@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.
- package/dist/bin/rig.js +22060 -14620
- package/dist/src/app/board.js +155 -28
- package/dist/src/app-opentui/adapters/doctor.d.ts +0 -2
- package/dist/src/app-opentui/adapters/doctor.js +1 -25
- 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 +6 -40
- package/dist/src/app-opentui/adapters/inbox.d.ts +12 -2
- package/dist/src/app-opentui/adapters/inbox.js +54 -59
- package/dist/src/app-opentui/adapters/init.d.ts +0 -2
- package/dist/src/app-opentui/adapters/init.js +0 -26
- 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 +348 -93
- 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 +97 -44
- package/dist/src/app-opentui/adapters/server.d.ts +10 -2
- package/dist/src/app-opentui/adapters/server.js +96 -27
- package/dist/src/app-opentui/adapters/tasks.d.ts +0 -2
- package/dist/src/app-opentui/adapters/tasks.js +437 -105
- 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.js +24313 -16963
- 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/drone.js +8 -6
- 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/index.js +3438 -1724
- package/dist/src/app-opentui/intent.js +71 -48
- package/dist/src/app-opentui/keymap.d.ts +6 -5
- package/dist/src/app-opentui/keymap.js +1064 -23
- 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 +33 -1
- package/dist/src/app-opentui/pi-pty-host.d.ts +5 -0
- package/dist/src/app-opentui/pi-pty-host.js +21 -3
- package/dist/src/app-opentui/react/App.d.ts +9 -0
- package/dist/src/app-opentui/react/App.js +5099 -0
- package/dist/src/app-opentui/react/Backdrop.d.ts +5 -0
- package/dist/src/app-opentui/react/Backdrop.js +829 -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 +5698 -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 +19923 -5151
- 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 +106 -39
- package/dist/src/app-opentui/render/image-visual-layer-worker.js +108 -20
- package/dist/src/app-opentui/render/image-visual-layer.d.ts +7 -0
- package/dist/src/app-opentui/render/image-visual-layer.js +109 -20
- 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/panels.js +18 -11
- package/dist/src/app-opentui/render/preloader.js +8 -6
- package/dist/src/app-opentui/render/scene.d.ts +50 -1
- package/dist/src/app-opentui/render/scene.js +183 -6
- package/dist/src/app-opentui/render/text.d.ts +7 -1
- package/dist/src/app-opentui/render/text.js +10 -7
- package/dist/src/app-opentui/render/type-bar.js +69 -30
- package/dist/src/app-opentui/runtime.d.ts +44 -1
- package/dist/src/app-opentui/runtime.js +3231 -1363
- package/dist/src/app-opentui/scenes/command.js +20 -6
- package/dist/src/app-opentui/scenes/doctor.js +176 -11
- package/dist/src/app-opentui/scenes/error.js +20 -10
- 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 +521 -31
- package/dist/src/app-opentui/scenes/handoff.js +204 -12
- package/dist/src/app-opentui/scenes/help.js +609 -40
- package/dist/src/app-opentui/scenes/inbox.js +278 -17
- package/dist/src/app-opentui/scenes/init.js +84 -39
- 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.js +218 -39
- 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.js +333 -20
- package/dist/src/app-opentui/scenes/server.js +181 -15
- package/dist/src/app-opentui/scenes/tasks.js +486 -31
- 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 +83 -30
- 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/theme.d.ts +28 -6
- package/dist/src/app-opentui/theme.js +61 -8
- package/dist/src/app-opentui/types.d.ts +121 -4
- package/dist/src/commands/_authority-runs.d.ts +1 -1
- package/dist/src/commands/_authority-runs.js +2 -12
- package/dist/src/commands/_help-catalog.js +95 -15
- package/dist/src/commands/_operator-view.js +34 -2
- package/dist/src/commands/_pi-frontend.d.ts +2 -0
- package/dist/src/commands/_pi-frontend.js +34 -0
- package/dist/src/commands/_server-events.d.ts +26 -0
- package/dist/src/commands/_server-events.js +310 -0
- package/dist/src/commands/agent.js +2 -12
- package/dist/src/commands/run.js +34 -2
- package/dist/src/commands/server.js +2 -12
- package/dist/src/commands/stats.js +95 -15
- package/dist/src/commands/task-run-driver.js +2 -12
- package/dist/src/commands/task.js +131 -29
- package/dist/src/commands.js +192 -31
- package/dist/src/index.js +192 -31
- package/package.json +11 -9
|
@@ -11,15 +11,17 @@ var RIG_UI = {
|
|
|
11
11
|
bg: "#070809",
|
|
12
12
|
bg2: "#0b0c0e",
|
|
13
13
|
panel: "#101115",
|
|
14
|
-
panel2: "#
|
|
15
|
-
glass: "#
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
panel2: "#14161b",
|
|
15
|
+
glass: "#1e2230",
|
|
16
|
+
border: "#2a2e3a",
|
|
17
|
+
ink: "#f4f5f8",
|
|
18
|
+
ink2: "#c7c9d3",
|
|
19
|
+
ink3: "#9aa0ae",
|
|
20
|
+
ink4: "#787b86",
|
|
20
21
|
lime: "#ccff4d",
|
|
21
22
|
limeDim: "#a9d63f",
|
|
22
23
|
cyan: "#56d8ff",
|
|
24
|
+
cyanDim: "#3f9fbd",
|
|
23
25
|
red: "#ff5d5d",
|
|
24
26
|
yellow: "#ffd24d",
|
|
25
27
|
magenta: "#ff79b0"
|
|
@@ -37,6 +39,18 @@ var styles = {
|
|
|
37
39
|
magenta: otuiFg(RIG_UI.magenta)
|
|
38
40
|
};
|
|
39
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
|
+
|
|
40
54
|
// packages/cli/src/app-opentui/render/scene.ts
|
|
41
55
|
function line(text, options = {}) {
|
|
42
56
|
return { text, ...options };
|
|
@@ -11,15 +11,17 @@ var RIG_UI = {
|
|
|
11
11
|
bg: "#070809",
|
|
12
12
|
bg2: "#0b0c0e",
|
|
13
13
|
panel: "#101115",
|
|
14
|
-
panel2: "#
|
|
15
|
-
glass: "#
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
panel2: "#14161b",
|
|
15
|
+
glass: "#1e2230",
|
|
16
|
+
border: "#2a2e3a",
|
|
17
|
+
ink: "#f4f5f8",
|
|
18
|
+
ink2: "#c7c9d3",
|
|
19
|
+
ink3: "#9aa0ae",
|
|
20
|
+
ink4: "#787b86",
|
|
20
21
|
lime: "#ccff4d",
|
|
21
22
|
limeDim: "#a9d63f",
|
|
22
23
|
cyan: "#56d8ff",
|
|
24
|
+
cyanDim: "#3f9fbd",
|
|
23
25
|
red: "#ff5d5d",
|
|
24
26
|
yellow: "#ffd24d",
|
|
25
27
|
magenta: "#ff79b0"
|
|
@@ -37,10 +39,141 @@ var styles = {
|
|
|
37
39
|
magenta: otuiFg(RIG_UI.magenta)
|
|
38
40
|
};
|
|
39
41
|
|
|
42
|
+
// packages/cli/src/app-opentui/drone.ts
|
|
43
|
+
import { RGBA, StyledText, TextAttributes as TextAttributes2 } from "@opentui/core";
|
|
44
|
+
var MINI_DRONE = [
|
|
45
|
+
"(!!!) (!!!)",
|
|
46
|
+
" \\%==%/ ",
|
|
47
|
+
" %%?%% ",
|
|
48
|
+
" /%==%\\ ",
|
|
49
|
+
"(!!!) (!!!)"
|
|
50
|
+
];
|
|
51
|
+
var LEAD_MARK = [
|
|
52
|
+
" .-=-. ",
|
|
53
|
+
"=%%?%%=",
|
|
54
|
+
" '-=-' "
|
|
55
|
+
];
|
|
56
|
+
var BLADE_FRAMES = ["---", "\\\\\\", "|||", "///"];
|
|
57
|
+
var EYE_FRAMES = ["o", "@", "\u2022", "."];
|
|
58
|
+
var COLOR = {
|
|
59
|
+
body: RGBA.fromHex(RIG_UI.lime),
|
|
60
|
+
mini: RGBA.fromHex(RIG_UI.limeDim),
|
|
61
|
+
rotor: RGBA.fromHex(RIG_UI.cyan),
|
|
62
|
+
path: RGBA.fromHex(RIG_UI.cyan),
|
|
63
|
+
eye: RGBA.fromHex(RIG_UI.ink),
|
|
64
|
+
dim: RGBA.fromHex(RIG_UI.ink4),
|
|
65
|
+
ink: RGBA.fromHex(RIG_UI.ink2)
|
|
66
|
+
};
|
|
67
|
+
function bladeForTick(tick, phase = 0) {
|
|
68
|
+
return BLADE_FRAMES[(Math.floor(tick / 3) + phase) % BLADE_FRAMES.length];
|
|
69
|
+
}
|
|
70
|
+
function eyeForTick(tick, phase = 0) {
|
|
71
|
+
const pulse = Math.sin(tick * 0.09 + phase);
|
|
72
|
+
return pulse > 0.55 ? EYE_FRAMES[1] : pulse > 0.1 ? EYE_FRAMES[0] : pulse > -0.45 ? EYE_FRAMES[2] : EYE_FRAMES[3];
|
|
73
|
+
}
|
|
74
|
+
function chunk(text, fg, bold = false, dim = false) {
|
|
75
|
+
let attributes = TextAttributes2.NONE;
|
|
76
|
+
if (bold)
|
|
77
|
+
attributes |= TextAttributes2.BOLD;
|
|
78
|
+
if (dim)
|
|
79
|
+
attributes |= TextAttributes2.DIM;
|
|
80
|
+
return { __isChunk: true, text, fg, ...attributes !== TextAttributes2.NONE ? { attributes } : {} };
|
|
81
|
+
}
|
|
82
|
+
function styledLine(text, colorFor) {
|
|
83
|
+
const chunks = [];
|
|
84
|
+
let run = "";
|
|
85
|
+
let runColor = null;
|
|
86
|
+
const flush = () => {
|
|
87
|
+
if (!run || !runColor)
|
|
88
|
+
return;
|
|
89
|
+
chunks.push(chunk(run, COLOR[runColor], runColor === "body" || runColor === "eye", runColor === "dim"));
|
|
90
|
+
run = "";
|
|
91
|
+
};
|
|
92
|
+
for (const char of text) {
|
|
93
|
+
const next = colorFor(char);
|
|
94
|
+
if (next !== runColor) {
|
|
95
|
+
flush();
|
|
96
|
+
runColor = next;
|
|
97
|
+
}
|
|
98
|
+
run += char;
|
|
99
|
+
}
|
|
100
|
+
flush();
|
|
101
|
+
return new StyledText(chunks.length > 0 ? chunks : [chunk("", COLOR.ink)]);
|
|
102
|
+
}
|
|
103
|
+
function droneColor(char) {
|
|
104
|
+
if (char === "?" || char === "o" || char === "@" || char === "\u2022")
|
|
105
|
+
return "eye";
|
|
106
|
+
if (char === "%" || char === "=")
|
|
107
|
+
return "mini";
|
|
108
|
+
if (char === "$")
|
|
109
|
+
return "body";
|
|
110
|
+
if (char === "(" || char === ")" || char === "/" || char === "\\" || char === "|" || char === "-")
|
|
111
|
+
return "rotor";
|
|
112
|
+
if (char === "\xB7" || char === "\u2022" || char === "'" || char === ".")
|
|
113
|
+
return "path";
|
|
114
|
+
if (char.trim() === "")
|
|
115
|
+
return "dim";
|
|
116
|
+
return "ink";
|
|
117
|
+
}
|
|
118
|
+
function motionColor(char) {
|
|
119
|
+
if (char === "\u25CF" || char === "\u25C6" || char === "\u25C9")
|
|
120
|
+
return "body";
|
|
121
|
+
if (char === "\u2022" || char === "\xB7" || char === "\u2500" || char === "\u2502" || char === "\u2571" || char === "\u2572" || char === "\u256D" || char === "\u256E" || char === "\u2570" || char === "\u256F")
|
|
122
|
+
return "path";
|
|
123
|
+
if (char === "\u258C" || char === "\u2590" || char === "\u2581" || char === "\u2594")
|
|
124
|
+
return "mini";
|
|
125
|
+
return droneColor(char);
|
|
126
|
+
}
|
|
127
|
+
function materializeDrone(lines, tick, phase = 0) {
|
|
128
|
+
const blade = bladeForTick(tick, phase);
|
|
129
|
+
const eye = eyeForTick(tick, phase);
|
|
130
|
+
return lines.map((line) => line.replaceAll("!!!", blade).replaceAll("?", eye));
|
|
131
|
+
}
|
|
132
|
+
function miniDroneLines(tick, align = "left", phase = 0) {
|
|
133
|
+
return materializeDrone(MINI_DRONE, tick, phase).map((text) => ({
|
|
134
|
+
text,
|
|
135
|
+
styledText: styledLine(text, droneColor),
|
|
136
|
+
fg: RIG_UI.limeDim,
|
|
137
|
+
align
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
function brandFleetLines(tick, align = "center") {
|
|
141
|
+
const left = materializeDrone(MINI_DRONE, tick, 0);
|
|
142
|
+
const right = materializeDrone(MINI_DRONE, tick, 2);
|
|
143
|
+
const lead = materializeDrone(LEAD_MARK, tick, 1);
|
|
144
|
+
const packet = ["\xB7", "\u2022", "\u25CF", "\u2022"][Math.floor(tick / 2) % 4];
|
|
145
|
+
const bridge = [
|
|
146
|
+
` ${left[0]} ${lead[0]} ${right[0]}`,
|
|
147
|
+
` ${left[1]} \xB7\u2500\u2500${packet}\u2500\u2500\xB7 ${lead[1]} \xB7\u2500\u2500${packet}\u2500\u2500\xB7 ${right[1]}`,
|
|
148
|
+
` ${left[2]} \xB7' '${lead[2]}' '\xB7 ${right[2]}`,
|
|
149
|
+
` ${left[3]} \u2572 signal bus \u2571 ${right[3]}`,
|
|
150
|
+
` ${left[4]} \xB7\u2500\u2500\u2500${packet}\u2500\u2500\u2500\u2500\u2500\u2500${packet}\u2500\u2500\u2500\xB7 ${right[4]}`
|
|
151
|
+
];
|
|
152
|
+
return bridge.map((text) => ({
|
|
153
|
+
text,
|
|
154
|
+
styledText: styledLine(text, motionColor),
|
|
155
|
+
fg: RIG_UI.limeDim,
|
|
156
|
+
align
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
function actionDrone(tick, phase = 0) {
|
|
160
|
+
const blade = bladeForTick(tick, phase);
|
|
161
|
+
const eye = eyeForTick(tick, phase);
|
|
162
|
+
return `(${blade})\u2572${eye}\u2571(${blade})`;
|
|
163
|
+
}
|
|
164
|
+
function actionDroneLine(tick, text, fg = RIG_UI.ink2) {
|
|
165
|
+
const prefix = actionDrone(tick);
|
|
166
|
+
const content = `${prefix} ${text}`;
|
|
167
|
+
return { text: content, styledText: styledLine(content, motionColor), fg, align: "center" };
|
|
168
|
+
}
|
|
169
|
+
|
|
40
170
|
// packages/cli/src/app-opentui/render/scene.ts
|
|
41
171
|
function line(text, options = {}) {
|
|
42
172
|
return { text, ...options };
|
|
43
173
|
}
|
|
174
|
+
function blank() {
|
|
175
|
+
return { text: "" };
|
|
176
|
+
}
|
|
44
177
|
function deckRow(input) {
|
|
45
178
|
const prefix = input.active ? "\u25B8" : " ";
|
|
46
179
|
const label = input.label.toUpperCase().padEnd(10);
|
|
@@ -51,11 +184,43 @@ function deckRow(input) {
|
|
|
51
184
|
activateOnClick: input.activateOnClick
|
|
52
185
|
});
|
|
53
186
|
}
|
|
187
|
+
function loadingRows(label, tick = 0, compact = false) {
|
|
188
|
+
const mascot = compact ? miniDroneLines(tick, "center") : brandFleetLines(tick, "center");
|
|
189
|
+
return [
|
|
190
|
+
blank(),
|
|
191
|
+
...mascot,
|
|
192
|
+
blank(),
|
|
193
|
+
{ ...actionDroneLine(tick, `loading ${label}\u2026`, RIG_UI.cyan), align: "center" }
|
|
194
|
+
];
|
|
195
|
+
}
|
|
196
|
+
function errorBanner(message, hint) {
|
|
197
|
+
return [
|
|
198
|
+
line(`\u2717 failed to load \u2014 ${message}`, { fg: RIG_UI.red, bold: true }),
|
|
199
|
+
...hint ? [line(` ${hint}`, { fg: RIG_UI.ink3 })] : [],
|
|
200
|
+
line(" select refresh/retry below", { fg: RIG_UI.ink4 }),
|
|
201
|
+
line("", { fg: RIG_UI.ink3 })
|
|
202
|
+
];
|
|
203
|
+
}
|
|
204
|
+
function lastRefreshError(state) {
|
|
205
|
+
const value = state.data.lastRefreshError;
|
|
206
|
+
return typeof value === "string" && value.trim() ? value : undefined;
|
|
207
|
+
}
|
|
54
208
|
function makeSceneFrame(input) {
|
|
55
209
|
return input;
|
|
56
210
|
}
|
|
57
211
|
|
|
212
|
+
// packages/cli/src/app-opentui/selectable.ts
|
|
213
|
+
function selectableDeckRow(deck, item) {
|
|
214
|
+
return { ...deckRow({ ...deck, activateOnClick: true }), selectable: item };
|
|
215
|
+
}
|
|
216
|
+
|
|
58
217
|
// packages/cli/src/app-opentui/scenes/doctor.ts
|
|
218
|
+
var DOCTOR_ACTIONS = [
|
|
219
|
+
{ detail: "run diagnostics now", item: { id: "run", label: "run", intent: { scene: "doctor", argv: ["doctor"], action: { kind: "doctor-run", label: "Run doctor" } }, message: "run diagnostics" } },
|
|
220
|
+
{ detail: "open server controls", item: { id: "server", label: "server", intent: { scene: "server", argv: ["server", "status"], action: { kind: "refresh", label: "Open server controls" } }, message: "open server controls" } },
|
|
221
|
+
{ detail: "repair project/server/auth link", item: { id: "repair", label: "repair", intent: { scene: "command", argv: ["init", "--repair"], action: { kind: "command-run", label: "Repair project link" } }, message: "repair project link" } },
|
|
222
|
+
{ detail: "open tasks", item: { id: "tasks", label: "tasks", intent: { scene: "tasks", argv: ["tasks"], action: { kind: "refresh", label: "Open tasks" } }, message: "open tasks" } }
|
|
223
|
+
];
|
|
59
224
|
function checks(state) {
|
|
60
225
|
const doctor = state.data.doctor;
|
|
61
226
|
if (!doctor || typeof doctor !== "object" || Array.isArray(doctor))
|
|
@@ -78,10 +243,7 @@ function panelHeight(layout) {
|
|
|
78
243
|
function actionRows(selected) {
|
|
79
244
|
return [
|
|
80
245
|
line("ACTIONS", { fg: RIG_UI.ink3, bold: true }),
|
|
81
|
-
|
|
82
|
-
deckRow({ label: "server", detail: "open server controls", index: 1, active: selected === 1, activateOnClick: true }),
|
|
83
|
-
deckRow({ label: "repair", detail: "repair project/server/auth link", index: 2, active: selected === 2, activateOnClick: true }),
|
|
84
|
-
deckRow({ label: "tasks", detail: "open tasks", index: 3, active: selected === 3, activateOnClick: true })
|
|
246
|
+
...DOCTOR_ACTIONS.map(({ detail, item }, index) => selectableDeckRow({ label: item.label, detail, index, active: selected === index }, item))
|
|
85
247
|
];
|
|
86
248
|
}
|
|
87
249
|
function renderDoctorScene(state, layout) {
|
|
@@ -90,7 +252,9 @@ function renderDoctorScene(state, layout) {
|
|
|
90
252
|
const failures = records.filter((check) => check.status === "fail").length;
|
|
91
253
|
const warnings = records.filter((check) => check.status === "warn").length;
|
|
92
254
|
const firstRemediation = records.find((check) => check.status !== "pass" && check.remediation)?.remediation;
|
|
93
|
-
const
|
|
255
|
+
const loading = state.status === "loading" && records.length === 0;
|
|
256
|
+
const refreshError = lastRefreshError(state);
|
|
257
|
+
const checkLines = records.length > 0 ? records.slice(0, 12).map((check) => line(`${glyph(check.status)} ${check.label}${check.detail ? ` \u2014 ${check.detail}` : ""}`, { fg: doctorColor(check.status) })) : loading ? loadingRows("diagnostics", state.tick) : [line("Diagnostics have not run in this session.", { fg: RIG_UI.ink3 })];
|
|
94
258
|
return makeSceneFrame({
|
|
95
259
|
scene: "doctor",
|
|
96
260
|
title: "Doctor",
|
|
@@ -104,6 +268,7 @@ function renderDoctorScene(state, layout) {
|
|
|
104
268
|
width: panelWidth(layout),
|
|
105
269
|
height: panelHeight(layout),
|
|
106
270
|
lines: [
|
|
271
|
+
...refreshError && !state.error ? errorBanner(refreshError) : [],
|
|
107
272
|
...actionRows(selected),
|
|
108
273
|
line("", { fg: RIG_UI.ink3 }),
|
|
109
274
|
line("CHECKS", { fg: RIG_UI.ink3, bold: true }),
|
|
@@ -14,15 +14,17 @@ var RIG_UI = {
|
|
|
14
14
|
bg: "#070809",
|
|
15
15
|
bg2: "#0b0c0e",
|
|
16
16
|
panel: "#101115",
|
|
17
|
-
panel2: "#
|
|
18
|
-
glass: "#
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
panel2: "#14161b",
|
|
18
|
+
glass: "#1e2230",
|
|
19
|
+
border: "#2a2e3a",
|
|
20
|
+
ink: "#f4f5f8",
|
|
21
|
+
ink2: "#c7c9d3",
|
|
22
|
+
ink3: "#9aa0ae",
|
|
23
|
+
ink4: "#787b86",
|
|
23
24
|
lime: "#ccff4d",
|
|
24
25
|
limeDim: "#a9d63f",
|
|
25
26
|
cyan: "#56d8ff",
|
|
27
|
+
cyanDim: "#3f9fbd",
|
|
26
28
|
red: "#ff5d5d",
|
|
27
29
|
yellow: "#ffd24d",
|
|
28
30
|
magenta: "#ff79b0"
|
|
@@ -173,7 +175,18 @@ function makeSceneFrame(input) {
|
|
|
173
175
|
return input;
|
|
174
176
|
}
|
|
175
177
|
|
|
178
|
+
// packages/cli/src/app-opentui/selectable.ts
|
|
179
|
+
function selectableDeckRow(deck, item) {
|
|
180
|
+
return { ...deckRow({ ...deck, activateOnClick: true }), selectable: item };
|
|
181
|
+
}
|
|
182
|
+
|
|
176
183
|
// packages/cli/src/app-opentui/scenes/error.ts
|
|
184
|
+
var ERROR_ACTIONS = [
|
|
185
|
+
{ detail: "return to dashboard", item: { id: "main", label: "main", intent: { scene: "main", argv: [], action: { kind: "refresh", label: "Back to dashboard" } }, message: "back to dashboard" } },
|
|
186
|
+
{ detail: "run diagnostics", item: { id: "doctor", label: "doctor", intent: { scene: "doctor", argv: ["doctor"], action: { kind: "doctor-run", label: "Run doctor" } }, message: "run diagnostics" } },
|
|
187
|
+
{ detail: "open server controls", item: { id: "server", label: "server", intent: { scene: "server", argv: ["server", "status"], action: { kind: "refresh", label: "Open server controls" } }, message: "open server controls" } },
|
|
188
|
+
{ detail: "repair project/server/auth link", item: { id: "repair", label: "repair", intent: { scene: "command", argv: ["init", "--repair"], action: { kind: "command-run", label: "Repair project link" } }, message: "repair project link" } }
|
|
189
|
+
];
|
|
177
190
|
function renderErrorScene(state) {
|
|
178
191
|
const message = state.error?.message ?? "Unknown app error";
|
|
179
192
|
const hint = state.error?.hint ?? "Use the actions below to recover.";
|
|
@@ -195,10 +208,7 @@ function renderErrorScene(state) {
|
|
|
195
208
|
...hint ? [line(hint, { fg: RIG_UI.yellow })] : [],
|
|
196
209
|
line("", { fg: RIG_UI.ink3 }),
|
|
197
210
|
line("ACTIONS", { fg: RIG_UI.ink3, bold: true }),
|
|
198
|
-
|
|
199
|
-
deckRow({ label: "doctor", detail: "run diagnostics", index: 1, active: selected === 1, activateOnClick: true }),
|
|
200
|
-
deckRow({ label: "server", detail: "open server controls", index: 2, active: selected === 2, activateOnClick: true }),
|
|
201
|
-
deckRow({ label: "repair", detail: "repair project/server/auth link", index: 3, active: selected === 3, activateOnClick: true })
|
|
211
|
+
...ERROR_ACTIONS.map(({ detail, item }, index) => selectableDeckRow({ label: item.label, detail, index, active: selected === index }, item))
|
|
202
212
|
],
|
|
203
213
|
backgroundColor: RIG_UI.panel,
|
|
204
214
|
backgroundAlpha: 184,
|