@code-yeongyu/senpi 2026.9.23-2 → 2026.9.23-4

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 (275) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/bundle/chunks/{app-server-command-UO3ODP6D.js → app-server-command-QRBQLEXY.js} +1 -1
  3. package/dist/bundle/chunks/{chunk-UCTYTLP3.js → chunk-3RN6BFG2.js} +2 -2
  4. package/dist/bundle/chunks/{chunk-OLJ7LQJY.js → chunk-BBOQ5H4W.js} +1 -1
  5. package/dist/bundle/chunks/{chunk-XTXBPXZZ.js → chunk-EN6KDFY2.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-2NFHX2FJ.js → chunk-J3QXPP4T.js} +1 -1
  7. package/dist/bundle/chunks/chunk-KBG7BJIL.js +8 -0
  8. package/dist/bundle/chunks/{chunk-LMO3WYKH.js → chunk-N46LNXHU.js} +156 -167
  9. package/dist/bundle/chunks/{chunk-7EH64T6E.js → chunk-ORCF262V.js} +2 -2
  10. package/dist/bundle/chunks/{chunk-67Z5WNA4.js → chunk-PSMTQDII.js} +1 -1
  11. package/dist/bundle/chunks/{chunk-IDJUNOOR.js → chunk-WUYBEF7C.js} +2 -2
  12. package/dist/bundle/chunks/{chunk-IDSOMHWS.js → chunk-WXIRFRXY.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-BPHXJ4N2.js → chunk-XDSQYM4F.js} +1 -1
  14. package/dist/bundle/chunks/{chunk-IBHBWRC4.js → chunk-ZEFQYQOU.js} +3 -3
  15. package/dist/bundle/chunks/{cli-main-LUQZADLN.js → cli-main-ROBDBYAB.js} +1 -1
  16. package/dist/bundle/chunks/cursor-agent.js +1 -1
  17. package/dist/bundle/chunks/{help-fast-path-VXAZDQ3Z.js → help-fast-path-QXVCHTP3.js} +1 -1
  18. package/dist/bundle/chunks/{host-command-5PEFD4N6.js → host-command-3PUZYQOK.js} +1 -1
  19. package/dist/bundle/chunks/{host-lifecycle-BXW5C4JT.js → host-lifecycle-OHPSU5VU.js} +1 -1
  20. package/dist/bundle/chunks/{interactive-host-runtime-A6PM52FT.js → interactive-host-runtime-57LEAJPU.js} +1 -1
  21. package/dist/bundle/chunks/{interactive-mode-VR7QYMAE.js → interactive-mode-SLPAGRHH.js} +1 -1
  22. package/dist/bundle/chunks/{list-tips-VGOIMT6W.js → list-tips-Z62FXPOJ.js} +1 -1
  23. package/dist/bundle/chunks/{multi-session-host-LYOVVA75.js → multi-session-host-3PACMEHC.js} +1 -1
  24. package/dist/bundle/chunks/{package-manager-cli-OMEJACX6.js → package-manager-cli-6UIUSRQO.js} +1 -1
  25. package/dist/bundle/chunks/{pi-messages-B6RSUQKL.js → pi-messages-CAS467IY.js} +1 -1
  26. package/dist/bundle/chunks/{rotation-stream-ZIYWOB2N.js → rotation-stream-CZT4TRPD.js} +1 -1
  27. package/dist/bundle/chunks/{rpc-mode-AKGJA73P.js → rpc-mode-47EVLL6X.js} +1 -1
  28. package/dist/bundle/chunks/{session-picker-UE5LOM6W.js → session-picker-ZIBANFBQ.js} +1 -1
  29. package/dist/bundle/chunks/session-worker.js +235 -246
  30. package/dist/bundle/cli.js +1 -1
  31. package/dist/bundle/index.js +1 -1
  32. package/dist/bundle/rpc-entry.js +1 -1
  33. package/dist/core/extensions/builtin/anthropic-subscription/executable-model-support.d.ts +19 -0
  34. package/dist/core/extensions/builtin/anthropic-subscription/executable-model-support.d.ts.map +1 -0
  35. package/dist/core/extensions/builtin/anthropic-subscription/executable-model-support.js +76 -0
  36. package/dist/core/extensions/builtin/anthropic-subscription/executable-model-support.js.map +1 -0
  37. package/dist/core/extensions/builtin/anthropic-subscription/executable-path-lookup.d.ts +7 -2
  38. package/dist/core/extensions/builtin/anthropic-subscription/executable-path-lookup.d.ts.map +1 -1
  39. package/dist/core/extensions/builtin/anthropic-subscription/executable-path-lookup.js +28 -3
  40. package/dist/core/extensions/builtin/anthropic-subscription/executable-path-lookup.js.map +1 -1
  41. package/dist/core/extensions/builtin/anthropic-subscription/executable.d.ts +11 -0
  42. package/dist/core/extensions/builtin/anthropic-subscription/executable.d.ts.map +1 -1
  43. package/dist/core/extensions/builtin/anthropic-subscription/executable.js +31 -10
  44. package/dist/core/extensions/builtin/anthropic-subscription/executable.js.map +1 -1
  45. package/dist/core/extensions/builtin/anthropic-subscription/guidance.d.ts +2 -1
  46. package/dist/core/extensions/builtin/anthropic-subscription/guidance.d.ts.map +1 -1
  47. package/dist/core/extensions/builtin/anthropic-subscription/guidance.js +18 -2
  48. package/dist/core/extensions/builtin/anthropic-subscription/guidance.js.map +1 -1
  49. package/dist/core/extensions/builtin/anthropic-subscription/stream-guidance.d.ts +2 -1
  50. package/dist/core/extensions/builtin/anthropic-subscription/stream-guidance.d.ts.map +1 -1
  51. package/dist/core/extensions/builtin/anthropic-subscription/stream-guidance.js +2 -2
  52. package/dist/core/extensions/builtin/anthropic-subscription/stream-guidance.js.map +1 -1
  53. package/dist/core/extensions/builtin/anthropic-subscription/stream.d.ts.map +1 -1
  54. package/dist/core/extensions/builtin/anthropic-subscription/stream.js +5 -3
  55. package/dist/core/extensions/builtin/anthropic-subscription/stream.js.map +1 -1
  56. package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -1
  57. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +43 -26
  58. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -1
  59. package/dist/core/extensions/builtin/goal/cache-warm-renderer.d.ts +6 -0
  60. package/dist/core/extensions/builtin/goal/cache-warm-renderer.d.ts.map +1 -1
  61. package/dist/core/extensions/builtin/goal/cache-warm-renderer.js +8 -0
  62. package/dist/core/extensions/builtin/goal/cache-warm-renderer.js.map +1 -1
  63. package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
  64. package/dist/core/extensions/builtin/goal/index.js +4 -2
  65. package/dist/core/extensions/builtin/goal/index.js.map +1 -1
  66. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +3 -1
  67. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
  68. package/dist/core/extensions/builtin/goal/monitor-continuation.js +32 -10
  69. package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
  70. package/dist/core/extensions/builtin/goal/parked-wait.d.ts +16 -0
  71. package/dist/core/extensions/builtin/goal/parked-wait.d.ts.map +1 -0
  72. package/dist/core/extensions/builtin/goal/parked-wait.js +54 -0
  73. package/dist/core/extensions/builtin/goal/parked-wait.js.map +1 -0
  74. package/dist/core/extensions/builtin/mcp/auth/commands-auth-dispatch.d.ts +1 -1
  75. package/dist/core/extensions/builtin/mcp/auth/commands-auth-dispatch.d.ts.map +1 -1
  76. package/dist/core/extensions/builtin/mcp/auth/commands-auth-dispatch.js +8 -2
  77. package/dist/core/extensions/builtin/mcp/auth/commands-auth-dispatch.js.map +1 -1
  78. package/dist/core/extensions/builtin/mcp/auth/commands-auth.d.ts.map +1 -1
  79. package/dist/core/extensions/builtin/mcp/auth/commands-auth.js +15 -4
  80. package/dist/core/extensions/builtin/mcp/auth/commands-auth.js.map +1 -1
  81. package/dist/core/extensions/builtin/mcp/commands.d.ts.map +1 -1
  82. package/dist/core/extensions/builtin/mcp/commands.js +2 -0
  83. package/dist/core/extensions/builtin/mcp/commands.js.map +1 -1
  84. package/dist/core/extensions/builtin/nested-agents-md/index.js +1 -1
  85. package/dist/core/extensions/builtin/nested-agents-md/index.js.map +1 -1
  86. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +5 -5
  87. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
  88. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +16 -11
  89. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  90. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +5 -5
  91. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts.map +1 -1
  92. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +9 -6
  93. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -1
  94. package/dist/core/extensions/builtin/prompt-preset/test-decision.d.ts +2 -0
  95. package/dist/core/extensions/builtin/prompt-preset/test-decision.d.ts.map +1 -0
  96. package/dist/core/extensions/builtin/prompt-preset/test-decision.js +5 -0
  97. package/dist/core/extensions/builtin/prompt-preset/test-decision.js.map +1 -0
  98. package/dist/core/extensions/builtin/rule-activation/types.d.ts +2 -0
  99. package/dist/core/extensions/builtin/rule-activation/types.d.ts.map +1 -1
  100. package/dist/core/extensions/builtin/rule-activation/types.js +7 -1
  101. package/dist/core/extensions/builtin/rule-activation/types.js.map +1 -1
  102. package/dist/core/extensions/builtin/rules/index.d.ts.map +1 -1
  103. package/dist/core/extensions/builtin/rules/index.js +2 -1
  104. package/dist/core/extensions/builtin/rules/index.js.map +1 -1
  105. package/dist/core/extensions/builtin/webfetch/webfetch/tool.d.ts +3 -1
  106. package/dist/core/extensions/builtin/webfetch/webfetch/tool.d.ts.map +1 -1
  107. package/dist/core/extensions/builtin/webfetch/webfetch/tool.js +9 -3
  108. package/dist/core/extensions/builtin/webfetch/webfetch/tool.js.map +1 -1
  109. package/dist/core/extensions/index.d.ts +1 -1
  110. package/dist/core/extensions/index.d.ts.map +1 -1
  111. package/dist/core/extensions/index.js.map +1 -1
  112. package/dist/core/extensions/loader.d.ts.map +1 -1
  113. package/dist/core/extensions/loader.js +6 -1
  114. package/dist/core/extensions/loader.js.map +1 -1
  115. package/dist/core/extensions/runner.d.ts +3 -1
  116. package/dist/core/extensions/runner.d.ts.map +1 -1
  117. package/dist/core/extensions/runner.js +5 -0
  118. package/dist/core/extensions/runner.js.map +1 -1
  119. package/dist/core/extensions/types.d.ts +10 -1
  120. package/dist/core/extensions/types.d.ts.map +1 -1
  121. package/dist/core/extensions/types.js.map +1 -1
  122. package/dist/core/model-config.d.ts +1 -0
  123. package/dist/core/model-config.d.ts.map +1 -1
  124. package/dist/core/model-config.js +26 -20
  125. package/dist/core/model-config.js.map +1 -1
  126. package/dist/core/model-resolver.d.ts.map +1 -1
  127. package/dist/core/model-resolver.js +87 -14
  128. package/dist/core/model-resolver.js.map +1 -1
  129. package/dist/core/models-json-migration.d.ts +30 -0
  130. package/dist/core/models-json-migration.d.ts.map +1 -0
  131. package/dist/core/models-json-migration.js +257 -0
  132. package/dist/core/models-json-migration.js.map +1 -0
  133. package/dist/core/output-guard.d.ts +2 -0
  134. package/dist/core/output-guard.d.ts.map +1 -1
  135. package/dist/core/output-guard.js +31 -0
  136. package/dist/core/output-guard.js.map +1 -1
  137. package/dist/core/settings-manager.d.ts +4 -0
  138. package/dist/core/settings-manager.d.ts.map +1 -1
  139. package/dist/core/settings-manager.js +16 -6
  140. package/dist/core/settings-manager.js.map +1 -1
  141. package/dist/core/settings-overrides.d.ts +8 -0
  142. package/dist/core/settings-overrides.d.ts.map +1 -0
  143. package/dist/core/settings-overrides.js +28 -0
  144. package/dist/core/settings-overrides.js.map +1 -0
  145. package/dist/core/tools/bash.d.ts.map +1 -1
  146. package/dist/core/tools/bash.js +12 -7
  147. package/dist/core/tools/bash.js.map +1 -1
  148. package/dist/core/tools/find.d.ts.map +1 -1
  149. package/dist/core/tools/find.js +9 -6
  150. package/dist/core/tools/find.js.map +1 -1
  151. package/dist/core/tools/grep/format.d.ts +3 -2
  152. package/dist/core/tools/grep/format.d.ts.map +1 -1
  153. package/dist/core/tools/grep/format.js +5 -3
  154. package/dist/core/tools/grep/format.js.map +1 -1
  155. package/dist/core/tools/grep/index.js +2 -2
  156. package/dist/core/tools/grep/index.js.map +1 -1
  157. package/dist/core/tools/ls.d.ts.map +1 -1
  158. package/dist/core/tools/ls.js +5 -3
  159. package/dist/core/tools/ls.js.map +1 -1
  160. package/dist/core/tools/model-only-text.d.ts +4 -0
  161. package/dist/core/tools/model-only-text.d.ts.map +1 -0
  162. package/dist/core/tools/model-only-text.js +12 -0
  163. package/dist/core/tools/model-only-text.js.map +1 -0
  164. package/dist/core/tools/read.d.ts.map +1 -1
  165. package/dist/core/tools/read.js +15 -5
  166. package/dist/core/tools/read.js.map +1 -1
  167. package/dist/core/tools/render-utils.d.ts.map +1 -1
  168. package/dist/core/tools/render-utils.js +2 -1
  169. package/dist/core/tools/render-utils.js.map +1 -1
  170. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  171. package/dist/core/tools/renderers/bash.js +1 -25
  172. package/dist/core/tools/renderers/bash.js.map +1 -1
  173. package/dist/core/tools/renderers/grep.d.ts.map +1 -1
  174. package/dist/core/tools/renderers/grep.js +0 -25
  175. package/dist/core/tools/renderers/grep.js.map +1 -1
  176. package/dist/core/tools/renderers/read.d.ts +8 -0
  177. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  178. package/dist/core/tools/renderers/read.js +2 -14
  179. package/dist/core/tools/renderers/read.js.map +1 -1
  180. package/dist/index.d.ts +1 -1
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.js.map +1 -1
  183. package/dist/modes/interactive/components/assistant-message.d.ts +2 -0
  184. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  185. package/dist/modes/interactive/components/assistant-message.js +4 -0
  186. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  187. package/dist/modes/interactive/components/custom-entry.d.ts +10 -1
  188. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  189. package/dist/modes/interactive/components/custom-entry.js +22 -0
  190. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  191. package/dist/modes/interactive/components/exploration-call.d.ts +15 -0
  192. package/dist/modes/interactive/components/exploration-call.d.ts.map +1 -0
  193. package/dist/modes/interactive/components/exploration-call.js +56 -0
  194. package/dist/modes/interactive/components/exploration-call.js.map +1 -0
  195. package/dist/modes/interactive/components/exploration-group.d.ts +21 -0
  196. package/dist/modes/interactive/components/exploration-group.d.ts.map +1 -0
  197. package/dist/modes/interactive/components/exploration-group.js +95 -0
  198. package/dist/modes/interactive/components/exploration-group.js.map +1 -0
  199. package/dist/modes/interactive/components/exploration-rules.d.ts +5 -0
  200. package/dist/modes/interactive/components/exploration-rules.d.ts.map +1 -0
  201. package/dist/modes/interactive/components/exploration-rules.js +15 -0
  202. package/dist/modes/interactive/components/exploration-rules.js.map +1 -0
  203. package/dist/modes/interactive/components/exploration-transcript-container.d.ts +18 -0
  204. package/dist/modes/interactive/components/exploration-transcript-container.d.ts.map +1 -0
  205. package/dist/modes/interactive/components/exploration-transcript-container.js +76 -0
  206. package/dist/modes/interactive/components/exploration-transcript-container.js.map +1 -0
  207. package/dist/modes/interactive/components/tool-execution.d.ts +7 -1
  208. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  209. package/dist/modes/interactive/components/tool-execution.js +8 -1
  210. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  211. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  212. package/dist/modes/interactive/interactive-mode.js +24 -35
  213. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  214. package/dist/modes/interactive/replay-assistant-tools.d.ts +14 -0
  215. package/dist/modes/interactive/replay-assistant-tools.d.ts.map +1 -0
  216. package/dist/modes/interactive/replay-assistant-tools.js +33 -0
  217. package/dist/modes/interactive/replay-assistant-tools.js.map +1 -0
  218. package/dist/modes/interactive/tool-progress.d.ts +2 -0
  219. package/dist/modes/interactive/tool-progress.d.ts.map +1 -1
  220. package/dist/modes/interactive/tool-progress.js +5 -2
  221. package/dist/modes/interactive/tool-progress.js.map +1 -1
  222. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
  223. package/dist/modes/interactive/tui-renderer.js +6 -1
  224. package/dist/modes/interactive/tui-renderer.js.map +1 -1
  225. package/docs/extensions.md +8 -0
  226. package/docs/mcp.md +9 -6
  227. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +30 -0
  228. package/node_modules/@code-yeongyu/senpi-codemode/README.md +10 -8
  229. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  230. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/display-code.ts +145 -0
  231. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-request.ts +7 -12
  232. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +2 -2
  233. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +38 -35
  234. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +1 -4
  235. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  236. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts.map +1 -1
  237. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +17 -1
  238. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
  239. package/node_modules/@earendil-works/pi-ai/dist/cursor/catalog-grouping.d.ts +18 -1
  240. package/node_modules/@earendil-works/pi-ai/dist/cursor/catalog-grouping.d.ts.map +1 -1
  241. package/node_modules/@earendil-works/pi-ai/dist/cursor/catalog-grouping.js +103 -3
  242. package/node_modules/@earendil-works/pi-ai/dist/cursor/catalog-grouping.js.map +1 -1
  243. package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.d.ts +3 -1
  244. package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.d.ts.map +1 -1
  245. package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.js +15 -3
  246. package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.js.map +1 -1
  247. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts +7 -2
  248. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts.map +1 -1
  249. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js +92 -20
  250. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js.map +1 -1
  251. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +9 -1
  252. package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
  253. package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
  254. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
  255. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +1 -0
  256. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
  257. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  258. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  259. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +5 -0
  260. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  261. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  262. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  263. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  264. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  265. package/node_modules/@earendil-works/pi-tui/dist/stderr-observer.d.ts +3 -0
  266. package/node_modules/@earendil-works/pi-tui/dist/stderr-observer.d.ts.map +1 -0
  267. package/node_modules/@earendil-works/pi-tui/dist/stderr-observer.js +14 -0
  268. package/node_modules/@earendil-works/pi-tui/dist/stderr-observer.js.map +1 -0
  269. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +4 -1
  270. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  271. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +8 -12
  272. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  273. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  274. package/package.json +7 -7
  275. package/dist/bundle/chunks/chunk-WJ2BGYFK.js +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"assistant-message.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/assistant-message.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,SAAS,EAAE,QAAQ,EAAsB,MAAM,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE/G,OAAO,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AM,MAAM,GAAG,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC;YACxF,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC;YACxD,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC1B,CAAC,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;IAEO,sBAAsB,CAAC,OAAyB;QACvD,OAAO,4BAA4B,CAAC;YACnC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,2BAA2B,EAAE,CAAC,GAAG,IAAI,CAAC,2BAA2B,CAAC;YAClE,UAAU,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC;YACvD,UAAU,EAAE,OAAO,CAAC,UAAU;SAC9B,CAAC,CAAC;IACJ,CAAC;IAEO,WAAW,CAAC,KAAa,EAAE,SAAiB,EAAE,KAAe;QACpE,IAAI,CAAC,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC5D,CAAC;IAEO,cAAc;QACrB,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,OAAO;QAC9B,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;CACD","sourcesContent":["import type { AssistantMessage } from \"@earendil-works/pi-ai\";\nimport { type Component, Container, Markdown, type MarkdownTheme, Spacer, Text } from \"@earendil-works/pi-tui\";\nimport type { MarkdownTransformer } from \"../../../core/extensions/types.ts\";\nimport { getMarkdownTheme, theme } from \"../theme/theme.ts\";\nimport { type AssistantRenderDescriptor, createAssistantRenderDescriptors } from \"./assistant-render-descriptors.ts\";\nimport { createMarkdownTransform } from \"./markdown-transform.ts\";\nimport { createBoundedRenderSignature } from \"./render-signature.ts\";\n\nconst OSC133_ZONE_START = \"\\x1b]133;A\\x07\";\nconst OSC133_ZONE_END = \"\\x1b]133;B\\x07\";\nconst OSC133_ZONE_FINAL = \"\\x1b]133;C\\x07\";\n\nfunction assertNever(value: never): never {\n\tthrow new TypeError(`Unexpected assistant render variant: ${String(value)}`);\n}\n\nexport class AssistantMessageComponent extends Container {\n\tprivate renderCache?: { readonly lines: string[]; readonly signature: string; readonly width: number };\n\tprivate contentContainer: Container;\n\tprivate hideThinkingBlock: boolean;\n\tprivate markdownTheme: MarkdownTheme;\n\tprivate hiddenThinkingLabel: string;\n\tprivate outputPad: number;\n\tprivate markdownTransformers: readonly MarkdownTransformer[];\n\tprivate lastMessage?: AssistantMessage;\n\tprivate lastMessageSignature?: string;\n\tprivate renderDescriptors: readonly AssistantRenderDescriptor[] = [];\n\tprivate hasToolCalls = false;\n\tprivate expanded = false;\n\tprivate providerErrorOwned = false;\n\tprivate isStreaming = false;\n\tprivate thinkingVisibilityOverrides = new Map<number, boolean>();\n\n\tconstructor(\n\t\tmessage?: AssistantMessage,\n\t\thideThinkingBlock = false,\n\t\tmarkdownTheme: MarkdownTheme = getMarkdownTheme(),\n\t\thiddenThinkingLabel = \"Thinking...\",\n\t\toutputPad = 1,\n\t\tmarkdownTransformers: readonly MarkdownTransformer[] = [],\n\t) {\n\t\tsuper();\n\n\t\tthis.hideThinkingBlock = hideThinkingBlock;\n\t\tthis.markdownTheme = markdownTheme;\n\t\tthis.hiddenThinkingLabel = hiddenThinkingLabel;\n\t\tthis.outputPad = outputPad;\n\t\tthis.markdownTransformers = markdownTransformers;\n\n\t\t// Container for text/thinking content\n\t\tthis.contentContainer = new Container();\n\t\tthis.addChild(this.contentContainer);\n\n\t\tif (message) this.updateContent(message);\n\t}\n\n\toverride invalidate(): void {\n\t\tthis.renderCache = undefined;\n\t\tsuper.invalidate();\n\t\tthis.renderDescriptors = [];\n\t\tthis.refreshContent();\n\t}\n\n\tsetHideThinkingBlock(hide: boolean): void {\n\t\tif (this.hideThinkingBlock === hide) return;\n\t\tthis.hideThinkingBlock = hide;\n\t\tthis.thinkingVisibilityOverrides.clear();\n\t\tthis.refreshContent();\n\t}\n\n\tsetHiddenThinkingLabel(label: string): void {\n\t\tif (this.hiddenThinkingLabel === label) return;\n\t\tthis.hiddenThinkingLabel = label;\n\t\tthis.refreshContent();\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tif (this.expanded === expanded) return;\n\t\tthis.expanded = expanded;\n\t\tthis.refreshContent();\n\t}\n\n\tsetProviderErrorOwned(owned: boolean): void {\n\t\tif (this.providerErrorOwned === owned) return;\n\t\tthis.providerErrorOwned = owned;\n\t\tthis.refreshContent();\n\t}\n\n\tsetOutputPad(padding: number): void {\n\t\tthis.outputPad = padding;\n\t\tthis.renderDescriptors = [];\n\t\tthis.refreshContent();\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst signature = this.lastMessageSignature ?? \"\";\n\t\tif (this.renderCache?.width === width && this.renderCache.signature === signature) {\n\t\t\treturn [...this.renderCache.lines];\n\t\t}\n\n\t\tconst lines = super.render(width);\n\t\tif (this.hasToolCalls || lines.length === 0) {\n\t\t\tthis.cacheRender(width, signature, lines);\n\t\t\treturn lines;\n\t\t}\n\n\t\tlines[0] = OSC133_ZONE_START + lines[0];\n\t\tlines[lines.length - 1] = OSC133_ZONE_END + OSC133_ZONE_FINAL + lines[lines.length - 1];\n\t\tthis.cacheRender(width, signature, lines);\n\t\treturn lines;\n\t}\n\n\tupdateContent(message: AssistantMessage, isStreaming = this.isStreaming): void {\n\t\tconst previousMessage = this.lastMessage;\n\t\tconst streamingChanged = this.isStreaming !== isStreaming;\n\t\tthis.isStreaming = isStreaming;\n\t\tthis.lastMessage = message;\n\t\tconst messageSignature = this.createMessageSignature(message);\n\t\tif (!streamingChanged && previousMessage === message && this.lastMessageSignature === messageSignature) {\n\t\t\treturn;\n\t\t}\n\t\tthis.lastMessageSignature = messageSignature;\n\t\tthis.renderCache = undefined;\n\t\tif (streamingChanged) this.renderDescriptors = [];\n\t\tthis.hasToolCalls = message.content.some((content) => content.type === \"toolCall\");\n\t\tconst descriptors = createAssistantRenderDescriptors(message, {\n\t\t\texpanded: this.expanded,\n\t\t\tproviderErrorOwned: this.providerErrorOwned,\n\t\t\thiddenThinkingLabel: this.hiddenThinkingLabel,\n\t\t\thideThinkingBlock: this.hideThinkingBlock,\n\t\t\tthinkingVisibilityOverrides: this.thinkingVisibilityOverrides,\n\t\t\thasToolCalls: this.hasToolCalls,\n\t\t});\n\t\tthis.reconcileRenderDescriptors(descriptors);\n\t}\n\n\tprivate reconcileRenderDescriptors(descriptors: readonly AssistantRenderDescriptor[]): void {\n\t\tlet divergentIndex = 0;\n\t\tconst sharedLength = Math.min(this.renderDescriptors.length, descriptors.length);\n\t\twhile (divergentIndex < sharedLength) {\n\t\t\tconst previous = this.renderDescriptors[divergentIndex];\n\t\t\tconst next = descriptors[divergentIndex];\n\t\t\tconst child = this.contentContainer.children[divergentIndex];\n\t\t\tif (!previous || !next || !child || previous.kind !== next.kind) break;\n\t\t\tif (previous.text !== next.text) {\n\t\t\t\tif ((next.kind === \"text-md\" || next.kind === \"thinking-md\") && child instanceof Markdown) {\n\t\t\t\t\tchild.setText(next.text);\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tdivergentIndex++;\n\t\t}\n\t\tfor (const child of this.contentContainer.children.splice(divergentIndex)) child.dispose?.();\n\t\tfor (const descriptor of descriptors.slice(divergentIndex))\n\t\t\tthis.contentContainer.addChild(this.createRenderChild(descriptor));\n\t\tthis.renderDescriptors = descriptors;\n\t}\n\n\tprivate createRenderChild(descriptor: AssistantRenderDescriptor): Component {\n\t\tswitch (descriptor.kind) {\n\t\t\tcase \"spacer\":\n\t\t\t\treturn new Spacer(1);\n\t\t\tcase \"text-md\":\n\t\t\t\treturn new Markdown(descriptor.text, this.outputPad, 0, this.markdownTheme, undefined, {\n\t\t\t\t\ttransform: createMarkdownTransform(\"assistant\", this.isStreaming, this.markdownTransformers),\n\t\t\t\t});\n\t\t\tcase \"thinking-md\":\n\t\t\t\treturn this.withThinkingToggle(\n\t\t\t\t\tnew Markdown(\n\t\t\t\t\t\tdescriptor.text,\n\t\t\t\t\t\tthis.outputPad,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tthis.markdownTheme,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolor: (text: string) => theme.fg(\"thinkingText\", text),\n\t\t\t\t\t\t\titalic: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttransform: createMarkdownTransform(\n\t\t\t\t\t\t\t\t\"assistant-thinking\",\n\t\t\t\t\t\t\t\tthis.isStreaming,\n\t\t\t\t\t\t\t\tthis.markdownTransformers,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\tdescriptor,\n\t\t\t\t);\n\t\t\tcase \"thinking-label\":\n\t\t\t\treturn this.withThinkingToggle(new Text(descriptor.text, this.outputPad, 0), descriptor);\n\t\t\tcase \"error-text\":\n\t\t\t\treturn new Text(descriptor.text, this.outputPad, 0);\n\t\t\tcase \"provider-native-summary\":\n\t\t\t\treturn new Text(descriptor.text, 1, 0);\n\t\t\tcase \"provider-native-body\":\n\t\t\t\treturn new Text(descriptor.text, 3, 0);\n\t\t\tdefault:\n\t\t\t\treturn assertNever(descriptor.kind);\n\t\t}\n\t}\n\n\t/**\n\t * Left-clicking a thinking run toggles that run between its label and its body (upstream\n\t * 71026970a). The mouse handler is attached to the Markdown/Text child itself so the\n\t * incremental reconciler still sees the same child types it updates in place.\n\t */\n\tprivate withThinkingToggle(component: Component, descriptor: AssistantRenderDescriptor): Component {\n\t\tconst runIndex = descriptor.thinkingRun;\n\t\tif (runIndex === undefined) return component;\n\t\tcomponent.handleMouse = (event) => {\n\t\t\tif (event.type !== \"click\" || event.button !== \"left\") return undefined;\n\t\t\tconst hidden = this.thinkingVisibilityOverrides.get(runIndex) ?? this.hideThinkingBlock;\n\t\t\tthis.thinkingVisibilityOverrides.set(runIndex, !hidden);\n\t\t\tthis.refreshContent();\n\t\t\treturn { handled: true };\n\t\t};\n\t\treturn component;\n\t}\n\n\tprivate createMessageSignature(message: AssistantMessage): string {\n\t\treturn createBoundedRenderSignature({\n\t\t\tcontent: message.content,\n\t\t\thiddenThinkingLabel: this.hiddenThinkingLabel,\n\t\t\thideThinkingBlock: this.hideThinkingBlock,\n\t\t\tthinkingVisibilityOverrides: [...this.thinkingVisibilityOverrides],\n\t\t\terrorState: [message.diagnostics, message.errorMessage],\n\t\t\tstopReason: message.stopReason,\n\t\t});\n\t}\n\n\tprivate cacheRender(width: number, signature: string, lines: string[]): void {\n\t\tthis.renderCache = { lines: [...lines], signature, width };\n\t}\n\n\tprivate refreshContent(): void {\n\t\tif (!this.lastMessage) return;\n\t\tthis.lastMessageSignature = undefined;\n\t\tthis.updateContent(this.lastMessage);\n\t}\n}\n"]}
