@e4779/pi-fabric 0.117.2-fork.31 → 0.131.4-fork.33

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 (811) hide show
  1. package/README.md +13 -6
  2. package/THIRD_PARTY_NOTICES.md +6 -14
  3. package/dist/activity/store.d.ts +2 -1
  4. package/dist/activity/store.d.ts.map +1 -1
  5. package/dist/actors/binding-store.d.ts +13 -0
  6. package/dist/actors/binding-store.d.ts.map +1 -1
  7. package/dist/actors/directory.d.ts.map +1 -1
  8. package/dist/actors/feedback.d.ts +5 -0
  9. package/dist/actors/feedback.d.ts.map +1 -0
  10. package/dist/actors/global-registry.d.ts +8 -0
  11. package/dist/actors/global-registry.d.ts.map +1 -1
  12. package/dist/actors/host-event-payload.d.ts +14 -0
  13. package/dist/actors/host-event-payload.d.ts.map +1 -1
  14. package/dist/actors/manager.d.ts +4 -3
  15. package/dist/actors/manager.d.ts.map +1 -1
  16. package/dist/actors/mesh-monitor.d.ts +2 -0
  17. package/dist/actors/mesh-monitor.d.ts.map +1 -1
  18. package/dist/actors/name-policy.d.ts +3 -0
  19. package/dist/actors/name-policy.d.ts.map +1 -0
  20. package/dist/actors/registry-store.d.ts +14 -5
  21. package/dist/actors/registry-store.d.ts.map +1 -1
  22. package/dist/actors/store-read.d.ts +16 -0
  23. package/dist/actors/store-read.d.ts.map +1 -0
  24. package/dist/agents/agent-files.d.ts +80 -0
  25. package/dist/agents/agent-files.d.ts.map +1 -0
  26. package/dist/agents/agent-files.js +327 -0
  27. package/dist/agents/agent-files.js.map +7 -0
  28. package/dist/agents/child-skills.d.ts +60 -0
  29. package/dist/agents/child-skills.d.ts.map +1 -0
  30. package/dist/agents/child-skills.js +94 -0
  31. package/dist/agents/child-skills.js.map +7 -0
  32. package/dist/agents/clone-first-worktree.d.ts +6 -0
  33. package/dist/agents/clone-first-worktree.d.ts.map +1 -1
  34. package/dist/agents/completion-inbox.d.ts.map +1 -1
  35. package/dist/agents/cow-clone.d.ts.map +1 -1
  36. package/dist/agents/handoff.d.ts +12 -2
  37. package/dist/agents/handoff.d.ts.map +1 -1
  38. package/dist/agents/herdr-status.d.ts +26 -0
  39. package/dist/agents/herdr-status.d.ts.map +1 -0
  40. package/dist/agents/herdr-status.js +161 -0
  41. package/dist/agents/herdr-status.js.map +7 -0
  42. package/dist/agents/hosted-run.d.ts +20 -4
  43. package/dist/agents/hosted-run.d.ts.map +1 -1
  44. package/dist/agents/manager.d.ts +18 -2
  45. package/dist/agents/manager.d.ts.map +1 -1
  46. package/dist/agents/model-pin-guard.d.ts +27 -0
  47. package/dist/agents/model-pin-guard.d.ts.map +1 -0
  48. package/dist/agents/model-pin-guard.js +86 -0
  49. package/dist/agents/model-pin-guard.js.map +7 -0
  50. package/dist/agents/model-pin.d.ts +25 -0
  51. package/dist/agents/model-pin.d.ts.map +1 -0
  52. package/dist/agents/provider-bridge.d.ts +7 -6
  53. package/dist/agents/provider-bridge.d.ts.map +1 -1
  54. package/dist/agents/provider-bridge.js +33 -5
  55. package/dist/agents/provider-bridge.js.map +3 -3
  56. package/dist/agents/request.d.ts.map +1 -1
  57. package/dist/agents/result.d.ts.map +1 -1
  58. package/dist/agents/result.js +1 -1
  59. package/dist/agents/runner-notice.d.ts.map +1 -1
  60. package/dist/agents/runner-protocol.d.ts +8 -0
  61. package/dist/agents/runner-protocol.d.ts.map +1 -1
  62. package/dist/agents/service-schema.d.ts.map +1 -1
  63. package/dist/agents/transports/herdr-core-socket.d.ts +13 -0
  64. package/dist/agents/transports/herdr-core-socket.d.ts.map +1 -0
  65. package/dist/agents/transports/herdr-core-transport.d.ts +10 -0
  66. package/dist/agents/transports/herdr-core-transport.d.ts.map +1 -0
  67. package/dist/agents/transports/herdr-socket.d.ts +12 -0
  68. package/dist/agents/transports/herdr-socket.d.ts.map +1 -0
  69. package/dist/agents/transports/herdr-transport.d.ts.map +1 -1
  70. package/dist/agents/types.d.ts +51 -0
  71. package/dist/agents/types.d.ts.map +1 -1
  72. package/dist/agents/worker-recovery.d.ts +75 -0
  73. package/dist/agents/worker-recovery.d.ts.map +1 -0
  74. package/dist/agents/worktree-manager.d.ts.map +1 -1
  75. package/dist/agents.js +12 -11
  76. package/dist/agents.js.map +2 -2
  77. package/dist/audit/details.d.ts +38 -1
  78. package/dist/audit/details.d.ts.map +1 -1
  79. package/dist/audit/projection.d.ts.map +1 -1
  80. package/dist/audit/trace-schema.d.ts +50 -0
  81. package/dist/audit/trace-schema.d.ts.map +1 -0
  82. package/dist/audit/trace.d.ts +2 -48
  83. package/dist/audit/trace.d.ts.map +1 -1
  84. package/dist/chunks/chunk-2RWNVCFD.js +483 -0
  85. package/dist/chunks/chunk-2RWNVCFD.js.map +7 -0
  86. package/dist/chunks/chunk-2SCMGO2Z.js +16 -0
  87. package/dist/chunks/chunk-2SCMGO2Z.js.map +7 -0
  88. package/dist/chunks/chunk-35EEGOH3.js +324 -0
  89. package/dist/chunks/chunk-35EEGOH3.js.map +7 -0
  90. package/dist/chunks/{chunk-UTOBAZ5T.js → chunk-37NIOSVU.js} +1 -1
  91. package/dist/chunks/chunk-37NIOSVU.js.map +7 -0
  92. package/dist/chunks/chunk-3IJEQBFS.js +25 -0
  93. package/dist/chunks/chunk-3IJEQBFS.js.map +7 -0
  94. package/dist/chunks/{chunk-EHQQ4KCX.js → chunk-3MOY6WIB.js} +84 -19
  95. package/dist/chunks/chunk-3MOY6WIB.js.map +7 -0
  96. package/dist/chunks/chunk-3VK6UGAN.js +64 -0
  97. package/dist/chunks/chunk-3VK6UGAN.js.map +7 -0
  98. package/dist/chunks/{chunk-ROTCDDOV.js → chunk-3XT5WHSG.js} +59 -119
  99. package/dist/chunks/chunk-3XT5WHSG.js.map +7 -0
  100. package/dist/chunks/{chunk-FIDUHKMM.js → chunk-4BYS4ZLY.js} +16 -16
  101. package/dist/chunks/chunk-4BYS4ZLY.js.map +7 -0
  102. package/dist/chunks/{chunk-UOM37PE4.js → chunk-4PBW54I2.js} +162 -92
  103. package/dist/chunks/chunk-4PBW54I2.js.map +7 -0
  104. package/dist/chunks/{chunk-ZEXCKK4K.js → chunk-4WKD3YM3.js} +3 -3
  105. package/dist/chunks/{chunk-PK4NIJEV.js → chunk-4XMXFHAR.js} +62 -3
  106. package/dist/chunks/chunk-4XMXFHAR.js.map +7 -0
  107. package/dist/chunks/{chunk-4EW7GVUR.js → chunk-56NMRVTV.js} +589 -377
  108. package/dist/chunks/chunk-56NMRVTV.js.map +7 -0
  109. package/dist/chunks/chunk-5QJFDKPN.js +179 -0
  110. package/dist/chunks/chunk-5QJFDKPN.js.map +7 -0
  111. package/dist/chunks/{chunk-P7CBPPHY.js → chunk-6GWDGTHC.js} +5 -5
  112. package/dist/chunks/{chunk-P7CBPPHY.js.map → chunk-6GWDGTHC.js.map} +1 -1
  113. package/dist/chunks/chunk-6HO2IUQ5.js +104 -0
  114. package/dist/chunks/chunk-6HO2IUQ5.js.map +7 -0
  115. package/dist/chunks/chunk-6OGYPHNQ.js +62 -0
  116. package/dist/chunks/chunk-6OGYPHNQ.js.map +7 -0
  117. package/dist/chunks/{chunk-G4TLWHRS.js → chunk-7N7IC3Z2.js} +4 -3
  118. package/dist/chunks/{chunk-G4TLWHRS.js.map → chunk-7N7IC3Z2.js.map} +2 -2
  119. package/dist/chunks/{chunk-5XBYFSI5.js → chunk-7YNE4NB2.js} +2 -2
  120. package/dist/chunks/chunk-ASOJYFKU.js +1316 -0
  121. package/dist/chunks/chunk-ASOJYFKU.js.map +7 -0
  122. package/dist/chunks/{chunk-NTC2MCB6.js → chunk-B5L3X3ID.js} +1 -1
  123. package/dist/chunks/{chunk-NTC2MCB6.js.map → chunk-B5L3X3ID.js.map} +1 -1
  124. package/dist/chunks/chunk-BIBRWZWQ.js +325 -0
  125. package/dist/chunks/chunk-BIBRWZWQ.js.map +7 -0
  126. package/dist/chunks/{chunk-K6QXUGS5.js → chunk-BMAEZNZ5.js} +2 -1
  127. package/dist/chunks/{chunk-FSB2VIRZ.js → chunk-CBIV747V.js} +14 -3
  128. package/dist/chunks/chunk-CBIV747V.js.map +7 -0
  129. package/dist/chunks/{chunk-CCHZXF6K.js → chunk-CXYJJ3HZ.js} +3 -3
  130. package/dist/chunks/{chunk-R2XQ6AHT.js → chunk-DGERP4VL.js} +22 -10
  131. package/dist/chunks/chunk-DGERP4VL.js.map +7 -0
  132. package/dist/chunks/{chunk-C7Z6F3SO.js → chunk-DGUXJSYA.js} +64 -33
  133. package/dist/chunks/chunk-DGUXJSYA.js.map +7 -0
  134. package/dist/chunks/chunk-F2LGSRIN.js +38 -0
  135. package/dist/chunks/chunk-F2LGSRIN.js.map +7 -0
  136. package/dist/chunks/chunk-F6A6MQ6G.js +609 -0
  137. package/dist/chunks/chunk-F6A6MQ6G.js.map +7 -0
  138. package/dist/chunks/{chunk-IR3PIHJM.js → chunk-FK73YJKV.js} +67 -2
  139. package/dist/chunks/chunk-FK73YJKV.js.map +7 -0
  140. package/dist/chunks/{chunk-XCEEQ5AB.js → chunk-G2DZJ5LK.js} +1607 -1567
  141. package/dist/chunks/chunk-G2DZJ5LK.js.map +7 -0
  142. package/dist/chunks/{chunk-VYQV5JRT.js → chunk-GJVKEHDL.js} +2 -2
  143. package/dist/chunks/chunk-GJVKEHDL.js.map +7 -0
  144. package/dist/chunks/{chunk-TIIIHPHF.js → chunk-GS67KDMV.js} +2 -2
  145. package/dist/chunks/{chunk-D5NYNIST.js → chunk-H57KPL3V.js} +5 -5
  146. package/dist/chunks/{chunk-KVYNGDGC.js → chunk-HFDJWLMS.js} +6 -6
  147. package/dist/chunks/{chunk-KVYNGDGC.js.map → chunk-HFDJWLMS.js.map} +1 -1
  148. package/dist/chunks/{chunk-INRXG4J5.js → chunk-HGD75NZY.js} +2 -2
  149. package/dist/chunks/{chunk-CRRUW26I.js → chunk-HRDMBGMY.js} +12 -12
  150. package/dist/chunks/{chunk-CRRUW26I.js.map → chunk-HRDMBGMY.js.map} +2 -2
  151. package/dist/chunks/{chunk-GO32KSEZ.js → chunk-HRVYXRWZ.js} +85 -10
  152. package/dist/chunks/chunk-HRVYXRWZ.js.map +7 -0
  153. package/dist/chunks/{chunk-MLLYR3Y6.js → chunk-HSEZPCL5.js} +19 -78
  154. package/dist/chunks/chunk-HSEZPCL5.js.map +7 -0
  155. package/dist/chunks/chunk-JMUUNW2H.js +65 -0
  156. package/dist/chunks/chunk-JMUUNW2H.js.map +7 -0
  157. package/dist/chunks/{chunk-UXIBKMUM.js → chunk-KIFOEBYJ.js} +4 -4
  158. package/dist/chunks/{chunk-3FJUP3GV.js → chunk-L6H46CPY.js} +2 -2
  159. package/dist/chunks/{chunk-SPCJXN4K.js → chunk-LKYLD5SN.js} +298 -65
  160. package/dist/chunks/chunk-LKYLD5SN.js.map +7 -0
  161. package/dist/chunks/{chunk-K7J2ABAZ.js → chunk-LRSZFYUC.js} +92 -32
  162. package/dist/chunks/chunk-LRSZFYUC.js.map +7 -0
  163. package/dist/chunks/{chunk-GIK2WNAK.js → chunk-LZ2ZXOCU.js} +112 -23
  164. package/dist/chunks/chunk-LZ2ZXOCU.js.map +7 -0
  165. package/dist/chunks/{chunk-FUY6XVRX.js → chunk-MPMEK3IQ.js} +2 -2
  166. package/dist/chunks/{chunk-HP5P7NBO.js → chunk-MSDL7U6Q.js} +4 -4
  167. package/dist/chunks/{chunk-ASSLHWZS.js → chunk-MX53BRAC.js} +2 -2
  168. package/dist/chunks/chunk-N7ZAK2PB.js +132 -0
  169. package/dist/chunks/chunk-N7ZAK2PB.js.map +7 -0
  170. package/dist/chunks/{chunk-VSDUSNIA.js → chunk-NBIYYMKS.js} +8 -2
  171. package/dist/chunks/chunk-NBIYYMKS.js.map +7 -0
  172. package/dist/chunks/chunk-NENQZCGW.js +45 -0
  173. package/dist/chunks/chunk-NENQZCGW.js.map +7 -0
  174. package/dist/chunks/chunk-NJHJKINP.js +47 -0
  175. package/dist/chunks/chunk-NJHJKINP.js.map +7 -0
  176. package/dist/chunks/{chunk-U366I5K2.js → chunk-NQ7IWEIF.js} +18 -6
  177. package/dist/chunks/chunk-NQ7IWEIF.js.map +7 -0
  178. package/dist/chunks/{chunk-ZQMBS5SH.js → chunk-OJ4HAALD.js} +15 -12
  179. package/dist/chunks/chunk-OJ4HAALD.js.map +7 -0
  180. package/dist/chunks/chunk-OZCJU3PZ.js +33 -0
  181. package/dist/chunks/chunk-OZCJU3PZ.js.map +7 -0
  182. package/dist/chunks/chunk-P3DCXKL3.js +40 -0
  183. package/dist/chunks/chunk-P3DCXKL3.js.map +7 -0
  184. package/dist/chunks/chunk-P7YSPKTM.js +294 -0
  185. package/dist/chunks/chunk-P7YSPKTM.js.map +7 -0
  186. package/dist/chunks/chunk-PQVUMJ5J.js +223 -0
  187. package/dist/chunks/chunk-PQVUMJ5J.js.map +7 -0
  188. package/dist/chunks/chunk-PUBHBEYO.js +84 -0
  189. package/dist/chunks/chunk-PUBHBEYO.js.map +7 -0
  190. package/dist/chunks/{chunk-P4KH4S4S.js → chunk-QGTD3LAZ.js} +5 -20
  191. package/dist/chunks/chunk-QGTD3LAZ.js.map +7 -0
  192. package/dist/chunks/{chunk-TIJ3YQXX.js → chunk-QOEOKW2X.js} +2 -2
  193. package/dist/chunks/{chunk-TIJ3YQXX.js.map → chunk-QOEOKW2X.js.map} +1 -1
  194. package/dist/chunks/{chunk-QT4W5YVB.js → chunk-RAA3FAYZ.js} +2 -2
  195. package/dist/chunks/{chunk-3UGN25XS.js → chunk-RKJPBTBB.js} +98 -1664
  196. package/dist/chunks/chunk-RKJPBTBB.js.map +7 -0
  197. package/dist/chunks/{chunk-WJJXODAB.js → chunk-RLKRZXSX.js} +8 -1
  198. package/dist/chunks/{chunk-WJJXODAB.js.map → chunk-RLKRZXSX.js.map} +2 -2
  199. package/dist/chunks/chunk-RWKQ5SRW.js +129 -0
  200. package/dist/chunks/chunk-RWKQ5SRW.js.map +7 -0
  201. package/dist/chunks/chunk-SW25R47N.js +71 -0
  202. package/dist/chunks/chunk-SW25R47N.js.map +7 -0
  203. package/dist/chunks/{chunk-EKODKR6Y.js → chunk-TEMKDJJY.js} +148 -72
  204. package/dist/chunks/chunk-TEMKDJJY.js.map +7 -0
  205. package/dist/chunks/{chunk-EFETPXU2.js → chunk-TJZYM2SP.js} +118 -237
  206. package/dist/chunks/chunk-TJZYM2SP.js.map +7 -0
  207. package/dist/chunks/{chunk-53N2I4QA.js → chunk-TXCNZCZP.js} +2 -2
  208. package/dist/chunks/{chunk-LNASO4VT.js → chunk-U6Y6TKJL.js} +45 -20
  209. package/dist/chunks/chunk-U6Y6TKJL.js.map +7 -0
  210. package/dist/chunks/chunk-UD7LFV43.js +28 -0
  211. package/dist/chunks/chunk-UD7LFV43.js.map +7 -0
  212. package/dist/chunks/{chunk-7QKKLBHJ.js → chunk-UPMWLOKL.js} +10 -1
  213. package/dist/chunks/{chunk-7QKKLBHJ.js.map → chunk-UPMWLOKL.js.map} +2 -2
  214. package/dist/chunks/chunk-V4OW2ULC.js +422 -0
  215. package/dist/chunks/chunk-V4OW2ULC.js.map +7 -0
  216. package/dist/chunks/{chunk-FE6NOAO7.js → chunk-VGRUWTMG.js} +1993 -659
  217. package/dist/chunks/chunk-VGRUWTMG.js.map +7 -0
  218. package/dist/chunks/{chunk-PYFJW3HC.js → chunk-W5FEHVZA.js} +2 -16
  219. package/dist/chunks/{chunk-PYFJW3HC.js.map → chunk-W5FEHVZA.js.map} +3 -3
  220. package/dist/chunks/chunk-WKFRGICG.js +101 -0
  221. package/dist/chunks/chunk-WKFRGICG.js.map +7 -0
  222. package/dist/chunks/{chunk-LEU5CDSL.js → chunk-XFOSUGLU.js} +5 -5
  223. package/dist/chunks/{chunk-MZUC6LLH.js → chunk-XMYG2TKR.js} +4 -4
  224. package/dist/chunks/{chunk-MZUC6LLH.js.map → chunk-XMYG2TKR.js.map} +1 -1
  225. package/dist/chunks/chunk-YC65P7ZO.js +57 -0
  226. package/dist/chunks/chunk-YC65P7ZO.js.map +7 -0
  227. package/dist/chunks/{chunk-5UBRGTVN.js → chunk-ZHROHNEE.js} +31 -15
  228. package/dist/chunks/chunk-ZHROHNEE.js.map +7 -0
  229. package/dist/cli/decisions.d.ts.map +1 -1
  230. package/dist/cli/decisions.js +15 -3
  231. package/dist/cli/decisions.js.map +2 -2
  232. package/dist/cli/mesh.js +4 -3
  233. package/dist/cli/mesh.js.map +1 -1
  234. package/dist/commands/fabric-handler.d.ts +7 -0
  235. package/dist/commands/fabric-handler.d.ts.map +1 -0
  236. package/dist/commands/fabric-handler.js +916 -0
  237. package/dist/commands/fabric-handler.js.map +7 -0
  238. package/dist/commands/fabric.d.ts +11 -1
  239. package/dist/commands/fabric.d.ts.map +1 -1
  240. package/dist/compaction/claim-events.d.ts +61 -0
  241. package/dist/compaction/claim-events.d.ts.map +1 -0
  242. package/dist/compaction/claim-events.js +210 -0
  243. package/dist/compaction/claim-events.js.map +7 -0
  244. package/dist/compaction/claim.d.ts +51 -0
  245. package/dist/compaction/claim.d.ts.map +1 -0
  246. package/dist/compaction/hook.d.ts +28 -2
  247. package/dist/compaction/hook.d.ts.map +1 -1
  248. package/dist/compaction/hook.js +12 -7
  249. package/dist/compaction/owner.js +9 -8
  250. package/dist/compaction/trace-events.d.ts +1 -1
  251. package/dist/compaction/trace-events.d.ts.map +1 -1
  252. package/dist/components/configuration.js +6 -6
  253. package/dist/components/effect-scope.d.ts.map +1 -1
  254. package/dist/config.d.ts +40 -3
  255. package/dist/config.d.ts.map +1 -1
  256. package/dist/core/action-arguments.d.ts.map +1 -1
  257. package/dist/core/action-policy-hooks.d.ts +69 -0
  258. package/dist/core/action-policy-hooks.d.ts.map +1 -0
  259. package/dist/core/action-registry.d.ts +31 -10
  260. package/dist/core/action-registry.d.ts.map +1 -1
  261. package/dist/core/action-registry.js +12 -9
  262. package/dist/core/approval-controller.d.ts +23 -3
  263. package/dist/core/approval-controller.d.ts.map +1 -1
  264. package/dist/core/atomic-write.d.ts +164 -0
  265. package/dist/core/atomic-write.d.ts.map +1 -1
  266. package/dist/core/call-presentation.d.ts +14 -0
  267. package/dist/core/call-presentation.d.ts.map +1 -0
  268. package/dist/core/child-tool-allowlist.d.ts +17 -1
  269. package/dist/core/child-tool-allowlist.d.ts.map +1 -1
  270. package/dist/core/compact-controller.d.ts +34 -0
  271. package/dist/core/compact-controller.d.ts.map +1 -1
  272. package/dist/core/core-override-guidance.d.ts +3 -1
  273. package/dist/core/core-override-guidance.d.ts.map +1 -1
  274. package/dist/core/file-lock.d.ts.map +1 -1
  275. package/dist/core/foreground-tools.d.ts +4 -1
  276. package/dist/core/foreground-tools.d.ts.map +1 -1
  277. package/dist/core/host-policy.d.ts +43 -0
  278. package/dist/core/host-policy.d.ts.map +1 -0
  279. package/dist/core/host-sdk-runtime.d.ts.map +1 -1
  280. package/dist/core/host-sdk.d.ts.map +1 -1
  281. package/dist/core/host-sdk.js +1 -1
  282. package/dist/core/managed-host-guidance.d.ts +5 -0
  283. package/dist/core/managed-host-guidance.d.ts.map +1 -0
  284. package/dist/core/model-aliases.d.ts +22 -0
  285. package/dist/core/model-aliases.d.ts.map +1 -0
  286. package/dist/core/model-resolution.d.ts +41 -20
  287. package/dist/core/model-resolution.d.ts.map +1 -1
  288. package/dist/core/native-tool-result.d.ts +1 -0
  289. package/dist/core/native-tool-result.d.ts.map +1 -1
  290. package/dist/core/program-tasks.d.ts +52 -0
  291. package/dist/core/program-tasks.d.ts.map +1 -0
  292. package/dist/core/prompt-guidance.d.ts +5 -0
  293. package/dist/core/prompt-guidance.d.ts.map +1 -0
  294. package/dist/core/prompt-guidance.js +159 -0
  295. package/dist/core/prompt-guidance.js.map +7 -0
  296. package/dist/core/provider-operations.d.ts.map +1 -1
  297. package/dist/core/provider-operations.js +60 -108
  298. package/dist/core/provider-operations.js.map +3 -3
  299. package/dist/core/shell-inbox.d.ts.map +1 -1
  300. package/dist/core/shell-jobs.d.ts +7 -5
  301. package/dist/core/shell-jobs.d.ts.map +1 -1
  302. package/dist/core/shell-timing.d.ts.map +1 -1
  303. package/dist/core/skill-prompt.d.ts +1 -1
  304. package/dist/core/skill-prompt.d.ts.map +1 -1
  305. package/dist/core/skill-references.d.ts +1 -1
  306. package/dist/core/skill-references.d.ts.map +1 -1
  307. package/dist/core/system-guidance.d.ts.map +1 -1
  308. package/dist/core/tool-result-proxy.d.ts.map +1 -1
  309. package/dist/decisions/command.d.ts +2 -1
  310. package/dist/decisions/command.d.ts.map +1 -1
  311. package/dist/decisions/command.js +40 -12
  312. package/dist/decisions/command.js.map +2 -2
  313. package/dist/decisions/events.d.ts +12 -0
  314. package/dist/decisions/events.d.ts.map +1 -0
  315. package/dist/decisions/events.js +130 -0
  316. package/dist/decisions/events.js.map +7 -0
  317. package/dist/decisions/host.d.ts +31 -3
  318. package/dist/decisions/host.d.ts.map +1 -1
  319. package/dist/decisions/render.d.ts +44 -0
  320. package/dist/decisions/render.d.ts.map +1 -0
  321. package/dist/decisions/store.d.ts +8 -0
  322. package/dist/decisions/store.d.ts.map +1 -1
  323. package/dist/durable/agent.d.ts +8 -0
  324. package/dist/durable/agent.d.ts.map +1 -1
  325. package/dist/durable/extension-load-error.d.ts +8 -0
  326. package/dist/durable/extension-load-error.d.ts.map +1 -0
  327. package/dist/durable/session.d.ts +1 -0
  328. package/dist/durable/session.d.ts.map +1 -1
  329. package/dist/durable/worker-host.d.ts +10 -1
  330. package/dist/durable/worker-host.d.ts.map +1 -1
  331. package/dist/durable/worker-host.js +10 -1181
  332. package/dist/durable/worker-host.js.map +4 -4
  333. package/dist/durable/worker-options.d.ts +3 -0
  334. package/dist/durable/worker-options.d.ts.map +1 -1
  335. package/dist/durable/worker-role-seed.d.ts +82 -0
  336. package/dist/durable/worker-role-seed.d.ts.map +1 -0
  337. package/dist/durable/worker.js +43 -4
  338. package/dist/durable/worker.js.map +2 -2
  339. package/dist/durable-controls.d.ts.map +1 -1
  340. package/dist/durable-extension-wasm.d.ts +8 -0
  341. package/dist/durable-extension-wasm.d.ts.map +1 -0
  342. package/dist/durable-extension-wasm.js +32 -0
  343. package/dist/durable-extension-wasm.js.map +7 -0
  344. package/dist/durable-extension.d.ts +94 -0
  345. package/dist/durable-extension.d.ts.map +1 -0
  346. package/dist/durable-extension.js +649 -0
  347. package/dist/durable-extension.js.map +7 -0
  348. package/dist/durable-host.d.ts +8 -0
  349. package/dist/durable-host.d.ts.map +1 -0
  350. package/dist/durable-host.js +20 -0
  351. package/dist/durable-host.js.map +7 -0
  352. package/dist/durable-journal.d.ts +94 -0
  353. package/dist/durable-journal.d.ts.map +1 -0
  354. package/dist/durable.d.ts.map +1 -1
  355. package/dist/durable.js +13 -10
  356. package/dist/durable.js.map +2 -2
  357. package/dist/entropy/index.js +12 -10
  358. package/dist/entropy/pool-store.d.ts.map +1 -1
  359. package/dist/execution-service.d.ts +14 -0
  360. package/dist/execution-service.d.ts.map +1 -1
  361. package/dist/extension-bootstrap.d.ts.map +1 -1
  362. package/dist/extension-bootstrap.js +28 -27
  363. package/dist/extension-bootstrap.js.map +2 -2
  364. package/dist/extension-copy.d.ts +21 -0
  365. package/dist/extension-copy.d.ts.map +1 -0
  366. package/dist/extension-copy.js +90 -0
  367. package/dist/extension-copy.js.map +7 -0
  368. package/dist/extension.d.ts +1 -1
  369. package/dist/extension.d.ts.map +1 -1
  370. package/dist/fabric-exec-arguments.d.ts.map +1 -1
  371. package/dist/fabric-exec-tool.d.ts +2 -1
  372. package/dist/fabric-exec-tool.d.ts.map +1 -1
  373. package/dist/fabric-runtime-state.d.ts +19 -0
  374. package/dist/fabric-runtime-state.d.ts.map +1 -1
  375. package/dist/fabric-runtime-state.js +2205 -839
  376. package/dist/fabric-runtime-state.js.map +4 -4
  377. package/dist/fabric-state.d.ts +44 -1
  378. package/dist/fabric-state.d.ts.map +1 -1
  379. package/dist/feedback.d.ts +5 -0
  380. package/dist/feedback.d.ts.map +1 -0
  381. package/dist/index.d.ts +5 -3
  382. package/dist/index.d.ts.map +1 -1
  383. package/dist/index.js +88 -53
  384. package/dist/index.js.map +2 -2
  385. package/dist/jev/client.js +2 -2
  386. package/dist/jev/manager.d.ts +3 -0
  387. package/dist/jev/manager.d.ts.map +1 -1
  388. package/dist/jev/observation.d.ts +1 -1
  389. package/dist/jev/observation.js +6 -6
  390. package/dist/jev-fabric/bridge.d.ts.map +1 -1
  391. package/dist/jev.js +11 -12
  392. package/dist/main-agent.d.ts +2 -1
  393. package/dist/main-agent.d.ts.map +1 -1
  394. package/dist/managed-host.d.ts +13 -0
  395. package/dist/managed-host.d.ts.map +1 -1
  396. package/dist/memory/digest.js +2 -2
  397. package/dist/memory/discovery.js +6 -7
  398. package/dist/memory/file-worker.js +10 -11
  399. package/dist/memory/file-worker.js.map +1 -1
  400. package/dist/memory/normalize.js +5 -6
  401. package/dist/memory/search.js +7 -8
  402. package/dist/memory/worker-provider.js +11 -12
  403. package/dist/memory.js +11 -12
  404. package/dist/memory.js.map +1 -1
  405. package/dist/mesh/grants.d.ts +3 -3
  406. package/dist/mesh/grants.d.ts.map +1 -1
  407. package/dist/mesh/store.d.ts +8 -0
  408. package/dist/mesh/store.d.ts.map +1 -1
  409. package/dist/native-codemode.d.ts.map +1 -1
  410. package/dist/native-tool-catalog.d.ts.map +1 -1
  411. package/dist/native-tool-catalog.js +12 -3
  412. package/dist/native-tool-catalog.js.map +2 -2
  413. package/dist/programs/host.d.ts +18 -6
  414. package/dist/programs/host.d.ts.map +1 -1
  415. package/dist/programs/host.js +71 -47
  416. package/dist/programs/host.js.map +2 -2
  417. package/dist/programs/source.d.ts +11 -0
  418. package/dist/programs/source.d.ts.map +1 -1
  419. package/dist/programs/store.d.ts.map +1 -1
  420. package/dist/protocol.d.ts +504 -8
  421. package/dist/protocol.d.ts.map +1 -1
  422. package/dist/protocol.js +41 -11
  423. package/dist/provider-globals.d.ts +13 -0
  424. package/dist/provider-globals.d.ts.map +1 -0
  425. package/dist/providers/agents-actions.d.ts.map +1 -1
  426. package/dist/providers/agents-provider.d.ts +3 -0
  427. package/dist/providers/agents-provider.d.ts.map +1 -1
  428. package/dist/providers/captured-tools-provider.d.ts +5 -0
  429. package/dist/providers/captured-tools-provider.d.ts.map +1 -1
  430. package/dist/providers/compact-provider.d.ts +4 -1
  431. package/dist/providers/compact-provider.d.ts.map +1 -1
  432. package/dist/providers/components-provider.d.ts.map +1 -1
  433. package/dist/providers/decisions-provider.d.ts +9 -1
  434. package/dist/providers/decisions-provider.d.ts.map +1 -1
  435. package/dist/providers/jev-provider.d.ts +1 -1
  436. package/dist/providers/jev-provider.js +11 -12
  437. package/dist/providers/memory-provider.js +10 -11
  438. package/dist/providers/pi-tools-provider.d.ts +14 -0
  439. package/dist/providers/pi-tools-provider.d.ts.map +1 -1
  440. package/dist/providers/programs-provider.d.ts.map +1 -1
  441. package/dist/providers/sessions-provider.d.ts +7 -0
  442. package/dist/providers/sessions-provider.d.ts.map +1 -1
  443. package/dist/repeat-guard.d.ts +7 -6
  444. package/dist/repeat-guard.d.ts.map +1 -1
  445. package/dist/residency/actor-client.js +3 -3
  446. package/dist/residency/client.d.ts +15 -0
  447. package/dist/residency/client.d.ts.map +1 -1
  448. package/dist/residency/host.d.ts.map +1 -1
  449. package/dist/residency/host.js +34 -23
  450. package/dist/residency/launcher.js +1 -1
  451. package/dist/residency/pi-entry.js +34 -23
  452. package/dist/residency/pi-entry.js.map +1 -1
  453. package/dist/residency/protocol.d.ts +2 -0
  454. package/dist/residency/protocol.d.ts.map +1 -1
  455. package/dist/runners.js +11 -1
  456. package/dist/runners.js.map +2 -2
  457. package/dist/runtime/core-override-guest-types.js +2 -2
  458. package/dist/runtime/cpython-child-source.d.ts.map +1 -1
  459. package/dist/runtime/cpython-runtime.d.ts.map +1 -1
  460. package/dist/runtime/cpython-runtime.js +51 -21
  461. package/dist/runtime/cpython-runtime.js.map +2 -2
  462. package/dist/runtime/deadline-pause.d.ts +2 -0
  463. package/dist/runtime/deadline-pause.d.ts.map +1 -1
  464. package/dist/runtime/dynamic-guest-types.d.ts.map +1 -1
  465. package/dist/runtime/dynamic-guest-types.js +2 -1
  466. package/dist/runtime/exec-journal.d.ts +73 -0
  467. package/dist/runtime/exec-journal.d.ts.map +1 -0
  468. package/dist/runtime/exec-journal.js +335 -0
  469. package/dist/runtime/exec-journal.js.map +7 -0
  470. package/dist/runtime/guest-types.d.ts +3 -2
  471. package/dist/runtime/guest-types.d.ts.map +1 -1
  472. package/dist/runtime/guest-types.js +1 -1
  473. package/dist/runtime/journal-shim.d.ts +3 -0
  474. package/dist/runtime/journal-shim.d.ts.map +1 -0
  475. package/dist/runtime/kernel.d.ts +95 -1
  476. package/dist/runtime/kernel.d.ts.map +1 -1
  477. package/dist/runtime/monty-bridge.d.ts +6 -2
  478. package/dist/runtime/monty-bridge.d.ts.map +1 -1
  479. package/dist/runtime/monty-runtime.d.ts.map +1 -1
  480. package/dist/runtime/monty-runtime.js +27 -15
  481. package/dist/runtime/monty-runtime.js.map +2 -2
  482. package/dist/runtime/native-codemode-guest.d.ts.map +1 -1
  483. package/dist/runtime/node-process-runtime.d.ts.map +1 -1
  484. package/dist/runtime/node-process-runtime.js +7 -5
  485. package/dist/runtime/quickjs-runtime.d.ts +7 -1
  486. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  487. package/dist/runtime/quickjs-runtime.js +5 -4
  488. package/dist/runtime/sha256.d.ts +4 -0
  489. package/dist/runtime/sha256.d.ts.map +1 -0
  490. package/dist/runtime/transpile.d.ts +8 -0
  491. package/dist/runtime/transpile.d.ts.map +1 -0
  492. package/dist/runtime/type-checker.d.ts +1 -7
  493. package/dist/runtime/type-checker.d.ts.map +1 -1
  494. package/dist/runtime/type-checker.js +4 -2
  495. package/dist/runtime/typescript-kernel.js +13 -10
  496. package/dist/runtime/typescript-kernel.js.map +1 -1
  497. package/dist/runtime-state-builtins.d.ts.map +1 -1
  498. package/dist/speculation/scanner.js +1 -1
  499. package/dist/speculation/store.d.ts +7 -16
  500. package/dist/speculation/store.d.ts.map +1 -1
  501. package/dist/speculation/types.d.ts +1 -0
  502. package/dist/speculation/types.d.ts.map +1 -1
  503. package/dist/storage/retention.d.ts.map +1 -1
  504. package/dist/topology/participant-directory.d.ts +26 -1
  505. package/dist/topology/participant-directory.d.ts.map +1 -1
  506. package/dist/topology/peer-presence.d.ts.map +1 -1
  507. package/dist/topology/peer-settle.js +11 -0
  508. package/dist/topology/peer-settle.js.map +7 -0
  509. package/dist/topology/session-label-settings.d.ts +13 -0
  510. package/dist/topology/session-label-settings.d.ts.map +1 -0
  511. package/dist/topology/session-label.d.ts +60 -0
  512. package/dist/topology/session-label.d.ts.map +1 -0
  513. package/dist/topology/types.d.ts +27 -0
  514. package/dist/topology/types.d.ts.map +1 -1
  515. package/dist/type-error-guidance.js +1 -1
  516. package/dist/ui/controller.d.ts +1 -0
  517. package/dist/ui/controller.d.ts.map +1 -1
  518. package/dist/ui/conversation-chrome.d.ts.map +1 -1
  519. package/dist/ui/conversation-chrome.js +3 -2
  520. package/dist/ui/conversation-commands.d.ts +1 -1
  521. package/dist/ui/conversation-commands.d.ts.map +1 -1
  522. package/dist/ui/conversation-native-reader.js +2 -2
  523. package/dist/ui/conversation-selection.d.ts +4 -1
  524. package/dist/ui/conversation-selection.d.ts.map +1 -1
  525. package/dist/ui/conversation-targets.d.ts.map +1 -1
  526. package/dist/ui/conversation-targets.js +2 -2
  527. package/dist/ui/conversation.d.ts +25 -24
  528. package/dist/ui/conversation.d.ts.map +1 -1
  529. package/dist/ui/conversation.js +170 -339
  530. package/dist/ui/conversation.js.map +2 -2
  531. package/dist/ui/core-tool-render.d.ts +1 -0
  532. package/dist/ui/core-tool-render.d.ts.map +1 -1
  533. package/dist/ui/dashboard-model.d.ts.map +1 -1
  534. package/dist/ui/dashboard.d.ts.map +1 -1
  535. package/dist/ui/dashboard.js +23 -16
  536. package/dist/ui/dashboard.js.map +2 -2
  537. package/dist/ui/fabric-render.d.ts +7 -0
  538. package/dist/ui/fabric-render.d.ts.map +1 -1
  539. package/dist/ui/footer-dock.d.ts +48 -0
  540. package/dist/ui/footer-dock.d.ts.map +1 -0
  541. package/dist/ui/format.d.ts +7 -0
  542. package/dist/ui/format.d.ts.map +1 -1
  543. package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -1
  544. package/dist/ui/settings-sections-presentation.d.ts.map +1 -1
  545. package/dist/ui/settings-values.d.ts +2 -1
  546. package/dist/ui/settings-values.d.ts.map +1 -1
  547. package/dist/ui/settings.js +60 -19
  548. package/dist/ui/settings.js.map +2 -2
  549. package/dist/ui/shell-hang-keys.d.ts +8 -1
  550. package/dist/ui/shell-hang-keys.d.ts.map +1 -1
  551. package/dist/ui/shell-tasks.d.ts +2 -2
  552. package/dist/ui/shell-tasks.d.ts.map +1 -1
  553. package/dist/ui/shell-tasks.js +27 -94
  554. package/dist/ui/shell-tasks.js.map +2 -2
  555. package/dist/ui/snapshot.d.ts.map +1 -1
  556. package/dist/ui/terminal-title.d.ts +41 -0
  557. package/dist/ui/terminal-title.d.ts.map +1 -0
  558. package/dist/ui/types.d.ts +4 -0
  559. package/dist/ui/types.d.ts.map +1 -1
  560. package/dist/ui/widget-keys.d.ts +5 -0
  561. package/dist/ui/widget-keys.d.ts.map +1 -0
  562. package/dist/ui/widget.d.ts +40 -18
  563. package/dist/ui/widget.d.ts.map +1 -1
  564. package/dist/ui/word-diff/line-emphasis.js +1603 -0
  565. package/dist/ui/word-diff/line-emphasis.js.map +7 -0
  566. package/dist/util.d.ts +2 -0
  567. package/dist/util.d.ts.map +1 -1
  568. package/dist/verified/authority.d.ts +2 -2
  569. package/dist/verified/authority.d.ts.map +1 -1
  570. package/dist/verified/budget.d.ts +4 -0
  571. package/dist/verified/budget.d.ts.map +1 -0
  572. package/dist/verified/generated/actor-name.d.ts +4 -0
  573. package/dist/verified/generated/actor-name.js +17 -0
  574. package/dist/verified/generated/authority.d.ts +4 -0
  575. package/dist/verified/generated/authority.js +28 -0
  576. package/dist/verified/generated/budget.d.ts +4 -0
  577. package/dist/verified/generated/budget.js +17 -0
  578. package/dist/verified/generated/compaction.d.ts +4 -0
  579. package/dist/verified/generated/compaction.js +19 -0
  580. package/dist/verified/generated/grants.d.ts +4 -0
  581. package/dist/verified/generated/grants.js +17 -0
  582. package/dist/verified/generated/lifecycle.d.ts +4 -0
  583. package/dist/verified/generated/lifecycle.js +50 -0
  584. package/dist/verified/generated/manifest.json +137 -48
  585. package/dist/verified/generated/policy.d.ts +17 -0
  586. package/dist/verified/generated/policy.js +211 -0
  587. package/dist/verified/generated/provider.d.ts +4 -0
  588. package/dist/verified/generated/provider.js +18 -0
  589. package/dist/verified/generated/resources.d.ts +6 -0
  590. package/dist/verified/generated/resources.js +73 -0
  591. package/dist/verified/generated/speculation.d.ts +6 -0
  592. package/dist/verified/generated/speculation.js +48 -0
  593. package/dist/verified/generated/storage.d.ts +4 -0
  594. package/dist/verified/generated/storage.js +18 -0
  595. package/dist/verified/grants.d.ts +22 -0
  596. package/dist/verified/grants.d.ts.map +1 -0
  597. package/dist/verified/lifecycle.d.ts +31 -0
  598. package/dist/verified/lifecycle.d.ts.map +1 -0
  599. package/dist/verified/machine.d.ts +18 -0
  600. package/dist/verified/machine.d.ts.map +1 -0
  601. package/dist/verified/memory.d.ts +1 -1
  602. package/dist/verified/memory.d.ts.map +1 -1
  603. package/dist/verified/nat.d.ts +1 -1
  604. package/dist/verified/nat.d.ts.map +1 -1
  605. package/dist/verified/policy.d.ts +17 -5
  606. package/dist/verified/policy.d.ts.map +1 -1
  607. package/dist/verified/provider.d.ts +22 -0
  608. package/dist/verified/provider.d.ts.map +1 -0
  609. package/dist/verified/resources.d.ts +21 -7
  610. package/dist/verified/resources.d.ts.map +1 -1
  611. package/dist/verified/speculation.d.ts +36 -0
  612. package/dist/verified/speculation.d.ts.map +1 -0
  613. package/dist/verified/storage.d.ts.map +1 -1
  614. package/dist/worker/missing-install.d.ts +8 -0
  615. package/dist/worker/missing-install.d.ts.map +1 -0
  616. package/dist/worker/options.d.ts.map +1 -1
  617. package/dist/worker/options.js +25 -0
  618. package/dist/worker/options.js.map +2 -2
  619. package/dist/worker/prompt-lifecycle.d.ts +16 -0
  620. package/dist/worker/prompt-lifecycle.d.ts.map +1 -0
  621. package/dist/worker/prompt-lifecycle.js +90 -0
  622. package/dist/worker/prompt-lifecycle.js.map +7 -0
  623. package/dist/worker/questions.d.ts +15 -3
  624. package/dist/worker/questions.d.ts.map +1 -1
  625. package/dist/worker/questions.js +53 -8
  626. package/dist/worker/questions.js.map +2 -2
  627. package/dist/worker/recovery-watchdog.d.ts +22 -0
  628. package/dist/worker/recovery-watchdog.d.ts.map +1 -1
  629. package/dist/worker/recovery-watchdog.js +116 -1
  630. package/dist/worker/recovery-watchdog.js.map +2 -2
  631. package/dist/worker/result.js +1 -1
  632. package/dist/worker/result.js.map +2 -2
  633. package/dist/worker.js +131 -21
  634. package/dist/worker.js.map +2 -2
  635. package/docs/actor-name-policy-handoff.md +5 -0
  636. package/docs/agents.md +172 -22
  637. package/docs/architecture.md +5 -1
  638. package/docs/audit-trace.md +2 -1
  639. package/docs/background-tasks.md +126 -28
  640. package/docs/codemode-parity.md +2 -2
  641. package/docs/compaction.md +21 -5
  642. package/docs/components.md +1 -1
  643. package/docs/configuration.md +113 -66
  644. package/docs/decisions.md +92 -10
  645. package/docs/durable-extension.md +121 -0
  646. package/docs/durable-pi.md +306 -6
  647. package/docs/extractive-history.md +3 -1
  648. package/docs/interface.md +22 -17
  649. package/docs/jev.md +2 -2
  650. package/docs/kernels.md +1 -1
  651. package/{node_modules/pi-coralbricks-provider/LICENSE → docs/licenses/gdp-wired-mit.txt} +1 -1
  652. package/docs/managed-host-migration.md +50 -0
  653. package/docs/programmatic-compaction.md +216 -6
  654. package/docs/programs.md +23 -1
  655. package/docs/prompt-cache.md +4 -2
  656. package/docs/provider-capabilities.md +15 -14
  657. package/docs/providers.md +99 -3
  658. package/docs/shell-composition.md +15 -0
  659. package/docs/short-lock-protocol.md +90 -0
  660. package/docs/skills.md +5 -1
  661. package/docs/speculation.md +6 -0
  662. package/docs/verified-kernels.md +309 -220
  663. package/package.json +45 -24
  664. package/proofs/actor-name.ts +27 -0
  665. package/proofs/authority.ts +62 -0
  666. package/proofs/budget.ts +24 -0
  667. package/proofs/compaction.ts +51 -0
  668. package/proofs/grants.ts +39 -0
  669. package/proofs/index.ts +40 -0
  670. package/proofs/kernel.ts +44 -0
  671. package/proofs/lifecycle.ts +128 -0
  672. package/proofs/policy.ts +195 -0
  673. package/proofs/provider.ts +52 -0
  674. package/proofs/resources.ts +160 -0
  675. package/proofs/speculation.ts +69 -0
  676. package/proofs/storage.ts +66 -0
  677. package/scripts/verified-kernels.ts +141 -0
  678. package/skillsets/python/fabric-council/SKILL.md +94 -20
  679. package/skillsets/python/fabric-exec/SKILL.md +2 -2
  680. package/skillsets/python/fabric-exec/references/agents.md +10 -4
  681. package/skillsets/python/fabric-fusion/SKILL.md +1 -1
  682. package/skillsets/python/fabric-guide/SKILL.md +1 -1
  683. package/skillsets/typescript/fabric-council/SKILL.md +110 -22
  684. package/skillsets/typescript/fabric-exec/SKILL.md +7 -7
  685. package/skillsets/typescript/fabric-exec/references/agents.md +17 -8
  686. package/skillsets/typescript/fabric-fusion/SKILL.md +1 -1
  687. package/skillsets/typescript/fabric-guide/SKILL.md +1 -1
  688. package/LAWS.bend +0 -502
  689. package/PROOF.bend +0 -452
  690. package/dist/chunks/chunk-3UGN25XS.js.map +0 -7
  691. package/dist/chunks/chunk-4EW7GVUR.js.map +0 -7
  692. package/dist/chunks/chunk-5UBRGTVN.js.map +0 -7
  693. package/dist/chunks/chunk-BN7F52EG.js +0 -525
  694. package/dist/chunks/chunk-BN7F52EG.js.map +0 -7
  695. package/dist/chunks/chunk-C7Z6F3SO.js.map +0 -7
  696. package/dist/chunks/chunk-DK35W6U7.js +0 -259
  697. package/dist/chunks/chunk-DK35W6U7.js.map +0 -7
  698. package/dist/chunks/chunk-EFETPXU2.js.map +0 -7
  699. package/dist/chunks/chunk-EHQQ4KCX.js.map +0 -7
  700. package/dist/chunks/chunk-EKODKR6Y.js.map +0 -7
  701. package/dist/chunks/chunk-FE6NOAO7.js.map +0 -7
  702. package/dist/chunks/chunk-FIDUHKMM.js.map +0 -7
  703. package/dist/chunks/chunk-FSB2VIRZ.js.map +0 -7
  704. package/dist/chunks/chunk-GIK2WNAK.js.map +0 -7
  705. package/dist/chunks/chunk-GO32KSEZ.js.map +0 -7
  706. package/dist/chunks/chunk-IR3PIHJM.js.map +0 -7
  707. package/dist/chunks/chunk-ITVLKXCI.js +0 -266
  708. package/dist/chunks/chunk-ITVLKXCI.js.map +0 -7
  709. package/dist/chunks/chunk-K7J2ABAZ.js.map +0 -7
  710. package/dist/chunks/chunk-KJZAOENY.js +0 -212
  711. package/dist/chunks/chunk-KJZAOENY.js.map +0 -7
  712. package/dist/chunks/chunk-LNASO4VT.js.map +0 -7
  713. package/dist/chunks/chunk-MLLYR3Y6.js.map +0 -7
  714. package/dist/chunks/chunk-P4KH4S4S.js.map +0 -7
  715. package/dist/chunks/chunk-PK4NIJEV.js.map +0 -7
  716. package/dist/chunks/chunk-Q2JQ3RYZ.js +0 -99
  717. package/dist/chunks/chunk-Q2JQ3RYZ.js.map +0 -7
  718. package/dist/chunks/chunk-R2XQ6AHT.js.map +0 -7
  719. package/dist/chunks/chunk-ROTCDDOV.js.map +0 -7
  720. package/dist/chunks/chunk-SPCJXN4K.js.map +0 -7
  721. package/dist/chunks/chunk-U366I5K2.js.map +0 -7
  722. package/dist/chunks/chunk-UKMQK5VP.js +0 -231
  723. package/dist/chunks/chunk-UKMQK5VP.js.map +0 -7
  724. package/dist/chunks/chunk-UOM37PE4.js.map +0 -7
  725. package/dist/chunks/chunk-UTOBAZ5T.js.map +0 -7
  726. package/dist/chunks/chunk-VSDUSNIA.js.map +0 -7
  727. package/dist/chunks/chunk-VTK2FEH7.js +0 -229
  728. package/dist/chunks/chunk-VTK2FEH7.js.map +0 -7
  729. package/dist/chunks/chunk-VYQV5JRT.js.map +0 -7
  730. package/dist/chunks/chunk-XCEEQ5AB.js.map +0 -7
  731. package/dist/chunks/chunk-ZLNJDTCN.js +0 -226
  732. package/dist/chunks/chunk-ZLNJDTCN.js.map +0 -7
  733. package/dist/chunks/chunk-ZQMBS5SH.js.map +0 -7
  734. package/dist/ui/conversation-shortcut.d.ts +0 -3
  735. package/dist/ui/conversation-shortcut.d.ts.map +0 -1
  736. package/dist/ui/widget-activity.d.ts +0 -21
  737. package/dist/ui/widget-activity.d.ts.map +0 -1
  738. package/dist/verified/generated/authority-kernel.d.ts +0 -10
  739. package/dist/verified/generated/authority-kernel.js +0 -127
  740. package/dist/verified/generated/kernel.d.ts +0 -31
  741. package/dist/verified/generated/kernel.js +0 -389
  742. package/dist/verified/generated/lifecycle-kernel.d.ts +0 -7
  743. package/dist/verified/generated/lifecycle-kernel.js +0 -164
  744. package/dist/verified/generated/provider-kernel.d.ts +0 -9
  745. package/dist/verified/generated/provider-kernel.js +0 -87
  746. package/dist/verified/generated/storage-kernel.d.ts +0 -11
  747. package/dist/verified/generated/storage-kernel.js +0 -107
  748. package/docs/licenses/bend-apache-2.0.txt +0 -202
  749. package/node_modules/pi-coralbricks-provider/README.md +0 -306
  750. package/node_modules/pi-coralbricks-provider/auth.ts +0 -30
  751. package/node_modules/pi-coralbricks-provider/custom-models.json +0 -1
  752. package/node_modules/pi-coralbricks-provider/deprecated-models.json +0 -1
  753. package/node_modules/pi-coralbricks-provider/guard.ts +0 -155
  754. package/node_modules/pi-coralbricks-provider/index.ts +0 -662
  755. package/node_modules/pi-coralbricks-provider/models.json +0 -88
  756. package/node_modules/pi-coralbricks-provider/package.json +0 -74
  757. package/node_modules/pi-coralbricks-provider/park.ts +0 -122
  758. package/node_modules/pi-coralbricks-provider/patch.json +0 -34
  759. package/node_modules/pi-coralbricks-provider/scripts/update-models.js +0 -658
  760. package/node_modules/pi-coralbricks-provider/settings.ts +0 -143
  761. package/node_modules/pi-coralbricks-provider/sync-policy.ts +0 -309
  762. package/proofs/abi.json +0 -308
  763. package/proofs/authority-abi.json +0 -7
  764. package/proofs/authority-kernel.bend +0 -23
  765. package/proofs/authority-proof.bend +0 -74
  766. package/proofs/authority-spec.bend +0 -30
  767. package/proofs/authority-state.bend +0 -43
  768. package/proofs/authority-types.d.ts +0 -3
  769. package/proofs/kernel.bend +0 -139
  770. package/proofs/lifecycle-abi.json +0 -3
  771. package/proofs/lifecycle-kernel.bend +0 -11
  772. package/proofs/lifecycle-proof.bend +0 -249
  773. package/proofs/lifecycle-spec.bend +0 -261
  774. package/proofs/lifecycle-types.d.ts +0 -4
  775. package/proofs/lifecycle.bend +0 -119
  776. package/proofs/provider-abi.json +0 -4
  777. package/proofs/provider-kernel.bend +0 -14
  778. package/proofs/provider-plans.bend +0 -28
  779. package/proofs/provider-spec.bend +0 -14
  780. package/proofs/provider-types.d.ts +0 -5
  781. package/proofs/resource-proof.bend +0 -633
  782. package/proofs/resource-spec.bend +0 -133
  783. package/proofs/resources.bend +0 -160
  784. package/proofs/state-kernel.bend +0 -17
  785. package/proofs/state-plans.bend +0 -40
  786. package/proofs/state-proof.bend +0 -42
  787. package/proofs/state-spec.bend +0 -26
  788. package/proofs/storage-abi.json +0 -3
  789. package/proofs/storage-kernel.bend +0 -11
  790. package/proofs/storage-plans.bend +0 -100
  791. package/proofs/storage-proof.bend +0 -176
  792. package/proofs/storage-spec.bend +0 -70
  793. package/proofs/storage-types.d.ts +0 -8
  794. package/proofs/types.d.ts +0 -7
  795. package/scripts/test-verified-kernels.mjs +0 -107
  796. package/scripts/verified-kernels.mjs +0 -176
  797. /package/dist/chunks/{chunk-ZEXCKK4K.js.map → chunk-4WKD3YM3.js.map} +0 -0
  798. /package/dist/chunks/{chunk-5XBYFSI5.js.map → chunk-7YNE4NB2.js.map} +0 -0
  799. /package/dist/chunks/{chunk-K6QXUGS5.js.map → chunk-BMAEZNZ5.js.map} +0 -0
  800. /package/dist/chunks/{chunk-CCHZXF6K.js.map → chunk-CXYJJ3HZ.js.map} +0 -0
  801. /package/dist/chunks/{chunk-TIIIHPHF.js.map → chunk-GS67KDMV.js.map} +0 -0
  802. /package/dist/chunks/{chunk-D5NYNIST.js.map → chunk-H57KPL3V.js.map} +0 -0
  803. /package/dist/chunks/{chunk-INRXG4J5.js.map → chunk-HGD75NZY.js.map} +0 -0
  804. /package/dist/chunks/{chunk-UXIBKMUM.js.map → chunk-KIFOEBYJ.js.map} +0 -0
  805. /package/dist/chunks/{chunk-3FJUP3GV.js.map → chunk-L6H46CPY.js.map} +0 -0
  806. /package/dist/chunks/{chunk-FUY6XVRX.js.map → chunk-MPMEK3IQ.js.map} +0 -0
  807. /package/dist/chunks/{chunk-HP5P7NBO.js.map → chunk-MSDL7U6Q.js.map} +0 -0
  808. /package/dist/chunks/{chunk-ASSLHWZS.js.map → chunk-MX53BRAC.js.map} +0 -0
  809. /package/dist/chunks/{chunk-QT4W5YVB.js.map → chunk-RAA3FAYZ.js.map} +0 -0
  810. /package/dist/chunks/{chunk-53N2I4QA.js.map → chunk-TXCNZCZP.js.map} +0 -0
  811. /package/dist/chunks/{chunk-LEU5CDSL.js.map → chunk-XFOSUGLU.js.map} +0 -0
