import { QueueController, type QueuePorts } from "./headless.ts"; import type { QueueBoundary } from "./protocol.ts"; export interface PiRpcCommand { id: string; type: string; [key: string]: unknown; } export interface PiRpcResponse { type: "response"; id?: string; command: string; success: boolean; error?: string; } export interface PiRpcQueueOptions { /** Construction requires explicit ownership. Do not mix native queued input with this owner. */ owned: true; request(command: PiRpcCommand, signal?: AbortSignal): Promise; command?: QueuePorts["command"]; /** Server-side graceful pause, acknowledged only after the run parks. */ gracefulPause?: QueuePorts["gracefulPause"]; persist?: QueuePorts["persist"]; } /** Native RPC has no row-edit protocol. Keep rich rows here until native acceptance. */ export declare function createPiRpcQueuePorts(options: PiRpcQueueOptions): QueuePorts; /** Normalize the public Pi RPC event stream. Does not inspect transcript text for gate completion. * Call dispatch at the returned boundary. For exact mid-run timing use the server extension * hooks; client-side RPC delivery necessarily reaches the next available native boundary. */ export declare function observePiRpcQueueEvent(controller: QueueController, value: unknown, contextWindow?: number): QueueBoundary | undefined;