@e4779/pi-fabric 0.92.42-fork.7 → 0.96.4-fork.9
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/LAWS.bend +502 -0
- package/PROOF.bend +452 -0
- package/README.md +5 -1
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/dist/agents/handoff.d.ts +2 -1
- package/dist/agents/handoff.d.ts.map +1 -1
- package/dist/agents/manager.d.ts +2 -0
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents.js +6 -5
- package/dist/agents.js.map +1 -1
- package/dist/chunks/{chunk-3TXOQ5MG.js → chunk-3CJETB4S.js} +828 -204
- package/dist/chunks/chunk-3CJETB4S.js.map +7 -0
- package/dist/chunks/{chunk-IUCVOZRX.js → chunk-3SIXBW6A.js} +2 -2
- package/dist/chunks/chunk-4E63LJDD.js +468 -0
- package/dist/chunks/chunk-4E63LJDD.js.map +7 -0
- package/dist/chunks/{chunk-AAHHYDTO.js → chunk-4NF3S3NM.js} +1 -1
- package/dist/chunks/{chunk-AAHHYDTO.js.map → chunk-4NF3S3NM.js.map} +2 -2
- package/dist/chunks/{chunk-2SWRVIYJ.js → chunk-754HA6KO.js} +2 -2
- package/dist/chunks/{chunk-K6DHXXF5.js → chunk-B2IVWASP.js} +2 -2
- package/dist/chunks/{chunk-ZDNGXLEC.js → chunk-B4HECUJI.js} +2 -2
- package/dist/chunks/{chunk-H6DDV6E2.js → chunk-CSJSHBAT.js} +5 -5
- package/dist/chunks/{chunk-MW5VI7IW.js → chunk-D4B4CCTA.js} +2 -2
- package/dist/chunks/{chunk-EDL4JDW7.js → chunk-EBWMC3OO.js} +2 -2
- package/dist/chunks/{chunk-4NUTVNS2.js → chunk-F72MAIQY.js} +31 -368
- package/dist/chunks/chunk-F72MAIQY.js.map +7 -0
- package/dist/chunks/{chunk-W3FRE4VI.js → chunk-FDIEQEXS.js} +2 -2
- package/dist/chunks/{chunk-7A6NVHB5.js → chunk-FJSHRHOR.js} +7 -4
- package/dist/chunks/chunk-FJSHRHOR.js.map +7 -0
- package/dist/chunks/{chunk-PSNXUZMY.js → chunk-G2F2RDZI.js} +5 -47
- package/dist/chunks/chunk-G2F2RDZI.js.map +7 -0
- package/dist/chunks/{chunk-3WIGAX56.js → chunk-JCV54SSP.js} +2 -2
- package/dist/chunks/chunk-KS44WKJJ.js +51 -0
- package/dist/chunks/chunk-KS44WKJJ.js.map +7 -0
- package/dist/chunks/{chunk-3H7SDWZI.js → chunk-LNLQ2LX3.js} +22 -1
- package/dist/chunks/chunk-LNLQ2LX3.js.map +7 -0
- package/dist/chunks/{chunk-G4LADAYY.js → chunk-OINADFEF.js} +8 -3
- package/dist/chunks/chunk-OINADFEF.js.map +7 -0
- package/dist/chunks/{chunk-UQ4LTUH4.js → chunk-OUAC6O5C.js} +36 -9
- package/dist/chunks/chunk-OUAC6O5C.js.map +7 -0
- package/dist/chunks/{chunk-MQG5QKGI.js → chunk-Q5BMTL6A.js} +217 -95
- package/dist/chunks/chunk-Q5BMTL6A.js.map +7 -0
- package/dist/chunks/{chunk-IK6PPFWG.js → chunk-QFKHAAZA.js} +11 -11
- package/dist/chunks/chunk-QFKHAAZA.js.map +7 -0
- package/dist/chunks/{chunk-RTXZHKMS.js → chunk-QNMQJNXE.js} +7 -3
- package/dist/chunks/chunk-QNMQJNXE.js.map +7 -0
- package/dist/chunks/{chunk-U5FYOMG5.js → chunk-UBPFGMDQ.js} +6 -2
- package/dist/chunks/chunk-UBPFGMDQ.js.map +7 -0
- package/dist/chunks/{chunk-FLKGJPCN.js → chunk-ULQFHZJE.js} +4 -1
- package/dist/chunks/chunk-ULQFHZJE.js.map +7 -0
- package/dist/chunks/{chunk-7VAZ4N43.js → chunk-V3PIO7QL.js} +2 -2
- package/dist/chunks/{chunk-MGDLRV2R.js → chunk-VQGO4P7C.js} +2 -2
- package/dist/chunks/{chunk-XT4346N7.js → chunk-WXSELMFV.js} +9 -3
- package/dist/chunks/chunk-WXSELMFV.js.map +7 -0
- package/dist/chunks/{chunk-D5WKZONW.js → chunk-X3IRR7CV.js} +2 -2
- package/dist/chunks/{chunk-IJL3QK3J.js → chunk-Y57UHPIK.js} +1 -1
- package/dist/chunks/{chunk-IJL3QK3J.js.map → chunk-Y57UHPIK.js.map} +1 -1
- package/dist/chunks/{chunk-RKRVOBVO.js → chunk-YC3QQDZ3.js} +2 -2
- package/dist/chunks/{chunk-Q4XJ4PYL.js → chunk-ZRI433JP.js} +299 -83
- package/dist/chunks/chunk-ZRI433JP.js.map +7 -0
- package/dist/chunks/{chunk-36B4AIRT.js → chunk-ZTXZ6JDO.js} +2 -2
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/compaction/bounds.d.ts +4 -0
- package/dist/compaction/bounds.d.ts.map +1 -1
- package/dist/compaction/branch-summary.d.ts.map +1 -1
- package/dist/compaction/dialogue.d.ts +24 -0
- package/dist/compaction/dialogue.d.ts.map +1 -0
- package/dist/compaction/hook.d.ts +6 -2
- package/dist/compaction/hook.d.ts.map +1 -1
- package/dist/compaction/hook.js +6 -5
- package/dist/compaction/instructions.d.ts +1 -0
- package/dist/compaction/instructions.d.ts.map +1 -1
- package/dist/compaction/projections.d.ts +3 -3
- package/dist/compaction/projections.d.ts.map +1 -1
- package/dist/compaction/qa.d.ts.map +1 -1
- package/dist/compaction/render.d.ts +11 -0
- package/dist/compaction/render.d.ts.map +1 -1
- package/dist/components/configuration.js +2 -3
- package/dist/components/effect-policy.d.ts +2 -0
- package/dist/components/effect-policy.d.ts.map +1 -1
- package/dist/components/effect-scope.d.ts.map +1 -1
- package/dist/components/supervisor.d.ts +1 -1
- package/dist/components/supervisor.d.ts.map +1 -1
- package/dist/core/action-registry.d.ts +14 -2
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +7 -5
- package/dist/core/provider-bindings.d.ts +8 -2
- package/dist/core/provider-bindings.d.ts.map +1 -1
- package/dist/core/provider-operations.d.ts +28 -0
- package/dist/core/provider-operations.d.ts.map +1 -0
- package/dist/core/provider-operations.js +201 -0
- package/dist/core/provider-operations.js.map +7 -0
- package/dist/core/shell-inbox.d.ts +13 -0
- package/dist/core/shell-inbox.d.ts.map +1 -0
- package/dist/core/shell-jobs.d.ts +51 -7
- package/dist/core/shell-jobs.d.ts.map +1 -1
- package/dist/core/shell-limits.d.ts +3 -0
- package/dist/core/shell-limits.d.ts.map +1 -0
- package/dist/core/shell-monitor.d.ts +51 -0
- package/dist/core/shell-monitor.d.ts.map +1 -0
- package/dist/entropy/index.js +8 -7
- package/dist/entropy/normal-form.d.ts.map +1 -1
- package/dist/execution-service.d.ts +1 -1
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/fabric-runtime-state.d.ts +1 -1
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +1124 -325
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/index.js +155 -44
- package/dist/index.js.map +3 -3
- package/dist/jev/observation.js +5 -3
- package/dist/jev.d.ts +0 -1
- package/dist/jev.d.ts.map +1 -1
- package/dist/jev.js +9 -13
- package/dist/memory/digest.d.ts.map +1 -1
- package/dist/memory/digest.js +2 -1
- package/dist/memory/discovery.js +6 -5
- package/dist/memory/expand-service.d.ts.map +1 -1
- package/dist/memory/file-worker.js +9 -8
- package/dist/memory/file-worker.js.map +1 -1
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/normalize.d.ts.map +1 -1
- package/dist/memory/normalize.js +5 -4
- package/dist/memory/search.js +7 -6
- package/dist/memory/worker-provider.js +10 -9
- package/dist/memory.js +9 -8
- package/dist/memory.js.map +1 -1
- package/dist/mesh/store.d.ts.map +1 -1
- package/dist/prewalk/handoff.d.ts +1 -1
- package/dist/prewalk/handoff.d.ts.map +1 -1
- package/dist/protocol.d.ts +2 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +1 -1
- package/dist/providers/jev-provider.d.ts +1 -1
- package/dist/providers/jev-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.js +9 -7
- package/dist/providers/memory-provider.js +9 -8
- package/dist/providers/pi-tools-provider.d.ts.map +1 -1
- package/dist/providers/tasks-provider.d.ts +12 -0
- package/dist/providers/tasks-provider.d.ts.map +1 -0
- package/dist/residency/host.js +10 -9
- package/dist/residency/pi-entry.js +10 -9
- package/dist/residency/pi-entry.js.map +1 -1
- 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 -2
- package/dist/runtime/monty-runtime.js.map +1 -1
- package/dist/runtime/typescript-kernel.js +2 -2
- package/dist/runtime-state-builtins.d.ts +1 -1
- package/dist/runtime-state-builtins.d.ts.map +1 -1
- package/dist/schema/controller.d.ts.map +1 -1
- package/dist/state/store.d.ts.map +1 -1
- package/dist/ui/controller.d.ts +1 -0
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation-targets.js +2 -2
- package/dist/ui/conversation.js +7 -7
- package/dist/ui/dashboard.js +9 -9
- package/dist/ui/highlight.d.ts.map +1 -1
- package/dist/ui/languages/bend.d.ts +4 -0
- package/dist/ui/languages/bend.d.ts.map +1 -0
- package/dist/ui/languages/bend.js +73 -0
- package/dist/ui/languages/bend.js.map +7 -0
- package/dist/ui/settings.js +1 -2
- package/dist/ui/settings.js.map +1 -1
- package/dist/ui/shell-hang-keys.d.ts.map +1 -1
- package/dist/ui/shell-tasks.d.ts +22 -0
- package/dist/ui/shell-tasks.d.ts.map +1 -0
- package/dist/ui/shell-tasks.js +161 -0
- package/dist/ui/shell-tasks.js.map +7 -0
- package/dist/ui/shiki-catalog.d.ts +2 -1
- package/dist/ui/shiki-catalog.d.ts.map +1 -1
- package/dist/ui/snapshot.d.ts.map +1 -1
- package/dist/ui/types.d.ts +1 -0
- package/dist/ui/types.d.ts.map +1 -1
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/verified/authority.d.ts +17 -0
- package/dist/verified/authority.d.ts.map +1 -0
- package/dist/verified/generated/authority-kernel.d.ts +10 -0
- package/dist/verified/generated/authority-kernel.js +116 -0
- package/dist/verified/generated/kernel.d.ts +31 -0
- package/dist/verified/generated/kernel.js +351 -0
- package/dist/verified/generated/lifecycle-kernel.d.ts +7 -0
- package/dist/verified/generated/lifecycle-kernel.js +155 -0
- package/dist/verified/generated/manifest.json +54 -0
- package/dist/verified/generated/provider-kernel.d.ts +9 -0
- package/dist/verified/generated/provider-kernel.js +80 -0
- package/dist/verified/generated/storage-kernel.d.ts +11 -0
- package/dist/verified/generated/storage-kernel.js +98 -0
- package/dist/verified/memory.d.ts +11 -0
- package/dist/verified/memory.d.ts.map +1 -0
- package/dist/verified/nat.d.ts +2 -0
- package/dist/verified/nat.d.ts.map +1 -0
- package/dist/verified/policy.d.ts +37 -0
- package/dist/verified/policy.d.ts.map +1 -0
- package/dist/verified/resources.d.ts +14 -0
- package/dist/verified/resources.d.ts.map +1 -0
- package/dist/verified/storage.d.ts +32 -0
- package/dist/verified/storage.d.ts.map +1 -0
- package/dist/worker/recovery-watchdog.d.ts +12 -0
- package/dist/worker/recovery-watchdog.d.ts.map +1 -0
- package/dist/worker/recovery-watchdog.js +41 -0
- package/dist/worker/recovery-watchdog.js.map +7 -0
- package/dist/worker.js +70 -20
- package/dist/worker.js.map +2 -2
- package/docs/agents.md +20 -14
- package/docs/architecture.md +1 -1
- package/docs/background-tasks.md +140 -0
- package/docs/compaction.md +91 -28
- package/docs/components.md +5 -1
- package/docs/configuration.md +6 -6
- package/docs/foreman.md +4 -4
- package/docs/harnesses.md +95 -0
- package/docs/interface.md +7 -0
- package/docs/jev.md +59 -52
- package/docs/kernels.md +2 -2
- package/docs/licenses/bend-apache-2.0.txt +202 -0
- package/docs/memory-recall.md +1 -1
- package/docs/programmatic-compaction.md +13 -2
- package/docs/provider-capabilities.md +197 -0
- package/docs/shell-middleware.md +3 -3
- package/docs/skills.md +1 -1
- package/docs/verified-kernels.md +278 -0
- package/package.json +14 -4
- package/proofs/abi.json +308 -0
- package/proofs/authority-abi.json +7 -0
- package/proofs/authority-kernel.bend +23 -0
- package/proofs/authority-proof.bend +74 -0
- package/proofs/authority-spec.bend +30 -0
- package/proofs/authority-state.bend +43 -0
- package/proofs/authority-types.d.ts +3 -0
- package/proofs/kernel.bend +139 -0
- package/proofs/lifecycle-abi.json +3 -0
- package/proofs/lifecycle-kernel.bend +11 -0
- package/proofs/lifecycle-proof.bend +249 -0
- package/proofs/lifecycle-spec.bend +261 -0
- package/proofs/lifecycle-types.d.ts +4 -0
- package/proofs/lifecycle.bend +119 -0
- package/proofs/provider-abi.json +4 -0
- package/proofs/provider-kernel.bend +14 -0
- package/proofs/provider-plans.bend +28 -0
- package/proofs/provider-spec.bend +14 -0
- package/proofs/provider-types.d.ts +5 -0
- package/proofs/resource-proof.bend +633 -0
- package/proofs/resource-spec.bend +133 -0
- package/proofs/resources.bend +160 -0
- package/proofs/state-kernel.bend +17 -0
- package/proofs/state-plans.bend +40 -0
- package/proofs/state-proof.bend +42 -0
- package/proofs/state-spec.bend +26 -0
- package/proofs/storage-abi.json +3 -0
- package/proofs/storage-kernel.bend +11 -0
- package/proofs/storage-plans.bend +100 -0
- package/proofs/storage-proof.bend +176 -0
- package/proofs/storage-spec.bend +70 -0
- package/proofs/storage-types.d.ts +8 -0
- package/proofs/types.d.ts +7 -0
- package/scripts/test-verified-kernels.mjs +107 -0
- package/scripts/verified-kernels.mjs +136 -0
- package/skillsets/python/fabric-jev/SKILL.md +13 -9
- package/skillsets/typescript/fabric-exec/SKILL.md +4 -2
- package/skillsets/typescript/fabric-jev/SKILL.md +13 -9
- package/dist/chunks/chunk-3H7SDWZI.js.map +0 -7
- package/dist/chunks/chunk-3TXOQ5MG.js.map +0 -7
- package/dist/chunks/chunk-4NUTVNS2.js.map +0 -7
- package/dist/chunks/chunk-77PDIBK2.js +0 -129
- package/dist/chunks/chunk-77PDIBK2.js.map +0 -7
- package/dist/chunks/chunk-7A6NVHB5.js.map +0 -7
- package/dist/chunks/chunk-FLKGJPCN.js.map +0 -7
- package/dist/chunks/chunk-G4LADAYY.js.map +0 -7
- package/dist/chunks/chunk-IK6PPFWG.js.map +0 -7
- package/dist/chunks/chunk-MQG5QKGI.js.map +0 -7
- package/dist/chunks/chunk-PSNXUZMY.js.map +0 -7
- package/dist/chunks/chunk-Q4XJ4PYL.js.map +0 -7
- package/dist/chunks/chunk-RTXZHKMS.js.map +0 -7
- package/dist/chunks/chunk-U5FYOMG5.js.map +0 -7
- package/dist/chunks/chunk-UQ4LTUH4.js.map +0 -7
- package/dist/chunks/chunk-XT4346N7.js.map +0 -7
- package/dist/jev/browser.d.ts +0 -37
- package/dist/jev/browser.d.ts.map +0 -1
- package/dist/jev/browser.js +0 -13
- package/dist/jev/browser.js.map +0 -7
- /package/dist/chunks/{chunk-IUCVOZRX.js.map → chunk-3SIXBW6A.js.map} +0 -0
- /package/dist/chunks/{chunk-2SWRVIYJ.js.map → chunk-754HA6KO.js.map} +0 -0
- /package/dist/chunks/{chunk-K6DHXXF5.js.map → chunk-B2IVWASP.js.map} +0 -0
- /package/dist/chunks/{chunk-ZDNGXLEC.js.map → chunk-B4HECUJI.js.map} +0 -0
- /package/dist/chunks/{chunk-H6DDV6E2.js.map → chunk-CSJSHBAT.js.map} +0 -0
- /package/dist/chunks/{chunk-MW5VI7IW.js.map → chunk-D4B4CCTA.js.map} +0 -0
- /package/dist/chunks/{chunk-EDL4JDW7.js.map → chunk-EBWMC3OO.js.map} +0 -0
- /package/dist/chunks/{chunk-W3FRE4VI.js.map → chunk-FDIEQEXS.js.map} +0 -0
- /package/dist/chunks/{chunk-3WIGAX56.js.map → chunk-JCV54SSP.js.map} +0 -0
- /package/dist/chunks/{chunk-7VAZ4N43.js.map → chunk-V3PIO7QL.js.map} +0 -0
- /package/dist/chunks/{chunk-MGDLRV2R.js.map → chunk-VQGO4P7C.js.map} +0 -0
- /package/dist/chunks/{chunk-D5WKZONW.js.map → chunk-X3IRR7CV.js.map} +0 -0
- /package/dist/chunks/{chunk-RKRVOBVO.js.map → chunk-YC3QQDZ3.js.map} +0 -0
- /package/dist/chunks/{chunk-36B4AIRT.js.map → chunk-ZTXZ6JDO.js.map} +0 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatDuration,
|
|
3
|
+
safeText,
|
|
4
|
+
wrapPlainText
|
|
5
|
+
} from "../chunks/chunk-IR3PIHJM.js";
|
|
6
|
+
|
|
7
|
+
// src/ui/shell-tasks.ts
|
|
8
|
+
import { SelectList, getKeybindings, truncateToWidth } from "@earendil-works/pi-tui";
|
|
9
|
+
var ShellTasksView = class {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.options = options;
|
|
12
|
+
this.#id = options.id;
|
|
13
|
+
this.#refresh();
|
|
14
|
+
if (!this.#id && this.#jobs.length === 1) this.#id = this.#jobs[0].id;
|
|
15
|
+
this.#unsubscribe = options.jobs.subscribe(() => this.#refresh());
|
|
16
|
+
this.#timer = setInterval(() => this.#refresh(), 1e3);
|
|
17
|
+
this.#timer.unref?.();
|
|
18
|
+
void this.#read();
|
|
19
|
+
}
|
|
20
|
+
#list;
|
|
21
|
+
#jobs = [];
|
|
22
|
+
#id;
|
|
23
|
+
#output = "";
|
|
24
|
+
#scroll = 0;
|
|
25
|
+
#stopArmed = 0;
|
|
26
|
+
#reading = false;
|
|
27
|
+
#closed = false;
|
|
28
|
+
#timer;
|
|
29
|
+
#unsubscribe;
|
|
30
|
+
#refresh() {
|
|
31
|
+
if (this.#closed) return;
|
|
32
|
+
const selected = this.#list?.getSelectedItem()?.value;
|
|
33
|
+
this.#jobs = this.options.jobs.list().filter((job) => job.finishedAt === void 0 || job.spilledAt !== void 0).sort((a, b) => Number(a.finishedAt !== void 0) - Number(b.finishedAt !== void 0) || b.startedAt - a.startedAt);
|
|
34
|
+
const { theme } = this.options;
|
|
35
|
+
const now = Date.now();
|
|
36
|
+
this.#list = new SelectList(this.#jobs.map((job) => ({
|
|
37
|
+
value: job.id,
|
|
38
|
+
label: `${job.id.slice(0, 8)} ${job.stopping ? "stopping" : job.status} ${formatDuration((job.finishedAt ?? now) - job.startedAt) || "0s"}`,
|
|
39
|
+
description: safeText(job.description ?? job.command).slice(0, 240)
|
|
40
|
+
})), Math.max(1, Math.min(12, this.options.rows() - 5)), {
|
|
41
|
+
selectedPrefix: (text) => theme.fg("accent", text),
|
|
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();
|
|
59
|
+
this.options.requestRender();
|
|
60
|
+
}
|
|
61
|
+
async #read() {
|
|
62
|
+
const id = this.#id;
|
|
63
|
+
if (!id || this.#reading || this.#closed) return;
|
|
64
|
+
const job = this.options.jobs.get(id);
|
|
65
|
+
if (!job) {
|
|
66
|
+
this.#output = "Task no longer retained.";
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this.#reading = true;
|
|
70
|
+
try {
|
|
71
|
+
const output = await job.outputText();
|
|
72
|
+
if (!this.#closed && this.#id === id) this.#output = output;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
if (!this.#closed && this.#id === id) this.#output = `Output unavailable: ${safeText(error instanceof Error ? error.message : error)}`;
|
|
75
|
+
} finally {
|
|
76
|
+
this.#reading = false;
|
|
77
|
+
if (!this.#closed) this.options.requestRender();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
handleInput(data) {
|
|
81
|
+
if (!this.#id) {
|
|
82
|
+
this.#list?.handleInput(data);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const keys = getKeybindings();
|
|
86
|
+
if (keys.matches(data, "tui.select.cancel")) {
|
|
87
|
+
this.#id = void 0;
|
|
88
|
+
this.#stopArmed = 0;
|
|
89
|
+
this.#refresh();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (data === "x") {
|
|
93
|
+
const now = Date.now();
|
|
94
|
+
const job = this.options.jobs.get(this.#id);
|
|
95
|
+
if (job && !job.finished) {
|
|
96
|
+
if (this.#stopArmed && now - this.#stopArmed < 3e3) {
|
|
97
|
+
job.stop();
|
|
98
|
+
this.#stopArmed = 0;
|
|
99
|
+
} else this.#stopArmed = now;
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
this.#stopArmed = 0;
|
|
103
|
+
if (keys.matches(data, "tui.select.up")) this.#scroll++;
|
|
104
|
+
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 += 10;
|
|
106
|
+
if (keys.matches(data, "tui.select.pageDown")) this.#scroll = Math.max(0, this.#scroll - 10);
|
|
107
|
+
if (data === "G") this.#scroll = 0;
|
|
108
|
+
}
|
|
109
|
+
this.options.requestRender();
|
|
110
|
+
}
|
|
111
|
+
render(width) {
|
|
112
|
+
if (width <= 0) return [];
|
|
113
|
+
const { theme } = this.options;
|
|
114
|
+
const height = Math.max(1, Math.floor(this.options.rows() * 0.8));
|
|
115
|
+
let rows = [theme.fg("accent", "Fabric \xB7 shell tasks")];
|
|
116
|
+
let hint = "\u2191\u2193 select \xB7 enter inspect \xB7 esc close";
|
|
117
|
+
if (!this.#id) rows.push(...this.#jobs.length ? this.#list.render(width) : ["No background shell tasks."]);
|
|
118
|
+
else {
|
|
119
|
+
const job = this.options.jobs.get(this.#id)?.info();
|
|
120
|
+
hint = this.#stopArmed && Date.now() - this.#stopArmed < 3e3 ? "Press x again to stop this task \xB7 esc back" : "\u2191\u2193 scroll output \xB7 G tail \xB7 x twice stop \xB7 esc tasks";
|
|
121
|
+
if (!job) rows.push("Task no longer retained.");
|
|
122
|
+
else {
|
|
123
|
+
const now = Date.now();
|
|
124
|
+
rows.push(`${job.id} \xB7 ${job.stopping ? "stopping" : job.status}${job.exitCode !== void 0 ? ` \xB7 exit ${job.exitCode}` : ""}`);
|
|
125
|
+
rows.push(`Elapsed ${formatDuration((job.finishedAt ?? now) - job.startedAt) || "0s"} \xB7 ${job.lastOutputAt ? `last output ${formatDuration(now - job.lastOutputAt) || "0s"} ago` : "no output yet"}${job.pid ? ` \xB7 pid ${job.pid}` : ""}`);
|
|
126
|
+
if (job.description) rows.push(safeText(job.description));
|
|
127
|
+
rows.push(`cwd: ${safeText(job.cwd ?? "unknown")}`);
|
|
128
|
+
const commandRows = wrapPlainText(`Command: ${job.command.slice(0, 12e3)}`, width, 5);
|
|
129
|
+
rows.push(...commandRows.slice(0, 4));
|
|
130
|
+
if (commandRows.length > 4 || job.command.length > 12e3) rows.push("[Command preview clipped; tasks.get returns full text]");
|
|
131
|
+
rows.push(`Log: ${safeText(job.logPath ?? "available after backgrounding")}`);
|
|
132
|
+
if (job.monitor) {
|
|
133
|
+
rows.push(`Monitor: ${job.monitor.delivery === "wake" ? "wake owning agent" : "UI only"} \xB7 deadline ${formatDuration(job.monitor.timeoutMs)} \xB7 ${job.eventCount} events`);
|
|
134
|
+
if (job.lastEvent) rows.push(`Latest event: ${safeText(job.lastEvent.lines.at(-1))}`);
|
|
135
|
+
}
|
|
136
|
+
rows.push(theme.fg("dim", "Bounded output tail (not a full archive):"));
|
|
137
|
+
const output = this.#output.split("\n").map(safeText);
|
|
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));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
rows = rows.slice(0, height - 1);
|
|
145
|
+
rows.push(theme.fg("dim", hint));
|
|
146
|
+
return rows.map((row) => truncateToWidth(row, width));
|
|
147
|
+
}
|
|
148
|
+
invalidate() {
|
|
149
|
+
this.#list?.invalidate();
|
|
150
|
+
}
|
|
151
|
+
dispose() {
|
|
152
|
+
if (this.#closed) return;
|
|
153
|
+
this.#closed = true;
|
|
154
|
+
clearInterval(this.#timer);
|
|
155
|
+
this.#unsubscribe();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
export {
|
|
159
|
+
ShellTasksView
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=shell-tasks.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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": ";;;;;;;AACA,SAAS,YAAY,gBAAgB,uBAAuC;AAcrE,IAAM,iBAAN,MAA0C;AAAA,EAY/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,eAAe,QAAQ,KAAK,UAAU,MAAM,KAAK,SAAS,CAAC;AAChE,SAAK,SAAS,YAAY,MAAM,KAAK,SAAS,GAAG,GAAI;AACrD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AI,GAAG,SAAS,KAAK,SAAS,CAAC;AACtD,aAAK,UAAU,KAAK,IAAI,KAAK,SAAS,KAAK,IAAI,GAAG,OAAO,SAAS,SAAS,CAAC;AAC5E,cAAM,MAAM,OAAO,SAAS,KAAK;AACjC,aAAK,KAAK,GAAG,OAAO,MAAM,KAAK,IAAI,GAAG,MAAM,SAAS,GAAG,GAAG,CAAC;AAAA,MAC9D;AAAA,IACF;AACA,WAAO,KAAK,MAAM,GAAG,SAAS,CAAC;AAC/B,SAAK,KAAK,MAAM,GAAG,OAAO,IAAI,CAAC;AAC/B,WAAO,KAAK,IAAI,SAAO,gBAAgB,KAAK,KAAK,CAAC;AAAA,EACpD;AAAA,EAEA,aAAmB;AAAE,SAAK,OAAO,WAAW;AAAA,EAAG;AAAA,EAC/C,UAAgB;AACd,QAAI,KAAK,QAAS;AAClB,SAAK,UAAU;AACf,kBAAc,KAAK,MAAM;AACzB,SAAK,aAAa;AAAA,EACpB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DynamicImportLanguageRegistration } from "shiki";
|
|
2
|
+
export declare const shikiLanguages: () => Record<string, DynamicImportLanguageRegistration>;
|
|
2
3
|
export declare const shikiThemeType: (id: string) => "light" | "dark" | undefined;
|
|
3
4
|
//# sourceMappingURL=shiki-catalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shiki-catalog.d.ts","sourceRoot":"","sources":["../../src/ui/shiki-catalog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shiki-catalog.d.ts","sourceRoot":"","sources":["../../src/ui/shiki-catalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,OAAO,CAAC;AAQ/D,eAAO,MAAM,cAAc,QAAO,MAAM,CAAC,MAAM,EAAE,iCAAiC,CAI/E,CAAC;AAEJ,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,KAAG,OAAO,GAAG,MAAM,GAAG,SAG9D,CAAC"}
|
|
@@ -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,MAA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@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FabricCapabilityBindingView } from "../protocol.js";
|
|
2
|
+
/** Private canonical state behind ActionRegistry's WeakMap-owned public views.
|
|
3
|
+
* Root issuance is a trusted registry operation, not a caller-supplied permission
|
|
4
|
+
* Boolean. Bend proves derivation/use/release over exact grants. JS identity,
|
|
5
|
+
* WeakMap ownership, binding observations and abort delivery remain trusted.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CapabilityAuthority {
|
|
8
|
+
#private;
|
|
9
|
+
private constructor();
|
|
10
|
+
static issue(grants: readonly FabricCapabilityBindingView[]): CapabilityAuthority;
|
|
11
|
+
derive(grants: readonly FabricCapabilityBindingView[]): CapabilityAuthority;
|
|
12
|
+
get active(): boolean;
|
|
13
|
+
release(): void;
|
|
14
|
+
resolve(ref: string): FabricCapabilityBindingView | undefined;
|
|
15
|
+
bindings(): FabricCapabilityBindingView[];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=authority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority.d.ts","sourceRoot":"","sources":["../../src/verified/authority.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AA0BlE;;;;GAIG;AACH,qBAAa,mBAAmB;;IAI9B,OAAO;IAOP,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,2BAA2B,EAAE,GAAG,mBAAmB;IAIjF,MAAM,CAAC,MAAM,EAAE,SAAS,2BAA2B,EAAE,GAAG,mBAAmB;IAI3E,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,OAAO,IAAI,IAAI;IAIf,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,2BAA2B,GAAG,SAAS;IAK7D,QAAQ,IAAI,2BAA2B,EAAE;CAG1C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated ABI declarations; see proofs/authority-abi.json.
|
|
2
|
+
export type AuthorityText = { $: "Nil" } | { $: "Con"; head: bigint; tail: AuthorityText };
|
|
3
|
+
export type AuthorityGrants = { $: "Nil" } | { $: "Con"; head: AuthorityText; tail: AuthorityGrants };
|
|
4
|
+
export type AuthorityState = { $: "Released" } | { $: "Active"; grants: AuthorityGrants };
|
|
5
|
+
|
|
6
|
+
export declare function authorityIssue(grants: AuthorityGrants): AuthorityState;
|
|
7
|
+
export declare function authorityLive(authority: AuthorityState): boolean;
|
|
8
|
+
export declare function authorityAllows(authority: AuthorityState, grant: AuthorityText): boolean;
|
|
9
|
+
export declare function authorityDerive(parent: AuthorityState, candidate: AuthorityGrants): AuthorityState;
|
|
10
|
+
export declare function authorityRelease(authority: AuthorityState): AuthorityState;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Generated by Bend 2.0.26; do not edit. See LAWS.bend and PROOF.bend.
|
|
2
|
+
// Includes adapted Bend runtime/Base code, Copyright 2026 HigherOrderCO, Apache-2.0.
|
|
3
|
+
// CLI removed and exports added by Pi Fabric; see THIRD_PARTY_NOTICES.md.
|
|
4
|
+
function d(t, e) {
|
|
5
|
+
return { $: t < e ? "LT" : t === e ? "EQ" : "GT" };
|
|
6
|
+
}
|
|
7
|
+
function n(t, e) {
|
|
8
|
+
return { $: "$JMP", f: t, x: e };
|
|
9
|
+
}
|
|
10
|
+
function $(t) {
|
|
11
|
+
for (; t !== null && typeof t == "object" && t.$ === "$JMP"; )
|
|
12
|
+
t = t.f(...t.x);
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
function o(t, e) {
|
|
16
|
+
return (...r) => r.length < e ? o((...u) => t(...r, ...u), e - r.length) : $(t(...r));
|
|
17
|
+
}
|
|
18
|
+
function v(t) {
|
|
19
|
+
return n(m, [t]);
|
|
20
|
+
}
|
|
21
|
+
function y(t) {
|
|
22
|
+
return n(p, [t]);
|
|
23
|
+
}
|
|
24
|
+
function g(t, e) {
|
|
25
|
+
return n(b, [t, e]);
|
|
26
|
+
}
|
|
27
|
+
function R(t, e) {
|
|
28
|
+
return n(w, [t, e]);
|
|
29
|
+
}
|
|
30
|
+
function N(t) {
|
|
31
|
+
return n(A, [t]);
|
|
32
|
+
}
|
|
33
|
+
function m(t) {
|
|
34
|
+
return { $: "Active", grants: t };
|
|
35
|
+
}
|
|
36
|
+
function p(t) {
|
|
37
|
+
if (t.$ === "Released")
|
|
38
|
+
return !1;
|
|
39
|
+
{
|
|
40
|
+
let e = t.grants;
|
|
41
|
+
return !0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function b(t, e) {
|
|
45
|
+
if (t.$ === "Released")
|
|
46
|
+
return !1;
|
|
47
|
+
{
|
|
48
|
+
let r = t.grants;
|
|
49
|
+
return n(l, [r, e, !1]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function w(t, e) {
|
|
53
|
+
if (t.$ === "Released")
|
|
54
|
+
return { $: "Released" };
|
|
55
|
+
{
|
|
56
|
+
let r = t.grants;
|
|
57
|
+
return n(L, [$(f(e, r, !0)), e]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function A(t) {
|
|
61
|
+
return { $: "Released" };
|
|
62
|
+
}
|
|
63
|
+
function l(t, e, r) {
|
|
64
|
+
if (t.$ === "Nil")
|
|
65
|
+
return r;
|
|
66
|
+
{
|
|
67
|
+
let u = t.head, i = t.tail, a = $(s(e, u, !0));
|
|
68
|
+
return n(l, [i, e, r || a]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function L(t, e) {
|
|
72
|
+
return t ? { $: "Active", grants: e } : { $: "Released" };
|
|
73
|
+
}
|
|
74
|
+
function f(t, e, r) {
|
|
75
|
+
if (t.$ === "Nil")
|
|
76
|
+
return r;
|
|
77
|
+
{
|
|
78
|
+
let u = t.head, i = t.tail;
|
|
79
|
+
return n(f, [i, e, $(c(r, $(l(e, u, !1))))]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function s(t, e, r) {
|
|
83
|
+
if (t.$ === "Nil") {
|
|
84
|
+
if (e.$ === "Nil")
|
|
85
|
+
return r;
|
|
86
|
+
{
|
|
87
|
+
let u = e.head, i = e.tail;
|
|
88
|
+
return !1;
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
let u = t.head, i = t.tail;
|
|
92
|
+
if (e.$ === "Nil")
|
|
93
|
+
return !1;
|
|
94
|
+
{
|
|
95
|
+
let a = e.head, h = e.tail;
|
|
96
|
+
return n(s, [i, h, $(c(r, $(E(u, a))))]);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function c(t, e) {
|
|
101
|
+
return t ? e : !1;
|
|
102
|
+
}
|
|
103
|
+
function E(t, e) {
|
|
104
|
+
return n(T, [d(t, e)]);
|
|
105
|
+
}
|
|
106
|
+
function T(t) {
|
|
107
|
+
return t.$ === "LT" ? !1 : t.$ === "EQ";
|
|
108
|
+
}
|
|
109
|
+
var j = /* @__PURE__ */ o(v, 1), q = /* @__PURE__ */ o(y, 1), D = /* @__PURE__ */ o(g, 2), I = /* @__PURE__ */ o(R, 2), J = /* @__PURE__ */ o(N, 1);
|
|
110
|
+
export {
|
|
111
|
+
D as authorityAllows,
|
|
112
|
+
I as authorityDerive,
|
|
113
|
+
j as authorityIssue,
|
|
114
|
+
q as authorityLive,
|
|
115
|
+
J as authorityRelease
|
|
116
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Generated ABI declarations; see proofs/abi.json.
|
|
2
|
+
export type BendList<T> = { $: "Nil" } | { $: "Con"; head: T; tail: BendList<T> };
|
|
3
|
+
export type ResourceName = BendList<bigint>;
|
|
4
|
+
export type ResourceScope = { $: "Unknown" } | { $: "Exact"; names: BendList<ResourceName> };
|
|
5
|
+
export type ResourceEffect = { $: "Quiet" } | { $: "Effect"; ordered: boolean; scope: ResourceScope };
|
|
6
|
+
export interface Span { $: "Span"; first: bigint; last: bigint; paired: boolean }
|
|
7
|
+
export interface Cut { $: "Cut"; eligible: boolean; afterPrevious: boolean; retained: bigint; budget: bigint; boundary: bigint; spans: BendList<Span> }
|
|
8
|
+
export interface Chunk { $: "Chunk"; start: bigint; end: bigint; total: bigint; expectedStart: bigint; expectedTotal: bigint; length: bigint; complete: boolean }
|
|
9
|
+
|
|
10
|
+
export declare function footprintFits(count: bigint, limit: bigint, valid: boolean): boolean;
|
|
11
|
+
export declare function unknownConflict(leftUnknown: boolean, leftUnknownOrdered: boolean, leftOrdered: boolean, rightUnknown: boolean, rightUnknownOrdered: boolean, rightOrdered: boolean): boolean;
|
|
12
|
+
export declare function transitionCurrent(retired: boolean, sameEpoch: boolean, sameOwner: boolean, closed: boolean): boolean;
|
|
13
|
+
export declare function canClose(retiring: boolean, ownerRetained: boolean, hasRetainers: boolean, hasInFlight: boolean): boolean;
|
|
14
|
+
export declare function cleanupState(failed: boolean, diverted: boolean): number;
|
|
15
|
+
export declare function spansSafe(spans: BendList<Span>, boundary: bigint): boolean;
|
|
16
|
+
export declare function cutAccepted(cut: Cut): boolean;
|
|
17
|
+
export declare function pointerCurrent(sourceMatches: boolean, lineageMatches: boolean): boolean;
|
|
18
|
+
export declare function chunkAccepted(chunk: Chunk): boolean;
|
|
19
|
+
export declare function coverageComplete(sourceComplete: boolean, truncated: boolean): boolean;
|
|
20
|
+
export declare function useNormalized(canonical: boolean, plan: boolean, changed: boolean, accepted: boolean): boolean;
|
|
21
|
+
export declare function headReadable(sequence: boolean, version: boolean, committed: boolean, pending: boolean, marker: boolean): boolean;
|
|
22
|
+
export declare function certificateAccepted(conditions: BendList<boolean>): boolean;
|
|
23
|
+
export declare function consume(active: boolean): { $: 'Tuple'; fst: boolean; snd: boolean };
|
|
24
|
+
export declare function lineageSelected(allBranches: boolean, member: boolean): boolean;
|
|
25
|
+
export declare function knownConflict(shared: boolean, leftOrdered: boolean, rightOrdered: boolean): boolean;
|
|
26
|
+
export declare function summaryWithin(bytes: bigint, byteLimit: bigint, projected: bigint, target: bigint): boolean;
|
|
27
|
+
export declare function sampleWithin(total: bigint, retained: bigint, omitted: bigint, limit: bigint): boolean;
|
|
28
|
+
export declare function resourceSource(names: BendList<ResourceName>): ResourceScope;
|
|
29
|
+
export declare function resourceNormalize(original: ResourceScope, candidate: BendList<ResourceName>): ResourceScope;
|
|
30
|
+
export declare function resourceConflict(left: ResourceScope, right: ResourceScope, leftOrdered: boolean, rightOrdered: boolean): boolean;
|
|
31
|
+
export declare function resourceGroups(left: BendList<ResourceEffect>, right: BendList<ResourceEffect>): boolean;
|