@glrs-dev/cli 2.3.0 → 2.4.1
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.
- package/CHANGELOG.md +8 -0
- package/dist/{chunk-EM4MJBOD.js → chunk-2AZKRWC6.js} +4 -4
- package/dist/{chunk-UXBOTMDY.js → chunk-2P3ETOT2.js} +2 -2
- package/dist/chunk-2VMFXAJH.js +795 -0
- package/dist/chunk-5ZVUFNCP.js +140 -0
- package/dist/{chunk-W37UX3U2.js → chunk-6Y27RQQL.js} +2 -2
- package/dist/{chunk-RZWOWTKF.js → chunk-EKNRKZWR.js} +4 -4
- package/dist/{chunk-YGNDPKIW.js → chunk-HQUCVJ4G.js} +3 -1
- package/dist/{chunk-OABVEBWW.js → chunk-MBEVC327.js} +1 -1
- package/dist/{chunk-MIWZLETC.js → chunk-MCM47HH4.js} +1 -1
- package/dist/{chunk-F3AFRUT2.js → chunk-PTIO556V.js} +2 -2
- package/dist/{chunk-E2UNZIZT.js → chunk-R2WXQ54P.js} +1 -1
- package/dist/{chunk-I2KUXY3I.js → chunk-SMDIOB5B.js} +2 -2
- package/dist/{chunk-SPULDN7P.js → chunk-YY7EWHMA.js} +5 -3
- package/dist/cli.js +31 -20
- package/dist/commands/autopilot-interactive.d.ts +89 -0
- package/dist/commands/autopilot-interactive.js +248 -0
- package/dist/commands/autopilot-raw.d.ts +1 -0
- package/dist/commands/autopilot-raw.js +368 -0
- package/dist/commands/autopilot-tui.d.ts +7 -0
- package/dist/commands/autopilot-tui.js +7 -0
- package/dist/commands/autopilot.d.ts +39 -0
- package/dist/commands/autopilot.js +395 -0
- package/dist/commands/cleanup.js +3 -3
- package/dist/commands/create.js +4 -4
- package/dist/commands/dashboard.d.ts +3 -0
- package/dist/commands/dashboard.js +1549 -0
- package/dist/commands/debrief.d.ts +57 -0
- package/dist/commands/debrief.js +9 -0
- package/dist/commands/delete.js +3 -3
- package/dist/commands/go.js +2 -2
- package/dist/commands/list.js +3 -3
- package/dist/commands/loop.d.ts +42 -0
- package/dist/commands/loop.js +133 -0
- package/dist/commands/plan-picker.d.ts +15 -0
- package/dist/commands/plan-picker.js +76 -0
- package/dist/commands/scoper.d.ts +54 -0
- package/dist/{vendor/harness-opencode/dist/scoper-S77SOK7X.js → commands/scoper.js} +30 -15
- package/dist/commands/switch.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/lib/auto-update.js +1 -1
- package/dist/lib/config.d.ts +3 -2
- package/dist/lib/config.js +1 -1
- package/dist/lib/registry.d.ts +2 -0
- package/dist/lib/registry.js +1 -1
- package/dist/lib/worktree.js +3 -3
- package/dist/node_modules/@glrs-dev/adapter-opencode/dist/index.d.ts +261 -0
- package/dist/node_modules/@glrs-dev/adapter-opencode/dist/index.js +488 -0
- package/dist/node_modules/@glrs-dev/adapter-opencode/package.json +8 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/auto-ship-LCT6LIH7.js +7 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/changeset-generator-DG3MVWVV.js +15 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-7OSEI5TF.js +249 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-E7PWTRFO.js +91 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-M2ZVBPWL.js +101 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-Q4ULU6ER.js +68 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-VITL2Z45.js +2772 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-ZNJWARTM.js +449 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/index.d.ts +1765 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/index.js +688 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/logger-UITJGIZE.js +8 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/loop-session-XKL3NHUA.js +8 -0
- package/dist/node_modules/@glrs-dev/autopilot/dist/plan-enrichment-D3RPJR2J.js +14 -0
- package/dist/node_modules/@glrs-dev/autopilot/package.json +8 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/plan.md +7 -0
- package/dist/vendor/harness-opencode/dist/chunk-GILWWWMB.js +66 -0
- package/dist/vendor/harness-opencode/dist/cli.js +335 -639
- package/dist/vendor/harness-opencode/dist/index.js +35 -8
- package/dist/vendor/harness-opencode/dist/plugin-check-GJRD2OK6.js +14 -0
- package/dist/vendor/harness-opencode/package.json +1 -1
- package/package.json +14 -6
- package/dist/vendor/harness-opencode/dist/autopilot/prompt-template.md +0 -104
- package/dist/vendor/harness-opencode/dist/chunk-GCWHRUOK.js +0 -259
- package/dist/vendor/harness-opencode/dist/chunk-MJSMBY2Y.js +0 -87
- package/dist/vendor/harness-opencode/dist/chunk-NIFAVPNN.js +0 -544
- package/dist/vendor/harness-opencode/dist/loop-session-J35NILUZ.js +0 -30
- package/dist/vendor/harness-opencode/dist/opencode-server-KPCDFYAX.js +0 -22
- package/dist/vendor/harness-opencode/dist/plan-parser-TMHEKT22.js +0 -6
- package/dist/vendor/harness-opencode/dist/plan-session-7VS32P52.js +0 -117
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import "../chunk-3RG5ZIWI.js";
|
|
2
|
+
|
|
3
|
+
// src/commands/autopilot.ts
|
|
4
|
+
import { command, flag, option, optional, string as stringType, number as numberType } from "cmd-ts";
|
|
5
|
+
import * as path from "path";
|
|
6
|
+
import * as fs from "fs";
|
|
7
|
+
import { formatElapsed, formatCost as formatCost2, EventStreamReader, deriveState } from "@glrs-dev/autopilot";
|
|
8
|
+
import { SessionRunner } from "@glrs-dev/autopilot";
|
|
9
|
+
|
|
10
|
+
// src/cli-renderer.ts
|
|
11
|
+
function formatDuration(ms) {
|
|
12
|
+
if (ms < 6e4) return `${Math.round(ms / 1e3)}s`;
|
|
13
|
+
const min = Math.floor(ms / 6e4);
|
|
14
|
+
const sec = Math.round(ms / 1e3 % 60);
|
|
15
|
+
return `${min}m ${sec}s`;
|
|
16
|
+
}
|
|
17
|
+
function formatCost(usd) {
|
|
18
|
+
return `$${usd.toFixed(2)}`;
|
|
19
|
+
}
|
|
20
|
+
function createCliRenderer(emitter) {
|
|
21
|
+
const handler = (event) => {
|
|
22
|
+
switch (event.type) {
|
|
23
|
+
// Lifecycle — session:start and session:done are handled by the caller
|
|
24
|
+
case "session:start":
|
|
25
|
+
case "session:done":
|
|
26
|
+
break;
|
|
27
|
+
// Enrichment
|
|
28
|
+
case "enrich:start":
|
|
29
|
+
break;
|
|
30
|
+
case "enrich:file:start":
|
|
31
|
+
break;
|
|
32
|
+
case "enrich:file:done":
|
|
33
|
+
process.stderr.write(
|
|
34
|
+
` \u2713 ${event.file}${event.specFile ? ` \u2192 ${event.specFile}` : ""} generated
|
|
35
|
+
`
|
|
36
|
+
);
|
|
37
|
+
break;
|
|
38
|
+
case "enrich:file:skip":
|
|
39
|
+
process.stderr.write(` ${event.file} \u2014 ${event.reason}
|
|
40
|
+
`);
|
|
41
|
+
break;
|
|
42
|
+
case "enrich:file:error":
|
|
43
|
+
process.stderr.write(` \u2717 ${event.file}: ${event.error}
|
|
44
|
+
`);
|
|
45
|
+
break;
|
|
46
|
+
case "enrich:done":
|
|
47
|
+
break;
|
|
48
|
+
// Execution — phase
|
|
49
|
+
case "phase:start":
|
|
50
|
+
if (event.current === 0) {
|
|
51
|
+
process.stderr.write(`
|
|
52
|
+
\x1B[2m${event.phase}\x1B[0m
|
|
53
|
+
`);
|
|
54
|
+
} else {
|
|
55
|
+
process.stderr.write(
|
|
56
|
+
`
|
|
57
|
+
\x1B[1m\u2192 Phase ${event.current}/${event.total}: ${event.phase}\x1B[0m
|
|
58
|
+
`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
case "phase:done":
|
|
63
|
+
if (event.iterations === 0 && event.completed) {
|
|
64
|
+
process.stderr.write(
|
|
65
|
+
` \x1B[2m\u2713 ${event.phase} \u2014 skipped (already done)\x1B[0m
|
|
66
|
+
`
|
|
67
|
+
);
|
|
68
|
+
} else if (event.completed) {
|
|
69
|
+
process.stderr.write(
|
|
70
|
+
` \u2713 Phase ${event.phase} complete (${event.iterations} iteration(s), ${formatCost(event.costUsd)})
|
|
71
|
+
`
|
|
72
|
+
);
|
|
73
|
+
} else {
|
|
74
|
+
process.stderr.write(
|
|
75
|
+
` \u2717 Phase ${event.phase} did not complete (${event.iterations} iteration(s))
|
|
76
|
+
`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
// Execution — iteration
|
|
81
|
+
case "iteration:start": {
|
|
82
|
+
const laneTag = event.laneId ? `[${event.laneId}] ` : "";
|
|
83
|
+
process.stderr.write(`
|
|
84
|
+
${laneTag}Iteration ${event.iteration}/${event.maxIterations} `);
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
case "iteration:done": {
|
|
88
|
+
const laneTag = event.laneId ? `[${event.laneId}] ` : "";
|
|
89
|
+
const dur = formatDuration(event.durationMs);
|
|
90
|
+
const costPart = event.costUsd && event.costUsd > 0 ? ` \xB7 ${formatCost(event.costUsd)}` : "";
|
|
91
|
+
const cumulPart = event.cumulativeCostUsd && event.cumulativeCostUsd > 0 ? ` (total: ${formatCost(event.cumulativeCostUsd)})` : "";
|
|
92
|
+
const filesPart = event.filesChanged ? ` \xB7 ${event.filesChanged} file(s) changed` : "";
|
|
93
|
+
const progressPart = event.madeProgress === false ? " \xB7 \x1B[33mno progress\x1B[0m" : "";
|
|
94
|
+
process.stderr.write(
|
|
95
|
+
`
|
|
96
|
+
${laneTag}\u2713 Iteration ${event.iteration} done (${dur}${costPart}${cumulPart}${filesPart}${progressPart})
|
|
97
|
+
`
|
|
98
|
+
);
|
|
99
|
+
if (event.commitSubject) {
|
|
100
|
+
process.stderr.write(` commit: ${event.commitSubject}
|
|
101
|
+
`);
|
|
102
|
+
}
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
case "tool:call": {
|
|
106
|
+
const laneTag = event.laneId ? `[${event.laneId}] ` : "";
|
|
107
|
+
const argPart = event.firstArg ? ` ${event.firstArg}` : "";
|
|
108
|
+
if (process.stderr.isTTY) {
|
|
109
|
+
process.stderr.write(`\r\x1B[K ${laneTag}\u2699 ${event.toolName}${argPart}`);
|
|
110
|
+
} else {
|
|
111
|
+
process.stderr.write(` ${laneTag}\u2699 ${event.toolName}${argPart}
|
|
112
|
+
`);
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case "cost:update":
|
|
117
|
+
if (process.stderr.isTTY && event.cumulativeCostUsd > 0) {
|
|
118
|
+
process.stderr.write(`\r\x1B[K \u{1F4B0} ${formatCost(event.cumulativeCostUsd)}`);
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
// Errors
|
|
122
|
+
case "error":
|
|
123
|
+
process.stderr.write(`
|
|
124
|
+
\x1B[31m\u2717 Error: ${event.message}\x1B[0m
|
|
125
|
+
`);
|
|
126
|
+
break;
|
|
127
|
+
case "credential:expired":
|
|
128
|
+
process.stderr.write(
|
|
129
|
+
`
|
|
130
|
+
\x1B[31m\u2717 Credentials expired (${event.provider}).\x1B[0m
|
|
131
|
+
Run \`gs-assume\` and then \`glrs oc autopilot --resume\`.
|
|
132
|
+
`
|
|
133
|
+
);
|
|
134
|
+
break;
|
|
135
|
+
// Verify
|
|
136
|
+
case "verify:start":
|
|
137
|
+
process.stderr.write(
|
|
138
|
+
` Running ${event.itemCount} verify command(s) for ${event.phase}...
|
|
139
|
+
`
|
|
140
|
+
);
|
|
141
|
+
break;
|
|
142
|
+
case "verify:result":
|
|
143
|
+
if (event.passed) {
|
|
144
|
+
process.stderr.write(` \u2713 ${event.itemId}: ${event.command}
|
|
145
|
+
`);
|
|
146
|
+
} else {
|
|
147
|
+
process.stderr.write(` \u2717 ${event.itemId}: ${event.command}
|
|
148
|
+
`);
|
|
149
|
+
if (event.stderr) {
|
|
150
|
+
process.stderr.write(` ${event.stderr.split("\n").join("\n ")}
|
|
151
|
+
`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
case "verify:done":
|
|
156
|
+
if (event.failed === 0) {
|
|
157
|
+
process.stderr.write(
|
|
158
|
+
` \u2713 All ${event.passed} verify command(s) passed
|
|
159
|
+
`
|
|
160
|
+
);
|
|
161
|
+
} else {
|
|
162
|
+
process.stderr.write(
|
|
163
|
+
` \u2717 ${event.failed} verify command(s) failed (${event.passed} passed)
|
|
164
|
+
`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
168
|
+
case "thinking":
|
|
169
|
+
if (process.stderr.isTTY) {
|
|
170
|
+
const dur = event.elapsedSec < 60 ? `${event.elapsedSec}s` : `${Math.floor(event.elapsedSec / 60)}m${(event.elapsedSec % 60).toString().padStart(2, "0")}s`;
|
|
171
|
+
process.stderr.write(`\r\x1B[K \u{1F4AD} thinking\u2026 ${dur} \xB7 ${event.chars} chars`);
|
|
172
|
+
}
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
emitter.on("event", handler);
|
|
177
|
+
return {
|
|
178
|
+
unsubscribe: () => {
|
|
179
|
+
emitter.off("event", handler);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// src/commands/autopilot.ts
|
|
185
|
+
var autopilotInteractiveCmd = command({
|
|
186
|
+
name: "autopilot",
|
|
187
|
+
description: "Run the autopilot. Use -p <path> to provide a plan, or omit to pick one interactively. Use -f for fast-model execution. Use --status to check the current run status.",
|
|
188
|
+
args: {
|
|
189
|
+
plan: option({
|
|
190
|
+
long: "plan",
|
|
191
|
+
short: "p",
|
|
192
|
+
type: optional(stringType),
|
|
193
|
+
description: "Path to an existing plan file or directory. If omitted, opens an interactive file picker."
|
|
194
|
+
}),
|
|
195
|
+
fast: flag({
|
|
196
|
+
long: "fast",
|
|
197
|
+
short: "f",
|
|
198
|
+
description: "Use the fast executor model (mid-execute tier). Enriches the plan first so cheaper models can execute reliably."
|
|
199
|
+
}),
|
|
200
|
+
resume: flag({
|
|
201
|
+
long: "resume",
|
|
202
|
+
description: "Resume from .agent/autopilot-checkpoint.json: skip phases listed in completedPhases (when the checkpoint's planPath matches --plan)."
|
|
203
|
+
}),
|
|
204
|
+
maxIterationsPerPhase: option({
|
|
205
|
+
long: "max-iterations-per-phase",
|
|
206
|
+
type: optional(numberType),
|
|
207
|
+
description: "Per-phase iteration budget. Override the tier default (deep=5, mid-execute/autopilot-execute=10, fast=10). A phase that hits this budget without completing is treated as a soft failure: a checkpoint is written, a warning is logged, and the run continues to the next phase."
|
|
208
|
+
}),
|
|
209
|
+
parallel: option({
|
|
210
|
+
long: "parallel",
|
|
211
|
+
type: optional(numberType),
|
|
212
|
+
description: "Number of parallel lanes for phase execution (default: 1 = sequential). When >1, phases that touch disjoint files run concurrently in per-lane git worktrees, merged back on completion. Conflicting phases (sharing any file) still run sequentially. The orchestrator falls back to the sequential path when no parallelism is possible (every phase shares a file)."
|
|
213
|
+
}),
|
|
214
|
+
ship: flag({
|
|
215
|
+
long: "ship",
|
|
216
|
+
description: 'After all phases complete and verify passes, push the current branch and open a PR via `gh pr create`. Without this flag, the autopilot stops at "all phases complete, run `/ship` to finalize." The PR title is the plan\'s H1; the PR body is main.md verbatim. Refuses to push from main/master/detached HEAD.'
|
|
217
|
+
}),
|
|
218
|
+
status: flag({
|
|
219
|
+
long: "status",
|
|
220
|
+
description: "Read and pretty-print the current autopilot status from .agent/autopilot-status.json. Exits 0 if found, 1 if not running."
|
|
221
|
+
})
|
|
222
|
+
},
|
|
223
|
+
handler: async ({ plan, fast, resume, maxIterationsPerPhase, parallel, ship, status }) => {
|
|
224
|
+
const cwd = process.cwd();
|
|
225
|
+
if (status) {
|
|
226
|
+
const eventFilePath = path.join(cwd, ".agent", "autopilot-events.jsonl");
|
|
227
|
+
const legacyStatusFilePath = path.join(cwd, ".agent", "autopilot-status.json");
|
|
228
|
+
if (fs.existsSync(eventFilePath)) {
|
|
229
|
+
try {
|
|
230
|
+
const reader = new EventStreamReader(eventFilePath);
|
|
231
|
+
const events = reader.readAll();
|
|
232
|
+
const handle = deriveState(events);
|
|
233
|
+
if (!handle) {
|
|
234
|
+
process.stderr.write("Event stream found but contains no session:start event.\n");
|
|
235
|
+
process.exit(1);
|
|
236
|
+
}
|
|
237
|
+
const elapsedMs = Date.now() - new Date(handle.startedAt).getTime();
|
|
238
|
+
const elapsed = formatElapsed(elapsedMs);
|
|
239
|
+
const cost = formatCost2(handle.cost, false);
|
|
240
|
+
process.stdout.write("\n\x1B[1mAutopilot Status\x1B[0m\n\n");
|
|
241
|
+
process.stdout.write(` Plan: ${handle.planPath}
|
|
242
|
+
`);
|
|
243
|
+
process.stdout.write(` Status: ${handle.status}
|
|
244
|
+
`);
|
|
245
|
+
process.stdout.write(` Elapsed: ${elapsed}
|
|
246
|
+
`);
|
|
247
|
+
process.stdout.write(` Iterations: ${handle.totalIterations} completed
|
|
248
|
+
`);
|
|
249
|
+
process.stdout.write(` Cost: ${cost}
|
|
250
|
+
`);
|
|
251
|
+
if (handle.currentPhase) {
|
|
252
|
+
process.stdout.write(` Phase: ${handle.currentPhase.phase} (${handle.currentPhase.current}/${handle.currentPhase.total})
|
|
253
|
+
`);
|
|
254
|
+
}
|
|
255
|
+
if (handle.currentIteration) {
|
|
256
|
+
process.stdout.write(` Iteration: ${handle.currentIteration.iteration}/${handle.currentIteration.max}
|
|
257
|
+
`);
|
|
258
|
+
}
|
|
259
|
+
if (handle.enrichProgress) {
|
|
260
|
+
process.stdout.write(` Enriching: ${handle.enrichProgress.done}/${handle.enrichProgress.total} files
|
|
261
|
+
`);
|
|
262
|
+
}
|
|
263
|
+
if (handle.verifyProgress) {
|
|
264
|
+
process.stdout.write(` Verifying: ${handle.verifyProgress.passed}/${handle.verifyProgress.total} passed
|
|
265
|
+
`);
|
|
266
|
+
}
|
|
267
|
+
if (handle.exitReason) {
|
|
268
|
+
process.stdout.write(` Exit: ${handle.exitReason}
|
|
269
|
+
`);
|
|
270
|
+
}
|
|
271
|
+
if (handle.error) {
|
|
272
|
+
process.stdout.write(` \x1B[31m\u26A0 Error: ${handle.error}\x1B[0m
|
|
273
|
+
`);
|
|
274
|
+
}
|
|
275
|
+
process.stdout.write(` Updated: ${handle.lastEventAt}
|
|
276
|
+
`);
|
|
277
|
+
process.stdout.write("\n");
|
|
278
|
+
process.exit(0);
|
|
279
|
+
} catch (err) {
|
|
280
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
281
|
+
process.stderr.write(`Failed to read event stream: ${msg}
|
|
282
|
+
`);
|
|
283
|
+
process.exit(1);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (fs.existsSync(legacyStatusFilePath)) {
|
|
287
|
+
try {
|
|
288
|
+
const raw = fs.readFileSync(legacyStatusFilePath, "utf8");
|
|
289
|
+
const state = JSON.parse(raw);
|
|
290
|
+
const elapsed = state.elapsedMs !== void 0 ? formatElapsed(state.elapsedMs) : formatElapsed(Date.now() - state.startedAt);
|
|
291
|
+
const cost = formatCost2(state.cumulativeCostUsd, state.costIsEstimated);
|
|
292
|
+
process.stdout.write("\n\x1B[1mAutopilot Status\x1B[0m (legacy)\n\n");
|
|
293
|
+
process.stdout.write(` Elapsed: ${elapsed}
|
|
294
|
+
`);
|
|
295
|
+
process.stdout.write(` Iterations: ${state.iterationsCompleted} completed
|
|
296
|
+
`);
|
|
297
|
+
process.stdout.write(` Cost: ${cost}
|
|
298
|
+
`);
|
|
299
|
+
if (state.phaseCount !== void 0) {
|
|
300
|
+
process.stdout.write(` Phase: ${state.phasesCompleted ?? 0}/${state.phaseCount}
|
|
301
|
+
`);
|
|
302
|
+
}
|
|
303
|
+
if (state.mainCheckboxesTotal !== void 0) {
|
|
304
|
+
process.stdout.write(` Checkboxes: ${state.mainCheckboxesCompleted ?? 0}/${state.mainCheckboxesTotal}
|
|
305
|
+
`);
|
|
306
|
+
}
|
|
307
|
+
process.stdout.write(` Progress: ${state.lastIterationProgress ? "\u2713 made progress" : "\u25CB no progress"}
|
|
308
|
+
`);
|
|
309
|
+
if (state.lastIterationErrored) {
|
|
310
|
+
process.stdout.write(` \x1B[31m\u26A0 Last iteration errored\x1B[0m
|
|
311
|
+
`);
|
|
312
|
+
}
|
|
313
|
+
if (state.writtenAt) {
|
|
314
|
+
process.stdout.write(` Updated: ${state.writtenAt}
|
|
315
|
+
`);
|
|
316
|
+
}
|
|
317
|
+
process.stdout.write("\n");
|
|
318
|
+
process.exit(0);
|
|
319
|
+
} catch (err) {
|
|
320
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
321
|
+
process.stderr.write(`Failed to read legacy status file: ${msg}
|
|
322
|
+
`);
|
|
323
|
+
process.exit(1);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
process.stderr.write("No autopilot status found. Is autopilot running?\n");
|
|
327
|
+
process.stderr.write(` Checked: ${eventFilePath}
|
|
328
|
+
`);
|
|
329
|
+
process.stderr.write(` Checked: ${legacyStatusFilePath}
|
|
330
|
+
`);
|
|
331
|
+
process.exit(1);
|
|
332
|
+
}
|
|
333
|
+
let planPath = plan;
|
|
334
|
+
if (!planPath) {
|
|
335
|
+
const { pickPlanFile } = await import("./plan-picker.js");
|
|
336
|
+
const picked = await pickPlanFile(process.cwd());
|
|
337
|
+
if (!picked) {
|
|
338
|
+
process.stderr.write("No plan selected.\n");
|
|
339
|
+
process.exit(0);
|
|
340
|
+
}
|
|
341
|
+
planPath = picked;
|
|
342
|
+
}
|
|
343
|
+
const { validatePlan } = await import("@glrs-dev/autopilot");
|
|
344
|
+
const validation = validatePlan(path.resolve(process.cwd(), planPath));
|
|
345
|
+
for (const w of validation.warnings) {
|
|
346
|
+
process.stderr.write(` \u26A0 ${w.message}${w.file ? ` (${w.file})` : ""}
|
|
347
|
+
`);
|
|
348
|
+
}
|
|
349
|
+
if (validation.errors.length > 0) {
|
|
350
|
+
process.stderr.write(
|
|
351
|
+
`
|
|
352
|
+
\x1B[31m\u2717 Plan validation failed:\x1B[0m
|
|
353
|
+
`
|
|
354
|
+
);
|
|
355
|
+
for (const e of validation.errors) {
|
|
356
|
+
process.stderr.write(
|
|
357
|
+
` ${e.message}${e.file ? ` (${e.file})` : ""}
|
|
358
|
+
`
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
process.exit(1);
|
|
362
|
+
}
|
|
363
|
+
if (fast && planPath) {
|
|
364
|
+
process.stderr.write("\n\x1B[1m\u2192 Enriching plan for fast execution\x1B[0m (deep model reads codebase, adds context)\n");
|
|
365
|
+
process.stderr.write(" Adding mirror refs, code pointers, and conventions...\n");
|
|
366
|
+
}
|
|
367
|
+
const runner = new SessionRunner({
|
|
368
|
+
planPath: path.resolve(process.cwd(), planPath),
|
|
369
|
+
cwd: process.cwd(),
|
|
370
|
+
fast,
|
|
371
|
+
resume,
|
|
372
|
+
maxIterationsPerPhase,
|
|
373
|
+
parallel,
|
|
374
|
+
ship
|
|
375
|
+
});
|
|
376
|
+
const renderer = createCliRenderer(runner.events);
|
|
377
|
+
const result = await runner.run();
|
|
378
|
+
renderer.unsubscribe();
|
|
379
|
+
if (fast && planPath) {
|
|
380
|
+
process.stderr.write(" \u2713 Plan enriched \u2014 executing with fast model (mid-execute tier)\n\n");
|
|
381
|
+
}
|
|
382
|
+
const costStr = result.loopResult.cumulativeCostUsd ? ` \xB7 $${result.loopResult.cumulativeCostUsd.toFixed(2)}` : "";
|
|
383
|
+
process.stdout.write(
|
|
384
|
+
`
|
|
385
|
+
\x1B[1m\u2713 Autopilot complete\x1B[0m
|
|
386
|
+
Plan: ${result.planPath}
|
|
387
|
+
Result: ${result.loopResult.exitReason} after ${result.loopResult.iterations} iteration(s)${costStr}
|
|
388
|
+
|
|
389
|
+
`
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
export {
|
|
394
|
+
autopilotInteractiveCmd
|
|
395
|
+
};
|
package/dist/commands/cleanup.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cleanup
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-2P3ETOT2.js";
|
|
4
|
+
import "../chunk-6Y27RQQL.js";
|
|
5
5
|
import "../chunk-LMRDQ4GW.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-YY7EWHMA.js";
|
|
7
7
|
import "../chunk-YBCA3IP6.js";
|
|
8
8
|
import "../chunk-3RG5ZIWI.js";
|
|
9
9
|
export {
|
package/dist/commands/create.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
create
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-2AZKRWC6.js";
|
|
4
|
+
import "../chunk-PTIO556V.js";
|
|
5
|
+
import "../chunk-6Y27RQQL.js";
|
|
6
6
|
import "../chunk-LMRDQ4GW.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-YY7EWHMA.js";
|
|
8
8
|
import "../chunk-YBCA3IP6.js";
|
|
9
9
|
import "../chunk-3RG5ZIWI.js";
|
|
10
10
|
export {
|