import { type AutonomousSpawnOptions } from "./autonomous.js"; import type { AcpEvent, SpawnOptions, SpawnResult, SpawnRetryOptions } from "./types.js"; /** * Spawns an agent with optional streaming. * * Returns both: * - `events`: an async stream of ACP events (empty when the provider doesn't support streaming) * - `result`: a promise resolving to the final SpawnResult * * @example * ```typescript * import { spawn } from "poe-code" * * const { events, result } = spawn("codex", "Fix the bug in auth.ts") * * for await (const e of events) { * // render or log events * } * * const final = await result * console.log(final.exitCode) * ``` */ export declare function spawn(service: string, prompt: string, options?: Omit): SpawnHandle; export declare function spawn(service: string, options: SpawnOptions): SpawnHandle; export declare namespace spawn { var pretty: (service: string, promptOrOptions: string | SpawnOptions, maybeOptions?: Omit) => Promise; var autonomous: (service: string, promptOrOptions: string | Omit, maybeOptions?: Omit) => Promise; var parallel: (calls: import("../../packages/agent-spawn/dist/index.js").SpawnParallelCall[], options?: import("../../packages/agent-spawn/dist/index.js").SpawnParallelOptions) => Promise; var retry: (service: string, options: SpawnOptions, retryOptions: SpawnRetryOptions) => { events: AsyncIterable; result: Promise; }; } type SpawnHandle = { events: AsyncIterable; result: Promise; unstable_setSessionModel?(model: string): Promise; }; export {};