@osdlc/wayfinder 0.8.0 → 0.9.0
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/CHANGELOG.md +26 -0
- package/README.md +24 -9
- package/dist/catalog.d.ts +16 -2
- package/dist/catalog.js +53 -8
- package/dist/commands/browse.js +4 -2
- package/dist/commands/list.d.ts +18 -2
- package/dist/commands/list.js +60 -9
- package/dist/config.d.ts +3 -2
- package/dist/config.js +3 -2
- package/dist/core/session.d.ts +25 -5
- package/dist/core/session.js +30 -17
- package/dist/documents.d.ts +76 -0
- package/dist/documents.js +18 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +6 -3
- package/dist/serve/catalog-share.d.ts +13 -1
- package/dist/serve/catalog-share.js +42 -3
- package/dist/serve/index.d.ts +5 -3
- package/dist/serve/index.js +20 -12
- package/dist/tui/app.d.ts +15 -2
- package/dist/tui/app.js +165 -43
- package/dist/vocabulary.d.ts +2 -0
- package/dist/vocabulary.js +2 -0
- package/dist/web/main.js +281 -28
- package/dist/web/page.html +2 -0
- package/dist/web/styles.css +56 -0
- package/package.json +9 -9
- package/schema/config.json +1 -1
package/dist/tui/app.js
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* host, so every key and every frame can be checked without a terminal.
|
|
6
6
|
*
|
|
7
7
|
* Collection is async, which is what much of the state handling is for: keys
|
|
8
|
-
* arrive during a refresh, and a row can be stale.
|
|
8
|
+
* arrive during a refresh, and a row can be stale. With nothing on screen,
|
|
9
|
+
* each runner's rows are drawn as that runner answers. Over rows already on
|
|
10
|
+
* screen, a refresh replaces them all at once when it ends.
|
|
9
11
|
*/
|
|
10
12
|
import { commandString } from '@osdlc/command-seam';
|
|
11
13
|
import { humanAge, humanMs } from '@osdlc/system-model/duration';
|
|
@@ -13,14 +15,14 @@ import { paramShape } from '@osdlc/system-model/params';
|
|
|
13
15
|
import { fitWidth } from '@osdlc/ux';
|
|
14
16
|
import { BIN } from "../app.js";
|
|
15
17
|
import { splitArgs } from "../args.js";
|
|
16
|
-
import { orderedCatalog } from "../catalog.js";
|
|
18
|
+
import { inDisplayOrder, orderedCatalog } from "../catalog.js";
|
|
17
19
|
import { COPY_REFUSED, skillCopyText, taskCopyText } from "../core/copy-text.js";
|
|
18
20
|
import { SessionError } from "../core/session.js";
|
|
19
21
|
import { skillLine } from "../core/skills.js";
|
|
20
22
|
import { groupOf, SKILLS_GROUP } from "../groups.js";
|
|
21
23
|
import { footerHints, keyLines, keysFor } from "../keys.js";
|
|
22
24
|
import { terminalSafe } from "../terminal-text.js";
|
|
23
|
-
import { countRunners, displayPath, parametersUnknownLabel, probeTimeLabel, runnerLabel, withheldLabel, } from "../vocabulary.js";
|
|
25
|
+
import { countRunners, displayPath, parametersUnknownLabel, probeTimeLabel, runnerLabel, withheldLabel, WAITING_AFTER_MS, } from "../vocabulary.js";
|
|
24
26
|
import { isText, namedKey, splitKeys } from "./keys-input.js";
|
|
25
27
|
import { cycleDiscovery, editPaths, execOffCause, moveRunner, settingsLines, toggleRunner, } from "./settings.js";
|
|
26
28
|
import { CLEAR_EOL, chunksWidth, line } from "./style.js";
|
|
@@ -96,12 +98,23 @@ const CLEAR_BELOW = '\x1b[J';
|
|
|
96
98
|
/** The one separator line character. */
|
|
97
99
|
const RULE = '─';
|
|
98
100
|
const errorText = (err) => (err instanceof Error ? err.message : String(err));
|
|
101
|
+
/** At most this many failed runners get a line above the rows. */
|
|
102
|
+
const MAX_FAILURE_LINES = 3;
|
|
103
|
+
/** A failed runner's reason, as the web view words it: `runner: message`. */
|
|
104
|
+
function failureText(r) {
|
|
105
|
+
const message = r.diagnostics.find((d) => d.severity === 'error')?.message ?? 'probe failed';
|
|
106
|
+
return terminalSafe(`${r.runner}: ${message}`);
|
|
107
|
+
}
|
|
99
108
|
/** Make a terminal UI. Nothing is drawn or probed until {@link Tui.boot}. */
|
|
100
109
|
export function createTui({ session, host, styles: s }) {
|
|
101
110
|
/** `argv` quoted for the shell, as the CLI prints the run line. */
|
|
102
111
|
const commandLine = (argv) => commandString(argv, { platform: host.platform });
|
|
103
112
|
const state = {
|
|
104
113
|
catalog: null,
|
|
114
|
+
partial: null,
|
|
115
|
+
pending: [],
|
|
116
|
+
expected: 0,
|
|
117
|
+
loadStarted: 0,
|
|
105
118
|
cache: [],
|
|
106
119
|
skills: [],
|
|
107
120
|
runnerOrder: session.runnerOrder(),
|
|
@@ -144,22 +157,31 @@ export function createTui({ session, host, styles: s }) {
|
|
|
144
157
|
state.message = { text, tone };
|
|
145
158
|
};
|
|
146
159
|
// ------------------------------------------------------------ the catalog
|
|
147
|
-
|
|
160
|
+
/** The rows to show: the catalog's, else what the first probe has sent so far. */
|
|
161
|
+
const shown = () => state.catalog ?? (state.partial !== null ? { reports: state.partial } : null);
|
|
162
|
+
const reports = () => shown()?.reports ?? [];
|
|
148
163
|
const reportFor = (runner) => reports().find((r) => r.runner === runner);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
164
|
+
/** A runner the first probe will report but has not yet. It has a tab and a placeholder. */
|
|
165
|
+
const waiting = () => state.partial === null ? [] : state.pending.filter((r) => reportFor(r) === undefined);
|
|
166
|
+
const tabs = () => {
|
|
167
|
+
const held = waiting();
|
|
168
|
+
const runners = held.length === 0
|
|
169
|
+
? reports().map((r) => r.runner)
|
|
170
|
+
: inDisplayOrder([...reports().map((r) => r.runner), ...held].map((runner) => ({ runner })), state.runnerOrder).map((r) => r.runner);
|
|
171
|
+
return [ALL, ...runners, ...(state.skills.length > 0 ? [SKILLS_TAB] : [])];
|
|
172
|
+
};
|
|
154
173
|
const showsSkills = () => state.runner === ALL || state.runner === SKILLS_TAB;
|
|
155
174
|
const cacheFor = (runner) => state.cache.find((c) => c.runner === runner);
|
|
156
175
|
const chainOf = (runner) => reportFor(runner)?.chain ?? [];
|
|
157
176
|
/** Each withheld runner, with its label and the scopes it needs. */
|
|
158
|
-
const withheldRunners = () =>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
177
|
+
const withheldRunners = () => {
|
|
178
|
+
const catalog = shown();
|
|
179
|
+
return catalog === null
|
|
180
|
+
? []
|
|
181
|
+
: session
|
|
182
|
+
.unknowns({ catalog, cache: state.cache })
|
|
183
|
+
.filter((u) => u.kind === 'withheld');
|
|
184
|
+
};
|
|
163
185
|
/** The withheld runners, and why, or null when execution is allowed. */
|
|
164
186
|
const withheld = () => {
|
|
165
187
|
const reason = session.withheldReason();
|
|
@@ -197,18 +219,22 @@ export function createTui({ session, host, styles: s }) {
|
|
|
197
219
|
declaredOnly: state.declaredOnly,
|
|
198
220
|
maxDepth: SCOPES[state.scope].maxDepth,
|
|
199
221
|
};
|
|
200
|
-
if (
|
|
222
|
+
if (shown() === null || state.runner === SKILLS_TAB) {
|
|
201
223
|
state.rows = [];
|
|
202
224
|
}
|
|
203
225
|
else {
|
|
204
226
|
const scoped = state.runner === ALL ? reports() : reports().filter((r) => r.runner === state.runner);
|
|
205
|
-
state.rows = session.search({
|
|
227
|
+
state.rows = session.search({ reports: scoped }, filter);
|
|
206
228
|
}
|
|
207
229
|
state.skillRows = showsSkills() ? session.searchSkills(state.skills, filter) : [];
|
|
208
230
|
const all = entries();
|
|
209
231
|
if (state.selectedId !== null && !all.some((e) => entryId(e) === state.selectedId)) {
|
|
210
232
|
state.selectedId = entryId(all[0]);
|
|
211
233
|
}
|
|
234
|
+
// While rows arrive, Enter runs the row on screen, not whatever lands
|
|
235
|
+
// at the top after it was drawn.
|
|
236
|
+
if (state.loading && state.selectedId === null)
|
|
237
|
+
state.selectedId = entryId(all[0]);
|
|
212
238
|
}
|
|
213
239
|
function cursor() {
|
|
214
240
|
if (state.selectedId === null)
|
|
@@ -307,8 +333,10 @@ export function createTui({ session, host, styles: s }) {
|
|
|
307
333
|
? state.cache.some((c) => c.state === 'stale')
|
|
308
334
|
: cacheFor(name)?.state === 'stale';
|
|
309
335
|
const held = name !== ALL && reportFor(name)?.skippedForExec === true;
|
|
336
|
+
const loading = name !== ALL && name !== SKILLS_TAB && reportFor(name) === undefined;
|
|
337
|
+
const failed = name !== ALL && reportFor(name)?.status === 'error';
|
|
310
338
|
const title = name === ALL ? ALL : name === SKILLS_TAB ? SKILLS_GROUP.id : runnerLabel(name);
|
|
311
|
-
const label = `${stale ? '~' : ''}${title} ${held ? '–' : count}`;
|
|
339
|
+
const label = `${stale ? '~' : ''}${title} ${held ? '–' : loading ? '…' : count}${failed ? ' !' : ''}`;
|
|
312
340
|
const selected = name === state.runner;
|
|
313
341
|
const chunks = [];
|
|
314
342
|
const prev = names[i - 1];
|
|
@@ -320,7 +348,7 @@ export function createTui({ session, host, styles: s }) {
|
|
|
320
348
|
// around the others, so it shows without color or inverse.
|
|
321
349
|
chunks.push({
|
|
322
350
|
text: selected ? `[${label}]` : ` ${label} `,
|
|
323
|
-
paint: selected ? s.selected : stale || held ? s.warning : s.dim,
|
|
351
|
+
paint: selected ? s.selected : failed ? s.error : stale || held ? s.warning : s.dim,
|
|
324
352
|
});
|
|
325
353
|
return chunks;
|
|
326
354
|
});
|
|
@@ -371,8 +399,20 @@ export function createTui({ session, host, styles: s }) {
|
|
|
371
399
|
// The clock and the probe time give way first when the line is too long,
|
|
372
400
|
// so a warning after them is not cut.
|
|
373
401
|
const clock = [];
|
|
402
|
+
// The names give way after the clock, so the warnings after them stay.
|
|
403
|
+
let named = null;
|
|
404
|
+
const left = state.pending;
|
|
374
405
|
if (state.catalog === null) {
|
|
375
|
-
|
|
406
|
+
if (state.loading && state.partial !== null && left.length > 0) {
|
|
407
|
+
const short = ` loading ${left.length} of ${state.expected}`;
|
|
408
|
+
const chunk = { text: `${short}: ${left.map(runnerLabel).join(', ')}`, paint: s.note };
|
|
409
|
+
named = { chunk, short };
|
|
410
|
+
chunks.push(chunk);
|
|
411
|
+
}
|
|
412
|
+
else if (state.loading) {
|
|
413
|
+
const text = state.expected < 0 ? ' detecting the project…' : ' loading…';
|
|
414
|
+
chunks.push({ text, paint: s.dim });
|
|
415
|
+
}
|
|
376
416
|
}
|
|
377
417
|
else {
|
|
378
418
|
clock.push({
|
|
@@ -387,7 +427,18 @@ export function createTui({ session, host, styles: s }) {
|
|
|
387
427
|
}
|
|
388
428
|
const note = refreshNote(state.cache, state.loading);
|
|
389
429
|
if (state.loading && note === null && state.catalog !== null) {
|
|
390
|
-
|
|
430
|
+
const short = ' refreshing…';
|
|
431
|
+
if (left.length > 0 && Date.now() - state.loadStarted >= WAITING_AFTER_MS) {
|
|
432
|
+
const chunk = {
|
|
433
|
+
text: `${short} waiting on ${left.map(runnerLabel).join(', ')}`,
|
|
434
|
+
paint: s.note,
|
|
435
|
+
};
|
|
436
|
+
named = { chunk, short };
|
|
437
|
+
chunks.push(chunk);
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
chunks.push({ text: short, paint: s.note });
|
|
441
|
+
}
|
|
391
442
|
}
|
|
392
443
|
if (note !== null) {
|
|
393
444
|
chunks.push({ text: ` ${note.text}`, paint: note.slow ? s.error : s.warning });
|
|
@@ -415,6 +466,8 @@ export function createTui({ session, host, styles: s }) {
|
|
|
415
466
|
}
|
|
416
467
|
const length = (list) => list.reduce((n, c) => n + c.text.length, 0);
|
|
417
468
|
const fitted = length(chunks) > width ? chunks.filter((c) => !clock.includes(c)) : chunks;
|
|
469
|
+
if (named !== null && length(fitted) > width)
|
|
470
|
+
named.chunk.text = named.short;
|
|
418
471
|
return line(fitted, width);
|
|
419
472
|
}
|
|
420
473
|
function queryLine(width) {
|
|
@@ -522,6 +575,13 @@ export function createTui({ session, host, styles: s }) {
|
|
|
522
575
|
// The list, in the rows left over. The entry line takes one more row than
|
|
523
576
|
// the key hints it replaces, so the list gives up a row while arguments
|
|
524
577
|
// are typed.
|
|
578
|
+
// A failed runner's reason, above the rows, as the web view shows it.
|
|
579
|
+
const failures = (state.runner === ALL ? reports() : [reportFor(state.runner)])
|
|
580
|
+
.filter((r) => r?.status === 'error')
|
|
581
|
+
.slice(0, MAX_FAILURE_LINES);
|
|
582
|
+
for (const r of failures) {
|
|
583
|
+
out.push(line([{ text: ` ${failureText(r)}`, paint: s.error }], width));
|
|
584
|
+
}
|
|
525
585
|
const at = cursor();
|
|
526
586
|
const list = entries();
|
|
527
587
|
const listHeight = Math.max(1, height - out.length - (state.entering ? 5 : 4));
|
|
@@ -531,10 +591,19 @@ export function createTui({ session, host, styles: s }) {
|
|
|
531
591
|
state.scroll = at - listHeight + 1;
|
|
532
592
|
if (state.scroll < 0)
|
|
533
593
|
state.scroll = 0;
|
|
594
|
+
// A runner the first probe has not heard from yet holds a line after the rows.
|
|
595
|
+
const placeholders = state.runner === ALL ? waiting() : [];
|
|
534
596
|
for (let i = 0; i < listHeight; i++) {
|
|
535
597
|
const entry = list[state.scroll + i];
|
|
536
598
|
if (!entry) {
|
|
537
|
-
|
|
599
|
+
const at = state.scroll + i - list.length;
|
|
600
|
+
const held = placeholders[at];
|
|
601
|
+
if (held !== undefined) {
|
|
602
|
+
out.push(line([{ text: ` … ${runnerLabel(held)} loading`, paint: s.dim }], width));
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
out.push(i === 0 ? emptyList(width) : CLEAR_EOL);
|
|
606
|
+
}
|
|
538
607
|
continue;
|
|
539
608
|
}
|
|
540
609
|
if (entry.skill !== undefined) {
|
|
@@ -616,8 +685,14 @@ export function createTui({ session, host, styles: s }) {
|
|
|
616
685
|
let text;
|
|
617
686
|
if (state.runner === SKILLS_TAB)
|
|
618
687
|
text = state.query !== '' ? 'no match' : 'no skills';
|
|
619
|
-
else if (state.
|
|
620
|
-
text = state.
|
|
688
|
+
else if (state.runner !== ALL && waiting().includes(state.runner)) {
|
|
689
|
+
text = `… loading ${runnerLabel(state.runner)}`;
|
|
690
|
+
}
|
|
691
|
+
else if (shown() === null)
|
|
692
|
+
text = state.probed ? 'nothing collected' : 'loading…';
|
|
693
|
+
else if (state.runner !== ALL && reportFor(state.runner)?.status === 'error') {
|
|
694
|
+
text = 'probe failed';
|
|
695
|
+
}
|
|
621
696
|
else if (state.runner !== ALL && reportFor(state.runner)?.skippedForExec === true) {
|
|
622
697
|
const held = withheld();
|
|
623
698
|
text = held === null ? 'withheld' : `${held.cause}${held.trustable ? ' — ^s to trust' : ''}`;
|
|
@@ -627,7 +702,7 @@ export function createTui({ session, host, styles: s }) {
|
|
|
627
702
|
else if (tabTasks().length > 0)
|
|
628
703
|
text = 'no task passes the filters';
|
|
629
704
|
else
|
|
630
|
-
text = state.probed || !state.loading ? 'nothing collected' : '
|
|
705
|
+
text = state.probed || !state.loading ? 'nothing collected' : 'loading…';
|
|
631
706
|
return line([{ text: ` ${text}`, paint: s.dim }], width);
|
|
632
707
|
}
|
|
633
708
|
/** The line under the selected task: its marks spelled out, then its doc. */
|
|
@@ -644,13 +719,18 @@ export function createTui({ session, host, styles: s }) {
|
|
|
644
719
|
chunks.push({ text: task.doc ?? task.detail ?? '', paint: s.dim });
|
|
645
720
|
return chunks;
|
|
646
721
|
}
|
|
722
|
+
/** Set once the terminal is given back: nothing may draw over the shell after that. */
|
|
723
|
+
let ended = false;
|
|
647
724
|
function draw() {
|
|
725
|
+
if (ended)
|
|
726
|
+
return;
|
|
648
727
|
recompute();
|
|
649
728
|
host.write(frame(host.columns() || 100, host.rows() || 30));
|
|
650
729
|
}
|
|
651
730
|
// --------------------------------------------------------------- actions
|
|
652
731
|
function quit(code) {
|
|
653
732
|
state.inFlight?.abort();
|
|
733
|
+
ended = true;
|
|
654
734
|
host.release();
|
|
655
735
|
host.exit(code);
|
|
656
736
|
}
|
|
@@ -661,11 +741,12 @@ export function createTui({ session, host, styles: s }) {
|
|
|
661
741
|
*/
|
|
662
742
|
let confirming = false;
|
|
663
743
|
function run(task, args) {
|
|
664
|
-
|
|
744
|
+
const catalog = shown();
|
|
745
|
+
if (catalog === null)
|
|
665
746
|
return;
|
|
666
747
|
let plan;
|
|
667
748
|
try {
|
|
668
|
-
plan = session.resolveRun(
|
|
749
|
+
plan = session.resolveRun(catalog, task.id, args);
|
|
669
750
|
}
|
|
670
751
|
catch (err) {
|
|
671
752
|
if (err instanceof SessionError) {
|
|
@@ -674,7 +755,8 @@ export function createTui({ session, host, styles: s }) {
|
|
|
674
755
|
}
|
|
675
756
|
throw err;
|
|
676
757
|
}
|
|
677
|
-
|
|
758
|
+
// Rows the first probe sent as it ran are as fresh as its final answer.
|
|
759
|
+
if (state.fromProbe || state.catalog === null) {
|
|
678
760
|
handOver(task, plan, args);
|
|
679
761
|
return;
|
|
680
762
|
}
|
|
@@ -697,6 +779,7 @@ export function createTui({ session, host, styles: s }) {
|
|
|
697
779
|
/** Hand the terminal to `plan`'s task and exit with its code. */
|
|
698
780
|
function handOver(task, plan, args) {
|
|
699
781
|
state.inFlight?.abort();
|
|
782
|
+
ended = true;
|
|
700
783
|
host.release();
|
|
701
784
|
host.write(`$ ${terminalSafe(commandLine(plan.argv))}\n`);
|
|
702
785
|
if (task.parameters.length > 0 && args.length === 0) {
|
|
@@ -736,14 +819,52 @@ export function createTui({ session, host, styles: s }) {
|
|
|
736
819
|
state.inFlight = controller;
|
|
737
820
|
state.loading = true;
|
|
738
821
|
state.message = note ?? null;
|
|
822
|
+
state.pending = [];
|
|
823
|
+
state.expected = -1;
|
|
824
|
+
state.loadStarted = Date.now();
|
|
825
|
+
// With nothing on screen, each runner is drawn as it answers. Rows
|
|
826
|
+
// already on screen stay until the whole answer replaces them; then the
|
|
827
|
+
// progress only names, after a while, the runners still out.
|
|
828
|
+
const live = state.catalog === null;
|
|
829
|
+
state.partial = live ? [] : null;
|
|
830
|
+
const current = () => generation === state.generation;
|
|
831
|
+
const waitingShown = () => Date.now() - state.loadStarted >= WAITING_AFTER_MS;
|
|
832
|
+
const waitTimer = setTimeout(() => {
|
|
833
|
+
if (current() && state.loading)
|
|
834
|
+
draw();
|
|
835
|
+
}, WAITING_AFTER_MS);
|
|
836
|
+
const progress = {
|
|
837
|
+
onRunners(runners) {
|
|
838
|
+
if (!current())
|
|
839
|
+
return;
|
|
840
|
+
state.pending = inDisplayOrder(runners.map((runner) => ({ runner })), state.runnerOrder).map((r) => r.runner);
|
|
841
|
+
state.expected = runners.length;
|
|
842
|
+
if (live || waitingShown())
|
|
843
|
+
draw();
|
|
844
|
+
},
|
|
845
|
+
onRunner(report, cache) {
|
|
846
|
+
if (!current())
|
|
847
|
+
return;
|
|
848
|
+
state.pending = state.pending.filter((r) => r !== report.runner);
|
|
849
|
+
if (state.partial === null) {
|
|
850
|
+
if (waitingShown())
|
|
851
|
+
draw();
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
state.partial = inDisplayOrder([...state.partial.filter((r) => r.runner !== report.runner), report], state.runnerOrder);
|
|
855
|
+
state.cache = [...state.cache.filter((c) => c.runner !== report.runner), cache];
|
|
856
|
+
draw();
|
|
857
|
+
},
|
|
858
|
+
};
|
|
739
859
|
draw();
|
|
740
860
|
try {
|
|
741
861
|
// Always a real probe. ^r means "ask again", and an answer from the
|
|
742
862
|
// store would look the same as doing nothing.
|
|
743
|
-
const snapshot = await session.catalog({ signal: controller.signal });
|
|
863
|
+
const snapshot = await session.catalog({ signal: controller.signal, progress });
|
|
744
864
|
if (generation !== state.generation)
|
|
745
865
|
return;
|
|
746
866
|
state.catalog = orderedCatalog(snapshot.catalog, state.runnerOrder);
|
|
867
|
+
state.partial = null;
|
|
747
868
|
state.cache = snapshot.cache;
|
|
748
869
|
state.skills = snapshot.skills;
|
|
749
870
|
state.fromProbe = snapshot.origin === 'probe';
|
|
@@ -756,32 +877,31 @@ export function createTui({ session, host, styles: s }) {
|
|
|
756
877
|
}
|
|
757
878
|
}
|
|
758
879
|
finally {
|
|
880
|
+
clearTimeout(waitTimer);
|
|
759
881
|
if (generation === state.generation) {
|
|
760
882
|
state.loading = false;
|
|
761
883
|
state.inFlight = null;
|
|
762
884
|
state.probed = true;
|
|
885
|
+
state.pending = [];
|
|
763
886
|
if (note !== undefined && state.message === note)
|
|
764
887
|
state.message = null;
|
|
765
888
|
}
|
|
766
889
|
}
|
|
767
890
|
}
|
|
768
891
|
async function boot() {
|
|
769
|
-
// The saved view
|
|
770
|
-
// one, the
|
|
771
|
-
//
|
|
772
|
-
|
|
773
|
-
// savedCatalog never throws; a bad file reads as none.
|
|
774
|
-
const stored = (await session.savedCatalog()) ?? (await session.storedCatalog());
|
|
775
|
-
if (stored !== null) {
|
|
776
|
-
state.catalog = orderedCatalog(stored.catalog, state.runnerOrder);
|
|
777
|
-
state.cache = stored.cache;
|
|
778
|
-
state.skills = stored.skills;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
catch {
|
|
782
|
-
// A store that cannot be read is the same as an empty one.
|
|
783
|
-
}
|
|
892
|
+
// The frame at once, then the saved view: one file, so the tasks show
|
|
893
|
+
// at once. Without one, the probe draws each runner as it answers. The
|
|
894
|
+
// store is not read first: it detects the project and hashes each
|
|
895
|
+
// runner's files, which costs as long as the probe's own detection.
|
|
784
896
|
draw();
|
|
897
|
+
// savedCatalog never throws; a bad file reads as none.
|
|
898
|
+
const saved = await session.savedCatalog();
|
|
899
|
+
if (saved !== null) {
|
|
900
|
+
state.catalog = orderedCatalog(saved.catalog, state.runnerOrder);
|
|
901
|
+
state.cache = saved.cache;
|
|
902
|
+
state.skills = saved.skills;
|
|
903
|
+
draw();
|
|
904
|
+
}
|
|
785
905
|
await refresh();
|
|
786
906
|
draw();
|
|
787
907
|
}
|
|
@@ -897,6 +1017,8 @@ export function createTui({ session, host, styles: s }) {
|
|
|
897
1017
|
state.runnerOrder = settings.runnerOrder.value;
|
|
898
1018
|
if (state.catalog !== null)
|
|
899
1019
|
state.catalog = orderedCatalog(state.catalog, state.runnerOrder);
|
|
1020
|
+
if (state.partial !== null)
|
|
1021
|
+
state.partial = inDisplayOrder(state.partial, state.runnerOrder);
|
|
900
1022
|
}
|
|
901
1023
|
async function openSettings() {
|
|
902
1024
|
let settings;
|
package/dist/vocabulary.d.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
import type { ParametersUnknownReason } from '@osdlc/system-model/detect';
|
|
10
10
|
import type { StaleReason } from '@osdlc/system-model/detect';
|
|
11
11
|
export { APP, BIN } from './app.ts';
|
|
12
|
+
/** How long a refresh runs before the status names the runners it still waits on. */
|
|
13
|
+
export declare const WAITING_AFTER_MS = 3000;
|
|
12
14
|
/** What one row is called on every surface. */
|
|
13
15
|
export declare const TASK_NOUN: {
|
|
14
16
|
readonly one: "task";
|
package/dist/vocabulary.js
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
import { groupOf } from '@osdlc/system-model/groups';
|
|
10
10
|
import { humanAge, humanMs } from '@osdlc/system-model/duration';
|
|
11
11
|
export { APP, BIN } from "./app.js";
|
|
12
|
+
/** How long a refresh runs before the status names the runners it still waits on. */
|
|
13
|
+
export const WAITING_AFTER_MS = 3000;
|
|
12
14
|
/** What one row is called on every surface. */
|
|
13
15
|
export const TASK_NOUN = { one: 'task', many: 'tasks' };
|
|
14
16
|
/** `1 task`, `3 tasks`. */
|