@e4779/pi-fabric 0.131.4-fork.33 → 0.138.1-fork.1

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 (435) hide show
  1. package/README.md +8 -0
  2. package/dist/actors/context.d.ts.map +1 -1
  3. package/dist/agents/clone-first-worktree.d.ts +2 -0
  4. package/dist/agents/clone-first-worktree.d.ts.map +1 -1
  5. package/dist/agents/completion-inbox.d.ts +2 -1
  6. package/dist/agents/completion-inbox.d.ts.map +1 -1
  7. package/dist/agents/handoff.d.ts.map +1 -1
  8. package/dist/agents/manager.d.ts.map +1 -1
  9. package/dist/agents/worktree-manager.d.ts +4 -1
  10. package/dist/agents/worktree-manager.d.ts.map +1 -1
  11. package/dist/agents/worktree-paths.d.ts +8 -3
  12. package/dist/agents/worktree-paths.d.ts.map +1 -1
  13. package/dist/agents.js +6 -1
  14. package/dist/agents.js.map +1 -1
  15. package/dist/async-settlement.d.ts +1 -1
  16. package/dist/async-settlement.d.ts.map +1 -1
  17. package/dist/audit/details.d.ts.map +1 -1
  18. package/dist/capture/catalog.d.ts +2 -0
  19. package/dist/capture/catalog.d.ts.map +1 -1
  20. package/dist/capture/interceptor.d.ts.map +1 -1
  21. package/dist/chunks/{chunk-7N7IC3Z2.js → chunk-2CD7HLVP.js} +3 -84
  22. package/dist/chunks/chunk-2CD7HLVP.js.map +7 -0
  23. package/dist/chunks/{chunk-7YNE4NB2.js → chunk-2MELFQCQ.js} +2 -2
  24. package/dist/chunks/{chunk-HSEZPCL5.js → chunk-2OC4YJOL.js} +3 -3
  25. package/dist/chunks/{chunk-TXCNZCZP.js → chunk-2QJ4MNS6.js} +2 -2
  26. package/dist/chunks/{chunk-F6A6MQ6G.js → chunk-2WPTD6BI.js} +11 -15
  27. package/dist/chunks/chunk-2WPTD6BI.js.map +7 -0
  28. package/dist/chunks/{chunk-QOEOKW2X.js → chunk-3QH6JAE3.js} +2 -2
  29. package/dist/chunks/chunk-4U47NCP2.js +88 -0
  30. package/dist/chunks/chunk-4U47NCP2.js.map +7 -0
  31. package/dist/chunks/{chunk-OJ4HAALD.js → chunk-5VZEAAHD.js} +10 -9
  32. package/dist/chunks/chunk-5VZEAAHD.js.map +7 -0
  33. package/dist/chunks/{chunk-LKYLD5SN.js → chunk-6HM4TX7L.js} +10 -8
  34. package/dist/chunks/chunk-6HM4TX7L.js.map +7 -0
  35. package/dist/chunks/{chunk-L6H46CPY.js → chunk-6NNL5LOG.js} +2 -2
  36. package/dist/chunks/{chunk-7TB7NXSL.js → chunk-7CIQQOOD.js} +11 -3
  37. package/dist/chunks/{chunk-7TB7NXSL.js.map → chunk-7CIQQOOD.js.map} +2 -2
  38. package/dist/chunks/{chunk-RWKQ5SRW.js → chunk-7ZFPVOV2.js} +2 -2
  39. package/dist/chunks/{chunk-PUBHBEYO.js → chunk-B2FIGOPI.js} +2 -2
  40. package/dist/chunks/{chunk-HRDMBGMY.js → chunk-BLT66VHH.js} +331 -22
  41. package/dist/chunks/chunk-BLT66VHH.js.map +7 -0
  42. package/dist/chunks/{chunk-4WKD3YM3.js → chunk-C3UPHOJW.js} +3 -3
  43. package/dist/chunks/{chunk-G2DZJ5LK.js → chunk-CB72SLHB.js} +451 -134
  44. package/dist/chunks/chunk-CB72SLHB.js.map +7 -0
  45. package/dist/chunks/{chunk-B5L3X3ID.js → chunk-CCJ6PUZJ.js} +1 -1
  46. package/dist/chunks/{chunk-B5L3X3ID.js.map → chunk-CCJ6PUZJ.js.map} +1 -1
  47. package/dist/chunks/{chunk-FK73YJKV.js → chunk-DWM63MAJ.js} +21 -9
  48. package/dist/chunks/chunk-DWM63MAJ.js.map +7 -0
  49. package/dist/chunks/{chunk-56NMRVTV.js → chunk-FFJ7TV66.js} +32 -29
  50. package/dist/chunks/chunk-FFJ7TV66.js.map +7 -0
  51. package/dist/chunks/{chunk-LRSZFYUC.js → chunk-FUMALXYQ.js} +15 -15
  52. package/dist/chunks/chunk-FUMALXYQ.js.map +7 -0
  53. package/dist/chunks/{chunk-TJZYM2SP.js → chunk-G3RQ3HUK.js} +8 -3
  54. package/dist/chunks/{chunk-TJZYM2SP.js.map → chunk-G3RQ3HUK.js.map} +2 -2
  55. package/dist/chunks/{chunk-RAA3FAYZ.js → chunk-GNPTDN6K.js} +2 -2
  56. package/dist/chunks/{chunk-XFOSUGLU.js → chunk-JCGEW5OQ.js} +5 -5
  57. package/dist/chunks/{chunk-CXYJJ3HZ.js → chunk-LJ2MG6U2.js} +3 -3
  58. package/dist/chunks/{chunk-3MOY6WIB.js → chunk-LRBDEAKB.js} +3 -3
  59. package/dist/chunks/{chunk-2RWNVCFD.js → chunk-MPFBOVOD.js} +1 -1
  60. package/dist/chunks/{chunk-2RWNVCFD.js.map → chunk-MPFBOVOD.js.map} +1 -1
  61. package/dist/chunks/{chunk-NQ7IWEIF.js → chunk-MQGRQMVM.js} +2 -2
  62. package/dist/chunks/{chunk-3VK6UGAN.js → chunk-O5SHIUIL.js} +6 -1
  63. package/dist/chunks/chunk-O5SHIUIL.js.map +7 -0
  64. package/dist/chunks/{chunk-U6Y6TKJL.js → chunk-OK2EKY3M.js} +15 -11
  65. package/dist/chunks/chunk-OK2EKY3M.js.map +7 -0
  66. package/dist/chunks/{chunk-DGUXJSYA.js → chunk-OR44GYXD.js} +70 -3
  67. package/dist/chunks/chunk-OR44GYXD.js.map +7 -0
  68. package/dist/chunks/{chunk-DGERP4VL.js → chunk-P4TALNLX.js} +11 -10
  69. package/dist/chunks/chunk-P4TALNLX.js.map +7 -0
  70. package/dist/chunks/{chunk-4BYS4ZLY.js → chunk-PHGPOSCP.js} +267 -71
  71. package/dist/chunks/chunk-PHGPOSCP.js.map +7 -0
  72. package/dist/chunks/{chunk-3XT5WHSG.js → chunk-QAGEWWCJ.js} +260 -59
  73. package/dist/chunks/chunk-QAGEWWCJ.js.map +7 -0
  74. package/dist/chunks/{chunk-WKFRGICG.js → chunk-RBYRHS24.js} +2 -2
  75. package/dist/chunks/{chunk-ZHROHNEE.js → chunk-RFNYH7S7.js} +8 -8
  76. package/dist/chunks/{chunk-VGRUWTMG.js → chunk-RPZJVLML.js} +472 -466
  77. package/dist/chunks/chunk-RPZJVLML.js.map +7 -0
  78. package/dist/chunks/{chunk-H57KPL3V.js → chunk-S2JWFXW5.js} +2 -2
  79. package/dist/chunks/{chunk-LZ2ZXOCU.js → chunk-SSB2JN3I.js} +168 -5
  80. package/dist/chunks/chunk-SSB2JN3I.js.map +7 -0
  81. package/dist/chunks/{chunk-RKJPBTBB.js → chunk-SVQ7ZHEQ.js} +33 -16
  82. package/dist/chunks/chunk-SVQ7ZHEQ.js.map +7 -0
  83. package/dist/chunks/{chunk-MPMEK3IQ.js → chunk-TV5NCPPS.js} +6 -5
  84. package/dist/chunks/chunk-TV5NCPPS.js.map +7 -0
  85. package/dist/chunks/{chunk-XOBLUZMB.js → chunk-UIVMSMSQ.js} +10 -1
  86. package/dist/chunks/chunk-UIVMSMSQ.js.map +7 -0
  87. package/dist/chunks/{chunk-QGTD3LAZ.js → chunk-UYS5VZUU.js} +9 -3
  88. package/dist/chunks/chunk-UYS5VZUU.js.map +7 -0
  89. package/dist/chunks/{chunk-HRVYXRWZ.js → chunk-V5RZK45W.js} +37 -3
  90. package/dist/chunks/chunk-V5RZK45W.js.map +7 -0
  91. package/dist/chunks/{chunk-KIFOEBYJ.js → chunk-VEXCD3RA.js} +2 -2
  92. package/dist/chunks/{chunk-GS67KDMV.js → chunk-VN7AE3EY.js} +2 -2
  93. package/dist/chunks/{chunk-HFDJWLMS.js → chunk-WFGJUVTH.js} +106 -65
  94. package/dist/chunks/chunk-WFGJUVTH.js.map +7 -0
  95. package/dist/chunks/chunk-WMULZZER.js +196 -0
  96. package/dist/chunks/chunk-WMULZZER.js.map +7 -0
  97. package/dist/chunks/{chunk-QNMQJNXE.js → chunk-X4HDI7RT.js} +14 -4
  98. package/dist/chunks/chunk-X4HDI7RT.js.map +7 -0
  99. package/dist/chunks/{chunk-MX53BRAC.js → chunk-XBAOTA4U.js} +2 -2
  100. package/dist/chunks/{chunk-MSDL7U6Q.js → chunk-XQCNVH3Y.js} +4 -4
  101. package/dist/chunks/{chunk-4PBW54I2.js → chunk-YC6NV7FK.js} +88 -54
  102. package/dist/chunks/chunk-YC6NV7FK.js.map +7 -0
  103. package/dist/chunks/{chunk-6GWDGTHC.js → chunk-YLO62DWD.js} +4 -4
  104. package/dist/cli/decisions.js +2 -2
  105. package/dist/cli/mesh.js +3 -3
  106. package/dist/commands/fabric-handler.d.ts.map +1 -1
  107. package/dist/commands/fabric-handler.js +18 -4
  108. package/dist/commands/fabric-handler.js.map +2 -2
  109. package/dist/commands/fabric.d.ts.map +1 -1
  110. package/dist/compaction/branch-summary.d.ts.map +1 -1
  111. package/dist/compaction/claim-events.js +9 -9
  112. package/dist/compaction/hook.d.ts.map +1 -1
  113. package/dist/compaction/hook.js +6 -6
  114. package/dist/compaction/normalize.d.ts +9 -0
  115. package/dist/compaction/normalize.d.ts.map +1 -1
  116. package/dist/compaction/owner.js +7 -7
  117. package/dist/compaction/projections.d.ts +18 -2
  118. package/dist/compaction/projections.d.ts.map +1 -1
  119. package/dist/compaction/qa.d.ts +3 -2
  120. package/dist/compaction/qa.d.ts.map +1 -1
  121. package/dist/compaction/render.d.ts +3 -0
  122. package/dist/compaction/render.d.ts.map +1 -1
  123. package/dist/compaction/threshold.d.ts.map +1 -1
  124. package/dist/compaction/user-activity.d.ts +31 -0
  125. package/dist/compaction/user-activity.d.ts.map +1 -0
  126. package/dist/components/configuration.js +4 -4
  127. package/dist/config.d.ts +13 -6
  128. package/dist/config.d.ts.map +1 -1
  129. package/dist/core/action-registry.d.ts +1 -1
  130. package/dist/core/action-registry.d.ts.map +1 -1
  131. package/dist/core/action-registry.js +10 -9
  132. package/dist/core/approval-controller.d.ts +3 -0
  133. package/dist/core/approval-controller.d.ts.map +1 -1
  134. package/dist/core/atomic-write.d.ts +1 -0
  135. package/dist/core/atomic-write.d.ts.map +1 -1
  136. package/dist/core/attached-monitors.d.ts +39 -0
  137. package/dist/core/attached-monitors.d.ts.map +1 -0
  138. package/dist/core/control-abort.d.ts +3 -0
  139. package/dist/core/control-abort.d.ts.map +1 -0
  140. package/dist/core/crash-guard.d.ts +15 -0
  141. package/dist/core/crash-guard.d.ts.map +1 -0
  142. package/dist/core/execution-guidelines.d.ts +6 -0
  143. package/dist/core/execution-guidelines.d.ts.map +1 -0
  144. package/dist/core/guidance-delivery.d.ts +19 -0
  145. package/dist/core/guidance-delivery.d.ts.map +1 -0
  146. package/dist/core/lifecycle-settlement.d.ts +9 -0
  147. package/dist/core/lifecycle-settlement.d.ts.map +1 -0
  148. package/dist/core/observation-actions.d.ts +9 -0
  149. package/dist/core/observation-actions.d.ts.map +1 -0
  150. package/dist/core/pasted-images.d.ts +12 -0
  151. package/dist/core/pasted-images.d.ts.map +1 -0
  152. package/dist/core/pasted-images.js +139 -0
  153. package/dist/core/pasted-images.js.map +7 -0
  154. package/dist/core/permission-queue.d.ts +32 -0
  155. package/dist/core/permission-queue.d.ts.map +1 -0
  156. package/dist/core/permission-queue.js +104 -0
  157. package/dist/core/permission-queue.js.map +7 -0
  158. package/dist/core/prompt-guidance.d.ts +1 -0
  159. package/dist/core/prompt-guidance.d.ts.map +1 -1
  160. package/dist/core/prompt-guidance.js +52 -3
  161. package/dist/core/prompt-guidance.js.map +3 -3
  162. package/dist/core/provider-operations.js +1 -1
  163. package/dist/core/shell-inbox.d.ts +1 -1
  164. package/dist/core/shell-inbox.d.ts.map +1 -1
  165. package/dist/core/shell-jobs.d.ts +28 -1
  166. package/dist/core/shell-jobs.d.ts.map +1 -1
  167. package/dist/core/shell-monitor.d.ts +1 -0
  168. package/dist/core/shell-monitor.d.ts.map +1 -1
  169. package/dist/durable/worker.js +0 -42
  170. package/dist/durable/worker.js.map +3 -3
  171. package/dist/durable-extension.d.ts +2 -2
  172. package/dist/durable-extension.d.ts.map +1 -1
  173. package/dist/durable-extension.js +215 -1
  174. package/dist/durable-extension.js.map +3 -3
  175. package/dist/entropy/index.d.ts +2 -0
  176. package/dist/entropy/index.d.ts.map +1 -1
  177. package/dist/entropy/index.js +23 -13
  178. package/dist/entropy/pool-store.d.ts +8 -1
  179. package/dist/entropy/pool-store.d.ts.map +1 -1
  180. package/dist/entropy/pool-worker.d.ts +18 -0
  181. package/dist/entropy/pool-worker.d.ts.map +1 -0
  182. package/dist/entropy/pool-writer.d.ts +23 -0
  183. package/dist/entropy/pool-writer.d.ts.map +1 -0
  184. package/dist/entropy/pool.d.ts +11 -0
  185. package/dist/entropy/pool.d.ts.map +1 -1
  186. package/dist/entropy/sessions.d.ts +5 -0
  187. package/dist/entropy/sessions.d.ts.map +1 -1
  188. package/dist/execution-service.d.ts.map +1 -1
  189. package/dist/extension-bootstrap.d.ts.map +1 -1
  190. package/dist/extension-bootstrap.js +19 -19
  191. package/dist/extension.d.ts.map +1 -1
  192. package/dist/fabric-exec-tool.d.ts.map +1 -1
  193. package/dist/fabric-runtime-state.d.ts.map +1 -1
  194. package/dist/fabric-runtime-state.js +534 -261
  195. package/dist/fabric-runtime-state.js.map +4 -4
  196. package/dist/fabric-state.d.ts.map +1 -1
  197. package/dist/index.js +40 -30
  198. package/dist/index.js.map +1 -1
  199. package/dist/jev/client.js +2 -2
  200. package/dist/jev/observation.js +7 -6
  201. package/dist/jev.js +12 -11
  202. package/dist/main-agent.d.ts.map +1 -1
  203. package/dist/managed-host.d.ts +4 -0
  204. package/dist/managed-host.d.ts.map +1 -1
  205. package/dist/memory/discovery.js +6 -6
  206. package/dist/memory/expand-service.d.ts.map +1 -1
  207. package/dist/memory/file-worker.js +9 -8
  208. package/dist/memory/file-worker.js.map +1 -1
  209. package/dist/memory/history-paging.d.ts +9 -0
  210. package/dist/memory/history-paging.d.ts.map +1 -0
  211. package/dist/memory/history-paging.js +164 -0
  212. package/dist/memory/history-paging.js.map +7 -0
  213. package/dist/memory/index.d.ts.map +1 -1
  214. package/dist/memory/normalize.js +5 -5
  215. package/dist/memory/outline-service.d.ts +7 -0
  216. package/dist/memory/outline-service.d.ts.map +1 -0
  217. package/dist/memory/request-cache.d.ts +3 -1
  218. package/dist/memory/request-cache.d.ts.map +1 -1
  219. package/dist/memory/request-context.d.ts +1 -0
  220. package/dist/memory/request-context.d.ts.map +1 -1
  221. package/dist/memory/request-limits.d.ts +2 -0
  222. package/dist/memory/request-limits.d.ts.map +1 -1
  223. package/dist/memory/search.js +7 -6
  224. package/dist/memory/worker-provider.d.ts.map +1 -1
  225. package/dist/memory/worker-provider.js +10 -9
  226. package/dist/memory.d.ts +16 -1
  227. package/dist/memory.d.ts.map +1 -1
  228. package/dist/memory.js +64 -12
  229. package/dist/memory.js.map +1 -1
  230. package/dist/mesh/store.d.ts +2 -1
  231. package/dist/mesh/store.d.ts.map +1 -1
  232. package/dist/programs/host.js +2 -2
  233. package/dist/protocol.d.ts +5 -0
  234. package/dist/protocol.d.ts.map +1 -1
  235. package/dist/protocol.js +1 -1
  236. package/dist/providers/agents-actions.d.ts.map +1 -1
  237. package/dist/providers/agents-message-router.d.ts +1 -0
  238. package/dist/providers/agents-message-router.d.ts.map +1 -1
  239. package/dist/providers/agents-provider.d.ts +2 -0
  240. package/dist/providers/agents-provider.d.ts.map +1 -1
  241. package/dist/providers/jev-provider.js +12 -11
  242. package/dist/providers/memory-provider.d.ts +4 -0
  243. package/dist/providers/memory-provider.d.ts.map +1 -1
  244. package/dist/providers/memory-provider.js +9 -8
  245. package/dist/providers/pi-read-operations.d.ts +24 -0
  246. package/dist/providers/pi-read-operations.d.ts.map +1 -0
  247. package/dist/providers/pi-tools-provider.d.ts +7 -0
  248. package/dist/providers/pi-tools-provider.d.ts.map +1 -1
  249. package/dist/providers/sessions-provider.d.ts +1 -1
  250. package/dist/providers/sessions-provider.d.ts.map +1 -1
  251. package/dist/providers/tasks-provider.d.ts +3 -1
  252. package/dist/providers/tasks-provider.d.ts.map +1 -1
  253. package/dist/residency/actor-client.js +3 -3
  254. package/dist/residency/client.d.ts.map +1 -1
  255. package/dist/residency/host.d.ts.map +1 -1
  256. package/dist/residency/host.js +17 -16
  257. package/dist/residency/launcher.js +1 -1
  258. package/dist/residency/pi-entry.js +17 -16
  259. package/dist/residency/pi-entry.js.map +1 -1
  260. package/dist/residency/protocol.d.ts +2 -0
  261. package/dist/residency/protocol.d.ts.map +1 -1
  262. package/dist/runtime/core-override-guest-types.js +2 -2
  263. package/dist/runtime/cpython-runtime.d.ts.map +1 -1
  264. package/dist/runtime/cpython-runtime.js +7 -6
  265. package/dist/runtime/cpython-runtime.js.map +2 -2
  266. package/dist/runtime/guest-types.d.ts +1 -1
  267. package/dist/runtime/guest-types.d.ts.map +1 -1
  268. package/dist/runtime/guest-types.js +1 -1
  269. package/dist/runtime/monty-runtime.d.ts.map +1 -1
  270. package/dist/runtime/monty-runtime.js +7 -6
  271. package/dist/runtime/monty-runtime.js.map +2 -2
  272. package/dist/runtime/node-process-runtime.d.ts.map +1 -1
  273. package/dist/runtime/node-process-runtime.js +6 -6
  274. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  275. package/dist/runtime/quickjs-runtime.js +4 -4
  276. package/dist/runtime/type-checker.d.ts.map +1 -1
  277. package/dist/runtime/type-checker.js +1 -1
  278. package/dist/runtime/typescript-kernel.js +10 -10
  279. package/dist/runtime-state-builtins.d.ts +2 -0
  280. package/dist/runtime-state-builtins.d.ts.map +1 -1
  281. package/dist/schema/policy.d.ts.map +1 -1
  282. package/dist/speculation/eligibility.d.ts.map +1 -1
  283. package/dist/speculation/store.d.ts.map +1 -1
  284. package/dist/topology/participant-directory.d.ts +1 -0
  285. package/dist/topology/participant-directory.d.ts.map +1 -1
  286. package/dist/topology/peer-presence.d.ts.map +1 -1
  287. package/dist/topology/provider-participants.d.ts +1 -0
  288. package/dist/topology/provider-participants.d.ts.map +1 -1
  289. package/dist/type-error-guidance.js +1 -1
  290. package/dist/ui/code-preview-shell.d.ts +1 -0
  291. package/dist/ui/code-preview-shell.d.ts.map +1 -1
  292. package/dist/ui/controller.d.ts.map +1 -1
  293. package/dist/ui/conversation-chrome.d.ts.map +1 -1
  294. package/dist/ui/conversation-chrome.js +2 -2
  295. package/dist/ui/conversation-feedback.d.ts +8 -0
  296. package/dist/ui/conversation-feedback.d.ts.map +1 -0
  297. package/dist/ui/conversation-latest.d.ts.map +1 -1
  298. package/dist/ui/conversation-native-reader.d.ts.map +1 -1
  299. package/dist/ui/conversation-native-reader.js +3 -3
  300. package/dist/ui/conversation-native-reader.js.map +2 -2
  301. package/dist/ui/conversation-render.d.ts.map +1 -1
  302. package/dist/ui/conversation.d.ts +1 -0
  303. package/dist/ui/conversation.d.ts.map +1 -1
  304. package/dist/ui/conversation.js +139 -86
  305. package/dist/ui/conversation.js.map +4 -4
  306. package/dist/ui/core-tool-render.d.ts.map +1 -1
  307. package/dist/ui/dashboard-fabric-graph.d.ts.map +1 -1
  308. package/dist/ui/dashboard.js +47 -48
  309. package/dist/ui/dashboard.js.map +3 -3
  310. package/dist/ui/fabric-render.d.ts.map +1 -1
  311. package/dist/ui/format.d.ts.map +1 -1
  312. package/dist/ui/highlight.d.ts.map +1 -1
  313. package/dist/ui/permissions.d.ts +18 -0
  314. package/dist/ui/permissions.d.ts.map +1 -0
  315. package/dist/ui/permissions.js +178 -0
  316. package/dist/ui/permissions.js.map +7 -0
  317. package/dist/ui/row-balance.d.ts +1 -1
  318. package/dist/ui/row-balance.d.ts.map +1 -1
  319. package/dist/ui/settings-sections-execution.d.ts.map +1 -1
  320. package/dist/ui/settings-values.d.ts.map +1 -1
  321. package/dist/ui/settings.js +37 -31
  322. package/dist/ui/settings.js.map +2 -2
  323. package/dist/ui/shell-hang-keys.d.ts.map +1 -1
  324. package/dist/ui/shell-tasks.d.ts.map +1 -1
  325. package/dist/ui/shell-tasks.js +28 -11
  326. package/dist/ui/shell-tasks.js.map +2 -2
  327. package/dist/ui/structured.d.ts.map +1 -1
  328. package/dist/ui/tool-display.d.ts +18 -2
  329. package/dist/ui/tool-display.d.ts.map +1 -1
  330. package/dist/ui/truncate.d.ts +3 -0
  331. package/dist/ui/truncate.d.ts.map +1 -0
  332. package/dist/ui/widget.d.ts +7 -2
  333. package/dist/ui/widget.d.ts.map +1 -1
  334. package/dist/verified/context.d.ts +35 -0
  335. package/dist/verified/context.d.ts.map +1 -0
  336. package/dist/verified/execution.d.ts +7 -0
  337. package/dist/verified/execution.d.ts.map +1 -0
  338. package/dist/verified/generated/context.d.ts +6 -0
  339. package/dist/verified/generated/context.js +51 -0
  340. package/dist/verified/generated/execution.d.ts +5 -0
  341. package/dist/verified/generated/execution.js +32 -0
  342. package/dist/verified/generated/manifest.json +34 -3
  343. package/dist/verified/generated/prompt-guidance.d.ts +4 -0
  344. package/dist/verified/generated/prompt-guidance.js +17 -0
  345. package/dist/worker/recovery-watchdog.d.ts +7 -0
  346. package/dist/worker/recovery-watchdog.d.ts.map +1 -1
  347. package/dist/worker/recovery-watchdog.js +66 -4
  348. package/dist/worker/recovery-watchdog.js.map +2 -2
  349. package/dist/worker.js +22 -3
  350. package/dist/worker.js.map +2 -2
  351. package/docs/agents.md +37 -4
  352. package/docs/architecture.md +13 -0
  353. package/docs/background-tasks.md +81 -5
  354. package/docs/benchmarks/cli-resume-2026-11-09.json +1260 -0
  355. package/docs/benchmarks/interactivity-2026-11-09.json +2280 -0
  356. package/docs/benchmarks/resume-latency-2026-11-09.json +12105 -0
  357. package/docs/benchmarks/resume-startup-fix-2026-11-09.json +5452 -0
  358. package/docs/benchmarks/session-memory-2026-11-09.json +1320 -0
  359. package/docs/benchmarks/session-memory-fix-2026-11-09.json +280 -0
  360. package/docs/compaction.md +59 -23
  361. package/docs/configuration.md +53 -11
  362. package/docs/entropy.md +4 -1
  363. package/docs/history-paging.md +99 -0
  364. package/docs/interactivity-investigation.md +109 -0
  365. package/docs/interface.md +2 -2
  366. package/docs/jev.md +1 -1
  367. package/docs/memory-recall.md +42 -1
  368. package/docs/providers.md +24 -1
  369. package/docs/resume-latency-investigation.md +249 -0
  370. package/docs/session-memory-investigation.md +223 -0
  371. package/docs/verified-kernels.md +56 -0
  372. package/package.json +211 -211
  373. package/proofs/context.ts +139 -0
  374. package/proofs/execution.ts +48 -0
  375. package/proofs/index.ts +6 -0
  376. package/proofs/prompt-guidance.ts +38 -0
  377. package/scripts/verified-kernels.ts +1 -1
  378. package/skillsets/python/fabric-council/SKILL.md +31 -21
  379. package/skillsets/python/fabric-exec/SKILL.md +1 -1
  380. package/skillsets/python/fabric-exec/references/agents.md +2 -0
  381. package/skillsets/python/fabric-guide/SKILL.md +1 -0
  382. package/skillsets/python/fabric-memory/SKILL.md +82 -0
  383. package/skillsets/typescript/fabric-council/SKILL.md +26 -17
  384. package/skillsets/typescript/fabric-exec/SKILL.md +3 -2
  385. package/skillsets/typescript/fabric-exec/references/agents.md +1 -0
  386. package/skillsets/typescript/fabric-guide/SKILL.md +1 -0
  387. package/skillsets/typescript/fabric-memory/SKILL.md +87 -0
  388. package/dist/chunks/chunk-3VK6UGAN.js.map +0 -7
  389. package/dist/chunks/chunk-3XT5WHSG.js.map +0 -7
  390. package/dist/chunks/chunk-4BYS4ZLY.js.map +0 -7
  391. package/dist/chunks/chunk-4PBW54I2.js.map +0 -7
  392. package/dist/chunks/chunk-56NMRVTV.js.map +0 -7
  393. package/dist/chunks/chunk-7N7IC3Z2.js.map +0 -7
  394. package/dist/chunks/chunk-DGERP4VL.js.map +0 -7
  395. package/dist/chunks/chunk-DGUXJSYA.js.map +0 -7
  396. package/dist/chunks/chunk-F6A6MQ6G.js.map +0 -7
  397. package/dist/chunks/chunk-FK73YJKV.js.map +0 -7
  398. package/dist/chunks/chunk-G2DZJ5LK.js.map +0 -7
  399. package/dist/chunks/chunk-HFDJWLMS.js.map +0 -7
  400. package/dist/chunks/chunk-HRDMBGMY.js.map +0 -7
  401. package/dist/chunks/chunk-HRVYXRWZ.js.map +0 -7
  402. package/dist/chunks/chunk-LKYLD5SN.js.map +0 -7
  403. package/dist/chunks/chunk-LRSZFYUC.js.map +0 -7
  404. package/dist/chunks/chunk-LZ2ZXOCU.js.map +0 -7
  405. package/dist/chunks/chunk-MPMEK3IQ.js.map +0 -7
  406. package/dist/chunks/chunk-OJ4HAALD.js.map +0 -7
  407. package/dist/chunks/chunk-QGTD3LAZ.js.map +0 -7
  408. package/dist/chunks/chunk-QNMQJNXE.js.map +0 -7
  409. package/dist/chunks/chunk-RKJPBTBB.js.map +0 -7
  410. package/dist/chunks/chunk-U6Y6TKJL.js.map +0 -7
  411. package/dist/chunks/chunk-VGRUWTMG.js.map +0 -7
  412. package/dist/chunks/chunk-XOBLUZMB.js.map +0 -7
  413. package/dist/durable/openai-sse-patch.d.ts +0 -21
  414. package/dist/durable/openai-sse-patch.d.ts.map +0 -1
  415. /package/dist/chunks/{chunk-7YNE4NB2.js.map → chunk-2MELFQCQ.js.map} +0 -0
  416. /package/dist/chunks/{chunk-HSEZPCL5.js.map → chunk-2OC4YJOL.js.map} +0 -0
  417. /package/dist/chunks/{chunk-TXCNZCZP.js.map → chunk-2QJ4MNS6.js.map} +0 -0
  418. /package/dist/chunks/{chunk-QOEOKW2X.js.map → chunk-3QH6JAE3.js.map} +0 -0
  419. /package/dist/chunks/{chunk-L6H46CPY.js.map → chunk-6NNL5LOG.js.map} +0 -0
  420. /package/dist/chunks/{chunk-RWKQ5SRW.js.map → chunk-7ZFPVOV2.js.map} +0 -0
  421. /package/dist/chunks/{chunk-PUBHBEYO.js.map → chunk-B2FIGOPI.js.map} +0 -0
  422. /package/dist/chunks/{chunk-4WKD3YM3.js.map → chunk-C3UPHOJW.js.map} +0 -0
  423. /package/dist/chunks/{chunk-RAA3FAYZ.js.map → chunk-GNPTDN6K.js.map} +0 -0
  424. /package/dist/chunks/{chunk-XFOSUGLU.js.map → chunk-JCGEW5OQ.js.map} +0 -0
  425. /package/dist/chunks/{chunk-CXYJJ3HZ.js.map → chunk-LJ2MG6U2.js.map} +0 -0
  426. /package/dist/chunks/{chunk-3MOY6WIB.js.map → chunk-LRBDEAKB.js.map} +0 -0
  427. /package/dist/chunks/{chunk-NQ7IWEIF.js.map → chunk-MQGRQMVM.js.map} +0 -0
  428. /package/dist/chunks/{chunk-WKFRGICG.js.map → chunk-RBYRHS24.js.map} +0 -0
  429. /package/dist/chunks/{chunk-ZHROHNEE.js.map → chunk-RFNYH7S7.js.map} +0 -0
  430. /package/dist/chunks/{chunk-H57KPL3V.js.map → chunk-S2JWFXW5.js.map} +0 -0
  431. /package/dist/chunks/{chunk-KIFOEBYJ.js.map → chunk-VEXCD3RA.js.map} +0 -0
  432. /package/dist/chunks/{chunk-GS67KDMV.js.map → chunk-VN7AE3EY.js.map} +0 -0
  433. /package/dist/chunks/{chunk-MX53BRAC.js.map → chunk-XBAOTA4U.js.map} +0 -0
  434. /package/dist/chunks/{chunk-MSDL7U6Q.js.map → chunk-XQCNVH3Y.js.map} +0 -0
  435. /package/dist/chunks/{chunk-6GWDGTHC.js.map → chunk-YLO62DWD.js.map} +0 -0