@@ -0,0 +1,121 @@
1
+ # Fabric in a pi-durable host
2
+
3
+ `pi-fabric/durable-extension` gives a host that runs its own pi-durable `Harness` the `fabric_exec` tool, without a Pi session.
4
+ It is one pi-durable `Extension`: a tool and its prompt section. There is no `ExtensionAPI`, no built-in file or shell tools, no Pi UI, no compaction, prewalk or topology.
5
+
6
+ Use it when your host already owns the agent loop (its own registry, tools, tenant scope and storage) and you want models to batch tool calls in one TypeScript program. For a whole Pi session over durable storage, use [`pi-fabric/durable-host`](durable-pi.md) instead.
7
+
8
+ ## Install
9
+
10
+ It needs `@earendil-works/pi-durable`, `@earendil-works/pi-codemode` and `@earendil-works/chord` **1.4.0 or later** as peers. pi-durable already depends on pi-codemode; the section uses its declaration renderer.
11
+
12
+ ```ts
13
+ import { createRegistry, defineExtension, Harness } from "@earendil-works/pi-durable";
14
+ import { createFabricExtension } from "pi-fabric/durable-extension";
15
+
16
+ const registry = createRegistry();
17
+ registry.install(hostTools); // your own tools, hooks, tenant guard
18
+ registry.install(createFabricExtension({
19
+ tools: ["search_knowledge", "read_ticket"], // optional: narrow what programs may call
20
+ onError: (error, { conversationId, callId }) => log.error({ conversationId, callId, error }),
21
+ }));
22
+ const harness = await Harness.open(storage, { models, registry }, ctx);
23
+ ```
24
+
25
+ A program the model sends looks like this:
26
+
27
+ ```ts
28
+ const [ticket, related] = await Promise.all([
29
+ tools.read_ticket({ id: "T-12" }),
30
+ tools.search_knowledge({ query: "login loop" }),
31
+ ]);
32
+ return { title: ticket.title, related: related.slice(0, 3) };
33
+ ```
34
+
35
+ ## Options
36
+
37
+ Every option is optional. `FABRIC_DURABLE_DEFAULTS` exports the defaults.
38
+
39
+ | Option | Default | What it does |
40
+ | --- | --- | --- |
41
+ | `name` | `"pi-fabric"` | Extension name. pi-durable reports section errors under it. |
42
+ | `toolName` | `"fabric_exec"` | The tool's name. |
43
+ | `tools` | every callable tool | Names of host tools programs may call. It only narrows the conversation's `Agent.callable`; it never widens it. `[]` grants none. |
44
+ | `providers` | none | Fabric providers granted to programs, as `{ [name]: { description?, actions: { [action]: (args, { api, context }) => value } } }`. |
45
+ | `timeoutMs` | `30000` | Deadline for the whole program, nested calls included. |
46
+ | `memoryLimitBytes` | `67108864` (64 MiB) | QuickJS heap limit. |
47
+ | `maxLogChars` | `20000` | `print()` and `console.*` output kept per program; the rest is cut with a notice. |
48
+ | `maxResultChars` | `40000` | Characters of the whole result the model sees; the rest is cut with a notice. |
49
+ | `maxArgumentBytes` | `262144` | Largest JSON argument object (UTF-8 bytes) for one nested tool call or provider action. A larger one is refused before the tool runs. |
50
+ | `sectionTokenBudget` | `3000` | Token budget (4 characters a token) for the tool declarations in the prompt section. |
51
+ | `quickJsWasmModule` | the bundled wasm | A precompiled `WebAssembly.Module` of `@jitl/quickjs-singlefile-mjs-release-sync`, for hosts that cannot compile wasm from bytes (Cloudflare Workers). Ignored when `runtime` is set. |
52
+ | `runtime` | in-process QuickJS | Kernel override, for example a sandbox in another isolate. |
53
+ | `onError` | none | `(error, { conversationId, callId }) => void`. Receives internal failures (see below). |
54
+
55
+ An invalid limit (zero, negative, not an integer) or provider name throws when you call `createFabricExtension`.
56
+
57
+ ### What a program can use
58
+
59
+ - `tools.<name>(args)`: the host tool's result. A tool with `structuredOutputSchema` returns its structured output; any other tool returns its text. A failed call rejects with the tool's own error text.
60
+ - `searchTools(query, limit?)` and `describeTool(name)`: find and read tools the section does not list.
61
+ - `<provider>.<action>(args)` and `fabric.tools.call({ ref: "<provider>.<action>", args })` for granted providers.
62
+ - `print()` and `console.*`; payloads the model passes as `π.<key>`; `setTimeout` (at most 64 pending timers, dropped when the program ends).
63
+
64
+ The result is the program's return value, after its log lines. A failed program is a tool error that names the nested calls already made; they are not undone.
65
+
66
+ ## Prompt section
67
+
68
+ The `fabric` section declares the tools a program may call with pi-codemode's renderer (`renderDeclarations` from `@earendil-works/pi-codemode/declarations`), so a host that also runs codemode shows both in one format. Tools are chosen cheapest first within `sectionTokenBudget` and shown in the conversation's order. Each granted provider is declared as its own namespace (`declare const notes: { add(args): Promise<unknown> }`), and the providers line gives each provider's description once. A tool whose name is not an identifier is declared under codemode's identifier (`look-up` becomes `look_up`); a program can call it by either name, and `describeTool` accepts either. Deferred tools (`deferred: true`) stay callable but are not listed, as in pi-durable's codemode. When a tool is left out for either reason, the section says so and points to `searchTools()`.
69
+
70
+ ## Security model
71
+
72
+ Read each rule as what a hostile program or a careless host must not be able to cause.
73
+
74
+ - **Default deny.** A program reaches only the conversation's callable tools (`Agent.callable`), narrowed by `tools`, never `fabric_exec` itself. Every Fabric namespace (`pi.*`, `agents.*`, `memory.*`, `mcp.*`, `jev.*`, `mesh.*`, models) is refused unless you grant it as a provider. An unknown action, or a name inherited from `Object.prototype`, is refused too.
75
+ - **Hooks see every call.** Each nested call goes through `ToolExecutionApi.executeTool`, so your `ToolTask` hooks (a tenant guard, an audit) see it as a nested call and can refuse it. The tool's tenant comes from the turn's scope, never from program arguments.
76
+ - **Plain JSON across the boundary.** Arguments are copied to plain JSON within `maxArgumentBytes` before a tool or action sees them, and an action's result is copied back. No prototype, getter or cycle crosses.
77
+ - **No host capabilities.** The program has no file, process, network, module loading or host object (`require`, `process`, `fetch`, `import()`, `WebAssembly`, the host bridge). Each program gets a fresh QuickJS context, so no global, prototype or module state crosses conversations or tenants in one process.
78
+ - **No secrets in results.** Program errors show no host paths. A provider action's error reaches the program as `Fabric action <ref> failed` unless the action throws `FabricDurableRefusal`, whose message the program sees. Any other host error (storage, a bug) reaches it as `Fabric host call failed`. The real error goes to `onError`.
79
+
80
+ ### Errors and `onError`
81
+
82
+ `fabric_exec` never throws to the Harness. When the kernel fails to load or the extension hits a bug, the model gets one fixed tool error, `fabric_exec failed with an internal error. The program may not have run.`, and `onError` gets the error with the conversation and call IDs. It gets no program source or arguments. An `onError` that throws is ignored. A section render error reaches the Harness's `onReport` as `extension_error` under the extension's name. pi-durable gives a tool no report channel of its own; that is why `onError` exists.
83
+
84
+ ## Durability
85
+
86
+ `fabric_exec` is declared `replay: "safe"`. Each run keeps a journal in a pi-durable task document: a header (journal format, engine, a digest of the program, its payloads and settings, a random seed, the start time) and every tool or provider result in the order the program received it. Each result is saved before the program sees it.
87
+
88
+ - **Restart mid-program.** pi-durable runs `fabric_exec` again with the same arguments. The program reruns from the top with the recorded seed and clock, so `Math.random()`, `Date` and timers give the same values. Recorded calls return their saved results without running again. A nested tool that was still running is reattached by its call number, so it finishes once.
89
+ - **Effects.** A provider action counts as an effect unless it is granted with `repeatable: true`. An intent is saved before an effect runs. If a restart cuts off an effect, or a nested tool reports it was interrupted after it may have run, the program stops there and does not run it again. The model reads:
90
+
91
+ ```text
92
+ fabric_exec was interrupted during this call, which may have run:
93
+ notes.add({"text":"paid"})
94
+ 2 earlier tool calls finished before the interruption and were replayed from the journal without running again.
95
+ The program stopped here and this call was not repeated. Check whether it took effect, or ask the user, before running it or the rest of the program again.
96
+ ```
97
+
98
+ A repeatable action that was cut off simply runs again.
99
+ - **Refusals.** A resume is refused, and nothing runs, when the program, its payloads or its settings changed, when the engine changed (`FABRIC_DURABLE_ENGINE` names the journal format, this package's version and the QuickJS build, so any upgrade counts), when the journal is damaged, or when the rerun asks for a different call than the one recorded. The model gets `fabric_exec could not resume after an interruption: <reason>.`
100
+ - **Cancel.** Cancelling the turn aborts the in-flight nested call and the program. No later call in the program runs.
101
+ - **Fork and compaction.** A forked or compacted conversation still offers `fabric_exec` and its section, rendered for that conversation.
102
+
103
+ ## Cloudflare Workers
104
+
105
+ The entry's import graph holds no `node:` module and no Pi package (`bun run build` checks this). It runs in a Worker without `nodejs_compat`. A Worker cannot compile wasm from bytes at run time, so you must pass `quickJsWasmModule`:
106
+
107
+ 1. In your build (Node or Bun), write the wasm to a file. `@jitl/quickjs-singlefile-mjs-release-sync` inlines it in JavaScript, so the package exports a helper that returns the installed bytes:
108
+
109
+ ```ts
110
+ import { writeFile } from "node:fs/promises";
111
+ import { quickJsWasmBytes } from "pi-fabric/durable-extension/wasm";
112
+
113
+ await writeFile("src/quickjs.wasm", await quickJsWasmBytes());
114
+ ```
115
+
116
+ Rerun it whenever you update pi-fabric, so the wasm matches the installed glue code.
117
+ 2. Ship the file as a `CompiledWasm` module (`import quickjsWasm from "./quickjs.wasm"` with a wasm module rule in wrangler). Do not import `pi-fabric/durable-extension/wasm` in the Worker itself.
118
+ 3. Pass it: `createFabricExtension({ quickJsWasmModule: quickjsWasm })`.
119
+ 4. Bundle with Node built-ins external. The kernel's lazy TypeScript transpile references them on paths a Worker never takes.
120
+
121
+ Without the module, every call returns the fixed internal error and `onError` receives `Wasm code generation disallowed by embedder`. The bundle is about 12 MB raw (2.1 MB gzip), mostly the TypeScript compiler, plus 0.5 MB of wasm.
@@ -43,7 +43,74 @@ exclusive transaction prevents concurrent writers, including directory aliases;
43
43
  process death releases it without timeout-based stealing or lock-file deletion.
44
44
  Reopening the same run uses its initial run ID for idempotent submission and
45
45
  resumes checkpoints. Completed work is not repeated. An interrupted unsafe tool
46
- fails closed, including `fabric_exec`, writes, and shell commands.
46
+ fails closed, including writes and shell commands.
47
+
48
+ In the durable worker, an interrupted `fabric_exec` call can continue after a
49
+ crash. The leaf adapter below does not do this. The worker offers the call a
50
+ fence. Fabric accepts it only when every effect must cross the host bridge,
51
+ which holds for the QuickJS and Monty runtimes but not for CPython or the Node
52
+ and Bun processes. An effect is any call outside the read-only set: the tier
53
+ that speculation may run early (`pi.read`, `pi.grep`, `pi.find`, `pi.ls`, and
54
+ status and lookup actions such as `memory.recall` and `programs.get`), the
55
+ native store load, discovery, and progress reporting. A read approval that
56
+ would prompt or call the auto classifier is an effect, and so is semantic
57
+ search.
58
+
59
+ A QuickJS program writes a crash journal. Each tool result is recorded before
60
+ the program sees it, and results reach the program one at a time. Before an
61
+ effect runs, Fabric records an intent and syncs it to disk. On recovery the same
62
+ program runs again with the same clock and random seed. Recorded results are
63
+ served from the journal, so no provider, approval, or prompt runs again. Calls
64
+ after the last recorded result then run live.
65
+
66
+ A few served calls changed state that lived only in the worker process, so
67
+ Fabric redoes them from their recorded arguments, once each and in their
68
+ recorded order, before the program sees their result. `compact.request` and
69
+ `compact.cancel` are always redone. `prewalk.plan` is redone when the
70
+ restarted session's prewalk arm owes a plan, and skipped otherwise.
71
+ `compact.carry`, `thinking.set`, and `thinking.reset` are redone only when
72
+ the session entry they wrote did not survive, as with an explicit Pi runner
73
+ started with `--no-session`, so a surviving session never gets a second entry. A redo runs the
74
+ provider again under the current policy, without asking for approval again. If
75
+ a redo fails, the program stops, reports that call and its error, and runs
76
+ nothing after it. State, mesh, saved programs, and cache releases are already on
77
+ disk or safe to skip and are not redone. Schema hypotheses and certificates are
78
+ stored in the mesh and bound to the tool call, so a resumed `schema.commit`
79
+ still checks the recorded certificate: it is refused once the certificate has
80
+ expired or the workspace or state changed since verification. If a call has an intent but no
81
+ result, it may have taken effect. Fabric asks whether to run that call again
82
+ as a `select` dialog, and pauses the program deadline while it waits (a
83
+ `timeout_ms` hard deadline keeps running). Only "Run it again" repeats the
84
+ call. "Stop here", a dismissed question, a question left unanswered for 5
85
+ minutes, or more than one such call stops the program, which reports the call.
86
+ The dialog goes to the worker's RPC client. A parent agent cancels it by
87
+ default, so the program stops. With `agents.childQuestions: "route"`, a parent
88
+ session asks its person or raises a root-held decision. Fabric also
89
+ refuses to resume, and runs nothing, when the program or its settings changed, the runtime or a pinned engine version
90
+ changed, the program stops repeating its recorded calls, the journal is missing
91
+ or damaged, or a recorded result named work such as a child agent or background
92
+ task that does not survive a restart. A call resumes at most three times.
93
+
94
+ The journal holds the program's identity digest, its random seed and start
95
+ time, and for every host call its reference, an argument digest, and the full
96
+ result or error the program received. Each line carries a checksum and a hash
97
+ of the line before it, so a lost, reordered, or foreign line refuses the
98
+ resume. Lines lost from the very end cannot be detected this way; Fabric relies
99
+ on `fdatasync` to keep a synced intent. Tool output can include secrets, so the
100
+ journal is private to its owner (mode `0600`). The worker deletes it as soon as
101
+ the call's final result is committed to the durable store, whether the call
102
+ succeeded, failed, was stopped as interrupted, or was aborted. It is never
103
+ deleted before that commit. If the worker crashes between the commit and the
104
+ delete, a sweep at worker start deletes any journal a day after its last write.
105
+
106
+ Monty programs keep the earlier fence. Before the first effect, Fabric arms the
107
+ fence and the worker commits that mark. On recovery, an accepted fence that was
108
+ never armed reruns the program from the start. An armed fence, an unaccepted
109
+ one, or a second crash fails closed as before. A rerun can read different file
110
+ contents than the first attempt did. It also emits its progress and
111
+ `workflow.item` transitions again, with the same `invocationId` and item IDs,
112
+ so a listener that acts on them should deduplicate. A journal resume does the
113
+ same for the progress calls it serves.
47
114
 
48
115
  A worker's store lives in its run directory under `durable/`. Recovery never
49
116
  replays streaming updates, so each provider delta and tool progress update commits
@@ -52,6 +119,111 @@ observers from memory after that commit. The journal grows with the transcript,
52
119
  not with the square of each streamed message. Run retention removes `durable/`
53
120
  with its run, and unknown or linked files inside it still preserve the run.
54
121
 
122
+ ### Opt-in: a session file for pi-durable workers
123
+
124
+ By default a `pi-durable` child without a seeded session runs with
125
+ `--no-session`. Set `agents.durableWorkerSession: true` to have it keep a
126
+ private Pi session file at `durable-session/session.jsonl` in its run directory
127
+ (mode `0600`, folder `0700`). The journal restores messages only; the session
128
+ file restores what extensions saved in the session, such as custom entries,
129
+ context edits, and compaction, when a relaunched attempt reopens it. This
130
+ includes the relaunch described in [Opt-in: reattach after a resident host
131
+ restart](#opt-in-reattach-after-a-resident-host-restart): it reuses the run
132
+ directory, so the relaunched worker reopens the same session file. Without the
133
+ file, the redo rules above rebuild extension state from the journal, and only
134
+ some calls can be redone. With the option on, the manager also creates run
135
+ directories with mode `0700`. Explicit `pi` children keep `--no-session`
136
+ either way. Run retention removes `durable-session/` with its run; see
137
+ "Retention" below for what it accepts.
138
+
139
+ With the option off, nothing below applies: there is no session file, no
140
+ worker-role entry, and fork and handoff seeds are written as before.
141
+
142
+ ### Worker role
143
+
144
+ With `agents.durableWorkerSession`, a `pi-durable` child's session carries a worker-role entry, so a context-aware
145
+ extension in the child knows it is a worker. The entry is one custom entry in the Pi
146
+ session file:
147
+
148
+ ```json
149
+ { "type": "custom", "customType": "context-aware.policy.v1",
150
+ "data": { "schemaVersion": 1, "layer": "host", "declaredBy": "pi-fabric/durable-worker",
151
+ "values": { "sessionRole": "worker" } } }
152
+ ```
153
+
154
+ Delegation extensions write the same entry for their workers. Without it, such an
155
+ extension acts as a session with a user at a terminal: it can send a compaction seed as a new
156
+ user message, rewrite it with a model, add the cache listing, and compact in the
157
+ middle of a reply. Fabric does not import any such extension; without one
158
+ the entry is one unread line.
159
+
160
+ **Create complete, never edit.** Fabric writes the entry only into a session file
161
+ it creates, in the same write that creates the file. The worker never appends to,
162
+ rewrites, or parses an existing session file, so a file that exists already (a
163
+ relaunch, or a `sessionFile` the caller supplies) is used exactly as it is.
164
+
165
+ The entry is the **root** of the tree: the first entry after the header, with
166
+ `parentId: null`. Every entry Pi appends, and every branch a later navigation or
167
+ Pi fork reaches, then descends from it. That is why the entry does not depend on
168
+ which entry Pi treats as the leaf.
169
+
170
+ - **New `durable-session/session.jsonl`.** Line 1 is a Pi session header (version
171
+ 3), line 2 is the entry with `parentId: null`. The worker writes both to
172
+ `tmp-<uuid>.jsonl` in the same folder (exclusive create, no link following,
173
+ `0600`), syncs it, hard-links it to `session.jsonl` and unlinks the temp name.
174
+ Exactly one of two concurrent attempts wins the link; the other keeps the
175
+ winner's file. On relaunch an existing `session.jsonl` is reused untouched, and
176
+ a leftover `tmp-<uuid>.jsonl` that is a second name of it is removed.
177
+ - **Fork and handoff seeds.** For a `pi-durable` child with the option on, the manager passes the seed
178
+ writers (`writeForkSession`, `writeHandoffSession`) `{ workerRole: true }`.
179
+ The file they return has the header, then the entry as the root, then the seed's
180
+ entries unchanged except that the seed's former root has `parentId` set to the
181
+ entry's id. The inherited messages are identical. A seed Pi's own
182
+ `createBranchedSession` writes is rewritten once by the writer, before it
183
+ returns the path and before any worker can open the file.
184
+ - **Plain `pi`, other runners, and the option off.** No option is passed. Seeds are byte for byte
185
+ what the writers always produced, there is no entry, and a child with no seed
186
+ keeps `--no-session`.
187
+ - **Caller-supplied `sessionFile`.** Never written. Such a child keeps whatever role
188
+ that file already declares.
189
+ - **A later explicit declaration wins.** A context-aware extension replays policy entries in
190
+ order and a later entry wins per path, so a later host policy that declares another
191
+ `sessionRole` overrides the seeded one; Fabric does not fight it.
192
+
193
+ #### Threat model
194
+
195
+ A process running as the same user is trusted, because it can already write every
196
+ session file. Same-user races (swapping a folder for a symlink, adding a hard link
197
+ between a check and a write) are therefore out of scope. The worker guards against
198
+ other users and against accidental links:
199
+
200
+ - Before it creates anything, the worker `lstat`s the run directory. It must be a
201
+ real directory (not a link) owned by the worker's user; otherwise the launch fails
202
+ with a clear error before any write. If group or others can write it
203
+ (`mode & 0o022`), the worker removes that write itself through a descriptor opened
204
+ without following links and checked to be the same directory, then confirms the bit
205
+ is gone. A run directory from an earlier Fabric or a test harness may have mode
206
+ `0775`; with the option on, the manager creates run directories with mode `0700`. After the
207
+ tightening no other user can add or swap entries in the run directory, and
208
+ anything already there is refused by the owner and link checks on
209
+ `durable-session/` and by `O_EXCL | O_NOFOLLOW` on the temp file.
210
+ - `durable-session/` is created without `recursive` (so the run directory must
211
+ already exist), with mode `0700`; an existing one must be a real directory owned by
212
+ the worker's user.
213
+ - The temp file is created with `O_CREAT | O_EXCL | O_NOFOLLOW`.
214
+
215
+ #### Retention
216
+
217
+ Run retention accepts only `session.jsonl` and `tmp-<lowercase uuid v4>.jsonl` in
218
+ `durable-session/`, each a regular file owned by this user. A file with two names is
219
+ accepted only as the crash leftover between the worker's link and unlink: the folder
220
+ holds exactly `session.jsonl` and one `tmp-<uuid>.jsonl` that share a device and
221
+ inode. A link that leaves the run, an unknown name (including an uppercase or
222
+ all-zero uuid), a symlink, or another owner keeps the run.
223
+
224
+ Fabric does not read the `context-aware.worker-compaction.v1` advisories a worker
225
+ writes.
226
+
55
227
  Durability **does not restore arbitrary JavaScript continuations**, promise
56
228
  general exactly-once external effects, or restart failed workers indefinitely.
57
229
  The standard process/actor lifecycle controls stop/retry/retention. A new run is
@@ -64,14 +236,87 @@ switches receive fresh request identities and do not replay old answers.
64
236
  Old leaf-adapter locators/journals are not silently migrated into worker stores.
65
237
 
66
238
  Worker retries retain the original prompt identity, so a completed journal can
67
- restore its answer even if the parent died before saving completion. Automatic
68
- reattachment after the owning Fabric/resident process restarts currently covers
69
- hosted adapters, not this built-in worker. Recovery of completed conversations
239
+ restore its answer even if the parent died before saving completion. By
240
+ default, automatic reattachment after the owning Fabric/resident process
241
+ restarts covers hosted adapters, not this built-in worker; `agents.wait` on such
242
+ a run fails at once when its resident host is gone and settles the run failed
243
+ with outcome `indeterminate`. Recovery of completed conversations
70
244
  with additional steering/follow-up user messages also remains incomplete: strict
71
245
  transcript correlation fails closed to avoid attributing a stale answer.
72
246
  Control acknowledgements do not provide an end-to-end exactly-once delivery
73
247
  contract; do not blindly resubmit a command whose acknowledgement was lost.
74
248
 
249
+ ## Opt-in: reattach after a resident host restart
250
+
251
+ Set `agents.durableWorkerRecovery: true` to let a resident host recover its
252
+ own unfinished `pi-durable` worker runs. It applies only to runs launched with
253
+ `residency: "durable"`, runner `pi-durable`, and the `process` transport, on
254
+ POSIX. Each such launch writes `worker-recovery.json` beside the run: the run
255
+ id, the absolute deadline, the current worker PID, and the worker launch. The
256
+ marker is **untrusted input**, not launch authority. The host also writes a
257
+ receipt under `<runRoot>.worker-launch-authority/<id>.json`, a sibling of
258
+ the host run root, outside all child run directories and nested run roots. The receipt pins every launch argument, PID and deadline, plus
259
+ the current host's agent configuration, binaries, inherited tools and policy.
260
+ Recovery requires an exact match; this covers optional/future arguments too,
261
+ including runner, child binaries, extensions, kernels and capability settings.
262
+ The run root and receipt directory, like the host configuration, must remain
263
+ host-controlled: this is not isolation against a process with arbitrary
264
+ same-user filesystem access. Both files are removed on settlement. An
265
+ explicit stop deletes the file as soon as it is requested, before Fabric
266
+ signals the worker, so a host that dies partway through a stop leaves nothing
267
+ to recover. Every other settlement this host makes deletes the file before it
268
+ writes the terminal record. A later host therefore never recovers a run Fabric
269
+ already finished or stopped.
270
+
271
+ When the host closes, it leaves these workers running. The next resident host,
272
+ whether started by a new session or by `agents.wait` after the old host died,
273
+ reads each file and decides:
274
+
275
+ - **Worker still running.** Fabric checks the PID and that its command line
276
+ still carries `--id <run id>`. It then adopts the worker and waits for its
277
+ result. Nothing is relaunched.
278
+ - **Worker gone.** Fabric relaunches the same launch in the same run directory,
279
+ with the same prompt and the progress so far carried over, and with
280
+ `--timeout-ms` set to what remains of the original deadline. `pi-durable`
281
+ reopens its journal, so completed work is not repeated.
282
+ - **Worker recorded a stop but is still running.** Fabric waits up to seven
283
+ seconds for it to exit and then relaunches it. If it is still running, the run
284
+ settles `indeterminate` and no new launch is attempted.
285
+ - **Recovery file does not match this host.** A missing or mismatched host
286
+ receipt, including a legacy marker-only run or a changed host policy, settles
287
+ the run `indeterminate` without adopting or starting a process. The launch
288
+ also has to use this host's worker and the run's own id, cwd and file paths.
289
+ Files over 8 MiB, malformed files and files whose id does not name their run
290
+ directory cannot authorize a launch.
291
+ - **No first status.** A valid marker can precede the worker's first status
292
+ write. Recovery explicitly publishes a failed, `indeterminate` status and
293
+ removes the marker. The run is not silently left without an owner.
294
+ It does not guess at, signal or relaunch a possibly still-running worker.
295
+ - **Deadline passed, or liveness cannot be verified.** This covers a PID owned
296
+ by another user and an unreadable command line. The run settles `failed` with
297
+ `outcome: "indeterminate"` and a reason. `agents.wait` returns that result
298
+ and does not throw.
299
+
300
+ The option is off by default; with it off, no file is written and behaviour is
301
+ unchanged. A run launched while the option was on keeps its marker; changing
302
+ the host policy (including turning the option off) settles it indeterminate.
303
+ The former authority is not revived. Windows, other transports, and
304
+ waits from another session of the project (`waitProjectAgent`) are not covered.
305
+
306
+ A hard-killed outer worker can leave its detached durable child alive briefly.
307
+ Outer-PID disappearance does **not** prove the child released its SQLite lease;
308
+ a relaunch during that window can fail with a storage-lock error. Recovery does
309
+ not steal/delete leases or kill guessed child PIDs. The lease still excludes
310
+ concurrent journal writers, but automatic recovery across that cleanup window
311
+ is not guaranteed. Graceful external-stop recovery waits for child shutdown;
312
+ unknown worker liveness always settles indeterminate without a relaunch.
313
+
314
+ Lifecycle events that the worker wrote but the old host had not read when it
315
+ died are not replayed. The new host starts reading `lifecycle.jsonl` from its
316
+ size at recovery. The run's status, turns, tool calls and usage are unaffected,
317
+ because they come from `status.json`; only those intermediate `pi.*` events
318
+ and their token-usage ledger entries are lost.
319
+
75
320
  ## Advanced: manually registered leaf adapter
76
321
 
77
322
  The rest of this guide concerns the restricted `pi-fabric/durable` factory, **not**
@@ -83,8 +328,8 @@ the separate ID explicitly.
83
328
  Exports include `PiDurableRunner`, `PiDurableRunnerOptions`,
84
329
  `PiDurableStorageOptions`, `PiDurableStorageLease`, `PiDurableLocator`, and
85
330
  `PiDurableMessageOptions`. Import/construction stays lazy and does not register a
86
- runner. First use checks pinned `@earendil-works/pi-durable@1.3.0` and
87
- `@earendil-works/chord@1.3.0`. Credentials remain in Models/environment, never in
331
+ runner. First use checks pinned `@earendil-works/pi-durable@1.4.0` and
332
+ `@earendil-works/chord@1.4.0`. Credentials remain in Models/environment, never in
88
333
  a locator.
89
334
 
90
335
  ### Leaf host setup
@@ -307,6 +552,61 @@ Full-host coverage is in `tests/durable-agent.test.ts`,
307
552
  `tests/durable-worker-e2e.test.ts`, `tests/durable-fabric-exec.test.ts`,
308
553
  `tests/handoff-continuation-worker.test.ts`, and `tests/durable-actors.test.ts`.
309
554
 
555
+ ## Embedding a durable session: `pi-fabric/durable-host`
556
+
557
+ A host process that runs one long-lived durable `AgentSession` of its own (a
558
+ daemon, not a Fabric-managed worker) imports `pi-fabric/durable-host`. The host
559
+ supplies the Pi SDK (`@earendil-works/pi-coding-agent`, `pi-ai`, `pi-agent-core`)
560
+ as peers, as for the extension. Fabric's registration graph never loads this
561
+ entry, and it does not read `agents.durableWorkerSession` or any other Fabric
562
+ setting: the embedder chooses its own session file.
563
+
564
+ Exports: `createDurableAgentSession` (the session), `DurableAgent`,
565
+ `openDurableWorkerStorage` (exclusive, fsync'd JSONL storage with a lease),
566
+ `createDurableWorkerRuntime` and `DurableWorkerOptions` (the full native runtime
567
+ with `/new`, `/fork` and `/resume`), `declareWorkerSessionRole` and
568
+ `DURABLE_WORKER_POLICY_ENTRY_TYPE`.
569
+
570
+ ```ts
571
+ import {
572
+ createDurableAgentSession, declareWorkerSessionRole, openDurableWorkerStorage,
573
+ } from "pi-fabric/durable-host";
574
+ import { SessionManager } from "@earendil-works/pi-coding-agent";
575
+ import { BACKGROUND_CONTEXT } from "@earendil-works/chord/context";
576
+
577
+ const lease = await openDurableWorkerStorage("/absolute/private/run-dir"); // throws if another process owns it
578
+ const sessionManager = SessionManager.open(sessionFile, undefined, cwd); // or create(...)
579
+ declareWorkerSessionRole(sessionManager); // before the first prompt; "already-seeded" on resume
580
+ const host = await createDurableAgentSession({
581
+ cwd, sessionManager, storage: lease.storage, runId: "my-daemon:main", // stable across restarts
582
+ // modelRuntime, model, tools, customTools, resourceLoader: as for createAgentSession
583
+ });
584
+ await host.session.bindExtensions({}); // not done for you; bind your own mode/UI/error hooks
585
+ await host.session.prompt("...");
586
+ // Shutdown: await host.close(); await lease.storage.close(BACKGROUND_CONTEXT); await lease.release();
587
+ ```
588
+
589
+ **Worker role.** `declareWorkerSessionRole(sessionManager)` appends the same
590
+ worker-role entry described under "Worker role" above to a session you already
591
+ opened. It returns `"seeded"` when it wrote the entry and `"already-seeded"`
592
+ when the latest host role declaration on the active branch is worker, so a restart
593
+ loop does not grow the file. A sibling branch does not count, and a later host
594
+ role override causes the helper to append a fresh worker declaration. Call it before the first prompt and before `bindExtensions`.
595
+ Unlike a Fabric child, whose entry is the tree root, this one is appended after
596
+ whatever the session already holds. Without it the session counts as a
597
+ foreground session with a user at a terminal.
598
+
599
+ **Supervision is the host's job.** An embedder gets journal resume through
600
+ `createDurableWorkerRuntime` and `createDurableAgentSession`, but not Fabric's
601
+ opt-in worker recovery (`agents.durableWorkerRecovery` and
602
+ `worker-recovery.json`), which only Fabric's agent manager performs. Nothing in
603
+ this entry restarts a process. After a crash, the host starts a new process,
604
+ reopens the same storage directory and session file, and calls
605
+ `createDurableAgentSession` again with the **same `runId`**, then
606
+ `host.agent.continue()` to finish interrupted work. Do not replay the original
607
+ prompt. The host also owns backoff, a restart budget, and releasing the storage
608
+ lease before another process takes over.
609
+
310
610
  ## Evidence
311
611
 
312
612
  `tests/durable-runner.test.ts` exercises the real published packages with offline
@@ -101,7 +101,9 @@ classifies facts, preferences, goals or commands.
101
101
  ## Lifecycle, caching and failures
102
102
 
103
103
  The implementation imports lazily at an enabled `before_agent_start` boundary.
104
- It issues at most one batch for the current source user-entry turn. A `context`
104
+ It issues at most one batch for the current source user-entry turn. A run that
105
+ a custom message starts (Pi's `before_agent_start` with `messageType: "custom"`)
106
+ has no query, so it drops any prepared view and prepares none. A `context`
105
107
  hook inserts one replay-safe ephemeral custom data message immediately before
106
108
  the last user message in the first request (normally the initiating prompt),
107
109
  after the existing history. That boundary and the view are frozen for the run: