/** * ZCode subprocess client: the zcode dialect over the shared JSON-RPC transport. * * The ZCode app-server is launched as a subprocess (`zcode app-server --stdio`) * speaking line-delimited JSON over stdio. It deliberately omits the `jsonrpc` * field (its strict validator rejects it — see AGENTS.md), and pushes events * via the `session/event` notification plus `state.updated` settings patches. * * The generic transport (read-loop multiplexer, pending-request map, watchdog, * process-group lifecycle) lives in {@link JsonRpcChild}; this class only * supplies the zcode dialect. */ import { type BackendCapabilities, type ServerRequest } from "./adapter.js"; import { JsonRpcChild } from "./jsonrpc-child.js"; export type { EventListener, ServerRequest } from "./adapter.js"; export declare class ZcodeBackend extends JsonRpcChild { readonly capabilities: BackendCapabilities; /** * Arrival-time responder for `interaction/requestProviderRuntimeHeaders`. * The backend asks before EVERY model request on a zhipu-account provider, * and a request that lands while no turn loop is polling the server-request * queue (compact's internal turn, session/goal set, any backend-owned * generation) dies at the backend's 180s cap as "Captcha verification * request timed out" — auto-compact silently failed that way (observed * 2026-09-19). Wired by ZcodeAcpServer.ensureBackend to the coding-plan key * answer; returning false falls back to queueing (turn-loop handling). */ providerRuntimeHeadersResponder?: (id: number, params: Record) => boolean; /** * Arrival-time hook for compact terminal states. `session/compact` runs its * internal turn in the background and NEVER reports failure on the RPC — * the outcome only surfaces as a `state.updated` notification whose reason * is one of `session_compacted` / `session_compact_cancelled` / * `session_compact_failed` (source: server-operations.ts * `runCompactTurnInBackground` → `afterStateMutation`). Wired by * ZcodeAcpServer.ensureBackend to record per-session outcomes so compact() * can report real failure instead of assuming success from the RPC ack. */ onCompactOutcome?: (sessionId: string, reason: string) => void; constructor(argv: string[], env: NodeJS.ProcessEnv); protected handleNotification(method: string, params: Record): void; protected handleServerRequest(req: ServerRequest): boolean; } //# sourceMappingURL=client.d.ts.map