@e4779/pi-fabric 0.97.0-fork.13 → 0.100.0-fork.15
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/THIRD_PARTY_NOTICES.md +5 -4
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/types.d.ts +4 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents.js +3 -3
- package/dist/chunks/{chunk-JCV54SSP.js → chunk-27ORW5EK.js} +41 -22
- package/dist/chunks/chunk-27ORW5EK.js.map +7 -0
- package/dist/chunks/{chunk-EQIGYLVB.js → chunk-3RFEMOJA.js} +9 -3
- package/dist/chunks/chunk-3RFEMOJA.js.map +7 -0
- package/dist/chunks/{chunk-D5GNTBV6.js → chunk-7HQKBGTL.js} +2 -2
- package/dist/chunks/{chunk-LNLQ2LX3.js → chunk-ASU53MOT.js} +2 -2
- package/dist/chunks/{chunk-V3PIO7QL.js → chunk-BUQZBG6O.js} +3 -43
- package/dist/chunks/chunk-BUQZBG6O.js.map +7 -0
- package/dist/chunks/{chunk-6K5SRGW6.js → chunk-C2DIKAOE.js} +4 -4
- package/dist/chunks/{chunk-FJSHRHOR.js → chunk-CPSPZGK4.js} +6 -6
- package/dist/chunks/{chunk-UBPFGMDQ.js → chunk-CXQF35XB.js} +4 -4
- package/dist/chunks/{chunk-3SIXBW6A.js → chunk-H4YYLQTX.js} +2 -2
- package/dist/chunks/{chunk-CSJSHBAT.js → chunk-I5VN6D5T.js} +48 -21
- package/dist/chunks/chunk-I5VN6D5T.js.map +7 -0
- package/dist/chunks/{chunk-VRYEGVHR.js → chunk-J7ZQERKA.js} +11 -8
- package/dist/chunks/chunk-J7ZQERKA.js.map +7 -0
- package/dist/chunks/{chunk-D4B4CCTA.js → chunk-JHQDS6YP.js} +2 -2
- package/dist/chunks/{chunk-OINADFEF.js → chunk-JWWGWUP7.js} +5 -5
- package/dist/chunks/{chunk-WXSELMFV.js → chunk-KFPUVFDS.js} +5 -5
- package/dist/chunks/{chunk-EPAFGT2M.js → chunk-LH2PGXSZ.js} +5 -1
- package/dist/chunks/{chunk-EPAFGT2M.js.map → chunk-LH2PGXSZ.js.map} +2 -2
- package/dist/chunks/{chunk-X3IRR7CV.js → chunk-M25A5R3F.js} +2 -2
- package/dist/chunks/chunk-MNTJX4U7.js +760 -0
- package/dist/chunks/chunk-MNTJX4U7.js.map +7 -0
- package/dist/chunks/{chunk-754HA6KO.js → chunk-NRLDV5R3.js} +7 -2
- package/dist/chunks/chunk-NRLDV5R3.js.map +7 -0
- package/dist/chunks/chunk-O4A5UOXU.js +44 -0
- package/dist/chunks/chunk-O4A5UOXU.js.map +7 -0
- package/dist/chunks/{chunk-4F27LJTS.js → chunk-OEJ6RFDO.js} +255 -72
- package/dist/chunks/chunk-OEJ6RFDO.js.map +7 -0
- package/dist/chunks/{chunk-VQGO4P7C.js → chunk-QIW7QMFI.js} +2 -2
- package/dist/chunks/{chunk-B4HECUJI.js → chunk-RUEKYUNR.js} +2 -2
- package/dist/chunks/{chunk-A4XPJESK.js → chunk-RZHXYLOY.js} +2 -2
- package/dist/chunks/{chunk-QNMMQAZ7.js → chunk-SDDBEBM4.js} +3 -3
- package/dist/chunks/{chunk-2LBC6TTP.js → chunk-UGMLWBVF.js} +390 -228
- package/dist/chunks/chunk-UGMLWBVF.js.map +7 -0
- package/dist/chunks/{chunk-5WUW727L.js → chunk-VGQ2IE7P.js} +19 -3
- package/dist/chunks/chunk-VGQ2IE7P.js.map +7 -0
- package/dist/chunks/{chunk-KBHITFTO.js → chunk-VRAGOMN4.js} +3 -1
- package/dist/chunks/chunk-VRAGOMN4.js.map +7 -0
- package/dist/chunks/{chunk-F676L43O.js → chunk-WK25T5ST.js} +11 -11
- package/dist/chunks/{chunk-IPHEM6RY.js → chunk-WQB6CVES.js} +2 -2
- package/dist/chunks/{chunk-CZSX6UG6.js → chunk-XYFOKDFM.js} +2 -2
- package/dist/chunks/{chunk-G2F2RDZI.js → chunk-YAPDV6LO.js} +2 -2
- package/dist/chunks/{chunk-Q5BMTL6A.js → chunk-YIEK7FH2.js} +4 -4
- package/dist/chunks/{chunk-KS44WKJJ.js → chunk-Z45SUO4B.js} +2 -2
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/compaction/hook.js +6 -6
- package/dist/components/builtin-guidance.d.ts +4 -0
- package/dist/components/builtin-guidance.d.ts.map +1 -0
- package/dist/components/configuration.js +2 -2
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-registry.js +7 -7
- package/dist/core/file-lock.d.ts +4 -0
- package/dist/core/file-lock.d.ts.map +1 -1
- package/dist/core/provider-operations.js +162 -51
- package/dist/core/provider-operations.js.map +2 -2
- package/dist/core/shell-timing.d.ts +11 -0
- package/dist/core/shell-timing.d.ts.map +1 -0
- package/dist/entropy/index.js +12 -10
- package/dist/entropy/pool-store.d.ts +3 -1
- package/dist/entropy/pool-store.d.ts.map +1 -1
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +138 -55
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +125 -58
- package/dist/index.js.map +3 -3
- package/dist/jev/observation.js +5 -5
- package/dist/jev.js +8 -8
- package/dist/lifecycle/broker.d.ts.map +1 -1
- package/dist/memory/digest.js +2 -2
- package/dist/memory/discovery.js +6 -6
- package/dist/memory/file-worker.js +9 -9
- package/dist/memory/normalize.js +5 -5
- package/dist/memory/search.js +7 -7
- package/dist/memory/worker-provider.js +10 -10
- package/dist/memory.js +10 -10
- package/dist/prewalk/messages.d.ts +1 -1
- package/dist/prewalk/messages.d.ts.map +1 -1
- package/dist/protocol.d.ts +12 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +3 -1
- package/dist/providers/agents-actions.d.ts.map +1 -1
- package/dist/providers/agents-message-router.d.ts.map +1 -1
- package/dist/providers/agents-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.js +8 -8
- package/dist/providers/memory-provider.js +9 -9
- package/dist/providers/prewalk-provider.d.ts +3 -3
- package/dist/providers/prewalk-provider.d.ts.map +1 -1
- package/dist/residency/host.js +9 -9
- package/dist/residency/pi-entry.js +9 -9
- package/dist/runtime/core-override-guest-types.js +2 -2
- package/dist/runtime/guest-types.d.ts +1 -1
- package/dist/runtime/guest-types.d.ts.map +1 -1
- package/dist/runtime/guest-types.js +1 -1
- package/dist/runtime/monty-runtime.js +1 -1
- package/dist/runtime/typescript-kernel.js +2 -2
- package/dist/ui/conversation.d.ts +2 -1
- package/dist/ui/conversation.d.ts.map +1 -1
- package/dist/ui/conversation.js +41 -37
- package/dist/ui/conversation.js.map +2 -2
- package/dist/ui/dashboard.js +10 -8
- package/dist/ui/dashboard.js.map +1 -1
- package/dist/ui/fabric-model-selector.d.ts +3 -0
- package/dist/ui/fabric-model-selector.d.ts.map +1 -1
- package/dist/ui/settings.d.ts.map +1 -1
- package/dist/ui/settings.js +15 -2
- package/dist/ui/settings.js.map +2 -2
- package/dist/ui/shell-tasks.d.ts +2 -1
- package/dist/ui/shell-tasks.d.ts.map +1 -1
- package/dist/ui/shell-tasks.js +169 -81
- package/dist/ui/shell-tasks.js.map +3 -3
- package/dist/ui/snapshot.d.ts.map +1 -1
- package/dist/ui/structured.d.ts.map +1 -1
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/verified/generated/authority-kernel.js +188 -81
- package/dist/verified/generated/kernel.js +547 -265
- package/dist/verified/generated/lifecycle-kernel.d.ts +1 -1
- package/dist/verified/generated/lifecycle-kernel.js +172 -125
- package/dist/verified/generated/manifest.json +11 -11
- package/dist/verified/generated/provider-kernel.js +160 -52
- package/dist/verified/generated/storage-kernel.js +238 -69
- package/dist/worker/model-control.d.ts +1 -1
- package/dist/worker/model-control.d.ts.map +1 -1
- package/dist/worker/model-control.js +6 -3
- package/dist/worker/model-control.js.map +2 -2
- package/dist/worker/options.d.ts.map +1 -1
- package/dist/worker/options.js +15 -0
- package/dist/worker/options.js.map +2 -2
- package/dist/worker.js +3 -2
- package/dist/worker.js.map +2 -2
- package/docs/agents.md +1 -1
- package/docs/background-tasks.md +33 -0
- package/docs/configuration.md +4 -2
- package/docs/entropy.md +13 -0
- package/docs/harnesses.md +1 -1
- package/docs/interface.md +2 -0
- package/docs/jev.md +1 -1
- package/docs/prompt-cache.md +3 -3
- package/docs/provider-capabilities.md +1 -1
- package/docs/verified-kernels.md +10 -6
- package/package.json +1 -1
- package/proofs/lifecycle-spec.bend +4 -4
- package/proofs/lifecycle-types.d.ts +1 -1
- package/proofs/lifecycle.bend +6 -6
- package/scripts/test-verified-kernels.mjs +3 -3
- package/scripts/verified-kernels.mjs +53 -13
- package/skillsets/typescript/fabric-exec/references/agents.md +2 -0
- package/dist/chunks/chunk-2LBC6TTP.js.map +0 -7
- package/dist/chunks/chunk-4E63LJDD.js +0 -468
- package/dist/chunks/chunk-4E63LJDD.js.map +0 -7
- package/dist/chunks/chunk-4F27LJTS.js.map +0 -7
- package/dist/chunks/chunk-5WUW727L.js.map +0 -7
- package/dist/chunks/chunk-754HA6KO.js.map +0 -7
- package/dist/chunks/chunk-CSJSHBAT.js.map +0 -7
- package/dist/chunks/chunk-EQIGYLVB.js.map +0 -7
- package/dist/chunks/chunk-JCV54SSP.js.map +0 -7
- package/dist/chunks/chunk-KBHITFTO.js.map +0 -7
- package/dist/chunks/chunk-V3PIO7QL.js.map +0 -7
- package/dist/chunks/chunk-VRYEGVHR.js.map +0 -7
- /package/dist/chunks/{chunk-D5GNTBV6.js.map → chunk-7HQKBGTL.js.map} +0 -0
- /package/dist/chunks/{chunk-LNLQ2LX3.js.map → chunk-ASU53MOT.js.map} +0 -0
- /package/dist/chunks/{chunk-6K5SRGW6.js.map → chunk-C2DIKAOE.js.map} +0 -0
- /package/dist/chunks/{chunk-FJSHRHOR.js.map → chunk-CPSPZGK4.js.map} +0 -0
- /package/dist/chunks/{chunk-UBPFGMDQ.js.map → chunk-CXQF35XB.js.map} +0 -0
- /package/dist/chunks/{chunk-3SIXBW6A.js.map → chunk-H4YYLQTX.js.map} +0 -0
- /package/dist/chunks/{chunk-D4B4CCTA.js.map → chunk-JHQDS6YP.js.map} +0 -0
- /package/dist/chunks/{chunk-OINADFEF.js.map → chunk-JWWGWUP7.js.map} +0 -0
- /package/dist/chunks/{chunk-WXSELMFV.js.map → chunk-KFPUVFDS.js.map} +0 -0
- /package/dist/chunks/{chunk-X3IRR7CV.js.map → chunk-M25A5R3F.js.map} +0 -0
- /package/dist/chunks/{chunk-VQGO4P7C.js.map → chunk-QIW7QMFI.js.map} +0 -0
- /package/dist/chunks/{chunk-B4HECUJI.js.map → chunk-RUEKYUNR.js.map} +0 -0
- /package/dist/chunks/{chunk-A4XPJESK.js.map → chunk-RZHXYLOY.js.map} +0 -0
- /package/dist/chunks/{chunk-QNMMQAZ7.js.map → chunk-SDDBEBM4.js.map} +0 -0
- /package/dist/chunks/{chunk-F676L43O.js.map → chunk-WK25T5ST.js.map} +0 -0
- /package/dist/chunks/{chunk-IPHEM6RY.js.map → chunk-WQB6CVES.js.map} +0 -0
- /package/dist/chunks/{chunk-CZSX6UG6.js.map → chunk-XYFOKDFM.js.map} +0 -0
- /package/dist/chunks/{chunk-G2F2RDZI.js.map → chunk-YAPDV6LO.js.map} +0 -0
- /package/dist/chunks/{chunk-Q5BMTL6A.js.map → chunk-YIEK7FH2.js.map} +0 -0
- /package/dist/chunks/{chunk-KS44WKJJ.js.map → chunk-Z45SUO4B.js.map} +0 -0
package/dist/ui/shell-tasks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { type Component } from "@earendil-works/pi-tui";
|
|
2
|
+
import { type Component, type KeybindingsManager } from "@earendil-works/pi-tui";
|
|
3
3
|
import type { FabricShellJobStore } from "../core/shell-jobs.js";
|
|
4
4
|
export interface ShellTasksOptions {
|
|
5
5
|
jobs: FabricShellJobStore;
|
|
@@ -7,6 +7,7 @@ export interface ShellTasksOptions {
|
|
|
7
7
|
done: () => void;
|
|
8
8
|
requestRender: () => void;
|
|
9
9
|
rows: () => number;
|
|
10
|
+
keys?: KeybindingsManager;
|
|
10
11
|
id?: string;
|
|
11
12
|
}
|
|
12
13
|
/** Lazy inspector; the controller owns lifetime, this view owns no Pi runtime. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-tasks.d.ts","sourceRoot":"","sources":["../../src/ui/shell-tasks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shell-tasks.d.ts","sourceRoot":"","sources":["../../src/ui/shell-tasks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAmE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAClJ,OAAO,KAAK,EAAsB,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAIrF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AASD,kFAAkF;AAClF,qBAAa,cAAe,YAAW,SAAS;;IAelC,QAAQ,CAAC,OAAO,EAAE,iBAAiB;gBAA1B,OAAO,EAAE,iBAAiB;IAkD/C,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAwH/B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IA0B/B,UAAU,IAAI,IAAI;IAClB,OAAO,IAAI,IAAI;CAOhB"}
|
package/dist/ui/shell-tasks.js
CHANGED
|
@@ -1,66 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spinnerFrame
|
|
3
|
+
} from "../chunks/chunk-O4A5UOXU.js";
|
|
1
4
|
import {
|
|
2
5
|
formatDuration,
|
|
6
|
+
padToWidth,
|
|
3
7
|
safeText,
|
|
4
8
|
wrapPlainText
|
|
5
9
|
} from "../chunks/chunk-IR3PIHJM.js";
|
|
6
10
|
|
|
7
11
|
// src/ui/shell-tasks.ts
|
|
8
|
-
import {
|
|
12
|
+
import { stripVTControlCharacters } from "node:util";
|
|
13
|
+
import { getKeybindings, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
14
|
+
var groupNames = ["Active", "Needs attention", "Finished"];
|
|
15
|
+
var taskGroup = (job) => job.finishedAt === void 0 ? 0 : job.status === "failed" || job.status === "timed_out" ? 1 : 2;
|
|
16
|
+
var elapsed = (job) => formatDuration((job.finishedAt ?? Date.now()) - job.startedAt) || "0s";
|
|
17
|
+
var outputLine = (line) => stripVTControlCharacters(line).replace(/\t/g, " ").replace(/[\u0000-\u0008\u000b-\u001f\u007f-\u009f]/g, "");
|
|
9
18
|
var ShellTasksView = class {
|
|
10
19
|
constructor(options) {
|
|
11
20
|
this.options = options;
|
|
12
21
|
this.#id = options.id;
|
|
13
22
|
this.#refresh();
|
|
14
23
|
if (!this.#id && this.#jobs.length === 1) this.#id = this.#jobs[0].id;
|
|
15
|
-
this.#
|
|
16
|
-
this.#
|
|
17
|
-
|
|
24
|
+
this.#selected = this.#id ?? this.#selected;
|
|
25
|
+
this.#unsubscribe = options.jobs.subscribe((event) => {
|
|
26
|
+
this.#refresh();
|
|
27
|
+
if (event.job.id === this.#id) void this.#read();
|
|
28
|
+
});
|
|
18
29
|
void this.#read();
|
|
19
30
|
}
|
|
20
|
-
#list;
|
|
21
31
|
#jobs = [];
|
|
32
|
+
#selected;
|
|
33
|
+
#listStart = 0;
|
|
34
|
+
#pageSize = 1;
|
|
22
35
|
#id;
|
|
23
36
|
#output = "";
|
|
24
37
|
#scroll = 0;
|
|
25
|
-
#stopArmed
|
|
38
|
+
#stopArmed;
|
|
26
39
|
#reading = false;
|
|
40
|
+
#readAgain = false;
|
|
27
41
|
#closed = false;
|
|
28
42
|
#timer;
|
|
29
43
|
#unsubscribe;
|
|
30
44
|
#refresh() {
|
|
31
45
|
if (this.#closed) return;
|
|
32
|
-
|
|
33
|
-
this.#jobs
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
selectedText: (text) => theme.fg("accent", text),
|
|
43
|
-
description: (text) => theme.fg("muted", text),
|
|
44
|
-
scrollInfo: (text) => theme.fg("dim", text),
|
|
45
|
-
noMatch: (text) => theme.fg("dim", text)
|
|
46
|
-
});
|
|
47
|
-
const index = this.#jobs.findIndex((job) => job.id === selected);
|
|
48
|
-
if (index >= 0) this.#list.setSelectedIndex(index);
|
|
49
|
-
this.#list.onSelect = (item) => {
|
|
50
|
-
this.#id = item.value;
|
|
51
|
-
this.#output = "";
|
|
52
|
-
this.#scroll = 0;
|
|
53
|
-
this.#stopArmed = 0;
|
|
54
|
-
void this.#read();
|
|
55
|
-
this.options.requestRender();
|
|
56
|
-
};
|
|
57
|
-
this.#list.onCancel = () => this.options.done();
|
|
58
|
-
void this.#read();
|
|
46
|
+
this.#jobs = this.options.jobs.list().filter((job) => job.finishedAt === void 0 || job.spilledAt !== void 0).sort((a, b) => taskGroup(a) - taskGroup(b) || b.startedAt - a.startedAt);
|
|
47
|
+
if (!this.#jobs.some((job) => job.id === this.#selected)) this.#selected = this.#jobs[0]?.id;
|
|
48
|
+
const active = this.#jobs.some((job) => job.finishedAt === void 0);
|
|
49
|
+
if (active && !this.#timer) {
|
|
50
|
+
this.#timer = setInterval(() => this.options.requestRender(), 250);
|
|
51
|
+
this.#timer.unref?.();
|
|
52
|
+
} else if (!active && this.#timer) {
|
|
53
|
+
clearInterval(this.#timer);
|
|
54
|
+
this.#timer = void 0;
|
|
55
|
+
}
|
|
59
56
|
this.options.requestRender();
|
|
60
57
|
}
|
|
61
58
|
async #read() {
|
|
62
59
|
const id = this.#id;
|
|
63
|
-
if (!id || this.#
|
|
60
|
+
if (!id || this.#closed) return;
|
|
61
|
+
if (this.#reading) {
|
|
62
|
+
this.#readAgain = true;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
64
65
|
const job = this.options.jobs.get(id);
|
|
65
66
|
if (!job) {
|
|
66
67
|
this.#output = "Task no longer retained.";
|
|
@@ -74,84 +75,171 @@ var ShellTasksView = class {
|
|
|
74
75
|
if (!this.#closed && this.#id === id) this.#output = `Output unavailable: ${safeText(error instanceof Error ? error.message : error)}`;
|
|
75
76
|
} finally {
|
|
76
77
|
this.#reading = false;
|
|
77
|
-
if (!this.#closed)
|
|
78
|
+
if (!this.#closed) {
|
|
79
|
+
this.options.requestRender();
|
|
80
|
+
if (this.#readAgain) {
|
|
81
|
+
this.#readAgain = false;
|
|
82
|
+
void this.#read();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
78
85
|
}
|
|
79
86
|
}
|
|
80
87
|
handleInput(data) {
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const keys = getKeybindings();
|
|
88
|
+
if (this.#closed) return;
|
|
89
|
+
const keys = this.options.keys ?? getKeybindings();
|
|
86
90
|
if (keys.matches(data, "tui.select.cancel")) {
|
|
91
|
+
if (!this.#id) {
|
|
92
|
+
this.dispose();
|
|
93
|
+
this.options.done();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
87
96
|
this.#id = void 0;
|
|
88
|
-
this.#stopArmed = 0;
|
|
97
|
+
this.#stopArmed = void 0;
|
|
89
98
|
this.#refresh();
|
|
90
99
|
return;
|
|
91
100
|
}
|
|
92
|
-
if (
|
|
101
|
+
if (!this.#id) {
|
|
102
|
+
const index = Math.max(0, this.#jobs.findIndex((job) => job.id === this.#selected));
|
|
103
|
+
let next = index;
|
|
104
|
+
if (keys.matches(data, "tui.select.up")) next = index === 0 ? this.#jobs.length - 1 : index - 1;
|
|
105
|
+
else if (keys.matches(data, "tui.select.down")) next = index === this.#jobs.length - 1 ? 0 : index + 1;
|
|
106
|
+
else if (keys.matches(data, "tui.select.pageUp")) next = Math.max(0, index - this.#pageSize);
|
|
107
|
+
else if (keys.matches(data, "tui.select.pageDown")) next = Math.min(this.#jobs.length - 1, index + this.#pageSize);
|
|
108
|
+
else if (keys.matches(data, "tui.select.confirm") && this.#selected) {
|
|
109
|
+
this.#id = this.#selected;
|
|
110
|
+
this.#output = "";
|
|
111
|
+
this.#scroll = 0;
|
|
112
|
+
this.#stopArmed = void 0;
|
|
113
|
+
void this.#read();
|
|
114
|
+
}
|
|
115
|
+
this.#selected = this.#jobs[next]?.id;
|
|
116
|
+
} else if (data === "x") {
|
|
93
117
|
const now = Date.now();
|
|
94
118
|
const job = this.options.jobs.get(this.#id);
|
|
95
119
|
if (job && !job.finished) {
|
|
96
|
-
if (this.#stopArmed && now - this.#stopArmed < 3e3) {
|
|
120
|
+
if (this.#stopArmed !== void 0 && now - this.#stopArmed < 3e3) {
|
|
97
121
|
job.stop();
|
|
98
|
-
this.#stopArmed = 0;
|
|
122
|
+
this.#stopArmed = void 0;
|
|
99
123
|
} else this.#stopArmed = now;
|
|
100
124
|
}
|
|
101
125
|
} else {
|
|
102
|
-
this.#stopArmed = 0;
|
|
126
|
+
this.#stopArmed = void 0;
|
|
103
127
|
if (keys.matches(data, "tui.select.up")) this.#scroll++;
|
|
104
128
|
if (keys.matches(data, "tui.select.down")) this.#scroll = Math.max(0, this.#scroll - 1);
|
|
105
|
-
if (keys.matches(data, "tui.select.pageUp")) this.#scroll +=
|
|
106
|
-
if (keys.matches(data, "tui.select.pageDown")) this.#scroll = Math.max(0, this.#scroll -
|
|
129
|
+
if (keys.matches(data, "tui.select.pageUp")) this.#scroll += this.#pageSize;
|
|
130
|
+
if (keys.matches(data, "tui.select.pageDown")) this.#scroll = Math.max(0, this.#scroll - this.#pageSize);
|
|
107
131
|
if (data === "G") this.#scroll = 0;
|
|
108
132
|
}
|
|
109
133
|
this.options.requestRender();
|
|
110
134
|
}
|
|
111
|
-
|
|
112
|
-
if (width <= 0) return [];
|
|
135
|
+
#status(job) {
|
|
113
136
|
const { theme } = this.options;
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
const active = job.finishedAt === void 0;
|
|
138
|
+
const color = job.stopping ? "warning" : active ? "accent" : taskGroup(job) === 1 ? "error" : job.status === "exited" ? "success" : "dim";
|
|
139
|
+
const glyph = active ? spinnerFrame() : taskGroup(job) === 1 ? "\u2717" : job.status === "exited" ? "\u2713" : "\u25A0";
|
|
140
|
+
return theme.fg(color, `${glyph} ${job.stopping ? "stopping" : job.status}`);
|
|
141
|
+
}
|
|
142
|
+
#section(label, width) {
|
|
143
|
+
const title = truncateToWidth(` ${label} `, width);
|
|
144
|
+
return this.options.theme.fg("borderMuted", title + "\u2500".repeat(Math.max(0, width - visibleWidth(title))));
|
|
145
|
+
}
|
|
146
|
+
#overview(width, height) {
|
|
147
|
+
const { theme } = this.options;
|
|
148
|
+
if (!this.#jobs.length) return [theme.fg("muted", "No background shell tasks."), theme.fg("dim", "Detached commands and monitors appear here.")].slice(0, height);
|
|
149
|
+
const selected = Math.max(0, this.#jobs.findIndex((job) => job.id === this.#selected));
|
|
150
|
+
const counts = groupNames.map((_, group) => this.#jobs.filter((job) => taskGroup(job) === group).length);
|
|
151
|
+
const compact = height < 4;
|
|
152
|
+
const rowSize = compact ? 1 : 2;
|
|
153
|
+
const window = (start) => {
|
|
154
|
+
const rows = [];
|
|
155
|
+
let previousGroup = -1, end = start;
|
|
156
|
+
for (let index = start; index < this.#jobs.length; index++) {
|
|
157
|
+
const job = this.#jobs[index];
|
|
158
|
+
const group = taskGroup(job);
|
|
159
|
+
const heading = !compact && group !== previousGroup;
|
|
160
|
+
if (rows.length + rowSize + Number(heading) > height) break;
|
|
161
|
+
if (heading) rows.push(this.#section(`${groupNames[group]} \xB7 ${counts[group]}`, width));
|
|
162
|
+
const chosen = job.id === this.#selected;
|
|
163
|
+
const title = safeText(job.description || job.command) || "Shell task";
|
|
164
|
+
const primary = `${chosen ? theme.fg("accent", "\u203A") : " "} ${this.#status(job)} ${theme.fg(chosen ? "accent" : "text", title)}`;
|
|
165
|
+
rows.push(chosen ? theme.bg("selectedBg", padToWidth(primary, width)) : truncateToWidth(primary, width));
|
|
166
|
+
if (!compact) {
|
|
167
|
+
const monitor = job.monitor ? ` \xB7 monitor:${job.monitor.delivery}` : "";
|
|
168
|
+
const exit = job.exitCode != null ? ` \xB7 exit ${job.exitCode}` : "";
|
|
169
|
+
rows.push(theme.fg("dim", ` ${job.id.slice(0, 8)} \xB7 ${job.tool} \xB7 ${elapsed(job)}${exit}${monitor}`));
|
|
135
170
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const available = Math.max(1, height - rows.length - 1);
|
|
139
|
-
this.#scroll = Math.min(this.#scroll, Math.max(0, output.length - available));
|
|
140
|
-
const end = output.length - this.#scroll;
|
|
141
|
-
rows.push(...output.slice(Math.max(0, end - available), end));
|
|
171
|
+
previousGroup = group;
|
|
172
|
+
end = index + 1;
|
|
142
173
|
}
|
|
174
|
+
return { rows, end };
|
|
175
|
+
};
|
|
176
|
+
this.#listStart = Math.min(this.#listStart, selected);
|
|
177
|
+
let page = window(this.#listStart);
|
|
178
|
+
while (page.end <= selected && this.#listStart < selected) page = window(++this.#listStart);
|
|
179
|
+
this.#pageSize = Math.max(1, page.end - this.#listStart);
|
|
180
|
+
return page.rows;
|
|
181
|
+
}
|
|
182
|
+
#detail(job, width, height) {
|
|
183
|
+
const { theme } = this.options;
|
|
184
|
+
const meta = [
|
|
185
|
+
theme.fg("accent", safeText(job.description || job.command)),
|
|
186
|
+
theme.fg("dim", `${job.lastOutputAt !== void 0 ? `last output ${formatDuration(Date.now() - job.lastOutputAt) || "0s"} ago` : "no output yet"}${job.pid ? ` \xB7 pid ${job.pid}` : ""}`),
|
|
187
|
+
theme.fg("muted", `cwd: ${safeText(job.cwd ?? "unknown")}`),
|
|
188
|
+
theme.fg("dim", `Log: ${safeText(job.logPath ?? "available after backgrounding")}`)
|
|
189
|
+
];
|
|
190
|
+
if (job.monitor) {
|
|
191
|
+
meta.push(theme.fg("muted", `Monitor: ${job.monitor.delivery === "wake" ? "wake owning agent" : "UI only"} \xB7 deadline ${formatDuration(job.monitor.timeoutMs)} \xB7 ${job.eventCount} events`));
|
|
192
|
+
if (job.lastEvent) meta.push(theme.fg("dim", `Latest event: ${safeText(job.lastEvent.lines.at(-1))}`));
|
|
143
193
|
}
|
|
144
|
-
rows =
|
|
145
|
-
|
|
146
|
-
|
|
194
|
+
const rows = meta.slice(0, Math.max(0, height - 6));
|
|
195
|
+
if (height >= 5) {
|
|
196
|
+
rows.push(this.#section("Command", width));
|
|
197
|
+
const commandSpace = Math.max(1, Math.min(3, height - rows.length - 4));
|
|
198
|
+
const command = wrapPlainText(job.command.slice(0, 12e3), width, commandSpace + 1);
|
|
199
|
+
const clipped = command.length > commandSpace || job.command.length > 12e3;
|
|
200
|
+
rows.push(...command.slice(0, commandSpace).map((line) => theme.fg("muted", line)));
|
|
201
|
+
if (clipped) rows[rows.length - 1] = theme.fg("dim", truncateToWidth("\u2026 command clipped \xB7 tasks.get for full text", width));
|
|
202
|
+
}
|
|
203
|
+
const available = Math.max(1, height - rows.length - 1);
|
|
204
|
+
const text = job.finishedAt === void 0 ? this.options.jobs.get(job.id)?.snapshotText(8e3) ?? "" : this.#output;
|
|
205
|
+
const output = text ? text.split("\n").flatMap((line) => wrapTextWithAnsi(outputLine(line), width)) : [job.finishedAt === void 0 ? "Waiting for output\u2026" : "No output captured."];
|
|
206
|
+
this.#scroll = Math.min(this.#scroll, Math.max(0, output.length - available));
|
|
207
|
+
const end = output.length - this.#scroll;
|
|
208
|
+
const start = Math.max(0, end - available);
|
|
209
|
+
this.#pageSize = available;
|
|
210
|
+
rows.push(this.#section(`Output \xB7 ${this.#scroll ? `${start + 1}\u2013${end}/${output.length}` : "tail"} \xB7 bounded`, width));
|
|
211
|
+
rows.push(...output.slice(start, end).map((line) => theme.fg("toolOutput", line)));
|
|
212
|
+
return rows.slice(0, height);
|
|
213
|
+
}
|
|
214
|
+
render(width) {
|
|
215
|
+
if (width <= 0) return [];
|
|
216
|
+
const { theme } = this.options;
|
|
217
|
+
const height = Math.max(1, Math.floor(this.options.rows() * 0.8));
|
|
218
|
+
const job = this.#id ? this.options.jobs.get(this.#id)?.info() : void 0;
|
|
219
|
+
const armed = job?.finishedAt === void 0 && this.#stopArmed !== void 0 && Date.now() - this.#stopArmed < 3e3;
|
|
220
|
+
const hint = !this.#id ? "\u2191\u2193 select \xB7 enter inspect \xB7 esc close" : armed ? "Press x again to stop this task \xB7 esc back" : width < 70 ? `\u2191\u2193 \xB7 G tail${job?.finishedAt === void 0 ? " \xB7 x\xD72 stop" : ""} \xB7 esc` : `\u2191\u2193/pg scroll \xB7 G tail${job?.finishedAt === void 0 ? " \xB7 x twice stop" : ""} \xB7 esc tasks`;
|
|
221
|
+
if (width < 8 || height < 7) return ["Fabric \xB7 shell tasks", hint].slice(0, height).map((row2) => truncateToWidth(row2, width));
|
|
222
|
+
const inner = width - 4;
|
|
223
|
+
const border = (text) => theme.fg("borderMuted", text);
|
|
224
|
+
const row = (text) => `${border("\u2502")} ${padToWidth(text, inner)} ${border("\u2502")}`;
|
|
225
|
+
const title = truncateToWidth(this.#id ? `Fabric \xB7 task ${this.#id}` : "Fabric \xB7 shell tasks", width - 6);
|
|
226
|
+
const top = border("\u256D\u2500") + ` ${theme.fg("accent", title)} ` + border("\u2500".repeat(Math.max(0, width - visibleWidth(title) - 6)) + "\u2500\u256E");
|
|
227
|
+
const counts = groupNames.map((name, group) => `${this.#jobs.filter((task) => taskGroup(task) === group).length} ${name.toLowerCase()}`);
|
|
228
|
+
const index = this.#jobs.findIndex((task) => task.id === this.#selected);
|
|
229
|
+
const summary = this.#id ? job ? `${this.#status(job)} \xB7 Elapsed ${elapsed(job)}${job.exitCode !== void 0 ? ` \xB7 exit ${job.exitCode}` : ""}` : "Task no longer retained." : `${counts.join(" \xB7 ")}${index >= 0 ? ` \xB7 ${index + 1}/${this.#jobs.length}` : ""}`;
|
|
230
|
+
const bodyHeight = height - 6;
|
|
231
|
+
const body = this.#id ? job ? this.#detail(job, inner, bodyHeight) : ["Task no longer retained."] : this.#overview(inner, bodyHeight);
|
|
232
|
+
while (body.length < bodyHeight) body.push("");
|
|
233
|
+
const separator = border(`\u251C${"\u2500".repeat(width - 2)}\u2524`);
|
|
234
|
+
return [top, row(summary), separator, ...body.map(row), separator, row(theme.fg(armed ? "warning" : "dim", hint)), border(`\u2570${"\u2500".repeat(width - 2)}\u256F`)];
|
|
147
235
|
}
|
|
148
236
|
invalidate() {
|
|
149
|
-
this.#list?.invalidate();
|
|
150
237
|
}
|
|
151
238
|
dispose() {
|
|
152
239
|
if (this.#closed) return;
|
|
153
240
|
this.#closed = true;
|
|
154
|
-
clearInterval(this.#timer);
|
|
241
|
+
if (this.#timer) clearInterval(this.#timer);
|
|
242
|
+
this.#timer = void 0;
|
|
155
243
|
this.#unsubscribe();
|
|
156
244
|
}
|
|
157
245
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ui/shell-tasks.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Theme } from \"@earendil-works/pi-coding-agent\";\nimport { SelectList, getKeybindings, truncateToWidth, type Component } from \"@earendil-works/pi-tui\";\nimport type { FabricShellJobInfo, FabricShellJobStore } from \"../core/shell-jobs.js\";\nimport { formatDuration, safeText, wrapPlainText } from \"./format.js\";\n\nexport interface ShellTasksOptions {\n jobs: FabricShellJobStore;\n theme: Theme;\n done: () => void;\n requestRender: () => void;\n rows: () => number;\n id?: string;\n}\n\n/** Lazy inspector; the controller owns lifetime, this view owns no Pi runtime. */\nexport class ShellTasksView implements Component {\n #list: SelectList | undefined;\n #jobs: FabricShellJobInfo[] = [];\n #id: string | undefined;\n #output = \"\";\n #scroll = 0;\n #stopArmed = 0;\n #reading = false;\n #closed = false;\n #timer: ReturnType<typeof setInterval>;\n #unsubscribe: () => void;\n\n constructor(readonly options: ShellTasksOptions) {\n this.#id = options.id;\n this.#refresh();\n if (!this.#id && this.#jobs.length === 1) this.#id = this.#jobs[0]!.id;\n this.#unsubscribe = options.jobs.subscribe(() => this.#refresh());\n this.#timer = setInterval(() => this.#refresh(), 1000);\n this.#timer.unref?.();\n void this.#read();\n }\n\n #refresh(): void {\n if (this.#closed) return;\n const selected = this.#list?.getSelectedItem()?.value;\n this.#jobs = this.options.jobs.list().filter(job => job.finishedAt === undefined || job.spilledAt !== undefined)\n .sort((a, b) => Number(a.finishedAt !== undefined) - Number(b.finishedAt !== undefined) || b.startedAt - a.startedAt);\n const { theme } = this.options;\n const now = Date.now();\n this.#list = new SelectList(this.#jobs.map(job => ({ value: job.id,\n label: `${job.id.slice(0, 8)} ${job.stopping ? \"stopping\" : job.status} ${formatDuration((job.finishedAt ?? now) - job.startedAt) || \"0s\"}`,\n description: safeText(job.description ?? job.command).slice(0, 240),\n })), Math.max(1, Math.min(12, this.options.rows() - 5)), {\n selectedPrefix: text => theme.fg(\"accent\", text), selectedText: text => theme.fg(\"accent\", text),\n description: text => theme.fg(\"muted\", text), scrollInfo: text => theme.fg(\"dim\", text), noMatch: text => theme.fg(\"dim\", text),\n });\n const index = this.#jobs.findIndex(job => job.id === selected);\n if (index >= 0) this.#list.setSelectedIndex(index);\n this.#list.onSelect = item => { this.#id = item.value; this.#output = \"\"; this.#scroll = 0; this.#stopArmed = 0; void this.#read(); this.options.requestRender(); };\n this.#list.onCancel = () => this.options.done();\n void this.#read();\n this.options.requestRender();\n }\n\n async #read(): Promise<void> {\n const id = this.#id;\n if (!id || this.#reading || this.#closed) return;\n const job = this.options.jobs.get(id);\n if (!job) { this.#output = \"Task no longer retained.\"; return; }\n this.#reading = true;\n try {\n const output = await job.outputText();\n if (!this.#closed && this.#id === id) this.#output = output;\n } catch (error) {\n if (!this.#closed && this.#id === id) this.#output = `Output unavailable: ${safeText(error instanceof Error ? error.message : error)}`;\n } finally { this.#reading = false; if (!this.#closed) this.options.requestRender(); }\n }\n\n handleInput(data: string): void {\n if (!this.#id) { this.#list?.handleInput(data); return; }\n const keys = getKeybindings();\n if (keys.matches(data, \"tui.select.cancel\")) { this.#id = undefined; this.#stopArmed = 0; this.#refresh(); return; }\n if (data === \"x\") {\n const now = Date.now();\n const job = this.options.jobs.get(this.#id);\n if (job && !job.finished) {\n if (this.#stopArmed && now - this.#stopArmed < 3000) { job.stop(); this.#stopArmed = 0; }\n else this.#stopArmed = now;\n }\n } else {\n this.#stopArmed = 0;\n if (keys.matches(data, \"tui.select.up\")) this.#scroll++;\n if (keys.matches(data, \"tui.select.down\")) this.#scroll = Math.max(0, this.#scroll - 1);\n if (keys.matches(data, \"tui.select.pageUp\")) this.#scroll += 10;\n if (keys.matches(data, \"tui.select.pageDown\")) this.#scroll = Math.max(0, this.#scroll - 10);\n if (data === \"G\") this.#scroll = 0;\n }\n this.options.requestRender();\n }\n\n render(width: number): string[] {\n if (width <= 0) return [];\n const { theme } = this.options;\n const height = Math.max(1, Math.floor(this.options.rows() * 0.8));\n let rows = [theme.fg(\"accent\", \"Fabric \u00B7 shell tasks\")];\n let hint = \"\u2191\u2193 select \u00B7 enter inspect \u00B7 esc close\";\n if (!this.#id) rows.push(...(this.#jobs.length ? this.#list!.render(width) : [\"No background shell tasks.\"]));\n else {\n const job = this.options.jobs.get(this.#id)?.info();\n hint = this.#stopArmed && Date.now() - this.#stopArmed < 3000 ? \"Press x again to stop this task \u00B7 esc back\" : \"\u2191\u2193 scroll output \u00B7 G tail \u00B7 x twice stop \u00B7 esc tasks\";\n if (!job) rows.push(\"Task no longer retained.\");\n else {\n const now = Date.now();\n rows.push(`${job.id} \u00B7 ${job.stopping ? \"stopping\" : job.status}${job.exitCode !== undefined ? ` \u00B7 exit ${job.exitCode}` : \"\"}`);\n rows.push(`Elapsed ${formatDuration((job.finishedAt ?? now) - job.startedAt) || \"0s\"} \u00B7 ${job.lastOutputAt ? `last output ${formatDuration(now - job.lastOutputAt) || \"0s\"} ago` : \"no output yet\"}${job.pid ? ` \u00B7 pid ${job.pid}` : \"\"}`);\n if (job.description) rows.push(safeText(job.description));\n rows.push(`cwd: ${safeText(job.cwd ?? \"unknown\")}`);\n const commandRows = wrapPlainText(`Command: ${job.command.slice(0, 12000)}`, width, 5);\n rows.push(...commandRows.slice(0, 4));\n if (commandRows.length > 4 || job.command.length > 12000) rows.push(\"[Command preview clipped; tasks.get returns full text]\");\n rows.push(`Log: ${safeText(job.logPath ?? \"available after backgrounding\")}`);\n if (job.monitor) {\n rows.push(`Monitor: ${job.monitor.delivery === \"wake\" ? \"wake owning agent\" : \"UI only\"} \u00B7 deadline ${formatDuration(job.monitor.timeoutMs)} \u00B7 ${job.eventCount} events`);\n if (job.lastEvent) rows.push(`Latest event: ${safeText(job.lastEvent.lines.at(-1))}`);\n }\n rows.push(theme.fg(\"dim\", \"Bounded output tail (not a full archive):\"));\n const output = this.#output.split(\"\\n\").map(safeText);\n const available = Math.max(1, height - rows.length - 1);\n this.#scroll = Math.min(this.#scroll, Math.max(0, output.length - available));\n const end = output.length - this.#scroll;\n rows.push(...output.slice(Math.max(0, end - available), end));\n }\n }\n rows = rows.slice(0, height - 1);\n rows.push(theme.fg(\"dim\", hint));\n return rows.map(row => truncateToWidth(row, width));\n }\n\n invalidate(): void { this.#list?.invalidate(); }\n dispose(): void {\n if (this.#closed) return;\n this.#closed = true;\n clearInterval(this.#timer);\n this.#unsubscribe();\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import { stripVTControlCharacters } from \"node:util\";\nimport type { Theme } from \"@earendil-works/pi-coding-agent\";\nimport { getKeybindings, truncateToWidth, visibleWidth, wrapTextWithAnsi, type Component, type KeybindingsManager } from \"@earendil-works/pi-tui\";\nimport type { FabricShellJobInfo, FabricShellJobStore } from \"../core/shell-jobs.js\";\nimport { formatDuration, padToWidth, safeText, wrapPlainText } from \"./format.js\";\nimport { spinnerFrame } from \"./spinner.js\";\n\nexport interface ShellTasksOptions {\n jobs: FabricShellJobStore;\n theme: Theme;\n done: () => void;\n requestRender: () => void;\n rows: () => number;\n keys?: KeybindingsManager;\n id?: string;\n}\n\nconst groupNames = [\"Active\", \"Needs attention\", \"Finished\"] as const;\nconst taskGroup = (job: FabricShellJobInfo): number => job.finishedAt === undefined ? 0\n : job.status === \"failed\" || job.status === \"timed_out\" ? 1 : 2;\nconst elapsed = (job: FabricShellJobInfo): string => formatDuration((job.finishedAt ?? Date.now()) - job.startedAt) || \"0s\";\nconst outputLine = (line: string): string => stripVTControlCharacters(line)\n .replace(/\\t/g, \" \").replace(/[\\u0000-\\u0008\\u000b-\\u001f\\u007f-\\u009f]/g, \"\");\n\n/** Lazy inspector; the controller owns lifetime, this view owns no Pi runtime. */\nexport class ShellTasksView implements Component {\n #jobs: FabricShellJobInfo[] = [];\n #selected: string | undefined;\n #listStart = 0;\n #pageSize = 1;\n #id: string | undefined;\n #output = \"\";\n #scroll = 0;\n #stopArmed: number | undefined;\n #reading = false;\n #readAgain = false;\n #closed = false;\n #timer: ReturnType<typeof setInterval> | undefined;\n #unsubscribe: () => void;\n\n constructor(readonly options: ShellTasksOptions) {\n this.#id = options.id;\n this.#refresh();\n if (!this.#id && this.#jobs.length === 1) this.#id = this.#jobs[0]!.id;\n this.#selected = this.#id ?? this.#selected;\n this.#unsubscribe = options.jobs.subscribe(event => {\n this.#refresh();\n if (event.job.id === this.#id) void this.#read();\n });\n void this.#read();\n }\n\n #refresh(): void {\n if (this.#closed) return;\n this.#jobs = this.options.jobs.list().filter(job => job.finishedAt === undefined || job.spilledAt !== undefined)\n .sort((a, b) => taskGroup(a) - taskGroup(b) || b.startedAt - a.startedAt);\n if (!this.#jobs.some(job => job.id === this.#selected)) this.#selected = this.#jobs[0]?.id;\n const active = this.#jobs.some(job => job.finishedAt === undefined);\n // Store events update metadata. Frames sample only the live in-memory tail, never disk logs.\n if (active && !this.#timer) {\n this.#timer = setInterval(() => this.options.requestRender(), 250);\n this.#timer.unref?.();\n } else if (!active && this.#timer) {\n clearInterval(this.#timer);\n this.#timer = undefined;\n }\n this.options.requestRender();\n }\n\n async #read(): Promise<void> {\n const id = this.#id;\n if (!id || this.#closed) return;\n if (this.#reading) { this.#readAgain = true; return; }\n const job = this.options.jobs.get(id);\n if (!job) { this.#output = \"Task no longer retained.\"; return; }\n this.#reading = true;\n try {\n const output = await job.outputText();\n if (!this.#closed && this.#id === id) this.#output = output;\n } catch (error) {\n if (!this.#closed && this.#id === id) this.#output = `Output unavailable: ${safeText(error instanceof Error ? error.message : error)}`;\n } finally {\n this.#reading = false;\n if (!this.#closed) {\n this.options.requestRender();\n if (this.#readAgain) { this.#readAgain = false; void this.#read(); }\n }\n }\n }\n\n handleInput(data: string): void {\n if (this.#closed) return;\n const keys = this.options.keys ?? getKeybindings();\n if (keys.matches(data, \"tui.select.cancel\")) {\n if (!this.#id) { this.dispose(); this.options.done(); return; }\n this.#id = undefined; this.#stopArmed = undefined; this.#refresh(); return;\n }\n if (!this.#id) {\n const index = Math.max(0, this.#jobs.findIndex(job => job.id === this.#selected));\n let next = index;\n if (keys.matches(data, \"tui.select.up\")) next = index === 0 ? this.#jobs.length - 1 : index - 1;\n else if (keys.matches(data, \"tui.select.down\")) next = index === this.#jobs.length - 1 ? 0 : index + 1;\n else if (keys.matches(data, \"tui.select.pageUp\")) next = Math.max(0, index - this.#pageSize);\n else if (keys.matches(data, \"tui.select.pageDown\")) next = Math.min(this.#jobs.length - 1, index + this.#pageSize);\n else if (keys.matches(data, \"tui.select.confirm\") && this.#selected) {\n this.#id = this.#selected; this.#output = \"\"; this.#scroll = 0; this.#stopArmed = undefined;\n void this.#read();\n }\n this.#selected = this.#jobs[next]?.id;\n } else if (data === \"x\") {\n const now = Date.now();\n const job = this.options.jobs.get(this.#id);\n if (job && !job.finished) {\n if (this.#stopArmed !== undefined && now - this.#stopArmed < 3000) { job.stop(); this.#stopArmed = undefined; }\n else this.#stopArmed = now;\n }\n } else {\n this.#stopArmed = undefined;\n if (keys.matches(data, \"tui.select.up\")) this.#scroll++;\n if (keys.matches(data, \"tui.select.down\")) this.#scroll = Math.max(0, this.#scroll - 1);\n if (keys.matches(data, \"tui.select.pageUp\")) this.#scroll += this.#pageSize;\n if (keys.matches(data, \"tui.select.pageDown\")) this.#scroll = Math.max(0, this.#scroll - this.#pageSize);\n if (data === \"G\") this.#scroll = 0;\n }\n this.options.requestRender();\n }\n\n #status(job: FabricShellJobInfo): string {\n const { theme } = this.options;\n const active = job.finishedAt === undefined;\n const color = job.stopping ? \"warning\" : active ? \"accent\" : taskGroup(job) === 1 ? \"error\" : job.status === \"exited\" ? \"success\" : \"dim\";\n const glyph = active ? spinnerFrame() : taskGroup(job) === 1 ? \"\u2717\" : job.status === \"exited\" ? \"\u2713\" : \"\u25A0\";\n return theme.fg(color, `${glyph} ${job.stopping ? \"stopping\" : job.status}`);\n }\n\n #section(label: string, width: number): string {\n const title = truncateToWidth(` ${label} `, width);\n return this.options.theme.fg(\"borderMuted\", title + \"\u2500\".repeat(Math.max(0, width - visibleWidth(title))));\n }\n\n #overview(width: number, height: number): string[] {\n const { theme } = this.options;\n if (!this.#jobs.length) return [theme.fg(\"muted\", \"No background shell tasks.\"), theme.fg(\"dim\", \"Detached commands and monitors appear here.\")].slice(0, height);\n const selected = Math.max(0, this.#jobs.findIndex(job => job.id === this.#selected));\n const counts = groupNames.map((_, group) => this.#jobs.filter(job => taskGroup(job) === group).length);\n const compact = height < 4;\n const rowSize = compact ? 1 : 2;\n const window = (start: number): { rows: string[]; end: number } => {\n const rows: string[] = [];\n let previousGroup = -1, end = start;\n for (let index = start; index < this.#jobs.length; index++) {\n const job = this.#jobs[index]!;\n const group = taskGroup(job);\n const heading = !compact && group !== previousGroup;\n if (rows.length + rowSize + Number(heading) > height) break;\n if (heading) rows.push(this.#section(`${groupNames[group]} \u00B7 ${counts[group]}`, width));\n const chosen = job.id === this.#selected;\n const title = safeText(job.description || job.command) || \"Shell task\";\n const primary = `${chosen ? theme.fg(\"accent\", \"\u203A\") : \" \"} ${this.#status(job)} ${theme.fg(chosen ? \"accent\" : \"text\", title)}`;\n rows.push(chosen ? theme.bg(\"selectedBg\", padToWidth(primary, width)) : truncateToWidth(primary, width));\n if (!compact) {\n const monitor = job.monitor ? ` \u00B7 monitor:${job.monitor.delivery}` : \"\";\n const exit = job.exitCode != null ? ` \u00B7 exit ${job.exitCode}` : \"\";\n rows.push(theme.fg(\"dim\", ` ${job.id.slice(0, 8)} \u00B7 ${job.tool} \u00B7 ${elapsed(job)}${exit}${monitor}`));\n }\n previousGroup = group; end = index + 1;\n }\n return { rows, end };\n };\n this.#listStart = Math.min(this.#listStart, selected);\n let page = window(this.#listStart);\n while (page.end <= selected && this.#listStart < selected) page = window(++this.#listStart);\n this.#pageSize = Math.max(1, page.end - this.#listStart);\n return page.rows;\n }\n\n #detail(job: FabricShellJobInfo, width: number, height: number): string[] {\n const { theme } = this.options;\n const meta = [\n theme.fg(\"accent\", safeText(job.description || job.command)),\n theme.fg(\"dim\", `${job.lastOutputAt !== undefined ? `last output ${formatDuration(Date.now() - job.lastOutputAt) || \"0s\"} ago` : \"no output yet\"}${job.pid ? ` \u00B7 pid ${job.pid}` : \"\"}`),\n theme.fg(\"muted\", `cwd: ${safeText(job.cwd ?? \"unknown\")}`),\n theme.fg(\"dim\", `Log: ${safeText(job.logPath ?? \"available after backgrounding\")}`),\n ];\n if (job.monitor) {\n meta.push(theme.fg(\"muted\", `Monitor: ${job.monitor.delivery === \"wake\" ? \"wake owning agent\" : \"UI only\"} \u00B7 deadline ${formatDuration(job.monitor.timeoutMs)} \u00B7 ${job.eventCount} events`));\n if (job.lastEvent) meta.push(theme.fg(\"dim\", `Latest event: ${safeText(job.lastEvent.lines.at(-1))}`));\n }\n const rows = meta.slice(0, Math.max(0, height - 6));\n if (height >= 5) {\n rows.push(this.#section(\"Command\", width));\n const commandSpace = Math.max(1, Math.min(3, height - rows.length - 4));\n const command = wrapPlainText(job.command.slice(0, 12000), width, commandSpace + 1);\n const clipped = command.length > commandSpace || job.command.length > 12000;\n rows.push(...command.slice(0, commandSpace).map(line => theme.fg(\"muted\", line)));\n if (clipped) rows[rows.length - 1] = theme.fg(\"dim\", truncateToWidth(\"\u2026 command clipped \u00B7 tasks.get for full text\", width));\n }\n const available = Math.max(1, height - rows.length - 1);\n // append() intentionally emits no store event for every output chunk.\n const text = job.finishedAt === undefined ? this.options.jobs.get(job.id)?.snapshotText(8000) ?? \"\" : this.#output;\n const output = text ? text.split(\"\\n\").flatMap(line => wrapTextWithAnsi(outputLine(line), width)) : [job.finishedAt === undefined ? \"Waiting for output\u2026\" : \"No output captured.\"];\n this.#scroll = Math.min(this.#scroll, Math.max(0, output.length - available));\n const end = output.length - this.#scroll;\n const start = Math.max(0, end - available);\n this.#pageSize = available;\n rows.push(this.#section(`Output \u00B7 ${this.#scroll ? `${start + 1}\u2013${end}/${output.length}` : \"tail\"} \u00B7 bounded`, width));\n rows.push(...output.slice(start, end).map(line => theme.fg(\"toolOutput\", line)));\n return rows.slice(0, height);\n }\n\n render(width: number): string[] {\n if (width <= 0) return [];\n const { theme } = this.options;\n const height = Math.max(1, Math.floor(this.options.rows() * 0.8));\n const job = this.#id ? this.options.jobs.get(this.#id)?.info() : undefined;\n const armed = job?.finishedAt === undefined && this.#stopArmed !== undefined && Date.now() - this.#stopArmed < 3000;\n const hint = !this.#id ? \"\u2191\u2193 select \u00B7 enter inspect \u00B7 esc close\"\n : armed ? \"Press x again to stop this task \u00B7 esc back\"\n : width < 70 ? `\u2191\u2193 \u00B7 G tail${job?.finishedAt === undefined ? \" \u00B7 x\u00D72 stop\" : \"\"} \u00B7 esc` : `\u2191\u2193/pg scroll \u00B7 G tail${job?.finishedAt === undefined ? \" \u00B7 x twice stop\" : \"\"} \u00B7 esc tasks`;\n if (width < 8 || height < 7) return [\"Fabric \u00B7 shell tasks\", hint].slice(0, height).map(row => truncateToWidth(row, width));\n const inner = width - 4;\n const border = (text: string) => theme.fg(\"borderMuted\", text);\n const row = (text: string) => `${border(\"\u2502\")} ${padToWidth(text, inner)} ${border(\"\u2502\")}`;\n const title = truncateToWidth(this.#id ? `Fabric \u00B7 task ${this.#id}` : \"Fabric \u00B7 shell tasks\", width - 6);\n const top = border(\"\u256D\u2500\") + ` ${theme.fg(\"accent\", title)} ` + border(\"\u2500\".repeat(Math.max(0, width - visibleWidth(title) - 6)) + \"\u2500\u256E\");\n const counts = groupNames.map((name, group) => `${this.#jobs.filter(task => taskGroup(task) === group).length} ${name.toLowerCase()}`);\n const index = this.#jobs.findIndex(task => task.id === this.#selected);\n const summary = this.#id ? job ? `${this.#status(job)} \u00B7 Elapsed ${elapsed(job)}${job.exitCode !== undefined ? ` \u00B7 exit ${job.exitCode}` : \"\"}` : \"Task no longer retained.\"\n : `${counts.join(\" \u00B7 \")}${index >= 0 ? ` \u00B7 ${index + 1}/${this.#jobs.length}` : \"\"}`;\n const bodyHeight = height - 6;\n const body = this.#id ? job ? this.#detail(job, inner, bodyHeight) : [\"Task no longer retained.\"] : this.#overview(inner, bodyHeight);\n while (body.length < bodyHeight) body.push(\"\");\n const separator = border(`\u251C${\"\u2500\".repeat(width - 2)}\u2524`);\n return [top, row(summary), separator, ...body.map(row), separator, row(theme.fg(armed ? \"warning\" : \"dim\", hint)), border(`\u2570${\"\u2500\".repeat(width - 2)}\u256F`)];\n }\n\n invalidate(): void { /* Theme and width are evaluated on every render. */ }\n dispose(): void {\n if (this.#closed) return;\n this.#closed = true;\n if (this.#timer) clearInterval(this.#timer);\n this.#timer = undefined;\n this.#unsubscribe();\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAAA,SAAS,gCAAgC;AAEzC,SAAS,gBAAgB,iBAAiB,cAAc,wBAAiE;AAezH,IAAM,aAAa,CAAC,UAAU,mBAAmB,UAAU;AAC3D,IAAM,YAAY,CAAC,QAAoC,IAAI,eAAe,SAAY,IAClF,IAAI,WAAW,YAAY,IAAI,WAAW,cAAc,IAAI;AAChE,IAAM,UAAU,CAAC,QAAoC,gBAAgB,IAAI,cAAc,KAAK,IAAI,KAAK,IAAI,SAAS,KAAK;AACvH,IAAM,aAAa,CAAC,SAAyB,yBAAyB,IAAI,EACvE,QAAQ,OAAO,IAAI,EAAE,QAAQ,8CAA8C,EAAE;AAGzE,IAAM,iBAAN,MAA0C;AAAA,EAe/C,YAAqB,SAA4B;AAA5B;AACnB,SAAK,MAAM,QAAQ;AACnB,SAAK,SAAS;AACd,QAAI,CAAC,KAAK,OAAO,KAAK,MAAM,WAAW,EAAG,MAAK,MAAM,KAAK,MAAM,CAAC,EAAG;AACpE,SAAK,YAAY,KAAK,OAAO,KAAK;AAClC,SAAK,eAAe,QAAQ,KAAK,UAAU,WAAS;AAClD,WAAK,SAAS;AACd,UAAI,MAAM,IAAI,OAAO,KAAK,IAAK,MAAK,KAAK,MAAM;AAAA,IACjD,CAAC;AACD,SAAK,KAAK,MAAM;AAAA,EAClB;AAAA,EAxBA,QAA8B,CAAC;AAAA,EAC/B;AAAA,EACA,aAAa;AAAA,EACb,YAAY;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,EACV,UAAU;AAAA,EACV;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AAAA,EACb,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EAc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mB;AAAA,EAAuD;AAAA,EAC1E,UAAgB;AACd,QAAI,KAAK,QAAS;AAClB,SAAK,UAAU;AACf,QAAI,KAAK,OAAQ,eAAc,KAAK,MAAM;AAC1C,SAAK,SAAS;AACd,SAAK,aAAa;AAAA,EACpB;AACF;",
|
|
6
|
+
"names": ["row"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/ui/snapshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAGL,KAAK,uBAAuB,EAG7B,MAAM,YAAY,CAAC;AAuDpB,oFAAoF;AACpF,qBAAa,4BAA4B;IACvC,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,QAAQ,CAAsC;IAEtD,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,uBAAuB,GAAG,SAAS;IAKzD,GAAG,CACD,MAAM,EAAE;QAAE,IAAI,EAAE,iBAAiB,EAAE,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/D,QAAQ,EAAE,uBAAuB,EACjC,iBAAiB,UAAQ,GACxB,IAAI;IAUP,KAAK,IAAI,IAAI;CAId;AAED,eAAO,MAAM,uBAAuB,GAClC,OAAO,WAAW,EAClB,QAAQ,SAAS,EAAE,EACnB,UAAU,gBAAgB,EAC1B,eAAe,iBAAiB,EAAE,EAClC,QAAQ,4BAA4B,EACpC,2BAAyB,KACxB,
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/ui/snapshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAGL,KAAK,uBAAuB,EAG7B,MAAM,YAAY,CAAC;AAuDpB,oFAAoF;AACpF,qBAAa,4BAA4B;IACvC,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,QAAQ,CAAsC;IAEtD,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,uBAAuB,GAAG,SAAS;IAKzD,GAAG,CACD,MAAM,EAAE;QAAE,IAAI,EAAE,iBAAiB,EAAE,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/D,QAAQ,EAAE,uBAAuB,EACjC,iBAAiB,UAAQ,GACxB,IAAI;IAUP,KAAK,IAAI,IAAI;CAId;AAED,eAAO,MAAM,uBAAuB,GAClC,OAAO,WAAW,EAClB,QAAQ,SAAS,EAAE,EACnB,UAAU,gBAAgB,EAC1B,eAAe,iBAAiB,EAAE,EAClC,QAAQ,4BAA4B,EACpC,2BAAyB,KACxB,uBA2OF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured.d.ts","sourceRoot":"","sources":["../../src/ui/structured.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"structured.d.ts","sourceRoot":"","sources":["../../src/ui/structured.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAevD,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAK1D,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAuGD,eAAO,MAAM,iBAAiB,GAC5B,OAAO,OAAO,EACd,QAAQ,kBAAkB,EAC1B,WAAW,MAAM,KAChB,oBA+BF,CAAC"}
|
package/dist/ui/widget.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../src/ui/widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAQvD,OAAO,EAGL,KAAK,uBAAuB,EAE7B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../src/ui/widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAQvD,OAAO,EAGL,KAAK,uBAAuB,EAE7B,MAAM,YAAY,CAAC;AAqFpB,eAAO,MAAM,sBAAsB,GACjC,UAAU,uBAAuB,EACjC,MAAM,kBAAkB,KACvB,OAWF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,8EAA8E;AAC9E,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,EAAE,eAAe,MAAM,KAAG,MAOvE,CAAC;AAEF,qBAAa,YAAa,YAAW,SAAS;;IAE1C,QAAQ,CAAC,KAAK,EAAE,KAAK;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,uBAAuB;IAChD,QAAQ,CAAC,OAAO,E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