/** * auto-yes Command - Control auto-yes for a worktree * Issue #518: [DR1-08] Factory pattern * Issue #4436: an enable the server's tool policy refuses (409 TOOL_POLICY_DENIED) * exits 33 (ToolPolicyExitCode.DENIED) with the reason on the first stderr line */ import { Command } from 'commander'; import type { AutoYesContractPolicy } from '../types/api-responses'; /** Issue #3863: `--answer-mode`'s help, shared with `send --auto-yes-answer-mode`. */ export declare const ANSWER_MODE_OPTION_DESCRIPTION: string; /** * Issue #3863: the stderr line naming the answer mode Auto-Yes is on with, or * null when there is nothing to say. Read off the response — an omitted mode * is resolved by the server (a grant that is on keeps its mode), so the CLI * cannot know it otherwise. * * Said when the mode was asked for, or when it is not the default * (`recommended`) — a re-enable that kept `careful`, say. An enable that asked * for nothing and got the default prints what it printed before the modes * (the output scripts already read); `capture --json`, `instances --json` and * the response's `answerMode` carry the mode in every case. * * @param answerMode - `answerMode` of the auto-yes POST (absent from older servers) * @param requested - Whether the command named a mode */ export declare function describeAnswerMode(answerMode: string | undefined, requested: boolean): string | null; /** * Issue #3863: validate an answer-mode option value, exiting 2 on a bad one. * * @param flag - The option's spelling, for the message */ export declare function validateAnswerModeOption(value: string | undefined, flag: string): void; /** * The stderr line(s) describing what the contract on the armed instance lets * Auto-Yes answer (Issue #3723), or an empty list when there is nothing to say. * * `mode: 'off'` is a warning: the poller just armed will answer no prompt at * all, and before this the only trace of that was `capture --json`'s * `autoYes.lastSuppression`, written once a prompt had already sat unanswered. * `safe` / `allow-listed` still answer some prompts, so they get one line that * names which. No contract, or one that states no mode, prints nothing — the * output is what it was. * * Shared with `send --auto-yes`, so the two ways of arming say the same thing. * Neither changes the exit code: arming did succeed, and a script that checks * `$?` must not start failing on a contract the operator chose. * * @param policy - `contractPolicy` from the auto-yes POST (absent from older servers) */ export declare function describeContractPolicy(policy: AutoYesContractPolicy | null | undefined): string[]; /** * Issue #4436: the stderr lines for an arming the server's tool policy refused, or * null when `error` is anything else (which keeps its own message and exit code). * * Only a 409 carrying `code: TOOL_POLICY_DENIED`: the code alone on another status * is not this refusal. The first line is the reason (the server's sentence, or * the same sentence from the shared module when the body had none), so a script * that reads one line of stderr gets it. */ export declare function describeToolPolicyDenial(error: unknown): string[] | null; export declare function createAutoYesCommand(): Command; //# sourceMappingURL=auto-yes.d.ts.map