1
+ {"version":3,"file":"assistant-message.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/assistant-message.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,SAAS,EAAE,QAAQ,EAAsB,MAAM,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE/G,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAkC,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACrH,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAC3C,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE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,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC;YACxD,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC1B,CAAC,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;IAEO,sBAAsB,CAAC,OAAyB;QACvD,OAAO,4BAA4B,CAAC;YACnC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,2BAA2B,EAAE,CAAC,GAAG,IAAI,CAAC,2BAA2B,CAAC;YAClE,UAAU,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC;YACvD,UAAU,EAAE,OAAO,CAAC,UAAU;SAC9B,CAAC,CAAC;IACJ,CAAC;IAEO,WAAW,CAAC,KAAa,EAAE,SAAiB,EAAE,KAAe;QACpE,IAAI,CAAC,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC5D,CAAC;IAEO,cAAc;QACrB,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,OAAO;QAC9B,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;CACD","sourcesContent":["import type { AssistantMessage } from \"@earendil-works/pi-ai\";\nimport { type Component, Container, Markdown, type MarkdownTheme, Spacer, Text } from \"@earendil-works/pi-tui\";\nimport type { MarkdownTransformer } from \"../../../core/extensions/types.ts\";\nimport { getMarkdownTheme, theme } from \"../theme/theme.ts\";\nimport { type AssistantRenderDescriptor, createAssistantRenderDescriptors } from \"./assistant-render-descriptors.ts\";\nimport { createMarkdownTransform } from \"./markdown-transform.ts\";\nimport { createBoundedRenderSignature } from \"./render-signature.ts\";\n\nconst OSC133_ZONE_START = \"\\x1b]133;A\\x07\";\nconst OSC133_ZONE_END = \"\\x1b]133;B\\x07\";\nconst OSC133_ZONE_FINAL = \"\\x1b]133;C\\x07\";\n\nfunction assertNever(value: never): never {\n\tthrow new TypeError(`Unexpected assistant render variant: ${String(value)}`);\n}\n\nexport class AssistantMessageComponent extends Container {\n\tprivate renderCache?: { readonly lines: string[]; readonly signature: string; readonly width: number };\n\tprivate contentContainer: Container;\n\tprivate hideThinkingBlock: boolean;\n\tprivate markdownTheme: MarkdownTheme;\n\tprivate hiddenThinkingLabel: string;\n\tprivate outputPad: number;\n\tprivate markdownTransformers: readonly MarkdownTransformer[];\n\tprivate lastMessage?: AssistantMessage;\n\tprivate lastMessageSignature?: string;\n\tprivate renderDescriptors: readonly AssistantRenderDescriptor[] = [];\n\tprivate hasToolCalls = false;\n\tprivate expanded = false;\n\tprivate providerErrorOwned = false;\n\tprivate isStreaming = false;\n\tprivate thinkingVisibilityOverrides = new Map<number, boolean>();\n\n\tconstructor(\n\t\tmessage?: AssistantMessage,\n\t\thideThinkingBlock = false,\n\t\tmarkdownTheme: MarkdownTheme = getMarkdownTheme(),\n\t\thiddenThinkingLabel = \"Thinking...\",\n\t\toutputPad = 1,\n\t\tmarkdownTransformers: readonly MarkdownTransformer[] = [],\n\t) {\n\t\tsuper();\n\n\t\tthis.hideThinkingBlock = hideThinkingBlock;\n\t\tthis.markdownTheme = markdownTheme;\n\t\tthis.hiddenThinkingLabel = hiddenThinkingLabel;\n\t\tthis.outputPad = outputPad;\n\t\tthis.markdownTransformers = markdownTransformers;\n\n\t\t// Container for text/thinking content\n\t\tthis.contentContainer = new Container();\n\t\tthis.addChild(this.contentContainer);\n\n\t\tif (message) this.updateContent(message);\n\t}\n\n\toverride invalidate(): void {\n\t\tthis.renderCache = undefined;\n\t\tsuper.invalidate();\n\t\tthis.renderDescriptors = [];\n\t\tthis.refreshContent();\n\t}\n\n\tsetHideThinkingBlock(hide: boolean): void {\n\t\tif (this.hideThinkingBlock === hide) return;\n\t\tthis.hideThinkingBlock = hide;\n\t\tthis.thinkingVisibilityOverrides.clear();\n\t\tthis.refreshContent();\n\t}\n\n\tsetHiddenThinkingLabel(label: string): void {\n\t\tif (this.hiddenThinkingLabel === label) return;\n\t\tthis.hiddenThinkingLabel = label;\n\t\tthis.refreshContent();\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tif (this.expanded === expanded) return;\n\t\tthis.expanded = expanded;\n\t\tthis.refreshContent();\n\t}\n\n\tsetProviderErrorOwned(owned: boolean): void {\n\t\tif (this.providerErrorOwned === owned) return;\n\t\tthis.providerErrorOwned = owned;\n\t\tthis.refreshContent();\n\t}\n\n\t/** Transcript-only reasoning/empty streaming heads may sit inside a compact exploration group. */\n\tget isExplorationDetail(): boolean {\n\t\treturn this.renderDescriptors.every((part) => part.kind === \"spacer\" || part.kind === \"thinking-label\");\n\t}\n\n\tsetOutputPad(padding: number): void {\n\t\tthis.outputPad = padding;\n\t\tthis.renderDescriptors = [];\n\t\tthis.refreshContent();\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst signature = this.lastMessageSignature ?? \"\";\n\t\tif (this.renderCache?.width === width && this.renderCache.signature === signature) {\n\t\t\treturn [...this.renderCache.lines];\n\t\t}\n\n\t\tconst lines = super.render(width);\n\t\tif (this.hasToolCalls || lines.length === 0) {\n\t\t\tthis.cacheRender(width, signature, lines);\n\t\t\treturn lines;\n\t\t}\n\n\t\tlines[0] = OSC133_ZONE_START + lines[0];\n\t\tlines[lines.length - 1] = OSC133_ZONE_END + OSC133_ZONE_FINAL + lines[lines.length - 1];\n\t\tthis.cacheRender(width, signature, lines);\n\t\treturn lines;\n\t}\n\n\tupdateContent(message: AssistantMessage, isStreaming = this.isStreaming): void {\n\t\tconst previousMessage = this.lastMessage;\n\t\tconst streamingChanged = this.isStreaming !== isStreaming;\n\t\tthis.isStreaming = isStreaming;\n\t\tthis.lastMessage = message;\n\t\tconst messageSignature = this.createMessageSignature(message);\n\t\tif (!streamingChanged && previousMessage === message && this.lastMessageSignature === messageSignature) {\n\t\t\treturn;\n\t\t}\n\t\tthis.lastMessageSignature = messageSignature;\n\t\tthis.renderCache = undefined;\n\t\tif (streamingChanged) this.renderDescriptors = [];\n\t\tthis.hasToolCalls = message.content.some((content) => content.type === \"toolCall\");\n\t\tconst descriptors = createAssistantRenderDescriptors(message, {\n\t\t\texpanded: this.expanded,\n\t\t\tproviderErrorOwned: this.providerErrorOwned,\n\t\t\thiddenThinkingLabel: this.hiddenThinkingLabel,\n\t\t\thideThinkingBlock: this.hideThinkingBlock,\n\t\t\tthinkingVisibilityOverrides: this.thinkingVisibilityOverrides,\n\t\t\thasToolCalls: this.hasToolCalls,\n\t\t});\n\t\tthis.reconcileRenderDescriptors(descriptors);\n\t}\n\n\tprivate reconcileRenderDescriptors(descriptors: readonly AssistantRenderDescriptor[]): void {\n\t\tlet divergentIndex = 0;\n\t\tconst sharedLength = Math.min(this.renderDescriptors.length, descriptors.length);\n\t\twhile (divergentIndex < sharedLength) {\n\t\t\tconst previous = this.renderDescriptors[divergentIndex];\n\t\t\tconst next = descriptors[divergentIndex];\n\t\t\tconst child = this.contentContainer.children[divergentIndex];\n\t\t\tif (!previous || !next || !child || previous.kind !== next.kind) break;\n\t\t\tif (previous.text !== next.text) {\n\t\t\t\tif ((next.kind === \"text-md\" || next.kind === \"thinking-md\") && child instanceof Markdown) {\n\t\t\t\t\tchild.setText(next.text);\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tdivergentIndex++;\n\t\t}\n\t\tfor (const child of this.contentContainer.children.splice(divergentIndex)) child.dispose?.();\n\t\tfor (const descriptor of descriptors.slice(divergentIndex))\n\t\t\tthis.contentContainer.addChild(this.createRenderChild(descriptor));\n\t\tthis.renderDescriptors = descriptors;\n\t}\n\n\tprivate createRenderChild(descriptor: AssistantRenderDescriptor): Component {\n\t\tswitch (descriptor.kind) {\n\t\t\tcase \"spacer\":\n\t\t\t\treturn new Spacer(1);\n\t\t\tcase \"text-md\":\n\t\t\t\treturn new Markdown(descriptor.text, this.outputPad, 0, this.markdownTheme, undefined, {\n\t\t\t\t\ttransform: createMarkdownTransform(\"assistant\", this.isStreaming, this.markdownTransformers),\n\t\t\t\t});\n\t\t\tcase \"thinking-md\":\n\t\t\t\treturn this.withThinkingToggle(\n\t\t\t\t\tnew Markdown(\n\t\t\t\t\t\tdescriptor.text,\n\t\t\t\t\t\tthis.outputPad,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tthis.markdownTheme,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolor: (text: string) => theme.fg(\"thinkingText\", text),\n\t\t\t\t\t\t\titalic: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttransform: createMarkdownTransform(\n\t\t\t\t\t\t\t\t\"assistant-thinking\",\n\t\t\t\t\t\t\t\tthis.isStreaming,\n\t\t\t\t\t\t\t\tthis.markdownTransformers,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\tdescriptor,\n\t\t\t\t);\n\t\t\tcase \"thinking-label\":\n\t\t\t\treturn this.withThinkingToggle(new Text(descriptor.text, this.outputPad, 0), descriptor);\n\t\t\tcase \"error-text\":\n\t\t\t\treturn new Text(descriptor.text, this.outputPad, 0);\n\t\t\tcase \"provider-native-summary\":\n\t\t\t\treturn new Text(descriptor.text, 1, 0);\n\t\t\tcase \"provider-native-body\":\n\t\t\t\treturn new Text(descriptor.text, 3, 0);\n\t\t\tdefault:\n\t\t\t\treturn assertNever(descriptor.kind);\n\t\t}\n\t}\n\n\t/**\n\t * Left-clicking a thinking run toggles that run between its label and its body (upstream\n\t * 71026970a). The mouse handler is attached to the Markdown/Text child itself so the\n\t * incremental reconciler still sees the same child types it updates in place.\n\t */\n\tprivate withThinkingToggle(component: Component, descriptor: AssistantRenderDescriptor): Component {\n\t\tconst runIndex = descriptor.thinkingRun;\n\t\tif (runIndex === undefined) return component;\n\t\tcomponent.handleMouse = (event) => {\n\t\t\tif (event.type !== \"click\" || event.button !== \"left\") return undefined;\n\t\t\tconst hidden = this.thinkingVisibilityOverrides.get(runIndex) ?? this.hideThinkingBlock;\n\t\t\tthis.thinkingVisibilityOverrides.set(runIndex, !hidden);\n\t\t\tthis.refreshContent();\n\t\t\treturn { handled: true };\n\t\t};\n\t\treturn component;\n\t}\n\n\tprivate createMessageSignature(message: AssistantMessage): string {\n\t\treturn createBoundedRenderSignature({\n\t\t\tcontent: message.content,\n\t\t\thiddenThinkingLabel: this.hiddenThinkingLabel,\n\t\t\thideThinkingBlock: this.hideThinkingBlock,\n\t\t\tthinkingVisibilityOverrides: [...this.thinkingVisibilityOverrides],\n\t\t\terrorState: [message.diagnostics, message.errorMessage],\n\t\t\tstopReason: message.stopReason,\n\t\t});\n\t}\n\n\tprivate cacheRender(width: number, signature: string, lines: string[]): void {\n\t\tthis.renderCache = { lines: [...lines], signature, width };\n\t}\n\n\tprivate refreshContent(): void {\n\t\tif (!this.lastMessage) return;\n\t\tthis.lastMessageSignature = undefined;\n\t\tthis.updateContent(this.lastMessage);\n\t}\n}\n"]}
@@ -1,5 +1,6 @@
1
+ import type { Component } from "@earendil-works/pi-tui";
1
2
  import { Container } from "@earendil-works/pi-tui";
