@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
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
repairCatalogInput,
|
|
13
13
|
validateCatalogArgs,
|
|
14
14
|
validationMessage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YAPDV6LO.js";
|
|
16
16
|
import {
|
|
17
17
|
runAbortable,
|
|
18
18
|
settleWithin,
|
|
@@ -26,139 +26,252 @@ import {
|
|
|
26
26
|
getActiveRepairCompiler,
|
|
27
27
|
isActiveQuarantine,
|
|
28
28
|
normalizeActiveArguments
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-Z45SUO4B.js";
|
|
30
30
|
import {
|
|
31
31
|
FABRIC_NESTED_TOOL_CALL_ID_PREFIX
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-VRAGOMN4.js";
|
|
33
33
|
import {
|
|
34
34
|
FabricResolutionError,
|
|
35
35
|
FabricTraceSafeError,
|
|
36
36
|
executionOutcomeFromError
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-M25A5R3F.js";
|
|
38
38
|
import {
|
|
39
39
|
BEND_NAT_MAX,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
Je,
|
|
41
|
+
Ut,
|
|
42
|
+
_t,
|
|
42
43
|
boundedEffectResources,
|
|
43
44
|
encodeResourceEffects,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} from "./chunk-4E63LJDD.js";
|
|
45
|
+
gt
|
|
46
|
+
} from "./chunk-MNTJX4U7.js";
|
|
47
47
|
import {
|
|
48
48
|
stableJsonHash
|
|
49
49
|
} from "./chunk-3YZUQESG.js";
|
|
50
50
|
|
|
51
51
|
// src/verified/generated/authority-kernel.js
|
|
52
|
-
function
|
|
52
|
+
function A(t, e) {
|
|
53
53
|
return { $: t < e ? "LT" : t === e ? "EQ" : "GT" };
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
55
|
+
function N(t) {
|
|
56
|
+
return (typeof t == "bigint" || Number.isInteger(t)) && t >= 0 && t <= 2 ** 53 ? Number(t) : { [Symbol.toPrimitive]() {
|
|
57
|
+
throw "bend: a Nat past the largest immediate 2^48-1";
|
|
58
|
+
} };
|
|
57
59
|
}
|
|
58
|
-
function
|
|
60
|
+
function f(t) {
|
|
59
61
|
for (; t !== null && typeof t == "object" && t.$ === "$JMP"; )
|
|
60
62
|
t = t.f(...t.x);
|
|
61
63
|
return t;
|
|
62
64
|
}
|
|
63
|
-
function
|
|
64
|
-
return (...r) => r.length < e ?
|
|
65
|
-
}
|
|
66
|
-
function v(t) {
|
|
67
|
-
return n(m, [t]);
|
|
68
|
-
}
|
|
69
|
-
function y(t) {
|
|
70
|
-
return n(p, [t]);
|
|
65
|
+
function c(t, e) {
|
|
66
|
+
return (...r) => r.length < e ? c((...a2) => t(...r, ...a2), e - r.length) : t(...r);
|
|
71
67
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
68
|
+
function R(t, e, r) {
|
|
69
|
+
for (; ; ) {
|
|
70
|
+
let a2 = t, i = e, n = r;
|
|
71
|
+
if (a2.$ === "Nil")
|
|
72
|
+
return i.$ === "Nil" ? n : false;
|
|
73
|
+
{
|
|
74
|
+
let o = a2.head, u2 = a2.tail;
|
|
75
|
+
if (i.$ === "Nil")
|
|
76
|
+
return false;
|
|
77
|
+
{
|
|
78
|
+
let $2 = i.head, k2 = i.tail;
|
|
79
|
+
t = u2, e = k2, r = m(n, B(o, $2));
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
74
84
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
85
|
+
function _(t, e, r) {
|
|
86
|
+
for (; ; ) {
|
|
87
|
+
let a2 = t, i = e, n = r;
|
|
88
|
+
if (a2.$ === "Nil")
|
|
89
|
+
return n;
|
|
90
|
+
{
|
|
91
|
+
let o = a2.head, u2 = a2.tail, $2 = R(i, o, true);
|
|
92
|
+
t = u2, e = i, r = n || $2;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
77
96
|
}
|
|
78
|
-
function
|
|
79
|
-
|
|
97
|
+
function E(t, e, r) {
|
|
98
|
+
for (; ; ) {
|
|
99
|
+
let a2 = t, i = e, n = r;
|
|
100
|
+
if (a2.$ === "Nil")
|
|
101
|
+
return n;
|
|
102
|
+
{
|
|
103
|
+
let o = a2.head;
|
|
104
|
+
t = a2.tail, e = i, r = m(n, _(i, o, false));
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
80
108
|
}
|
|
81
|
-
function
|
|
82
|
-
return { $: "Active", grants: t };
|
|
109
|
+
function x(t) {
|
|
110
|
+
return { $: "authority-state.Active", grants: t };
|
|
83
111
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
return false;
|
|
87
|
-
{
|
|
88
|
-
let e = t.grants;
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
112
|
+
function C(t) {
|
|
113
|
+
return t.$ !== "authority-state.Released";
|
|
91
114
|
}
|
|
92
|
-
function
|
|
93
|
-
if (t.$ === "Released")
|
|
115
|
+
function L(t, e) {
|
|
116
|
+
if (t.$ === "authority-state.Released")
|
|
94
117
|
return false;
|
|
95
118
|
{
|
|
96
119
|
let r = t.grants;
|
|
97
|
-
return
|
|
120
|
+
return _(r, e, false);
|
|
98
121
|
}
|
|
99
122
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
123
|
+
function Q(t, e) {
|
|
124
|
+
return t ? { $: "authority-state.Active", grants: e } : { $: "authority-state.Released" };
|
|
125
|
+
}
|
|
126
|
+
function I(t, e) {
|
|
127
|
+
if (t.$ === "authority-state.Released")
|
|
128
|
+
return { $: "authority-state.Released" };
|
|
103
129
|
{
|
|
104
130
|
let r = t.grants;
|
|
105
|
-
return
|
|
131
|
+
return Q(E(e, r, true), e);
|
|
106
132
|
}
|
|
107
133
|
}
|
|
108
|
-
function
|
|
109
|
-
return { $: "Released" };
|
|
134
|
+
function q(t) {
|
|
135
|
+
return { $: "authority-state.Released" };
|
|
110
136
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
return r;
|
|
114
|
-
{
|
|
115
|
-
let u2 = t.head, i2 = t.tail, a2 = $(s(e, u2, true));
|
|
116
|
-
return n(l, [i2, e, r || a2]);
|
|
117
|
-
}
|
|
137
|
+
function U(t) {
|
|
138
|
+
return x(t);
|
|
118
139
|
}
|
|
119
|
-
function
|
|
120
|
-
return t
|
|
140
|
+
function j(t) {
|
|
141
|
+
return C(t);
|
|
121
142
|
}
|
|
122
|
-
function
|
|
123
|
-
|
|
124
|
-
return r;
|
|
125
|
-
{
|
|
126
|
-
let u2 = t.head, i2 = t.tail;
|
|
127
|
-
return n(f, [i2, e, $(c(r, $(l(e, u2, false))))]);
|
|
128
|
-
}
|
|
143
|
+
function D(t, e) {
|
|
144
|
+
return L(t, e);
|
|
129
145
|
}
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
if (e.$ === "Nil")
|
|
133
|
-
return r;
|
|
134
|
-
{
|
|
135
|
-
let u2 = e.head, i2 = e.tail;
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
} else {
|
|
139
|
-
let u2 = t.head, i2 = t.tail;
|
|
140
|
-
if (e.$ === "Nil")
|
|
141
|
-
return false;
|
|
142
|
-
{
|
|
143
|
-
let a2 = e.head, h2 = e.tail;
|
|
144
|
-
return n(s, [i2, h2, $(c(r, $(E(u2, a2))))]);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
146
|
+
function M(t, e) {
|
|
147
|
+
return I(t, e);
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
+
function T(t) {
|
|
150
|
+
return q(t);
|
|
151
|
+
}
|
|
152
|
+
function m(t, e) {
|
|
149
153
|
return t ? e : false;
|
|
150
154
|
}
|
|
151
|
-
function
|
|
152
|
-
return
|
|
155
|
+
function B(t, e) {
|
|
156
|
+
return P(A(t, e));
|
|
153
157
|
}
|
|
154
|
-
function
|
|
158
|
+
function P(t) {
|
|
155
159
|
return t.$ === "LT" ? false : t.$ === "EQ";
|
|
156
160
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
function b(t) {
|
|
162
|
+
let e = [t];
|
|
163
|
+
for (let r = e, a2 = 0; ; )
|
|
164
|
+
switch (t.$) {
|
|
165
|
+
case "Nil":
|
|
166
|
+
return r[a2] = t, e[0];
|
|
167
|
+
case "Con":
|
|
168
|
+
r = r[a2] = { ...t, head: N(t.head) }, a2 = "tail", t = t[a2];
|
|
169
|
+
continue;
|
|
170
|
+
default:
|
|
171
|
+
throw "bend: List has no tag " + t?.$ + " (its tags: Nil, Con); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function p(t) {
|
|
175
|
+
let e = [t];
|
|
176
|
+
for (let r = e, a2 = 0; ; )
|
|
177
|
+
switch (t.$) {
|
|
178
|
+
case "Nil":
|
|
179
|
+
return r[a2] = t, e[0];
|
|
180
|
+
case "Con":
|
|
181
|
+
r = r[a2] = { ...t, head: BigInt(t.head) }, a2 = "tail", t = t[a2];
|
|
182
|
+
continue;
|
|
183
|
+
default:
|
|
184
|
+
throw "bend: List has no tag " + t?.$ + " (its tags: Nil, Con); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function g(t) {
|
|
188
|
+
let e = [t];
|
|
189
|
+
for (let r = e, a2 = 0; ; )
|
|
190
|
+
switch (t.$) {
|
|
191
|
+
case "Nil":
|
|
192
|
+
return r[a2] = t, e[0];
|
|
193
|
+
case "Con":
|
|
194
|
+
r = r[a2] = { ...t, head: b(t.head) }, a2 = "tail", t = t[a2];
|
|
195
|
+
continue;
|
|
196
|
+
default:
|
|
197
|
+
throw "bend: List has no tag " + t?.$ + " (its tags: Nil, Con); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function w(t) {
|
|
201
|
+
let e = [t];
|
|
202
|
+
for (let r = e, a2 = 0; ; )
|
|
203
|
+
switch (t.$) {
|
|
204
|
+
case "Nil":
|
|
205
|
+
return r[a2] = t, e[0];
|
|
206
|
+
case "Con":
|
|
207
|
+
r = r[a2] = { ...t, head: p(t.head) }, a2 = "tail", t = t[a2];
|
|
208
|
+
continue;
|
|
209
|
+
default:
|
|
210
|
+
throw "bend: List has no tag " + t?.$ + " (its tags: Nil, Con); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function l(t) {
|
|
214
|
+
let e = [t];
|
|
215
|
+
for (let r = e, a2 = 0; ; )
|
|
216
|
+
switch (t.$) {
|
|
217
|
+
case "authority-state.Released":
|
|
218
|
+
return r[a2] = t, e[0];
|
|
219
|
+
case "authority-state.Active":
|
|
220
|
+
return r = r[a2] = { ...t, grants: w(t.grants) }, e[0];
|
|
221
|
+
default:
|
|
222
|
+
throw "bend: authority-state.Authority has no tag " + t?.$ + " (its tags: authority-state.Released, authority-state.Active); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function d(t) {
|
|
226
|
+
let e = [t];
|
|
227
|
+
for (let r = e, a2 = 0; ; )
|
|
228
|
+
switch (t.$) {
|
|
229
|
+
case "authority-state.Released":
|
|
230
|
+
return r[a2] = t, e[0];
|
|
231
|
+
case "authority-state.Active":
|
|
232
|
+
return r = r[a2] = { ...t, grants: g(t.grants) }, e[0];
|
|
233
|
+
default:
|
|
234
|
+
throw "bend: authority-state.Authority has no tag " + t?.$ + " (its tags: authority-state.Released, authority-state.Active); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
var h = /* @__PURE__ */ new Map([["Unknown", "resources.Unknown"], ["Exact", "resources.Exact"], ["Quiet", "resources.Quiet"], ["Active", "authority-state.Active"], ["Released", "authority-state.Released"], ["Effect", "resources.Effect"]]);
|
|
238
|
+
var y = /* @__PURE__ */ new Map([["resources.Unknown", "Unknown"], ["resources.Exact", "Exact"], ["resources.Quiet", "Quiet"], ["authority-state.Active", "Active"], ["authority-state.Released", "Released"], ["resources.Effect", "Effect"]]);
|
|
239
|
+
function s(t, e) {
|
|
240
|
+
let r = [t];
|
|
241
|
+
for (let a2 = [[r, 0]]; a2.length > 0; ) {
|
|
242
|
+
let [i, n] = a2.pop(), o = i[n];
|
|
243
|
+
if (o === null || typeof o != "object") continue;
|
|
244
|
+
let u2 = Array.isArray(o) ? [...o] : { ...o };
|
|
245
|
+
typeof u2.$ == "string" && (u2.$ = e.get(u2.$) ?? u2.$), i[n] = u2;
|
|
246
|
+
for (let $2 of Object.keys(u2)) a2.push([u2, $2]);
|
|
247
|
+
}
|
|
248
|
+
return r[0];
|
|
249
|
+
}
|
|
250
|
+
var G = /* @__PURE__ */ c((t) => {
|
|
251
|
+
let e = l(f(U(g(t))));
|
|
252
|
+
return w(t), e;
|
|
253
|
+
}, 1);
|
|
254
|
+
var J = (t) => s(G(s(t, h)), y);
|
|
255
|
+
var O = /* @__PURE__ */ c((t) => {
|
|
256
|
+
let e = f(j(d(t)));
|
|
257
|
+
return l(t), e;
|
|
258
|
+
}, 1);
|
|
259
|
+
var S = (t) => s(O(s(t, h)), y);
|
|
260
|
+
var z = /* @__PURE__ */ c((t, e) => {
|
|
261
|
+
let r = f(D(d(t), b(e)));
|
|
262
|
+
return l(t), p(e), r;
|
|
263
|
+
}, 2);
|
|
264
|
+
var F = (t, e) => s(z(s(t, h), s(e, h)), y);
|
|
265
|
+
var H = /* @__PURE__ */ c((t, e) => {
|
|
266
|
+
let r = l(f(M(d(t), g(e))));
|
|
267
|
+
return l(t), w(e), r;
|
|
268
|
+
}, 2);
|
|
269
|
+
var K = (t, e) => s(H(s(t, h), s(e, h)), y);
|
|
270
|
+
var V = /* @__PURE__ */ c((t) => {
|
|
271
|
+
let e = l(f(T(d(t))));
|
|
272
|
+
return l(t), e;
|
|
273
|
+
}, 1);
|
|
274
|
+
var W = (t) => s(V(s(t, h)), y);
|
|
162
275
|
|
|
163
276
|
// src/verified/authority.ts
|
|
164
277
|
var encodeGrant = (grant) => {
|
|
@@ -170,15 +283,15 @@ var encodeGrant = (grant) => {
|
|
|
170
283
|
grant.descriptorHash
|
|
171
284
|
]);
|
|
172
285
|
let encoded = { $: "Nil" };
|
|
173
|
-
for (let
|
|
174
|
-
encoded = { $: "Con", head: BigInt(text.charCodeAt(
|
|
286
|
+
for (let i = text.length - 1; i >= 0; i--) {
|
|
287
|
+
encoded = { $: "Con", head: BigInt(text.charCodeAt(i)), tail: encoded };
|
|
175
288
|
}
|
|
176
289
|
return encoded;
|
|
177
290
|
};
|
|
178
291
|
var encodeGrants = (grants) => {
|
|
179
292
|
let encoded = { $: "Nil" };
|
|
180
|
-
for (let
|
|
181
|
-
encoded = { $: "Con", head: encodeGrant(grants[
|
|
293
|
+
for (let i = grants.length - 1; i >= 0; i--) {
|
|
294
|
+
encoded = { $: "Con", head: encodeGrant(grants[i]), tail: encoded };
|
|
182
295
|
}
|
|
183
296
|
return encoded;
|
|
184
297
|
};
|
|
@@ -189,7 +302,7 @@ var CapabilityAuthority = class _CapabilityAuthority {
|
|
|
189
302
|
const canonical = grants.map((grant) => Object.freeze({ ...grant }));
|
|
190
303
|
this.#grants = new Map(canonical.map((grant) => [grant.ref, grant]));
|
|
191
304
|
const encoded = encodeGrants(canonical);
|
|
192
|
-
this.#state = parent ?
|
|
305
|
+
this.#state = parent ? K(parent.#state, encoded) : J(encoded);
|
|
193
306
|
}
|
|
194
307
|
static issue(grants) {
|
|
195
308
|
return new _CapabilityAuthority(grants);
|
|
@@ -198,14 +311,14 @@ var CapabilityAuthority = class _CapabilityAuthority {
|
|
|
198
311
|
return new _CapabilityAuthority(grants, this);
|
|
199
312
|
}
|
|
200
313
|
get active() {
|
|
201
|
-
return
|
|
314
|
+
return S(this.#state);
|
|
202
315
|
}
|
|
203
316
|
release() {
|
|
204
|
-
this.#state =
|
|
317
|
+
this.#state = W(this.#state);
|
|
205
318
|
}
|
|
206
319
|
resolve(ref) {
|
|
207
320
|
const grant = this.#grants.get(ref);
|
|
208
|
-
return grant &&
|
|
321
|
+
return grant && F(this.#state, encodeGrant(grant)) ? { ...grant } : void 0;
|
|
209
322
|
}
|
|
210
323
|
bindings() {
|
|
211
324
|
return this.active ? [...this.#grants.values()].map((grant) => ({ ...grant })) : [];
|
|
@@ -275,9 +388,9 @@ var summarizeEffects = (effects) => {
|
|
|
275
388
|
};
|
|
276
389
|
};
|
|
277
390
|
var effectConflictsBetween = (left, right) => {
|
|
278
|
-
if (!
|
|
391
|
+
if (!Ut(left.declarations, right.declarations)) return [];
|
|
279
392
|
const conflicts = [];
|
|
280
|
-
if (
|
|
393
|
+
if (Je(
|
|
281
394
|
left.hasUnknown,
|
|
282
395
|
left.hasUnknownNoncommutative,
|
|
283
396
|
left.hasNoncommutative,
|
|
@@ -288,7 +401,7 @@ var effectConflictsBetween = (left, right) => {
|
|
|
288
401
|
conflicts.push({ resources: ["*"], reason: "unknown_resource" });
|
|
289
402
|
}
|
|
290
403
|
const overlap = [...left.resourceNoncommutative.keys()].filter(
|
|
291
|
-
(resource) =>
|
|
404
|
+
(resource) => _t(
|
|
292
405
|
right.resourceNoncommutative.has(resource),
|
|
293
406
|
left.resourceNoncommutative.get(resource) ?? false,
|
|
294
407
|
right.resourceNoncommutative.get(resource) ?? false
|
|
@@ -354,13 +467,13 @@ var levenshtein = (left, right) => {
|
|
|
354
467
|
let previous = new Array(right.length + 1);
|
|
355
468
|
let current = new Array(right.length + 1);
|
|
356
469
|
for (let j2 = 0; j2 <= right.length; j2++) previous[j2] = j2;
|
|
357
|
-
for (let
|
|
358
|
-
current[0] =
|
|
470
|
+
for (let i = 1; i <= left.length; i++) {
|
|
471
|
+
current[0] = i;
|
|
359
472
|
for (let j2 = 1; j2 <= right.length; j2++) {
|
|
360
473
|
current[j2] = Math.min(
|
|
361
474
|
previous[j2] + 1,
|
|
362
475
|
current[j2 - 1] + 1,
|
|
363
|
-
previous[j2 - 1] + (left[
|
|
476
|
+
previous[j2 - 1] + (left[i - 1] === right[j2 - 1] ? 0 : 1)
|
|
364
477
|
);
|
|
365
478
|
}
|
|
366
479
|
const swap = previous;
|
|
@@ -455,155 +568,204 @@ var formatUnknownActionMessage = (ref, suggestions) => suggestions.length > 0 ?
|
|
|
455
568
|
import { randomUUID } from "node:crypto";
|
|
456
569
|
|
|
457
570
|
// src/verified/generated/lifecycle-kernel.js
|
|
458
|
-
function
|
|
459
|
-
if (
|
|
571
|
+
function d2(l2) {
|
|
572
|
+
if (l2 > 281474976710655)
|
|
573
|
+
throw "bend: a Nat past the largest immediate 2^48-1";
|
|
574
|
+
return l2;
|
|
575
|
+
}
|
|
576
|
+
function y2(l2) {
|
|
577
|
+
return (typeof l2 == "bigint" || Number.isInteger(l2)) && l2 >= 0 && l2 <= 2 ** 53 ? Number(l2) : { [Symbol.toPrimitive]() {
|
|
460
578
|
throw "bend: a Nat past the largest immediate 2^48-1";
|
|
461
|
-
|
|
579
|
+
} };
|
|
462
580
|
}
|
|
463
|
-
function
|
|
464
|
-
|
|
581
|
+
function p2(l2) {
|
|
582
|
+
for (; l2 !== null && typeof l2 == "object" && l2.$ === "$JMP"; )
|
|
583
|
+
l2 = l2.f(...l2.x);
|
|
584
|
+
return l2;
|
|
465
585
|
}
|
|
466
|
-
function
|
|
467
|
-
|
|
468
|
-
o2 = o2.f(...o2.x);
|
|
469
|
-
return o2;
|
|
586
|
+
function f2(l2, e) {
|
|
587
|
+
return (...c2) => c2.length < e ? f2((...o) => l2(...c2, ...o), e - c2.length) : l2(...c2);
|
|
470
588
|
}
|
|
471
|
-
function
|
|
472
|
-
|
|
589
|
+
function s2(l2, e, c2) {
|
|
590
|
+
if (l2.$ === "lifecycle.Closing" || l2.$ === "lifecycle.Closed")
|
|
591
|
+
return false;
|
|
592
|
+
if (l2.$ === "lifecycle.Failed")
|
|
593
|
+
return c2;
|
|
594
|
+
{
|
|
595
|
+
let o = R2(e);
|
|
596
|
+
return c2 || o;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
function $(l2) {
|
|
600
|
+
return l2.$ === "lifecycle.Staged" ? { $: "lifecycle.Retiring" } : l2.$ === "lifecycle.Active" ? { $: "lifecycle.Retiring" } : l2;
|
|
601
|
+
}
|
|
602
|
+
function k(l2, e) {
|
|
603
|
+
if (l2) {
|
|
604
|
+
let c2 = e.phase, o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
605
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: o, holds: n, calls: d2(r + 1), revoked: t }, command: { $: "lifecycle.Granted" } };
|
|
606
|
+
} else
|
|
607
|
+
return { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Denied" } };
|
|
473
608
|
}
|
|
474
|
-
function
|
|
475
|
-
|
|
609
|
+
function w2(l2, e) {
|
|
610
|
+
if (l2) {
|
|
611
|
+
let c2 = e.phase, o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
612
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: o, holds: d2(n + 1), calls: r, revoked: t }, command: { $: "lifecycle.Granted" } };
|
|
613
|
+
} else
|
|
614
|
+
return { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Denied" } };
|
|
476
615
|
}
|
|
477
|
-
function
|
|
478
|
-
return
|
|
616
|
+
function v(l2, e) {
|
|
617
|
+
return l2 ? { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Granted" } } : { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Denied" } };
|
|
479
618
|
}
|
|
480
|
-
function
|
|
481
|
-
if (
|
|
482
|
-
let
|
|
483
|
-
return
|
|
484
|
-
} else if (
|
|
485
|
-
let
|
|
486
|
-
if (
|
|
487
|
-
let
|
|
488
|
-
return { $: "Outcome", next: { $: "Life", phase: { $: "Active" }, owner:
|
|
489
|
-
} else if (
|
|
490
|
-
let
|
|
491
|
-
return { $: "Outcome", next: { $: "Life", phase: { $: "Active" }, owner:
|
|
619
|
+
function g2(l2, e) {
|
|
620
|
+
if (l2.$ === "lifecycle.Inspect") {
|
|
621
|
+
let c2 = e.phase, o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
622
|
+
return v(s2(c2, t, false), { $: "lifecycle.Life", phase: c2, owner: o, holds: n, calls: r, revoked: t });
|
|
623
|
+
} else if (l2.$ === "lifecycle.Activate") {
|
|
624
|
+
let c2 = e.phase;
|
|
625
|
+
if (c2.$ === "lifecycle.Staged") {
|
|
626
|
+
let o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
627
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Active" }, owner: o, holds: n, calls: r, revoked: t }, command: { $: "lifecycle.Granted" } };
|
|
628
|
+
} else if (c2.$ === "lifecycle.Active") {
|
|
629
|
+
let o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
630
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Active" }, owner: o, holds: n, calls: r, revoked: t }, command: { $: "lifecycle.Granted" } };
|
|
492
631
|
} else {
|
|
493
|
-
let
|
|
494
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
495
|
-
}
|
|
496
|
-
} else if (
|
|
497
|
-
let
|
|
498
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
499
|
-
} else if (
|
|
500
|
-
let
|
|
501
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
502
|
-
} else if (
|
|
503
|
-
let
|
|
504
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
505
|
-
} else if (
|
|
506
|
-
let
|
|
507
|
-
return
|
|
508
|
-
} else if (
|
|
509
|
-
let
|
|
510
|
-
if (
|
|
511
|
-
let r = e.calls,
|
|
512
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
632
|
+
let o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
633
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: o, holds: n, calls: r, revoked: t }, command: { $: "lifecycle.Denied" } };
|
|
634
|
+
}
|
|
635
|
+
} else if (l2.$ === "lifecycle.Retire") {
|
|
636
|
+
let c2 = e.phase, o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
637
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: $(c2), owner: o, holds: n, calls: r, revoked: t }, command: { $: "lifecycle.Granted" } };
|
|
638
|
+
} else if (l2.$ === "lifecycle.DropOwner") {
|
|
639
|
+
let c2 = e.phase, o = e.holds, n = e.calls, r = e.revoked;
|
|
640
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: false, holds: o, calls: n, revoked: r }, command: { $: "lifecycle.Granted" } };
|
|
641
|
+
} else if (l2.$ === "lifecycle.Revoke") {
|
|
642
|
+
let c2 = e.phase, o = e.holds, n = e.calls;
|
|
643
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: $(c2), owner: false, holds: o, calls: n, revoked: true }, command: { $: "lifecycle.Granted" } };
|
|
644
|
+
} else if (l2.$ === "lifecycle.Retain") {
|
|
645
|
+
let c2 = l2.cleanup, o = e.phase, n = e.owner, r = e.holds, t = e.calls, i = e.revoked;
|
|
646
|
+
return w2(s2(o, i, c2), { $: "lifecycle.Life", phase: o, owner: n, holds: r, calls: t, revoked: i });
|
|
647
|
+
} else if (l2.$ === "lifecycle.Release") {
|
|
648
|
+
let c2 = e.phase, o = e.owner, n = e.holds;
|
|
649
|
+
if (n === 0) {
|
|
650
|
+
let r = e.calls, t = e.revoked;
|
|
651
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: o, holds: 0, calls: r, revoked: t }, command: { $: "lifecycle.Denied" } };
|
|
513
652
|
} else {
|
|
514
|
-
let r =
|
|
515
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
516
|
-
}
|
|
517
|
-
} else if (
|
|
518
|
-
let
|
|
519
|
-
return
|
|
520
|
-
} else if (
|
|
521
|
-
let
|
|
522
|
-
if (r ===
|
|
523
|
-
let
|
|
524
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
653
|
+
let r = n - 1, t = e.calls, i = e.revoked;
|
|
654
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: o, holds: r, calls: t, revoked: i }, command: { $: "lifecycle.Granted" } };
|
|
655
|
+
}
|
|
656
|
+
} else if (l2.$ === "lifecycle.Begin") {
|
|
657
|
+
let c2 = l2.cleanup, o = e.phase, n = e.owner, r = e.holds, t = e.calls, i = e.revoked;
|
|
658
|
+
return k(s2(o, i, c2), { $: "lifecycle.Life", phase: o, owner: n, holds: r, calls: t, revoked: i });
|
|
659
|
+
} else if (l2.$ === "lifecycle.End") {
|
|
660
|
+
let c2 = e.phase, o = e.owner, n = e.holds, r = e.calls;
|
|
661
|
+
if (r === 0) {
|
|
662
|
+
let t = e.revoked;
|
|
663
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: o, holds: n, calls: 0, revoked: t }, command: { $: "lifecycle.Denied" } };
|
|
525
664
|
} else {
|
|
526
|
-
let
|
|
527
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
528
|
-
}
|
|
529
|
-
} else if (
|
|
530
|
-
let
|
|
531
|
-
if (
|
|
532
|
-
let
|
|
533
|
-
if (
|
|
534
|
-
let
|
|
535
|
-
return { $: "Outcome", next: { $: "Life", phase: { $: "Retiring" }, owner:
|
|
665
|
+
let t = r - 1, i = e.revoked;
|
|
666
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: o, holds: n, calls: t, revoked: i }, command: { $: "lifecycle.Granted" } };
|
|
667
|
+
}
|
|
668
|
+
} else if (l2.$ === "lifecycle.Shut") {
|
|
669
|
+
let c2 = e.phase;
|
|
670
|
+
if (c2.$ === "lifecycle.Retiring") {
|
|
671
|
+
let o = e.owner;
|
|
672
|
+
if (o) {
|
|
673
|
+
let n = e.holds, r = e.calls, t = e.revoked;
|
|
674
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: o, holds: n, calls: r, revoked: t }, command: { $: "lifecycle.Denied" } };
|
|
536
675
|
} else {
|
|
537
|
-
let
|
|
538
|
-
if (
|
|
676
|
+
let n = e.holds;
|
|
677
|
+
if (n === 0) {
|
|
539
678
|
let r = e.calls;
|
|
540
|
-
if (r ===
|
|
541
|
-
let
|
|
542
|
-
return { $: "Outcome", next: { $: "Life", phase: { $: "Closing" }, owner: false, holds:
|
|
679
|
+
if (r === 0) {
|
|
680
|
+
let t = e.revoked;
|
|
681
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closing" }, owner: false, holds: 0, calls: 0, revoked: t }, command: { $: "lifecycle.StartClose" } };
|
|
543
682
|
} else {
|
|
544
|
-
let
|
|
545
|
-
return { $: "Outcome", next: { $: "Life", phase: { $: "Retiring" }, owner: false, holds:
|
|
683
|
+
let t = r - 0, i = e.revoked;
|
|
684
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: false, holds: 0, calls: t, revoked: i }, command: { $: "lifecycle.Denied" } };
|
|
546
685
|
}
|
|
547
686
|
} else {
|
|
548
|
-
let r =
|
|
549
|
-
return { $: "Outcome", next: { $: "Life", phase: { $: "Retiring" }, owner: false, holds: r, calls:
|
|
687
|
+
let r = n - 0, t = e.calls, i = e.revoked;
|
|
688
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: false, holds: r, calls: t, revoked: i }, command: { $: "lifecycle.Denied" } };
|
|
550
689
|
}
|
|
551
690
|
}
|
|
552
691
|
} else {
|
|
553
|
-
let
|
|
554
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
555
|
-
}
|
|
556
|
-
} else if (
|
|
557
|
-
let
|
|
558
|
-
if (
|
|
559
|
-
let
|
|
560
|
-
return { $: "Outcome", next: { $: "Life", phase: { $: "Closed" }, owner:
|
|
692
|
+
let o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
693
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: o, holds: n, calls: r, revoked: t }, command: { $: "lifecycle.Denied" } };
|
|
694
|
+
}
|
|
695
|
+
} else if (l2.$ === "lifecycle.Complete") {
|
|
696
|
+
let c2 = e.phase;
|
|
697
|
+
if (c2.$ === "lifecycle.Closing") {
|
|
698
|
+
let o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
699
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closed" }, owner: o, holds: n, calls: r, revoked: t }, command: { $: "lifecycle.Granted" } };
|
|
561
700
|
} else {
|
|
562
|
-
let
|
|
563
|
-
return { $: "Outcome", next: { $: "Life", phase:
|
|
701
|
+
let o = e.owner, n = e.holds, r = e.calls, t = e.revoked;
|
|
702
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: c2, owner: o, holds: n, calls: r, revoked: t }, command: { $: "lifecycle.Denied" } };
|
|
564
703
|
}
|
|
565
|
-
} else if (e.phase.$ === "Closed") {
|
|
566
|
-
let
|
|
567
|
-
return { $: "Outcome", next: { $: "Life", phase: { $: "Closed" }, owner:
|
|
704
|
+
} else if (e.phase.$ === "lifecycle.Closed") {
|
|
705
|
+
let c2 = e.owner, o = e.holds, n = e.calls, r = e.revoked;
|
|
706
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closed" }, owner: c2, holds: o, calls: n, revoked: r }, command: { $: "lifecycle.Denied" } };
|
|
568
707
|
} else {
|
|
569
|
-
let
|
|
570
|
-
return { $: "Outcome", next: { $: "Life", phase: { $: "Failed" }, owner: false, holds:
|
|
708
|
+
let c2 = e.holds, o = e.calls;
|
|
709
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Failed" }, owner: false, holds: c2, calls: o, revoked: true }, command: { $: "lifecycle.Granted" } };
|
|
571
710
|
}
|
|
572
711
|
}
|
|
573
|
-
function
|
|
574
|
-
return
|
|
712
|
+
function O2(l2, e) {
|
|
713
|
+
return g2(e, l2);
|
|
575
714
|
}
|
|
576
|
-
function
|
|
577
|
-
|
|
578
|
-
return false;
|
|
579
|
-
if (o2.$ === "Failed")
|
|
580
|
-
return s2;
|
|
581
|
-
{
|
|
582
|
-
let n2 = a(L2(e));
|
|
583
|
-
return s2 || n2;
|
|
584
|
-
}
|
|
715
|
+
function L2(l2, e) {
|
|
716
|
+
return O2(l2, e);
|
|
585
717
|
}
|
|
586
|
-
function
|
|
587
|
-
return
|
|
718
|
+
function R2(l2) {
|
|
719
|
+
return !l2;
|
|
588
720
|
}
|
|
589
|
-
function
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
721
|
+
function x2(l2) {
|
|
722
|
+
let e = [l2];
|
|
723
|
+
for (let c2 = e, o = 0; ; )
|
|
724
|
+
switch (l2.$) {
|
|
725
|
+
case "lifecycle.Life":
|
|
726
|
+
return c2 = c2[o] = { ...l2, holds: y2(l2.holds), calls: y2(l2.calls) }, e[0];
|
|
727
|
+
default:
|
|
728
|
+
throw "bend: lifecycle.Life has no tag " + l2?.$ + " (its tags: lifecycle.Life); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
|
|
729
|
+
}
|
|
595
730
|
}
|
|
596
|
-
function
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
731
|
+
function h2(l2) {
|
|
732
|
+
let e = [l2];
|
|
733
|
+
for (let c2 = e, o = 0; ; )
|
|
734
|
+
switch (l2.$) {
|
|
735
|
+
case "lifecycle.Life":
|
|
736
|
+
return c2 = c2[o] = { ...l2, holds: BigInt(l2.holds), calls: BigInt(l2.calls) }, e[0];
|
|
737
|
+
default:
|
|
738
|
+
throw "bend: lifecycle.Life has no tag " + l2?.$ + " (its tags: lifecycle.Life); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
function C2(l2) {
|
|
742
|
+
let e = [l2];
|
|
743
|
+
for (let c2 = e, o = 0; ; )
|
|
744
|
+
switch (l2.$) {
|
|
745
|
+
case "lifecycle.Outcome":
|
|
746
|
+
return c2 = c2[o] = { ...l2, next: h2(l2.next) }, e[0];
|
|
747
|
+
default:
|
|
748
|
+
throw "bend: lifecycle.Outcome has no tag " + l2?.$ + " (its tags: lifecycle.Outcome); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
|
|
749
|
+
}
|
|
602
750
|
}
|
|
603
|
-
|
|
604
|
-
|
|
751
|
+
var u = /* @__PURE__ */ new Map([["Closing", "lifecycle.Closing"], ["Closed", "lifecycle.Closed"], ["Failed", "lifecycle.Failed"], ["Staged", "lifecycle.Staged"], ["Retiring", "lifecycle.Retiring"], ["Active", "lifecycle.Active"], ["Outcome", "lifecycle.Outcome"], ["Denied", "lifecycle.Denied"], ["Life", "lifecycle.Life"], ["Granted", "lifecycle.Granted"], ["Inspect", "lifecycle.Inspect"], ["Activate", "lifecycle.Activate"], ["Retire", "lifecycle.Retire"], ["DropOwner", "lifecycle.DropOwner"], ["Revoke", "lifecycle.Revoke"], ["Retain", "lifecycle.Retain"], ["Release", "lifecycle.Release"], ["Begin", "lifecycle.Begin"], ["End", "lifecycle.End"], ["Shut", "lifecycle.Shut"], ["StartClose", "lifecycle.StartClose"], ["Complete", "lifecycle.Complete"]]);
|
|
752
|
+
var D2 = /* @__PURE__ */ new Map([["lifecycle.Closing", "Closing"], ["lifecycle.Closed", "Closed"], ["lifecycle.Failed", "Failed"], ["lifecycle.Staged", "Staged"], ["lifecycle.Retiring", "Retiring"], ["lifecycle.Active", "Active"], ["lifecycle.Outcome", "Outcome"], ["lifecycle.Denied", "Denied"], ["lifecycle.Life", "Life"], ["lifecycle.Granted", "Granted"], ["lifecycle.Inspect", "Inspect"], ["lifecycle.Activate", "Activate"], ["lifecycle.Retire", "Retire"], ["lifecycle.DropOwner", "DropOwner"], ["lifecycle.Revoke", "Revoke"], ["lifecycle.Retain", "Retain"], ["lifecycle.Release", "Release"], ["lifecycle.Begin", "Begin"], ["lifecycle.End", "End"], ["lifecycle.Shut", "Shut"], ["lifecycle.StartClose", "StartClose"], ["lifecycle.Complete", "Complete"]]);
|
|
753
|
+
function a(l2, e) {
|
|
754
|
+
let c2 = [l2];
|
|
755
|
+
for (let o = [[c2, 0]]; o.length > 0; ) {
|
|
756
|
+
let [n, r] = o.pop(), t = n[r];
|
|
757
|
+
if (t === null || typeof t != "object") continue;
|
|
758
|
+
let i = Array.isArray(t) ? [...t] : { ...t };
|
|
759
|
+
typeof i.$ == "string" && (i.$ = e.get(i.$) ?? i.$), n[r] = i;
|
|
760
|
+
for (let m2 of Object.keys(i)) o.push([i, m2]);
|
|
761
|
+
}
|
|
762
|
+
return c2[0];
|
|
605
763
|
}
|
|
606
|
-
var
|
|
764
|
+
var S2 = /* @__PURE__ */ f2((l2, e) => {
|
|
765
|
+
let c2 = C2(p2(L2(x2(l2), e)));
|
|
766
|
+
return h2(l2), c2;
|
|
767
|
+
}, 2);
|
|
768
|
+
var b2 = (l2, e) => a(S2(a(l2, u), a(e, u)), D2);
|
|
607
769
|
|
|
608
770
|
// src/core/provider-bindings.ts
|
|
609
771
|
var snapshot = (binding) => ({
|
|
@@ -613,7 +775,7 @@ var snapshot = (binding) => ({
|
|
|
613
775
|
var useOnce = () => {
|
|
614
776
|
let active = true;
|
|
615
777
|
return () => {
|
|
616
|
-
const next =
|
|
778
|
+
const next = gt(active);
|
|
617
779
|
active = next.snd;
|
|
618
780
|
return next.fst;
|
|
619
781
|
};
|
|
@@ -638,7 +800,7 @@ var FabricProviderBindings = class {
|
|
|
638
800
|
binding(id) {
|
|
639
801
|
const binding = this.#all.get(id);
|
|
640
802
|
const life = this.#lifecycles.get(id);
|
|
641
|
-
return binding && life &&
|
|
803
|
+
return binding && life && b2(life, { $: "Inspect" }).command.$ === "Granted" ? binding : void 0;
|
|
642
804
|
}
|
|
643
805
|
has(name) {
|
|
644
806
|
return this.#current.has(name);
|
|
@@ -804,7 +966,7 @@ var FabricProviderBindings = class {
|
|
|
804
966
|
const binding = this.#all.get(id);
|
|
805
967
|
if (!binding) return;
|
|
806
968
|
binding.closeError = error instanceof Error ? error.message : String(error);
|
|
807
|
-
this.#step(binding, { $: "
|
|
969
|
+
this.#step(binding, { $: "Abort" });
|
|
808
970
|
this.revoke(id);
|
|
809
971
|
}
|
|
810
972
|
/** Hold the real operation, not the caller's cancellation race. */
|
|
@@ -871,7 +1033,7 @@ var FabricProviderBindings = class {
|
|
|
871
1033
|
}
|
|
872
1034
|
async #maybeClose(binding) {
|
|
873
1035
|
if (binding.closeTask) return binding.closeTask;
|
|
874
|
-
if (this.#step(binding, { $: "
|
|
1036
|
+
if (this.#step(binding, { $: "Shut" }) !== "StartClose") return;
|
|
875
1037
|
binding.closeTask = Promise.resolve().then(async () => {
|
|
876
1038
|
try {
|
|
877
1039
|
const unsubscribe = binding.unsubscribeCatalog;
|
|
@@ -896,7 +1058,7 @@ var FabricProviderBindings = class {
|
|
|
896
1058
|
}
|
|
897
1059
|
#canBegin(id, cleanup) {
|
|
898
1060
|
const life = this.#lifecycles.get(id);
|
|
899
|
-
return !!life && life.calls < BigInt(BEND_NAT_MAX) &&
|
|
1061
|
+
return !!life && life.calls < BigInt(BEND_NAT_MAX) && b2(life, { $: "Begin", cleanup }).command.$ === "Granted";
|
|
900
1062
|
}
|
|
901
1063
|
#step(binding, event) {
|
|
902
1064
|
const life = this.#lifecycles.get(binding.id);
|
|
@@ -904,7 +1066,7 @@ var FabricProviderBindings = class {
|
|
|
904
1066
|
if (event.$ === "Begin" && life.calls >= BigInt(BEND_NAT_MAX) || event.$ === "Retain" && life.holds >= BigInt(BEND_NAT_MAX)) {
|
|
905
1067
|
throw new Error("Provider lifecycle accounting overflow");
|
|
906
1068
|
}
|
|
907
|
-
const outcome =
|
|
1069
|
+
const outcome = b2(life, event);
|
|
908
1070
|
if (outcome.next.holds > BigInt(BEND_NAT_MAX) || outcome.next.calls > BigInt(BEND_NAT_MAX)) {
|
|
909
1071
|
throw new Error("Provider lifecycle accounting overflow");
|
|
910
1072
|
}
|
|
@@ -2101,4 +2263,4 @@ export {
|
|
|
2101
2263
|
scoreActionSearch,
|
|
2102
2264
|
ActionRegistry
|
|
2103
2265
|
};
|
|
2104
|
-
//# sourceMappingURL=chunk-
|
|
2266
|
+
//# sourceMappingURL=chunk-UGMLWBVF.js.map
|