import { AGENT_METHODS, CLIENT_METHODS } from "@agentclientprotocol/sdk"; import type { AuthCapabilities, AuthMethod, AuthMethodAgent, AuthMethodTerminal, ClientCapabilities } from "@agentclientprotocol/sdk"; import { LOADED_TURN_QUERY_METHOD, SESSION_STEERING_METHOD } from "./acp-client.js"; type ValueOf = T[keyof T]; type ClientMethod = ValueOf; type AgentMethod = ValueOf; export type ClientMethodCoverage = "served" | "pending"; /** `guarded` means the raw passthrough would create/reopen session state outside the router, so * the client rejects it until a driven wrapper can route updates, permissions, and terminals. */ export type AgentMethodCoverage = "driven" | "passthrough" | "guarded"; /** Enforceable definition of "full ACP spec support": every SDK method constant is classified * here, and the tripwire test fails when an SDK bump silently widens or shrinks the protocol. * Agent side: 16 operational methods are driven (plus initialize), 0 are guarded, and the * passthrough remainder is nes/*, document/*, and mcp/message. The raw escape hatch remains * blocked for session-stateful new/load/resume/fork even though each has a driven wrapper. */ export declare const CLIENT_METHOD_COVERAGE: Readonly>; export declare const AGENT_METHOD_COVERAGE: Readonly>; /** Compile-time assertion primitive: `Expect` only accepts `true`, so a `false` (drifted) SDK * shape is a type error at build time. */ type Expect = T; /** `ClientCapabilities.auth` still exists and is typed as `AuthCapabilities` (§1.2 UNSTABLE pin). */ export type _AuthKeyExists = Expect<"auth" extends keyof ClientCapabilities ? true : false>; /** `AuthCapabilities.terminal` is still the typed boolean gate §1.2 assigns to (no `as` cast). */ export type _AuthTerminalIsBoolean = Expect; /** The exact property set SDK 1.2.1 types on `AuthCapabilities` (§1.2). The runtime tripwire below * asserts `clientCapabilitiesFor({ auth })` emits ONLY these keys, so a bump that widens/renames * the shape trips the coverage suite. */ export declare const AUTH_CAPABILITY_KEYS: readonly string[]; /** Runtime drift assertion (§4.6.4 item 1): every key on the advertised `ClientCapabilities.auth` * block is a pinned SDK-1.2.1 `AuthCapabilities` key. Throws on drift, tripping the build. A * `null`/absent `auth` (the default-OFF baseline) is vacuously conformant. Reads only structural * keys — never any advertised value — so it is secret-free. */ export declare function assertAuthCapabilityShape(auth: ClientCapabilities["auth"]): void; /** The two `AuthMethod` variants the base dispatcher handles (`agent`/`terminal`, §1.3). `agent` is * the default when `type` is absent (`AuthMethodAgent` carries no `type`). ACP schema 1.21.0 * (`@agentclientprotocol/sdk` 1.4.0) removed the former `env_var` variant * (agentclientprotocol/agent-client-protocol #1796/#2000); the tripwires below are retargeted to the * two-variant union and additionally pin that `env_var` stays absent. */ export declare const HANDLED_AUTH_METHOD_TYPES: readonly ["agent", "terminal"]; /** §4.6.4 item 3 — the SDK `AuthMethod` union is EXACTLY the two variants the dispatcher handles; * a third variant (a widened union) makes this `false` and fails `tsc`. */ export type _AuthMethodUnionPinned = Expect<[ AuthMethod ] extends [AuthMethodAgent | AuthMethodTerminal] ? true : false>; /** The `terminal` discriminant is still the literal the dispatcher branches on: the SDK intersects the * bare method type with `{ type: "…" }` in the `AuthMethod` union, so a dropped discriminant makes * `Extract` collapse to `never` and fails `tsc`. */ export type _AuthMethodTerminalDiscriminant = Expect<[ Extract ] extends [never] ? false : true>; /** The removed `env_var` discriminant must STAY absent: if a future SDK reintroduces it, this fails * `tsc` so the dispatcher/descriptor decision is re-made consciously, never by silent widening. */ export type _AuthMethodEnvVarAbsent = Expect<[ Extract ] extends [never] ? true : false>; /** The cross-agent `_meta` key conventions the base layer keys on (§1 intro; recognized by literal * name, NOT SDK schema fields). `gateway` ⇒ in-process classification; `terminal-auth` ⇒ terminal * launch hint; `api-key` ⇒ codex's disk api-key `_meta`. */ export declare const AUTH_META_CONVENTION_KEYS: { readonly gateway: "gateway"; readonly terminalAuth: "terminal-auth"; readonly apiKey: "api-key"; }; /** The codex startup pre-auth env channel delivered by `codexAuthProfile.spawnAuthEnv` (§2.8/§3.3). */ export declare const CODEX_SPAWN_AUTH_ENV: "DEFAULT_AUTH_REQUEST"; /** JSON-RPC `-32000` is reserved EXCLUSIVELY for `authRequired` (SDK `jsonrpc.js:818-823`) — the * guarantee the code-only §1.5 matcher relies on (§4.6.4 item 5). */ export declare const ACP_AUTH_REQUIRED_CODE_EXCLUSIVE: -32000; /** Frozen pi-acp wire surface consumed by the first-class backend. Keeping these literals in the * executable protocol-coverage module makes capability/auth/error drift visible in tests instead * of leaving the built-in coupled only through prose. */ export declare const PI_ACP_PROTOCOL_CONTRACT: { readonly mcpCapabilities: { readonly http: true; readonly sse: true; }; readonly authMethodIds: readonly ["pi-stored-credentials"]; readonly providerErrorKinds: readonly ["auth_error", "rate_limit", "billing_error", "provider_error"]; }; /** One row of the §3.6 full `_meta` support matrix, landed as executable data (not prose) so an * SDK/agent bump that changes a `_meta` surface trips the drift suite (§4.6.4 item 4). */ export interface AuthMetaMatrixRow { readonly agent: string; /** A stable literal that MUST still be present in the cited artifact/spec — the drift anchor. */ readonly capability: string; /** Wire direction: A→C agent→client, C→A client→agent, C↔A both, — none, agent-internal. */ readonly direction: "A→C" | "C→A" | "C↔A" | "—" | "agent-internal"; /** Every published row describes behavior delivered and verified by the current implementation. */ readonly status: "supported-today"; /** When set, the literal is asserted present in this backend's INSTALLED dist (claude/codex only; * opencode ships a compiled binary with no consumable source — §3.4, grounded by live-e2e). */ readonly distProbe?: "claude" | "codex"; } export declare const AUTH_META_MATRIX: readonly AuthMetaMatrixRow[]; /** One executable disposition for a vendor extension that is intentionally absent from the * standard SDK AGENT_METHODS table. `typed-unsupported` means the public wrapper exists and * rejects from initialize negotiation before emitting a wire request. The loaded-turn * extension (turn-terminal state for loaded sessions) is only served by the two in-repo * servers (pi-acp, codex-acp); claude and opencode do not advertise it — the seam then * classifies the loaded session's founding turn through the OBSERVATION path instead (the * post-load continuation watch plus the replay probe under the connection-death contract — * see `InteractiveSession.awaitCurrentTurn`; phase-F review round 2: the old degradation * released the loaded session and re-issued the call, which can duplicate a still-running * turn; a possibly-running call is never re-issued). The replay classification is restricted * to the VERIFIED BUILT-IN instances (`connectionDeathVerified`) — a custom backend's quiet * observation window is not terminal evidence and degrades to the keep-attached * still-running wait (phase-F review round 3). */ export interface AcpExtensionSupportMatrixRow { readonly agent: string; readonly method: typeof SESSION_STEERING_METHOD | typeof LOADED_TURN_QUERY_METHOD; readonly disposition: "supported" | "typed-unsupported" | "not-advertised"; /** Installed distributions whose method + initialize advertisement are probed by the protocol * coverage suite. Pi is workspace-owned and covered in its package tests instead. */ readonly distProbe?: "claude" | "codex"; } /** Built-in support for non-standard agent request methods. Kept separate from * AGENT_METHOD_COVERAGE so a vendor extension is never counted as a standard ACP method. */ export declare const ACP_EXTENSION_SUPPORT_MATRIX: readonly AcpExtensionSupportMatrixRow[]; /** One built-in's reference to universal ACP classifications and backend-specific live evidence. */ export interface BuiltinProtocolCoverageRow { readonly clientMethods: Readonly>; readonly agentMethods: Readonly>; readonly authMeta: readonly AuthMetaMatrixRow[]; readonly extensions: readonly AcpExtensionSupportMatrixRow[]; readonly installedDistProbes: readonly string[]; readonly liveProbes: readonly string[]; } /** Central backend dispositions. Registry tests enforce exact key and reference parity. */ export declare const BUILTIN_PROTOCOL_COVERAGE: Readonly<{ claude: BuiltinProtocolCoverageRow; codex: BuiltinProtocolCoverageRow; opencode: BuiltinProtocolCoverageRow; pi: BuiltinProtocolCoverageRow; }>; export {}; //# sourceMappingURL=protocol-coverage.d.ts.map