@glrs-dev/cli 2.3.0 → 2.4.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/{chunk-EM4MJBOD.js → chunk-2AZKRWC6.js} +4 -4
  3. package/dist/{chunk-UXBOTMDY.js → chunk-2P3ETOT2.js} +2 -2
  4. package/dist/chunk-2VMFXAJH.js +795 -0
  5. package/dist/chunk-5ZVUFNCP.js +140 -0
  6. package/dist/{chunk-W37UX3U2.js → chunk-6Y27RQQL.js} +2 -2
  7. package/dist/{chunk-RZWOWTKF.js → chunk-EKNRKZWR.js} +4 -4
  8. package/dist/{chunk-YGNDPKIW.js → chunk-HQUCVJ4G.js} +3 -1
  9. package/dist/{chunk-OABVEBWW.js → chunk-MBEVC327.js} +1 -1
  10. package/dist/{chunk-MIWZLETC.js → chunk-MCM47HH4.js} +1 -1
  11. package/dist/{chunk-F3AFRUT2.js → chunk-PTIO556V.js} +2 -2
  12. package/dist/{chunk-E2UNZIZT.js → chunk-R2WXQ54P.js} +1 -1
  13. package/dist/{chunk-I2KUXY3I.js → chunk-SMDIOB5B.js} +2 -2
  14. package/dist/{chunk-SPULDN7P.js → chunk-YY7EWHMA.js} +5 -3
  15. package/dist/cli.js +31 -20
  16. package/dist/commands/autopilot-interactive.d.ts +89 -0
  17. package/dist/commands/autopilot-interactive.js +248 -0
  18. package/dist/commands/autopilot-raw.d.ts +1 -0
  19. package/dist/commands/autopilot-raw.js +368 -0
  20. package/dist/commands/autopilot-tui.d.ts +7 -0
  21. package/dist/commands/autopilot-tui.js +7 -0
  22. package/dist/commands/autopilot.d.ts +39 -0
  23. package/dist/commands/autopilot.js +395 -0
  24. package/dist/commands/cleanup.js +3 -3
  25. package/dist/commands/create.js +4 -4
  26. package/dist/commands/dashboard.d.ts +3 -0
  27. package/dist/commands/dashboard.js +1549 -0
  28. package/dist/commands/debrief.d.ts +57 -0
  29. package/dist/commands/debrief.js +9 -0
  30. package/dist/commands/delete.js +3 -3
  31. package/dist/commands/go.js +2 -2
  32. package/dist/commands/list.js +3 -3
  33. package/dist/commands/loop.d.ts +42 -0
  34. package/dist/commands/loop.js +133 -0
  35. package/dist/commands/plan-picker.d.ts +15 -0
  36. package/dist/commands/plan-picker.js +76 -0
  37. package/dist/commands/scoper.d.ts +54 -0
  38. package/dist/{vendor/harness-opencode/dist/scoper-S77SOK7X.js → commands/scoper.js} +30 -15
  39. package/dist/commands/switch.js +3 -3
  40. package/dist/index.d.ts +2 -2
  41. package/dist/index.js +1 -1
  42. package/dist/lib/auto-update.js +1 -1
  43. package/dist/lib/config.d.ts +3 -2
  44. package/dist/lib/config.js +1 -1
  45. package/dist/lib/registry.d.ts +2 -0
  46. package/dist/lib/registry.js +1 -1
  47. package/dist/lib/worktree.js +3 -3
  48. package/dist/vendor/harness-opencode/dist/agents/prompts/plan.md +7 -0
  49. package/dist/vendor/harness-opencode/dist/chunk-GILWWWMB.js +66 -0
  50. package/dist/vendor/harness-opencode/dist/cli.js +335 -639
  51. package/dist/vendor/harness-opencode/dist/index.js +35 -8
  52. package/dist/vendor/harness-opencode/dist/plugin-check-GJRD2OK6.js +14 -0
  53. package/dist/vendor/harness-opencode/package.json +1 -1
  54. package/package.json +8 -2
  55. package/dist/vendor/harness-opencode/dist/autopilot/prompt-template.md +0 -104
  56. package/dist/vendor/harness-opencode/dist/chunk-GCWHRUOK.js +0 -259
  57. package/dist/vendor/harness-opencode/dist/chunk-MJSMBY2Y.js +0 -87
  58. package/dist/vendor/harness-opencode/dist/chunk-NIFAVPNN.js +0 -544
  59. package/dist/vendor/harness-opencode/dist/loop-session-J35NILUZ.js +0 -30
  60. package/dist/vendor/harness-opencode/dist/opencode-server-KPCDFYAX.js +0 -22
  61. package/dist/vendor/harness-opencode/dist/plan-parser-TMHEKT22.js +0 -6
  62. package/dist/vendor/harness-opencode/dist/plan-session-7VS32P52.js +0 -117
