@e4779/pi-fabric 0.117.2-fork.30 → 0.131.0-fork.32

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 (796) hide show
  1. package/README.md +12 -5
  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/global-registry.d.ts +8 -0
  9. package/dist/actors/global-registry.d.ts.map +1 -1
  10. package/dist/actors/host-event-payload.d.ts +14 -0
  11. package/dist/actors/host-event-payload.d.ts.map +1 -1
  12. package/dist/actors/manager.d.ts +4 -3
  13. package/dist/actors/manager.d.ts.map +1 -1
  14. package/dist/actors/mesh-monitor.d.ts +2 -0
  15. package/dist/actors/mesh-monitor.d.ts.map +1 -1
  16. package/dist/actors/name-policy.d.ts +3 -0
  17. package/dist/actors/name-policy.d.ts.map +1 -0
  18. package/dist/actors/registry-store.d.ts +14 -5
  19. package/dist/actors/registry-store.d.ts.map +1 -1
  20. package/dist/actors/store-read.d.ts +16 -0
  21. package/dist/actors/store-read.d.ts.map +1 -0
  22. package/dist/agents/agent-files.d.ts +80 -0
  23. package/dist/agents/agent-files.d.ts.map +1 -0
  24. package/dist/agents/agent-files.js +327 -0
  25. package/dist/agents/agent-files.js.map +7 -0
  26. package/dist/agents/child-skills.d.ts +60 -0
  27. package/dist/agents/child-skills.d.ts.map +1 -0
  28. package/dist/agents/child-skills.js +94 -0
  29. package/dist/agents/child-skills.js.map +7 -0
  30. package/dist/agents/clone-first-worktree.d.ts +6 -0
  31. package/dist/agents/clone-first-worktree.d.ts.map +1 -1
  32. package/dist/agents/cow-clone.d.ts.map +1 -1
  33. package/dist/agents/handoff.d.ts +12 -2
  34. package/dist/agents/handoff.d.ts.map +1 -1
  35. package/dist/agents/herdr-status.d.ts +26 -0
  36. package/dist/agents/herdr-status.d.ts.map +1 -0
  37. package/dist/agents/herdr-status.js +161 -0
  38. package/dist/agents/herdr-status.js.map +7 -0
  39. package/dist/agents/hosted-run.d.ts +20 -4
  40. package/dist/agents/hosted-run.d.ts.map +1 -1
  41. package/dist/agents/manager.d.ts +18 -2
  42. package/dist/agents/manager.d.ts.map +1 -1
  43. package/dist/agents/model-pin-guard.d.ts +27 -0
  44. package/dist/agents/model-pin-guard.d.ts.map +1 -0
  45. package/dist/agents/model-pin-guard.js +86 -0
  46. package/dist/agents/model-pin-guard.js.map +7 -0
  47. package/dist/agents/model-pin.d.ts +25 -0
  48. package/dist/agents/model-pin.d.ts.map +1 -0
  49. package/dist/agents/provider-bridge.d.ts +7 -6
  50. package/dist/agents/provider-bridge.d.ts.map +1 -1
  51. package/dist/agents/provider-bridge.js +33 -5
  52. package/dist/agents/provider-bridge.js.map +3 -3
  53. package/dist/agents/request.d.ts.map +1 -1
  54. package/dist/agents/result.d.ts.map +1 -1
  55. package/dist/agents/result.js +1 -1
  56. package/dist/agents/runner-notice.d.ts.map +1 -1
  57. package/dist/agents/runner-protocol.d.ts +8 -0
  58. package/dist/agents/runner-protocol.d.ts.map +1 -1
  59. package/dist/agents/service-schema.d.ts.map +1 -1
  60. package/dist/agents/transports/herdr-socket.d.ts +12 -0
  61. package/dist/agents/transports/herdr-socket.d.ts.map +1 -0
  62. package/dist/agents/transports/herdr-transport.d.ts.map +1 -1
  63. package/dist/agents/types.d.ts +51 -0
  64. package/dist/agents/types.d.ts.map +1 -1
  65. package/dist/agents/worker-recovery.d.ts +75 -0
  66. package/dist/agents/worker-recovery.d.ts.map +1 -0
  67. package/dist/agents/worktree-manager.d.ts.map +1 -1
  68. package/dist/agents.js +12 -11
  69. package/dist/agents.js.map +2 -2
  70. package/dist/audit/details.d.ts +36 -1
  71. package/dist/audit/details.d.ts.map +1 -1
  72. package/dist/audit/projection.d.ts.map +1 -1
  73. package/dist/audit/trace-schema.d.ts +50 -0
  74. package/dist/audit/trace-schema.d.ts.map +1 -0
  75. package/dist/audit/trace.d.ts +2 -48
  76. package/dist/audit/trace.d.ts.map +1 -1
  77. package/dist/chunks/chunk-2RWNVCFD.js +483 -0
  78. package/dist/chunks/chunk-2RWNVCFD.js.map +7 -0
  79. package/dist/chunks/chunk-2SCMGO2Z.js +16 -0
  80. package/dist/chunks/chunk-2SCMGO2Z.js.map +7 -0
  81. package/dist/chunks/chunk-35EEGOH3.js +324 -0
  82. package/dist/chunks/chunk-35EEGOH3.js.map +7 -0
  83. package/dist/chunks/{chunk-3FJUP3GV.js → chunk-36XQFTEN.js} +2 -2
  84. package/dist/chunks/{chunk-UTOBAZ5T.js → chunk-37NIOSVU.js} +1 -1
  85. package/dist/chunks/chunk-37NIOSVU.js.map +7 -0
  86. package/dist/chunks/chunk-3IJEQBFS.js +25 -0
  87. package/dist/chunks/chunk-3IJEQBFS.js.map +7 -0
  88. package/dist/chunks/{chunk-EHQQ4KCX.js → chunk-3MOY6WIB.js} +84 -19
  89. package/dist/chunks/chunk-3MOY6WIB.js.map +7 -0
  90. package/dist/chunks/chunk-3PKZSIRA.js +1312 -0
  91. package/dist/chunks/chunk-3PKZSIRA.js.map +7 -0
  92. package/dist/chunks/chunk-3VK6UGAN.js +64 -0
  93. package/dist/chunks/chunk-3VK6UGAN.js.map +7 -0
  94. package/dist/chunks/{chunk-ROTCDDOV.js → chunk-3XT5WHSG.js} +59 -119
  95. package/dist/chunks/chunk-3XT5WHSG.js.map +7 -0
  96. package/dist/chunks/{chunk-FIDUHKMM.js → chunk-4BYS4ZLY.js} +16 -16
  97. package/dist/chunks/chunk-4BYS4ZLY.js.map +7 -0
  98. package/dist/chunks/{chunk-K7J2ABAZ.js → chunk-4KX6BIPL.js} +91 -31
  99. package/dist/chunks/chunk-4KX6BIPL.js.map +7 -0
  100. package/dist/chunks/{chunk-UOM37PE4.js → chunk-4PBW54I2.js} +162 -92
  101. package/dist/chunks/chunk-4PBW54I2.js.map +7 -0
  102. package/dist/chunks/{chunk-ZEXCKK4K.js → chunk-4WKD3YM3.js} +3 -3
  103. package/dist/chunks/{chunk-PK4NIJEV.js → chunk-4XMXFHAR.js} +62 -3
  104. package/dist/chunks/chunk-4XMXFHAR.js.map +7 -0
  105. package/dist/chunks/{chunk-4EW7GVUR.js → chunk-56NMRVTV.js} +589 -377
  106. package/dist/chunks/chunk-56NMRVTV.js.map +7 -0
  107. package/dist/chunks/{chunk-GIK2WNAK.js → chunk-5BOTHX47.js} +109 -20
  108. package/dist/chunks/chunk-5BOTHX47.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-GO32KSEZ.js → chunk-7CIES6X2.js} +84 -9
  118. package/dist/chunks/chunk-7CIES6X2.js.map +7 -0
  119. package/dist/chunks/{chunk-G4TLWHRS.js → chunk-7N7IC3Z2.js} +4 -3
  120. package/dist/chunks/{chunk-G4TLWHRS.js.map → chunk-7N7IC3Z2.js.map} +2 -2
  121. package/dist/chunks/{chunk-5XBYFSI5.js → chunk-7YNE4NB2.js} +2 -2
  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-F2LGSRIN.js +38 -0
  133. package/dist/chunks/chunk-F2LGSRIN.js.map +7 -0
  134. package/dist/chunks/chunk-F6A6MQ6G.js +609 -0
  135. package/dist/chunks/chunk-F6A6MQ6G.js.map +7 -0
  136. package/dist/chunks/{chunk-IR3PIHJM.js → chunk-FK73YJKV.js} +67 -2
  137. package/dist/chunks/chunk-FK73YJKV.js.map +7 -0
  138. package/dist/chunks/{chunk-VYQV5JRT.js → chunk-GJVKEHDL.js} +2 -2
  139. package/dist/chunks/chunk-GJVKEHDL.js.map +7 -0
  140. package/dist/chunks/{chunk-TIIIHPHF.js → chunk-GS67KDMV.js} +2 -2
  141. package/dist/chunks/{chunk-D5NYNIST.js → chunk-H57KPL3V.js} +5 -5
  142. package/dist/chunks/{chunk-KVYNGDGC.js → chunk-HFDJWLMS.js} +6 -6
  143. package/dist/chunks/{chunk-KVYNGDGC.js.map → chunk-HFDJWLMS.js.map} +1 -1
  144. package/dist/chunks/{chunk-INRXG4J5.js → chunk-HGD75NZY.js} +2 -2
  145. package/dist/chunks/{chunk-CRRUW26I.js → chunk-HRDMBGMY.js} +12 -12
  146. package/dist/chunks/{chunk-CRRUW26I.js.map → chunk-HRDMBGMY.js.map} +2 -2
  147. package/dist/chunks/{chunk-MLLYR3Y6.js → chunk-HSEZPCL5.js} +19 -78
  148. package/dist/chunks/chunk-HSEZPCL5.js.map +7 -0
  149. package/dist/chunks/{chunk-LNASO4VT.js → chunk-IOGDTIGN.js} +44 -19
  150. package/dist/chunks/chunk-IOGDTIGN.js.map +7 -0
  151. package/dist/chunks/chunk-JMUUNW2H.js +65 -0
  152. package/dist/chunks/chunk-JMUUNW2H.js.map +7 -0
  153. package/dist/chunks/{chunk-UXIBKMUM.js → chunk-KIFOEBYJ.js} +4 -4
  154. package/dist/chunks/{chunk-SPCJXN4K.js → chunk-LKYLD5SN.js} +298 -65
  155. package/dist/chunks/chunk-LKYLD5SN.js.map +7 -0
  156. package/dist/chunks/{chunk-FUY6XVRX.js → chunk-MPMEK3IQ.js} +2 -2
  157. package/dist/chunks/{chunk-HP5P7NBO.js → chunk-MSDL7U6Q.js} +4 -4
  158. package/dist/chunks/chunk-N7ZAK2PB.js +132 -0
  159. package/dist/chunks/chunk-N7ZAK2PB.js.map +7 -0
  160. package/dist/chunks/{chunk-VSDUSNIA.js → chunk-NBIYYMKS.js} +8 -2
  161. package/dist/chunks/chunk-NBIYYMKS.js.map +7 -0
  162. package/dist/chunks/chunk-NENQZCGW.js +45 -0
  163. package/dist/chunks/chunk-NENQZCGW.js.map +7 -0
  164. package/dist/chunks/chunk-NJHJKINP.js +47 -0
  165. package/dist/chunks/chunk-NJHJKINP.js.map +7 -0
  166. package/dist/chunks/{chunk-U366I5K2.js → chunk-NQ7IWEIF.js} +18 -6
  167. package/dist/chunks/chunk-NQ7IWEIF.js.map +7 -0
  168. package/dist/chunks/{chunk-ZQMBS5SH.js → chunk-OJ4HAALD.js} +15 -12
  169. package/dist/chunks/chunk-OJ4HAALD.js.map +7 -0
  170. package/dist/chunks/chunk-OZCJU3PZ.js +33 -0
  171. package/dist/chunks/chunk-OZCJU3PZ.js.map +7 -0
  172. package/dist/chunks/chunk-P3DCXKL3.js +40 -0
  173. package/dist/chunks/chunk-P3DCXKL3.js.map +7 -0
  174. package/dist/chunks/chunk-P7YSPKTM.js +294 -0
  175. package/dist/chunks/chunk-P7YSPKTM.js.map +7 -0
  176. package/dist/chunks/chunk-PQVUMJ5J.js +223 -0
  177. package/dist/chunks/chunk-PQVUMJ5J.js.map +7 -0
  178. package/dist/chunks/chunk-PUBHBEYO.js +84 -0
  179. package/dist/chunks/chunk-PUBHBEYO.js.map +7 -0
  180. package/dist/chunks/{chunk-P4KH4S4S.js → chunk-QGTD3LAZ.js} +5 -20
  181. package/dist/chunks/chunk-QGTD3LAZ.js.map +7 -0
  182. package/dist/chunks/{chunk-TIJ3YQXX.js → chunk-QOEOKW2X.js} +2 -2
  183. package/dist/chunks/{chunk-TIJ3YQXX.js.map → chunk-QOEOKW2X.js.map} +1 -1
  184. package/dist/chunks/{chunk-QT4W5YVB.js → chunk-RAA3FAYZ.js} +2 -2
  185. package/dist/chunks/{chunk-WJJXODAB.js → chunk-RLKRZXSX.js} +8 -1
  186. package/dist/chunks/{chunk-WJJXODAB.js.map → chunk-RLKRZXSX.js.map} +2 -2
  187. package/dist/chunks/chunk-RWKQ5SRW.js +129 -0
  188. package/dist/chunks/chunk-RWKQ5SRW.js.map +7 -0
  189. package/dist/chunks/chunk-SW25R47N.js +71 -0
  190. package/dist/chunks/chunk-SW25R47N.js.map +7 -0
  191. package/dist/chunks/{chunk-EFETPXU2.js → chunk-TJZYM2SP.js} +118 -237
  192. package/dist/chunks/chunk-TJZYM2SP.js.map +7 -0
  193. package/dist/chunks/{chunk-53N2I4QA.js → chunk-TXCNZCZP.js} +2 -2
  194. package/dist/chunks/chunk-UD7LFV43.js +28 -0
  195. package/dist/chunks/chunk-UD7LFV43.js.map +7 -0
  196. package/dist/chunks/{chunk-ASSLHWZS.js → chunk-UFMYN5TA.js} +2 -2
  197. package/dist/chunks/{chunk-7QKKLBHJ.js → chunk-UPMWLOKL.js} +10 -1
  198. package/dist/chunks/{chunk-7QKKLBHJ.js.map → chunk-UPMWLOKL.js.map} +2 -2
  199. package/dist/chunks/chunk-V4OW2ULC.js +422 -0
  200. package/dist/chunks/chunk-V4OW2ULC.js.map +7 -0
  201. package/dist/chunks/{chunk-FE6NOAO7.js → chunk-VNWQIGQL.js} +1820 -649
  202. package/dist/chunks/chunk-VNWQIGQL.js.map +7 -0
  203. package/dist/chunks/{chunk-PYFJW3HC.js → chunk-W5FEHVZA.js} +2 -16
  204. package/dist/chunks/{chunk-PYFJW3HC.js.map → chunk-W5FEHVZA.js.map} +3 -3
  205. package/dist/chunks/{chunk-XCEEQ5AB.js → chunk-WGMCNCP6.js} +1567 -1564
  206. package/dist/chunks/chunk-WGMCNCP6.js.map +7 -0
  207. package/dist/chunks/chunk-WKFRGICG.js +101 -0
  208. package/dist/chunks/chunk-WKFRGICG.js.map +7 -0
  209. package/dist/chunks/{chunk-3UGN25XS.js → chunk-WWTGWGH7.js} +80 -1662
  210. package/dist/chunks/chunk-WWTGWGH7.js.map +7 -0
  211. package/dist/chunks/{chunk-5UBRGTVN.js → chunk-X7QETPBC.js} +31 -15
  212. package/dist/chunks/chunk-X7QETPBC.js.map +7 -0
  213. package/dist/chunks/{chunk-LEU5CDSL.js → chunk-XFOSUGLU.js} +5 -5
  214. package/dist/chunks/{chunk-MZUC6LLH.js → chunk-XMYG2TKR.js} +4 -4
  215. package/dist/chunks/{chunk-MZUC6LLH.js.map → chunk-XMYG2TKR.js.map} +1 -1
  216. package/dist/chunks/chunk-YC65P7ZO.js +57 -0
  217. package/dist/chunks/chunk-YC65P7ZO.js.map +7 -0
  218. package/dist/chunks/{chunk-EKODKR6Y.js → chunk-YHFWMAQ5.js} +1 -24
  219. package/dist/chunks/chunk-YHFWMAQ5.js.map +7 -0
  220. package/dist/chunks/{chunk-C7Z6F3SO.js → chunk-ZFWICFNJ.js} +27 -20
  221. package/dist/chunks/{chunk-C7Z6F3SO.js.map → chunk-ZFWICFNJ.js.map} +2 -2
  222. package/dist/cli/decisions.d.ts.map +1 -1
  223. package/dist/cli/decisions.js +15 -3
  224. package/dist/cli/decisions.js.map +2 -2
  225. package/dist/cli/mesh.js +4 -3
  226. package/dist/cli/mesh.js.map +1 -1
  227. package/dist/commands/fabric-handler.d.ts +7 -0
  228. package/dist/commands/fabric-handler.d.ts.map +1 -0
  229. package/dist/commands/fabric-handler.js +916 -0
  230. package/dist/commands/fabric-handler.js.map +7 -0
  231. package/dist/commands/fabric.d.ts +11 -1
  232. package/dist/commands/fabric.d.ts.map +1 -1
  233. package/dist/compaction/claim-events.d.ts +61 -0
  234. package/dist/compaction/claim-events.d.ts.map +1 -0
  235. package/dist/compaction/claim-events.js +210 -0
  236. package/dist/compaction/claim-events.js.map +7 -0
  237. package/dist/compaction/claim.d.ts +51 -0
  238. package/dist/compaction/claim.d.ts.map +1 -0
  239. package/dist/compaction/hook.d.ts +28 -2
  240. package/dist/compaction/hook.d.ts.map +1 -1
  241. package/dist/compaction/hook.js +12 -7
  242. package/dist/compaction/owner.js +9 -8
  243. package/dist/compaction/trace-events.d.ts +1 -1
  244. package/dist/compaction/trace-events.d.ts.map +1 -1
  245. package/dist/components/configuration.js +6 -6
  246. package/dist/components/effect-scope.d.ts.map +1 -1
  247. package/dist/config.d.ts +39 -2
  248. package/dist/config.d.ts.map +1 -1
  249. package/dist/core/action-arguments.d.ts.map +1 -1
  250. package/dist/core/action-policy-hooks.d.ts +69 -0
  251. package/dist/core/action-policy-hooks.d.ts.map +1 -0
  252. package/dist/core/action-registry.d.ts +31 -10
  253. package/dist/core/action-registry.d.ts.map +1 -1
  254. package/dist/core/action-registry.js +12 -9
  255. package/dist/core/approval-controller.d.ts +23 -3
  256. package/dist/core/approval-controller.d.ts.map +1 -1
  257. package/dist/core/atomic-write.d.ts +164 -0
  258. package/dist/core/atomic-write.d.ts.map +1 -1
  259. package/dist/core/child-tool-allowlist.d.ts +17 -1
  260. package/dist/core/child-tool-allowlist.d.ts.map +1 -1
  261. package/dist/core/compact-controller.d.ts +34 -0
  262. package/dist/core/compact-controller.d.ts.map +1 -1
  263. package/dist/core/core-override-guidance.d.ts +3 -1
  264. package/dist/core/core-override-guidance.d.ts.map +1 -1
  265. package/dist/core/file-lock.d.ts.map +1 -1
  266. package/dist/core/foreground-tools.d.ts +4 -1
  267. package/dist/core/foreground-tools.d.ts.map +1 -1
  268. package/dist/core/host-policy.d.ts +43 -0
  269. package/dist/core/host-policy.d.ts.map +1 -0
  270. package/dist/core/host-sdk-runtime.d.ts.map +1 -1
  271. package/dist/core/host-sdk.d.ts.map +1 -1
  272. package/dist/core/host-sdk.js +1 -1
  273. package/dist/core/managed-host-guidance.d.ts +5 -0
  274. package/dist/core/managed-host-guidance.d.ts.map +1 -0
  275. package/dist/core/model-aliases.d.ts +22 -0
  276. package/dist/core/model-aliases.d.ts.map +1 -0
  277. package/dist/core/model-resolution.d.ts +41 -20
  278. package/dist/core/model-resolution.d.ts.map +1 -1
  279. package/dist/core/native-tool-result.d.ts +1 -0
  280. package/dist/core/native-tool-result.d.ts.map +1 -1
  281. package/dist/core/program-tasks.d.ts +52 -0
  282. package/dist/core/program-tasks.d.ts.map +1 -0
  283. package/dist/core/prompt-guidance.d.ts +5 -0
  284. package/dist/core/prompt-guidance.d.ts.map +1 -0
  285. package/dist/core/prompt-guidance.js +159 -0
  286. package/dist/core/prompt-guidance.js.map +7 -0
  287. package/dist/core/provider-operations.d.ts.map +1 -1
  288. package/dist/core/provider-operations.js +60 -108
  289. package/dist/core/provider-operations.js.map +3 -3
  290. package/dist/core/shell-inbox.d.ts.map +1 -1
  291. package/dist/core/shell-jobs.d.ts +7 -5
  292. package/dist/core/shell-jobs.d.ts.map +1 -1
  293. package/dist/core/shell-timing.d.ts.map +1 -1
  294. package/dist/core/skill-prompt.d.ts +1 -1
  295. package/dist/core/skill-prompt.d.ts.map +1 -1
  296. package/dist/core/skill-references.d.ts +1 -1
  297. package/dist/core/skill-references.d.ts.map +1 -1
  298. package/dist/core/system-guidance.d.ts.map +1 -1
  299. package/dist/core/tool-result-proxy.d.ts.map +1 -1
  300. package/dist/decisions/command.d.ts +2 -1
  301. package/dist/decisions/command.d.ts.map +1 -1
  302. package/dist/decisions/command.js +40 -12
  303. package/dist/decisions/command.js.map +2 -2
  304. package/dist/decisions/events.d.ts +12 -0
  305. package/dist/decisions/events.d.ts.map +1 -0
  306. package/dist/decisions/events.js +130 -0
  307. package/dist/decisions/events.js.map +7 -0
  308. package/dist/decisions/host.d.ts +31 -3
  309. package/dist/decisions/host.d.ts.map +1 -1
  310. package/dist/decisions/render.d.ts +44 -0
  311. package/dist/decisions/render.d.ts.map +1 -0
  312. package/dist/decisions/store.d.ts +8 -0
  313. package/dist/decisions/store.d.ts.map +1 -1
  314. package/dist/durable/agent.d.ts +8 -0
  315. package/dist/durable/agent.d.ts.map +1 -1
  316. package/dist/durable/extension-load-error.d.ts +8 -0
  317. package/dist/durable/extension-load-error.d.ts.map +1 -0
  318. package/dist/durable/session.d.ts +1 -0
  319. package/dist/durable/session.d.ts.map +1 -1
  320. package/dist/durable/worker-host.d.ts +10 -1
  321. package/dist/durable/worker-host.d.ts.map +1 -1
  322. package/dist/durable/worker-host.js +10 -1181
  323. package/dist/durable/worker-host.js.map +4 -4
  324. package/dist/durable/worker-options.d.ts +3 -0
  325. package/dist/durable/worker-options.d.ts.map +1 -1
  326. package/dist/durable/worker-role-seed.d.ts +82 -0
  327. package/dist/durable/worker-role-seed.d.ts.map +1 -0
  328. package/dist/durable/worker.js +43 -4
  329. package/dist/durable/worker.js.map +2 -2
  330. package/dist/durable-controls.d.ts.map +1 -1
  331. package/dist/durable-extension-wasm.d.ts +8 -0
  332. package/dist/durable-extension-wasm.d.ts.map +1 -0
  333. package/dist/durable-extension-wasm.js +32 -0
  334. package/dist/durable-extension-wasm.js.map +7 -0
  335. package/dist/durable-extension.d.ts +94 -0
  336. package/dist/durable-extension.d.ts.map +1 -0
  337. package/dist/durable-extension.js +649 -0
  338. package/dist/durable-extension.js.map +7 -0
  339. package/dist/durable-host.d.ts +8 -0
  340. package/dist/durable-host.d.ts.map +1 -0
  341. package/dist/durable-host.js +20 -0
  342. package/dist/durable-host.js.map +7 -0
  343. package/dist/durable-journal.d.ts +94 -0
  344. package/dist/durable-journal.d.ts.map +1 -0
  345. package/dist/durable.d.ts.map +1 -1
  346. package/dist/durable.js +10 -8
  347. package/dist/durable.js.map +2 -2
  348. package/dist/entropy/index.js +12 -10
  349. package/dist/entropy/pool-store.d.ts.map +1 -1
  350. package/dist/execution-service.d.ts +14 -0
  351. package/dist/execution-service.d.ts.map +1 -1
  352. package/dist/extension-bootstrap.d.ts.map +1 -1
  353. package/dist/extension-bootstrap.js +28 -27
  354. package/dist/extension-bootstrap.js.map +2 -2
  355. package/dist/extension-copy.d.ts +21 -0
  356. package/dist/extension-copy.d.ts.map +1 -0
  357. package/dist/extension-copy.js +90 -0
  358. package/dist/extension-copy.js.map +7 -0
  359. package/dist/extension.d.ts +1 -1
  360. package/dist/extension.d.ts.map +1 -1
  361. package/dist/fabric-exec-arguments.d.ts.map +1 -1
  362. package/dist/fabric-exec-tool.d.ts +2 -1
  363. package/dist/fabric-exec-tool.d.ts.map +1 -1
  364. package/dist/fabric-runtime-state.d.ts +19 -0
  365. package/dist/fabric-runtime-state.d.ts.map +1 -1
  366. package/dist/fabric-runtime-state.js +2125 -786
  367. package/dist/fabric-runtime-state.js.map +4 -4
  368. package/dist/fabric-state.d.ts +44 -1
  369. package/dist/fabric-state.d.ts.map +1 -1
  370. package/dist/index.d.ts +5 -3
  371. package/dist/index.d.ts.map +1 -1
  372. package/dist/index.js +88 -53
  373. package/dist/index.js.map +2 -2
  374. package/dist/jev/client.js +2 -2
  375. package/dist/jev/manager.d.ts +3 -0
  376. package/dist/jev/manager.d.ts.map +1 -1
  377. package/dist/jev/observation.d.ts +1 -1
  378. package/dist/jev/observation.js +6 -6
  379. package/dist/jev-fabric/bridge.d.ts.map +1 -1
  380. package/dist/jev.js +11 -12
  381. package/dist/managed-host.d.ts +13 -0
  382. package/dist/managed-host.d.ts.map +1 -1
  383. package/dist/memory/digest.js +2 -2
  384. package/dist/memory/discovery.js +6 -7
  385. package/dist/memory/file-worker.js +10 -11
  386. package/dist/memory/file-worker.js.map +1 -1
  387. package/dist/memory/normalize.js +5 -6
  388. package/dist/memory/search.js +7 -8
  389. package/dist/memory/worker-provider.js +11 -12
  390. package/dist/memory.js +11 -12
  391. package/dist/memory.js.map +1 -1
  392. package/dist/mesh/grants.d.ts +3 -3
  393. package/dist/mesh/grants.d.ts.map +1 -1
  394. package/dist/mesh/store.d.ts +8 -0
  395. package/dist/mesh/store.d.ts.map +1 -1
  396. package/dist/native-codemode.d.ts.map +1 -1
  397. package/dist/native-tool-catalog.d.ts.map +1 -1
  398. package/dist/native-tool-catalog.js +12 -3
  399. package/dist/native-tool-catalog.js.map +2 -2
  400. package/dist/programs/host.d.ts +18 -6
  401. package/dist/programs/host.d.ts.map +1 -1
  402. package/dist/programs/host.js +71 -47
  403. package/dist/programs/host.js.map +2 -2
  404. package/dist/programs/source.d.ts +11 -0
  405. package/dist/programs/source.d.ts.map +1 -1
  406. package/dist/programs/store.d.ts.map +1 -1
  407. package/dist/protocol.d.ts +504 -8
  408. package/dist/protocol.d.ts.map +1 -1
  409. package/dist/protocol.js +41 -11
  410. package/dist/provider-globals.d.ts +13 -0
  411. package/dist/provider-globals.d.ts.map +1 -0
  412. package/dist/providers/agents-actions.d.ts.map +1 -1
  413. package/dist/providers/agents-provider.d.ts +3 -0
  414. package/dist/providers/agents-provider.d.ts.map +1 -1
  415. package/dist/providers/captured-tools-provider.d.ts +5 -0
  416. package/dist/providers/captured-tools-provider.d.ts.map +1 -1
  417. package/dist/providers/compact-provider.d.ts +4 -1
  418. package/dist/providers/compact-provider.d.ts.map +1 -1
  419. package/dist/providers/components-provider.d.ts.map +1 -1
  420. package/dist/providers/decisions-provider.d.ts +9 -1
  421. package/dist/providers/decisions-provider.d.ts.map +1 -1
  422. package/dist/providers/jev-provider.d.ts +1 -1
  423. package/dist/providers/jev-provider.js +11 -12
  424. package/dist/providers/memory-provider.js +10 -11
  425. package/dist/providers/pi-tools-provider.d.ts +14 -0
  426. package/dist/providers/pi-tools-provider.d.ts.map +1 -1
  427. package/dist/providers/programs-provider.d.ts.map +1 -1
  428. package/dist/providers/sessions-provider.d.ts +7 -0
  429. package/dist/providers/sessions-provider.d.ts.map +1 -1
  430. package/dist/repeat-guard.d.ts +7 -6
  431. package/dist/repeat-guard.d.ts.map +1 -1
  432. package/dist/residency/actor-client.js +3 -3
  433. package/dist/residency/client.d.ts +15 -0
  434. package/dist/residency/client.d.ts.map +1 -1
  435. package/dist/residency/host.d.ts.map +1 -1
  436. package/dist/residency/host.js +34 -23
  437. package/dist/residency/launcher.js +1 -1
  438. package/dist/residency/pi-entry.js +34 -23
  439. package/dist/residency/pi-entry.js.map +1 -1
  440. package/dist/residency/protocol.d.ts +2 -0
  441. package/dist/residency/protocol.d.ts.map +1 -1
  442. package/dist/runners.js +11 -1
  443. package/dist/runners.js.map +2 -2
  444. package/dist/runtime/core-override-guest-types.js +2 -2
  445. package/dist/runtime/cpython-child-source.d.ts.map +1 -1
  446. package/dist/runtime/cpython-runtime.d.ts.map +1 -1
  447. package/dist/runtime/cpython-runtime.js +51 -21
  448. package/dist/runtime/cpython-runtime.js.map +2 -2
  449. package/dist/runtime/deadline-pause.d.ts +2 -0
  450. package/dist/runtime/deadline-pause.d.ts.map +1 -1
  451. package/dist/runtime/dynamic-guest-types.d.ts.map +1 -1
  452. package/dist/runtime/dynamic-guest-types.js +2 -1
  453. package/dist/runtime/exec-journal.d.ts +73 -0
  454. package/dist/runtime/exec-journal.d.ts.map +1 -0
  455. package/dist/runtime/exec-journal.js +335 -0
  456. package/dist/runtime/exec-journal.js.map +7 -0
  457. package/dist/runtime/guest-types.d.ts +3 -2
  458. package/dist/runtime/guest-types.d.ts.map +1 -1
  459. package/dist/runtime/guest-types.js +1 -1
  460. package/dist/runtime/journal-shim.d.ts +3 -0
  461. package/dist/runtime/journal-shim.d.ts.map +1 -0
  462. package/dist/runtime/kernel.d.ts +95 -1
  463. package/dist/runtime/kernel.d.ts.map +1 -1
  464. package/dist/runtime/monty-bridge.d.ts +6 -2
  465. package/dist/runtime/monty-bridge.d.ts.map +1 -1
  466. package/dist/runtime/monty-runtime.d.ts.map +1 -1
  467. package/dist/runtime/monty-runtime.js +27 -15
  468. package/dist/runtime/monty-runtime.js.map +2 -2
  469. package/dist/runtime/native-codemode-guest.d.ts.map +1 -1
  470. package/dist/runtime/node-process-runtime.d.ts.map +1 -1
  471. package/dist/runtime/node-process-runtime.js +7 -5
  472. package/dist/runtime/quickjs-runtime.d.ts +7 -1
  473. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  474. package/dist/runtime/quickjs-runtime.js +5 -4
  475. package/dist/runtime/sha256.d.ts +4 -0
  476. package/dist/runtime/sha256.d.ts.map +1 -0
  477. package/dist/runtime/transpile.d.ts +8 -0
  478. package/dist/runtime/transpile.d.ts.map +1 -0
  479. package/dist/runtime/type-checker.d.ts +1 -7
  480. package/dist/runtime/type-checker.d.ts.map +1 -1
  481. package/dist/runtime/type-checker.js +4 -2
  482. package/dist/runtime/typescript-kernel.js +13 -10
  483. package/dist/runtime/typescript-kernel.js.map +1 -1
  484. package/dist/runtime-state-builtins.d.ts.map +1 -1
  485. package/dist/speculation/scanner.js +1 -1
  486. package/dist/speculation/store.d.ts +7 -16
  487. package/dist/speculation/store.d.ts.map +1 -1
  488. package/dist/speculation/types.d.ts +1 -0
  489. package/dist/speculation/types.d.ts.map +1 -1
  490. package/dist/storage/retention.d.ts.map +1 -1
  491. package/dist/topology/participant-directory.d.ts +26 -1
  492. package/dist/topology/participant-directory.d.ts.map +1 -1
  493. package/dist/topology/peer-presence.d.ts.map +1 -1
  494. package/dist/topology/peer-settle.js +11 -0
  495. package/dist/topology/peer-settle.js.map +7 -0
  496. package/dist/topology/session-label-settings.d.ts +13 -0
  497. package/dist/topology/session-label-settings.d.ts.map +1 -0
  498. package/dist/topology/session-label.d.ts +60 -0
  499. package/dist/topology/session-label.d.ts.map +1 -0
  500. package/dist/topology/types.d.ts +27 -0
  501. package/dist/topology/types.d.ts.map +1 -1
  502. package/dist/type-error-guidance.js +1 -1
  503. package/dist/ui/controller.d.ts +1 -0
  504. package/dist/ui/controller.d.ts.map +1 -1
  505. package/dist/ui/conversation-chrome.d.ts.map +1 -1
  506. package/dist/ui/conversation-chrome.js +3 -2
  507. package/dist/ui/conversation-commands.d.ts +1 -1
  508. package/dist/ui/conversation-commands.d.ts.map +1 -1
  509. package/dist/ui/conversation-native-reader.js +2 -2
  510. package/dist/ui/conversation-selection.d.ts +4 -1
  511. package/dist/ui/conversation-selection.d.ts.map +1 -1
  512. package/dist/ui/conversation-targets.d.ts.map +1 -1
  513. package/dist/ui/conversation-targets.js +2 -2
  514. package/dist/ui/conversation.d.ts +25 -24
  515. package/dist/ui/conversation.d.ts.map +1 -1
  516. package/dist/ui/conversation.js +170 -339
  517. package/dist/ui/conversation.js.map +2 -2
  518. package/dist/ui/core-tool-render.d.ts +1 -0
  519. package/dist/ui/core-tool-render.d.ts.map +1 -1
  520. package/dist/ui/dashboard.d.ts.map +1 -1
  521. package/dist/ui/dashboard.js +17 -13
  522. package/dist/ui/dashboard.js.map +2 -2
  523. package/dist/ui/fabric-render.d.ts +6 -0
  524. package/dist/ui/fabric-render.d.ts.map +1 -1
  525. package/dist/ui/footer-dock.d.ts +48 -0
  526. package/dist/ui/footer-dock.d.ts.map +1 -0
  527. package/dist/ui/format.d.ts +7 -0
  528. package/dist/ui/format.d.ts.map +1 -1
  529. package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -1
  530. package/dist/ui/settings-sections-presentation.d.ts.map +1 -1
  531. package/dist/ui/settings-values.d.ts +1 -0
  532. package/dist/ui/settings-values.d.ts.map +1 -1
  533. package/dist/ui/settings.js +59 -18
  534. package/dist/ui/settings.js.map +2 -2
  535. package/dist/ui/shell-hang-keys.d.ts +8 -1
  536. package/dist/ui/shell-hang-keys.d.ts.map +1 -1
  537. package/dist/ui/shell-tasks.d.ts +2 -2
  538. package/dist/ui/shell-tasks.d.ts.map +1 -1
  539. package/dist/ui/shell-tasks.js +27 -94
  540. package/dist/ui/shell-tasks.js.map +2 -2
  541. package/dist/ui/snapshot.d.ts.map +1 -1
  542. package/dist/ui/terminal-title.d.ts +41 -0
  543. package/dist/ui/terminal-title.d.ts.map +1 -0
  544. package/dist/ui/types.d.ts +4 -0
  545. package/dist/ui/types.d.ts.map +1 -1
  546. package/dist/ui/widget-keys.d.ts +5 -0
  547. package/dist/ui/widget-keys.d.ts.map +1 -0
  548. package/dist/ui/widget.d.ts +34 -16
  549. package/dist/ui/widget.d.ts.map +1 -1
  550. package/dist/ui/word-diff/line-emphasis.js +1603 -0
  551. package/dist/ui/word-diff/line-emphasis.js.map +7 -0
  552. package/dist/util.d.ts +2 -0
  553. package/dist/util.d.ts.map +1 -1
  554. package/dist/verified/authority.d.ts +2 -2
  555. package/dist/verified/authority.d.ts.map +1 -1
  556. package/dist/verified/budget.d.ts +4 -0
  557. package/dist/verified/budget.d.ts.map +1 -0
  558. package/dist/verified/generated/actor-name.d.ts +4 -0
  559. package/dist/verified/generated/actor-name.js +17 -0
  560. package/dist/verified/generated/authority.d.ts +4 -0
  561. package/dist/verified/generated/authority.js +28 -0
  562. package/dist/verified/generated/budget.d.ts +4 -0
  563. package/dist/verified/generated/budget.js +17 -0
  564. package/dist/verified/generated/compaction.d.ts +4 -0
  565. package/dist/verified/generated/compaction.js +19 -0
  566. package/dist/verified/generated/grants.d.ts +4 -0
  567. package/dist/verified/generated/grants.js +17 -0
  568. package/dist/verified/generated/lifecycle.d.ts +4 -0
  569. package/dist/verified/generated/lifecycle.js +50 -0
  570. package/dist/verified/generated/manifest.json +137 -48
  571. package/dist/verified/generated/policy.d.ts +17 -0
  572. package/dist/verified/generated/policy.js +211 -0
  573. package/dist/verified/generated/provider.d.ts +4 -0
  574. package/dist/verified/generated/provider.js +18 -0
  575. package/dist/verified/generated/resources.d.ts +6 -0
  576. package/dist/verified/generated/resources.js +73 -0
  577. package/dist/verified/generated/speculation.d.ts +6 -0
  578. package/dist/verified/generated/speculation.js +48 -0
  579. package/dist/verified/generated/storage.d.ts +4 -0
  580. package/dist/verified/generated/storage.js +18 -0
  581. package/dist/verified/grants.d.ts +22 -0
  582. package/dist/verified/grants.d.ts.map +1 -0
  583. package/dist/verified/lifecycle.d.ts +31 -0
  584. package/dist/verified/lifecycle.d.ts.map +1 -0
  585. package/dist/verified/machine.d.ts +18 -0
  586. package/dist/verified/machine.d.ts.map +1 -0
  587. package/dist/verified/memory.d.ts +1 -1
  588. package/dist/verified/memory.d.ts.map +1 -1
  589. package/dist/verified/nat.d.ts +1 -1
  590. package/dist/verified/nat.d.ts.map +1 -1
  591. package/dist/verified/policy.d.ts +17 -5
  592. package/dist/verified/policy.d.ts.map +1 -1
  593. package/dist/verified/provider.d.ts +22 -0
  594. package/dist/verified/provider.d.ts.map +1 -0
  595. package/dist/verified/resources.d.ts +21 -7
  596. package/dist/verified/resources.d.ts.map +1 -1
  597. package/dist/verified/speculation.d.ts +36 -0
  598. package/dist/verified/speculation.d.ts.map +1 -0
  599. package/dist/verified/storage.d.ts.map +1 -1
  600. package/dist/worker/missing-install.d.ts +8 -0
  601. package/dist/worker/missing-install.d.ts.map +1 -0
  602. package/dist/worker/options.d.ts.map +1 -1
  603. package/dist/worker/options.js +25 -0
  604. package/dist/worker/options.js.map +2 -2
  605. package/dist/worker/prompt-lifecycle.d.ts +16 -0
  606. package/dist/worker/prompt-lifecycle.d.ts.map +1 -0
  607. package/dist/worker/prompt-lifecycle.js +90 -0
  608. package/dist/worker/prompt-lifecycle.js.map +7 -0
  609. package/dist/worker/questions.d.ts +15 -3
  610. package/dist/worker/questions.d.ts.map +1 -1
  611. package/dist/worker/questions.js +53 -8
  612. package/dist/worker/questions.js.map +2 -2
  613. package/dist/worker/recovery-watchdog.d.ts +22 -0
  614. package/dist/worker/recovery-watchdog.d.ts.map +1 -1
  615. package/dist/worker/recovery-watchdog.js +116 -1
  616. package/dist/worker/recovery-watchdog.js.map +2 -2
  617. package/dist/worker/result.js +1 -1
  618. package/dist/worker/result.js.map +2 -2
  619. package/dist/worker.js +131 -21
  620. package/dist/worker.js.map +2 -2
  621. package/docs/actor-name-policy-handoff.md +5 -0
  622. package/docs/agents.md +164 -17
  623. package/docs/architecture.md +5 -1
  624. package/docs/audit-trace.md +2 -1
  625. package/docs/background-tasks.md +102 -16
  626. package/docs/codemode-parity.md +2 -2
  627. package/docs/compaction.md +21 -5
  628. package/docs/components.md +1 -1
  629. package/docs/configuration.md +111 -66
  630. package/docs/decisions.md +92 -10
  631. package/docs/durable-extension.md +121 -0
  632. package/docs/durable-pi.md +306 -6
  633. package/docs/extractive-history.md +3 -1
  634. package/docs/interface.md +20 -17
  635. package/docs/jev.md +1 -1
  636. package/docs/kernels.md +1 -1
  637. package/{node_modules/pi-coralbricks-provider/LICENSE → docs/licenses/gdp-wired-mit.txt} +1 -1
  638. package/docs/managed-host-migration.md +50 -0
  639. package/docs/programmatic-compaction.md +216 -6
  640. package/docs/programs.md +23 -1
  641. package/docs/prompt-cache.md +4 -2
  642. package/docs/provider-capabilities.md +15 -14
  643. package/docs/providers.md +99 -3
  644. package/docs/shell-composition.md +15 -0
  645. package/docs/short-lock-protocol.md +90 -0
  646. package/docs/skills.md +5 -1
  647. package/docs/speculation.md +6 -0
  648. package/docs/verified-kernels.md +309 -220
  649. package/package.json +45 -24
  650. package/proofs/actor-name.ts +27 -0
  651. package/proofs/authority.ts +62 -0
  652. package/proofs/budget.ts +24 -0
  653. package/proofs/compaction.ts +51 -0
  654. package/proofs/grants.ts +39 -0
  655. package/proofs/index.ts +40 -0
  656. package/proofs/kernel.ts +44 -0
  657. package/proofs/lifecycle.ts +128 -0
  658. package/proofs/policy.ts +195 -0
  659. package/proofs/provider.ts +52 -0
  660. package/proofs/resources.ts +160 -0
  661. package/proofs/speculation.ts +69 -0
  662. package/proofs/storage.ts +66 -0
  663. package/scripts/verified-kernels.ts +141 -0
  664. package/skillsets/python/fabric-council/SKILL.md +92 -20
  665. package/skillsets/python/fabric-exec/SKILL.md +2 -2
  666. package/skillsets/python/fabric-exec/references/agents.md +10 -4
  667. package/skillsets/python/fabric-fusion/SKILL.md +1 -1
  668. package/skillsets/python/fabric-guide/SKILL.md +1 -1
  669. package/skillsets/typescript/fabric-council/SKILL.md +109 -22
  670. package/skillsets/typescript/fabric-exec/SKILL.md +7 -7
  671. package/skillsets/typescript/fabric-exec/references/agents.md +12 -3
  672. package/skillsets/typescript/fabric-fusion/SKILL.md +1 -1
  673. package/skillsets/typescript/fabric-guide/SKILL.md +1 -1
  674. package/LAWS.bend +0 -502
  675. package/PROOF.bend +0 -452
  676. package/dist/chunks/chunk-3UGN25XS.js.map +0 -7
  677. package/dist/chunks/chunk-4EW7GVUR.js.map +0 -7
  678. package/dist/chunks/chunk-5UBRGTVN.js.map +0 -7
  679. package/dist/chunks/chunk-BN7F52EG.js +0 -525
  680. package/dist/chunks/chunk-BN7F52EG.js.map +0 -7
  681. package/dist/chunks/chunk-DK35W6U7.js +0 -259
  682. package/dist/chunks/chunk-DK35W6U7.js.map +0 -7
  683. package/dist/chunks/chunk-EFETPXU2.js.map +0 -7
  684. package/dist/chunks/chunk-EHQQ4KCX.js.map +0 -7
  685. package/dist/chunks/chunk-EKODKR6Y.js.map +0 -7
  686. package/dist/chunks/chunk-FE6NOAO7.js.map +0 -7
  687. package/dist/chunks/chunk-FIDUHKMM.js.map +0 -7
  688. package/dist/chunks/chunk-FSB2VIRZ.js.map +0 -7
  689. package/dist/chunks/chunk-GIK2WNAK.js.map +0 -7
  690. package/dist/chunks/chunk-GO32KSEZ.js.map +0 -7
  691. package/dist/chunks/chunk-IR3PIHJM.js.map +0 -7
  692. package/dist/chunks/chunk-ITVLKXCI.js +0 -266
  693. package/dist/chunks/chunk-ITVLKXCI.js.map +0 -7
  694. package/dist/chunks/chunk-K7J2ABAZ.js.map +0 -7
  695. package/dist/chunks/chunk-KJZAOENY.js +0 -212
  696. package/dist/chunks/chunk-KJZAOENY.js.map +0 -7
  697. package/dist/chunks/chunk-LNASO4VT.js.map +0 -7
  698. package/dist/chunks/chunk-MLLYR3Y6.js.map +0 -7
  699. package/dist/chunks/chunk-P4KH4S4S.js.map +0 -7
  700. package/dist/chunks/chunk-PK4NIJEV.js.map +0 -7
  701. package/dist/chunks/chunk-Q2JQ3RYZ.js +0 -99
  702. package/dist/chunks/chunk-Q2JQ3RYZ.js.map +0 -7
  703. package/dist/chunks/chunk-R2XQ6AHT.js.map +0 -7
  704. package/dist/chunks/chunk-ROTCDDOV.js.map +0 -7
  705. package/dist/chunks/chunk-SPCJXN4K.js.map +0 -7
  706. package/dist/chunks/chunk-U366I5K2.js.map +0 -7
  707. package/dist/chunks/chunk-UKMQK5VP.js +0 -231
  708. package/dist/chunks/chunk-UKMQK5VP.js.map +0 -7
  709. package/dist/chunks/chunk-UOM37PE4.js.map +0 -7
  710. package/dist/chunks/chunk-UTOBAZ5T.js.map +0 -7
  711. package/dist/chunks/chunk-VSDUSNIA.js.map +0 -7
  712. package/dist/chunks/chunk-VTK2FEH7.js +0 -229
  713. package/dist/chunks/chunk-VTK2FEH7.js.map +0 -7
  714. package/dist/chunks/chunk-VYQV5JRT.js.map +0 -7
  715. package/dist/chunks/chunk-XCEEQ5AB.js.map +0 -7
  716. package/dist/chunks/chunk-ZLNJDTCN.js +0 -226
  717. package/dist/chunks/chunk-ZLNJDTCN.js.map +0 -7
  718. package/dist/chunks/chunk-ZQMBS5SH.js.map +0 -7
  719. package/dist/ui/conversation-shortcut.d.ts +0 -3
  720. package/dist/ui/conversation-shortcut.d.ts.map +0 -1
  721. package/dist/ui/widget-activity.d.ts +0 -21
  722. package/dist/ui/widget-activity.d.ts.map +0 -1
  723. package/dist/verified/generated/authority-kernel.d.ts +0 -10
  724. package/dist/verified/generated/authority-kernel.js +0 -127
  725. package/dist/verified/generated/kernel.d.ts +0 -31
  726. package/dist/verified/generated/kernel.js +0 -389
  727. package/dist/verified/generated/lifecycle-kernel.d.ts +0 -7
  728. package/dist/verified/generated/lifecycle-kernel.js +0 -164
  729. package/dist/verified/generated/provider-kernel.d.ts +0 -9
  730. package/dist/verified/generated/provider-kernel.js +0 -87
  731. package/dist/verified/generated/storage-kernel.d.ts +0 -11
  732. package/dist/verified/generated/storage-kernel.js +0 -107
  733. package/docs/licenses/bend-apache-2.0.txt +0 -202
  734. package/node_modules/pi-coralbricks-provider/README.md +0 -306
  735. package/node_modules/pi-coralbricks-provider/auth.ts +0 -30
  736. package/node_modules/pi-coralbricks-provider/custom-models.json +0 -1
  737. package/node_modules/pi-coralbricks-provider/deprecated-models.json +0 -1
  738. package/node_modules/pi-coralbricks-provider/guard.ts +0 -155
  739. package/node_modules/pi-coralbricks-provider/index.ts +0 -662
  740. package/node_modules/pi-coralbricks-provider/models.json +0 -88
  741. package/node_modules/pi-coralbricks-provider/package.json +0 -74
  742. package/node_modules/pi-coralbricks-provider/park.ts +0 -122
  743. package/node_modules/pi-coralbricks-provider/patch.json +0 -34
  744. package/node_modules/pi-coralbricks-provider/scripts/update-models.js +0 -658
  745. package/node_modules/pi-coralbricks-provider/settings.ts +0 -143
  746. package/node_modules/pi-coralbricks-provider/sync-policy.ts +0 -309
  747. package/proofs/abi.json +0 -308
  748. package/proofs/authority-abi.json +0 -7
  749. package/proofs/authority-kernel.bend +0 -23
  750. package/proofs/authority-proof.bend +0 -74
  751. package/proofs/authority-spec.bend +0 -30
  752. package/proofs/authority-state.bend +0 -43
  753. package/proofs/authority-types.d.ts +0 -3
  754. package/proofs/kernel.bend +0 -139
  755. package/proofs/lifecycle-abi.json +0 -3
  756. package/proofs/lifecycle-kernel.bend +0 -11
  757. package/proofs/lifecycle-proof.bend +0 -249
  758. package/proofs/lifecycle-spec.bend +0 -261
  759. package/proofs/lifecycle-types.d.ts +0 -4
  760. package/proofs/lifecycle.bend +0 -119
  761. package/proofs/provider-abi.json +0 -4
  762. package/proofs/provider-kernel.bend +0 -14
  763. package/proofs/provider-plans.bend +0 -28
  764. package/proofs/provider-spec.bend +0 -14
  765. package/proofs/provider-types.d.ts +0 -5
  766. package/proofs/resource-proof.bend +0 -633
  767. package/proofs/resource-spec.bend +0 -133
  768. package/proofs/resources.bend +0 -160
  769. package/proofs/state-kernel.bend +0 -17
  770. package/proofs/state-plans.bend +0 -40
  771. package/proofs/state-proof.bend +0 -42
  772. package/proofs/state-spec.bend +0 -26
  773. package/proofs/storage-abi.json +0 -3
  774. package/proofs/storage-kernel.bend +0 -11
  775. package/proofs/storage-plans.bend +0 -100
  776. package/proofs/storage-proof.bend +0 -176
  777. package/proofs/storage-spec.bend +0 -70
  778. package/proofs/storage-types.d.ts +0 -8
  779. package/proofs/types.d.ts +0 -7
  780. package/scripts/test-verified-kernels.mjs +0 -107
  781. package/scripts/verified-kernels.mjs +0 -176
  782. /package/dist/chunks/{chunk-3FJUP3GV.js.map → chunk-36XQFTEN.js.map} +0 -0
  783. /package/dist/chunks/{chunk-ZEXCKK4K.js.map → chunk-4WKD3YM3.js.map} +0 -0
  784. /package/dist/chunks/{chunk-5XBYFSI5.js.map → chunk-7YNE4NB2.js.map} +0 -0
  785. /package/dist/chunks/{chunk-K6QXUGS5.js.map → chunk-BMAEZNZ5.js.map} +0 -0
  786. /package/dist/chunks/{chunk-CCHZXF6K.js.map → chunk-CXYJJ3HZ.js.map} +0 -0
  787. /package/dist/chunks/{chunk-TIIIHPHF.js.map → chunk-GS67KDMV.js.map} +0 -0
  788. /package/dist/chunks/{chunk-D5NYNIST.js.map → chunk-H57KPL3V.js.map} +0 -0
  789. /package/dist/chunks/{chunk-INRXG4J5.js.map → chunk-HGD75NZY.js.map} +0 -0
  790. /package/dist/chunks/{chunk-UXIBKMUM.js.map → chunk-KIFOEBYJ.js.map} +0 -0
  791. /package/dist/chunks/{chunk-FUY6XVRX.js.map → chunk-MPMEK3IQ.js.map} +0 -0
  792. /package/dist/chunks/{chunk-HP5P7NBO.js.map → chunk-MSDL7U6Q.js.map} +0 -0
  793. /package/dist/chunks/{chunk-QT4W5YVB.js.map → chunk-RAA3FAYZ.js.map} +0 -0
  794. /package/dist/chunks/{chunk-53N2I4QA.js.map → chunk-TXCNZCZP.js.map} +0 -0
  795. /package/dist/chunks/{chunk-ASSLHWZS.js.map → chunk-UFMYN5TA.js.map} +0 -0
  796. /package/dist/chunks/{chunk-LEU5CDSL.js.map → chunk-XFOSUGLU.js.map} +0 -0
