UNPKG

browser-debugger-cli

Version:

DevTools telemetry in your terminal. For humans and agents. Direct WebSocket to Chrome's debugging port.

71 lines 2.71 kB
/** * Semantic exit codes for agent-friendly error handling. * * **STABILITY: These exit codes are part of bdg's stable public API.** * * Exit codes follow semantic ranges for predictable automation: * - **0**: Success (command completed successfully) * - **1**: Generic failure (backward compatibility, avoid in new code) * - **80-99**: User errors (invalid input, permissions, resource issues) * - **100-119**: Software errors (bugs, integration failures, timeouts) * * **Versioning guarantees:** * - Exit code values are **stable** and will not change in minor versions * - New exit codes may be added in minor versions (within existing ranges) * - Existing codes will only be removed in major versions with deprecation notice * - Exit code semantics (meaning) will remain consistent across versions * * **For automation users:** * - Check specific exit codes (e.g., 83 for "resource not found") * - Use ranges for category detection (80-99 = user error, 100-119 = software error) * - Exit code 0 guarantees success, non-zero indicates failure * * **Migration policy:** * - Deprecated codes will be documented in CHANGELOG.md with migration path * - Deprecated codes will remain functional for at least one major version * * Reference: https://developer.squareup.com/blog/command-line-observability-with-semantic-exit-codes/ */ /** * Exit code constants following semantic ranges. * * **These values are stable API** - use confidently in automation scripts. */ export declare const EXIT_CODES: { readonly SUCCESS: 0; readonly GENERIC_FAILURE: 1; readonly INVALID_URL: 80; readonly INVALID_ARGUMENTS: 81; readonly PERMISSION_DENIED: 82; readonly RESOURCE_NOT_FOUND: 83; readonly RESOURCE_ALREADY_EXISTS: 84; readonly RESOURCE_BUSY: 85; readonly DAEMON_ALREADY_RUNNING: 86; readonly STALE_CACHE: 87; readonly NO_FORMS_FOUND: 88; readonly FORM_IN_IFRAME: 89; readonly CHROME_LAUNCH_FAILURE: 100; readonly CDP_CONNECTION_FAILURE: 101; readonly CDP_TIMEOUT: 102; readonly SESSION_FILE_ERROR: 103; readonly UNHANDLED_EXCEPTION: 104; readonly SIGNAL_HANDLER_ERROR: 105; readonly SOFTWARE_ERROR: 110; }; /** * Exit code registry entry with code, name, and description. */ interface ExitCodeEntry { readonly code: number; readonly name: string; readonly description: string; } /** * Exit code registry - provides documentation for all exit codes. * * This registry is derived from EXIT_CODES to ensure consistency. * Used by help --json for machine-readable documentation. */ export declare const EXIT_CODE_REGISTRY: readonly ExitCodeEntry[]; export {}; //# sourceMappingURL=exitCodes.d.ts.map