Brings the deterministic Han-flow conductor into BooCode: launch any read-only flow from BooChat or BooCoder, watch each agent stream live in a Paseo-style run pane, get an evidence-disciplined report — on local Qwen, persisted and resumable. Read-only enforced hard via qwen --approval-mode plan (orchestrator tasks fail closed if qwen is unavailable; never fall to write-capable native). Backend (apps/coder): re-homed conductor defs, flow_runs/flow_steps schema, flow-runner + dispatcher onTaskTerminal hook, restart-resume, runs routes (launch/list/get/cancel), user-channel WS. Contracts: two flow_run_* frames. Web: orchestrator pane kind + OrchestratorPane, Workflow button + slash flows (BooChat/BooCoder parity), FlowLauncherDialog, "New Orchestrator" in the + and split menus, runs history + export. Plan: openspec/changes/orchestrator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
13 lines
522 B
TypeScript
13 lines
522 B
TypeScript
import { readFile } from 'node:fs/promises';
|
|
import { dirname, join } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
export const AGENTS_DIR = join(HERE, 'agents');
|
|
|
|
/** Load a Han agent persona — the markdown body after the YAML frontmatter. */
|
|
export async function loadPersona(agent: string): Promise<string> {
|
|
const md = await readFile(join(AGENTS_DIR, `${agent}.md`), 'utf8');
|
|
return md.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/, '').trim();
|
|
}
|