@e4779/pi-fabric 0.116.0-fork.26 → 0.117.2-fork.29

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-ODYU3IJU.js → chunk-FE6NOAO7.js} +5 -5
  23. package/dist/chunks/{chunk-ODYU3IJU.js.map → chunk-FE6NOAO7.js.map} +2 -2
  24. package/dist/chunks/{chunk-H3SGA7G7.js → chunk-FIDUHKMM.js} +5 -5
  25. package/dist/chunks/{chunk-4GGBND7V.js → chunk-FSYAGCGA.js} +2 -2
  26. package/dist/chunks/{chunk-ZPI4QTOX.js → chunk-FUY6XVRX.js} +2 -2
  27. package/dist/chunks/{chunk-A5XF3ZPJ.js → chunk-G4TLWHRS.js} +2 -2
  28. package/dist/chunks/{chunk-PTZ5DKAB.js → chunk-G54PEZ44.js} +4 -3
  29. package/dist/chunks/chunk-G54PEZ44.js.map +7 -0
  30. package/dist/chunks/{chunk-7C5IEIQK.js → chunk-GEQMQVNS.js} +2 -2
  31. package/dist/chunks/{chunk-DONS3EZH.js → chunk-GIK2WNAK.js} +2 -2
  32. package/dist/chunks/{chunk-MOJBW5X2.js → chunk-GO32KSEZ.js} +5 -3
  33. package/dist/chunks/chunk-GO32KSEZ.js.map +7 -0
  34. package/dist/chunks/{chunk-HQ5YW2OJ.js → chunk-HP5P7NBO.js} +2 -2
  35. package/dist/chunks/{chunk-R2MMPHR2.js → chunk-INRXG4J5.js} +2 -2
  36. package/dist/chunks/{chunk-BQWJ5ZR7.js → chunk-K7J2ABAZ.js} +3 -3
  37. package/dist/chunks/{chunk-OTHMEDN6.js → chunk-KVYNGDGC.js} +6 -6
  38. package/dist/chunks/{chunk-6EVAHJAR.js → chunk-LEU5CDSL.js} +3 -3
  39. package/dist/chunks/{chunk-V2IV4LYW.js → chunk-LNASO4VT.js} +3 -3
  40. package/dist/chunks/{chunk-HCNHKJDA.js → chunk-MLLYR3Y6.js} +2 -2
  41. package/dist/chunks/{chunk-D3W6CBJZ.js → chunk-MZUC6LLH.js} +4 -4
  42. package/dist/chunks/{chunk-D3IONBBJ.js → chunk-P7CBPPHY.js} +5 -5
  43. package/dist/chunks/{chunk-WQ6LC2KK.js → chunk-QT4W5YVB.js} +2 -2
  44. package/dist/chunks/{chunk-TNPZBMYC.js → chunk-ROTCDDOV.js} +4 -4
  45. package/dist/chunks/{chunk-PH4PT6R4.js → chunk-TIIIHPHF.js} +2 -2
  46. package/dist/chunks/{chunk-2YG4ZA2K.js → chunk-TIJ3YQXX.js} +2 -2
  47. package/dist/chunks/{chunk-QCCPR3U5.js → chunk-UOM37PE4.js} +4 -4
  48. package/dist/chunks/{chunk-EQYQICUY.js → chunk-UXIBKMUM.js} +3 -3
  49. package/dist/chunks/{chunk-O7IREHJI.js → chunk-XCEEQ5AB.js} +318 -39
  50. package/dist/chunks/chunk-XCEEQ5AB.js.map +7 -0
  51. package/dist/chunks/{chunk-JV4JR6TT.js → chunk-ZEXCKK4K.js} +3 -3
  52. package/dist/cli/decisions.js +1 -1
  53. package/dist/cli/mesh.js +2 -2
  54. package/dist/commands/fabric.d.ts.map +1 -1
  55. package/dist/compaction/hook.js +6 -6
  56. package/dist/compaction/owner.js +7 -7
  57. package/dist/components/configuration.js +4 -4
  58. package/dist/core/action-registry.js +6 -6
  59. package/dist/core/provider-operations.js +53 -154
  60. package/dist/core/provider-operations.js.map +2 -2
  61. package/dist/durable.js +2 -2
  62. package/dist/durable.js.map +1 -1
  63. package/dist/entropy/index.js +8 -8
  64. package/dist/extension-bootstrap.js +16 -16
  65. package/dist/fabric-runtime-state.js +42 -42
  66. package/dist/index.js +20 -20
  67. package/dist/jev/client.js +3 -3
  68. package/dist/jev/decision-types.d.ts +16 -0
  69. package/dist/jev/decision-types.d.ts.map +1 -1
  70. package/dist/jev/guest-types.d.ts +1 -1
  71. package/dist/jev/guest-types.d.ts.map +1 -1
  72. package/dist/jev/observation.js +7 -7
  73. package/dist/jev/routes.d.ts +1 -1
  74. package/dist/jev/routes.d.ts.map +1 -1
  75. package/dist/jev.js +12 -12
  76. package/dist/memory/digest.js +2 -2
  77. package/dist/memory/discovery.js +6 -6
  78. package/dist/memory/file-worker.js +9 -9
  79. package/dist/memory/normalize.js +5 -5
  80. package/dist/memory/search.js +7 -7
  81. package/dist/memory/worker-provider.js +10 -10
  82. package/dist/memory.js +10 -10
  83. package/dist/providers/jev-provider.js +12 -12
  84. package/dist/providers/memory-provider.js +9 -9
  85. package/dist/residency/host.js +12 -12
  86. package/dist/residency/pi-entry.js +12 -12
  87. package/dist/runtime/core-override-guest-types.js +2 -2
  88. package/dist/runtime/guest-types.d.ts +1 -1
  89. package/dist/runtime/guest-types.d.ts.map +1 -1
  90. package/dist/runtime/guest-types.js +1 -1
  91. package/dist/runtime/monty-runtime.js +3 -3
  92. package/dist/runtime/typescript-kernel.js +2 -2
  93. package/dist/type-error-guidance.js +1 -1
  94. package/dist/ui/controller.d.ts +2 -0
  95. package/dist/ui/controller.d.ts.map +1 -1
  96. package/dist/ui/conversation.js +1 -1
  97. package/dist/ui/dashboard-detail.d.ts.map +1 -1
  98. package/dist/ui/dashboard.js +6 -5
  99. package/dist/ui/dashboard.js.map +2 -2
  100. package/dist/ui/settings.js +3 -3
  101. package/dist/ui/transcript-parser.d.ts.map +1 -1
  102. package/dist/ui/transcript-reader.d.ts +1 -0
  103. package/dist/ui/transcript-reader.d.ts.map +1 -1
  104. package/dist/ui/transcript-sanitization.d.ts +2 -0
  105. package/dist/ui/transcript-sanitization.d.ts.map +1 -1
  106. package/dist/ui/transcript.d.ts +1 -1
  107. package/dist/ui/transcript.d.ts.map +1 -1
  108. package/dist/ui/widget-activity.d.ts +21 -0
  109. package/dist/ui/widget-activity.d.ts.map +1 -0
  110. package/dist/ui/widget.d.ts +40 -3
  111. package/dist/ui/widget.d.ts.map +1 -1
  112. package/dist/verified/generated/authority-kernel.d.ts +1 -1
  113. package/dist/verified/generated/authority-kernel.js +61 -157
  114. package/dist/verified/generated/kernel.d.ts +8 -8
  115. package/dist/verified/generated/kernel.js +205 -449
  116. package/dist/verified/generated/lifecycle-kernel.d.ts +1 -1
  117. package/dist/verified/generated/lifecycle-kernel.js +95 -133
  118. package/dist/verified/generated/manifest.json +18 -18
  119. package/dist/verified/generated/provider-kernel.d.ts +1 -1
  120. package/dist/verified/generated/provider-kernel.js +48 -149
  121. package/dist/verified/generated/storage-kernel.d.ts +2 -2
  122. package/dist/verified/generated/storage-kernel.js +59 -219
  123. package/dist/verified/nat.d.ts.map +1 -1
  124. package/dist/verified/policy.d.ts.map +1 -1
  125. package/docs/configuration.md +1 -1
  126. package/docs/durable-pi.md +2 -2
  127. package/docs/interface.md +4 -0
  128. package/docs/jev.md +2 -2
  129. package/docs/provider-capabilities.md +1 -1
  130. package/docs/verified-kernels.md +4 -3
  131. package/package.json +9 -9
  132. package/proofs/abi.json +11 -11
  133. package/proofs/authority-types.d.ts +1 -1
  134. package/proofs/lifecycle-types.d.ts +1 -1
  135. package/proofs/provider-types.d.ts +1 -1
  136. package/proofs/storage-types.d.ts +2 -2
  137. package/proofs/types.d.ts +4 -4
  138. package/scripts/test-verified-kernels.mjs +1 -1
  139. package/scripts/verified-kernels.mjs +1 -1
  140. package/dist/chunks/chunk-7EYJE4TW.js.map +0 -7
  141. package/dist/chunks/chunk-DLXPTBPL.js.map +0 -7
  142. package/dist/chunks/chunk-HITKWKYD.js.map +0 -7
  143. package/dist/chunks/chunk-KBYSGB7E.js.map +0 -7
  144. package/dist/chunks/chunk-MOJBW5X2.js.map +0 -7
  145. package/dist/chunks/chunk-O7IREHJI.js.map +0 -7
  146. package/dist/chunks/chunk-PTZ5DKAB.js.map +0 -7
  147. package/dist/chunks/chunk-WTLH5RY4.js +0 -760
  148. package/dist/chunks/chunk-WTLH5RY4.js.map +0 -7
  149. /package/dist/chunks/{chunk-HZGQ7XYM.js.map → chunk-3FJUP3GV.js.map} +0 -0
  150. /package/dist/chunks/{chunk-U2UBUKNQ.js.map → chunk-3UGN25XS.js.map} +0 -0
  151. /package/dist/chunks/{chunk-VR2LV4CA.js.map → chunk-53N2I4QA.js.map} +0 -0
  152. /package/dist/chunks/{chunk-IQXNJNDI.js.map → chunk-5UBRGTVN.js.map} +0 -0
  153. /package/dist/chunks/{chunk-4GNFBZPR.js.map → chunk-ASSLHWZS.js.map} +0 -0
  154. /package/dist/chunks/{chunk-QGP7AY2R.js.map → chunk-C7Z6F3SO.js.map} +0 -0
  155. /package/dist/chunks/{chunk-56RFFBBO.js.map → chunk-CRRUW26I.js.map} +0 -0
  156. /package/dist/chunks/{chunk-I2TK65VR.js.map → chunk-D5NYNIST.js.map} +0 -0
  157. /package/dist/chunks/{chunk-QQ7D6UAM.js.map → chunk-EHQQ4KCX.js.map} +0 -0
  158. /package/dist/chunks/{chunk-H3SGA7G7.js.map → chunk-FIDUHKMM.js.map} +0 -0
  159. /package/dist/chunks/{chunk-4GGBND7V.js.map → chunk-FSYAGCGA.js.map} +0 -0
  160. /package/dist/chunks/{chunk-ZPI4QTOX.js.map → chunk-FUY6XVRX.js.map} +0 -0
  161. /package/dist/chunks/{chunk-A5XF3ZPJ.js.map → chunk-G4TLWHRS.js.map} +0 -0
  162. /package/dist/chunks/{chunk-7C5IEIQK.js.map → chunk-GEQMQVNS.js.map} +0 -0
  163. /package/dist/chunks/{chunk-DONS3EZH.js.map → chunk-GIK2WNAK.js.map} +0 -0
  164. /package/dist/chunks/{chunk-HQ5YW2OJ.js.map → chunk-HP5P7NBO.js.map} +0 -0
  165. /package/dist/chunks/{chunk-R2MMPHR2.js.map → chunk-INRXG4J5.js.map} +0 -0
  166. /package/dist/chunks/{chunk-BQWJ5ZR7.js.map → chunk-K7J2ABAZ.js.map} +0 -0
  167. /package/dist/chunks/{chunk-OTHMEDN6.js.map → chunk-KVYNGDGC.js.map} +0 -0
  168. /package/dist/chunks/{chunk-6EVAHJAR.js.map → chunk-LEU5CDSL.js.map} +0 -0
  169. /package/dist/chunks/{chunk-V2IV4LYW.js.map → chunk-LNASO4VT.js.map} +0 -0
  170. /package/dist/chunks/{chunk-HCNHKJDA.js.map → chunk-MLLYR3Y6.js.map} +0 -0
  171. /package/dist/chunks/{chunk-D3W6CBJZ.js.map → chunk-MZUC6LLH.js.map} +0 -0
  172. /package/dist/chunks/{chunk-D3IONBBJ.js.map → chunk-P7CBPPHY.js.map} +0 -0
  173. /package/dist/chunks/{chunk-WQ6LC2KK.js.map → chunk-QT4W5YVB.js.map} +0 -0
  174. /package/dist/chunks/{chunk-TNPZBMYC.js.map → chunk-ROTCDDOV.js.map} +0 -0
  175. /package/dist/chunks/{chunk-PH4PT6R4.js.map → chunk-TIIIHPHF.js.map} +0 -0
  176. /package/dist/chunks/{chunk-2YG4ZA2K.js.map → chunk-TIJ3YQXX.js.map} +0 -0
  177. /package/dist/chunks/{chunk-QCCPR3U5.js.map → chunk-UOM37PE4.js.map} +0 -0
  178. /package/dist/chunks/{chunk-EQYQICUY.js.map → chunk-UXIBKMUM.js.map} +0 -0
  179. /package/dist/chunks/{chunk-JV4JR6TT.js.map → chunk-ZEXCKK4K.js.map} +0 -0
