@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,1125 @@
1
+ import {
2
+ clip,
3
+ compactRedactedValue,
4
+ contentText,
5
+ messageError,
6
+ recordOf,
7
+ redact,
8
+ redactRecord,
9
+ terminalSafe,
10
+ unwrapActorEnvelopeText
11
+ } from "./chunk-DLXPTBPL.js";
12
+ import {
13
+ readJsonlPageFromDescriptor
14
+ } from "./chunk-CGPK5WHX.js";
15
+
16
+ // src/util.ts
17
+ var countNewlines = (value) => {
18
+ let count = 0;
19
+ for (let index = 0; index < value.length; index++) {
20
+ if (value.charCodeAt(index) === 10) count++;
21
+ }
22
+ return count;
23
+ };
24
+ var truncateMiddle = (value, maxChars) => {
25
+ if (value.length <= maxChars) return value;
26
+ const marker = `
27
+
28
+ ... ${value.length - maxChars} characters omitted by Pi Fabric ...
29
+
30
+ `;
31
+ const available = Math.max(0, maxChars - marker.length);
32
+ const head = Math.ceil(available / 2);
33
+ const tail = Math.floor(available / 2);
34
+ return `${value.slice(0, head)}${marker}${value.slice(value.length - tail)}`;
35
+ };
36
+
37
+ // src/core/call-preview.ts
38
+ var HEADLINE_ARG_KEYS = [
39
+ "task",
40
+ "path",
41
+ "query",
42
+ "message",
43
+ "search",
44
+ "pattern",
45
+ "command",
46
+ "text",
47
+ "prompt",
48
+ "question",
49
+ "input",
50
+ "content",
51
+ "expression",
52
+ "url",
53
+ "topic",
54
+ "key",
55
+ "filter",
56
+ "name",
57
+ "q"
58
+ ];
59
+ var HEADLINE_SKIP_KEYS = /* @__PURE__ */ new Set([
60
+ "label",
61
+ "title",
62
+ "type",
63
+ "kind",
64
+ "mode",
65
+ "format",
66
+ "resultFormat",
67
+ "limit",
68
+ "max",
69
+ "offset",
70
+ "start",
71
+ "concurrency",
72
+ "overwrite",
73
+ "id",
74
+ "provider",
75
+ "namespace",
76
+ "server",
77
+ "tool",
78
+ "ref",
79
+ "recursive",
80
+ "synthesize",
81
+ "commandDigest"
82
+ ]);
83
+ var cleanOneLine = (value, max) => {
84
+ const single = value.replace(/\s+/g, " ").trim();
85
+ if (!single) return "";
86
+ return single.length <= max ? single : `${single.slice(0, Math.max(1, max - 1))}\u2026`;
87
+ };
88
+ var headlineArg = (args, max = 96) => {
89
+ if (!args) return void 0;
90
+ for (const key of HEADLINE_ARG_KEYS) {
91
+ const value = args[key];
92
+ if (typeof value === "string") {
93
+ const cleaned = cleanOneLine(value, max);
94
+ if (cleaned) return cleaned;
95
+ }
96
+ }
97
+ for (const [key, value] of Object.entries(args)) {
98
+ if (HEADLINE_SKIP_KEYS.has(key)) continue;
99
+ if (typeof value === "string") {
100
+ const cleaned = cleanOneLine(value, max);
101
+ if (cleaned) return cleaned;
102
+ }
103
+ }
104
+ return void 0;
105
+ };
106
+
107
+ // src/ui/transcript-reader.ts
108
+ import fs from "node:fs";
109
+
110
+ // src/ui/transcript-parser.ts
111
+ var MAX_TOOL_SUMMARY_CHARS = 500;
112
+ var MAX_TRANSCRIPT_MESSAGE_CHARS = 4e4;
113
+ var TRANSCRIPT_ENTRY_LIMIT = 80;
114
+ var TranscriptAccumulator = class {
115
+ entries = [];
116
+ #tools = /* @__PURE__ */ new Map();
117
+ #anonymousTools = /* @__PURE__ */ new Map();
118
+ #activeTools = [];
119
+ #assistant;
120
+ #retry;
121
+ #compaction;
122
+ #userMessages = /* @__PURE__ */ new Map();
123
+ #userBoundaries = /* @__PURE__ */ new Map();
124
+ #sequence = 0;
125
+ append(events) {
126
+ for (const event of events) this.#append(event);
127
+ }
128
+ snapshot(olderAvailable = false, updatedAt, maxEntries = TRANSCRIPT_ENTRY_LIMIT) {
129
+ const entries = maxEntries > 0 && this.entries.length > maxEntries ? this.entries.slice(-maxEntries) : this.entries;
130
+ const omitted = entries.length < this.entries.length;
131
+ return {
132
+ entries: entries.map((entry) => ({ ...entry })),
133
+ truncated: olderAvailable || omitted,
134
+ hasMore: olderAvailable || omitted,
135
+ ...updatedAt !== void 0 ? { updatedAt } : {}
136
+ };
137
+ }
138
+ #nextId(event, prefix = "event") {
139
+ if (typeof event.toolCallId === "string") return event.toolCallId;
140
+ if (typeof event.uuid === "string") return event.uuid;
141
+ if (typeof event.id === "string") return event.id;
142
+ return `${prefix}-${this.#sequence++}`;
143
+ }
144
+ #finishAssistant(status) {
145
+ if (!this.#assistant) return;
146
+ this.#assistant.status = status;
147
+ this.#assistant = void 0;
148
+ }
149
+ #pushMessage(kind, id, text, status = "completed", label = kind === "assistant" ? "Agent" : "User", identity) {
150
+ const display = kind === "user" ? unwrapActorEnvelopeText(text) ?? text : text;
151
+ const safe = clip(display, MAX_TRANSCRIPT_MESSAGE_CHARS, kind !== "user");
152
+ if (!safe) return;
153
+ const entry = { id, kind, label, text: safe, status };
154
+ if (kind === "user" && identity) {
155
+ const existing = this.#userMessages.get(identity);
156
+ if (existing) {
157
+ existing.text = safe;
158
+ return;
159
+ }
160
+ this.#userMessages.set(identity, entry);
161
+ }
162
+ this.entries.push(entry);
163
+ }
164
+ #userIdentity(event, message) {
165
+ if (event.type === "message_start" || event.type === "message_end" || event.type === "message") {
166
+ const timestamp = message.timestamp;
167
+ if (typeof timestamp === "number" && Number.isFinite(timestamp)) {
168
+ const base = JSON.stringify([timestamp, contentText(message.content)]);
169
+ let boundary = this.#userBoundaries.get(base);
170
+ if (!boundary || event.type === "message_start" && boundary.ended) {
171
+ boundary = { serial: (boundary?.serial ?? -1) + 1, ended: false };
172
+ this.#userBoundaries.set(base, boundary);
173
+ }
174
+ if (event.type === "message_end") boundary.ended = true;
175
+ return `user:${base}:${boundary.serial}`;
176
+ }
177
+ }
178
+ return void 0;
179
+ }
180
+ #toolParent(id) {
181
+ if (!id.startsWith("fabric_")) return void 0;
182
+ for (let index = this.#activeTools.length - 1; index >= 0; index--) {
183
+ const candidate = this.#activeTools[index];
184
+ if (candidate?.toolName === "fabric_exec" && candidate.status === "running") return candidate;
185
+ }
186
+ return void 0;
187
+ }
188
+ #startTool(id, label, args) {
189
+ const existing = this.#tools.get(id);
190
+ const safeArgs = args === void 0 ? void 0 : redactRecord(args);
191
+ if (existing) {
192
+ if (safeArgs !== void 0) existing.args = safeArgs;
193
+ if (args !== void 0) existing.text = compactRedactedValue(safeArgs ?? redact(args));
194
+ return existing;
195
+ }
196
+ const parent = this.#toolParent(id);
197
+ const safeLabel = terminalSafe(label) || "tool";
198
+ const entry = {
199
+ id,
200
+ kind: "tool",
201
+ label: safeLabel,
202
+ toolName: safeLabel,
203
+ status: "running",
204
+ ...safeArgs !== void 0 ? { args: safeArgs } : {},
205
+ ...args !== void 0 ? { text: compactRedactedValue(safeArgs ?? redact(args)) } : {},
206
+ ...parent ? { parentId: parent.id, depth: (parent.depth ?? 0) + 1 } : {}
207
+ };
208
+ this.entries.push(entry);
209
+ this.#tools.set(id, entry);
210
+ this.#activeTools.push(entry);
211
+ return entry;
212
+ }
213
+ #finishTool(id, label, result, failed) {
214
+ const safeLabel = terminalSafe(label) || "tool";
215
+ const anonymous = this.#anonymousTools.get(safeLabel);
216
+ const entry = id ? this.#tools.get(id) : anonymous?.shift();
217
+ if (anonymous?.length === 0) this.#anonymousTools.delete(safeLabel);
218
+ const safeResult = result === void 0 ? void 0 : redact(result);
219
+ if (entry) {
220
+ entry.status = failed ? "failed" : "completed";
221
+ if (safeResult !== void 0) entry.result = safeResult;
222
+ if (failed && result !== void 0) {
223
+ const failure = compactRedactedValue(safeResult);
224
+ entry.text = clip(
225
+ `${entry.text ? `${entry.text} \xB7 ` : ""}error: ${failure}`,
226
+ MAX_TOOL_SUMMARY_CHARS
227
+ );
228
+ }
229
+ this.#tools.delete(entry.id);
230
+ const activeIndex = this.#activeTools.indexOf(entry);
231
+ if (activeIndex >= 0) this.#activeTools.splice(activeIndex, 1);
232
+ return;
233
+ }
234
+ this.entries.push({
235
+ id: id ?? `tool-${this.#sequence++}`,
236
+ kind: "tool",
237
+ label: safeLabel,
238
+ toolName: safeLabel,
239
+ status: failed ? "failed" : "completed",
240
+ ...safeResult !== void 0 ? { result: safeResult } : {},
241
+ ...failed && safeResult !== void 0 ? { text: compactRedactedValue(safeResult) } : {}
242
+ });
243
+ }
244
+ #appendSessionMessage(event, message) {
245
+ const id = this.#nextId(event, "message");
246
+ if (message.role === "user") {
247
+ this.#pushMessage("user", id, contentText(message.content), "completed", "User", this.#userIdentity(event, message));
248
+ return;
249
+ }
250
+ if (message.role === "assistant") {
251
+ const error = messageError(message);
252
+ const text = contentText(message.content);
253
+ if (text) this.#pushMessage("assistant", id, text, error ? "failed" : "completed");
254
+ if (error) {
255
+ this.entries.push({
256
+ id: `${id}-error`,
257
+ kind: "error",
258
+ label: "Agent error",
259
+ text: error,
260
+ status: "failed"
261
+ });
262
+ }
263
+ if (Array.isArray(message.content)) {
264
+ for (const value of message.content) {
265
+ const part = recordOf(value);
266
+ if (part?.type !== "toolCall" || typeof part.name !== "string") continue;
267
+ const toolId = typeof part.id === "string" ? part.id : `session-tool-${this.#sequence++}`;
268
+ this.#startTool(toolId, part.name, part.arguments);
269
+ }
270
+ }
271
+ return;
272
+ }
273
+ if (message.role === "toolResult") {
274
+ const toolId = typeof message.toolCallId === "string" ? message.toolCallId : void 0;
275
+ const label = typeof message.toolName === "string" ? message.toolName : "tool";
276
+ this.#finishTool(
277
+ toolId,
278
+ label,
279
+ { content: message.content, ...message.details !== void 0 ? { details: message.details } : {} },
280
+ message.isError === true
281
+ );
282
+ }
283
+ }
284
+ #append(event) {
285
+ if (typeof event.type !== "string") return;
286
+ const id = this.#nextId(event);
287
+ if (event.type === "message") {
288
+ const message = recordOf(event.message);
289
+ if (message) this.#appendSessionMessage(event, message);
290
+ return;
291
+ }
292
+ if (event.type === "model_change") {
293
+ const provider = typeof event.provider === "string" ? event.provider : "";
294
+ const model = typeof event.modelId === "string" ? event.modelId : "";
295
+ this.entries.push({
296
+ id,
297
+ kind: "status",
298
+ label: "Model changed",
299
+ ...provider || model ? { text: [provider, model].filter(Boolean).join("/") } : {},
300
+ status: "completed"
301
+ });
302
+ return;
303
+ }
304
+ if (event.type === "thinking_level_change") {
305
+ this.entries.push({
306
+ id,
307
+ kind: "status",
308
+ label: "Thinking changed",
309
+ ...typeof event.thinkingLevel === "string" ? { text: event.thinkingLevel } : {},
310
+ status: "completed"
311
+ });
312
+ return;
313
+ }
314
+ if (event.type === "compaction") {
315
+ this.entries.push({
316
+ id,
317
+ kind: "status",
318
+ label: "Compacted context",
319
+ ...typeof event.summary === "string" ? { text: terminalSafe(event.summary) } : {},
320
+ status: "completed"
321
+ });
322
+ return;
323
+ }
324
+ if (event.type === "stream_event") {
325
+ const stream = recordOf(event.event);
326
+ const delta = recordOf(stream?.delta);
327
+ if (stream?.type === "content_block_delta" && delta?.type === "text_delta") {
328
+ const text = typeof delta.text === "string" ? terminalSafe(delta.text, false) : "";
329
+ if (!text) return;
330
+ if (!this.#assistant) {
331
+ this.#assistant = {
332
+ id,
333
+ kind: "assistant",
334
+ label: "Claude",
335
+ text: clip(text, MAX_TRANSCRIPT_MESSAGE_CHARS, false),
336
+ status: "running"
337
+ };
338
+ this.entries.push(this.#assistant);
339
+ } else {
340
+ this.#assistant.text = clip(
341
+ `${this.#assistant.text ?? ""}${text}`,
342
+ MAX_TRANSCRIPT_MESSAGE_CHARS,
343
+ false
344
+ );
345
+ }
346
+ }
347
+ return;
348
+ }
349
+ if (event.type === "assistant") {
350
+ const message = recordOf(event.message);
351
+ if (!message || message.role !== "assistant") return;
352
+ if (Array.isArray(message.content)) {
353
+ for (const value of message.content) {
354
+ const part = recordOf(value);
355
+ if (part?.type !== "tool_use") continue;
356
+ const toolId = typeof part.id === "string" ? part.id : `claude-tool-${this.#sequence++}`;
357
+ const label = typeof part.name === "string" ? part.name : "tool";
358
+ this.#startTool(toolId, label, part.input);
359
+ }
360
+ }
361
+ const text = terminalSafe(contentText(message.content));
362
+ if (text) {
363
+ if (this.#assistant) {
364
+ this.#assistant.text = clip(text, MAX_TRANSCRIPT_MESSAGE_CHARS);
365
+ this.#finishAssistant("completed");
366
+ } else {
367
+ this.#pushMessage("assistant", id, text, "completed", "Claude");
368
+ }
369
+ }
370
+ if (typeof event.error === "string") {
371
+ this.entries.push({
372
+ id: `${id}-error`,
373
+ kind: "error",
374
+ label: "Claude error",
375
+ text: clip(event.error, MAX_TOOL_SUMMARY_CHARS),
376
+ status: "failed"
377
+ });
378
+ }
379
+ return;
380
+ }
381
+ if (event.type === "user") {
382
+ const message = recordOf(event.message);
383
+ if (!message || !Array.isArray(message.content)) return;
384
+ let hasToolResult = false;
385
+ for (const value of message.content) {
386
+ const part = recordOf(value);
387
+ if (part?.type !== "tool_result" || typeof part.tool_use_id !== "string") continue;
388
+ hasToolResult = true;
389
+ this.#finishTool(part.tool_use_id, "tool", part.content, part.is_error === true);
390
+ }
391
+ if (!hasToolResult) this.#pushMessage("user", id, contentText(message.content));
392
+ return;
393
+ }
394
+ if (event.type === "result") {
395
+ this.#finishAssistant(event.is_error === true ? "failed" : "completed");
396
+ if (event.is_error === true || event.subtype !== "success") {
397
+ const errors = Array.isArray(event.errors) ? event.errors.filter((value) => typeof value === "string").join(" \xB7 ") : "";
398
+ const text = errors || (typeof event.result === "string" ? event.result : "Claude run failed");
399
+ this.entries.push({
400
+ id,
401
+ kind: "error",
402
+ label: "Claude result",
403
+ text: clip(text, MAX_TOOL_SUMMARY_CHARS),
404
+ status: "failed"
405
+ });
406
+ }
407
+ return;
408
+ }
409
+ if (event.type === "system" && event.subtype === "api_retry") {
410
+ this.entries.push({
411
+ id,
412
+ kind: "status",
413
+ label: "Claude API retry",
414
+ status: "running",
415
+ ...typeof event.error === "string" ? { text: clip(event.error, MAX_TOOL_SUMMARY_CHARS) } : {}
416
+ });
417
+ return;
418
+ }
419
+ if (event.type === "message_start") this.#finishAssistant("completed");
420
+ if (event.type === "message_start" || event.type === "message_update") {
421
+ const message = recordOf(event.message);
422
+ if (!message) return;
423
+ if (message.role === "user") {
424
+ if (event.type === "message_start") {
425
+ this.#pushMessage("user", id, contentText(message.content), "completed", "User", this.#userIdentity(event, message));
426
+ }
427
+ return;
428
+ }
429
+ if (message.role !== "assistant") return;
430
+ const text = terminalSafe(contentText(message.content));
431
+ if (!text) return;
432
+ if (!this.#assistant) {
433
+ this.#assistant = {
434
+ id,
435
+ kind: "assistant",
436
+ label: "Agent",
437
+ text: clip(text, MAX_TRANSCRIPT_MESSAGE_CHARS),
438
+ status: "running"
439
+ };
440
+ this.entries.push(this.#assistant);
441
+ } else {
442
+ this.#assistant.text = clip(text, MAX_TRANSCRIPT_MESSAGE_CHARS);
443
+ if (!this.entries.includes(this.#assistant)) this.entries.push(this.#assistant);
444
+ }
445
+ return;
446
+ }
447
+ if (event.type === "message_end") {
448
+ const message = recordOf(event.message);
449
+ if (!message) return;
450
+ if (message.role === "user") {
451
+ this.#pushMessage("user", id, contentText(message.content), "completed", "User", this.#userIdentity(event, message));
452
+ return;
453
+ }
454
+ if (message.role !== "assistant") return;
455
+ const error = messageError(message);
456
+ if (error) {
457
+ this.#finishAssistant("failed");
458
+ this.entries.push({ id, kind: "error", label: "Agent error", text: error, status: "failed" });
459
+ return;
460
+ }
461
+ const text = terminalSafe(contentText(message.content));
462
+ if (!text) {
463
+ this.#finishAssistant("completed");
464
+ return;
465
+ }
466
+ if (!this.#assistant) this.#pushMessage("assistant", id, text);
467
+ else {
468
+ this.#assistant.text = clip(text, MAX_TRANSCRIPT_MESSAGE_CHARS);
469
+ this.#finishAssistant("completed");
470
+ }
471
+ return;
472
+ }
473
+ if (event.type === "response" && event.command === "prompt" && event.success === false) {
474
+ const text = typeof event.error === "string" ? event.error : "Pi rejected the prompt";
475
+ this.entries.push({
476
+ id,
477
+ kind: "error",
478
+ label: "Prompt rejected",
479
+ text: clip(text, MAX_TOOL_SUMMARY_CHARS),
480
+ status: "failed"
481
+ });
482
+ return;
483
+ }
484
+ if (event.type === "tool_execution_start") {
485
+ const label = typeof event.toolName === "string" ? event.toolName : "tool";
486
+ const entry = this.#startTool(id, label, event.args);
487
+ if (typeof event.toolCallId !== "string") {
488
+ const key = terminalSafe(label) || "tool";
489
+ this.#tools.delete(entry.id);
490
+ this.#anonymousTools.set(key, [...this.#anonymousTools.get(key) ?? [], entry]);
491
+ }
492
+ return;
493
+ }
494
+ if (event.type === "tool_execution_end") {
495
+ const label = typeof event.toolName === "string" ? event.toolName : "tool";
496
+ this.#finishTool(
497
+ typeof event.toolCallId === "string" ? event.toolCallId : void 0,
498
+ label,
499
+ event.result,
500
+ event.isError === true
501
+ );
502
+ return;
503
+ }
504
+ if (event.type === "auto_retry_start") {
505
+ const attempt = typeof event.attempt === "number" ? ` ${event.attempt}` : "";
506
+ this.#retry = {
507
+ id,
508
+ kind: "status",
509
+ label: `Retry${attempt}`,
510
+ status: "running",
511
+ ...typeof event.errorMessage === "string" ? { text: clip(event.errorMessage, MAX_TOOL_SUMMARY_CHARS) } : {}
512
+ };
513
+ this.entries.push(this.#retry);
514
+ return;
515
+ }
516
+ if (event.type === "auto_retry_end") {
517
+ const failed = event.success === false;
518
+ if (this.#retry) {
519
+ this.#retry.status = failed ? "failed" : "completed";
520
+ if (failed && typeof event.finalError === "string") {
521
+ this.#retry.text = clip(event.finalError, MAX_TOOL_SUMMARY_CHARS);
522
+ }
523
+ this.#retry = void 0;
524
+ }
525
+ return;
526
+ }
527
+ if (event.type === "compaction_start") {
528
+ this.#compaction = {
529
+ id,
530
+ kind: "status",
531
+ label: "Compacting context",
532
+ status: "running"
533
+ };
534
+ this.entries.push(this.#compaction);
535
+ return;
536
+ }
537
+ if (event.type === "compaction_end") {
538
+ if (this.#compaction) {
539
+ const failed = event.aborted === true || typeof event.errorMessage === "string";
540
+ this.#compaction.status = failed ? "failed" : "completed";
541
+ if (typeof event.errorMessage === "string") {
542
+ this.#compaction.text = clip(event.errorMessage, MAX_TOOL_SUMMARY_CHARS);
543
+ }
544
+ this.#compaction = void 0;
545
+ }
546
+ return;
547
+ }
548
+ if (event.type === "extension_error" || event.type === "worker_stderr") {
549
+ const text = typeof event.error === "string" ? event.error : typeof event.text === "string" ? event.text : "Extension error";
550
+ const warningLines = text.split(/\r?\n/).filter((line) => line.trim());
551
+ const warningCount = event.type === "worker_stderr" && warningLines.length > 0 && warningLines.every((line) => /^\s*Warning:/.test(line)) ? warningLines.length : 0;
552
+ this.entries.push({
553
+ id,
554
+ kind: "error",
555
+ label: event.type === "worker_stderr" ? "Worker stderr" : "Error",
556
+ text: clip(text, warningCount > 0 ? MAX_TRANSCRIPT_MESSAGE_CHARS : MAX_TOOL_SUMMARY_CHARS),
557
+ ...event.type === "worker_stderr" ? { warningCount } : {},
558
+ status: "failed"
559
+ });
560
+ }
561
+ }
562
+ };
563
+ var parseRaw = (raw) => {
564
+ try {
565
+ return recordOf(JSON.parse(raw));
566
+ } catch {
567
+ return void 0;
568
+ }
569
+ };
570
+ var parsedEvents = (lines) => lines.map((line) => recordOf(line.parsed) ?? parseRaw(line.raw)).filter((event) => event !== void 0);
571
+ var normalizedToolStarts = (event) => {
572
+ if (event.type === "tool_execution_start" && typeof event.toolCallId === "string") {
573
+ return [{ id: event.toolCallId, event }];
574
+ }
575
+ const starts = [];
576
+ const appendContentStarts = (content, type) => {
577
+ if (!Array.isArray(content)) return;
578
+ for (const value of content) {
579
+ const part = recordOf(value);
580
+ if (part?.type !== type || typeof part.id !== "string") continue;
581
+ const name = typeof part.name === "string" ? part.name : "tool";
582
+ starts.push({
583
+ id: part.id,
584
+ event: {
585
+ type: "tool_execution_start",
586
+ toolCallId: part.id,
587
+ toolName: name,
588
+ args: type === "toolCall" ? part.arguments : part.input
589
+ }
590
+ });
591
+ }
592
+ };
593
+ if (event.type === "message") {
594
+ const message = recordOf(event.message);
595
+ if (message?.role === "assistant") appendContentStarts(message.content, "toolCall");
596
+ } else if (event.type === "assistant") {
597
+ const message = recordOf(event.message);
598
+ if (message?.role === "assistant") appendContentStarts(message.content, "tool_use");
599
+ }
600
+ return starts;
601
+ };
602
+ var toolLifecycleEndIds = (event) => {
603
+ if (event.type === "tool_execution_end" && typeof event.toolCallId === "string") {
604
+ return [event.toolCallId];
605
+ }
606
+ if (event.type === "message") {
607
+ const message2 = recordOf(event.message);
608
+ return message2?.role === "toolResult" && typeof message2.toolCallId === "string" ? [message2.toolCallId] : [];
609
+ }
610
+ if (event.type !== "user") return [];
611
+ const message = recordOf(event.message);
612
+ if (!Array.isArray(message?.content)) return [];
613
+ return message.content.flatMap((value) => {
614
+ const part = recordOf(value);
615
+ return part?.type === "tool_result" && typeof part.tool_use_id === "string" ? [part.tool_use_id] : [];
616
+ });
617
+ };
618
+ var missingToolStartIds = (events) => {
619
+ const active = /* @__PURE__ */ new Set();
620
+ const missing = /* @__PURE__ */ new Set();
621
+ for (const event of events) {
622
+ for (const start of normalizedToolStarts(event)) active.add(start.id);
623
+ for (const id of toolLifecycleEndIds(event)) {
624
+ if (active.has(id)) active.delete(id);
625
+ else missing.add(id);
626
+ }
627
+ }
628
+ return missing;
629
+ };
630
+
631
+ // src/ui/transcript-reader.ts
632
+ var PAGE_LINES = 40;
633
+ var TOOL_LIFECYCLE_CONTEXT_LINES = PAGE_LINES * 4;
634
+ var MAX_PAGE_BYTES = 512 * 1024;
635
+ var MAX_CACHE_ENTRIES = 32;
636
+ var FORWARD_READ_CHUNK_BYTES = 64 * 1024;
637
+ var completeLogEnd = (descriptor, size, fallback = 0) => {
638
+ if (size <= 0) return 0;
639
+ const scanFloor = Math.max(0, size - MAX_PAGE_BYTES);
640
+ let scanEnd = size;
641
+ while (scanEnd > scanFloor) {
642
+ const scanStart = Math.max(scanFloor, scanEnd - FORWARD_READ_CHUNK_BYTES);
643
+ const chunk = Buffer.allocUnsafe(scanEnd - scanStart);
644
+ const bytesRead = fs.readSync(descriptor, chunk, 0, chunk.length, scanStart);
645
+ if (bytesRead <= 0) return 0;
646
+ for (let index = bytesRead - 1; index >= 0; index--) {
647
+ if (chunk[index] === 10) return scanStart + index + 1;
648
+ }
649
+ scanEnd = scanStart;
650
+ }
651
+ return Math.min(fallback, size);
652
+ };
653
+ var readForwardPage = (descriptor, start, end) => {
654
+ const lines = [];
655
+ const readLimit = Math.min(end, Math.max(0, start) + MAX_PAGE_BYTES);
656
+ let readOffset = Math.max(0, start);
657
+ let pending = Buffer.alloc(0);
658
+ let pendingOffset = readOffset;
659
+ let pageEnd = readOffset;
660
+ while (readOffset < readLimit && lines.length < PAGE_LINES) {
661
+ const chunkSize = Math.min(FORWARD_READ_CHUNK_BYTES, readLimit - readOffset);
662
+ const chunk = Buffer.allocUnsafe(chunkSize);
663
+ const bytesRead = fs.readSync(descriptor, chunk, 0, chunkSize, readOffset);
664
+ if (bytesRead <= 0) break;
665
+ const data = pending.length > 0 ? Buffer.concat([pending, chunk.subarray(0, bytesRead)]) : chunk.subarray(0, bytesRead);
666
+ const dataOffset = pending.length > 0 ? pendingOffset : readOffset;
667
+ let lineStart = 0;
668
+ for (let index = 0; index < data.length; index++) {
669
+ if (data[index] !== 10) continue;
670
+ const raw = data.subarray(lineStart, index).toString("utf8").replace(/\r$/, "");
671
+ pageEnd = dataOffset + index + 1;
672
+ if (raw) {
673
+ const offset = dataOffset + lineStart;
674
+ const parsed = parseRaw(raw);
675
+ lines.push({ offset, raw, ...parsed ? { parsed } : {} });
676
+ if (lines.length >= PAGE_LINES) return { lines, end: pageEnd };
677
+ }
678
+ lineStart = index + 1;
679
+ }
680
+ pending = Buffer.from(data.subarray(lineStart));
681
+ pendingOffset = dataOffset + lineStart;
682
+ readOffset += bytesRead;
683
+ }
684
+ return { lines, end: readOffset >= end ? end : pageEnd };
685
+ };
686
+ var AgentTranscriptReader = class {
687
+ #cache = /* @__PURE__ */ new Map();
688
+ read(source, followLatest = true) {
689
+ const filePath = source.logFile;
690
+ if (!filePath) {
691
+ return { entries: [], truncated: false, hasMore: false, hasNewer: false };
692
+ }
693
+ const cached = this.#cache.get(filePath);
694
+ let descriptor;
695
+ try {
696
+ const noFollow = typeof fs.constants.O_NOFOLLOW === "number" ? fs.constants.O_NOFOLLOW : 0;
697
+ descriptor = fs.openSync(filePath, fs.constants.O_RDONLY | noFollow);
698
+ const stat = fs.fstatSync(descriptor);
699
+ if (!stat.isFile()) {
700
+ return cached?.transcript ?? {
701
+ entries: [],
702
+ truncated: false,
703
+ hasMore: false,
704
+ hasNewer: false
705
+ };
706
+ }
707
+ const sameFile = cached?.device === stat.dev && cached.inode === stat.ino;
708
+ const sameSizeRewrite = sameFile && cached.offset === stat.size && cached.modifiedAt !== stat.mtimeMs;
709
+ let state;
710
+ if (!cached || !sameFile || stat.size < cached.offset || sameSizeRewrite) {
711
+ state = this.#latestState(descriptor, stat);
712
+ } else if (stat.size !== cached.offset || stat.mtimeMs !== cached.modifiedAt) {
713
+ const wasAtTail = cached.pageEnd >= cached.completeEnd;
714
+ const completeEnd = completeLogEnd(descriptor, stat.size, cached.completeEnd);
715
+ if (cached.pageEnd > completeEnd || followLatest && wasAtTail && completeEnd > cached.completeEnd) {
716
+ state = this.#latestState(descriptor, stat, completeEnd);
717
+ } else {
718
+ state = {
719
+ ...cached,
720
+ modifiedAt: stat.mtimeMs,
721
+ offset: stat.size,
722
+ completeEnd,
723
+ transcript: {
724
+ ...cached.transcript,
725
+ hasNewer: cached.pageEnd < completeEnd,
726
+ updatedAt: stat.mtimeMs
727
+ }
728
+ };
729
+ }
730
+ } else {
731
+ state = cached;
732
+ }
733
+ this.#remember(filePath, state);
734
+ return state.transcript;
735
+ } catch {
736
+ return cached?.transcript ?? {
737
+ entries: [],
738
+ truncated: false,
739
+ hasMore: false,
740
+ hasNewer: false
741
+ };
742
+ } finally {
743
+ if (descriptor !== void 0) {
744
+ try {
745
+ fs.closeSync(descriptor);
746
+ } catch {
747
+ }
748
+ }
749
+ }
750
+ }
751
+ loadOlder(source) {
752
+ const filePath = source.logFile;
753
+ if (!filePath) return false;
754
+ this.read(source, false);
755
+ const cached = this.#cache.get(filePath);
756
+ if (!cached?.hasMore || cached.pageStart <= 0) return false;
757
+ let descriptor;
758
+ try {
759
+ const noFollow = typeof fs.constants.O_NOFOLLOW === "number" ? fs.constants.O_NOFOLLOW : 0;
760
+ descriptor = fs.openSync(filePath, fs.constants.O_RDONLY | noFollow);
761
+ const stat = fs.fstatSync(descriptor);
762
+ if (!stat.isFile() || stat.dev !== cached.device || stat.ino !== cached.inode) return false;
763
+ const completeEnd = completeLogEnd(descriptor, stat.size, cached.completeEnd);
764
+ const pageEnd = Math.min(cached.pageStart, completeEnd);
765
+ const page = readJsonlPageFromDescriptor(
766
+ descriptor,
767
+ PAGE_LINES,
768
+ pageEnd,
769
+ stat.size,
770
+ MAX_PAGE_BYTES
771
+ );
772
+ const pageStart = page.lines[0]?.offset;
773
+ if (pageStart === void 0) return false;
774
+ const state = this.#stateForPage(
775
+ descriptor,
776
+ stat,
777
+ completeEnd,
778
+ page.lines,
779
+ pageStart,
780
+ pageEnd,
781
+ page.hasMore
782
+ );
783
+ this.#remember(filePath, state);
784
+ return true;
785
+ } catch {
786
+ return false;
787
+ } finally {
788
+ if (descriptor !== void 0) {
789
+ try {
790
+ fs.closeSync(descriptor);
791
+ } catch {
792
+ }
793
+ }
794
+ }
795
+ }
796
+ loadNewer(source) {
797
+ const filePath = source.logFile;
798
+ if (!filePath) return false;
799
+ this.read(source, false);
800
+ const cached = this.#cache.get(filePath);
801
+ if (!cached || cached.pageEnd >= cached.completeEnd) return false;
802
+ let descriptor;
803
+ try {
804
+ const noFollow = typeof fs.constants.O_NOFOLLOW === "number" ? fs.constants.O_NOFOLLOW : 0;
805
+ descriptor = fs.openSync(filePath, fs.constants.O_RDONLY | noFollow);
806
+ const stat = fs.fstatSync(descriptor);
807
+ if (!stat.isFile() || stat.dev !== cached.device || stat.ino !== cached.inode) return false;
808
+ const completeEnd = completeLogEnd(descriptor, stat.size, cached.completeEnd);
809
+ const page = readForwardPage(descriptor, cached.pageEnd, completeEnd);
810
+ if (page.lines.length === 0 || page.end <= cached.pageEnd) return false;
811
+ const state = this.#stateForPage(
812
+ descriptor,
813
+ stat,
814
+ completeEnd,
815
+ page.lines,
816
+ cached.pageEnd,
817
+ page.end,
818
+ cached.pageEnd > 0
819
+ );
820
+ this.#remember(filePath, state);
821
+ return true;
822
+ } catch {
823
+ return false;
824
+ } finally {
825
+ if (descriptor !== void 0) {
826
+ try {
827
+ fs.closeSync(descriptor);
828
+ } catch {
829
+ }
830
+ }
831
+ }
832
+ }
833
+ loadLatest(source) {
834
+ const filePath = source.logFile;
835
+ if (!filePath) return false;
836
+ this.read(source, false);
837
+ const cached = this.#cache.get(filePath);
838
+ let descriptor;
839
+ try {
840
+ const noFollow = typeof fs.constants.O_NOFOLLOW === "number" ? fs.constants.O_NOFOLLOW : 0;
841
+ descriptor = fs.openSync(filePath, fs.constants.O_RDONLY | noFollow);
842
+ const stat = fs.fstatSync(descriptor);
843
+ if (!stat.isFile()) return false;
844
+ if (cached && (stat.dev !== cached.device || stat.ino !== cached.inode)) return false;
845
+ const completeEnd = completeLogEnd(descriptor, stat.size, cached?.completeEnd ?? 0);
846
+ const state = this.#latestState(descriptor, stat, completeEnd);
847
+ this.#remember(filePath, state);
848
+ return true;
849
+ } catch {
850
+ return false;
851
+ } finally {
852
+ if (descriptor !== void 0) {
853
+ try {
854
+ fs.closeSync(descriptor);
855
+ } catch {
856
+ }
857
+ }
858
+ }
859
+ }
860
+ clear() {
861
+ this.#cache.clear();
862
+ }
863
+ #latestState(descriptor, stat, knownCompleteEnd) {
864
+ const completeEnd = knownCompleteEnd ?? completeLogEnd(descriptor, stat.size);
865
+ const page = readJsonlPageFromDescriptor(
866
+ descriptor,
867
+ PAGE_LINES,
868
+ completeEnd,
869
+ stat.size,
870
+ MAX_PAGE_BYTES
871
+ );
872
+ return this.#stateForPage(
873
+ descriptor,
874
+ stat,
875
+ completeEnd,
876
+ page.lines,
877
+ page.lines[0]?.offset ?? completeEnd,
878
+ completeEnd,
879
+ page.hasMore
880
+ );
881
+ }
882
+ #stateForPage(descriptor, stat, completeEnd, lines, pageStart, pageEnd, hasMore) {
883
+ const events = parsedEvents(lines);
884
+ const missingStarts = missingToolStartIds(events);
885
+ const lifecycleContext = [];
886
+ if (missingStarts.size > 0 && pageStart > 0) {
887
+ const contextPage = readJsonlPageFromDescriptor(
888
+ descriptor,
889
+ TOOL_LIFECYCLE_CONTEXT_LINES,
890
+ pageStart,
891
+ stat.size,
892
+ MAX_PAGE_BYTES
893
+ );
894
+ const contextEvents = parsedEvents(contextPage.lines);
895
+ for (let index = contextEvents.length - 1; index >= 0 && missingStarts.size > 0; index--) {
896
+ const starts = normalizedToolStarts(contextEvents[index]);
897
+ for (let startIndex = starts.length - 1; startIndex >= 0; startIndex--) {
898
+ const start = starts[startIndex];
899
+ if (!missingStarts.delete(start.id)) continue;
900
+ lifecycleContext.unshift(start.event);
901
+ }
902
+ }
903
+ }
904
+ const accumulator = new TranscriptAccumulator();
905
+ accumulator.append([...lifecycleContext, ...events]);
906
+ const transcript = {
907
+ ...accumulator.snapshot(hasMore, stat.mtimeMs, Number.MAX_SAFE_INTEGER),
908
+ hasNewer: pageEnd < completeEnd
909
+ };
910
+ return {
911
+ device: stat.dev,
912
+ inode: stat.ino,
913
+ modifiedAt: stat.mtimeMs,
914
+ offset: stat.size,
915
+ completeEnd,
916
+ pageStart,
917
+ pageEnd,
918
+ hasMore: transcript.hasMore ?? false,
919
+ transcript
920
+ };
921
+ }
922
+ #remember(filePath, state) {
923
+ this.#cache.delete(filePath);
924
+ this.#cache.set(filePath, state);
925
+ while (this.#cache.size > MAX_CACHE_ENTRIES) {
926
+ const oldest = this.#cache.keys().next().value;
927
+ if (!oldest) break;
928
+ this.#cache.delete(oldest);
929
+ }
930
+ }
931
+ };
932
+
933
+ // src/ui/transcript.ts
934
+ var PREVIEW_TREE_GUARD_MAX_DEPTH = 8;
935
+ var isFabricAgentToolPreviewNode = (value, depth) => {
936
+ const record = recordOf(value);
937
+ if (!record || typeof record.id !== "string" || typeof record.name !== "string" || record.text !== void 0 && typeof record.text !== "string" || record.currentTool !== void 0 && typeof record.currentTool !== "string" || !Array.isArray(record.tools)) {
938
+ return false;
939
+ }
940
+ if (record.agents === void 0) return true;
941
+ if (depth >= PREVIEW_TREE_GUARD_MAX_DEPTH || !Array.isArray(record.agents)) return false;
942
+ return record.agents.every((child) => isFabricAgentToolPreviewNode(child, depth + 1));
943
+ };
944
+ var isFabricAgentToolPreview = (value) => recordOf(value)?.kind === "fabric-agent-tools" && isFabricAgentToolPreviewNode(value, 0);
945
+ var recentTranscriptTools = (transcript, limit = 2) => {
946
+ const tools = transcript.entries.filter((entry) => entry.kind === "tool");
947
+ const boundedLimit = Math.max(1, limit);
948
+ const running = tools.filter((entry) => entry.status === "running");
949
+ const completed = tools.filter((entry) => entry.status !== "running");
950
+ const completedSlots = Math.max(0, boundedLimit - Math.min(running.length, boundedLimit));
951
+ const retained = /* @__PURE__ */ new Set([
952
+ ...running.slice(-boundedLimit),
953
+ ...completed.slice(-completedSlots)
954
+ ]);
955
+ return tools.filter((entry) => retained.has(entry)).slice(-boundedLimit).map((entry) => ({ ...entry }));
956
+ };
957
+
958
+ // src/ui/preview-lines.ts
959
+ function countContentLines(content) {
960
+ if (!content) return 0;
961
+ let terminators = 0;
962
+ for (let index = 0; index < content.length; index++) {
963
+ const code = content.charCodeAt(index);
964
+ if (code === 13) {
965
+ terminators++;
966
+ if (content.charCodeAt(index + 1) === 10) index++;
967
+ } else if (code === 10) {
968
+ terminators++;
969
+ }
970
+ }
971
+ const finalCode = content.charCodeAt(content.length - 1);
972
+ return terminators + (finalCode === 10 || finalCode === 13 ? 0 : 1);
973
+ }
974
+ function selectPreviewTextLines(text, limit) {
975
+ if (!Number.isInteger(limit)) {
976
+ const lines = collectPreviewTextLines(text);
977
+ return { ...selectPreviewLines(lines, limit), total: lines.length };
978
+ }
979
+ const entries = [];
980
+ const split = limit >= 8;
981
+ const head = split ? Math.ceil(limit * 0.65) : limit;
982
+ const tailLimit = split ? Math.max(1, limit - head - 1) : 0;
983
+ const tail = [];
984
+ let tailSize = 0;
985
+ let tailCursor = 0;
986
+ let total = 0;
987
+ forEachPreviewTextLine(text, (line, index) => {
988
+ total++;
989
+ if (limit <= 0 || index < limit) entries.push({ kind: "line", line, index });
990
+ if (!split || index < head) return;
991
+ tail[tailCursor] = line;
992
+ if (++tailCursor === tailLimit) tailCursor = 0;
993
+ if (tailSize < tailLimit) tailSize++;
994
+ });
995
+ if (limit <= 0 || total <= limit) return { entries, shown: total, hidden: 0, total };
996
+ if (!split) return { entries, shown: limit, hidden: total - limit, total };
997
+ const hidden = total - head - tailLimit;
998
+ const selected = entries.slice(0, head);
999
+ selected.push({ kind: "hidden", hidden });
1000
+ let tailSlot = tailSize === tailLimit ? tailCursor : 0;
1001
+ for (let offset = 0; offset < tailSize; offset++) {
1002
+ const line = tail[tailSlot];
1003
+ if (line === void 0) throw new RangeError(`Missing preview tail line ${offset}`);
1004
+ selected.push({ kind: "line", line, index: total - tailSize + offset });
1005
+ if (++tailSlot === tailLimit) tailSlot = 0;
1006
+ }
1007
+ return { entries: selected, shown: head + tailLimit, hidden, total };
1008
+ }
1009
+ function selectPreviewLines(lines, limit) {
1010
+ if (lines.length <= limit || limit <= 0) {
1011
+ return {
1012
+ entries: lines.map((line, index) => ({ kind: "line", line, index })),
1013
+ shown: lines.length,
1014
+ hidden: 0
1015
+ };
1016
+ }
1017
+ if (limit < 8) {
1018
+ return {
1019
+ entries: lines.slice(0, limit).map((line, index) => ({ kind: "line", line, index })),
1020
+ shown: limit,
1021
+ hidden: lines.length - limit
1022
+ };
1023
+ }
1024
+ const head = Math.ceil(limit * 0.65);
1025
+ const tail = Math.max(1, limit - head - 1);
1026
+ const hidden = lines.length - head - tail;
1027
+ return {
1028
+ entries: [
1029
+ ...lines.slice(0, head).map((line, index) => ({ kind: "line", line, index })),
1030
+ { kind: "hidden", hidden },
1031
+ ...lines.slice(-tail).map((line, offset) => ({
1032
+ kind: "line",
1033
+ line,
1034
+ index: lines.length - tail + offset
1035
+ }))
1036
+ ],
1037
+ shown: head + tail,
1038
+ hidden
1039
+ };
1040
+ }
1041
+ function collectPreviewTextLines(text) {
1042
+ const lines = [];
1043
+ forEachPreviewTextLine(text, (line) => lines.push(line));
1044
+ return lines;
1045
+ }
1046
+ function forEachPreviewTextLine(text, callback) {
1047
+ let index = 0;
1048
+ let pendingEmpty = 0;
1049
+ forEachRawTextLine(text, (line) => {
1050
+ if (line === "") {
1051
+ pendingEmpty++;
1052
+ return;
1053
+ }
1054
+ while (pendingEmpty > 0) {
1055
+ callback("", index++);
1056
+ pendingEmpty--;
1057
+ }
1058
+ callback(line, index++);
1059
+ });
1060
+ if (index === 0 && pendingEmpty > 0 && text.length > 0) callback("", index);
1061
+ }
1062
+ function forEachRawTextLine(text, callback) {
1063
+ let start = 0;
1064
+ while (start <= text.length) {
1065
+ const newline = text.indexOf("\n", start);
1066
+ if (newline < 0) {
1067
+ callback(text.slice(start));
1068
+ break;
1069
+ }
1070
+ callback(text.slice(start, newline));
1071
+ start = newline + 1;
1072
+ }
1073
+ }
1074
+
1075
+ // src/providers/write-diff-limits.ts
1076
+ var configuredMaxBytes = Number.parseInt(
1077
+ process.env.CODE_PREVIEW_MAX_WRITE_DIFF_BYTES ?? "",
1078
+ 10
1079
+ );
1080
+ var MAX_WRITE_DIFF_BYTES = Number.isFinite(configuredMaxBytes) && configuredMaxBytes > 0 ? configuredMaxBytes : 2e5;
1081
+ var configuredMaxChangedLineCells = Number.parseInt(
1082
+ process.env.CODE_PREVIEW_MAX_WRITE_DIFF_CHANGED_LINE_CELLS ?? "",
1083
+ 10
1084
+ );
1085
+ var MAX_WRITE_DIFF_CHANGED_LINE_CELLS = Number.isFinite(configuredMaxChangedLineCells) && configuredMaxChangedLineCells > 0 ? configuredMaxChangedLineCells : 1e6;
1086
+ var writeContentForPreview = (content) => Buffer.byteLength(content, "utf8") <= MAX_WRITE_DIFF_BYTES ? content : void 0;
1087
+ var shouldSkipWriteDiffBytes = (...texts) => {
1088
+ let total = 0;
1089
+ for (const text of texts) {
1090
+ total += Buffer.byteLength(text, "utf8");
1091
+ if (total > MAX_WRITE_DIFF_BYTES) return true;
1092
+ }
1093
+ return false;
1094
+ };
1095
+ var shouldSkipWriteDiffComplexity = (before, after) => {
1096
+ const beforeLines = before.split("\n");
1097
+ const afterLines = after.split("\n");
1098
+ const sharedLimit = Math.min(beforeLines.length, afterLines.length);
1099
+ let prefix = 0;
1100
+ while (prefix < sharedLimit && beforeLines[prefix] === afterLines[prefix]) prefix++;
1101
+ let suffix = 0;
1102
+ const suffixLimit = sharedLimit - prefix;
1103
+ while (suffix < suffixLimit && beforeLines[beforeLines.length - suffix - 1] === afterLines[afterLines.length - suffix - 1]) {
1104
+ suffix++;
1105
+ }
1106
+ const changedBefore = beforeLines.length - prefix - suffix;
1107
+ const changedAfter = afterLines.length - prefix - suffix;
1108
+ return changedBefore * changedAfter > MAX_WRITE_DIFF_CHANGED_LINE_CELLS;
1109
+ };
1110
+
1111
+ export {
1112
+ countNewlines,
1113
+ truncateMiddle,
1114
+ headlineArg,
1115
+ countContentLines,
1116
+ selectPreviewTextLines,
1117
+ MAX_WRITE_DIFF_BYTES,
1118
+ writeContentForPreview,
1119
+ shouldSkipWriteDiffBytes,
1120
+ shouldSkipWriteDiffComplexity,
1121
+ AgentTranscriptReader,
1122
+ isFabricAgentToolPreview,
1123
+ recentTranscriptTools
1124
+ };
1125
+ //# sourceMappingURL=chunk-J2HV2URQ.js.map