/** * CLI Utility Functions * * Shared utilities used by CLI command modules: * - CliExitError: error class for centralized process.exit at CLI boundary * - getSkillCacheEnv: environment setup for skill scripts * - spawnAndWait: spawn child process and wait for completion * - runPrWatchLoop: foreground polling loop for PR watch */ import type { IPrPollOptions, IPrPollResult } from '../application/handlers'; /** * Error class for signaling a CLI exit with a specific code. * * Throw this from command modules instead of calling process.exit() directly. * The top-level CLI runner catches it, prints any message, and exits. * * Usage: * - `throw new CliExitError(1, 'Something failed')` — prints message, exits 1 * - `throw new CliExitError(1)` — exits 1 with no additional output */ export declare class CliExitError extends Error { readonly exitCode: number; constructor(exitCode: number, message?: string); } export interface IPrWatchLoopOptions { handler: { poll: (options: IPrPollOptions) => Promise; }; pollOptions: IPrPollOptions; intervalMinutes: number; json: boolean; printResult: (result: IPrPollResult) => void; stopOnResolved: boolean; } export declare function getSkillCacheEnv(skillName: string): NodeJS.ProcessEnv; /** * Spawn a child process and wait for it to complete. * Returns a promise that resolves when the process exits successfully, * or rejects on error or non-zero exit code. */ export declare function spawnAndWait(scriptPath: string, args: string[], env?: NodeJS.ProcessEnv): Promise; export declare function runPrWatchLoop(options: IPrWatchLoopOptions): Promise; //# sourceMappingURL=cli-utils.d.ts.map