gsd-pi 2.76.0-dev.fe143342a → 2.77.0-dev.538325aea

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 (802) hide show
  1. package/README.md +17 -35
  2. package/dist/claude-cli-check.js +32 -3
  3. package/dist/cli.js +13 -21
  4. package/dist/extension-registry.js +1 -1
  5. package/dist/headless-ui.d.ts +1 -1
  6. package/dist/headless.js +2 -4
  7. package/dist/loader.js +0 -1
  8. package/dist/onboarding.js +50 -5
  9. package/dist/provider-migrations.d.ts +2 -2
  10. package/dist/provider-migrations.js +2 -1
  11. package/dist/remote-questions-config.js +1 -1
  12. package/dist/resources/extensions/async-jobs/async-bash-tool.js +1 -1
  13. package/dist/resources/extensions/aws-auth/index.js +2 -1
  14. package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.js +6 -9
  15. package/dist/resources/extensions/bg-shell/process-manager.js +2 -1
  16. package/dist/resources/extensions/browser-tools/index.js +0 -1
  17. package/dist/resources/extensions/claude-code-cli/index.js +1 -1
  18. package/dist/resources/extensions/claude-code-cli/partial-builder.js +106 -17
  19. package/dist/resources/extensions/claude-code-cli/readiness.js +4 -3
  20. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +28 -23
  21. package/dist/resources/extensions/gsd/auto/loop.js +9 -0
  22. package/dist/resources/extensions/gsd/auto/phases.js +54 -4
  23. package/dist/resources/extensions/gsd/auto/run-unit.js +38 -2
  24. package/dist/resources/extensions/gsd/auto/session.js +18 -1
  25. package/dist/resources/extensions/gsd/auto-dispatch.js +56 -17
  26. package/dist/resources/extensions/gsd/auto-model-selection.js +1 -1
  27. package/dist/resources/extensions/gsd/auto-post-unit.js +59 -2
  28. package/dist/resources/extensions/gsd/auto-prompts.js +14 -0
  29. package/dist/resources/extensions/gsd/auto-recovery.js +69 -1
  30. package/dist/resources/extensions/gsd/auto-start.js +35 -38
  31. package/dist/resources/extensions/gsd/auto-worktree.js +51 -53
  32. package/dist/resources/extensions/gsd/auto.js +55 -16
  33. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +17 -1
  34. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +17 -6
  35. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +34 -2
  36. package/dist/resources/extensions/gsd/clean-root-preflight.js +93 -0
  37. package/dist/resources/extensions/gsd/commands-prefs-wizard.js +968 -23
  38. package/dist/resources/extensions/gsd/dispatch-guard.js +44 -3
  39. package/dist/resources/extensions/gsd/gitignore.js +1 -0
  40. package/dist/resources/extensions/gsd/gsd-db.js +90 -30
  41. package/dist/resources/extensions/gsd/guided-flow.js +191 -2
  42. package/dist/resources/extensions/gsd/health-widget.js +4 -1
  43. package/dist/resources/extensions/gsd/key-manager.js +22 -0
  44. package/dist/resources/extensions/gsd/model-router.js +36 -3
  45. package/dist/resources/extensions/gsd/pre-execution-checks.js +31 -6
  46. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -0
  47. package/dist/resources/extensions/gsd/prompts/discuss.md +29 -2
  48. package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
  49. package/dist/resources/extensions/gsd/prompts/system.md +1 -0
  50. package/dist/resources/extensions/gsd/safety/evidence-collector.js +96 -0
  51. package/dist/resources/extensions/gsd/safety/file-change-validator.js +12 -4
  52. package/dist/resources/extensions/gsd/safety/safety-harness.js +5 -1
  53. package/dist/resources/extensions/gsd/token-counter.js +22 -5
  54. package/dist/resources/extensions/gsd/tools/complete-milestone.js +16 -10
  55. package/dist/resources/extensions/gsd/uok/plan-v2.js +20 -3
  56. package/dist/resources/extensions/gsd/worktree-resolver.js +50 -10
  57. package/dist/resources/extensions/mcp-client/index.js +1 -1
  58. package/dist/resources/extensions/ollama/index.js +1 -2
  59. package/dist/resources/extensions/ollama/ollama-chat-provider.js +5 -15
  60. package/dist/resources/extensions/remote-questions/config.js +12 -1
  61. package/dist/resources/extensions/universal-config/index.js +1 -1
  62. package/dist/resources/skills/verify-before-complete/SKILL.md +2 -1
  63. package/dist/resources/skills/write-docs/SKILL.md +2 -1
  64. package/dist/security-overrides.d.ts +4 -1
  65. package/dist/security-overrides.js +16 -3
  66. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  67. package/dist/web/standalone/.next/BUILD_ID +1 -1
  68. package/dist/web/standalone/.next/app-path-routes-manifest.json +8 -8
  69. package/dist/web/standalone/.next/build-manifest.json +3 -3
  70. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  71. package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
  72. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  73. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  74. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  75. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  76. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  77. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  78. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  79. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  80. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  81. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  82. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  83. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  84. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  85. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  86. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  87. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  88. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  89. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  90. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +1 -1
  91. package/dist/web/standalone/.next/server/app/index.html +1 -1
  92. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  93. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  94. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  95. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  96. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  97. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  98. package/dist/web/standalone/.next/server/app-paths-manifest.json +8 -8
  99. package/dist/web/standalone/.next/server/chunks/6897.js +2 -2
  100. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  101. package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
  102. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  103. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  104. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  105. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  106. package/dist/web/standalone/.next/static/chunks/2826.d445fb428ef41fa1.js +9 -0
  107. package/dist/web/standalone/.next/static/chunks/{webpack-5fc74f13a25fa1bb.js → webpack-1832629448831fdc.js} +1 -1
  108. package/dist/web-mode.js +1 -1
  109. package/dist/welcome-screen.js +19 -15
  110. package/dist/wizard.js +4 -5
  111. package/package.json +25 -7
  112. package/packages/daemon/package.json +2 -2
  113. package/packages/gsd-agent-core/dist/agent-session.d.ts +716 -0
  114. package/packages/gsd-agent-core/dist/agent-session.d.ts.map +1 -0
  115. package/packages/gsd-agent-core/dist/agent-session.js +2595 -0
  116. package/packages/gsd-agent-core/dist/agent-session.js.map +1 -0
  117. package/packages/gsd-agent-core/dist/artifact-manager.d.ts +52 -0
  118. package/packages/gsd-agent-core/dist/artifact-manager.d.ts.map +1 -0
  119. package/packages/gsd-agent-core/dist/artifact-manager.js +118 -0
  120. package/packages/gsd-agent-core/dist/artifact-manager.js.map +1 -0
  121. package/packages/gsd-agent-core/dist/bash-executor.d.ts +57 -0
  122. package/packages/gsd-agent-core/dist/bash-executor.d.ts.map +1 -0
  123. package/packages/gsd-agent-core/dist/bash-executor.js +282 -0
  124. package/packages/gsd-agent-core/dist/bash-executor.js.map +1 -0
  125. package/packages/gsd-agent-core/dist/blob-store.d.ts +39 -0
  126. package/packages/gsd-agent-core/dist/blob-store.d.ts.map +1 -0
  127. package/packages/gsd-agent-core/dist/blob-store.js +151 -0
  128. package/packages/gsd-agent-core/dist/blob-store.js.map +1 -0
  129. package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts +90 -0
  130. package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts.map +1 -0
  131. package/packages/gsd-agent-core/dist/compaction/branch-summarization.js +207 -0
  132. package/packages/gsd-agent-core/dist/compaction/branch-summarization.js.map +1 -0
  133. package/packages/gsd-agent-core/dist/compaction/compaction.d.ts +137 -0
  134. package/packages/gsd-agent-core/dist/compaction/compaction.d.ts.map +1 -0
  135. package/packages/gsd-agent-core/dist/compaction/compaction.js +621 -0
  136. package/packages/gsd-agent-core/dist/compaction/compaction.js.map +1 -0
  137. package/packages/gsd-agent-core/dist/compaction/index.d.ts +7 -0
  138. package/packages/gsd-agent-core/dist/compaction/index.d.ts.map +1 -0
  139. package/packages/gsd-agent-core/dist/compaction/index.js +7 -0
  140. package/packages/gsd-agent-core/dist/compaction/index.js.map +1 -0
  141. package/packages/gsd-agent-core/dist/compaction/utils.d.ts +78 -0
  142. package/packages/gsd-agent-core/dist/compaction/utils.d.ts.map +1 -0
  143. package/packages/gsd-agent-core/dist/compaction/utils.js +263 -0
  144. package/packages/gsd-agent-core/dist/compaction/utils.js.map +1 -0
  145. package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts +90 -0
  146. package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts.map +1 -0
  147. package/packages/gsd-agent-core/dist/compaction-orchestrator.js +338 -0
  148. package/packages/gsd-agent-core/dist/compaction-orchestrator.js.map +1 -0
  149. package/packages/gsd-agent-core/dist/contextual-tips.d.ts +43 -0
  150. package/packages/gsd-agent-core/dist/contextual-tips.d.ts.map +1 -0
  151. package/packages/gsd-agent-core/dist/contextual-tips.js +208 -0
  152. package/packages/gsd-agent-core/dist/contextual-tips.js.map +1 -0
  153. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts +18 -0
  154. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts.map +1 -0
  155. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js +250 -0
  156. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js.map +1 -0
  157. package/packages/gsd-agent-core/dist/export-html/index.d.ts +37 -0
  158. package/packages/gsd-agent-core/dist/export-html/index.d.ts.map +1 -0
  159. package/packages/gsd-agent-core/dist/export-html/index.js +257 -0
  160. package/packages/gsd-agent-core/dist/export-html/index.js.map +1 -0
  161. package/packages/gsd-agent-core/dist/export-html/template.css +971 -0
  162. package/packages/gsd-agent-core/dist/export-html/template.html +54 -0
  163. package/packages/gsd-agent-core/dist/export-html/template.js +1583 -0
  164. package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts +38 -0
  165. package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts.map +1 -0
  166. package/packages/gsd-agent-core/dist/export-html/tool-renderer.js +70 -0
  167. package/packages/gsd-agent-core/dist/export-html/tool-renderer.js.map +1 -0
  168. package/packages/gsd-agent-core/dist/export-html/vendor/highlight.min.js +1213 -0
  169. package/packages/gsd-agent-core/dist/export-html/vendor/marked.min.js +6 -0
  170. package/packages/gsd-agent-core/dist/fallback-resolver.d.ts +75 -0
  171. package/packages/gsd-agent-core/dist/fallback-resolver.d.ts.map +1 -0
  172. package/packages/gsd-agent-core/dist/fallback-resolver.js +118 -0
  173. package/packages/gsd-agent-core/dist/fallback-resolver.js.map +1 -0
  174. package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts +44 -0
  175. package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts.map +1 -0
  176. package/packages/gsd-agent-core/dist/image-overflow-recovery.js +99 -0
  177. package/packages/gsd-agent-core/dist/image-overflow-recovery.js.map +1 -0
  178. package/packages/gsd-agent-core/dist/index.d.ts +14 -0
  179. package/packages/gsd-agent-core/dist/index.d.ts.map +1 -0
  180. package/packages/gsd-agent-core/dist/index.js +19 -0
  181. package/packages/gsd-agent-core/dist/index.js.map +1 -0
  182. package/packages/gsd-agent-core/dist/keybindings.d.ts +47 -0
  183. package/packages/gsd-agent-core/dist/keybindings.d.ts.map +1 -0
  184. package/packages/gsd-agent-core/dist/keybindings.js +156 -0
  185. package/packages/gsd-agent-core/dist/keybindings.js.map +1 -0
  186. package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts +42 -0
  187. package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts.map +1 -0
  188. package/packages/gsd-agent-core/dist/lifecycle-hooks.js +204 -0
  189. package/packages/gsd-agent-core/dist/lifecycle-hooks.js.map +1 -0
  190. package/packages/gsd-agent-core/dist/retry-handler.d.ts +128 -0
  191. package/packages/gsd-agent-core/dist/retry-handler.d.ts.map +1 -0
  192. package/packages/gsd-agent-core/dist/retry-handler.js +518 -0
  193. package/packages/gsd-agent-core/dist/retry-handler.js.map +1 -0
  194. package/packages/gsd-agent-core/dist/sdk.d.ts +159 -0
  195. package/packages/gsd-agent-core/dist/sdk.d.ts.map +1 -0
  196. package/packages/gsd-agent-core/dist/sdk.js +375 -0
  197. package/packages/gsd-agent-core/dist/sdk.js.map +1 -0
  198. package/packages/gsd-agent-core/dist/system-prompt.d.ts +28 -0
  199. package/packages/gsd-agent-core/dist/system-prompt.d.ts.map +1 -0
  200. package/packages/gsd-agent-core/dist/system-prompt.js +201 -0
  201. package/packages/gsd-agent-core/dist/system-prompt.js.map +1 -0
  202. package/packages/gsd-agent-core/package.json +25 -0
  203. package/packages/gsd-agent-core/scripts/copy-assets.cjs +43 -0
  204. package/packages/gsd-agent-core/src/agent-session.test.ts +169 -0
  205. package/packages/gsd-agent-core/src/agent-session.ts +3358 -0
  206. package/packages/gsd-agent-core/src/artifact-manager.ts +126 -0
  207. package/packages/gsd-agent-core/src/bash-executor.ts +352 -0
  208. package/packages/gsd-agent-core/src/blob-store.ts +154 -0
  209. package/packages/gsd-agent-core/src/compaction/branch-summarization.ts +317 -0
  210. package/packages/gsd-agent-core/src/compaction/compaction.ts +855 -0
  211. package/packages/gsd-agent-core/src/compaction/index.ts +7 -0
  212. package/packages/gsd-agent-core/src/compaction/utils.ts +312 -0
  213. package/packages/gsd-agent-core/src/compaction-orchestrator.ts +449 -0
  214. package/packages/gsd-agent-core/src/contextual-tips.ts +232 -0
  215. package/packages/gsd-agent-core/src/export-html/ansi-to-html.ts +259 -0
  216. package/packages/gsd-agent-core/src/export-html/index.ts +345 -0
  217. package/packages/gsd-agent-core/src/export-html/template.css +971 -0
  218. package/packages/gsd-agent-core/src/export-html/template.html +54 -0
  219. package/packages/gsd-agent-core/src/export-html/template.js +1583 -0
  220. package/packages/gsd-agent-core/src/export-html/tool-renderer.ts +114 -0
  221. package/packages/gsd-agent-core/src/export-html/vendor/highlight.min.js +1213 -0
  222. package/packages/gsd-agent-core/src/export-html/vendor/marked.min.js +6 -0
  223. package/packages/gsd-agent-core/src/fallback-resolver.ts +193 -0
  224. package/packages/gsd-agent-core/src/image-overflow-recovery.ts +120 -0
  225. package/packages/gsd-agent-core/src/index.ts +68 -0
  226. package/packages/gsd-agent-core/src/keybindings.ts +220 -0
  227. package/packages/gsd-agent-core/src/lifecycle-hooks.ts +284 -0
  228. package/packages/gsd-agent-core/src/retry-handler.ts +620 -0
  229. package/packages/gsd-agent-core/src/sdk.ts +550 -0
  230. package/packages/gsd-agent-core/src/system-prompt.ts +270 -0
  231. package/packages/gsd-agent-core/tsconfig.json +28 -0
  232. package/packages/gsd-agent-core/tsconfig.tsbuildinfo +1 -0
  233. package/packages/gsd-agent-modes/dist/cli/args.d.ts +58 -0
  234. package/packages/gsd-agent-modes/dist/cli/args.d.ts.map +1 -0
  235. package/packages/gsd-agent-modes/dist/cli/args.js +324 -0
  236. package/packages/gsd-agent-modes/dist/cli/args.js.map +1 -0
  237. package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts +13 -0
  238. package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts.map +1 -0
  239. package/packages/gsd-agent-modes/dist/cli/config-selector.js +32 -0
  240. package/packages/gsd-agent-modes/dist/cli/config-selector.js.map +1 -0
  241. package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts +15 -0
  242. package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts.map +1 -0
  243. package/packages/gsd-agent-modes/dist/cli/file-processor.js +86 -0
  244. package/packages/gsd-agent-modes/dist/cli/file-processor.js.map +1 -0
  245. package/packages/gsd-agent-modes/dist/cli/list-models.d.ts +21 -0
  246. package/packages/gsd-agent-modes/dist/cli/list-models.d.ts.map +1 -0
  247. package/packages/gsd-agent-modes/dist/cli/list-models.js +114 -0
  248. package/packages/gsd-agent-modes/dist/cli/list-models.js.map +1 -0
  249. package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts +10 -0
  250. package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts.map +1 -0
  251. package/packages/gsd-agent-modes/dist/cli/session-picker.js +37 -0
  252. package/packages/gsd-agent-modes/dist/cli/session-picker.js.map +1 -0
  253. package/packages/gsd-agent-modes/dist/index.d.ts +7 -0
  254. package/packages/gsd-agent-modes/dist/index.d.ts.map +1 -0
  255. package/packages/gsd-agent-modes/dist/index.js +7 -0
  256. package/packages/gsd-agent-modes/dist/index.js.map +1 -0
  257. package/packages/gsd-agent-modes/dist/main.d.ts +8 -0
  258. package/packages/gsd-agent-modes/dist/main.d.ts.map +1 -0
  259. package/packages/gsd-agent-modes/dist/main.js +491 -0
  260. package/packages/gsd-agent-modes/dist/main.js.map +1 -0
  261. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts +34 -0
  262. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts.map +1 -0
  263. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js +330 -0
  264. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js.map +1 -0
  265. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts +29 -0
  266. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  267. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +141 -0
  268. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +1 -0
  269. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts +36 -0
  270. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  271. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js +157 -0
  272. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js.map +1 -0
  273. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  274. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  275. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js +48 -0
  276. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  277. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  278. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  279. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js +43 -0
  280. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  281. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts +11 -0
  282. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts.map +1 -0
  283. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js +47 -0
  284. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js.map +1 -0
  285. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  286. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  287. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js +44 -0
  288. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  289. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts +71 -0
  290. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  291. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js +474 -0
  292. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js.map +1 -0
  293. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts +15 -0
  294. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  295. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js +32 -0
  296. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  297. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts +22 -0
  298. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  299. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js +70 -0
  300. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js.map +1 -0
  301. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts +20 -0
  302. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  303. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js +75 -0
  304. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js.map +1 -0
  305. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  306. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
  307. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js +140 -0
  308. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js.map +1 -0
  309. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts +12 -0
  310. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts.map +1 -0
  311. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js +133 -0
  312. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js.map +1 -0
  313. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts +33 -0
  314. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  315. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js +82 -0
  316. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  317. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts +20 -0
  318. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  319. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js +111 -0
  320. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js.map +1 -0
  321. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts +24 -0
  322. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  323. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js +63 -0
  324. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js.map +1 -0
  325. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts +33 -0
  326. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  327. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js +118 -0
  328. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js.map +1 -0
  329. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts +32 -0
  330. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts.map +1 -0
  331. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js +230 -0
  332. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js.map +1 -0
  333. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts +34 -0
  334. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts.map +1 -0
  335. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js +36 -0
  336. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js.map +1 -0
  337. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts +48 -0
  338. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  339. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js +72 -0
  340. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  341. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts +63 -0
  342. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  343. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js +213 -0
  344. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js.map +1 -0
  345. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts +86 -0
  346. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  347. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js +536 -0
  348. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js.map +1 -0
  349. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
  350. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  351. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js +93 -0
  352. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  353. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts +30 -0
  354. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts.map +1 -0
  355. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js +169 -0
  356. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js.map +1 -0
  357. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
  358. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  359. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js +267 -0
  360. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  361. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts +21 -0
  362. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  363. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js +155 -0
  364. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  365. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts +97 -0
  366. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  367. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js +810 -0
  368. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js.map +1 -0
  369. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts +71 -0
  370. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  371. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js +320 -0
  372. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js.map +1 -0
  373. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  374. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  375. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js +34 -0
  376. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  377. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  378. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  379. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js +46 -0
  380. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  381. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  382. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  383. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js +45 -0
  384. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js.map +1 -0
  385. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  386. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  387. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js +46 -0
  388. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  389. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts +15 -0
  390. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts.map +1 -0
  391. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js +40 -0
  392. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js.map +1 -0
  393. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts +111 -0
  394. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  395. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +984 -0
  396. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +1 -0
  397. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts +44 -0
  398. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts.map +1 -0
  399. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js +61 -0
  400. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js.map +1 -0
  401. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts +109 -0
  402. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  403. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js +1035 -0
  404. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js.map +1 -0
  405. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  406. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  407. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js +112 -0
  408. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  409. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts +12 -0
  410. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  411. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js +38 -0
  412. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js.map +1 -0
  413. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  414. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  415. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js +33 -0
  416. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  417. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts +27 -0
  418. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -0
  419. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +793 -0
  420. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -0
  421. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts +4 -0
  422. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts.map +1 -0
  423. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js +62 -0
  424. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js.map +1 -0
  425. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts +22 -0
  426. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -0
  427. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +118 -0
  428. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +1 -0
  429. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts +7 -0
  430. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -0
  431. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js +68 -0
  432. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js.map +1 -0
  433. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts +50 -0
  434. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -0
  435. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js +2 -0
  436. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js.map +1 -0
  437. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts +358 -0
  438. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  439. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js +3409 -0
  440. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js.map +1 -0
  441. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts +77 -0
  442. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -0
  443. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js +529 -0
  444. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js.map +1 -0
  445. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts +6 -0
  446. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts.map +1 -0
  447. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js +15 -0
  448. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js.map +1 -0
  449. package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts +28 -0
  450. package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts.map +1 -0
  451. package/packages/gsd-agent-modes/dist/modes/print-mode.js +84 -0
  452. package/packages/gsd-agent-modes/dist/modes/print-mode.js.map +1 -0
  453. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts +17 -0
  454. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts.map +1 -0
  455. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js +49 -0
  456. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js.map +1 -0
  457. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts +37 -0
  458. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts.map +1 -0
  459. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js +84 -0
  460. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js.map +1 -0
  461. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts +243 -0
  462. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  463. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js +464 -0
  464. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js.map +1 -0
  465. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts +25 -0
  466. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  467. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js +750 -0
  468. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js.map +1 -0
  469. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts +511 -0
  470. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  471. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js +8 -0
  472. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js.map +1 -0
  473. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts +19 -0
  474. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts.map +1 -0
  475. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js +45 -0
  476. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js.map +1 -0
  477. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts +22 -0
  478. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts.map +1 -0
  479. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js +21 -0
  480. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js.map +1 -0
  481. package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts +4 -0
  482. package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts.map +1 -0
  483. package/packages/gsd-agent-modes/dist/pi-tui-compat.js +3 -0
  484. package/packages/gsd-agent-modes/dist/pi-tui-compat.js.map +1 -0
  485. package/packages/gsd-agent-modes/dist/theme.d.ts +15 -0
  486. package/packages/gsd-agent-modes/dist/theme.d.ts.map +1 -0
  487. package/packages/gsd-agent-modes/dist/theme.js +23 -0
  488. package/packages/gsd-agent-modes/dist/theme.js.map +1 -0
  489. package/packages/gsd-agent-modes/dist/utils/theme.d.ts +16 -0
  490. package/packages/gsd-agent-modes/dist/utils/theme.d.ts.map +1 -0
  491. package/packages/gsd-agent-modes/dist/utils/theme.js +11 -0
  492. package/packages/gsd-agent-modes/dist/utils/theme.js.map +1 -0
  493. package/packages/gsd-agent-modes/package.json +23 -0
  494. package/packages/gsd-agent-modes/src/cli/args.ts +350 -0
  495. package/packages/gsd-agent-modes/src/cli/config-selector.ts +54 -0
  496. package/packages/gsd-agent-modes/src/cli/file-processor.ts +107 -0
  497. package/packages/gsd-agent-modes/src/cli/list-models.ts +141 -0
  498. package/packages/gsd-agent-modes/src/cli/session-picker.ts +59 -0
  499. package/packages/gsd-agent-modes/src/index.ts +6 -0
  500. package/packages/gsd-agent-modes/src/main.ts +614 -0
  501. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
  502. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/provider-display-name.test.ts +18 -0
  503. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/timestamp.test.ts +38 -0
  504. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/tool-execution.test.ts +171 -0
  505. package/packages/gsd-agent-modes/src/modes/interactive/components/armin.ts +382 -0
  506. package/packages/gsd-agent-modes/src/modes/interactive/components/assistant-message.ts +178 -0
  507. package/packages/gsd-agent-modes/src/modes/interactive/components/bash-execution.ts +212 -0
  508. package/packages/gsd-agent-modes/src/modes/interactive/components/bordered-loader.ts +66 -0
  509. package/packages/gsd-agent-modes/src/modes/interactive/components/branch-summary-message.ts +59 -0
  510. package/packages/gsd-agent-modes/src/modes/interactive/components/chat-frame.ts +67 -0
  511. package/packages/gsd-agent-modes/src/modes/interactive/components/compaction-summary-message.ts +60 -0
  512. package/packages/gsd-agent-modes/src/modes/interactive/components/config-selector.ts +597 -0
  513. package/packages/gsd-agent-modes/src/modes/interactive/components/countdown-timer.ts +41 -0
  514. package/packages/gsd-agent-modes/src/modes/interactive/components/custom-editor.ts +88 -0
  515. package/packages/gsd-agent-modes/src/modes/interactive/components/custom-message.ts +100 -0
  516. package/packages/gsd-agent-modes/src/modes/interactive/components/daxnuts.ts +165 -0
  517. package/packages/gsd-agent-modes/src/modes/interactive/components/diff.ts +147 -0
  518. package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.test.ts +73 -0
  519. package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.ts +89 -0
  520. package/packages/gsd-agent-modes/src/modes/interactive/components/extension-editor.ts +151 -0
  521. package/packages/gsd-agent-modes/src/modes/interactive/components/extension-input.ts +100 -0
  522. package/packages/gsd-agent-modes/src/modes/interactive/components/extension-selector.ts +156 -0
  523. package/packages/gsd-agent-modes/src/modes/interactive/components/footer.ts +257 -0
  524. package/packages/gsd-agent-modes/src/modes/interactive/components/index.ts +35 -0
  525. package/packages/gsd-agent-modes/src/modes/interactive/components/keybinding-hints.ts +84 -0
  526. package/packages/gsd-agent-modes/src/modes/interactive/components/login-dialog.ts +257 -0
  527. package/packages/gsd-agent-modes/src/modes/interactive/components/model-selector.ts +656 -0
  528. package/packages/gsd-agent-modes/src/modes/interactive/components/oauth-selector.ts +122 -0
  529. package/packages/gsd-agent-modes/src/modes/interactive/components/provider-manager.ts +210 -0
  530. package/packages/gsd-agent-modes/src/modes/interactive/components/scoped-models-selector.ts +342 -0
  531. package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector-search.ts +194 -0
  532. package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector.ts +1011 -0
  533. package/packages/gsd-agent-modes/src/modes/interactive/components/settings-selector.ts +452 -0
  534. package/packages/gsd-agent-modes/src/modes/interactive/components/show-images-selector.ts +45 -0
  535. package/packages/gsd-agent-modes/src/modes/interactive/components/skill-invocation-message.ts +56 -0
  536. package/packages/gsd-agent-modes/src/modes/interactive/components/theme-selector.ts +63 -0
  537. package/packages/gsd-agent-modes/src/modes/interactive/components/thinking-selector.ts +64 -0
  538. package/packages/gsd-agent-modes/src/modes/interactive/components/timestamp.ts +48 -0
  539. package/packages/gsd-agent-modes/src/modes/interactive/components/tool-execution.ts +1157 -0
  540. package/packages/gsd-agent-modes/src/modes/interactive/components/tree-render-utils.ts +81 -0
  541. package/packages/gsd-agent-modes/src/modes/interactive/components/tree-selector.ts +1208 -0
  542. package/packages/gsd-agent-modes/src/modes/interactive/components/user-message-selector.ts +145 -0
  543. package/packages/gsd-agent-modes/src/modes/interactive/components/user-message.ts +44 -0
  544. package/packages/gsd-agent-modes/src/modes/interactive/components/visual-truncate.ts +50 -0
  545. package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller-ordering.test.ts +1430 -0
  546. package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.test.ts +71 -0
  547. package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.ts +957 -0
  548. package/packages/gsd-agent-modes/src/modes/interactive/controllers/extension-ui-controller.ts +63 -0
  549. package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.test.ts +183 -0
  550. package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.ts +140 -0
  551. package/packages/gsd-agent-modes/src/modes/interactive/controllers/model-controller.ts +77 -0
  552. package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-ordering.test.ts +44 -0
  553. package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-state.ts +49 -0
  554. package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode.ts +4195 -0
  555. package/packages/gsd-agent-modes/src/modes/interactive/slash-command-handlers.ts +670 -0
  556. package/packages/gsd-agent-modes/src/modes/interactive/utils/shorten-path.ts +14 -0
  557. package/packages/gsd-agent-modes/src/modes/print-mode.ts +106 -0
  558. package/packages/gsd-agent-modes/src/modes/rpc/jsonl.ts +58 -0
  559. package/packages/gsd-agent-modes/src/modes/rpc/remote-terminal.ts +109 -0
  560. package/packages/gsd-agent-modes/src/modes/rpc/rpc-client.ts +572 -0
  561. package/packages/gsd-agent-modes/src/modes/rpc/rpc-mode.ts +902 -0
  562. package/packages/gsd-agent-modes/src/modes/rpc/rpc-protocol-v2.test.ts +971 -0
  563. package/packages/gsd-agent-modes/src/modes/rpc/rpc-types.ts +335 -0
  564. package/packages/gsd-agent-modes/src/modes/shared/command-context-actions.ts +53 -0
  565. package/packages/gsd-agent-modes/src/pi-coding-agent-compat.ts +42 -0
  566. package/packages/gsd-agent-modes/src/pi-tui-compat.ts +4 -0
  567. package/packages/gsd-agent-modes/src/theme.ts +25 -0
  568. package/packages/gsd-agent-modes/src/utils/theme.ts +24 -0
  569. package/packages/gsd-agent-modes/tsconfig.json +28 -0
  570. package/packages/gsd-agent-modes/tsconfig.tsbuildinfo +1 -0
  571. package/packages/gsd-agent-types/dist/index.d.ts +176 -0
  572. package/packages/gsd-agent-types/dist/index.d.ts.map +1 -0
  573. package/packages/gsd-agent-types/dist/index.js +24 -0
  574. package/packages/gsd-agent-types/dist/index.js.map +1 -0
  575. package/packages/gsd-agent-types/package.json +24 -0
  576. package/packages/gsd-agent-types/src/index.ts +206 -0
  577. package/packages/gsd-agent-types/tsconfig.json +25 -0
  578. package/packages/gsd-agent-types/tsconfig.tsbuildinfo +1 -0
  579. package/packages/mcp-server/dist/remote-questions.d.ts +45 -0
  580. package/packages/mcp-server/dist/remote-questions.d.ts.map +1 -0
  581. package/packages/mcp-server/dist/remote-questions.js +732 -0
  582. package/packages/mcp-server/dist/remote-questions.js.map +1 -0
  583. package/packages/mcp-server/dist/server.d.ts +7 -0
  584. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  585. package/packages/mcp-server/dist/server.js +77 -11
  586. package/packages/mcp-server/dist/server.js.map +1 -1
  587. package/packages/mcp-server/dist/session-manager.d.ts +14 -0
  588. package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
  589. package/packages/mcp-server/dist/session-manager.js +49 -1
  590. package/packages/mcp-server/dist/session-manager.js.map +1 -1
  591. package/packages/mcp-server/package.json +4 -3
  592. package/packages/mcp-server/src/mcp-server.test.ts +67 -0
  593. package/packages/mcp-server/src/remote-questions.test.ts +294 -0
  594. package/packages/mcp-server/src/remote-questions.ts +916 -0
  595. package/packages/mcp-server/src/server.ts +94 -18
  596. package/packages/mcp-server/src/session-manager.ts +43 -1
  597. package/packages/mcp-server/tsconfig.test.json +19 -0
  598. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  599. package/packages/native/dist/tsconfig.tsbuildinfo +1 -0
  600. package/packages/native/package.json +1 -1
  601. package/packages/native/tsconfig.json +2 -1
  602. package/packages/pi-agent-core/package.json +1 -1
  603. package/packages/pi-ai/dist/models/custom.d.ts +38 -0
  604. package/packages/pi-ai/dist/models/custom.d.ts.map +1 -1
  605. package/packages/pi-ai/dist/models/custom.js +41 -0
  606. package/packages/pi-ai/dist/models/custom.js.map +1 -1
  607. package/packages/pi-ai/dist/providers/anthropic-auth.test.js +1 -1
  608. package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
  609. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
  610. package/packages/pi-ai/dist/providers/anthropic-shared.js +27 -4
  611. package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
  612. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  613. package/packages/pi-ai/dist/providers/anthropic.js +8 -3
  614. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  615. package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts +2 -0
  616. package/packages/pi-ai/dist/providers/minimax-tool-name.test.d.ts.map +1 -0
  617. package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +80 -0
  618. package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -0
  619. package/packages/pi-ai/dist/providers/simple-options.d.ts +10 -0
  620. package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
  621. package/packages/pi-ai/dist/providers/simple-options.js +16 -1
  622. package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
  623. package/packages/pi-ai/package.json +1 -1
  624. package/packages/pi-ai/src/models/custom.ts +42 -0
  625. package/packages/pi-ai/src/providers/anthropic-auth.test.ts +1 -1
  626. package/packages/pi-ai/src/providers/anthropic-shared.ts +26 -5
  627. package/packages/pi-ai/src/providers/anthropic.ts +9 -3
  628. package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +98 -0
  629. package/packages/pi-ai/src/providers/simple-options.ts +17 -1
  630. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  631. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +3 -2
  632. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
  633. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +2 -0
  634. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  635. package/packages/pi-coding-agent/dist/core/agent-session.js +7 -0
  636. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  637. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +2 -0
  638. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  639. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  640. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +7 -0
  641. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  642. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  643. package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts +2 -0
  644. package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.d.ts.map +1 -0
  645. package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js +203 -0
  646. package/packages/pi-coding-agent/dist/core/model-registry-custom-caps.test.js.map +1 -0
  647. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  648. package/packages/pi-coding-agent/dist/core/model-registry.js +14 -0
  649. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  650. package/packages/pi-coding-agent/dist/core/session-manager.js +1 -1
  651. package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
  652. package/packages/pi-coding-agent/dist/core/session-manager.test.js +21 -1
  653. package/packages/pi-coding-agent/dist/core/session-manager.test.js.map +1 -1
  654. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  655. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +13 -1
  656. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  657. package/packages/pi-coding-agent/package.json +1 -1
  658. package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +3 -2
  659. package/packages/pi-coding-agent/src/core/agent-session.ts +11 -0
  660. package/packages/pi-coding-agent/src/core/extensions/runner.ts +2 -0
  661. package/packages/pi-coding-agent/src/core/extensions/types.ts +7 -0
  662. package/packages/pi-coding-agent/src/core/model-registry-custom-caps.test.ts +245 -0
  663. package/packages/pi-coding-agent/src/core/model-registry.ts +16 -0
  664. package/packages/pi-coding-agent/src/core/session-manager.test.ts +30 -1
  665. package/packages/pi-coding-agent/src/core/session-manager.ts +1 -1
  666. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +13 -1
  667. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  668. package/packages/pi-tui/package.json +1 -1
  669. package/packages/rpc-client/package.json +1 -1
  670. package/pkg/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  671. package/pkg/dist/core/export-html/ansi-to-html.js +1 -0
  672. package/pkg/dist/core/export-html/ansi-to-html.js.map +1 -1
  673. package/pkg/dist/core/export-html/index.d.ts +1 -1
  674. package/pkg/dist/core/export-html/index.d.ts.map +1 -1
  675. package/pkg/dist/core/export-html/index.js +39 -5
  676. package/pkg/dist/core/export-html/index.js.map +1 -1
  677. package/pkg/dist/core/export-html/tool-renderer.d.ts +2 -2
  678. package/pkg/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  679. package/pkg/dist/core/export-html/tool-renderer.js.map +1 -1
  680. package/pkg/package.json +1 -1
  681. package/scripts/ensure-workspace-builds.cjs +2 -0
  682. package/scripts/install.js +512 -0
  683. package/scripts/link-workspace-packages.cjs +2 -0
  684. package/scripts/postinstall.js +9 -178
  685. package/src/resources/extensions/async-jobs/async-bash-tool.ts +1 -1
  686. package/src/resources/extensions/aws-auth/index.ts +2 -1
  687. package/src/resources/extensions/bg-shell/bg-shell-lifecycle.ts +4 -7
  688. package/src/resources/extensions/bg-shell/index.ts +2 -1
  689. package/src/resources/extensions/bg-shell/process-manager.ts +2 -1
  690. package/src/resources/extensions/browser-tools/index.ts +2 -1
  691. package/src/resources/extensions/claude-code-cli/index.ts +1 -1
  692. package/src/resources/extensions/claude-code-cli/partial-builder.ts +115 -23
  693. package/src/resources/extensions/claude-code-cli/readiness.ts +4 -3
  694. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +30 -22
  695. package/src/resources/extensions/claude-code-cli/tests/provider-registration.test.ts +27 -0
  696. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +39 -6
  697. package/src/resources/extensions/gsd/auto/loop-deps.ts +13 -0
  698. package/src/resources/extensions/gsd/auto/loop.ts +9 -0
  699. package/src/resources/extensions/gsd/auto/phases.ts +78 -4
  700. package/src/resources/extensions/gsd/auto/run-unit.ts +40 -2
  701. package/src/resources/extensions/gsd/auto/session.ts +28 -1
  702. package/src/resources/extensions/gsd/auto-dispatch.ts +59 -16
  703. package/src/resources/extensions/gsd/auto-model-selection.ts +1 -1
  704. package/src/resources/extensions/gsd/auto-post-unit.ts +62 -3
  705. package/src/resources/extensions/gsd/auto-prompts.ts +28 -1
  706. package/src/resources/extensions/gsd/auto-recovery.ts +62 -1
  707. package/src/resources/extensions/gsd/auto-start.ts +40 -52
  708. package/src/resources/extensions/gsd/auto-worktree.ts +62 -63
  709. package/src/resources/extensions/gsd/auto.ts +58 -16
  710. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +23 -1
  711. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +18 -6
  712. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +35 -2
  713. package/src/resources/extensions/gsd/clean-root-preflight.ts +111 -0
  714. package/src/resources/extensions/gsd/commands-prefs-wizard.ts +898 -32
  715. package/src/resources/extensions/gsd/dispatch-guard.ts +44 -2
  716. package/src/resources/extensions/gsd/gitignore.ts +1 -1
  717. package/src/resources/extensions/gsd/gsd-db.ts +92 -32
  718. package/src/resources/extensions/gsd/guided-flow.ts +223 -2
  719. package/src/resources/extensions/gsd/health-widget.ts +3 -1
  720. package/src/resources/extensions/gsd/journal.ts +2 -1
  721. package/src/resources/extensions/gsd/key-manager.ts +22 -0
  722. package/src/resources/extensions/gsd/model-router.ts +42 -1
  723. package/src/resources/extensions/gsd/pre-execution-checks.ts +33 -7
  724. package/src/resources/extensions/gsd/preferences-types.ts +8 -0
  725. package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -0
  726. package/src/resources/extensions/gsd/prompts/discuss.md +29 -2
  727. package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +5 -2
  728. package/src/resources/extensions/gsd/prompts/system.md +1 -0
  729. package/src/resources/extensions/gsd/safety/evidence-collector.ts +119 -0
  730. package/src/resources/extensions/gsd/safety/file-change-validator.ts +16 -3
  731. package/src/resources/extensions/gsd/safety/safety-harness.ts +9 -0
  732. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +188 -2
  733. package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +12 -0
  734. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +122 -0
  735. package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +141 -0
  736. package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +63 -0
  737. package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +23 -0
  738. package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +186 -0
  739. package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +15 -0
  740. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +61 -1
  741. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
  742. package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
  743. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +2 -0
  744. package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +9 -9
  745. package/src/resources/extensions/gsd/tests/dispatch-guard-summary-db-mismatch.test.ts +77 -0
  746. package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +31 -0
  747. package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +1 -1
  748. package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +1 -1
  749. package/src/resources/extensions/gsd/tests/escalation.test.ts +1 -1
  750. package/src/resources/extensions/gsd/tests/exec-history.test.ts +113 -0
  751. package/src/resources/extensions/gsd/tests/file-change-validator.test.ts +38 -0
  752. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +296 -1
  753. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +1 -0
  754. package/src/resources/extensions/gsd/tests/integration/gitignore-tracked-gsd.test.ts +1 -0
  755. package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +30 -0
  756. package/src/resources/extensions/gsd/tests/integration/worktree-e2e.test.ts +11 -0
  757. package/src/resources/extensions/gsd/tests/issue-4540-regressions.test.ts +288 -0
  758. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +2 -0
  759. package/src/resources/extensions/gsd/tests/key-manager.test.ts +2 -0
  760. package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
  761. package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +12 -0
  762. package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
  763. package/src/resources/extensions/gsd/tests/milestone-status-authoritative.test.ts +3 -3
  764. package/src/resources/extensions/gsd/tests/parallel-research-dispatch.test.ts +19 -0
  765. package/src/resources/extensions/gsd/tests/plan-gate-failed-doctor-heal-hint.test.ts +37 -0
  766. package/src/resources/extensions/gsd/tests/pre-exec-gate-loop.test.ts +272 -0
  767. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +337 -0
  768. package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +44 -0
  769. package/src/resources/extensions/gsd/tests/ready-phrase-no-files-4573.test.ts +388 -0
  770. package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +9 -3
  771. package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +230 -0
  772. package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +205 -0
  773. package/src/resources/extensions/gsd/tests/schema-v21-sequence.test.ts +413 -0
  774. package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +32 -40
  775. package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +56 -0
  776. package/src/resources/extensions/gsd/tests/token-counter.test.ts +105 -1
  777. package/src/resources/extensions/gsd/tests/tool-compatibility.test.ts +107 -0
  778. package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +23 -0
  779. package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +127 -5
  780. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +65 -2
  781. package/src/resources/extensions/gsd/tests/worktree-db.test.ts +35 -0
  782. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +6 -1
  783. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +78 -5
  784. package/src/resources/extensions/gsd/tests/write-gate.test.ts +64 -0
  785. package/src/resources/extensions/gsd/token-counter.ts +22 -5
  786. package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
  787. package/src/resources/extensions/gsd/uok/plan-v2.ts +26 -3
  788. package/src/resources/extensions/gsd/workflow-logger.ts +2 -1
  789. package/src/resources/extensions/gsd/worktree-resolver.ts +54 -9
  790. package/src/resources/extensions/mcp-client/index.ts +1 -1
  791. package/src/resources/extensions/ollama/index.ts +3 -3
  792. package/src/resources/extensions/ollama/ollama-chat-provider.ts +6 -18
  793. package/src/resources/extensions/remote-questions/config.ts +15 -4
  794. package/src/resources/extensions/search-the-web/index.ts +2 -1
  795. package/src/resources/extensions/shared/tests/format-utils.test.ts +5 -3
  796. package/src/resources/extensions/universal-config/index.ts +1 -1
  797. package/src/resources/skills/verify-before-complete/SKILL.md +2 -1
  798. package/src/resources/skills/write-docs/SKILL.md +2 -1
  799. package/dist/web/standalone/.next/static/chunks/2826.e59e8578e2e28639.js +0 -9
  800. package/packages/native/tsconfig.tsbuildinfo +0 -1
  801. /package/dist/web/standalone/.next/static/{n21VtX2hZlkpdEUO_nU4z → gy6_foLMsEzdGBT19c3hr}/_buildManifest.js +0 -0
  802. /package/dist/web/standalone/.next/static/{n21VtX2hZlkpdEUO_nU4z → gy6_foLMsEzdGBT19c3hr}/_ssgManifest.js +0 -0
