"use strict";
/**
 * CLI Common Type Definitions
 * Issue #96: npm install CLI support
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.WaitExitCode = exports.ExitCode = void 0;
exports.getErrorMessage = getErrorMessage;
/**
 * Exit codes for CLI commands
 * NTH-4: DRY - centralized exit code definitions
 */
var ExitCode;
(function (ExitCode) {
    ExitCode[ExitCode["SUCCESS"] = 0] = "SUCCESS";
    ExitCode[ExitCode["DEPENDENCY_ERROR"] = 1] = "DEPENDENCY_ERROR";
    ExitCode[ExitCode["CONFIG_ERROR"] = 2] = "CONFIG_ERROR";
    ExitCode[ExitCode["START_FAILED"] = 3] = "START_FAILED";
    ExitCode[ExitCode["STOP_FAILED"] = 4] = "STOP_FAILED";
    ExitCode[ExitCode["UNEXPECTED_ERROR"] = 99] = "UNEXPECTED_ERROR";
})(ExitCode || (exports.ExitCode = ExitCode = {}));
/**
 * Wait command exit codes
 * Issue #518: [DR2-01] ERROR: 1 removed (conflicts with ExitCode.DEPENDENCY_ERROR).
 * Infrastructure errors use ExitCode; wait-specific results use WaitExitCode.
 */
exports.WaitExitCode = {
    SUCCESS: 0,
    PROMPT_DETECTED: 10,
    TIMEOUT: 124,
};
/**
 * Extract error message from unknown error
 * Issue #125: DRY - centralized error message extraction
 *
 * @param error - Unknown error object
 * @returns Error message string
 */
function getErrorMessage(error) {
    if (error instanceof Error) {
        return error.message;
    }
    return String(error);
}
