@rasensio/aidlc 1.55.0 → 1.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,84 @@
1
+ /**
2
+ * The four autopilot questions, asked by `aidlc autopilot setup` and by `aidlc init`
3
+ * from this one place so the two can never offer different choices
4
+ * (init-sets-work-mode/AC-8, AC-20).
5
+ *
6
+ * Init adds two things setup does not need: each question pre-selects the answer
7
+ * already in force, and an answer no choice matches is offered as "(current)" and
8
+ * left untouched when chosen. Without that, somebody pressing Enter through a re-run
9
+ * would silently replace a hand-set $20 cap with the recommended $15
10
+ * (init-sets-work-mode/AC-9, AC-10).
11
+ *
12
+ * @module
13
+ */
14
+ import type { Prompter } from '../core/prompt.js';
15
+ import { type ReleasePreset } from './presets.js';
16
+ import { type AutopilotConfig, type AutopilotPaths } from './state.js';
17
+ import type { TeamDefaults } from './team.js';
18
+ /** The option value meaning "keep the current answer, wherever it lives". */
19
+ export declare const KEEP = "__current__";
20
+ export interface AutopilotPicks {
21
+ /** A preset id, `custom`, or {@link KEEP}. */
22
+ agent: string;
23
+ /** The typed argv when `agent` is `custom`. */
24
+ customCommand: string[] | null;
25
+ /** `1`, `2`, or {@link KEEP}. */
26
+ parallel: string;
27
+ /** A cost-cap choice value (`none` included), or {@link KEEP}. */
28
+ costCap: string;
29
+ /** A release preset id, or {@link KEEP}. */
30
+ release: string;
31
+ }
32
+ export type Slot = 'agent' | 'parallel' | 'costCap' | 'release';
33
+ export interface Preselect {
34
+ initial: Record<Slot, string>;
35
+ /** Label of the current answer for a slot no listed choice matches. */
36
+ extras: Partial<Record<Slot, string>>;
37
+ }
38
+ export declare const recommended: <T extends {
39
+ label: string;
40
+ }>(choices: readonly T[]) => T;
41
+ export declare function recommendedPreselect(releases: readonly ReleasePreset[]): Preselect;
42
+ /**
43
+ * Each answer in force: the machine's where it sets one, else the team's, else the
44
+ * recommended choice (init-sets-work-mode/AC-9). Team values were validated on load,
45
+ * so only a machine value can fail to match a choice.
46
+ */
47
+ export declare function currentPreselect(machine: AutopilotConfig | null, team: TeamDefaults, releases: readonly ReleasePreset[]): Preselect;
48
+ /**
49
+ * `--non-interactive --autopilot`: every answer already in force, in either file, is
50
+ * kept; only a missing one takes the recommended choice (init-sets-work-mode/AC-14).
51
+ */
52
+ export declare function fillMissingPicks(machine: AutopilotConfig | null, team: TeamDefaults, releases: readonly ReleasePreset[]): AutopilotPicks;
53
+ /**
54
+ * The four questions. Messages and choices are exactly what `aidlc autopilot setup`
55
+ * has always asked; `pre.extras` only appends a "(current)" choice.
56
+ *
57
+ * Returns null on any cancel.
58
+ */
59
+ export declare function askAutopilotQuestions(prompt: Prompter, releases: readonly ReleasePreset[], pre: Preselect): Promise<AutopilotPicks | null>;
60
+ /** What init saves, and where. */
61
+ export interface InitWrites {
62
+ machine: Partial<AutopilotConfig>;
63
+ dropFromMachine: ('cost_cap_usd' | 'release_command')[];
64
+ team: TeamDefaults;
65
+ /** Plain names of what was saved, for the summary (init-sets-work-mode/AC-19). */
66
+ saved: {
67
+ machine: string[];
68
+ team: string[];
69
+ };
70
+ }
71
+ /**
72
+ * Route each answer to its home: the agent and parallelism to this machine only, the
73
+ * cost cap and release step to the team. Saving a team answer drops this machine's
74
+ * own copy, or the answer just given would do nothing here because the machine
75
+ * overrides the team. A KEEP writes and drops nothing
76
+ * (init-sets-work-mode/AC-16, AC-17, AC-18).
77
+ */
78
+ export declare function planInitWrites(picks: AutopilotPicks): InitWrites;
79
+ /**
80
+ * Apply the machine half. Keys the plan does not name — `template`, anything a later
81
+ * version adds — survive. Returns whether the file was written.
82
+ */
83
+ export declare function applyMachineWrites(p: AutopilotPaths, w: InitWrites): boolean;
84
+ //# sourceMappingURL=questions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../src/autopilot/questions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,Q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e,GAAG,IAAI,EAC/B,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,SAAS,aAAa,EAAE,GACjC,cAAc,CAUhB;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,GAAG,EAAE,SAAS,GACb,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAgDhC;AAED,kCAAkC;AAClC,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAClC,eAAe,EAAE,CAAC,cAAc,GAAG,iBAAiB,CAAC,EAAE,CAAC;IACxD,IAAI,EAAE,YAAY,CAAC;IACnB,kFAAkF;IAClF,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CA+BhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAQ5E"}
@@ -0,0 +1,195 @@
1
+ /**
2
+ * The four autopilot questions, asked by `aidlc autopilot setup` and by `aidlc init`
3
+ * from this one place so the two can never offer different choices
4
+ * (init-sets-work-mode/AC-8, AC-20).
5
+ *
6
+ * Init adds two things setup does not need: each question pre-selects the answer
7
+ * already in force, and an answer no choice matches is offered as "(current)" and
8
+ * left untouched when chosen. Without that, somebody pressing Enter through a re-run
9
+ * would silently replace a hand-set $20 cap with the recommended $15
10
+ * (init-sets-work-mode/AC-9, AC-10).
11
+ *
12
+ * @module
13
+ */
14
+ import { AGENT_PRESETS, COST_CAP_CHOICES, PARALLEL_CHOICES, agentPreset } from './presets.js';
15
+ import { loadConfig, saveConfig } from './state.js';
16
+ /** The option value meaning "keep the current answer, wherever it lives". */
17
+ export const KEEP = '__current__';
18
+ export const recommended = (choices) => choices.find((c) => c.label.includes('(recommended)')) ?? choices[0];
19
+ export function recommendedPreselect(releases) {
20
+ return {
21
+ initial: {
22
+ agent: recommended(AGENT_PRESETS).id,
23
+ parallel: recommended(PARALLEL_CHOICES).value,
24
+ costCap: recommended(COST_CAP_CHOICES).value,
25
+ release: recommended(releases).id,
26
+ },
27
+ extras: {},
28
+ };
29
+ }
30
+ const sameArgv = (a, b) => Array.isArray(a) && a.length === b.length && a.every((v, i) => v === b[i]);
31
+ const display = (value) => (Array.isArray(value) ? value.join(' ') : String(value));
32
+ /**
33
+ * Each answer in force: the machine's where it sets one, else the team's, else the
34
+ * recommended choice (init-sets-work-mode/AC-9). Team values were validated on load,
35
+ * so only a machine value can fail to match a choice.
36
+ */
37
+ export function currentPreselect(machine, team, releases) {
38
+ const { initial } = recommendedPreselect(releases);
39
+ const extras = {};
40
+ const set = (slot, value, label) => {
41
+ if (value !== undefined)
42
+ initial[slot] = value;
43
+ else {
44
+ initial[slot] = KEEP;
45
+ extras[slot] = label;
46
+ }
47
+ };
48
+ const command = machine?.agent_command;
49
+ if (Array.isArray(command) && command.length > 0) {
50
+ set('agent', AGENT_PRESETS.find((a) => sameArgv(command, a.command))?.id, command.join(' '));
51
+ }
52
+ if (machine?.max_parallel !== undefined) {
53
+ const value = String(machine.max_parallel);
54
+ set('parallel', PARALLEL_CHOICES.find((c) => c.value === value)?.value, `${display(machine.max_parallel)} at once`);
55
+ }
56
+ const cap = machine !== null && 'cost_cap_usd' in machine ? machine.cost_cap_usd : team.cost_cap_usd;
57
+ if (cap !== undefined) {
58
+ const value = cap === null ? 'none' : String(cap);
59
+ set('costCap', COST_CAP_CHOICES.find((c) => c.value === value)?.value, typeof cap === 'number' ? `$${cap} per item` : display(cap));
60
+ }
61
+ if (machine !== null && 'release_command' in machine) {
62
+ const rc = machine.release_command;
63
+ const match = rc === null ? releases.find((r) => r.command === null) : releases.find((r) => r.command !== null && sameArgv(rc, r.command));
64
+ set('release', match?.id, display(rc));
65
+ }
66
+ else if (team.release !== undefined) {
67
+ initial.release = team.release;
68
+ }
69
+ return { initial, extras };
70
+ }
71
+ /**
72
+ * `--non-interactive --autopilot`: every answer already in force, in either file, is
73
+ * kept; only a missing one takes the recommended choice (init-sets-work-mode/AC-14).
74
+ */
75
+ export function fillMissingPicks(machine, team, releases) {
76
+ const rec = recommendedPreselect(releases).initial;
77
+ const command = machine?.agent_command;
78
+ return {
79
+ agent: Array.isArray(command) && command.length > 0 ? KEEP : rec.agent,
80
+ customCommand: null,
81
+ parallel: machine?.max_parallel !== undefined ? KEEP : rec.parallel,
82
+ costCap: (machine !== null && 'cost_cap_usd' in machine) || 'cost_cap_usd' in team ? KEEP : rec.costCap,
83
+ release: (machine !== null && 'release_command' in machine) || team.release !== undefined ? KEEP : rec.release,
84
+ };
85
+ }
86
+ /**
87
+ * The four questions. Messages and choices are exactly what `aidlc autopilot setup`
88
+ * has always asked; `pre.extras` only appends a "(current)" choice.
89
+ *
90
+ * Returns null on any cancel.
91
+ */
92
+ export async function askAutopilotQuestions(prompt, releases, pre) {
93
+ const withCurrent = (slot, options) => {
94
+ const label = pre.extras[slot];
95
+ return label === undefined ? options : [...options, { value: KEEP, label: `${label} (current)` }];
96
+ };
97
+ const agent = await prompt.select({
98
+ message: 'Which agent builds each item, and what may it do?',
99
+ options: withCurrent('agent', [
100
+ ...AGENT_PRESETS.map((a) => ({ value: a.id, label: a.label, hint: a.hint })),
101
+ { value: 'custom', label: 'Custom command — type it yourself' },
102
+ ]),
103
+ initialValue: pre.initial.agent,
104
+ });
105
+ if (!agent.ok)
106
+ return null;
107
+ let customCommand = null;
108
+ if (agent.value === 'custom') {
109
+ const text = await prompt.text({
110
+ message: 'Agent command, words separated by spaces; {prompt} marks where the prompt goes',
111
+ placeholder: 'my-agent run {prompt}',
112
+ validate: (v) => ((v ?? '').split(/\s+/).includes('{prompt}') ? undefined : 'the command must contain {prompt}'),
113
+ });
114
+ if (!text.ok)
115
+ return null;
116
+ customCommand = text.value.trim().split(/\s+/);
117
+ }
118
+ const parallel = await prompt.select({
119
+ message: 'How many items build at once?',
120
+ options: withCurrent('parallel', [...PARALLEL_CHOICES]),
121
+ initialValue: pre.initial.parallel,
122
+ });
123
+ if (!parallel.ok)
124
+ return null;
125
+ const cap = await prompt.select({
126
+ message: 'Stop an item when it has cost more than:',
127
+ options: withCurrent('costCap', [...COST_CAP_CHOICES]),
128
+ initialValue: pre.initial.costCap,
129
+ });
130
+ if (!cap.ok)
131
+ return null;
132
+ const release = await prompt.select({
133
+ message: 'After an item merges:',
134
+ options: withCurrent('release', releases.map((r) => ({ value: r.id, label: r.label, hint: r.hint }))),
135
+ initialValue: pre.initial.release,
136
+ });
137
+ if (!release.ok)
138
+ return null;
139
+ return { agent: agent.value, customCommand, parallel: parallel.value, costCap: cap.value, release: release.value };
140
+ }
141
+ /**
142
+ * Route each answer to its home: the agent and parallelism to this machine only, the
143
+ * cost cap and release step to the team. Saving a team answer drops this machine's
144
+ * own copy, or the answer just given would do nothing here because the machine
145
+ * overrides the team. A KEEP writes and drops nothing
146
+ * (init-sets-work-mode/AC-16, AC-17, AC-18).
147
+ */
148
+ export function planInitWrites(picks) {
149
+ const w = { machine: {}, dropFromMachine: [], team: {}, saved: { machine: [], team: [] } };
150
+ if (picks.agent !== KEEP) {
151
+ const preset = agentPreset(picks.agent);
152
+ if (picks.agent === 'custom' && picks.customCommand !== null) {
153
+ w.machine.agent_command = picks.customCommand;
154
+ w.machine.agent_platform = 'claude-code';
155
+ w.saved.machine.push('agent');
156
+ }
157
+ else if (preset !== undefined) {
158
+ w.machine.agent_command = preset.command;
159
+ w.machine.agent_platform = preset.platform;
160
+ w.saved.machine.push('agent');
161
+ }
162
+ }
163
+ if (picks.parallel !== KEEP) {
164
+ w.machine.max_parallel = Number(picks.parallel);
165
+ w.saved.machine.push('items at once');
166
+ }
167
+ if (picks.costCap !== KEEP) {
168
+ w.team.cost_cap_usd = picks.costCap === 'none' ? null : Number(picks.costCap);
169
+ w.dropFromMachine.push('cost_cap_usd');
170
+ w.saved.team.push('cost cap');
171
+ }
172
+ if (picks.release !== KEEP) {
173
+ // The preset name, never its command (AC-18).
174
+ w.team.release = picks.release;
175
+ w.dropFromMachine.push('release_command');
176
+ w.saved.team.push('release step');
177
+ }
178
+ return w;
179
+ }
180
+ /**
181
+ * Apply the machine half. Keys the plan does not name — `template`, anything a later
182
+ * version adds — survive. Returns whether the file was written.
183
+ */
184
+ export function applyMachineWrites(p, w) {
185
+ const existing = loadConfig(p);
186
+ const touchesExisting = existing !== null && w.dropFromMachine.some((k) => k in existing);
187
+ if (Object.keys(w.machine).length === 0 && !touchesExisting)
188
+ return false;
189
+ const next = { ...(existing ?? {}), ...w.machine };
190
+ for (const key of w.dropFromMachine)
191
+ delete next[key];
192
+ saveConfig(p, next);
193
+ return true;
194
+ }
195
+ //# sourceMappingURL=questions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions.js","sourceRoot":"","sources":["../../src/autopilot/questions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAsB,MAAM,cAAc,CAAC;AAClH,OAAO,EAAE,UAAU,EAAE,UAAU,EAA6C,MAAM,YAAY,CAAC;AAG/F,6EAA6E;AAC7E,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC;AAuBlC,MAAM,CAAC,MAAM,WAAW,GAAG,CAA8B,OAAqB,EAAK,EAAE,CACnF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;AAEvE,MAAM,UAAU,oBAAoB,CAAC,QAAkC;IACrE,OAAO;QACL,OAAO,EAAE;YACP,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,E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BAAgB,QAAQ,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,YAAY,CA4BpH;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAOlF;AAED,sCAAsC;AACtC,wBAAgB,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAKxF;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,IAAI,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,CAAC,EAAE,cAAc,EACjB,IAAI,EAAE;IACJ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,yFAAyF;IACzF,QAAQ,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CAC3E,EACD,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAAC,CAoDjD"}
@@ -14,6 +14,7 @@ import { dirname } from 'node:path';
14
14
  import { resumeFailed, tick } from './driver.js';