@@ -0,0 +1,1157 @@
1
+ import {
2
+ Box,
3
+ Container,
4
+ getCapabilities,
5
+ Image,
6
+ type ImageDimensions,
7
+ imageFallback,
8
+ Spacer,
9
+ Text,
10
+ type TUI,
11
+ truncateToWidth,
12
+ } from "@gsd/pi-tui";
13
+ import stripAnsi from "strip-ansi";
14
+ import type { ToolDefinition } from "@gsd/agent-types";
15
+ import type { EditDiffError, EditDiffResult } from "@gsd/agent-types";
16
+ import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize } from "@gsd/pi-coding-agent";
17
+ import { getLanguageFromPath, highlightCode } from "@gsd/pi-coding-agent";
18
+ import { allTools, computeEditDiff, convertToPng, sanitizeBinaryOutput } from "../../../pi-coding-agent-compat.js";
19
+ import { theme } from "../../../theme.js";
20
+ import { shortenPath } from "../utils/shorten-path.js";
21
+ import { renderDiff } from "./diff.js";
22
+ import { keyHint } from "./keybinding-hints.js";
23
+ import { truncateToVisualLines } from "./visual-truncate.js";
24
+
25
+ // Preview line limit for bash when not expanded
26
+ const BASH_PREVIEW_LINES = 5;
27
+ // During partial write tool-call streaming, re-highlight the first N lines fully
28
+ // to keep multiline tokenization mostly correct without re-highlighting the full file.
29
+ const WRITE_PARTIAL_FULL_HIGHLIGHT_LINES = 50;
30
+
31
+ /**
32
+ * Replace tabs with spaces for consistent rendering
33
+ */
34
+ function replaceTabs(text: string): string {
35
+ return text.replace(/\t/g, " ");
36
+ }
37
+
38
+ /**
39
+ * Normalize control characters for terminal preview rendering.
40
+ * Keep tool arguments unchanged, sanitize only display text.
41
+ */
42
+ function normalizeDisplayText(text: string): string {
43
+ return text.replace(/\r/g, "");
44
+ }
45
+
46
+ /** Safely coerce value to string for display. Returns null if invalid type. */
47
+ function str(value: unknown): string | null {
48
+ if (typeof value === "string") return value;
49
+ if (value == null) return "";
50
+ return null; // Invalid type
51
+ }
52
+
53
+ /**
54
+ * Split a Claude Code MCP tool name (`mcp__<server>__<tool>`) into its parts.
55
+ * Returns null for non-prefixed names. Duplicated from the claude-code-cli
56
+ * extension (parseMcpToolName) so this package doesn't have to import across
57
+ * the resources/extensions boundary.
58
+ */
59
+ function parseMcpToolName(name: string): { server: string; tool: string } | null {
60
+ if (!name.startsWith("mcp__")) return null;
61
+ const rest = name.slice("mcp__".length);
62
+ const delim = rest.indexOf("__");
63
+ if (delim <= 0 || delim === rest.length - 2) return null;
64
+ return { server: rest.slice(0, delim), tool: rest.slice(delim + 2) };
65
+ }
66
+
67
+ const COMPACT_ARG_VALUE_LIMIT = 60;
68
+ const GENERIC_OUTPUT_PREVIEW_LINES = 10;
69
+ const GENERIC_ARGS_JSON_PREVIEW_LINES = 10;
70
+
71
+ /**
72
+ * Format tool args for the generic-renderer fallback. Produces a one-line
73
+ * `k=v, k=v` summary when every value is a primitive that fits inline; falls
74
+ * back to a truncated JSON dump for structurally complex args.
75
+ */
76
+ function formatCompactArgs(args: unknown, expanded: boolean): string {
77
+ if (args == null) return "";
78
+ if (typeof args !== "object") return String(args);
79
+
80
+ const entries = Object.entries(args as Record<string, unknown>);
81
+ if (entries.length === 0) return "";
82
+
83
+ const allPrimitive = entries.every(([, value]) => {
84
+ const t = typeof value;
85
+ if (t === "number" || t === "boolean") return true;
86
+ if (t === "string") return (value as string).length <= COMPACT_ARG_VALUE_LIMIT;
87
+ return value == null;
88
+ });
89
+
90
+ if (allPrimitive) {
91
+ return entries
92
+ .map(([key, value]) => {
93
+ if (typeof value === "string") return `${key}=${JSON.stringify(value)}`;
94
+ if (value == null) return `${key}=null`;
95
+ return `${key}=${String(value)}`;
96
+ })
97
+ .join(", ");
98
+ }
99
+
100
+ // Complex args: show truncated JSON.
101
+ const lines = JSON.stringify(args, null, 2).split("\n");
102
+ const maxLines = expanded ? lines.length : GENERIC_ARGS_JSON_PREVIEW_LINES;
103
+ if (lines.length <= maxLines) return lines.join("\n");
104
+ return lines.slice(0, maxLines).join("\n") + "\n...";
105
+ }
106
+
107
+ export interface ToolExecutionOptions {
108
+ showImages?: boolean; // default: true (only used if terminal supports images)
109
+ }
110
+
111
+ type WriteHighlightCache = {
112
+ rawPath: string | null;
113
+ lang: string;
114
+ rawContent: string;
115
+ normalizedLines: string[];
116
+ highlightedLines: string[];
117
+ };
118
+
119
+ type ToolTruncationDetails = {
120
+ truncated?: boolean;
121
+ truncatedBy?: string;
122
+ outputLines?: number;
123
+ totalLines?: number;
124
+ maxBytes?: number;
125
+ maxLines?: number;
126
+ firstLineExceedsLimit?: boolean;
127
+ };
128
+
129
+ type ToolResultDetails = {
130
+ truncation?: ToolTruncationDetails;
131
+ fullOutputPath?: string;
132
+ firstChangedLine?: number;
133
+ diff?: string;
134
+ entryLimitReached?: number;
135
+ resultLimitReached?: number;
136
+ matchLimitReached?: number;
137
+ linesTruncated?: boolean;
138
+ [key: string]: unknown;
139
+ };
140
+
141
+ /**
142
+ * Component that renders a tool call with its result (updateable)
143
+ */
144
+ export class ToolExecutionComponent extends Container {
145
+ private contentBox: Box; // Used for custom tools and bash visual truncation
146
+ private contentText: Text; // For built-in tools (with its own padding/bg)
147
+ private imageComponents: Image[] = [];
148
+ private imageSpacers: Spacer[] = [];
149
+ private toolName: string;
150
+ private args: Record<string, unknown>;
151
+ private expanded = false;
152
+ private showImages: boolean;
153
+ private isPartial = true;
154
+ private toolDefinition?: ToolDefinition;
155
+ private ui: TUI;
156
+ private cwd: string;
157
+ private result?: {
158
+ content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;
159
+ isError: boolean;
160
+ details?: ToolResultDetails;
161
+ };
162
+ // Cached edit diff preview (computed when args arrive, before tool executes)
163
+ private editDiffPreview?: EditDiffResult | EditDiffError;
164
+ private editDiffArgsKey?: string; // Track which args the preview is for
165
+ // Cached converted images for Kitty protocol (which requires PNG), keyed by index
166
+ private convertedImages: Map<number, { data: string; mimeType: string }> = new Map();
167
+ // Cached resolved image dimensions to avoid re-triggering async parsing
168
+ // when updateDisplay() recreates Image components (#3455).
169
+ private resolvedImageDimensions: Map<number, ImageDimensions> = new Map();
170
+ // Incremental syntax highlighting cache for write tool call args
171
+ private writeHighlightCache?: WriteHighlightCache;
172
+ // When true, this component intentionally renders no lines
173
+ private hideComponent = false;
174
+
175
+ private get normalizedToolName(): string {
176
+ return typeof this.toolName === "string" ? this.toolName.toLowerCase() : "";
177
+ }
178
+
179
+ constructor(
180
+ toolName: string,
181
+ args: Record<string, unknown>,
182
+ options: ToolExecutionOptions = {},
183
+ toolDefinition: ToolDefinition | undefined,
184
+ ui: TUI,
185
+ cwd: string = process.cwd(),
186
+ ) {
187
+ super();
188
+ this.toolName = toolName;
189
+ this.args = args;
190
+ this.showImages = options.showImages ?? true;
191
+ this.toolDefinition = toolDefinition;
192
+ this.ui = ui;
193
+ this.cwd = cwd;
194
+
195
+ this.addChild(new Spacer(1));
196
+
197
+ // Always create both - contentBox for custom tools/bash, contentText for other built-ins
198
+ this.contentBox = new Box(1, 1, (text: string) => theme.bg("toolPendingBg", text));
199
+ this.contentText = new Text("", 1, 1, (text: string) => theme.bg("toolPendingBg", text));
200
+
201
+ // Use contentBox for bash (visual truncation) or custom tools with custom renderers
202
+ // Use contentText for built-in tools (including overrides without custom renderers)
203
+ if (this.normalizedToolName === "bash" || (toolDefinition && !this.shouldUseBuiltInRenderer())) {
204
+ this.addChild(this.contentBox);
205
+ } else {
206
+ this.addChild(this.contentText);
207
+ }
208
+
209
+ this.updateDisplay();
210
+ }
211
+
212
+ /**
213
+ * Check if we should use built-in rendering for this tool.
214
+ * Returns true if the tool name is a built-in AND either there's no toolDefinition
215
+ * or the toolDefinition doesn't provide custom renderers.
216
+ */
217
+ private shouldUseBuiltInRenderer(): boolean {
218
+ const normalizedToolName = this.normalizedToolName;
219
+ const isBuiltInName = normalizedToolName in allTools;
220
+ const hasCustomRenderers = this.toolDefinition?.renderCall || this.toolDefinition?.renderResult;
221
+ return isBuiltInName && !hasCustomRenderers;
222
+ }
223
+
224
+ dispose(): void {
225
+ this.convertedImages.clear();
226
+ this.imageComponents = [];
227
+ this.imageSpacers = [];
228
+ this.editDiffPreview = undefined;
229
+ this.writeHighlightCache = undefined;
230
+ this.result = undefined;
231
+ }
232
+
233
+ updateArgs(args: Record<string, unknown>): void {
234
+ this.args = args;
235
+ if (this.normalizedToolName === "write" && this.isPartial) {
236
+ this.updateWriteHighlightCacheIncremental();
237
+ }
238
+ this.updateDisplay();
239
+ }
240
+
241
+ private highlightSingleLine(line: string, lang: string): string {
242
+ const highlighted = highlightCode(line, lang);
243
+ return highlighted[0] ?? "";
244
+ }
245
+
246
+ private refreshWriteHighlightPrefix(cache: WriteHighlightCache): void {
247
+ const prefixCount = Math.min(WRITE_PARTIAL_FULL_HIGHLIGHT_LINES, cache.normalizedLines.length);
248
+ if (prefixCount === 0) return;
249
+
250
+ const prefixSource = cache.normalizedLines.slice(0, prefixCount).join("\n");
251
+ const prefixHighlighted = highlightCode(prefixSource, cache.lang);
252
+ for (let i = 0; i < prefixCount; i++) {
253
+ cache.highlightedLines[i] =
254
+ prefixHighlighted[i] ?? this.highlightSingleLine(cache.normalizedLines[i] ?? "", cache.lang);
255
+ }
256
+ }
257
+
258
+ private rebuildWriteHighlightCacheFull(rawPath: string | null, fileContent: string): void {
259
+ const lang = rawPath ? getLanguageFromPath(rawPath) : undefined;
260
+ if (!lang) {
261
+ this.writeHighlightCache = undefined;
262
+ return;
263
+ }
264
+
265
+ const displayContent = normalizeDisplayText(fileContent);
266
+ const normalized = replaceTabs(displayContent);
267
+ this.writeHighlightCache = {
268
+ rawPath,
269
+ lang,
270
+ rawContent: fileContent,
271
+ normalizedLines: normalized.split("\n"),
272
+ highlightedLines: highlightCode(normalized, lang),
273
+ };
274
+ }
275
+
276
+ private updateWriteHighlightCacheIncremental(): void {
277
+ const rawPath = str(this.args?.file_path ?? this.args?.path);
278
+ const fileContent = str(this.args?.content);
279
+ if (rawPath === null || fileContent === null) {
280
+ this.writeHighlightCache = undefined;
281
+ return;
282
+ }
283
+
284
+ const lang = rawPath ? getLanguageFromPath(rawPath) : undefined;
285
+ if (!lang) {
286
+ this.writeHighlightCache = undefined;
287
+ return;
288
+ }
289
+
290
+ if (!this.writeHighlightCache) {
291
+ this.rebuildWriteHighlightCacheFull(rawPath, fileContent);
292
+ return;
293
+ }
294
+
295
+ const cache = this.writeHighlightCache;
296
+ if (cache.lang !== lang || cache.rawPath !== rawPath) {
297
+ this.rebuildWriteHighlightCacheFull(rawPath, fileContent);
298
+ return;
299
+ }
300
+
301
+ if (!fileContent.startsWith(cache.rawContent)) {
302
+ this.rebuildWriteHighlightCacheFull(rawPath, fileContent);
303
+ return;
304
+ }
305
+
306
+ if (fileContent.length === cache.rawContent.length) {
307
+ return;
308
+ }
309
+
310
+ const deltaRaw = fileContent.slice(cache.rawContent.length);
311
+ const deltaDisplay = normalizeDisplayText(deltaRaw);
312
+ const deltaNormalized = replaceTabs(deltaDisplay);
313
+ cache.rawContent = fileContent;
314
+
315
+ if (cache.normalizedLines.length === 0) {
316
+ cache.normalizedLines.push("");
317
+ cache.highlightedLines.push("");
318
+ }
319
+
320
+ const segments = deltaNormalized.split("\n");
321
+ const lastIndex = cache.normalizedLines.length - 1;
322
+ cache.normalizedLines[lastIndex] += segments[0];
323
+ cache.highlightedLines[lastIndex] = this.highlightSingleLine(cache.normalizedLines[lastIndex], cache.lang);
324
+
325
+ for (let i = 1; i < segments.length; i++) {
326
+ cache.normalizedLines.push(segments[i]);
327
+ cache.highlightedLines.push(this.highlightSingleLine(segments[i], cache.lang));
328
+ }
329
+
330
+ this.refreshWriteHighlightPrefix(cache);
331
+ }
332
+
333
+ /**
334
+ * Signal that args are complete (tool is about to execute).
335
+ * This triggers diff computation for edit tool.
336
+ */
337
+ setArgsComplete(): void {
338
+ if (this.toolName === "write") {
339
+ const rawPath = str(this.args?.file_path ?? this.args?.path);
340
+ const fileContent = str(this.args?.content);
341
+ if (rawPath !== null && fileContent !== null) {
342
+ this.rebuildWriteHighlightCacheFull(rawPath, fileContent);
343
+ }
344
+ }
345
+ this.maybeComputeEditDiff();
346
+ }
347
+
348
+ /**
349
+ * Compute edit diff preview when we have complete args.
350
+ * This runs async and updates display when done.
351
+ * Handles both single-edit format (oldText/newText) and multi-edit format (edits[]).
352
+ */
353
+ private maybeComputeEditDiff(): void {
354
+ if (this.toolName !== "edit") return;
355
+
356
+ const path = str(this.args?.path);
357
+
358
+ if (!path) return;
359
+
360
+ const oldText = this.args?.oldText;
361
+ const newText = this.args?.newText;
362
+ const edits = this.args?.edits;
363
+
364
+ if (typeof oldText === "string" && typeof newText === "string") {
365
+ // Single-edit path: oldText + newText at top level
366
+ const argsKey = JSON.stringify({ path, oldText, newText });
367
+ if (this.editDiffArgsKey === argsKey) return;
368
+ this.editDiffArgsKey = argsKey;
369
+
370
+ computeEditDiff(path, oldText, newText, this.cwd).then((result) => {
371
+ if (this.editDiffArgsKey === argsKey) {
372
+ this.editDiffPreview = result;
373
+ this.updateDisplay();
374
+ this.ui.requestRender();
375
+ }
376
+ });
377
+ } else if (Array.isArray(edits)) {
378
+ // Multi-edit path: edits[] array format
379
+ // Validate each element has oldText and newText strings before passing to computeEditDiff
380
+ const firstValidEdit = edits.find(
381
+ (e): e is { oldText: string; newText: string } =>
382
+ e !== null &&
383
+ typeof e === "object" &&
384
+ typeof e.oldText === "string" &&
385
+ typeof e.newText === "string",
386
+ );
387
+ if (!firstValidEdit) return;
388
+
389
+ const argsKey = JSON.stringify({ path, edits });
390
+ if (this.editDiffArgsKey === argsKey) return;
391
+ this.editDiffArgsKey = argsKey;
392
+
393
+ // Preview the first edit; subsequent edits will be reflected in the post-execution diff
394
+ computeEditDiff(path, firstValidEdit.oldText, firstValidEdit.newText, this.cwd).then((result) => {
395
+ if (this.editDiffArgsKey === argsKey) {
396
+ this.editDiffPreview = result;
397
+ this.updateDisplay();
398
+ this.ui.requestRender();
399
+ }
400
+ });
401
+ }
402
+ }
403
+
404
+ updateResult(
405
+ result: {
406
+ content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;
407
+ details?: ToolResultDetails;
408
+ isError: boolean;
409
+ },
410
+ isPartial = false,
411
+ ): void {
412
+ this.result = result;
413
+ this.isPartial = isPartial;
414
+ if (this.normalizedToolName === "write" && !isPartial) {
415
+ const rawPath = str(this.args?.file_path ?? this.args?.path);
416
+ const fileContent = str(this.args?.content);
417
+ if (rawPath !== null && fileContent !== null) {
418
+ this.rebuildWriteHighlightCacheFull(rawPath, fileContent);
419
+ }
420
+ }
421
+ this.updateDisplay();
422
+ // Convert non-PNG images to PNG for Kitty protocol (async)
423
+ this.maybeConvertImagesForKitty();
424
+ }
425
+
426
+ /**
427
+ * Mark a pending tool call as finished with no result (e.g., squashed by compaction).
428
+ * Stops the "Running" indicator without providing a result.
429
+ */
430
+ markHistoricalNoResult(): void {
431
+ this.isPartial = false;
432
+ this.updateDisplay();
433
+ }
434
+
435
+ /**
436
+ * Finalize a pending tool call as failed/interrupted while preserving any streamed partial output.
437
+ */
438
+ completeWithError(message?: string): void {
439
+ this.isPartial = false;
440
+ if (this.result) {
441
+ let content = this.result.content;
442
+ if (message) {
443
+ const alreadyHasMessage = content.some((block) => block.type === "text" && block.text === message);
444
+ if (!alreadyHasMessage) {
445
+ content = [...content, { type: "text", text: message }];
446
+ }
447
+ }
448
+ this.result = { ...this.result, content, isError: true };
449
+ } else {
450
+ this.result = {
451
+ content: message ? [{ type: "text", text: message }] : [],
452
+ isError: true,
453
+ };
454
+ }
455
+ this.updateDisplay();
456
+ }
457
+
458
+ /**
459
+ * Convert non-PNG images to PNG for Kitty graphics protocol.
460
+ * Kitty requires PNG format (f=100), so JPEG/GIF/WebP won't display.
461
+ */
462
+ private maybeConvertImagesForKitty(): void {
463
+ const caps = getCapabilities();
464
+ // Only needed for Kitty protocol
465
+ if (caps.images !== "kitty") return;
466
+ if (!this.result) return;
467
+
468
+ const imageBlocks = this.result.content?.filter((c) => c.type === "image") || [];
469
+
470
+ for (let i = 0; i < imageBlocks.length; i++) {
471
+ const img = imageBlocks[i];
472
+ if (!img.data || !img.mimeType) continue;
473
+ // Skip if already PNG or already converted
474
+ if (img.mimeType === "image/png") continue;
475
+ if (this.convertedImages.has(i)) continue;
476
+
477
+ // Convert async
478
+ const index = i;
479
+ convertToPng(img.data, img.mimeType).then((converted) => {
480
+ if (converted) {
481
+ this.convertedImages.set(index, converted);
482
+ this.updateDisplay();
483
+ this.ui.requestRender();
484
+ }
485
+ });
486
+ }
487
+ }
488
+
489
+ setExpanded(expanded: boolean): void {
490
+ this.expanded = expanded;
491
+ this.updateDisplay();
492
+ }
493
+
494
+ setShowImages(show: boolean): void {
495
+ this.showImages = show;
496
+ this.updateDisplay();
497
+ }
498
+
499
+ override invalidate(): void {
500
+ super.invalidate();
501
+ this.updateDisplay();
502
+ }
503
+
504
+ override render(width: number): string[] {
505
+ if (this.hideComponent) {
506
+ return [];
507
+ }
508
+ return super.render(width);
509
+ }
510
+
511
+ private updateDisplay(): void {
512
+ // Set background based on state
513
+ const bgFn = this.isPartial
514
+ ? (text: string) => theme.bg("toolPendingBg", text)
515
+ : this.result?.isError
516
+ ? (text: string) => theme.bg("toolErrorBg", text)
517
+ : (text: string) => theme.bg("toolSuccessBg", text);
518
+
519
+ const useBuiltInRenderer = this.shouldUseBuiltInRenderer();
520
+ let customRendererHasContent = false;
521
+ this.hideComponent = false;
522
+
523
+ // Use built-in rendering for built-in tools (or overrides without custom renderers)
524
+ if (useBuiltInRenderer) {
525
+ if (this.normalizedToolName === "bash") {
526
+ // Bash uses Box with visual line truncation
527
+ this.contentBox.setBgFn(bgFn);
528
+ this.contentBox.clear();
529
+ this.renderBashContent();
530
+ } else {
531
+ // Other built-in tools: use Text directly with caching
532
+ this.contentText.setCustomBgFn(bgFn);
533
+ this.contentText.setText(this.formatToolExecution());
534
+ }
535
+ } else if (this.toolDefinition) {
536
+ // Custom tools use Box for flexible component rendering
537
+ this.contentBox.setBgFn(bgFn);
538
+ this.contentBox.clear();
539
+
540
+ // Render call component
541
+ if (this.toolDefinition.renderCall) {
542
+ try {
543
+ const renderContext = {
544
+ args: this.args,
545
+ toolCallId: "",
546
+ invalidate: () => this.updateDisplay(),
547
+ lastComponent: undefined,
548
+ state: undefined,
549
+ cwd: this.cwd,
550
+ executionStarted: !this.isPartial,
551
+ argsComplete: true,
552
+ isPartial: this.isPartial,
553
+ expanded: this.expanded,
554
+ showImages: this.showImages,
555
+ isError: this.result?.isError ?? false,
556
+ };
557
+ // vendor-seam: dual-module-path -- ToolDefinition.renderCall signature diverges between pi dist and GSD usage
558
+ const callComponent = (this.toolDefinition.renderCall as unknown as (...a: unknown[]) => Container | undefined)(this.args, theme, renderContext);
559
+ if (callComponent !== undefined) {
560
+ this.contentBox.addChild(callComponent);
561
+ customRendererHasContent = true;
562
+ }
563
+ } catch {
564
+ // Fall back to default on error
565
+ this.contentBox.addChild(new Text(theme.fg("toolTitle", theme.bold(this.toolName)), 0, 0));
566
+ customRendererHasContent = true;
567
+ }
568
+ } else {
569
+ // No custom renderCall, show tool name
570
+ this.contentBox.addChild(new Text(theme.fg("toolTitle", theme.bold(this.toolName)), 0, 0));
571
+ customRendererHasContent = true;
572
+ }
573
+
574
+ // Render result component if we have a result
575
+ if (this.result && this.toolDefinition.renderResult) {
576
+ try {
577
+ const renderContext = {
578
+ args: this.args,
579
+ toolCallId: "",
580
+ invalidate: () => this.updateDisplay(),
581
+ lastComponent: undefined,
582
+ state: undefined,
583
+ cwd: this.cwd,
584
+ executionStarted: true,
585
+ argsComplete: true,
586
+ isPartial: this.isPartial,
587
+ expanded: this.expanded,
588
+ showImages: this.showImages,
589
+ isError: this.result.isError,
590
+ };
591
+ // vendor-seam: dual-module-path -- ToolDefinition.renderResult signature diverges between pi dist and GSD usage
592
+ const resultComponent = (this.toolDefinition.renderResult as unknown as (...a: unknown[]) => Container | undefined)(
593
+ { content: this.result.content, details: this.result.details },
594
+ { expanded: this.expanded, isPartial: this.isPartial },
595
+ theme,
596
+ renderContext,
597
+ );
598
+ if (resultComponent !== undefined) {
599
+ this.contentBox.addChild(resultComponent);
600
+ customRendererHasContent = true;
601
+ }
602
+ } catch {
603
+ // Fall back to showing raw output on error
604
+ const output = this.getTextOutput();
605
+ if (output) {
606
+ this.contentBox.addChild(new Text(theme.fg("toolOutput", output), 0, 0));
607
+ customRendererHasContent = true;
608
+ }
609
+ }
610
+ } else if (this.result) {
611
+ // Has result but no custom renderResult
612
+ const output = this.getTextOutput();
613
+ if (output) {
614
+ this.contentBox.addChild(new Text(theme.fg("toolOutput", output), 0, 0));
615
+ customRendererHasContent = true;
616
+ }
617
+ }
618
+ } else {
619
+ // Unknown tool with no registered definition - show generic fallback
620
+ this.contentText.setCustomBgFn(bgFn);
621
+ this.contentText.setText(this.formatToolExecution());
622
+ }
623
+
624
+ // Handle images (same for both custom and built-in)
625
+ for (const img of this.imageComponents) {
626
+ this.removeChild(img);
627
+ }
628
+ this.imageComponents = [];
629
+ for (const spacer of this.imageSpacers) {
630
+ this.removeChild(spacer);
631
+ }
632
+ this.imageSpacers = [];
633
+
634
+ if (this.result) {
635
+ const imageBlocks = this.result.content?.filter((c) => c.type === "image") || [];
636
+ const caps = getCapabilities();
637
+
638
+ for (let i = 0; i < imageBlocks.length; i++) {
639
+ const img = imageBlocks[i];
640
+ if (caps.images && this.showImages && img.data && img.mimeType) {
641
+ // Use converted PNG for Kitty protocol if available
642
+ const converted = this.convertedImages.get(i);
643
+ const imageData = converted?.data ?? img.data;
644
+ const imageMimeType = converted?.mimeType ?? img.mimeType;
645
+
646
+ // For Kitty, skip non-PNG images that haven't been converted yet
647
+ if (caps.images === "kitty" && imageMimeType !== "image/png") {
648
+ continue;
649
+ }
650
+
651
+ const spacer = new Spacer(1);
652
+ this.addChild(spacer);
653
+ this.imageSpacers.push(spacer);
654
+ // Pass cached dimensions to avoid re-triggering async parsing
655
+ // when updateDisplay() recreates Image components (#3455).
656
+ const cachedDims = this.resolvedImageDimensions.get(i);
657
+ const imageComponent = new Image(
658
+ imageData,
659
+ imageMimeType,
660
+ { fallbackColor: (s: string) => theme.fg("toolOutput", s) },
661
+ { maxWidthCells: 60 },
662
+ cachedDims,
663
+ );
664
+ // setOnDimensionsResolved/getDimensions removed in pi-tui 0.67.2 —
665
+ // dimensions are passed to the Image constructor and resolved synchronously.
666
+ this.imageComponents.push(imageComponent);
667
+ this.addChild(imageComponent);
668
+ }
669
+ }
670
+ }
671
+
672
+ if (!useBuiltInRenderer && this.toolDefinition) {
673
+ this.hideComponent = !customRendererHasContent && this.imageComponents.length === 0;
674
+ }
675
+ }
676
+
677
+ /**
678
+ * Render bash content using visual line truncation (like bash-execution.ts)
679
+ */
680
+ private renderBashContent(): void {
681
+ const command = str(this.args?.command);
682
+ const timeout = this.args?.timeout as number | undefined;
683
+
684
+ // Header
685
+ const timeoutSuffix = timeout ? theme.fg("muted", ` (timeout ${timeout}s)`) : "";
686
+ const commandDisplay =
687
+ command === null ? theme.fg("error", "[invalid arg]") : command ? command : theme.fg("toolOutput", "...");
688
+ this.contentBox.addChild(
689
+ new Text(theme.fg("toolTitle", theme.bold(`$ ${commandDisplay}`)) + timeoutSuffix, 0, 0),
690
+ );
691
+
692
+ if (this.result) {
693
+ const output = this.getTextOutput().trim();
694
+
695
+ if (output) {
696
+ // Style each line for the output
697
+ const styledOutput = output
698
+ .split("\n")
699
+ .map((line) => theme.fg("toolOutput", line))
700
+ .join("\n");
701
+
702
+ if (this.expanded) {
703
+ // Show all lines when expanded
704
+ this.contentBox.addChild(new Text(`\n${styledOutput}`, 0, 0));
705
+ } else {
706
+ // Use visual line truncation when collapsed with width-aware caching
707
+ let cachedWidth: number | undefined;
708
+ let cachedLines: string[] | undefined;
709
+ let cachedSkipped: number | undefined;
710
+
711
+ this.contentBox.addChild({
712
+ render: (width: number) => {
713
+ if (cachedLines === undefined || cachedWidth !== width) {
714
+ const result = truncateToVisualLines(styledOutput, BASH_PREVIEW_LINES, width);
715
+ cachedLines = result.visualLines;
716
+ cachedSkipped = result.skippedCount;
717
+ cachedWidth = width;
718
+ }
719
+ if (cachedSkipped && cachedSkipped > 0) {
720
+ const hint =
721
+ theme.fg("muted", `... (${cachedSkipped} earlier lines,`) +
722
+ ` ${keyHint("expandTools", "to expand")})`;
723
+ return ["", truncateToWidth(hint, width, "..."), ...cachedLines];
724
+ }
725
+ // Add blank line for spacing (matches expanded case)
726
+ return ["", ...cachedLines];
727
+ },
728
+ invalidate: () => {
729
+ cachedWidth = undefined;
730
+ cachedLines = undefined;
731
+ cachedSkipped = undefined;
732
+ },
733
+ });
734
+ }
735
+ }
736
+
737
+ // Truncation warnings
738
+ const truncation = this.result.details?.truncation;
739
+ const fullOutputPath = this.result.details?.fullOutputPath;
740
+ if (truncation?.truncated || fullOutputPath) {
741
+ const warnings: string[] = [];
742
+ if (fullOutputPath) {
743
+ warnings.push(`Full output: ${fullOutputPath}`);
744
+ }
745
+ if (truncation?.truncated) {
746
+ if (truncation.truncatedBy === "lines") {
747
+ warnings.push(`Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines`);
748
+ } else {
749
+ warnings.push(
750
+ `Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)`,
751
+ );
752
+ }
753
+ }
754
+ this.contentBox.addChild(new Text(`\n${theme.fg("warning", `[${warnings.join(". ")}]`)}`, 0, 0));
755
+ }
756
+ }
757
+ }
758
+
759
+ private getTextOutput(): string {
760
+ if (!this.result) return "";
761
+
762
+ const textBlocks = this.result.content?.filter((c) => c.type === "text") || [];
763
+ const imageBlocks = this.result.content?.filter((c) => c.type === "image") || [];
764
+
765
+ let output = textBlocks
766
+ .map((c) => {
767
+ // Use sanitizeBinaryOutput to handle binary data that crashes string-width
768
+ return sanitizeBinaryOutput(stripAnsi(c.text || "")).replace(/\r/g, "");
769
+ })
770
+ .join("\n");
771
+
772
+ const caps = getCapabilities();
773
+ if (imageBlocks.length > 0 && (!caps.images || !this.showImages)) {
774
+ const imageIndicators = imageBlocks
775
+ .map((img) => {
776
+ return imageFallback(typeof img.mimeType === "string" ? img.mimeType : "image/unknown");
777
+ })
778
+ .join("\n");
779
+ output = output ? `${output}\n${imageIndicators}` : imageIndicators;
780
+ }
781
+
782
+ return output;
783
+ }
784
+
785
+ private formatToolExecution(): string {
786
+ let text: string;
787
+ const invalidArg = theme.fg("error", "[invalid arg]");
788
+ const normalizedToolName = this.normalizedToolName;
789
+
790
+ if (normalizedToolName === "read") {
791
+ const rawPath = str(this.args?.file_path ?? this.args?.path);
792
+ const path = rawPath !== null ? shortenPath(rawPath) : null;
793
+ const offset = typeof this.args?.offset === "number" ? this.args.offset : undefined;
794
+ const limit = typeof this.args?.limit === "number" ? this.args.limit : undefined;
795
+
796
+ let pathDisplay = path === null ? invalidArg : path ? theme.fg("accent", path) : theme.fg("toolOutput", "...");
797
+ if (offset !== undefined || limit !== undefined) {
798
+ const startLine = offset ?? 1;
799
+ const endLine = limit !== undefined ? startLine + limit - 1 : "";
800
+ pathDisplay += theme.fg("warning", `:${startLine}${endLine ? `-${endLine}` : ""}`);
801
+ }
802
+
803
+ text = `${theme.fg("toolTitle", theme.bold("read"))} ${pathDisplay}`;
804
+
805
+ if (this.result) {
806
+ if (this.result.isError) {
807
+ const errorText = this.getTextOutput().trim() || "read failed";
808
+ text += `\n\n${theme.fg("error", errorText)}`;
809
+ return text;
810
+ }
811
+
812
+ const rawOutput = this.getTextOutput();
813
+ // Strip hashline prefixes (e.g. "1#BQ:content") for TUI display
814
+ const output = rawOutput.replace(/^(\s*)\d+#[ZPMQVRWSNKTXJBYH]{2}:/gm, "$1");
815
+ const rawPath = str(this.args?.file_path ?? this.args?.path);
816
+ const lang = rawPath ? getLanguageFromPath(rawPath) : undefined;
817
+ const lines = lang ? highlightCode(replaceTabs(output), lang) : output.split("\n");
818
+
819
+ const maxLines = this.expanded ? lines.length : 10;
820
+ const displayLines = lines.slice(0, maxLines);
821
+ const remaining = lines.length - maxLines;
822
+
823
+ text +=
824
+ "\n\n" +
825
+ displayLines
826
+ .map((line: string) => (lang ? replaceTabs(line) : theme.fg("toolOutput", replaceTabs(line))))
827
+ .join("\n");
828
+ if (remaining > 0) {
829
+ text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
830
+ }
831
+
832
+ const truncation = this.result.details?.truncation;
833
+ if (truncation?.truncated) {
834
+ if (truncation.firstLineExceedsLimit) {
835
+ text +=
836
+ "\n" +
837
+ theme.fg(
838
+ "warning",
839
+ `[First line exceeds ${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit]`,
840
+ );
841
+ } else if (truncation.truncatedBy === "lines") {
842
+ text +=
843
+ "\n" +
844
+ theme.fg(
845
+ "warning",
846
+ `[Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines (${truncation.maxLines ?? DEFAULT_MAX_LINES} line limit)]`,
847
+ );
848
+ } else {
849
+ text +=
850
+ "\n" +
851
+ theme.fg(
852
+ "warning",
853
+ `[Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)]`,
854
+ );
855
+ }
856
+ }
857
+ }
858
+ } else if (normalizedToolName === "write") {
859
+ const rawPath = str(this.args?.file_path ?? this.args?.path);
860
+ const fileContent = str(this.args?.content);
861
+ const path = rawPath !== null ? shortenPath(rawPath) : null;
862
+
863
+ text =
864
+ theme.fg("toolTitle", theme.bold("write")) +
865
+ " " +
866
+ (path === null ? invalidArg : path ? theme.fg("accent", path) : theme.fg("toolOutput", "..."));
867
+
868
+ if (fileContent === null) {
869
+ text += `\n\n${theme.fg("error", "[invalid content arg - expected string]")}`;
870
+ } else if (fileContent) {
871
+ const lang = rawPath ? getLanguageFromPath(rawPath) : undefined;
872
+
873
+ let lines: string[];
874
+ if (lang) {
875
+ const cache = this.writeHighlightCache;
876
+ if (cache && cache.lang === lang && cache.rawPath === rawPath && cache.rawContent === fileContent) {
877
+ lines = cache.highlightedLines;
878
+ } else {
879
+ const displayContent = normalizeDisplayText(fileContent);
880
+ const normalized = replaceTabs(displayContent);
881
+ lines = highlightCode(normalized, lang);
882
+ this.writeHighlightCache = {
883
+ rawPath,
884
+ lang,
885
+ rawContent: fileContent,
886
+ normalizedLines: normalized.split("\n"),
887
+ highlightedLines: lines,
888
+ };
889
+ }
890
+ } else {
891
+ lines = normalizeDisplayText(fileContent).split("\n");
892
+ this.writeHighlightCache = undefined;
893
+ }
894
+
895
+ const totalLines = lines.length;
896
+ const maxLines = this.expanded ? lines.length : 10;
897
+ const displayLines = lines.slice(0, maxLines);
898
+ const remaining = lines.length - maxLines;
899
+
900
+ text +=
901
+ "\n\n" +
902
+ displayLines.map((line: string) => (lang ? line : theme.fg("toolOutput", replaceTabs(line)))).join("\n");
903
+ if (remaining > 0) {
904
+ text +=
905
+ theme.fg("muted", `\n... (${remaining} more lines, ${totalLines} total,`) +
906
+ ` ${keyHint("expandTools", "to expand")})`;
907
+ }
908
+ }
909
+
910
+ // Show error if tool execution failed
911
+ if (this.result?.isError) {
912
+ const errorText = this.getTextOutput();
913
+ if (errorText) {
914
+ text += `\n\n${theme.fg("error", errorText)}`;
915
+ }
916
+ }
917
+ } else if (normalizedToolName === "edit") {
918
+ const rawPath = str(this.args?.file_path ?? this.args?.path);
919
+ const path = rawPath !== null ? shortenPath(rawPath) : null;
920
+
921
+ // Build path display, appending :line if we have diff info
922
+ let pathDisplay = path === null ? invalidArg : path ? theme.fg("accent", path) : theme.fg("toolOutput", "...");
923
+ const firstChangedLine =
924
+ (this.editDiffPreview && "firstChangedLine" in this.editDiffPreview
925
+ ? this.editDiffPreview.firstChangedLine
926
+ : undefined) ||
927
+ (this.result && !this.result.isError ? this.result.details?.firstChangedLine : undefined);
928
+ if (firstChangedLine) {
929
+ pathDisplay += theme.fg("warning", `:${firstChangedLine}`);
930
+ }
931
+
932
+ text = `${theme.fg("toolTitle", theme.bold("edit"))} ${pathDisplay}`;
933
+
934
+ if (this.result?.isError) {
935
+ // Show error from result
936
+ const errorText = this.getTextOutput();
937
+ if (errorText) {
938
+ text += `\n\n${theme.fg("error", errorText)}`;
939
+ }
940
+ } else if (this.result?.details?.diff) {
941
+ // Tool executed successfully - use the diff from result
942
+ // This takes priority over editDiffPreview which may have a stale error
943
+ // due to race condition (async preview computed after file was modified)
944
+ text += `\n\n${renderDiff(this.result.details.diff, { filePath: rawPath ?? undefined })}`;
945
+ } else if (this.editDiffPreview) {
946
+ // Use cached diff preview (before tool executes)
947
+ if ("error" in this.editDiffPreview) {
948
+ text += `\n\n${theme.fg("error", this.editDiffPreview.error)}`;
949
+ } else if (this.editDiffPreview.diff) {
950
+ text += `\n\n${renderDiff(this.editDiffPreview.diff, { filePath: rawPath ?? undefined })}`;
951
+ }
952
+ }
953
+ } else if (normalizedToolName === "ls") {
954
+ const rawPath = str(this.args?.path);
955
+ const path = rawPath !== null ? shortenPath(rawPath || ".") : null;
956
+ const limit = this.args?.limit;
957
+
958
+ text = `${theme.fg("toolTitle", theme.bold("ls"))} ${path === null ? invalidArg : theme.fg("accent", path)}`;
959
+ if (limit !== undefined) {
960
+ text += theme.fg("toolOutput", ` (limit ${limit})`);
961
+ }
962
+
963
+ if (this.result) {
964
+ if (this.result.isError) {
965
+ const errorText = this.getTextOutput().trim() || "ls failed";
966
+ text += `\n\n${theme.fg("error", errorText)}`;
967
+ return text;
968
+ }
969
+
970
+ const output = this.getTextOutput().trim();
971
+ if (output) {
972
+ const lines = output.split("\n");
973
+ const maxLines = this.expanded ? lines.length : 20;
974
+ const displayLines = lines.slice(0, maxLines);
975
+ const remaining = lines.length - maxLines;
976
+
977
+ text += `\n\n${displayLines.map((line: string) => theme.fg("toolOutput", line)).join("\n")}`;
978
+ if (remaining > 0) {
979
+ text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
980
+ }
981
+ }
982
+
983
+ const entryLimit = this.result.details?.entryLimitReached;
984
+ const truncation = this.result.details?.truncation;
985
+ if (entryLimit || truncation?.truncated) {
986
+ const warnings: string[] = [];
987
+ if (entryLimit) {
988
+ warnings.push(`${entryLimit} entries limit`);
989
+ }
990
+ if (truncation?.truncated) {
991
+ warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
992
+ }
993
+ text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
994
+ }
995
+ }
996
+ } else if (normalizedToolName === "find") {
997
+ const pattern = str(this.args?.pattern);
998
+ const rawPath = str(this.args?.path);
999
+ const path = rawPath !== null ? shortenPath(rawPath || ".") : null;
1000
+ const limit = this.args?.limit;
1001
+
1002
+ text =
1003
+ theme.fg("toolTitle", theme.bold("find")) +
1004
+ " " +
1005
+ (pattern === null ? invalidArg : theme.fg("accent", pattern || "")) +
1006
+ theme.fg("toolOutput", ` in ${path === null ? invalidArg : path}`);
1007
+ if (limit !== undefined) {
1008
+ text += theme.fg("toolOutput", ` (limit ${limit})`);
1009
+ }
1010
+
1011
+ if (this.result) {
1012
+ if (this.result.isError) {
1013
+ const errorText = this.getTextOutput().trim() || "find failed";
1014
+ text += `\n\n${theme.fg("error", errorText)}`;
1015
+ return text;
1016
+ }
1017
+
1018
+ const output = this.getTextOutput().trim();
1019
+ if (output) {
1020
+ const lines = output.split("\n");
1021
+ const maxLines = this.expanded ? lines.length : 20;
1022
+ const displayLines = lines.slice(0, maxLines);
1023
+ const remaining = lines.length - maxLines;
1024
+
1025
+ text += `\n\n${displayLines.map((line: string) => theme.fg("toolOutput", line)).join("\n")}`;
1026
+ if (remaining > 0) {
1027
+ text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
1028
+ }
1029
+ }
1030
+
1031
+ const resultLimit = this.result.details?.resultLimitReached;
1032
+ const truncation = this.result.details?.truncation;
1033
+ if (resultLimit || truncation?.truncated) {
1034
+ const warnings: string[] = [];
1035
+ if (resultLimit) {
1036
+ warnings.push(`${resultLimit} results limit`);
1037
+ }
1038
+ if (truncation?.truncated) {
1039
+ warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
1040
+ }
1041
+ text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
1042
+ }
1043
+ }
1044
+ } else if (normalizedToolName === "grep") {
1045
+ const pattern = str(this.args?.pattern);
1046
+ const rawPath = str(this.args?.path);
1047
+ const path = rawPath !== null ? shortenPath(rawPath || ".") : null;
1048
+ const glob = str(this.args?.glob);
1049
+ const limit = this.args?.limit;
1050
+
1051
+ text =
1052
+ theme.fg("toolTitle", theme.bold("grep")) +
1053
+ " " +
1054
+ (pattern === null ? invalidArg : theme.fg("accent", `/${pattern || ""}/`)) +
1055
+ theme.fg("toolOutput", ` in ${path === null ? invalidArg : path}`);
1056
+ if (glob) {
1057
+ text += theme.fg("toolOutput", ` (${glob})`);
1058
+ }
1059
+ if (limit !== undefined) {
1060
+ text += theme.fg("toolOutput", ` limit ${limit}`);
1061
+ }
1062
+
1063
+ if (this.result) {
1064
+ if (this.result.isError) {
1065
+ const errorText = this.getTextOutput().trim() || "grep failed";
1066
+ text += `\n\n${theme.fg("error", errorText)}`;
1067
+ return text;
1068
+ }
1069
+
1070
+ const output = this.getTextOutput().trim();
1071
+ if (output) {
1072
+ const lines = output.split("\n");
1073
+ const maxLines = this.expanded ? lines.length : 15;
1074
+ const displayLines = lines.slice(0, maxLines);
1075
+ const remaining = lines.length - maxLines;
1076
+
1077
+ text += `\n\n${displayLines.map((line: string) => theme.fg("toolOutput", line)).join("\n")}`;
1078
+ if (remaining > 0) {
1079
+ text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
1080
+ }
1081
+ }
1082
+
1083
+ const matchLimit = this.result.details?.matchLimitReached;
1084
+ const truncation = this.result.details?.truncation;
1085
+ const linesTruncated = this.result.details?.linesTruncated;
1086
+ if (matchLimit || truncation?.truncated || linesTruncated) {
1087
+ const warnings: string[] = [];
1088
+ if (matchLimit) {
1089
+ warnings.push(`${matchLimit} matches limit`);
1090
+ }
1091
+ if (truncation?.truncated) {
1092
+ warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
1093
+ }
1094
+ if (linesTruncated) {
1095
+ warnings.push("some lines truncated");
1096
+ }
1097
+ text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
1098
+ }
1099
+ }
1100
+ } else if (normalizedToolName === "web_search") {
1101
+ // Server-side Anthropic web search
1102
+ text = theme.fg("toolTitle", theme.bold("web search"));
1103
+
1104
+ if (process.env.PI_OFFLINE === "1") {
1105
+ text += "\n\n" + theme.fg("muted", "\u{1F50C} Offline \u{2014} web search unavailable");
1106
+ } else if (this.result) {
1107
+ const output = this.getTextOutput().trim();
1108
+ if (output) {
1109
+ const lines = output.split("\n");
1110
+ const maxLines = this.expanded ? lines.length : 10;
1111
+ const displayLines = lines.slice(0, maxLines);
1112
+ const remaining = lines.length - maxLines;
1113
+
1114
+ text += `\n\n${displayLines.map((line: string) => theme.fg("toolOutput", line)).join("\n")}`;
1115
+ if (remaining > 0) {
1116
+ text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
1117
+ }
1118
+ }
1119
+ }
1120
+ } else {
1121
+ // Generic tool / MCP tool without a registered renderer.
1122
+ // MCP tool names from Claude Code arrive as `mcp__<server>__<tool>`;
1123
+ // render the server prefix in muted style so the tool name reads
1124
+ // cleanly. GSD-registered MCP tools have already had their prefix
1125
+ // stripped upstream in partial-builder.ts and won't reach this branch.
1126
+ const parsed = parseMcpToolName(this.toolName);
1127
+ const displayName = parsed ? parsed.tool : this.toolName;
1128
+ const serverPrefix = parsed ? theme.fg("muted", `${parsed.server}\u00b7`) : "";
1129
+ text = serverPrefix + theme.fg("toolTitle", theme.bold(displayName));
1130
+
1131
+ const argsText = formatCompactArgs(this.args, this.expanded);
1132
+ if (argsText) {
1133
+ if (argsText.includes("\n")) {
1134
+ text += `\n\n${theme.fg("toolOutput", argsText)}`;
1135
+ } else {
1136
+ text += " " + theme.fg("toolOutput", argsText);
1137
+ }
1138
+ }
1139
+
1140
+ if (this.result) {
1141
+ const output = this.getTextOutput().trim();
1142
+ if (output) {
1143
+ const lines = output.split("\n");
1144
+ const maxLines = this.expanded ? lines.length : GENERIC_OUTPUT_PREVIEW_LINES;
1145
+ const displayLines = lines.slice(0, maxLines);
1146
+ const remaining = lines.length - maxLines;
1147
+ text += `\n\n${displayLines.map((line: string) => theme.fg("toolOutput", line)).join("\n")}`;
1148
+ if (remaining > 0) {
1149
+ text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
1150
+ }
1151
+ }
1152
+ }
1153
+ }
1154
+
1155
+ return text;
1156
+ }
1157
+ }