2
- import type { EntryRenderer } from "../../../core/extensions/types.ts";
3
+ import type { EntryRenderer, EntryRendererOptions } from "../../../core/extensions/types.ts";
3
4
  import type { CustomEntry } from "../../../core/session-manager.ts";
4
5
  /**
5
6
  * Component that renders a custom session entry from extensions.
@@ -11,9 +12,17 @@ export declare class CustomEntryComponent extends Container {
11
12
  private customComponent?;
12
13
  private _expanded;
13
14
  constructor(entry: CustomEntry<unknown>, renderer: EntryRenderer);
15
+ get customEntry(): CustomEntry<unknown>;
14
16
  hasContent(): boolean;
15
17
  setExpanded(expanded: boolean): void;
16
18
  invalidate(): void;
17
19
  private rebuild;
18
20
  }
21
+ /**
22
+ * Index of the card `entry` replaces in place: the transcript card directly before
23
+ * `insertIndex` (skipping only `isTransient` children such as a status line), when it
24
+ * renders an entry of the same custom type and the renderer's `replaces` option accepts
25
+ * the pair. Returns -1 when `entry` becomes a new card.
26
+ */
27
+ export declare function replacedEntryCardIndex(children: readonly Component[], insertIndex: number, entry: CustomEntry<unknown>, options: EntryRendererOptions | undefined, isTransient?: (child: Component) => boolean): number;
19
28
  //# sourceMappingURL=custom-entry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-entry.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/custom-entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,SAAS,EAAgB,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAGpE;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,eAAe,CAAC,CAAY;IACpC,OAAO,CAAC,SAAS,CAAS;IAE1B,YAAY,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,aAAa,EAK/D;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAKnC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,OAAO,CAAC,OAAO;CAsBf"}
