@h-rig/cli 0.0.6-alpha.83 → 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/rig.js +22085 -14618
- 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 +24296 -16919
- 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 +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 +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"
|
|
@@ -38,11 +40,11 @@ var styles = {
|
|
|
38
40
|
};
|
|
39
41
|
function statusColor(status) {
|
|
40
42
|
switch (status) {
|
|
41
|
-
case "running":
|
|
42
43
|
case "success":
|
|
43
44
|
case "completed":
|
|
44
45
|
case "merged":
|
|
45
46
|
return RIG_UI.lime;
|
|
47
|
+
case "running":
|
|
46
48
|
case "preparing":
|
|
47
49
|
case "created":
|
|
48
50
|
case "validating":
|
|
@@ -62,11 +64,182 @@ function statusColor(status) {
|
|
|
62
64
|
return RIG_UI.ink3;
|
|
63
65
|
}
|
|
64
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 MINI_DRONE = [
|
|
111
|
+
"(!!!) (!!!)",
|
|
112
|
+
" \\%==%/ ",
|
|
113
|
+
" %%?%% ",
|
|
114
|
+
" /%==%\\ ",
|
|
115
|
+
"(!!!) (!!!)"
|
|
116
|
+
];
|
|
117
|
+
var LEAD_MARK = [
|
|
118
|
+
" .-=-. ",
|
|
119
|
+
"=%%?%%=",
|
|
120
|
+
" '-=-' "
|
|
121
|
+
];
|
|
122
|
+
var BLADE_FRAMES = ["---", "\\\\\\", "|||", "///"];
|
|
123
|
+
var EYE_FRAMES = ["o", "@", "\u2022", "."];
|
|
124
|
+
var COLOR = {
|
|
125
|
+
body: RGBA.fromHex(RIG_UI.lime),
|
|
126
|
+
mini: RGBA.fromHex(RIG_UI.limeDim),
|
|
127
|
+
rotor: RGBA.fromHex(RIG_UI.cyan),
|
|
128
|
+
path: RGBA.fromHex(RIG_UI.cyan),
|
|
129
|
+
eye: RGBA.fromHex(RIG_UI.ink),
|
|
130
|
+
dim: RGBA.fromHex(RIG_UI.ink4),
|
|
131
|
+
ink: RGBA.fromHex(RIG_UI.ink2)
|
|
132
|
+
};
|
|
133
|
+
function bladeForTick(tick, phase = 0) {
|
|
134
|
+
return BLADE_FRAMES[(Math.floor(tick / 3) + phase) % BLADE_FRAMES.length];
|
|
135
|
+
}
|
|
136
|
+
function eyeForTick(tick, phase = 0) {
|
|
137
|
+
const pulse = Math.sin(tick * 0.09 + phase);
|
|
138
|
+
return pulse > 0.55 ? EYE_FRAMES[1] : pulse > 0.1 ? EYE_FRAMES[0] : pulse > -0.45 ? EYE_FRAMES[2] : EYE_FRAMES[3];
|
|
139
|
+
}
|
|
140
|
+
function chunk(text, fg, bold = false, dim = false) {
|
|
141
|
+
let attributes = TextAttributes2.NONE;
|
|
142
|
+
if (bold)
|
|
143
|
+
attributes |= TextAttributes2.BOLD;
|
|
144
|
+
if (dim)
|
|
145
|
+
attributes |= TextAttributes2.DIM;
|
|
146
|
+
return { __isChunk: true, text, fg, ...attributes !== TextAttributes2.NONE ? { attributes } : {} };
|
|
147
|
+
}
|
|
148
|
+
function styledLine(text, colorFor) {
|
|
149
|
+
const chunks = [];
|
|
150
|
+
let run = "";
|
|
151
|
+
let runColor = null;
|
|
152
|
+
const flush = () => {
|
|
153
|
+
if (!run || !runColor)
|
|
154
|
+
return;
|
|
155
|
+
chunks.push(chunk(run, COLOR[runColor], runColor === "body" || runColor === "eye", runColor === "dim"));
|
|
156
|
+
run = "";
|
|
157
|
+
};
|
|
158
|
+
for (const char of text) {
|
|
159
|
+
const next = colorFor(char);
|
|
160
|
+
if (next !== runColor) {
|
|
161
|
+
flush();
|
|
162
|
+
runColor = next;
|
|
163
|
+
}
|
|
164
|
+
run += char;
|
|
165
|
+
}
|
|
166
|
+
flush();
|
|
167
|
+
return new StyledText(chunks.length > 0 ? chunks : [chunk("", COLOR.ink)]);
|
|
168
|
+
}
|
|
169
|
+
function droneColor(char) {
|
|
170
|
+
if (char === "?" || char === "o" || char === "@" || char === "\u2022")
|
|
171
|
+
return "eye";
|
|
172
|
+
if (char === "%" || char === "=")
|
|
173
|
+
return "mini";
|
|
174
|
+
if (char === "$")
|
|
175
|
+
return "body";
|
|
176
|
+
if (char === "(" || char === ")" || char === "/" || char === "\\" || char === "|" || char === "-")
|
|
177
|
+
return "rotor";
|
|
178
|
+
if (char === "\xB7" || char === "\u2022" || char === "'" || char === ".")
|
|
179
|
+
return "path";
|
|
180
|
+
if (char.trim() === "")
|
|
181
|
+
return "dim";
|
|
182
|
+
return "ink";
|
|
183
|
+
}
|
|
184
|
+
function motionColor(char) {
|
|
185
|
+
if (char === "\u25CF" || char === "\u25C6" || char === "\u25C9")
|
|
186
|
+
return "body";
|
|
187
|
+
if (char === "\u2022" || char === "\xB7" || char === "\u2500" || char === "\u2502" || char === "\u2571" || char === "\u2572" || char === "\u256D" || char === "\u256E" || char === "\u2570" || char === "\u256F")
|
|
188
|
+
return "path";
|
|
189
|
+
if (char === "\u258C" || char === "\u2590" || char === "\u2581" || char === "\u2594")
|
|
190
|
+
return "mini";
|
|
191
|
+
return droneColor(char);
|
|
192
|
+
}
|
|
193
|
+
function materializeDrone(lines, tick, phase = 0) {
|
|
194
|
+
const blade = bladeForTick(tick, phase);
|
|
195
|
+
const eye = eyeForTick(tick, phase);
|
|
196
|
+
return lines.map((line) => line.replaceAll("!!!", blade).replaceAll("?", eye));
|
|
197
|
+
}
|
|
198
|
+
function miniDroneLines(tick, align = "left", phase = 0) {
|
|
199
|
+
return materializeDrone(MINI_DRONE, tick, phase).map((text) => ({
|
|
200
|
+
text,
|
|
201
|
+
styledText: styledLine(text, droneColor),
|
|
202
|
+
fg: RIG_UI.limeDim,
|
|
203
|
+
align
|
|
204
|
+
}));
|
|
205
|
+
}
|
|
206
|
+
function brandFleetLines(tick, align = "center") {
|
|
207
|
+
const left = materializeDrone(MINI_DRONE, tick, 0);
|
|
208
|
+
const right = materializeDrone(MINI_DRONE, tick, 2);
|
|
209
|
+
const lead = materializeDrone(LEAD_MARK, tick, 1);
|
|
210
|
+
const packet = ["\xB7", "\u2022", "\u25CF", "\u2022"][Math.floor(tick / 2) % 4];
|
|
211
|
+
const bridge = [
|
|
212
|
+
` ${left[0]} ${lead[0]} ${right[0]}`,
|
|
213
|
+
` ${left[1]} \xB7\u2500\u2500${packet}\u2500\u2500\xB7 ${lead[1]} \xB7\u2500\u2500${packet}\u2500\u2500\xB7 ${right[1]}`,
|
|
214
|
+
` ${left[2]} \xB7' '${lead[2]}' '\xB7 ${right[2]}`,
|
|
215
|
+
` ${left[3]} \u2572 signal bus \u2571 ${right[3]}`,
|
|
216
|
+
` ${left[4]} \xB7\u2500\u2500\u2500${packet}\u2500\u2500\u2500\u2500\u2500\u2500${packet}\u2500\u2500\u2500\xB7 ${right[4]}`
|
|
217
|
+
];
|
|
218
|
+
return bridge.map((text) => ({
|
|
219
|
+
text,
|
|
220
|
+
styledText: styledLine(text, motionColor),
|
|
221
|
+
fg: RIG_UI.limeDim,
|
|
222
|
+
align
|
|
223
|
+
}));
|
|
224
|
+
}
|
|
225
|
+
function actionDrone(tick, phase = 0) {
|
|
226
|
+
const blade = bladeForTick(tick, phase);
|
|
227
|
+
const eye = eyeForTick(tick, phase);
|
|
228
|
+
return `(${blade})\u2572${eye}\u2571(${blade})`;
|
|
229
|
+
}
|
|
230
|
+
function actionDroneLine(tick, text, fg = RIG_UI.ink2) {
|
|
231
|
+
const prefix = actionDrone(tick);
|
|
232
|
+
const content = `${prefix} ${text}`;
|
|
233
|
+
return { text: content, styledText: styledLine(content, motionColor), fg, align: "center" };
|
|
234
|
+
}
|
|
65
235
|
|
|
66
236
|
// packages/cli/src/app-opentui/render/scene.ts
|
|
67
237
|
function line(text, options = {}) {
|
|
68
238
|
return { text, ...options };
|
|
69
239
|
}
|
|
240
|
+
function blank() {
|
|
241
|
+
return { text: "" };
|
|
242
|
+
}
|
|
70
243
|
function deckRow(input) {
|
|
71
244
|
const prefix = input.active ? "\u25B8" : " ";
|
|
72
245
|
const label = input.label.toUpperCase().padEnd(10);
|
|
@@ -77,10 +250,39 @@ function deckRow(input) {
|
|
|
77
250
|
activateOnClick: input.activateOnClick
|
|
78
251
|
});
|
|
79
252
|
}
|
|
253
|
+
function loadingRows(label, tick = 0, compact = false) {
|
|
254
|
+
const mascot = compact ? miniDroneLines(tick, "center") : brandFleetLines(tick, "center");
|
|
255
|
+
return [
|
|
256
|
+
blank(),
|
|
257
|
+
...mascot,
|
|
258
|
+
blank(),
|
|
259
|
+
{ ...actionDroneLine(tick, `loading ${label}\u2026`, RIG_UI.cyan), align: "center" }
|
|
260
|
+
];
|
|
261
|
+
}
|
|
262
|
+
function errorBanner(message, hint) {
|
|
263
|
+
return [
|
|
264
|
+
line(`\u2717 failed to load \u2014 ${message}`, { fg: RIG_UI.red, bold: true }),
|
|
265
|
+
...hint ? [line(` ${hint}`, { fg: RIG_UI.ink3 })] : [],
|
|
266
|
+
line(" select refresh/retry below", { fg: RIG_UI.ink4 }),
|
|
267
|
+
line("", { fg: RIG_UI.ink3 })
|
|
268
|
+
];
|
|
269
|
+
}
|
|
270
|
+
function lastRefreshError(state) {
|
|
271
|
+
const value = state.data.lastRefreshError;
|
|
272
|
+
return typeof value === "string" && value.trim() ? value : undefined;
|
|
273
|
+
}
|
|
80
274
|
function makeSceneFrame(input) {
|
|
81
275
|
return input;
|
|
82
276
|
}
|
|
83
277
|
|
|
278
|
+
// packages/cli/src/app-opentui/selectable.ts
|
|
279
|
+
function selectableDeckRow(deck, item) {
|
|
280
|
+
return { ...deckRow({ ...deck, activateOnClick: true }), selectable: item };
|
|
281
|
+
}
|
|
282
|
+
function withSelectable(line2, item) {
|
|
283
|
+
return { ...line2, selectable: item, activateOnClick: true };
|
|
284
|
+
}
|
|
285
|
+
|
|
84
286
|
// packages/cli/src/app-opentui/list-search.ts
|
|
85
287
|
function isListSearchScene(scene) {
|
|
86
288
|
return scene === "fleet" || scene === "tasks";
|
|
@@ -113,15 +315,199 @@ function filterRunsForSearch(runs, query) {
|
|
|
113
315
|
function searchSummary(kind, query, visible, total) {
|
|
114
316
|
return query.trim() ? `search ${JSON.stringify(query)} \xB7 ${visible}/${total} ${kind}` : `${total} ${kind}`;
|
|
115
317
|
}
|
|
318
|
+
function runSortSpec(value) {
|
|
319
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
320
|
+
return null;
|
|
321
|
+
const record = value;
|
|
322
|
+
const key = record.key;
|
|
323
|
+
const dir = record.dir;
|
|
324
|
+
if ((key === "status" || key === "runId" || key === "title" || key === "age") && (dir === "asc" || dir === "desc")) {
|
|
325
|
+
return { key, dir };
|
|
326
|
+
}
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
function cycleRunSort(current, key) {
|
|
330
|
+
if (!current || current.key !== key)
|
|
331
|
+
return { key, dir: "asc" };
|
|
332
|
+
if (current.dir === "asc")
|
|
333
|
+
return { key, dir: "desc" };
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
function ageValue(updatedAt) {
|
|
337
|
+
const parsed = Date.parse(updatedAt ?? "");
|
|
338
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
339
|
+
}
|
|
340
|
+
function applyDir(rows, compare, dir) {
|
|
341
|
+
const sorted = [...rows].sort(compare);
|
|
342
|
+
return dir === "desc" ? sorted.reverse() : sorted;
|
|
343
|
+
}
|
|
344
|
+
function sortRuns(runs, spec) {
|
|
345
|
+
if (!spec)
|
|
346
|
+
return [...runs];
|
|
347
|
+
const { key, dir } = spec;
|
|
348
|
+
if (key === "age") {
|
|
349
|
+
const byNewest = applyDir(runs, (a, b) => ageValue(b.updatedAt) - ageValue(a.updatedAt) || a.runId.localeCompare(b.runId), "asc");
|
|
350
|
+
return dir === "asc" ? byNewest : [...byNewest].reverse();
|
|
351
|
+
}
|
|
352
|
+
const compare = (a, b) => {
|
|
353
|
+
if (key === "status")
|
|
354
|
+
return a.status.localeCompare(b.status) || a.runId.localeCompare(b.runId);
|
|
355
|
+
if (key === "title")
|
|
356
|
+
return a.title.localeCompare(b.title, undefined, { sensitivity: "base" }) || a.runId.localeCompare(b.runId);
|
|
357
|
+
return a.runId.localeCompare(b.runId, undefined, { numeric: true });
|
|
358
|
+
};
|
|
359
|
+
return applyDir(runs, compare, dir);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// packages/cli/src/app-opentui/fleet-stats.ts
|
|
363
|
+
var ACTIVE_STATUSES = new Set([
|
|
364
|
+
"running",
|
|
365
|
+
"preparing",
|
|
366
|
+
"created",
|
|
367
|
+
"validating",
|
|
368
|
+
"reviewing",
|
|
369
|
+
"closing-out",
|
|
370
|
+
"stopping",
|
|
371
|
+
"loading"
|
|
372
|
+
]);
|
|
373
|
+
var SPARK_CHARS = ["\u2581", "\u2582", "\u2583", "\u2584", "\u2585", "\u2586", "\u2587", "\u2588"];
|
|
374
|
+
function normalizeStatus(status) {
|
|
375
|
+
return status.replace(/_/g, "-").toLowerCase();
|
|
376
|
+
}
|
|
377
|
+
function computeFleetStats(runs) {
|
|
378
|
+
const byStatus = new Map;
|
|
379
|
+
let active = 0;
|
|
380
|
+
let succeeded = 0;
|
|
381
|
+
let failed = 0;
|
|
382
|
+
for (const run of runs) {
|
|
383
|
+
const status = normalizeStatus(run.status ?? "");
|
|
384
|
+
byStatus.set(status, (byStatus.get(status) ?? 0) + 1);
|
|
385
|
+
if (ACTIVE_STATUSES.has(status))
|
|
386
|
+
active += 1;
|
|
387
|
+
else if (status === "success" || status === "completed" || status === "merged")
|
|
388
|
+
succeeded += 1;
|
|
389
|
+
else if (status === "failed" || status === "error")
|
|
390
|
+
failed += 1;
|
|
391
|
+
}
|
|
392
|
+
const total = runs.length;
|
|
393
|
+
const load = total === 0 ? 0 : active / total;
|
|
394
|
+
const sparkline = buildSparklineSeries(active, succeeded, failed);
|
|
395
|
+
return { total, active, succeeded, failed, byStatus, load, sparkline };
|
|
396
|
+
}
|
|
397
|
+
function buildSparklineSeries(active, succeeded, failed) {
|
|
398
|
+
const peak = Math.max(1, active, succeeded, failed);
|
|
399
|
+
const base = [succeeded, Math.round(succeeded * 0.6 + failed * 0.4), failed, Math.round((active + failed) / 2), active];
|
|
400
|
+
return base.map((value) => Math.max(0, Math.min(peak, value)) / peak);
|
|
401
|
+
}
|
|
402
|
+
function sparklineString(values, width) {
|
|
403
|
+
if (values.length === 0)
|
|
404
|
+
return "";
|
|
405
|
+
const series = width && width > 0 && values.length > width ? values.slice(values.length - width) : values;
|
|
406
|
+
return series.map((value) => {
|
|
407
|
+
const clamped = Math.max(0, Math.min(1, value));
|
|
408
|
+
const index = Math.min(SPARK_CHARS.length - 1, Math.round(clamped * (SPARK_CHARS.length - 1)));
|
|
409
|
+
return SPARK_CHARS[index];
|
|
410
|
+
}).join("");
|
|
411
|
+
}
|
|
412
|
+
function statusSegments(stats, width) {
|
|
413
|
+
if (width <= 0 || stats.total === 0)
|
|
414
|
+
return { active: "", done: "", failed: "", other: "" };
|
|
415
|
+
const other = Math.max(0, stats.total - stats.active - stats.succeeded - stats.failed);
|
|
416
|
+
const raw = [
|
|
417
|
+
{ key: "active", value: stats.active },
|
|
418
|
+
{ key: "done", value: stats.succeeded },
|
|
419
|
+
{ key: "failed", value: stats.failed },
|
|
420
|
+
{ key: "other", value: other }
|
|
421
|
+
];
|
|
422
|
+
const exact = raw.map((entry) => ({ key: entry.key, exact: entry.value / stats.total * width }));
|
|
423
|
+
const floored = exact.map((entry) => ({ key: entry.key, n: Math.floor(entry.exact), frac: entry.exact - Math.floor(entry.exact) }));
|
|
424
|
+
let remaining = width - floored.reduce((sum, entry) => sum + entry.n, 0);
|
|
425
|
+
for (const entry of [...floored].sort((a, b) => b.frac - a.frac)) {
|
|
426
|
+
if (remaining <= 0)
|
|
427
|
+
break;
|
|
428
|
+
entry.n += 1;
|
|
429
|
+
remaining -= 1;
|
|
430
|
+
}
|
|
431
|
+
const widths = new Map(floored.map((entry) => [entry.key, entry.n]));
|
|
432
|
+
return {
|
|
433
|
+
active: "\u2588".repeat(widths.get("active") ?? 0),
|
|
434
|
+
done: "\u2588".repeat(widths.get("done") ?? 0),
|
|
435
|
+
failed: "\u2588".repeat(widths.get("failed") ?? 0),
|
|
436
|
+
other: "\u2592".repeat(widths.get("other") ?? 0)
|
|
437
|
+
};
|
|
438
|
+
}
|
|
116
439
|
|
|
117
440
|
// packages/cli/src/app-opentui/scenes/fleet.ts
|
|
118
|
-
|
|
441
|
+
var FLEET_RECOVERY_ITEMS = [
|
|
442
|
+
{ id: "tasks", label: "tasks", intent: { scene: "tasks", argv: ["tasks"], action: { kind: "refresh", label: "Open tasks" } }, message: "open tasks and dispatch work" },
|
|
443
|
+
{ id: "repair", label: "repair", intent: { scene: "command", argv: ["init", "--repair"], action: { kind: "command-run", label: "Repair project link" } }, message: "repair project/server/auth link" },
|
|
444
|
+
{ id: "server", label: "server", intent: { scene: "server", argv: ["server", "status"], action: { kind: "refresh", label: "Open server controls" } }, message: "server controls" },
|
|
445
|
+
{ id: "doctor", label: "doctor", intent: { scene: "doctor", argv: ["doctor"], action: { kind: "doctor-run", label: "Run doctor" } }, message: "diagnose project" }
|
|
446
|
+
];
|
|
447
|
+
var COL = {
|
|
448
|
+
glyph: 1,
|
|
449
|
+
runId: 8,
|
|
450
|
+
status: 13,
|
|
451
|
+
age: 6,
|
|
452
|
+
model: 10
|
|
453
|
+
};
|
|
454
|
+
var GUTTER = " ";
|
|
455
|
+
var RUN_COLUMNS = [
|
|
456
|
+
{ key: "status", label: "status", hint: "by run state" },
|
|
457
|
+
{ key: "runId", label: "run-id", hint: "by run id" },
|
|
458
|
+
{ key: "title", label: "task/title", hint: "by task title" },
|
|
459
|
+
{ key: "age", label: "age", hint: "by recency" }
|
|
460
|
+
];
|
|
461
|
+
function runSelectableItem(run) {
|
|
462
|
+
const runId = run.runId?.trim();
|
|
463
|
+
if (!runId)
|
|
464
|
+
return null;
|
|
465
|
+
const title = (run.title || run.taskId || "run").trim() || "run";
|
|
466
|
+
return {
|
|
467
|
+
id: runId,
|
|
468
|
+
label: title,
|
|
469
|
+
data: { selectedRunId: runId },
|
|
470
|
+
intent: { scene: "run-detail", argv: ["run", "status", runId], action: { kind: "refresh", payload: { runId }, label: `Open run ${runId.slice(0, 8)}` } },
|
|
471
|
+
message: `open run ${runId.slice(0, 8)} detail`
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
function fleetSlice(state) {
|
|
119
475
|
const fleet = state.data.fleet;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
476
|
+
return fleet && typeof fleet === "object" && !Array.isArray(fleet) ? fleet : null;
|
|
477
|
+
}
|
|
478
|
+
function asRuns(state) {
|
|
479
|
+
const runs = fleetSlice(state)?.runs;
|
|
123
480
|
return Array.isArray(runs) ? runs : [];
|
|
124
481
|
}
|
|
482
|
+
function optimisticStatuses(state) {
|
|
483
|
+
const map = new Map;
|
|
484
|
+
for (const key of ["optimisticRun", "dispatchingRun"]) {
|
|
485
|
+
const value = state.data[key];
|
|
486
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
487
|
+
continue;
|
|
488
|
+
const record = value;
|
|
489
|
+
if (typeof record.runId === "string" && typeof record.status === "string")
|
|
490
|
+
map.set(record.runId, record.status);
|
|
491
|
+
}
|
|
492
|
+
return map;
|
|
493
|
+
}
|
|
494
|
+
function updatedAgoLabel(state) {
|
|
495
|
+
const refreshedAt = fleetSlice(state)?.refreshedAt;
|
|
496
|
+
if (typeof refreshedAt !== "string")
|
|
497
|
+
return;
|
|
498
|
+
const parsed = Date.parse(refreshedAt);
|
|
499
|
+
if (!Number.isFinite(parsed))
|
|
500
|
+
return;
|
|
501
|
+
const seconds = Math.max(0, Math.round((Date.now() - parsed) / 1000));
|
|
502
|
+
if (seconds < 1)
|
|
503
|
+
return "updated just now";
|
|
504
|
+
if (seconds < 60)
|
|
505
|
+
return `updated ${seconds}s ago`;
|
|
506
|
+
const minutes = Math.round(seconds / 60);
|
|
507
|
+
if (minutes < 60)
|
|
508
|
+
return `updated ${minutes}m ago`;
|
|
509
|
+
return `updated ${Math.round(minutes / 60)}h ago`;
|
|
510
|
+
}
|
|
125
511
|
function panelWidth(layout) {
|
|
126
512
|
return layout?.centerWidth ?? 100;
|
|
127
513
|
}
|
|
@@ -133,27 +519,106 @@ function clip(value, width) {
|
|
|
133
519
|
return "";
|
|
134
520
|
return value.length <= width ? value : `${value.slice(0, Math.max(0, width - 1))}\u2026`;
|
|
135
521
|
}
|
|
136
|
-
function
|
|
137
|
-
|
|
138
|
-
|
|
522
|
+
function cell(value, width) {
|
|
523
|
+
return clip(value, width).padEnd(width);
|
|
524
|
+
}
|
|
525
|
+
function relativeAge(updatedAt) {
|
|
526
|
+
const parsed = Date.parse(updatedAt ?? "");
|
|
527
|
+
if (!Number.isFinite(parsed))
|
|
528
|
+
return "\u2014";
|
|
529
|
+
const deltaMs = Date.now() - parsed;
|
|
530
|
+
if (deltaMs < 0)
|
|
531
|
+
return "now";
|
|
532
|
+
const seconds = Math.floor(deltaMs / 1000);
|
|
533
|
+
if (seconds < 60)
|
|
534
|
+
return `${seconds}s`;
|
|
535
|
+
const minutes = Math.floor(seconds / 60);
|
|
536
|
+
if (minutes < 60)
|
|
537
|
+
return `${minutes}m`;
|
|
538
|
+
const hours = Math.floor(minutes / 60);
|
|
539
|
+
if (hours < 24)
|
|
540
|
+
return `${hours}h`;
|
|
541
|
+
const days = Math.floor(hours / 24);
|
|
542
|
+
if (days < 99)
|
|
543
|
+
return `${days}d`;
|
|
544
|
+
return "99d+";
|
|
545
|
+
}
|
|
546
|
+
function modelLabel(run) {
|
|
547
|
+
const raw = run.raw;
|
|
548
|
+
for (const key of ["model", "runtimeAdapter", "adapter", "runtimeMode"]) {
|
|
549
|
+
const value = raw[key];
|
|
550
|
+
if (typeof value === "string" && value.trim())
|
|
551
|
+
return value.trim();
|
|
552
|
+
}
|
|
553
|
+
return "\u2014";
|
|
554
|
+
}
|
|
555
|
+
function sortArrow(spec, key) {
|
|
556
|
+
if (!spec || spec.key !== key)
|
|
557
|
+
return "";
|
|
558
|
+
return spec.dir === "asc" ? "\u25B2" : "\u25BC";
|
|
559
|
+
}
|
|
560
|
+
function headerRow(titleWidth, spec) {
|
|
561
|
+
const text = [
|
|
562
|
+
" ",
|
|
563
|
+
cell(`run-id${sortArrow(spec, "runId")}`, COL.runId),
|
|
564
|
+
cell(`status${sortArrow(spec, "status")}`, COL.status),
|
|
565
|
+
cell(`task / title${sortArrow(spec, "title")}`, titleWidth),
|
|
566
|
+
cell(`age${sortArrow(spec, "age")}`, COL.age),
|
|
567
|
+
"model"
|
|
568
|
+
].join(GUTTER);
|
|
569
|
+
return line(text, { fg: RIG_UI.ink, bold: true, bg: RIG_UI.glass });
|
|
570
|
+
}
|
|
571
|
+
function sortToggleRow(column, current) {
|
|
572
|
+
const arrow = sortArrow(current, column.key);
|
|
573
|
+
const active = current?.key === column.key;
|
|
574
|
+
const next = cycleRunSort(current, column.key);
|
|
575
|
+
const marker = active ? "\u25B8" : " ";
|
|
576
|
+
const label = `${column.label}${arrow ? ` ${arrow}` : ""}`.padEnd(14);
|
|
577
|
+
const row = line(`${marker} ${label} ${column.hint}`, {
|
|
578
|
+
fg: active ? RIG_UI.lime : RIG_UI.ink2,
|
|
579
|
+
bold: active
|
|
580
|
+
});
|
|
581
|
+
return withSelectable(row, {
|
|
582
|
+
id: `fleet-sort-${column.key}`,
|
|
583
|
+
label: `sort by ${column.label}`,
|
|
584
|
+
data: { fleetSort: next },
|
|
585
|
+
message: `sort runs ${next ? `${column.label} ${next.dir}` : "default"}`
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
function sortStrip(spec) {
|
|
589
|
+
return [
|
|
590
|
+
line("SORT", { fg: RIG_UI.ink3, bold: true }),
|
|
591
|
+
...RUN_COLUMNS.map((column) => sortToggleRow(column, spec)),
|
|
592
|
+
line("", { fg: RIG_UI.ink3 })
|
|
593
|
+
];
|
|
594
|
+
}
|
|
595
|
+
function runRow(width, run, active, optimistic) {
|
|
596
|
+
const effectiveStatus = optimistic ?? run.status;
|
|
597
|
+
const { glyph } = statusLabel(effectiveStatus);
|
|
139
598
|
const marker = active ? "\u258C" : " ";
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
599
|
+
const status = effectiveStatus.replace(/[_-]/g, " ");
|
|
600
|
+
const fixed = `${marker} ${glyph}${GUTTER}${cell(run.runId.slice(0, COL.runId), COL.runId)}${GUTTER}${cell(status, COL.status)}${GUTTER}`;
|
|
601
|
+
const tail = `${GUTTER}${cell(relativeAge(run.updatedAt), COL.age)}${GUTTER}${cell(modelLabel(run), COL.model)}`;
|
|
602
|
+
const titleWidth = Math.max(8, width - fixed.length - tail.length);
|
|
603
|
+
const row = line(`${fixed}${cell(run.title, titleWidth)}${tail}`, {
|
|
604
|
+
fg: active ? RIG_UI.ink : RIG_UI.ink2,
|
|
144
605
|
bold: active,
|
|
145
|
-
|
|
146
|
-
activateOnClick: true
|
|
606
|
+
...active ? { bg: RIG_UI.glass } : {}
|
|
147
607
|
});
|
|
608
|
+
const item = runSelectableItem(run);
|
|
609
|
+
return item ? withSelectable(row, item) : row;
|
|
148
610
|
}
|
|
611
|
+
var RECOVERY_DECKS = [
|
|
612
|
+
{ label: "tasks", detail: "open tasks and dispatch work" },
|
|
613
|
+
{ label: "repair", detail: "repair project/server/auth link" },
|
|
614
|
+
{ label: "server", detail: "open server controls" },
|
|
615
|
+
{ label: "doctor", detail: "diagnose project" }
|
|
616
|
+
];
|
|
149
617
|
function recoveryRows(selected, reason) {
|
|
150
618
|
return [
|
|
151
619
|
...reason ? [line(reason, { fg: RIG_UI.yellow }), line("", { fg: RIG_UI.ink3 })] : [],
|
|
152
620
|
line("ACTIONS", { fg: RIG_UI.ink3, bold: true }),
|
|
153
|
-
|
|
154
|
-
deckRow({ label: "repair", detail: "repair project/server/auth link", index: 1, active: selected === 1, activateOnClick: true }),
|
|
155
|
-
deckRow({ label: "server", detail: "open server controls", index: 2, active: selected === 2, activateOnClick: true }),
|
|
156
|
-
deckRow({ label: "doctor", detail: "diagnose project", index: 3, active: selected === 3, activateOnClick: true })
|
|
621
|
+
...RECOVERY_DECKS.map((deck, index) => selectableDeckRow({ ...deck, index, active: selected === index }, FLEET_RECOVERY_ITEMS[index]))
|
|
157
622
|
];
|
|
158
623
|
}
|
|
159
624
|
function emptyRows(query, total, selected) {
|
|
@@ -175,20 +640,41 @@ function renderFleetScene(state, layout) {
|
|
|
175
640
|
const width = panelWidth(layout);
|
|
176
641
|
const allRuns = asRuns(state);
|
|
177
642
|
const query = listSearchQuery(state);
|
|
178
|
-
const
|
|
643
|
+
const spec = runSortSpec(state.data.fleetSort);
|
|
644
|
+
const runs = sortRuns(filterRunsForSearch(allRuns, query), spec);
|
|
179
645
|
const selectedRun = typeof state.data.selectedRunId === "string" && runs.some((run) => run.runId === state.data.selectedRunId) ? state.data.selectedRunId : runs[0]?.runId;
|
|
180
646
|
const selectedIndex = Math.max(0, runs.findIndex((run) => run.runId === selectedRun));
|
|
181
647
|
const recoveryIndex = Math.max(0, Math.min(3, state.selection.index));
|
|
648
|
+
const optimistic = optimisticStatuses(state);
|
|
649
|
+
const updatedAgo = updatedAgoLabel(state);
|
|
182
650
|
const panelTop = 0;
|
|
183
651
|
const contentWidth = Math.max(12, width - (layout?.compact ? 8 : 10));
|
|
652
|
+
const stats = computeFleetStats(allRuns);
|
|
653
|
+
const barWidth = Math.max(8, Math.min(48, contentWidth - 8));
|
|
654
|
+
const segments = statusSegments(stats, barWidth);
|
|
655
|
+
const distributionBar = t`${styles.cyan(segments.active)}${styles.lime(segments.done)}${styles.red(segments.failed)}${styles.ink4(segments.other)}`;
|
|
656
|
+
const telemetry = allRuns.length > 0 ? [
|
|
657
|
+
line(`load ${sparklineString(stats.sparkline)} ${Math.round(stats.load * 100)}% \u25CF${stats.active} active \u2713${stats.succeeded} done \u2717${stats.failed} failed ${stats.total} total`, { fg: RIG_UI.cyan }),
|
|
658
|
+
{ text: segments.active + segments.done + segments.failed + segments.other, styledText: distributionBar, fg: RIG_UI.ink2 },
|
|
659
|
+
line("", { fg: RIG_UI.ink3 })
|
|
660
|
+
] : [];
|
|
661
|
+
const G = GUTTER.length;
|
|
662
|
+
const railWidth = 1 + 1 + COL.glyph;
|
|
663
|
+
const titleWidth = Math.max(8, contentWidth - (railWidth + G + COL.runId + G + COL.status + G + G + COL.age + G + COL.model));
|
|
664
|
+
const loading = state.status === "loading" && allRuns.length === 0;
|
|
665
|
+
const refreshError = lastRefreshError(state);
|
|
666
|
+
const banner = refreshError && !state.error ? errorBanner(refreshError) : [];
|
|
184
667
|
const panelLines = [
|
|
185
|
-
|
|
186
|
-
|
|
668
|
+
...banner,
|
|
669
|
+
...telemetry,
|
|
187
670
|
...runs.length > 0 ? [
|
|
188
671
|
...degradedRows(state, recoveryIndex),
|
|
189
672
|
...query.trim() ? [line(searchSummary("runs", query, runs.length, allRuns.length), { fg: RIG_UI.ink4 }), line("", { fg: RIG_UI.ink3 })] : [],
|
|
190
|
-
...
|
|
191
|
-
|
|
673
|
+
...sortStrip(spec),
|
|
674
|
+
headerRow(titleWidth, spec),
|
|
675
|
+
line("", { fg: RIG_UI.ink3 }),
|
|
676
|
+
...runs.map((run, index) => runRow(contentWidth, run, index === selectedIndex, optimistic.get(run.runId)))
|
|
677
|
+
] : state.error ? degradedRows(state, recoveryIndex) : loading ? loadingRows("runs", state.tick) : [
|
|
192
678
|
...query.trim() ? [line(searchSummary("runs", query, runs.length, allRuns.length), { fg: RIG_UI.ink4 }), line("", { fg: RIG_UI.ink3 })] : [],
|
|
193
679
|
...emptyRows(query, allRuns.length, recoveryIndex)
|
|
194
680
|
]
|
|
@@ -198,7 +684,7 @@ function renderFleetScene(state, layout) {
|
|
|
198
684
|
title: "Runs",
|
|
199
685
|
lines: [
|
|
200
686
|
line("", { fg: RIG_UI.ink4 }),
|
|
201
|
-
line(query.trim() ? ` runs --search ${JSON.stringify(query)}` : " runs"
|
|
687
|
+
line(`${query.trim() ? ` runs --search ${JSON.stringify(query)}` : " runs"}${updatedAgo ? ` \xB7 ${updatedAgo}` : ""}`, { fg: RIG_UI.ink3 })
|
|
202
688
|
],
|
|
203
689
|
panels: [{
|
|
204
690
|
id: "runs-list",
|
|
@@ -216,7 +702,11 @@ function renderFleetScene(state, layout) {
|
|
|
216
702
|
paddingX: layout?.compact ? 2 : 3,
|
|
217
703
|
paddingY: 1
|
|
218
704
|
}],
|
|
219
|
-
footer: {
|
|
705
|
+
footer: {
|
|
706
|
+
run: selectedRun ? selectedRun.slice(0, 8) : "no runs",
|
|
707
|
+
message: searchSummary("runs", query, runs.length, allRuns.length),
|
|
708
|
+
...updatedAgo ? { updated: updatedAgo } : {}
|
|
709
|
+
},
|
|
220
710
|
typeBarPlaceholder: "search runs\u2026",
|
|
221
711
|
live: true
|
|
222
712
|
});
|