import { type ChildProcessWithoutNullStreams } from "node:child_process"; import type { ActorCapabilities } from "./actor-contract.js"; import type { CuaProvider, CuaTurn } from "./computer-use.js"; import type { ReasoningEffort } from "./reasoning-effort.js"; type JsonObject = Record; /** The transport, injected so tests drive a fake server with no CLI and no spend. */ export interface AppServerTransport { request(method: string, params: JsonObject): Promise; notify(method: string, params: JsonObject): void; /** Resolves when the named notification arrives after the current turn began. */ awaitNotification(method: string, timeoutMs: number): Promise; close(): void; } /** Newline-delimited JSON-RPC over the child's stdio — the framing codex-app-server.ts uses. */ export declare function stdioTransport(child: ChildProcessWithoutNullStreams): AppServerTransport; export interface AppServerProviderOptions { /** Absent = spawn `codex app-server`. Injected in tests. */ transport?: AppServerTransport; model?: string; reasoningEffort?: ReasoningEffort; /** Per-turn wall clock. */ timeoutMs?: number; cwd?: string; /** The persona/mission, set ONCE on the thread instead of re-sent every turn. */ baseInstructions?: string; } export declare const APP_SERVER_CAPABILITIES: ActorCapabilities; /** The reply shape a turn is constrained to. Strict mode: every property in `required`. */ export declare function turnOutputSchema(): JsonObject; export interface AppServerSession { provider: CuaProvider; /** Ends the thread and the process. The run owns the lifetime, not the provider. */ close(): void; } /** * Start a thread and return a provider that spends it, one `turn/start` per computer-use turn. * * The thread is started EAGERLY (before the first screenshot) so the ~500ms handshake is paid * while the sandbox is still booting rather than inside turn one. */ export declare function startAppServerSession(options?: AppServerProviderOptions): Promise; /** Read a `turn/completed` notification into a CuaTurn. Exported for tests. */ export declare function turnFromNotification(note: JsonObject): CuaTurn; export {};