@e4779/pi-fabric 0.92.17-fork.3

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 (1044) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +181 -0
  3. package/THIRD_PARTY_NOTICES.md +33 -0
  4. package/dist/activity/store.d.ts +33 -0
  5. package/dist/activity/store.d.ts.map +1 -0
  6. package/dist/activity/types.d.ts +104 -0
  7. package/dist/activity/types.d.ts.map +1 -0
  8. package/dist/actors/binding-store.d.ts +17 -0
  9. package/dist/actors/binding-store.d.ts.map +1 -0
  10. package/dist/actors/context.d.ts +13 -0
  11. package/dist/actors/context.d.ts.map +1 -0
  12. package/dist/actors/delivery-policy.d.ts +8 -0
  13. package/dist/actors/delivery-policy.d.ts.map +1 -0
  14. package/dist/actors/directory.d.ts +47 -0
  15. package/dist/actors/directory.d.ts.map +1 -0
  16. package/dist/actors/global-registry.d.ts +47 -0
  17. package/dist/actors/global-registry.d.ts.map +1 -0
  18. package/dist/actors/host-event-observer.d.ts +5 -0
  19. package/dist/actors/host-event-observer.d.ts.map +1 -0
  20. package/dist/actors/host-event-payload.d.ts +14 -0
  21. package/dist/actors/host-event-payload.d.ts.map +1 -0
  22. package/dist/actors/log-store.d.ts +22 -0
  23. package/dist/actors/log-store.d.ts.map +1 -0
  24. package/dist/actors/manager.d.ts +175 -0
  25. package/dist/actors/manager.d.ts.map +1 -0
  26. package/dist/actors/mesh-monitor.d.ts +22 -0
  27. package/dist/actors/mesh-monitor.d.ts.map +1 -0
  28. package/dist/actors/predicate.d.ts +7 -0
  29. package/dist/actors/predicate.d.ts.map +1 -0
  30. package/dist/actors/registry-store.d.ts +15 -0
  31. package/dist/actors/registry-store.d.ts.map +1 -0
  32. package/dist/actors/types.d.ts +218 -0
  33. package/dist/actors/types.d.ts.map +1 -0
  34. package/dist/agents/bash-worktree-add.d.ts +24 -0
  35. package/dist/agents/bash-worktree-add.d.ts.map +1 -0
  36. package/dist/agents/budget-ledger.d.ts +88 -0
  37. package/dist/agents/budget-ledger.d.ts.map +1 -0
  38. package/dist/agents/claude-cli.d.ts +32 -0
  39. package/dist/agents/claude-cli.d.ts.map +1 -0
  40. package/dist/agents/claude-cli.js +17 -0
  41. package/dist/agents/claude-cli.js.map +7 -0
  42. package/dist/agents/clone-first-worktree.d.ts +17 -0
  43. package/dist/agents/clone-first-worktree.d.ts.map +1 -0
  44. package/dist/agents/compact-control.d.ts +32 -0
  45. package/dist/agents/compact-control.d.ts.map +1 -0
  46. package/dist/agents/compact-control.js +129 -0
  47. package/dist/agents/compact-control.js.map +7 -0
  48. package/dist/agents/constants.d.ts +9 -0
  49. package/dist/agents/constants.d.ts.map +1 -0
  50. package/dist/agents/cow-clone.d.ts +8 -0
  51. package/dist/agents/cow-clone.d.ts.map +1 -0
  52. package/dist/agents/handoff-completion.d.ts +4 -0
  53. package/dist/agents/handoff-completion.d.ts.map +1 -0
  54. package/dist/agents/handoff.d.ts +19 -0
  55. package/dist/agents/handoff.d.ts.map +1 -0
  56. package/dist/agents/lifecycle.d.ts +32 -0
  57. package/dist/agents/lifecycle.d.ts.map +1 -0
  58. package/dist/agents/manager.d.ts +75 -0
  59. package/dist/agents/manager.d.ts.map +1 -0
  60. package/dist/agents/pi-binary.d.ts +7 -0
  61. package/dist/agents/pi-binary.d.ts.map +1 -0
  62. package/dist/agents/request.d.ts +13 -0
  63. package/dist/agents/request.d.ts.map +1 -0
  64. package/dist/agents/result.d.ts +8 -0
  65. package/dist/agents/result.d.ts.map +1 -0
  66. package/dist/agents/result.js +9 -0
  67. package/dist/agents/result.js.map +7 -0
  68. package/dist/agents/rm.d.ts +15 -0
  69. package/dist/agents/rm.d.ts.map +1 -0
  70. package/dist/agents/semaphore.d.ts +7 -0
  71. package/dist/agents/semaphore.d.ts.map +1 -0
  72. package/dist/agents/service-provider.d.ts +9 -0
  73. package/dist/agents/service-provider.d.ts.map +1 -0
  74. package/dist/agents/service-schema.d.ts +6 -0
  75. package/dist/agents/service-schema.d.ts.map +1 -0
  76. package/dist/agents/service-types.d.ts +192 -0
  77. package/dist/agents/service-types.d.ts.map +1 -0
  78. package/dist/agents/service.d.ts +36 -0
  79. package/dist/agents/service.d.ts.map +1 -0
  80. package/dist/agents/session-export.d.ts +39 -0
  81. package/dist/agents/session-export.d.ts.map +1 -0
  82. package/dist/agents/session-pins.d.ts +24 -0
  83. package/dist/agents/session-pins.d.ts.map +1 -0
  84. package/dist/agents/thinking-transfer.d.ts +39 -0
  85. package/dist/agents/thinking-transfer.d.ts.map +1 -0
  86. package/dist/agents/transports/herdr-transport.d.ts +10 -0
  87. package/dist/agents/transports/herdr-transport.d.ts.map +1 -0
  88. package/dist/agents/transports/localterm-transport.d.ts +7 -0
  89. package/dist/agents/transports/localterm-transport.d.ts.map +1 -0
  90. package/dist/agents/transports/process-transport.d.ts +7 -0
  91. package/dist/agents/transports/process-transport.d.ts.map +1 -0
  92. package/dist/agents/transports/process-utils.d.ts +33 -0
  93. package/dist/agents/transports/process-utils.d.ts.map +1 -0
  94. package/dist/agents/transports/screen-transport.d.ts +7 -0
  95. package/dist/agents/transports/screen-transport.d.ts.map +1 -0
  96. package/dist/agents/transports/tmux-transport.d.ts +7 -0
  97. package/dist/agents/transports/tmux-transport.d.ts.map +1 -0
  98. package/dist/agents/types.d.ts +280 -0
  99. package/dist/agents/types.d.ts.map +1 -0
  100. package/dist/agents/veda-cli.d.ts +22 -0
  101. package/dist/agents/veda-cli.d.ts.map +1 -0
  102. package/dist/agents/veda-cli.js +13 -0
  103. package/dist/agents/veda-cli.js.map +7 -0
  104. package/dist/agents/worktree-manager.d.ts +14 -0
  105. package/dist/agents/worktree-manager.d.ts.map +1 -0
  106. package/dist/agents/worktree-paths.d.ts +5 -0
  107. package/dist/agents/worktree-paths.d.ts.map +1 -0
  108. package/dist/agents.d.ts +8 -0
  109. package/dist/agents.d.ts.map +1 -0
  110. package/dist/agents.js +761 -0
  111. package/dist/agents.js.map +7 -0
  112. package/dist/async-settlement.d.ts +4 -0
  113. package/dist/async-settlement.d.ts.map +1 -0
  114. package/dist/audit/details.d.ts +86 -0
  115. package/dist/audit/details.d.ts.map +1 -0
  116. package/dist/audit/index.d.ts +4 -0
  117. package/dist/audit/index.d.ts.map +1 -0
  118. package/dist/audit/projection.d.ts +20 -0
  119. package/dist/audit/projection.d.ts.map +1 -0
  120. package/dist/audit/trace.d.ts +99 -0
  121. package/dist/audit/trace.d.ts.map +1 -0
  122. package/dist/capture/catalog.d.ts +30 -0
  123. package/dist/capture/catalog.d.ts.map +1 -0
  124. package/dist/capture/interceptor.d.ts +20 -0
  125. package/dist/capture/interceptor.d.ts.map +1 -0
  126. package/dist/capture/wrapper.d.ts +15 -0
  127. package/dist/capture/wrapper.d.ts.map +1 -0
  128. package/dist/chunks/chunk-2DMJ7MEI.js +1984 -0
  129. package/dist/chunks/chunk-2DMJ7MEI.js.map +7 -0
  130. package/dist/chunks/chunk-2PZWDVJB.js +738 -0
  131. package/dist/chunks/chunk-2PZWDVJB.js.map +7 -0
  132. package/dist/chunks/chunk-2UQV52II.js +440 -0
  133. package/dist/chunks/chunk-2UQV52II.js.map +7 -0
  134. package/dist/chunks/chunk-32BNQ75J.js +1445 -0
  135. package/dist/chunks/chunk-32BNQ75J.js.map +7 -0
  136. package/dist/chunks/chunk-3H7SDWZI.js +467 -0
  137. package/dist/chunks/chunk-3H7SDWZI.js.map +7 -0
  138. package/dist/chunks/chunk-3MEHEH6B.js +41 -0
  139. package/dist/chunks/chunk-3MEHEH6B.js.map +7 -0
  140. package/dist/chunks/chunk-3QECYQGA.js +70 -0
  141. package/dist/chunks/chunk-3QECYQGA.js.map +7 -0
  142. package/dist/chunks/chunk-3WIGAX56.js +644 -0
  143. package/dist/chunks/chunk-3WIGAX56.js.map +7 -0
  144. package/dist/chunks/chunk-3YZUQESG.js +16 -0
  145. package/dist/chunks/chunk-3YZUQESG.js.map +7 -0
  146. package/dist/chunks/chunk-4JETKRFE.js +287 -0
  147. package/dist/chunks/chunk-4JETKRFE.js.map +7 -0
  148. package/dist/chunks/chunk-4SSMGBF4.js +93 -0
  149. package/dist/chunks/chunk-4SSMGBF4.js.map +7 -0
  150. package/dist/chunks/chunk-5SU3YXBS.js +15 -0
  151. package/dist/chunks/chunk-5SU3YXBS.js.map +7 -0
  152. package/dist/chunks/chunk-656HWVFU.js +409 -0
  153. package/dist/chunks/chunk-656HWVFU.js.map +7 -0
  154. package/dist/chunks/chunk-7A6NVHB5.js +1242 -0
  155. package/dist/chunks/chunk-7A6NVHB5.js.map +7 -0
  156. package/dist/chunks/chunk-7TB7NXSL.js +58 -0
  157. package/dist/chunks/chunk-7TB7NXSL.js.map +7 -0
  158. package/dist/chunks/chunk-AAHHYDTO.js +24 -0
  159. package/dist/chunks/chunk-AAHHYDTO.js.map +7 -0
  160. package/dist/chunks/chunk-ARLYAW2A.js +95 -0
  161. package/dist/chunks/chunk-ARLYAW2A.js.map +7 -0
  162. package/dist/chunks/chunk-AYBIR4YV.js +210 -0
  163. package/dist/chunks/chunk-AYBIR4YV.js.map +7 -0
  164. package/dist/chunks/chunk-BOTRGFQQ.js +87 -0
  165. package/dist/chunks/chunk-BOTRGFQQ.js.map +7 -0
  166. package/dist/chunks/chunk-CGPK5WHX.js +96 -0
  167. package/dist/chunks/chunk-CGPK5WHX.js.map +7 -0
  168. package/dist/chunks/chunk-CI56CW53.js +470 -0
  169. package/dist/chunks/chunk-CI56CW53.js.map +7 -0
  170. package/dist/chunks/chunk-CPSW2GW4.js +1466 -0
  171. package/dist/chunks/chunk-CPSW2GW4.js.map +7 -0
  172. package/dist/chunks/chunk-CQFP2RCP.js +64 -0
  173. package/dist/chunks/chunk-CQFP2RCP.js.map +7 -0
  174. package/dist/chunks/chunk-D5WKZONW.js +797 -0
  175. package/dist/chunks/chunk-D5WKZONW.js.map +7 -0
  176. package/dist/chunks/chunk-DLXPTBPL.js +151 -0
  177. package/dist/chunks/chunk-DLXPTBPL.js.map +7 -0
  178. package/dist/chunks/chunk-G4LADAYY.js +287 -0
  179. package/dist/chunks/chunk-G4LADAYY.js.map +7 -0
  180. package/dist/chunks/chunk-GXNR6NRU.js +447 -0
  181. package/dist/chunks/chunk-GXNR6NRU.js.map +7 -0
  182. package/dist/chunks/chunk-IGVDD2HT.js +10 -0
  183. package/dist/chunks/chunk-IGVDD2HT.js.map +7 -0
  184. package/dist/chunks/chunk-J2HV2URQ.js +1125 -0
  185. package/dist/chunks/chunk-J2HV2URQ.js.map +7 -0
  186. package/dist/chunks/chunk-KAD7UWT2.js +99 -0
  187. package/dist/chunks/chunk-KAD7UWT2.js.map +7 -0
  188. package/dist/chunks/chunk-KYXZJNV6.js +227 -0
  189. package/dist/chunks/chunk-KYXZJNV6.js.map +7 -0
  190. package/dist/chunks/chunk-LMAVZN7J.js +8 -0
  191. package/dist/chunks/chunk-LMAVZN7J.js.map +7 -0
  192. package/dist/chunks/chunk-M3S7XITB.js +110 -0
  193. package/dist/chunks/chunk-M3S7XITB.js.map +7 -0
  194. package/dist/chunks/chunk-MGDLRV2R.js +112 -0
  195. package/dist/chunks/chunk-MGDLRV2R.js.map +7 -0
  196. package/dist/chunks/chunk-MGWQOKBV.js +30 -0
  197. package/dist/chunks/chunk-MGWQOKBV.js.map +7 -0
  198. package/dist/chunks/chunk-N5GUXC6F.js +184 -0
  199. package/dist/chunks/chunk-N5GUXC6F.js.map +7 -0
  200. package/dist/chunks/chunk-NQOEHX62.js +215 -0
  201. package/dist/chunks/chunk-NQOEHX62.js.map +7 -0
  202. package/dist/chunks/chunk-OKOHRXGF.js +100 -0
  203. package/dist/chunks/chunk-OKOHRXGF.js.map +7 -0
  204. package/dist/chunks/chunk-OP2KTYQB.js +286 -0
  205. package/dist/chunks/chunk-OP2KTYQB.js.map +7 -0
  206. package/dist/chunks/chunk-OTCASLY2.js +52 -0
  207. package/dist/chunks/chunk-OTCASLY2.js.map +7 -0
  208. package/dist/chunks/chunk-PAN6C3JM.js +42 -0
  209. package/dist/chunks/chunk-PAN6C3JM.js.map +7 -0
  210. package/dist/chunks/chunk-PH7ZJ27F.js +6873 -0
  211. package/dist/chunks/chunk-PH7ZJ27F.js.map +7 -0
  212. package/dist/chunks/chunk-PM5I335G.js +225 -0
  213. package/dist/chunks/chunk-PM5I335G.js.map +7 -0
  214. package/dist/chunks/chunk-PSNXUZMY.js +218 -0
  215. package/dist/chunks/chunk-PSNXUZMY.js.map +7 -0
  216. package/dist/chunks/chunk-PXAICAUT.js +24 -0
  217. package/dist/chunks/chunk-PXAICAUT.js.map +7 -0
  218. package/dist/chunks/chunk-RERA6YWA.js +359 -0
  219. package/dist/chunks/chunk-RERA6YWA.js.map +7 -0
  220. package/dist/chunks/chunk-RNOPHITP.js +1720 -0
  221. package/dist/chunks/chunk-RNOPHITP.js.map +7 -0
  222. package/dist/chunks/chunk-RRGTKHXZ.js +931 -0
  223. package/dist/chunks/chunk-RRGTKHXZ.js.map +7 -0
  224. package/dist/chunks/chunk-SWB2OHYW.js +93 -0
  225. package/dist/chunks/chunk-SWB2OHYW.js.map +7 -0
  226. package/dist/chunks/chunk-T3A5GNCW.js +19 -0
  227. package/dist/chunks/chunk-T3A5GNCW.js.map +7 -0
  228. package/dist/chunks/chunk-TPLMVELH.js +118 -0
  229. package/dist/chunks/chunk-TPLMVELH.js.map +7 -0
  230. package/dist/chunks/chunk-TSRKCXNI.js +17 -0
  231. package/dist/chunks/chunk-TSRKCXNI.js.map +7 -0
  232. package/dist/chunks/chunk-U5FYOMG5.js +119 -0
  233. package/dist/chunks/chunk-U5FYOMG5.js.map +7 -0
  234. package/dist/chunks/chunk-U6CTHPZC.js +1924 -0
  235. package/dist/chunks/chunk-U6CTHPZC.js.map +7 -0
  236. package/dist/chunks/chunk-UDFDF7IY.js +1572 -0
  237. package/dist/chunks/chunk-UDFDF7IY.js.map +7 -0
  238. package/dist/chunks/chunk-UKMQK5VP.js +231 -0
  239. package/dist/chunks/chunk-UKMQK5VP.js.map +7 -0
  240. package/dist/chunks/chunk-UQ4LTUH4.js +2181 -0
  241. package/dist/chunks/chunk-UQ4LTUH4.js.map +7 -0
  242. package/dist/chunks/chunk-UTR3I23Z.js +65 -0
  243. package/dist/chunks/chunk-UTR3I23Z.js.map +7 -0
  244. package/dist/chunks/chunk-VPPIJRNZ.js +50 -0
  245. package/dist/chunks/chunk-VPPIJRNZ.js.map +7 -0
  246. package/dist/chunks/chunk-VRYEGVHR.js +195 -0
  247. package/dist/chunks/chunk-VRYEGVHR.js.map +7 -0
  248. package/dist/chunks/chunk-VRZNFNPB.js +4218 -0
  249. package/dist/chunks/chunk-VRZNFNPB.js.map +7 -0
  250. package/dist/chunks/chunk-VXZZJ44D.js +295 -0
  251. package/dist/chunks/chunk-VXZZJ44D.js.map +7 -0
  252. package/dist/chunks/chunk-W3FRE4VI.js +297 -0
  253. package/dist/chunks/chunk-W3FRE4VI.js.map +7 -0
  254. package/dist/chunks/chunk-WVH324VF.js +60 -0
  255. package/dist/chunks/chunk-WVH324VF.js.map +7 -0
  256. package/dist/chunks/chunk-X7G62ZGH.js +151 -0
  257. package/dist/chunks/chunk-X7G62ZGH.js.map +7 -0
  258. package/dist/chunks/chunk-XB3RJVT4.js +17 -0
  259. package/dist/chunks/chunk-XB3RJVT4.js.map +7 -0
  260. package/dist/chunks/chunk-XT4346N7.js +651 -0
  261. package/dist/chunks/chunk-XT4346N7.js.map +7 -0
  262. package/dist/chunks/chunk-Y7KNRAFL.js +1180 -0
  263. package/dist/chunks/chunk-Y7KNRAFL.js.map +7 -0
  264. package/dist/chunks/chunk-YK5AZ7CZ.js +692 -0
  265. package/dist/chunks/chunk-YK5AZ7CZ.js.map +7 -0
  266. package/dist/chunks/chunk-YU4O6SWQ.js +246 -0
  267. package/dist/chunks/chunk-YU4O6SWQ.js.map +7 -0
  268. package/dist/chunks/chunk-YU62DDKK.js +22 -0
  269. package/dist/chunks/chunk-YU62DDKK.js.map +7 -0
  270. package/dist/chunks/chunk-Z63R5GVN.js +121 -0
  271. package/dist/chunks/chunk-Z63R5GVN.js.map +7 -0
  272. package/dist/chunks/chunk-ZDNGXLEC.js +221 -0
  273. package/dist/chunks/chunk-ZDNGXLEC.js.map +7 -0
  274. package/dist/chunks/chunk-ZZ4LHQYJ.js +777 -0
  275. package/dist/chunks/chunk-ZZ4LHQYJ.js.map +7 -0
  276. package/dist/commands/fabric.d.ts +17 -0
  277. package/dist/commands/fabric.d.ts.map +1 -0
  278. package/dist/compaction/bounds.d.ts +23 -0
  279. package/dist/compaction/bounds.d.ts.map +1 -0
  280. package/dist/compaction/branch-details.d.ts +83 -0
  281. package/dist/compaction/branch-details.d.ts.map +1 -0
  282. package/dist/compaction/branch-summary.d.ts +9 -0
  283. package/dist/compaction/branch-summary.d.ts.map +1 -0
  284. package/dist/compaction/enrichers.d.ts +10 -0
  285. package/dist/compaction/enrichers.d.ts.map +1 -0
  286. package/dist/compaction/hook.d.ts +99 -0
  287. package/dist/compaction/hook.d.ts.map +1 -0
  288. package/dist/compaction/hook.js +22 -0
  289. package/dist/compaction/hook.js.map +7 -0
  290. package/dist/compaction/instructions.d.ts +38 -0
  291. package/dist/compaction/instructions.d.ts.map +1 -0
  292. package/dist/compaction/normalize.d.ts +83 -0
  293. package/dist/compaction/normalize.d.ts.map +1 -0
  294. package/dist/compaction/projections.d.ts +31 -0
  295. package/dist/compaction/projections.d.ts.map +1 -0
  296. package/dist/compaction/qa.d.ts +27 -0
  297. package/dist/compaction/qa.d.ts.map +1 -0
  298. package/dist/compaction/render.d.ts +10 -0
  299. package/dist/compaction/render.d.ts.map +1 -0
  300. package/dist/compaction/threshold.d.ts +5 -0
  301. package/dist/compaction/threshold.d.ts.map +1 -0
  302. package/dist/compaction/trace-events.d.ts +23 -0
  303. package/dist/compaction/trace-events.d.ts.map +1 -0
  304. package/dist/components/catalog.d.ts +25 -0
  305. package/dist/components/catalog.d.ts.map +1 -0
  306. package/dist/components/effect-policy.d.ts +21 -0
  307. package/dist/components/effect-policy.d.ts.map +1 -0
  308. package/dist/components/effect-scope.d.ts +31 -0
  309. package/dist/components/effect-scope.d.ts.map +1 -0
  310. package/dist/components/loader.d.ts +27 -0
  311. package/dist/components/loader.d.ts.map +1 -0
  312. package/dist/components/model-guidance.d.ts +48 -0
  313. package/dist/components/model-guidance.d.ts.map +1 -0
  314. package/dist/components/provider-component.d.ts +31 -0
  315. package/dist/components/provider-component.d.ts.map +1 -0
  316. package/dist/components/supervisor.d.ts +29 -0
  317. package/dist/components/supervisor.d.ts.map +1 -0
  318. package/dist/components/types.d.ts +140 -0
  319. package/dist/components/types.d.ts.map +1 -0
  320. package/dist/config-migrations.d.ts +11 -0
  321. package/dist/config-migrations.d.ts.map +1 -0
  322. package/dist/config.d.ts +282 -0
  323. package/dist/config.d.ts.map +1 -0
  324. package/dist/core/action-arguments.d.ts +12 -0
  325. package/dist/core/action-arguments.d.ts.map +1 -0
  326. package/dist/core/action-registry.d.ts +170 -0
  327. package/dist/core/action-registry.d.ts.map +1 -0
  328. package/dist/core/action-registry.js +20 -0
  329. package/dist/core/action-registry.js.map +7 -0
  330. package/dist/core/action-repair.d.ts +15 -0
  331. package/dist/core/action-repair.d.ts.map +1 -0
  332. package/dist/core/action-result.d.ts +13 -0
  333. package/dist/core/action-result.d.ts.map +1 -0
  334. package/dist/core/agent-dir.d.ts +2 -0
  335. package/dist/core/agent-dir.d.ts.map +1 -0
  336. package/dist/core/approval-controller.d.ts +31 -0
  337. package/dist/core/approval-controller.d.ts.map +1 -0
  338. package/dist/core/atomic-write.d.ts +15 -0
  339. package/dist/core/atomic-write.d.ts.map +1 -0
  340. package/dist/core/auto-approval-classifier.d.ts +17 -0
  341. package/dist/core/auto-approval-classifier.d.ts.map +1 -0
  342. package/dist/core/call-preview.d.ts +8 -0
  343. package/dist/core/call-preview.d.ts.map +1 -0
  344. package/dist/core/child-tool-allowlist.d.ts +3 -0
  345. package/dist/core/child-tool-allowlist.d.ts.map +1 -0
  346. package/dist/core/compact-controller.d.ts +42 -0
  347. package/dist/core/compact-controller.d.ts.map +1 -0
  348. package/dist/core/core-override-guidance.d.ts +7 -0
  349. package/dist/core/core-override-guidance.d.ts.map +1 -0
  350. package/dist/core/damaged-file.d.ts +6 -0
  351. package/dist/core/damaged-file.d.ts.map +1 -0
  352. package/dist/core/direct-tool-approval.d.ts +19 -0
  353. package/dist/core/direct-tool-approval.d.ts.map +1 -0
  354. package/dist/core/effect-conflict.d.ts +3 -0
  355. package/dist/core/effect-conflict.d.ts.map +1 -0
  356. package/dist/core/file-lock.d.ts +12 -0
  357. package/dist/core/file-lock.d.ts.map +1 -0
  358. package/dist/core/kernel-skills.d.ts +3 -0
  359. package/dist/core/kernel-skills.d.ts.map +1 -0
  360. package/dist/core/model-resolution.d.ts +62 -0
  361. package/dist/core/model-resolution.d.ts.map +1 -0
  362. package/dist/core/model-usage.d.ts +8 -0
  363. package/dist/core/model-usage.d.ts.map +1 -0
  364. package/dist/core/pi-arguments.d.ts +3 -0
  365. package/dist/core/pi-arguments.d.ts.map +1 -0
  366. package/dist/core/pi-bash-error.d.ts +9 -0
  367. package/dist/core/pi-bash-error.d.ts.map +1 -0
  368. package/dist/core/pi-tools.d.ts +9 -0
  369. package/dist/core/pi-tools.d.ts.map +1 -0
  370. package/dist/core/provider-bindings.d.ts +47 -0
  371. package/dist/core/provider-bindings.d.ts.map +1 -0
  372. package/dist/core/proxy-contract.d.ts +18 -0
  373. package/dist/core/proxy-contract.d.ts.map +1 -0
  374. package/dist/core/session-context.d.ts +14 -0
  375. package/dist/core/session-context.d.ts.map +1 -0
  376. package/dist/core/shell-jobs.d.ts +99 -0
  377. package/dist/core/shell-jobs.d.ts.map +1 -0
  378. package/dist/core/skill-block.d.ts +10 -0
  379. package/dist/core/skill-block.d.ts.map +1 -0
  380. package/dist/core/skill-dir.d.ts +4 -0
  381. package/dist/core/skill-dir.d.ts.map +1 -0
  382. package/dist/core/skill-prompt.d.ts +3 -0
  383. package/dist/core/skill-prompt.d.ts.map +1 -0
  384. package/dist/core/skill-references.d.ts +7 -0
  385. package/dist/core/skill-references.d.ts.map +1 -0
  386. package/dist/core/stable-hash.d.ts +3 -0
  387. package/dist/core/stable-hash.d.ts.map +1 -0
  388. package/dist/core/system-guidance.d.ts +13 -0
  389. package/dist/core/system-guidance.d.ts.map +1 -0
  390. package/dist/core/token-math.d.ts +16 -0
  391. package/dist/core/token-math.d.ts.map +1 -0
  392. package/dist/core/tool-ownership.d.ts +47 -0
  393. package/dist/core/tool-ownership.d.ts.map +1 -0
  394. package/dist/core/tool-result-proxy.d.ts +18 -0
  395. package/dist/core/tool-result-proxy.d.ts.map +1 -0
  396. package/dist/entropy/active.d.ts +9 -0
  397. package/dist/entropy/active.d.ts.map +1 -0
  398. package/dist/entropy/compiled-store.d.ts +16 -0
  399. package/dist/entropy/compiled-store.d.ts.map +1 -0
  400. package/dist/entropy/compiled-surface.d.ts +57 -0
  401. package/dist/entropy/compiled-surface.d.ts.map +1 -0
  402. package/dist/entropy/compiler.d.ts +27 -0
  403. package/dist/entropy/compiler.d.ts.map +1 -0
  404. package/dist/entropy/corpus.d.ts +22 -0
  405. package/dist/entropy/corpus.d.ts.map +1 -0
  406. package/dist/entropy/fingerprint.d.ts +9 -0
  407. package/dist/entropy/fingerprint.d.ts.map +1 -0
  408. package/dist/entropy/index.d.ts +16 -0
  409. package/dist/entropy/index.d.ts.map +1 -0
  410. package/dist/entropy/index.js +194 -0
  411. package/dist/entropy/index.js.map +7 -0
  412. package/dist/entropy/meter.d.ts +10 -0
  413. package/dist/entropy/meter.d.ts.map +1 -0
  414. package/dist/entropy/normal-form.d.ts +40 -0
  415. package/dist/entropy/normal-form.d.ts.map +1 -0
  416. package/dist/entropy/passes.d.ts +13 -0
  417. package/dist/entropy/passes.d.ts.map +1 -0
  418. package/dist/entropy/pool-store.d.ts +15 -0
  419. package/dist/entropy/pool-store.d.ts.map +1 -0
  420. package/dist/entropy/pool.d.ts +41 -0
  421. package/dist/entropy/pool.d.ts.map +1 -0
  422. package/dist/entropy/presentation.d.ts +12 -0
  423. package/dist/entropy/presentation.d.ts.map +1 -0
  424. package/dist/entropy/sessions.d.ts +47 -0
  425. package/dist/entropy/sessions.d.ts.map +1 -0
  426. package/dist/entropy/surface.d.ts +30 -0
  427. package/dist/entropy/surface.d.ts.map +1 -0
  428. package/dist/entropy/trial.d.ts +38 -0
  429. package/dist/entropy/trial.d.ts.map +1 -0
  430. package/dist/entropy/types.d.ts +181 -0
  431. package/dist/entropy/types.d.ts.map +1 -0
  432. package/dist/execution-service.d.ts +66 -0
  433. package/dist/execution-service.d.ts.map +1 -0
  434. package/dist/fabric-exec-arguments.d.ts +7 -0
  435. package/dist/fabric-exec-arguments.d.ts.map +1 -0
  436. package/dist/fabric-exec-tool.d.ts +8 -0
  437. package/dist/fabric-exec-tool.d.ts.map +1 -0
  438. package/dist/fabric-runtime-state.d.ts +96 -0
  439. package/dist/fabric-runtime-state.d.ts.map +1 -0
  440. package/dist/fabric-runtime-state.js +11928 -0
  441. package/dist/fabric-runtime-state.js.map +7 -0
  442. package/dist/fabric-state.d.ts +95 -0
  443. package/dist/fabric-state.d.ts.map +1 -0
  444. package/dist/failure-progress.d.ts +3 -0
  445. package/dist/failure-progress.d.ts.map +1 -0
  446. package/dist/host-compatibility.d.ts +5 -0
  447. package/dist/host-compatibility.d.ts.map +1 -0
  448. package/dist/index.d.ts +11 -0
  449. package/dist/index.d.ts.map +1 -0
  450. package/dist/index.js +6094 -0
  451. package/dist/index.js.map +7 -0
  452. package/dist/jev/auth.d.ts +5 -0
  453. package/dist/jev/auth.d.ts.map +1 -0
  454. package/dist/jev/browser.d.ts +37 -0
  455. package/dist/jev/browser.d.ts.map +1 -0
  456. package/dist/jev/browser.js +13 -0
  457. package/dist/jev/browser.js.map +7 -0
  458. package/dist/jev/client.d.ts +29 -0
  459. package/dist/jev/client.d.ts.map +1 -0
  460. package/dist/jev/client.js +11 -0
  461. package/dist/jev/client.js.map +7 -0
  462. package/dist/jev/config.d.ts +17 -0
  463. package/dist/jev/config.d.ts.map +1 -0
  464. package/dist/jev/guest-types.d.ts +2 -0
  465. package/dist/jev/guest-types.d.ts.map +1 -0
  466. package/dist/jev/manager.d.ts +36 -0
  467. package/dist/jev/manager.d.ts.map +1 -0
  468. package/dist/jev/observation.d.ts +59 -0
  469. package/dist/jev/observation.d.ts.map +1 -0
  470. package/dist/jev/observation.js +20 -0
  471. package/dist/jev/observation.js.map +7 -0
  472. package/dist/jev/types.d.ts +142 -0
  473. package/dist/jev/types.d.ts.map +1 -0
  474. package/dist/jev/validation.d.ts +8 -0
  475. package/dist/jev/validation.d.ts.map +1 -0
  476. package/dist/jev.d.ts +9 -0
  477. package/dist/jev.d.ts.map +1 -0
  478. package/dist/jev.js +49 -0
  479. package/dist/jev.js.map +7 -0
  480. package/dist/lifecycle/broker.d.ts +30 -0
  481. package/dist/lifecycle/broker.d.ts.map +1 -0
  482. package/dist/lifecycle/delivery-scheduler.d.ts +30 -0
  483. package/dist/lifecycle/delivery-scheduler.d.ts.map +1 -0
  484. package/dist/lifecycle/types.d.ts +91 -0
  485. package/dist/lifecycle/types.d.ts.map +1 -0
  486. package/dist/log-tail.d.ts +11 -0
  487. package/dist/log-tail.d.ts.map +1 -0
  488. package/dist/main-agent.d.ts +70 -0
  489. package/dist/main-agent.d.ts.map +1 -0
  490. package/dist/managed-host.d.ts +22 -0
  491. package/dist/managed-host.d.ts.map +1 -0
  492. package/dist/mcp.d.ts +9 -0
  493. package/dist/mcp.d.ts.map +1 -0
  494. package/dist/mcp.js +21 -0
  495. package/dist/mcp.js.map +7 -0
  496. package/dist/memory/client.d.ts +31 -0
  497. package/dist/memory/client.d.ts.map +1 -0
  498. package/dist/memory/context.d.ts +114 -0
  499. package/dist/memory/context.d.ts.map +1 -0
  500. package/dist/memory/digest.d.ts +48 -0
  501. package/dist/memory/digest.d.ts.map +1 -0
  502. package/dist/memory/digest.js +7 -0
  503. package/dist/memory/digest.js.map +7 -0
  504. package/dist/memory/discovery.d.ts +43 -0
  505. package/dist/memory/discovery.d.ts.map +1 -0
  506. package/dist/memory/discovery.js +25 -0
  507. package/dist/memory/discovery.js.map +7 -0
  508. package/dist/memory/expand-service.d.ts +4 -0
  509. package/dist/memory/expand-service.d.ts.map +1 -0
  510. package/dist/memory/host-source.d.ts +60 -0
  511. package/dist/memory/host-source.d.ts.map +1 -0
  512. package/dist/memory/index.d.ts +113 -0
  513. package/dist/memory/index.d.ts.map +1 -0
  514. package/dist/memory/lineage.d.ts +25 -0
  515. package/dist/memory/lineage.d.ts.map +1 -0
  516. package/dist/memory/normalize.d.ts +188 -0
  517. package/dist/memory/normalize.d.ts.map +1 -0
  518. package/dist/memory/normalize.js +26 -0
  519. package/dist/memory/normalize.js.map +7 -0
  520. package/dist/memory/portable.d.ts +66 -0
  521. package/dist/memory/portable.d.ts.map +1 -0
  522. package/dist/memory/provider.d.ts +15 -0
  523. package/dist/memory/provider.d.ts.map +1 -0
  524. package/dist/memory/recall-service.d.ts +5 -0
  525. package/dist/memory/recall-service.d.ts.map +1 -0
  526. package/dist/memory/regex.d.ts +19 -0
  527. package/dist/memory/regex.d.ts.map +1 -0
  528. package/dist/memory/request-cache.d.ts +49 -0
  529. package/dist/memory/request-cache.d.ts.map +1 -0
  530. package/dist/memory/request-context.d.ts +57 -0
  531. package/dist/memory/request-context.d.ts.map +1 -0
  532. package/dist/memory/request-limits.d.ts +8 -0
  533. package/dist/memory/request-limits.d.ts.map +1 -0
  534. package/dist/memory/search.d.ts +98 -0
  535. package/dist/memory/search.d.ts.map +1 -0
  536. package/dist/memory/search.js +24 -0
  537. package/dist/memory/search.js.map +7 -0
  538. package/dist/memory/sessions-service.d.ts +3 -0
  539. package/dist/memory/sessions-service.d.ts.map +1 -0
  540. package/dist/memory/source-observation.d.ts +28 -0
  541. package/dist/memory/source-observation.d.ts.map +1 -0
  542. package/dist/memory/tokenize.d.ts +24 -0
  543. package/dist/memory/tokenize.d.ts.map +1 -0
  544. package/dist/memory.d.ts +8 -0
  545. package/dist/memory.d.ts.map +1 -0
  546. package/dist/memory.js +119 -0
  547. package/dist/memory.js.map +7 -0
  548. package/dist/mesh/store.d.ts +78 -0
  549. package/dist/mesh/store.d.ts.map +1 -0
  550. package/dist/output-budget.d.ts +12 -0
  551. package/dist/output-budget.d.ts.map +1 -0
  552. package/dist/prewalk/arm.d.ts +8 -0
  553. package/dist/prewalk/arm.d.ts.map +1 -0
  554. package/dist/prewalk/controller.d.ts +66 -0
  555. package/dist/prewalk/controller.d.ts.map +1 -0
  556. package/dist/prewalk/fs-drift.d.ts +19 -0
  557. package/dist/prewalk/fs-drift.d.ts.map +1 -0
  558. package/dist/prewalk/handoff.d.ts +46 -0
  559. package/dist/prewalk/handoff.d.ts.map +1 -0
  560. package/dist/protocol.d.ts +275 -0
  561. package/dist/protocol.d.ts.map +1 -0
  562. package/dist/protocol.js +46 -0
  563. package/dist/protocol.js.map +7 -0
  564. package/dist/providers/agents-actions.d.ts +3 -0
  565. package/dist/providers/agents-actions.d.ts.map +1 -0
  566. package/dist/providers/agents-message-router.d.ts +29 -0
  567. package/dist/providers/agents-message-router.d.ts.map +1 -0
  568. package/dist/providers/agents-progress.d.ts +18 -0
  569. package/dist/providers/agents-progress.d.ts.map +1 -0
  570. package/dist/providers/agents-provider.d.ts +51 -0
  571. package/dist/providers/agents-provider.d.ts.map +1 -0
  572. package/dist/providers/arg-normalization.d.ts +15 -0
  573. package/dist/providers/arg-normalization.d.ts.map +1 -0
  574. package/dist/providers/captured-tools-provider.d.ts +23 -0
  575. package/dist/providers/captured-tools-provider.d.ts.map +1 -0
  576. package/dist/providers/compact-provider.d.ts +14 -0
  577. package/dist/providers/compact-provider.d.ts.map +1 -0
  578. package/dist/providers/components-provider.d.ts +12 -0
  579. package/dist/providers/components-provider.d.ts.map +1 -0
  580. package/dist/providers/jev-provider.d.ts +70 -0
  581. package/dist/providers/jev-provider.d.ts.map +1 -0
  582. package/dist/providers/jev-provider.js +28 -0
  583. package/dist/providers/jev-provider.js.map +7 -0
  584. package/dist/providers/mcp-descriptor-cache.d.ts +47 -0
  585. package/dist/providers/mcp-descriptor-cache.d.ts.map +1 -0
  586. package/dist/providers/mcp-provider.d.ts +47 -0
  587. package/dist/providers/mcp-provider.d.ts.map +1 -0
  588. package/dist/providers/memory-provider.d.ts +32 -0
  589. package/dist/providers/memory-provider.d.ts.map +1 -0
  590. package/dist/providers/memory-provider.js +23 -0
  591. package/dist/providers/memory-provider.js.map +7 -0
  592. package/dist/providers/mesh-provider.d.ts +17 -0
  593. package/dist/providers/mesh-provider.d.ts.map +1 -0
  594. package/dist/providers/pi-bash-cwd.d.ts +49 -0
  595. package/dist/providers/pi-bash-cwd.d.ts.map +1 -0
  596. package/dist/providers/pi-tools-provider.d.ts +25 -0
  597. package/dist/providers/pi-tools-provider.d.ts.map +1 -0
  598. package/dist/providers/schema-provider.d.ts +15 -0
  599. package/dist/providers/schema-provider.d.ts.map +1 -0
  600. package/dist/providers/state-provider.d.ts +16 -0
  601. package/dist/providers/state-provider.d.ts.map +1 -0
  602. package/dist/providers/write-diff-limits.d.ts +5 -0
  603. package/dist/providers/write-diff-limits.d.ts.map +1 -0
  604. package/dist/providers/write-preview.d.ts +3 -0
  605. package/dist/providers/write-preview.d.ts.map +1 -0
  606. package/dist/ref-names.d.ts +2 -0
  607. package/dist/ref-names.d.ts.map +1 -0
  608. package/dist/repairs/active.d.ts +7 -0
  609. package/dist/repairs/active.d.ts.map +1 -0
  610. package/dist/repairs/apply.d.ts +7 -0
  611. package/dist/repairs/apply.d.ts.map +1 -0
  612. package/dist/repairs/catalog-digest.d.ts +5 -0
  613. package/dist/repairs/catalog-digest.d.ts.map +1 -0
  614. package/dist/repairs/classify.d.ts +10 -0
  615. package/dist/repairs/classify.d.ts.map +1 -0
  616. package/dist/repairs/compiler.d.ts +33 -0
  617. package/dist/repairs/compiler.d.ts.map +1 -0
  618. package/dist/repairs/promote.d.ts +4 -0
  619. package/dist/repairs/promote.d.ts.map +1 -0
  620. package/dist/repairs/store.d.ts +10 -0
  621. package/dist/repairs/store.d.ts.map +1 -0
  622. package/dist/repairs/types.d.ts +49 -0
  623. package/dist/repairs/types.d.ts.map +1 -0
  624. package/dist/repeat-guard.d.ts +25 -0
  625. package/dist/repeat-guard.d.ts.map +1 -0
  626. package/dist/residency/actor-client.d.ts +16 -0
  627. package/dist/residency/actor-client.d.ts.map +1 -0
  628. package/dist/residency/actor-client.js +9 -0
  629. package/dist/residency/actor-client.js.map +7 -0
  630. package/dist/residency/client.d.ts +44 -0
  631. package/dist/residency/client.d.ts.map +1 -0
  632. package/dist/residency/host.d.ts +3 -0
  633. package/dist/residency/host.d.ts.map +1 -0
  634. package/dist/residency/host.js +32 -0
  635. package/dist/residency/host.js.map +7 -0
  636. package/dist/residency/launcher-owner.d.ts +7 -0
  637. package/dist/residency/launcher-owner.d.ts.map +1 -0
  638. package/dist/residency/launcher.d.ts +3 -0
  639. package/dist/residency/launcher.d.ts.map +1 -0
  640. package/dist/residency/launcher.js +154 -0
  641. package/dist/residency/launcher.js.map +7 -0
  642. package/dist/residency/pi-entry.d.ts +3 -0
  643. package/dist/residency/pi-entry.d.ts.map +1 -0
  644. package/dist/residency/pi-entry.js +48 -0
  645. package/dist/residency/pi-entry.js.map +7 -0
  646. package/dist/residency/protocol.d.ts +122 -0
  647. package/dist/residency/protocol.d.ts.map +1 -0
  648. package/dist/run-display.d.ts +3 -0
  649. package/dist/run-display.d.ts.map +1 -0
  650. package/dist/runtime/core-override-guest-types.d.ts +15 -0
  651. package/dist/runtime/core-override-guest-types.d.ts.map +1 -0
  652. package/dist/runtime/core-override-guest-types.js +9 -0
  653. package/dist/runtime/core-override-guest-types.js.map +7 -0
  654. package/dist/runtime/core-tool-properties.d.ts +6 -0
  655. package/dist/runtime/core-tool-properties.d.ts.map +1 -0
  656. package/dist/runtime/cpython-child-source.d.ts +2 -0
  657. package/dist/runtime/cpython-child-source.d.ts.map +1 -0
  658. package/dist/runtime/cpython-linux-sandbox.d.ts +2 -0
  659. package/dist/runtime/cpython-linux-sandbox.d.ts.map +1 -0
  660. package/dist/runtime/cpython-runtime.d.ts +9 -0
  661. package/dist/runtime/cpython-runtime.d.ts.map +1 -0
  662. package/dist/runtime/cpython-runtime.js +677 -0
  663. package/dist/runtime/cpython-runtime.js.map +7 -0
  664. package/dist/runtime/dynamic-guest-types.d.ts +3 -0
  665. package/dist/runtime/dynamic-guest-types.d.ts.map +1 -0
  666. package/dist/runtime/dynamic-guest-types.js +8 -0
  667. package/dist/runtime/dynamic-guest-types.js.map +7 -0
  668. package/dist/runtime/guest-code-repair.d.ts +2 -0
  669. package/dist/runtime/guest-code-repair.d.ts.map +1 -0
  670. package/dist/runtime/guest-stack-map.d.ts +11 -0
  671. package/dist/runtime/guest-stack-map.d.ts.map +1 -0
  672. package/dist/runtime/guest-types.d.ts +40 -0
  673. package/dist/runtime/guest-types.d.ts.map +1 -0
  674. package/dist/runtime/guest-types.js +13 -0
  675. package/dist/runtime/guest-types.js.map +7 -0
  676. package/dist/runtime/kernel.d.ts +30 -0
  677. package/dist/runtime/kernel.d.ts.map +1 -0
  678. package/dist/runtime/monty-bridge.d.ts +4 -0
  679. package/dist/runtime/monty-bridge.d.ts.map +1 -0
  680. package/dist/runtime/monty-runtime.d.ts +6 -0
  681. package/dist/runtime/monty-runtime.d.ts.map +1 -0
  682. package/dist/runtime/monty-runtime.js +485 -0
  683. package/dist/runtime/monty-runtime.js.map +7 -0
  684. package/dist/runtime/monty-source.d.ts +10 -0
  685. package/dist/runtime/monty-source.d.ts.map +1 -0
  686. package/dist/runtime/monty-values.d.ts +7 -0
  687. package/dist/runtime/monty-values.d.ts.map +1 -0
  688. package/dist/runtime/node-process-child-source.d.ts +2 -0
  689. package/dist/runtime/node-process-child-source.d.ts.map +1 -0
  690. package/dist/runtime/node-process-runtime.d.ts +10 -0
  691. package/dist/runtime/node-process-runtime.d.ts.map +1 -0
  692. package/dist/runtime/node-process-runtime.js +16 -0
  693. package/dist/runtime/node-process-runtime.js.map +7 -0
  694. package/dist/runtime/orchestration.d.ts +3 -0
  695. package/dist/runtime/orchestration.d.ts.map +1 -0
  696. package/dist/runtime/python-arguments.d.ts +2 -0
  697. package/dist/runtime/python-arguments.d.ts.map +1 -0
  698. package/dist/runtime/python-error-guidance.d.ts +6 -0
  699. package/dist/runtime/python-error-guidance.d.ts.map +1 -0
  700. package/dist/runtime/quickjs-runtime.d.ts +8 -0
  701. package/dist/runtime/quickjs-runtime.d.ts.map +1 -0
  702. package/dist/runtime/quickjs-runtime.js +15 -0
  703. package/dist/runtime/quickjs-runtime.js.map +7 -0
  704. package/dist/runtime/type-checker.d.ts +18 -0
  705. package/dist/runtime/type-checker.d.ts.map +1 -0
  706. package/dist/runtime/type-checker.js +11 -0
  707. package/dist/runtime/type-checker.js.map +7 -0
  708. package/dist/runtime/typescript-kernel.d.ts +14 -0
  709. package/dist/runtime/typescript-kernel.d.ts.map +1 -0
  710. package/dist/runtime/typescript-kernel.js +53 -0
  711. package/dist/runtime/typescript-kernel.js.map +7 -0
  712. package/dist/runtime-paths.d.ts +7 -0
  713. package/dist/runtime-paths.d.ts.map +1 -0
  714. package/dist/runtime-state-builtins.d.ts +26 -0
  715. package/dist/runtime-state-builtins.d.ts.map +1 -0
  716. package/dist/runtime-state-speculation.d.ts +16 -0
  717. package/dist/runtime-state-speculation.d.ts.map +1 -0
  718. package/dist/schema/controller.d.ts +35 -0
  719. package/dist/schema/controller.d.ts.map +1 -0
  720. package/dist/schema/policy.d.ts +2 -0
  721. package/dist/schema/policy.d.ts.map +1 -0
  722. package/dist/schema/types.d.ts +86 -0
  723. package/dist/schema/types.d.ts.map +1 -0
  724. package/dist/schema/workspace.d.ts +19 -0
  725. package/dist/schema/workspace.d.ts.map +1 -0
  726. package/dist/speculation/eligibility.d.ts +22 -0
  727. package/dist/speculation/eligibility.d.ts.map +1 -0
  728. package/dist/speculation/freshness.d.ts +10 -0
  729. package/dist/speculation/freshness.d.ts.map +1 -0
  730. package/dist/speculation/partial-json.d.ts +9 -0
  731. package/dist/speculation/partial-json.d.ts.map +1 -0
  732. package/dist/speculation/python-scanner.d.ts +7 -0
  733. package/dist/speculation/python-scanner.d.ts.map +1 -0
  734. package/dist/speculation/python-scanner.js +166 -0
  735. package/dist/speculation/python-scanner.js.map +7 -0
  736. package/dist/speculation/scanner.d.ts +13 -0
  737. package/dist/speculation/scanner.d.ts.map +1 -0
  738. package/dist/speculation/scanner.js +182 -0
  739. package/dist/speculation/scanner.js.map +7 -0
  740. package/dist/speculation/store.d.ts +41 -0
  741. package/dist/speculation/store.d.ts.map +1 -0
  742. package/dist/speculation/stream-tap.d.ts +30 -0
  743. package/dist/speculation/stream-tap.d.ts.map +1 -0
  744. package/dist/speculation/types.d.ts +44 -0
  745. package/dist/speculation/types.d.ts.map +1 -0
  746. package/dist/state/complexity.d.ts +13 -0
  747. package/dist/state/complexity.d.ts.map +1 -0
  748. package/dist/state/evidence-runner.d.ts +17 -0
  749. package/dist/state/evidence-runner.d.ts.map +1 -0
  750. package/dist/state/store.d.ts +76 -0
  751. package/dist/state/store.d.ts.map +1 -0
  752. package/dist/state/types.d.ts +165 -0
  753. package/dist/state/types.d.ts.map +1 -0
  754. package/dist/storage/retention.d.ts +22 -0
  755. package/dist/storage/retention.d.ts.map +1 -0
  756. package/dist/thinking.d.ts +19 -0
  757. package/dist/thinking.d.ts.map +1 -0
  758. package/dist/topology/control-plane.d.ts +58 -0
  759. package/dist/topology/control-plane.d.ts.map +1 -0
  760. package/dist/topology/participant-directory.d.ts +33 -0
  761. package/dist/topology/participant-directory.d.ts.map +1 -0
  762. package/dist/topology/peer-settle.d.ts +51 -0
  763. package/dist/topology/peer-settle.d.ts.map +1 -0
  764. package/dist/topology/records.d.ts +6 -0
  765. package/dist/topology/records.d.ts.map +1 -0
  766. package/dist/topology/types.d.ts +89 -0
  767. package/dist/topology/types.d.ts.map +1 -0
  768. package/dist/type-error-guidance.d.ts +3 -0
  769. package/dist/type-error-guidance.d.ts.map +1 -0
  770. package/dist/ui/arc-group.d.ts +17 -0
  771. package/dist/ui/arc-group.d.ts.map +1 -0
  772. package/dist/ui/border-status-editor.d.ts +22 -0
  773. package/dist/ui/border-status-editor.d.ts.map +1 -0
  774. package/dist/ui/code-preview-shell.d.ts +11 -0
  775. package/dist/ui/code-preview-shell.d.ts.map +1 -0
  776. package/dist/ui/code-preview.d.ts +53 -0
  777. package/dist/ui/code-preview.d.ts.map +1 -0
  778. package/dist/ui/controller.d.ts +20 -0
  779. package/dist/ui/controller.d.ts.map +1 -0
  780. package/dist/ui/conversation-chrome.d.ts +16 -0
  781. package/dist/ui/conversation-chrome.d.ts.map +1 -0
  782. package/dist/ui/conversation-chrome.js +11 -0
  783. package/dist/ui/conversation-chrome.js.map +7 -0
  784. package/dist/ui/conversation-commands.d.ts +12 -0
  785. package/dist/ui/conversation-commands.d.ts.map +1 -0
  786. package/dist/ui/conversation-history.d.ts +6 -0
  787. package/dist/ui/conversation-history.d.ts.map +1 -0
  788. package/dist/ui/conversation-host.d.ts +7 -0
  789. package/dist/ui/conversation-host.d.ts.map +1 -0
  790. package/dist/ui/conversation-host.js +9 -0
  791. package/dist/ui/conversation-host.js.map +7 -0
  792. package/dist/ui/conversation-native-reader-checkpoint.d.ts +8 -0
  793. package/dist/ui/conversation-native-reader-checkpoint.d.ts.map +1 -0
  794. package/dist/ui/conversation-native-reader-replay.d.ts +10 -0
  795. package/dist/ui/conversation-native-reader-replay.d.ts.map +1 -0
  796. package/dist/ui/conversation-native-reader.d.ts +110 -0
  797. package/dist/ui/conversation-native-reader.d.ts.map +1 -0
  798. package/dist/ui/conversation-native-reader.js +1050 -0
  799. package/dist/ui/conversation-native-reader.js.map +7 -0
  800. package/dist/ui/conversation-queue-store.d.ts +14 -0
  801. package/dist/ui/conversation-queue-store.d.ts.map +1 -0
  802. package/dist/ui/conversation-queue.d.ts +244 -0
  803. package/dist/ui/conversation-queue.d.ts.map +1 -0
  804. package/dist/ui/conversation-render.d.ts +104 -0
  805. package/dist/ui/conversation-render.d.ts.map +1 -0
  806. package/dist/ui/conversation-selection.d.ts +18 -0
  807. package/dist/ui/conversation-selection.d.ts.map +1 -0
  808. package/dist/ui/conversation-shortcut.d.ts +3 -0
  809. package/dist/ui/conversation-shortcut.d.ts.map +1 -0
  810. package/dist/ui/conversation-targets.d.ts +7 -0
  811. package/dist/ui/conversation-targets.d.ts.map +1 -0
  812. package/dist/ui/conversation-targets.js +12 -0
  813. package/dist/ui/conversation-targets.js.map +7 -0
  814. package/dist/ui/conversation-transcript.d.ts +25 -0
  815. package/dist/ui/conversation-transcript.d.ts.map +1 -0
  816. package/dist/ui/conversation.d.ts +219 -0
  817. package/dist/ui/conversation.d.ts.map +1 -0
  818. package/dist/ui/conversation.js +2861 -0
  819. package/dist/ui/conversation.js.map +7 -0
  820. package/dist/ui/core-tool-render.d.ts +20 -0
  821. package/dist/ui/core-tool-render.d.ts.map +1 -0
  822. package/dist/ui/dashboard-detail.d.ts +68 -0
  823. package/dist/ui/dashboard-detail.d.ts.map +1 -0
  824. package/dist/ui/dashboard-fabric-graph.d.ts +50 -0
  825. package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -0
  826. package/dist/ui/dashboard-graph-controller.d.ts +52 -0
  827. package/dist/ui/dashboard-graph-controller.d.ts.map +1 -0
  828. package/dist/ui/dashboard-modal-controller.d.ts +36 -0
  829. package/dist/ui/dashboard-modal-controller.d.ts.map +1 -0
  830. package/dist/ui/dashboard-model.d.ts +111 -0
  831. package/dist/ui/dashboard-model.d.ts.map +1 -0
  832. package/dist/ui/dashboard-presentation.d.ts +6 -0
  833. package/dist/ui/dashboard-presentation.d.ts.map +1 -0
  834. package/dist/ui/dashboard.d.ts +156 -0
  835. package/dist/ui/dashboard.d.ts.map +1 -0
  836. package/dist/ui/dashboard.js +4622 -0
  837. package/dist/ui/dashboard.js.map +7 -0
  838. package/dist/ui/diff-background.d.ts +12 -0
  839. package/dist/ui/diff-background.d.ts.map +1 -0
  840. package/dist/ui/dynamic-border.d.ts +8 -0
  841. package/dist/ui/dynamic-border.d.ts.map +1 -0
  842. package/dist/ui/escape-halt.d.ts +11 -0
  843. package/dist/ui/escape-halt.d.ts.map +1 -0
  844. package/dist/ui/fabric-actor-delivery-selector.d.ts +17 -0
  845. package/dist/ui/fabric-actor-delivery-selector.d.ts.map +1 -0
  846. package/dist/ui/fabric-actor-tool-selector.d.ts +22 -0
  847. package/dist/ui/fabric-actor-tool-selector.d.ts.map +1 -0
  848. package/dist/ui/fabric-code-parser.d.ts +9 -0
  849. package/dist/ui/fabric-code-parser.d.ts.map +1 -0
  850. package/dist/ui/fabric-host-event-selector.d.ts +29 -0
  851. package/dist/ui/fabric-host-event-selector.d.ts.map +1 -0
  852. package/dist/ui/fabric-model-selector.d.ts +64 -0
  853. package/dist/ui/fabric-model-selector.d.ts.map +1 -0
  854. package/dist/ui/fabric-render.d.ts +113 -0
  855. package/dist/ui/fabric-render.d.ts.map +1 -0
  856. package/dist/ui/fabric-thinking-selector.d.ts +26 -0
  857. package/dist/ui/fabric-thinking-selector.d.ts.map +1 -0
  858. package/dist/ui/fabric-title-hint.d.ts +3 -0
  859. package/dist/ui/fabric-title-hint.d.ts.map +1 -0
  860. package/dist/ui/format.d.ts +9 -0
  861. package/dist/ui/format.d.ts.map +1 -0
  862. package/dist/ui/handoff-completion.d.ts +3 -0
  863. package/dist/ui/handoff-completion.d.ts.map +1 -0
  864. package/dist/ui/highlight.d.ts +69 -0
  865. package/dist/ui/highlight.d.ts.map +1 -0
  866. package/dist/ui/model-picker.d.ts +46 -0
  867. package/dist/ui/model-picker.d.ts.map +1 -0
  868. package/dist/ui/model-picker.js +17 -0
  869. package/dist/ui/model-picker.js.map +7 -0
  870. package/dist/ui/preview-lines.d.ts +16 -0
  871. package/dist/ui/preview-lines.d.ts.map +1 -0
  872. package/dist/ui/row-balance.d.ts +29 -0
  873. package/dist/ui/row-balance.d.ts.map +1 -0
  874. package/dist/ui/settings-component.d.ts +26 -0
  875. package/dist/ui/settings-component.d.ts.map +1 -0
  876. package/dist/ui/settings-rpc.d.ts +15 -0
  877. package/dist/ui/settings-rpc.d.ts.map +1 -0
  878. package/dist/ui/settings-section-context.d.ts +18 -0
  879. package/dist/ui/settings-section-context.d.ts.map +1 -0
  880. package/dist/ui/settings-sections-agents.d.ts +5 -0
  881. package/dist/ui/settings-sections-agents.d.ts.map +1 -0
  882. package/dist/ui/settings-sections-execution.d.ts +8 -0
  883. package/dist/ui/settings-sections-execution.d.ts.map +1 -0
  884. package/dist/ui/settings-sections-lifecycle.d.ts +6 -0
  885. package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -0
  886. package/dist/ui/settings-sections-presentation.d.ts +6 -0
  887. package/dist/ui/settings-sections-presentation.d.ts.map +1 -0
  888. package/dist/ui/settings-sections.d.ts +12 -0
  889. package/dist/ui/settings-sections.d.ts.map +1 -0
  890. package/dist/ui/settings-submenus.d.ts +74 -0
  891. package/dist/ui/settings-submenus.d.ts.map +1 -0
  892. package/dist/ui/settings-values.d.ts +63 -0
  893. package/dist/ui/settings-values.d.ts.map +1 -0
  894. package/dist/ui/settings.d.ts +21 -0
  895. package/dist/ui/settings.d.ts.map +1 -0
  896. package/dist/ui/settings.js +1985 -0
  897. package/dist/ui/settings.js.map +7 -0
  898. package/dist/ui/shell-hang-keys.d.ts +11 -0
  899. package/dist/ui/shell-hang-keys.d.ts.map +1 -0
  900. package/dist/ui/shiki-language.d.ts +7 -0
  901. package/dist/ui/shiki-language.d.ts.map +1 -0
  902. package/dist/ui/shiki-theme.d.ts +7 -0
  903. package/dist/ui/shiki-theme.d.ts.map +1 -0
  904. package/dist/ui/snapshot.d.ts +17 -0
  905. package/dist/ui/snapshot.d.ts.map +1 -0
  906. package/dist/ui/spinner.d.ts +6 -0
  907. package/dist/ui/spinner.d.ts.map +1 -0
  908. package/dist/ui/state-file-preview.d.ts +13 -0
  909. package/dist/ui/state-file-preview.d.ts.map +1 -0
  910. package/dist/ui/structured.d.ts +9 -0
  911. package/dist/ui/structured.d.ts.map +1 -0
  912. package/dist/ui/tool-call-timing.d.ts +2 -0
  913. package/dist/ui/tool-call-timing.d.ts.map +1 -0
  914. package/dist/ui/tool-display.d.ts +8 -0
  915. package/dist/ui/tool-display.d.ts.map +1 -0
  916. package/dist/ui/topology.d.ts +162 -0
  917. package/dist/ui/topology.d.ts.map +1 -0
  918. package/dist/ui/transcript-parser.d.ts +18 -0
  919. package/dist/ui/transcript-parser.d.ts.map +1 -0
  920. package/dist/ui/transcript-reader.d.ts +10 -0
  921. package/dist/ui/transcript-reader.d.ts.map +1 -0
  922. package/dist/ui/transcript-sanitization.d.ts +14 -0
  923. package/dist/ui/transcript-sanitization.d.ts.map +1 -0
  924. package/dist/ui/transcript.d.ts +52 -0
  925. package/dist/ui/transcript.d.ts.map +1 -0
  926. package/dist/ui/types.d.ts +84 -0
  927. package/dist/ui/types.d.ts.map +1 -0
  928. package/dist/ui/widget.d.ts +16 -0
  929. package/dist/ui/widget.d.ts.map +1 -0
  930. package/dist/ui/word-diff/alignment.d.ts +6 -0
  931. package/dist/ui/word-diff/alignment.d.ts.map +1 -0
  932. package/dist/ui/word-diff/change-block.d.ts +18 -0
  933. package/dist/ui/word-diff/change-block.d.ts.map +1 -0
  934. package/dist/ui/word-diff/changed-line.d.ts +14 -0
  935. package/dist/ui/word-diff/changed-line.d.ts.map +1 -0
  936. package/dist/ui/word-diff/emphasis.d.ts +9 -0
  937. package/dist/ui/word-diff/emphasis.d.ts.map +1 -0
  938. package/dist/ui/word-diff/line-emphasis.d.ts +7 -0
  939. package/dist/ui/word-diff/line-emphasis.d.ts.map +1 -0
  940. package/dist/ui/word-diff/line-matching.d.ts +10 -0
  941. package/dist/ui/word-diff/line-matching.d.ts.map +1 -0
  942. package/dist/ui/word-diff/line-similarity.d.ts +16 -0
  943. package/dist/ui/word-diff/line-similarity.d.ts.map +1 -0
  944. package/dist/ui/word-diff/normalize.d.ts +3 -0
  945. package/dist/ui/word-diff/normalize.d.ts.map +1 -0
  946. package/dist/ui/word-diff/parse.d.ts +17 -0
  947. package/dist/ui/word-diff/parse.d.ts.map +1 -0
  948. package/dist/ui/word-diff/range-refinement.d.ts +5 -0
  949. package/dist/ui/word-diff/range-refinement.d.ts.map +1 -0
  950. package/dist/ui/word-diff/ranges.d.ts +11 -0
  951. package/dist/ui/word-diff/ranges.d.ts.map +1 -0
  952. package/dist/ui/word-diff/smart-filter.d.ts +3 -0
  953. package/dist/ui/word-diff/smart-filter.d.ts.map +1 -0
  954. package/dist/ui/word-diff/sparse-line-matching.d.ts +25 -0
  955. package/dist/ui/word-diff/sparse-line-matching.d.ts.map +1 -0
  956. package/dist/ui/word-diff/text-boundaries.d.ts +11 -0
  957. package/dist/ui/word-diff/text-boundaries.d.ts.map +1 -0
  958. package/dist/ui/word-diff/token-alignment.d.ts +9 -0
  959. package/dist/ui/word-diff/token-alignment.d.ts.map +1 -0
  960. package/dist/ui/word-diff/token-text-refinement.d.ts +4 -0
  961. package/dist/ui/word-diff/token-text-refinement.d.ts.map +1 -0
  962. package/dist/ui/word-diff/tokens.d.ts +16 -0
  963. package/dist/ui/word-diff/tokens.d.ts.map +1 -0
  964. package/dist/ui/word-diff/types.d.ts +10 -0
  965. package/dist/ui/word-diff/types.d.ts.map +1 -0
  966. package/dist/util.d.ts +3 -0
  967. package/dist/util.d.ts.map +1 -0
  968. package/dist/worker/model-control.d.ts +14 -0
  969. package/dist/worker/model-control.d.ts.map +1 -0
  970. package/dist/worker/model-control.js +118 -0
  971. package/dist/worker/model-control.js.map +7 -0
  972. package/dist/worker/options.d.ts +3 -0
  973. package/dist/worker/options.d.ts.map +1 -0
  974. package/dist/worker/options.js +156 -0
  975. package/dist/worker/options.js.map +7 -0
  976. package/dist/worker/run-record.d.ts +22 -0
  977. package/dist/worker/run-record.d.ts.map +1 -0
  978. package/dist/worker/run-record.js +124 -0
  979. package/dist/worker/run-record.js.map +7 -0
  980. package/dist/worker/session-export.d.ts +45 -0
  981. package/dist/worker/session-export.d.ts.map +1 -0
  982. package/dist/worker/session-export.js +91 -0
  983. package/dist/worker/session-export.js.map +7 -0
  984. package/dist/worker.d.ts +3 -0
  985. package/dist/worker.d.ts.map +1 -0
  986. package/dist/worker.js +1074 -0
  987. package/dist/worker.js.map +7 -0
  988. package/docs/agents.md +618 -0
  989. package/docs/architecture.md +141 -0
  990. package/docs/audit-trace.md +116 -0
  991. package/docs/certification.md +166 -0
  992. package/docs/compaction.md +345 -0
  993. package/docs/component-calculus.md +191 -0
  994. package/docs/components.md +330 -0
  995. package/docs/configuration.md +529 -0
  996. package/docs/entropy.md +214 -0
  997. package/docs/interface.md +210 -0
  998. package/docs/jev.md +289 -0
  999. package/docs/kernels.md +186 -0
  1000. package/docs/memory-recall.md +664 -0
  1001. package/docs/programmatic-compaction.md +205 -0
  1002. package/docs/provider-component-calculus.md +378 -0
  1003. package/docs/providers.md +163 -0
  1004. package/docs/repairs.md +90 -0
  1005. package/docs/residency-runtime.md +82 -0
  1006. package/docs/schema-enforcement.md +166 -0
  1007. package/docs/skills.md +50 -0
  1008. package/docs/speculation.md +171 -0
  1009. package/docs/state-layer.md +197 -0
  1010. package/package.json +135 -0
  1011. package/skillsets/python/fabric-advisor/SKILL.md +29 -0
  1012. package/skillsets/python/fabric-ambient/SKILL.md +44 -0
  1013. package/skillsets/python/fabric-ambient/references/setup.md +67 -0
  1014. package/skillsets/python/fabric-council/SKILL.md +54 -0
  1015. package/skillsets/python/fabric-exec/SKILL.md +74 -0
  1016. package/skillsets/python/fabric-exec/references/agents.md +65 -0
  1017. package/skillsets/python/fabric-exec/references/mcp.md +23 -0
  1018. package/skillsets/python/fabric-exec/references/mesh.md +27 -0
  1019. package/skillsets/python/fabric-fusion/SKILL.md +112 -0
  1020. package/skillsets/python/fabric-guide/SKILL.md +29 -0
  1021. package/skillsets/python/fabric-jev/SKILL.md +162 -0
  1022. package/skillsets/python/fabric-rlm/SKILL.md +120 -0
  1023. package/skillsets/python/fabric-schema/SKILL.md +55 -0
  1024. package/skillsets/python/fabric-spec/SKILL.md +42 -0
  1025. package/skillsets/python/fabric-supervisor/SKILL.md +37 -0
  1026. package/skillsets/python/fabric-swarm/SKILL.md +40 -0
  1027. package/skillsets/python/fabric-workflow/SKILL.md +62 -0
  1028. package/skillsets/typescript/fabric-advisor/SKILL.md +29 -0
  1029. package/skillsets/typescript/fabric-ambient/SKILL.md +44 -0
  1030. package/skillsets/typescript/fabric-ambient/references/setup.md +90 -0
  1031. package/skillsets/typescript/fabric-council/SKILL.md +94 -0
  1032. package/skillsets/typescript/fabric-exec/SKILL.md +142 -0
  1033. package/skillsets/typescript/fabric-exec/references/agents.md +218 -0
  1034. package/skillsets/typescript/fabric-exec/references/mcp.md +49 -0
  1035. package/skillsets/typescript/fabric-exec/references/mesh.md +51 -0
  1036. package/skillsets/typescript/fabric-fusion/SKILL.md +332 -0
  1037. package/skillsets/typescript/fabric-guide/SKILL.md +29 -0
  1038. package/skillsets/typescript/fabric-jev/SKILL.md +159 -0
  1039. package/skillsets/typescript/fabric-rlm/SKILL.md +284 -0
  1040. package/skillsets/typescript/fabric-schema/SKILL.md +121 -0
  1041. package/skillsets/typescript/fabric-spec/SKILL.md +42 -0
  1042. package/skillsets/typescript/fabric-supervisor/SKILL.md +37 -0
  1043. package/skillsets/typescript/fabric-swarm/SKILL.md +80 -0
  1044. package/skillsets/typescript/fabric-workflow/SKILL.md +133 -0