1
+ {"version":3,"file":"custom-entry.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/custom-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAO,SAAS,EAAgB,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAGpE;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,eAAe,CAAC,CAAY;IACpC,OAAO,CAAC,SAAS,CAAS;IAE1B,YAAY,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,aAAa,EAK/D;IAED,IAAI,WAAW,IAAI,WAAW,CAAC,OAAO,CAAC,CAEtC;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAKnC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,OAAO,CAAC,OAAO;CAsBf;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,SAAS,SAAS,EAAE,EAC9B,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,EAC3B,OAAO,EAAE,oBAAoB,GAAG,SAAS,EACzC,WAAW,GAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAqB,GACtD,MAAM,CAQR"}
@@ -12,6 +12,9 @@ export class CustomEntryComponent extends Container {
12
12
  this.renderer = renderer;
13
13
  this.rebuild();
14
14
  }
15
+ get customEntry() {
16
+ return this.entry;
17
+ }
15
18
  hasContent() {
16
19
  return this.customComponent !== undefined;
17
20
  }
@@ -46,4 +49,23 @@ export class CustomEntryComponent extends Container {
46
49
  this.addChild(component);
47
50
  }
48
51
  }
52
+ /**
53
+ * Index of the card `entry` replaces in place: the transcript card directly before
54
+ * `insertIndex` (skipping only `isTransient` children such as a status line), when it
55
+ * renders an entry of the same custom type and the renderer's `replaces` option accepts
56
+ * the pair. Returns -1 when `entry` becomes a new card.
57
+ */
58
+ export function replacedEntryCardIndex(children, insertIndex, entry, options, isTransient = () => false) {
59
+ if (options?.replaces === undefined)
60
+ return -1;
61
+ let previousIndex = insertIndex - 1;
62
+ while (previousIndex >= 0 && isTransient(children[previousIndex]))
63
+ previousIndex--;
64
+ const previous = children[previousIndex];
65
+ if (!(previous instanceof CustomEntryComponent))
66
+ return -1;
67
+ if (previous.customEntry.customType !== entry.customType)
68
+ return -1;
69
+ return options.replaces(previous.customEntry, entry) ? previousIndex : -1;
70
+ }
49
71
  //# sourceMappingURL=custom-entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-entry.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/custom-entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAMlD,YAAY,KAA2B,EAAE,QAAuB;QAC/D,KAAK,EAAE,CAAC;QAHD,cAAS,GAAG,KAAK,CAAC;QAIzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IAED,UAAU;QACT,OAAO,IAAI,CAAC,eAAe,KAAK,SAAS,CAAC;IAC3C,CAAC;IAED,WAAW,CAAC,QAAiB;QAC5B,IAAI,IAAI,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1B,IAAI,CAAC,OAAO,EAAE,CAAC;QAChB,CAAC;IACF,CAAC;IAEQ,UAAU;QAClB,KAAK,CAAC,UAAU,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IAEO,OAAO;QACd,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QAEjC,IAAI,SAAgC,CAAC;QACrC,IAAI,CAAC;YACJ,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC,CAAC;QAC5E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC;YACvE,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,sBAAsB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1G,SAAS,GAAG,GAAG,CAAC;QACjB,CAAC;QAED,IAAI,CAAC,SAAS,EAAE,CAAC;YAChB,OAAO;QACR,CAAC;QAED,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;CACD","sourcesContent":["import type { Component } from \"@earendil-works/pi-tui\";\nimport { Box, Container, Spacer, Text } from \"@earendil-works/pi-tui\";\nimport type { EntryRenderer } from \"../../../core/extensions/types.ts\";\nimport type { CustomEntry } from \"../../../core/session-manager.ts\";\nimport { theme } from \"../theme/theme.ts\";\n\n/**\n * Component that renders a custom session entry from extensions.\n * The host owns transcript spacing; renderer output should provide only its content.\n */\nexport class CustomEntryComponent extends Container {\n\tprivate entry: CustomEntry<unknown>;\n\tprivate renderer: EntryRenderer;\n\tprivate customComponent?: Component;\n\tprivate _expanded = false;\n\n\tconstructor(entry: CustomEntry<unknown>, renderer: EntryRenderer) {\n\t\tsuper();\n\t\tthis.entry = entry;\n\t\tthis.renderer = renderer;\n\t\tthis.rebuild();\n\t}\n\n\thasContent(): boolean {\n\t\treturn this.customComponent !== undefined;\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tif (this._expanded !== expanded) {\n\t\t\tthis._expanded = expanded;\n\t\t\tthis.rebuild();\n\t\t}\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tthis.rebuild();\n\t}\n\n\tprivate rebuild(): void {\n\t\tthis.clear();\n\t\tthis.customComponent = undefined;\n\n\t\tlet component: Component | undefined;\n\t\ttry {\n\t\t\tcomponent = this.renderer(this.entry, { expanded: this._expanded }, theme);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconst box = new Box(1, 1, (text) => theme.bg(\"customMessageBg\", text));\n\t\t\tbox.addChild(new Text(theme.fg(\"error\", `[${this.entry.customType}] renderer failed: ${message}`), 0, 0));\n\t\t\tcomponent = box;\n\t\t}\n\n\t\tif (!component) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.customComponent = component;\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(component);\n\t}\n}\n"]}
