import type { AgentStepExecutor, AgentStepRequest, AgentStepSubmission } from "../workflows/types.js"; export interface SupervisedProcessRegistry { register(pid: number): unknown | Promise; unregister(pid: number): unknown | Promise; } export type RpcStepExecutorOptions = { cwd: string; registry?: SupervisedProcessRegistry; /** Start a separate process group, or inherit the caller's process group. */ processGroup?: "own" | "inherit"; /** Grace period before a process group receives SIGKILL. */ abortGraceMs?: number; /** Absolute path to the pi binary; defaults to the installed `pi`. */ piBin?: string; /** Extra environment for the child; the server's environment is inherited. */ env?: Record; /** Extra pi arguments, for example a model override. */ piArgs?: string[]; /** Park assistant-message nodes for a visible origin session. */ assistantMessageMode?: "park"; }; /** * Runs agent steps in a headless `pi --mode rpc` child. One child serves one * workflow run. The rpc-bridge extension inside the child registers the * `workflow` tool and reports submissions over stderr; this executor * validates them through `request.accept` and re-prompts on rejection, so * the model sees the same tool contract as an in-session run. */ export declare class RpcStepExecutor implements AgentStepExecutor { readonly assistantMessageMode: "park" | "unsupported"; private readonly options; private child; private childExited; private stderrBuffer; private actions; private submissionWaiters; private stdoutBuffer; private registeredPid; private closePromise; constructor(options: RpcStepExecutorOptions); runAgentStep(request: AgentStepRequest, signal: AbortSignal): Promise; /** Stop the child process tree, then unregister its exact group leader. */ close(): Promise; private closeChild; private currentExit; private ensureStarted; private unregisterChild; private promptForSubmission; private takeMatchingAction; private sendAbortQuietly; private wakeSubmissionWaiters; }