@e4779/pi-fabric 0.102.0-fork.16 → 0.105.0-fork.22

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 (562) hide show
  1. package/README.md +44 -13
  2. package/THIRD_PARTY_NOTICES.md +10 -2
  3. package/dist/activity/store.d.ts +3 -0
  4. package/dist/activity/store.d.ts.map +1 -1
  5. package/dist/activity/workflow-items.d.ts +33 -0
  6. package/dist/activity/workflow-items.d.ts.map +1 -0
  7. package/dist/actors/binding-store.d.ts.map +1 -1
  8. package/dist/actors/manager.d.ts +6 -0
  9. package/dist/actors/manager.d.ts.map +1 -1
  10. package/dist/actors/mesh-monitor.d.ts +2 -2
  11. package/dist/actors/mesh-monitor.d.ts.map +1 -1
  12. package/dist/actors/registry-store.d.ts.map +1 -1
  13. package/dist/actors/types.d.ts +11 -0
  14. package/dist/actors/types.d.ts.map +1 -1
  15. package/dist/agents/child-env.d.ts +29 -0
  16. package/dist/agents/child-env.d.ts.map +1 -0
  17. package/dist/agents/fork-seed.d.ts +21 -0
  18. package/dist/agents/fork-seed.d.ts.map +1 -0
  19. package/dist/agents/handoff.d.ts +7 -1
  20. package/dist/agents/handoff.d.ts.map +1 -1
  21. package/dist/agents/hosted-run.d.ts +63 -0
  22. package/dist/agents/hosted-run.d.ts.map +1 -0
  23. package/dist/agents/manager.d.ts +21 -1
  24. package/dist/agents/manager.d.ts.map +1 -1
  25. package/dist/agents/request.d.ts.map +1 -1
  26. package/dist/agents/runner-notice.d.ts +7 -0
  27. package/dist/agents/runner-notice.d.ts.map +1 -0
  28. package/dist/agents/runner-protocol.d.ts +158 -0
  29. package/dist/agents/runner-protocol.d.ts.map +1 -0
  30. package/dist/agents/runner-registry.d.ts +223 -0
  31. package/dist/agents/runner-registry.d.ts.map +1 -0
  32. package/dist/agents/transports/process-transport.d.ts.map +1 -1
  33. package/dist/agents/transports/process-utils.d.ts +4 -1
  34. package/dist/agents/transports/process-utils.d.ts.map +1 -1
  35. package/dist/agents/types.d.ts +89 -4
  36. package/dist/agents/types.d.ts.map +1 -1
  37. package/dist/agents/worktree-manager.d.ts +21 -0
  38. package/dist/agents/worktree-manager.d.ts.map +1 -1
  39. package/dist/agents/write-guard.d.ts +16 -0
  40. package/dist/agents/write-guard.d.ts.map +1 -0
  41. package/dist/agents/write-guard.js +13 -0
  42. package/dist/agents/write-guard.js.map +7 -0
  43. package/dist/agents.js +13 -12
  44. package/dist/agents.js.map +1 -1
  45. package/dist/assessment.d.ts +3 -0
  46. package/dist/assessment.d.ts.map +1 -0
  47. package/dist/assessment.js +15 -0
  48. package/dist/assessment.js.map +7 -0
  49. package/dist/audit/assessment.d.ts +74 -0
  50. package/dist/audit/assessment.d.ts.map +1 -0
  51. package/dist/audit/details.d.ts +4 -0
  52. package/dist/audit/details.d.ts.map +1 -1
  53. package/dist/audit/index.d.ts +1 -0
  54. package/dist/audit/index.d.ts.map +1 -1
  55. package/dist/audit/projection.d.ts +2 -1
  56. package/dist/audit/projection.d.ts.map +1 -1
  57. package/dist/audit/trace.d.ts +16 -1
  58. package/dist/audit/trace.d.ts.map +1 -1
  59. package/dist/cache/leases.d.ts +2 -1
  60. package/dist/cache/leases.d.ts.map +1 -1
  61. package/dist/capture/interceptor.d.ts.map +1 -1
  62. package/dist/chunks/chunk-2USMWEE6.js +81 -0
  63. package/dist/chunks/chunk-2USMWEE6.js.map +7 -0
  64. package/dist/chunks/chunk-2Y24ML7H.js +115 -0
  65. package/dist/chunks/chunk-2Y24ML7H.js.map +7 -0
  66. package/dist/chunks/chunk-3GJJG2FV.js +1329 -0
  67. package/dist/chunks/chunk-3GJJG2FV.js.map +7 -0
  68. package/dist/chunks/{chunk-5VTBHJN3.js → chunk-3KDUMDPZ.js} +153 -29
  69. package/dist/chunks/chunk-3KDUMDPZ.js.map +7 -0
  70. package/dist/chunks/chunk-4RTHQGES.js +189 -0
  71. package/dist/chunks/chunk-4RTHQGES.js.map +7 -0
  72. package/dist/chunks/{chunk-ZZ66L3W5.js → chunk-5MNLVHF5.js} +30 -7
  73. package/dist/chunks/chunk-5MNLVHF5.js.map +7 -0
  74. package/dist/chunks/{chunk-RAO6TQFP.js → chunk-5XBYFSI5.js} +26 -6
  75. package/dist/chunks/chunk-5XBYFSI5.js.map +7 -0
  76. package/dist/chunks/{chunk-J2HV2URQ.js → chunk-7EYJE4TW.js} +1 -1
  77. package/dist/chunks/{chunk-J2HV2URQ.js.map → chunk-7EYJE4TW.js.map} +2 -2
  78. package/dist/chunks/{chunk-57CMH4SW.js → chunk-7JU7Z4XQ.js} +2 -2
  79. package/dist/chunks/chunk-7QKKLBHJ.js +33 -0
  80. package/dist/chunks/chunk-7QKKLBHJ.js.map +7 -0
  81. package/dist/chunks/chunk-7XRUMDV7.js +235 -0
  82. package/dist/chunks/chunk-7XRUMDV7.js.map +7 -0
  83. package/dist/chunks/{chunk-DUJ46TIP.js → chunk-ABJCSNZO.js} +4 -4
  84. package/dist/chunks/chunk-B2Y4364O.js +78 -0
  85. package/dist/chunks/chunk-B2Y4364O.js.map +7 -0
  86. package/dist/chunks/{chunk-4TKPBEPB.js → chunk-BVJBYFHD.js} +9 -3
  87. package/dist/chunks/{chunk-4TKPBEPB.js.map → chunk-BVJBYFHD.js.map} +2 -2
  88. package/dist/chunks/{chunk-KP4ANT6L.js → chunk-C7EEG6SM.js} +2 -2
  89. package/dist/chunks/{chunk-NHMICIEU.js → chunk-CCHZXF6K.js} +3 -3
  90. package/dist/chunks/{chunk-W63E3WEO.js → chunk-CXTTLBUV.js} +3 -2
  91. package/dist/chunks/chunk-CXTTLBUV.js.map +7 -0
  92. package/dist/chunks/{chunk-HOX6VW45.js → chunk-CYMDX3XP.js} +1 -1
  93. package/dist/chunks/{chunk-HOX6VW45.js.map → chunk-CYMDX3XP.js.map} +1 -1
  94. package/dist/chunks/chunk-DK35W6U7.js +259 -0
  95. package/dist/chunks/chunk-DK35W6U7.js.map +7 -0
  96. package/dist/chunks/{chunk-5JN5AWNV.js → chunk-DZ4WN5XJ.js} +3 -3
  97. package/dist/chunks/chunk-EXWS4ZS3.js +6490 -0
  98. package/dist/chunks/chunk-EXWS4ZS3.js.map +7 -0
  99. package/dist/chunks/{chunk-QHYBSIIO.js → chunk-FB24AOIJ.js} +39 -37
  100. package/dist/chunks/{chunk-QHYBSIIO.js.map → chunk-FB24AOIJ.js.map} +1 -1
  101. package/dist/chunks/chunk-FSB2VIRZ.js +435 -0
  102. package/dist/chunks/chunk-FSB2VIRZ.js.map +7 -0
  103. package/dist/chunks/{chunk-PNDYFU64.js → chunk-GJVPP3NN.js} +81 -11
  104. package/dist/chunks/chunk-GJVPP3NN.js.map +7 -0
  105. package/dist/chunks/{chunk-B5D6GA77.js → chunk-GYPDGW27.js} +100 -92
  106. package/dist/chunks/chunk-GYPDGW27.js.map +7 -0
  107. package/dist/chunks/{chunk-LEFBW2GK.js → chunk-IAFI4A2I.js} +44 -2
  108. package/dist/chunks/{chunk-LEFBW2GK.js.map → chunk-IAFI4A2I.js.map} +3 -3
  109. package/dist/chunks/{chunk-PWS2OXLV.js → chunk-IIPKG52D.js} +1 -1
  110. package/dist/chunks/chunk-IIPKG52D.js.map +7 -0
  111. package/dist/chunks/chunk-ITVLKXCI.js +266 -0
  112. package/dist/chunks/chunk-ITVLKXCI.js.map +7 -0
  113. package/dist/chunks/chunk-JKQARSWR.js +265 -0
  114. package/dist/chunks/chunk-JKQARSWR.js.map +7 -0
  115. package/dist/chunks/{chunk-AYBIR4YV.js → chunk-KJZAOENY.js} +6 -4
  116. package/dist/chunks/chunk-KJZAOENY.js.map +7 -0
  117. package/dist/chunks/{chunk-74BA4VSX.js → chunk-KQ6R5EWR.js} +1462 -1405
  118. package/dist/chunks/chunk-KQ6R5EWR.js.map +7 -0
  119. package/dist/chunks/chunk-L22K5BWU.js +180 -0
  120. package/dist/chunks/chunk-L22K5BWU.js.map +7 -0
  121. package/dist/chunks/{chunk-7XJB2USB.js → chunk-LOLCTWJF.js} +4 -4
  122. package/dist/chunks/{chunk-QETG2GVX.js → chunk-M5IN6DMF.js} +34 -31
  123. package/dist/chunks/chunk-M5IN6DMF.js.map +7 -0
  124. package/dist/chunks/{chunk-64O5L7EW.js → chunk-M6IRQ3QT.js} +2 -2
  125. package/dist/chunks/{chunk-TX6E5W7H.js → chunk-NTC2MCB6.js} +1 -1
  126. package/dist/chunks/chunk-NTC2MCB6.js.map +7 -0
  127. package/dist/chunks/{chunk-EPYLZWJV.js → chunk-OVBKQCYL.js} +2 -2
  128. package/dist/chunks/{chunk-YV2PHCDB.js → chunk-PYFJW3HC.js} +16 -2
  129. package/dist/chunks/{chunk-YV2PHCDB.js.map → chunk-PYFJW3HC.js.map} +3 -3
  130. package/dist/chunks/{chunk-Z5Y65YBX.js → chunk-PYQM7KPL.js} +3 -2
  131. package/dist/chunks/{chunk-BEJF2JX2.js → chunk-QLFDPXK7.js} +33 -2
  132. package/dist/chunks/chunk-QLFDPXK7.js.map +7 -0
  133. package/dist/chunks/chunk-QUWC6YCN.js +125 -0
  134. package/dist/chunks/chunk-QUWC6YCN.js.map +7 -0
  135. package/dist/chunks/{chunk-DKVJREDI.js → chunk-QY7YK7M6.js} +2 -2
  136. package/dist/chunks/{chunk-WMJ2AVQQ.js → chunk-R5F6CHW2.js} +34 -18
  137. package/dist/chunks/chunk-R5F6CHW2.js.map +7 -0
  138. package/dist/chunks/chunk-S3IRPDSO.js +57 -0
  139. package/dist/chunks/chunk-S3IRPDSO.js.map +7 -0
  140. package/dist/chunks/{chunk-7BG5COXB.js → chunk-SVDHQUTM.js} +21 -4
  141. package/dist/chunks/chunk-SVDHQUTM.js.map +7 -0
  142. package/dist/chunks/{chunk-HG4DMARW.js → chunk-T5CU2GPZ.js} +116 -26
  143. package/dist/chunks/chunk-T5CU2GPZ.js.map +7 -0
  144. package/dist/chunks/{chunk-RIFG4HS6.js → chunk-TFFZVLR2.js} +141 -9
  145. package/dist/chunks/chunk-TFFZVLR2.js.map +7 -0
  146. package/dist/chunks/{chunk-BUQZBG6O.js → chunk-U2UBUKNQ.js} +136 -136
  147. package/dist/chunks/chunk-U2UBUKNQ.js.map +7 -0
  148. package/dist/chunks/chunk-U366I5K2.js +363 -0
  149. package/dist/chunks/chunk-U366I5K2.js.map +7 -0
  150. package/dist/chunks/{chunk-4NF3S3NM.js → chunk-UTOBAZ5T.js} +1 -1
  151. package/dist/chunks/chunk-UTOBAZ5T.js.map +7 -0
  152. package/dist/chunks/chunk-V73NIH6B.js +127 -0
  153. package/dist/chunks/chunk-V73NIH6B.js.map +7 -0
  154. package/dist/chunks/{chunk-PN4EKNRE.js → chunk-VON4TSO3.js} +132 -12
  155. package/dist/chunks/chunk-VON4TSO3.js.map +7 -0
  156. package/dist/chunks/{chunk-5ZJV4LAX.js → chunk-VPRJOD4Y.js} +4 -4
  157. package/dist/chunks/{chunk-FDIEQEXS.js → chunk-VSDUSNIA.js} +4 -4
  158. package/dist/chunks/chunk-VSDUSNIA.js.map +7 -0
  159. package/dist/chunks/{chunk-RG22JKIC.js → chunk-W7X4XEQU.js} +2 -2
  160. package/dist/chunks/{chunk-LV4IT75S.js → chunk-WLLXKS6I.js} +2 -2
  161. package/dist/chunks/chunk-WOLUDZVR.js +197 -0
  162. package/dist/chunks/chunk-WOLUDZVR.js.map +7 -0
  163. package/dist/chunks/{chunk-YVDBHS4C.js → chunk-WREA4RNR.js} +3 -3
  164. package/dist/chunks/{chunk-QE2JFB7F.js → chunk-WYUV6WL3.js} +16 -6
  165. package/dist/chunks/chunk-WYUV6WL3.js.map +7 -0
  166. package/dist/chunks/{chunk-NGGI6LDC.js → chunk-X2TRSE7D.js} +2 -2
  167. package/dist/chunks/{chunk-VRAGOMN4.js → chunk-YRDCJZZW.js} +34 -1
  168. package/dist/chunks/chunk-YRDCJZZW.js.map +7 -0
  169. package/dist/chunks/{chunk-CC63CY6R.js → chunk-YYSZBD7S.js} +17 -261
  170. package/dist/chunks/chunk-YYSZBD7S.js.map +7 -0
  171. package/dist/chunks/{chunk-A4VP7HDF.js → chunk-ZLNJDTCN.js} +2 -2
  172. package/dist/chunks/{chunk-G4CSXNBT.js → chunk-ZXKYU6CH.js} +42 -5
  173. package/dist/chunks/chunk-ZXKYU6CH.js.map +7 -0
  174. package/dist/cli/decisions.d.ts +8 -0
  175. package/dist/cli/decisions.d.ts.map +1 -0
  176. package/dist/cli/decisions.js +131 -0
  177. package/dist/cli/decisions.js.map +7 -0
  178. package/dist/cli/index.d.ts +3 -0
  179. package/dist/cli/index.d.ts.map +1 -0
  180. package/dist/cli/index.js +56 -0
  181. package/dist/cli/index.js.map +7 -0
  182. package/dist/cli/mesh.d.ts +3 -0
  183. package/dist/cli/mesh.d.ts.map +1 -0
  184. package/dist/cli/mesh.js +126 -0
  185. package/dist/cli/mesh.js.map +7 -0
  186. package/dist/commands/fabric.d.ts.map +1 -1
  187. package/dist/compaction/carry.d.ts +23 -0
  188. package/dist/compaction/carry.d.ts.map +1 -0
  189. package/dist/compaction/hook.d.ts +9 -0
  190. package/dist/compaction/hook.d.ts.map +1 -1
  191. package/dist/compaction/hook.js +6 -6
  192. package/dist/compaction/orphan-repair.d.ts +11 -0
  193. package/dist/compaction/orphan-repair.d.ts.map +1 -0
  194. package/dist/compaction/orphan-repair.js +75 -0
  195. package/dist/compaction/orphan-repair.js.map +7 -0
  196. package/dist/compaction/owner.d.ts +26 -0
  197. package/dist/compaction/owner.d.ts.map +1 -0
  198. package/dist/compaction/owner.js +26 -0
  199. package/dist/compaction/owner.js.map +7 -0
  200. package/dist/compaction/pressure.d.ts +19 -0
  201. package/dist/compaction/pressure.d.ts.map +1 -0
  202. package/dist/compaction/render.d.ts +4 -0
  203. package/dist/compaction/render.d.ts.map +1 -1
  204. package/dist/compaction/threshold.d.ts +6 -1
  205. package/dist/compaction/threshold.d.ts.map +1 -1
  206. package/dist/components/configuration.js +6 -6
  207. package/dist/components/provider-component.d.ts +1 -1
  208. package/dist/components/provider-component.d.ts.map +1 -1
  209. package/dist/config.d.ts +45 -2
  210. package/dist/config.d.ts.map +1 -1
  211. package/dist/core/action-registry.d.ts +5 -1
  212. package/dist/core/action-registry.d.ts.map +1 -1
  213. package/dist/core/action-registry.js +8 -8
  214. package/dist/core/approval-controller.d.ts +5 -1
  215. package/dist/core/approval-controller.d.ts.map +1 -1
  216. package/dist/core/approval-overrides.d.ts +11 -0
  217. package/dist/core/approval-overrides.d.ts.map +1 -0
  218. package/dist/core/atomic-write.d.ts +77 -0
  219. package/dist/core/atomic-write.d.ts.map +1 -1
  220. package/dist/core/compact-controller.d.ts +8 -0
  221. package/dist/core/compact-controller.d.ts.map +1 -1
  222. package/dist/core/file-lock.d.ts.map +1 -1
  223. package/dist/core/foreground-tools.d.ts +45 -0
  224. package/dist/core/foreground-tools.d.ts.map +1 -0
  225. package/dist/core/provider-bindings.d.ts +10 -1
  226. package/dist/core/provider-bindings.d.ts.map +1 -1
  227. package/dist/core/provider-operations.js.map +1 -1
  228. package/dist/core/tool-ownership.d.ts +18 -2
  229. package/dist/core/tool-ownership.d.ts.map +1 -1
  230. package/dist/decisions/command.d.ts +5 -0
  231. package/dist/decisions/command.d.ts.map +1 -0
  232. package/dist/decisions/command.js +74 -0
  233. package/dist/decisions/command.js.map +7 -0
  234. package/dist/decisions/host.d.ts +24 -0
  235. package/dist/decisions/host.d.ts.map +1 -0
  236. package/dist/decisions/store.d.ts +147 -0
  237. package/dist/decisions/store.d.ts.map +1 -0
  238. package/dist/durable.d.ts +38 -0
  239. package/dist/durable.d.ts.map +1 -0
  240. package/dist/durable.js +274 -0
  241. package/dist/durable.js.map +7 -0
  242. package/dist/entropy/index.js +10 -9
  243. package/dist/execution-service.d.ts +41 -1
  244. package/dist/execution-service.d.ts.map +1 -1
  245. package/dist/extension-bootstrap.d.ts +7 -0
  246. package/dist/extension-bootstrap.d.ts.map +1 -0
  247. package/dist/extension-bootstrap.js +51 -0
  248. package/dist/extension-bootstrap.js.map +7 -0
  249. package/dist/extension.d.ts +8 -0
  250. package/dist/extension.d.ts.map +1 -0
  251. package/dist/fabric-exec-tool.d.ts.map +1 -1
  252. package/dist/fabric-runtime-state.d.ts +8 -0
  253. package/dist/fabric-runtime-state.d.ts.map +1 -1
  254. package/dist/fabric-runtime-state.js +2432 -346
  255. package/dist/fabric-runtime-state.js.map +4 -4
  256. package/dist/fabric-state.d.ts +22 -0
  257. package/dist/fabric-state.d.ts.map +1 -1
  258. package/dist/host-compatibility.d.ts +1 -1
  259. package/dist/host-compatibility.d.ts.map +1 -1
  260. package/dist/index.d.ts +5 -6
  261. package/dist/index.d.ts.map +1 -1
  262. package/dist/index.js +68 -6250
  263. package/dist/index.js.map +4 -4
  264. package/dist/jev/observation.js +5 -5
  265. package/dist/jev-fabric/bridge.d.ts +15 -0
  266. package/dist/jev-fabric/bridge.d.ts.map +1 -1
  267. package/dist/jev-fabric/client.js +1 -1
  268. package/dist/jev-fabric/client.js.map +2 -2
  269. package/dist/jev-fabric/operations.d.ts +2 -0
  270. package/dist/jev-fabric/operations.d.ts.map +1 -1
  271. package/dist/jev-fabric/operations.js +1 -1
  272. package/dist/jev-fabric/operations.js.map +2 -2
  273. package/dist/jev-fabric/resolve.js +1 -1
  274. package/dist/jev-fabric/resolve.js.map +2 -2
  275. package/dist/jev.js +9 -9
  276. package/dist/lifecycle/types.d.ts.map +1 -1
  277. package/dist/memory/client.d.ts +3 -0
  278. package/dist/memory/client.d.ts.map +1 -1
  279. package/dist/memory/digest.js +2 -2
  280. package/dist/memory/discovery.js +6 -6
  281. package/dist/memory/expand-service.d.ts.map +1 -1
  282. package/dist/memory/file-worker.d.ts.map +1 -1
  283. package/dist/memory/file-worker.js +10 -9
  284. package/dist/memory/file-worker.js.map +2 -2
  285. package/dist/memory/host-source.d.ts +2 -1
  286. package/dist/memory/host-source.d.ts.map +1 -1
  287. package/dist/memory/normalize.js +5 -5
  288. package/dist/memory/portable.d.ts +3 -1
  289. package/dist/memory/portable.d.ts.map +1 -1
  290. package/dist/memory/request-cache.d.ts +4 -2
  291. package/dist/memory/request-cache.d.ts.map +1 -1
  292. package/dist/memory/request-context.d.ts +3 -0
  293. package/dist/memory/request-context.d.ts.map +1 -1
  294. package/dist/memory/search.js +7 -7
  295. package/dist/memory/worker-provider.d.ts.map +1 -1
  296. package/dist/memory/worker-provider.js +10 -10
  297. package/dist/memory.js +14 -13
  298. package/dist/memory.js.map +2 -2
  299. package/dist/mesh/grants.d.ts +86 -0
  300. package/dist/mesh/grants.d.ts.map +1 -0
  301. package/dist/mesh/store.d.ts +89 -0
  302. package/dist/mesh/store.d.ts.map +1 -1
  303. package/dist/programs/host.d.ts +22 -0
  304. package/dist/programs/host.d.ts.map +1 -0
  305. package/dist/programs/host.js +171 -0
  306. package/dist/programs/host.js.map +7 -0
  307. package/dist/programs/source.d.ts +16 -0
  308. package/dist/programs/source.d.ts.map +1 -0
  309. package/dist/programs/store.d.ts +81 -0
  310. package/dist/programs/store.d.ts.map +1 -0
  311. package/dist/protocol.d.ts +153 -0
  312. package/dist/protocol.d.ts.map +1 -1
  313. package/dist/protocol.js +15 -1
  314. package/dist/providers/agents-actions.d.ts.map +1 -1
  315. package/dist/providers/agents-message-router.d.ts.map +1 -1
  316. package/dist/providers/agents-progress.d.ts.map +1 -1
  317. package/dist/providers/agents-provider.d.ts +3 -0
  318. package/dist/providers/agents-provider.d.ts.map +1 -1
  319. package/dist/providers/cache-provider.d.ts +1 -1
  320. package/dist/providers/cache-provider.d.ts.map +1 -1
  321. package/dist/providers/compact-provider.d.ts +13 -1
  322. package/dist/providers/compact-provider.d.ts.map +1 -1
  323. package/dist/providers/decisions-provider.d.ts +17 -0
  324. package/dist/providers/decisions-provider.d.ts.map +1 -0
  325. package/dist/providers/jev-provider.js +9 -9
  326. package/dist/providers/memory-provider.d.ts.map +1 -1
  327. package/dist/providers/memory-provider.js +9 -9
  328. package/dist/providers/mesh-provider.d.ts +4 -0
  329. package/dist/providers/mesh-provider.d.ts.map +1 -1
  330. package/dist/providers/pi-native-mcp.d.ts.map +1 -1
  331. package/dist/providers/pi-tools-provider.d.ts.map +1 -1
  332. package/dist/providers/programs-provider.d.ts +18 -0
  333. package/dist/providers/programs-provider.d.ts.map +1 -0
  334. package/dist/providers/state-provider.d.ts +4 -1
  335. package/dist/providers/state-provider.d.ts.map +1 -1
  336. package/dist/providers/thinking-provider.d.ts +15 -0
  337. package/dist/providers/thinking-provider.d.ts.map +1 -0
  338. package/dist/residency/actor-client.js +3 -3
  339. package/dist/residency/client.d.ts.map +1 -1
  340. package/dist/residency/host.d.ts +21 -0
  341. package/dist/residency/host.d.ts.map +1 -1
  342. package/dist/residency/host.js +28 -22
  343. package/dist/residency/launcher-owner.d.ts +2 -0
  344. package/dist/residency/launcher-owner.d.ts.map +1 -1
  345. package/dist/residency/launcher.js +35 -20
  346. package/dist/residency/launcher.js.map +3 -3
  347. package/dist/residency/pi-entry.js +26 -22
  348. package/dist/residency/pi-entry.js.map +1 -1
  349. package/dist/residency/protocol.d.ts +12 -2
  350. package/dist/residency/protocol.d.ts.map +1 -1
  351. package/dist/runners.d.ts +9 -0
  352. package/dist/runners.d.ts.map +1 -0
  353. package/dist/runners.js +182 -0
  354. package/dist/runners.js.map +7 -0
  355. package/dist/runtime/core-override-guest-types.js +2 -2
  356. package/dist/runtime/cpython-child-source.d.ts.map +1 -1
  357. package/dist/runtime/cpython-runtime.d.ts.map +1 -1
  358. package/dist/runtime/cpython-runtime.js +35 -7
  359. package/dist/runtime/cpython-runtime.js.map +2 -2
  360. package/dist/runtime/deadline-pause.d.ts +26 -0
  361. package/dist/runtime/deadline-pause.d.ts.map +1 -0
  362. package/dist/runtime/guest-types.d.ts +1 -1
  363. package/dist/runtime/guest-types.d.ts.map +1 -1
  364. package/dist/runtime/guest-types.js +1 -1
  365. package/dist/runtime/kernel.d.ts +3 -0
  366. package/dist/runtime/kernel.d.ts.map +1 -1
  367. package/dist/runtime/monty-runtime.d.ts.map +1 -1
  368. package/dist/runtime/monty-runtime.js +33 -12
  369. package/dist/runtime/monty-runtime.js.map +2 -2
  370. package/dist/runtime/node-process-runtime.d.ts.map +1 -1
  371. package/dist/runtime/node-process-runtime.js +4 -3
  372. package/dist/runtime/orchestration.d.ts.map +1 -1
  373. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  374. package/dist/runtime/quickjs-runtime.js +2 -1
  375. package/dist/runtime/typescript-kernel.js +8 -7
  376. package/dist/runtime/typescript-kernel.js.map +1 -1
  377. package/dist/runtime-state-builtins.d.ts.map +1 -1
  378. package/dist/schema/controller.d.ts.map +1 -1
  379. package/dist/schema/policy.d.ts.map +1 -1
  380. package/dist/scope.d.ts +69 -0
  381. package/dist/scope.d.ts.map +1 -0
  382. package/dist/scope.js +37 -0
  383. package/dist/scope.js.map +7 -0
  384. package/dist/speculation/eligibility.d.ts.map +1 -1
  385. package/dist/speculation/python-scanner.js +1 -1
  386. package/dist/speculation/python-scanner.js.map +2 -2
  387. package/dist/speculation/scanner.js +1 -1
  388. package/dist/speculation/scanner.js.map +2 -2
  389. package/dist/state/binding.d.ts +17 -0
  390. package/dist/state/binding.d.ts.map +1 -0
  391. package/dist/state/store.d.ts +8 -2
  392. package/dist/state/store.d.ts.map +1 -1
  393. package/dist/state/types.d.ts +23 -2
  394. package/dist/state/types.d.ts.map +1 -1
  395. package/dist/storage/retention.d.ts +7 -0
  396. package/dist/storage/retention.d.ts.map +1 -1
  397. package/dist/storage/scratch.d.ts.map +1 -1
  398. package/dist/thinking-control.d.ts +64 -0
  399. package/dist/thinking-control.d.ts.map +1 -0
  400. package/dist/thinking-control.js +15 -0
  401. package/dist/thinking-control.js.map +7 -0
  402. package/dist/thinking.d.ts +61 -0
  403. package/dist/thinking.d.ts.map +1 -1
  404. package/dist/topology/control-plane.d.ts +13 -0
  405. package/dist/topology/control-plane.d.ts.map +1 -1
  406. package/dist/topology/participant-directory.d.ts +2 -0
  407. package/dist/topology/participant-directory.d.ts.map +1 -1
  408. package/dist/topology/provider-participants.d.ts +72 -0
  409. package/dist/topology/provider-participants.d.ts.map +1 -0
  410. package/dist/topology/records.d.ts.map +1 -1
  411. package/dist/topology/types.d.ts +13 -3
  412. package/dist/topology/types.d.ts.map +1 -1
  413. package/dist/type-error-guidance.js +170 -0
  414. package/dist/type-error-guidance.js.map +7 -0
  415. package/dist/ui/controller.d.ts.map +1 -1
  416. package/dist/ui/conversation-chrome.d.ts +2 -0
  417. package/dist/ui/conversation-chrome.d.ts.map +1 -1
  418. package/dist/ui/conversation-chrome.js +1 -1
  419. package/dist/ui/conversation-latest.d.ts +10 -0
  420. package/dist/ui/conversation-latest.d.ts.map +1 -0
  421. package/dist/ui/conversation-native-reader.js +2 -1
  422. package/dist/ui/conversation-native-reader.js.map +1 -1
  423. package/dist/ui/conversation-render.d.ts +2 -1
  424. package/dist/ui/conversation-render.d.ts.map +1 -1
  425. package/dist/ui/conversation-scrollbar.d.ts +22 -0
  426. package/dist/ui/conversation-scrollbar.d.ts.map +1 -0
  427. package/dist/ui/conversation-selection.d.ts +2 -2
  428. package/dist/ui/conversation-selection.d.ts.map +1 -1
  429. package/dist/ui/conversation-targets.d.ts.map +1 -1
  430. package/dist/ui/conversation-targets.js +2 -2
  431. package/dist/ui/conversation.d.ts +3 -0
  432. package/dist/ui/conversation.d.ts.map +1 -1
  433. package/dist/ui/conversation.js +253 -34
  434. package/dist/ui/conversation.js.map +4 -4
  435. package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -1
  436. package/dist/ui/dashboard.js +14 -15
  437. package/dist/ui/dashboard.js.map +2 -2
  438. package/dist/ui/image-overlays.d.ts +16 -0
  439. package/dist/ui/image-overlays.d.ts.map +1 -0
  440. package/dist/ui/image-overlays.js +10 -0
  441. package/dist/ui/image-overlays.js.map +7 -0
  442. package/dist/ui/kitty-viewport.d.ts +24 -0
  443. package/dist/ui/kitty-viewport.d.ts.map +1 -0
  444. package/dist/ui/retention.d.ts +14 -0
  445. package/dist/ui/retention.d.ts.map +1 -0
  446. package/dist/ui/settings-sections-execution.d.ts.map +1 -1
  447. package/dist/ui/settings.d.ts.map +1 -1
  448. package/dist/ui/settings.js +27 -16
  449. package/dist/ui/settings.js.map +2 -2
  450. package/dist/ui/transcript.d.ts +2 -1
  451. package/dist/ui/transcript.d.ts.map +1 -1
  452. package/dist/ui/types.d.ts +2 -1
  453. package/dist/ui/types.d.ts.map +1 -1
  454. package/dist/ui/widget.d.ts +4 -2
  455. package/dist/ui/widget.d.ts.map +1 -1
  456. package/dist/verified/generated/authority-kernel.js +1 -1
  457. package/dist/verified/generated/kernel.js +1 -1
  458. package/dist/verified/generated/lifecycle-kernel.js +1 -1
  459. package/dist/verified/generated/manifest.json +7 -7
  460. package/dist/verified/generated/provider-kernel.js +1 -1
  461. package/dist/verified/generated/storage-kernel.js +1 -1
  462. package/dist/worker/options.d.ts.map +1 -1
  463. package/dist/worker/options.js +14 -0
  464. package/dist/worker/options.js.map +2 -2
  465. package/dist/worker/questions.d.ts +46 -0
  466. package/dist/worker/questions.d.ts.map +1 -0
  467. package/dist/worker/questions.js +87 -0
  468. package/dist/worker/questions.js.map +7 -0
  469. package/dist/worker/result.d.ts +3 -0
  470. package/dist/worker/result.d.ts.map +1 -0
  471. package/dist/worker/result.js +7493 -0
  472. package/dist/worker/result.js.map +7 -0
  473. package/dist/worker/run-record.js +10 -113
  474. package/dist/worker/run-record.js.map +3 -3
  475. package/dist/worker/startup.d.ts +8 -0
  476. package/dist/worker/startup.d.ts.map +1 -0
  477. package/dist/worker.js +111 -22
  478. package/dist/worker.js.map +4 -4
  479. package/docs/agents.md +197 -3
  480. package/docs/architecture.md +8 -1
  481. package/docs/audit-trace.md +36 -1
  482. package/docs/background-tasks.md +25 -1
  483. package/docs/certification.md +1 -1
  484. package/docs/compaction.md +64 -0
  485. package/docs/components.md +1 -0
  486. package/docs/configuration.md +105 -10
  487. package/docs/decisions.md +144 -0
  488. package/docs/durable-pi.md +186 -0
  489. package/docs/interface.md +10 -1
  490. package/docs/kitty-images.md +89 -0
  491. package/docs/licenses/typebox-mit.txt +23 -0
  492. package/docs/memory-recall.md +5 -3
  493. package/docs/programmatic-compaction.md +67 -11
  494. package/docs/programs.md +137 -0
  495. package/docs/provider-capabilities.md +23 -1
  496. package/docs/providers.md +158 -0
  497. package/docs/residency-runtime.md +64 -0
  498. package/docs/schema-enforcement.md +5 -3
  499. package/docs/shell-composition.md +6 -6
  500. package/docs/skills.md +2 -1
  501. package/docs/speculation.md +2 -1
  502. package/docs/state-layer.md +26 -4
  503. package/docs/thinking.md +48 -0
  504. package/docs/verified-kernels.md +1 -1
  505. package/package.json +48 -12
  506. package/scripts/test-verified-kernels.mjs +1 -1
  507. package/scripts/verified-kernels.mjs +1 -1
  508. package/skillsets/python/fabric-exec/SKILL.md +2 -2
  509. package/skillsets/python/fabric-exec/references/agents.md +9 -4
  510. package/skillsets/python/fabric-exec/references/mesh.md +9 -0
  511. package/skillsets/python/fabric-graph/SKILL.md +109 -0
  512. package/skillsets/python/fabric-guide/SKILL.md +2 -1
  513. package/skillsets/typescript/fabric-exec/SKILL.md +20 -2
  514. package/skillsets/typescript/fabric-exec/references/agents.md +10 -4
  515. package/skillsets/typescript/fabric-exec/references/mesh.md +10 -0
  516. package/skillsets/typescript/fabric-graph/SKILL.md +112 -0
  517. package/skillsets/typescript/fabric-guide/SKILL.md +2 -1
  518. package/skillsets/typescript/fabric-workflow/SKILL.md +1 -1
  519. package/dist/chunks/chunk-4NF3S3NM.js.map +0 -7
  520. package/dist/chunks/chunk-5VTBHJN3.js.map +0 -7
  521. package/dist/chunks/chunk-74BA4VSX.js.map +0 -7
  522. package/dist/chunks/chunk-7BG5COXB.js.map +0 -7
  523. package/dist/chunks/chunk-AYBIR4YV.js.map +0 -7
  524. package/dist/chunks/chunk-B5D6GA77.js.map +0 -7
  525. package/dist/chunks/chunk-BEJF2JX2.js.map +0 -7
  526. package/dist/chunks/chunk-BUQZBG6O.js.map +0 -7
  527. package/dist/chunks/chunk-CC63CY6R.js.map +0 -7
  528. package/dist/chunks/chunk-FDIEQEXS.js.map +0 -7
  529. package/dist/chunks/chunk-G4CSXNBT.js.map +0 -7
  530. package/dist/chunks/chunk-HG4DMARW.js.map +0 -7
  531. package/dist/chunks/chunk-KAD7UWT2.js +0 -99
  532. package/dist/chunks/chunk-KAD7UWT2.js.map +0 -7
  533. package/dist/chunks/chunk-MGWQOKBV.js +0 -30
  534. package/dist/chunks/chunk-MGWQOKBV.js.map +0 -7
  535. package/dist/chunks/chunk-PN4EKNRE.js.map +0 -7
  536. package/dist/chunks/chunk-PNDYFU64.js.map +0 -7
  537. package/dist/chunks/chunk-PWS2OXLV.js.map +0 -7
  538. package/dist/chunks/chunk-QE2JFB7F.js.map +0 -7
  539. package/dist/chunks/chunk-QETG2GVX.js.map +0 -7
  540. package/dist/chunks/chunk-RAO6TQFP.js.map +0 -7
  541. package/dist/chunks/chunk-RIFG4HS6.js.map +0 -7
  542. package/dist/chunks/chunk-TX6E5W7H.js.map +0 -7
  543. package/dist/chunks/chunk-VRAGOMN4.js.map +0 -7
  544. package/dist/chunks/chunk-W63E3WEO.js.map +0 -7
  545. package/dist/chunks/chunk-WMJ2AVQQ.js.map +0 -7
  546. package/dist/chunks/chunk-ZZ66L3W5.js.map +0 -7
  547. /package/dist/chunks/{chunk-57CMH4SW.js.map → chunk-7JU7Z4XQ.js.map} +0 -0
  548. /package/dist/chunks/{chunk-DUJ46TIP.js.map → chunk-ABJCSNZO.js.map} +0 -0
  549. /package/dist/chunks/{chunk-KP4ANT6L.js.map → chunk-C7EEG6SM.js.map} +0 -0
  550. /package/dist/chunks/{chunk-NHMICIEU.js.map → chunk-CCHZXF6K.js.map} +0 -0
  551. /package/dist/chunks/{chunk-5JN5AWNV.js.map → chunk-DZ4WN5XJ.js.map} +0 -0
  552. /package/dist/chunks/{chunk-7XJB2USB.js.map → chunk-LOLCTWJF.js.map} +0 -0
  553. /package/dist/chunks/{chunk-64O5L7EW.js.map → chunk-M6IRQ3QT.js.map} +0 -0
  554. /package/dist/chunks/{chunk-EPYLZWJV.js.map → chunk-OVBKQCYL.js.map} +0 -0
  555. /package/dist/chunks/{chunk-Z5Y65YBX.js.map → chunk-PYQM7KPL.js.map} +0 -0
  556. /package/dist/chunks/{chunk-DKVJREDI.js.map → chunk-QY7YK7M6.js.map} +0 -0
  557. /package/dist/chunks/{chunk-5ZJV4LAX.js.map → chunk-VPRJOD4Y.js.map} +0 -0
  558. /package/dist/chunks/{chunk-RG22JKIC.js.map → chunk-W7X4XEQU.js.map} +0 -0
  559. /package/dist/chunks/{chunk-LV4IT75S.js.map → chunk-WLLXKS6I.js.map} +0 -0
  560. /package/dist/chunks/{chunk-YVDBHS4C.js.map → chunk-WREA4RNR.js.map} +0 -0
  561. /package/dist/chunks/{chunk-NGGI6LDC.js.map → chunk-X2TRSE7D.js.map} +0 -0
  562. /package/dist/chunks/{chunk-A4VP7HDF.js.map → chunk-ZLNJDTCN.js.map} +0 -0
