@e4779/pi-fabric 0.116.0-fork.26 → 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.
Files changed (179) hide show
  1. package/THIRD_PARTY_NOTICES.md +2 -2
  2. package/dist/agents.js +3 -3
  3. package/dist/chunks/{chunk-HZGQ7XYM.js → chunk-3FJUP3GV.js} +2 -2
  4. package/dist/chunks/{chunk-U2UBUKNQ.js → chunk-3UGN25XS.js} +2 -2
  5. package/dist/chunks/{chunk-HITKWKYD.js → chunk-4EW7GVUR.js} +192 -326
  6. package/dist/chunks/chunk-4EW7GVUR.js.map +7 -0
  7. package/dist/chunks/{chunk-VR2LV4CA.js → chunk-53N2I4QA.js} +2 -2
  8. package/dist/chunks/{chunk-IQXNJNDI.js → chunk-5UBRGTVN.js} +8 -8
  9. package/dist/chunks/{chunk-4GNFBZPR.js → chunk-ASSLHWZS.js} +2 -2
  10. package/dist/chunks/{chunk-DLXPTBPL.js → chunk-AV36PBKH.js} +9 -1
  11. package/dist/chunks/chunk-AV36PBKH.js.map +7 -0
  12. package/dist/chunks/chunk-BN7F52EG.js +525 -0
  13. package/dist/chunks/chunk-BN7F52EG.js.map +7 -0
  14. package/dist/chunks/{chunk-QGP7AY2R.js → chunk-C7Z6F3SO.js} +2 -2
  15. package/dist/chunks/{chunk-56RFFBBO.js → chunk-CRRUW26I.js} +12 -12
  16. package/dist/chunks/{chunk-I2TK65VR.js → chunk-D5NYNIST.js} +5 -5
  17. package/dist/chunks/{chunk-KBYSGB7E.js → chunk-EFETPXU2.js} +69 -229
  18. package/dist/chunks/chunk-EFETPXU2.js.map +7 -0
  19. package/dist/chunks/{chunk-QQ7D6UAM.js → chunk-EHQQ4KCX.js} +2 -2
  20. package/dist/chunks/{chunk-7EYJE4TW.js → chunk-EKODKR6Y.js} +55 -6
  21. package/dist/chunks/chunk-EKODKR6Y.js.map +7 -0
  22. package/dist/chunks/{chunk-H3SGA7G7.js → chunk-FIDUHKMM.js} +5 -5
  23. package/dist/chunks/{chunk-4GGBND7V.js → chunk-FSYAGCGA.js} +2 -2
  24. package/dist/chunks/{chunk-ZPI4QTOX.js → chunk-FUY6XVRX.js} +2 -2
  25. package/dist/chunks/{chunk-A5XF3ZPJ.js → chunk-G4TLWHRS.js} +2 -2
  26. package/dist/chunks/{chunk-PTZ5DKAB.js → chunk-G54PEZ44.js} +4 -3
  27. package/dist/chunks/chunk-G54PEZ44.js.map +7 -0
  28. package/dist/chunks/{chunk-7C5IEIQK.js → chunk-GEQMQVNS.js} +2 -2
  29. package/dist/chunks/{chunk-DONS3EZH.js → chunk-GIK2WNAK.js} +2 -2
  30. package/dist/chunks/{chunk-MOJBW5X2.js → chunk-GO32KSEZ.js} +5 -3
  31. package/dist/chunks/chunk-GO32KSEZ.js.map +7 -0
  32. package/dist/chunks/{chunk-HQ5YW2OJ.js → chunk-HP5P7NBO.js} +2 -2
  33. package/dist/chunks/{chunk-R2MMPHR2.js → chunk-INRXG4J5.js} +2 -2
  34. package/dist/chunks/{chunk-BQWJ5ZR7.js → chunk-K7J2ABAZ.js} +3 -3
  35. package/dist/chunks/{chunk-OTHMEDN6.js → chunk-KVYNGDGC.js} +6 -6
  36. package/dist/chunks/{chunk-6EVAHJAR.js → chunk-LEU5CDSL.js} +3 -3
  37. package/dist/chunks/{chunk-HCNHKJDA.js → chunk-MLLYR3Y6.js} +2 -2
  38. package/dist/chunks/{chunk-D3W6CBJZ.js → chunk-MZUC6LLH.js} +4 -4
  39. package/dist/chunks/{chunk-D3IONBBJ.js → chunk-P7CBPPHY.js} +5 -5
  40. package/dist/chunks/{chunk-WQ6LC2KK.js → chunk-QT4W5YVB.js} +2 -2
  41. package/dist/chunks/{chunk-TNPZBMYC.js → chunk-ROTCDDOV.js} +4 -4
  42. package/dist/chunks/{chunk-PH4PT6R4.js → chunk-TIIIHPHF.js} +2 -2
  43. package/dist/chunks/{chunk-2YG4ZA2K.js → chunk-TIJ3YQXX.js} +2 -2
  44. package/dist/chunks/{chunk-QCCPR3U5.js → chunk-UOM37PE4.js} +4 -4
  45. package/dist/chunks/{chunk-EQYQICUY.js → chunk-UXIBKMUM.js} +3 -3
  46. package/dist/chunks/{chunk-V2IV4LYW.js → chunk-XWWV6TKV.js} +3 -3
  47. package/dist/chunks/{chunk-O7IREHJI.js → chunk-YKYWY722.js} +318 -39
  48. package/dist/chunks/chunk-YKYWY722.js.map +7 -0
  49. package/dist/chunks/{chunk-JV4JR6TT.js → chunk-ZEXCKK4K.js} +3 -3
  50. package/dist/chunks/{chunk-ODYU3IJU.js → chunk-ZPPNWB64.js} +4 -4
  51. package/dist/cli/decisions.js +1 -1
  52. package/dist/cli/mesh.js +2 -2
  53. package/dist/commands/fabric.d.ts.map +1 -1
  54. package/dist/compaction/hook.js +6 -6
  55. package/dist/compaction/owner.js +7 -7
  56. package/dist/components/configuration.js +4 -4
  57. package/dist/core/action-registry.js +6 -6
  58. package/dist/core/provider-operations.js +53 -154
  59. package/dist/core/provider-operations.js.map +2 -2
  60. package/dist/durable.js +2 -2
  61. package/dist/durable.js.map +1 -1
  62. package/dist/entropy/index.js +8 -8
  63. package/dist/extension-bootstrap.js +16 -16
  64. package/dist/fabric-runtime-state.js +42 -42
  65. package/dist/index.js +20 -20
  66. package/dist/jev/client.js +3 -3
  67. package/dist/jev/decision-types.d.ts +16 -0
  68. package/dist/jev/decision-types.d.ts.map +1 -1
  69. package/dist/jev/guest-types.d.ts +1 -1
  70. package/dist/jev/guest-types.d.ts.map +1 -1
  71. package/dist/jev/observation.js +7 -7
  72. package/dist/jev/routes.d.ts +1 -1
  73. package/dist/jev/routes.d.ts.map +1 -1
  74. package/dist/jev.js +12 -12
  75. package/dist/memory/digest.js +2 -2
  76. package/dist/memory/discovery.js +6 -6
  77. package/dist/memory/file-worker.js +9 -9
  78. package/dist/memory/normalize.js +5 -5
  79. package/dist/memory/search.js +7 -7
  80. package/dist/memory/worker-provider.js +10 -10
  81. package/dist/memory.js +10 -10
  82. package/dist/providers/jev-provider.js +12 -12
  83. package/dist/providers/memory-provider.js +9 -9
  84. package/dist/residency/host.js +12 -12
  85. package/dist/residency/pi-entry.js +12 -12
  86. package/dist/runtime/core-override-guest-types.js +2 -2
  87. package/dist/runtime/guest-types.d.ts +1 -1
  88. package/dist/runtime/guest-types.d.ts.map +1 -1
  89. package/dist/runtime/guest-types.js +1 -1
  90. package/dist/runtime/monty-runtime.js +3 -3
  91. package/dist/runtime/typescript-kernel.js +2 -2
  92. package/dist/type-error-guidance.js +1 -1
  93. package/dist/ui/controller.d.ts +2 -0
  94. package/dist/ui/controller.d.ts.map +1 -1
  95. package/dist/ui/conversation.js +1 -1
  96. package/dist/ui/dashboard-detail.d.ts.map +1 -1
  97. package/dist/ui/dashboard.js +6 -5
  98. package/dist/ui/dashboard.js.map +2 -2
  99. package/dist/ui/settings.js +3 -3
  100. package/dist/ui/transcript-parser.d.ts.map +1 -1
  101. package/dist/ui/transcript-reader.d.ts +1 -0
  102. package/dist/ui/transcript-reader.d.ts.map +1 -1
  103. package/dist/ui/transcript-sanitization.d.ts +2 -0
  104. package/dist/ui/transcript-sanitization.d.ts.map +1 -1
  105. package/dist/ui/transcript.d.ts +1 -1
  106. package/dist/ui/transcript.d.ts.map +1 -1
  107. package/dist/ui/widget-activity.d.ts +21 -0
  108. package/dist/ui/widget-activity.d.ts.map +1 -0
  109. package/dist/ui/widget.d.ts +40 -3
  110. package/dist/ui/widget.d.ts.map +1 -1
  111. package/dist/verified/generated/authority-kernel.d.ts +1 -1
  112. package/dist/verified/generated/authority-kernel.js +61 -157
  113. package/dist/verified/generated/kernel.d.ts +8 -8
  114. package/dist/verified/generated/kernel.js +205 -449
  115. package/dist/verified/generated/lifecycle-kernel.d.ts +1 -1
  116. package/dist/verified/generated/lifecycle-kernel.js +95 -133
  117. package/dist/verified/generated/manifest.json +18 -18
  118. package/dist/verified/generated/provider-kernel.d.ts +1 -1
  119. package/dist/verified/generated/provider-kernel.js +48 -149
  120. package/dist/verified/generated/storage-kernel.d.ts +2 -2
  121. package/dist/verified/generated/storage-kernel.js +59 -219
  122. package/dist/verified/nat.d.ts.map +1 -1
  123. package/dist/verified/policy.d.ts.map +1 -1
  124. package/docs/configuration.md +1 -1
  125. package/docs/durable-pi.md +2 -2
  126. package/docs/interface.md +4 -0
  127. package/docs/jev.md +2 -2
  128. package/docs/provider-capabilities.md +1 -1
  129. package/docs/verified-kernels.md +4 -3
  130. package/package.json +9 -9
  131. package/proofs/abi.json +11 -11
  132. package/proofs/authority-types.d.ts +1 -1
  133. package/proofs/lifecycle-types.d.ts +1 -1
  134. package/proofs/provider-types.d.ts +1 -1
  135. package/proofs/storage-types.d.ts +2 -2
  136. package/proofs/types.d.ts +4 -4
  137. package/scripts/test-verified-kernels.mjs +1 -1
  138. package/scripts/verified-kernels.mjs +1 -1
  139. package/dist/chunks/chunk-7EYJE4TW.js.map +0 -7
  140. package/dist/chunks/chunk-DLXPTBPL.js.map +0 -7
  141. package/dist/chunks/chunk-HITKWKYD.js.map +0 -7
  142. package/dist/chunks/chunk-KBYSGB7E.js.map +0 -7
  143. package/dist/chunks/chunk-MOJBW5X2.js.map +0 -7
  144. package/dist/chunks/chunk-O7IREHJI.js.map +0 -7
  145. package/dist/chunks/chunk-PTZ5DKAB.js.map +0 -7
  146. package/dist/chunks/chunk-WTLH5RY4.js +0 -760
  147. package/dist/chunks/chunk-WTLH5RY4.js.map +0 -7
  148. /package/dist/chunks/{chunk-HZGQ7XYM.js.map → chunk-3FJUP3GV.js.map} +0 -0
  149. /package/dist/chunks/{chunk-U2UBUKNQ.js.map → chunk-3UGN25XS.js.map} +0 -0
  150. /package/dist/chunks/{chunk-VR2LV4CA.js.map → chunk-53N2I4QA.js.map} +0 -0
  151. /package/dist/chunks/{chunk-IQXNJNDI.js.map → chunk-5UBRGTVN.js.map} +0 -0
  152. /package/dist/chunks/{chunk-4GNFBZPR.js.map → chunk-ASSLHWZS.js.map} +0 -0
  153. /package/dist/chunks/{chunk-QGP7AY2R.js.map → chunk-C7Z6F3SO.js.map} +0 -0
  154. /package/dist/chunks/{chunk-56RFFBBO.js.map → chunk-CRRUW26I.js.map} +0 -0
  155. /package/dist/chunks/{chunk-I2TK65VR.js.map → chunk-D5NYNIST.js.map} +0 -0
  156. /package/dist/chunks/{chunk-QQ7D6UAM.js.map → chunk-EHQQ4KCX.js.map} +0 -0
  157. /package/dist/chunks/{chunk-H3SGA7G7.js.map → chunk-FIDUHKMM.js.map} +0 -0
  158. /package/dist/chunks/{chunk-4GGBND7V.js.map → chunk-FSYAGCGA.js.map} +0 -0
  159. /package/dist/chunks/{chunk-ZPI4QTOX.js.map → chunk-FUY6XVRX.js.map} +0 -0
  160. /package/dist/chunks/{chunk-A5XF3ZPJ.js.map → chunk-G4TLWHRS.js.map} +0 -0
  161. /package/dist/chunks/{chunk-7C5IEIQK.js.map → chunk-GEQMQVNS.js.map} +0 -0
  162. /package/dist/chunks/{chunk-DONS3EZH.js.map → chunk-GIK2WNAK.js.map} +0 -0
  163. /package/dist/chunks/{chunk-HQ5YW2OJ.js.map → chunk-HP5P7NBO.js.map} +0 -0
  164. /package/dist/chunks/{chunk-R2MMPHR2.js.map → chunk-INRXG4J5.js.map} +0 -0
  165. /package/dist/chunks/{chunk-BQWJ5ZR7.js.map → chunk-K7J2ABAZ.js.map} +0 -0
  166. /package/dist/chunks/{chunk-OTHMEDN6.js.map → chunk-KVYNGDGC.js.map} +0 -0
  167. /package/dist/chunks/{chunk-6EVAHJAR.js.map → chunk-LEU5CDSL.js.map} +0 -0
  168. /package/dist/chunks/{chunk-HCNHKJDA.js.map → chunk-MLLYR3Y6.js.map} +0 -0
  169. /package/dist/chunks/{chunk-D3W6CBJZ.js.map → chunk-MZUC6LLH.js.map} +0 -0
  170. /package/dist/chunks/{chunk-D3IONBBJ.js.map → chunk-P7CBPPHY.js.map} +0 -0
  171. /package/dist/chunks/{chunk-WQ6LC2KK.js.map → chunk-QT4W5YVB.js.map} +0 -0
  172. /package/dist/chunks/{chunk-TNPZBMYC.js.map → chunk-ROTCDDOV.js.map} +0 -0
  173. /package/dist/chunks/{chunk-PH4PT6R4.js.map → chunk-TIIIHPHF.js.map} +0 -0
  174. /package/dist/chunks/{chunk-2YG4ZA2K.js.map → chunk-TIJ3YQXX.js.map} +0 -0
  175. /package/dist/chunks/{chunk-QCCPR3U5.js.map → chunk-UOM37PE4.js.map} +0 -0
  176. /package/dist/chunks/{chunk-EQYQICUY.js.map → chunk-UXIBKMUM.js.map} +0 -0
  177. /package/dist/chunks/{chunk-V2IV4LYW.js.map → chunk-XWWV6TKV.js.map} +0 -0
  178. /package/dist/chunks/{chunk-JV4JR6TT.js.map → chunk-ZEXCKK4K.js.map} +0 -0
  179. /package/dist/chunks/{chunk-ODYU3IJU.js.map → chunk-ZPPNWB64.js.map} +0 -0
