/** * Process exit codes for the pr-shepherd CLI. * * Three bands: * 0 done — shepherd finished and the PR is in a good terminal state * 10-19 shepherd RAN successfully; the code reports PR state * 64-78 shepherd FAILED (BSD `sysexits.h` codes) * * Caller rule: `$? >= 64` means shepherd itself failed. `0` or `10-19` means it * ran to completion and is reporting PR state. See docs/exit-codes.md. */ import type { IterateResult } from "./types.mts"; export declare const EXIT: Readonly<{ /** `cancel` + `merged` or `ready-delay-elapsed` — shepherd finished cleanly. */ readonly OK: 0; /** Nothing to do yet; CI still in progress. */ readonly WAIT: 10; /** Draft PR converted to ready for review. */ readonly MARK_READY: 11; /** Agent work required. */ readonly FIX_CODE: 12; /** Human attention required. */ readonly ESCALATE: 13; /** `cancel` + `closed` — PR closed without merging. */ readonly CLOSED: 14; /** Agent should run the emitted merge or queue command. */ readonly MERGE: 15; /** Aggregate stack has PRs to shepherd through one-PR sessions. */ readonly SHEPHERD: 16; /** Bad/unknown flag, unknown subcommand, missing required arg, invalid duration. */ readonly USAGE: 64; /** Malformed caller data: bad `--require-sha`, `PRRC_*` IDs, bad repo string. */ readonly DATAERR: 65; /** Input file/stdin could not be read. */ readonly NOINPUT: 66; /** Precondition unmet: no open PR for branch, thread not eligible, unclassified 4xx. */ readonly UNAVAILABLE: 69; /** Unexpected/unclassified internal error — the fallback. */ readonly SOFTWARE: 70; /** Retryable GitHub failure: 429, 5xx, rate limit exhausted, Retry-After, GraphQL INTERNAL. */ readonly TEMPFAIL: 75; /** GitHub 401/403 — missing token or insufficient PAT scopes. */ readonly NOPERM: 77; /** `.pr-shepherdrc.yml` validation failure. */ readonly CONFIG: 78; }>; /** An error that carries its own exit code, so the top-level handler doesn't have to guess. */ export declare class ShepherdError extends Error { readonly exitCode: number; constructor(message: string, exitCode: number, opts?: { cause?: unknown; }); } export declare function iterateResultToExitCode(result: IterateResult): number; export declare function errorToExitCode(err: unknown): number;