Files
claude-hud/dist/extra-cmd.d.ts
2026-03-20 00:42:28 +00:00

23 lines
956 B
TypeScript

export interface ExtraLabel {
label: string;
}
/**
* Sanitize output to prevent terminal escape injection.
* Strips ANSI escapes, OSC sequences, control characters, and bidi controls.
*/
export declare function sanitize(input: string): string;
/**
* Parse --extra-cmd argument from process.argv
* Supports both: --extra-cmd "command" and --extra-cmd="command"
*/
export declare function parseExtraCmdArg(argv?: string[]): string | null;
/**
* Execute a command and parse JSON output expecting { label: string }
* Returns null on any error (timeout, parse failure, missing label)
*
* SECURITY NOTE: The cmd parameter is sourced exclusively from CLI arguments
* (--extra-cmd) typed by the user. Since the user controls their own shell,
* shell injection is not a concern here - it's intentional user input.
*/
export declare function runExtraCmd(cmd: string, timeout?: number): Promise<string | null>;
//# sourceMappingURL=extra-cmd.d.ts.map