@@ -14,31 +14,31 @@ import {
14
14
  reconstructSessionLineage,
15
15
  searchMemoryIndex,
16
16
  shardPolicy
17
- } from "./chunk-OTHMEDN6.js";
17
+ } from "./chunk-KVYNGDGC.js";
18
18
  import {
19
19
  compareLexical,
20
20
  foldSessionDigest,
21
21
  normalizeMemoryPhrase,
22
22
  tokenizeLexical
23
- } from "./chunk-D3W6CBJZ.js";
23
+ } from "./chunk-MZUC6LLH.js";
24
24
  import {
25
25
  AmbiguousSessionError,
26
26
  enumerateAllSessions,
27
27
  resolveScope,
28
28
  resolveSessionTarget
29
- } from "./chunk-PH4PT6R4.js";
29
+ } from "./chunk-TIIIHPHF.js";
30
30
  import {
31
31
  expandSessionEntriesChecked,
32
32
  normalizeRecords,
33
33
  normalizeSession
34
- } from "./chunk-I2TK65VR.js";
34
+ } from "./chunk-D5NYNIST.js";
35
35
  import {
36
36
  actionArgNormalizer
37
37
  } from "./chunk-NQOEHX62.js";
38
38
  import {
39
- acceptMemoryChunk,
40
- rt
41
- } from "./chunk-WTLH5RY4.js";
39
+ Be,
40
+ acceptMemoryChunk
41
+ } from "./chunk-BN7F52EG.js";
42
42
 
