import { type ToolError } from '@opensip-cli/core'; export declare const EXIT_CODES: { readonly SUCCESS: 0; readonly RUNTIME_ERROR: 1; readonly CONFIGURATION_ERROR: 2; readonly CHECK_NOT_FOUND: 3; readonly REPORT_FAILED: 4; /** * A plugin was rejected by the compatibility gate (launch) — its * declared `apiVersion` is out of range and it was explicitly requested * (fail-closed; the skip path is silent). Dedicated rather than reusing * `CONFIGURATION_ERROR` so an incompatible plugin is diagnosable from the * exit code alone. Read by the CLI fail-closed admission path (Phase 3). */ readonly PLUGIN_INCOMPATIBLE: 5; }; /** * Canonical mapping from typed `ToolError` subclasses to CLI exit * codes. This is the single source of truth for how typed errors flow * into the process exit code — both the CLI's top-level * `handleParseError` and any tool that chooses to handle its own * `ToolError` locally route through this function. * * The mapping policy (see `Tool` interface JSDoc in * `@opensip-cli/core` for the full contract): * * - `NotFoundError` → `CHECK_NOT_FOUND` (exit 3) * - `ConfigurationError` → `CONFIGURATION_ERROR` (exit 2) * - `ValidationError` → `CONFIGURATION_ERROR` (exit 2) * - `NetworkError` → `REPORT_FAILED` (exit 4) * - `PluginIncompatibleError`→ `PLUGIN_INCOMPATIBLE` (exit 5) * - `TimeoutError` → `RUNTIME_ERROR` (exit 1) * - any other `ToolError` → `RUNTIME_ERROR` (exit 1) */ export declare function mapToolErrorToExitCode(error: ToolError): number; /** * Human-readable diagnosis for untyped errors. Advice only — exit codes come from * typed {@link mapToolErrorToExitCode}, Commander, or bootstrap errors. */ export interface ErrorSuggestion { message: string; action?: string; } /** * LAST-RESORT message/action advice for UNSTRUCTURED errors — a bare `Error`/string * with no type to map from. The typed {@link mapToolErrorToExitCode} is * authoritative for any `ToolError`; untyped errors always exit `RUNTIME_ERROR`. * Returns null if no rule fires. */ export declare function getErrorSuggestion(err: unknown): ErrorSuggestion | null; //# sourceMappingURL=exit-codes.d.ts.map