@@ -1,760 +0,0 @@
1
- // src/verified/generated/kernel.js
2
- function S(e, t) {
3
- return { $: e < t ? "LT" : e === t ? "EQ" : "GT" };
4
- }
5
- function P(e) {
6
- if (e > 281474976710655)
7
- throw "bend: a Nat past the largest immediate 2^48-1";
8
- return e;
9
- }
10
- function c(e) {
11
- return (typeof e == "bigint" || Number.isInteger(e)) && e >= 0 && e <= 2 ** 53 ? Number(e) : { [Symbol.toPrimitive]() {
12
- throw "bend: a Nat past the largest immediate 2^48-1";
13
- } };
14
- }
15
- function h(e) {
16
- for (; e !== null && typeof e == "object" && e.$ === "$JMP"; )
17
- e = e.f(e.x);
18
- return e;
19
- }
20
- function $(e, t) {
21
- return (...n) => n.length < t ? $((...r) => e(...n, ...r), t - n.length) : e(...n);
22
- }
23
- function y(e, t, n) {
24
- for (; ; ) {
25
- let r = e, a = t, s = n;
26
- if (r.$ === "Nil")
27
- return a.$ === "Nil" ? s : false;
28
- {
29
- let l = r.head, u = r.tail;
30
- if (a.$ === "Nil")
31
- return false;
32
- {
33
- let g = a.head, k = a.tail;
34
- e = u, t = k, n = d(s, _(l, g));
35
- continue;
36
- }
37
- }
38
- }
39
- }
40
- function B(e) {
41
- return e.$ !== "Nil";
42
- }
43
- function V(e, t) {
44
- for (; ; ) {
45
- let n = e, r = t;
46
- if (n.$ === "Nil")
47
- return true;
48
- {
49
- let a = n.tail;
50
- if (r === 0)
51
- return false;
52
- {
53
- let s = r - 1;
54
- e = a, t = s;
55
- continue;
56
- }
57
- }
58
- }
59
- }
60
- function j(e) {
61
- return d(B(e), w(y(e, { $: "Con", head: 42, tail: { $: "Nil" } }, true)));
62
- }
63
- function F(e) {
64
- return d(B(e), d(V(e, 256), w(y(e, { $: "Con", head: 42, tail: { $: "Nil" } }, true))));
65
- }
66
- function I(e, t, n) {
67
- for (; ; ) {
68
- let r = e, a = t, s = n;
69
- if (r.$ === "Nil")
70
- return s;
71
- {
72
- let l = r.head, u = r.tail, g = y(a, l, true);
73
- e = u, t = a, n = s || g;
74
- continue;
75
- }
76
- }
77
- }
78
- function E(e, t, n) {
79
- for (; ; ) {
80
- let r = e, a = t, s = n;
81
- if (r.$ === "Nil")
82
- return s;
83
- {
84
- let l = r.head;
85
- e = r.tail, t = a, n = d(s, I(a, l, false));
86
- continue;
87
- }
88
- }
89
- }
90
- function M(e, t) {
91
- for (; ; ) {
92
- let n = e, r = t;
93
- if (n.$ === "Nil")
94
- return true;
95
- {
96
- let a = n.tail;
97
- if (r === 0)
98
- return false;
99
- {
100
- let s = r - 1;
101
- e = a, t = s;
102
- continue;
103
- }
104
- }
105
- }
106
- }
107
- function R(e, t) {
108
- for (; ; ) {
109
- let n = e, r = t;
110
- if (n.$ === "Nil")
111
- return r;
112
- {
113
- let a = n.head;
114
- e = n.tail, t = d(r, F(a));
115
- continue;
116
- }
117
- }
118
- }
119
- function J(e, t) {
120
- for (; ; ) {
121
- let n = e, r = t;
122
- if (n.$ === "Nil")
123
- return r;
124
- {
125
- let a = n.head;
126
- e = n.tail, t = d(r, j(a));
127
- continue;
128
- }
129
- }
130
- }
131
- function Q(e) {
132
- return e.$ !== "Nil";
133
- }
134
- function U(e, t) {
135
- return e ? { $: "resources.Exact", names: t } : { $: "resources.Unknown" };
136
- }
137
- function O(e) {
138
- return U(d(Q(e), J(e, true)), e);
139
- }
140
- function D(e) {
141
- return d(Q(e), d(M(e, 64), R(e, true)));
142
- }
143
- function H(e, t, n) {
144
- return e ? d(E(t, n, true), E(n, t, true)) : false;
145
- }
146
- function K(e, t) {
147
- return H(D(t), e, t);
148
- }
149
- function X(e, t) {
150
- if (e.$ === "resources.Unknown")
151
- return { $: "resources.Unknown" };
152
- {
153
- let n = e.names;
154
- return U(K(n, t), t);
155
- }
156
- }
157
- function Y(e, t, n) {
158
- for (; ; ) {
159
- let r = e, a = t, s = n;
160
- if (r.$ === "Nil")
161
- return s;
162
- {
163
- let l = r.head, u = r.tail, g = I(a, l, false);
164
- e = u, t = a, n = s || g;
165
- continue;
166
- }
167
- }
168
- }
169
- function Z(e, t) {
170
- if (e.$ === "resources.Unknown")
171
- return true;
172
- {
173
- let n = e.names;
174
- if (t.$ === "resources.Unknown")
175
- return true;
176
- {
177
- let r = t.names;
178
- return Y(n, r, false);
179
- }
180
- }
181
- }
182
- function A(e, t, n, r) {
183
- return d(n || r, Z(e, t));
184
- }
185
- function v(e, t) {
186
- if (e.$ === "resources.Quiet")
187
- return false;
188
- {
189
- let n = e.ordered, r = e.scope;
190
- if (t.$ === "resources.Quiet")
191
- return false;
192
- {
193
- let a = t.ordered, s = t.scope;
194
- return A(r, s, n, a);
195
- }
196
- }
197
- }
198
- function ee(e, t, n) {
199
- for (; ; ) {
200
- let r = e, a = t, s = n;
201
- if (r.$ === "Nil")
202
- return s;
203
- {
204
- let l = r.head, u = r.tail, g = v(a, l);
205
- e = u, t = a, n = s || g;
206
- continue;
207
- }
208
- }
209
- }
210
- function te(e, t, n) {
211
- for (; ; ) {
212
- let r = e, a = t, s = n;
213
- if (r.$ === "Nil")
214
- return s;
215
- {
216
- let l = r.head, u = r.tail, g = ee(a, l, false);
217
- e = u, t = a, n = s || g;
218
- continue;
219
- }
220
- }
221
- }
222
- function m(e) {
223
- for (; ; ) {
224
- let t = e;
225
- if (t.$ === "Nil")
226
- return true;
227
- if (t.head) {
228
- e = t.tail;
229
- continue;
230
- } else
231
- return false;
232
- }
233
- }
234
- function ie(e, t, n, r, a, s) {
235
- let l = d(e, t || s), u = d(r, a || n);
236
- return l || u;
237
- }
238
- function oe(e, t, n, r) {
239
- return { $: "Con", head: w(e), tail: { $: "Con", head: t, tail: { $: "Con", head: n, tail: { $: "Con", head: w(r), tail: { $: "Nil" } } } } };
240
- }
241
- function ae(e, t, n, r) {
242
- return m(oe(e, t, n, r));
243
- }
244
- function ue(e, t) {
245
- return e ? 2 : t ? 1 : 0;
246
- }
247
- function ce(e, t) {
248
- let n = t.first, r = t.last, a = t.paired, s = w(a), l = p(e, n), u = s || l, g = r < e;
249
- return u || g;
250
- }
251
- function T(e, t) {
252
- if (e.$ === "Nil")
253
- return { $: "Nil" };
254
- {
255
- let n = e.head, r = e.tail;
256
- return { $: "Con", head: ce(t, n), tail: T(r, t) };
257
- }
258
- }
259
- function L(e, t) {
260
- return m(T(e, t));
261
- }
262
- function $e(e) {
263
- let t = e.eligible, n = e.afterPrevious, r = e.retained, a = e.budget, s = e.boundary, l = e.spans;
264
- return { $: "Con", head: t, tail: { $: "Con", head: n, tail: { $: "Con", head: p(r, a), tail: { $: "Con", head: L(l, s), tail: { $: "Nil" } } } } };
265
- }
266
- function he(e) {
267
- return m($e(e));
268
- }
269
- function fe(e, t) {
270
- return e || t;
271
- }
272
- function de(e, t) {
273
- return m({ $: "Con", head: e, tail: { $: "Con", head: t, tail: { $: "Nil" } } });
274
- }
275
- function ge(e) {
276
- let t = e.start, n = e.end, r = e.total, a = e.expectedStart, s = e.expectedTotal, l = e.length, u = e.complete, g = _(n, r), k = t < n;
277
- return { $: "Con", head: _(t, a), tail: { $: "Con", head: _(r, s), tail: { $: "Con", head: p(t, n), tail: { $: "Con", head: p(n, r), tail: { $: "Con", head: _(l, n < t ? 0 : n - t), tail: { $: "Con", head: w(u !== g), tail: { $: "Con", head: u || k, tail: { $: "Nil" } } } } } } } };
278
- }
279
- function me(e) {
280
- return m(ge(e));
281
- }
282
- function we(e, t) {
283
- return m({ $: "Con", head: e, tail: { $: "Con", head: w(t), tail: { $: "Nil" } } });
284
- }
285
- function pe(e, t, n, r) {
286
- return { $: "Con", head: w(e), tail: { $: "Con", head: t, tail: { $: "Con", head: n, tail: { $: "Con", head: r, tail: { $: "Nil" } } } } };
287
- }
288
- function _e(e, t, n, r) {
289
- return m(pe(e, t, n, r));
290
- }
291
- function Ce(e, t, n, r, a) {
292
- let s = d(r, a);
293
- return m({ $: "Con", head: e, tail: { $: "Con", head: t, tail: { $: "Con", head: n || s, tail: { $: "Nil" } } } });
294
- }
295
- function be(e) {
296
- return m(e);
297
- }
298
- function ke(e) {
299
- return { $: "Tuple", fst: e, snd: false };
300
- }
301
- function ye(e, t, n) {
302
- return d(e, t || n);
303
- }
304
- function Ne(e, t, n, r) {
305
- return m({ $: "Con", head: p(e, t), tail: { $: "Con", head: p(n, r), tail: { $: "Nil" } } });
306
- }
307
- function xe(e, t, n, r) {
308
- let a = t;
309
- return m({ $: "Con", head: _(e, P(a + n)), tail: { $: "Con", head: p(a, r), tail: { $: "Nil" } } });
310
- }
311
- function Se(e) {
312
- return O(e);
313
- }
314
- function Be(e, t) {
315
- return X(e, t);
316
- }
317
- function Ee(e, t) {
318
- return te(e, t, false);
319
- }
320
- function d(e, t) {
321
- return e ? t : false;
322
- }
323
- function _(e, t) {
324
- return Qe(S(e, t));
325
- }
326
- function w(e) {
327
- return !e;
328
- }
329
- function p(e, t) {
330
- return Ue(S(e, t));
331
- }
332
- function Qe(e) {
333
- return e.$ === "EQ";
334
- }
335
- function Ue(e) {
336
- return e.$ !== "GT";
337
- }
338
- function Ae(e) {
339
- let t = [e];
340
- for (let n = t, r = 0; ; )
341
- switch (e.$) {
342
- case "Nil":
343
- return n[r] = e, t[0];
344
- case "Con":
345
- n = n[r] = { ...e, head: c(e.head) }, r = "tail", e = e[r];
346
- continue;
347
- default:
348
- throw "bend: List has no tag " + e?.$ + " (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)";
349
- }
350
- }
351
- function Te(e) {
352
- let t = [e];
353
- for (let n = t, r = 0; ; )
354
- switch (e.$) {
355
- case "Nil":
356
- return n[r] = e, t[0];
357
- case "Con":
358
- n = n[r] = { ...e, head: BigInt(e.head) }, r = "tail", e = e[r];
359
- continue;
360
- default:
361
- throw "bend: List has no tag " + e?.$ + " (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)";
362
- }
363
- }
364
- function N(e) {
365
- let t = [e];
366
- for (let n = t, r = 0; ; )
367
- switch (e.$) {
368
- case "Nil":
369
- return n[r] = e, t[0];
370
- case "Con":
371
- n = n[r] = { ...e, head: Ae(e.head) }, r = "tail", e = e[r];
372
- continue;
373
- default:
374
- throw "bend: List has no tag " + e?.$ + " (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)";
375
- }
376
- }
377
- function x(e) {
378
- let t = [e];
379
- for (let n = t, r = 0; ; )
380
- switch (e.$) {
381
- case "Nil":
382
- return n[r] = e, t[0];
383
- case "Con":
384
- n = n[r] = { ...e, head: Te(e.head) }, r = "tail", e = e[r];
385
- continue;
386
- default:
387
- throw "bend: List has no tag " + e?.$ + " (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)";
388
- }
389
- }
390
- function C(e) {
391
- let t = [e];
392
- for (let n = t, r = 0; ; )
393
- switch (e.$) {
394
- case "resources.Unknown":
395
- return n[r] = e, t[0];
396
- case "resources.Exact":
397
- return n = n[r] = { ...e, names: x(e.names) }, t[0];
398
- default:
399
- throw "bend: resources.Scope has no tag " + e?.$ + " (its tags: resources.Unknown, resources.Exact); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
400
- }
401
- }
402
- function b(e) {
403
- let t = [e];
404
- for (let n = t, r = 0; ; )
405
- switch (e.$) {
406
- case "resources.Unknown":
407
- return n[r] = e, t[0];
408
- case "resources.Exact":
409
- return n = n[r] = { ...e, names: N(e.names) }, t[0];
410
- default:
411
- throw "bend: resources.Scope has no tag " + e?.$ + " (its tags: resources.Unknown, resources.Exact); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
412
- }
413
- }
414
- function Le(e) {
415
- let t = [e];
416
- for (let n = t, r = 0; ; )
417
- switch (e.$) {
418
- case "resources.Quiet":
419
- return n[r] = e, t[0];
420
- case "resources.Effect":
421
- return n = n[r] = { ...e, scope: b(e.scope) }, t[0];
422
- default:
423
- throw "bend: resources.Effect has no tag " + e?.$ + " (its tags: resources.Quiet, resources.Effect); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
424
- }
425
- }
426
- function ze(e) {
427
- let t = [e];
428
- for (let n = t, r = 0; ; )
429
- switch (e.$) {
430
- case "resources.Quiet":
431
- return n[r] = e, t[0];
432
- case "resources.Effect":
433
- return n = n[r] = { ...e, scope: C(e.scope) }, t[0];
434
- default:
435
- throw "bend: resources.Effect has no tag " + e?.$ + " (its tags: resources.Quiet, resources.Effect); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
436
- }
437
- }
438
- function z(e) {
439
- let t = [e];
440
- for (let n = t, r = 0; ; )
441
- switch (e.$) {
442
- case "Nil":
443
- return n[r] = e, t[0];
444
- case "Con":
445
- n = n[r] = { ...e, head: Le(e.head) }, r = "tail", e = e[r];
446
- continue;
447
- default:
448
- throw "bend: List has no tag " + e?.$ + " (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)";
449
- }
450
- }
451
- function W(e) {
452
- let t = [e];
453
- for (let n = t, r = 0; ; )
454
- switch (e.$) {
455
- case "Nil":
456
- return n[r] = e, t[0];
457
- case "Con":
458
- n = n[r] = { ...e, head: ze(e.head) }, r = "tail", e = e[r];
459
- continue;
460
- default:
461
- throw "bend: List has no tag " + e?.$ + " (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)";
462
- }
463
- }
464
- function We(e) {
465
- let t = [e];
466
- for (let n = t, r = 0; ; )
467
- switch (e.$) {
468
- case "Span":
469
- return n = n[r] = { ...e, first: c(e.first), last: c(e.last) }, t[0];
470
- default:
471
- throw "bend: Span has no tag " + e?.$ + " (its tags: Span); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
472
- }
473
- }
474
- function qe(e) {
475
- let t = [e];
476
- for (let n = t, r = 0; ; )
477
- switch (e.$) {
478
- case "Span":
479
- return n = n[r] = { ...e, first: BigInt(e.first), last: BigInt(e.last) }, t[0];
480
- default:
481
- throw "bend: Span has no tag " + e?.$ + " (its tags: Span); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
482
- }
483
- }
484
- function q(e) {
485
- let t = [e];
486
- for (let n = t, r = 0; ; )
487
- switch (e.$) {
488
- case "Nil":
489
- return n[r] = e, t[0];
490
- case "Con":
491
- n = n[r] = { ...e, head: We(e.head) }, r = "tail", e = e[r];
492
- continue;
493
- default:
494
- throw "bend: List has no tag " + e?.$ + " (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)";
495
- }
496
- }
497
- function G(e) {
498
- let t = [e];
499
- for (let n = t, r = 0; ; )
500
- switch (e.$) {
501
- case "Nil":
502
- return n[r] = e, t[0];
503
- case "Con":
504
- n = n[r] = { ...e, head: qe(e.head) }, r = "tail", e = e[r];
505
- continue;
506
- default:
507
- throw "bend: List has no tag " + e?.$ + " (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)";
508
- }
509
- }
510
- function Ge(e) {
511
- let t = [e];
512
- for (let n = t, r = 0; ; )
513
- switch (e.$) {
514
- case "Cut":
515
- return n = n[r] = { ...e, retained: c(e.retained), budget: c(e.budget), boundary: c(e.boundary), spans: q(e.spans) }, t[0];
516
- default:
517
- throw "bend: Cut has no tag " + e?.$ + " (its tags: Cut); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
518
- }
519
- }
520
- function Pe(e) {
521
- let t = [e];
522
- for (let n = t, r = 0; ; )
523
- switch (e.$) {
524
- case "Cut":
525
- return n = n[r] = { ...e, retained: BigInt(e.retained), budget: BigInt(e.budget), boundary: BigInt(e.boundary), spans: G(e.spans) }, t[0];
526
- default:
527
- throw "bend: Cut has no tag " + e?.$ + " (its tags: Cut); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
528
- }
529
- }
530
- function Ve(e) {
531
- let t = [e];
532
- for (let n = t, r = 0; ; )
533
- switch (e.$) {
534
- case "Chunk":
535
- return n = n[r] = { ...e, start: c(e.start), end: c(e.end), total: c(e.total), expectedStart: c(e.expectedStart), expectedTotal: c(e.expectedTotal), length: c(e.length) }, t[0];
536
- default:
537
- throw "bend: Chunk has no tag " + e?.$ + " (its tags: Chunk); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
538
- }
539
- }
540
- function je(e) {
541
- let t = [e];
542
- for (let n = t, r = 0; ; )
543
- switch (e.$) {
544
- case "Chunk":
545
- return n = n[r] = { ...e, start: BigInt(e.start), end: BigInt(e.end), total: BigInt(e.total), expectedStart: BigInt(e.expectedStart), expectedTotal: BigInt(e.expectedTotal), length: BigInt(e.length) }, t[0];
546
- default:
547
- throw "bend: Chunk has no tag " + e?.$ + " (its tags: Chunk); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
548
- }
549
- }
550
- var o = /* @__PURE__ */ new Map([["Unknown", "resources.Unknown"], ["Exact", "resources.Exact"], ["Quiet", "resources.Quiet"], ["Effect", "resources.Effect"]]);
551
- var f = /* @__PURE__ */ new Map([["resources.Unknown", "Unknown"], ["resources.Exact", "Exact"], ["resources.Quiet", "Quiet"], ["resources.Effect", "Effect"]]);
552
- function i(e, t) {
553
- let n = [e];
554
- for (let r = [[n, 0]]; r.length > 0; ) {
555
- let [a, s] = r.pop(), l = a[s];
556
- if (l === null || typeof l != "object") continue;
557
- let u = Array.isArray(l) ? [...l] : { ...l };
558
- typeof u.$ == "string" && (u.$ = t.get(u.$) ?? u.$), a[s] = u;
559
- for (let g of Object.keys(u)) r.push([u, g]);
560
- }
561
- return n[0];
562
- }
563
- var Re = /* @__PURE__ */ $((e, t, n, r, a, s) => h(ie(e, t, n, r, a, s)), 6);
564
- var Je = (e, t, n, r, a, s) => i(Re(i(e, o), i(t, o), i(n, o), i(r, o), i(a, o), i(s, o)), f);
565
- var Oe = /* @__PURE__ */ $((e, t, n, r) => h(ae(e, t, n, r)), 4);
566
- var De = (e, t, n, r) => i(Oe(i(e, o), i(t, o), i(n, o), i(r, o)), f);
567
- var Xe = /* @__PURE__ */ $((e, t) => h(ue(e, t)), 2);
568
- var Ye = (e, t) => i(Xe(i(e, o), i(t, o)), f);
569
- var et = /* @__PURE__ */ $((e) => {
570
- let t = h(he(Ge(e)));
571
- return Pe(e), t;
572
- }, 1);
573
- var tt = (e) => i(et(i(e, o)), f);
574
- var nt = /* @__PURE__ */ $((e, t) => h(de(e, t)), 2);
575
- var rt = (e, t) => i(nt(i(e, o), i(t, o)), f);
576
- var it = /* @__PURE__ */ $((e) => {
577
- let t = h(me(Ve(e)));
578
- return je(e), t;
579
- }, 1);
580
- var ot = (e) => i(it(i(e, o)), f);
581
- var at = /* @__PURE__ */ $((e, t) => h(we(e, t)), 2);
582
- var st = (e, t) => i(at(i(e, o), i(t, o)), f);
583
- var lt = /* @__PURE__ */ $((e, t, n, r) => h(_e(e, t, n, r)), 4);
584
- var ut = (e, t, n, r) => i(lt(i(e, o), i(t, o), i(n, o), i(r, o)), f);
585
- var ct = /* @__PURE__ */ $((e, t, n, r, a) => h(Ce(e, t, n, r, a)), 5);
586
- var $t = (e, t, n, r, a) => i(ct(i(e, o), i(t, o), i(n, o), i(r, o), i(a, o)), f);
587
- var ht = /* @__PURE__ */ $((e) => h(be(e)), 1);
588
- var ft = (e) => i(ht(i(e, o)), f);
589
- var dt = /* @__PURE__ */ $((e) => h(ke(e)), 1);
590
- var gt = (e) => i(dt(i(e, o)), f);
591
- var mt = /* @__PURE__ */ $((e, t) => h(fe(e, t)), 2);
592
- var wt = (e, t) => i(mt(i(e, o), i(t, o)), f);
593
- var pt = /* @__PURE__ */ $((e, t, n) => h(ye(e, t, n)), 3);
594
- var _t = (e, t, n) => i(pt(i(e, o), i(t, o), i(n, o)), f);
595
- var Ct = /* @__PURE__ */ $((e, t, n, r) => {
596
- let a = h(Ne(c(e), c(t), c(n), c(r)));
597
- return BigInt(e), BigInt(t), BigInt(n), BigInt(r), a;
598
- }, 4);
599
- var bt = (e, t, n, r) => i(Ct(i(e, o), i(t, o), i(n, o), i(r, o)), f);
600
- var kt = /* @__PURE__ */ $((e, t, n, r) => {
601
- let a = h(xe(c(e), c(t), c(n), c(r)));
602
- return BigInt(e), BigInt(t), BigInt(n), BigInt(r), a;
603
- }, 4);
604
- var yt = (e, t, n, r) => i(kt(i(e, o), i(t, o), i(n, o), i(r, o)), f);
605
- var Nt = /* @__PURE__ */ $((e) => {
606
- let t = C(h(Se(N(e))));
607
- return x(e), t;
608
- }, 1);
609
- var xt = (e) => i(Nt(i(e, o)), f);
610
- var St = /* @__PURE__ */ $((e, t) => {
611
- let n = C(h(Be(b(e), N(t))));
612
- return C(e), x(t), n;
613
- }, 2);
614
- var Bt = (e, t) => i(St(i(e, o), i(t, o)), f);
615
- var Qt = /* @__PURE__ */ $((e, t) => {
616
- let n = h(Ee(z(e), z(t)));
617
- return W(e), W(t), n;
618
- }, 2);
619
- var Ut = (e, t) => i(Qt(i(e, o), i(t, o)), f);
620
-
621
- // src/verified/nat.ts
622
- var BEND_NAT_MAX = 2 ** 48 - 1;
623
-
624
- // src/verified/resources.ts
625
- var encodeResourceNames = (values) => {
626
- let names = { $: "Nil" };
627
- const cache = /* @__PURE__ */ new Map();
628
- const input = Array.isArray(values) ? values : [];
629
- for (let i2 = input.length - 1; i2 >= 0; i2--) {
630
- const value = input[i2];
631
- let name = { $: "Nil" };
632
- if (typeof value === "string") {
633
- const cached = cache.get(value);
634
- if (cached) name = cached;
635
- else {
636
- for (let j2 = value.length - 1; j2 >= 0; j2--) {
637
- name = { $: "Con", head: BigInt(value.charCodeAt(j2)), tail: name };
638
- }
639
- cache.set(value, name);
640
- }
641
- }
642
- names = { $: "Con", head: name, tail: names };
643
- }
644
- return names;
645
- };
646
- var decodeResourceScope = (scope) => {
647
- if (scope.$ === "Unknown") return ["*"];
648
- const result = [];
649
- for (let names = scope.names; names.$ === "Con"; names = names.tail) {
650
- const chars = [];
651
- for (let name = names.head; name.$ === "Con"; name = name.tail) {
652
- if (name.head < 0n || name.head > 65535n) throw new Error("Invalid verified resource code unit");
653
- chars.push(String.fromCharCode(Number(name.head)));
654
- }
655
- result.push(chars.join(""));
656
- }
657
- return result;
658
- };
659
- var boundedEffectResources = (resources) => {
660
- const declared = Array.isArray(resources) ? Array.from(resources) : [];
661
- const original = xt(encodeResourceNames(declared));
662
- const proposal = /* @__PURE__ */ new Set();
663
- for (const resource of declared) {
664
- proposal.add(resource);
665
- if (proposal.size > 64) break;
666
- }
667
- return decodeResourceScope(Bt(original, encodeResourceNames([...proposal])));
668
- };
669
- var encodeResourceEffects = (effects) => {
670
- let result = { $: "Nil" };
671
- for (let i2 = effects.length - 1; i2 >= 0; i2--) {
672
- const effect = effects[i2];
673
- const value = effect.kind === "none" ? { $: "Quiet" } : {
674
- $: "Effect",
675
- ordered: effect.ordering !== "commutative",
676
- scope: xt(encodeResourceNames(effect.resources))
677
- };
678
- result = { $: "Con", head: value, tail: result };
679
- }
680
- return result;
681
- };
682
-
683
- // src/verified/policy.ts
684
- var isNatural = (value) => Number.isSafeInteger(value) && value >= 0;
685
- var isArithmeticNatural = (value) => isNatural(value) && value <= BEND_NAT_MAX;
686
- var bendList = (values) => {
687
- let list = { $: "Nil" };
688
- for (let index = values.length - 1; index >= 0; index--) {
689
- list = { $: "Con", head: values[index], tail: list };
690
- }
691
- return list;
692
- };
693
- var acceptSummaryBounds = (bytes, byteLimit, projected, target) => [bytes, byteLimit, projected, target].every(isNatural) && bt(BigInt(bytes), BigInt(byteLimit), BigInt(projected), BigInt(target));
694
- var acceptSampleAccounting = (total, retained, omitted, limit) => [total, retained, omitted, limit].every(isArithmeticNatural) && retained + omitted <= BEND_NAT_MAX && yt(BigInt(total), BigInt(retained), BigInt(omitted), BigInt(limit));
695
- var acceptCompactionCut = (candidate, spans) => {
696
- if (![candidate.retained, candidate.budget, candidate.boundary].every(isNatural) || typeof candidate.eligible !== "boolean" || typeof candidate.afterPrevious !== "boolean") return false;
697
- const base = {
698
- $: "Cut",
699
- eligible: candidate.eligible,
700
- afterPrevious: candidate.afterPrevious,
701
- retained: BigInt(candidate.retained),
702
- budget: BigInt(candidate.budget),
703
- boundary: BigInt(candidate.boundary)
704
- };
705
- if (!tt({ ...base, spans: { $: "Nil" } })) return false;
706
- let batch = [];
707
- for (const span of spans) {
708
- if (!isNatural(span.first) || !isNatural(span.last) || span.first > span.last || typeof span.hasCall !== "boolean" || typeof span.hasResult !== "boolean") return false;
709
- batch.push({ $: "Span", first: BigInt(span.first), last: BigInt(span.last), paired: span.hasCall && span.hasResult });
710
- if (batch.length === 128) {
711
- if (!tt({ ...base, spans: bendList(batch) })) return false;
712
- batch = [];
713
- }
714
- }
715
- return tt({ ...base, spans: bendList(batch) });
716
- };
717
- var acceptMemoryChunk = (range, length, expectedStart, expectedTotal) => {
718
- if (![range.start, range.end, range.total, length, expectedStart, expectedTotal].every(isArithmeticNatural) || range.start + length > BEND_NAT_MAX || typeof range.complete !== "boolean") return false;
719
- return ot({
720
- $: "Chunk",
721
- start: BigInt(range.start),
722
- end: BigInt(range.end),
723
- total: BigInt(range.total),
724
- length: BigInt(length),
725
- expectedStart: BigInt(expectedStart),
726
- expectedTotal: BigInt(expectedTotal),
727
- complete: range.complete
728
- });
729
- };
730
- var assertCertificateFacts = (facts) => {
731
- if (facts.length !== 8 || facts.some((fact) => typeof fact.valid !== "boolean")) {
732
- throw new Error("Invalid Schema certificate evidence");
733
- }
734
- if (!ft(bendList(facts.map((fact) => fact.valid)))) {
735
- throw new Error(facts.find((fact) => !fact.valid)?.error ?? "Schema certificate rejected");
736
- }
737
- };
738
-
739
- export {
740
- BEND_NAT_MAX,
741
- Je,
742
- De,
743
- Ye,
744
- rt,
745
- st,
746
- ut,
747
- $t,
748
- gt,
749
- wt,
750
- _t,
751
- Ut,
752
- boundedEffectResources,
753
- encodeResourceEffects,
754
- acceptSummaryBounds,
755
- acceptSampleAccounting,
756
- acceptCompactionCut,
757
- acceptMemoryChunk,
758
- assertCertificateFacts
759
- };
760
- //# sourceMappingURL=chunk-WTLH5RY4.js.map