@h-rig/cli 0.0.6-alpha.82 → 0.0.6-alpha.84
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/dist/bin/build-rig-binaries.js +40 -8
- package/dist/bin/rig.js +23402 -14577
- package/dist/src/app/board.js +217 -41
- package/dist/src/app-opentui/adapters/command.d.ts +2 -0
- package/dist/src/app-opentui/adapters/command.js +329 -0
- package/dist/src/app-opentui/adapters/common.js +2 -2
- package/dist/src/app-opentui/adapters/doctor.d.ts +0 -2
- package/dist/src/app-opentui/adapters/doctor.js +64 -39
- package/dist/src/app-opentui/adapters/family.d.ts +62 -0
- package/dist/src/app-opentui/adapters/family.js +14305 -0
- package/dist/src/app-opentui/adapters/fleet.d.ts +0 -2
- package/dist/src/app-opentui/adapters/fleet.js +90 -60
- package/dist/src/app-opentui/adapters/inbox.d.ts +12 -2
- package/dist/src/app-opentui/adapters/inbox.js +137 -78
- package/dist/src/app-opentui/adapters/init.d.ts +0 -2
- package/dist/src/app-opentui/adapters/init.js +85 -47
- package/dist/src/app-opentui/adapters/inspect.d.ts +52 -0
- package/dist/src/app-opentui/adapters/inspect.js +1024 -0
- package/dist/src/app-opentui/adapters/pi-attach.d.ts +15 -6
- package/dist/src/app-opentui/adapters/pi-attach.js +442 -125
- package/dist/src/app-opentui/adapters/pi.d.ts +23 -0
- package/dist/src/app-opentui/adapters/pi.js +363 -0
- package/dist/src/app-opentui/adapters/plugin.d.ts +84 -0
- package/dist/src/app-opentui/adapters/plugin.js +544 -0
- package/dist/src/app-opentui/adapters/repo.d.ts +37 -0
- package/dist/src/app-opentui/adapters/repo.js +186 -0
- package/dist/src/app-opentui/adapters/run-detail.d.ts +9 -2
- package/dist/src/app-opentui/adapters/run-detail.js +180 -63
- package/dist/src/app-opentui/adapters/server.d.ts +10 -2
- package/dist/src/app-opentui/adapters/server.js +191 -45
- package/dist/src/app-opentui/adapters/tasks.d.ts +11 -2
- package/dist/src/app-opentui/adapters/tasks.js +1123 -143
- package/dist/src/app-opentui/adapters/workspace.d.ts +49 -0
- package/dist/src/app-opentui/adapters/workspace.js +333 -0
- package/dist/src/app-opentui/autocomplete.d.ts +20 -0
- package/dist/src/app-opentui/autocomplete.js +576 -0
- package/dist/src/app-opentui/bootstrap.d.ts +1 -6
- package/dist/src/app-opentui/bootstrap.js +25252 -16474
- package/dist/src/app-opentui/command-palette.d.ts +3 -0
- package/dist/src/app-opentui/command-palette.js +1010 -0
- package/dist/src/app-opentui/command-pty-host.d.ts +62 -0
- package/dist/src/app-opentui/command-pty-host.js +248 -0
- package/dist/src/app-opentui/drone.js +8 -6
- package/dist/src/app-opentui/events.js +1 -1
- package/dist/src/app-opentui/fleet-stats.d.ts +32 -0
- package/dist/src/app-opentui/fleet-stats.js +114 -0
- package/dist/src/app-opentui/focus-manager.d.ts +14 -0
- package/dist/src/app-opentui/focus-manager.js +24 -0
- package/dist/src/app-opentui/index.js +5431 -2797
- package/dist/src/app-opentui/intent.js +179 -50
- package/dist/src/app-opentui/keymap.d.ts +21 -0
- package/dist/src/app-opentui/keymap.js +1748 -0
- package/dist/src/app-opentui/launch-routing.d.ts +16 -0
- package/dist/src/app-opentui/launch-routing.js +55 -0
- package/dist/src/app-opentui/layout.d.ts +7 -0
- package/dist/src/app-opentui/layout.js +13 -6
- package/dist/src/app-opentui/list-search.d.ts +24 -0
- package/dist/src/app-opentui/list-search.js +88 -1
- package/dist/src/app-opentui/pi-host-child.js +99 -17
- package/dist/src/app-opentui/pi-pty-host.d.ts +14 -0
- package/dist/src/app-opentui/pi-pty-host.js +30 -14
- package/dist/src/app-opentui/react/App.d.ts +9 -0
- package/dist/src/app-opentui/react/App.js +5144 -0
- package/dist/src/app-opentui/react/Backdrop.d.ts +5 -0
- package/dist/src/app-opentui/react/Backdrop.js +1834 -0
- package/dist/src/app-opentui/react/ChromeHost.d.ts +5 -0
- package/dist/src/app-opentui/react/ChromeHost.js +2942 -0
- package/dist/src/app-opentui/react/SceneFrameView.d.ts +7 -0
- package/dist/src/app-opentui/react/SceneFrameView.js +529 -0
- package/dist/src/app-opentui/react/context.d.ts +17 -0
- package/dist/src/app-opentui/react/context.js +37 -0
- package/dist/src/app-opentui/react/launch.d.ts +2 -0
- package/dist/src/app-opentui/react/launch.js +5743 -0
- package/dist/src/app-opentui/react/nav.d.ts +18 -0
- package/dist/src/app-opentui/react/nav.js +54 -0
- package/dist/src/app-opentui/react/scroll.d.ts +12 -0
- package/dist/src/app-opentui/react/scroll.js +21 -0
- package/dist/src/app-opentui/react/syntax.d.ts +2 -0
- package/dist/src/app-opentui/react/syntax.js +64 -0
- package/dist/src/app-opentui/registry.js +20428 -4828
- package/dist/src/app-opentui/render/ascii-fleet.d.ts +15 -0
- package/dist/src/app-opentui/render/ascii-fleet.js +82 -0
- package/dist/src/app-opentui/render/constants.d.ts +31 -0
- package/dist/src/app-opentui/render/constants.js +66 -0
- package/dist/src/app-opentui/render/graphics.d.ts +2 -1
- package/dist/src/app-opentui/render/graphics.js +228 -46
- package/dist/src/app-opentui/render/image-visual-layer-worker.js +469 -930
- package/dist/src/app-opentui/render/image-visual-layer.d.ts +25 -10
- package/dist/src/app-opentui/render/image-visual-layer.js +448 -329
- package/dist/src/app-opentui/render/native-host.d.ts +37 -0
- package/dist/src/app-opentui/render/native-host.js +179 -0
- package/dist/src/app-opentui/render/panel-layout.d.ts +38 -0
- package/dist/src/app-opentui/render/panel-layout.js +48 -0
- package/dist/src/app-opentui/render/panels.d.ts +2 -0
- package/dist/src/app-opentui/render/panels.js +78 -38
- package/dist/src/app-opentui/render/preloader.d.ts +10 -0
- package/dist/src/app-opentui/render/preloader.js +165 -0
- package/dist/src/app-opentui/render/scene.d.ts +53 -1
- package/dist/src/app-opentui/render/scene.js +195 -6
- package/dist/src/app-opentui/render/text.d.ts +7 -1
- package/dist/src/app-opentui/render/text.js +15 -8
- package/dist/src/app-opentui/render/type-bar.d.ts +2 -1
- package/dist/src/app-opentui/render/type-bar.js +113 -39
- package/dist/src/app-opentui/runtime-resources.d.ts +16 -0
- package/dist/src/app-opentui/runtime-resources.js +62 -0
- package/dist/src/app-opentui/runtime.d.ts +44 -1
- package/dist/src/app-opentui/runtime.js +5415 -2738
- package/dist/src/app-opentui/scenes/command.d.ts +3 -0
- package/dist/src/app-opentui/scenes/command.js +117 -0
- package/dist/src/app-opentui/scenes/doctor.d.ts +2 -1
- package/dist/src/app-opentui/scenes/doctor.js +221 -17
- package/dist/src/app-opentui/scenes/error.js +60 -20
- package/dist/src/app-opentui/scenes/family-domains/agent.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/agent.js +348 -0
- package/dist/src/app-opentui/scenes/family-domains/browser.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/browser.js +195 -0
- package/dist/src/app-opentui/scenes/family-domains/dist.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/dist.js +243 -0
- package/dist/src/app-opentui/scenes/family-domains/git.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/git.js +195 -0
- package/dist/src/app-opentui/scenes/family-domains/github.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/github.js +274 -0
- package/dist/src/app-opentui/scenes/family-domains/harness.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/harness.js +152 -0
- package/dist/src/app-opentui/scenes/family-domains/index.d.ts +4 -0
- package/dist/src/app-opentui/scenes/family-domains/index.js +1679 -0
- package/dist/src/app-opentui/scenes/family-domains/kit.d.ts +76 -0
- package/dist/src/app-opentui/scenes/family-domains/kit.js +305 -0
- package/dist/src/app-opentui/scenes/family-domains/profile.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/profile.js +212 -0
- package/dist/src/app-opentui/scenes/family-domains/queue.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/queue.js +146 -0
- package/dist/src/app-opentui/scenes/family-domains/remote.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/remote.js +518 -0
- package/dist/src/app-opentui/scenes/family-domains/review.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/review.js +280 -0
- package/dist/src/app-opentui/scenes/family-domains/setup.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/setup.js +267 -0
- package/dist/src/app-opentui/scenes/family-domains/stats.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/stats.js +370 -0
- package/dist/src/app-opentui/scenes/family.d.ts +3 -0
- package/dist/src/app-opentui/scenes/family.js +2144 -0
- package/dist/src/app-opentui/scenes/fleet.js +552 -43
- package/dist/src/app-opentui/scenes/handoff.js +342 -35
- package/dist/src/app-opentui/scenes/help.js +640 -56
- package/dist/src/app-opentui/scenes/inbox.d.ts +2 -1
- package/dist/src/app-opentui/scenes/inbox.js +329 -21
- package/dist/src/app-opentui/scenes/init.d.ts +2 -1
- package/dist/src/app-opentui/scenes/init.js +120 -34
- package/dist/src/app-opentui/scenes/inspect.d.ts +3 -0
- package/dist/src/app-opentui/scenes/inspect.js +793 -0
- package/dist/src/app-opentui/scenes/main.d.ts +2 -1
- package/dist/src/app-opentui/scenes/main.js +264 -29
- package/dist/src/app-opentui/scenes/pi.d.ts +3 -0
- package/dist/src/app-opentui/scenes/pi.js +508 -0
- package/dist/src/app-opentui/scenes/plugin.d.ts +3 -0
- package/dist/src/app-opentui/scenes/plugin.js +486 -0
- package/dist/src/app-opentui/scenes/repo.d.ts +3 -0
- package/dist/src/app-opentui/scenes/repo.js +424 -0
- package/dist/src/app-opentui/scenes/run-detail.d.ts +2 -1
- package/dist/src/app-opentui/scenes/run-detail.js +362 -35
- package/dist/src/app-opentui/scenes/server.d.ts +2 -1
- package/dist/src/app-opentui/scenes/server.js +243 -26
- package/dist/src/app-opentui/scenes/tasks.js +518 -41
- package/dist/src/app-opentui/scenes/workspace.d.ts +3 -0
- package/dist/src/app-opentui/scenes/workspace.js +426 -0
- package/dist/src/app-opentui/selectable.d.ts +19 -0
- package/dist/src/app-opentui/selectable.js +79 -0
- package/dist/src/app-opentui/state.js +129 -36
- package/dist/src/app-opentui/surface-catalog.d.ts +20 -0
- package/dist/src/app-opentui/surface-catalog.js +540 -0
- package/dist/src/app-opentui/terminal-capabilities.d.ts +7 -0
- package/dist/src/app-opentui/terminal-capabilities.js +15 -0
- package/dist/src/app-opentui/theme.d.ts +28 -6
- package/dist/src/app-opentui/theme.js +61 -8
- package/dist/src/app-opentui/types.d.ts +130 -5
- package/dist/src/commands/_authority-runs.d.ts +1 -1
- package/dist/src/commands/_authority-runs.js +2 -12
- package/dist/src/commands/_doctor-checks.js +62 -13
- package/dist/src/commands/_help-catalog.js +95 -15
- package/dist/src/commands/_operator-view.js +97 -15
- package/dist/src/commands/_pi-frontend.d.ts +2 -0
- package/dist/src/commands/_pi-frontend.js +97 -13
- package/dist/src/commands/_preflight.js +64 -14
- package/dist/src/commands/_server-client.js +82 -18
- package/dist/src/commands/_server-events.d.ts +26 -0
- package/dist/src/commands/_server-events.js +310 -0
- package/dist/src/commands/_snapshot-upload.js +62 -13
- package/dist/src/commands/agent.js +2 -12
- package/dist/src/commands/connect.js +7 -1
- package/dist/src/commands/doctor.js +62 -13
- package/dist/src/commands/github.js +144 -23
- package/dist/src/commands/inbox.js +62 -13
- package/dist/src/commands/init.js +82 -18
- package/dist/src/commands/inspect.js +62 -13
- package/dist/src/commands/run.js +100 -15
- package/dist/src/commands/server.js +71 -26
- package/dist/src/commands/setup.js +62 -13
- package/dist/src/commands/stats.js +157 -28
- package/dist/src/commands/task-run-driver.js +64 -25
- package/dist/src/commands/task.js +196 -43
- package/dist/src/commands.js +419 -123
- package/dist/src/index.js +426 -130
- package/package.json +11 -10
- package/dist/src/app-opentui/render/image-visual-layer-native-canvas.d.ts +0 -2
- package/dist/src/app-opentui/render/image-visual-layer-native-canvas.js +0 -1484
|
@@ -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,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
|
+
};
|