@e4779/pi-fabric 0.97.0-fork.13 → 0.100.0-fork.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/THIRD_PARTY_NOTICES.md +5 -4
  2. package/dist/agents/manager.d.ts.map +1 -1
  3. package/dist/agents/request.d.ts.map +1 -1
  4. package/dist/agents/types.d.ts +4 -0
  5. package/dist/agents/types.d.ts.map +1 -1
  6. package/dist/agents.js +3 -3
  7. package/dist/chunks/{chunk-JCV54SSP.js → chunk-27ORW5EK.js} +41 -22
  8. package/dist/chunks/chunk-27ORW5EK.js.map +7 -0
  9. package/dist/chunks/{chunk-EQIGYLVB.js → chunk-3RFEMOJA.js} +9 -3
  10. package/dist/chunks/chunk-3RFEMOJA.js.map +7 -0
  11. package/dist/chunks/{chunk-D5GNTBV6.js → chunk-7HQKBGTL.js} +2 -2
  12. package/dist/chunks/{chunk-LNLQ2LX3.js → chunk-ASU53MOT.js} +2 -2
  13. package/dist/chunks/{chunk-V3PIO7QL.js → chunk-BUQZBG6O.js} +3 -43
  14. package/dist/chunks/chunk-BUQZBG6O.js.map +7 -0
  15. package/dist/chunks/{chunk-6K5SRGW6.js → chunk-C2DIKAOE.js} +4 -4
  16. package/dist/chunks/{chunk-FJSHRHOR.js → chunk-CPSPZGK4.js} +6 -6
  17. package/dist/chunks/{chunk-UBPFGMDQ.js → chunk-CXQF35XB.js} +4 -4
  18. package/dist/chunks/{chunk-3SIXBW6A.js → chunk-H4YYLQTX.js} +2 -2
  19. package/dist/chunks/{chunk-CSJSHBAT.js → chunk-I5VN6D5T.js} +48 -21
  20. package/dist/chunks/chunk-I5VN6D5T.js.map +7 -0
  21. package/dist/chunks/{chunk-VRYEGVHR.js → chunk-J7ZQERKA.js} +11 -8
  22. package/dist/chunks/chunk-J7ZQERKA.js.map +7 -0
  23. package/dist/chunks/{chunk-D4B4CCTA.js → chunk-JHQDS6YP.js} +2 -2
  24. package/dist/chunks/{chunk-OINADFEF.js → chunk-JWWGWUP7.js} +5 -5
  25. package/dist/chunks/{chunk-WXSELMFV.js → chunk-KFPUVFDS.js} +5 -5
  26. package/dist/chunks/{chunk-EPAFGT2M.js → chunk-LH2PGXSZ.js} +5 -1
  27. package/dist/chunks/{chunk-EPAFGT2M.js.map → chunk-LH2PGXSZ.js.map} +2 -2
  28. package/dist/chunks/{chunk-X3IRR7CV.js → chunk-M25A5R3F.js} +2 -2
  29. package/dist/chunks/chunk-MNTJX4U7.js +760 -0
  30. package/dist/chunks/chunk-MNTJX4U7.js.map +7 -0
  31. package/dist/chunks/{chunk-754HA6KO.js → chunk-NRLDV5R3.js} +7 -2
  32. package/dist/chunks/chunk-NRLDV5R3.js.map +7 -0
  33. package/dist/chunks/chunk-O4A5UOXU.js +44 -0
  34. package/dist/chunks/chunk-O4A5UOXU.js.map +7 -0
  35. package/dist/chunks/{chunk-4F27LJTS.js → chunk-OEJ6RFDO.js} +255 -72
  36. package/dist/chunks/chunk-OEJ6RFDO.js.map +7 -0
  37. package/dist/chunks/{chunk-VQGO4P7C.js → chunk-QIW7QMFI.js} +2 -2
  38. package/dist/chunks/{chunk-B4HECUJI.js → chunk-RUEKYUNR.js} +2 -2
  39. package/dist/chunks/{chunk-A4XPJESK.js → chunk-RZHXYLOY.js} +2 -2
  40. package/dist/chunks/{chunk-QNMMQAZ7.js → chunk-SDDBEBM4.js} +3 -3
  41. package/dist/chunks/{chunk-2LBC6TTP.js → chunk-UGMLWBVF.js} +390 -228
  42. package/dist/chunks/chunk-UGMLWBVF.js.map +7 -0
  43. package/dist/chunks/{chunk-5WUW727L.js → chunk-VGQ2IE7P.js} +19 -3
  44. package/dist/chunks/chunk-VGQ2IE7P.js.map +7 -0
  45. package/dist/chunks/{chunk-KBHITFTO.js → chunk-VRAGOMN4.js} +3 -1
  46. package/dist/chunks/chunk-VRAGOMN4.js.map +7 -0
  47. package/dist/chunks/{chunk-F676L43O.js → chunk-WK25T5ST.js} +11 -11
  48. package/dist/chunks/{chunk-IPHEM6RY.js → chunk-WQB6CVES.js} +2 -2
  49. package/dist/chunks/{chunk-CZSX6UG6.js → chunk-XYFOKDFM.js} +2 -2
  50. package/dist/chunks/{chunk-G2F2RDZI.js → chunk-YAPDV6LO.js} +2 -2
  51. package/dist/chunks/{chunk-Q5BMTL6A.js → chunk-YIEK7FH2.js} +4 -4
  52. package/dist/chunks/{chunk-KS44WKJJ.js → chunk-Z45SUO4B.js} +2 -2
  53. package/dist/commands/fabric.d.ts.map +1 -1
  54. package/dist/compaction/hook.js +6 -6
  55. package/dist/components/builtin-guidance.d.ts +4 -0
  56. package/dist/components/builtin-guidance.d.ts.map +1 -0
  57. package/dist/components/configuration.js +2 -2
  58. package/dist/config.d.ts +7 -0
  59. package/dist/config.d.ts.map +1 -1
  60. package/dist/core/action-registry.js +7 -7
  61. package/dist/core/file-lock.d.ts +4 -0
  62. package/dist/core/file-lock.d.ts.map +1 -1
  63. package/dist/core/provider-operations.js +162 -51
  64. package/dist/core/provider-operations.js.map +2 -2
  65. package/dist/core/shell-timing.d.ts +11 -0
  66. package/dist/core/shell-timing.d.ts.map +1 -0
  67. package/dist/entropy/index.js +12 -10
  68. package/dist/entropy/pool-store.d.ts +3 -1
  69. package/dist/entropy/pool-store.d.ts.map +1 -1
  70. package/dist/fabric-runtime-state.d.ts.map +1 -1
  71. package/dist/fabric-runtime-state.js +138 -55
  72. package/dist/fabric-runtime-state.js.map +4 -4
  73. package/dist/fabric-state.d.ts.map +1 -1
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +125 -58
  76. package/dist/index.js.map +3 -3
  77. package/dist/jev/observation.js +5 -5
  78. package/dist/jev.js +8 -8
  79. package/dist/lifecycle/broker.d.ts.map +1 -1
  80. package/dist/memory/digest.js +2 -2
  81. package/dist/memory/discovery.js +6 -6
  82. package/dist/memory/file-worker.js +9 -9
  83. package/dist/memory/normalize.js +5 -5
  84. package/dist/memory/search.js +7 -7
  85. package/dist/memory/worker-provider.js +10 -10
  86. package/dist/memory.js +10 -10
  87. package/dist/prewalk/messages.d.ts +1 -1
  88. package/dist/prewalk/messages.d.ts.map +1 -1
  89. package/dist/protocol.d.ts +12 -0
  90. package/dist/protocol.d.ts.map +1 -1
  91. package/dist/protocol.js +3 -1
  92. package/dist/providers/agents-actions.d.ts.map +1 -1
  93. package/dist/providers/agents-message-router.d.ts.map +1 -1
  94. package/dist/providers/agents-provider.d.ts.map +1 -1
  95. package/dist/providers/jev-provider.js +8 -8
  96. package/dist/providers/memory-provider.js +9 -9
  97. package/dist/providers/prewalk-provider.d.ts +3 -3
  98. package/dist/providers/prewalk-provider.d.ts.map +1 -1
  99. package/dist/residency/host.js +9 -9
  100. package/dist/residency/pi-entry.js +9 -9
  101. package/dist/runtime/core-override-guest-types.js +2 -2
  102. package/dist/runtime/guest-types.d.ts +1 -1
  103. package/dist/runtime/guest-types.d.ts.map +1 -1
  104. package/dist/runtime/guest-types.js +1 -1
  105. package/dist/runtime/monty-runtime.js +1 -1
  106. package/dist/runtime/typescript-kernel.js +2 -2
  107. package/dist/ui/conversation.d.ts +2 -1
  108. package/dist/ui/conversation.d.ts.map +1 -1
  109. package/dist/ui/conversation.js +41 -37
  110. package/dist/ui/conversation.js.map +2 -2
  111. package/dist/ui/dashboard.js +10 -8
  112. package/dist/ui/dashboard.js.map +1 -1
  113. package/dist/ui/fabric-model-selector.d.ts +3 -0
  114. package/dist/ui/fabric-model-selector.d.ts.map +1 -1
  115. package/dist/ui/settings.d.ts.map +1 -1
  116. package/dist/ui/settings.js +15 -2
  117. package/dist/ui/settings.js.map +2 -2
  118. package/dist/ui/shell-tasks.d.ts +2 -1
  119. package/dist/ui/shell-tasks.d.ts.map +1 -1
  120. package/dist/ui/shell-tasks.js +169 -81
  121. package/dist/ui/shell-tasks.js.map +3 -3
  122. package/dist/ui/snapshot.d.ts.map +1 -1
  123. package/dist/ui/structured.d.ts.map +1 -1
  124. package/dist/ui/widget.d.ts.map +1 -1
  125. package/dist/verified/generated/authority-kernel.js +188 -81
  126. package/dist/verified/generated/kernel.js +547 -265
  127. package/dist/verified/generated/lifecycle-kernel.d.ts +1 -1
  128. package/dist/verified/generated/lifecycle-kernel.js +172 -125
  129. package/dist/verified/generated/manifest.json +11 -11
  130. package/dist/verified/generated/provider-kernel.js +160 -52
  131. package/dist/verified/generated/storage-kernel.js +238 -69
  132. package/dist/worker/model-control.d.ts +1 -1
  133. package/dist/worker/model-control.d.ts.map +1 -1
  134. package/dist/worker/model-control.js +6 -3
  135. package/dist/worker/model-control.js.map +2 -2
  136. package/dist/worker/options.d.ts.map +1 -1
  137. package/dist/worker/options.js +15 -0
  138. package/dist/worker/options.js.map +2 -2
  139. package/dist/worker.js +3 -2
  140. package/dist/worker.js.map +2 -2
  141. package/docs/agents.md +1 -1
  142. package/docs/background-tasks.md +33 -0
  143. package/docs/configuration.md +4 -2
  144. package/docs/entropy.md +13 -0
  145. package/docs/harnesses.md +1 -1
  146. package/docs/interface.md +2 -0
  147. package/docs/jev.md +1 -1
  148. package/docs/prompt-cache.md +3 -3
  149. package/docs/provider-capabilities.md +1 -1
  150. package/docs/verified-kernels.md +10 -6
  151. package/package.json +1 -1
  152. package/proofs/lifecycle-spec.bend +4 -4
  153. package/proofs/lifecycle-types.d.ts +1 -1
  154. package/proofs/lifecycle.bend +6 -6
  155. package/scripts/test-verified-kernels.mjs +3 -3
  156. package/scripts/verified-kernels.mjs +53 -13
  157. package/skillsets/typescript/fabric-exec/references/agents.md +2 -0
  158. package/dist/chunks/chunk-2LBC6TTP.js.map +0 -7
  159. package/dist/chunks/chunk-4E63LJDD.js +0 -468
  160. package/dist/chunks/chunk-4E63LJDD.js.map +0 -7
  161. package/dist/chunks/chunk-4F27LJTS.js.map +0 -7
  162. package/dist/chunks/chunk-5WUW727L.js.map +0 -7
  163. package/dist/chunks/chunk-754HA6KO.js.map +0 -7
  164. package/dist/chunks/chunk-CSJSHBAT.js.map +0 -7
  165. package/dist/chunks/chunk-EQIGYLVB.js.map +0 -7
  166. package/dist/chunks/chunk-JCV54SSP.js.map +0 -7
  167. package/dist/chunks/chunk-KBHITFTO.js.map +0 -7
  168. package/dist/chunks/chunk-V3PIO7QL.js.map +0 -7
  169. package/dist/chunks/chunk-VRYEGVHR.js.map +0 -7
  170. /package/dist/chunks/{chunk-D5GNTBV6.js.map → chunk-7HQKBGTL.js.map} +0 -0
  171. /package/dist/chunks/{chunk-LNLQ2LX3.js.map → chunk-ASU53MOT.js.map} +0 -0
  172. /package/dist/chunks/{chunk-6K5SRGW6.js.map → chunk-C2DIKAOE.js.map} +0 -0
  173. /package/dist/chunks/{chunk-FJSHRHOR.js.map → chunk-CPSPZGK4.js.map} +0 -0
  174. /package/dist/chunks/{chunk-UBPFGMDQ.js.map → chunk-CXQF35XB.js.map} +0 -0
  175. /package/dist/chunks/{chunk-3SIXBW6A.js.map → chunk-H4YYLQTX.js.map} +0 -0
  176. /package/dist/chunks/{chunk-D4B4CCTA.js.map → chunk-JHQDS6YP.js.map} +0 -0
  177. /package/dist/chunks/{chunk-OINADFEF.js.map → chunk-JWWGWUP7.js.map} +0 -0
  178. /package/dist/chunks/{chunk-WXSELMFV.js.map → chunk-KFPUVFDS.js.map} +0 -0
  179. /package/dist/chunks/{chunk-X3IRR7CV.js.map → chunk-M25A5R3F.js.map} +0 -0
  180. /package/dist/chunks/{chunk-VQGO4P7C.js.map → chunk-QIW7QMFI.js.map} +0 -0
  181. /package/dist/chunks/{chunk-B4HECUJI.js.map → chunk-RUEKYUNR.js.map} +0 -0
  182. /package/dist/chunks/{chunk-A4XPJESK.js.map → chunk-RZHXYLOY.js.map} +0 -0
  183. /package/dist/chunks/{chunk-QNMMQAZ7.js.map → chunk-SDDBEBM4.js.map} +0 -0
  184. /package/dist/chunks/{chunk-F676L43O.js.map → chunk-WK25T5ST.js.map} +0 -0
  185. /package/dist/chunks/{chunk-IPHEM6RY.js.map → chunk-WQB6CVES.js.map} +0 -0
  186. /package/dist/chunks/{chunk-CZSX6UG6.js.map → chunk-XYFOKDFM.js.map} +0 -0
  187. /package/dist/chunks/{chunk-G2F2RDZI.js.map → chunk-YAPDV6LO.js.map} +0 -0
  188. /package/dist/chunks/{chunk-Q5BMTL6A.js.map → chunk-YIEK7FH2.js.map} +0 -0
  189. /package/dist/chunks/{chunk-KS44WKJJ.js.map → chunk-Z45SUO4B.js.map} +0 -0
