import type { RpcResponse } from "./rpc-types.ts"; interface PendingRequest { /** True once the child announced it owns this request (`engine_request_accepted`). */ accepted: boolean; resolve(response: RpcResponse): void; reject(error: Error): void; } /** * In-flight RPC requests and their ownership state. * * Ownership decides whether a submission may be returned to the editor after * the transport dies: a request the child never took is still the user's text, * while one it had already started may have run side effects. Output cannot * answer that — a command can finish, having changed the working tree, and * print nothing. */ export declare class RpcPendingRequests { private readonly pending; get size(): number; add(id: string, handlers: Omit): void; has(id: string): boolean; delete(id: string): void; /** Record the child's admission frame for a request that is still in flight. */ markAccepted(id: string): void; /** Deliver a response, if the request is still ours to settle. */ resolve(id: string, response: RpcResponse): boolean; /** * Fail everything in flight after transport loss. * * Accepted requests get their own copy of the failure, marked accepted, so a * single engine exit can reject an accepted and an unaccepted request with * honest, different classifications. */ rejectAll(error: Error): void; } export {}; //# sourceMappingURL=rpc-pending-requests.d.ts.map