@@ -0,0 +1,1572 @@
1
+ import {
2
+ defaultCodePreviewSettings,
3
+ normalizeCodePreviewSettings
4
+ } from "./chunk-OKOHRXGF.js";
5
+ import {
6
+ renameAtomic
7
+ } from "./chunk-KAD7UWT2.js";
8
+ import {
9
+ DEFAULT_FABRIC_THINKING,
10
+ isFabricThinking
11
+ } from "./chunk-MGWQOKBV.js";
12
+ import {
13
+ DEFAULT_JEV_CONFIG,
14
+ normalizeJevConfig
15
+ } from "./chunk-3MEHEH6B.js";
16
+ import {
17
+ PI_CORE_TOOL_NAME_SET
18
+ } from "./chunk-YU62DDKK.js";
19
+
20
+ // src/core/model-resolution.ts
21
+ var PROVIDER_MODEL_RE = /^[^\s/]+\/[^\s/]+$/;
22
+ var FUZZY_RESOLUTION_MARKERS = ["closest", "recent", "latest"];
23
+ var modelKey = (model) => `${model.provider}/${model.id}`;
24
+ var sameModel = (left, right) => right !== void 0 && left.provider.toLowerCase() === right.provider.toLowerCase() && left.id.toLowerCase() === right.id.toLowerCase();
25
+ var normalizeModelAliases = (input) => {
26
+ if (typeof input !== "object" || input === null || Array.isArray(input)) return {};
27
+ const aliases = {};
28
+ for (const [rawName, rawValue] of Object.entries(input)) {
29
+ const name = rawName.trim();
30
+ if (!name) continue;
31
+ const values = typeof rawValue === "string" ? [rawValue] : rawValue;
32
+ if (!Array.isArray(values) || values.length === 0) continue;
33
+ const targets = [];
34
+ let valid = true;
35
+ for (const candidate of values) {
36
+ if (typeof candidate !== "string") {
37
+ valid = false;
38
+ break;
39
+ }
40
+ const target = candidate.trim();
41
+ if (!PROVIDER_MODEL_RE.test(target)) {
42
+ valid = false;
43
+ break;
44
+ }
45
+ if (!targets.includes(target)) targets.push(target);
46
+ }
47
+ if (valid && targets.length > 0) aliases[name] = targets;
48
+ }
49
+ return aliases;
50
+ };
51
+ var FUZZY_MIN_QUERY_LENGTH = 4;
52
+ var FUZZY_LEVENSHTEIN_MIN_RATIO = 0.55;
53
+ var subsequenceSpan = (needle, haystack) => {
54
+ let index = 0;
55
+ let first = -1;
56
+ let last = -1;
57
+ for (let i = 0; i < haystack.length && index < needle.length; i += 1) {
58
+ if (haystack[i] === needle[index]) {
59
+ if (first === -1) first = i;
60
+ last = i;
61
+ index += 1;
62
+ }
63
+ }
64
+ return index === needle.length ? last - first + 1 : Number.POSITIVE_INFINITY;
65
+ };
66
+ var levenshteinRatio = (left, right) => {
67
+ if (left === right) return 1;
68
+ if (left.length === 0 || right.length === 0) return 0;
69
+ let previous = Array.from({ length: right.length + 1 }, (_, column) => column);
70
+ for (let i = 0; i < left.length; i += 1) {
71
+ const current = [i + 1];
72
+ for (let j = 0; j < right.length; j += 1) {
73
+ current.push(Math.min(
74
+ previous[j] + 1,
75
+ current[j] + 1,
76
+ previous[j] + (left[i] === right[j] ? 0 : 1)
77
+ ));
78
+ }
79
+ previous = current;
80
+ }
81
+ return 1 - previous[right.length] / Math.max(left.length, right.length);
82
+ };
83
+ var closenessScore = (query, model) => {
84
+ const id = model.id.toLowerCase();
85
+ const name = model.name?.toLowerCase();
86
+ if (id.startsWith(query)) return 60 + query.length / id.length * 20;
87
+ if (id.includes(query)) return 50 + query.length / id.length * 15;
88
+ if (name?.startsWith(query) === true) return 45 + query.length / name.length * 15;
89
+ if (name?.includes(query) === true) return 40 + query.length / name.length * 10;
90
+ if (model.provider.toLowerCase().includes(query)) return 25;
91
+ if (query.length >= 3 && query[0] === id[0] && subsequenceSpan(query, id) <= query.length + 2) {
92
+ return 18 + query.length / id.length * 6;
93
+ }
94
+ if (query.length >= FUZZY_MIN_QUERY_LENGTH) {
95
+ const idRatio = levenshteinRatio(query, id);
96
+ if (idRatio >= FUZZY_LEVENSHTEIN_MIN_RATIO) return 8 + idRatio * 10;
97
+ if (name !== void 0) {
98
+ const nameRatio = levenshteinRatio(query, name);
99
+ if (nameRatio >= FUZZY_LEVENSHTEIN_MIN_RATIO) return 6 + nameRatio * 8;
100
+ }
101
+ }
102
+ return 0;
103
+ };
104
+ var pickClosestCandidate = (query, pool, lastUsed) => {
105
+ const usage = {};
106
+ for (const [key, value] of Object.entries(lastUsed ?? {})) {
107
+ usage[key.toLowerCase()] = value;
108
+ }
109
+ const recency = (model) => usage[`${model.provider}/${model.id}`.toLowerCase()] ?? 0;
110
+ let best;
111
+ let bestScore = 0;
112
+ let tied = false;
113
+ for (const model of pool) {
114
+ const score = closenessScore(query, model);
115
+ if (score <= 0) continue;
116
+ if (best === void 0 || score > bestScore) {
117
+ best = model;
118
+ bestScore = score;
119
+ tied = false;
120
+ continue;
121
+ }
122
+ if (score === bestScore) {
123
+ tied = true;
124
+ const bestRecent = recency(best);
125
+ const nextRecent = recency(model);
126
+ if (nextRecent > bestRecent || nextRecent === bestRecent && modelKey(model) > modelKey(best)) {
127
+ best = model;
128
+ }
129
+ }
130
+ }
131
+ if (best === void 0) return void 0;
132
+ const runnersUp = pool.filter(
133
+ (model) => model !== best && closenessScore(query, model) === bestScore
134
+ );
135
+ const wonOnRecency = tied && runnersUp.some((model) => recency(model) !== recency(best));
136
+ return {
137
+ model: best,
138
+ via: !tied ? "closest" : wonOnRecency ? "recent" : "latest"
139
+ };
140
+ };
141
+ var resolveFabricModel = (query, options) => {
142
+ const normalized = query.trim().toLowerCase();
143
+ if (!normalized) return { kind: "not-found", query };
144
+ const providerFilter = options.provider?.trim().toLowerCase();
145
+ const available = providerFilter ? options.available.filter((model) => model.provider.toLowerCase() === providerFilter) : [...options.available];
146
+ if (available.length === 0) return { kind: "not-found", query };
147
+ const aliasKey = Object.keys(options.aliases).find(
148
+ (key) => key.toLowerCase() === normalized
149
+ );
150
+ const tried = [];
151
+ if (aliasKey !== void 0) {
152
+ const chain = options.aliases[aliasKey] ?? [];
153
+ for (const target of chain) {
154
+ tried.push(target);
155
+ const separator = target.indexOf("/");
156
+ const provider = target.slice(0, separator);
157
+ const id = target.slice(separator + 1);
158
+ const match = available.find(
159
+ (model) => model.provider.toLowerCase() === provider.toLowerCase() && model.id.toLowerCase() === id.toLowerCase()
160
+ );
161
+ if (match) {
162
+ return sameModel(match, options.current) ? { kind: "already-active", model: match } : { kind: "resolved", model: match, via: aliasKey };
163
+ }
164
+ }
165
+ return { kind: "not-found", query, tried };
166
+ }
167
+ const exact = available.find((model) => modelKey(model).toLowerCase() === normalized) ?? available.find((model) => model.id.toLowerCase() === normalized);
168
+ if (exact) {
169
+ return sameModel(exact, options.current) ? { kind: "already-active", model: exact } : { kind: "resolved", model: exact };
170
+ }
171
+ const candidates = available.filter(
172
+ (model) => model.id.toLowerCase().includes(normalized) || model.name !== void 0 && model.name.toLowerCase().includes(normalized) || model.provider.toLowerCase().includes(normalized)
173
+ );
174
+ if (candidates.length === 1) {
175
+ const match = candidates[0];
176
+ if (match === void 0) return { kind: "not-found", query };
177
+ return sameModel(match, options.current) ? { kind: "already-active", model: match } : { kind: "resolved", model: match };
178
+ }
179
+ const pool = candidates.length > 1 ? candidates : available;
180
+ const picked = pickClosestCandidate(normalized, pool, options.lastUsed);
181
+ if (picked) {
182
+ return sameModel(picked.model, options.current) ? { kind: "already-active", model: picked.model } : { kind: "resolved", model: picked.model, via: picked.via };
183
+ }
184
+ if (candidates.length > 1) return { kind: "ambiguous", query, candidates };
185
+ return { kind: "not-found", query };
186
+ };
187
+ var unavailablePiModelError = (query, resolution) => {
188
+ const detail = resolution?.kind === "not-found" && resolution.tried !== void 0 ? ` Alias targets tried: ${resolution.tried.join(", ")}.` : resolution?.kind === "ambiguous" ? ` Visible matches: ${resolution.candidates.map(modelKey).join(", ")}.` : "";
189
+ return new Error(
190
+ `Model ${JSON.stringify(query)} is not available to this Pi session.${detail} Use agents.models({ runner: "pi" }) to list the models visible to this session.`
191
+ );
192
+ };
193
+ var resolveAvailablePiModel = (selector, options) => {
194
+ const query = selector.trim();
195
+ const alias = Object.keys(options.aliases).some(
196
+ (name) => name.toLowerCase() === query.toLowerCase()
197
+ );
198
+ if (PROVIDER_MODEL_RE.test(query) && !alias) {
199
+ const exact = options.available.find(
200
+ (model) => modelKey(model).toLowerCase() === query.toLowerCase()
201
+ );
202
+ if (exact) return exact;
203
+ throw unavailablePiModelError(query);
204
+ }
205
+ const resolution = resolveFabricModel(query, options);
206
+ if (resolution.kind === "resolved" || resolution.kind === "already-active") {
207
+ return resolution.model;
208
+ }
209
+ throw unavailablePiModelError(query, resolution);
210
+ };
211
+
212
+ // src/core/shell-jobs.ts
213
+ import { createWriteStream } from "node:fs";
214
+ import { readFile, unlink, writeFile } from "node:fs/promises";
215
+ import { tmpdir } from "node:os";
216
+ import path from "node:path";
217
+ import { randomUUID } from "node:crypto";
218
+ var DEFAULT_SHELL_HANG_MS = 12e4;
219
+ var SHELL_HANG_MAX_MS = 6e5;
220
+ var SHELL_HANG_SNAPSHOT_BYTES = 8e3;
221
+ var posixQuote = (value) => "'" + value.replaceAll("'", "'\\''") + "'";
222
+ var powershellQuote = (value) => "'" + value.replaceAll("'", "''") + "'";
223
+ var wrapShellCommandForPid = (command, pidPath, tool) => tool === "powershell" ? `Set-Content -LiteralPath ${powershellQuote(pidPath)} -Value $PID
224
+ ${command}` : `printf '%s\\n' "$$" > ${posixQuote(pidPath)}
225
+ ${command}`;
226
+ var formatShellHangNotice = (input) => {
227
+ const seconds = Math.max(1, Math.round(input.elapsedMs / 1e3));
228
+ const pid = input.pid !== void 0 ? ` (pid ${input.pid})` : "";
229
+ return `[Still running after ${seconds}s${pid}. Live output: ${input.logPath}]`;
230
+ };
231
+ var appendShellHangNotice = (output, notice) => output ? `${output}
232
+
233
+ ${notice}` : notice;
234
+ var parseShellPid = (text) => {
235
+ const pid = Number(text.trim());
236
+ return Number.isSafeInteger(pid) && pid > 1 ? pid : void 0;
237
+ };
238
+ var FabricShellJob = class {
239
+ id;
240
+ tool;
241
+ command;
242
+ abort = new AbortController();
243
+ startedAt = Date.now();
244
+ pidPath;
245
+ pid;
246
+ logPath;
247
+ spilled = false;
248
+ finished = false;
249
+ spilledAt;
250
+ finishedAt;
251
+ exitCode;
252
+ status = "running";
253
+ #chunks = [];
254
+ #stream;
255
+ #spill = new AbortController();
256
+ #pidRead;
257
+ constructor(tool, command) {
258
+ this.id = randomUUID();
259
+ this.tool = tool;
260
+ this.command = command;
261
+ this.pidPath = path.join(tmpdir(), `pi-fabric-shell-${this.id}.pid`);
262
+ }
263
+ append(data) {
264
+ if (this.finished) return;
265
+ this.#chunks.push(data);
266
+ this.#stream?.write(data);
267
+ }
268
+ snapshotText(maxBytes = SHELL_HANG_SNAPSHOT_BYTES) {
269
+ const all = Buffer.concat(this.#chunks);
270
+ const slice = all.length <= maxBytes ? all : all.subarray(all.length - maxBytes);
271
+ return slice.toString("utf8");
272
+ }
273
+ async persistLog() {
274
+ if (this.logPath) return this.logPath;
275
+ const logPath = path.join(tmpdir(), `pi-fabric-shell-${this.id}.log`);
276
+ this.logPath = logPath;
277
+ await writeFile(logPath, Buffer.concat(this.#chunks), { encoding: "utf8", mode: 384 });
278
+ this.#stream = createWriteStream(logPath, { flags: "a", encoding: "utf8", mode: 384 });
279
+ return logPath;
280
+ }
281
+ async readPid() {
282
+ if (this.pid !== void 0) return this.pid;
283
+ this.#pidRead ??= (async () => {
284
+ for (let attempt = 0; attempt < 25; attempt += 1) {
285
+ try {
286
+ const pid = parseShellPid(await readFile(this.pidPath, "utf8"));
287
+ if (pid !== void 0) {
288
+ this.pid = pid;
289
+ return pid;
290
+ }
291
+ } catch {
292
+ }
293
+ await new Promise((resolve) => setTimeout(resolve, 10));
294
+ }
295
+ return void 0;
296
+ })();
297
+ return this.#pidRead;
298
+ }
299
+ spill() {
300
+ if (this.spilled || this.finished) return;
301
+ this.spilled = true;
302
+ this.spilledAt = Date.now();
303
+ this.status = "spilled";
304
+ if (!this.#spill.signal.aborted) this.#spill.abort();
305
+ }
306
+ whenSpill() {
307
+ if (this.spilled || this.#spill.signal.aborted) return Promise.resolve();
308
+ return new Promise((resolve) => {
309
+ this.#spill.signal.addEventListener("abort", () => resolve(), { once: true });
310
+ });
311
+ }
312
+ async finish(exitCode, footer) {
313
+ if (this.finished) return;
314
+ this.finished = true;
315
+ this.finishedAt = Date.now();
316
+ if (exitCode !== void 0) this.exitCode = exitCode;
317
+ if (this.status === "running") {
318
+ this.status = this.abort.signal.aborted ? "killed" : "exited";
319
+ } else if (this.abort.signal.aborted && this.status === "spilled") {
320
+ this.status = "killed";
321
+ }
322
+ if (footer && this.#stream) this.#stream.write(footer.endsWith("\n") ? footer : `${footer}
323
+ `);
324
+ await new Promise((resolve) => {
325
+ if (!this.#stream) {
326
+ resolve();
327
+ return;
328
+ }
329
+ this.#stream.end(() => resolve());
330
+ });
331
+ this.#stream = void 0;
332
+ if (!this.#spill.signal.aborted) this.#spill.abort();
333
+ if (!this.spilled) {
334
+ await unlink(this.pidPath).catch(() => void 0);
335
+ }
336
+ }
337
+ info() {
338
+ return {
339
+ id: this.id,
340
+ tool: this.tool,
341
+ command: this.command,
342
+ ...this.pid !== void 0 ? { pid: this.pid } : {},
343
+ ...this.logPath ? { logPath: this.logPath } : {},
344
+ startedAt: this.startedAt,
345
+ ...this.spilledAt !== void 0 ? { spilledAt: this.spilledAt } : {},
346
+ ...this.finishedAt !== void 0 ? { finishedAt: this.finishedAt } : {},
347
+ status: this.status,
348
+ ...this.exitCode !== void 0 ? { exitCode: this.exitCode } : {}
349
+ };
350
+ }
351
+ };
352
+ var trackShellOperations = (inner, job, tool) => ({
353
+ exec: (command, cwd, options) => inner.exec(wrapShellCommandForPid(command, job.pidPath, tool), cwd, {
354
+ ...options,
355
+ onData: (data) => {
356
+ job.append(data);
357
+ options.onData(data);
358
+ }
359
+ })
360
+ });
361
+ var FabricShellJobStore = class {
362
+ #jobs = /* @__PURE__ */ new Map();
363
+ begin(tool, command) {
364
+ const job = new FabricShellJob(tool, command);
365
+ this.#jobs.set(job.id, job);
366
+ return job;
367
+ }
368
+ get(id) {
369
+ return this.#jobs.get(id);
370
+ }
371
+ list() {
372
+ return [...this.#jobs.values()].map((job) => job.info());
373
+ }
374
+ waiting() {
375
+ return [...this.#jobs.values()].filter((job) => !job.spilled && !job.finished);
376
+ }
377
+ live() {
378
+ return [...this.#jobs.values()].filter((job) => !job.finished);
379
+ }
380
+ spillWaiting() {
381
+ const jobs = this.waiting();
382
+ for (const job of jobs) job.spill();
383
+ return jobs.length;
384
+ }
385
+ killWaiting() {
386
+ const jobs = this.waiting();
387
+ for (const job of jobs) {
388
+ if (!job.abort.signal.aborted) job.abort.abort(new Error("Command aborted"));
389
+ }
390
+ return jobs.length;
391
+ }
392
+ async close() {
393
+ const live = this.live();
394
+ for (const job of live) {
395
+ if (!job.abort.signal.aborted) job.abort.abort(new Error("Fabric session ended"));
396
+ }
397
+ await Promise.allSettled(live.map((job) => job.finish(null, "\n\n[Process ended: session closed]\n")));
398
+ this.#jobs.clear();
399
+ }
400
+ };
401
+ var raceShellHang = async (options) => {
402
+ const { job, parentSignal, hangMs } = options;
403
+ const onParentAbort = () => {
404
+ if (job.spilled || job.finished || job.abort.signal.aborted) return;
405
+ job.abort.abort(parentSignal?.reason ?? new Error("Command aborted"));
406
+ };
407
+ if (parentSignal) {
408
+ if (parentSignal.aborted) onParentAbort();
409
+ else parentSignal.addEventListener("abort", onParentAbort, { once: true });
410
+ }
411
+ const detachParent = () => {
412
+ parentSignal?.removeEventListener("abort", onParentAbort);
413
+ };
414
+ let hangTimer;
415
+ const hang = new Promise((resolve) => {
416
+ const finish = () => resolve("spill");
417
+ if (hangMs > 0) {
418
+ hangTimer = setTimeout(() => {
419
+ job.spill();
420
+ finish();
421
+ }, hangMs);
422
+ hangTimer.unref?.();
423
+ }
424
+ if (options.immediate) {
425
+ void job.readPid().then(() => {
426
+ if (!job.finished) job.spill();
427
+ });
428
+ }
429
+ void job.whenSpill().then(finish);
430
+ });
431
+ const execute = options.execute(job.abort.signal).then(
432
+ (value) => ({ status: "done", value }),
433
+ (error) => ({ status: "error", error })
434
+ );
435
+ try {
436
+ const first = await Promise.race([execute, hang]);
437
+ if (first === "spill") {
438
+ if (job.finished) return execute;
439
+ job.spill();
440
+ detachParent();
441
+ void execute.then(async (result) => {
442
+ if (job.finished) return;
443
+ if (result.status === "done") {
444
+ await job.finish(0, "\n\n[Process exited with code 0]\n");
445
+ return;
446
+ }
447
+ const message = result.error instanceof Error ? result.error.message : String(result.error);
448
+ await job.finish(null, "\n\n[" + message + "]\n");
449
+ });
450
+ return { status: "spilled" };
451
+ }
452
+ detachParent();
453
+ return first;
454
+ } finally {
455
+ if (hangTimer) clearTimeout(hangTimer);
456
+ }
457
+ };
458
+
459
+ // src/config.ts
460
+ import fs2 from "node:fs";
461
+ import os from "node:os";
462
+ import path3 from "node:path";
463
+
464
+ // src/core/damaged-file.ts
465
+ import fs from "node:fs";
466
+ import path2 from "node:path";
467
+ var quarantineDamagedFile = (filePath) => {
468
+ const destination = path2.join(
469
+ path2.dirname(filePath),
470
+ `${path2.basename(filePath)}.damaged.${process.pid}.${Date.now()}`
471
+ );
472
+ try {
473
+ fs.renameSync(filePath, destination);
474
+ return destination;
475
+ } catch {
476
+ return void 0;
477
+ }
478
+ };
479
+
480
+ // src/config-migrations.ts
481
+ var CURRENT_FABRIC_CONFIG_VERSION = 4;
482
+ var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
483
+ var mergeObjects = (base, override) => {
484
+ const merged = { ...base };
485
+ for (const [key, value] of Object.entries(override)) {
486
+ const current = merged[key];
487
+ merged[key] = isObject(current) && isObject(value) ? mergeObjects(current, value) : value;
488
+ }
489
+ return merged;
490
+ };
491
+ var migrations = [
492
+ {
493
+ from: 0,
494
+ to: 1,
495
+ migrate(document) {
496
+ const migrated = { ...document };
497
+ const legacy = migrated.subagents;
498
+ const canonical = migrated.agents;
499
+ if (legacy !== void 0) {
500
+ if (canonical !== void 0 && isObject(legacy) !== isObject(canonical)) {
501
+ throw new Error(
502
+ "Fabric configuration cannot merge legacy subagents with a malformed agents section"
503
+ );
504
+ }
505
+ migrated.agents = isObject(legacy) && isObject(canonical) ? mergeObjects(legacy, canonical) : canonical ?? legacy;
506
+ }
507
+ delete migrated.subagents;
508
+ return migrated;
509
+ }
510
+ },
511
+ {
512
+ from: 1,
513
+ to: 2,
514
+ migrate(document) {
515
+ const migrated = { ...document };
516
+ const ui = migrated.ui;
517
+ if (isObject(ui) && Object.hasOwn(ui, "showNestedToolCalls")) {
518
+ const renamed = { ...ui };
519
+ if (!Object.hasOwn(renamed, "showAgentToolPreview")) {
520
+ renamed.showAgentToolPreview = renamed.showNestedToolCalls;
521
+ }
522
+ delete renamed.showNestedToolCalls;
523
+ migrated.ui = renamed;
524
+ }
525
+ return migrated;
526
+ }
527
+ },
528
+ {
529
+ from: 2,
530
+ to: 3,
531
+ migrate(document) {
532
+ const migrated = { ...document };
533
+ const ui = migrated.ui;
534
+ if (isObject(ui) && Object.hasOwn(ui, "nestedToolDebounceMs")) {
535
+ const renamed = { ...ui };
536
+ if (!Object.hasOwn(renamed, "updateDebounceMs")) {
537
+ renamed.updateDebounceMs = renamed.nestedToolDebounceMs;
538
+ }
539
+ delete renamed.nestedToolDebounceMs;
540
+ migrated.ui = renamed;
541
+ }
542
+ return migrated;
543
+ }
544
+ },
545
+ {
546
+ from: 3,
547
+ to: 4,
548
+ migrate(document) {
549
+ const migrated = { ...document };
550
+ const prewalk = migrated.prewalk;
551
+ if (isObject(prewalk) && (prewalk.enabled === "true" || prewalk.enabled === "false")) {
552
+ migrated.prewalk = {
553
+ ...prewalk,
554
+ enabled: prewalk.enabled === "true"
555
+ };
556
+ }
557
+ return migrated;
558
+ }
559
+ }
560
+ ];
561
+ var configVersion = (document) => {
562
+ const value = document.configVersion;
563
+ if (value === void 0) return 0;
564
+ if (typeof value !== "number" || !Number.isInteger(value) || value < 0) {
565
+ throw new Error("Fabric configuration configVersion must be a non-negative integer");
566
+ }
567
+ return value;
568
+ };
569
+ var migrateFabricConfigDocument = (input) => {
570
+ const fromVersion = configVersion(input);
571
+ if (fromVersion > CURRENT_FABRIC_CONFIG_VERSION) {
572
+ return {
573
+ document: structuredClone(input),
574
+ fromVersion,
575
+ toVersion: fromVersion,
576
+ appliedVersions: [],
577
+ changed: false,
578
+ forwardCompatible: true
579
+ };
580
+ }
581
+ let version = fromVersion;
582
+ let document = structuredClone(input);
583
+ const appliedVersions = [];
584
+ while (version < CURRENT_FABRIC_CONFIG_VERSION) {
585
+ const migration = migrations.find((candidate) => candidate.from === version);
586
+ if (!migration || migration.to !== version + 1) {
587
+ throw new Error(`No Fabric configuration migration exists for version ${version}`);
588
+ }
589
+ document = migration.migrate(document);
590
+ version = migration.to;
591
+ document.configVersion = version;
592
+ appliedVersions.push(version);
593
+ }
594
+ if (Object.hasOwn(document, "subagents")) {
595
+ throw new Error("Current Fabric configuration contains removed key subagents");
596
+ }
597
+ return {
598
+ document,
599
+ fromVersion,
600
+ toVersion: version,
601
+ appliedVersions,
602
+ changed: appliedVersions.length > 0,
603
+ forwardCompatible: false
604
+ };
605
+ };
606
+
607
+ // src/config.ts
608
+ var MIN_COMPACTION_TOKEN_THRESHOLD = 1e3;
609
+ var MAX_COMPACTION_TOKEN_THRESHOLD = 1e8;
610
+ var MIN_COMPACTION_RATIO_THRESHOLD = 0.25;
611
+ var MAX_COMPACTION_RATIO_THRESHOLD = 0.95;
612
+ var clampCompactionTokenThreshold = (value) => Math.min(
613
+ MAX_COMPACTION_TOKEN_THRESHOLD,
614
+ Math.max(MIN_COMPACTION_TOKEN_THRESHOLD, Math.round(value))
615
+ );
616
+ var clampCompactionRatioThreshold = (value) => Math.min(
617
+ MAX_COMPACTION_RATIO_THRESHOLD,
618
+ Math.max(MIN_COMPACTION_RATIO_THRESHOLD, value)
619
+ );
620
+ var MAX_EXECUTOR_TIMEOUT_MS = 24 * 36e5;
621
+ var MIN_AGENT_TIMEOUT_MS = 1e3;
622
+ var MAX_AGENT_TIMEOUT_MS = 24 * 36e5;
623
+ var DEFAULT_AGENT_TIMEOUT_MS = MAX_AGENT_TIMEOUT_MS;
624
+ var QUICKJS_MAX_MEMORY_LIMIT_BYTES = 4294967295;
625
+ var MAX_EXECUTOR_MEMORY_LIMIT_BYTES = Math.max(
626
+ 8 * 1024 * 1024,
627
+ Math.min(Number.MAX_SAFE_INTEGER, Math.floor(os.totalmem()))
628
+ );
629
+ var maxExecutorMemoryLimitBytes = (runtime, kernel = "typescript") => kernel === "typescript" && runtime === "quickjs" ? Math.min(QUICKJS_MAX_MEMORY_LIMIT_BYTES, MAX_EXECUTOR_MEMORY_LIMIT_BYTES) : MAX_EXECUTOR_MEMORY_LIMIT_BYTES;
630
+ var DEFAULT_FABRIC_CONFIG = {
631
+ fullCodeMode: true,
632
+ executor: {
633
+ kernel: "typescript",
634
+ pythonRuntime: "monty",
635
+ cpython: { binary: "python3" },
636
+ runtime: "quickjs",
637
+ timeoutMs: 12e4,
638
+ maxTimeoutMs: 9e5,
639
+ hostCallTimeouts: {},
640
+ shellHangMs: DEFAULT_SHELL_HANG_MS,
641
+ memoryLimitBytes: 64 * 1024 * 1024,
642
+ maxOutputChars: 5e4,
643
+ maxNestedResultChars: 2e6,
644
+ resultFormat: "auto"
645
+ },
646
+ approvals: {
647
+ read: "allow",
648
+ write: "allow",
649
+ execute: "allow",
650
+ network: "allow",
651
+ agent: "allow"
652
+ },
653
+ mcp: {
654
+ enabled: true,
655
+ disableOAuth: true,
656
+ allowDynamicServers: true,
657
+ callTimeoutMs: 12e4,
658
+ cache: {
659
+ enabled: true,
660
+ revalidate: "changed",
661
+ revalidateBudgetMs: 6e4
662
+ }
663
+ },
664
+ prewalk: {
665
+ mode: "in-place",
666
+ alwaysRearm: false,
667
+ compactOnReturn: true,
668
+ detectShellWrites: true
669
+ },
670
+ agents: {
671
+ enabled: true,
672
+ runner: "pi",
673
+ transport: "process",
674
+ claude: { binary: "claude" },
675
+ veda: { binary: "veda", backend: "agy", persona: "navigator-chat" },
676
+ thinking: DEFAULT_FABRIC_THINKING,
677
+ maxConcurrent: 4,
678
+ maxPerExecution: 100,
679
+ maxDepth: 2,
680
+ timeoutMs: DEFAULT_AGENT_TIMEOUT_MS,
681
+ extensions: true,
682
+ defaultTools: ["read", "bash", "edit", "write", "grep", "find", "ls"],
683
+ retainRuns: false,
684
+ notifyOnComplete: true,
685
+ budgetUsd: 0,
686
+ maxTokensPerChild: 0,
687
+ sessionExport: true,
688
+ sessionExportDir: ""
689
+ },
690
+ jev: { ...DEFAULT_JEV_CONFIG, credentialCommand: [] },
691
+ components: [],
692
+ capture: {
693
+ enabled: true,
694
+ hideFromModel: true,
695
+ keepVisible: ["fabric_exec"],
696
+ defaultRisk: "execute",
697
+ risks: {
698
+ read: "read",
699
+ grep: "read",
700
+ find: "read",
701
+ ls: "read",
702
+ edit: "write",
703
+ write: "write",
704
+ bash: "execute",
705
+ fovea_sketch: "read",
706
+ fovea_focus: "read",
707
+ fovea_dwell: "read",
708
+ fovea_impact: "read"
709
+ }
710
+ },
711
+ ui: {
712
+ enabled: true,
713
+ widget: "auto",
714
+ maxRows: 6,
715
+ refreshMs: 500,
716
+ eventHistory: 80,
717
+ haltOnEscape: true,
718
+ showAgentToolPreview: true,
719
+ toolDisplay: "compact",
720
+ updateDebounceMs: 100
721
+ },
722
+ compaction: {
723
+ engine: "fabric",
724
+ targetContextRatio: 0.65,
725
+ thresholds: {},
726
+ tokenThresholds: {}
727
+ },
728
+ retention: {
729
+ orphanedTempRunMs: 6 * 60 * 60 * 1e3,
730
+ oneShotRunMs: 24 * 60 * 60 * 1e3,
731
+ actorRunArchiveMs: 7 * 24 * 60 * 60 * 1e3
732
+ },
733
+ mesh: {
734
+ enabled: true,
735
+ actorScope: "project",
736
+ maxEventBytes: 256 * 1024,
737
+ maxReadEvents: 500,
738
+ actorPollMs: 250,
739
+ actorQueueLimit: 32,
740
+ eventContextChars: 4e4,
741
+ actorContextEntries: 14
742
+ },
743
+ models: {
744
+ aliases: {}
745
+ },
746
+ memory: {
747
+ enabled: true,
748
+ maxSessions: 500,
749
+ maxEntryChars: 2e3,
750
+ indexThinking: false,
751
+ indexToolOutput: true,
752
+ hotSessions: 50,
753
+ digestTerms: 200,
754
+ maxColdVocabularyBytes: 512 * 1024,
755
+ maxColdCacheBytes: 1024 * 1024,
756
+ maxSyncSessions: 1e4,
757
+ maxSyncSourceBytes: 512 * 1024 * 1024,
758
+ maxCacheCleanupFiles: 1e5,
759
+ regexMaxPatternBytes: 1024,
760
+ regexMaxHaystackTerms: 2e4,
761
+ regexMaxHaystackBytes: 2 * 1024 * 1024,
762
+ regexTimeoutMs: 250
763
+ },
764
+ entropy: {
765
+ compile: true
766
+ },
767
+ repairs: {
768
+ enabled: true
769
+ },
770
+ schema: {
771
+ mode: "off",
772
+ certificateTtlMs: 3e4,
773
+ maxFiles: 100,
774
+ maxBytes: 10 * 1024 * 1024,
775
+ trustedCommands: {}
776
+ },
777
+ speculation: {
778
+ enabled: true,
779
+ maxConcurrent: 4,
780
+ maxEntries: 64,
781
+ maxBufferBytes: 2 * 1024 * 1024,
782
+ entryTtlMs: 18e4,
783
+ mcpAllowlist: []
784
+ },
785
+ codePreview: defaultCodePreviewSettings()
786
+ };
787
+ var readJsonObjectFile = (filePath) => {
788
+ let source;
789
+ try {
790
+ source = fs2.readFileSync(filePath, "utf8");
791
+ } catch (error) {
792
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") return void 0;
793
+ return void 0;
794
+ }
795
+ if (!source.trim()) return { document: {}, source };
796
+ try {
797
+ const parsed = JSON.parse(source);
798
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
799
+ quarantineDamagedFile(filePath);
800
+ return void 0;
801
+ }
802
+ return { document: parsed, source };
803
+ } catch {
804
+ quarantineDamagedFile(filePath);
805
+ return void 0;
806
+ }
807
+ };
808
+ var mergeObjects2 = (base, override) => {
809
+ const merged = { ...base };
810
+ for (const [key, value] of Object.entries(override)) {
811
+ const baseValue = merged[key];
812
+ if (typeof baseValue === "object" && baseValue !== null && !Array.isArray(baseValue) && typeof value === "object" && value !== null && !Array.isArray(value)) {
813
+ merged[key] = mergeObjects2(
814
+ baseValue,
815
+ value
816
+ );
817
+ } else {
818
+ merged[key] = value;
819
+ }
820
+ }
821
+ return merged;
822
+ };
823
+ var approvalMode = (value, fallback) => value === "allow" || value === "ask" || value === "auto" || value === "deny" ? value : fallback;
824
+ var booleanValue = (value, fallback) => typeof value === "boolean" ? value : fallback;
825
+ var boundedInteger = (value, fallback, min, max) => typeof value === "number" && Number.isInteger(value) ? Math.max(min, Math.min(max, value)) : fallback;
826
+ var boundedFloat = (value, fallback, min, max) => typeof value === "number" && Number.isFinite(value) ? Math.max(min, Math.min(max, value)) : fallback;
827
+ var stringValue = (value) => typeof value === "string" && value.trim() ? value : void 0;
828
+ var runnerValue = (value, fallback) => value === "pi" || value === "claude" || value === "veda" ? value : fallback;
829
+ var prewalkModeValue = (value, fallback) => value === "in-place" || value === "trajectory" ? value : fallback;
830
+ var transportValue = (value, fallback) => value === "auto" || value === "process" || value === "tmux" || value === "screen" || value === "localterm" || value === "herdr" ? value : fallback;
831
+ var thinkingValue = (value, fallback) => isFabricThinking(value) ? value : fallback;
832
+ var objectValue = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
833
+ var widgetModeValue = (value, fallback) => value === "auto" || value === "always" || value === "hidden" ? value : fallback;
834
+ var toolDisplayModeValue = (value, fallback) => value === "full" || value === "compact" ? value : fallback;
835
+ var executorKernelValue = (value, fallback) => value === "typescript" || value === "python" ? value : fallback;
836
+ var executorRuntimeValue = (value, fallback) => value === "quickjs" || value === "node-process" || value === "bun-process" ? value : fallback;
837
+ var resultFormatValue = (value, fallback) => value === "auto" || value === "yaml" || value === "json" || value === "text" ? value : fallback;
838
+ var compactionEngineValue = (value, fallback) => value === "pi" || value === "fabric" ? value : fallback;
839
+ var actorScopeValue = (value, fallback) => value === "project" || value === "session" ? value : fallback;
840
+ var schemaModeValue = (value, fallback) => value === "off" || value === "audit" || value === "enforce" ? value : fallback;
841
+ var mcpRevalidatePolicyValue = (value, fallback) => value === "changed" || value === "all" || value === "off" ? value : fallback;
842
+ var riskValue = (value, fallback) => value === "read" || value === "write" || value === "execute" || value === "network" || value === "agent" ? value : fallback;
843
+ var normalizeFabricConfig = (input) => {
844
+ const executor = objectValue(input.executor);
845
+ const cpython = objectValue(executor.cpython);
846
+ const executorKernel = executorKernelValue(executor.kernel, DEFAULT_FABRIC_CONFIG.executor.kernel);
847
+ const executorMaxTimeoutMs = boundedInteger(
848
+ executor.maxTimeoutMs,
849
+ DEFAULT_FABRIC_CONFIG.executor.maxTimeoutMs,
850
+ 1e3,
851
+ MAX_EXECUTOR_TIMEOUT_MS
852
+ );
853
+ const approvals = objectValue(input.approvals);
854
+ const mcp = objectValue(input.mcp);
855
+ const mcpCache = objectValue(mcp.cache);
856
+ const prewalk = objectValue(input.prewalk);
857
+ const agents = objectValue(input.agents);
858
+ const claude = objectValue(agents.claude);
859
+ const veda = objectValue(agents.veda);
860
+ const capture = objectValue(input.capture);
861
+ const ui = objectValue(input.ui);
862
+ const compaction = objectValue(input.compaction);
863
+ const retention = objectValue(input.retention);
864
+ const mesh = objectValue(input.mesh);
865
+ const memory = objectValue(input.memory);
866
+ const entropy = objectValue(input.entropy);
867
+ const repairs = objectValue(input.repairs);
868
+ const modelsSection = objectValue(input.models);
869
+ const schema = objectValue(input.schema);
870
+ const schemaMode = schemaModeValue(schema.mode, DEFAULT_FABRIC_CONFIG.schema.mode);
871
+ const speculation = objectValue(input.speculation);
872
+ const configuredExecutorRuntime = executorRuntimeValue(
873
+ executor.runtime,
874
+ DEFAULT_FABRIC_CONFIG.executor.runtime
875
+ );
876
+ const executorRuntime = schemaMode === "enforce" && executorKernel === "typescript" ? "quickjs" : configuredExecutorRuntime;
877
+ const configuredTools = Array.isArray(agents.defaultTools) ? agents.defaultTools.filter(
878
+ (tool) => typeof tool === "string" && Boolean(tool)
879
+ ) : DEFAULT_FABRIC_CONFIG.agents.defaultTools;
880
+ const approvalModel = stringValue(approvals.model);
881
+ const configPath = stringValue(mcp.configPath);
882
+ const meshRoot = stringValue(mesh.root);
883
+ const memoryIndexDir = stringValue(memory.indexDir);
884
+ const compactionThresholds = Object.fromEntries(
885
+ Object.entries(objectValue(compaction.thresholds)).filter(
886
+ ([model, threshold]) => model.includes("/") && typeof threshold === "number" && Number.isFinite(threshold)
887
+ ).map(([model, threshold]) => [
888
+ model,
889
+ clampCompactionRatioThreshold(threshold)
890
+ ])
891
+ );
892
+ const compactionTokenThresholds = Object.fromEntries(
893
+ Object.entries(objectValue(compaction.tokenThresholds)).filter(
894
+ ([model, tokens]) => model.includes("/") && typeof tokens === "number" && Number.isFinite(tokens)
895
+ ).map(([model, tokens]) => [
896
+ model,
897
+ clampCompactionTokenThreshold(tokens)
898
+ ])
899
+ );
900
+ const prewalkModel = stringValue(prewalk.model);
901
+ const prewalkThinking = isFabricThinking(prewalk.thinking) ? prewalk.thinking : void 0;
902
+ const agentModel = stringValue(agents.model);
903
+ const claudeBinary = stringValue(claude.binary);
904
+ const claudeModel = stringValue(claude.model);
905
+ const vedaBinary = stringValue(veda.binary);
906
+ const vedaBackend = stringValue(veda.backend);
907
+ const vedaModel = stringValue(veda.model);
908
+ const vedaPersona = stringValue(veda.persona);
909
+ const agentThinking = thinkingValue(agents.thinking, DEFAULT_FABRIC_CONFIG.agents.thinking);
910
+ const configuredComponents = Array.isArray(input.components) ? input.components.flatMap((raw) => {
911
+ const componentEntry = objectValue(raw);
912
+ const id = stringValue(componentEntry.id);
913
+ const component = stringValue(componentEntry.component);
914
+ if (!id || !component) return [];
915
+ return [{
916
+ id,
917
+ component,
918
+ ...Object.prototype.hasOwnProperty.call(componentEntry, "config") ? { config: componentEntry.config } : {},
919
+ ...typeof componentEntry.disabled === "boolean" ? { disabled: componentEntry.disabled } : {}
920
+ }];
921
+ }).slice(0, 256) : DEFAULT_FABRIC_CONFIG.components;
922
+ const configuredVisible = Array.isArray(capture.keepVisible) ? capture.keepVisible.filter(
923
+ (name) => typeof name === "string" && Boolean(name.trim())
924
+ ) : DEFAULT_FABRIC_CONFIG.capture.keepVisible;
925
+ const configuredRisks = {
926
+ ...DEFAULT_FABRIC_CONFIG.capture.risks,
927
+ ...objectValue(capture.risks)
928
+ };
929
+ const trustedCommands = Object.fromEntries(
930
+ Object.entries(objectValue(schema.trustedCommands)).flatMap(([name, raw]) => {
931
+ if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/.test(name)) return [];
932
+ const command = objectValue(raw);
933
+ const executable = stringValue(command.command);
934
+ if (!executable) return [];
935
+ const shell = booleanValue(command.shell, false);
936
+ const args = !shell && Array.isArray(command.args) ? command.args.filter((arg) => typeof arg === "string").slice(0, 64) : [];
937
+ return [[name, {
938
+ command: executable,
939
+ args,
940
+ shell,
941
+ timeoutMs: boundedInteger(command.timeoutMs, 3e4, 1, 3e5)
942
+ }]];
943
+ })
944
+ );
945
+ const risks = Object.fromEntries(
946
+ Object.entries(configuredRisks).filter(([name]) => Boolean(name.trim())).map(([name, risk]) => [name, riskValue(risk, DEFAULT_FABRIC_CONFIG.capture.defaultRisk)])
947
+ );
948
+ return {
949
+ fullCodeMode: booleanValue(input.fullCodeMode, DEFAULT_FABRIC_CONFIG.fullCodeMode),
950
+ executor: {
951
+ kernel: executorKernel,
952
+ pythonRuntime: executor.pythonRuntime === "cpython" ? "cpython" : "monty",
953
+ cpython: {
954
+ binary: stringValue(cpython.binary)?.trim() ?? DEFAULT_FABRIC_CONFIG.executor.cpython.binary
955
+ },
956
+ runtime: executorRuntime,
957
+ maxTimeoutMs: boundedInteger(
958
+ executor.maxTimeoutMs,
959
+ DEFAULT_FABRIC_CONFIG.executor.maxTimeoutMs,
960
+ 1e3,
961
+ MAX_EXECUTOR_TIMEOUT_MS
962
+ ),
963
+ hostCallTimeouts: Object.fromEntries(
964
+ Object.entries(objectValue(executor.hostCallTimeouts)).filter(
965
+ ([ref, value]) => typeof ref === "string" && Boolean(ref.trim()) && typeof value === "number" && Number.isFinite(value) && value >= 1
966
+ ).map(([ref, value]) => [ref, boundedInteger(value, 1e3, 1e3, executorMaxTimeoutMs)])
967
+ ),
968
+ timeoutMs: boundedInteger(
969
+ executor.timeoutMs,
970
+ DEFAULT_FABRIC_CONFIG.executor.timeoutMs,
971
+ 1e3,
972
+ executorMaxTimeoutMs
973
+ ),
974
+ shellHangMs: boundedInteger(
975
+ executor.shellHangMs,
976
+ DEFAULT_FABRIC_CONFIG.executor.shellHangMs,
977
+ 0,
978
+ Math.min(executorMaxTimeoutMs, SHELL_HANG_MAX_MS)
979
+ ),
980
+ memoryLimitBytes: boundedInteger(
981
+ executor.memoryLimitBytes,
982
+ DEFAULT_FABRIC_CONFIG.executor.memoryLimitBytes,
983
+ 8 * 1024 * 1024,
984
+ maxExecutorMemoryLimitBytes(executorRuntime, executorKernel)
985
+ ),
986
+ maxOutputChars: boundedInteger(
987
+ executor.maxOutputChars,
988
+ DEFAULT_FABRIC_CONFIG.executor.maxOutputChars,
989
+ 1e3,
990
+ 1e6
991
+ ),
992
+ maxNestedResultChars: boundedInteger(
993
+ executor.maxNestedResultChars,
994
+ DEFAULT_FABRIC_CONFIG.executor.maxNestedResultChars,
995
+ 1e4,
996
+ 2e7
997
+ ),
998
+ resultFormat: resultFormatValue(
999
+ executor.resultFormat,
1000
+ DEFAULT_FABRIC_CONFIG.executor.resultFormat
1001
+ )
1002
+ },
1003
+ approvals: {
1004
+ read: approvalMode(approvals.read, DEFAULT_FABRIC_CONFIG.approvals.read),
1005
+ write: approvalMode(approvals.write, DEFAULT_FABRIC_CONFIG.approvals.write),
1006
+ execute: approvalMode(approvals.execute, DEFAULT_FABRIC_CONFIG.approvals.execute),
1007
+ network: approvalMode(approvals.network, DEFAULT_FABRIC_CONFIG.approvals.network),
1008
+ agent: approvalMode(approvals.agent, DEFAULT_FABRIC_CONFIG.approvals.agent),
1009
+ ...approvalModel ? { model: approvalModel } : {}
1010
+ },
1011
+ mcp: {
1012
+ enabled: booleanValue(mcp.enabled, DEFAULT_FABRIC_CONFIG.mcp.enabled),
1013
+ ...configPath ? { configPath } : {},
1014
+ disableOAuth: booleanValue(mcp.disableOAuth, DEFAULT_FABRIC_CONFIG.mcp.disableOAuth),
1015
+ allowDynamicServers: booleanValue(
1016
+ mcp.allowDynamicServers,
1017
+ DEFAULT_FABRIC_CONFIG.mcp.allowDynamicServers
1018
+ ),
1019
+ callTimeoutMs: boundedInteger(
1020
+ mcp.callTimeoutMs,
1021
+ DEFAULT_FABRIC_CONFIG.mcp.callTimeoutMs,
1022
+ 1e3,
1023
+ 9e5
1024
+ ),
1025
+ cache: {
1026
+ enabled: booleanValue(mcpCache.enabled, DEFAULT_FABRIC_CONFIG.mcp.cache.enabled),
1027
+ revalidate: mcpRevalidatePolicyValue(
1028
+ mcpCache.revalidate,
1029
+ DEFAULT_FABRIC_CONFIG.mcp.cache.revalidate
1030
+ ),
1031
+ revalidateBudgetMs: boundedInteger(
1032
+ mcpCache.revalidateBudgetMs,
1033
+ DEFAULT_FABRIC_CONFIG.mcp.cache.revalidateBudgetMs,
1034
+ 1e3,
1035
+ 6e5
1036
+ )
1037
+ }
1038
+ },
1039
+ prewalk: {
1040
+ ...prewalk.enabled === false ? { enabled: false } : {},
1041
+ mode: prewalkModeValue(prewalk.mode, DEFAULT_FABRIC_CONFIG.prewalk.mode),
1042
+ ...prewalkModel ? { model: prewalkModel } : {},
1043
+ ...prewalkThinking ? { thinking: prewalkThinking } : {},
1044
+ alwaysRearm: booleanValue(
1045
+ prewalk.alwaysRearm,
1046
+ DEFAULT_FABRIC_CONFIG.prewalk.alwaysRearm
1047
+ ),
1048
+ compactOnReturn: booleanValue(
1049
+ prewalk.compactOnReturn,
1050
+ DEFAULT_FABRIC_CONFIG.prewalk.compactOnReturn
1051
+ ),
1052
+ detectShellWrites: booleanValue(
1053
+ prewalk.detectShellWrites,
1054
+ DEFAULT_FABRIC_CONFIG.prewalk.detectShellWrites
1055
+ )
1056
+ },
1057
+ agents: {
1058
+ enabled: booleanValue(agents.enabled, DEFAULT_FABRIC_CONFIG.agents.enabled),
1059
+ runner: runnerValue(agents.runner, DEFAULT_FABRIC_CONFIG.agents.runner),
1060
+ transport: transportValue(agents.transport, DEFAULT_FABRIC_CONFIG.agents.transport),
1061
+ ...agentModel ? { model: agentModel } : {},
1062
+ claude: {
1063
+ binary: claudeBinary ?? DEFAULT_FABRIC_CONFIG.agents.claude.binary,
1064
+ ...claudeModel ? { model: claudeModel } : {}
1065
+ },
1066
+ veda: {
1067
+ binary: vedaBinary ?? DEFAULT_FABRIC_CONFIG.agents.veda.binary,
1068
+ backend: vedaBackend ?? DEFAULT_FABRIC_CONFIG.agents.veda.backend,
1069
+ ...vedaModel ? { model: vedaModel } : {},
1070
+ persona: vedaPersona ?? DEFAULT_FABRIC_CONFIG.agents.veda.persona
1071
+ },
1072
+ thinking: agentThinking,
1073
+ maxConcurrent: boundedInteger(
1074
+ agents.maxConcurrent,
1075
+ DEFAULT_FABRIC_CONFIG.agents.maxConcurrent,
1076
+ 1,
1077
+ 32
1078
+ ),
1079
+ maxPerExecution: boundedInteger(
1080
+ agents.maxPerExecution,
1081
+ DEFAULT_FABRIC_CONFIG.agents.maxPerExecution,
1082
+ 1,
1083
+ 1e3
1084
+ ),
1085
+ maxDepth: boundedInteger(
1086
+ agents.maxDepth,
1087
+ DEFAULT_FABRIC_CONFIG.agents.maxDepth,
1088
+ 0,
1089
+ Number.MAX_SAFE_INTEGER
1090
+ ),
1091
+ timeoutMs: boundedInteger(
1092
+ agents.timeoutMs,
1093
+ DEFAULT_FABRIC_CONFIG.agents.timeoutMs,
1094
+ MIN_AGENT_TIMEOUT_MS,
1095
+ MAX_AGENT_TIMEOUT_MS
1096
+ ),
1097
+ extensions: booleanValue(agents.extensions, DEFAULT_FABRIC_CONFIG.agents.extensions),
1098
+ defaultTools: configuredTools,
1099
+ retainRuns: booleanValue(agents.retainRuns, DEFAULT_FABRIC_CONFIG.agents.retainRuns),
1100
+ notifyOnComplete: booleanValue(
1101
+ agents.notifyOnComplete,
1102
+ DEFAULT_FABRIC_CONFIG.agents.notifyOnComplete
1103
+ ),
1104
+ budgetUsd: boundedFloat(
1105
+ agents.budgetUsd,
1106
+ DEFAULT_FABRIC_CONFIG.agents.budgetUsd,
1107
+ 0,
1108
+ 1e6
1109
+ ),
1110
+ maxTokensPerChild: boundedInteger(
1111
+ agents.maxTokensPerChild,
1112
+ DEFAULT_FABRIC_CONFIG.agents.maxTokensPerChild,
1113
+ 0,
1114
+ 1e8
1115
+ ),
1116
+ sessionExport: booleanValue(
1117
+ agents.sessionExport,
1118
+ DEFAULT_FABRIC_CONFIG.agents.sessionExport
1119
+ ),
1120
+ sessionExportDir: typeof agents.sessionExportDir === "string" ? agents.sessionExportDir : DEFAULT_FABRIC_CONFIG.agents.sessionExportDir
1121
+ },
1122
+ jev: normalizeJevConfig(input.jev),
1123
+ components: configuredComponents.map((entry) => structuredClone(entry)),
1124
+ capture: {
1125
+ enabled: booleanValue(capture.enabled, DEFAULT_FABRIC_CONFIG.capture.enabled),
1126
+ hideFromModel: booleanValue(
1127
+ capture.hideFromModel,
1128
+ DEFAULT_FABRIC_CONFIG.capture.hideFromModel
1129
+ ),
1130
+ keepVisible: [...new Set(configuredVisible)],
1131
+ defaultRisk: riskValue(capture.defaultRisk, DEFAULT_FABRIC_CONFIG.capture.defaultRisk),
1132
+ risks
1133
+ },
1134
+ ui: {
1135
+ enabled: booleanValue(ui.enabled, DEFAULT_FABRIC_CONFIG.ui.enabled),
1136
+ widget: widgetModeValue(ui.widget, DEFAULT_FABRIC_CONFIG.ui.widget),
1137
+ maxRows: boundedInteger(ui.maxRows, DEFAULT_FABRIC_CONFIG.ui.maxRows, 1, 20),
1138
+ refreshMs: boundedInteger(ui.refreshMs, DEFAULT_FABRIC_CONFIG.ui.refreshMs, 100, 1e4),
1139
+ eventHistory: boundedInteger(
1140
+ ui.eventHistory,
1141
+ DEFAULT_FABRIC_CONFIG.ui.eventHistory,
1142
+ 1,
1143
+ 500
1144
+ ),
1145
+ haltOnEscape: booleanValue(ui.haltOnEscape, DEFAULT_FABRIC_CONFIG.ui.haltOnEscape),
1146
+ // Renamed from ui.showNestedToolCalls; the v2 migration rewrites persisted
1147
+ // files, and this fallback covers configs normalized without migration.
1148
+ showAgentToolPreview: booleanValue(
1149
+ ui.showAgentToolPreview ?? ui.showNestedToolCalls,
1150
+ DEFAULT_FABRIC_CONFIG.ui.showAgentToolPreview
1151
+ ),
1152
+ toolDisplay: toolDisplayModeValue(
1153
+ ui.toolDisplay,
1154
+ DEFAULT_FABRIC_CONFIG.ui.toolDisplay
1155
+ ),
1156
+ // Renamed from ui.nestedToolDebounceMs (v3): the window coalesces every
1157
+ // live fabric_exec card update — nested calls, progress, agent previews.
1158
+ updateDebounceMs: boundedInteger(
1159
+ ui.updateDebounceMs ?? ui.nestedToolDebounceMs,
1160
+ DEFAULT_FABRIC_CONFIG.ui.updateDebounceMs,
1161
+ 0,
1162
+ 2e3
1163
+ )
1164
+ },
1165
+ compaction: {
1166
+ engine: compactionEngineValue(compaction.engine, DEFAULT_FABRIC_CONFIG.compaction.engine),
1167
+ targetContextRatio: boundedFloat(
1168
+ compaction.targetContextRatio,
1169
+ DEFAULT_FABRIC_CONFIG.compaction.targetContextRatio,
1170
+ 0.25,
1171
+ 0.85
1172
+ ),
1173
+ thresholds: compactionThresholds,
1174
+ tokenThresholds: compactionTokenThresholds
1175
+ },
1176
+ retention: {
1177
+ orphanedTempRunMs: boundedInteger(
1178
+ retention.orphanedTempRunMs,
1179
+ DEFAULT_FABRIC_CONFIG.retention.orphanedTempRunMs,
1180
+ 60 * 60 * 1e3,
1181
+ 365 * 24 * 60 * 60 * 1e3
1182
+ ),
1183
+ oneShotRunMs: boundedInteger(
1184
+ retention.oneShotRunMs,
1185
+ DEFAULT_FABRIC_CONFIG.retention.oneShotRunMs,
1186
+ 60 * 60 * 1e3,
1187
+ 365 * 24 * 60 * 60 * 1e3
1188
+ ),
1189
+ actorRunArchiveMs: boundedInteger(
1190
+ retention.actorRunArchiveMs,
1191
+ DEFAULT_FABRIC_CONFIG.retention.actorRunArchiveMs,
1192
+ 60 * 60 * 1e3,
1193
+ 365 * 24 * 60 * 60 * 1e3
1194
+ )
1195
+ },
1196
+ mesh: {
1197
+ enabled: booleanValue(mesh.enabled, DEFAULT_FABRIC_CONFIG.mesh.enabled),
1198
+ ...meshRoot ? { root: meshRoot } : {},
1199
+ actorScope: actorScopeValue(mesh.actorScope, DEFAULT_FABRIC_CONFIG.mesh.actorScope),
1200
+ maxEventBytes: boundedInteger(
1201
+ mesh.maxEventBytes,
1202
+ DEFAULT_FABRIC_CONFIG.mesh.maxEventBytes,
1203
+ 1024,
1204
+ 4 * 1024 * 1024
1205
+ ),
1206
+ maxReadEvents: boundedInteger(
1207
+ mesh.maxReadEvents,
1208
+ DEFAULT_FABRIC_CONFIG.mesh.maxReadEvents,
1209
+ 1,
1210
+ 1e4
1211
+ ),
1212
+ actorPollMs: boundedInteger(
1213
+ mesh.actorPollMs,
1214
+ DEFAULT_FABRIC_CONFIG.mesh.actorPollMs,
1215
+ 50,
1216
+ 1e4
1217
+ ),
1218
+ actorQueueLimit: boundedInteger(
1219
+ mesh.actorQueueLimit,
1220
+ DEFAULT_FABRIC_CONFIG.mesh.actorQueueLimit,
1221
+ 1,
1222
+ 1e3
1223
+ ),
1224
+ eventContextChars: boundedInteger(
1225
+ mesh.eventContextChars,
1226
+ DEFAULT_FABRIC_CONFIG.mesh.eventContextChars,
1227
+ 1e3,
1228
+ 1e6
1229
+ ),
1230
+ actorContextEntries: boundedInteger(
1231
+ mesh.actorContextEntries,
1232
+ DEFAULT_FABRIC_CONFIG.mesh.actorContextEntries,
1233
+ 1,
1234
+ 100
1235
+ )
1236
+ },
1237
+ models: {
1238
+ aliases: normalizeModelAliases(modelsSection.aliases)
1239
+ },
1240
+ memory: {
1241
+ enabled: booleanValue(memory.enabled, DEFAULT_FABRIC_CONFIG.memory.enabled),
1242
+ ...memoryIndexDir ? { indexDir: memoryIndexDir } : {},
1243
+ maxSessions: boundedInteger(
1244
+ memory.maxSessions,
1245
+ DEFAULT_FABRIC_CONFIG.memory.maxSessions,
1246
+ 1,
1247
+ 1e5
1248
+ ),
1249
+ maxEntryChars: boundedInteger(
1250
+ memory.maxEntryChars,
1251
+ DEFAULT_FABRIC_CONFIG.memory.maxEntryChars,
1252
+ 100,
1253
+ 1e6
1254
+ ),
1255
+ indexThinking: booleanValue(
1256
+ memory.indexThinking,
1257
+ DEFAULT_FABRIC_CONFIG.memory.indexThinking ?? false
1258
+ ),
1259
+ indexToolOutput: booleanValue(
1260
+ memory.indexToolOutput,
1261
+ DEFAULT_FABRIC_CONFIG.memory.indexToolOutput ?? true
1262
+ ),
1263
+ hotSessions: boundedInteger(
1264
+ memory.hotSessions,
1265
+ DEFAULT_FABRIC_CONFIG.memory.hotSessions ?? 50,
1266
+ 0,
1267
+ 1e5
1268
+ ),
1269
+ digestTerms: boundedInteger(
1270
+ memory.digestTerms,
1271
+ DEFAULT_FABRIC_CONFIG.memory.digestTerms ?? 200,
1272
+ 1,
1273
+ 1e4
1274
+ ),
1275
+ maxColdVocabularyBytes: boundedInteger(
1276
+ memory.maxColdVocabularyBytes,
1277
+ DEFAULT_FABRIC_CONFIG.memory.maxColdVocabularyBytes ?? 512 * 1024,
1278
+ 2,
1279
+ 64 * 1024 * 1024
1280
+ ),
1281
+ maxColdCacheBytes: boundedInteger(
1282
+ memory.maxColdCacheBytes,
1283
+ DEFAULT_FABRIC_CONFIG.memory.maxColdCacheBytes ?? 1024 * 1024,
1284
+ 512,
1285
+ 128 * 1024 * 1024
1286
+ ),
1287
+ maxSyncSessions: boundedInteger(
1288
+ memory.maxSyncSessions,
1289
+ DEFAULT_FABRIC_CONFIG.memory.maxSyncSessions ?? 1e4,
1290
+ 1,
1291
+ 1e6
1292
+ ),
1293
+ maxSyncSourceBytes: boundedInteger(
1294
+ memory.maxSyncSourceBytes,
1295
+ DEFAULT_FABRIC_CONFIG.memory.maxSyncSourceBytes ?? 512 * 1024 * 1024,
1296
+ 1024,
1297
+ 8 * 1024 * 1024 * 1024
1298
+ ),
1299
+ maxCacheCleanupFiles: boundedInteger(
1300
+ memory.maxCacheCleanupFiles,
1301
+ DEFAULT_FABRIC_CONFIG.memory.maxCacheCleanupFiles ?? 1e5,
1302
+ 1,
1303
+ 1e6
1304
+ ),
1305
+ regexMaxPatternBytes: boundedInteger(
1306
+ memory.regexMaxPatternBytes,
1307
+ DEFAULT_FABRIC_CONFIG.memory.regexMaxPatternBytes ?? 1024,
1308
+ 1,
1309
+ 64 * 1024
1310
+ ),
1311
+ regexMaxHaystackTerms: boundedInteger(
1312
+ memory.regexMaxHaystackTerms,
1313
+ DEFAULT_FABRIC_CONFIG.memory.regexMaxHaystackTerms ?? 2e4,
1314
+ 1,
1315
+ 1e6
1316
+ ),
1317
+ regexMaxHaystackBytes: boundedInteger(
1318
+ memory.regexMaxHaystackBytes,
1319
+ DEFAULT_FABRIC_CONFIG.memory.regexMaxHaystackBytes ?? 2 * 1024 * 1024,
1320
+ 1024,
1321
+ 128 * 1024 * 1024
1322
+ ),
1323
+ regexTimeoutMs: boundedInteger(
1324
+ memory.regexTimeoutMs,
1325
+ DEFAULT_FABRIC_CONFIG.memory.regexTimeoutMs ?? 250,
1326
+ 10,
1327
+ 1e4
1328
+ )
1329
+ },
1330
+ entropy: {
1331
+ compile: booleanValue(entropy.compile, DEFAULT_FABRIC_CONFIG.entropy.compile)
1332
+ },
1333
+ repairs: {
1334
+ enabled: booleanValue(repairs.enabled, DEFAULT_FABRIC_CONFIG.repairs.enabled)
1335
+ },
1336
+ schema: {
1337
+ mode: schemaMode,
1338
+ certificateTtlMs: boundedInteger(
1339
+ schema.certificateTtlMs,
1340
+ DEFAULT_FABRIC_CONFIG.schema.certificateTtlMs,
1341
+ 1e3,
1342
+ 10 * 6e4
1343
+ ),
1344
+ maxFiles: boundedInteger(
1345
+ schema.maxFiles,
1346
+ DEFAULT_FABRIC_CONFIG.schema.maxFiles,
1347
+ 1,
1348
+ 1e3
1349
+ ),
1350
+ maxBytes: boundedInteger(
1351
+ schema.maxBytes,
1352
+ DEFAULT_FABRIC_CONFIG.schema.maxBytes,
1353
+ 1024,
1354
+ 100 * 1024 * 1024
1355
+ ),
1356
+ trustedCommands
1357
+ },
1358
+ speculation: {
1359
+ enabled: booleanValue(
1360
+ speculation.enabled,
1361
+ DEFAULT_FABRIC_CONFIG.speculation.enabled
1362
+ ),
1363
+ maxConcurrent: boundedInteger(
1364
+ speculation.maxConcurrent,
1365
+ DEFAULT_FABRIC_CONFIG.speculation.maxConcurrent,
1366
+ 1,
1367
+ 32
1368
+ ),
1369
+ maxEntries: boundedInteger(
1370
+ speculation.maxEntries,
1371
+ DEFAULT_FABRIC_CONFIG.speculation.maxEntries,
1372
+ 1,
1373
+ 1024
1374
+ ),
1375
+ maxBufferBytes: boundedInteger(
1376
+ speculation.maxBufferBytes,
1377
+ DEFAULT_FABRIC_CONFIG.speculation.maxBufferBytes,
1378
+ 64 * 1024,
1379
+ 64 * 1024 * 1024
1380
+ ),
1381
+ entryTtlMs: boundedInteger(
1382
+ speculation.entryTtlMs,
1383
+ DEFAULT_FABRIC_CONFIG.speculation.entryTtlMs,
1384
+ 5e3,
1385
+ 30 * 6e4
1386
+ ),
1387
+ mcpAllowlist: [
1388
+ ...new Set(
1389
+ (Array.isArray(speculation.mcpAllowlist) ? speculation.mcpAllowlist : []).filter(
1390
+ (entry) => typeof entry === "string" && entry.trim().length > 0
1391
+ ).map((entry) => entry.trim().slice(0, 256))
1392
+ )
1393
+ ].slice(0, 256)
1394
+ },
1395
+ codePreview: normalizeCodePreviewSettings(input.codePreview)
1396
+ };
1397
+ };
1398
+ var effectiveToolCaptureConfig = (config) => config.schema?.mode === "enforce" ? {
1399
+ ...config.capture,
1400
+ enabled: true,
1401
+ hideFromModel: true,
1402
+ keepVisible: ["fabric_exec"],
1403
+ risks: { ...config.capture.risks }
1404
+ } : config.fullCodeMode ? {
1405
+ ...config.capture,
1406
+ keepVisible: config.capture.keepVisible.filter(
1407
+ (name) => !PI_CORE_TOOL_NAME_SET.has(name)
1408
+ ),
1409
+ risks: { ...config.capture.risks }
1410
+ } : {
1411
+ ...config.capture,
1412
+ enabled: false,
1413
+ hideFromModel: false,
1414
+ keepVisible: [...config.capture.keepVisible],
1415
+ risks: { ...config.capture.risks }
1416
+ };
1417
+ var planConfigFile = (filePath) => {
1418
+ const input = readJsonObjectFile(filePath);
1419
+ if (!input) return void 0;
1420
+ const migration = migrateFabricConfigDocument(input.document);
1421
+ return {
1422
+ path: filePath,
1423
+ document: migration.document,
1424
+ source: input.source,
1425
+ changed: migration.changed
1426
+ };
1427
+ };
1428
+ var writeJsonAtomic = (filePath, document, expectedSource) => {
1429
+ const resolvedPath = fs2.existsSync(filePath) ? fs2.realpathSync(filePath) : filePath;
1430
+ const directory = path3.dirname(resolvedPath);
1431
+ if (!fs2.existsSync(directory)) fs2.mkdirSync(directory, { recursive: true });
1432
+ const mode = fs2.existsSync(resolvedPath) ? fs2.statSync(resolvedPath).mode & 511 : 384;
1433
+ const temporaryPath = path3.join(
1434
+ directory,
1435
+ `.${path3.basename(resolvedPath)}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`
1436
+ );
1437
+ let descriptor;
1438
+ try {
1439
+ descriptor = fs2.openSync(temporaryPath, "wx", mode);
1440
+ fs2.writeFileSync(descriptor, `${JSON.stringify(document, null, 2)}
1441
+ `, "utf8");
1442
+ fs2.fsyncSync(descriptor);
1443
+ fs2.closeSync(descriptor);
1444
+ descriptor = void 0;
1445
+ if (expectedSource === null) {
1446
+ if (fs2.existsSync(resolvedPath)) {
1447
+ throw new Error(`Fabric configuration changed while updating ${filePath}`);
1448
+ }
1449
+ } else {
1450
+ let currentSource;
1451
+ try {
1452
+ currentSource = fs2.readFileSync(resolvedPath, "utf8");
1453
+ } catch (error) {
1454
+ throw new Error(`Fabric configuration changed while updating ${filePath}`, { cause: error });
1455
+ }
1456
+ if (currentSource !== expectedSource) {
1457
+ throw new Error(`Fabric configuration changed while updating ${filePath}`);
1458
+ }
1459
+ }
1460
+ renameAtomic(temporaryPath, resolvedPath);
1461
+ try {
1462
+ const directoryDescriptor = fs2.openSync(directory, "r");
1463
+ try {
1464
+ fs2.fsyncSync(directoryDescriptor);
1465
+ } finally {
1466
+ fs2.closeSync(directoryDescriptor);
1467
+ }
1468
+ } catch (error) {
1469
+ const code = error instanceof Error && "code" in error ? error.code : void 0;
1470
+ if (code !== "EINVAL" && code !== "ENOTSUP" && code !== "EISDIR" && code !== "EPERM") throw error;
1471
+ }
1472
+ } catch (error) {
1473
+ if (descriptor !== void 0) fs2.closeSync(descriptor);
1474
+ fs2.rmSync(temporaryPath, { force: true });
1475
+ throw error;
1476
+ }
1477
+ };
1478
+ var resolveFabricConfig = (options, includeProject, applyEnvironmentOverrides) => {
1479
+ let merged = structuredClone(DEFAULT_FABRIC_CONFIG);
1480
+ const plans = [
1481
+ planConfigFile(path3.join(options.agentDir, "fabric.json")),
1482
+ ...includeProject ? [planConfigFile(path3.join(options.cwd, ".pi", "fabric.json"))] : []
1483
+ ].filter((plan) => plan !== void 0);
1484
+ for (const plan of plans) {
1485
+ if (plan.changed) writeJsonAtomic(plan.path, plan.document, plan.source);
1486
+ merged = mergeObjects2(merged, plan.document);
1487
+ }
1488
+ const inheritedKernel = process.env.PI_FABRIC_KERNEL;
1489
+ if (applyEnvironmentOverrides && inheritedKernel !== void 0) {
1490
+ if (inheritedKernel !== "typescript" && inheritedKernel !== "python") {
1491
+ throw new Error(`Invalid PI_FABRIC_KERNEL: ${inheritedKernel}; expected typescript or python`);
1492
+ }
1493
+ merged.executor = { ...objectValue(merged.executor), kernel: inheritedKernel };
1494
+ }
1495
+ const inheritedPythonRuntime = process.env.PI_FABRIC_PYTHON_RUNTIME;
1496
+ if (applyEnvironmentOverrides && inheritedPythonRuntime !== void 0) {
1497
+ if (inheritedPythonRuntime !== "cpython" && inheritedPythonRuntime !== "monty") {
1498
+ throw new Error(`Invalid PI_FABRIC_PYTHON_RUNTIME: ${inheritedPythonRuntime}; expected cpython or monty`);
1499
+ }
1500
+ merged.executor = { ...objectValue(merged.executor), pythonRuntime: inheritedPythonRuntime };
1501
+ }
1502
+ const inheritedFullCodeMode = process.env.PI_FABRIC_FULL_CODE_MODE;
1503
+ if (applyEnvironmentOverrides && (inheritedFullCodeMode === "true" || inheritedFullCodeMode === "false")) {
1504
+ merged.fullCodeMode = inheritedFullCodeMode === "true";
1505
+ }
1506
+ return normalizeFabricConfig(merged);
1507
+ };
1508
+ var loadFabricConfigForScope = (options, scope) => {
1509
+ if (scope === "project" && !options.projectTrusted) {
1510
+ throw new Error("Cannot load project Fabric configuration for an untrusted project");
1511
+ }
1512
+ return resolveFabricConfig(options, scope === "project", false);
1513
+ };
1514
+ var loadFabricConfig = (options) => {
1515
+ const config = resolveFabricConfig(options, options.projectTrusted, true);
1516
+ if (config.compaction.engine === "fabric") {
1517
+ process.env.PI_FABRIC_COMPACTION_ENGINE = "fabric";
1518
+ } else {
1519
+ delete process.env.PI_FABRIC_COMPACTION_ENGINE;
1520
+ }
1521
+ return config;
1522
+ };
1523
+ var saveFabricConfig = (options, partial) => {
1524
+ const scope = options.scope ?? (options.projectTrusted ? "project" : "global");
1525
+ if (scope === "project" && !options.projectTrusted) {
1526
+ throw new Error("Cannot save project Fabric configuration for an untrusted project");
1527
+ }
1528
+ const targetPath = scope === "project" ? path3.join(options.cwd, ".pi", "fabric.json") : path3.join(options.agentDir, "fabric.json");
1529
+ if (Object.hasOwn(partial, "configVersion") || Object.hasOwn(partial, "subagents")) {
1530
+ throw new Error("Fabric configuration updates must use the current schema");
1531
+ }
1532
+ const input = readJsonObjectFile(targetPath);
1533
+ const existing = migrateFabricConfigDocument(input?.document ?? {}).document;
1534
+ const merged = mergeObjects2(existing, partial);
1535
+ merged.configVersion = Math.max(
1536
+ typeof merged.configVersion === "number" ? merged.configVersion : 0,
1537
+ CURRENT_FABRIC_CONFIG_VERSION
1538
+ );
1539
+ writeJsonAtomic(targetPath, merged, input?.source ?? null);
1540
+ return { scope, path: targetPath };
1541
+ };
1542
+
1543
+ export {
1544
+ quarantineDamagedFile,
1545
+ FUZZY_RESOLUTION_MARKERS,
1546
+ normalizeModelAliases,
1547
+ resolveFabricModel,
1548
+ resolveAvailablePiModel,
1549
+ DEFAULT_SHELL_HANG_MS,
1550
+ formatShellHangNotice,
1551
+ appendShellHangNotice,
1552
+ trackShellOperations,
1553
+ FabricShellJobStore,
1554
+ raceShellHang,
1555
+ MIN_COMPACTION_TOKEN_THRESHOLD,
1556
+ MAX_COMPACTION_TOKEN_THRESHOLD,
1557
+ MIN_COMPACTION_RATIO_THRESHOLD,
1558
+ MAX_COMPACTION_RATIO_THRESHOLD,
1559
+ clampCompactionTokenThreshold,
1560
+ clampCompactionRatioThreshold,
1561
+ MAX_EXECUTOR_TIMEOUT_MS,
1562
+ MIN_AGENT_TIMEOUT_MS,
1563
+ MAX_AGENT_TIMEOUT_MS,
1564
+ QUICKJS_MAX_MEMORY_LIMIT_BYTES,
1565
+ maxExecutorMemoryLimitBytes,
1566
+ DEFAULT_FABRIC_CONFIG,
1567
+ effectiveToolCaptureConfig,
1568
+ loadFabricConfigForScope,
1569
+ loadFabricConfig,
1570
+ saveFabricConfig
1571
+ };
1572
+ //# sourceMappingURL=chunk-UDFDF7IY.js.map