import type { AcpEvent, SpawnOptions, SpawnResult, SpawnMode, spawn as agentSpawn } from "../../../agent-spawn/dist/index.js"; import type { TaskList } from "../../../task-list/dist/index.js"; export interface SpawnCall { agent: string; prompt: string; model?: string; mode?: SpawnMode; cwd?: string; signal?: AbortSignal; skills?: string[]; logDir?: string; logFileName?: string; hooks?: SpawnOptions["hooks"]; } export type MockSpawnStep = { kind: "emit"; event: AcpEvent; } | { kind: "exit"; exitCode: number; } | { kind: "throw"; error: "abort" | "activity_timeout" | "agent_startup_error" | "agent_crashed" | Error; } | { kind: "wait"; ms: number; ignoreAbort?: boolean; } | { kind: "block"; } | { kind: "run"; fn: (call: SpawnCall) => void | Promise; } | { kind: "assert"; fn: (call: SpawnCall) => void; }; export type MockSpawnScripts = Record | ((call: SpawnCall) => MockSpawnStep[] | undefined); export interface MockSpawnOptions { cwdExists?: (cwd: string) => boolean; afterResult?: (result: MockSpawnResult, call: SpawnCall) => void | Promise; } export type MockSpawnResult = SpawnResult & { events: AcpEvent[]; }; export interface MockSpawn { spawn: typeof agentSpawn; calls: SpawnCall[]; clock: { now(): number; }; } export type MockTaskScriptAction = { kind: "complete"; } | { kind: "fail"; } | { kind: "exit"; exitCode: number; } | { kind: "block"; }; export interface MockTaskScriptSpawnOptions { list?: string; } export declare function createMockSpawn(scripts?: MockSpawnScripts, options?: MockSpawnOptions): MockSpawn; export declare function createTaskScriptSpawn(taskList: TaskList, scripts: Record, options?: MockTaskScriptSpawnOptions): MockSpawn;