"use strict";
/**
 * CCS Error Handling Module
 *
 * Centralized error handling system for CCS CLI providing:
 * - Standardized exit codes
 * - Custom error types with exit code mapping
 * - Centralized error handler with cleanup
 * - Cleanup callback registry
 *
 * @example
 * ```typescript
 * import { handleError, ConfigError, ExitCode, registerCleanup } from './errors';
 *
 * // Register cleanup for spawned process
 * registerCleanup(() => proxy.kill());
 *
 * // Throw typed error
 * throw new ConfigError('Invalid config file', '~/.ccs/config.json');
 *
 * // Or handle directly
 * handleError(new NetworkError('Connection refused'));
 * ```
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.createCleanupScope = exports.hasCleanupRun = exports.getCleanupCount = exports.clearCleanup = exports.runCleanup = exports.registerCleanup = exports.assertOrExit = exports.withErrorHandling = exports.exitWithSuccess = exports.exitWithError = exports.handleError = exports.isRecoverableError = exports.isCCSError = exports.RetryableError = exports.ValidationError = exports.UserAbortError = exports.MigrationError = exports.ProxyError = exports.ProfileError = exports.ProviderError = exports.BinaryError = exports.AuthError = exports.NetworkError = exports.ConfigError = exports.CCSError = exports.isRecoverable = exports.isSuccess = exports.EXIT_CODE_DESCRIPTIONS = exports.ExitCode = void 0;
// Exit codes
var exit_codes_1 = require("./exit-codes");
Object.defineProperty(exports, "ExitCode", { enumerable: true, get: function () { return exit_codes_1.ExitCode; } });
Object.defineProperty(exports, "EXIT_CODE_DESCRIPTIONS", { enumerable: true, get: function () { return exit_codes_1.EXIT_CODE_DESCRIPTIONS; } });
Object.defineProperty(exports, "isSuccess", { enumerable: true, get: function () { return exit_codes_1.isSuccess; } });
Object.defineProperty(exports, "isRecoverable", { enumerable: true, get: function () { return exit_codes_1.isRecoverable; } });
// Error types
var error_types_1 = require("./error-types");
Object.defineProperty(exports, "CCSError", { enumerable: true, get: function () { return error_types_1.CCSError; } });
Object.defineProperty(exports, "ConfigError", { enumerable: true, get: function () { return error_types_1.ConfigError; } });
Object.defineProperty(exports, "NetworkError", { enumerable: true, get: function () { return error_types_1.NetworkError; } });
Object.defineProperty(exports, "AuthError", { enumerable: true, get: function () { return error_types_1.AuthError; } });
Object.defineProperty(exports, "BinaryError", { enumerable: true, get: function () { return error_types_1.BinaryError; } });
Object.defineProperty(exports, "ProviderError", { enumerable: true, get: function () { return error_types_1.ProviderError; } });
Object.defineProperty(exports, "ProfileError", { enumerable: true, get: function () { return error_types_1.ProfileError; } });
Object.defineProperty(exports, "ProxyError", { enumerable: true, get: function () { return error_types_1.ProxyError; } });
Object.defineProperty(exports, "MigrationError", { enumerable: true, get: function () { return error_types_1.MigrationError; } });
Object.defineProperty(exports, "UserAbortError", { enumerable: true, get: function () { return error_types_1.UserAbortError; } });
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return error_types_1.ValidationError; } });
Object.defineProperty(exports, "RetryableError", { enumerable: true, get: function () { return error_types_1.RetryableError; } });
Object.defineProperty(exports, "isCCSError", { enumerable: true, get: function () { return error_types_1.isCCSError; } });
Object.defineProperty(exports, "isRecoverableError", { enumerable: true, get: function () { return error_types_1.isRecoverableError; } });
// Error handler
var error_handler_1 = require("./error-handler");
Object.defineProperty(exports, "handleError", { enumerable: true, get: function () { return error_handler_1.handleError; } });
Object.defineProperty(exports, "exitWithError", { enumerable: true, get: function () { return error_handler_1.exitWithError; } });
Object.defineProperty(exports, "exitWithSuccess", { enumerable: true, get: function () { return error_handler_1.exitWithSuccess; } });
Object.defineProperty(exports, "withErrorHandling", { enumerable: true, get: function () { return error_handler_1.withErrorHandling; } });
Object.defineProperty(exports, "assertOrExit", { enumerable: true, get: function () { return error_handler_1.assertOrExit; } });
// Cleanup registry
var cleanup_registry_1 = require("./cleanup-registry");
Object.defineProperty(exports, "registerCleanup", { enumerable: true, get: function () { return cleanup_registry_1.registerCleanup; } });
Object.defineProperty(exports, "runCleanup", { enumerable: true, get: function () { return cleanup_registry_1.runCleanup; } });
Object.defineProperty(exports, "clearCleanup", { enumerable: true, get: function () { return cleanup_registry_1.clearCleanup; } });
Object.defineProperty(exports, "getCleanupCount", { enumerable: true, get: function () { return cleanup_registry_1.getCleanupCount; } });
Object.defineProperty(exports, "hasCleanupRun", { enumerable: true, get: function () { return cleanup_registry_1.hasCleanupRun; } });
Object.defineProperty(exports, "createCleanupScope", { enumerable: true, get: function () { return cleanup_registry_1.createCleanupScope; } });
//# sourceMappingURL=index.js.map