import type { CommandResult } from "./process-runner"; /** Thrown by command funnels so the index wrapper can attribute the failure stage + drain once. */ export type CliErrorClass = "invalid_input" | "filesystem" | "authentication" | "dependency" | "peer_dependency" | "registry_auth" | "network" | "package_compatibility" | "workspace_config" | "install_script" | "process" | "user_cancelled" | "generation" | "unknown"; export type CliErrorMetadata = { duration_ms?: number; exit_code?: number; failure_signal?: NodeJS.Signals; http_status?: number; cancellation_exit_code?: number; auth_failure_stage?: string; }; export declare class CreateError extends Error { stage: string; errorClass: CliErrorClass; errorCode: string; errorMetadata: CliErrorMetadata; constructor(stage: string, message: string, errorClass?: CliErrorClass, errorCode?: string, errorMetadata?: CliErrorMetadata); } export declare class CliCancelledError extends CreateError { exitCode: number; constructor(stage: string, exitCode?: number, metadata?: CliErrorMetadata); } export type CliErrorProperties = CliErrorMetadata & { failure_stage: string; error_class: CliErrorClass; error_code: string; }; /** Return only bounded values; never forward an error message or stack. */ export declare function cliErrorProperties(error: unknown, fallback?: CliErrorProperties): CliErrorProperties; export declare function processErrorProperties(result: CommandResult, failureStage: string, fallback: Pick): CliErrorProperties; /** Throw a typed CLI error (or cancellation) from a failed child process. */ export declare function throwCommandFailure(result: CommandResult, stage: string, message: string, fallback?: Pick): never; //# sourceMappingURL=errors.d.ts.map