@h-rig/cli 0.0.6-alpha.89 → 0.0.6-alpha.90

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 (231) hide show
  1. package/dist/bin/build-rig-binaries.js +8 -40
  2. package/dist/bin/rig.js +12519 -26675
  3. package/dist/src/app/board.js +74 -693
  4. package/dist/src/app/drone-ui.js +1 -1
  5. package/dist/src/app/theme.js +0 -1
  6. package/dist/src/commands/_async-ui.js +1 -1
  7. package/dist/src/commands/_authority-runs.d.ts +1 -1
  8. package/dist/src/commands/_authority-runs.js +12 -2
  9. package/dist/src/commands/_cli-format.d.ts +1 -10
  10. package/dist/src/commands/_cli-format.js +2 -5
  11. package/dist/src/commands/_connection-state.d.ts +1 -11
  12. package/dist/src/commands/_connection-state.js +5 -50
  13. package/dist/src/commands/_doctor-checks.js +40 -501
  14. package/dist/src/commands/_help-catalog.js +17 -99
  15. package/dist/src/commands/_json-output.js +0 -4
  16. package/dist/src/commands/_operator-view.js +54 -575
  17. package/dist/src/commands/_pi-frontend.d.ts +0 -27
  18. package/dist/src/commands/_pi-frontend.js +52 -576
  19. package/dist/src/commands/_preflight.js +66 -553
  20. package/dist/src/commands/_server-client.d.ts +0 -33
  21. package/dist/src/commands/_server-client.js +46 -541
  22. package/dist/src/commands/_snapshot-upload.js +42 -503
  23. package/dist/src/commands/_spinner.js +1 -1
  24. package/dist/src/commands/agent.js +12 -2
  25. package/dist/src/commands/browser.js +1 -1
  26. package/dist/src/commands/connect.js +15 -626
  27. package/dist/src/commands/doctor.js +41 -502
  28. package/dist/src/commands/github.js +51 -584
  29. package/dist/src/commands/inbox.js +41 -502
  30. package/dist/src/commands/init.js +74 -561
  31. package/dist/src/commands/inspect.js +41 -502
  32. package/dist/src/commands/run.js +54 -578
  33. package/dist/src/commands/server.js +163 -692
  34. package/dist/src/commands/setup.js +46 -507
  35. package/dist/src/commands/stats.js +58 -601
  36. package/dist/src/commands/task-run-driver.js +58 -509
  37. package/dist/src/commands/task.js +110 -729
  38. package/dist/src/commands.js +237 -1112
  39. package/dist/src/index.js +244 -1123
  40. package/dist/src/launcher.js +0 -4
  41. package/package.json +9 -13
  42. package/dist/src/app-opentui/adapters/command.d.ts +0 -2
  43. package/dist/src/app-opentui/adapters/command.js +0 -329
  44. package/dist/src/app-opentui/adapters/common.d.ts +0 -56
  45. package/dist/src/app-opentui/adapters/common.js +0 -153
  46. package/dist/src/app-opentui/adapters/doctor.d.ts +0 -9
  47. package/dist/src/app-opentui/adapters/doctor.js +0 -1217
  48. package/dist/src/app-opentui/adapters/family.d.ts +0 -62
  49. package/dist/src/app-opentui/adapters/family.js +0 -14855
  50. package/dist/src/app-opentui/adapters/fleet.d.ts +0 -14
  51. package/dist/src/app-opentui/adapters/fleet.js +0 -1335
  52. package/dist/src/app-opentui/adapters/inbox.d.ts +0 -43
  53. package/dist/src/app-opentui/adapters/inbox.js +0 -1944
  54. package/dist/src/app-opentui/adapters/init.d.ts +0 -11
  55. package/dist/src/app-opentui/adapters/init.js +0 -2818
  56. package/dist/src/app-opentui/adapters/inspect.d.ts +0 -52
  57. package/dist/src/app-opentui/adapters/inspect.js +0 -1455
  58. package/dist/src/app-opentui/adapters/pi-attach.d.ts +0 -32
  59. package/dist/src/app-opentui/adapters/pi-attach.js +0 -2101
  60. package/dist/src/app-opentui/adapters/pi.d.ts +0 -23
  61. package/dist/src/app-opentui/adapters/pi.js +0 -363
  62. package/dist/src/app-opentui/adapters/plugin.d.ts +0 -84
  63. package/dist/src/app-opentui/adapters/plugin.js +0 -544
  64. package/dist/src/app-opentui/adapters/repo.d.ts +0 -37
  65. package/dist/src/app-opentui/adapters/repo.js +0 -186
  66. package/dist/src/app-opentui/adapters/run-detail.d.ts +0 -27
  67. package/dist/src/app-opentui/adapters/run-detail.js +0 -1441
  68. package/dist/src/app-opentui/adapters/server.d.ts +0 -48
  69. package/dist/src/app-opentui/adapters/server.js +0 -1561
  70. package/dist/src/app-opentui/adapters/tasks.d.ts +0 -64
  71. package/dist/src/app-opentui/adapters/tasks.js +0 -4524
  72. package/dist/src/app-opentui/adapters/workspace.d.ts +0 -49
  73. package/dist/src/app-opentui/adapters/workspace.js +0 -333
  74. package/dist/src/app-opentui/autocomplete.d.ts +0 -20
  75. package/dist/src/app-opentui/autocomplete.js +0 -578
  76. package/dist/src/app-opentui/bootstrap.d.ts +0 -11
  77. package/dist/src/app-opentui/bootstrap.js +0 -27833
  78. package/dist/src/app-opentui/command-palette.d.ts +0 -3
  79. package/dist/src/app-opentui/command-palette.js +0 -1038
  80. package/dist/src/app-opentui/command-pty-host.d.ts +0 -62
  81. package/dist/src/app-opentui/command-pty-host.js +0 -248
  82. package/dist/src/app-opentui/drone.d.ts +0 -12
  83. package/dist/src/app-opentui/drone.js +0 -230
  84. package/dist/src/app-opentui/events.d.ts +0 -7
  85. package/dist/src/app-opentui/events.js +0 -28
  86. package/dist/src/app-opentui/fleet-stats.d.ts +0 -32
  87. package/dist/src/app-opentui/fleet-stats.js +0 -114
  88. package/dist/src/app-opentui/focus-manager.d.ts +0 -14
  89. package/dist/src/app-opentui/focus-manager.js +0 -24
  90. package/dist/src/app-opentui/index.d.ts +0 -8
  91. package/dist/src/app-opentui/index.js +0 -5260
  92. package/dist/src/app-opentui/intent.d.ts +0 -3
  93. package/dist/src/app-opentui/intent.js +0 -365
  94. package/dist/src/app-opentui/keymap.d.ts +0 -21
  95. package/dist/src/app-opentui/keymap.js +0 -1377
  96. package/dist/src/app-opentui/launch-routing.d.ts +0 -16
  97. package/dist/src/app-opentui/launch-routing.js +0 -55
  98. package/dist/src/app-opentui/layout.d.ts +0 -22
  99. package/dist/src/app-opentui/layout.js +0 -51
  100. package/dist/src/app-opentui/list-search.d.ts +0 -36
  101. package/dist/src/app-opentui/list-search.js +0 -130
  102. package/dist/src/app-opentui/pi-host-child.d.ts +0 -2
  103. package/dist/src/app-opentui/pi-host-child.js +0 -1299
  104. package/dist/src/app-opentui/pi-pty-host.d.ts +0 -28
  105. package/dist/src/app-opentui/pi-pty-host.js +0 -10
  106. package/dist/src/app-opentui/react/App.d.ts +0 -9
  107. package/dist/src/app-opentui/react/App.js +0 -3866
  108. package/dist/src/app-opentui/react/Backdrop.d.ts +0 -5
  109. package/dist/src/app-opentui/react/Backdrop.js +0 -823
  110. package/dist/src/app-opentui/react/ChromeHost.d.ts +0 -5
  111. package/dist/src/app-opentui/react/ChromeHost.js +0 -1539
  112. package/dist/src/app-opentui/react/SceneFrameView.d.ts +0 -7
  113. package/dist/src/app-opentui/react/SceneFrameView.js +0 -579
  114. package/dist/src/app-opentui/react/context.d.ts +0 -17
  115. package/dist/src/app-opentui/react/context.js +0 -37
  116. package/dist/src/app-opentui/react/launch.d.ts +0 -2
  117. package/dist/src/app-opentui/react/launch.js +0 -4897
  118. package/dist/src/app-opentui/react/nav.d.ts +0 -18
  119. package/dist/src/app-opentui/react/nav.js +0 -54
  120. package/dist/src/app-opentui/react/scroll.d.ts +0 -12
  121. package/dist/src/app-opentui/react/scroll.js +0 -21
  122. package/dist/src/app-opentui/react/syntax.d.ts +0 -2
  123. package/dist/src/app-opentui/react/syntax.js +0 -65
  124. package/dist/src/app-opentui/registry.d.ts +0 -4
  125. package/dist/src/app-opentui/registry.js +0 -22876
  126. package/dist/src/app-opentui/remote-link.d.ts +0 -10
  127. package/dist/src/app-opentui/remote-link.js +0 -47
  128. package/dist/src/app-opentui/render/ascii-fleet.d.ts +0 -15
  129. package/dist/src/app-opentui/render/ascii-fleet.js +0 -82
  130. package/dist/src/app-opentui/render/constants.d.ts +0 -30
  131. package/dist/src/app-opentui/render/constants.js +0 -64
  132. package/dist/src/app-opentui/render/graphics.d.ts +0 -40
  133. package/dist/src/app-opentui/render/graphics.js +0 -713
  134. package/dist/src/app-opentui/render/hover.d.ts +0 -11
  135. package/dist/src/app-opentui/render/hover.js +0 -34
  136. package/dist/src/app-opentui/render/native-host.d.ts +0 -37
  137. package/dist/src/app-opentui/render/native-host.js +0 -180
  138. package/dist/src/app-opentui/render/panel-layout.d.ts +0 -38
  139. package/dist/src/app-opentui/render/panel-layout.js +0 -48
  140. package/dist/src/app-opentui/render/panels.d.ts +0 -12
  141. package/dist/src/app-opentui/render/panels.js +0 -288
  142. package/dist/src/app-opentui/render/preloader.d.ts +0 -10
  143. package/dist/src/app-opentui/render/preloader.js +0 -166
  144. package/dist/src/app-opentui/render/scene.d.ts +0 -68
  145. package/dist/src/app-opentui/render/scene.js +0 -300
  146. package/dist/src/app-opentui/render/terminal-handoff.d.ts +0 -16
  147. package/dist/src/app-opentui/render/terminal-handoff.js +0 -14
  148. package/dist/src/app-opentui/render/text.d.ts +0 -29
  149. package/dist/src/app-opentui/render/text.js +0 -177
  150. package/dist/src/app-opentui/render/type-bar.d.ts +0 -15
  151. package/dist/src/app-opentui/render/type-bar.js +0 -212
  152. package/dist/src/app-opentui/runtime-resources.d.ts +0 -16
  153. package/dist/src/app-opentui/runtime-resources.js +0 -62
  154. package/dist/src/app-opentui/runtime.d.ts +0 -45
  155. package/dist/src/app-opentui/runtime.js +0 -5232
  156. package/dist/src/app-opentui/scenes/command.d.ts +0 -3
  157. package/dist/src/app-opentui/scenes/command.js +0 -118
  158. package/dist/src/app-opentui/scenes/doctor.d.ts +0 -3
  159. package/dist/src/app-opentui/scenes/doctor.js +0 -296
  160. package/dist/src/app-opentui/scenes/error.d.ts +0 -2
  161. package/dist/src/app-opentui/scenes/error.js +0 -277
  162. package/dist/src/app-opentui/scenes/family-domains/agent.d.ts +0 -2
  163. package/dist/src/app-opentui/scenes/family-domains/agent.js +0 -349
  164. package/dist/src/app-opentui/scenes/family-domains/browser.d.ts +0 -2
  165. package/dist/src/app-opentui/scenes/family-domains/browser.js +0 -196
  166. package/dist/src/app-opentui/scenes/family-domains/dist.d.ts +0 -2
  167. package/dist/src/app-opentui/scenes/family-domains/dist.js +0 -244
  168. package/dist/src/app-opentui/scenes/family-domains/git.d.ts +0 -2
  169. package/dist/src/app-opentui/scenes/family-domains/git.js +0 -196
  170. package/dist/src/app-opentui/scenes/family-domains/github.d.ts +0 -2
  171. package/dist/src/app-opentui/scenes/family-domains/github.js +0 -275
  172. package/dist/src/app-opentui/scenes/family-domains/harness.d.ts +0 -2
  173. package/dist/src/app-opentui/scenes/family-domains/harness.js +0 -153
  174. package/dist/src/app-opentui/scenes/family-domains/index.d.ts +0 -4
  175. package/dist/src/app-opentui/scenes/family-domains/index.js +0 -1680
  176. package/dist/src/app-opentui/scenes/family-domains/kit.d.ts +0 -76
  177. package/dist/src/app-opentui/scenes/family-domains/kit.js +0 -306
  178. package/dist/src/app-opentui/scenes/family-domains/profile.d.ts +0 -2
  179. package/dist/src/app-opentui/scenes/family-domains/profile.js +0 -213
  180. package/dist/src/app-opentui/scenes/family-domains/queue.d.ts +0 -2
  181. package/dist/src/app-opentui/scenes/family-domains/queue.js +0 -147
  182. package/dist/src/app-opentui/scenes/family-domains/remote.d.ts +0 -2
  183. package/dist/src/app-opentui/scenes/family-domains/remote.js +0 -519
  184. package/dist/src/app-opentui/scenes/family-domains/review.d.ts +0 -2
  185. package/dist/src/app-opentui/scenes/family-domains/review.js +0 -281
  186. package/dist/src/app-opentui/scenes/family-domains/setup.d.ts +0 -2
  187. package/dist/src/app-opentui/scenes/family-domains/setup.js +0 -268
  188. package/dist/src/app-opentui/scenes/family-domains/stats.d.ts +0 -2
  189. package/dist/src/app-opentui/scenes/family-domains/stats.js +0 -371
  190. package/dist/src/app-opentui/scenes/family.d.ts +0 -3
  191. package/dist/src/app-opentui/scenes/family.js +0 -2199
  192. package/dist/src/app-opentui/scenes/fleet.d.ts +0 -3
  193. package/dist/src/app-opentui/scenes/fleet.js +0 -766
  194. package/dist/src/app-opentui/scenes/handoff.d.ts +0 -2
  195. package/dist/src/app-opentui/scenes/handoff.js +0 -455
  196. package/dist/src/app-opentui/scenes/help.d.ts +0 -3
  197. package/dist/src/app-opentui/scenes/help.js +0 -725
  198. package/dist/src/app-opentui/scenes/inbox.d.ts +0 -3
  199. package/dist/src/app-opentui/scenes/inbox.js +0 -427
  200. package/dist/src/app-opentui/scenes/init.d.ts +0 -3
  201. package/dist/src/app-opentui/scenes/init.js +0 -181
  202. package/dist/src/app-opentui/scenes/inspect.d.ts +0 -3
  203. package/dist/src/app-opentui/scenes/inspect.js +0 -794
  204. package/dist/src/app-opentui/scenes/main.d.ts +0 -3
  205. package/dist/src/app-opentui/scenes/main.js +0 -332
  206. package/dist/src/app-opentui/scenes/pi.d.ts +0 -3
  207. package/dist/src/app-opentui/scenes/pi.js +0 -509
  208. package/dist/src/app-opentui/scenes/plugin.d.ts +0 -3
  209. package/dist/src/app-opentui/scenes/plugin.js +0 -487
  210. package/dist/src/app-opentui/scenes/repo.d.ts +0 -3
  211. package/dist/src/app-opentui/scenes/repo.js +0 -425
  212. package/dist/src/app-opentui/scenes/run-detail.d.ts +0 -3
  213. package/dist/src/app-opentui/scenes/run-detail.js +0 -467
  214. package/dist/src/app-opentui/scenes/server.d.ts +0 -3
  215. package/dist/src/app-opentui/scenes/server.js +0 -378
  216. package/dist/src/app-opentui/scenes/tasks.d.ts +0 -3
  217. package/dist/src/app-opentui/scenes/tasks.js +0 -768
  218. package/dist/src/app-opentui/scenes/workspace.d.ts +0 -3
  219. package/dist/src/app-opentui/scenes/workspace.js +0 -427
  220. package/dist/src/app-opentui/selectable.d.ts +0 -19
  221. package/dist/src/app-opentui/selectable.js +0 -80
  222. package/dist/src/app-opentui/state.d.ts +0 -4
  223. package/dist/src/app-opentui/state.js +0 -399
  224. package/dist/src/app-opentui/surface-catalog.d.ts +0 -20
  225. package/dist/src/app-opentui/surface-catalog.js +0 -542
  226. package/dist/src/app-opentui/theme.d.ts +0 -59
  227. package/dist/src/app-opentui/theme.js +0 -142
  228. package/dist/src/app-opentui/types.d.ts +0 -313
  229. package/dist/src/app-opentui/types.js +0 -1
  230. package/dist/src/commands/_server-events.d.ts +0 -26
  231. package/dist/src/commands/_server-events.js +0 -715
