/** * The six autopilot questions, asked by `aidlc autopilot setup` and by `aidlc init` * from this one place so the two can never offer different choices * (init-sets-work-mode/AC-8, AC-20; the two stop questions are * autopilot-stop-controls/AC-7). * * Init adds two things setup does not need: each question pre-selects the answer * already in force, and an answer no choice matches is offered as "(current)" and * left untouched when chosen. Without that, somebody pressing Enter through a re-run * would silently replace a hand-set $20 cap with the recommended $15 * (init-sets-work-mode/AC-9, AC-10). * * @module */ import type { Prompter } from '../core/prompt.js'; import { type ReleasePreset } from './presets.js'; import { type AutopilotConfig, type AutopilotPaths } from './state.js'; import type { TeamDefaults } from './team.js'; /** The option value meaning "keep the current answer, wherever it lives". */ export declare const KEEP = "__current__"; export interface AutopilotPicks { /** A preset id, `custom`, or {@link KEEP}. */ agent: string; /** The typed argv when `agent` is `custom`. */ customCommand: string[] | null; /** `1`, `2`, or {@link KEEP}. */ parallel: string; /** A cost-cap choice value (`none` included), or {@link KEEP}. */ costCap: string; /** Pause flag text (`requirements,design`, `none`, …), or {@link KEEP}. */ pauses: string; /** `pr`, `merge`, `release`, or {@link KEEP}. */ stopAt: string; /** A release preset id, or {@link KEEP}. */ release: string; } export type Slot = 'agent' | 'parallel' | 'costCap' | 'pauses' | 'stopAt' | 'release'; export interface Preselect { initial: Record; /** Label of the current answer for a slot no listed choice matches. */ extras: Partial>; } export declare const recommended: (choices: readonly T[]) => T; export declare function recommendedPreselect(releases: readonly ReleasePreset[]): Preselect; /** * Each answer in force: the machine's where it sets one, else the team's, else the * recommended choice (init-sets-work-mode/AC-9). Team values were validated on load, * so only a machine value can fail to match a choice. */ export declare function currentPreselect(machine: AutopilotConfig | null, team: TeamDefaults, releases: readonly ReleasePreset[]): Preselect; /** * `--non-interactive --autopilot`: every answer already in force, in either file, is * kept; only a missing one takes the recommended choice (init-sets-work-mode/AC-14). */ export declare function fillMissingPicks(machine: AutopilotConfig | null, team: TeamDefaults, releases: readonly ReleasePreset[]): AutopilotPicks; /** * The six questions. The stop questions come after the cost cap and before the * release step, which is what "merge and run the release step" runs * (autopilot-stop-controls/AC-7). `pre.extras` only appends a "(current)" choice. * * Returns null on any cancel. */ export declare function askAutopilotQuestions(prompt: Prompter, releases: readonly ReleasePreset[], pre: Preselect): Promise; /** What init saves, and where. */ export interface InitWrites { machine: Partial; dropFromMachine: ('cost_cap_usd' | 'cost_cap_tokens' | 'release_command' | 'pause_after' | 'stop_at')[]; team: TeamDefaults; /** Plain names of what was saved, for the summary (init-sets-work-mode/AC-19). */ saved: { machine: string[]; team: string[]; }; } /** * Route each answer to its home: the agent and parallelism to this machine only, the * cost cap, the stops and the release step to the team. Saving a team answer drops this machine's * own copy, or the answer just given would do nothing here because the machine * overrides the team. A KEEP writes and drops nothing * (init-sets-work-mode/AC-16, AC-17, AC-18). */ export declare function planInitWrites(picks: AutopilotPicks): InitWrites; /** * Apply the machine half. Keys the plan does not name — `template`, anything a later * version adds — survive. Returns whether the file was written. */ export declare function applyMachineWrites(p: AutopilotPaths, w: InitWrites): boolean; //# sourceMappingURL=questions.d.ts.map