@@ -2,8 +2,14 @@ import {
2
2
  formatFabricEffectConflict
3
3
  } from "./chunk-LMAVZN7J.js";
4
4
  import {
5
- FABRIC_NESTED_TOOL_CALL_ID_PREFIX
6
- } from "./chunk-Q2JQ3RYZ.js";
5
+ providerGlobalNames
6
+ } from "./chunk-35EEGOH3.js";
7
+ import {
8
+ Interner,
9
+ bit,
10
+ idSet,
11
+ members
12
+ } from "./chunk-NJHJKINP.js";
7
13
  import {
8
14
  MAX_AUDIT_VALUE_CHARS,
9
15
  boundedPreviewValue,
@@ -16,12 +22,10 @@ import {
16
22
  strictDecisionResult,
17
23
  validateCatalogArgs,
18
24
  validationMessage
19
- } from "./chunk-G4TLWHRS.js";
25
+ } from "./chunk-7N7IC3Z2.js";
20
26
  import {
21
- runAbortable,
22
- settleWithin,
23
- throwIfAborted
24
- } from "./chunk-7TB7NXSL.js";
27
+ executionOutcomeFromError
28
+ } from "./chunk-HSEZPCL5.js";
25
29
  import {
26
30
  activeQuarantinedRefNames,
27
31
  applyActiveActionName,
@@ -30,184 +34,109 @@ import {
30
34
  getActiveRepairCompiler,
31
35
  isActiveQuarantine,
32
36
  normalizeActiveArguments
33
- } from "./chunk-53N2I4QA.js";
37
+ } from "./chunk-TXCNZCZP.js";
38
+ import {
39
+ runAbortable,
40
+ settleWithin,
41
+ throwIfAborted
42
+ } from "./chunk-7TB7NXSL.js";
43
+ import {
44
+ FABRIC_NESTED_TOOL_CALL_ID_PREFIX
45
+ } from "./chunk-2RWNVCFD.js";
34
46
  import {
35
47
  FabricResolutionError,
36
- FabricTraceSafeError,
37
- executionOutcomeFromError
38
- } from "./chunk-MLLYR3Y6.js";
48
+ FabricTraceSafeError
49
+ } from "./chunk-PUBHBEYO.js";
39
50
  import {
40
51
  stableJsonHash
41
52
  } from "./chunk-3YZUQESG.js";
