@h-rig/run-plugin 0.0.6-alpha.190 → 0.0.6-alpha.192
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/src/plugin.js +66 -12
- package/dist/src/read-model/plugin.js +66 -12
- package/dist/src/read-model/runs-screen.js +62 -11
- package/package.json +4 -4
package/dist/src/plugin.js
CHANGED
|
@@ -3758,11 +3758,15 @@ import {
|
|
|
3758
3758
|
DRONE_WIDTH,
|
|
3759
3759
|
RIG_SPINNER_FRAMES,
|
|
3760
3760
|
accent as accent2,
|
|
3761
|
+
accentDim,
|
|
3762
|
+
bgPanel,
|
|
3761
3763
|
bold,
|
|
3764
|
+
formatAge,
|
|
3762
3765
|
ink,
|
|
3763
3766
|
ink2,
|
|
3764
3767
|
ink3,
|
|
3765
3768
|
ink4,
|
|
3769
|
+
keyHints,
|
|
3766
3770
|
phaseGlyph,
|
|
3767
3771
|
red,
|
|
3768
3772
|
renderDroneFrame,
|
|
@@ -3777,9 +3781,10 @@ function createRunsBoardView(host, deps) {
|
|
|
3777
3781
|
let tick = 0;
|
|
3778
3782
|
let filter = "";
|
|
3779
3783
|
let sortMode = "active";
|
|
3784
|
+
const rowToIndex = new Map;
|
|
3780
3785
|
function visibleRuns() {
|
|
3781
3786
|
const query = filter.trim().toLowerCase();
|
|
3782
|
-
const filtered = query ? runs.filter((run) => run.runId.toLowerCase().includes(query) || run.status.toLowerCase().includes(query) || run.title.toLowerCase().includes(query)) : [...runs];
|
|
3787
|
+
const filtered = query ? runs.filter((run) => run.runId.toLowerCase().includes(query) || run.status.toLowerCase().includes(query) || (run.taskId ?? "").toLowerCase().includes(query) || run.title.toLowerCase().includes(query)) : [...runs];
|
|
3783
3788
|
if (sortMode === "active") {
|
|
3784
3789
|
return filtered.map((run, index) => ({ run, index })).sort((a, b) => a.run.rank - b.run.rank || a.index - b.index).map((entry) => entry.run);
|
|
3785
3790
|
}
|
|
@@ -3825,39 +3830,55 @@ function createRunsBoardView(host, deps) {
|
|
|
3825
3830
|
];
|
|
3826
3831
|
}
|
|
3827
3832
|
function renderLines(width) {
|
|
3833
|
+
rowToIndex.clear();
|
|
3828
3834
|
if (loading) {
|
|
3829
3835
|
return droneBoardLines(width, "contacting the fleet\u2026", 24);
|
|
3830
3836
|
}
|
|
3831
3837
|
if (error) {
|
|
3832
|
-
return ["", ` ${red("runs unavailable:")} ${ink2(error)}`, ""];
|
|
3838
|
+
return ["", ` ${red("\u2717 runs unavailable:")} ${ink2(error)}`, "", ` ${ink4("r reloads \u2014 the fleet may just be waking up")}`, ""];
|
|
3833
3839
|
}
|
|
3834
3840
|
const visible = visibleRuns();
|
|
3835
3841
|
if (runs.length === 0) {
|
|
3836
|
-
return droneBoardLines(width, "no runs yet \u2014
|
|
3842
|
+
return droneBoardLines(width, "no runs yet \u2014 press 3 (tasks), pick one, dispatch", 50);
|
|
3837
3843
|
}
|
|
3838
3844
|
if (visible.length === 0) {
|
|
3839
3845
|
return ["", ` ${ink2("no runs match")} ${accent2(`/${filter}`)} ${ink3("\u2014 esc clears the filter")}`, ""];
|
|
3840
3846
|
}
|
|
3841
3847
|
const start = Math.max(0, Math.min(selected - Math.floor(MAX_VISIBLE / 2), visible.length - MAX_VISIBLE));
|
|
3842
3848
|
const window = visible.slice(start, start + MAX_VISIBLE);
|
|
3843
|
-
const
|
|
3849
|
+
const titleWidth = Math.max(8, width - 45);
|
|
3850
|
+
const lines = [""];
|
|
3851
|
+
lines.push(ink4(` ${"RUN".padEnd(10)}${"STATUS".padEnd(17)}${"TASK".padEnd(8)}${"TITLE".padEnd(titleWidth)}AGE`));
|
|
3852
|
+
for (let index = 0;index < window.length; index += 1) {
|
|
3853
|
+
const run = window[index];
|
|
3844
3854
|
const isSelected = start + index === selected;
|
|
3845
3855
|
const color = statusRoleColor(run.role);
|
|
3846
3856
|
const dot = color(phaseGlyph(run.phase));
|
|
3847
3857
|
const id = run.runId.slice(0, 8);
|
|
3848
|
-
const status = color(run.status.padEnd(16));
|
|
3849
|
-
const
|
|
3850
|
-
const
|
|
3851
|
-
|
|
3852
|
-
|
|
3858
|
+
const status = color(run.status.padEnd(16).slice(0, 16));
|
|
3859
|
+
const task = run.taskId ? `#${run.taskId}` : "";
|
|
3860
|
+
const cleanTitle = run.taskId && run.title.startsWith(`[${run.taskId}] `) ? run.title.slice(run.taskId.length + 3) : run.title;
|
|
3861
|
+
const taskCell = isSelected ? accentDim(task.padEnd(7).slice(0, 7)) : ink4(task.padEnd(7).slice(0, 7));
|
|
3862
|
+
const title = truncateToWidth(cleanTitle, titleWidth - 1).padEnd(titleWidth - 1);
|
|
3863
|
+
const age = formatAge(run.updatedAt).padStart(4);
|
|
3864
|
+
const rail = isSelected ? accent2("\u258C") : " ";
|
|
3865
|
+
const row = `${rail} ${dot} ${isSelected ? bold(ink(id)) : ink3(id)} ${status} ${taskCell} ${isSelected ? ink(title) : ink2(title)} ${ink4(age)}`;
|
|
3866
|
+
rowToIndex.set(lines.length, start + index);
|
|
3867
|
+
lines.push(isSelected ? bgPanel(row) : row);
|
|
3868
|
+
if (isSelected) {
|
|
3869
|
+
const origin = run.origin ? `${run.origin} run` : "run";
|
|
3870
|
+
rowToIndex.set(lines.length, start + index);
|
|
3871
|
+
lines.push(` ${ink4("\u21B3")} ${ink4(`${origin} ${run.runId}`)}${run.updatedAt ? ink4(` \xB7 updated ${formatAge(run.updatedAt)} ago`) : ""}`);
|
|
3872
|
+
}
|
|
3873
|
+
}
|
|
3853
3874
|
const meta = [];
|
|
3854
3875
|
if (visible.length > MAX_VISIBLE)
|
|
3855
|
-
meta.push(`${selected + 1}
|
|
3876
|
+
meta.push(`${selected + 1} of ${visible.length}`);
|
|
3856
3877
|
if (filter)
|
|
3857
3878
|
meta.push(`filter: ${filter}`);
|
|
3858
3879
|
meta.push(`sort: ${sortMode}`);
|
|
3859
3880
|
lines.push(ink4(` ${meta.join(" \xB7 ")}`));
|
|
3860
|
-
return [
|
|
3881
|
+
return [...lines, ""];
|
|
3861
3882
|
}
|
|
3862
3883
|
function handleInput(data) {
|
|
3863
3884
|
const enc = (value) => encodeURIComponent(value);
|
|
@@ -3937,11 +3958,41 @@ function createRunsBoardView(host, deps) {
|
|
|
3937
3958
|
}
|
|
3938
3959
|
return false;
|
|
3939
3960
|
}
|
|
3961
|
+
function handleMouse(event, line) {
|
|
3962
|
+
if (event.wheel !== null) {
|
|
3963
|
+
moveSelection(event.wheel);
|
|
3964
|
+
host.requestRender();
|
|
3965
|
+
return true;
|
|
3966
|
+
}
|
|
3967
|
+
if (!event.leftClick)
|
|
3968
|
+
return false;
|
|
3969
|
+
const index = rowToIndex.get(line);
|
|
3970
|
+
if (index === undefined)
|
|
3971
|
+
return false;
|
|
3972
|
+
if (index === selected) {
|
|
3973
|
+
const run = selectedRun3();
|
|
3974
|
+
if (run)
|
|
3975
|
+
host.act(`run-detail:${encodeURIComponent(run.runId)}`);
|
|
3976
|
+
return true;
|
|
3977
|
+
}
|
|
3978
|
+
selected = index;
|
|
3979
|
+
host.requestRender();
|
|
3980
|
+
return true;
|
|
3981
|
+
}
|
|
3940
3982
|
return {
|
|
3941
3983
|
render(width) {
|
|
3942
3984
|
return renderLines(width).map((line) => truncateToWidth(line, Math.max(10, width - 1)));
|
|
3943
3985
|
},
|
|
3986
|
+
footer(noticeText) {
|
|
3987
|
+
const run = selectedRun3();
|
|
3988
|
+
const context = noticeText ? accentDim(noticeText) : ink4(run ? "enter opens the run \u2014 steer, stop, and gates live there" : "the fleet board \u2014 every dispatched run, live");
|
|
3989
|
+
return [
|
|
3990
|
+
` ${context}`,
|
|
3991
|
+
keyHints([["enter", "open"], ["a", "attach"], ["s", "steer"], ["x", "stop"], ["/", "filter"], ["o", "sort"], ["r", "reload"], ["q", "quit"]])
|
|
3992
|
+
];
|
|
3993
|
+
},
|
|
3944
3994
|
handleInput,
|
|
3995
|
+
handleMouse,
|
|
3945
3996
|
setBoard(board) {
|
|
3946
3997
|
if (board.kind !== "runs")
|
|
3947
3998
|
return;
|
|
@@ -4197,7 +4248,10 @@ async function produceRunsBoard(context) {
|
|
|
4197
4248
|
role: classification.role,
|
|
4198
4249
|
phase: classification.phase,
|
|
4199
4250
|
rank: classification.rank,
|
|
4200
|
-
title: run.title
|
|
4251
|
+
title: run.title,
|
|
4252
|
+
...run.taskId ? { taskId: run.taskId } : {},
|
|
4253
|
+
...run.updatedAt ? { updatedAt: run.updatedAt } : {},
|
|
4254
|
+
...run.source ? { origin: run.source } : {}
|
|
4201
4255
|
};
|
|
4202
4256
|
});
|
|
4203
4257
|
return { kind: "runs", runs: rows };
|
|
@@ -2208,11 +2208,15 @@ import {
|
|
|
2208
2208
|
DRONE_WIDTH,
|
|
2209
2209
|
RIG_SPINNER_FRAMES,
|
|
2210
2210
|
accent as accent2,
|
|
2211
|
+
accentDim,
|
|
2212
|
+
bgPanel,
|
|
2211
2213
|
bold,
|
|
2214
|
+
formatAge,
|
|
2212
2215
|
ink,
|
|
2213
2216
|
ink2,
|
|
2214
2217
|
ink3,
|
|
2215
2218
|
ink4,
|
|
2219
|
+
keyHints,
|
|
2216
2220
|
phaseGlyph,
|
|
2217
2221
|
red,
|
|
2218
2222
|
renderDroneFrame,
|
|
@@ -2227,9 +2231,10 @@ function createRunsBoardView(host, deps) {
|
|
|
2227
2231
|
let tick = 0;
|
|
2228
2232
|
let filter = "";
|
|
2229
2233
|
let sortMode = "active";
|
|
2234
|
+
const rowToIndex = new Map;
|
|
2230
2235
|
function visibleRuns() {
|
|
2231
2236
|
const query = filter.trim().toLowerCase();
|
|
2232
|
-
const filtered = query ? runs.filter((run) => run.runId.toLowerCase().includes(query) || run.status.toLowerCase().includes(query) || run.title.toLowerCase().includes(query)) : [...runs];
|
|
2237
|
+
const filtered = query ? runs.filter((run) => run.runId.toLowerCase().includes(query) || run.status.toLowerCase().includes(query) || (run.taskId ?? "").toLowerCase().includes(query) || run.title.toLowerCase().includes(query)) : [...runs];
|
|
2233
2238
|
if (sortMode === "active") {
|
|
2234
2239
|
return filtered.map((run, index) => ({ run, index })).sort((a, b) => a.run.rank - b.run.rank || a.index - b.index).map((entry) => entry.run);
|
|
2235
2240
|
}
|
|
@@ -2275,39 +2280,55 @@ function createRunsBoardView(host, deps) {
|
|
|
2275
2280
|
];
|
|
2276
2281
|
}
|
|
2277
2282
|
function renderLines(width) {
|
|
2283
|
+
rowToIndex.clear();
|
|
2278
2284
|
if (loading) {
|
|
2279
2285
|
return droneBoardLines(width, "contacting the fleet\u2026", 24);
|
|
2280
2286
|
}
|
|
2281
2287
|
if (error) {
|
|
2282
|
-
return ["", ` ${red("runs unavailable:")} ${ink2(error)}`, ""];
|
|
2288
|
+
return ["", ` ${red("\u2717 runs unavailable:")} ${ink2(error)}`, "", ` ${ink4("r reloads \u2014 the fleet may just be waking up")}`, ""];
|
|
2283
2289
|
}
|
|
2284
2290
|
const visible = visibleRuns();
|
|
2285
2291
|
if (runs.length === 0) {
|
|
2286
|
-
return droneBoardLines(width, "no runs yet \u2014
|
|
2292
|
+
return droneBoardLines(width, "no runs yet \u2014 press 3 (tasks), pick one, dispatch", 50);
|
|
2287
2293
|
}
|
|
2288
2294
|
if (visible.length === 0) {
|
|
2289
2295
|
return ["", ` ${ink2("no runs match")} ${accent2(`/${filter}`)} ${ink3("\u2014 esc clears the filter")}`, ""];
|
|
2290
2296
|
}
|
|
2291
2297
|
const start = Math.max(0, Math.min(selected - Math.floor(MAX_VISIBLE / 2), visible.length - MAX_VISIBLE));
|
|
2292
2298
|
const window = visible.slice(start, start + MAX_VISIBLE);
|
|
2293
|
-
const
|
|
2299
|
+
const titleWidth = Math.max(8, width - 45);
|
|
2300
|
+
const lines = [""];
|
|
2301
|
+
lines.push(ink4(` ${"RUN".padEnd(10)}${"STATUS".padEnd(17)}${"TASK".padEnd(8)}${"TITLE".padEnd(titleWidth)}AGE`));
|
|
2302
|
+
for (let index = 0;index < window.length; index += 1) {
|
|
2303
|
+
const run = window[index];
|
|
2294
2304
|
const isSelected = start + index === selected;
|
|
2295
2305
|
const color = statusRoleColor(run.role);
|
|
2296
2306
|
const dot = color(phaseGlyph(run.phase));
|
|
2297
2307
|
const id = run.runId.slice(0, 8);
|
|
2298
|
-
const status = color(run.status.padEnd(16));
|
|
2299
|
-
const
|
|
2300
|
-
const
|
|
2301
|
-
|
|
2302
|
-
|
|
2308
|
+
const status = color(run.status.padEnd(16).slice(0, 16));
|
|
2309
|
+
const task = run.taskId ? `#${run.taskId}` : "";
|
|
2310
|
+
const cleanTitle = run.taskId && run.title.startsWith(`[${run.taskId}] `) ? run.title.slice(run.taskId.length + 3) : run.title;
|
|
2311
|
+
const taskCell = isSelected ? accentDim(task.padEnd(7).slice(0, 7)) : ink4(task.padEnd(7).slice(0, 7));
|
|
2312
|
+
const title = truncateToWidth(cleanTitle, titleWidth - 1).padEnd(titleWidth - 1);
|
|
2313
|
+
const age = formatAge(run.updatedAt).padStart(4);
|
|
2314
|
+
const rail = isSelected ? accent2("\u258C") : " ";
|
|
2315
|
+
const row = `${rail} ${dot} ${isSelected ? bold(ink(id)) : ink3(id)} ${status} ${taskCell} ${isSelected ? ink(title) : ink2(title)} ${ink4(age)}`;
|
|
2316
|
+
rowToIndex.set(lines.length, start + index);
|
|
2317
|
+
lines.push(isSelected ? bgPanel(row) : row);
|
|
2318
|
+
if (isSelected) {
|
|
2319
|
+
const origin = run.origin ? `${run.origin} run` : "run";
|
|
2320
|
+
rowToIndex.set(lines.length, start + index);
|
|
2321
|
+
lines.push(` ${ink4("\u21B3")} ${ink4(`${origin} ${run.runId}`)}${run.updatedAt ? ink4(` \xB7 updated ${formatAge(run.updatedAt)} ago`) : ""}`);
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2303
2324
|
const meta = [];
|
|
2304
2325
|
if (visible.length > MAX_VISIBLE)
|
|
2305
|
-
meta.push(`${selected + 1}
|
|
2326
|
+
meta.push(`${selected + 1} of ${visible.length}`);
|
|
2306
2327
|
if (filter)
|
|
2307
2328
|
meta.push(`filter: ${filter}`);
|
|
2308
2329
|
meta.push(`sort: ${sortMode}`);
|
|
2309
2330
|
lines.push(ink4(` ${meta.join(" \xB7 ")}`));
|
|
2310
|
-
return [
|
|
2331
|
+
return [...lines, ""];
|
|
2311
2332
|
}
|
|
2312
2333
|
function handleInput(data) {
|
|
2313
2334
|
const enc = (value) => encodeURIComponent(value);
|
|
@@ -2387,11 +2408,41 @@ function createRunsBoardView(host, deps) {
|
|
|
2387
2408
|
}
|
|
2388
2409
|
return false;
|
|
2389
2410
|
}
|
|
2411
|
+
function handleMouse(event, line) {
|
|
2412
|
+
if (event.wheel !== null) {
|
|
2413
|
+
moveSelection(event.wheel);
|
|
2414
|
+
host.requestRender();
|
|
2415
|
+
return true;
|
|
2416
|
+
}
|
|
2417
|
+
if (!event.leftClick)
|
|
2418
|
+
return false;
|
|
2419
|
+
const index = rowToIndex.get(line);
|
|
2420
|
+
if (index === undefined)
|
|
2421
|
+
return false;
|
|
2422
|
+
if (index === selected) {
|
|
2423
|
+
const run = selectedRun2();
|
|
2424
|
+
if (run)
|
|
2425
|
+
host.act(`run-detail:${encodeURIComponent(run.runId)}`);
|
|
2426
|
+
return true;
|
|
2427
|
+
}
|
|
2428
|
+
selected = index;
|
|
2429
|
+
host.requestRender();
|
|
2430
|
+
return true;
|
|
2431
|
+
}
|
|
2390
2432
|
return {
|
|
2391
2433
|
render(width) {
|
|
2392
2434
|
return renderLines(width).map((line) => truncateToWidth(line, Math.max(10, width - 1)));
|
|
2393
2435
|
},
|
|
2436
|
+
footer(noticeText) {
|
|
2437
|
+
const run = selectedRun2();
|
|
2438
|
+
const context = noticeText ? accentDim(noticeText) : ink4(run ? "enter opens the run \u2014 steer, stop, and gates live there" : "the fleet board \u2014 every dispatched run, live");
|
|
2439
|
+
return [
|
|
2440
|
+
` ${context}`,
|
|
2441
|
+
keyHints([["enter", "open"], ["a", "attach"], ["s", "steer"], ["x", "stop"], ["/", "filter"], ["o", "sort"], ["r", "reload"], ["q", "quit"]])
|
|
2442
|
+
];
|
|
2443
|
+
},
|
|
2394
2444
|
handleInput,
|
|
2445
|
+
handleMouse,
|
|
2395
2446
|
setBoard(board) {
|
|
2396
2447
|
if (board.kind !== "runs")
|
|
2397
2448
|
return;
|
|
@@ -2454,7 +2505,10 @@ async function produceRunsBoard(context) {
|
|
|
2454
2505
|
role: classification.role,
|
|
2455
2506
|
phase: classification.phase,
|
|
2456
2507
|
rank: classification.rank,
|
|
2457
|
-
title: run.title
|
|
2508
|
+
title: run.title,
|
|
2509
|
+
...run.taskId ? { taskId: run.taskId } : {},
|
|
2510
|
+
...run.updatedAt ? { updatedAt: run.updatedAt } : {},
|
|
2511
|
+
...run.source ? { origin: run.source } : {}
|
|
2458
2512
|
};
|
|
2459
2513
|
});
|
|
2460
2514
|
return { kind: "runs", runs: rows };
|
|
@@ -4,11 +4,15 @@ import {
|
|
|
4
4
|
DRONE_WIDTH,
|
|
5
5
|
RIG_SPINNER_FRAMES,
|
|
6
6
|
accent,
|
|
7
|
+
accentDim,
|
|
8
|
+
bgPanel,
|
|
7
9
|
bold,
|
|
10
|
+
formatAge,
|
|
8
11
|
ink,
|
|
9
12
|
ink2,
|
|
10
13
|
ink3,
|
|
11
14
|
ink4,
|
|
15
|
+
keyHints,
|
|
12
16
|
phaseGlyph,
|
|
13
17
|
red,
|
|
14
18
|
renderDroneFrame,
|
|
@@ -24,9 +28,10 @@ function createRunsBoardView(host, deps) {
|
|
|
24
28
|
let tick = 0;
|
|
25
29
|
let filter = "";
|
|
26
30
|
let sortMode = "active";
|
|
31
|
+
const rowToIndex = new Map;
|
|
27
32
|
function visibleRuns() {
|
|
28
33
|
const query = filter.trim().toLowerCase();
|
|
29
|
-
const filtered = query ? runs.filter((run) => run.runId.toLowerCase().includes(query) || run.status.toLowerCase().includes(query) || run.title.toLowerCase().includes(query)) : [...runs];
|
|
34
|
+
const filtered = query ? runs.filter((run) => run.runId.toLowerCase().includes(query) || run.status.toLowerCase().includes(query) || (run.taskId ?? "").toLowerCase().includes(query) || run.title.toLowerCase().includes(query)) : [...runs];
|
|
30
35
|
if (sortMode === "active") {
|
|
31
36
|
return filtered.map((run, index) => ({ run, index })).sort((a, b) => a.run.rank - b.run.rank || a.index - b.index).map((entry) => entry.run);
|
|
32
37
|
}
|
|
@@ -72,39 +77,55 @@ function createRunsBoardView(host, deps) {
|
|
|
72
77
|
];
|
|
73
78
|
}
|
|
74
79
|
function renderLines(width) {
|
|
80
|
+
rowToIndex.clear();
|
|
75
81
|
if (loading) {
|
|
76
82
|
return droneBoardLines(width, "contacting the fleet\u2026", 24);
|
|
77
83
|
}
|
|
78
84
|
if (error) {
|
|
79
|
-
return ["", ` ${red("runs unavailable:")} ${ink2(error)}`, ""];
|
|
85
|
+
return ["", ` ${red("\u2717 runs unavailable:")} ${ink2(error)}`, "", ` ${ink4("r reloads \u2014 the fleet may just be waking up")}`, ""];
|
|
80
86
|
}
|
|
81
87
|
const visible = visibleRuns();
|
|
82
88
|
if (runs.length === 0) {
|
|
83
|
-
return droneBoardLines(width, "no runs yet \u2014
|
|
89
|
+
return droneBoardLines(width, "no runs yet \u2014 press 3 (tasks), pick one, dispatch", 50);
|
|
84
90
|
}
|
|
85
91
|
if (visible.length === 0) {
|
|
86
92
|
return ["", ` ${ink2("no runs match")} ${accent(`/${filter}`)} ${ink3("\u2014 esc clears the filter")}`, ""];
|
|
87
93
|
}
|
|
88
94
|
const start = Math.max(0, Math.min(selected - Math.floor(MAX_VISIBLE / 2), visible.length - MAX_VISIBLE));
|
|
89
95
|
const window = visible.slice(start, start + MAX_VISIBLE);
|
|
90
|
-
const
|
|
96
|
+
const titleWidth = Math.max(8, width - 45);
|
|
97
|
+
const lines = [""];
|
|
98
|
+
lines.push(ink4(` ${"RUN".padEnd(10)}${"STATUS".padEnd(17)}${"TASK".padEnd(8)}${"TITLE".padEnd(titleWidth)}AGE`));
|
|
99
|
+
for (let index = 0;index < window.length; index += 1) {
|
|
100
|
+
const run = window[index];
|
|
91
101
|
const isSelected = start + index === selected;
|
|
92
102
|
const color = statusRoleColor(run.role);
|
|
93
103
|
const dot = color(phaseGlyph(run.phase));
|
|
94
104
|
const id = run.runId.slice(0, 8);
|
|
95
|
-
const status = color(run.status.padEnd(16));
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
105
|
+
const status = color(run.status.padEnd(16).slice(0, 16));
|
|
106
|
+
const task = run.taskId ? `#${run.taskId}` : "";
|
|
107
|
+
const cleanTitle = run.taskId && run.title.startsWith(`[${run.taskId}] `) ? run.title.slice(run.taskId.length + 3) : run.title;
|
|
108
|
+
const taskCell = isSelected ? accentDim(task.padEnd(7).slice(0, 7)) : ink4(task.padEnd(7).slice(0, 7));
|
|
109
|
+
const title = truncateToWidth(cleanTitle, titleWidth - 1).padEnd(titleWidth - 1);
|
|
110
|
+
const age = formatAge(run.updatedAt).padStart(4);
|
|
111
|
+
const rail = isSelected ? accent("\u258C") : " ";
|
|
112
|
+
const row = `${rail} ${dot} ${isSelected ? bold(ink(id)) : ink3(id)} ${status} ${taskCell} ${isSelected ? ink(title) : ink2(title)} ${ink4(age)}`;
|
|
113
|
+
rowToIndex.set(lines.length, start + index);
|
|
114
|
+
lines.push(isSelected ? bgPanel(row) : row);
|
|
115
|
+
if (isSelected) {
|
|
116
|
+
const origin = run.origin ? `${run.origin} run` : "run";
|
|
117
|
+
rowToIndex.set(lines.length, start + index);
|
|
118
|
+
lines.push(` ${ink4("\u21B3")} ${ink4(`${origin} ${run.runId}`)}${run.updatedAt ? ink4(` \xB7 updated ${formatAge(run.updatedAt)} ago`) : ""}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
100
121
|
const meta = [];
|
|
101
122
|
if (visible.length > MAX_VISIBLE)
|
|
102
|
-
meta.push(`${selected + 1}
|
|
123
|
+
meta.push(`${selected + 1} of ${visible.length}`);
|
|
103
124
|
if (filter)
|
|
104
125
|
meta.push(`filter: ${filter}`);
|
|
105
126
|
meta.push(`sort: ${sortMode}`);
|
|
106
127
|
lines.push(ink4(` ${meta.join(" \xB7 ")}`));
|
|
107
|
-
return [
|
|
128
|
+
return [...lines, ""];
|
|
108
129
|
}
|
|
109
130
|
function handleInput(data) {
|
|
110
131
|
const enc = (value) => encodeURIComponent(value);
|
|
@@ -184,11 +205,41 @@ function createRunsBoardView(host, deps) {
|
|
|
184
205
|
}
|
|
185
206
|
return false;
|
|
186
207
|
}
|
|
208
|
+
function handleMouse(event, line) {
|
|
209
|
+
if (event.wheel !== null) {
|
|
210
|
+
moveSelection(event.wheel);
|
|
211
|
+
host.requestRender();
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
if (!event.leftClick)
|
|
215
|
+
return false;
|
|
216
|
+
const index = rowToIndex.get(line);
|
|
217
|
+
if (index === undefined)
|
|
218
|
+
return false;
|
|
219
|
+
if (index === selected) {
|
|
220
|
+
const run = selectedRun();
|
|
221
|
+
if (run)
|
|
222
|
+
host.act(`run-detail:${encodeURIComponent(run.runId)}`);
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
selected = index;
|
|
226
|
+
host.requestRender();
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
187
229
|
return {
|
|
188
230
|
render(width) {
|
|
189
231
|
return renderLines(width).map((line) => truncateToWidth(line, Math.max(10, width - 1)));
|
|
190
232
|
},
|
|
233
|
+
footer(noticeText) {
|
|
234
|
+
const run = selectedRun();
|
|
235
|
+
const context = noticeText ? accentDim(noticeText) : ink4(run ? "enter opens the run \u2014 steer, stop, and gates live there" : "the fleet board \u2014 every dispatched run, live");
|
|
236
|
+
return [
|
|
237
|
+
` ${context}`,
|
|
238
|
+
keyHints([["enter", "open"], ["a", "attach"], ["s", "steer"], ["x", "stop"], ["/", "filter"], ["o", "sort"], ["r", "reload"], ["q", "quit"]])
|
|
239
|
+
];
|
|
240
|
+
},
|
|
191
241
|
handleInput,
|
|
242
|
+
handleMouse,
|
|
192
243
|
setBoard(board) {
|
|
193
244
|
if (board.kind !== "runs")
|
|
194
245
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-rig/run-plugin",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.192",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Run execution + run read-model: the one owner of run state (worker write path, projection read path).",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@oh-my-pi/pi-coding-agent": "16.2.4",
|
|
39
39
|
"@oh-my-pi/pi-tui": "16.2.4",
|
|
40
40
|
"@oh-my-pi/pi-utils": "16.2.4",
|
|
41
|
-
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.
|
|
42
|
-
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.
|
|
43
|
-
"@rig/std-shared": "npm:@h-rig/std-shared@0.0.6-alpha.
|
|
41
|
+
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.192",
|
|
42
|
+
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.192",
|
|
43
|
+
"@rig/std-shared": "npm:@h-rig/std-shared@0.0.6-alpha.192",
|
|
44
44
|
"effect": "4.0.0-beta.90",
|
|
45
45
|
"picocolors": "^1.1.1"
|
|
46
46
|
}
|