@e4779/pi-fabric 0.116.0-fork.25 → 0.117.2-fork.28
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 +2 -2
- package/dist/agents.js +3 -3
- package/dist/chunks/{chunk-HZGQ7XYM.js → chunk-3FJUP3GV.js} +2 -2
- package/dist/chunks/{chunk-U2UBUKNQ.js → chunk-3UGN25XS.js} +2 -2
- package/dist/chunks/{chunk-HITKWKYD.js → chunk-4EW7GVUR.js} +192 -326
- package/dist/chunks/chunk-4EW7GVUR.js.map +7 -0
- package/dist/chunks/{chunk-VR2LV4CA.js → chunk-53N2I4QA.js} +2 -2
- package/dist/chunks/{chunk-IQXNJNDI.js → chunk-5UBRGTVN.js} +8 -8
- package/dist/chunks/{chunk-4GNFBZPR.js → chunk-ASSLHWZS.js} +2 -2
- package/dist/chunks/{chunk-DLXPTBPL.js → chunk-AV36PBKH.js} +9 -1
- package/dist/chunks/chunk-AV36PBKH.js.map +7 -0
- package/dist/chunks/chunk-BN7F52EG.js +525 -0
- package/dist/chunks/chunk-BN7F52EG.js.map +7 -0
- package/dist/chunks/{chunk-QGP7AY2R.js → chunk-C7Z6F3SO.js} +2 -2
- package/dist/chunks/{chunk-56RFFBBO.js → chunk-CRRUW26I.js} +12 -12
- package/dist/chunks/{chunk-I2TK65VR.js → chunk-D5NYNIST.js} +5 -5
- package/dist/chunks/{chunk-KBYSGB7E.js → chunk-EFETPXU2.js} +69 -229
- package/dist/chunks/chunk-EFETPXU2.js.map +7 -0
- package/dist/chunks/{chunk-QQ7D6UAM.js → chunk-EHQQ4KCX.js} +2 -2
- package/dist/chunks/{chunk-7EYJE4TW.js → chunk-EKODKR6Y.js} +55 -6
- package/dist/chunks/chunk-EKODKR6Y.js.map +7 -0
- package/dist/chunks/{chunk-H3SGA7G7.js → chunk-FIDUHKMM.js} +5 -5
- package/dist/chunks/{chunk-4GGBND7V.js → chunk-FSYAGCGA.js} +2 -2
- package/dist/chunks/{chunk-ZPI4QTOX.js → chunk-FUY6XVRX.js} +2 -2
- package/dist/chunks/{chunk-A5XF3ZPJ.js → chunk-G4TLWHRS.js} +2 -2
- package/dist/chunks/{chunk-PTZ5DKAB.js → chunk-G54PEZ44.js} +4 -3
- package/dist/chunks/chunk-G54PEZ44.js.map +7 -0
- package/dist/chunks/{chunk-7C5IEIQK.js → chunk-GEQMQVNS.js} +2 -2
- package/dist/chunks/{chunk-DONS3EZH.js → chunk-GIK2WNAK.js} +2 -2
- package/dist/chunks/{chunk-MOJBW5X2.js → chunk-GO32KSEZ.js} +5 -3
- package/dist/chunks/chunk-GO32KSEZ.js.map +7 -0
- package/dist/chunks/{chunk-HQ5YW2OJ.js → chunk-HP5P7NBO.js} +2 -2
- package/dist/chunks/{chunk-R2MMPHR2.js → chunk-INRXG4J5.js} +2 -2
- package/dist/chunks/{chunk-BQWJ5ZR7.js → chunk-K7J2ABAZ.js} +3 -3
- package/dist/chunks/{chunk-OTHMEDN6.js → chunk-KVYNGDGC.js} +6 -6
- package/dist/chunks/{chunk-6EVAHJAR.js → chunk-LEU5CDSL.js} +3 -3
- package/dist/chunks/{chunk-HCNHKJDA.js → chunk-MLLYR3Y6.js} +2 -2
- package/dist/chunks/{chunk-D3W6CBJZ.js → chunk-MZUC6LLH.js} +4 -4
- package/dist/chunks/{chunk-D3IONBBJ.js → chunk-P7CBPPHY.js} +5 -5
- package/dist/chunks/{chunk-WQ6LC2KK.js → chunk-QT4W5YVB.js} +2 -2
- package/dist/chunks/{chunk-TNPZBMYC.js → chunk-ROTCDDOV.js} +4 -4
- package/dist/chunks/{chunk-PH4PT6R4.js → chunk-TIIIHPHF.js} +2 -2
- package/dist/chunks/{chunk-2YG4ZA2K.js → chunk-TIJ3YQXX.js} +2 -2
- package/dist/chunks/{chunk-QCCPR3U5.js → chunk-UOM37PE4.js} +4 -4
- package/dist/chunks/{chunk-EQYQICUY.js → chunk-UXIBKMUM.js} +3 -3
- package/dist/chunks/{chunk-V2IV4LYW.js → chunk-XWWV6TKV.js} +3 -3
- package/dist/chunks/{chunk-O7IREHJI.js → chunk-YKYWY722.js} +318 -39
- package/dist/chunks/chunk-YKYWY722.js.map +7 -0
- package/dist/chunks/{chunk-JV4JR6TT.js → chunk-ZEXCKK4K.js} +3 -3
- package/dist/chunks/{chunk-ODYU3IJU.js → chunk-ZPPNWB64.js} +4 -4
- package/dist/cli/decisions.js +1 -1
- package/dist/cli/mesh.js +2 -2
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/compaction/hook.js +6 -6
- package/dist/compaction/owner.js +7 -7
- package/dist/components/configuration.js +4 -4
- package/dist/core/action-registry.js +6 -6
- package/dist/core/provider-operations.js +53 -154
- package/dist/core/provider-operations.js.map +2 -2
- package/dist/durable.js +2 -2
- package/dist/durable.js.map +1 -1
- package/dist/entropy/index.js +8 -8
- package/dist/extension-bootstrap.js +16 -16
- package/dist/fabric-runtime-state.js +42 -42
- package/dist/index.js +20 -20
- package/dist/jev/client.js +3 -3
- package/dist/jev/decision-types.d.ts +16 -0
- package/dist/jev/decision-types.d.ts.map +1 -1
- package/dist/jev/guest-types.d.ts +1 -1
- package/dist/jev/guest-types.d.ts.map +1 -1
- package/dist/jev/observation.js +7 -7
- package/dist/jev/routes.d.ts +1 -1
- package/dist/jev/routes.d.ts.map +1 -1
- package/dist/jev.js +12 -12
- 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/providers/jev-provider.js +12 -12
- package/dist/providers/memory-provider.js +9 -9
- package/dist/residency/host.js +12 -12
- package/dist/residency/pi-entry.js +12 -12
- 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 +3 -3
- package/dist/runtime/typescript-kernel.js +2 -2
- package/dist/type-error-guidance.js +1 -1
- package/dist/ui/controller.d.ts +2 -0
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation.js +1 -1
- package/dist/ui/dashboard-detail.d.ts.map +1 -1
- package/dist/ui/dashboard.js +6 -5
- package/dist/ui/dashboard.js.map +2 -2
- package/dist/ui/settings.js +3 -3
- package/dist/ui/transcript-parser.d.ts.map +1 -1
- package/dist/ui/transcript-reader.d.ts +1 -0
- package/dist/ui/transcript-reader.d.ts.map +1 -1
- package/dist/ui/transcript-sanitization.d.ts +2 -0
- package/dist/ui/transcript-sanitization.d.ts.map +1 -1
- package/dist/ui/transcript.d.ts +1 -1
- package/dist/ui/transcript.d.ts.map +1 -1
- package/dist/ui/widget-activity.d.ts +21 -0
- package/dist/ui/widget-activity.d.ts.map +1 -0
- package/dist/ui/widget.d.ts +40 -3
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/verified/generated/authority-kernel.d.ts +1 -1
- package/dist/verified/generated/authority-kernel.js +61 -157
- package/dist/verified/generated/kernel.d.ts +8 -8
- package/dist/verified/generated/kernel.js +205 -449
- package/dist/verified/generated/lifecycle-kernel.d.ts +1 -1
- package/dist/verified/generated/lifecycle-kernel.js +95 -133
- package/dist/verified/generated/manifest.json +18 -18
- package/dist/verified/generated/provider-kernel.d.ts +1 -1
- package/dist/verified/generated/provider-kernel.js +48 -149
- package/dist/verified/generated/storage-kernel.d.ts +2 -2
- package/dist/verified/generated/storage-kernel.js +59 -219
- package/dist/verified/nat.d.ts.map +1 -1
- package/dist/verified/policy.d.ts.map +1 -1
- package/docs/configuration.md +1 -1
- package/docs/durable-pi.md +2 -2
- package/docs/interface.md +4 -0
- package/docs/jev.md +2 -2
- package/docs/provider-capabilities.md +1 -1
- package/docs/verified-kernels.md +4 -3
- package/package.json +9 -9
- package/proofs/abi.json +11 -11
- package/proofs/authority-types.d.ts +1 -1
- package/proofs/lifecycle-types.d.ts +1 -1
- package/proofs/provider-types.d.ts +1 -1
- package/proofs/storage-types.d.ts +2 -2
- package/proofs/types.d.ts +4 -4
- package/scripts/test-verified-kernels.mjs +1 -1
- package/scripts/verified-kernels.mjs +1 -1
- package/dist/chunks/chunk-7EYJE4TW.js.map +0 -7
- package/dist/chunks/chunk-DLXPTBPL.js.map +0 -7
- package/dist/chunks/chunk-HITKWKYD.js.map +0 -7
- package/dist/chunks/chunk-KBYSGB7E.js.map +0 -7
- package/dist/chunks/chunk-MOJBW5X2.js.map +0 -7
- package/dist/chunks/chunk-O7IREHJI.js.map +0 -7
- package/dist/chunks/chunk-PTZ5DKAB.js.map +0 -7
- package/dist/chunks/chunk-WTLH5RY4.js +0 -760
- package/dist/chunks/chunk-WTLH5RY4.js.map +0 -7
- /package/dist/chunks/{chunk-HZGQ7XYM.js.map → chunk-3FJUP3GV.js.map} +0 -0
- /package/dist/chunks/{chunk-U2UBUKNQ.js.map → chunk-3UGN25XS.js.map} +0 -0
- /package/dist/chunks/{chunk-VR2LV4CA.js.map → chunk-53N2I4QA.js.map} +0 -0
- /package/dist/chunks/{chunk-IQXNJNDI.js.map → chunk-5UBRGTVN.js.map} +0 -0
- /package/dist/chunks/{chunk-4GNFBZPR.js.map → chunk-ASSLHWZS.js.map} +0 -0
- /package/dist/chunks/{chunk-QGP7AY2R.js.map → chunk-C7Z6F3SO.js.map} +0 -0
- /package/dist/chunks/{chunk-56RFFBBO.js.map → chunk-CRRUW26I.js.map} +0 -0
- /package/dist/chunks/{chunk-I2TK65VR.js.map → chunk-D5NYNIST.js.map} +0 -0
- /package/dist/chunks/{chunk-QQ7D6UAM.js.map → chunk-EHQQ4KCX.js.map} +0 -0
- /package/dist/chunks/{chunk-H3SGA7G7.js.map → chunk-FIDUHKMM.js.map} +0 -0
- /package/dist/chunks/{chunk-4GGBND7V.js.map → chunk-FSYAGCGA.js.map} +0 -0
- /package/dist/chunks/{chunk-ZPI4QTOX.js.map → chunk-FUY6XVRX.js.map} +0 -0
- /package/dist/chunks/{chunk-A5XF3ZPJ.js.map → chunk-G4TLWHRS.js.map} +0 -0
- /package/dist/chunks/{chunk-7C5IEIQK.js.map → chunk-GEQMQVNS.js.map} +0 -0
- /package/dist/chunks/{chunk-DONS3EZH.js.map → chunk-GIK2WNAK.js.map} +0 -0
- /package/dist/chunks/{chunk-HQ5YW2OJ.js.map → chunk-HP5P7NBO.js.map} +0 -0
- /package/dist/chunks/{chunk-R2MMPHR2.js.map → chunk-INRXG4J5.js.map} +0 -0
- /package/dist/chunks/{chunk-BQWJ5ZR7.js.map → chunk-K7J2ABAZ.js.map} +0 -0
- /package/dist/chunks/{chunk-OTHMEDN6.js.map → chunk-KVYNGDGC.js.map} +0 -0
- /package/dist/chunks/{chunk-6EVAHJAR.js.map → chunk-LEU5CDSL.js.map} +0 -0
- /package/dist/chunks/{chunk-HCNHKJDA.js.map → chunk-MLLYR3Y6.js.map} +0 -0
- /package/dist/chunks/{chunk-D3W6CBJZ.js.map → chunk-MZUC6LLH.js.map} +0 -0
- /package/dist/chunks/{chunk-D3IONBBJ.js.map → chunk-P7CBPPHY.js.map} +0 -0
- /package/dist/chunks/{chunk-WQ6LC2KK.js.map → chunk-QT4W5YVB.js.map} +0 -0
- /package/dist/chunks/{chunk-TNPZBMYC.js.map → chunk-ROTCDDOV.js.map} +0 -0
- /package/dist/chunks/{chunk-PH4PT6R4.js.map → chunk-TIIIHPHF.js.map} +0 -0
- /package/dist/chunks/{chunk-2YG4ZA2K.js.map → chunk-TIJ3YQXX.js.map} +0 -0
- /package/dist/chunks/{chunk-QCCPR3U5.js.map → chunk-UOM37PE4.js.map} +0 -0
- /package/dist/chunks/{chunk-EQYQICUY.js.map → chunk-UXIBKMUM.js.map} +0 -0
- /package/dist/chunks/{chunk-V2IV4LYW.js.map → chunk-XWWV6TKV.js.map} +0 -0
- /package/dist/chunks/{chunk-JV4JR6TT.js.map → chunk-ZEXCKK4K.js.map} +0 -0
- /package/dist/chunks/{chunk-ODYU3IJU.js.map → chunk-ZPPNWB64.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
strictDecisionResult,
|
|
17
17
|
validateCatalogArgs,
|
|
18
18
|
validationMessage
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-G4TLWHRS.js";
|
|
20
20
|
import {
|
|
21
21
|
runAbortable,
|
|
22
22
|
settleWithin,
|
|
@@ -30,249 +30,153 @@ import {
|
|
|
30
30
|
getActiveRepairCompiler,
|
|
31
31
|
isActiveQuarantine,
|
|
32
32
|
normalizeActiveArguments
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-53N2I4QA.js";
|
|
34
34
|
import {
|
|
35
35
|
FabricResolutionError,
|
|
36
36
|
FabricTraceSafeError,
|
|
37
37
|
executionOutcomeFromError
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-MLLYR3Y6.js";
|
|
39
39
|
import {
|
|
40
40
|
stableJsonHash
|
|
41
41
|
} from "./chunk-3YZUQESG.js";
|
|
42
42
|
import {
|
|
43
|
+
Ae,
|
|
43
44
|
BEND_NAT_MAX,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_t,
|
|
45
|
+
Xe,
|
|
46
|
+
_n,
|
|
47
47
|
boundedEffectResources,
|
|
48
48
|
encodeResourceEffects,
|
|
49
|
-
|
|
50
|
-
} from "./chunk-
|
|
49
|
+
nn
|
|
50
|
+
} from "./chunk-BN7F52EG.js";
|
|
51
51
|
|
|
52
52
|
// src/verified/generated/authority-kernel.js
|
|
53
|
-
function
|
|
53
|
+
function d(t, e) {
|
|
54
54
|
return { $: t < e ? "LT" : t === e ? "EQ" : "GT" };
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
return (typeof t == "bigint" || Number.isInteger(t)) && t >= 0 && t <= 2 ** 53 ? Number(t) : { [Symbol.toPrimitive]() {
|
|
58
|
-
throw "bend: a Nat past the largest immediate 2^48-1";
|
|
59
|
-
} };
|
|
60
|
-
}
|
|
61
|
-
function f(t) {
|
|
56
|
+
function v(t) {
|
|
62
57
|
for (; t !== null && typeof t == "object" && t.$ === "$JMP"; )
|
|
63
58
|
t = t.f(t.x);
|
|
64
59
|
return t;
|
|
65
60
|
}
|
|
66
|
-
function
|
|
67
|
-
return (...r) => r.length < e ?
|
|
61
|
+
function l(t, e) {
|
|
62
|
+
return (...r) => r.length < e ? l((...u2) => t(...r, ...u2), e - r.length) : v(t(...r));
|
|
68
63
|
}
|
|
69
|
-
function
|
|
64
|
+
function g(t, e, r) {
|
|
70
65
|
for (; ; ) {
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
66
|
+
let u2 = t, n = e, o = r;
|
|
67
|
+
if (u2.$ === "Nil")
|
|
68
|
+
return n.$ === "Nil" ? o : false;
|
|
74
69
|
{
|
|
75
|
-
let
|
|
76
|
-
if (
|
|
70
|
+
let a2 = u2.head, s = u2.tail;
|
|
71
|
+
if (n.$ === "Nil")
|
|
77
72
|
return false;
|
|
78
73
|
{
|
|
79
|
-
let
|
|
80
|
-
t =
|
|
74
|
+
let c = n.head, _ = n.tail;
|
|
75
|
+
t = s, e = _, r = f(o, L(a2, c));
|
|
81
76
|
continue;
|
|
82
77
|
}
|
|
83
78
|
}
|
|
84
79
|
}
|
|
85
80
|
}
|
|
86
|
-
function
|
|
81
|
+
function y(t, e, r) {
|
|
87
82
|
for (; ; ) {
|
|
88
|
-
let
|
|
89
|
-
if (
|
|
90
|
-
return
|
|
83
|
+
let u2 = t, n = e, o = r;
|
|
84
|
+
if (u2.$ === "Nil")
|
|
85
|
+
return o;
|
|
91
86
|
{
|
|
92
|
-
let
|
|
93
|
-
t =
|
|
87
|
+
let a2 = u2.head, s = u2.tail, c = g(n, a2, true);
|
|
88
|
+
t = s, e = n, r = o || c;
|
|
94
89
|
continue;
|
|
95
90
|
}
|
|
96
91
|
}
|
|
97
92
|
}
|
|
98
|
-
function
|
|
93
|
+
function p(t, e, r) {
|
|
99
94
|
for (; ; ) {
|
|
100
|
-
let
|
|
101
|
-
if (
|
|
102
|
-
return
|
|
95
|
+
let u2 = t, n = e, o = r;
|
|
96
|
+
if (u2.$ === "Nil")
|
|
97
|
+
return o;
|
|
103
98
|
{
|
|
104
|
-
let
|
|
105
|
-
t =
|
|
99
|
+
let a2 = u2.head;
|
|
100
|
+
t = u2.tail, e = n, r = f(o, y(n, a2, false));
|
|
106
101
|
continue;
|
|
107
102
|
}
|
|
108
103
|
}
|
|
109
104
|
}
|
|
110
|
-
function
|
|
105
|
+
function R(t) {
|
|
111
106
|
return { $: "authority-state.Active", grants: t };
|
|
112
107
|
}
|
|
113
|
-
function
|
|
108
|
+
function b(t) {
|
|
114
109
|
return t.$ !== "authority-state.Released";
|
|
115
110
|
}
|
|
116
|
-
function
|
|
111
|
+
function w(t, e) {
|
|
117
112
|
if (t.$ === "authority-state.Released")
|
|
118
113
|
return false;
|
|
119
114
|
{
|
|
120
115
|
let r = t.grants;
|
|
121
|
-
return
|
|
116
|
+
return y(r, e, false);
|
|
122
117
|
}
|
|
123
118
|
}
|
|
124
|
-
function
|
|
119
|
+
function A(t, e) {
|
|
125
120
|
return t ? { $: "authority-state.Active", grants: e } : { $: "authority-state.Released" };
|
|
126
121
|
}
|
|
127
|
-
function
|
|
122
|
+
function x(t, e) {
|
|
128
123
|
if (t.$ === "authority-state.Released")
|
|
129
124
|
return { $: "authority-state.Released" };
|
|
130
125
|
{
|
|
131
126
|
let r = t.grants;
|
|
132
|
-
return
|
|
127
|
+
return A(p(e, r, true), e);
|
|
133
128
|
}
|
|
134
129
|
}
|
|
135
|
-
function
|
|
130
|
+
function k(t) {
|
|
136
131
|
return { $: "authority-state.Released" };
|
|
137
132
|
}
|
|
138
|
-
function
|
|
139
|
-
return
|
|
133
|
+
function E(t) {
|
|
134
|
+
return R(t);
|
|
140
135
|
}
|
|
141
|
-
function
|
|
142
|
-
return
|
|
136
|
+
function m(t) {
|
|
137
|
+
return b(t);
|
|
143
138
|
}
|
|
144
|
-
function
|
|
145
|
-
return
|
|
139
|
+
function N(t, e) {
|
|
140
|
+
return w(t, e);
|
|
146
141
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
142
|
+
function Q(t, e) {
|
|
143
|
+
return x(t, e);
|
|
149
144
|
}
|
|
150
|
-
function
|
|
151
|
-
return
|
|
145
|
+
function q(t) {
|
|
146
|
+
return k(t);
|
|
152
147
|
}
|
|
153
|
-
function
|
|
148
|
+
function f(t, e) {
|
|
154
149
|
return t ? e : false;
|
|
155
150
|
}
|
|
156
|
-
function
|
|
157
|
-
return
|
|
151
|
+
function L(t, e) {
|
|
152
|
+
return U(d(t, e));
|
|
158
153
|
}
|
|
159
|
-
function
|
|
154
|
+
function U(t) {
|
|
160
155
|
return t.$ === "EQ";
|
|
161
156
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
switch (t.$) {
|
|
166
|
-
case "Nil":
|
|
167
|
-
return r[a2] = t, e[0];
|
|
168
|
-
case "Con":
|
|
169
|
-
r = r[a2] = { ...t, head: N(t.head) }, a2 = "tail", t = t[a2];
|
|
170
|
-
continue;
|
|
171
|
-
default:
|
|
172
|
-
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)";
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function p(t) {
|
|
176
|
-
let e = [t];
|
|
177
|
-
for (let r = e, a2 = 0; ; )
|
|
178
|
-
switch (t.$) {
|
|
179
|
-
case "Nil":
|
|
180
|
-
return r[a2] = t, e[0];
|
|
181
|
-
case "Con":
|
|
182
|
-
r = r[a2] = { ...t, head: BigInt(t.head) }, a2 = "tail", t = t[a2];
|
|
183
|
-
continue;
|
|
184
|
-
default:
|
|
185
|
-
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)";
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function g(t) {
|
|
189
|
-
let e = [t];
|
|
190
|
-
for (let r = e, a2 = 0; ; )
|
|
191
|
-
switch (t.$) {
|
|
192
|
-
case "Nil":
|
|
193
|
-
return r[a2] = t, e[0];
|
|
194
|
-
case "Con":
|
|
195
|
-
r = r[a2] = { ...t, head: b(t.head) }, a2 = "tail", t = t[a2];
|
|
196
|
-
continue;
|
|
197
|
-
default:
|
|
198
|
-
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)";
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
function w(t) {
|
|
202
|
-
let e = [t];
|
|
203
|
-
for (let r = e, a2 = 0; ; )
|
|
204
|
-
switch (t.$) {
|
|
205
|
-
case "Nil":
|
|
206
|
-
return r[a2] = t, e[0];
|
|
207
|
-
case "Con":
|
|
208
|
-
r = r[a2] = { ...t, head: p(t.head) }, a2 = "tail", t = t[a2];
|
|
209
|
-
continue;
|
|
210
|
-
default:
|
|
211
|
-
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)";
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
function l(t) {
|
|
215
|
-
let e = [t];
|
|
216
|
-
for (let r = e, a2 = 0; ; )
|
|
217
|
-
switch (t.$) {
|
|
218
|
-
case "authority-state.Released":
|
|
219
|
-
return r[a2] = t, e[0];
|
|
220
|
-
case "authority-state.Active":
|
|
221
|
-
return r = r[a2] = { ...t, grants: w(t.grants) }, e[0];
|
|
222
|
-
default:
|
|
223
|
-
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)";
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
function d(t) {
|
|
227
|
-
let e = [t];
|
|
228
|
-
for (let r = e, a2 = 0; ; )
|
|
229
|
-
switch (t.$) {
|
|
230
|
-
case "authority-state.Released":
|
|
231
|
-
return r[a2] = t, e[0];
|
|
232
|
-
case "authority-state.Active":
|
|
233
|
-
return r = r[a2] = { ...t, grants: g(t.grants) }, e[0];
|
|
234
|
-
default:
|
|
235
|
-
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)";
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
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"]]);
|
|
239
|
-
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"]]);
|
|
240
|
-
function s(t, e) {
|
|
157
|
+
var $ = /* @__PURE__ */ new Map([["Unknown", "resources.Unknown"], ["Exact", "resources.Exact"], ["Quiet", "resources.Quiet"], ["Active", "authority-state.Active"], ["Released", "authority-state.Released"]]);
|
|
158
|
+
var h = /* @__PURE__ */ new Map([["resources.Unknown", "Unknown"], ["resources.Exact", "Exact"], ["resources.Quiet", "Quiet"], ["authority-state.Active", "Active"], ["authority-state.Released", "Released"]]);
|
|
159
|
+
function i(t, e) {
|
|
241
160
|
let r = [t];
|
|
242
|
-
for (let
|
|
243
|
-
let [
|
|
244
|
-
if (
|
|
245
|
-
let
|
|
246
|
-
typeof
|
|
247
|
-
for (let
|
|
161
|
+
for (let u2 = [[r, 0]]; u2.length > 0; ) {
|
|
162
|
+
let [n, o] = u2.pop(), a2 = n[o];
|
|
163
|
+
if (a2 === null || typeof a2 != "object") continue;
|
|
164
|
+
let s = Array.isArray(a2) ? [...a2] : { ...a2 };
|
|
165
|
+
typeof s.$ == "string" && (s.$ = e.get(s.$) ?? s.$), n[o] = s;
|
|
166
|
+
for (let c of Object.keys(s)) u2.push([s, c]);
|
|
248
167
|
}
|
|
249
168
|
return r[0];
|
|
250
169
|
}
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
var
|
|
256
|
-
var
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
var
|
|
261
|
-
var z = /* @__PURE__ */ c((t, e) => {
|
|
262
|
-
let r = f(D(d(t), b(e)));
|
|
263
|
-
return l(t), p(e), r;
|
|
264
|
-
}, 2);
|
|
265
|
-
var F = (t, e) => s(z(s(t, h), s(e, h)), y);
|
|
266
|
-
var H = /* @__PURE__ */ c((t, e) => {
|
|
267
|
-
let r = l(f(M(d(t), g(e))));
|
|
268
|
-
return l(t), w(e), r;
|
|
269
|
-
}, 2);
|
|
270
|
-
var K = (t, e) => s(H(s(t, h), s(e, h)), y);
|
|
271
|
-
var V = /* @__PURE__ */ c((t) => {
|
|
272
|
-
let e = l(f(B(d(t))));
|
|
273
|
-
return l(t), e;
|
|
274
|
-
}, 1);
|
|
275
|
-
var W = (t) => s(V(s(t, h)), y);
|
|
170
|
+
var j = /* @__PURE__ */ l((t) => E(t), 1);
|
|
171
|
+
var D = (t) => i(j(i(t, $)), h);
|
|
172
|
+
var I = /* @__PURE__ */ l((t) => m(t), 1);
|
|
173
|
+
var M = (t) => i(I(i(t, $)), h);
|
|
174
|
+
var T = /* @__PURE__ */ l((t, e) => N(t, e), 2);
|
|
175
|
+
var B = (t, e) => i(T(i(t, $), i(e, $)), h);
|
|
176
|
+
var C = /* @__PURE__ */ l((t, e) => Q(t, e), 2);
|
|
177
|
+
var G = (t, e) => i(C(i(t, $), i(e, $)), h);
|
|
178
|
+
var J = /* @__PURE__ */ l((t) => q(t), 1);
|
|
179
|
+
var O = (t) => i(J(i(t, $)), h);
|
|
276
180
|
|
|
277
181
|
// src/verified/authority.ts
|
|
278
182
|
var encodeGrant = (grant) => {
|
|
@@ -284,15 +188,15 @@ var encodeGrant = (grant) => {
|
|
|
284
188
|
grant.descriptorHash
|
|
285
189
|
]);
|
|
286
190
|
let encoded = { $: "Nil" };
|
|
287
|
-
for (let
|
|
288
|
-
encoded = { $: "Con", head:
|
|
191
|
+
for (let i3 = text.length - 1; i3 >= 0; i3--) {
|
|
192
|
+
encoded = { $: "Con", head: text.charCodeAt(i3), tail: encoded };
|
|
289
193
|
}
|
|
290
194
|
return encoded;
|
|
291
195
|
};
|
|
292
196
|
var encodeGrants = (grants) => {
|
|
293
197
|
let encoded = { $: "Nil" };
|
|
294
|
-
for (let
|
|
295
|
-
encoded = { $: "Con", head: encodeGrant(grants[
|
|
198
|
+
for (let i3 = grants.length - 1; i3 >= 0; i3--) {
|
|
199
|
+
encoded = { $: "Con", head: encodeGrant(grants[i3]), tail: encoded };
|
|
296
200
|
}
|
|
297
201
|
return encoded;
|
|
298
202
|
};
|
|
@@ -303,7 +207,7 @@ var CapabilityAuthority = class _CapabilityAuthority {
|
|
|
303
207
|
const canonical = grants.map((grant) => Object.freeze({ ...grant }));
|
|
304
208
|
this.#grants = new Map(canonical.map((grant) => [grant.ref, grant]));
|
|
305
209
|
const encoded = encodeGrants(canonical);
|
|
306
|
-
this.#state = parent ?
|
|
210
|
+
this.#state = parent ? G(parent.#state, encoded) : D(encoded);
|
|
307
211
|
}
|
|
308
212
|
static issue(grants) {
|
|
309
213
|
return new _CapabilityAuthority(grants);
|
|
@@ -312,14 +216,14 @@ var CapabilityAuthority = class _CapabilityAuthority {
|
|
|
312
216
|
return new _CapabilityAuthority(grants, this);
|
|
313
217
|
}
|
|
314
218
|
get active() {
|
|
315
|
-
return
|
|
219
|
+
return M(this.#state);
|
|
316
220
|
}
|
|
317
221
|
release() {
|
|
318
|
-
this.#state =
|
|
222
|
+
this.#state = O(this.#state);
|
|
319
223
|
}
|
|
320
224
|
resolve(ref) {
|
|
321
225
|
const grant = this.#grants.get(ref);
|
|
322
|
-
return grant &&
|
|
226
|
+
return grant && B(this.#state, encodeGrant(grant)) ? { ...grant } : void 0;
|
|
323
227
|
}
|
|
324
228
|
bindings() {
|
|
325
229
|
return this.active ? [...this.#grants.values()].map((grant) => ({ ...grant })) : [];
|
|
@@ -389,9 +293,9 @@ var summarizeEffects = (effects) => {
|
|
|
389
293
|
};
|
|
390
294
|
};
|
|
391
295
|
var effectConflictsBetween = (left, right) => {
|
|
392
|
-
if (!
|
|
296
|
+
if (!_n(left.declarations, right.declarations)) return [];
|
|
393
297
|
const conflicts = [];
|
|
394
|
-
if (
|
|
298
|
+
if (Ae(
|
|
395
299
|
left.hasUnknown,
|
|
396
300
|
left.hasUnknownNoncommutative,
|
|
397
301
|
left.hasNoncommutative,
|
|
@@ -402,7 +306,7 @@ var effectConflictsBetween = (left, right) => {
|
|
|
402
306
|
conflicts.push({ resources: ["*"], reason: "unknown_resource" });
|
|
403
307
|
}
|
|
404
308
|
const overlap = [...left.resourceNoncommutative.keys()].filter(
|
|
405
|
-
(resource) =>
|
|
309
|
+
(resource) => nn(
|
|
406
310
|
right.resourceNoncommutative.has(resource),
|
|
407
311
|
left.resourceNoncommutative.get(resource) ?? false,
|
|
408
312
|
right.resourceNoncommutative.get(resource) ?? false
|
|
@@ -468,13 +372,13 @@ var levenshtein = (left, right) => {
|
|
|
468
372
|
let previous = new Array(right.length + 1);
|
|
469
373
|
let current = new Array(right.length + 1);
|
|
470
374
|
for (let j2 = 0; j2 <= right.length; j2++) previous[j2] = j2;
|
|
471
|
-
for (let
|
|
472
|
-
current[0] =
|
|
375
|
+
for (let i3 = 1; i3 <= left.length; i3++) {
|
|
376
|
+
current[0] = i3;
|
|
473
377
|
for (let j2 = 1; j2 <= right.length; j2++) {
|
|
474
378
|
current[j2] = Math.min(
|
|
475
379
|
previous[j2] + 1,
|
|
476
380
|
current[j2 - 1] + 1,
|
|
477
|
-
previous[j2 - 1] + (left[
|
|
381
|
+
previous[j2 - 1] + (left[i3 - 1] === right[j2 - 1] ? 0 : 1)
|
|
478
382
|
);
|
|
479
383
|
}
|
|
480
384
|
const swap = previous;
|
|
@@ -569,204 +473,166 @@ var formatUnknownActionMessage = (ref, suggestions) => suggestions.length > 0 ?
|
|
|
569
473
|
import { randomUUID } from "node:crypto";
|
|
570
474
|
|
|
571
475
|
// src/verified/generated/lifecycle-kernel.js
|
|
572
|
-
function
|
|
476
|
+
function a(l2) {
|
|
573
477
|
if (l2 > 281474976710655)
|
|
574
478
|
throw "bend: a Nat past the largest immediate 2^48-1";
|
|
575
479
|
return l2;
|
|
576
480
|
}
|
|
577
|
-
function
|
|
578
|
-
return (typeof l2 == "bigint" || Number.isInteger(l2)) && l2 >= 0 && l2 <= 2 ** 53 ? Number(l2) : { [Symbol.toPrimitive]() {
|
|
579
|
-
throw "bend: a Nat past the largest immediate 2^48-1";
|
|
580
|
-
} };
|
|
581
|
-
}
|
|
582
|
-
function p2(l2) {
|
|
481
|
+
function u(l2) {
|
|
583
482
|
for (; l2 !== null && typeof l2 == "object" && l2.$ === "$JMP"; )
|
|
584
483
|
l2 = l2.f(l2.x);
|
|
585
484
|
return l2;
|
|
586
485
|
}
|
|
587
|
-
function
|
|
588
|
-
return (...
|
|
486
|
+
function y2(l2, e) {
|
|
487
|
+
return (...o) => o.length < e ? y2((...c) => l2(...o, ...c), e - o.length) : u(l2(...o));
|
|
589
488
|
}
|
|
590
|
-
function
|
|
489
|
+
function i2(l2, e, o) {
|
|
591
490
|
if (l2.$ === "lifecycle.Closing" || l2.$ === "lifecycle.Closed")
|
|
592
491
|
return false;
|
|
593
492
|
if (l2.$ === "lifecycle.Failed")
|
|
594
|
-
return
|
|
493
|
+
return o;
|
|
595
494
|
{
|
|
596
|
-
let
|
|
597
|
-
return
|
|
495
|
+
let c = O2(e);
|
|
496
|
+
return o || c;
|
|
598
497
|
}
|
|
599
498
|
}
|
|
600
|
-
function $(l2) {
|
|
499
|
+
function $2(l2) {
|
|
601
500
|
return l2.$ === "lifecycle.Staged" ? { $: "lifecycle.Retiring" } : l2.$ === "lifecycle.Active" ? { $: "lifecycle.Retiring" } : l2;
|
|
602
501
|
}
|
|
603
|
-
function
|
|
502
|
+
function m2(l2, e) {
|
|
604
503
|
if (l2) {
|
|
605
|
-
let
|
|
606
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
504
|
+
let o = e.phase, c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
505
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: a(t + 1), revoked: n }, command: { $: "lifecycle.Granted" } };
|
|
607
506
|
} else
|
|
608
507
|
return { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Denied" } };
|
|
609
508
|
}
|
|
610
|
-
function
|
|
509
|
+
function p2(l2, e) {
|
|
611
510
|
if (l2) {
|
|
612
|
-
let
|
|
613
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
511
|
+
let o = e.phase, c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
512
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: a(r + 1), calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
|
|
614
513
|
} else
|
|
615
514
|
return { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Denied" } };
|
|
616
515
|
}
|
|
617
|
-
function
|
|
516
|
+
function k2(l2, e) {
|
|
618
517
|
return l2 ? { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Granted" } } : { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Denied" } };
|
|
619
518
|
}
|
|
620
|
-
function
|
|
519
|
+
function v2(l2, e) {
|
|
621
520
|
if (l2.$ === "lifecycle.Inspect") {
|
|
622
|
-
let
|
|
623
|
-
return
|
|
521
|
+
let o = e.phase, c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
522
|
+
return k2(i2(o, n, false), { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: t, revoked: n });
|
|
624
523
|
} else if (l2.$ === "lifecycle.Activate") {
|
|
625
|
-
let
|
|
626
|
-
if (
|
|
627
|
-
let
|
|
628
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Active" }, owner:
|
|
629
|
-
} else if (
|
|
630
|
-
let
|
|
631
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Active" }, owner:
|
|
524
|
+
let o = e.phase;
|
|
525
|
+
if (o.$ === "lifecycle.Staged") {
|
|
526
|
+
let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
527
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Active" }, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
|
|
528
|
+
} else if (o.$ === "lifecycle.Active") {
|
|
529
|
+
let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
530
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Active" }, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
|
|
632
531
|
} else {
|
|
633
|
-
let
|
|
634
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
532
|
+
let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
533
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
|
|
635
534
|
}
|
|
636
535
|
} else if (l2.$ === "lifecycle.Retire") {
|
|
637
|
-
let
|
|
638
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: $(
|
|
536
|
+
let o = e.phase, c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
537
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: $2(o), owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
|
|
639
538
|
} else if (l2.$ === "lifecycle.DropOwner") {
|
|
640
|
-
let
|
|
641
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
539
|
+
let o = e.phase, c = e.holds, r = e.calls, t = e.revoked;
|
|
540
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: false, holds: c, calls: r, revoked: t }, command: { $: "lifecycle.Granted" } };
|
|
642
541
|
} else if (l2.$ === "lifecycle.Revoke") {
|
|
643
|
-
let
|
|
644
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: $(
|
|
542
|
+
let o = e.phase, c = e.holds, r = e.calls;
|
|
543
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: $2(o), owner: false, holds: c, calls: r, revoked: true }, command: { $: "lifecycle.Granted" } };
|
|
645
544
|
} else if (l2.$ === "lifecycle.Retain") {
|
|
646
|
-
let
|
|
647
|
-
return
|
|
545
|
+
let o = l2.cleanup, c = e.phase, r = e.owner, t = e.holds, n = e.calls, s = e.revoked;
|
|
546
|
+
return p2(i2(c, s, o), { $: "lifecycle.Life", phase: c, owner: r, holds: t, calls: n, revoked: s });
|
|
648
547
|
} else if (l2.$ === "lifecycle.Release") {
|
|
649
|
-
let
|
|
650
|
-
if (
|
|
651
|
-
let
|
|
652
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
548
|
+
let o = e.phase, c = e.owner, r = e.holds;
|
|
549
|
+
if (r === 0) {
|
|
550
|
+
let t = e.calls, n = e.revoked;
|
|
551
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: 0, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
|
|
653
552
|
} else {
|
|
654
|
-
let
|
|
655
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
553
|
+
let t = r - 1, n = e.calls, s = e.revoked;
|
|
554
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: t, calls: n, revoked: s }, command: { $: "lifecycle.Granted" } };
|
|
656
555
|
}
|
|
657
556
|
} else if (l2.$ === "lifecycle.Begin") {
|
|
658
|
-
let
|
|
659
|
-
return
|
|
557
|
+
let o = l2.cleanup, c = e.phase, r = e.owner, t = e.holds, n = e.calls, s = e.revoked;
|
|
558
|
+
return m2(i2(c, s, o), { $: "lifecycle.Life", phase: c, owner: r, holds: t, calls: n, revoked: s });
|
|
660
559
|
} else if (l2.$ === "lifecycle.End") {
|
|
661
|
-
let
|
|
662
|
-
if (
|
|
663
|
-
let
|
|
664
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
560
|
+
let o = e.phase, c = e.owner, r = e.holds, t = e.calls;
|
|
561
|
+
if (t === 0) {
|
|
562
|
+
let n = e.revoked;
|
|
563
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: 0, revoked: n }, command: { $: "lifecycle.Denied" } };
|
|
665
564
|
} else {
|
|
666
|
-
let
|
|
667
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
565
|
+
let n = t - 1, s = e.revoked;
|
|
566
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: n, revoked: s }, command: { $: "lifecycle.Granted" } };
|
|
668
567
|
}
|
|
669
568
|
} else if (l2.$ === "lifecycle.Shut") {
|
|
670
|
-
let
|
|
671
|
-
if (
|
|
672
|
-
let
|
|
673
|
-
if (
|
|
674
|
-
let
|
|
675
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner:
|
|
569
|
+
let o = e.phase;
|
|
570
|
+
if (o.$ === "lifecycle.Retiring") {
|
|
571
|
+
let c = e.owner;
|
|
572
|
+
if (c) {
|
|
573
|
+
let r = e.holds, t = e.calls, n = e.revoked;
|
|
574
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
|
|
676
575
|
} else {
|
|
677
|
-
let
|
|
678
|
-
if (
|
|
679
|
-
let
|
|
680
|
-
if (
|
|
681
|
-
let
|
|
682
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closing" }, owner: false, holds: 0, calls: 0, revoked:
|
|
576
|
+
let r = e.holds;
|
|
577
|
+
if (r === 0) {
|
|
578
|
+
let t = e.calls;
|
|
579
|
+
if (t === 0) {
|
|
580
|
+
let n = e.revoked;
|
|
581
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closing" }, owner: false, holds: 0, calls: 0, revoked: n }, command: { $: "lifecycle.StartClose" } };
|
|
683
582
|
} else {
|
|
684
|
-
let
|
|
685
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: false, holds: 0, calls:
|
|
583
|
+
let n = t - 0, s = e.revoked;
|
|
584
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: false, holds: 0, calls: n, revoked: s }, command: { $: "lifecycle.Denied" } };
|
|
686
585
|
}
|
|
687
586
|
} else {
|
|
688
|
-
let
|
|
689
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: false, holds:
|
|
587
|
+
let t = r - 0, n = e.calls, s = e.revoked;
|
|
588
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: false, holds: t, calls: n, revoked: s }, command: { $: "lifecycle.Denied" } };
|
|
690
589
|
}
|
|
691
590
|
}
|
|
692
591
|
} else {
|
|
693
|
-
let
|
|
694
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
592
|
+
let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
593
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
|
|
695
594
|
}
|
|
696
595
|
} else if (l2.$ === "lifecycle.Complete") {
|
|
697
|
-
let
|
|
698
|
-
if (
|
|
699
|
-
let
|
|
700
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closed" }, owner:
|
|
596
|
+
let o = e.phase;
|
|
597
|
+
if (o.$ === "lifecycle.Closing") {
|
|
598
|
+
let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
599
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closed" }, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
|
|
701
600
|
} else {
|
|
702
|
-
let
|
|
703
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase:
|
|
601
|
+
let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
|
|
602
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
|
|
704
603
|
}
|
|
705
604
|
} else if (e.phase.$ === "lifecycle.Closed") {
|
|
706
|
-
let
|
|
707
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closed" }, owner:
|
|
605
|
+
let o = e.owner, c = e.holds, r = e.calls, t = e.revoked;
|
|
606
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closed" }, owner: o, holds: c, calls: r, revoked: t }, command: { $: "lifecycle.Denied" } };
|
|
708
607
|
} else {
|
|
709
|
-
let
|
|
710
|
-
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Failed" }, owner: false, holds:
|
|
608
|
+
let o = e.holds, c = e.calls;
|
|
609
|
+
return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Failed" }, owner: false, holds: o, calls: c, revoked: true }, command: { $: "lifecycle.Granted" } };
|
|
711
610
|
}
|
|
712
611
|
}
|
|
713
|
-
function
|
|
714
|
-
return
|
|
612
|
+
function w2(l2, e) {
|
|
613
|
+
return v2(e, l2);
|
|
715
614
|
}
|
|
716
|
-
function
|
|
717
|
-
return
|
|
615
|
+
function g2(l2, e) {
|
|
616
|
+
return w2(l2, e);
|
|
718
617
|
}
|
|
719
|
-
function
|
|
618
|
+
function O2(l2) {
|
|
720
619
|
return !l2;
|
|
721
620
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
for (let c2 = e, o = 0; ; )
|
|
735
|
-
switch (l2.$) {
|
|
736
|
-
case "lifecycle.Life":
|
|
737
|
-
return c2 = c2[o] = { ...l2, holds: BigInt(l2.holds), calls: BigInt(l2.calls) }, e[0];
|
|
738
|
-
default:
|
|
739
|
-
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)";
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
function C2(l2) {
|
|
743
|
-
let e = [l2];
|
|
744
|
-
for (let c2 = e, o = 0; ; )
|
|
745
|
-
switch (l2.$) {
|
|
746
|
-
case "lifecycle.Outcome":
|
|
747
|
-
return c2 = c2[o] = { ...l2, next: h2(l2.next) }, e[0];
|
|
748
|
-
default:
|
|
749
|
-
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)";
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
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"]]);
|
|
753
|
-
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"]]);
|
|
754
|
-
function a(l2, e) {
|
|
755
|
-
let c2 = [l2];
|
|
756
|
-
for (let o = [[c2, 0]]; o.length > 0; ) {
|
|
757
|
-
let [n, r] = o.pop(), t = n[r];
|
|
758
|
-
if (t === null || typeof t != "object") continue;
|
|
759
|
-
let i = Array.isArray(t) ? [...t] : { ...t };
|
|
760
|
-
typeof i.$ == "string" && (i.$ = e.get(i.$) ?? i.$), n[r] = i;
|
|
761
|
-
for (let m2 of Object.keys(i)) o.push([i, m2]);
|
|
762
|
-
}
|
|
763
|
-
return c2[0];
|
|
621
|
+
var f2 = /* @__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"]]);
|
|
622
|
+
var R2 = /* @__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"]]);
|
|
623
|
+
function d2(l2, e) {
|
|
624
|
+
let o = [l2];
|
|
625
|
+
for (let c = [[o, 0]]; c.length > 0; ) {
|
|
626
|
+
let [r, t] = c.pop(), n = r[t];
|
|
627
|
+
if (n === null || typeof n != "object") continue;
|
|
628
|
+
let s = Array.isArray(n) ? [...n] : { ...n };
|
|
629
|
+
typeof s.$ == "string" && (s.$ = e.get(s.$) ?? s.$), r[t] = s;
|
|
630
|
+
for (let h2 of Object.keys(s)) c.push([s, h2]);
|
|
631
|
+
}
|
|
632
|
+
return o[0];
|
|
764
633
|
}
|
|
765
|
-
var
|
|
766
|
-
|
|
767
|
-
return h2(l2), c2;
|
|
768
|
-
}, 2);
|
|
769
|
-
var b2 = (l2, e) => a(S2(a(l2, u), a(e, u)), D2);
|
|
634
|
+
var x2 = /* @__PURE__ */ y2((l2, e) => g2(l2, e), 2);
|
|
635
|
+
var L2 = (l2, e) => d2(x2(d2(l2, f2), d2(e, f2)), R2);
|
|
770
636
|
|
|
771
637
|
// src/core/provider-bindings.ts
|
|
772
638
|
var snapshot = (binding) => ({
|
|
@@ -776,7 +642,7 @@ var snapshot = (binding) => ({
|
|
|
776
642
|
var useOnce = () => {
|
|
777
643
|
let active = true;
|
|
778
644
|
return () => {
|
|
779
|
-
const next =
|
|
645
|
+
const next = Xe(active);
|
|
780
646
|
active = next.snd;
|
|
781
647
|
return next.fst;
|
|
782
648
|
};
|
|
@@ -801,7 +667,7 @@ var FabricProviderBindings = class {
|
|
|
801
667
|
binding(id) {
|
|
802
668
|
const binding = this.#all.get(id);
|
|
803
669
|
const life = this.#lifecycles.get(id);
|
|
804
|
-
return binding && life &&
|
|
670
|
+
return binding && life && L2(life, { $: "Inspect" }).command.$ === "Granted" ? binding : void 0;
|
|
805
671
|
}
|
|
806
672
|
has(name) {
|
|
807
673
|
return this.#current.has(name);
|
|
@@ -842,7 +708,7 @@ var FabricProviderBindings = class {
|
|
|
842
708
|
);
|
|
843
709
|
}
|
|
844
710
|
this.#all.set(binding.id, binding);
|
|
845
|
-
this.#lifecycles.set(binding.id, { $: "Life", phase: { $: options.staged ? "Staged" : "Active" }, owner: true, holds:
|
|
711
|
+
this.#lifecycles.set(binding.id, { $: "Life", phase: { $: options.staged ? "Staged" : "Active" }, owner: true, holds: 0, calls: 0, revoked: false });
|
|
846
712
|
this.#signals.set(binding.id, new AbortController());
|
|
847
713
|
if (options.staged) {
|
|
848
714
|
this.#staged.set(binding.name, binding);
|
|
@@ -1069,16 +935,16 @@ var FabricProviderBindings = class {
|
|
|
1069
935
|
}
|
|
1070
936
|
#canBegin(id, cleanup) {
|
|
1071
937
|
const life = this.#lifecycles.get(id);
|
|
1072
|
-
return !!life && life.calls <
|
|
938
|
+
return !!life && life.calls < BEND_NAT_MAX && L2(life, { $: "Begin", cleanup }).command.$ === "Granted";
|
|
1073
939
|
}
|
|
1074
940
|
#step(binding, event) {
|
|
1075
941
|
const life = this.#lifecycles.get(binding.id);
|
|
1076
942
|
if (!life) return "Denied";
|
|
1077
|
-
if (event.$ === "Begin" && life.calls >=
|
|
943
|
+
if (event.$ === "Begin" && life.calls >= BEND_NAT_MAX || event.$ === "Retain" && life.holds >= BEND_NAT_MAX) {
|
|
1078
944
|
throw new Error("Provider lifecycle accounting overflow");
|
|
1079
945
|
}
|
|
1080
|
-
const outcome =
|
|
1081
|
-
if (outcome.next.holds >
|
|
946
|
+
const outcome = L2(life, event);
|
|
947
|
+
if (outcome.next.holds > BEND_NAT_MAX || outcome.next.calls > BEND_NAT_MAX) {
|
|
1082
948
|
throw new Error("Provider lifecycle accounting overflow");
|
|
1083
949
|
}
|
|
1084
950
|
this.#lifecycles.set(binding.id, outcome.next);
|
|
@@ -2286,4 +2152,4 @@ export {
|
|
|
2286
2152
|
scoreActionSearch,
|
|
2287
2153
|
ActionRegistry
|
|
2288
2154
|
};
|
|
2289
|
-
//# sourceMappingURL=chunk-
|
|
2155
|
+
//# sourceMappingURL=chunk-4EW7GVUR.js.map
|