15
15
  import { identify } from './pause.js';
16
16
  import { clearRun, loadConfig, loadRun, loadState, saveRun, saveState, withLock, } from './state.js';
17
+ import { loadTeamDefaults, withTeamDefaults } from './team.js';
17
18
  export function isAlive(pid) {
18
19
  try {
19
20
  process.kill(pid, 0);
@@ -43,7 +44,9 @@ export function realCtx(repo, p, dryRun, say) {
43
44
  repo,
44
45
  cli: selfCli(),
45
46
  paths: p,
46
- config: loadConfig(p),
47
+ // Team defaults from the primary checkout's committed config sit under the
48
+ // machine's own (init-sets-work-mode/AC-21).
49
+ config: withTeamDefaults(loadConfig(p), loadTeamDefaults(repo), repo),
47
50
  dryRun,
48
51
  now: () => Date.now(),
49
52
  say,
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/autopilot/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,IAAI,EAA+B,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,QAAQ,EACR,UAAU,EACV,OAAO,EACP,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,GAGT,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,SAAS,CAAC,CAAiB;IACzC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,CAA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AAC,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC;gBACxE,GAAG,CAAC,GAAG,CAAC,iBAAiB,GAAG,CAAC,QAAQ,CAAC,MAAM,2BAA2B,CAAC,CAAC;gBACzE,OAAO,MAAM,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG;YAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC;AACH,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Team defaults for autopilot: the `autopilot:` section of the committed
3
+ * `.aidlc/config.yaml` (init-sets-work-mode/AC-21..AC-23).
4
+ *
5
+ * Only the cost cap and the release step are team decisions. The agent, its
6
+ * permissions and how many items build at once belong to the machine that runs
7
+ * them, so those keys are never read from a committed file — a clone must not be
8
+ * able to hand an agent full access on somebody else's machine.
9
+ *
10
+ * @module
11
+ */
12
+ import type { AutopilotConfig } from './state.js';
13
+ /**
14
+ * Preset names, never a command: a name resolved against `releasePresets` can only
15
+ * select a command the code already offers (init-sets-work-mode/AC-18).
16
+ */
17
+ export declare const TEAM_RELEASE_IDS: readonly ["repo-script", "merge-only"];
18
+ export type TeamReleaseId = (typeof TEAM_RELEASE_IDS)[number];
19
+ export interface TeamDefaults {
20
+ /** null = no cap. */
21
+ cost_cap_usd?: number | null;
22
+ release?: TeamReleaseId;
23
+ }
24
+ /**
25
+ * The validated `autopilot:` section of `<projectRoot>/.aidlc/config.yaml`. Never
26
+ * throws; a missing or unreadable file is no defaults.
27
+ *
28
+ * Invalid values are dropped rather than reported: this runs on every autopilot
29
+ * pass, and a warning repeated each minute in a background log is read after the
30
+ * run, not before it (init-sets-work-mode/AC-23).
31
+ */
32
+ export declare function loadTeamDefaults(projectRoot: string): TeamDefaults;
33
+ /**
34
+ * The config autopilot runs with: the machine's own over the team's, key by key.
35
+ *
36
+ * A key the machine sets wins even when its value is null (no cap, merge only), so
37
+ * the test is presence, not `??`. A machine with no config stays not set up whatever
38
+ * the repo says: only the machine names an agent (init-sets-work-mode/AC-21, AC-22).
39
+ */
40
+ export declare function withTeamDefaults(machine: AutopilotConfig | null, team: TeamDefaults, projectRoot: string): AutopilotConfig | null;
41
+ //# sourceMappingURL=team.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../src/autopilot/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,wCAAyC,CAAC;AACvE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,CAuBlE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,eAAe,GAAG,IAAI,EAC/B,IAAI,EAAE,YAAY,EAClB,WAAW,EAAE,MAAM,GAClB,eAAe,GAAG,IAAI,CASxB"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Team defaults for autopilot: the `autopilot:` section of the committed
3
+ * `.aidlc/config.yaml` (init-sets-work-mode/AC-21..AC-23).
4
+ *
5
+ * Only the cost cap and the release step are team decisions. The agent, its
6
+ * permissions and how many items build at once belong to the machine that runs
7
+ * them, so those keys are never read from a committed file — a clone must not be
8
+ * able to hand an agent full access on somebody else's machine.
9
+ *
10
+ * @module
11
+ */
12
+ import { existsSync, readFileSync } from 'node:fs';
13
+ import { join } from 'node:path';
14
+ import { parse as parseYaml } from 'yaml';
15
+ import { releasePresets } from './presets.js';
16
+ /**
17
+ * Preset names, never a command: a name resolved against `releasePresets` can only
18
+ * select a command the code already offers (init-sets-work-mode/AC-18).
19
+ */
20
+ export const TEAM_RELEASE_IDS = ['repo-script', 'merge-only'];
21
+ /**
22
+ * The validated `autopilot:` section of `<projectRoot>/.aidlc/config.yaml`. Never
23
+ * throws; a missing or unreadable file is no defaults.
24
+ *
25
+ * Invalid values are dropped rather than reported: this runs on every autopilot
26
+ * pass, and a warning repeated each minute in a background log is read after the
27
+ * run, not before it (init-sets-work-mode/AC-23).
28
+ */
29
+ export function loadTeamDefaults(projectRoot) {
30
+ const file = join(projectRoot, '.aidlc', 'config.yaml');
31
+ let section;
32
+ try {
33
+ if (!existsSync(file))
34
+ return {};
35
+ section = parseYaml(readFileSync(file, 'utf8'))?.autopilot;
36
+ }
37
+ catch {
38
+ return {};
39
+ }
40
+ if (typeof section !== 'object' || section === null || Array.isArray(section))
41
+ return {};
42
+ const raw = section;
43
+ const team = {};
44
+ const cap = raw.cost_cap_usd;
45
+ if (cap === null || (typeof cap === 'number' && Number.isFinite(cap) && cap > 0)) {
46
+ team.cost_cap_usd = cap;
47
+ }
48
+ // `releasePresets` offers `repo-script` only when the script exists, so the same
49
+ // lookup that resolves a name also refuses one that points at nothing.
50
+ if (typeof raw.release === 'string' && releasePresets(projectRoot).some((r) => r.id === raw.release)) {
51
+ team.release = raw.release;
52
+ }
53
+ return team;
54
+ }
55
+ /**
56
+ * The config autopilot runs with: the machine's own over the team's, key by key.
57
+ *
58
+ * A key the machine sets wins even when its value is null (no cap, merge only), so
59
+ * the test is presence, not `??`. A machine with no config stays not set up whatever
60
+ * the repo says: only the machine names an agent (init-sets-work-mode/AC-21, AC-22).
61
+ */
62
+ export function withTeamDefaults(machine, team, projectRoot) {
63
+ if (machine === null)
64
+ return null;
65
+ const base = {};
66
+ if ('cost_cap_usd' in team)
67
+ base.cost_cap_usd = team.cost_cap_usd;
68
+ if (team.release !== undefined) {
69
+ const preset = releasePresets(projectRoot).find((r) => r.id === team.release);
70
+ if (preset)
71
+ base.release_command = preset.command;
72
+ }
73
+ return { ...base, ...machine };
74
+ }
75
+ //# sourceMappingURL=team.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/autopilot/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,aAAa,EAAE,YAAY,CAAU,CAAC;AASvE;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;IACxD,IAAI,OAAgB,CAAC;IACrB,IAAI,CAAC;QACH,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,CAAC;QACjC,OAAO,GAAI,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAoC,EAAE,SAAS,CAAC;IACjG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IACzF,MAAM,GAAG,GAAG,OAAkC,CAAC;IAE/C,MAAM,IAAI,GAAiB,EAAE,CAAC;IAC9B,MAAM,GAAG,GA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's behalf.
41
41
  */
42
42
  export declare function runSetup(repo: string, p: AutopilotPaths, opts: SetupOptions, prompt?: Prompter): Promise<SetupOutcome>;
43
- /** `aidlc init --autopilot` and `aidlc autopilot setup` share this (AC-12). */
43
+ /**
44
+ * `aidlc autopilot setup`. `aidlc init` asks the same four questions through
45
+ * `askAutopilotQuestions` and saves the answers per home instead
46
+ * (init-sets-work-mode/AC-16, AC-20).
47
+ */
44
48
  export declare function setupCommand(opts: SetupOptions, prompt?: Prompter): Promise<number>;
45
49
  /**
46
50
  * `aidlc autopilot forget <instance>` — stop tracking an item finished or
@@ -1 +1 @@
1
- {"version":3,"file":"autopilot.d.ts","sourceRoot":"","sources":["../../src/commands/autopilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAuBnE,OAAO,EAQL,KAAK,eAAe,EAEpB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,uBAAuB,CAAC;AA2C/B,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAWjG;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,CAAC,EAAE,cAAc,EACjB,IAAI,EAAE,YAAY,EAClB,MAAM,GAAE,QAA0B,GACjC,OAAO,CAA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jC,OAAO,CAAC,YAAY,CAAC,CAwDvB;AAaD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,GAAE,QAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,CAa1G;AA6HD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqBlD;AAED,yGAAyG;AACzG,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM,EAAE,CAI9D;AAmCD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CA2E3D"}
@@ -22,6 +22,7 @@ import { resolveProjectRoot } from '../core/project-root.js';
22
22
  import { forgetItem, statusLines, tick } from '../autopilot/driver.js';
23
23
  import { AGENT_PRESETS, COST_CAP_CHOICES, PARALLEL_CHOICES, agentPreset, releasePresets, } from '../autopilot/presets.js';
24
24
  import { currentSystem, identify, livePause, pauseRun, pauseStatusLines, processTable, realPauseDeps, resumeRun, } from '../autopilot/pause.js';
25
+ import { askAutopilotQuestions, recommended } from '../autopilot/questions.js';
25
26
  import { activeRun, realCtx, runLoop, spawnLoopDetached, startRun } from '../autopilot/run.js';
26
27
  import { autopilotDir, autopilotPaths, loadConfig, loadState, saveConfig, saveState, withLock, } from '../autopilot/state.js';
27
28
  /** The primary checkout and the autopilot directory, or null outside a git repo. */
@@ -54,7 +55,6 @@ const PAUSED = 'the run is paused — `aidlc autopilot resume` continues it';
54
55
  const stamp = (line) => {
55
56
  process.stdout.write(`${new Date().toISOString()} ${line}\n`);
56
57
  };
57
- const recommended = (choices) => choices.find((c) => c.label.includes('(recommended)')) ?? choices[0];
58
58
  function parseCostCap(value) {
59
59
  if (value === 'none')
60
60
  return null;
@@ -86,43 +86,15 @@ export async function runSetup(repo, p, opts, prompt = defaultPrompter) {
86
86
  let customCommand = null;
87
87
  if (ask) {
88
88
  prompt.intro('aidlc autopilot setup');
89
- const agent = await prompt.select({
90
- message: 'Which agent builds each item, and what may it do?',
91
- options: [
92
- ...AGENT_PRESETS.map((a) => ({ value: a.id, label: a.label, hint: a.hint })),
93
- { value: 'custom', label: 'Custom command — type it yourself' },
94
- ],
95
- initialValue: agentId,
89
+ // Shared with `aidlc init` (init-sets-work-mode/AC-8). No "(current)" extras here:
90
+ // setup has always offered the plain lists and still does (AC-20).
91
+ const picks = await askAutopilotQuestions(prompt, releases, {
92
+ initial: { agent: agentId, parallel, costCap, release: releaseId },
93
+ extras: {},
96
94
  });
97
- if (!agent.ok)
95
+ if (picks === null)
98
96
  return { ok: false, reason: 'setup cancelled — nothing written' };
99
- agentId = agent.value;
100
- if (agentId === 'custom') {
101
- const text = await prompt.text({
102
- message: 'Agent command, words separated by spaces; {prompt} marks where the prompt goes',
103
- placeholder: 'my-agent run {prompt}',
104
- validate: (v) => ((v ?? '').split(/\s+/).includes('{prompt}') ? undefined : 'the command must contain {prompt}'),
105
- });
106
- if (!text.ok)
107
- return { ok: false, reason: 'setup cancelled — nothing written' };
108
- customCommand = text.value.trim().split(/\s+/);
109
- }
110
- const par = await prompt.select({ message: 'How many items build at once?', options: [...PARALLEL_CHOICES], initialValue: parallel });
111
- if (!par.ok)
112
- return { ok: false, reason: 'setup cancelled — nothing written' };
113
- parallel = par.value;
114
- const cap = await prompt.select({ message: 'Stop an item when it has cost more than:', options: [...COST_CAP_CHOICES], initialValue: costCap });
115
- if (!cap.ok)
116
- return { ok: false, reason: 'setup cancelled — nothing written' };
117
- costCap = cap.value;
118
- const rel = await prompt.select({
119
- message: 'After an item merges:',
120
- options: releases.map((r) => ({ value: r.id, label: r.label, hint: r.hint })),
121
- initialValue: releaseId,
122
- });
123
- if (!rel.ok)
124
- return { ok: false, reason: 'setup cancelled — nothing written' };
125
- releaseId = rel.value;
97
+ ({ agent: agentId, parallel, costCap, release: releaseId, customCommand } = picks);
126
98
  }
127
99
  const preset = agentPreset(agentId);
128
100
  if (customCommand === null && preset === undefined) {
@@ -162,7 +134,11 @@ function describeConfig(p, c) {
162
134
  'start a run with `aidlc autopilot run --items <n>` or `--all`',
163
135
  ].join('\n');
164
136
  }
165
- /** `aidlc init --autopilot` and `aidlc autopilot setup` share this (AC-12). */
137
+ /**
138
+ * `aidlc autopilot setup`. `aidlc init` asks the same four questions through
139
+ * `askAutopilotQuestions` and saves the answers per home instead
140
+ * (init-sets-work-mode/AC-16, AC-20).
141
+ */
166
142
  export async function setupCommand(opts, prompt = defaultPrompter) {
167
143
  const where = locate();
168
144
  if (where === null) {