42
53
  import {
43
- Ae,
44
- BEND_NAT_MAX,
45
- Xe,
46
- _n,
47
- boundedEffectResources,
48
- encodeResourceEffects,
49
- nn
50
- } from "./chunk-BN7F52EG.js";
54
+ VERIFIED_NAT_MAX,
55
+ consume,
56
+ knownConflict,
57
+ unknownConflict
58
+ } from "./chunk-P7YSPKTM.js";
51
59
 
52
- // src/verified/generated/authority-kernel.js
53
- function d(t, e) {
54
- return { $: t < e ? "LT" : t === e ? "EQ" : "GT" };
55
- }
56
- function v(t) {
57
- for (; t !== null && typeof t == "object" && t.$ === "$JMP"; )
58
- t = t.f(t.x);
59
- return t;
60
+ // src/verified/generated/authority.js
61
+ function $n(v, what) {
62
+ if (typeof v !== "number" || !Number.isSafeInteger(v) || v < 0) throw new RangeError(what + " must be a natural below 2^53, not " + v);
63
+ return v;
60
64
  }
61
- function l(t, e) {
62
- return (...r) => r.length < e ? l((...u2) => t(...r, ...u2), e - r.length) : v(t(...r));
63
- }
64
- function g(t, e, r) {
65
- for (; ; ) {
66
- let u2 = t, n = e, o = r;
67
- if (u2.$ === "Nil")
68
- return n.$ === "Nil" ? o : false;
69
- {
70
- let a2 = u2.head, s = u2.tail;
71
- if (n.$ === "Nil")
72
- return false;
73
- {
74
- let c = n.head, _ = n.tail;
75
- t = s, e = _, r = f(o, L(a2, c));
76
- continue;
77
- }
78
- }
79
- }
80
- }
81
- function y(t, e, r) {
82
- for (; ; ) {
83
- let u2 = t, n = e, o = r;
84
- if (u2.$ === "Nil")
85
- return o;
86
- {
87
- let a2 = u2.head, s = u2.tail, c = g(n, a2, true);
88
- t = s, e = n, r = o || c;
89
- continue;
90
- }
91
- }
92
- }
93
- function p(t, e, r) {
94
- for (; ; ) {
95
- let u2 = t, n = e, o = r;
96
- if (u2.$ === "Nil")
97
- return o;
98
- {
99
- let a2 = u2.head;
100
- t = u2.tail, e = n, r = f(o, y(n, a2, false));
101
- continue;
102
- }
103
- }
104
- }
105
- function R(t) {
106
- return { $: "authority-state.Active", grants: t };
107
- }
108
- function b(t) {
109
- return t.$ !== "authority-state.Released";
110
- }
111
- function w(t, e) {
112
- if (t.$ === "authority-state.Released")
113
- return false;
114
- {
115
- let r = t.grants;
116
- return y(r, e, false);
65
+ function $m(v, what) {
66
+ if (!(v instanceof Map)) throw new RangeError(what + " must be a Map of naturals");
67
+ for (const [key, x] of v) {
68
+ $n(key, "a key of " + what);
69
+ $n(x, "a cell of " + what);
117
70
  }
71
+ return v;
118
72
  }
119
- function A(t, e) {
120
- return t ? { $: "authority-state.Active", grants: e } : { $: "authority-state.Released" };
73
+ function $keys(maps, names) {
74
+ const keys = /* @__PURE__ */ new Set();
75
+ let past = 0;
76
+ for (const c of Object.values(maps)) for (const key of c.keys()) past = Math.max(past, key + 1);
77
+ for (const n of names) for (const key of maps[n].keys()) keys.add(key);
78
+ return [...keys, past];
121
79
  }
122
- function x(t, e) {
123
- if (t.$ === "authority-state.Released")
124
- return { $: "authority-state.Released" };
125
- {
126
- let r = t.grants;
127
- return A(p(e, r, true), e);
80
+ function $every(keys, f) {
81
+ const past = keys[keys.length - 1], d = f(past), cells = /* @__PURE__ */ new Map();
82
+ for (let i = 0; i < keys.length - 1; i++) {
83
+ const v = f(keys[i]);
84
+ if (v !== d) cells.set(keys[i], v);
128
85
  }
86
+ return { cells, d };
129
87
  }
130
- function k(t) {
131
- return { $: "authority-state.Released" };
132
- }
133
- function E(t) {
134
- return R(t);
135
- }
136
- function m(t) {
137
- return b(t);
138
- }
139
- function N(t, e) {
140
- return w(t, e);
141
- }
142
- function Q(t, e) {
143
- return x(t, e);
144
- }
145
- function q(t) {
146
- return k(t);
147
- }
148
- function f(t, e) {
149
- return t ? e : false;
150
- }
151
- function L(t, e) {
152
- return U(d(t, e));
153
- }
154
- function U(t) {
155
- return t.$ === "EQ";
156
- }
157
- var $ = /* @__PURE__ */ new Map([["Unknown", "resources.Unknown"], ["Exact", "resources.Exact"], ["Quiet", "resources.Quiet"], ["Active", "authority-state.Active"], ["Released", "authority-state.Released"]]);
158
- var h = /* @__PURE__ */ new Map([["resources.Unknown", "Unknown"], ["resources.Exact", "Exact"], ["resources.Quiet", "Quiet"], ["authority-state.Active", "Active"], ["authority-state.Released", "Released"]]);
159
- function i(t, e) {
160
- let r = [t];
161
- for (let u2 = [[r, 0]]; u2.length > 0; ) {
162
- let [n, o] = u2.pop(), a2 = n[o];
163
- if (a2 === null || typeof a2 != "object") continue;
164
- let s = Array.isArray(a2) ? [...a2] : { ...a2 };
165
- typeof s.$ == "string" && (s.$ = e.get(s.$) ?? s.$), n[o] = s;
166
- for (let c of Object.keys(s)) u2.push([s, c]);
167
- }
168
- return r[0];
169
- }
170
- var j = /* @__PURE__ */ l((t) => E(t), 1);
171
- var D = (t) => i(j(i(t, $)), h);
172
- var I = /* @__PURE__ */ l((t) => m(t), 1);
173
- var M = (t) => i(I(i(t, $)), h);
174
- var T = /* @__PURE__ */ l((t, e) => N(t, e), 2);
175
- var B = (t, e) => i(T(i(t, $), i(e, $)), h);
176
- var C = /* @__PURE__ */ l((t, e) => Q(t, e), 2);
177
- var G = (t, e) => i(C(i(t, $), i(e, $)), h);
178
- var J = /* @__PURE__ */ l((t) => q(t), 1);
179
- var O = (t) => i(J(i(t, $)), h);
88
+ var capabilityAuthority = /* @__PURE__ */ (() => {
89
+ function init(params) {
90
+ const env = {}, s = {};
91
+ return { scalars: { "live": 0, "granted": 0 }, maps: { "Grants": /* @__PURE__ */ new Map() } };
92
+ }
93
+ function step2(params, state, input) {
94
+ const env = { "op": $n(input["op"], "input op"), "name": $n(input["name"], "input name"), "parentLive": $n(input["parentLive"], "input parentLive") }, s = state.scalars, dft = { ...state.defaults }, maps = { ...state.maps, "Candidate": $m(input["Candidate"], "input Candidate"), "Parent": $m(input["Parent"], "input Parent") };
95
+ const flag0 = $keys(maps, ["Candidate", "Parent"]).every((k) => (maps["Candidate"].get(k) ?? 0) <= 1 && (maps["Parent"].get(k) ?? 0) <= 1);
96
+ const flag1 = $keys(maps, ["Candidate", "Parent"]).every((k) => !(1 <= (maps["Candidate"].get(k) ?? 0)) || 1 <= (maps["Parent"].get(k) ?? 0));
97
+ const flag2 = $keys(maps, ["Candidate", "Parent"]).every((k) => (maps["Candidate"].get(k) ?? 0) <= (maps["Parent"].get(k) ?? 0));
98
+ const flag3 = env["op"] === 0;
99
+ const flag4 = env["op"] === 1 && (env["parentLive"] === 1 && flag2);
100
+ const flag5 = env["op"] === 2 && (s["live"] === 1 && 1 <= (maps["Grants"].get(env["name"]) ?? dft["Grants"] ?? 0));
101
+ if (!(env["op"] < 4 && env["parentLive"] <= 1 && flag0)) throw new RangeError("capability authority: the request fails the rule's assumption, so no proof covers the step it would take");
102
+ const scalars = { ...s, "live": flag3 || flag4 ? 1 : env["op"] === 2 ? s["live"] : 0, "granted": flag5 ? 1 : 0 };
103
+ const write0 = $every($keys(maps, ["Candidate", "Grants"]), (k) => flag3 || flag4 ? maps["Candidate"].get(k) ?? 0 : env["op"] === 2 ? maps["Grants"].get(k) ?? dft["Grants"] ?? 0 : 0);
104
+ state.maps["Grants"] = write0.cells;
105
+ dft["Grants"] = write0.d;
106
+ return Object.keys(dft).length ? { scalars, maps: state.maps, defaults: dft } : { scalars, maps: state.maps };
107
+ }
108
+ return { init, step: step2 };
109
+ })();
180
110
 
181
111
  // src/verified/authority.ts
182
- var encodeGrant = (grant) => {
183
- const text = JSON.stringify([
184
- grant.ref,
185
- grant.provider,
186
- grant.providerBindingId,
187
- grant.generation,
188
- grant.descriptorHash
189
- ]);
190
- let encoded = { $: "Nil" };
191
- for (let i3 = text.length - 1; i3 >= 0; i3--) {
192
- encoded = { $: "Con", head: text.charCodeAt(i3), tail: encoded };
193
- }
194
- return encoded;
195
- };
196
- var encodeGrants = (grants) => {
197
- let encoded = { $: "Nil" };
198
- for (let i3 = grants.length - 1; i3 >= 0; i3--) {
199
- encoded = { $: "Con", head: encodeGrant(grants[i3]), tail: encoded };
200
- }
201
- return encoded;
202
- };
112
+ var ISSUE = 0;
113
+ var DERIVE = 1;
114
+ var USE = 2;
115
+ var RELEASE = 3;
116
+ var encodeGrant = (grant) => JSON.stringify([
117
+ grant.ref,
118
+ grant.provider,
119
+ grant.providerBindingId,
120
+ grant.generation,
121
+ grant.descriptorHash
122
+ ]);
203
123
  var CapabilityAuthority = class _CapabilityAuthority {
204
124
  #state;
125
+ #names;
205
126
  #grants;
206
127
  constructor(grants, parent) {
207
128
  const canonical = grants.map((grant) => Object.freeze({ ...grant }));
208
129
  this.#grants = new Map(canonical.map((grant) => [grant.ref, grant]));
209
- const encoded = encodeGrants(canonical);
210
- this.#state = parent ? G(parent.#state, encoded) : D(encoded);
130
+ this.#names = parent ? parent.#names : new Interner();
131
+ const candidate = idSet(canonical.map((grant) => this.#names.id(encodeGrant(grant))));
132
+ const parentGrants = parent ? idSet(members(parent.#state, "Grants")) : /* @__PURE__ */ new Map();
133
+ this.#state = capabilityAuthority.step({}, capabilityAuthority.init({}), {
134
+ op: parent ? DERIVE : ISSUE,
135
+ name: 0,
136
+ parentLive: bit(parent?.active ?? false),
137
+ Candidate: candidate,
138
+ Parent: parentGrants
139
+ });
211
140
  }
212
141
  static issue(grants) {
213
142
  return new _CapabilityAuthority(grants);
@@ -216,14 +145,22 @@ var CapabilityAuthority = class _CapabilityAuthority {
216
145
  return new _CapabilityAuthority(grants, this);
217
146
  }
218
147
  get active() {
219
- return M(this.#state);
148
+ return this.#state.scalars.live === 1;
220
149
  }
221
150
  release() {
222
- this.#state = O(this.#state);
151
+ this.#state = capabilityAuthority.step({}, this.#state, { op: RELEASE, name: 0, parentLive: 0, Candidate: /* @__PURE__ */ new Map(), Parent: /* @__PURE__ */ new Map() });
223
152
  }
224
153
  resolve(ref) {
225
154
  const grant = this.#grants.get(ref);
226
- return grant && B(this.#state, encodeGrant(grant)) ? { ...grant } : void 0;
155
+ if (!grant) return void 0;
156
+ this.#state = capabilityAuthority.step({}, this.#state, {
157
+ op: USE,
158
+ name: this.#names.id(encodeGrant(grant)),
159
+ parentLive: 0,
160
+ Candidate: /* @__PURE__ */ new Map(),
161
+ Parent: /* @__PURE__ */ new Map()
162
+ });
163
+ return this.#state.scalars.granted === 1 ? { ...grant } : void 0;
227
164
  }
228
165
  bindings() {
229
166
  return this.active ? [...this.#grants.values()].map((grant) => ({ ...grant })) : [];
@@ -233,6 +170,214 @@ var CapabilityAuthority = class _CapabilityAuthority {
233
170
  // src/core/action-registry.ts
234
171
  import { randomUUID as randomUUID2 } from "node:crypto";
235
172
 
173
+ // src/verified/generated/resources.js
174
+ function $n2(v, what) {
175
+ if (typeof v !== "number" || !Number.isSafeInteger(v) || v < 0) throw new RangeError(what + " must be a natural below 2^53, not " + v);
176
+ return v;
177
+ }
178
+ function $m2(v, what) {
179
+ if (!(v instanceof Map)) throw new RangeError(what + " must be a Map of naturals");
180
+ for (const [key, x] of v) {
181
+ $n2(key, "a key of " + what);
182
+ $n2(x, "a cell of " + what);
183
+ }
184
+ return v;
185
+ }
186
+ function $keys2(maps, names) {
187
+ const keys = /* @__PURE__ */ new Set();
188
+ let past = 0;
189
+ for (const c of Object.values(maps)) for (const key of c.keys()) past = Math.max(past, key + 1);
190
+ for (const n of names) for (const key of maps[n].keys()) keys.add(key);
191
+ return [...keys, past];
192
+ }
193
+ function $breaks(maps, reads, cmps) {
194
+ const p = /* @__PURE__ */ new Set([0]);
195
+ for (const [n, d, minus] of reads) {
196
+ for (const s of maps[n].keys()) {
197
+ if (minus) p.add(s + d);
198
+ else if (s >= d) p.add(s - d);
199
+ }
200
+ if (minus) p.add(d);
201
+ }
202
+ for (const [v, d, minus] of cmps) {
203
+ if (minus) {
204
+ p.add(v + d);
205
+ p.add(d);
206
+ } else if (v >= d) p.add(v - d);
207
+ }
208
+ const keys = /* @__PURE__ */ new Set();
209
+ for (const q of p) for (let i = -1; i <= 2; i++) if (q + i >= 0) keys.add(q + i);
210
+ const sorted = [...keys].sort((a, b) => a - b);
211
+ sorted.push(sorted[sorted.length - 1] + 1);
212
+ return sorted;
213
+ }
214
+ function $every2(keys, f) {
215
+ const past = keys[keys.length - 1], d = f(past), cells = /* @__PURE__ */ new Map();
216
+ for (let i = 0; i < keys.length - 1; i++) {
217
+ const v = f(keys[i]);
218
+ if (v !== d) cells.set(keys[i], v);
219
+ }
220
+ return { cells, d };
221
+ }
222
+ function $join(ks, x, y, f) {
223
+ const by = /* @__PURE__ */ new Map();
224
+ for (const k1 of ks) {
225
+ const v = y(k1), l = by.get(v);
226
+ if (l) l.push(k1);
227
+ else by.set(v, [k1]);
228
+ }
229
+ return ks.every((k) => {
230
+ const l = by.get(x(k));
231
+ return l === void 0 || l.every((k1) => f(k, k1));
232
+ });
233
+ }
234
+ function $spread(keys, n) {
235
+ const out = /* @__PURE__ */ new Set();
236
+ for (const k of keys) for (let i = 0; i < n; i++) out.add(k + i);
237
+ return [...out].sort((a, b) => a - b);
238
+ }
239
+ var resourceScope = /* @__PURE__ */ (() => {
240
+ function init(params) {
241
+ const env = {}, s = {};
242
+ return { scalars: { "exact": 0 }, maps: { "Names": /* @__PURE__ */ new Map() } };
243
+ }
244
+ function step2(params, state, input) {
245
+ const env = { "op": $n2(input["op"], "input op"), "first": $n2(input["first"], "input first") }, s = state.scalars, dft = { ...state.defaults }, maps = { ...state.maps, "Given": $m2(input["Given"], "input Given"), "Len": $m2(input["Len"], "input Len") };
246
+ const flag0 = $keys2(maps, ["Given"]).every((k) => (maps["Given"].get(k) ?? 0) <= 1);
247
+ const flag1 = $breaks(maps, [["Given", 0, false]], [[0, 0, false], [1, 0, false]]).every((k) => !(1 <= (maps["Given"].get(k) ?? 0)) || !(k === 0) && !(k === 1));
248
+ const flag2 = $breaks(maps, [["Given", 0, false], ["Names", 0, false], ["Names", 0, false], ["Given", 0, false], ["Given", 0, false], ["Len", 0, false]], [[0, 0, false], [1, 0, false], [66, 0, false]]).every((k) => (!(1 <= (maps["Given"].get(k) ?? 0)) || 1 <= (maps["Names"].get(k) ?? dft["Names"] ?? 0)) && (!(1 <= (maps["Names"].get(k) ?? dft["Names"] ?? 0)) || 1 <= (maps["Given"].get(k) ?? 0)) && (!(1 <= (maps["Given"].get(k) ?? 0)) || !(k === 0) && !(k === 1) && k < 66 && (maps["Len"].get(k) ?? 0) <= 256));
249
+ const flag3 = $keys2(maps, ["Given", "Names"]).every((k) => (maps["Given"].get(k) ?? 0) === (maps["Names"].get(k) ?? dft["Names"] ?? 0));
250
+ const flag4 = $keys2(maps, ["Given", "Len"]).every((k) => !(1 <= (maps["Given"].get(k) ?? 0)) || (maps["Len"].get(k) ?? 0) <= 256);
251
+ const flag5 = 1 <= (maps["Given"].get(env["first"]) ?? 0) && (env["op"] === 0 && flag1 || env["op"] === 1 && (s["exact"] === 1 && flag2));
252
+ if (!(env["op"] < 2 && flag0)) throw new RangeError("resource scope: the request fails the rule's assumption, so no proof covers the step it would take");
253
+ const scalars = { ...s, "exact": flag5 ? 1 : 0 };
254
+ const write0 = $every2($keys2(maps, ["Given"]), (k) => flag5 ? maps["Given"].get(k) ?? 0 : 0);
255
+ state.maps["Names"] = write0.cells;
256
+ dft["Names"] = write0.d;
257
+ return Object.keys(dft).length ? { scalars, maps: state.maps, defaults: dft } : { scalars, maps: state.maps };
258
+ }
259
+ return { init, step: step2 };
260
+ })();
261
+ var resourceGroups = /* @__PURE__ */ (() => {
262
+ function init(params) {
263
+ const env = {}, s = {};
264
+ return { scalars: { "conflict": 0 }, maps: {} };
265
+ }
266
+ function step2(params, state, input) {
267
+ const env = { "L_len": $n2(input["L_len"], "input L_len"), "R_len": $n2(input["R_len"], "input R_len"), "LN_len": $n2(input["LN_len"], "input LN_len"), "RN_len": $n2(input["RN_len"], "input RN_len") }, s = state.scalars, dft = { ...state.defaults }, maps = { ...state.maps, "L.effect": $m2(input["L.effect"], "input L.effect"), "L.ordered": $m2(input["L.ordered"], "input L.ordered"), "L.exact": $m2(input["L.exact"], "input L.exact"), "R.effect": $m2(input["R.effect"], "input R.effect"), "R.ordered": $m2(input["R.ordered"], "input R.ordered"), "R.exact": $m2(input["R.exact"], "input R.exact"), "LN.item": $m2(input["LN.item"], "input LN.item"), "LN.name": $m2(input["LN.name"], "input LN.name"), "RN.item": $m2(input["RN.item"], "input RN.item"), "RN.name": $m2(input["RN.name"], "input RN.name") };
268
+ const flag0 = $breaks(maps, [["LN.item", 0, false]], [[env["LN_len"], 0, false]]).every((k) => !(k < env["LN_len"]) || (maps["LN.item"].get(k) ?? 0) < env["L_len"]);
269
+ const flag1 = $breaks(maps, [["RN.item", 0, false]], [[env["RN_len"], 0, false]]).every((k) => !(k < env["RN_len"]) || (maps["RN.item"].get(k) ?? 0) < env["R_len"]);
270
+ const flag2 = flag0 && flag1;
271
+ const flag3 = ((ks) => ks.every((k) => ks.every((k1) => !(k < env["L_len"] && k1 < env["R_len"] && 0 <= 0) || !((maps["L.effect"].get(k) ?? 0) === 1 && (maps["R.effect"].get(k1) ?? 0) === 1 && ((maps["L.ordered"].get(k) ?? 0) === 1 || (maps["R.ordered"].get(k1) ?? 0) === 1) && !((maps["L.exact"].get(k) ?? 0) === 1 && (maps["R.exact"].get(k1) ?? 0) === 1)))))($spread($breaks(maps, [["L.effect", 0, false], ["L.ordered", 0, false], ["L.exact", 0, false], ["R.effect", 0, false], ["R.ordered", 0, false], ["R.exact", 0, false]], [[env["L_len"], 0, false], [env["R_len"], 0, false]]), 2));
272
+ const flag4 = $join($spread($breaks(maps, [["LN.name", 0, false], ["LN.item", 0, false], ["LN.item", 0, false], ["RN.name", 0, false], ["RN.item", 0, false], ["RN.item", 0, false]], [[env["LN_len"], 0, false], [env["RN_len"], 0, false]]), 2), (k) => maps["LN.name"].get(k) ?? 0, (k1) => maps["RN.name"].get(k1) ?? 0, (k, k1) => !(k < env["LN_len"] && k1 < env["RN_len"] && (maps["LN.name"].get(k) ?? 0) === (maps["RN.name"].get(k1) ?? 0) && 0 <= 0) || !((maps["L.effect"].get(maps["LN.item"].get(k) ?? 0) ?? 0) === 1 && (maps["R.effect"].get(maps["RN.item"].get(k1) ?? 0) ?? 0) === 1 && ((maps["L.ordered"].get(maps["LN.item"].get(k) ?? 0) ?? 0) === 1 || (maps["R.ordered"].get(maps["RN.item"].get(k1) ?? 0) ?? 0) === 1)));
273
+ const flag5 = $breaks(maps, [["L.effect", 0, false], ["L.ordered", 0, false], ["L.exact", 0, false]], [[env["L_len"], 0, false]]).every((k) => !(k < env["L_len"]) || (maps["L.effect"].get(k) ?? 0) <= 1 && (maps["L.ordered"].get(k) ?? 0) <= 1 && (maps["L.exact"].get(k) ?? 0) <= 1);
274
+ const flag6 = $breaks(maps, [["R.effect", 0, false], ["R.ordered", 0, false], ["R.exact", 0, false]], [[env["R_len"], 0, false]]).every((k) => !(k < env["R_len"]) || (maps["R.effect"].get(k) ?? 0) <= 1 && (maps["R.ordered"].get(k) ?? 0) <= 1 && (maps["R.exact"].get(k) ?? 0) <= 1);
275
+ if (!(flag5 && flag6 && flag2)) throw new RangeError("resource groups: the request fails the rule's assumption, so no proof covers the step it would take");
276
+ const scalars = { ...s, "conflict": flag3 && flag4 ? 0 : 1 };
277
+ return Object.keys(dft).length ? { scalars, maps: state.maps, defaults: dft } : { scalars, maps: state.maps };
278
+ }
279
+ return { init, step: step2 };
280
+ })();
281
+
282
+ // src/verified/resources.ts
283
+ var EMPTY = 0;
284
+ var WILDCARD = 1;
285
+ var FIRST = 2;
286
+ var UNKNOWN = Object.freeze({ exact: false, names: Object.freeze([]) });
287
+ var ResourceNames = class {
288
+ #ids = /* @__PURE__ */ new Map();
289
+ #names = [];
290
+ id(value) {
291
+ if (typeof value !== "string" || value === "") return EMPTY;
292
+ if (value === "*") return WILDCARD;
293
+ let id = this.#ids.get(value);
294
+ if (id === void 0) {
295
+ id = FIRST + this.#names.length;
296
+ this.#ids.set(value, id);
297
+ this.#names.push(value);
298
+ }
299
+ return id;
300
+ }
301
+ name(id) {
302
+ const name = this.#names[id - FIRST];
303
+ if (name === void 0) throw new Error(`Invalid verified resource id ${id}`);
304
+ return name;
305
+ }
306
+ /** Each id's complete UTF-16 length, for the kernel's 256-unit bound. */
307
+ lengths(ids) {
308
+ const cells = /* @__PURE__ */ new Map();
309
+ for (const id of ids) if (id >= FIRST) cells.set(id, this.name(id).length);
310
+ return cells;
311
+ }
312
+ };
313
+ var SOURCE = 0;
314
+ var NORMALIZE = 1;
315
+ var step = (names, state, op, values) => {
316
+ const ids = values.map((value) => names.id(value));
317
+ return resourceScope.step({}, state, { op, first: ids[0] ?? EMPTY, Given: idSet(ids), Len: names.lengths(ids) });
318
+ };
319
+ var decode = (names, state, order) => {
320
+ if (state.scalars.exact !== 1) return UNKNOWN;
321
+ const held = new Set(members(state, "Names"));
322
+ const listed = [...new Set(order.map((value) => names.id(value)))].filter((id) => held.delete(id));
323
+ if (held.size > 0) throw new Error("Verified resource scope names an undeclared resource");
324
+ return { exact: true, names: listed.map((id) => names.name(id)) };
325
+ };
326
+ var resourceSource = (values) => {
327
+ const declared = Array.isArray(values) ? Array.from(values) : [];
328
+ const names = new ResourceNames();
329
+ return decode(names, step(names, resourceScope.init({}), SOURCE, declared), declared);
330
+ };
331
+ var decodeResourceScope = (scope) => scope.exact ? [...scope.names] : ["*"];
332
+ var resourceNormalize = (values, proposal) => {
333
+ const declared = Array.isArray(values) ? Array.from(values) : [];
334
+ const candidate = Array.from(proposal);
335
+ const names = new ResourceNames();
336
+ for (const value of candidate) names.id(value);
337
+ const source = step(names, resourceScope.init({}), SOURCE, declared);
338
+ return decode(names, step(names, source, NORMALIZE, candidate), candidate);
339
+ };
340
+ var boundedEffectResources = (resources) => {
341
+ const declared = Array.isArray(resources) ? Array.from(resources) : [];
342
+ const proposal = /* @__PURE__ */ new Set();
343
+ for (const resource of declared) {
344
+ proposal.add(resource);
345
+ if (proposal.size > 64) break;
346
+ }
347
+ return decodeResourceScope(resourceNormalize(declared, [...proposal]));
348
+ };
349
+ var encodeResourceEffects = (effects) => effects.map((effect) => effect.kind === "none" ? { effect: false, ordered: false, scope: UNKNOWN } : { effect: true, ordered: effect.ordering !== "commutative", scope: resourceSource(effect.resources) });
350
+ var effectCells = (side) => ({
351
+ effect: new Map(side.map((e, i) => [i, bit(e.effect)])),
352
+ ordered: new Map(side.map((e, i) => [i, bit(e.ordered)])),
353
+ exact: new Map(side.map((e, i) => [i, bit(e.scope.exact)]))
354
+ });
355
+ var rowCells = (names, side) => {
356
+ const rows = side.flatMap((e, item) => (e.scope.exact ? e.scope.names : []).map((name) => [item, names.id(name)]));
357
+ return { len: rows.length, item: new Map(rows.map(([item], p) => [p, item])), name: new Map(rows.map(([, name], p) => [p, name])) };
358
+ };
359
+ var resourceGroups2 = (left, right) => {
360
+ const names = new ResourceNames();
361
+ const L = effectCells(left), R = effectCells(right), LN = rowCells(names, left), RN = rowCells(names, right);
362
+ const state = resourceGroups.step({}, resourceGroups.init({}), {
363
+ L_len: left.length,
364
+ R_len: right.length,
365
+ LN_len: LN.len,
366
+ RN_len: RN.len,
367
+ "L.effect": L.effect,
368
+ "L.ordered": L.ordered,
369
+ "L.exact": L.exact,
370
+ "R.effect": R.effect,
371
+ "R.ordered": R.ordered,
372
+ "R.exact": R.exact,
373
+ "LN.item": LN.item,
374
+ "LN.name": LN.name,
375
+ "RN.item": RN.item,
376
+ "RN.name": RN.name
377
+ });
378
+ return state.scalars.conflict === 1;
379
+ };
380
+
236
381
  // src/components/effect-policy.ts
237
382
  var FabricComponentIndependenceError = class extends Error {
238
383
  constructor(message) {
@@ -293,9 +438,9 @@ var summarizeEffects = (effects) => {
293
438
  };
294
439
  };
295
440
  var effectConflictsBetween = (left, right) => {
296
- if (!_n(left.declarations, right.declarations)) return [];
441
+ if (!resourceGroups2(left.declarations, right.declarations)) return [];
297
442
  const conflicts = [];
298
- if (Ae(
443
+ if (unknownConflict(
299
444
  left.hasUnknown,
300
445
  left.hasUnknownNoncommutative,
301
446
  left.hasNoncommutative,
@@ -306,7 +451,7 @@ var effectConflictsBetween = (left, right) => {
306
451
  conflicts.push({ resources: ["*"], reason: "unknown_resource" });
307
452
  }
308
453
  const overlap = [...left.resourceNoncommutative.keys()].filter(
309
- (resource) => nn(
454
+ (resource) => knownConflict(
310
455
  right.resourceNoncommutative.has(resource),
311
456
  left.resourceNoncommutative.get(resource) ?? false,
312
457
  right.resourceNoncommutative.get(resource) ?? false
@@ -371,14 +516,14 @@ var levenshtein = (left, right) => {
371
516
  if (right.length === 0) return left.length;
372
517
  let previous = new Array(right.length + 1);
373
518
  let current = new Array(right.length + 1);
374
- for (let j2 = 0; j2 <= right.length; j2++) previous[j2] = j2;
375
- for (let i3 = 1; i3 <= left.length; i3++) {
376
- current[0] = i3;
377
- for (let j2 = 1; j2 <= right.length; j2++) {
378
- current[j2] = Math.min(
379
- previous[j2] + 1,
380
- current[j2 - 1] + 1,
381
- previous[j2 - 1] + (left[i3 - 1] === right[j2 - 1] ? 0 : 1)
519
+ for (let j = 0; j <= right.length; j++) previous[j] = j;
520
+ for (let i = 1; i <= left.length; i++) {
521
+ current[0] = i;
522
+ for (let j = 1; j <= right.length; j++) {
523
+ current[j] = Math.min(
524
+ previous[j] + 1,
525
+ current[j - 1] + 1,
526
+ previous[j - 1] + (left[i - 1] === right[j - 1] ? 0 : 1)
382
527
  );
383
528
  }
384
529
  const swap = previous;
@@ -390,8 +535,8 @@ var levenshtein = (left, right) => {
390
535
  var editThreshold = (form) => form.length <= 4 ? 1 : Math.max(2, Math.floor(form.length / 4));
391
536
  var tokenAligned = (spilled, declared) => {
392
537
  if (spilled.length === 0 || spilled.length !== declared.length) return false;
393
- return spilled.every((token, index) => {
394
- const other = declared[index];
538
+ return spilled.every((token, index2) => {
539
+ const other = declared[index2];
395
540
  if (token === other) return true;
396
541
  return token.length >= 3 && other.length >= 3 && (token.startsWith(other) || other.startsWith(token));
397
542
  });
@@ -400,7 +545,7 @@ var sortNames = (names) => [...new Set(names)].sort((left, right) => left.locale
400
545
  var catalogCache = /* @__PURE__ */ new WeakMap();
401
546
  var catalogSnapshot = (declared) => {
402
547
  const cached = catalogCache.get(declared);
403
- if (cached?.forms.length === declared.length && cached.forms.every((entry, index) => entry.name === declared[index])) {
548
+ if (cached?.forms.length === declared.length && cached.forms.every((entry, index2) => entry.name === declared[index2])) {
404
549
  return cached;
405
550
  }
406
551
  const forms = declared.map((name) => {
@@ -472,167 +617,108 @@ var formatUnknownActionMessage = (ref, suggestions) => suggestions.length > 0 ?
472
617
  // src/core/provider-bindings.ts
473
618
  import { randomUUID } from "node:crypto";
474
619
 
475
- // src/verified/generated/lifecycle-kernel.js
476
- function a(l2) {
477
- if (l2 > 281474976710655)
478
- throw "bend: a Nat past the largest immediate 2^48-1";
479
- return l2;
480
- }
481
- function u(l2) {
482
- for (; l2 !== null && typeof l2 == "object" && l2.$ === "$JMP"; )
483
- l2 = l2.f(l2.x);
484
- return l2;
485
- }
486
- function y2(l2, e) {
487
- return (...o) => o.length < e ? y2((...c) => l2(...o, ...c), e - o.length) : u(l2(...o));
488
- }
489
- function i2(l2, e, o) {
490
- if (l2.$ === "lifecycle.Closing" || l2.$ === "lifecycle.Closed")
491
- return false;
492
- if (l2.$ === "lifecycle.Failed")
493
- return o;
494
- {
495
- let c = O2(e);
496
- return o || c;
497
- }
498
- }
499
- function $2(l2) {
500
- return l2.$ === "lifecycle.Staged" ? { $: "lifecycle.Retiring" } : l2.$ === "lifecycle.Active" ? { $: "lifecycle.Retiring" } : l2;
501
- }
502
- function m2(l2, e) {
503
- if (l2) {
504
- let o = e.phase, c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
505
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: a(t + 1), revoked: n }, command: { $: "lifecycle.Granted" } };
506
- } else
507
- return { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Denied" } };
508
- }
509
- function p2(l2, e) {
510
- if (l2) {
511
- let o = e.phase, c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
512
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: a(r + 1), calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
513
- } else
514
- return { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Denied" } };
515
- }
516
- function k2(l2, e) {
517
- return l2 ? { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Granted" } } : { $: "lifecycle.Outcome", next: e, command: { $: "lifecycle.Denied" } };
518
- }
519
- function v2(l2, e) {
520
- if (l2.$ === "lifecycle.Inspect") {
521
- let o = e.phase, c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
522
- return k2(i2(o, n, false), { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: t, revoked: n });
523
- } else if (l2.$ === "lifecycle.Activate") {
524
- let o = e.phase;
525
- if (o.$ === "lifecycle.Staged") {
526
- let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
527
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Active" }, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
528
- } else if (o.$ === "lifecycle.Active") {
529
- let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
530
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Active" }, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
531
- } else {
532
- let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
533
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
534
- }
535
- } else if (l2.$ === "lifecycle.Retire") {
536
- let o = e.phase, c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
537
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: $2(o), owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
538
- } else if (l2.$ === "lifecycle.DropOwner") {
539
- let o = e.phase, c = e.holds, r = e.calls, t = e.revoked;
540
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: false, holds: c, calls: r, revoked: t }, command: { $: "lifecycle.Granted" } };
541
- } else if (l2.$ === "lifecycle.Revoke") {
542
- let o = e.phase, c = e.holds, r = e.calls;
543
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: $2(o), owner: false, holds: c, calls: r, revoked: true }, command: { $: "lifecycle.Granted" } };
544
- } else if (l2.$ === "lifecycle.Retain") {
545
- let o = l2.cleanup, c = e.phase, r = e.owner, t = e.holds, n = e.calls, s = e.revoked;
546
- return p2(i2(c, s, o), { $: "lifecycle.Life", phase: c, owner: r, holds: t, calls: n, revoked: s });
547
- } else if (l2.$ === "lifecycle.Release") {
548
- let o = e.phase, c = e.owner, r = e.holds;
549
- if (r === 0) {
550
- let t = e.calls, n = e.revoked;
551
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: 0, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
552
- } else {
553
- let t = r - 1, n = e.calls, s = e.revoked;
554
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: t, calls: n, revoked: s }, command: { $: "lifecycle.Granted" } };
555
- }
556
- } else if (l2.$ === "lifecycle.Begin") {
557
- let o = l2.cleanup, c = e.phase, r = e.owner, t = e.holds, n = e.calls, s = e.revoked;
558
- return m2(i2(c, s, o), { $: "lifecycle.Life", phase: c, owner: r, holds: t, calls: n, revoked: s });
559
- } else if (l2.$ === "lifecycle.End") {
560
- let o = e.phase, c = e.owner, r = e.holds, t = e.calls;
561
- if (t === 0) {
562
- let n = e.revoked;
563
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: 0, revoked: n }, command: { $: "lifecycle.Denied" } };
564
- } else {
565
- let n = t - 1, s = e.revoked;
566
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: n, revoked: s }, command: { $: "lifecycle.Granted" } };
567
- }
568
- } else if (l2.$ === "lifecycle.Shut") {
569
- let o = e.phase;
570
- if (o.$ === "lifecycle.Retiring") {
571
- let c = e.owner;
572
- if (c) {
573
- let r = e.holds, t = e.calls, n = e.revoked;
574
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
575
- } else {
576
- let r = e.holds;
577
- if (r === 0) {
578
- let t = e.calls;
579
- if (t === 0) {
580
- let n = e.revoked;
581
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closing" }, owner: false, holds: 0, calls: 0, revoked: n }, command: { $: "lifecycle.StartClose" } };
582
- } else {
583
- let n = t - 0, s = e.revoked;
584
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: false, holds: 0, calls: n, revoked: s }, command: { $: "lifecycle.Denied" } };
585
- }
586
- } else {
587
- let t = r - 0, n = e.calls, s = e.revoked;
588
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Retiring" }, owner: false, holds: t, calls: n, revoked: s }, command: { $: "lifecycle.Denied" } };
589
- }
590
- }
591
- } else {
592
- let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
593
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
594
- }
595
- } else if (l2.$ === "lifecycle.Complete") {
596
- let o = e.phase;
597
- if (o.$ === "lifecycle.Closing") {
598
- let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
599
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closed" }, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Granted" } };
600
- } else {
601
- let c = e.owner, r = e.holds, t = e.calls, n = e.revoked;
602
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: o, owner: c, holds: r, calls: t, revoked: n }, command: { $: "lifecycle.Denied" } };
603
- }
604
- } else if (e.phase.$ === "lifecycle.Closed") {
605
- let o = e.owner, c = e.holds, r = e.calls, t = e.revoked;
606
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Closed" }, owner: o, holds: c, calls: r, revoked: t }, command: { $: "lifecycle.Denied" } };
607
- } else {
608
- let o = e.holds, c = e.calls;
609
- return { $: "lifecycle.Outcome", next: { $: "lifecycle.Life", phase: { $: "lifecycle.Failed" }, owner: false, holds: o, calls: c, revoked: true }, command: { $: "lifecycle.Granted" } };
610
- }
611
- }
612
- function w2(l2, e) {
613
- return v2(e, l2);
620
+ // src/verified/generated/lifecycle.js
621
+ function $n3(v, what) {
622
+ if (typeof v !== "number" || !Number.isSafeInteger(v) || v < 0) throw new RangeError(what + " must be a natural below 2^53, not " + v);
623
+ return v;
614
624
  }
615
- function g2(l2, e) {
616
- return w2(l2, e);
625
+ function $x(v) {
626
+ if (v > 9007199254740991) throw new RangeError("a value passed 2^53 - 1, past which the proofs over the naturals no longer describe the run");
627
+ return v;
617
628
  }
618
- function O2(l2) {
619
- return !l2;
620
- }
621
- var f2 = /* @__PURE__ */ new Map([["Closing", "lifecycle.Closing"], ["Closed", "lifecycle.Closed"], ["Failed", "lifecycle.Failed"], ["Staged", "lifecycle.Staged"], ["Retiring", "lifecycle.Retiring"], ["Active", "lifecycle.Active"], ["Outcome", "lifecycle.Outcome"], ["Denied", "lifecycle.Denied"], ["Life", "lifecycle.Life"], ["Granted", "lifecycle.Granted"], ["Inspect", "lifecycle.Inspect"], ["Activate", "lifecycle.Activate"], ["Retire", "lifecycle.Retire"], ["DropOwner", "lifecycle.DropOwner"], ["Revoke", "lifecycle.Revoke"], ["Retain", "lifecycle.Retain"], ["Release", "lifecycle.Release"], ["Begin", "lifecycle.Begin"], ["End", "lifecycle.End"], ["Shut", "lifecycle.Shut"], ["StartClose", "lifecycle.StartClose"], ["Complete", "lifecycle.Complete"]]);
622
- var R2 = /* @__PURE__ */ new Map([["lifecycle.Closing", "Closing"], ["lifecycle.Closed", "Closed"], ["lifecycle.Failed", "Failed"], ["lifecycle.Staged", "Staged"], ["lifecycle.Retiring", "Retiring"], ["lifecycle.Active", "Active"], ["lifecycle.Outcome", "Outcome"], ["lifecycle.Denied", "Denied"], ["lifecycle.Life", "Life"], ["lifecycle.Granted", "Granted"], ["lifecycle.Inspect", "Inspect"], ["lifecycle.Activate", "Activate"], ["lifecycle.Retire", "Retire"], ["lifecycle.DropOwner", "DropOwner"], ["lifecycle.Revoke", "Revoke"], ["lifecycle.Retain", "Retain"], ["lifecycle.Release", "Release"], ["lifecycle.Begin", "Begin"], ["lifecycle.End", "End"], ["lifecycle.Shut", "Shut"], ["lifecycle.StartClose", "StartClose"], ["lifecycle.Complete", "Complete"]]);
623
- function d2(l2, e) {
624
- let o = [l2];
625
- for (let c = [[o, 0]]; c.length > 0; ) {
626
- let [r, t] = c.pop(), n = r[t];
627
- if (n === null || typeof n != "object") continue;
628
- let s = Array.isArray(n) ? [...n] : { ...n };
629
- typeof s.$ == "string" && (s.$ = e.get(s.$) ?? s.$), r[t] = s;
630
- for (let h2 of Object.keys(s)) c.push([s, h2]);
631
- }
632
- return o[0];
633
- }
634
- var x2 = /* @__PURE__ */ y2((l2, e) => g2(l2, e), 2);
635
- var L2 = (l2, e) => d2(x2(d2(l2, f2), d2(e, f2)), R2);
629
+ var bindingStep = /* @__PURE__ */ (() => {
630
+ function init(params) {
631
+ const env = {}, s = {};
632
+ return { scalars: { "phase": 0, "owner": 1, "holds": 0, "calls": 0, "revoked": 0, "command": 0 }, maps: {} };
633
+ }
634
+ function step2(params, state, input) {
635
+ const env = { "event": $n3(input["event"], "input event"), "cleanup": $n3(input["cleanup"], "input cleanup") }, s = state.scalars, dft = { ...state.defaults }, maps = state.maps;
636
+ const flag0 = env["event"] === 0 && s["phase"] <= 2 && s["revoked"] === 0;
637
+ const flag1 = env["event"] === 1 && s["phase"] <= 1;
638
+ const flag2 = env["event"] === 2 && s["phase"] <= 1;
639
+ const flag3 = env["event"] === 2 && 2 <= s["phase"];
640
+ const flag4 = env["event"] === 3 && 0 <= 0;
641
+ const flag5 = env["event"] === 4 && s["phase"] <= 1;
642
+ const flag6 = env["event"] === 4 && 2 <= s["phase"];
643
+ const flag7 = env["event"] === 5 && s["phase"] <= 2 && (env["cleanup"] === 1 || s["revoked"] === 0);
644
+ const flag8 = env["event"] === 5 && s["phase"] === 5 && env["cleanup"] === 1;
645
+ const flag9 = env["event"] === 7 && s["phase"] <= 2 && (env["cleanup"] === 1 || s["revoked"] === 0);
646
+ const flag10 = env["event"] === 7 && s["phase"] === 5 && env["cleanup"] === 1;
647
+ const flag11 = env["event"] === 6 && 0 <= 0 && 1 <= s["holds"];
648
+ const flag12 = env["event"] === 8 && 0 <= 0 && 1 <= s["calls"];
649
+ const flag13 = env["event"] === 9 && s["phase"] === 2 && (s["owner"] === 0 && s["holds"] === 0 && s["calls"] === 0);
650
+ const flag14 = env["event"] === 10 && s["phase"] === 3;
651
+ const flag15 = env["event"] === 11 && (s["phase"] <= 3 || s["phase"] === 5);
652
+ const flag16 = flag0;
653
+ const flag17 = flag1;
654
+ const flag18 = flag2;
655
+ const flag19 = flag3;
656
+ const flag20 = flag4;
657
+ const flag21 = flag5;
658
+ const flag22 = flag6;
659
+ const flag23 = flag7;
660
+ const flag24 = flag8;
661
+ const flag25 = flag9;
662
+ const flag26 = flag10;
663
+ const flag27 = flag11;
664
+ const flag28 = flag12;
665
+ const flag29 = flag13;
666
+ const flag30 = flag14;
667
+ const flag31 = flag15;
668
+ if (!(env["event"] < 12 && env["cleanup"] <= 1)) throw new RangeError("binding lifecycle: the request fails the rule's assumption, so no proof covers the step it would take");
669
+ const scalars = { ...s, "owner": flag20 || flag21 || flag22 || flag31 ? 0 : s["owner"], "holds": flag23 || flag24 ? $x(s["holds"] + 1) : flag27 ? Math.max(0, s["holds"] - 1) : s["holds"], "calls": flag25 || flag26 ? $x(s["calls"] + 1) : flag28 ? Math.max(0, s["calls"] - 1) : s["calls"], "revoked": flag21 || flag22 || flag31 ? 1 : s["revoked"], "phase": flag17 ? 1 : flag18 || flag21 ? 2 : flag29 ? 3 : flag30 ? 4 : flag31 ? 5 : s["phase"], "command": flag16 || flag17 || flag18 || flag19 || flag20 || flag21 || flag22 || flag23 || flag24 || flag25 || flag26 || flag27 || flag28 || flag30 || flag31 ? 1 : flag29 ? 2 : 0 };
670
+ return Object.keys(dft).length ? { scalars, maps: state.maps, defaults: dft } : { scalars, maps: state.maps };
671
+ }
672
+ return { init, step: step2 };
673
+ })();
674
+
675
+ // src/verified/lifecycle.ts
676
+ var PHASES = ["Staged", "Active", "Retiring", "Closing", "Closed", "Failed"];
677
+ var EVENTS = ["Inspect", "Activate", "Retire", "DropOwner", "Revoke", "Retain", "Release", "Begin", "End", "Shut", "Complete", "Abort"];
678
+ var COMMANDS = ["Denied", "Granted", "StartClose"];
679
+ var index = (values, value, what) => {
680
+ const i = values.indexOf(value);
681
+ if (i < 0) throw new Error(`Invalid verified ${what}: ${value}`);
682
+ return i;
683
+ };
684
+ var named = (values, i, what) => {
685
+ const value = i === void 0 ? void 0 : values[i];
686
+ if (value === void 0) throw new Error(`Invalid verified ${what} index ${i}`);
687
+ return value;
688
+ };
689
+ var flag = (value) => {
690
+ if (value !== 0 && value !== 1) throw new Error("Invalid verified lifecycle flag");
691
+ return value === 1;
692
+ };
693
+ var bindingStep2 = (life, event) => {
694
+ const state = {
695
+ scalars: {
696
+ phase: index(PHASES, life.phase.$, "phase"),
697
+ owner: bit(life.owner),
698
+ holds: life.holds,
699
+ calls: life.calls,
700
+ revoked: bit(life.revoked),
701
+ command: 0
702
+ },
703
+ maps: {}
704
+ };
705
+ const next = bindingStep.step({}, state, {
706
+ event: index(EVENTS, event.$, "event"),
707
+ cleanup: bit("cleanup" in event && event.cleanup)
708
+ }).scalars;
709
+ return {
710
+ $: "Outcome",
711
+ next: {
712
+ $: "Life",
713
+ phase: { $: named(PHASES, next.phase, "phase") },
714
+ owner: flag(next.owner),
715
+ holds: next.holds,
716
+ calls: next.calls,
717
+ revoked: flag(next.revoked)
718
+ },
719
+ command: { $: named(COMMANDS, next.command, "command") }
720
+ };
721
+ };
636
722
 
637
723
  // src/core/provider-bindings.ts
638
724
  var snapshot = (binding) => ({
@@ -642,9 +728,9 @@ var snapshot = (binding) => ({
642
728
  var useOnce = () => {
643
729
  let active = true;
644
730
  return () => {
645
- const next = Xe(active);
646
- active = next.snd;
647
- return next.fst;
731
+ const next = consume(active);
732
+ active = next.active;
733
+ return next.released;
648
734
  };
649
735
  };
650
736
  var FabricProviderBindings = class {
@@ -667,7 +753,7 @@ var FabricProviderBindings = class {
667
753
  binding(id) {
668
754
  const binding = this.#all.get(id);
669
755
  const life = this.#lifecycles.get(id);
670
- return binding && life && L2(life, { $: "Inspect" }).command.$ === "Granted" ? binding : void 0;
756
+ return binding && life && bindingStep2(life, { $: "Inspect" }).command.$ === "Granted" ? binding : void 0;
671
757
  }
672
758
  has(name) {
673
759
  return this.#current.has(name);
@@ -935,16 +1021,16 @@ var FabricProviderBindings = class {
935
1021
  }
936
1022
  #canBegin(id, cleanup) {
937
1023
  const life = this.#lifecycles.get(id);
938
- return !!life && life.calls < BEND_NAT_MAX && L2(life, { $: "Begin", cleanup }).command.$ === "Granted";
1024
+ return !!life && life.calls < VERIFIED_NAT_MAX && bindingStep2(life, { $: "Begin", cleanup }).command.$ === "Granted";
939
1025
  }
940
1026
  #step(binding, event) {
941
1027
  const life = this.#lifecycles.get(binding.id);
942
1028
  if (!life) return "Denied";
943
- if (event.$ === "Begin" && life.calls >= BEND_NAT_MAX || event.$ === "Retain" && life.holds >= BEND_NAT_MAX) {
1029
+ if (event.$ === "Begin" && life.calls >= VERIFIED_NAT_MAX || event.$ === "Retain" && life.holds >= VERIFIED_NAT_MAX) {
944
1030
  throw new Error("Provider lifecycle accounting overflow");
945
1031
  }
946
- const outcome = L2(life, event);
947
- if (outcome.next.holds > BEND_NAT_MAX || outcome.next.calls > BEND_NAT_MAX) {
1032
+ const outcome = bindingStep2(life, event);
1033
+ if (outcome.next.holds > VERIFIED_NAT_MAX || outcome.next.calls > VERIFIED_NAT_MAX) {
948
1034
  throw new Error("Provider lifecycle accounting overflow");
949
1035
  }
950
1036
  this.#lifecycles.set(binding.id, outcome.next);
@@ -968,6 +1054,10 @@ var FabricProviderBindings = class {
968
1054
  var fabricActionListLimit = (limit) => Math.max(1, Math.min(limit ?? 100, 1e3));
969
1055
  var NESTED_TOOL_CALL_ID_PREFIX = FABRIC_NESTED_TOOL_CALL_ID_PREFIX;
970
1056
  var providerNamePattern = /^[a-z][a-z0-9_-]*$/;
1057
+ var PROVIDER_TYPE_SOURCE_TIMEOUT_MS = 500;
1058
+ var isPlainRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1059
+ var usesProviderGlobal = (code, name) => new RegExp(`(?<![\\w$.])${name}\\s*(?:\\?\\.|\\.|\\[)`).test(code);
1060
+ var actionTypeSource = (name, inputSchema) => typeof name === "string" && name.length > 0 && name.length <= 256 ? { name, inputSchema: isPlainRecord(inputSchema) ? inputSchema : {} } : void 0;
971
1061
  var SCOPE_HOLDER = Symbol.for("pi-fabric:scope:v1");
972
1062
  var snapshotArguments = (args) => {
973
1063
  const snapshot2 = structuredClone(args);
@@ -1076,6 +1166,7 @@ var ActionRegistry = class {
1076
1166
  #activeEffects = /* @__PURE__ */ new Map();
1077
1167
  #unavailable = /* @__PURE__ */ new Map();
1078
1168
  #unavailableResolver;
1169
+ #hostPolicy;
1079
1170
  #speculation;
1080
1171
  #speculationEligibility;
1081
1172
  /**
@@ -1119,6 +1210,44 @@ var ActionRegistry = class {
1119
1210
  setUnavailableResolver(resolve) {
1120
1211
  this.#unavailableResolver = resolve;
1121
1212
  }
1213
+ /** Host restrictions checked before any provider prepares or runs an action. */
1214
+ setHostPolicy(policy) {
1215
+ this.#hostPolicy = policy;
1216
+ }
1217
+ get hostPolicy() {
1218
+ return this.#hostPolicy;
1219
+ }
1220
+ #policyProviders(providers) {
1221
+ return providers.filter((provider) => !this.#hostPolicy?.previewProviderHidden(provider.name));
1222
+ }
1223
+ #listProvider(provider, request, context) {
1224
+ return runAbortable(context.signal, () => {
1225
+ if (this.#hostPolicy?.providerHidden(provider.name)) return [];
1226
+ return this.#providerBindings.trackProvider(provider, () => provider.list(request, context));
1227
+ });
1228
+ }
1229
+ #policyRefs(refs) {
1230
+ const policy = this.#hostPolicy;
1231
+ if (!policy?.active) return refs;
1232
+ return refs.filter((ref) => {
1233
+ const separator = ref.indexOf(".");
1234
+ return !policy.refDenial(ref.slice(0, separator), ref.slice(separator + 1));
1235
+ });
1236
+ }
1237
+ #policyActions(actions) {
1238
+ const policy = this.#hostPolicy;
1239
+ return policy?.active ? actions.filter((action) => !policy.refDenial(action.provider, action.name)) : actions;
1240
+ }
1241
+ /**
1242
+ * Decide again on the action that resolution produced. Name repair can turn
1243
+ * a ref the policy allowed as written (pi.Write, pi.save) into a denied
1244
+ * canonical action, so every caller checks the resolved name before it
1245
+ * prepares arguments or runs the provider.
1246
+ */
1247
+ #assertResolvedAllowed(action) {
1248
+ const denial = this.#hostPolicy?.refDenial(action.provider, action.name);
1249
+ if (denial) throw new FabricResolutionError(denial);
1250
+ }
1122
1251
  markUnavailable(name, reason) {
1123
1252
  if (!providerNamePattern.test(name)) {
1124
1253
  throw new Error(`Invalid Fabric provider name: ${name}`);
@@ -1134,10 +1263,12 @@ var ActionRegistry = class {
1134
1263
  unregister(name, options) {
1135
1264
  return this.#providerBindings.unregister(name, options);
1136
1265
  }
1137
- providers(context) {
1266
+ #visibleProviders(context) {
1138
1267
  if (context) this.#scopeContext(context);
1139
- const visible = context?.capabilityView ? [...new Set(this.#viewAuthority(context.capabilityView).bindings().map((value) => this.#providerBindings.binding(value.providerBindingId)?.provider).filter((provider) => Boolean(provider)))] : this.#providerBindings.providers();
1140
- return visible.map((provider) => ({ name: provider.name, description: provider.description })).sort((left, right) => left.name.localeCompare(right.name));
1268
+ return context?.capabilityView ? [...new Set(this.#viewAuthority(context.capabilityView).bindings().map((value) => this.#providerBindings.binding(value.providerBindingId)?.provider).filter((provider) => Boolean(provider)))] : this.#policyProviders(this.#providerBindings.providers());
1269
+ }
1270
+ providers(context) {
1271
+ return this.#visibleProviders(context).map((provider) => ({ name: provider.name, description: provider.description })).sort((left, right) => left.name.localeCompare(right.name));
1141
1272
  }
1142
1273
  async inspectCapabilities(requirements, context) {
1143
1274
  return this.#resolveCapabilities(requirements, context, false);
@@ -1146,19 +1277,39 @@ var ActionRegistry = class {
1146
1277
  return this.#resolveCapabilities(requirements, context, true);
1147
1278
  }
1148
1279
  /**
1149
- * Snapshot the tool schemas backing the dynamic guest surfaces (mcp and
1150
- * extensions) so the type gate can reject argument-shape mistakes before
1151
- * the sandbox runs. Side-effect-free by construction: MCP data comes from
1152
- * the provider's cache-warm descriptor slice (listing would schedule
1153
- * background revalidation), extension data from the captured-tool catalog.
1154
- * Providers that cannot supply data yet simply contribute no section and
1155
- * the loose declarations stand for that execution.
1280
+ * Names of the visible providers that get a program global (see
1281
+ * src/provider-globals.ts): sorted, capped, and never a Fabric global, a
1282
+ * built-in provider, or a language keyword or builtin. A committed view
1283
+ * limits the names to the providers it binds.
1284
+ */
1285
+ providerGlobals(context) {
1286
+ return providerGlobalNames(this.#visibleProviders(context).map((provider) => provider.name));
1287
+ }
1288
+ /**
1289
+ * Snapshot the tool schemas backing the dynamic guest surfaces (mcp,
1290
+ * extensions and provider globals) so the type gate can reject
1291
+ * argument-shape mistakes before the sandbox runs. Side-effect-free by
1292
+ * construction: MCP data comes from the provider's cache-warm descriptor
1293
+ * slice (listing would schedule background revalidation), extension data
1294
+ * from the captured-tool catalog, provider-global data from each provider's
1295
+ * own list(). Providers that cannot supply data yet simply contribute no
1296
+ * section, or a loose global, and the loose declarations stand for that
1297
+ * execution. With `code`, a provider's list() runs only when the program
1298
+ * uses its global (`name.` or `name[`); other provider globals stay loose,
1299
+ * so a program never waits on, or triggers, a catalog it does not use.
1156
1300
  */
1157
- async guestTypeSources(context) {
1301
+ async guestTypeSources(context, options = {}) {
1158
1302
  context = this.#scopeContext(context);
1159
1303
  const sources = {};
1304
+ const globals = this.providerGlobals(context);
1160
1305
  if (context.capabilityView) {
1161
1306
  const actions = await this.list({ limit: 1e3 }, context);
1307
+ if (globals.length > 0) {
1308
+ sources.providers = globals.map((provider) => ({
1309
+ provider,
1310
+ actions: actions.filter((action) => action.provider === provider).flatMap((action) => actionTypeSource(action.name, action.inputSchema) ?? [])
1311
+ }));
1312
+ }
1162
1313
  const byServer = /* @__PURE__ */ new Map();
1163
1314
  for (const action of actions.filter((candidate) => candidate.provider === "mcp")) {
1164
1315
  const server = action.namespace;
@@ -1180,7 +1331,7 @@ var ActionRegistry = class {
1180
1331
  return sources;
1181
1332
  }
1182
1333
  const mcp = this.#providerBindings.current("mcp")?.provider;
1183
- const mcpDescriptors = mcp?.sliceDescriptors?.();
1334
+ const mcpDescriptors = this.#hostPolicy?.active ? mcp?.sliceDescriptors?.().filter((descriptor) => !this.#hostPolicy.previewDenial("mcp", descriptor.name)) : mcp?.sliceDescriptors?.();
1184
1335
  if (mcpDescriptors && mcpDescriptors.length > 0) {
1185
1336
  const byServer = /* @__PURE__ */ new Map();
1186
1337
  for (const descriptor of mcpDescriptors) {
@@ -1211,7 +1362,7 @@ var ActionRegistry = class {
1211
1362
  const extensions = this.#providerBindings.current("extensions")?.provider;
1212
1363
  if (extensions) {
1213
1364
  try {
1214
- const descriptors = await extensions.list({}, context);
1365
+ const descriptors = this.#policyActions((await this.#listProvider(extensions, {}, context)).map((descriptor) => ({ ...descriptor, provider: "extensions" })));
1215
1366
  if (descriptors.length > 0) {
1216
1367
  sources.extensionTools = descriptors.map((descriptor) => ({
1217
1368
  name: descriptor.name,
@@ -1224,8 +1375,47 @@ var ActionRegistry = class {
1224
1375
  } catch {
1225
1376
  }
1226
1377
  }
1378
+ if (globals.length > 0) {
1379
+ const { code } = options;
1380
+ sources.providers = await Promise.all(globals.map((name) => code === void 0 || usesProviderGlobal(code, name) ? this.#providerTypeSource(name, context) : { provider: name, actions: [] }));
1381
+ }
1227
1382
  return sources;
1228
1383
  }
1384
+ // A provider that fails, stalls past the bound, or lists nothing still gets
1385
+ // its global, declared loosely: the global's existence never depends on a
1386
+ // transient listing, and the registry validates every call at dispatch.
1387
+ async #providerTypeSource(name, context) {
1388
+ const provider = this.#providerBindings.current(name)?.provider;
1389
+ if (!provider) return { provider: name, actions: [] };
1390
+ let timer;
1391
+ try {
1392
+ const descriptors = await Promise.race([
1393
+ this.#listProvider(provider, {}, context),
1394
+ new Promise((resolve) => {
1395
+ const handle = setTimeout(() => resolve(void 0), PROVIDER_TYPE_SOURCE_TIMEOUT_MS);
1396
+ handle.unref?.();
1397
+ timer = handle;
1398
+ })
1399
+ ]);
1400
+ if (!Array.isArray(descriptors)) return { provider: name, actions: [] };
1401
+ const quarantined = activeQuarantinedRefNames();
1402
+ return {
1403
+ provider: name,
1404
+ actions: descriptors.flatMap((descriptor) => {
1405
+ if (!isPlainRecord(descriptor) || quarantined.has(`${name}.${String(descriptor.name)}`)) return [];
1406
+ if (this.#hostPolicy?.active && this.#hostPolicy.refDenial(name, String(descriptor.name))) return [];
1407
+ return actionTypeSource(
1408
+ descriptor.name,
1409
+ isPlainRecord(descriptor.inputSchema) ? effectiveInputSchema(`${name}.${descriptor.name}`, descriptor.inputSchema) : void 0
1410
+ ) ?? [];
1411
+ })
1412
+ };
1413
+ } catch {
1414
+ return { provider: name, actions: [] };
1415
+ } finally {
1416
+ if (timer) clearTimeout(timer);
1417
+ }
1418
+ }
1229
1419
  // The model-facing discovery view: quarantined refs hide here, and the
1230
1420
  // compiled overlay teaches: listed schemas show the compiled shape so
1231
1421
  // tightened enums are visible before the first call. Pass `declared: true`
@@ -1234,22 +1424,26 @@ var ActionRegistry = class {
1234
1424
  // carry-forward read the live contract. Capability-view paths stay
1235
1425
  // declared everywhere (see describe): committed views pin declared
1236
1426
  // digests, and a surface activation must never invalidate them.
1237
- async listDetailed(request, context) {
1427
+ async listDetailed(request, context, include = () => true) {
1238
1428
  context = this.#scopeContext(context);
1239
1429
  if (context.capabilityView) {
1240
- const refs = this.#viewAuthority(context.capabilityView).bindings().map((binding) => binding.ref).filter((ref) => !request.provider || ref.startsWith(`${request.provider}.`)).filter((ref) => request.declared || !activeQuarantinedRefNames().has(ref)).sort();
1430
+ const refs = this.#policyRefs(this.#viewAuthority(context.capabilityView).bindings().map((binding) => binding.ref)).filter((ref) => !request.provider || ref.startsWith(`${request.provider}.`)).filter((ref) => request.declared || !activeQuarantinedRefNames().has(ref)).sort();
1241
1431
  const actions = await Promise.all(refs.map((ref) => this.describe(ref, context)));
1242
1432
  const query = request.query?.normalize("NFKC").trim().toLowerCase();
1243
1433
  const filtered = actions.filter((action) => !request.namespace || action.namespace === request.namespace).filter(
1244
1434
  (action) => !query || `${action.ref} ${action.description}`.toLowerCase().includes(query)
1245
- );
1435
+ ).filter(include);
1246
1436
  const page2 = filtered.slice(0, fabricActionListLimit(request.limit));
1247
1437
  return { actions: page2, total: filtered.length, truncated: filtered.length > page2.length };
1248
1438
  }
1249
- const providers = request.provider ? [this.#requireProvider(request.provider)] : this.#providerBindings.providers();
1439
+ const providers = this.#policyProviders(request.provider ? [this.#requireProvider(request.provider)] : this.#providerBindings.providers());
1250
1440
  const lists = await Promise.all(
1251
1441
  providers.map(async (provider) => {
1252
- const descriptors = await runAbortable(context.signal, () => this.#providerBindings.trackProvider(provider, () => provider.list(request, context)));
1442
+ const enumeration = {
1443
+ ...request.namespace === void 0 ? {} : { namespace: request.namespace },
1444
+ ...request.query === void 0 ? {} : { query: request.query }
1445
+ };
1446
+ const descriptors = await this.#listProvider(provider, enumeration, context);
1253
1447
  return descriptors.filter(
1254
1448
  (descriptor) => request.declared || !activeQuarantinedRefNames().has(`${provider.name}.${descriptor.name}`)
1255
1449
  ).map((descriptor) => {
@@ -1264,7 +1458,7 @@ var ActionRegistry = class {
1264
1458
  });
1265
1459
  })
1266
1460
  );
1267
- const all = lists.flat();
1461
+ const all = this.#policyActions(lists.flat()).filter(include);
1268
1462
  const page = all.slice(0, fabricActionListLimit(request.limit));
1269
1463
  return { actions: page, total: all.length, truncated: all.length > page.length };
1270
1464
  }
@@ -1279,15 +1473,15 @@ var ActionRegistry = class {
1279
1473
  const binding = this.#providerBindings.binding(pinned.providerBindingId);
1280
1474
  return binding ? [[binding.name, binding.provider]] : [];
1281
1475
  })
1282
- ).values()] : options.provider ? [this.#requireProvider(options.provider)] : this.#providerBindings.providers()).filter((provider) => !options.provider || provider.name === options.provider).filter((provider) => options.includeProvider?.(provider.name) ?? true).sort((left, right) => left.name.localeCompare(right.name));
1476
+ ).values()] : options.provider ? [this.#requireProvider(options.provider)] : this.#providerBindings.providers()).filter((provider) => !options.provider || provider.name === options.provider).filter((provider) => options.includeProvider?.(provider.name) ?? true).filter((provider) => !this.#hostPolicy?.previewProviderHidden(provider.name)).sort((left, right) => left.name.localeCompare(right.name));
1283
1477
  const lists = await Promise.all(
1284
1478
  providers.map(async (provider) => ({
1285
1479
  provider,
1286
- actions: context.capabilityView ? await this.list({ provider: provider.name, limit: 1e3 }, context) : (await runAbortable(context.signal, () => this.#providerBindings.trackProvider(provider, () => provider.list({}, context)))).filter(
1480
+ actions: context.capabilityView ? await this.list({ provider: provider.name, limit: 1e3 }, context) : (await this.#listProvider(provider, {}, context)).filter(
1287
1481
  (descriptor) => !activeQuarantinedRefNames().has(`${provider.name}.${descriptor.name}`)
1288
1482
  ).map((descriptor) => resolveDescriptor(provider, descriptor))
1289
1483
  }))
1290
- );
1484
+ ).then((entries) => entries.map(({ provider, actions }) => ({ provider, actions: this.#policyActions(actions) })));
1291
1485
  const allActions = lists.flatMap(({ actions }) => actions).sort((left, right) => left.ref.localeCompare(right.ref));
1292
1486
  const limit = Math.max(1, Math.min(Math.floor(options.limit ?? 1e3), 1e3));
1293
1487
  const retainedRefs = new Set(allActions.slice(0, limit).map((action) => action.ref));
@@ -1366,6 +1560,7 @@ var ActionRegistry = class {
1366
1560
  throw new FabricResolutionError(formatUnknownActionMessage(ref, resolved.suggestions));
1367
1561
  }
1368
1562
  const action = resolved.action;
1563
+ this.#assertResolvedAllowed(action);
1369
1564
  if (expectedDescriptorHash && actionDescriptorHash(action) !== expectedDescriptorHash) {
1370
1565
  throw new FabricResolutionError(`Fabric capability descriptor changed: ${ref}`);
1371
1566
  }
@@ -1373,7 +1568,7 @@ var ActionRegistry = class {
1373
1568
  }
1374
1569
  if (context.capabilityView) {
1375
1570
  const pinned = await Promise.all(
1376
- this.#viewAuthority(context.capabilityView).bindings().map((binding) => binding.ref).map(
1571
+ this.#policyRefs(this.#viewAuthority(context.capabilityView).bindings().map((binding) => binding.ref)).map(
1377
1572
  (candidate) => this.describe(candidate, context)
1378
1573
  )
1379
1574
  );
@@ -1388,10 +1583,10 @@ var ActionRegistry = class {
1388
1583
  }
1389
1584
  const matches = [];
1390
1585
  const declaredNames = [];
1391
- for (const provider of this.#providerBindings.providers()) {
1586
+ for (const provider of this.#policyProviders(this.#providerBindings.providers())) {
1392
1587
  let descriptors;
1393
1588
  try {
1394
- descriptors = await runAbortable(context.signal, () => this.#providerBindings.trackProvider(provider, () => provider.list({}, context)));
1589
+ descriptors = await this.#listProvider(provider, {}, context);
1395
1590
  } catch {
1396
1591
  continue;
1397
1592
  }
@@ -1400,6 +1595,7 @@ var ActionRegistry = class {
1400
1595
  if (descriptor.name === ref) matches.push(resolveDescriptor(provider, descriptor));
1401
1596
  }
1402
1597
  }
1598
+ matches.splice(0, matches.length, ...this.#policyActions(matches));
1403
1599
  if (matches.length === 1) return matches[0];
1404
1600
  if (matches.length > 1) {
1405
1601
  throw new Error(
@@ -1430,6 +1626,7 @@ var ActionRegistry = class {
1430
1626
  throw new FabricResolutionError(formatUnknownActionMessage(ref, resolved.suggestions));
1431
1627
  }
1432
1628
  const action = resolved.action;
1629
+ this.#assertResolvedAllowed(action);
1433
1630
  const providerActionName = resolved.repairedFrom === void 0 ? actionName : action.name;
1434
1631
  const authority = { ref: action.ref, descriptor: actionDescriptorHash(action) };
1435
1632
  if (expectedDescriptorHash && actionDescriptorHash(action) !== expectedDescriptorHash) {
@@ -1466,7 +1663,7 @@ var ActionRegistry = class {
1466
1663
  );
1467
1664
  if (catalog.invalid) throw new Error(`Invalid arguments for ${ref}: ${catalog.invalid}`);
1468
1665
  if (context.approve) {
1469
- await runAbortable(context.signal, () => context.approve(structuredClone(action), snapshotArguments(catalog.args)));
1666
+ await runAbortable(context.signal, () => context.approve(structuredClone(action), snapshotArguments(catalog.args), context.signal));
1470
1667
  }
1471
1668
  const acquired = await runAbortable(
1472
1669
  context.signal,
@@ -1507,6 +1704,7 @@ var ActionRegistry = class {
1507
1704
  throw new FabricResolutionError(formatUnknownActionMessage(ref, resolved.suggestions));
1508
1705
  }
1509
1706
  const action = resolved.action;
1707
+ this.#assertResolvedAllowed(action);
1510
1708
  const providerActionName = resolved.repairedFrom === void 0 ? actionName : action.name;
1511
1709
  const authority = { ref: action.ref, descriptor: actionDescriptorHash(action) };
1512
1710
  if (expectedDescriptorHash && actionDescriptorHash(action) !== expectedDescriptorHash) {
@@ -1579,7 +1777,7 @@ var ActionRegistry = class {
1579
1777
  throw new FabricTraceSafeError(`Invalid arguments for ${ref}: ${catalog.invalid}`);
1580
1778
  }
1581
1779
  failureStage = "approve";
1582
- await runAbortable(context.signal, () => context.approve(structuredClone(action), snapshotArguments(catalog.args)));
1780
+ await runAbortable(context.signal, () => context.approve(structuredClone(action), snapshotArguments(catalog.args), context.signal));
1583
1781
  failureStage = "invoke";
1584
1782
  const nestedToolCallId = `${NESTED_TOOL_CALL_ID_PREFIX}${randomUUID2()}`;
1585
1783
  const effect = action.effect;
@@ -1650,6 +1848,7 @@ var ActionRegistry = class {
1650
1848
  if (served.replay.mediaNote) activeAudit.mediaNote = served.replay.mediaNote;
1651
1849
  }
1652
1850
  if (served.replay.preview !== void 0) activeAudit.preview = served.replay.preview;
1851
+ if (served.replay.terminate) activeAudit.terminate = true;
1653
1852
  }
1654
1853
  }
1655
1854
  if (!servedFromSpeculation) {
@@ -1700,6 +1899,10 @@ var ActionRegistry = class {
1700
1899
  attachPreview(preview) {
1701
1900
  if (!invocationActive) return;
1702
1901
  activeAudit.preview = preview;
1902
+ },
1903
+ requestTerminate() {
1904
+ if (!invocationActive) return;
1905
+ activeAudit.terminate = true;
1703
1906
  }
1704
1907
  }).finally(() => {
1705
1908
  if (effect.kind !== "none") this.#speculation?.bumpEpoch();
@@ -1791,6 +1994,7 @@ var ActionRegistry = class {
1791
1994
  const descriptor = await runAbortable(context.signal, () => this.#providerBindings.trackProvider(provider, () => provider.describe(actionName, context)));
1792
1995
  if (!descriptor) return void 0;
1793
1996
  const action = resolveDescriptor(provider, descriptor);
1997
+ if (this.#hostPolicy?.refDenial(action.provider, action.name)) return void 0;
1794
1998
  if (expectedDescriptorHash && actionDescriptorHash(action) !== expectedDescriptorHash) {
1795
1999
  return void 0;
1796
2000
  }
@@ -1831,6 +2035,9 @@ var ActionRegistry = class {
1831
2035
  },
1832
2036
  attachPreview(preview) {
1833
2037
  replay.preview = preview;
2038
+ },
2039
+ requestTerminate() {
2040
+ replay.terminate = true;
1834
2041
  }
1835
2042
  }));
1836
2043
  return {
@@ -1980,7 +2187,7 @@ var ActionRegistry = class {
1980
2187
  }
1981
2188
  async #declaredActionNames(provider, context) {
1982
2189
  try {
1983
- const descriptors = await runAbortable(context.signal, () => this.#providerBindings.trackProvider(provider, () => provider.list({}, context)));
2190
+ const descriptors = await this.#listProvider(provider, {}, context);
1984
2191
  return descriptors.map((descriptor) => descriptor.name);
1985
2192
  } catch {
1986
2193
  return [];
@@ -2002,6 +2209,8 @@ var ActionRegistry = class {
2002
2209
  ...descriptor.name !== actionName ? { repairedFrom: actionName } : {}
2003
2210
  };
2004
2211
  }
2212
+ const notPermitted = provider.notPermitted?.(actionName);
2213
+ if (notPermitted) throw new FabricResolutionError(notPermitted);
2005
2214
  if (!allowRepair) return { suggestions: [] };
2006
2215
  const declared = (await this.#declaredActionNames(provider, context)).filter(
2007
2216
  (name) => !activeQuarantinedRefNames().has(`${provider.name}.${name}`)
@@ -2052,6 +2261,8 @@ var ActionRegistry = class {
2052
2261
  throw new Error(`Fabric action references must use provider.action: ${ref}`);
2053
2262
  }
2054
2263
  const providerName = ref.slice(0, separator);
2264
+ const hostDenial = this.#hostPolicy?.refDenial(providerName, ref.slice(separator + 1));
2265
+ if (hostDenial) throw new FabricResolutionError(hostDenial);
2055
2266
  const pinned = view ? this.#viewAuthority(view).resolve(ref) : void 0;
2056
2267
  if (view && !pinned) {
2057
2268
  throw new FabricResolutionError(`Fabric capability is outside the committed view: ${ref}`);
@@ -2139,6 +2350,7 @@ var ActionRegistry = class {
2139
2350
  };
2140
2351
 
2141
2352
  export {
2353
+ boundedEffectResources,
2142
2354
  FabricComponentIndependenceError,
2143
2355
  trackedRegistration,
2144
2356
  registrationEffect,
@@ -2152,4 +2364,4 @@ export {
2152
2364
  scoreActionSearch,
2153
2365
  ActionRegistry
2154
2366
  };
2155
- //# sourceMappingURL=chunk-4EW7GVUR.js.map
2367
+ //# sourceMappingURL=chunk-56NMRVTV.js.map