/** * v2.1 Phase 4g — stable, machine-readable error codes for tool responses. * * Every tool that returns `{ success: false, error: "..." }` also returns an * `error_code: ""` picked from this catalog. Clients branch on the * code (stable across versions) instead of string-matching the `error` text * (which we rephrase freely for UX polish). * * Stability guarantee * ─────────────────── * • Codes here are FOREVER. Never remove or rename within a major version. * • Additions are a MINOR-version change (new optional code; old clients * ignore it, new clients branch on it). * • Removals / renames are MAJOR — they break every client in the field. * * Add a new code: * 1. Append to ERROR_CODES below with a one-line comment. * 2. Wire at least one handler to emit it. * 3. Add a test. Add a row in docs/error-codes.md. * 4. Consider whether to bump PROTOCOL_VERSION (MINOR) at release time. */ export declare const ERROR_CODES: { /** Missing / invalid / mismatched agent_token. Includes signature failures. */ readonly AUTH_FAILED: "AUTH_FAILED"; /** Caller is authenticated but lacks the capability required by the tool. */ readonly CAP_DENIED: "CAP_DENIED"; /** spawn_agent / register_agent where a row with that name already exists. */ readonly NAME_COLLISION: "NAME_COLLISION"; /** v2.1.3 — register_agent blocked because an active row with this name is * held by a different session and the caller's token does not match. */ readonly NAME_COLLISION_ACTIVE: "NAME_COLLISION_ACTIVE"; /** v2.1.3 — send_message from an agent whose row no longer exists (e.g. * deleted by relay recover / unregister_agent between dispatcher auth and * handler write). Caller should re-register before retrying. */ readonly SENDER_NOT_REGISTERED: "SENDER_NOT_REGISTERED"; /** v2.1.4 (I11) — expand_capabilities called with a new_capabilities list * that would REMOVE one of the agent's existing caps. This tool is additive- * only; operators must unregister + re-register for reductions. */ readonly REDUCTION_NOT_ALLOWED: "REDUCTION_NOT_ALLOWED"; /** v2.1.4 (I11) — expand_capabilities called with a new_capabilities list * that is a subset of the current caps (no new caps to add). Returned * explicitly so callers notice and don't silently churn. */ readonly NO_OP_EXPANSION: "NO_OP_EXPANSION"; /** Task / message / channel / agent / webhook not found. */ readonly NOT_FOUND: "NOT_FOUND"; /** Creating something that already exists (e.g. create_channel). */ readonly ALREADY_EXISTS: "ALREADY_EXISTS"; /** v2.1 Phase 4k — caller is not from/to_agent on a task they're reading. */ readonly NOT_PARTY: "NOT_PARTY"; /** Caller is not a member of the channel they're posting/reading. */ readonly NOT_MEMBER: "NOT_MEMBER"; /** Zod / shape / format failure. */ readonly VALIDATION: "VALIDATION"; /** Exceeds RELAY_MAX_PAYLOAD_BYTES or similar size cap. */ readonly PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE"; /** CAS write lost a race — re-read and retry. */ readonly CONCURRENT_UPDATE: "CONCURRENT_UPDATE"; /** ADR-0012 — a force TAKEOVER lost its compare-and-swap: the row's * session_id no longer equals the caller's expected_session_id (another * relaunch won, or the row went live). The caller MUST re-read (its LIVE gate * then skips) and surface loudly — NEVER retry-force, NEVER come up mute. */ readonly FORCE_PRECONDITION_FAILED: "FORCE_PRECONDITION_FAILED"; /** State-transition violation (e.g., cancel a completed task). */ readonly INVALID_STATE: "INVALID_STATE"; /** Rate-limit bucket exceeded. */ readonly RATE_LIMITED: "RATE_LIMITED"; /** v2.1 Phase 4e — webhook URL or DNS resolution in blocked range. */ readonly SSRF_REFUSED: "SSRF_REFUSED"; /** v2.1 Phase 4c.3 — import schema_version mismatches relay. */ readonly SCHEMA_MISMATCH: "SCHEMA_MISMATCH"; /** v2.10 — a schema-gated task's completion result did not conform to the task's registered JSON Schema (RELAY_SCHEMA_GATING=enforce). */ readonly RESULT_SCHEMA_VIOLATION: "RESULT_SCHEMA_VIOLATION"; /** v2.1 Phase 2c — restore refused while relay daemon appears to be running. */ readonly DAEMON_RUNNING: "DAEMON_RUNNING"; /** * The requested tool exists in the codebase but is hidden by the active * profile's feature_bundles / tool_visibility. Returned from tools/call; * the MCP tools/list response already omits hidden tools. Response * includes a `hint` pointing at the profile that would expose the tool. */ readonly TOOL_NOT_AVAILABLE: "TOOL_NOT_AVAILABLE"; /** Unexpected failure. Should be rare; indicates an actual bug. */ readonly INTERNAL: "INTERNAL"; }; export type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES]; //# sourceMappingURL=error-codes.d.ts.map