/** * spawner - launch and manage pi subagent child processes. * * Each subagent runs as an independent `pi --print` child process. * The parent parses JSON Lines events from stdout to track progress, * collect token usage, and capture the final result. */ import type { SpawnSubagentOptions, SubagentHandle, RunSubagentOptions, MailboxMessage } from "./types.js"; /** * Read new mailbox messages from an outbox file starting at the given byte * offset. Returns parsed messages and the new offset to use on the next call. * * Business (#101): Only complete lines (terminated by \n) are consumed. * A partial trailing line (mid-write, no \n yet) is held back — the offset * only advances to the last \n boundary, so the partial content is re-read * on the next poll once the writer completes the line. This prevents * messages from being silently swallowed when the file is read mid-write. */ export declare function readNewMailboxLines(filePath: string, offset: number): { messages: MailboxMessage[]; newOffset: number; }; /** * Launch a new subagent child process. * * The child runs `pi --print` with the given task. The parent reads * JSON Lines from stdout and accumulates usage + final result. * * On abort, sends SIGTERM (then SIGKILL after 5s grace). */ export declare function spawnSubagent(opts: SpawnSubagentOptions): Promise; /** * Resume an existing subagent by re-spawning with a resume prompt. */ export declare function resumeSubagent(agentId: string, opts: RunSubagentOptions): Promise; /** * Retry a failed subagent with the same agentId. */ export declare function retrySubagent(agentId: string, opts: RunSubagentOptions): Promise; /** * Delete a temporary system prompt file created by runSubagentProcess. * Best-effort: ignores errors if the file is already gone. * Exported for testing. (#190) */ export declare function cleanupTempSystemPrompt(filePath: string | undefined): void; //# sourceMappingURL=spawner.d.ts.map