1
+ {"version":3,"file":"custom-entry.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/custom-entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAMlD,YAAY,KAA2B,EAAE,QAAuB;QAC/D,KAAK,EAAE,CAAC;QAHD,cAAS,GA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tui\";\nimport type { EntryRenderer, EntryRendererOptions } from \"../../../core/extensions/types.ts\";\nimport type { CustomEntry } from \"../../../core/session-manager.ts\";\nimport { theme } from \"../theme/theme.ts\";\n\n/**\n * Component that renders a custom session entry from extensions.\n * The host owns transcript spacing; renderer output should provide only its content.\n */\nexport class CustomEntryComponent extends Container {\n\tprivate entry: CustomEntry<unknown>;\n\tprivate renderer: EntryRenderer;\n\tprivate customComponent?: Component;\n\tprivate _expanded = false;\n\n\tconstructor(entry: CustomEntry<unknown>, renderer: EntryRenderer) {\n\t\tsuper();\n\t\tthis.entry = entry;\n\t\tthis.renderer = renderer;\n\t\tthis.rebuild();\n\t}\n\n\tget customEntry(): CustomEntry<unknown> {\n\t\treturn this.entry;\n\t}\n\n\thasContent(): boolean {\n\t\treturn this.customComponent !== undefined;\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tif (this._expanded !== expanded) {\n\t\t\tthis._expanded = expanded;\n\t\t\tthis.rebuild();\n\t\t}\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tthis.rebuild();\n\t}\n\n\tprivate rebuild(): void {\n\t\tthis.clear();\n\t\tthis.customComponent = undefined;\n\n\t\tlet component: Component | undefined;\n\t\ttry {\n\t\t\tcomponent = this.renderer(this.entry, { expanded: this._expanded }, theme);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconst box = new Box(1, 1, (text) => theme.bg(\"customMessageBg\", text));\n\t\t\tbox.addChild(new Text(theme.fg(\"error\", `[${this.entry.customType}] renderer failed: ${message}`), 0, 0));\n\t\t\tcomponent = box;\n\t\t}\n\n\t\tif (!component) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.customComponent = component;\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(component);\n\t}\n}\n\n/**\n * Index of the card `entry` replaces in place: the transcript card directly before\n * `insertIndex` (skipping only `isTransient` children such as a status line), when it\n * renders an entry of the same custom type and the renderer's `replaces` option accepts\n * the pair. Returns -1 when `entry` becomes a new card.\n */\nexport function replacedEntryCardIndex(\n\tchildren: readonly Component[],\n\tinsertIndex: number,\n\tentry: CustomEntry<unknown>,\n\toptions: EntryRendererOptions | undefined,\n\tisTransient: (child: Component) => boolean = () => false,\n): number {\n\tif (options?.replaces === undefined) return -1;\n\tlet previousIndex = insertIndex - 1;\n\twhile (previousIndex >= 0 && isTransient(children[previousIndex] as Component)) previousIndex--;\n\tconst previous = children[previousIndex];\n\tif (!(previous instanceof CustomEntryComponent)) return -1;\n\tif (previous.customEntry.customType !== entry.customType) return -1;\n\treturn options.replaces(previous.customEntry, entry) ? previousIndex : -1;\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import type { ToolExecutionComponent } from "./tool-execution.ts";
2
+ /** One exploration call as the collapsed group shows it: an action plus a label, never output. */
3
+ export type ExplorationCall = {
4
+ readonly action: "Read" | "Search" | "List";
5
+ /** Read: file basename. Search: the pattern plus ` in <dir>` for an explicit path. List: directory basename. */
6
+ readonly label: string;
7
+ readonly pending: boolean;
8
+ readonly failed: boolean;
9
+ };
10
+ /**
11
+ * Group only the built-in read/grep/find/ls presentation; custom renderers, semantic reads, and other
12
+ * tools stay cards.
13
+ */
14
+ export declare function explorationCall(component: ToolExecutionComponent): ExplorationCall | undefined;
15
+ //# sourceMappingURL=exploration-call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exploration-call.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/exploration-call.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,kGAAkG;AAClG,MAAM,MAAM,eAAe,GAAG;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,gHAAgH;IAChH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CACzB,CAAC;AAuBF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,sBAAsB,GAAG,eAAe,GAAG,SAAS,CAuB9F"}
@@ -0,0 +1,56 @@
1
+ import { basename } from "node:path";
2
+ import { resolveToCwd } from "../../../core/tools/path-utils.js";
3
+ import { findRenderers, grepRenderers, lsRenderers, readRenderers } from "../../../core/tools/renderers/index.js";
4
+ import { getCompactReadClassification } from "../../../core/tools/renderers/read.js";
5
+ import { formatPathRelativeToCwdOrAbsolute } from "../../../utils/paths.js";
6
+ const BUILT_IN_RENDERERS = { read: readRenderers, grep: grepRenderers, find: findRenderers, ls: lsRenderers };
7
+ function stringArg(args, ...keys) {
8
+ if (args === null || typeof args !== "object")
9
+ return undefined;
10
+ for (const key of keys) {
11
+ const value = Reflect.get(args, key);
12
+ if (typeof value === "string" && value)
13
+ return value;
14
+ }
15
+ return undefined;
16
+ }
17
+ function isReadRenderArgs(args) {
18
+ return args !== null && typeof args === "object";
19
+ }
20
+ /** A skill load or a memory recall is a semantic card, not file exploration; it keeps its own line. */
21
+ function isSemanticRead(args, cwd) {
22
+ const kind = getCompactReadClassification(isReadRenderArgs(args) ? args : undefined, cwd)?.kind;
23
+ return kind === "skill" || kind === "memory";
24
+ }
25
+ /**
26
+ * Group only the built-in read/grep/find/ls presentation; custom renderers, semantic reads, and other
27
+ * tools stay cards.
28
+ */
29
+ export function explorationCall(component) {
30
+ const { identity, state, presentation } = component.presentationSnapshot;
31
+ if (presentation !== "classic")
32
+ return undefined;
33
+ const toolName = identity.toolName;
34
+ if (toolName !== "read" && toolName !== "grep" && toolName !== "find" && toolName !== "ls")
35
+ return undefined;
36
+ const expected = BUILT_IN_RENDERERS[toolName];
37
+ const actual = identity.toolDefinition;
38
+ if (actual && (actual.renderCall !== expected.renderCall || actual.renderResult !== expected.renderResult)) {
39
+ return undefined;
40
+ }
41
+ const pending = state.isPartial;
42
+ const failed = state.result?.isError ?? false;
43
+ const path = stringArg(state.args, "file_path", "path");
44
+ if (toolName === "read") {
45
+ if (isSemanticRead(state.args, identity.cwd))
46
+ return undefined;
47
+ return { action: "Read", label: path ? basename(path) : "", pending, failed };
48
+ }
49
+ if (toolName === "grep") {
50
+ const pattern = stringArg(state.args, "pattern") ?? "";
51
+ const dir = path ? formatPathRelativeToCwdOrAbsolute(resolveToCwd(path, identity.cwd), identity.cwd) : "";
52
+ return { action: "Search", label: dir ? `${pattern} in ${dir}` : pattern, pending, failed };
53
+ }
54
+ return { action: "List", label: (path && basename(path)) || path || ".", pending, failed };
55
+ }
56
+ //# sourceMappingURL=exploration-call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exploration-call.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/exploration-call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAuB,MAAM,uCAAuC,CAAC;AAC1G,OAAO,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAY5E,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC;AAE9G,SAAS,SAAS,CAAC,IAAa,EAAE,GAAG,IAAc;IAClD,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,KAAK,GAAY,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC9C,IAAI,OAAO,KAAK,KAAK,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EAAE,OAAO,IAAI,KAAK,CAAC;IAC9C,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACzB,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC;YAAE,OAAO,SAAS,CAAC;QAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC/E,CAAC;IACD,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;QACvD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,iCAAiC,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1G,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC7F,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC5F,CAAC","sourcesContent":["import { basename } from \"node:path\";\nimport { resolveToCwd } from \"../../../core/tools/path-utils.ts\";\nimport { findRenderers, grepRenderers, lsRenderers, readRenderers } from \"../../../core/tools/renderers/index.ts\";\nimport { getCompactReadClassification, type ReadRenderArgs } from \"../../../core/tools/renderers/read.ts\";\nimport { formatPathRelativeToCwdOrAbsolute } from \"../../../utils/paths.ts\";\nimport type { ToolExecutionComponent } from \"./tool-execution.ts\";\n\n/** One exploration call as the collapsed group shows it: an action plus a label, never output. */\nexport type ExplorationCall = {\n\treadonly action: \"Read\" | \"Search\" | \"List\";\n\t/** Read: file basename. Search: the pattern plus ` in <dir>` for an explicit path. List: directory basename. */\n\treadonly label: string;\n\treadonly pending: boolean;\n\treadonly failed: boolean;\n};\n\nconst BUILT_IN_RENDERERS = { read: readRenderers, grep: grepRenderers, find: findRenderers, ls: lsRenderers };\n\nfunction stringArg(args: unknown, ...keys: string[]): string | undefined {\n\tif (args === null || typeof args !== \"object\") return undefined;\n\tfor (const key of keys) {\n\t\tconst value: unknown = Reflect.get(args, key);\n\t\tif (typeof value === \"string\" && value) return value;\n\t}\n\treturn undefined;\n}\n\nfunction isReadRenderArgs(args: unknown): args is ReadRenderArgs {\n\treturn args !== null && typeof args === \"object\";\n}\n\n/** A skill load or a memory recall is a semantic card, not file exploration; it keeps its own line. */\nfunction isSemanticRead(args: unknown, cwd: string): boolean {\n\tconst kind = getCompactReadClassification(isReadRenderArgs(args) ? args : undefined, cwd)?.kind;\n\treturn kind === \"skill\" || kind === \"memory\";\n}\n\n/**\n * Group only the built-in read/grep/find/ls presentation; custom renderers, semantic reads, and other\n * tools stay cards.\n */\nexport function explorationCall(component: ToolExecutionComponent): ExplorationCall | undefined {\n\tconst { identity, state, presentation } = component.presentationSnapshot;\n\tif (presentation !== \"classic\") return undefined;\n\tconst toolName = identity.toolName;\n\tif (toolName !== \"read\" && toolName !== \"grep\" && toolName !== \"find\" && toolName !== \"ls\") return undefined;\n\tconst expected = BUILT_IN_RENDERERS[toolName];\n\tconst actual = identity.toolDefinition;\n\tif (actual && (actual.renderCall !== expected.renderCall || actual.renderResult !== expected.renderResult)) {\n\t\treturn undefined;\n\t}\n\tconst pending = state.isPartial;\n\tconst failed = state.result?.isError ?? false;\n\tconst path = stringArg(state.args, \"file_path\", \"path\");\n\tif (toolName === \"read\") {\n\t\tif (isSemanticRead(state.args, identity.cwd)) return undefined;\n\t\treturn { action: \"Read\", label: path ? basename(path) : \"\", pending, failed };\n\t}\n\tif (toolName === \"grep\") {\n\t\tconst pattern = stringArg(state.args, \"pattern\") ?? \"\";\n\t\tconst dir = path ? formatPathRelativeToCwdOrAbsolute(resolveToCwd(path, identity.cwd), identity.cwd) : \"\";\n\t\treturn { action: \"Search\", label: dir ? `${pattern} in ${dir}` : pattern, pending, failed };\n\t}\n\treturn { action: \"List\", label: (path && basename(path)) || path || \".\", pending, failed };\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import { type Component, Container, type TuiMouseEvent } from "@earendil-works/pi-tui";
2
+ import type { ExplorationCall } from "./exploration-call.ts";
3
+ import type { ToolExecutionComponent } from "./tool-execution.ts";
4
+ /**
5
+ * Codex-style exploring cell over the original tool cards. It is a non-owning view: the transcript
6
+ * owns and disposes the cards, and result routing keeps addressing them by tool call id.
7
+ */
8
+ export declare class ExplorationGroup extends Container {
9
+ calls: {
10
+ readonly component: ToolExecutionComponent;
11
+ readonly call: ExplorationCall;
12
+ }[];
13
+ /** Rule paths injected into this group's calls; repeated paths count once. */
14
+ private rules;
15
+ private get expanded();
16
+ render(width: number): string[];
17
+ handleMouse(event: TuiMouseEvent): ReturnType<Container["handleMouse"]>;
18
+ /** References are replaced on each projection, never disposed by this view. */
19
+ setMembers(members: Component[], calls: ExplorationGroup["calls"], rules?: readonly string[]): void;
20
+ }
21
+ //# sourceMappingURL=exploration-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exploration-group.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/exploration-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,KAAK,aAAa,EAAmB,MAAM,wBAAwB,CAAC;AAGxG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AA2BlE;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;IAC9C,KAAK,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,sBAAsB,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;KAAE,EAAE,CAAM;IAC7F,8EAA8E;IAC9E,OAAO,CAAC,KAAK,CAAyB;IAEtC,OAAO,KAAK,QAAQ,GAEnB;IAEQ,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAqBvC;IAEQ,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAwB/E;IAED,+EAA+E;IAC/E,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,KAAK,GAAE,SAAS,MAAM,EAAO,GAAG,IAAI,CAItG;CACD"}
@@ -0,0 +1,95 @@
1
+ import { Container, truncateToWidth } from "@earendil-works/pi-tui";
2
+ import { theme } from "../theme/theme.js";
3
+ import { toolSpinnerGlyph } from "../tool-progress.js";
4
+ /** Body lines past this many collapse into one `… +K more` line, as codex caps exploring cells. */
5
+ const MAX_BODY_LINES = 8;
6
+ const SPINNER_FRAME_MS = 80;
7
+ function bodyLines(calls) {
8
+ const lines = [];
9
+ for (let index = 0; index < calls.length;) {
10
+ const first = calls[index];
11
+ index++;
12
+ if (first.action === "Read" && !first.failed) {
13
+ const names = [first.label];
14
+ while (index < calls.length && calls[index].action === "Read" && !calls[index].failed) {
15
+ names.push(calls[index].label);
16
+ index++;
17
+ }
18
+ const unique = [...new Set(names.filter(Boolean))];
19
+ lines.push(`${theme.fg("accent", "Read")} ${unique.join(theme.fg("dim", ", "))}`.trimEnd());
20
+ continue;
21
+ }
22
+ const failed = first.failed ? theme.fg("error", " (failed)") : "";
23
+ lines.push(`${theme.fg("accent", first.action)} ${first.label}`.trimEnd() + failed);
24
+ }
25
+ return lines;
26
+ }
27
+ /**
28
+ * Codex-style exploring cell over the original tool cards. It is a non-owning view: the transcript
29
+ * owns and disposes the cards, and result routing keeps addressing them by tool call id.
30
+ */
31
+ export class ExplorationGroup extends Container {
32
+ constructor() {
33
+ super(...arguments);
34
+ this.calls = [];
35
+ /** Rule paths injected into this group's calls; repeated paths count once. */
36
+ this.rules = [];
37
+ }
38
+ get expanded() {
39
+ return this.calls.some(({ component }) => component.presentationSnapshot.state.expanded);
40
+ }
41
+ render(width) {
42
+ const pending = this.calls.some(({ call }) => call.pending);
43
+ const failed = this.calls.filter(({ call }) => call.failed).length;
44
+ const marker = pending
45
+ ? theme.fg("accent", toolSpinnerGlyph(Math.floor(Date.now() / SPINNER_FRAME_MS)))
46
+ : theme.fg("dim", "•");
47
+ const header = `${marker} ${theme.bold(pending ? "Exploring" : "Explored")}` +
48
+ (failed ? theme.fg("error", ` · ${failed} failed`) : "");
49
+ const lines = ["", truncateToWidth(header, width)];
50
+ if (this.expanded)
51
+ return [...lines, ...super.render(width)];
52
+ const body = bodyLines(this.calls.map(({ call }) => call));
53
+ const ruleCount = new Set(this.rules).size;
54
+ if (ruleCount > 0)
55
+ body.push(`${theme.fg("accent", "Applied")} ${ruleCount} project ${ruleCount === 1 ? "rule" : "rules"}`);
56
+ const shown = body.length > MAX_BODY_LINES ? body.slice(0, MAX_BODY_LINES) : body;
57
+ if (body.length > shown.length)
58
+ shown.push(theme.fg("dim", `… +${body.length - shown.length} more`));
59
+ for (const [index, line] of shown.entries()) {
60
+ lines.push(truncateToWidth(`${index === 0 ? theme.fg("dim", " └ ") : " "}${line}`, width));
61
+ }
62
+ return lines;
63
+ }
64
+ handleMouse(event) {
65
+ if ((event.type === "press" || event.type === "click") &&
66
+ event.button === "left" &&
67
+ (event.y === 1 || !this.expanded)) {
68
+ if (event.type === "click") {
69
+ const expanded = !this.expanded;
70
+ for (const { component } of this.calls)
71
+ component.setExpanded(expanded);
72
+ }
73
+ return {
74
+ handled: true,
75
+ target: {
76
+ component: this,
77
+ originX: event.screenX - event.x,
78
+ originY: event.screenY - event.y,
79
+ width: event.width,
80
+ height: event.height,
81
+ },
82
+ };
83
+ }
84
+ if (this.expanded && event.y >= 2)
85
+ return super.handleMouse({ ...event, y: event.y - 2, height: event.height - 2 });
86
+ return undefined;
87
+ }
88
+ /** References are replaced on each projection, never disposed by this view. */
89
+ setMembers(members, calls, rules = []) {
90
+ this.children = members;
91
+ this.calls = calls;
92
+ this.rules = rules;
93
+ }
94
+ }
95
+ //# sourceMappingURL=exploration-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exploration-group.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/exploration-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAsB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACxG,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,mGAAmG;AACnG,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,SAAS,SAAS,CAAC,KAAiC;IACnD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,GAAI,CAAC;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,KAAK,EAAE,CAAC;QACR,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC5B,OAAO,KAAK,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,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B,MAAM,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAChC,KAAK,MAAM,EAAE,SAAS,EAAE,IAAI,IAAI,CAAC,KAAK;oBAAE,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YACzE,CAAC;YACD,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACP,SAAS,EAAE,IAAI;oBACf,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;oBAChC,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;oBAChC,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;iBACpB;aACD,CAAC;QACH,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC;YAChC,OAAO,KAAK,CAAC,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;QAClF,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,+EAA+E;IAC/E,UAAU,CAAC,OAAoB,EAAE,KAAgC,EAAE,KAAK,GAAsB,EAAE;QAC/F,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;CACD","sourcesContent":["import { type Component, Container, type TuiMouseEvent, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport { theme } from \"../theme/theme.ts\";\nimport { toolSpinnerGlyph } from \"../tool-progress.ts\";\nimport type { ExplorationCall } from \"./exploration-call.ts\";\nimport type { ToolExecutionComponent } from \"./tool-execution.ts\";\n\n/** Body lines past this many collapse into one `… +K more` line, as codex caps exploring cells. */\nconst MAX_BODY_LINES = 8;\nconst SPINNER_FRAME_MS = 80;\n\nfunction bodyLines(calls: readonly ExplorationCall[]): string[] {\n\tconst lines: string[] = [];\n\tfor (let index = 0; index < calls.length; ) {\n\t\tconst first = calls[index];\n\t\tindex++;\n\t\tif (first.action === \"Read\" && !first.failed) {\n\t\t\tconst names = [first.label];\n\t\t\twhile (index < calls.length && calls[index].action === \"Read\" && !calls[index].failed) {\n\t\t\t\tnames.push(calls[index].label);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tconst unique = [...new Set(names.filter(Boolean))];\n\t\t\tlines.push(`${theme.fg(\"accent\", \"Read\")} ${unique.join(theme.fg(\"dim\", \", \"))}`.trimEnd());\n\t\t\tcontinue;\n\t\t}\n\t\tconst failed = first.failed ? theme.fg(\"error\", \" (failed)\") : \"\";\n\t\tlines.push(`${theme.fg(\"accent\", first.action)} ${first.label}`.trimEnd() + failed);\n\t}\n\treturn lines;\n}\n\n/**\n * Codex-style exploring cell over the original tool cards. It is a non-owning view: the transcript\n * owns and disposes the cards, and result routing keeps addressing them by tool call id.\n */\nexport class ExplorationGroup extends Container {\n\tcalls: { readonly component: ToolExecutionComponent; readonly call: ExplorationCall }[] = [];\n\t/** Rule paths injected into this group's calls; repeated paths count once. */\n\tprivate rules: readonly string[] = [];\n\n\tprivate get expanded(): boolean {\n\t\treturn this.calls.some(({ component }) => component.presentationSnapshot.state.expanded);\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst pending = this.calls.some(({ call }) => call.pending);\n\t\tconst failed = this.calls.filter(({ call }) => call.failed).length;\n\t\tconst marker = pending\n\t\t\t? theme.fg(\"accent\", toolSpinnerGlyph(Math.floor(Date.now() / SPINNER_FRAME_MS)))\n\t\t\t: theme.fg(\"dim\", \"•\");\n\t\tconst header =\n\t\t\t`${marker} ${theme.bold(pending ? \"Exploring\" : \"Explored\")}` +\n\t\t\t(failed ? theme.fg(\"error\", ` · ${failed} failed`) : \"\");\n\t\tconst lines = [\"\", truncateToWidth(header, width)];\n\t\tif (this.expanded) return [...lines, ...super.render(width)];\n\t\tconst body = bodyLines(this.calls.map(({ call }) => call));\n\t\tconst ruleCount = new Set(this.rules).size;\n\t\tif (ruleCount > 0)\n\t\t\tbody.push(`${theme.fg(\"accent\", \"Applied\")} ${ruleCount} project ${ruleCount === 1 ? \"rule\" : \"rules\"}`);\n\t\tconst shown = body.length > MAX_BODY_LINES ? body.slice(0, MAX_BODY_LINES) : body;\n\t\tif (body.length > shown.length) shown.push(theme.fg(\"dim\", `… +${body.length - shown.length} more`));\n\t\tfor (const [index, line] of shown.entries()) {\n\t\t\tlines.push(truncateToWidth(`${index === 0 ? theme.fg(\"dim\", \" └ \") : \" \"}${line}`, width));\n\t\t}\n\t\treturn lines;\n\t}\n\n\toverride handleMouse(event: TuiMouseEvent): ReturnType<Container[\"handleMouse\"]> {\n\t\tif (\n\t\t\t(event.type === \"press\" || event.type === \"click\") &&\n\t\t\tevent.button === \"left\" &&\n\t\t\t(event.y === 1 || !this.expanded)\n\t\t) {\n\t\t\tif (event.type === \"click\") {\n\t\t\t\tconst expanded = !this.expanded;\n\t\t\t\tfor (const { component } of this.calls) component.setExpanded(expanded);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\thandled: true,\n\t\t\t\ttarget: {\n\t\t\t\t\tcomponent: this,\n\t\t\t\t\toriginX: event.screenX - event.x,\n\t\t\t\t\toriginY: event.screenY - event.y,\n\t\t\t\t\twidth: event.width,\n\t\t\t\t\theight: event.height,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\tif (this.expanded && event.y >= 2)\n\t\t\treturn super.handleMouse({ ...event, y: event.y - 2, height: event.height - 2 });\n\t\treturn undefined;\n\t}\n\n\t/** References are replaced on each projection, never disposed by this view. */\n\tsetMembers(members: Component[], calls: ExplorationGroup[\"calls\"], rules: readonly string[] = []): void {\n\t\tthis.children = members;\n\t\tthis.calls = calls;\n\t\tthis.rules = rules;\n\t}\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { CustomEntryComponent } from "./custom-entry.ts";
2
+ import type { ExplorationGroup } from "./exploration-group.ts";
3
+ /** Undefined for stream rules, legacy notices without a tool call id, and calls outside the group. */
4
+ export declare function projectRulesOfCall(card: CustomEntryComponent, calls: ExplorationGroup["calls"]): readonly string[] | undefined;
5
+ //# sourceMappingURL=exploration-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exploration-rules.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/exploration-rules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,sGAAsG;AACtG,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,oBAAoB,EAC1B,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAC9B,SAAS,MAAM,EAAE,GAAG,SAAS,CAS/B"}
@@ -0,0 +1,15 @@
1
+ import { parseRuleActivationDetails, RULE_ACTIVATION_ENTRY_TYPE, } from "../../../core/extensions/builtin/rule-activation/types.js";
2
+ /** Undefined for stream rules, legacy notices without a tool call id, and calls outside the group. */
3
+ export function projectRulesOfCall(card, calls) {
4
+ const entry = card.customEntry;
5
+ if (entry.customType !== RULE_ACTIVATION_ENTRY_TYPE)
6
+ return undefined;
7
+ const details = parseRuleActivationDetails(entry.data);
8
+ if (details?.kind !== "project-rules" || details.toolCallId === undefined)
9
+ return undefined;
10
+ const toolCallId = details.toolCallId;
11
+ return calls.some(({ component }) => component.presentationSnapshot.identity.toolCallId === toolCallId)
12
+ ? details.rules
13
+ : undefined;
14
+ }
15
+ //# sourceMappingURL=exploration-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exploration-rules.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/exploration-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,0BAA0B,EAC1B,0BAA0B,GAC1B,MAAM,2DAA2D,CAAC;AAInE,sGAAsG;AACtG,MAAM,UAAU,kBAAkB,CACjC,IAA0B,EAC1B,KAAgC;IAEhC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC;IAC/B,IAAI,KAAK,CAAC,UAAU,KAAK,0BAA0B;QAAE,OAAO,SAAS,CAAC;IACtE,MAAM,OAAO,GAAG,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,IAAI,OAAO,EAAE,IAAI,KAAK,eAAe,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5F,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,oBAAoB,CAAC,QAAQ,CAAC,UAAU,KAAK,UAAU,CAAC;QACtG,CAAC,CAAC,OAAO,CAAC,KAAK;QACf,CAAC,CAAC,SAAS,CAAC;AACd,CAAC","sourcesContent":["import {\n\tparseRuleActivationDetails,\n\tRULE_ACTIVATION_ENTRY_TYPE,\n} from \"../../../core/extensions/builtin/rule-activation/types.ts\";\nimport type { CustomEntryComponent } from \"./custom-entry.ts\";\nimport type { ExplorationGroup } from \"./exploration-group.ts\";\n\n/** Undefined for stream rules, legacy notices without a tool call id, and calls outside the group. */\nexport function projectRulesOfCall(\n\tcard: CustomEntryComponent,\n\tcalls: ExplorationGroup[\"calls\"],\n): readonly string[] | undefined {\n\tconst entry = card.customEntry;\n\tif (entry.customType !== RULE_ACTIVATION_ENTRY_TYPE) return undefined;\n\tconst details = parseRuleActivationDetails(entry.data);\n\tif (details?.kind !== \"project-rules\" || details.toolCallId === undefined) return undefined;\n\tconst toolCallId = details.toolCallId;\n\treturn calls.some(({ component }) => component.presentationSnapshot.identity.toolCallId === toolCallId)\n\t\t? details.rules\n\t\t: undefined;\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { Container, type TuiMouseEvent } from "@earendil-works/pi-tui";
2
+ import { type ProgressiveTranscriptOptions } from "./progressive-transcript-container.ts";
3
+ /**
4
+ * Original children remain the lifecycle/ID/anchor model. A non-owning projection groups their
5
+ * presentation before progressive hydration, so compact frames never render hidden tool results.
6
+ * Re-projecting also handles partial args, late text, and visibility changes without moving cards.
7
+ */
8
+ export declare class ExplorationTranscriptContainer extends Container {
9
+ private readonly display;
10
+ private groups;
11
+ constructor(options: ProgressiveTranscriptOptions);
12
+ render(width: number): string[];
13
+ handleMouse(event: TuiMouseEvent): import("@earendil-works/pi-tui/tui").TuiMouseDispatchResult | undefined;
14
+ clear(): void;
15
+ detachAll(): void;
16
+ dispose(): void;
17
+ }
18
+ //# sourceMappingURL=exploration-transcript-container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exploration-transcript-container.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/exploration-transcript-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAMvF,OAAO,EAEN,KAAK,4BAA4B,EACjC,MAAM,uCAAuC,CAAC;AAG/C;;;;GAIG;AACH,qBAAa,8BAA+B,SAAQ,SAAS;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,OAAO,CAAC,MAAM,CAA2D;IAEzE,YAAY,OAAO,EAAE,4BAA4B,EAGhD;IAEQ,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAiCvC;IAEQ,WAAW,CAAC,KAAK,EAAE,aAAa,2EAExC;IAEQ,KAAK,IAAI,IAAI,CAIrB;IAEQ,SAAS,IAAI,IAAI,CAIzB;IAEQ,OAAO,IAAI,IAAI,CAIvB;CACD"}
@@ -0,0 +1,76 @@
1
+ import { Container } from "@earendil-works/pi-tui";
2
+ import { AssistantMessageComponent } from "./assistant-message.js";
3
+ import { CustomEntryComponent } from "./custom-entry.js";
4
+ import { explorationCall } from "./exploration-call.js";
5
+ import { ExplorationGroup } from "./exploration-group.js";
6
+ import { projectRulesOfCall } from "./exploration-rules.js";
7
+ import { ProgressiveTranscriptContainer, } from "./progressive-transcript-container.js";
8
+ import { ToolExecutionComponent } from "./tool-execution.js";
9
+ /**
10
+ * Original children remain the lifecycle/ID/anchor model. A non-owning projection groups their
11
+ * presentation before progressive hydration, so compact frames never render hidden tool results.
12
+ * Re-projecting also handles partial args, late text, and visibility changes without moving cards.
13
+ */
14
+ export class ExplorationTranscriptContainer extends Container {
15
+ constructor(options) {
16
+ super();
17
+ this.groups = new WeakMap();
18
+ this.display = new ProgressiveTranscriptContainer(options);
19
+ }
20
+ render(width) {
21
+ const projected = [];
22
+ let group;
23
+ let members = [];
24
+ let calls = [];
25
+ let rules = [];
26
+ for (const child of this.children) {
27
+ const call = child instanceof ToolExecutionComponent ? explorationCall(child) : undefined;
28
+ if (child instanceof ToolExecutionComponent && call) {
29
+ if (!group) {
30
+ group = this.groups.get(child) ?? new ExplorationGroup();
31
+ this.groups.set(child, group);
32
+ projected.push(group);
33
+ members = [];
34
+ calls = [];
35
+ rules = [];
36
+ }
37
+ members.push(child);
38
+ calls.push({ component: child, call });
39
+ group.setMembers(members, calls, rules);
40
+ }
41
+ else if (group && child instanceof AssistantMessageComponent && child.isExplorationDetail) {
42
+ members.push(child);
43
+ }
44
+ else if (group && child instanceof CustomEntryComponent && projectRulesOfCall(child, calls)) {
45
+ members.push(child);
46
+ rules = [...rules, ...(projectRulesOfCall(child, calls) ?? [])];
47
+ group.setMembers(members, calls, rules);
48
+ }
49
+ else {
50
+ group = undefined;
51
+ projected.push(child);
52
+ }
53
+ }
54
+ this.display.children = projected;
55
+ return this.display.render(width);
56
+ }
57
+ handleMouse(event) {
58
+ return this.display.handleMouse(event);
59
+ }
60
+ clear() {
61
+ this.display.detachAll();
62
+ this.groups = new WeakMap();
63
+ super.clear();
64
+ }
65
+ detachAll() {
66
+ this.display.detachAll();
67
+ this.groups = new WeakMap();
68
+ super.detachAll();
69
+ }
70
+ dispose() {
71
+ this.display.detachAll();
72
+ this.display.dispose();
73
+ super.dispose();
74
+ }
75
+ }
76
+ //# sourceMappingURL=exploration-transcript-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exploration-transcript-container.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/exploration-transcript-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAsB,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EACN,8BAA8B,GAE9B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,OAAO,8BAA+B,SAAQ,SAAS;IAI5D,YAAY,OAAqC;QAChD,KAAK,EAAE,CAAC;QAHD,WAAM,GAAG,IAAI,OAAO,EAA4C,CAAC;QAIxE,IAAI,CAAC,OAAO,GAAG,IAAI,8BAA8B,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC;IAEQ,MAAM,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAgB,EAAE,CAAC;QAClC,IAAI,KAAmC,CAAC;QACxC,IAAI,OAAO,GAAgB,EAAE,CAAC;QAC9B,IAAI,KAAK,GAA8B,EAAE,CAAC;QAC1C,IAAI,KAAK,GAAa,EAAE,CAAC;QACzB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,MAAM,IAAI,GAAG,KAAK,YAAY,sBAAsB,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,C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AClB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;QACF,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAEQ,WAAW,CAAC,KAAoB;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAEQ,KAAK;QACb,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC5B,KAAK,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAEQ,SAAS;QACjB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC5B,KAAK,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACvB,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD","sourcesContent":["import { type Component, Container, type TuiMouseEvent } from \"@earendil-works/pi-tui\";\nimport { AssistantMessageComponent } from \"./assistant-message.ts\";\nimport { CustomEntryComponent } from \"./custom-entry.ts\";\nimport { explorationCall } from \"./exploration-call.ts\";\nimport { ExplorationGroup } from \"./exploration-group.ts\";\nimport { projectRulesOfCall } from \"./exploration-rules.ts\";\nimport {\n\tProgressiveTranscriptContainer,\n\ttype ProgressiveTranscriptOptions,\n} from \"./progressive-transcript-container.ts\";\nimport { ToolExecutionComponent } from \"./tool-execution.ts\";\n\n/**\n * Original children remain the lifecycle/ID/anchor model. A non-owning projection groups their\n * presentation before progressive hydration, so compact frames never render hidden tool results.\n * Re-projecting also handles partial args, late text, and visibility changes without moving cards.\n */\nexport class ExplorationTranscriptContainer extends Container {\n\tprivate readonly display: ProgressiveTranscriptContainer;\n\tprivate groups = new WeakMap<ToolExecutionComponent, ExplorationGroup>();\n\n\tconstructor(options: ProgressiveTranscriptOptions) {\n\t\tsuper();\n\t\tthis.display = new ProgressiveTranscriptContainer(options);\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst projected: Component[] = [];\n\t\tlet group: ExplorationGroup | undefined;\n\t\tlet members: Component[] = [];\n\t\tlet calls: ExplorationGroup[\"calls\"] = [];\n\t\tlet rules: string[] = [];\n\t\tfor (const child of this.children) {\n\t\t\tconst call = child instanceof ToolExecutionComponent ? explorationCall(child) : undefined;\n\t\t\tif (child instanceof ToolExecutionComponent && call) {\n\t\t\t\tif (!group) {\n\t\t\t\t\tgroup = this.groups.get(child) ?? new ExplorationGroup();\n\t\t\t\t\tthis.groups.set(child, group);\n\t\t\t\t\tprojected.push(group);\n\t\t\t\t\tmembers = [];\n\t\t\t\t\tcalls = [];\n\t\t\t\t\trules = [];\n\t\t\t\t}\n\t\t\t\tmembers.push(child);\n\t\t\t\tcalls.push({ component: child, call });\n\t\t\t\tgroup.setMembers(members, calls, rules);\n\t\t\t} else if (group && child instanceof AssistantMessageComponent && child.isExplorationDetail) {\n\t\t\t\tmembers.push(child);\n\t\t\t} else if (group && child instanceof CustomEntryComponent && projectRulesOfCall(child, calls)) {\n\t\t\t\tmembers.push(child);\n\t\t\t\trules = [...rules, ...(projectRulesOfCall(child, calls) ?? [])];\n\t\t\t\tgroup.setMembers(members, calls, rules);\n\t\t\t} else {\n\t\t\t\tgroup = undefined;\n\t\t\t\tprojected.push(child);\n\t\t\t}\n\t\t}\n\t\tthis.display.children = projected;\n\t\treturn this.display.render(width);\n\t}\n\n\toverride handleMouse(event: TuiMouseEvent) {\n\t\treturn this.display.handleMouse(event);\n\t}\n\n\toverride clear(): void {\n\t\tthis.display.detachAll();\n\t\tthis.groups = new WeakMap();\n\t\tsuper.clear();\n\t}\n\n\toverride detachAll(): void {\n\t\tthis.display.detachAll();\n\t\tthis.groups = new WeakMap();\n\t\tsuper.detachAll();\n\t}\n\n\toverride dispose(): void {\n\t\tthis.display.detachAll();\n\t\tthis.display.dispose();\n\t\tsuper.dispose();\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Container, type TUI } from "@earendil-works/pi-tui";
2
- import type { ToolExecutionResult, ToolRenderers } from "./tool-execution-types.ts";
2
+ import type { ToolExecutionIdentity, ToolExecutionRenderState, ToolExecutionResult, ToolRenderers } from "./tool-execution-types.ts";
3
3
  export type { ToolRenderers } from "./tool-execution-types.ts";
4
4
  export interface ToolExecutionOptions {
5
5
  showImages?: boolean;
@@ -31,6 +31,12 @@ export declare class ToolExecutionComponent extends Container {
31
31
  private lastDisplaySignature?;
32
32
  constructor(toolName: string, toolCallId: string, args: unknown, options: ToolExecutionOptions | undefined, toolDefinition: ToolRenderers | undefined, ui: TUI, cwd: string, presentation?: ToolExecutionPresentation);
33
33
  updateArgs(args: unknown): void;
34
+ /** Read-only presentation state; execution routing continues to own this original card. */
35
+ get presentationSnapshot(): {
36
+ identity: ToolExecutionIdentity;
37
+ state: ToolExecutionRenderState;
38
+ presentation: ToolExecutionPresentation;
39
+ };
34
40
  markExecutionStarted(): void;
35
41
  setArgsComplete(): void;
36
42
  updateResult(result: ToolExecutionResult, isPartial?: boolean): void;
@@ -1 +1 @@
1
- {"version":3,"file":"tool-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,KAAK,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAUrE,OAAO,KAAK,EAGX,mBAAmB,EACnB,aAAa,EACb,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,e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