@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.
- package/dist/bin/build-rig-binaries.js +8 -40
- package/dist/bin/rig.js +12519 -26675
- package/dist/src/app/board.js +74 -693
- package/dist/src/app/drone-ui.js +1 -1
- package/dist/src/app/theme.js +0 -1
- package/dist/src/commands/_async-ui.js +1 -1
- package/dist/src/commands/_authority-runs.d.ts +1 -1
- package/dist/src/commands/_authority-runs.js +12 -2
- package/dist/src/commands/_cli-format.d.ts +1 -10
- package/dist/src/commands/_cli-format.js +2 -5
- package/dist/src/commands/_connection-state.d.ts +1 -11
- package/dist/src/commands/_connection-state.js +5 -50
- package/dist/src/commands/_doctor-checks.js +40 -501
- package/dist/src/commands/_help-catalog.js +17 -99
- package/dist/src/commands/_json-output.js +0 -4
- package/dist/src/commands/_operator-view.js +54 -575
- package/dist/src/commands/_pi-frontend.d.ts +0 -27
- package/dist/src/commands/_pi-frontend.js +52 -576
- package/dist/src/commands/_preflight.js +66 -553
- package/dist/src/commands/_server-client.d.ts +0 -33
- package/dist/src/commands/_server-client.js +46 -541
- package/dist/src/commands/_snapshot-upload.js +42 -503
- package/dist/src/commands/_spinner.js +1 -1
- package/dist/src/commands/agent.js +12 -2
- package/dist/src/commands/browser.js +1 -1
- package/dist/src/commands/connect.js +15 -626
- package/dist/src/commands/doctor.js +41 -502
- package/dist/src/commands/github.js +51 -584
- package/dist/src/commands/inbox.js +41 -502
- package/dist/src/commands/init.js +74 -561
- package/dist/src/commands/inspect.js +41 -502
- package/dist/src/commands/run.js +54 -578
- package/dist/src/commands/server.js +163 -692
- package/dist/src/commands/setup.js +46 -507
- package/dist/src/commands/stats.js +58 -601
- package/dist/src/commands/task-run-driver.js +58 -509
- package/dist/src/commands/task.js +110 -729
- package/dist/src/commands.js +237 -1112
- package/dist/src/index.js +244 -1123
- package/dist/src/launcher.js +0 -4
- package/package.json +9 -13
- package/dist/src/app-opentui/adapters/command.d.ts +0 -2
- package/dist/src/app-opentui/adapters/command.js +0 -329
- package/dist/src/app-opentui/adapters/common.d.ts +0 -56
- package/dist/src/app-opentui/adapters/common.js +0 -153
- package/dist/src/app-opentui/adapters/doctor.d.ts +0 -9
- package/dist/src/app-opentui/adapters/doctor.js +0 -1217
- package/dist/src/app-opentui/adapters/family.d.ts +0 -62
- package/dist/src/app-opentui/adapters/family.js +0 -14855
- package/dist/src/app-opentui/adapters/fleet.d.ts +0 -14
- package/dist/src/app-opentui/adapters/fleet.js +0 -1335
- package/dist/src/app-opentui/adapters/inbox.d.ts +0 -43
- package/dist/src/app-opentui/adapters/inbox.js +0 -1944
- package/dist/src/app-opentui/adapters/init.d.ts +0 -11
- package/dist/src/app-opentui/adapters/init.js +0 -2818
- package/dist/src/app-opentui/adapters/inspect.d.ts +0 -52
- package/dist/src/app-opentui/adapters/inspect.js +0 -1455
- package/dist/src/app-opentui/adapters/pi-attach.d.ts +0 -32
- package/dist/src/app-opentui/adapters/pi-attach.js +0 -2101
- package/dist/src/app-opentui/adapters/pi.d.ts +0 -23
- package/dist/src/app-opentui/adapters/pi.js +0 -363
- package/dist/src/app-opentui/adapters/plugin.d.ts +0 -84
- package/dist/src/app-opentui/adapters/plugin.js +0 -544
- package/dist/src/app-opentui/adapters/repo.d.ts +0 -37
- package/dist/src/app-opentui/adapters/repo.js +0 -186
- package/dist/src/app-opentui/adapters/run-detail.d.ts +0 -27
- package/dist/src/app-opentui/adapters/run-detail.js +0 -1441
- package/dist/src/app-opentui/adapters/server.d.ts +0 -48
- package/dist/src/app-opentui/adapters/server.js +0 -1561
- package/dist/src/app-opentui/adapters/tasks.d.ts +0 -64
- package/dist/src/app-opentui/adapters/tasks.js +0 -4524
- package/dist/src/app-opentui/adapters/workspace.d.ts +0 -49
- package/dist/src/app-opentui/adapters/workspace.js +0 -333
- package/dist/src/app-opentui/autocomplete.d.ts +0 -20
- package/dist/src/app-opentui/autocomplete.js +0 -578
- package/dist/src/app-opentui/bootstrap.d.ts +0 -11
- package/dist/src/app-opentui/bootstrap.js +0 -27833
- package/dist/src/app-opentui/command-palette.d.ts +0 -3
- package/dist/src/app-opentui/command-palette.js +0 -1038
- package/dist/src/app-opentui/command-pty-host.d.ts +0 -62
- package/dist/src/app-opentui/command-pty-host.js +0 -248
- package/dist/src/app-opentui/drone.d.ts +0 -12
- package/dist/src/app-opentui/drone.js +0 -230
- package/dist/src/app-opentui/events.d.ts +0 -7
- package/dist/src/app-opentui/events.js +0 -28
- package/dist/src/app-opentui/fleet-stats.d.ts +0 -32
- package/dist/src/app-opentui/fleet-stats.js +0 -114
- package/dist/src/app-opentui/focus-manager.d.ts +0 -14
- package/dist/src/app-opentui/focus-manager.js +0 -24
- package/dist/src/app-opentui/index.d.ts +0 -8
- package/dist/src/app-opentui/index.js +0 -5260
- package/dist/src/app-opentui/intent.d.ts +0 -3
- package/dist/src/app-opentui/intent.js +0 -365
- package/dist/src/app-opentui/keymap.d.ts +0 -21
- package/dist/src/app-opentui/keymap.js +0 -1377
- package/dist/src/app-opentui/launch-routing.d.ts +0 -16
- package/dist/src/app-opentui/launch-routing.js +0 -55
- package/dist/src/app-opentui/layout.d.ts +0 -22
- package/dist/src/app-opentui/layout.js +0 -51
- package/dist/src/app-opentui/list-search.d.ts +0 -36
- package/dist/src/app-opentui/list-search.js +0 -130
- package/dist/src/app-opentui/pi-host-child.d.ts +0 -2
- package/dist/src/app-opentui/pi-host-child.js +0 -1299
- package/dist/src/app-opentui/pi-pty-host.d.ts +0 -28
- package/dist/src/app-opentui/pi-pty-host.js +0 -10
- package/dist/src/app-opentui/react/App.d.ts +0 -9
- package/dist/src/app-opentui/react/App.js +0 -3866
- package/dist/src/app-opentui/react/Backdrop.d.ts +0 -5
- package/dist/src/app-opentui/react/Backdrop.js +0 -823
- package/dist/src/app-opentui/react/ChromeHost.d.ts +0 -5
- package/dist/src/app-opentui/react/ChromeHost.js +0 -1539
- package/dist/src/app-opentui/react/SceneFrameView.d.ts +0 -7
- package/dist/src/app-opentui/react/SceneFrameView.js +0 -579
- package/dist/src/app-opentui/react/context.d.ts +0 -17
- package/dist/src/app-opentui/react/context.js +0 -37
- package/dist/src/app-opentui/react/launch.d.ts +0 -2
- package/dist/src/app-opentui/react/launch.js +0 -4897
- package/dist/src/app-opentui/react/nav.d.ts +0 -18
- package/dist/src/app-opentui/react/nav.js +0 -54
- package/dist/src/app-opentui/react/scroll.d.ts +0 -12
- package/dist/src/app-opentui/react/scroll.js +0 -21
- package/dist/src/app-opentui/react/syntax.d.ts +0 -2
- package/dist/src/app-opentui/react/syntax.js +0 -65
- package/dist/src/app-opentui/registry.d.ts +0 -4
- package/dist/src/app-opentui/registry.js +0 -22876
- package/dist/src/app-opentui/remote-link.d.ts +0 -10
- package/dist/src/app-opentui/remote-link.js +0 -47
- package/dist/src/app-opentui/render/ascii-fleet.d.ts +0 -15
- package/dist/src/app-opentui/render/ascii-fleet.js +0 -82
- package/dist/src/app-opentui/render/constants.d.ts +0 -30
- package/dist/src/app-opentui/render/constants.js +0 -64
- package/dist/src/app-opentui/render/graphics.d.ts +0 -40
- package/dist/src/app-opentui/render/graphics.js +0 -713
- package/dist/src/app-opentui/render/hover.d.ts +0 -11
- package/dist/src/app-opentui/render/hover.js +0 -34
- package/dist/src/app-opentui/render/native-host.d.ts +0 -37
- package/dist/src/app-opentui/render/native-host.js +0 -180
- package/dist/src/app-opentui/render/panel-layout.d.ts +0 -38
- package/dist/src/app-opentui/render/panel-layout.js +0 -48
- package/dist/src/app-opentui/render/panels.d.ts +0 -12
- package/dist/src/app-opentui/render/panels.js +0 -288
- package/dist/src/app-opentui/render/preloader.d.ts +0 -10
- package/dist/src/app-opentui/render/preloader.js +0 -166
- package/dist/src/app-opentui/render/scene.d.ts +0 -68
- package/dist/src/app-opentui/render/scene.js +0 -300
- package/dist/src/app-opentui/render/terminal-handoff.d.ts +0 -16
- package/dist/src/app-opentui/render/terminal-handoff.js +0 -14
- package/dist/src/app-opentui/render/text.d.ts +0 -29
- package/dist/src/app-opentui/render/text.js +0 -177
- package/dist/src/app-opentui/render/type-bar.d.ts +0 -15
- package/dist/src/app-opentui/render/type-bar.js +0 -212
- package/dist/src/app-opentui/runtime-resources.d.ts +0 -16
- package/dist/src/app-opentui/runtime-resources.js +0 -62
- package/dist/src/app-opentui/runtime.d.ts +0 -45
- package/dist/src/app-opentui/runtime.js +0 -5232
- package/dist/src/app-opentui/scenes/command.d.ts +0 -3
- package/dist/src/app-opentui/scenes/command.js +0 -118
- package/dist/src/app-opentui/scenes/doctor.d.ts +0 -3
- package/dist/src/app-opentui/scenes/doctor.js +0 -296
- package/dist/src/app-opentui/scenes/error.d.ts +0 -2
- package/dist/src/app-opentui/scenes/error.js +0 -277
- package/dist/src/app-opentui/scenes/family-domains/agent.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/agent.js +0 -349
- package/dist/src/app-opentui/scenes/family-domains/browser.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/browser.js +0 -196
- package/dist/src/app-opentui/scenes/family-domains/dist.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/dist.js +0 -244
- package/dist/src/app-opentui/scenes/family-domains/git.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/git.js +0 -196
- package/dist/src/app-opentui/scenes/family-domains/github.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/github.js +0 -275
- package/dist/src/app-opentui/scenes/family-domains/harness.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/harness.js +0 -153
- package/dist/src/app-opentui/scenes/family-domains/index.d.ts +0 -4
- package/dist/src/app-opentui/scenes/family-domains/index.js +0 -1680
- package/dist/src/app-opentui/scenes/family-domains/kit.d.ts +0 -76
- package/dist/src/app-opentui/scenes/family-domains/kit.js +0 -306
- package/dist/src/app-opentui/scenes/family-domains/profile.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/profile.js +0 -213
- package/dist/src/app-opentui/scenes/family-domains/queue.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/queue.js +0 -147
- package/dist/src/app-opentui/scenes/family-domains/remote.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/remote.js +0 -519
- package/dist/src/app-opentui/scenes/family-domains/review.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/review.js +0 -281
- package/dist/src/app-opentui/scenes/family-domains/setup.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/setup.js +0 -268
- package/dist/src/app-opentui/scenes/family-domains/stats.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/stats.js +0 -371
- package/dist/src/app-opentui/scenes/family.d.ts +0 -3
- package/dist/src/app-opentui/scenes/family.js +0 -2199
- package/dist/src/app-opentui/scenes/fleet.d.ts +0 -3
- package/dist/src/app-opentui/scenes/fleet.js +0 -766
- package/dist/src/app-opentui/scenes/handoff.d.ts +0 -2
- package/dist/src/app-opentui/scenes/handoff.js +0 -455
- package/dist/src/app-opentui/scenes/help.d.ts +0 -3
- package/dist/src/app-opentui/scenes/help.js +0 -725
- package/dist/src/app-opentui/scenes/inbox.d.ts +0 -3
- package/dist/src/app-opentui/scenes/inbox.js +0 -427
- package/dist/src/app-opentui/scenes/init.d.ts +0 -3
- package/dist/src/app-opentui/scenes/init.js +0 -181
- package/dist/src/app-opentui/scenes/inspect.d.ts +0 -3
- package/dist/src/app-opentui/scenes/inspect.js +0 -794
- package/dist/src/app-opentui/scenes/main.d.ts +0 -3
- package/dist/src/app-opentui/scenes/main.js +0 -332
- package/dist/src/app-opentui/scenes/pi.d.ts +0 -3
- package/dist/src/app-opentui/scenes/pi.js +0 -509
- package/dist/src/app-opentui/scenes/plugin.d.ts +0 -3
- package/dist/src/app-opentui/scenes/plugin.js +0 -487
- package/dist/src/app-opentui/scenes/repo.d.ts +0 -3
- package/dist/src/app-opentui/scenes/repo.js +0 -425
- package/dist/src/app-opentui/scenes/run-detail.d.ts +0 -3
- package/dist/src/app-opentui/scenes/run-detail.js +0 -467
- package/dist/src/app-opentui/scenes/server.d.ts +0 -3
- package/dist/src/app-opentui/scenes/server.js +0 -378
- package/dist/src/app-opentui/scenes/tasks.d.ts +0 -3
- package/dist/src/app-opentui/scenes/tasks.js +0 -768
- package/dist/src/app-opentui/scenes/workspace.d.ts +0 -3
- package/dist/src/app-opentui/scenes/workspace.js +0 -427
- package/dist/src/app-opentui/selectable.d.ts +0 -19
- package/dist/src/app-opentui/selectable.js +0 -80
- package/dist/src/app-opentui/state.d.ts +0 -4
- package/dist/src/app-opentui/state.js +0 -399
- package/dist/src/app-opentui/surface-catalog.d.ts +0 -20
- package/dist/src/app-opentui/surface-catalog.js +0 -542
- package/dist/src/app-opentui/theme.d.ts +0 -59
- package/dist/src/app-opentui/theme.js +0 -142
- package/dist/src/app-opentui/types.d.ts +0 -313
- package/dist/src/app-opentui/types.js +0 -1
- package/dist/src/commands/_server-events.d.ts +0 -26
- package/dist/src/commands/_server-events.js +0 -715
|
@@ -1,196 +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 actionDetail(sub) {
|
|
95
|
-
return sub.direct ? sub.description : `${sub.description} \xB7 ${sub.fields.length} field${sub.fields.length === 1 ? "" : "s"}`;
|
|
96
|
-
}
|
|
97
|
-
function detailText(details, key) {
|
|
98
|
-
const value = details?.[key];
|
|
99
|
-
if (value === undefined || value === null)
|
|
100
|
-
return;
|
|
101
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean")
|
|
102
|
-
return String(value);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
function metric(label, value, opts = {}) {
|
|
106
|
-
return line(` ${label.padEnd(22)} ${value}`, { fg: opts.fg ?? RIG_UI.ink2, bold: opts.bold });
|
|
107
|
-
}
|
|
108
|
-
function heading(text) {
|
|
109
|
-
return line(text, { fg: RIG_UI.ink, bold: true });
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// packages/cli/src/app-opentui/scenes/family-domains/browser.ts
|
|
113
|
-
var CONTRACT = {
|
|
114
|
-
attachUrl: "http://127.0.0.1:9333",
|
|
115
|
-
preset: "hp-next-local",
|
|
116
|
-
stateDir: ".tmp/rig-browser/hp-next"
|
|
117
|
-
};
|
|
118
|
-
var AGENT_HELPERS = [
|
|
119
|
-
"rig-browser-launch",
|
|
120
|
-
"rig-browser-check",
|
|
121
|
-
"rig-browser-attach-info"
|
|
122
|
-
];
|
|
123
|
-
function isWorkstation(sub) {
|
|
124
|
-
return sub.base[0] === "hp-next";
|
|
125
|
-
}
|
|
126
|
-
var renderBrowser = (ctx) => {
|
|
127
|
-
const lines = [];
|
|
128
|
-
lines.push(line("BROWSER WORKSTATION \xB7 browser-required task contract", { fg: RIG_UI.cyan, bold: true }));
|
|
129
|
-
lines.push(blank());
|
|
130
|
-
lines.push(heading("WORKSTATION STATUS"));
|
|
131
|
-
const probed = ctx.state.ran;
|
|
132
|
-
const up = ctx.details?.up === true;
|
|
133
|
-
const probeUrl = detailText(ctx.details, "attachUrl") ?? CONTRACT.attachUrl;
|
|
134
|
-
const probePort = detailText(ctx.details, "port") ?? "(unknown)";
|
|
135
|
-
if (probed && up) {
|
|
136
|
-
lines.push(metric("status", `RUNNING on :${probePort}`, { fg: RIG_UI.lime, bold: true }));
|
|
137
|
-
const browser = detailText(ctx.details, "browser");
|
|
138
|
-
if (browser)
|
|
139
|
-
lines.push(metric("browser", browser, { fg: RIG_UI.ink }));
|
|
140
|
-
const pages = detailText(ctx.details, "pages");
|
|
141
|
-
if (pages !== undefined)
|
|
142
|
-
lines.push(metric("open page targets", pages, { fg: RIG_UI.ink2 }));
|
|
143
|
-
const activeUrl = detailText(ctx.details, "activeUrl");
|
|
144
|
-
if (activeUrl)
|
|
145
|
-
lines.push(metric("active page", activeUrl, { fg: RIG_UI.ink2 }));
|
|
146
|
-
lines.push(metric("attach url", probeUrl, { fg: RIG_UI.ink2 }));
|
|
147
|
-
} else if (probed) {
|
|
148
|
-
const reason = detailText(ctx.details, "reason") ?? "no CDP endpoint";
|
|
149
|
-
lines.push(metric("status", "DOWN \u2014 start the workstation", { fg: RIG_UI.red, bold: true }));
|
|
150
|
-
lines.push(metric("probe", `${probeUrl} \xB7 ${reason}`, { fg: RIG_UI.ink3 }));
|
|
151
|
-
lines.push(line(" \u2192 run hp-next start (or dev), then hp-next check before attaching MCP", { fg: RIG_UI.ink2 }));
|
|
152
|
-
} else {
|
|
153
|
-
lines.push(metric("status", "not probed yet", { fg: RIG_UI.ink3 }));
|
|
154
|
-
}
|
|
155
|
-
lines.push(blank());
|
|
156
|
-
lines.push(heading("ATTACH CONTRACT (documented defaults)"));
|
|
157
|
-
lines.push(metric("attach url", CONTRACT.attachUrl, { fg: RIG_UI.ink2 }));
|
|
158
|
-
lines.push(metric("preset / profile", CONTRACT.preset, { fg: RIG_UI.ink2 }));
|
|
159
|
-
lines.push(metric("state dir", CONTRACT.stateDir, { fg: RIG_UI.ink3 }));
|
|
160
|
-
lines.push(blank());
|
|
161
|
-
lines.push(heading("AGENT HELPERS (worker PATH)"));
|
|
162
|
-
for (const helper of AGENT_HELPERS)
|
|
163
|
-
lines.push(metric(helper, "\u2192 inside a run", { fg: RIG_UI.ink3 }));
|
|
164
|
-
lines.push(blank());
|
|
165
|
-
const workstation = [];
|
|
166
|
-
const helpDemo = [];
|
|
167
|
-
for (const sub of ctx.snap.subcommands) {
|
|
168
|
-
if (isWorkstation(sub))
|
|
169
|
-
workstation.push(sub);
|
|
170
|
-
else
|
|
171
|
-
helpDemo.push(sub);
|
|
172
|
-
}
|
|
173
|
-
lines.push(heading(up ? "HP-NEXT WORKSTATION (controls)" : "HP-NEXT WORKSTATION (start here)"));
|
|
174
|
-
if (workstation.length === 0) {
|
|
175
|
-
lines.push(line(" (no hp-next workstation actions in this catalog)", { fg: RIG_UI.ink4 }));
|
|
176
|
-
} else {
|
|
177
|
-
for (const sub of workstation) {
|
|
178
|
-
lines.push(ctx.cursor.deck({ label: sub.base.join(" ") || ctx.family, detail: actionDetail(sub) }, actionItemFor(ctx.family, sub)));
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
lines.push(blank());
|
|
182
|
-
lines.push(heading("HELP & DEMO"));
|
|
183
|
-
if (helpDemo.length === 0) {
|
|
184
|
-
lines.push(line(" (no help/demo actions in this catalog)", { fg: RIG_UI.ink4 }));
|
|
185
|
-
} else {
|
|
186
|
-
for (const sub of helpDemo) {
|
|
187
|
-
lines.push(ctx.cursor.deck({ label: sub.base.join(" ") || ctx.family, detail: actionDetail(sub) }, actionItemFor(ctx.family, sub)));
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
lines.push(blank());
|
|
191
|
-
lines.push(line("enter a row: direct commands run \xB7 parameterized commands open a form", { fg: RIG_UI.ink4 }));
|
|
192
|
-
return lines;
|
|
193
|
-
};
|
|
194
|
-
export {
|
|
195
|
-
renderBrowser
|
|
196
|
-
};
|
|
@@ -1,244 +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
|
-
|
|
141
|
-
// packages/cli/src/app-opentui/scenes/family-domains/kit.ts
|
|
142
|
-
function actionItemFor(family, sub) {
|
|
143
|
-
const base = sub.base.join(" ");
|
|
144
|
-
if (sub.direct) {
|
|
145
|
-
const label = `run rig ${family} ${base}`.trim();
|
|
146
|
-
return {
|
|
147
|
-
id: `action:${sub.id}`,
|
|
148
|
-
label,
|
|
149
|
-
intent: { scene: "command", argv: [family, ...sub.base], action: { kind: "command-run", label: `Run rig ${family} ${base}`.trim(), payload: { argv: [family, ...sub.base], family } } },
|
|
150
|
-
message: label
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
id: `action:${sub.id}`,
|
|
155
|
-
label: `configure ${family} ${base}`.trim(),
|
|
156
|
-
intent: { scene: "family", argv: [family], action: { kind: "refresh", label: `Configure ${sub.template}`, payload: { family, formSub: sub.id } } },
|
|
157
|
-
message: `configure & run rig ${family} ${sub.template}`
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
function actionDetail(sub) {
|
|
161
|
-
return sub.direct ? sub.description : `${sub.description} \xB7 ${sub.fields.length} field${sub.fields.length === 1 ? "" : "s"}`;
|
|
162
|
-
}
|
|
163
|
-
function metric(label, value, opts = {}) {
|
|
164
|
-
return line(` ${label.padEnd(22)} ${value}`, { fg: opts.fg ?? RIG_UI.ink2, bold: opts.bold });
|
|
165
|
-
}
|
|
166
|
-
function heading(text) {
|
|
167
|
-
return line(text, { fg: RIG_UI.ink, bold: true });
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// packages/cli/src/app-opentui/scenes/family-domains/dist.ts
|
|
171
|
-
function asRecord(value) {
|
|
172
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
173
|
-
}
|
|
174
|
-
function asBool(value) {
|
|
175
|
-
return value === true;
|
|
176
|
-
}
|
|
177
|
-
function asStringOrNull(value) {
|
|
178
|
-
return typeof value === "string" && value.length > 0 ? value : null;
|
|
179
|
-
}
|
|
180
|
-
function checkLine(label, ok, detail) {
|
|
181
|
-
const { glyph, color } = statusLabel(ok ? "success" : "needs-attention");
|
|
182
|
-
return line(` ${glyph} ${label.padEnd(20)} ${detail}`, { fg: color });
|
|
183
|
-
}
|
|
184
|
-
var renderDist = (ctx) => {
|
|
185
|
-
const lines = [];
|
|
186
|
-
lines.push(line(ctx.snap.summary, { fg: RIG_UI.ink3 }));
|
|
187
|
-
lines.push(blank());
|
|
188
|
-
const details = ctx.details;
|
|
189
|
-
const bun = asRecord(details?.["bun"]);
|
|
190
|
-
const rig = asRecord(details?.["rig"]);
|
|
191
|
-
const userBinDir = asStringOrNull(details?.["userBinDir"]);
|
|
192
|
-
const userBinInPath = asBool(details?.["userBinInPath"]);
|
|
193
|
-
const latestDistBinary = asStringOrNull(details?.["latestDistBinary"]);
|
|
194
|
-
const hasStructured = Boolean(bun || rig || userBinDir);
|
|
195
|
-
if (ctx.state.ran && hasStructured) {
|
|
196
|
-
const bunOk = asBool(bun?.["available"]);
|
|
197
|
-
const bunVersion = asStringOrNull(bun?.["version"]);
|
|
198
|
-
const rigOnPath = asBool(rig?.["onPath"]);
|
|
199
|
-
const rigRunnable = asBool(rig?.["runnable"]);
|
|
200
|
-
const rigPath = asStringOrNull(rig?.["path"]);
|
|
201
|
-
const installable = Boolean(latestDistBinary);
|
|
202
|
-
const ready = bunOk && installable;
|
|
203
|
-
const top = statusLabel(ready ? "success" : "needs-attention");
|
|
204
|
-
lines.push(line(`${top.glyph} DISTRIBUTION ${ready ? "READY" : "NEEDS ATTENTION"}`, { fg: top.color, bold: true }));
|
|
205
|
-
lines.push(blank());
|
|
206
|
-
lines.push(heading("READINESS"));
|
|
207
|
-
lines.push(checkLine("bun toolchain", bunOk, bunOk ? `ok${bunVersion ? ` \xB7 v${bunVersion}` : ""}` : "missing \u2014 build needs bun"));
|
|
208
|
-
lines.push(checkLine("rig on PATH", rigOnPath, rigOnPath ? rigPath ?? "present" : "not on PATH"));
|
|
209
|
-
lines.push(checkLine("rig runnable", rigRunnable, rigRunnable ? "responds to `rig help`" : "installed rig did not run"));
|
|
210
|
-
lines.push(checkLine("packaged binary", installable, installable ? "built \u2014 ready to install" : "none \u2014 run `dist build`"));
|
|
211
|
-
lines.push(blank());
|
|
212
|
-
lines.push(heading("INSTALL TARGET"));
|
|
213
|
-
if (userBinDir) {
|
|
214
|
-
lines.push(metric("user bin dir", userBinDir));
|
|
215
|
-
lines.push(metric("on PATH", userBinInPath ? "yes" : "no \u2014 add to PATH to run rig", { fg: userBinInPath ? RIG_UI.lime : RIG_UI.yellow }));
|
|
216
|
-
} else {
|
|
217
|
-
lines.push(line(" (install location unknown)", { fg: RIG_UI.ink4 }));
|
|
218
|
-
}
|
|
219
|
-
lines.push(metric("latest dist binary", latestDistBinary ?? "none built yet", { fg: latestDistBinary ? RIG_UI.ink2 : RIG_UI.ink4 }));
|
|
220
|
-
lines.push(blank());
|
|
221
|
-
} else if (ctx.state.ran) {
|
|
222
|
-
const probe = statusLabel(ctx.state.ok ? "success" : "needs-attention");
|
|
223
|
-
lines.push(line(`${probe.glyph} DOCTOR \xB7 rig dist ${ctx.state.subcommand?.join(" ") ?? "doctor"}`, { fg: probe.color, bold: true }));
|
|
224
|
-
if (ctx.state.lines.length === 0)
|
|
225
|
-
lines.push(line(" (no output)", { fg: RIG_UI.ink4 }));
|
|
226
|
-
else
|
|
227
|
-
for (const text of ctx.state.lines.slice(0, 40))
|
|
228
|
-
lines.push(line(` ${text}`, { fg: RIG_UI.ink2 }));
|
|
229
|
-
lines.push(blank());
|
|
230
|
-
} else {
|
|
231
|
-
lines.push(line(" doctor probe did not run \u2014 select doctor below to inspect the build env", { fg: RIG_UI.ink4 }));
|
|
232
|
-
lines.push(blank());
|
|
233
|
-
}
|
|
234
|
-
lines.push(heading("ACTIONS"));
|
|
235
|
-
for (const sub of ctx.snap.subcommands) {
|
|
236
|
-
lines.push(ctx.cursor.deck({ label: sub.base.join(" ") || ctx.family, detail: actionDetail(sub) }, actionItemFor(ctx.family, sub)));
|
|
237
|
-
}
|
|
238
|
-
lines.push(blank());
|
|
239
|
-
lines.push(line("build packages the binary \xB7 install copies it onto PATH \xB7 doctor re-probes the env", { fg: RIG_UI.ink4 }));
|
|
240
|
-
return lines;
|
|
241
|
-
};
|
|
242
|
-
export {
|
|
243
|
-
renderDist
|
|
244
|
-
};
|
|
@@ -1,196 +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/git.ts
|
|
102
|
-
var FLOWS = [
|
|
103
|
-
{ verb: "status", hint: "show task-scoped worktree state \xB7 [--task <id>]" },
|
|
104
|
-
{ verb: "changed", hint: "list changed files \xB7 [--task <id>] [--scoped]" },
|
|
105
|
-
{ verb: "preflight", hint: "gate before commit \xB7 [--task <id>] [--strict]" },
|
|
106
|
-
{ verb: "sync-branch", hint: "ensure the task branch exists \xB7 [--task <id>]" },
|
|
107
|
-
{ verb: "commit", hint: "scoped commit \xB7 [--target <monorepo|project|both>] [--message <m>]" },
|
|
108
|
-
{ verb: "snapshot", hint: "write a worktree snapshot \xB7 [--output <file>]" },
|
|
109
|
-
{ verb: "open-pr", hint: "open the task PR \xB7 [--reviewer <u>] [--base <b>] [--title <t>] [--draft]" }
|
|
110
|
-
];
|
|
111
|
-
function parseGitStatus(rawLines) {
|
|
112
|
-
let task = null;
|
|
113
|
-
let expectedBranch = null;
|
|
114
|
-
const repos = [];
|
|
115
|
-
let current = null;
|
|
116
|
-
for (const raw of rawLines) {
|
|
117
|
-
const text = raw.replace(/\s+$/, "");
|
|
118
|
-
const taskMatch = /^Task:\s*(.+)$/.exec(text.trim());
|
|
119
|
-
if (taskMatch) {
|
|
120
|
-
const value = taskMatch[1].trim();
|
|
121
|
-
task = value === "(none active)" ? null : value;
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
const expectedMatch = /^Expected monorepo branch:\s*(.+)$/.exec(text.trim());
|
|
125
|
-
if (expectedMatch) {
|
|
126
|
-
expectedBranch = expectedMatch[1].trim();
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
const branchMatch = /^\s+branch:\s*(.+)$/.exec(text);
|
|
130
|
-
if (branchMatch && current) {
|
|
131
|
-
current.branch = branchMatch[1].trim();
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
const changedMatch = /^\s+changed files:\s*(.+)$/.exec(text);
|
|
135
|
-
if (changedMatch && current) {
|
|
136
|
-
current.changed = changedMatch[1].trim();
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
const warnMatch = /^\s+warning:\s*(.+)$/.exec(text);
|
|
140
|
-
if (warnMatch && current) {
|
|
141
|
-
current.warning = warnMatch[1].trim();
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
const labelMatch = /^([A-Za-z][\w-]*):$/.exec(text.trim());
|
|
145
|
-
if (labelMatch && !text.startsWith("===")) {
|
|
146
|
-
current = { label: labelMatch[1], branch: "", changed: "" };
|
|
147
|
-
repos.push(current);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return { task, expectedBranch, repos };
|
|
151
|
-
}
|
|
152
|
-
var renderGit = (ctx) => {
|
|
153
|
-
const lines = [];
|
|
154
|
-
lines.push(line("GIT-FLOW CONSOLE \xB7 rig git <args\u2026> \u2192 Rig git-flow helper", { fg: RIG_UI.cyan, bold: true }));
|
|
155
|
-
lines.push(blank());
|
|
156
|
-
const parsed = ctx.state.ran ? parseGitStatus(ctx.state.lines) : null;
|
|
157
|
-
lines.push(heading("WORKTREE STATUS"));
|
|
158
|
-
if (parsed && parsed.repos.length > 0) {
|
|
159
|
-
lines.push(metric("active task", parsed.task ?? "(none active)", { fg: parsed.task ? RIG_UI.lime : RIG_UI.ink3, bold: Boolean(parsed.task) }));
|
|
160
|
-
if (parsed.expectedBranch)
|
|
161
|
-
lines.push(metric("expected branch", parsed.expectedBranch, { fg: RIG_UI.ink3 }));
|
|
162
|
-
lines.push(blank());
|
|
163
|
-
for (const repo of parsed.repos) {
|
|
164
|
-
lines.push(metric(`${repo.label} \xB7 branch`, repo.branch || "unknown", { fg: RIG_UI.ink, bold: true }));
|
|
165
|
-
const dirty = repo.changed !== "0" && repo.changed !== "";
|
|
166
|
-
lines.push(metric(`${repo.label} \xB7 changed`, `${repo.changed} file${repo.changed === "1" ? "" : "s"}`, { fg: dirty ? RIG_UI.yellow : RIG_UI.ink2 }));
|
|
167
|
-
if (repo.warning)
|
|
168
|
-
lines.push(metric(`${repo.label} \xB7 warning`, repo.warning, { fg: RIG_UI.red }));
|
|
169
|
-
}
|
|
170
|
-
} else if (ctx.state.ran && !ctx.state.ok) {
|
|
171
|
-
lines.push(metric("live probe", "rig git status returned an error (not a git repo?)", { fg: RIG_UI.red }));
|
|
172
|
-
} else {
|
|
173
|
-
lines.push(metric("live probe", "not probed yet", { fg: RIG_UI.ink3 }));
|
|
174
|
-
}
|
|
175
|
-
lines.push(blank());
|
|
176
|
-
lines.push(heading("RUN A GIT-FLOW COMMAND"));
|
|
177
|
-
const subs = ctx.snap.subcommands;
|
|
178
|
-
if (subs.length === 0) {
|
|
179
|
-
lines.push(line(" (no passthrough action in this catalog)", { fg: RIG_UI.ink4 }));
|
|
180
|
-
} else {
|
|
181
|
-
for (const sub of subs) {
|
|
182
|
-
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)));
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
lines.push(blank());
|
|
186
|
-
lines.push(heading("FLOWS (type one into the form above)"));
|
|
187
|
-
for (const flow of FLOWS) {
|
|
188
|
-
lines.push(line(` ${flow.verb.padEnd(13)} ${flow.hint}`, { fg: RIG_UI.ink3 }));
|
|
189
|
-
}
|
|
190
|
-
lines.push(blank());
|
|
191
|
-
lines.push(line("enter the run row \u2192 fill <args\u2026> with e.g. `status --task <id>` \u2192 run", { fg: RIG_UI.ink4 }));
|
|
192
|
-
return lines;
|
|
193
|
-
};
|
|
194
|
-
export {
|
|
195
|
-
renderGit
|
|
196
|
-
};
|