@@ -1,117 +0,0 @@
1
- import {
2
- createSession,
3
- sendAndWait,
4
- startServer
5
- } from "./chunk-GCWHRUOK.js";
6
-
7
- // src/autopilot/plan-session.ts
8
- import * as fs from "fs";
9
- import * as path from "path";
10
- var DEFAULT_PLAN_TIMEOUT_MS = 10 * 60 * 1e3;
11
- async function runPlanSession(opts) {
12
- const timeoutMs = opts.timeoutMs ?? DEFAULT_PLAN_TIMEOUT_MS;
13
- const _startServer = opts._deps?.startServer ?? startServer;
14
- const _createSession = opts._deps?.createSession ?? createSession;
15
- const _sendAndWait = opts._deps?.sendAndWait ?? sendAndWait;
16
- const _existsSync = opts._deps?.existsSync ?? fs.existsSync;
17
- const server = await _startServer({ cwd: opts.planDir });
18
- try {
19
- const sessionId = await _createSession(server.client, {
20
- cwd: opts.planDir,
21
- agentName: "plan"
22
- });
23
- const multiFileDir = path.join(opts.planDir, opts.slug);
24
- const multiFileMain = path.join(multiFileDir, "main.md");
25
- const singleFilePlan = path.join(opts.planDir, `${opts.slug}.md`);
26
- const prompt = `Read the scope at ${opts.scopePath} and produce a plan. Use slug ${opts.slug} for the plan file(s). If the scope warrants multiple phases, produce a multi-file plan at ${multiFileDir}/main.md + phase_N.md files. Otherwise produce a single-file plan at ${singleFilePlan}.`;
27
- const result = await _sendAndWait(server.client, {
28
- sessionId,
29
- message: prompt,
30
- agentName: "plan",
31
- stallMs: timeoutMs,
32
- autoRejectPermissions: true,
33
- serverUrl: server.url
34
- });
35
- if (result.kind === "abort") {
36
- throw new Error(
37
- `Plan session aborted (timeout after ${timeoutMs}ms).`
38
- );
39
- }
40
- if (result.kind === "stall") {
41
- throw new Error(
42
- `Plan session stalled for ${result.stallMs}ms with no idle signal.`
43
- );
44
- }
45
- if (result.kind === "error") {
46
- throw new Error(`Plan session error: ${result.message}`);
47
- }
48
- if (result.kind === "question_rejected") {
49
- process.stderr.write(
50
- `
51
- \u26A0 @plan tried to ask a question (rejected). Checking if plan was written anyway...
52
- `
53
- );
54
- }
55
- if (_existsSync(multiFileMain)) {
56
- return { planPath: multiFileDir };
57
- }
58
- if (_existsSync(singleFilePlan)) {
59
- return { planPath: singleFilePlan };
60
- }
61
- process.stderr.write(
62
- `
63
- \u26A0 @plan didn't write a plan file. Re-sending with explicit instructions...
64
- `
65
- );
66
- const retryPrompt = `You did not write a plan file. Write the plan NOW. Read the scope at ${opts.scopePath}. Write the plan to ${singleFilePlan} (single-file) or ${multiFileDir}/main.md (multi-file). Do NOT ask questions. Just write the plan.`;
67
- const retryResult = await _sendAndWait(server.client, {
68
- sessionId,
69
- message: retryPrompt,
70
- agentName: "plan",
71
- stallMs: timeoutMs,
72
- autoRejectPermissions: true,
73
- serverUrl: server.url
74
- });
75
- if (retryResult.kind !== "idle" && retryResult.kind !== "question_rejected") {
76
- throw new Error(`@plan retry failed: ${retryResult.kind}`);
77
- }
78
- if (_existsSync(multiFileMain)) {
79
- return { planPath: multiFileDir };
80
- }
81
- if (_existsSync(singleFilePlan)) {
82
- return { planPath: singleFilePlan };
83
- }
84
- process.stderr.write(
85
- `
86
- \u26A0 @plan still didn't write a plan. Constructing minimal plan from scope.
87
- `
88
- );
89
- const scopeContent = fs.existsSync(opts.scopePath) ? fs.readFileSync(opts.scopePath, "utf-8") : `# Plan
90
-
91
- Scope file not found at ${opts.scopePath}.`;
92
- const minimalPlan = [
93
- `# Plan (auto-generated from scope)`,
94
- "",
95
- "This plan was auto-generated because @plan did not produce a plan file.",
96
- "Review and refine before executing.",
97
- "",
98
- scopeContent,
99
- "",
100
- "## Acceptance criteria",
101
- "",
102
- "- [ ] Review and refine this auto-generated plan",
103
- "",
104
- "## File-level changes",
105
- "",
106
- "- To be determined after plan review."
107
- ].join("\n");
108
- fs.mkdirSync(path.dirname(singleFilePlan), { recursive: true });
109
- fs.writeFileSync(singleFilePlan, minimalPlan);
110
- return { planPath: singleFilePlan };
111
- } finally {
112
- await server.shutdown();
113
- }
114
- }
115
- export {
116
- runPlanSession
117
- };