/** * The one exit-code table for the whole binary. * * The previous contract was 0/1 only (every failure path returned 1, bad * usage inherited commander's 1), while docs/CLI-AGENT-FRIENDLY.md claimed a * different set of meanings for 2-5 that was never implemented. Both are * replaced by this table; docs/CLI-EXIT-CODE-MATRIX.md is the human copy. * * Codes exist so an agent can branch without parsing prose. The JSON * outcome's `code` field carries the finer-grained reason. */ import { CliOutcomeStatus } from "./cli-types.js"; export declare const CliExitCode: { /** Done. */ readonly OK: 0; /** Failed for a reason no other code names. */ readonly FAILURE: 1; /** Bad usage: unknown command, unknown option, missing argument. */ readonly USAGE: 2; /** No grant, or the grant does not cover this. */ readonly NO_GRANT: 3; /** Payment required and not settled. */ readonly PAYMENT_REQUIRED: 4; /** No server holding this data answered (incl. owner not ready). */ readonly SERVER_UNAVAILABLE: 5; /** Not ready yet, come back. */ readonly NOT_READY: 6; /** A person has to confirm before this can proceed. */ readonly CONFIRMATION_REQUIRED: 7; }; export type CliExitCode = (typeof CliExitCode)[keyof typeof CliExitCode]; /** * Exit code for an owner-side outcome status. * * Only statuses with an unambiguous slot in the table map to a distinct * code; the rest stay {@link CliExitCode.FAILURE} with the status itself in * the JSON payload. Success statuses map to OK. */ export declare function exitCodeForOutcome(status: CliOutcomeStatus): CliExitCode; /** * Protocol-level error classes the builder command group maps onto the * table. Keys are the stable `code` values emitted in JSON outcomes. */ export declare const PROTOCOL_EXIT_MAP: Record; /** Lowercase and strip the transport prefixes real SDK codes carry. */ export declare function normalizeProtocolCode(code: string): string; export declare function exitCodeForProtocolCode(code: string): CliExitCode; //# sourceMappingURL=exit-codes.d.ts.map