/** * Standardized exit codes following gh CLI convention. * * 0 = Success * 1 = General error * 2 = Cancelled (e.g., Ctrl+C, user cancelled prompt) * 4 = Authentication required */ import { type StructuredError } from './output.js'; import type { TerminationReason } from './telemetry-types.js'; export declare const ExitCode: { readonly SUCCESS: 0; readonly GENERAL_ERROR: 1; readonly CANCELLED: 2; readonly AUTH_REQUIRED: 4; }; export type ExitCodeValue = (typeof ExitCode)[keyof typeof ExitCode]; export declare function resolveErrorCode(code: string): { reason: TerminationReason; exit: ExitCodeValue; }; /** Exit with a specific code, optionally writing a structured error first. */ export declare function exitWithCode(code: ExitCodeValue, error?: StructuredError): never; /** * Convenience: exit with code 4 and auth-required error. * * Recovery hints are inferred from interaction mode unless explicitly provided. */ export declare function exitWithAuthRequired(message?: string, options?: { recovery?: StructuredError['recovery']; }): never;