/** * Structured error model for the Lamina CLI. * * Conventions, modeled on `gh`, `vercel`, `stripe`: * - Exit 0 → success * - Exit 1 → runtime error (auth failed, network down, server error, etc.) * - Exit 2 → invalid CLI usage (bad flag, missing arg, malformed input) * * Every CLI-thrown error should be a `LaminaCliError` with: * - a short summary line (the `message`) * - an actionable `suggestion` line (what the user should try next) * - an optional `docsUrl` for the relevant guide * - an `exitCode` (1 or 2) * - an internal `code` for programmatic categorisation */ export declare const EXIT: { readonly SUCCESS: 0; readonly RUNTIME_ERROR: 1; readonly INVALID_USAGE: 2; }; export type LaminaCliErrorCode = 'auth_invalid_key' | 'auth_not_logged_in' | 'auth_timeout' | 'auth_denied' | 'auth_invalid_callback' | 'auth_state_mismatch' | 'auth_dcr_failed' | 'auth_token_exchange_failed' | 'invalid_argument' | 'network_unreachable' | 'not_found' | 'server_error' | 'unknown_subcommand' | 'unknown'; export interface LaminaCliErrorOptions { message: string; code: LaminaCliErrorCode; exitCode?: 1 | 2; suggestion?: string; docsUrl?: string; cause?: unknown; /** * Structured server-side details for the error (e.g. validation error * field list). Surfaced in --json output so coding agents can read each * `errors[].field` and self-correct on retry without re-parsing the * human-readable message. */ details?: unknown; } export declare class LaminaCliError extends Error { readonly code: LaminaCliErrorCode; readonly exitCode: 1 | 2; readonly suggestion?: string; readonly docsUrl?: string; readonly details?: unknown; constructor(options: LaminaCliErrorOptions); } export declare function classifyError(err: unknown): LaminaCliError; export declare function printCliError(err: LaminaCliError): void;