@h-rig/cli 0.0.6-alpha.83 → 0.0.6-alpha.85

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 (163) hide show
  1. package/dist/bin/rig.js +22060 -14620
  2. package/dist/src/app/board.js +155 -28
  3. package/dist/src/app-opentui/adapters/doctor.d.ts +0 -2
  4. package/dist/src/app-opentui/adapters/doctor.js +1 -25
  5. package/dist/src/app-opentui/adapters/family.d.ts +62 -0
  6. package/dist/src/app-opentui/adapters/family.js +14305 -0
  7. package/dist/src/app-opentui/adapters/fleet.d.ts +0 -2
  8. package/dist/src/app-opentui/adapters/fleet.js +6 -40
  9. package/dist/src/app-opentui/adapters/inbox.d.ts +12 -2
  10. package/dist/src/app-opentui/adapters/inbox.js +54 -59
  11. package/dist/src/app-opentui/adapters/init.d.ts +0 -2
  12. package/dist/src/app-opentui/adapters/init.js +0 -26
  13. package/dist/src/app-opentui/adapters/inspect.d.ts +52 -0
  14. package/dist/src/app-opentui/adapters/inspect.js +1024 -0
  15. package/dist/src/app-opentui/adapters/pi-attach.d.ts +15 -6
  16. package/dist/src/app-opentui/adapters/pi-attach.js +348 -93
  17. package/dist/src/app-opentui/adapters/pi.d.ts +23 -0
  18. package/dist/src/app-opentui/adapters/pi.js +363 -0
  19. package/dist/src/app-opentui/adapters/plugin.d.ts +84 -0
  20. package/dist/src/app-opentui/adapters/plugin.js +544 -0
  21. package/dist/src/app-opentui/adapters/repo.d.ts +37 -0
  22. package/dist/src/app-opentui/adapters/repo.js +186 -0
  23. package/dist/src/app-opentui/adapters/run-detail.d.ts +9 -2
  24. package/dist/src/app-opentui/adapters/run-detail.js +97 -44
  25. package/dist/src/app-opentui/adapters/server.d.ts +10 -2
  26. package/dist/src/app-opentui/adapters/server.js +96 -27
  27. package/dist/src/app-opentui/adapters/tasks.d.ts +0 -2
  28. package/dist/src/app-opentui/adapters/tasks.js +437 -105
  29. package/dist/src/app-opentui/adapters/workspace.d.ts +49 -0
  30. package/dist/src/app-opentui/adapters/workspace.js +333 -0
  31. package/dist/src/app-opentui/autocomplete.d.ts +20 -0
  32. package/dist/src/app-opentui/autocomplete.js +576 -0
  33. package/dist/src/app-opentui/bootstrap.js +24313 -16963
  34. package/dist/src/app-opentui/command-palette.d.ts +3 -0
  35. package/dist/src/app-opentui/command-palette.js +1010 -0
  36. package/dist/src/app-opentui/drone.js +8 -6
  37. package/dist/src/app-opentui/fleet-stats.d.ts +32 -0
  38. package/dist/src/app-opentui/fleet-stats.js +114 -0
  39. package/dist/src/app-opentui/index.js +3438 -1724
  40. package/dist/src/app-opentui/intent.js +71 -48
  41. package/dist/src/app-opentui/keymap.d.ts +6 -5
  42. package/dist/src/app-opentui/keymap.js +1064 -23
  43. package/dist/src/app-opentui/layout.d.ts +7 -0
  44. package/dist/src/app-opentui/layout.js +13 -6
  45. package/dist/src/app-opentui/list-search.d.ts +24 -0
  46. package/dist/src/app-opentui/list-search.js +88 -1
  47. package/dist/src/app-opentui/pi-host-child.js +33 -1
  48. package/dist/src/app-opentui/pi-pty-host.d.ts +5 -0
  49. package/dist/src/app-opentui/pi-pty-host.js +21 -3
  50. package/dist/src/app-opentui/react/App.d.ts +9 -0
  51. package/dist/src/app-opentui/react/App.js +5099 -0
  52. package/dist/src/app-opentui/react/Backdrop.d.ts +5 -0
  53. package/dist/src/app-opentui/react/Backdrop.js +829 -0
  54. package/dist/src/app-opentui/react/ChromeHost.d.ts +5 -0
  55. package/dist/src/app-opentui/react/ChromeHost.js +2942 -0
  56. package/dist/src/app-opentui/react/SceneFrameView.d.ts +7 -0
  57. package/dist/src/app-opentui/react/SceneFrameView.js +529 -0
  58. package/dist/src/app-opentui/react/context.d.ts +17 -0
  59. package/dist/src/app-opentui/react/context.js +37 -0
  60. package/dist/src/app-opentui/react/launch.d.ts +2 -0
  61. package/dist/src/app-opentui/react/launch.js +5698 -0
  62. package/dist/src/app-opentui/react/nav.d.ts +18 -0
  63. package/dist/src/app-opentui/react/nav.js +54 -0
  64. package/dist/src/app-opentui/react/scroll.d.ts +12 -0
  65. package/dist/src/app-opentui/react/scroll.js +21 -0
  66. package/dist/src/app-opentui/react/syntax.d.ts +2 -0
  67. package/dist/src/app-opentui/react/syntax.js +64 -0
  68. package/dist/src/app-opentui/registry.js +19923 -5151
  69. package/dist/src/app-opentui/render/constants.d.ts +31 -0
  70. package/dist/src/app-opentui/render/constants.js +66 -0
  71. package/dist/src/app-opentui/render/graphics.d.ts +2 -1
  72. package/dist/src/app-opentui/render/graphics.js +106 -39
  73. package/dist/src/app-opentui/render/image-visual-layer-worker.js +108 -20
  74. package/dist/src/app-opentui/render/image-visual-layer.d.ts +7 -0
  75. package/dist/src/app-opentui/render/image-visual-layer.js +109 -20
  76. package/dist/src/app-opentui/render/native-host.d.ts +37 -0
  77. package/dist/src/app-opentui/render/native-host.js +179 -0
  78. package/dist/src/app-opentui/render/panels.js +18 -11
  79. package/dist/src/app-opentui/render/preloader.js +8 -6
  80. package/dist/src/app-opentui/render/scene.d.ts +50 -1
  81. package/dist/src/app-opentui/render/scene.js +183 -6
  82. package/dist/src/app-opentui/render/text.d.ts +7 -1
  83. package/dist/src/app-opentui/render/text.js +10 -7
  84. package/dist/src/app-opentui/render/type-bar.js +69 -30
  85. package/dist/src/app-opentui/runtime.d.ts +44 -1
  86. package/dist/src/app-opentui/runtime.js +3231 -1363
  87. package/dist/src/app-opentui/scenes/command.js +20 -6
  88. package/dist/src/app-opentui/scenes/doctor.js +176 -11
  89. package/dist/src/app-opentui/scenes/error.js +20 -10
  90. package/dist/src/app-opentui/scenes/family-domains/agent.d.ts +2 -0
  91. package/dist/src/app-opentui/scenes/family-domains/agent.js +348 -0
  92. package/dist/src/app-opentui/scenes/family-domains/browser.d.ts +2 -0
  93. package/dist/src/app-opentui/scenes/family-domains/browser.js +195 -0
  94. package/dist/src/app-opentui/scenes/family-domains/dist.d.ts +2 -0
  95. package/dist/src/app-opentui/scenes/family-domains/dist.js +243 -0
  96. package/dist/src/app-opentui/scenes/family-domains/git.d.ts +2 -0
  97. package/dist/src/app-opentui/scenes/family-domains/git.js +195 -0
  98. package/dist/src/app-opentui/scenes/family-domains/github.d.ts +2 -0
  99. package/dist/src/app-opentui/scenes/family-domains/github.js +274 -0
  100. package/dist/src/app-opentui/scenes/family-domains/harness.d.ts +2 -0
  101. package/dist/src/app-opentui/scenes/family-domains/harness.js +152 -0
  102. package/dist/src/app-opentui/scenes/family-domains/index.d.ts +4 -0
  103. package/dist/src/app-opentui/scenes/family-domains/index.js +1679 -0
  104. package/dist/src/app-opentui/scenes/family-domains/kit.d.ts +76 -0
  105. package/dist/src/app-opentui/scenes/family-domains/kit.js +305 -0
  106. package/dist/src/app-opentui/scenes/family-domains/profile.d.ts +2 -0
  107. package/dist/src/app-opentui/scenes/family-domains/profile.js +212 -0
  108. package/dist/src/app-opentui/scenes/family-domains/queue.d.ts +2 -0
  109. package/dist/src/app-opentui/scenes/family-domains/queue.js +146 -0
  110. package/dist/src/app-opentui/scenes/family-domains/remote.d.ts +2 -0
  111. package/dist/src/app-opentui/scenes/family-domains/remote.js +518 -0
  112. package/dist/src/app-opentui/scenes/family-domains/review.d.ts +2 -0
  113. package/dist/src/app-opentui/scenes/family-domains/review.js +280 -0
  114. package/dist/src/app-opentui/scenes/family-domains/setup.d.ts +2 -0
  115. package/dist/src/app-opentui/scenes/family-domains/setup.js +267 -0
  116. package/dist/src/app-opentui/scenes/family-domains/stats.d.ts +2 -0
  117. package/dist/src/app-opentui/scenes/family-domains/stats.js +370 -0
  118. package/dist/src/app-opentui/scenes/family.d.ts +3 -0
  119. package/dist/src/app-opentui/scenes/family.js +2144 -0
  120. package/dist/src/app-opentui/scenes/fleet.js +521 -31
  121. package/dist/src/app-opentui/scenes/handoff.js +204 -12
  122. package/dist/src/app-opentui/scenes/help.js +609 -40
  123. package/dist/src/app-opentui/scenes/inbox.js +278 -17
  124. package/dist/src/app-opentui/scenes/init.js +84 -39
  125. package/dist/src/app-opentui/scenes/inspect.d.ts +3 -0
  126. package/dist/src/app-opentui/scenes/inspect.js +793 -0
  127. package/dist/src/app-opentui/scenes/main.js +218 -39
  128. package/dist/src/app-opentui/scenes/pi.d.ts +3 -0
  129. package/dist/src/app-opentui/scenes/pi.js +508 -0
  130. package/dist/src/app-opentui/scenes/plugin.d.ts +3 -0
  131. package/dist/src/app-opentui/scenes/plugin.js +486 -0
  132. package/dist/src/app-opentui/scenes/repo.d.ts +3 -0
  133. package/dist/src/app-opentui/scenes/repo.js +424 -0
  134. package/dist/src/app-opentui/scenes/run-detail.js +333 -20
  135. package/dist/src/app-opentui/scenes/server.js +181 -15
  136. package/dist/src/app-opentui/scenes/tasks.js +486 -31
  137. package/dist/src/app-opentui/scenes/workspace.d.ts +3 -0
  138. package/dist/src/app-opentui/scenes/workspace.js +426 -0
  139. package/dist/src/app-opentui/selectable.d.ts +19 -0
  140. package/dist/src/app-opentui/selectable.js +79 -0
  141. package/dist/src/app-opentui/state.js +83 -30
  142. package/dist/src/app-opentui/surface-catalog.d.ts +20 -0
  143. package/dist/src/app-opentui/surface-catalog.js +540 -0
  144. package/dist/src/app-opentui/theme.d.ts +28 -6
  145. package/dist/src/app-opentui/theme.js +61 -8
  146. package/dist/src/app-opentui/types.d.ts +121 -4
  147. package/dist/src/commands/_authority-runs.d.ts +1 -1
  148. package/dist/src/commands/_authority-runs.js +2 -12
  149. package/dist/src/commands/_help-catalog.js +95 -15
  150. package/dist/src/commands/_operator-view.js +34 -2
  151. package/dist/src/commands/_pi-frontend.d.ts +2 -0
  152. package/dist/src/commands/_pi-frontend.js +34 -0
  153. package/dist/src/commands/_server-events.d.ts +26 -0
  154. package/dist/src/commands/_server-events.js +310 -0
  155. package/dist/src/commands/agent.js +2 -12
  156. package/dist/src/commands/run.js +34 -2
  157. package/dist/src/commands/server.js +2 -12
  158. package/dist/src/commands/stats.js +95 -15
  159. package/dist/src/commands/task-run-driver.js +2 -12
  160. package/dist/src/commands/task.js +131 -29
  161. package/dist/src/commands.js +192 -31
  162. package/dist/src/index.js +192 -31
  163. package/package.json +11 -9
