/** * skill command guards — confirmation contract and typed error mapping * Issue #1237: `commandmate skill` is a thin client over the Skill APIs, so the * only safety logic that belongs here is the part the server cannot enforce: * whether *this invocation* is allowed to ask for a write at all. */ import { ApiError } from '../utils/api-client'; /** * Validate a Skill ID before it is interpolated into a request path. * The server validates it again; this only turns a typo into exit 2 instead of * a request carrying an arbitrary path segment. */ export declare function isValidSkillId(id: string): boolean; /** * Print a refusal on stderr and set the process exit code. * * Callers must `return` immediately afterwards: process.exit is stubbed in * tests, so anything written after this line would still run — and, for a write * command, would still reach the API. */ export declare function refuse(message: string, exitCode: number): void; /** Exit code for a failed Skill API call. */ export declare function skillExitCode(error: ApiError): number; /** * Report a failed skill subcommand. * * Everything goes to stderr, including the typed code and any blocker paths, so * a `--json` run that fails emits nothing at all on stdout rather than a * half-written or error-shaped document. */ export declare function handleSkillCommandError(error: unknown): void; /** How the confirmation requirement was settled. Only `confirmed` may write. */ export type ConfirmationOutcome = 'confirmed' | 'declined' | 'non_interactive'; /** * Decide whether this invocation may proceed to a write. * * A non-TTY without `--yes` is refused rather than assumed: an environment that * cannot show a prompt is exactly the one where an implicit yes would install * something nobody watched. */ export declare function resolveWriteConfirmation(question: string, options: { yes?: boolean; }): Promise; /** * Whether `--ack-risk` names exactly this Skill and version. * * Deliberately an exact value rather than a flag: `--yes` is a blanket "don't * prompt me" that a wrapper script sets once and forgets, so it must not be * able to carry a high-risk install with it. Typing the id and version is the * acknowledgement. */ export declare function riskAcknowledgementMatches(ackRisk: string | undefined, skillId: string, version: string): boolean; //# sourceMappingURL=skill-guards.d.ts.map