@@ -1,147 +0,0 @@
1
- // @bun
2
- // packages/cli/src/app-opentui/theme.ts
3
- import {
4
- bold as otuiBold,
5
- dim as otuiDim,
6
- fg as otuiFg,
7
- t,
8
- TextAttributes
9
- } from "@opentui/core";
10
- var RIG_UI = {
11
- bg: "#070809",
12
- bg2: "#0b0c0e",
13
- panel: "#101115",
14
- panel2: "#14161b",
15
- hover: "#181b24",
16
- glass: "#1e2230",
17
- border: "#2a2e3a",
18
- ink: "#f4f5f8",
19
- ink2: "#c7c9d3",
20
- ink3: "#9aa0ae",
21
- ink4: "#787b86",
22
- lime: "#ccff4d",
23
- limeDim: "#a9d63f",
24
- cyan: "#56d8ff",
25
- cyanDim: "#3f9fbd",
26
- red: "#ff5d5d",
27
- yellow: "#ffd24d",
28
- magenta: "#ff79b0"
29
- };
30
- var styles = {
31
- ink: otuiFg(RIG_UI.ink),
32
- ink2: otuiFg(RIG_UI.ink2),
33
- ink3: otuiFg(RIG_UI.ink3),
34
- ink4: otuiFg(RIG_UI.ink4),
35
- lime: otuiFg(RIG_UI.lime),
36
- limeDim: otuiFg(RIG_UI.limeDim),
37
- cyan: otuiFg(RIG_UI.cyan),
38
- red: otuiFg(RIG_UI.red),
39
- yellow: otuiFg(RIG_UI.yellow),
40
- magenta: otuiFg(RIG_UI.magenta)
41
- };
42
-
43
- // packages/cli/src/app-opentui/drone.ts
44
- import { RGBA, StyledText, TextAttributes as TextAttributes2 } from "@opentui/core";
45
- var COLOR = {
46
- body: RGBA.fromHex(RIG_UI.lime),
47
- mini: RGBA.fromHex(RIG_UI.limeDim),
48
- rotor: RGBA.fromHex(RIG_UI.cyan),
49
- path: RGBA.fromHex(RIG_UI.cyan),
50
- eye: RGBA.fromHex(RIG_UI.ink),
51
- dim: RGBA.fromHex(RIG_UI.ink4),
52
- ink: RGBA.fromHex(RIG_UI.ink2)
53
- };
54
-
55
- // packages/cli/src/app-opentui/render/scene.ts
56
- function line(text, options = {}) {
57
- return { text, ...options };
58
- }
59
- function blank() {
60
- return { text: "" };
61
- }
62
-
63
- // packages/cli/src/app-opentui/fleet-stats.ts
64
- var ACTIVE_STATUSES = new Set([
65
- "running",
66
- "preparing",
67
- "created",
68
- "validating",
69
- "reviewing",
70
- "closing-out",
71
- "stopping",
72
- "loading"
73
- ]);
74
-
75
- // packages/cli/src/app-opentui/scenes/family-domains/kit.ts
76
- function actionItemFor(family, sub) {
77
- const base = sub.base.join(" ");
78
- if (sub.direct) {
79
- const label = `run rig ${family} ${base}`.trim();
80
- return {
81
- id: `action:${sub.id}`,
82
- label,
83
- intent: { scene: "command", argv: [family, ...sub.base], action: { kind: "command-run", label: `Run rig ${family} ${base}`.trim(), payload: { argv: [family, ...sub.base], family } } },
84
- message: label
85
- };
86
- }
87
- return {
88
- id: `action:${sub.id}`,
89
- label: `configure ${family} ${base}`.trim(),
90
- intent: { scene: "family", argv: [family], action: { kind: "refresh", label: `Configure ${sub.template}`, payload: { family, formSub: sub.id } } },
91
- message: `configure & run rig ${family} ${sub.template}`
92
- };
93
- }
94
- function metric(label, value, opts = {}) {
95
- return line(` ${label.padEnd(22)} ${value}`, { fg: opts.fg ?? RIG_UI.ink2, bold: opts.bold });
96
- }
97
- function heading(text) {
98
- return line(text, { fg: RIG_UI.ink, bold: true });
99
- }
100
-
101
- // packages/cli/src/app-opentui/scenes/family-domains/queue.ts
102
- var RUN_OPTIONS = [
103
- { flag: "--workers <n>", def: "2", what: "parallel workers draining the queue" },
104
- { flag: "--max-tasks <n>", def: "10", what: "cap on tasks pulled this run" },
105
- { flag: "--action <validate|verify|pipeline>", def: "default", what: "stage each task runs through" },
106
- { flag: "--isolation <off|worktree>", def: "worktree", what: "per-task worktree isolation" },
107
- { flag: "--no-runtime-reuse", def: "reuse on", what: "force a fresh runtime per task" },
108
- { flag: "--fail-fast", def: "off", what: "stop the run on the first failure" },
109
- { flag: "--skip-project-sync", def: "off", what: "skip the main-sync preflight" }
110
- ];
111
- function runSubcommand(subs) {
112
- return subs.find((sub) => sub.base[0] === "run") ?? subs[0];
113
- }
114
- var renderQueue = (ctx) => {
115
- const lines = [];
116
- lines.push(line(ctx.snap.summary || "Run task queues locally.", { fg: RIG_UI.ink3 }));
117
- lines.push(blank());
118
- lines.push(line("\u25CF QUEUE CONTROL \xB7 no live state probe (queue is run-only)", { fg: RIG_UI.cyan, bold: true }));
119
- lines.push(line(" Drains pending task work locally through a pool of parallel workers.", { fg: RIG_UI.ink2 }));
120
- lines.push(line(" Each pulled task runs its action stage, optionally in an isolated worktree.", { fg: RIG_UI.ink2 }));
121
- lines.push(line(" Configure the run below, then launch the worker pool.", { fg: RIG_UI.ink2 }));
122
- lines.push(blank());
123
- lines.push(heading("RUN OPTIONS"));
124
- for (const opt of RUN_OPTIONS) {
125
- lines.push(metric(opt.flag, `${opt.what} \xB7 default ${opt.def}`));
126
- }
127
- lines.push(blank());
128
- lines.push(heading("CONTROLS"));
129
- const run = runSubcommand(ctx.snap.subcommands);
130
- if (run) {
131
- lines.push(ctx.cursor.deck({ label: `\u25B6 queue ${run.base.join(" ") || "run"}`.trim(), detail: "launch the local worker pool \u2014 drain pending tasks" }, actionItemFor(ctx.family, run)));
132
- }
133
- for (const sub of ctx.snap.subcommands) {
134
- if (sub === run)
135
- continue;
136
- lines.push(ctx.cursor.deck({ label: sub.base.join(" ") || ctx.family, detail: sub.description }, actionItemFor(ctx.family, sub)));
137
- }
138
- if (ctx.snap.subcommands.length === 0) {
139
- lines.push(line(" (no queue controls available)", { fg: RIG_UI.ink4 }));
140
- }
141
- lines.push(blank());
142
- lines.push(line("enter a control: direct commands run \xB7 parameterized commands open a form", { fg: RIG_UI.ink4 }));
143
- return lines;
144
- };
145
- export {
146
- renderQueue
147
- };
@@ -1,2 +0,0 @@
1
- import { type DomainRenderer } from "./kit";
2
- export declare const renderRemote: DomainRenderer;
@@ -1,519 +0,0 @@
1
- // @bun
2
- // packages/cli/src/app-opentui/theme.ts
3
- import {
4
- bold as otuiBold,
5
- dim as otuiDim,
6
- fg as otuiFg,
7
- t,
8
- TextAttributes
9
- } from "@opentui/core";
10
- var RIG_UI = {
11
- bg: "#070809",
12
- bg2: "#0b0c0e",
13
- panel: "#101115",
14
- panel2: "#14161b",
15
- hover: "#181b24",
16
- glass: "#1e2230",
17
- border: "#2a2e3a",
18
- ink: "#f4f5f8",
19
- ink2: "#c7c9d3",
20
- ink3: "#9aa0ae",
21
- ink4: "#787b86",
22
- lime: "#ccff4d",
23
- limeDim: "#a9d63f",
24
- cyan: "#56d8ff",
25
- cyanDim: "#3f9fbd",
26
- red: "#ff5d5d",
27
- yellow: "#ffd24d",
28
- magenta: "#ff79b0"
29
- };
30
- var styles = {
31
- ink: otuiFg(RIG_UI.ink),
32
- ink2: otuiFg(RIG_UI.ink2),
33
- ink3: otuiFg(RIG_UI.ink3),
34
- ink4: otuiFg(RIG_UI.ink4),
35
- lime: otuiFg(RIG_UI.lime),
36
- limeDim: otuiFg(RIG_UI.limeDim),
37
- cyan: otuiFg(RIG_UI.cyan),
38
- red: otuiFg(RIG_UI.red),
39
- yellow: otuiFg(RIG_UI.yellow),
40
- magenta: otuiFg(RIG_UI.magenta)
41
- };
42
- function statusColor(status) {
43
- switch (status) {
44
- case "success":
45
- case "completed":
46
- case "merged":
47
- return RIG_UI.lime;
48
- case "running":
49
- case "preparing":
50
- case "created":
51
- case "validating":
52
- case "reviewing":
53
- case "closing-out":
54
- case "stopping":
55
- case "loading":
56
- case "action":
57
- return RIG_UI.cyan;
58
- case "needs-attention":
59
- case "needs_attention":
60
- return RIG_UI.yellow;
61
- case "failed":
62
- case "error":
63
- return RIG_UI.red;
64
- default:
65
- return RIG_UI.ink3;
66
- }
67
- }
68
- function statusGlyph(status) {
69
- switch (status) {
70
- case "success":
71
- case "completed":
72
- case "merged":
73
- return "\u2713";
74
- case "running":
75
- return "\u25CF";
76
- case "preparing":
77
- case "created":
78
- case "validating":
79
- case "reviewing":
80
- case "closing-out":
81
- case "stopping":
82
- case "loading":
83
- case "action":
84
- return "\u25D0";
85
- case "needs-attention":
86
- case "needs_attention":
87
- return "\u26A0";
88
- case "failed":
89
- case "error":
90
- return "\u2717";
91
- default:
92
- return "\xB7";
93
- }
94
- }
95
- function noColorActive() {
96
- const noColor = process.env.NO_COLOR;
97
- if (noColor !== undefined && noColor !== "") {
98
- return true;
99
- }
100
- return process.env.RIG_NO_COLOR !== undefined;
101
- }
102
- function statusLabel(status) {
103
- return {
104
- glyph: statusGlyph(status),
105
- color: noColorActive() ? RIG_UI.ink : statusColor(status)
106
- };
107
- }
108
-
109
- // packages/cli/src/app-opentui/drone.ts
110
- import { RGBA, StyledText, TextAttributes as TextAttributes2 } from "@opentui/core";
111
- var COLOR = {
112
- body: RGBA.fromHex(RIG_UI.lime),
113
- mini: RGBA.fromHex(RIG_UI.limeDim),
114
- rotor: RGBA.fromHex(RIG_UI.cyan),
115
- path: RGBA.fromHex(RIG_UI.cyan),
116
- eye: RGBA.fromHex(RIG_UI.ink),
117
- dim: RGBA.fromHex(RIG_UI.ink4),
118
- ink: RGBA.fromHex(RIG_UI.ink2)
119
- };
120
-
121
- // packages/cli/src/app-opentui/render/scene.ts
122
- function line(text, options = {}) {
123
- return { text, ...options };
124
- }
125
- function blank() {
126
- return { text: "" };
127
- }
128
-
129
- // packages/cli/src/app-opentui/fleet-stats.ts
130
- var ACTIVE_STATUSES = new Set([
131
- "running",
132
- "preparing",
133
- "created",
134
- "validating",
135
- "reviewing",
136
- "closing-out",
137
- "stopping",
138
- "loading"
139
- ]);
140
- var BAR_CHARS = ["\u258F", "\u258E", "\u258D", "\u258C", "\u258B", "\u258A", "\u2589", "\u2588"];
141
- function barString(ratio, width) {
142
- if (width <= 0)
143
- return "";
144
- const clamped = Math.max(0, Math.min(1, ratio));
145
- const totalEighths = Math.round(clamped * width * 8);
146
- const full = Math.floor(totalEighths / 8);
147
- const remainder = totalEighths % 8;
148
- let bar = "\u2588".repeat(Math.min(width, full));
149
- if (full < width && remainder > 0)
150
- bar += BAR_CHARS[remainder - 1];
151
- return bar.padEnd(width, " ").slice(0, width);
152
- }
153
-
154
- // packages/cli/src/app-opentui/scenes/family-domains/kit.ts
155
- function relativeTime(iso, now = Date.now()) {
156
- if (!iso)
157
- return "";
158
- const then = Date.parse(iso);
159
- if (!Number.isFinite(then))
160
- return "";
161
- const deltaMs = now - then;
162
- if (deltaMs < 0)
163
- return "just now";
164
- const seconds = Math.floor(deltaMs / 1000);
165
- if (seconds < 60)
166
- return "just now";
167
- const minutes = Math.floor(seconds / 60);
168
- if (minutes < 60)
169
- return `${minutes}m ago`;
170
- const hours = Math.floor(minutes / 60);
171
- if (hours < 24)
172
- return `${hours}h ago`;
173
- const days = Math.floor(hours / 24);
174
- return `${days}d ago`;
175
- }
176
- function actionItemFor(family, sub) {
177
- const base = sub.base.join(" ");
178
- if (sub.direct) {
179
- const label = `run rig ${family} ${base}`.trim();
180
- return {
181
- id: `action:${sub.id}`,
182
- label,
183
- intent: { scene: "command", argv: [family, ...sub.base], action: { kind: "command-run", label: `Run rig ${family} ${base}`.trim(), payload: { argv: [family, ...sub.base], family } } },
184
- message: label
185
- };
186
- }
187
- return {
188
- id: `action:${sub.id}`,
189
- label: `configure ${family} ${base}`.trim(),
190
- intent: { scene: "family", argv: [family], action: { kind: "refresh", label: `Configure ${sub.template}`, payload: { family, formSub: sub.id } } },
191
- message: `configure & run rig ${family} ${sub.template}`
192
- };
193
- }
194
- function actionDetail(sub) {
195
- return sub.direct ? sub.description : `${sub.description} \xB7 ${sub.fields.length} field${sub.fields.length === 1 ? "" : "s"}`;
196
- }
197
- function detailText(details, key) {
198
- const value = details?.[key];
199
- if (value === undefined || value === null)
200
- return;
201
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean")
202
- return String(value);
203
- return;
204
- }
205
- function metric(label, value, opts = {}) {
206
- return line(` ${label.padEnd(22)} ${value}`, { fg: opts.fg ?? RIG_UI.ink2, bold: opts.bold });
207
- }
208
- function heading(text) {
209
- return line(text, { fg: RIG_UI.ink, bold: true });
210
- }
211
-
212
- // packages/cli/src/app-opentui/scenes/family-domains/remote.ts
213
- function asRecord(value) {
214
- return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
215
- }
216
- function pickBool(rec, keys) {
217
- if (!rec)
218
- return;
219
- for (const key of keys) {
220
- const v = rec[key];
221
- if (typeof v === "boolean")
222
- return v;
223
- }
224
- return;
225
- }
226
- function pickScalar(rec, keys) {
227
- if (!rec)
228
- return;
229
- for (const key of keys) {
230
- const v = rec[key];
231
- if (typeof v === "string" && v.trim().length > 0)
232
- return v;
233
- if (typeof v === "number" && Number.isFinite(v))
234
- return String(v);
235
- }
236
- return;
237
- }
238
- function pickNumber(rec, keys) {
239
- if (!rec)
240
- return;
241
- for (const key of keys) {
242
- const v = rec[key];
243
- if (typeof v === "number" && Number.isFinite(v))
244
- return v;
245
- if (typeof v === "string" && v.trim().length > 0 && Number.isFinite(Number(v)))
246
- return Number(v);
247
- }
248
- return;
249
- }
250
- function readEndpoints(details) {
251
- const raw = details?.["endpoints"];
252
- if (!Array.isArray(raw))
253
- return [];
254
- const rows = [];
255
- for (const entry of raw) {
256
- const rec = asRecord(entry);
257
- if (!rec)
258
- continue;
259
- const alias = pickScalar(rec, ["alias"]) ?? "";
260
- const host = pickScalar(rec, ["host"]) ?? "";
261
- if (!alias && !host)
262
- continue;
263
- const tokenConfigured = pickBool(rec, ["tokenConfigured"]) ?? false;
264
- rows.push({
265
- alias: alias || "\u2014",
266
- host,
267
- port: pickScalar(rec, ["port"]) ?? "",
268
- lastConnected: pickScalar(rec, ["lastConnected"]) ?? null,
269
- tokenConfigured
270
- });
271
- }
272
- return rows;
273
- }
274
- function readRemoteTasks(state) {
275
- if (!state)
276
- return [];
277
- const candidates = [state["tasks"], state["taskList"], state["queue"]];
278
- const raw = candidates.find((value) => Array.isArray(value));
279
- if (!Array.isArray(raw))
280
- return [];
281
- const tasks = [];
282
- for (const entry of raw) {
283
- const rec = asRecord(entry);
284
- if (!rec)
285
- continue;
286
- const id = pickScalar(rec, ["id", "taskId", "name"]) ?? "";
287
- if (!id)
288
- continue;
289
- tasks.push({
290
- id,
291
- status: pickScalar(rec, ["status", "state"]) ?? "unknown",
292
- title: pickScalar(rec, ["title", "summary", "description"]) ?? ""
293
- });
294
- }
295
- return tasks;
296
- }
297
- function readRemote(details) {
298
- const conn = asRecord(details?.["remote"]);
299
- const payload = asRecord(details?.["payload"]);
300
- const state = asRecord(payload?.["state"]) ?? asRecord(details?.["state"]);
301
- return { conn, state };
302
- }
303
- function deriveStatus(ran, ok, paused, running) {
304
- if (!ran)
305
- return { status: "loading", paused: false, running: false };
306
- if (!ok)
307
- return { status: "failed", paused: false, running: false };
308
- if (paused === true)
309
- return { status: "needs-attention", paused: true, running: false };
310
- if (running === true || paused === false)
311
- return { status: "running", paused: false, running: true };
312
- return { status: "success", paused: false, running: false };
313
- }
314
- function baseKey(sub) {
315
- return sub.base.join(" ");
316
- }
317
- var GUTTER = " ";
318
- var TASK_COL = { id: 18, status: 14 };
319
- var ENDPOINT_COL = { alias: 16, host: 26, last: 12 };
320
- function endpointFormRow(ctx, sub, label, message) {
321
- return {
322
- id: `remote-endpoint:${sub.id}`,
323
- label,
324
- intent: { scene: "family", argv: [ctx.family], action: { kind: "refresh", label, payload: { family: ctx.family, formSub: sub.id } } },
325
- message
326
- };
327
- }
328
- function endpointDataRow(alias) {
329
- const argv = ["remote", "endpoint", "test", "--alias", alias];
330
- const label = `test endpoint ${alias}`;
331
- return {
332
- id: `remote-endpoint-row:${alias}`,
333
- label,
334
- intent: { scene: "command", argv: [...argv], action: { kind: "command-run", label: `rig ${argv.join(" ")}`, payload: { argv: [...argv], family: "remote" } } },
335
- message: `ping configured endpoint ${alias}`
336
- };
337
- }
338
- var renderRemote = (ctx) => {
339
- const lines = [];
340
- lines.push(line(ctx.snap.summary, { fg: RIG_UI.ink3 }));
341
- lines.push(blank());
342
- const { conn, state } = readRemote(ctx.details);
343
- const paused = pickBool(state, ["isPaused", "paused", "isHalted"]);
344
- const running = pickBool(state, ["isRunning", "running", "active", "isActive"]);
345
- const { status, paused: isPaused, running: isRunning } = deriveStatus(ctx.state.ran, ctx.state.ok, paused, running);
346
- const { glyph, color } = statusLabel(status);
347
- const host = detailText(conn, "host");
348
- const port = detailText(conn, "port");
349
- const alias = detailText(conn, "alias");
350
- const source = detailText(conn, "source");
351
- const target = host ? `${host}${port ? `:${port}` : ""}` : alias ?? "(no endpoint resolved)";
352
- const reachable = ctx.state.ran && ctx.state.ok;
353
- const stateWord = !ctx.state.ran ? "probing\u2026" : isPaused ? "PAUSED" : isRunning ? "RUNNING" : ctx.state.ok ? "connected \xB7 idle" : "unreachable";
354
- lines.push(line(`${glyph} REMOTE ORCHESTRATION \xB7 ${stateWord}`, { fg: color, bold: true }));
355
- lines.push(blank());
356
- lines.push(line(`${GUTTER}${"ALIAS".padEnd(14)}${GUTTER}${"HOST:PORT".padEnd(26)}${GUTTER}${"SOURCE".padEnd(8)}${GUTTER}REACHABLE`, { fg: RIG_UI.ink, bold: true, bg: RIG_UI.glass }));
357
- const reach = !ctx.state.ran ? "\u2026" : reachable ? "\u25CF yes" : "\u2717 no";
358
- const reachFg = !ctx.state.ran ? RIG_UI.ink3 : reachable ? RIG_UI.lime : RIG_UI.red;
359
- lines.push(line(`${GUTTER}${(alias ?? "\u2014").padEnd(14)}${GUTTER}${target.padEnd(26)}${GUTTER}${(source ?? "\u2014").padEnd(8)}${GUTTER}`, { fg: RIG_UI.ink2 }));
360
- lines.push(line(`${GUTTER}\u21B3 reachable: ${reach}`, { fg: reachFg }));
361
- const endpoints = readEndpoints(ctx.details);
362
- const now = Date.now();
363
- if (endpoints.length > 0) {
364
- lines.push(blank());
365
- lines.push(line(`${GUTTER}REGISTRY \xB7 ${endpoints.length} configured endpoint${endpoints.length === 1 ? "" : "s"}`, { fg: RIG_UI.ink3, bold: true }));
366
- lines.push(line(`${GUTTER} ${"ALIAS".padEnd(ENDPOINT_COL.alias)}${GUTTER}${"HOST:PORT".padEnd(ENDPOINT_COL.host)}${GUTTER}${"TOKEN".padEnd(6)}${GUTTER}${"LAST".padEnd(ENDPOINT_COL.last)}`, { fg: RIG_UI.ink, bold: true, bg: RIG_UI.glass }));
367
- for (const ep of endpoints) {
368
- const active = ctx.cursor.index === ctx.selected;
369
- const isResolved = alias !== undefined && ep.alias === alias;
370
- const hostPort = ep.host ? `${ep.host}${ep.port ? `:${ep.port}` : ""}` : "\u2014";
371
- const hpCell = hostPort.length > ENDPOINT_COL.host ? `${hostPort.slice(0, ENDPOINT_COL.host - 1)}\u2026` : hostPort;
372
- const aliasCell = ep.alias.length > ENDPOINT_COL.alias ? `${ep.alias.slice(0, ENDPOINT_COL.alias - 1)}\u2026` : ep.alias;
373
- const tokenCell = ep.tokenConfigured ? "\u25CF set" : "\u2717 \u2014";
374
- const last = ep.lastConnected ? relativeTime(ep.lastConnected, now) || "\u2014" : "never";
375
- const marker = active ? "\u258C " : " ";
376
- const dot = isResolved ? "\u203A " : " ";
377
- const content = line(`${GUTTER}${marker}${dot}${aliasCell.padEnd(ENDPOINT_COL.alias)}${GUTTER}${hpCell.padEnd(ENDPOINT_COL.host)}${GUTTER}${tokenCell.padEnd(6)}${GUTTER}${last.padEnd(ENDPOINT_COL.last)}`, {
378
- fg: active ? RIG_UI.ink : RIG_UI.ink2,
379
- ...active ? { bg: RIG_UI.glass } : {}
380
- });
381
- lines.push(ctx.cursor.row(content, endpointDataRow(ep.alias)));
382
- }
383
- lines.push(line(`${GUTTER} \u203A marks the resolved endpoint \xB7 select a row to test it`, { fg: RIG_UI.ink4 }));
384
- }
385
- const subs = ctx.snap.subcommands;
386
- const byKey = new Map;
387
- for (const sub of subs)
388
- byKey.set(baseKey(sub), sub);
389
- const used = new Set;
390
- const endpointVerbs = [
391
- { key: "endpoint add", label: "add endpoint", message: "register a new remote endpoint" },
392
- { key: "endpoint remove", label: "remove endpoint", message: "remove a configured remote endpoint" },
393
- { key: "endpoint test", label: "test endpoint", message: "ping a configured remote endpoint" },
394
- { key: "endpoint list", label: "list endpoints", message: "list all configured remote endpoints" }
395
- ];
396
- const endpointRows = [];
397
- for (const verb of endpointVerbs) {
398
- const sub = byKey.get(verb.key);
399
- if (!sub)
400
- continue;
401
- used.add(verb.key);
402
- endpointRows.push(ctx.cursor.deck({ label: verb.label, detail: actionDetail(sub) }, endpointFormRow(ctx, sub, verb.label, verb.message)));
403
- }
404
- if (endpointRows.length > 0) {
405
- lines.push(line(" endpoint actions:", { fg: RIG_UI.ink4 }));
406
- lines.push(...endpointRows);
407
- }
408
- lines.push(blank());
409
- const currentIteration = pickNumber(state, ["currentIteration", "iteration", "iterationsUsed"]);
410
- const maxIterations = pickNumber(state, ["maxIterations", "maxIteration", "iterationBudget"]);
411
- const counters = [
412
- ["tasks", pickScalar(state, ["taskCount", "totalTasks", "tasks"])],
413
- ["workers", pickScalar(state, ["maxWorkers", "workers", "activeWorkers"])],
414
- ["orchestration", pickScalar(state, ["orchestrationId", "orchestration"])],
415
- ["model", pickScalar(state, ["model", "agentModel"])]
416
- ];
417
- const hasCounters = counters.some(([, v]) => v !== undefined) || currentIteration !== undefined || maxIterations !== undefined;
418
- if (hasCounters) {
419
- lines.push(heading("RUN STATE"));
420
- if (currentIteration !== undefined && maxIterations !== undefined && maxIterations > 0) {
421
- const ratio = Math.min(1, currentIteration / maxIterations);
422
- const bar = barString(ratio, 24);
423
- const barFg = ratio >= 1 ? RIG_UI.red : ratio >= 0.8 ? RIG_UI.yellow : RIG_UI.lime;
424
- lines.push(line(` ${"iteration budget".padEnd(22)} ${bar} ${currentIteration}/${maxIterations}`, { fg: barFg }));
425
- } else if (currentIteration !== undefined) {
426
- lines.push(metric("iteration", String(currentIteration)));
427
- } else if (maxIterations !== undefined) {
428
- lines.push(metric("max iterations", String(maxIterations)));
429
- }
430
- for (const [label, value] of counters) {
431
- if (value !== undefined)
432
- lines.push(metric(label, value));
433
- }
434
- lines.push(blank());
435
- }
436
- const tasks = readRemoteTasks(state);
437
- if (tasks.length > 0) {
438
- lines.push(heading("REMOTE TASKS"));
439
- lines.push(line(`${GUTTER}${"TASK".padEnd(TASK_COL.id)}${GUTTER}${"STATUS".padEnd(TASK_COL.status)}${GUTTER}TITLE`, { fg: RIG_UI.ink, bold: true, bg: RIG_UI.glass }));
440
- for (const task of tasks.slice(0, 20)) {
441
- const taskStatus = statusLabel(task.status);
442
- const id = task.id.length > TASK_COL.id ? `${task.id.slice(0, TASK_COL.id - 1)}\u2026` : task.id;
443
- const statusCell = `${taskStatus.glyph} ${task.status}`;
444
- const statusClipped = statusCell.length > TASK_COL.status ? `${statusCell.slice(0, TASK_COL.status - 1)}\u2026` : statusCell;
445
- lines.push(line(`${GUTTER}${id.padEnd(TASK_COL.id)}${GUTTER}${statusClipped.padEnd(TASK_COL.status)}${GUTTER}${task.title}`, { fg: RIG_UI.ink2 }));
446
- }
447
- lines.push(blank());
448
- }
449
- const hasStructured = state !== null && Object.keys(state).length > 0;
450
- if (ctx.state.ran && !hasStructured) {
451
- if (ctx.state.lines.length === 0)
452
- lines.push(line(" (no state output)", { fg: RIG_UI.ink4 }));
453
- else
454
- for (const text of ctx.state.lines.slice(0, 24))
455
- lines.push(line(` ${text}`, { fg: RIG_UI.ink2 }));
456
- lines.push(blank());
457
- }
458
- if (!ctx.state.ran) {
459
- lines.push(line(" remote status pending \u2014 run `status` below to connect", { fg: RIG_UI.ink4 }));
460
- lines.push(blank());
461
- }
462
- const pushRow = (sub, detailOverride) => {
463
- used.add(baseKey(sub));
464
- lines.push(ctx.cursor.deck({ label: baseKey(sub) || ctx.family, detail: detailOverride ?? actionDetail(sub) }, actionItemFor(ctx.family, sub)));
465
- };
466
- const flowKeys = ["status", "tasks", "watch", "pause", "resume", "continue", "stop", "refresh"];
467
- const flowSubs = flowKeys.map((k) => byKey.get(k)).filter((s) => s !== undefined);
468
- if (flowSubs.length > 0) {
469
- lines.push(heading("FLOW CONTROLS"));
470
- for (const sub of flowSubs) {
471
- const key = baseKey(sub);
472
- let detail;
473
- if (key === "pause")
474
- detail = isRunning ? "halt the running remote \xB7 resume to continue" : "halt the remote run (idle)";
475
- else if (key === "resume")
476
- detail = isPaused ? "resume the PAUSED remote run" : "resume a paused remote run";
477
- else if (key === "stop")
478
- detail = isRunning || isPaused ? "interrupt the active remote run" : "interrupt the remote run";
479
- else if (key === "watch")
480
- detail = "stream remote events live";
481
- else if (key === "status")
482
- detail = "re-probe remote run state";
483
- pushRow(sub, detail);
484
- }
485
- lines.push(blank());
486
- }
487
- const tuneKeys = [
488
- "add-iterations",
489
- "remove-iterations",
490
- "prompt-preview",
491
- "iteration-output"
492
- ];
493
- const tuneSubs = tuneKeys.map((k) => byKey.get(k)).filter((s) => s !== undefined);
494
- if (tuneSubs.length > 0) {
495
- lines.push(heading("RUN TUNING"));
496
- for (const sub of tuneSubs)
497
- pushRow(sub);
498
- lines.push(blank());
499
- }
500
- const orchSubs = subs.filter((s) => baseKey(s).startsWith("orchestrate") && !used.has(baseKey(s)));
501
- if (orchSubs.length > 0) {
502
- lines.push(heading("ORCHESTRATION"));
503
- for (const sub of orchSubs)
504
- pushRow(sub);
505
- lines.push(blank());
506
- }
507
- const rest = subs.filter((s) => !used.has(baseKey(s)));
508
- if (rest.length > 0) {
509
- lines.push(heading("MORE"));
510
- for (const sub of rest)
511
- pushRow(sub);
512
- lines.push(blank());
513
- }
514
- lines.push(line("enter a control: direct commands run \xB7 parameterized commands open a form", { fg: RIG_UI.ink4 }));
515
- return lines;
516
- };
517
- export {
518
- renderRemote
519
- };
@@ -1,2 +0,0 @@
1
- import { type DomainRenderer } from "./kit";
2
- export declare const renderReview: DomainRenderer;