@@ -1,26 +1,27 @@
1
+ import {
2
+ KittyViewport,
3
+ isKittyImageLine
4
+ } from "../chunks/chunk-2Y24ML7H.js";
1
5
  import {
2
6
  defaultConversationTarget
3
7
  } from "../chunks/chunk-NBIYYMKS.js";
4
8
  import {
5
9
  conversationFooter
6
- } from "../chunks/chunk-DGERP4VL.js";
10
+ } from "../chunks/chunk-P4TALNLX.js";
7
11
  import {
8
12
  getConversationHost
9
13
  } from "../chunks/chunk-UGYCAG6O.js";
10
- import {
11
- KittyViewport,
12
- isKittyImageLine
13
- } from "../chunks/chunk-2Y24ML7H.js";
14
14
  import {
15
15
  highlightCode
16
- } from "../chunks/chunk-QNMQJNXE.js";
16
+ } from "../chunks/chunk-X4HDI7RT.js";
17
+ import {
18
+ borderBadge,
19
+ safeText,
20
+ truncateStyledText
21
+ } from "../chunks/chunk-DWM63MAJ.js";
17
22
  import {
18
23
  isActiveStatus
19
24
  } from "../chunks/chunk-37NIOSVU.js";
20
- import {
21
- borderBadge,
22
- safeText
23
- } from "../chunks/chunk-FK73YJKV.js";
24
25
  import {
25
26
  terminalSafe,
26
27
  unwrapActorEnvelopeText
@@ -32,9 +33,8 @@ import {
32
33
  CURSOR_MARKER,
33
34
  getKeybindings as getKeybindings3,
34
35
  Key as Key2,
35
- Text,
36
+ Text as Text2,
36
37
  matchesKey as matchesKey2,
37
- truncateToWidth as truncateToWidth4,
38
38
  visibleWidth as visibleWidth5
39
39
  } from "@earendil-works/pi-tui";
40
40
 
@@ -105,7 +105,39 @@ var BorderStatusEditor = class extends Editor {
105
105
  };
106
106
 
107
107
  // src/ui/conversation-render.ts
108
- import { wrapTextWithAnsi } from "@earendil-works/pi-tui";
108
+ import { Text, wrapTextWithAnsi } from "@earendil-works/pi-tui";
109
+
110
+ // src/ui/conversation-feedback.ts
111
+ import { stripVTControlCharacters } from "node:util";
112
+ var preview = (text, limit) => {
113
+ const clean = stripVTControlCharacters(text).replace(/[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, " ").replace(/\s+/g, " ").trim();
114
+ return clean.length > limit ? `${clean.slice(0, limit - 1)}\u2026` : clean;
115
+ };
116
+ var formatAgentFeedback = (sender, text) => `Agent ${preview(sender, 80) || "unknown"}: ${preview(text, 240)}`;
117
+ var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
118
+ function conversationFeedback(message) {
119
+ const details = record(message.details);
120
+ if (message.customType === "pi-fabric-actor") {
121
+ const actor = record(details?.actor);
122
+ const feedback = record(details?.message);
123
+ return typeof actor?.name === "string" && typeof feedback?.text === "string" ? formatAgentFeedback(actor.name, feedback.text) : void 0;
124
+ }
125
+ if (message.customType !== "pi-fabric-agent-message") return void 0;
126
+ const from = record(details?.from);
127
+ const sender = typeof from?.name === "string" && from.name ? from.name : from?.id;
128
+ if (typeof sender !== "string") return void 0;
129
+ const content = message.content;
130
+ const closing = "\n</fabric-agent-message>";
131
+ if (!content.startsWith("<fabric-agent-message ") || !content.endsWith(closing)) return void 0;
132
+ const start = content.indexOf("\n") + 1;
133
+ if (start === 0) return void 0;
134
+ const data = content.indexOf("\n<data>", start);
135
+ const end = data < 0 ? content.length - closing.length : data;
136
+ const text = content.slice(start, end).replace(/&(amp|lt|gt);/g, (_entity, name) => name === "amp" ? "&" : name === "lt" ? "<" : ">");
137
+ return formatAgentFeedback(sender, text);
138
+ }
139
+
140
+ // src/ui/conversation-render.ts
109
141
  var DEFAULT_IMAGE_WIDTH_CELLS = 60;
110
142
  var stableKey = (value) => {
111
143
  if (value === void 0) return "undefined";
@@ -369,7 +401,12 @@ var FabricConversationTranscriptRenderer = class {
369
401
  this.renderBashExecution(message, width, options, lines);
370
402
  return;
371
403
  case "custom":
372
- if (!message.display) return;
404
+ if (!message.display) {
405
+ if (message.customType !== "pi-fabric-agent-message" && message.customType !== "pi-fabric-actor") return;
406
+ const feedback = conversationFeedback({ ...message, content: customText(message) });
407
+ if (feedback !== void 0) lines.push(...new Text(this.theme.fg("dim", feedback), 1, 0).render(width));
408
+ return;
409
+ }
373
410
  this.pushSpacer(lines);
374
411
  this.renderCustomMessage(message, width, options, lines);
375
412
  return;
@@ -391,9 +428,9 @@ var FabricConversationTranscriptRenderer = class {
391
428
  this.pushSpacer(lines);
392
429
  const skillBlock = getConversationHost().parseSkillBlock(text);
393
430
  if (skillBlock) {
394
- const record = this.messageRecord(this.messageKey(message), () => new (getConversationHost()).SkillInvocationMessageComponent(skillBlock, this.markdownTheme(options)));
395
- record.component.setExpanded(options.toolsExpanded);
396
- lines.push(...safeRender(record.component, width, () => this.plainTextFallback(text, width)));
431
+ const record2 = this.messageRecord(this.messageKey(message), () => new (getConversationHost()).SkillInvocationMessageComponent(skillBlock, this.markdownTheme(options)));
432
+ record2.component.setExpanded(options.toolsExpanded);
433
+ lines.push(...safeRender(record2.component, width, () => this.plainTextFallback(text, width)));
397
434
  if (skillBlock.userMessage) {
398
435
  this.pushSpacer(lines);
399
436
  lines.push(...this.userComponentLines(skillBlock.userMessage, width, options));
@@ -412,13 +449,13 @@ var FabricConversationTranscriptRenderer = class {
412
449
  return safeRender(component, width, () => this.plainTextFallback(text, width));
413
450
  }
414
451
  renderAssistantContent(message, key, streaming, width, options, lines) {
415
- const record = this.assistantRecord(key, options);
416
- if (record.message !== message || record.streaming !== streaming) {
417
- record.component.updateContent(message, streaming);
418
- record.message = message;
419
- record.streaming = streaming;
452
+ const record2 = this.assistantRecord(key, options);
453
+ if (record2.message !== message || record2.streaming !== streaming) {
454
+ record2.component.updateContent(message, streaming);
455
+ record2.message = message;
456
+ record2.streaming = streaming;
420
457
  }
421
- lines.push(...safeRender(record.component, width, () => this.plainTextFallback(assistantText(message), width)));
458
+ lines.push(...safeRender(record2.component, width, () => this.plainTextFallback(assistantText(message), width)));
422
459
  }
423
460
  reconcileTool(id, name, callArgs, result, tool, error, options) {
424
461
  const key = `${this.currentTargetId}\0${id}`;
@@ -428,17 +465,17 @@ var FabricConversationTranscriptRenderer = class {
428
465
  const isError = result?.isError ?? tool?.isError ?? !!error;
429
466
  const started = tool ? tool.executionStarted ?? true : false;
430
467
  const argsComplete = !!result || !!tool?.result || !!tool?.argsComplete;
431
- let record = this.toolComponents.get(key);
432
- const images = record?.result === value ? void 0 : value?.content?.filter(
468
+ let record2 = this.toolComponents.get(key);
469
+ const images = record2?.result === value ? void 0 : value?.content?.filter(
433
470
  (block) => !!block && typeof block === "object" && block.type === "image"
434
471
  );
435
- const imageKey = record && record.result === value ? record.imageKey : stableKey(images?.length ? images : void 0);
436
- if (record && (record.name !== name || record.imageKey !== imageKey || !record.isPartial && isPartial || record.argsComplete && !argsComplete || record.started && !started && !result)) {
472
+ const imageKey = record2 && record2.result === value ? record2.imageKey : stableKey(images?.length ? images : void 0);
473
+ if (record2 && (record2.name !== name || record2.imageKey !== imageKey || !record2.isPartial && isPartial || record2.argsComplete && !argsComplete || record2.started && !started && !result)) {
437
474
  this.releaseTool(key);
438
- record = void 0;
475
+ record2 = void 0;
439
476
  }
440
477
  let row = this.toolRows.get(key);
441
- if (!record) {
478
+ if (!record2) {
442
479
  const token = {};
443
480
  this.toolTokens.set(key, token);
444
481
  const definition = this.definitionFor(name, key, token);
@@ -466,7 +503,7 @@ var FabricConversationTranscriptRenderer = class {
466
503
  options.target.cwd ?? process.cwd()
467
504
  );
468
505
  if (options.toolsExpanded) component2.setExpanded(true);
469
- record = {
506
+ record2 = {
470
507
  component: component2,
471
508
  name,
472
509
  dynamicRenderer: !!definition?.renderCall || !!definition?.renderResult,
@@ -482,7 +519,7 @@ var FabricConversationTranscriptRenderer = class {
482
519
  isError: false,
483
520
  error: void 0
484
521
  };
485
- this.toolComponents.set(key, record);
522
+ this.toolComponents.set(key, record2);
486
523
  row = {
487
524
  spacer: false,
488
525
  dynamic: !!definition?.renderCall || !!definition?.renderResult || isPartial || imageKey !== "undefined",
@@ -490,26 +527,26 @@ var FabricConversationTranscriptRenderer = class {
490
527
  };
491
528
  this.toolRows.set(key, row);
492
529
  }
493
- const { component } = record;
530
+ const { component } = record2;
494
531
  let changed = false;
495
- if (record.args !== args) {
532
+ if (record2.args !== args) {
496
533
  component.updateArgs(args);
497
534
  changed = true;
498
- record.args = args;
499
- record.argsKey = String(Number(record.argsKey) + 1);
535
+ record2.args = args;
536
+ record2.argsKey = String(Number(record2.argsKey) + 1);
500
537
  }
501
- if (started && !record.started) {
502
- record.started = true;
538
+ if (started && !record2.started) {
539
+ record2.started = true;
503
540
  component.markExecutionStarted();
504
541
  changed = true;
505
542
  }
506
- if (argsComplete && !record.argsComplete) {
507
- record.argsComplete = true;
543
+ if (argsComplete && !record2.argsComplete) {
544
+ record2.argsComplete = true;
508
545
  component.setArgsComplete();
509
546
  changed = true;
510
547
  }
511
- if (record.result !== value || record.isPartial !== isPartial || record.isError !== isError || record.error !== error) {
512
- const resultKey = String(Number(record.resultKey ?? 0) + 1);
548
+ if (record2.result !== value || record2.isPartial !== isPartial || record2.isError !== isError || record2.error !== error) {
549
+ const resultKey = String(Number(record2.resultKey ?? 0) + 1);
513
550
  if (value !== void 0 || error !== void 0) {
514
551
  component.updateResult({
515
552
  content: error && !value ? [{ type: "text", text: error }] : value?.content ?? [],
@@ -518,14 +555,14 @@ var FabricConversationTranscriptRenderer = class {
518
555
  }, isPartial);
519
556
  changed = true;
520
557
  }
521
- record.result = value;
522
- record.resultKey = resultKey;
523
- record.partialKey = isPartial ? resultKey : void 0;
524
- record.isPartial = isPartial;
525
- record.isError = isError;
526
- record.error = error;
527
- }
528
- row.dynamic = record.dynamicRenderer || isPartial || imageKey !== "undefined";
558
+ record2.result = value;
559
+ record2.resultKey = resultKey;
560
+ record2.partialKey = isPartial ? resultKey : void 0;
561
+ record2.isPartial = isPartial;
562
+ record2.isError = isError;
563
+ record2.error = error;
564
+ }
565
+ row.dynamic = record2.dynamicRenderer || isPartial || imageKey !== "undefined";
529
566
  if (changed) row.lines = void 0;
530
567
  return row;
531
568
  }
@@ -537,30 +574,30 @@ var FabricConversationTranscriptRenderer = class {
537
574
  }
538
575
  renderBashExecution(message, width, options, lines) {
539
576
  const key = this.messageKey(message);
540
- const record = this.messageRecord(key, () => {
577
+ const record2 = this.messageRecord(key, () => {
541
578
  const component = new (getConversationHost()).BashExecutionComponent(message.command, this.tui, message.excludeFromContext);
542
579
  component.appendOutput(terminalSafe(message.output ?? "", false));
543
580
  const truncation = message.truncated ? { truncated: true } : void 0;
544
581
  component.setComplete(message.exitCode, message.cancelled, truncation, message.fullOutputPath);
545
582
  return component;
546
583
  });
547
- record.component.setExpanded(options.toolsExpanded);
548
- lines.push(...safeRender(record.component, width, () => this.plainTextFallback(message.command, width)));
584
+ record2.component.setExpanded(options.toolsExpanded);
585
+ lines.push(...safeRender(record2.component, width, () => this.plainTextFallback(message.command, width)));
549
586
  }
550
587
  renderCustomMessage(message, width, options, lines) {
551
- const record = this.messageRecord(this.messageKey(message), () => new (getConversationHost()).CustomMessageComponent(
588
+ const record2 = this.messageRecord(this.messageKey(message), () => new (getConversationHost()).CustomMessageComponent(
552
589
  message,
553
590
  this.rendererOptions.getMessageRenderer?.(message.customType),
554
591
  this.markdownTheme(options),
555
592
  options.outputPad ?? 1
556
593
  ));
557
- record.component.setExpanded(options.toolsExpanded);
558
- lines.push(...safeRender(record.component, width, () => this.plainTextFallback(customText(message), width)));
594
+ record2.component.setExpanded(options.toolsExpanded);
595
+ lines.push(...safeRender(record2.component, width, () => this.plainTextFallback(customText(message), width)));
559
596
  }
560
597
  renderBoxedMessage(key, message, create, width, options, lines) {
561
- const record = this.messageRecord(key, () => new create(message, this.markdownTheme(options)));
562
- record.component.setExpanded(options.toolsExpanded);
563
- lines.push(...safeRender(record.component, width, () => this.plainTextFallback(message.summary, width)));
598
+ const record2 = this.messageRecord(key, () => new create(message, this.markdownTheme(options)));
599
+ record2.component.setExpanded(options.toolsExpanded);
600
+ lines.push(...safeRender(record2.component, width, () => this.plainTextFallback(message.summary, width)));
564
601
  }
565
602
  /**
566
603
  * Registered definition with wrapped renderer callbacks: the render context
@@ -596,9 +633,9 @@ var FabricConversationTranscriptRenderer = class {
596
633
  assistantRecord(key, options) {
597
634
  const cacheKey = key;
598
635
  const hideThinking = options.hideThinking ?? false;
599
- let record = this.assistantComponents.get(cacheKey);
600
- if (!record || record.hideThinking !== hideThinking) {
601
- record = {
636
+ let record2 = this.assistantComponents.get(cacheKey);
637
+ if (!record2 || record2.hideThinking !== hideThinking) {
638
+ record2 = {
602
639
  hideThinking,
603
640
  component: new (getConversationHost()).AssistantMessageComponent(
604
641
  void 0,
@@ -609,18 +646,18 @@ var FabricConversationTranscriptRenderer = class {
609
646
  this.rendererOptions.markdownTransformers
610
647
  )
611
648
  };
612
- this.assistantComponents.set(cacheKey, record);
649
+ this.assistantComponents.set(cacheKey, record2);
613
650
  }
614
- return record;
651
+ return record2;
615
652
  }
616
653
  messageRecord(key, create) {
617
654
  const cacheKey = key;
618
- let record = this.messageComponents.get(cacheKey);
619
- if (!record) {
620
- record = { component: create() };
621
- this.messageComponents.set(cacheKey, record);
655
+ let record2 = this.messageComponents.get(cacheKey);
656
+ if (!record2) {
657
+ record2 = { component: create() };
658
+ this.messageComponents.set(cacheKey, record2);
622
659
  }
623
- return record;
660
+ return record2;
624
661
  }
625
662
  releaseRendererStates(key) {
626
663
  for (const state of this.rendererStates.get(key) ?? []) {
@@ -900,7 +937,7 @@ function activeBackground(prefix) {
900
937
  }
901
938
 
902
939
  // src/ui/conversation-latest.ts
903
- import { compositeTuiLine as compositeTuiLine2, getKeybindings, truncateToWidth as truncateToWidth2, visibleWidth as visibleWidth4 } from "@earendil-works/pi-tui";
940
+ import { compositeTuiLine as compositeTuiLine2, getKeybindings, visibleWidth as visibleWidth4 } from "@earendil-works/pi-tui";
904
941
  var ConversationLatest = class {
905
942
  rect;
906
943
  clear() {
@@ -919,12 +956,12 @@ var ConversationLatest = class {
919
956
  const display = process.platform === "darwin" && part.toLowerCase() === "alt" ? "option" : part;
920
957
  return display.charAt(0).toUpperCase() + display.slice(1);
921
958
  }).join("+")).join("/");
922
- const label = truncateToWidth2(theme.bg("selectedBg", theme.fg(
959
+ const label = truncateStyledText(theme.bg("selectedBg", theme.fg(
923
960
  "text",
924
961
  ` \u2193 Jump to latest message${shortcut ? ` \xB7 ${shortcut}` : ""} `
925
962
  )), width, "");
926
963
  const column = Math.floor((width - visibleWidth4(label)) / 2);
927
- const text = truncateToWidth2(label, Math.max(0, width - (scrollbarVisible ? 1 : 0) - column), "");
964
+ const text = truncateStyledText(label, Math.max(0, width - (scrollbarVisible ? 1 : 0) - column), "");
928
965
  const textWidth = visibleWidth4(text);
929
966
  if (textWidth === 0) return;
930
967
  lines[row] = compositeTuiLine2(lines[row] ?? "", text, column, textWidth, width);
@@ -996,8 +1033,7 @@ import { createHash } from "node:crypto";
996
1033
  import {
997
1034
  Key,
998
1035
  getKeybindings as getKeybindings2,
999
- matchesKey,
1000
- truncateToWidth as truncateToWidth3
1036
+ matchesKey
1001
1037
  } from "@earendil-works/pi-tui";
1002
1038
  var QUEUE_STEER_CONVERSATION_QUEUE_REQUEST_EVENT = "queue-steer:conversation-queue:request:v1";
1003
1039
  var DEQUEUE_FALLBACK = "alt+up";
@@ -1460,10 +1496,10 @@ function createConversationQueue(options) {
1460
1496
  theme
1461
1497
  );
1462
1498
  const lines2 = widget.render(width);
1463
- if (dispatched.length > 0) lines2.push(theme.fg("dim", truncateToWidth3("Sent rows await child delivery; they cannot be edited locally.", width, "")));
1499
+ if (dispatched.length > 0) lines2.push(theme.fg("dim", truncateStyledText("Sent rows await child delivery; they cannot be edited locally.", width, "")));
1464
1500
  return lines2;
1465
1501
  }
1466
- const lines = [""];
1502
+ const lines = [];
1467
1503
  const innerWidth = Math.max(0, width - 2);
1468
1504
  const dequeueHint = (options.keybindings ?? getKeybindings2()).getKeys("app.message.dequeue").join("/") || DEQUEUE_FALLBACK;
1469
1505
  for (const row of rows) {
@@ -1472,11 +1508,11 @@ function createConversationQueue(options) {
1472
1508
  const note = row.removed ? " \xB7 removed on save" : row.paused ? " \xB7 paused" : "";
1473
1509
  const color = row.state === "dispatched" ? "dim" : bridge ? bridge.laneColor(row.lane) : "dim";
1474
1510
  lines.push(
1475
- ` ${theme.fg(color, truncateToWidth3(`${marker}${label}: ${row.text.replace(/\n/g, " ")}${note}`, innerWidth, "\u2026"))} `
1511
+ ` ${theme.fg(color, truncateStyledText(`${marker}${label}: ${row.text.replace(/\n/g, " ")}${note}`, innerWidth, "\u2026"))} `
1476
1512
  );
1477
1513
  }
1478
1514
  const hint = queue.length > 0 ? `\u21B3 ${dequeueHint} to edit queued messages` : "\u21B3 Waiting for child delivery";
1479
- lines.push(` ${theme.fg("dim", truncateToWidth3(hint, innerWidth, "\u2026"))} `);
1515
+ lines.push(` ${theme.fg("dim", truncateStyledText(hint, innerWidth, "\u2026"))} `);
1480
1516
  return lines;
1481
1517
  },
1482
1518
  handleInput(data) {
@@ -1871,6 +1907,7 @@ var FabricConversationView = class {
1871
1907
  list;
1872
1908
  listFocused = false;
1873
1909
  listTop = 0;
1910
+ rawMousePress;
1874
1911
  currentId;
1875
1912
  feedback;
1876
1913
  commandNotification;
@@ -2038,8 +2075,8 @@ var FabricConversationView = class {
2038
2075
  const button = Number(mouse[1]);
2039
2076
  const wheel = (button & 64) !== 0;
2040
2077
  const release = mouse[4] === "m" || !wheel && (button & 3) === 3 && !(button & 32);
2041
- this.handleMouse({
2042
- type: wheel ? "wheel" : release ? "release" : button & 32 ? "drag" : "press",
2078
+ const event = {
2079
+ type: wheel ? "wheel" : release ? "release" : button & 32 ? (button & 3) === 3 ? "move" : "drag" : "press",
2043
2080
  button: wheel ? "none" : (button & 3) === 0 ? "left" : (button & 3) === 1 ? "middle" : (button & 3) === 2 ? "right" : "none",
2044
2081
  ...wheel ? { wheelDelta: (button & 1) === 0 ? -3 : 3 } : {},
2045
2082
  x: Number(mouse[2]) - 1,
@@ -2051,9 +2088,17 @@ var FabricConversationView = class {
2051
2088
  shift: !!(button & 4),
2052
2089
  alt: !!(button & 8),
2053
2090
  ctrl: !!(button & 16)
2054
- });
2091
+ };
2092
+ const pressed = this.rawMousePress;
2093
+ if (event.type === "press") this.rawMousePress = { x: event.x, y: event.y, button: event.button };
2094
+ else if (event.type !== "move") this.rawMousePress = void 0;
2095
+ this.handleMouse(event);
2096
+ if (event.type === "release" && pressed?.button === "left" && (event.button === "left" || event.button === "none") && pressed.x === event.x && pressed.y === event.y) {
2097
+ this.handleMouse({ ...event, type: "click", button: "left" });
2098
+ }
2055
2099
  return;
2056
2100
  }
2101
+ this.rawMousePress = void 0;
2057
2102
  if (this.listFocused && this.list) {
2058
2103
  this.list.handleInput(data);
2059
2104
  this.tui.requestRender();
@@ -2176,6 +2221,10 @@ var FabricConversationView = class {
2176
2221
  head.push(feedback);
2177
2222
  remaining--;
2178
2223
  }
2224
+ const editorGap = editorShowsTopBorder && remaining > 1 ? [""] : [];
2225
+ remaining -= editorGap.length;
2226
+ const queueGap = queueLines.length > 0 && queueLines.length + 2 <= remaining ? [""] : [];
2227
+ remaining -= queueGap.length;
2179
2228
  const queueBudget = Math.max(0, remaining - 1);
2180
2229
  if (queueLines.length > queueBudget) {
2181
2230
  const cursor = queueLines.findIndex((line) => line.includes(CURSOR_MARKER));
@@ -2229,7 +2278,7 @@ var FabricConversationView = class {
2229
2278
  this.theme
2230
2279
  );
2231
2280
  } else this.scrollbar.reset();
2232
- return [...head, ...body.slice(0, remaining), ...queueLines, ...editorLines, ...footer, ...list].slice(0, rows).map((line) => isKittyImageLine(line) || visibleWidth5(line) <= width ? line : truncateToWidth4(line, width, ""));
2281
+ return [...head, ...body.slice(0, remaining), ...queueGap, ...queueLines, ...editorGap, ...editorLines, ...footer, ...list].slice(0, rows).map((line) => isKittyImageLine(line) || visibleWidth5(line) <= width ? line : truncateStyledText(line, width, ""));
2233
2282
  }
2234
2283
  /** Observe files without rendering native history; true means a visible change
2235
2284
  * or a live animation still needs the normal TUI render path. */
@@ -2237,6 +2286,10 @@ var FabricConversationView = class {
2237
2286
  if (this.disposed) return false;
2238
2287
  this.updateTargets();
2239
2288
  const changed = this.observe();
2289
+ if (this.currentId && this.state.view(this.currentId).following && this.observedTranscript?.hasMore && !this.observedTranscript.hasNewer && this.lastBody.length > 0 && this.lastBody.length < this.lastBodyBudget && this.options.loadOlder(this.currentId)) {
2290
+ this.observe();
2291
+ return true;
2292
+ }
2240
2293
  return changed || this.selectedTargetIsWorking();
2241
2294
  }
2242
2295
  observe() {
@@ -2558,13 +2611,13 @@ var FabricConversationView = class {
2558
2611
  this.feedback = void 0;
2559
2612
  const text = safeText(message).slice(0, 4096);
2560
2613
  this.commandNotification = {
2561
- component: new Text(
2614
+ component: new Text2(
2562
2615
  this.theme.fg(kind === "error" ? "error" : "dim", kind === "error" ? `Error: ${text}` : text),
2563
2616
  kind === "error" ? this.options.appearance?.outputPad ?? 1 : 1,
2564
2617
  0
2565
2618
  ),
2566
2619
  epoch: this.state.epoch,
2567
- ...options.reserve !== void 0 ? { pendingResult: new Text(this.theme.fg("dim", safeText(options.reserve).slice(0, 4096)), 1, 0) } : {}
2620
+ ...options.reserve !== void 0 ? { pendingResult: new Text2(this.theme.fg("dim", safeText(options.reserve).slice(0, 4096)), 1, 0) } : {}
2568
2621
  };
2569
2622
  if (options.reveal !== false) {
2570
2623
  const entry = this.state.view(this.currentId);
@@ -2834,14 +2887,14 @@ var FabricConversationView = class {
2834
2887
  const access = target?.readOnlyReason ? " \xB7 read-only" : "";
2835
2888
  const name = target ? isMainTarget(target) ? "Main" : safeText(target.name) || safeText(target.id) : "Fabric";
2836
2889
  const suffix = visibleWidth5(access) + 1 <= labelWidth ? access : "";
2837
- const label = truncateToWidth4(name, Math.max(0, labelWidth - visibleWidth5(suffix)), "\u2026") + suffix;
2890
+ const label = truncateStyledText(name, Math.max(0, labelWidth - visibleWidth5(suffix)), "\u2026") + suffix;
2838
2891
  return borderBadge(this.editor?.borderColor("\u2500") ?? "", label);
2839
2892
  }
2840
2893
  currentFeedbackLine(width) {
2841
2894
  if (!this.feedback) return void 0;
2842
2895
  if (Date.now() - this.feedback.at > FEEDBACK_TTL_MS) return void 0;
2843
2896
  const color = this.feedback.kind === "error" ? "error" : "accent";
2844
- return truncateToWidth4(this.theme.fg(color, this.feedback.text), width, "");
2897
+ return truncateStyledText(this.theme.fg(color, this.feedback.text), width, "");
2845
2898
  }
2846
2899
  renderEditorLines(innerWidth) {
2847
2900
  const editor = this.editor;
@@ -2905,7 +2958,7 @@ var FabricConversationView = class {
2905
2958
  while (tail.length < reserved) tail.push("");
2906
2959
  }
2907
2960
  if (!editorVisible && !this.observedTranscript?.hasNewer) tail.push(...this.working?.render(width) ?? []);
2908
- if (budget > 1) tail.push("");
2961
+ if (budget > 1 && (!editorVisible || this.observedTranscript?.hasNewer)) tail.push("");
2909
2962
  return tail;
2910
2963
  }
2911
2964
  windowBody(body, budget, tail) {