@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
@@ -0,0 +1,66 @@
1
+ // src/cli/plugin-check.ts
2
+ import * as fs from "fs";
3
+ import * as path from "path";
4
+ import * as os from "os";
5
+ import { select, checkbox, confirm } from "@inquirer/prompts";
6
+ var PLUGIN_NAME = "@glrs-dev/harness-plugin-opencode";
7
+ function getOpencodeConfigPath() {
8
+ const configHome = process.env["XDG_CONFIG_HOME"] ?? path.join(os.homedir(), ".config");
9
+ return path.join(configHome, "opencode", "opencode.json");
10
+ }
11
+ function isPluginInstalled() {
12
+ const configPath = getOpencodeConfigPath();
13
+ if (!fs.existsSync(configPath)) return false;
14
+ try {
15
+ const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
16
+ const plugins = Array.isArray(config.plugin) ? config.plugin : [];
17
+ return plugins.some((p) => {
18
+ const name = typeof p === "string" ? p : Array.isArray(p) ? p[0] : null;
19
+ return name === PLUGIN_NAME || String(name ?? "").startsWith(`${PLUGIN_NAME}@`);
20
+ });
21
+ } catch {
22
+ return false;
23
+ }
24
+ }
25
+ async function promptYesNo(question) {
26
+ if (!process.stdin.isTTY) return false;
27
+ return confirm({ message: question, default: false });
28
+ }
29
+ async function promptChoice(question, choices, defaultIndex = 0) {
30
+ if (!process.stdin.isTTY) return defaultIndex;
31
+ const answer = await select({
32
+ message: question,
33
+ choices: choices.map((label, i) => ({
34
+ name: label,
35
+ value: i
36
+ })),
37
+ default: defaultIndex
38
+ });
39
+ return answer;
40
+ }
41
+ async function promptMulti(question, choices) {
42
+ if (!process.stdin.isTTY) {
43
+ const defaults = /* @__PURE__ */ new Set();
44
+ choices.forEach((c, i) => {
45
+ if (c.defaultOn) defaults.add(i);
46
+ });
47
+ return defaults;
48
+ }
49
+ const answers = await checkbox({
50
+ message: question,
51
+ choices: choices.map((c, i) => ({
52
+ name: c.label,
53
+ value: i,
54
+ checked: c.defaultOn
55
+ }))
56
+ });
57
+ return new Set(answers);
58
+ }
59
+
60
+ export {
61
+ getOpencodeConfigPath,
62
+ isPluginInstalled,
63
+ promptYesNo,
64
+ promptChoice,
65
+ promptMulti
66
+ };