@@ -32,11 +32,11 @@ import {
32
32
  DEFAULT_FABRIC_CONFIG,
33
33
  MAX_AGENT_TIMEOUT_MS,
34
34
  MIN_AGENT_TIMEOUT_MS
35
- } from "./chunk-EQIGYLVB.js";
35
+ } from "./chunk-3RFEMOJA.js";
36
36
  import {
37
37
  compileFabricSummary,
38
38
  rawContextTokens
39
- } from "./chunk-Q5BMTL6A.js";
39
+ } from "./chunk-YIEK7FH2.js";
40
40
  import {
41
41
  writeFileAtomic,
42
42
  writeJsonAtomic
@@ -65,7 +65,7 @@ import {
65
65
  import {
66
66
  compactionRequestBoundsError,
67
67
  encodeCompactionRequest
68
- } from "./chunk-LNLQ2LX3.js";
68
+ } from "./chunk-ASU53MOT.js";
69
69
 
70
70
  // src/core/model-usage.ts
71
71
  import { readFileSync } from "node:fs";
@@ -94,98 +94,269 @@ import fs from "node:fs";
94
94
  import path2 from "node:path";
95
95
 
96
96
  // src/verified/generated/storage-kernel.js
97
- function c(n, t) {
98
- return { $: n < t ? "LT" : n === t ? "EQ" : "GT" };
97
+ function d(e, t) {
98
+ return { $: e < t ? "LT" : e === t ? "EQ" : "GT" };
99
99
  }
100
- function g(n) {
101
- if (n > 281474976710655n)
100
+ function y(e) {
101
+ if (e > 281474976710655)
102
102
  throw "bend: a Nat past the largest immediate 2^48-1";
103
- return n;
103
+ return e;
104
104
  }
105
- function u(n, t) {
106
- return { $: "$JMP", f: n, x: t };
107
- }
108
- function $(n) {
109
- for (; n !== null && typeof n == "object" && n.$ === "$JMP"; )
110
- n = n.f(...n.x);
111
- return n;
112
- }
113
- function p(n, t) {
114
- return (...e) => e.length < t ? p((...r) => n(...e, ...r), t - e.length) : $(n(...e));
105
+ function c(e) {
106
+ return (typeof e == "bigint" || Number.isInteger(e)) && e >= 0 && e <= 2 ** 53 ? Number(e) : { [Symbol.toPrimitive]() {
107
+ throw "bend: a Nat past the largest immediate 2^48-1";
108
+ } };
115
109
  }
116
- function v(n, t) {
117
- return u(B, [n, t]);
110
+ function D(e) {
111
+ for (; e !== null && typeof e == "object" && e.$ === "$JMP"; )
112
+ e = e.f(...e.x);
113
+ return e;
118
114
  }
119
- function B(n, t) {
120
- let e = n.key, r = n.expected, i = n.change, o = t.present, l = t.version, m = t.highWater;
121
- return u(T, [$(b(r, l)), e, i, o, l, m]);
115
+ function m(e, t) {
116
+ return (...a) => a.length < t ? m((...s) => e(...a, ...s), t - a.length) : e(...a);
122
117
  }
123
- function T(n, t, e, r, i, o) {
124
- return n ? u(I, [t, e, r, i, o]) : { $: "Conflict" };
118
+ function C(e, t) {
119
+ let a = e.high, s = e.low, n = t.high, r = t.low;
120
+ return u(p(a, n), p(s, r));
125
121
  }
126
- function b(n, t) {
127
- if (n.$ === "Any")
122
+ function E(e, t) {
123
+ if (e.$ === "storage-plans.Any")
128
124
  return true;
129
125
  {
130
- let e = n.version;
131
- return u(N, [e, t]);
126
+ let a = e.version;
127
+ return C(a, t);
132
128
  }
133
129
  }
134
- function I(n, t, e, r, i) {
135
- if (t.$ === "Delete")
136
- return e ? u(h, [$(d(r, i)), n, { $: "Delete" }, r, i]) : { $: "Unchanged" };
137
- {
138
- let o = t.value, l = t.identity;
139
- return u(h, [$(d($(w(e, r, i)), i)), n, { $: "Put", value: o, identity: l }, $(w(e, r, i)), i]);
140
- }
130
+ function k(e) {
131
+ let t = e.high, a = e.low, s = t < 2097151, n = a < 4294967295;
132
+ return u(u(R(t, 2097151), R(a, 4294967295)), s || n);
141
133
  }
142
- function N(n, t) {
143
- let e = n.high, r = n.low, i = t.high, o = t.low;
144
- return u(a, [$(f(e, i)), $(f(r, o))]);
134
+ function q(e, t, a) {
135
+ return e ? { $: "storage-plans.Revision", high: y(t + 1), low: 0 } : { $: "storage-plans.Revision", high: t, low: y(a + 1) };
145
136
  }
146
- function h(n, t, e, r, i) {
147
- if (n)
148
- if (e.$ === "Put") {
149
- let o = e.value, l = e.identity;
150
- return { $: "PutNext", key: t, value: o, identity: l, version: $(s(r)), highWater: $(s(i)) };
137
+ function h(e) {
138
+ let t = e.high, a = e.low;
139
+ return q(p(a, 4294967295), t, a);
140
+ }
141
+ function x(e, t, a) {
142
+ return e ? t : a;
143
+ }
144
+ function b(e, t) {
145
+ return u(k(e), k(t));
146
+ }
147
+ function N(e, t, a, s, n) {
148
+ if (e)
149
+ if (a.$ === "storage-plans.Put") {
150
+ let r = a.value, o = a.identity;
151
+ return { $: "storage-plans.PutNext", key: t, value: r, identity: o, version: h(s), highWater: h(n) };
151
152
  } else
152
- return { $: "DeleteNext", key: t, version: $(s(r)), highWater: $(s(i)) };
153
+ return { $: "storage-plans.DeleteNext", key: t, version: h(s), highWater: h(n) };
153
154
  else
154
- return { $: "Exhausted" };
155
+ return { $: "storage-plans.Exhausted" };
156
+ }
157
+ function S(e, t, a, s, n) {
158
+ if (t.$ === "storage-plans.Delete")
159
+ return a ? N(b(s, n), e, { $: "storage-plans.Delete" }, s, n) : { $: "storage-plans.Unchanged" };
160
+ {
161
+ let r = t.value, o = t.identity;
162
+ return N(b(x(a, s, n), n), e, { $: "storage-plans.Put", value: r, identity: o }, x(a, s, n), n);
163
+ }
164
+ }
165
+ function T(e, t, a, s, n, r) {
166
+ return e ? S(t, a, s, n, r) : { $: "storage-plans.Conflict" };
167
+ }
168
+ function U(e, t) {
169
+ let a = e.key, s = e.expected, n = e.change, r = t.present, o = t.version, l = t.highWater;
170
+ return T(E(s, o), a, n, r, o, l);
171
+ }
172
+ function W(e, t) {
173
+ return U(e, t);
174
+ }
175
+ function u(e, t) {
176
+ return e ? t : false;
177
+ }
178
+ function p(e, t) {
179
+ return L(d(e, t));
180
+ }
181
+ function R(e, t) {
182
+ return B(d(e, t));
183
+ }
184
+ function L(e) {
185
+ return e.$ === "LT" ? false : e.$ === "EQ";
186
+ }
187
+ function B(e) {
188
+ return e.$ === "LT" ? true : e.$ === "EQ";
189
+ }
190
+ function $(e) {
191
+ let t = [e];
192
+ for (let a = t, s = 0; ; )
193
+ switch (e.$) {
194
+ case "storage-plans.Revision":
195
+ return a = a[s] = { ...e, high: c(e.high), low: c(e.low) }, t[0];
196
+ default:
197
+ 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)";
198
+ }
199
+ }
200
+ function i(e) {
201
+ let t = [e];
202
+ for (let a = t, s = 0; ; )
203
+ switch (e.$) {
204
+ case "storage-plans.Revision":
205
+ return a = a[s] = { ...e, high: BigInt(e.high), low: BigInt(e.low) }, t[0];
206
+ default:
207
+ 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)";
208
+ }
209
+ }
210
+ function I(e) {
211
+ let t = [e];
212
+ for (let a = t, s = 0; ; )
213
+ switch (e.$) {
214
+ case "storage-plans.Any":
215
+ return a[s] = e, t[0];
216
+ case "storage-plans.At":
217
+ return a = a[s] = { ...e, version: $(e.version) }, t[0];
218
+ default:
219
+ 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)";
220
+ }
155
221
  }
156
- function d(n, t) {
157
- return u(a, [$(y(n)), $(y(t))]);
222
+ function j(e) {
223
+ let t = [e];
224
+ for (let a = t, s = 0; ; )
225
+ switch (e.$) {
226
+ case "storage-plans.Any":
227
+ return a[s] = e, t[0];
228
+ case "storage-plans.At":
229
+ return a = a[s] = { ...e, version: i(e.version) }, t[0];
230
+ default:
231
+ 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)";
232
+ }
158
233
  }
159
- function w(n, t, e) {
160
- return n ? t : e;
234
+ function f(e) {
235
+ let t = [e];
236
+ for (let a = t, s = 0; ; )
237
+ switch (e.$) {
238
+ case "Nil":
239
+ return a[s] = e, t[0];
240
+ case "Con":
241
+ a = a[s] = { ...e, head: c(e.head) }, s = "tail", e = e[s];
242
+ continue;
243
+ default:
244
+ 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)";
245
+ }
246
+ }
247
+ function M(e) {
248
+ let t = [e];
249
+ for (let a = t, s = 0; ; )
250
+ switch (e.$) {
251
+ case "storage-plans.Put":
252
+ return a = a[s] = { ...e, value: f(e.value), identity: f(e.identity) }, t[0];
253
+ case "storage-plans.Delete":
254
+ return a[s] = e, t[0];
255
+ default:
256
+ 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)";
257
+ }
161
258
  }
162
- function a(n, t) {
163
- return n ? t : false;
259
+ function g(e) {
260
+ let t = [e];
261
+ for (let a = t, s = 0; ; )
262
+ switch (e.$) {
263
+ case "Nil":
264
+ return a[s] = e, t[0];
265
+ case "Con":
266
+ a = a[s] = { ...e, head: BigInt(e.head) }, s = "tail", e = e[s];
267
+ continue;
268
+ default:
269
+ 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)";
270
+ }
164
271
  }
165
- function f(n, t) {
166
- return u(P, [c(n, t)]);
272
+ function Q(e) {
273
+ let t = [e];
274
+ for (let a = t, s = 0; ; )
275
+ switch (e.$) {
276
+ case "storage-plans.Put":
277
+ return a = a[s] = { ...e, value: g(e.value), identity: g(e.identity) }, t[0];
278
+ case "storage-plans.Delete":
279
+ return a[s] = e, t[0];
280
+ default:
281
+ 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)";
282
+ }
167
283
  }
168
- function s(n) {
169
- let t = n.high, e = n.low;
170
- return u(E, [$(f(e, BigInt(4294967295))), t, e]);
284
+ function G(e) {
285
+ let t = [e];
286
+ for (let a = t, s = 0; ; )
287
+ switch (e.$) {
288
+ case "storage-plans.Conflict":
289
+ return a[s] = e, t[0];
290
+ case "storage-plans.Exhausted":
291
+ return a[s] = e, t[0];
292
+ case "storage-plans.Unchanged":
293
+ return a[s] = e, t[0];
294
+ case "storage-plans.PutNext":
295
+ 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];
296
+ case "storage-plans.DeleteNext":
297
+ return a = a[s] = { ...e, key: g(e.key), version: i(e.version), highWater: i(e.highWater) }, t[0];
298
+ default:
299
+ 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)";
300
+ }
171
301
  }
172
- function y(n) {
173
- let t = n.high, e = n.low, r = BigInt(2097151), i = BigInt(4294967295), o = t < r, l = e < i;
174
- return u(a, [$(a($(x(t, BigInt(2097151))), $(x(e, BigInt(4294967295))))), o || l]);
302
+ function J(e) {
303
+ let t = [e];
304
+ for (let a = t, s = 0; ; )
305
+ switch (e.$) {
306
+ case "storage-plans.Request":
307
+ return a = a[s] = { ...e, key: f(e.key), expected: I(e.expected), change: M(e.change) }, t[0];
308
+ default:
309
+ 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)";
310
+ }
175
311
  }
176
- function P(n) {
177
- return n.$ === "LT" ? false : n.$ === "EQ";
312
+ function O(e) {
313
+ let t = [e];
314
+ for (let a = t, s = 0; ; )
315
+ switch (e.$) {
316
+ case "storage-plans.Slot":
317
+ return a = a[s] = { ...e, version: $(e.version), highWater: $(e.highWater) }, t[0];
318
+ default:
319
+ 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)";
320
+ }
178
321
  }
179
- function E(n, t, e) {
180
- return n ? { $: "Revision", high: g(t + 1n), low: 0n } : { $: "Revision", high: t, low: g(e + 1n) };
322
+ function z(e) {
323
+ let t = [e];
324
+ for (let a = t, s = 0; ; )
325
+ switch (e.$) {
326
+ case "storage-plans.Request":
327
+ return a = a[s] = { ...e, key: g(e.key), expected: j(e.expected), change: Q(e.change) }, t[0];
328
+ default:
329
+ 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)";
330
+ }
181
331
  }
182
- function x(n, t) {
183
- return u(k, [c(n, t)]);
332
+ function F(e) {
333
+ let t = [e];
334
+ for (let a = t, s = 0; ; )
335
+ switch (e.$) {
336
+ case "storage-plans.Slot":
337
+ return a = a[s] = { ...e, version: i(e.version), highWater: i(e.highWater) }, t[0];
338
+ default:
339
+ 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)";
340
+ }
184
341
  }
185
- function k(n) {
186
- return n.$ === "LT" ? true : n.$ === "EQ";
342
+ 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"]]);
343
+ 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"]]);
344
+ function w(e, t) {
345
+ let a = [e];
346
+ for (let s = [[a, 0]]; s.length > 0; ) {
347
+ let [n, r] = s.pop(), o = n[r];
348
+ if (o === null || typeof o != "object") continue;
349
+ let l = Array.isArray(o) ? [...o] : { ...o };
350
+ typeof l.$ == "string" && (l.$ = t.get(l.$) ?? l.$), n[r] = l;
351
+ for (let A of Object.keys(l)) s.push([l, A]);
352
+ }
353
+ return a[0];
187
354
  }
188
- var C = /* @__PURE__ */ p(v, 2);
355
+ var K = /* @__PURE__ */ m((e, t) => {
356
+ let a = G(D(W(J(e), O(t))));
357
+ return z(e), F(t), a;
358
+ }, 2);
359
+ var V = (e, t) => w(K(w(e, P), w(t, P)), H);
189
360
 
190
361
  // src/verified/storage.ts
191
362
  var RADIX = 4294967296n;
@@ -243,7 +414,7 @@ var capture = (key, ifVersion, payload) => {
243
414
  const actual = storageRevision(actualVersion);
244
415
  const clock = storageRevision(highWater);
245
416
  if (clock < actual) throw new Error("Inconsistent Fabric mesh high-water revision");
246
- const plan = C(
417
+ const plan = V(
247
418
  request,
248
419
  { $: "Slot", present, version: encodeRevision(actual), highWater: encodeRevision(clock) }
249
420
  );
@@ -2617,6 +2788,9 @@ var AgentManager = class {
2617
2788
  if (request.persona && runner !== "veda") {
2618
2789
  throw new Error(`The persona option is only supported by the Veda runner, not ${runner}`);
2619
2790
  }
2791
+ if (request.persistSession === true && runner !== "claude") {
2792
+ throw new Error("persistSession is only supported by the Claude runner");
2793
+ }
2620
2794
  if (runner === "claude" && request.recursive) {
2621
2795
  throw new Error(
2622
2796
  "Claude runner does not support recursive Fabric. Use a Pi runner for recursive: true, or omit recursive for Claude Code tools."
@@ -2775,6 +2949,10 @@ var AgentManager = class {
2775
2949
  ...model ? ["--model", model] : [],
2776
2950
  ...thinking ? ["--thinking", thinking] : [],
2777
2951
  ...systemPrompt ? ["--system-prompt", systemPrompt] : [],
2952
+ "--persist-session",
2953
+ String(request.persistSession === true),
2954
+ "--model-admission",
2955
+ this.config.modelAdmission ?? "strict",
2778
2956
  ...sessionFile ? ["--session-file", sessionFile] : [],
2779
2957
  ...sessionExportFile ? ["--session-export-file", sessionExportFile] : [],
2780
2958
  ...inheritedSessionPins && inheritedSessionPins.length > 0 ? ["--inherited-session-pins", serializeInheritedSessionPins(inheritedSessionPins)] : [],
@@ -6381,10 +6559,15 @@ var LifecycleBroker = class {
6381
6559
  }
6382
6560
  async #drain() {
6383
6561
  const entries = this.mesh.listAll(FABRIC_LIFECYCLE_SUBSCRIPTION_PREFIX);
6562
+ if (entries.length === 0) return;
6563
+ let directory;
6384
6564
  for (const entry of entries) {
6385
6565
  const subscription = lifecycleSubscriptionFromValue(entry.value);
6386
6566
  if (!subscription || entry.key !== subscriptionKey(subscription.id)) continue;
6387
- const target = this.participants.get(subscription.to);
6567
+ directory ??= new Map(
6568
+ this.participants.list({ scope: "project" }).map((record) => [record.id, record])
6569
+ );
6570
+ const target = directory.get(subscription.to) ?? this.participants.get(subscription.to);
6388
6571
  if (!target || target.stale || !target.local) continue;
6389
6572
  await this.#drainSubscription(entry, subscription);
6390
6573
  }
@@ -7539,4 +7722,4 @@ export {
7539
7722
  agentParticipantRecords,
7540
7723
  actorParticipantRecord
7541
7724
  };
7542
- //# sourceMappingURL=chunk-4F27LJTS.js.map
7725
+ //# sourceMappingURL=chunk-OEJ6RFDO.js.map