package/docs/providers.md CHANGED
@@ -51,6 +51,78 @@ async invoke(actionName, args, context) {
51
51
  }
52
52
  ```
53
53
 
54
+ ## Provider participants
55
+
56
+ A provider that starts its own long-running work, such as a delegate that launches runs on another system, can register each run as a participant. Inside `fabric_exec`, `context.participants` is present (it is absent in other host contexts such as speculation, so check it):
57
+
58
+ ```ts
59
+ async invoke(actionName, args, context) {
60
+ const run = await backend.start(args.task);
61
+ const participant = context.participants?.register({
62
+ id: run.id, // [A-Za-z0-9][A-Za-z0-9._:-]{0,63}, unique while unsettled
63
+ label: `Delegate ${run.id}`, // shown in the widget and dashboard
64
+ kind: "delegate",
65
+ detached: actionName === "spawn",
66
+ stop: async (reason) => ({ confirmed: await backend.cancel(run.id, reason) }),
67
+ steer: async (message) => backend.message(run.id, message),
68
+ });
69
+ run.on("progress", (event) => participant?.update({ phase: event.step, message: event.note, usage: event.usage }));
70
+ if (actionName === "spawn") return { ref: participant?.ref };
71
+ const result = await run.done();
72
+ participant?.settle({ status: result.ok ? "completed" : "failed", summary: result.summary });
73
+ participant?.dispose();
74
+ return result;
75
+ }
76
+ ```
77
+
78
+ `register` returns a handle whose `ref` is `provider:<provider>:<id>`. Fabric binds the provider name, so a provider cannot register or control another provider's refs. `update` replaces the shown phase, message (at most 500 characters), and cumulative `usage` totals. `settle` records the terminal status once and later calls are ignored. `dispose` removes the participant. Invalid specs or progress throw.
79
+
80
+ Registered participants appear in the participant directory with `kind: "provider"`, in `agents.members()`, and as agent rows in the activity widget and dashboard. `agents.stop`, `agents.steer`, and `agents.followUp` accept the ref, as do the dashboard and conversation controls. They call the provider's callbacks. A missing `steer` or `followUp` callback, or a `data` payload, fails with a clear error. `agents.stop` returns `{ ref, outcome: "confirmed" | "unconfirmed", detail? }`. With `mesh.enabled`, other sessions reach the participant through the owner's control plane.
81
+
82
+ Owned-work cancellation: when the `fabric_exec` program that registered a non-detached participant is cancelled or times out, Fabric calls `stop("program_cancelled")` on each of its unsettled participants in parallel, within one 5 second total bound. Each outcome is `confirmed` when the callback resolves `{ confirmed: true }`, otherwise `unconfirmed` with `detail` `declined`, `error`, or `timeout`. Fabric records the outcomes as [`fabric.participant.stop`](audit-trace.md#owned-work-stops) trace operations and in the tool result. A program that completes normally leaves its participants to the provider. Detached participants survive the invocation and stop only when asked. Fabric releases every participant of a provider, without calling `stop`, when that provider withdraws or the session shuts down; their handles then do nothing.
83
+
84
+ ## Withdrawing a direct registration
85
+
86
+ An extension withdraws a provider it registered directly by emitting `FABRIC_PROVIDER_WITHDRAW_EVENT` (`pi-fabric:provider:withdraw:v1`):
87
+
88
+ ```ts
89
+ import { FABRIC_PROVIDER_WITHDRAW_EVENT, type FabricProviderWithdrawalV1 } from "pi-fabric/protocol";
90
+
91
+ pi.events.emit(FABRIC_PROVIDER_WITHDRAW_EVENT, { name: "example" } satisfies FabricProviderWithdrawalV1);
92
+ ```
93
+
94
+ Fabric retires the current binding and drops its owner hold, the same path a component lease takes. It also releases the provider's [participants](#provider-participants), detached ones included. New calls to `example.*` are refused immediately. Work already admitted and committed capability views that pinned the old generation drain under the [retained-generation rules](provider-capabilities.md#capability-views). The extension owns the provider instance, so Fabric does not call `close()` on withdrawal. Fabric also forgets the registration and does not remount it on reload; an extension that answers `FABRIC_PROVIDER_DISCOVER_EVENT` must stop registering there too. Register again with `FABRIC_PROVIDER_REGISTER_EVENT` at any time.
95
+
96
+ Optional `generation` pins the withdrawal to one binding: a number matches the binding generation, a string matches the provider binding id (`providerBindingId` in a committed view). Unknown names, generation mismatches, component-owned providers, and managed-host providers are ignored; set `PI_FABRIC_DEBUG=1` to log ignored withdrawals. Component-owned providers withdraw through their component lifecycle.
97
+
98
+ ## Tool placement query
99
+
100
+ Extensions that need to know where a tool is reachable this turn can ask synchronously with `FABRIC_TOOL_PLACEMENT_EVENT` (`pi-fabric:tool-placement:v1`), so they need not guess from Fabric's mode:
101
+
102
+ ```ts
103
+ import {
104
+ FABRIC_TOOL_PLACEMENT_EVENT,
105
+ type FabricToolPlacementRequestV1,
106
+ type FabricToolPlacementResultV1,
107
+ } from "pi-fabric/protocol";
108
+
109
+ let placement: FabricToolPlacementResultV1 | undefined;
110
+ pi.events.emit(FABRIC_TOOL_PLACEMENT_EVENT, {
111
+ tools: ["my_tool", "read"],
112
+ reply: (result) => { placement = result; },
113
+ } satisfies FabricToolPlacementRequestV1);
114
+ // placement === undefined: Fabric is not loaded.
115
+ // placement.tools.my_tool: "model" | "program" | "unavailable"
116
+ ```
117
+
118
+ The reply is `{ version: 1, mode, tools }`. `mode` is `"full-code"`, `"enforce"` (Schema enforce), or `"orchestration"`. Each tool maps to:
119
+
120
+ - `model`: declared to the model this turn. Exclusive modes declare `fabric_exec` plus any resolved [foreground tools](configuration.md#foreground-tools) (full code mode only); orchestration declares Pi's active set.
121
+ - `program`: callable from a `fabric_exec` program, as `pi.<tool>` for Pi core tools or `extensions.<tool>` for captured extension tools. Requires an initialized Fabric runtime and respects child tool allowlists. Schema enforce exposes no `extensions.*` namespace.
122
+ - `unavailable`: neither.
123
+
124
+ `model` wins when both apply; optional `programCallable` lists the reported `model` tools that a program can also call, such as foreground tools, and is omitted when empty. Omitting `tools` reports every tool registered with Pi; at most 1,024 names of up to 256 characters each are accepted. An invalid query gets no reply. Placement describes state at the time of the query. A later mode change, reload, or tool refresh can change it, so query when you need the answer and do not cache it.
125
+
54
126
  ## Invocation costs and guarantees
55
127
 
56
128
  | Access pattern | Work and allocation | Guarantees |
@@ -72,6 +144,38 @@ the same normalized progress, entity, or metrics value is a UI no-op, not a hear
72
144
  durable event. Actual lifecycle completion and failure still travel through the normal
73
145
  invocation path. See [incremental activity reads](interface.md#incremental-activity-reads).
74
146
 
147
+ ## Workflow item events
148
+
149
+ Every `workflow.item` status transition emits `pi-fabric:workflow-item:v1` (`FABRIC_WORKFLOW_ITEM_EVENT`) on `pi.events`, so a host extension can track program work without parsing results:
150
+
151
+ ```ts
152
+ import { FABRIC_WORKFLOW_ITEM_EVENT, type FabricWorkflowItemEventV1 } from "pi-fabric/protocol";
153
+
154
+ pi.events.on(FABRIC_WORKFLOW_ITEM_EVENT, (event: FabricWorkflowItemEventV1) => {
155
+ // { version: 1, invocationId, sessionId?, itemId, label?, from?, to, at, meta? }
156
+ });
157
+ ```
158
+
159
+ `invocationId` is the owning `fabric_exec` tool call id. `itemId` is the caller's stable id or the deterministic per-invocation `item-<n>`. `from` is absent on an item's first status, and `meta` appears only when the transitioning call carried it. Updates that keep the same status emit nothing. When the program ends, items still `running` settle to `completed` or `failed` and emit that transition, matching the activity surface. Fabric emits synchronously from the host bridge and never waits on listeners. A throwing listener is logged and cannot fail the program. Transitions stay in the execution trace as before; `meta` never enters it.
160
+
161
+ ## Program run events
162
+
163
+ A host extension, daemon bridge, or embedder runs a [saved program](programs.md#host-runs) without a model turn by emitting `pi-fabric:program:run:v1` (`FABRIC_PROGRAM_RUN_EVENT`):
164
+
165
+ ```ts
166
+ import { FABRIC_PROGRAM_RUN_EVENT, type FabricProgramRunReplyV1 } from "pi-fabric/protocol";
167
+
168
+ pi.events.emit(FABRIC_PROGRAM_RUN_EVENT, {
169
+ ref: "changed-tests", // name, name@<digest prefix>, or digest
170
+ input: { base: "main" }, // optional, JSON, at most 64 KiB
171
+ requirePromoted: true, // optional
172
+ signal, // optional AbortSignal
173
+ reply: (result: FabricProgramRunReplyV1) => {},
174
+ });
175
+ ```
176
+
177
+ The run has the same semantics as `/fabric run`: the session's root capability view, the configured approval policy, a `pi-fabric-program-run` transcript message, and `invokedBy: "host"` in the trace. `reply` is called exactly once with `{ ok: true, program, value, logs }` or `{ ok: false, error, program? }`.
178
+
75
179
  ## Managed embedded hosts
76
180
 
77
181
  Trusted embedding code can opt into a closed-world provider authority:
@@ -105,6 +209,60 @@ The host remains responsible for OS isolation, resource loading, broker authoriz
105
209
  cancellation, and for exposing only trusted extension code. This option does not sandbox arbitrary
106
210
  host-side extensions. In particular, do not auto-load plugins from the agent's computer snapshot.
107
211
 
212
+ ## Principal and scope
213
+
214
+ A host can attach a principal and resource grants to a Fabric session. Fabric propagates them and narrows them for children. Providers and adapters enforce them. A program can never set or widen a principal.
215
+
216
+ ```ts
217
+ type FabricScope = {
218
+ version: 1;
219
+ principal: { id: string; issuer: "host" };
220
+ grants: { resource: string; actions: ("read" | "write" | "execute")[] }[];
221
+ digest: string; // sha256 hex of canonical JSON { grants, parentDigest?, principal }
222
+ parentDigest?: string; // set on derived scopes
223
+ };
224
+ ```
225
+
226
+ A resource is `<ns>:<path>`. The namespace matches `[a-z][a-z0-9._-]*`. The path is `/`-separated segments with an optional leading `/`. A final `/*` matches exactly one more segment, and a final `/**` matches one or more. `<ns>:*` matches everything in the namespace. Neither wildcard matches its own prefix, so `fs:/repo/**` does not cover `fs:/repo`. A scope holds at most 64 grants. Fabric merges grants per resource, sorts them, and orders actions as read, write, execute before hashing, so equal content always has the same digest. A supplied `digest` must match.
227
+
228
+ Issue the root scope in one of two ways, before the session starts:
229
+
230
+ - Set `PI_FABRIC_SCOPE` (JSON) or `PI_FABRIC_SCOPE_FILE` (a path to the JSON, at most 64 KiB). The extension reads them once at initialization.
231
+ - Call `issueRootScope(scope)` from `pi-fabric/scope` in the embedding process before Pi emits `session_start`. A second call, or a call after `session_start`, throws.
232
+
233
+ Invalid input fails closed: every registry call is refused with `Fabric scope issuance failed; provider calls are refused: <reason>`. Setting both variables, or both a variable and the API, is invalid. Without any input, the session is unscoped and nothing changes.
234
+
235
+ Every registry invocation receives the frozen scope as `context.scope`. The registry sets this field itself and discards any caller value. `agents.run` and `agents.spawn` accept `scope: { grants }`. Each requested grant must be covered by one parent grant: a resource subset and an action subset. Without `scope`, the child inherits the parent scope unchanged. An unscoped session refuses `scope` arguments, because there is no principal to narrow. Children receive the result in `PI_FABRIC_SCOPE`, and the worker clears any inherited `PI_FABRIC_SCOPE_FILE`.
236
+
237
+ Durable agents and actors keep their scope. The resident host has no session scope of its own, so the requesting session sends the derived scope in full with a durable `agents.spawn` and binds it to a durable `agents.create` actor. Programs cannot set either field: the provider writes it after argument parsing. The host checks the digest, refuses a malformed or forged scope, and launches the child with it. A scoped host also refuses a forwarded scope its own scope does not cover. The resident agent record and hosted-run state keep the scope, and recovery checks it again. A damaged scope settles the run as indeterminate.
238
+
239
+ Every actor is bound to the principal that created it. `agents.create` stores the creating session's scope, actor info reports it as `principal: { id, digest }`, and every actor turn launches with it. Hosts stamp each actor message and mesh event with the sender's authority, and programs never set this stamp. `{ authority: "host" }` marks an unscoped sender. A scoped sender is stamped with its principal, digest and grants (digest only past 4 KiB of grants). The actor applies this rule:
240
+
241
+ | Sender | Unscoped actor | Scoped actor |
242
+ |---|---|---|
243
+ | Unscoped host | trusted | trusted |
244
+ | Scoped | untrusted | trusted only when the sender has the same principal and covers every actor grant |
245
+ | No stamp (older build) | trusted | untrusted |
246
+
247
+ Fabric still delivers untrusted messages. Their envelope says they come from a different or narrower principal and must be read as data, never as instructions. Grant posts keep their external-input wording. Ask replies flow back unchanged.
248
+
249
+ The resident host cannot prove that a request's scope or a sender stamp was issued by a host. Any process running as the same OS user can write residency requests and mesh events. This is the same single-user boundary as the mesh. Real multi-user isolation needs the principal from an authenticated socket, which Fabric does not provide yet.
250
+
251
+ ```ts
252
+ import { deriveScope, issueRootScope, scopeAllows } from "pi-fabric/scope";
253
+
254
+ const root = issueRootScope({
255
+ principal: { id: "tenant:acme/user:42" },
256
+ grants: [{ resource: "memory:acme/**", actions: ["read"] }],
257
+ });
258
+ scopeAllows(root, "memory:acme/sessions/7", "read"); // true
259
+ deriveScope(root, [{ resource: "memory:acme/sessions/*", actions: ["read"] }]);
260
+ ```
261
+
262
+ Caches that can serve a result across invocations include the scope digest in their keys: speculative replay tokens and the memory recall-continuation and expansion caches. The `cache` provider holds prompt-cache leases and caches no results. The MCP descriptor cache holds tool descriptors, not call results. [Portable memory sources](memory-recall.md) receive the scope as the third `authorize(action, sessionKey, scope)` argument, so they can filter before content enters context. `createMemorySourceClient` calls accept `{ scope }`.
263
+
264
+ This layer is trusted host adapter code, not a verified kernel. Fabric guarantees issuance, propagation, narrowing and cache isolation. It does not map grants onto individual actions: a provider that ignores `context.scope` keeps its native authority. Claude and Veda children receive the variable without a Fabric registry to read it. See [provider capabilities](provider-capabilities.md#future-verified-extension).
265
+
108
266
  ## Effect semantics and scoped acquisition
109
267
 
110
268
  Action descriptors can declare effect semantics. Descriptor hashes and committed component and actor views carry this metadata. Omitting it is the conservative choice. Read-risk actions then resolve as commutative `none`, and every other risk resolves as unknown-order `emission`.
@@ -43,6 +43,16 @@ stdin EOF. `pi-entry.js` starts `ResidentHost` on `session_start`, aborts it on
43
43
  The residency protocol is unchanged: `config.json`, `owner.json`, request,
44
44
  response, and mesh files remain the durable interface.
45
45
 
46
+ Scope travels with each request. The host has no session scope of its own, so
47
+ a scoped session puts the full derived scope in a durable spawn
48
+ (`inheritedScope`) or actor create (`principalScope`). The host checks the
49
+ digest and refuses a malformed scope. It records the scope in the agent's
50
+ `agents/<id>.json` and in the actor registry, and launches every child and
51
+ actor turn with it. Hosted-run recovery checks the persisted scope again.
52
+ Requests are files writable by the same OS user, so this keeps the
53
+ single-user boundary of the mesh; see
54
+ [principal and scope](providers.md#principal-and-scope).
55
+
46
56
  ## Context and lifecycle
47
57
 
48
58
  Residency does not share agent contexts. Each actor or agent retains its own
@@ -53,6 +63,60 @@ and reconnection.
53
63
  The host exits after its normal idle grace once it owns no live durable actor or
54
64
  running durable agent.
55
65
 
66
+ [Scheduled mesh events](agents.md#scheduled-events) add one rule, computed by the
67
+ pure `residentIdleDecision`: pending schedules on any topic keep the host alive
68
+ while it owns at least one durable participant, and every idle check re-arms a
69
+ wake timer to the earliest due time. At that time the host releases due schedules
70
+ under the mesh lock, and its actor monitor delivers them. Pending schedules alone,
71
+ with no durable participant, do not keep the host running; Fabric adds no system
72
+ daemon, so such a schedule is released the next time any Fabric process touches
73
+ the mesh root.
74
+
75
+ ### Stale commands after restart
76
+
77
+ A restarted host keeps its `residentHostId(rootId)` and replays the control log
78
+ from offset 0, so a stop or ask meant for the previous process could otherwise
79
+ reach a durable actor's next turn. Each host process publishes its participant
80
+ records with a fresh `ownerIncarnation`, and requesters stamp that value on each
81
+ command. The new host refuses an unclaimed command for an earlier incarnation
82
+ with an immediate rejection and does not execute it; the caller re-resolves the
83
+ participant and decides whether to resend. See
84
+ [stale commands after restart](agents.md#stale-commands-after-restart).
85
+
86
+ ## Containers and PID namespaces
87
+
88
+ `kill(pid, 0)` only answers within the caller's PID namespace and boot. In a
89
+ container, the same number can name an unrelated process or nothing, and after
90
+ PID reuse it names a stranger. Fabric owners therefore record an identity:
91
+ `hostname`, the Linux PID namespace (`/proc/self/ns/pid`), the boot id, and the
92
+ process start time. The owner-liveness section of `src/core/atomic-write.ts`
93
+ judges an owner as follows:
94
+
95
+ - Same host, namespace and boot: the signal probe decides (`ESRCH` dead,
96
+ `EPERM` alive). On Linux, a different `/proc/<pid>/stat` start time for the
97
+ same PID means reuse, so the owner is dead.
98
+ - Another namespace, host or boot: only a heartbeat decides. A fresh heartbeat
99
+ is alive, a stale one is dead, and none is `unknown`. On the same host, a
100
+ different boot id with no heartbeat is dead, since no process outlives its
101
+ boot.
102
+ - Records without identity fields keep the earlier signal-probe behaviour.
103
+
104
+ `unknown` is never treated as death. A lock whose owner might be alive is not
105
+ stolen.
106
+
107
+ The resident host is a long-lived owner. Its start lock and `owner.json` carry
108
+ additive `identity` and `heartbeatAt` fields, and the format stays `1`. The
109
+ heartbeat refreshes every 10 s, and a heartbeat older than 45 s is stale. The
110
+ Schema commit lock heartbeats the same way while a transaction runs. Short
111
+ mesh, actor-store and file locks carry an identity line only. Across
112
+ namespaces, their creation time serves as the heartbeat, with a 10-minute hold
113
+ ceiling (or the lock's stale window, if longer). Scratch markers record
114
+ identity and no heartbeat, so the sweeper leaves a foreign owner's scratch
115
+ alone.
116
+
117
+ Hosts and containers that share `.pi/fabric` need clocks that agree within the
118
+ heartbeat TTL.
119
+
56
120
  ## Validation
57
121
 
58
122
  Run:
@@ -36,12 +36,14 @@ Under enforce mode, discovery and workflow display operations still work, along
36
36
  - `pi.read`, `pi.grep`, `pi.find`, `pi.ls`;
37
37
  - `memory.recall`, `memory.expand`, `memory.sessions`;
38
38
  - `state.get`, `state.history`, `state.complexity`;
39
- - `mesh.self`, `mesh.read`, `mesh.members`, `mesh.get`, `mesh.list`;
40
- - `compact.status`;
39
+ - `mesh.self`, `mesh.read`, `mesh.members`, `mesh.get`, `mesh.list`, `mesh.scheduled`, `mesh.grants`;
40
+ - `decisions.list`;
41
+ - `programs.list`, `programs.get`;
42
+ - `compact.status`, `thinking.status`;
41
43
  - `components.list`, `components.status`, `components.graph`;
42
44
  - `schema.status`, `schema.hypothesize`, `schema.verify`, `schema.commit`, `schema.abort`.
43
45
 
44
- The gate blocks `pi.edit`, `pi.write`, `pi.bash`, `pi.powershell`, all agent/actor actions, mesh and state writes or execution, `compact.request`, `compact.cancel`, `components.reload`, MCP, captured extensions, and every external provider, whatever risk it declares. Enforce sessions keep declarative component entries in configuration without activating them, and registered definitions stay visible to diagnostics. A provider that claims `risk: "read"` still fails this exact-reference policy. Fabric records guard failures in the existing typed execution trace with `failureStage: "guard"`.
46
+ The gate blocks `pi.edit`, `pi.write`, `pi.bash`, `pi.powershell`, all agent/actor actions, mesh and state writes or execution, `compact.request`, `compact.cancel`, `thinking.set`, `thinking.reset`, `decisions.raise`, `decisions.wait`, `decisions.answer`, `decisions.escalate`, `decisions.cancel`, `programs.save`, `programs.run`, `components.reload`, MCP, captured extensions, and every external provider, whatever risk it declares. Enforce sessions keep declarative component entries in configuration without activating them, and registered definitions stay visible to diagnostics. A provider that claims `risk: "read"` still fails this exact-reference policy. Fabric records guard failures in the existing typed execution trace with `failureStage: "guard"`.
45
47
 
46
48
  An enforce session never restores persistent actors, and host-event actor dispatch stays off. Fabric disables agent execution, so the gate also blocks agent actions. Capture `keepVisible`, descriptor risk, claimed source metadata, or tool visibility cannot authorize a second top-level path. Fabric blocks a colliding external or SDK tool named `fabric_exec` unless Pi's canonical `sourceInfo.path` identifies this extension's entry exactly.
47
49
 
@@ -1,7 +1,7 @@
1
1
  # Shell composition
2
2
 
3
3
  Fabric's shell surfaces follow jev-fabric's
4
- [composition contract](https://github.com/monotykamary/jev-fabric/blob/main/docs/composition.md):
4
+ [composition contract](https://github.com/fabric-runtime/jev-fabric/blob/main/docs/composition.md):
5
5
  two axes, one set of verbs, the same records. An agent that knows `jev-fabric
6
6
  -- start` / `follow` / `read` already knows `pi.bash({durable:true})` /
7
7
  `tasks.read` / `sessions.read`, and a command can move between Fabric and a
@@ -11,7 +11,7 @@ standalone jev-fabric without being rewritten.
11
11
 
12
12
  | Lifetime | Owner | Batch (no stdin) | Interactive (stdin open) |
13
13
  | --- | --- | --- | --- |
14
- | `foreground` | the calling `fabric_exec` | `pi.bash({cmd})` | — |
14
+ | `foreground` | the calling `fabric_exec` | `pi.bash({cmd})` | unsupported |
15
15
  | `session` | this Pi session, or the Jev program that opened it | `pi.bash({cmd, background:true})` | `sessions.open({argv \| cmd})` |
16
16
  | `durable` | the jev-fabric store; outlives Pi | `pi.bash({cmd, durable:true})` | `sessions.open({…, durable:true})` |
17
17
 
@@ -21,9 +21,9 @@ standalone jev-fabric without being rewritten.
21
21
  - **Durable** and **interactive** children are owned by jev-fabric (macOS and
22
22
  Linux). Durable batch tasks still run through `pi.bash` and its middleware;
23
23
  interactive children run outside `pi.bash`, so they are unavailable while an
24
- extension overrides `bash`, rather than bypassing its gate.
25
- - A Jev program's interactive `session` children end with the program, however
26
- it ends. `fabric_exec` children stay with the Pi session, like background tasks.
24
+ extension overrides `bash`. This preserves the extension's gate.
25
+ - A Jev program's interactive `session` children end whenever the program ends.
26
+ `fabric_exec` children stay with the Pi session, like background tasks.
27
27
 
28
28
  ## One set of verbs
29
29
 
@@ -34,7 +34,7 @@ standalone jev-fabric without being rewritten.
34
34
  | bytes by offset | `tasks.read` (combined `output`) | `sessions.read` (`stdout`/`stderr`) | `read` |
35
35
  | literal line filter | `tasks.watch({match})` | read + filter in code | `watch <id> <literal>` |
36
36
  | retained events | monitor replay (`tasks.watch`, no match) | `sessions.events` | `events` / `follow` |
37
- | input | — | `sessions.write`, `sessions.closeInput` | `write`, `closeInput` |
37
+ | input | not applicable | `sessions.write`, `sessions.closeInput` | `write`, `closeInput` |
38
38
  | stop by ID | `tasks.stop` | `sessions.stop` | `stop` |
39
39
  | discovery | `tasks.list`, `tasks.external`, `tasks.adopt` | `sessions.list` | `list` |
40
40
 
package/docs/skills.md CHANGED
@@ -8,7 +8,7 @@ Pi Fabric uses a core-first, user-opt-in skill hierarchy.
8
8
  - The user invokes every advanced workflow. Each one declares `disable-model-invocation: true` and stays out of the model catalog. Agent policy forbids reading one autonomously or delegating from one user-only skill to another. The policy governs agent behavior. It is not a filesystem authorization boundary.
9
9
  - `/skill:fabric-guide` is the user-only router. It names one exact advanced command and stops there. The router never invokes the recommendation.
10
10
  - Each user-facing description summarizes its command. Only the selected execution reference spends always-on model context.
11
- - Both `skillsets/typescript/` and `skillsets/python/` contain the same fourteen canonical skill names, each with its own reference files. Fabric contributes only the selected tree through Pi resource discovery. Changing the kernel reloads Pi resources; see [kernel-specific skills](kernels.md#kernel-specific-skills-and-guidance). Third-party skills remain under Pi's normal discovery rules.
11
+ - Both `skillsets/typescript/` and `skillsets/python/` contain the same fifteen canonical skill names, each with its own reference files. Fabric contributes only the selected tree through Pi resource discovery. Changing the kernel reloads Pi resources; see [kernel-specific skills](kernels.md#kernel-specific-skills-and-guidance). Third-party skills remain under Pi's normal discovery rules.
12
12
 
13
13
  The parent agent behaves like regular Pi until the user explicitly opts into orchestration, recursion, Schema, Jev programs, ambient actors, or swarm coordination.
14
14
 
@@ -49,3 +49,4 @@ A mandatory pointer serves legibility and single-source maintenance. Per-run tok
49
49
  - `/skill:fabric-spec`: supervise spec compliance persistently.
50
50
  - `/skill:fabric-ambient`: route directly to an advisor or supervisor profile.
51
51
  - `/skill:fabric-swarm`: coordinate durable actors.
52
+ - `/skill:fabric-graph`: run a step graph as plain program code, or as a resumable durable actor with mesh checkpoints, scheduled wakes, and decision nodes; see [saved programs](programs.md).
@@ -74,7 +74,8 @@ ActionRegistry.invoke() serve-or-reexecute at the real call site
74
74
  refs that are `risk: "read"` with `effect.kind: "none"`, never prompt for
75
75
  approval, and cost nothing when wasted (`pi.read`/`grep`/`find`/`ls`,
76
76
  `memory.recall`/`expand`/`sessions`, `state.get`/`history`/`complexity`,
77
- `schema.status`, `compact.status`, `components.list`/`status`/`graph`).
77
+ `schema.status`, `compact.status`, `thinking.status`, `decisions.list`,
78
+ `programs.list`/`get`, `components.list`/`status`/`graph`).
78
79
  The gate re-runs against the resolved descriptor at launch, so a provider
79
80
  or config change that reclassifies a ref closes speculation off.
80
81
  2. **Freshness, not staleness.** A stored promise is served only when both
@@ -42,8 +42,8 @@ The append-only JSONL event log holds:
42
42
  - **`transition`**: a versioned proposal with `data: { protocolVersion: 1, phase: "proposed", label, from?, to, summary, evidence?, tags?, kind?, complexity?, certificationStatus?, ts }`.
43
43
  - **`transition.committed`**: makes its referenced proposal visible after all ledger and head CAS writes succeed.
44
44
  - **`transition.rejected`**: records a failed proposal and its rollback or quarantine status. A proposal never becomes visible merely because this marker exists.
45
- - **`state.certified`**: emitted only after a successful verification. Its data holds bounded `targets`, the verification-time `head`, `evidenceDigest`, `resultDigest`, `certificationStatus: "certified"`, and `ts`.
46
- - **`state.violated`**: best-effort reporting for fail-closed verification. Its data holds bounded non-confirmed `results`, blocking `reasons`, selected `targets`, the verification-time `head`, and both digests.
45
+ - **`state.certified`**: emitted only after a successful verification. Its data holds bounded `targets`, the verification-time `head`, `evidenceDigest`, `resultDigest`, `certificationStatus: "certified"`, the [bound certificate](#bound-certificates) fields (`binding?`, `observed?`, `issuer`, `requestedBy`, `schemaMode?`), and `ts`.
46
+ - **`state.violated`**: best-effort reporting for fail-closed verification. Its data holds bounded non-confirmed `results`, blocking `reasons`, selected `targets`, the verification-time `head`, both digests, and the same bound certificate fields.
47
47
  - **`state.goal.met`**: emitted when the executable goal predicate passes.
48
48
 
49
49
  A certificate target carries the transition's stable `transitionId`, `label`, and `to`. When verification has a head, the certificate also records that head's `transitionId`, label, destination, and CAS `version`. The fold applies certification and violation events in sequence for each target. A transition receives a certified overlay only when its latest durable verification outcome is `state.certified`. A later `state.violated` removes that overlay. Certificate currentness also requires the full recorded head identity to equal the committed current head: transition ID, label, destination, and CAS version.
@@ -143,7 +143,7 @@ By default the fold finds the last representation transition and drops earlier t
143
143
 
144
144
  ### `state.verify`: risk `execute`
145
145
 
146
- `{ labels?, includeArchived?, timeoutMs? }` selects the current head when you omit `labels`. With labels supplied, it selects the active transitions that match. Archived transitions stay out unless you set `includeArchived: true`.
146
+ `{ labels?, includeArchived?, timeoutMs?, binding? }` selects the current head when you omit `labels`. With labels supplied, it selects the active transitions that match. Archived transitions stay out unless you set `includeArchived: true`.
147
147
 
148
148
  Commands run sequentially with a per-command timeout of 30 seconds by default. The layer streams combined stdout and stderr. It does not accumulate output without limit. Each report keeps at most a 32 KiB UTF-8 prefix per command, plus `outputBytes`, `outputOmittedBytes`, and a digest of the complete byte stream. Results also apply byte bounds to claims, commands, and errors, and each carries digest and omission metadata. Verification events use smaller bounded prefixes, bounded result and reason arrays, and target chunks, so each payload stays comfortably below the default 256 KiB mesh limit. Each result includes `{ claim, command, status, exitCode, output, outputBytes, outputOmittedBytes, outputDigest, error? }`. The `status` field is one of:
149
149
 
@@ -151,7 +151,7 @@ Commands run sequentially with a per-command timeout of 30 seconds by default. T
151
151
  - `violated` on a non-zero exit;
152
152
  - `error` on spawn failure, timeout, or cancellation.
153
153
 
154
- The report adds `{ certified, violated, certificationStatus, evidenceDigest, resultDigest, failures, certificate? }`. The `certified` flag is true if and only if at least one evidence command ran and every result was confirmed. Any other outcome blocks certification and publishes `state.violated`. A successful run publishes `state.certified` and returns its certificate. When the selected targets include the unchanged current head, the layer then CAS-persists that certificate in `state/current` with a binding to the resulting head version. After a failed run that targets the unchanged current head, it CAS-revokes any stored certificate once violation publication succeeds.
154
+ The report adds `{ certified, violated, certificationStatus, evidenceDigest, resultDigest, failures, certificate?, binding?, observed?, requestedBy }`. See [Bound certificates](#bound-certificates) for `binding`. The `certified` flag is true if and only if at least one evidence command ran and every result was confirmed. Any other outcome blocks certification and publishes `state.violated`. A successful run publishes `state.certified` and returns its certificate. When the selected targets include the unchanged current head, the layer then CAS-persists that certificate in `state/current` with a binding to the resulting head version. After a failed run that targets the unchanged current head, it CAS-revokes any stored certificate once violation publication succeeds.
155
155
 
156
156
  An explicitly empty `labels` array selects nothing and fails closed. A request for an archived, proposed, rejected, or otherwise uncommitted label also fails closed as a missing active target when no committed match is visible.
157
157
 
@@ -165,6 +165,28 @@ On POSIX, each command shell leads a detached process group. A timeout or abort
165
165
 
166
166
  `{ timeoutMs? }` runs the goal predicate and reports `{ passed, output, exitCode, error? }`. The same 32 KiB cap bounds the command output. A passing `state.goal.met` event stores a smaller bounded prefix along with the full-stream digest and omission metadata. Goal checks stay separate from state certification.
167
167
 
168
+ ## Bound certificates
169
+
170
+ A certificate says which evidence passed. A verifier that consumes it, such as a pi-work style gate, usually also needs to know *what* that evidence ran against and *who* issued it. `state.verify` accepts an optional `binding`, and every new certificate carries host-recorded provenance:
171
+
172
+ | Field | Source | Meaning |
173
+ | --- | --- | --- |
174
+ | `binding` | Caller | Up to 16 string claims. Keys match `[a-z][a-zA-Z0-9_.-]{0,63}`, values hold at most 512 characters, and keys are stored sorted. Well-known keys: `commit`, `specDigest`, `nodeAddress`, `criteriaDigest`. |
175
+ | `observed` | Host | `{ commit?, dirty? }` from `git rev-parse --verify HEAD` and `git status --porcelain` in the verification cwd, taken before any evidence runs. Fabric omits it outside a git work tree or before the first commit, and omits only `dirty` when the status probe fails. Probes are time-bounded, output-bounded, and run with `GIT_OPTIONAL_LOCKS=0`. |
176
+ | `issuer` | Host | Always `"host"`: the Fabric host ran the evidence and wrote the certificate. |
177
+ | `requestedBy` | Host | `"program"` when the call came through the `state` provider action surface (a `fabric_exec` program or any other registry caller); `"host"` when host code calls `StateStore.verify` directly. |
178
+ | `schemaMode` | Host | The configured Schema mode (`off`, `audit`, or `enforce`) at verification time, when known. |
179
+
180
+ Only `binding.commit` is checked. The host compares it, case-insensitively, with the full observed HEAD object name. A different HEAD fails closed with reason `binding-mismatch`. A cwd with no observable HEAD fails closed with reason `binding-unobserved`. In both cases no evidence runs, `state.violated` is published, and a current certificate for the targeted head is revoked as for any other failed verification. Other binding keys are recorded caller claims. Fabric validates their shape but not their meaning. A consumer that requires them must compare them with its own expected values. A malformed `binding` is a usage error: the call throws before any probe, evidence, or event.
181
+
182
+ These fields appear wherever the certificate does: the `state.certified` event, the durable certificate in `state/current`, `state.get()` (`head.certificate` and `certification.current/recent`), `state.history()`, and the `state.verify` report. All fields are optional on read. Certificates written before this change still fold, and malformed stored values fold as absent while the certificate itself stays valid.
183
+
184
+ A strict verifier can therefore require, for example, `issuer === "host"`, `requestedBy === "program"`, `observed.commit === expectedCommit`, `observed.dirty === false`, and `binding.specDigest === expectedSpecDigest`. Like the rest of the state layer, these are records in project mesh storage. They are as trustworthy as write access to that storage and not cryptographically signed.
185
+
186
+ ### Relation to the verified state kernel
187
+
188
+ The bound fields live entirely in the JavaScript host payload. They are not inputs to the generated `headReadable` kernel that decides head visibility, and they do not touch the Schema controller's `assertCertificateFacts`/`consume` transaction-certificate kernels. Certificate currentness still depends only on the recorded head identity. The commit check is a host-side precondition, and it can only add a blocking failure: it can turn a would-be certification into a violation but never the reverse. No `.bend` law, proof, or generated module changed.
189
+
168
190
  ## Complexity rule
169
191
 
170
192
  The built-in complexity implementation handles `.ts`, `.js`, `.tsx`, and `.jsx`. It lexes tokens with no AST dependency and counts statement decision keywords:
@@ -0,0 +1,48 @@
1
+ # Thinking control
2
+
3
+ `thinking.*` lets a program change the host Pi session's reasoning effort for a bounded scope. It is the adaptive-thinking primitive: a program can raise effort for a hard step and drop back to the baseline afterwards. Fabric applies every change through Pi's own `setThinkingLevel`, so Pi persists the level and clamps it to the active model as usual.
4
+
5
+ ## Guest API
6
+
7
+ ```ts
8
+ const before = await thinking.status();
9
+ // { level, available, bounds: { min, max }, baseline, override? }
10
+
11
+ await thinking.set({ level: "high", reason: "proof step" }); // this agent run
12
+ await thinking.set({ level: "low", scope: "turns", turns: 3 }); // the next 3 agent_end events
13
+ await thinking.set({ level: "xhigh", scope: "session" }); // until reset
14
+ await thinking.reset(); // back to the baseline
15
+ ```
16
+
17
+ Python uses the same calls, for example `await thinking.set(level="high", scope="turn")`.
18
+
19
+ | Action | Risk | Result |
20
+ | --- | --- | --- |
21
+ | `thinking.status()` | read, no effect, speculation-eligible | `{level, available, bounds:{min,max}, baseline, override?:{level, scope, remainingTurns?, reason?, setAt}}` |
22
+ | `thinking.set({level, scope?, turns?, reason?})` | write | status plus `clamped: true` and `requested` when the applied level differs from the request |
23
+ | `thinking.reset()` | write | status after restoring the baseline |
24
+
25
+ - `available` lists the active model's supported levels inside the effective bounds. Without a model, every level is listed, matching Pi.
26
+ - `bounds` resolves unbounded ends to the model's lowest and highest supported levels.
27
+ - `baseline` is the level that was active when the first override began. A second `set` keeps that baseline.
28
+ - `scope: "turn"` (the default) reverts at the next `agent_end`. A `set` inside the running program therefore lasts for the rest of the current agent run. `scope: "turns"` requires `turns` (1 to 20) and counts `agent_end` events, including the current run. `scope: "session"` lasts until `thinking.reset()`. `turns` with any other scope is rejected.
29
+ - `reason` is optional, at most 256 characters, and appears in status.
30
+ - A requested level is first clamped into `thinking.bounds`, then to the nearest level the model supports inside those bounds (next higher first, then lower, as in pi-ai). When no supported level lies inside the bounds, `set` fails and changes nothing.
31
+
32
+ `set` and `reset` are control-plane writes. They follow `approvals.write` like `compact.request`, and Schema enforce mode blocks them while still allowing `thinking.status`. Managed hosts do not expose `thinking.*`.
33
+
34
+ ## Persistence and ownership
35
+
36
+ Every override change appends a `pi-fabric-thinking` custom session entry `{version: 1, override}`. After a reload or restart, Fabric replays the latest entry on the active branch, so a pending revert still happens at the next `agent_end`. Tree navigation replays the entry on the new branch. A malformed latest entry ends the override and never revives an older one.
37
+
38
+ The `agent_end` revert runs even before the Fabric runtime activates. If the user or another extension changes the level while an override is active, Fabric ends the override without restoring the baseline. It never fights another owner for the setting.
39
+
40
+ ## Bounds
41
+
42
+ `thinking.bounds` (`{min?, max?}`, default unbounded) caps every level Fabric selects: `thinking.set`, child runs, and inherited child sessions. Level names are validated, and an inverted or malformed value fails configuration loading. See [configuration](configuration.md#thinking-bounds).
43
+
44
+ ## Child runs
45
+
46
+ `agents.run` and `agents.spawn` accept `thinkingBounds: {min?, max?}`. Explicit ends must lie inside the caller's effective bounds, and omitted ends inherit them. A wider request fails before launch. Each run's `thinking` level (explicit, alias, or `agents.thinking`) is clamped into the child's bounds. A clamped run reports the original level as `requestedThinking` on its handle and record. Without configured bounds, child runs keep the existing behavior.
47
+
48
+ Fabric passes the child's effective bounds to the worker, which exports them to the child process as `PI_FABRIC_THINKING_BOUNDS` (JSON `{min?, max?}`). A child Fabric intersects its own `thinking.bounds` with that value and never widens it: when the two ranges do not overlap, the parent range applies. At session start, the child moves a level outside its bounds back inside them, which covers a model clamp that would overshoot the parent's maximum. A malformed inherited value fails the child's configuration load. Durable `agents.spawn` sends the narrowed bounds with the request, so the resident host enforces the caller's bounds.
@@ -204,7 +204,7 @@ author-defined observational equivalence are not claimed as Bend theorems.
204
204
 
205
205
  ## Reproducible bridge
206
206
 
207
- The contributor toolchain pins **Bend 2.0.34**. Installed Fabric needs neither
207
+ The contributor toolchain pins **Bend 2.0.35**. Installed Fabric needs neither
208
208
  Bend nor a Bend loader. Linux CI downloads that exact release archive and checks
209
209
  its SHA-256 before running proofs. Windows tests execute the checked-in generated
210
210
  JS and ABI; native Bend currently requires Linux, macOS, or WSL.
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@e4779/pi-fabric",
3
- "version": "0.102.0-fork.16",
3
+ "version": "0.105.0-fork.22",
4
4
  "description": "A programmable tool and agent runtime for Pi",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
+ "bin": {
8
+ "pi-fabric": "./dist/cli/index.js"
9
+ },
7
10
  "types": "./dist/index.d.ts",
8
11
  "exports": {
9
12
  ".": {
@@ -18,10 +21,22 @@
18
21
  "types": "./dist/agents.d.ts",
19
22
  "import": "./dist/agents.js"
20
23
  },
24
+ "./runners": {
25
+ "types": "./dist/runners.d.ts",
26
+ "import": "./dist/runners.js"
27
+ },
28
+ "./durable": {
29
+ "types": "./dist/durable.d.ts",
30
+ "import": "./dist/durable.js"
31
+ },
21
32
  "./mcp": {
22
33
  "types": "./dist/mcp.d.ts",
23
34
  "import": "./dist/mcp.js"
24
35
  },
36
+ "./assessment": {
37
+ "types": "./dist/assessment.d.ts",
38
+ "import": "./dist/assessment.js"
39
+ },
25
40
  "./jev": {
26
41
  "types": "./dist/jev.d.ts",
27
42
  "import": "./dist/jev.js"
@@ -29,6 +44,10 @@
29
44
  "./memory": {
30
45
  "types": "./dist/memory.d.ts",
31
46
  "import": "./dist/memory.js"
47
+ },
48
+ "./scope": {
49
+ "types": "./dist/scope.d.ts",
50
+ "import": "./dist/scope.js"
32
51
  }
33
52
  },
34
53
  "files": [
@@ -51,12 +70,12 @@
51
70
  "proof:dist": "node scripts/smoke-verified-kernels.mjs",
52
71
  "build": "bun run proof:artifact && node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json --emitDeclarationOnly && node scripts/build.mjs && bun run assert:build-artifacts",
53
72
  "typecheck": "tsc --noEmit",
54
- "test:pi99": "bun run build && vitest run tests/pi99-sdk.test.ts",
73
+ "test:pi1": "bun run build && vitest run tests/pi1-sdk.test.ts tests/pi1-public-contract.test.ts",
55
74
  "test:jev:live": "PI_FABRIC_JEV_LIVE=1 vitest run tests/jev-live.test.ts",
56
75
  "test:jev:dist": "node scripts/smoke-jev.mjs",
57
76
  "test:changed": "node scripts/test-affected.mjs",
58
77
  "test:affected": "node scripts/test-affected.mjs --base $PI_TEST_BASE",
59
- "test:smoke": "vitest run tests/optional-preview-startup.test.ts tests/script-runtime.test.ts tests/pi-binary.test.ts tests/host-compatibility.test.ts tests/output-budget.test.ts tests/actor-mesh-monitor.test.ts tests/handoff.test.ts tests/config-migrations.test.ts tests/monty-payload-preflight.test.ts tests/bundled-binary-spawn.test.ts tests/conversation-native-reader-suspension.test.ts",
78
+ "test:smoke": "vitest run tests/optional-preview-startup.test.ts tests/script-runtime.test.ts tests/pi-binary.test.ts tests/host-compatibility.test.ts tests/output-budget.test.ts tests/actor-mesh-monitor.test.ts tests/handoff.test.ts tests/config-migrations.test.ts tests/monty-payload-preflight.test.ts tests/bundled-binary-spawn.test.ts tests/worker-installation.test.ts tests/conversation-native-reader-suspension.test.ts",
60
79
  "test:related": "vitest related --run",
61
80
  "check:fast": "bun run typecheck && bun run test:changed",
62
81
  "certify:context": "bun run build && node scripts/certify-context.mjs",
@@ -65,6 +84,7 @@
65
84
  "benchmark:memory-heads": "bun run build && node scripts/benchmark-memory-heads.mjs",
66
85
  "benchmark:memory-recall": "bun run build && node scripts/benchmark-memory-recall.mjs",
67
86
  "benchmark:conversation": "bun run build && node --expose-gc scripts/benchmark-conversation.mjs",
87
+ "benchmark:kitty": "bun scripts/benchmark-kitty.mjs",
68
88
  "benchmark:provider-dispatch": "node scripts/benchmark-provider-dispatch.mjs",
69
89
  "benchmark:activity": "node --expose-gc scripts/benchmark-activity.mjs",
70
90
  "benchmark:turn-cpu": "node scripts/benchmark-turn-cpu.mjs",
@@ -89,24 +109,28 @@
89
109
  "orchestration"
90
110
  ],
91
111
  "license": "MIT",
112
+ "funding": {
113
+ "type": "opencollective",
114
+ "url": "https://opencollective.com/pi-fabric"
115
+ },
92
116
  "author": "monotykamary",
93
117
  "repository": {
94
118
  "type": "git",
95
- "url": "git+https://github.com/monotykamary/pi-fabric.git"
119
+ "url": "git+https://github.com/fabric-runtime/pi-fabric.git"
96
120
  },
97
- "homepage": "https://github.com/monotykamary/pi-fabric#readme",
121
+ "homepage": "https://github.com/fabric-runtime/pi-fabric#readme",
98
122
  "bugs": {
99
- "url": "https://github.com/monotykamary/pi-fabric/issues"
123
+ "url": "https://github.com/fabric-runtime/pi-fabric/issues"
100
124
  },
101
125
  "engines": {
102
126
  "node": ">=24"
103
127
  },
104
128
  "pi": {
105
129
  "extensions": [
106
- "./dist/index.js"
130
+ "./dist/extension-bootstrap.js"
107
131
  ],
108
132
  "skills": [],
109
- "image": "https://raw.githubusercontent.com/monotykamary/pi-fabric/main/media/banner.svg"
133
+ "image": "https://raw.githubusercontent.com/fabric-runtime/pi-fabric/main/media/banner.svg"
110
134
  },
111
135
  "dependencies": {
112
136
  "@jitl/quickjs-singlefile-mjs-release-sync": "^0.32.0",
@@ -124,17 +148,29 @@
124
148
  "yaml": "^2.9.0"
125
149
  },
126
150
  "peerDependencies": {
151
+ "@earendil-works/chord": "1.0.0",
152
+ "@earendil-works/pi-durable": "1.0.0",
127
153
  "@earendil-works/pi-ai": "*",
128
154
  "@earendil-works/pi-agent-core": "*",
129
155
  "@earendil-works/pi-coding-agent": "*",
130
156
  "@earendil-works/pi-tui": "*",
131
157
  "typebox": "*"
132
158
  },
159
+ "peerDependenciesMeta": {
160
+ "@earendil-works/chord": {
161
+ "optional": true
162
+ },
163
+ "@earendil-works/pi-durable": {
164
+ "optional": true
165
+ }
166
+ },
133
167
  "devDependencies": {
134
- "@earendil-works/pi-ai": "0.99.0",
135
- "@earendil-works/pi-agent-core": "0.99.0",
136
- "@earendil-works/pi-coding-agent": "0.99.0",
137
- "@earendil-works/pi-tui": "0.99.0",
168
+ "@earendil-works/chord": "1.0.0",
169
+ "@earendil-works/pi-durable": "1.0.0",
170
+ "@earendil-works/pi-ai": "1.0.0",
171
+ "@earendil-works/pi-agent-core": "1.0.0",
172
+ "@earendil-works/pi-coding-agent": "1.0.0",
173
+ "@earendil-works/pi-tui": "1.0.0",
138
174
  "typebox": "1.3.27",
139
175
  "@types/cross-spawn": "^6.0.6",
140
176
  "@types/node": "^26.1.2",
@@ -8,7 +8,7 @@ import { fileURLToPath } from "node:url";
8
8
  const root = fileURLToPath(new URL("../", import.meta.url));
9
9
  const env = { ...process.env, BEND_NO_TELEMETRY: "1" };
10
10
  const bend = process.env.BEND_BIN || "bend";
11
- if (execFileSync(bend, ["version"], { encoding: "utf8", env }).trim() !== "bend 2.0.34") throw new Error("Bend 2.0.34 required");
11
+ if (execFileSync(bend, ["version"], { encoding: "utf8", env }).trim() !== "bend 2.0.35") throw new Error("Bend 2.0.35 required");
12
12
  const inputs = JSON.parse(readFileSync(join(root, "src/verified/generated/manifest.json"), "utf8")).inputs;
13
13
  const originals = Object.fromEntries(Object.keys(inputs).filter((path) => path.endsWith(".bend")).map((path) => [path, readFileSync(join(root, path), "utf8")]));
14
14
  const mutations = [