/** * Agent-spawn facade: routes a thread's agent type to the right per-agent spawn * module (claude-spawn / copilot-spawn / codex-spawn) and owns the cross-agent * orchestration (state-machine transitions, keep-alive reconciliation at boot). * * The per-agent CLI resolvers and spawn functions are re-exported so existing * importers keep a single entry point. */ import { type AgentType } from "../config/index.js"; import { type Database } from "../data/memory/schema.js"; import { type ThreadLifecycleService } from "./thread-lifecycle.service.js"; import { type SpawnResult } from "./spawn-common.js"; export { resolveClaudePath, spawnAgentProcess } from "./claude-spawn.service.js"; export { resolveCopilotPath, spawnCopilotProcess } from "./copilot-spawn.service.js"; export { resolveCodexPath, spawnCodexProcess } from "./codex-spawn.service.js"; /** * Resolve the right spawn function for `agentType` and call it. * Handles CLI path resolution and error reporting internally. * * When `db` is provided and the thread is in `Created` state, transitions * Created → Spawning before the process starts, then Spawning → Active on * success. This implements the explicit state machine for newly registered * threads without affecting existing restart flows (Exited/Active → Active). */ export declare function dispatchSpawn(agentType: AgentType, name: string, threadId: number, threadLifecycle: ThreadLifecycleService, workingDirectory?: string, memorySourceThreadId?: number, runtimeThreadType?: "worker" | "branch", db?: Database): Promise; export declare function spawnKeepAliveThreads(threadLifecycle: ThreadLifecycleService): Promise<{ spawned: number; errors: string[]; }>; //# sourceMappingURL=agent-spawn.service.d.ts.map