@@ -0,0 +1,243 @@
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
+ glass: "#1e2230",
16
+ border: "#2a2e3a",
17
+ ink: "#f4f5f8",
18
+ ink2: "#c7c9d3",
19
+ ink3: "#9aa0ae",
20
+ ink4: "#787b86",
21
+ lime: "#ccff4d",
22
+ limeDim: "#a9d63f",
23
+ cyan: "#56d8ff",
24
+ cyanDim: "#3f9fbd",
25
+ red: "#ff5d5d",
26
+ yellow: "#ffd24d",
27
+ magenta: "#ff79b0"
28
+ };
29
+ var styles = {
30
+ ink: otuiFg(RIG_UI.ink),
31
+ ink2: otuiFg(RIG_UI.ink2),
32
+ ink3: otuiFg(RIG_UI.ink3),
33
+ ink4: otuiFg(RIG_UI.ink4),
34
+ lime: otuiFg(RIG_UI.lime),
35
+ limeDim: otuiFg(RIG_UI.limeDim),
36
+ cyan: otuiFg(RIG_UI.cyan),
37
+ red: otuiFg(RIG_UI.red),
38
+ yellow: otuiFg(RIG_UI.yellow),
39
+ magenta: otuiFg(RIG_UI.magenta)
40
+ };
41
+ function statusColor(status) {
42
+ switch (status) {
43
+ case "success":
44
+ case "completed":
45
+ case "merged":
46
+ return RIG_UI.lime;
47
+ case "running":
48
+ case "preparing":
49
+ case "created":
50
+ case "validating":
51
+ case "reviewing":
52
+ case "closing-out":
53
+ case "stopping":
54
+ case "loading":
55
+ case "action":
56
+ return RIG_UI.cyan;
57
+ case "needs-attention":
58
+ case "needs_attention":
59
+ return RIG_UI.yellow;
60
+ case "failed":
61
+ case "error":
62
+ return RIG_UI.red;
63
+ default:
64
+ return RIG_UI.ink3;
65
+ }
66
+ }
67
+ function statusGlyph(status) {
68
+ switch (status) {
69
+ case "success":
70
+ case "completed":
71
+ case "merged":
72
+ return "\u2713";
73
+ case "running":
74
+ return "\u25CF";
75
+ case "preparing":
76
+ case "created":
77
+ case "validating":
78
+ case "reviewing":
79
+ case "closing-out":
80
+ case "stopping":
81
+ case "loading":
82
+ case "action":
83
+ return "\u25D0";
84
+ case "needs-attention":
85
+ case "needs_attention":
86
+ return "\u26A0";
87
+ case "failed":
88
+ case "error":
89
+ return "\u2717";
90
+ default:
91
+ return "\xB7";
92
+ }
93
+ }
94
+ function noColorActive() {
95
+ const noColor = process.env.NO_COLOR;
96
+ if (noColor !== undefined && noColor !== "") {
97
+ return true;
98
+ }
99
+ return process.env.RIG_NO_COLOR !== undefined;
100
+ }
101
+ function statusLabel(status) {
102
+ return {
103
+ glyph: statusGlyph(status),
104
+ color: noColorActive() ? RIG_UI.ink : statusColor(status)
105
+ };
106
+ }
107
+
108
+ // packages/cli/src/app-opentui/drone.ts
109
+ import { RGBA, StyledText, TextAttributes as TextAttributes2 } from "@opentui/core";
110
+ var COLOR = {
111
+ body: RGBA.fromHex(RIG_UI.lime),
112
+ mini: RGBA.fromHex(RIG_UI.limeDim),
113
+ rotor: RGBA.fromHex(RIG_UI.cyan),
114
+ path: RGBA.fromHex(RIG_UI.cyan),
115
+ eye: RGBA.fromHex(RIG_UI.ink),
116
+ dim: RGBA.fromHex(RIG_UI.ink4),
117
+ ink: RGBA.fromHex(RIG_UI.ink2)
118
+ };
119
+
120
+ // packages/cli/src/app-opentui/render/scene.ts
121
+ function line(text, options = {}) {
122
+ return { text, ...options };
123
+ }
124
+ function blank() {
125
+ return { text: "" };
126
+ }
127
+
128
+ // packages/cli/src/app-opentui/fleet-stats.ts
129
+ var ACTIVE_STATUSES = new Set([
130
+ "running",
131
+ "preparing",
132
+ "created",
133
+ "validating",
134
+ "reviewing",
135
+ "closing-out",
136
+ "stopping",
137
+ "loading"
138
+ ]);
139
+
140
+ // packages/cli/src/app-opentui/scenes/family-domains/kit.ts
141
+ function actionItemFor(family, sub) {
142
+ const base = sub.base.join(" ");
143
+ if (sub.direct) {
144
+ const label = `run rig ${family} ${base}`.trim();
145
+ return {
146
+ id: `action:${sub.id}`,
147
+ label,
148
+ intent: { scene: "command", argv: [family, ...sub.base], action: { kind: "command-run", label: `Run rig ${family} ${base}`.trim(), payload: { argv: [family, ...sub.base], family } } },
149
+ message: label
150
+ };
151
+ }
152
+ return {
153
+ id: `action:${sub.id}`,
154
+ label: `configure ${family} ${base}`.trim(),
155
+ intent: { scene: "family", argv: [family], action: { kind: "refresh", label: `Configure ${sub.template}`, payload: { family, formSub: sub.id } } },
156
+ message: `configure & run rig ${family} ${sub.template}`
157
+ };
158
+ }
159
+ function actionDetail(sub) {
160
+ return sub.direct ? sub.description : `${sub.description} \xB7 ${sub.fields.length} field${sub.fields.length === 1 ? "" : "s"}`;
161
+ }
162
+ function metric(label, value, opts = {}) {
163
+ return line(` ${label.padEnd(22)} ${value}`, { fg: opts.fg ?? RIG_UI.ink2, bold: opts.bold });
164
+ }
165
+ function heading(text) {
166
+ return line(text, { fg: RIG_UI.ink, bold: true });
167
+ }
168
+
169
+ // packages/cli/src/app-opentui/scenes/family-domains/dist.ts
170
+ function asRecord(value) {
171
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
172
+ }
173
+ function asBool(value) {
174
+ return value === true;
175
+ }
176
+ function asStringOrNull(value) {
177
+ return typeof value === "string" && value.length > 0 ? value : null;
178
+ }
179
+ function checkLine(label, ok, detail) {
180
+ const { glyph, color } = statusLabel(ok ? "success" : "needs-attention");
181
+ return line(` ${glyph} ${label.padEnd(20)} ${detail}`, { fg: color });
182
+ }
183
+ var renderDist = (ctx) => {
184
+ const lines = [];
185
+ lines.push(line(ctx.snap.summary, { fg: RIG_UI.ink3 }));
186
+ lines.push(blank());
187
+ const details = ctx.details;
188
+ const bun = asRecord(details?.["bun"]);
189
+ const rig = asRecord(details?.["rig"]);
190
+ const userBinDir = asStringOrNull(details?.["userBinDir"]);
191
+ const userBinInPath = asBool(details?.["userBinInPath"]);
192
+ const latestDistBinary = asStringOrNull(details?.["latestDistBinary"]);
193
+ const hasStructured = Boolean(bun || rig || userBinDir);
194
+ if (ctx.state.ran && hasStructured) {
195
+ const bunOk = asBool(bun?.["available"]);
196
+ const bunVersion = asStringOrNull(bun?.["version"]);
197
+ const rigOnPath = asBool(rig?.["onPath"]);
198
+ const rigRunnable = asBool(rig?.["runnable"]);
199
+ const rigPath = asStringOrNull(rig?.["path"]);
200
+ const installable = Boolean(latestDistBinary);
201
+ const ready = bunOk && installable;
202
+ const top = statusLabel(ready ? "success" : "needs-attention");
203
+ lines.push(line(`${top.glyph} DISTRIBUTION ${ready ? "READY" : "NEEDS ATTENTION"}`, { fg: top.color, bold: true }));
204
+ lines.push(blank());
205
+ lines.push(heading("READINESS"));
206
+ lines.push(checkLine("bun toolchain", bunOk, bunOk ? `ok${bunVersion ? ` \xB7 v${bunVersion}` : ""}` : "missing \u2014 build needs bun"));
207
+ lines.push(checkLine("rig on PATH", rigOnPath, rigOnPath ? rigPath ?? "present" : "not on PATH"));
208
+ lines.push(checkLine("rig runnable", rigRunnable, rigRunnable ? "responds to `rig help`" : "installed rig did not run"));
209
+ lines.push(checkLine("packaged binary", installable, installable ? "built \u2014 ready to install" : "none \u2014 run `dist build`"));
210
+ lines.push(blank());
211
+ lines.push(heading("INSTALL TARGET"));
212
+ if (userBinDir) {
213
+ lines.push(metric("user bin dir", userBinDir));
214
+ lines.push(metric("on PATH", userBinInPath ? "yes" : "no \u2014 add to PATH to run rig", { fg: userBinInPath ? RIG_UI.lime : RIG_UI.yellow }));
215
+ } else {
216
+ lines.push(line(" (install location unknown)", { fg: RIG_UI.ink4 }));
217
+ }
218
+ lines.push(metric("latest dist binary", latestDistBinary ?? "none built yet", { fg: latestDistBinary ? RIG_UI.ink2 : RIG_UI.ink4 }));
219
+ lines.push(blank());
220
+ } else if (ctx.state.ran) {
221
+ const probe = statusLabel(ctx.state.ok ? "success" : "needs-attention");
222
+ lines.push(line(`${probe.glyph} DOCTOR \xB7 rig dist ${ctx.state.subcommand?.join(" ") ?? "doctor"}`, { fg: probe.color, bold: true }));
223
+ if (ctx.state.lines.length === 0)
224
+ lines.push(line(" (no output)", { fg: RIG_UI.ink4 }));
225
+ else
226
+ for (const text of ctx.state.lines.slice(0, 40))
227
+ lines.push(line(` ${text}`, { fg: RIG_UI.ink2 }));
228
+ lines.push(blank());
229
+ } else {
230
+ lines.push(line(" doctor probe did not run \u2014 select doctor below to inspect the build env", { fg: RIG_UI.ink4 }));
231
+ lines.push(blank());
232
+ }
233
+ lines.push(heading("ACTIONS"));
234
+ for (const sub of ctx.snap.subcommands) {
235
+ lines.push(ctx.cursor.deck({ label: sub.base.join(" ") || ctx.family, detail: actionDetail(sub) }, actionItemFor(ctx.family, sub)));
236
+ }
237
+ lines.push(blank());
238
+ lines.push(line("build packages the binary \xB7 install copies it onto PATH \xB7 doctor re-probes the env", { fg: RIG_UI.ink4 }));
239
+ return lines;
240
+ };
241
+ export {
242
+ renderDist
243
+ };
@@ -0,0 +1,2 @@
1
+ import { type DomainRenderer } from "./kit";
2
+ export declare const renderGit: DomainRenderer;
@@ -0,0 +1,195 @@
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
+ glass: "#1e2230",
16
+ border: "#2a2e3a",
17
+ ink: "#f4f5f8",
18
+ ink2: "#c7c9d3",
19
+ ink3: "#9aa0ae",
20
+ ink4: "#787b86",
21
+ lime: "#ccff4d",
22
+ limeDim: "#a9d63f",
23
+ cyan: "#56d8ff",
24
+ cyanDim: "#3f9fbd",
25
+ red: "#ff5d5d",
26
+ yellow: "#ffd24d",
27
+ magenta: "#ff79b0"
28
+ };
29
+ var styles = {
30
+ ink: otuiFg(RIG_UI.ink),
31
+ ink2: otuiFg(RIG_UI.ink2),
32
+ ink3: otuiFg(RIG_UI.ink3),
33
+ ink4: otuiFg(RIG_UI.ink4),
34
+ lime: otuiFg(RIG_UI.lime),
35
+ limeDim: otuiFg(RIG_UI.limeDim),
36
+ cyan: otuiFg(RIG_UI.cyan),
37
+ red: otuiFg(RIG_UI.red),
38
+ yellow: otuiFg(RIG_UI.yellow),
39
+ magenta: otuiFg(RIG_UI.magenta)
40
+ };
41
+
42
+ // packages/cli/src/app-opentui/drone.ts
43
+ import { RGBA, StyledText, TextAttributes as TextAttributes2 } from "@opentui/core";
44
+ var COLOR = {
45
+ body: RGBA.fromHex(RIG_UI.lime),
46
+ mini: RGBA.fromHex(RIG_UI.limeDim),
47
+ rotor: RGBA.fromHex(RIG_UI.cyan),
48
+ path: RGBA.fromHex(RIG_UI.cyan),
49
+ eye: RGBA.fromHex(RIG_UI.ink),
50
+ dim: RGBA.fromHex(RIG_UI.ink4),
51
+ ink: RGBA.fromHex(RIG_UI.ink2)
52
+ };
53
+
54
+ // packages/cli/src/app-opentui/render/scene.ts
55
+ function line(text, options = {}) {
56
+ return { text, ...options };
57
+ }
58
+ function blank() {
59
+ return { text: "" };
60
+ }
61
+
62
+ // packages/cli/src/app-opentui/fleet-stats.ts
63
+ var ACTIVE_STATUSES = new Set([
64
+ "running",
65
+ "preparing",
66
+ "created",
67
+ "validating",
68
+ "reviewing",
69
+ "closing-out",
70
+ "stopping",
71
+ "loading"
72
+ ]);
73
+
74
+ // packages/cli/src/app-opentui/scenes/family-domains/kit.ts
75
+ function actionItemFor(family, sub) {
76
+ const base = sub.base.join(" ");
77
+ if (sub.direct) {
78
+ const label = `run rig ${family} ${base}`.trim();
79
+ return {
80
+ id: `action:${sub.id}`,
81
+ label,
82
+ intent: { scene: "command", argv: [family, ...sub.base], action: { kind: "command-run", label: `Run rig ${family} ${base}`.trim(), payload: { argv: [family, ...sub.base], family } } },
83
+ message: label
84
+ };
85
+ }
86
+ return {
87
+ id: `action:${sub.id}`,
88
+ label: `configure ${family} ${base}`.trim(),
89
+ intent: { scene: "family", argv: [family], action: { kind: "refresh", label: `Configure ${sub.template}`, payload: { family, formSub: sub.id } } },
90
+ message: `configure & run rig ${family} ${sub.template}`
91
+ };
92
+ }
93
+ function metric(label, value, opts = {}) {
94
+ return line(` ${label.padEnd(22)} ${value}`, { fg: opts.fg ?? RIG_UI.ink2, bold: opts.bold });
95
+ }
96
+ function heading(text) {
97
+ return line(text, { fg: RIG_UI.ink, bold: true });
98
+ }
99
+
100
+ // packages/cli/src/app-opentui/scenes/family-domains/git.ts
101
+ var FLOWS = [
102
+ { verb: "status", hint: "show task-scoped worktree state \xB7 [--task <id>]" },
103
+ { verb: "changed", hint: "list changed files \xB7 [--task <id>] [--scoped]" },
104
+ { verb: "preflight", hint: "gate before commit \xB7 [--task <id>] [--strict]" },
105
+ { verb: "sync-branch", hint: "ensure the task branch exists \xB7 [--task <id>]" },
106
+ { verb: "commit", hint: "scoped commit \xB7 [--target <monorepo|project|both>] [--message <m>]" },
107
+ { verb: "snapshot", hint: "write a worktree snapshot \xB7 [--output <file>]" },
108
+ { verb: "open-pr", hint: "open the task PR \xB7 [--reviewer <u>] [--base <b>] [--title <t>] [--draft]" }
109
+ ];
110
+ function parseGitStatus(rawLines) {
111
+ let task = null;
112
+ let expectedBranch = null;
113
+ const repos = [];
114
+ let current = null;
115
+ for (const raw of rawLines) {
116
+ const text = raw.replace(/\s+$/, "");
117
+ const taskMatch = /^Task:\s*(.+)$/.exec(text.trim());
118
+ if (taskMatch) {
119
+ const value = taskMatch[1].trim();
120
+ task = value === "(none active)" ? null : value;
121
+ continue;
122
+ }
123
+ const expectedMatch = /^Expected monorepo branch:\s*(.+)$/.exec(text.trim());
124
+ if (expectedMatch) {
125
+ expectedBranch = expectedMatch[1].trim();
126
+ continue;
127
+ }
128
+ const branchMatch = /^\s+branch:\s*(.+)$/.exec(text);
129
+ if (branchMatch && current) {
130
+ current.branch = branchMatch[1].trim();
131
+ continue;
132
+ }
133
+ const changedMatch = /^\s+changed files:\s*(.+)$/.exec(text);
134
+ if (changedMatch && current) {
135
+ current.changed = changedMatch[1].trim();
136
+ continue;
137
+ }
138
+ const warnMatch = /^\s+warning:\s*(.+)$/.exec(text);
139
+ if (warnMatch && current) {
140
+ current.warning = warnMatch[1].trim();
141
+ continue;
142
+ }
143
+ const labelMatch = /^([A-Za-z][\w-]*):$/.exec(text.trim());
144
+ if (labelMatch && !text.startsWith("===")) {
145
+ current = { label: labelMatch[1], branch: "", changed: "" };
146
+ repos.push(current);
147
+ }
148
+ }
149
+ return { task, expectedBranch, repos };
150
+ }
151
+ var renderGit = (ctx) => {
152
+ const lines = [];
153
+ lines.push(line("GIT-FLOW CONSOLE \xB7 rig git <args\u2026> \u2192 Rig git-flow helper", { fg: RIG_UI.cyan, bold: true }));
154
+ lines.push(blank());
155
+ const parsed = ctx.state.ran ? parseGitStatus(ctx.state.lines) : null;
156
+ lines.push(heading("WORKTREE STATUS"));
157
+ if (parsed && parsed.repos.length > 0) {
158
+ lines.push(metric("active task", parsed.task ?? "(none active)", { fg: parsed.task ? RIG_UI.lime : RIG_UI.ink3, bold: Boolean(parsed.task) }));
159
+ if (parsed.expectedBranch)
160
+ lines.push(metric("expected branch", parsed.expectedBranch, { fg: RIG_UI.ink3 }));
161
+ lines.push(blank());
162
+ for (const repo of parsed.repos) {
163
+ lines.push(metric(`${repo.label} \xB7 branch`, repo.branch || "unknown", { fg: RIG_UI.ink, bold: true }));
164
+ const dirty = repo.changed !== "0" && repo.changed !== "";
165
+ lines.push(metric(`${repo.label} \xB7 changed`, `${repo.changed} file${repo.changed === "1" ? "" : "s"}`, { fg: dirty ? RIG_UI.yellow : RIG_UI.ink2 }));
166
+ if (repo.warning)
167
+ lines.push(metric(`${repo.label} \xB7 warning`, repo.warning, { fg: RIG_UI.red }));
168
+ }
169
+ } else if (ctx.state.ran && !ctx.state.ok) {
170
+ lines.push(metric("live probe", "rig git status returned an error (not a git repo?)", { fg: RIG_UI.red }));
171
+ } else {
172
+ lines.push(metric("live probe", "not probed yet", { fg: RIG_UI.ink3 }));
173
+ }
174
+ lines.push(blank());
175
+ lines.push(heading("RUN A GIT-FLOW COMMAND"));
176
+ const subs = ctx.snap.subcommands;
177
+ if (subs.length === 0) {
178
+ lines.push(line(" (no passthrough action in this catalog)", { fg: RIG_UI.ink4 }));
179
+ } else {
180
+ for (const sub of subs) {
181
+ lines.push(ctx.cursor.deck({ label: "enter git args", detail: "open the form \xB7 type the git-flow verb + flags, then run rig git \u2026" }, actionItemFor(ctx.family, sub)));
182
+ }
183
+ }
184
+ lines.push(blank());
185
+ lines.push(heading("FLOWS (type one into the form above)"));
186
+ for (const flow of FLOWS) {
187
+ lines.push(line(` ${flow.verb.padEnd(13)} ${flow.hint}`, { fg: RIG_UI.ink3 }));
188
+ }
189
+ lines.push(blank());
190
+ lines.push(line("enter the run row \u2192 fill <args\u2026> with e.g. `status --task <id>` \u2192 run", { fg: RIG_UI.ink4 }));
191
+ return lines;
192
+ };
193
+ export {
194
+ renderGit
195
+ };
@@ -0,0 +1,2 @@
1
+ import { type DomainRenderer } from "./kit";
2
+ export declare const renderGithub: DomainRenderer;