export interface RunScriptDeps { error: (msg: string) => void; exit: (code: number) => never; } /** * Wraps a script's main function with consistent error handling and * exit-code mapping. ScriptError subclasses exit with their specific * exitCode; any other thrown value exits 1 with a generic message. * * The function may be sync or async. Returns a promise that resolves * before exit() is called for the failure path; on success the promise * simply resolves (exit() is not invoked — caller can let process end * naturally with code 0). */ export declare function runScript(deps: RunScriptDeps, fn: () => void | Promise): Promise;