43
43
  // src/memory/context.ts
44
44
  var RECALL_DEFAULT_PAGE_SIZE = 10;
@@ -1220,7 +1220,7 @@ async function processMemoryExpand(args, context, cache, signal) {
1220
1220
  if (snapshot) {
1221
1221
  const sourceChanged = expectedSourceHash !== void 0 && snapshot.sourceHash !== expectedSourceHash;
1222
1222
  const lineageChanged = expectedLineageFingerprint !== void 0 && snapshot.lineageFingerprint !== expectedLineageFingerprint;
1223
- if (!rt(!sourceChanged, !lineageChanged)) {
1223
+ if (!Be(!sourceChanged, !lineageChanged)) {
1224
1224
  return {
1225
1225
  session: ref.file,
1226
1226
  branches,
@@ -1247,7 +1247,7 @@ async function processMemoryExpand(args, context, cache, signal) {
1247
1247
  const initialLineage = access.lineage(branches);
1248
1248
  const sourceChanged = expectedSourceHash !== void 0 && initialState.sourceHash !== expectedSourceHash;
1249
1249
  const lineageChanged = expectedLineageFingerprint !== void 0 && initialLineage.fingerprint !== expectedLineageFingerprint;
1250
- if (!rt(!sourceChanged, !lineageChanged)) {
1250
+ if (!Be(!sourceChanged, !lineageChanged)) {
1251
1251
  return {
1252
1252
  session: ref.file,
1253
1253
  branches,
@@ -1283,7 +1283,7 @@ async function processMemoryExpand(args, context, cache, signal) {
1283
1283
  const finalState2 = access.state();
1284
1284
  const finalLineage2 = access.lineage(branches);
1285
1285
  const finalObservation = access.observe(branches);
1286
- if (!finalState2 || !finalObservation || !rt(finalState2.sourceHash === initialState.sourceHash, finalLineage2.fingerprint === initialLineage.fingerprint)) {
1286
+ if (!finalState2 || !finalObservation || !Be(finalState2.sourceHash === initialState.sourceHash, finalLineage2.fingerprint === initialLineage.fingerprint)) {
1287
1287
  return {
1288
1288
  session: ref.file,
1289
1289
  error: stalePointerError(
@@ -1579,7 +1579,7 @@ async function processMemoryExpand(args, context, cache, signal) {
1579
1579
  cache.forgetExpansionSnapshot(snapshot);
1580
1580
  const actualState = access.state();
1581
1581
  const actualLineage = access.lineage(branches);
1582
- if (!actualState || !endingObservation || !rt(actualState.sourceHash === snapshot.sourceHash, actualLineage.fingerprint === snapshot.lineageFingerprint)) {
1582
+ if (!actualState || !endingObservation || !Be(actualState.sourceHash === snapshot.sourceHash, actualLineage.fingerprint === snapshot.lineageFingerprint)) {
1583
1583
  return {
1584
1584
  session: ref.file,
1585
1585
  error: stalePointerError(
@@ -2208,4 +2208,4 @@ export {
2208
2208
  memoryActionSchemas,
2209
2209
  MemoryProvider
2210
2210
  };
2211
- //# sourceMappingURL=chunk-56RFFBBO.js.map
2211
+ //# sourceMappingURL=chunk-CRRUW26I.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  readFabricBranchSummaryDetails,
3
3
  readFabricProjectionTrace
4
- } from "./chunk-2YG4ZA2K.js";
4
+ } from "./chunk-TIJ3YQXX.js";
5
5
  import {
6
- wt
7
- } from "./chunk-WTLH5RY4.js";
6
+ Ze
7
+ } from "./chunk-BN7F52EG.js";
8
8
 
9
9
  // src/memory/normalize.ts
10
10
  import fs from "node:fs";
@@ -419,7 +419,7 @@ var normalizeRecords = (records, identity, maxEntryChars, options = {}) => {
419
419
  const type = asString(raw.type);
420
420
  const ordinal = rawOrdinal;
421
421
  rawOrdinal += 1;
422
- if (!wt(
422
+ if (!Ze(
423
423
  !options.lineage || options.lineage.entryOrdinals === null,
424
424
  options.lineage?.entryOrdinals?.has(ordinal) ?? false
425
425
  )) {
@@ -654,4 +654,4 @@ export {
654
654
  expandSessionEntries,
655
655
  expandSessionEntriesChecked
656
656
  };
657
- //# sourceMappingURL=chunk-I2TK65VR.js.map
657
+ //# sourceMappingURL=chunk-D5NYNIST.js.map
@@ -17,284 +17,124 @@ import fs from "node:fs";
17
17
  import path from "node:path";
18
18
 
19
19
  // src/verified/generated/storage-kernel.js
20
- function d(e, t) {
20
+ function p(e, t) {
21
21
  return { $: e < t ? "LT" : e === t ? "EQ" : "GT" };
22
22
  }
23
- function y(e) {
23
+ function c(e) {
24
24
  if (e > 281474976710655)
25
25
  throw "bend: a Nat past the largest immediate 2^48-1";
26
26
  return e;
27
27
  }
28
- function c(e) {
29
- return (typeof e == "bigint" || Number.isInteger(e)) && e >= 0 && e <= 2 ** 53 ? Number(e) : { [Symbol.toPrimitive]() {
30
- throw "bend: a Nat past the largest immediate 2^48-1";
31
- } };
32
- }
33
- function D(e) {
28
+ function P(e) {
34
29
  for (; e !== null && typeof e == "object" && e.$ === "$JMP"; )
35
30
  e = e.f(e.x);
36
31
  return e;
37
32
  }
38
- function m(e, t) {
39
- return (...a) => a.length < t ? m((...s) => e(...a, ...s), t - a.length) : e(...a);
33
+ function f(e, t) {
34
+ return (...n) => n.length < t ? f((...a) => e(...n, ...a), t - n.length) : P(e(...n));
40
35
  }
41
- function C(e, t) {
42
- let a = e.high, s = e.low, n = t.high, r = t.low;
43
- return u(p(a, n), p(s, r));
36
+ function D(e, t) {
37
+ let n = e.high, a = e.low, r = t.high, o = t.low;
38
+ return i(u(n, r), u(a, o));
44
39
  }
45
- function q(e, t) {
40
+ function b(e, t) {
46
41
  if (e.$ === "storage-plans.Any")
47
42
  return true;
48
43
  {
49
- let a = e.version;
50
- return C(a, t);
44
+ let n = e.version;
45
+ return D(n, t);
51
46
  }
52
47
  }
53
- function k(e) {
54
- let t = e.high, a = e.low, s = t < 2097151, n = a < 4294967295;
55
- return u(u(R(t, 2097151), R(a, 4294967295)), s || n);
48
+ function h(e) {
49
+ let t = e.high, n = e.low, a = t < 2097151, r = n < 4294967295;
50
+ return i(i(v(t, 2097151), v(n, 4294967295)), a || r);
56
51
  }
57
- function E(e, t, a) {
58
- return e ? { $: "storage-plans.Revision", high: y(t + 1), low: 0 } : { $: "storage-plans.Revision", high: t, low: y(a + 1) };
52
+ function m(e, t, n) {
53
+ return e ? { $: "storage-plans.Revision", high: c(t + 1), low: 0 } : { $: "storage-plans.Revision", high: t, low: c(n + 1) };
59
54
  }
60
- function h(e) {
61
- let t = e.high, a = e.low;
62
- return E(p(a, 4294967295), t, a);
55
+ function $(e) {
56
+ let t = e.high, n = e.low;
57
+ return m(u(n, 4294967295), t, n);
63
58
  }
64
- function x(e, t, a) {
65
- return e ? t : a;
59
+ function d(e, t, n) {
60
+ return e ? t : n;
66
61
  }
67
- function b(e, t) {
68
- return u(k(e), k(t));
62
+ function y(e, t) {
63
+ return i(h(e), h(t));
69
64
  }
70
- function N(e, t, a, s, n) {
65
+ function x(e, t, n, a, r) {
71
66
  if (e)
72
- if (a.$ === "storage-plans.Put") {
73
- let r = a.value, o = a.identity;
74
- return { $: "storage-plans.PutNext", key: t, value: r, identity: o, version: h(s), highWater: h(n) };
67
+ if (n.$ === "storage-plans.Put") {
68
+ let o = n.value, s = n.identity;
69
+ return { $: "storage-plans.PutNext", key: t, value: o, identity: s, version: $(a), highWater: $(r) };
75
70
  } else
76
- return { $: "storage-plans.DeleteNext", key: t, version: h(s), highWater: h(n) };
71
+ return { $: "storage-plans.DeleteNext", key: t, version: $(a), highWater: $(r) };
77
72
  else
78
73
  return { $: "storage-plans.Exhausted" };
79
74
  }
80
- function S(e, t, a, s, n) {
75
+ function A(e, t, n, a, r) {
81
76
  if (t.$ === "storage-plans.Delete")
82
- return a ? N(b(s, n), e, { $: "storage-plans.Delete" }, s, n) : { $: "storage-plans.Unchanged" };
77
+ return n ? x(y(a, r), e, { $: "storage-plans.Delete" }, a, r) : { $: "storage-plans.Unchanged" };
83
78
  {
84
- let r = t.value, o = t.identity;
85
- return N(b(x(a, s, n), n), e, { $: "storage-plans.Put", value: r, identity: o }, x(a, s, n), n);
79
+ let o = t.value, s = t.identity;
80
+ return x(y(d(n, a, r), r), e, { $: "storage-plans.Put", value: o, identity: s }, d(n, a, r), r);
86
81
  }
87
82
  }
88
- function U(e, t, a, s, n, r) {
89
- return e ? S(t, a, s, n, r) : { $: "storage-plans.Conflict" };
83
+ function C(e, t, n, a, r, o) {
84
+ return e ? A(t, n, a, r, o) : { $: "storage-plans.Conflict" };
90
85
  }
91
- function T(e, t) {
92
- let a = e.key, s = e.expected, n = e.change, r = t.present, o = t.version, l = t.highWater;
93
- return U(q(s, o), a, n, r, o, l);
86
+ function E(e, t) {
87
+ let n = e.key, a = e.expected, r = e.change, o = t.present, s = t.version, l = t.highWater;
88
+ return C(b(a, s), n, r, o, s, l);
94
89
  }
95
- function W(e, t) {
96
- return T(e, t);
90
+ function k(e, t) {
91
+ return E(e, t);
97
92
  }
98
- function u(e, t) {
93
+ function i(e, t) {
99
94
  return e ? t : false;
100
95
  }
101
- function p(e, t) {
102
- return B(d(e, t));
96
+ function u(e, t) {
97
+ return R(p(e, t));
103
98
  }
104
- function R(e, t) {
105
- return I(d(e, t));
99
+ function v(e, t) {
100
+ return T(p(e, t));
106
101
  }
107
- function B(e) {
102
+ function R(e) {
108
103
  return e.$ === "EQ";
109
104
  }
110
- function I(e) {
105
+ function T(e) {
111
106
  return e.$ !== "GT";
112
107
  }
113
- function $(e) {
114
- let t = [e];
115
- for (let a = t, s = 0; ; )
116
- switch (e.$) {
117
- case "storage-plans.Revision":
118
- return a = a[s] = { ...e, high: c(e.high), low: c(e.low) }, t[0];
119
- default:
120
- throw "bend: storage-plans.Revision has no tag " + e?.$ + " (its tags: storage-plans.Revision); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
121
- }
122
- }
123
- function i(e) {
124
- let t = [e];
125
- for (let a = t, s = 0; ; )
126
- switch (e.$) {
127
- case "storage-plans.Revision":
128
- return a = a[s] = { ...e, high: BigInt(e.high), low: BigInt(e.low) }, t[0];
129
- default:
130
- throw "bend: storage-plans.Revision has no tag " + e?.$ + " (its tags: storage-plans.Revision); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
131
- }
132
- }
133
- function j(e) {
134
- let t = [e];
135
- for (let a = t, s = 0; ; )
136
- switch (e.$) {
137
- case "storage-plans.Any":
138
- return a[s] = e, t[0];
139
- case "storage-plans.At":
140
- return a = a[s] = { ...e, version: $(e.version) }, t[0];
141
- default:
142
- throw "bend: storage-plans.Expectation has no tag " + e?.$ + " (its tags: storage-plans.Any, storage-plans.At); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
143
- }
144
- }
145
- function G(e) {
146
- let t = [e];
147
- for (let a = t, s = 0; ; )
148
- switch (e.$) {
149
- case "storage-plans.Any":
150
- return a[s] = e, t[0];
151
- case "storage-plans.At":
152
- return a = a[s] = { ...e, version: i(e.version) }, t[0];
153
- default:
154
- throw "bend: storage-plans.Expectation has no tag " + e?.$ + " (its tags: storage-plans.Any, storage-plans.At); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
155
- }
156
- }
157
- function f(e) {
158
- let t = [e];
159
- for (let a = t, s = 0; ; )
160
- switch (e.$) {
161
- case "Nil":
162
- return a[s] = e, t[0];
163
- case "Con":
164
- a = a[s] = { ...e, head: c(e.head) }, s = "tail", e = e[s];
165
- continue;
166
- default:
167
- 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)";
168
- }
169
- }
170
- function L(e) {
171
- let t = [e];
172
- for (let a = t, s = 0; ; )
173
- switch (e.$) {
174
- case "storage-plans.Put":
175
- return a = a[s] = { ...e, value: f(e.value), identity: f(e.identity) }, t[0];
176
- case "storage-plans.Delete":
177
- return a[s] = e, t[0];
178
- default:
179
- throw "bend: storage-plans.Change has no tag " + e?.$ + " (its tags: storage-plans.Put, storage-plans.Delete); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
180
- }
181
- }
182
- function g(e) {
183
- let t = [e];
184
- for (let a = t, s = 0; ; )
185
- switch (e.$) {
186
- case "Nil":
187
- return a[s] = e, t[0];
188
- case "Con":
189
- a = a[s] = { ...e, head: BigInt(e.head) }, s = "tail", e = e[s];
190
- continue;
191
- default:
192
- 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)";
193
- }
194
- }
195
- function M(e) {
196
- let t = [e];
197
- for (let a = t, s = 0; ; )
198
- switch (e.$) {
199
- case "storage-plans.Put":
200
- return a = a[s] = { ...e, value: g(e.value), identity: g(e.identity) }, t[0];
201
- case "storage-plans.Delete":
202
- return a[s] = e, t[0];
203
- default:
204
- throw "bend: storage-plans.Change has no tag " + e?.$ + " (its tags: storage-plans.Put, storage-plans.Delete); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
205
- }
206
- }
207
- function Q(e) {
208
- let t = [e];
209
- for (let a = t, s = 0; ; )
210
- switch (e.$) {
211
- case "storage-plans.Conflict":
212
- return a[s] = e, t[0];
213
- case "storage-plans.Exhausted":
214
- return a[s] = e, t[0];
215
- case "storage-plans.Unchanged":
216
- return a[s] = e, t[0];
217
- case "storage-plans.PutNext":
218
- return a = a[s] = { ...e, key: g(e.key), value: g(e.value), identity: g(e.identity), version: i(e.version), highWater: i(e.highWater) }, t[0];
219
- case "storage-plans.DeleteNext":
220
- return a = a[s] = { ...e, key: g(e.key), version: i(e.version), highWater: i(e.highWater) }, t[0];
221
- default:
222
- throw "bend: storage-plans.Plan has no tag " + e?.$ + " (its tags: storage-plans.Conflict, storage-plans.Exhausted, storage-plans.Unchanged, storage-plans.PutNext, storage-plans.DeleteNext); 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 J(e) {
226
- let t = [e];
227
- for (let a = t, s = 0; ; )
228
- switch (e.$) {
229
- case "storage-plans.Request":
230
- return a = a[s] = { ...e, key: f(e.key), expected: j(e.expected), change: L(e.change) }, t[0];
231
- default:
232
- throw "bend: storage-plans.Request has no tag " + e?.$ + " (its tags: storage-plans.Request); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
233
- }
234
- }
235
- function O(e) {
236
- let t = [e];
237
- for (let a = t, s = 0; ; )
238
- switch (e.$) {
239
- case "storage-plans.Slot":
240
- return a = a[s] = { ...e, version: $(e.version), highWater: $(e.highWater) }, t[0];
241
- default:
242
- throw "bend: storage-plans.Slot has no tag " + e?.$ + " (its tags: storage-plans.Slot); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
243
- }
244
- }
245
- function z(e) {
246
- let t = [e];
247
- for (let a = t, s = 0; ; )
248
- switch (e.$) {
249
- case "storage-plans.Request":
250
- return a = a[s] = { ...e, key: g(e.key), expected: G(e.expected), change: M(e.change) }, t[0];
251
- default:
252
- throw "bend: storage-plans.Request has no tag " + e?.$ + " (its tags: storage-plans.Request); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
253
- }
254
- }
255
- function F(e) {
256
- let t = [e];
257
- for (let a = t, s = 0; ; )
258
- switch (e.$) {
259
- case "storage-plans.Slot":
260
- return a = a[s] = { ...e, version: i(e.version), highWater: i(e.highWater) }, t[0];
261
- default:
262
- throw "bend: storage-plans.Slot has no tag " + e?.$ + " (its tags: storage-plans.Slot); a tag names its constructor as the loading file sees it, which a later version will make the same everywhere (#1105)";
263
- }
264
- }
265
- var P = /* @__PURE__ */ new Map([["Any", "storage-plans.Any"], ["Revision", "storage-plans.Revision"], ["Exhausted", "storage-plans.Exhausted"], ["Put", "storage-plans.Put"], ["PutNext", "storage-plans.PutNext"], ["DeleteNext", "storage-plans.DeleteNext"], ["Delete", "storage-plans.Delete"], ["Unchanged", "storage-plans.Unchanged"], ["Conflict", "storage-plans.Conflict"], ["At", "storage-plans.At"], ["Request", "storage-plans.Request"], ["Slot", "storage-plans.Slot"]]);
266
- var H = /* @__PURE__ */ new Map([["storage-plans.Any", "Any"], ["storage-plans.Revision", "Revision"], ["storage-plans.Exhausted", "Exhausted"], ["storage-plans.Put", "Put"], ["storage-plans.PutNext", "PutNext"], ["storage-plans.DeleteNext", "DeleteNext"], ["storage-plans.Delete", "Delete"], ["storage-plans.Unchanged", "Unchanged"], ["storage-plans.Conflict", "Conflict"], ["storage-plans.At", "At"], ["storage-plans.Request", "Request"], ["storage-plans.Slot", "Slot"]]);
267
- function w(e, t) {
268
- let a = [e];
269
- for (let s = [[a, 0]]; s.length > 0; ) {
270
- let [n, r] = s.pop(), o = n[r];
271
- if (o === null || typeof o != "object") continue;
272
- let l = Array.isArray(o) ? [...o] : { ...o };
273
- typeof l.$ == "string" && (l.$ = t.get(l.$) ?? l.$), n[r] = l;
274
- for (let A of Object.keys(l)) s.push([l, A]);
108
+ var w = /* @__PURE__ */ new Map([["Any", "storage-plans.Any"], ["Revision", "storage-plans.Revision"], ["Exhausted", "storage-plans.Exhausted"], ["Put", "storage-plans.Put"], ["PutNext", "storage-plans.PutNext"], ["DeleteNext", "storage-plans.DeleteNext"], ["Delete", "storage-plans.Delete"], ["Unchanged", "storage-plans.Unchanged"], ["Conflict", "storage-plans.Conflict"]]);
109
+ var U = /* @__PURE__ */ new Map([["storage-plans.Any", "Any"], ["storage-plans.Revision", "Revision"], ["storage-plans.Exhausted", "Exhausted"], ["storage-plans.Put", "Put"], ["storage-plans.PutNext", "PutNext"], ["storage-plans.DeleteNext", "DeleteNext"], ["storage-plans.Delete", "Delete"], ["storage-plans.Unchanged", "Unchanged"], ["storage-plans.Conflict", "Conflict"]]);
110
+ function g(e, t) {
111
+ let n = [e];
112
+ for (let a = [[n, 0]]; a.length > 0; ) {
113
+ let [r, o] = a.pop(), s = r[o];
114
+ if (s === null || typeof s != "object") continue;
115
+ let l = Array.isArray(s) ? [...s] : { ...s };
116
+ typeof l.$ == "string" && (l.$ = t.get(l.$) ?? l.$), r[o] = l;
117
+ for (let N of Object.keys(l)) a.push([l, N]);
275
118
  }
276
- return a[0];
119
+ return n[0];
277
120
  }
278
- var K = /* @__PURE__ */ m((e, t) => {
279
- let a = Q(D(W(J(e), O(t))));
280
- return z(e), F(t), a;
281
- }, 2);
282
- var V = (e, t) => w(K(w(e, P), w(t, P)), H);
121
+ var j = /* @__PURE__ */ f((e, t) => k(e, t), 2);
122
+ var G = (e, t) => g(j(g(e, w), g(t, w)), U);
283
123
 
284
124
  // src/verified/storage.ts
285
- var RADIX = 4294967296n;
125
+ var RADIX = 4294967296;
286
126
  var encode = (text) => {
287
127
  let result = { $: "Nil" };
288
128
  for (let index = text.length - 1; index >= 0; index--) {
289
- result = { $: "Con", head: BigInt(text.charCodeAt(index)), tail: result };
129
+ result = { $: "Con", head: text.charCodeAt(index), tail: result };
290
130
  }
291
131
  return result;
292
132
  };
293
133
  var decode = (text) => {
294
134
  const units = [];
295
135
  for (let node = text; node.$ === "Con"; node = node.tail) {
296
- if (node.head < 0n || node.head > 65535n) throw new Error("Invalid storage code unit");
297
- units.push(String.fromCharCode(Number(node.head)));
136
+ if (node.head < 0 || node.head > 65535) throw new Error("Invalid storage code unit");
137
+ units.push(String.fromCharCode(node.head));
298
138
  }
299
139
  return units.join("");
300
140
  };
@@ -305,14 +145,14 @@ var storageRevision = (value) => {
305
145
  return value;
306
146
  };
307
147
  var encodeRevision = (value) => {
308
- const exact = BigInt(storageRevision(value));
309
- return { $: "Revision", high: exact / RADIX, low: exact % RADIX };
148
+ const exact = storageRevision(value);
149
+ return { $: "Revision", high: Math.floor(exact / RADIX), low: exact % RADIX };
310
150
  };
311
151
  var decodeRevision = (value) => {
312
- if (value.high < 0n || value.high > 2097151n || value.low < 0n || value.low >= RADIX) {
152
+ if (!Number.isInteger(value.high) || !Number.isInteger(value.low) || value.high < 0 || value.high > 2097151 || value.low < 0 || value.low >= RADIX) {
313
153
  throw new Error("Invalid verified storage revision limbs");
314
154
  }
315
- return storageRevision(Number(value.high * RADIX + value.low));
155
+ return storageRevision(value.high * RADIX + value.low);
316
156
  };
317
157
  var serialize = (value) => {
318
158
  const json = JSON.stringify(value);
@@ -337,7 +177,7 @@ var capture = (key, ifVersion, payload) => {
337
177
  const actual = storageRevision(actualVersion);
338
178
  const clock = storageRevision(highWater);
339
179
  if (clock < actual) throw new Error("Inconsistent Fabric mesh high-water revision");
340
- const plan = V(
180
+ const plan = G(
341
181
  request,
342
182
  { $: "Slot", present, version: encodeRevision(actual), highWater: encodeRevision(clock) }
343
183
  );
@@ -1326,4 +1166,4 @@ export {
1326
1166
  MESH_MAX_SCHEDULE_AHEAD_MS,
1327
1167
  MeshStore
1328
1168
  };
1329
- //# sourceMappingURL=chunk-KBYSGB7E.js.map
1169
+ //# sourceMappingURL=chunk-EFETPXU2.js.map