gsd-pi 2.77.0-dev.538325aea → 2.77.0-dev.eaa4973bc

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 (874) hide show
  1. package/dist/cli-web-branch.d.ts +1 -0
  2. package/dist/cli-web-branch.js +3 -0
  3. package/dist/cli.js +59 -15
  4. package/dist/extension-discovery.d.ts +6 -0
  5. package/dist/extension-discovery.js +37 -0
  6. package/dist/extension-registry.d.ts +3 -0
  7. package/dist/extension-registry.js +1 -1
  8. package/dist/extension-sort.d.ts +18 -0
  9. package/dist/extension-sort.js +114 -0
  10. package/dist/extension-validator.d.ts +47 -0
  11. package/dist/extension-validator.js +127 -0
  12. package/dist/headless-ui.d.ts +1 -1
  13. package/dist/headless.js +4 -2
  14. package/dist/loader.js +36 -7
  15. package/dist/onboarding.js +5 -5
  16. package/dist/provider-migrations.d.ts +20 -2
  17. package/dist/provider-migrations.js +15 -2
  18. package/dist/remote-questions-config.js +1 -1
  19. package/dist/resources/extensions/async-jobs/async-bash-tool.js +1 -1
  20. package/dist/resources/extensions/aws-auth/index.js +1 -2
  21. package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.js +9 -6
  22. package/dist/resources/extensions/bg-shell/process-manager.js +1 -2
  23. package/dist/resources/extensions/browser-tools/index.js +1 -0
  24. package/dist/resources/extensions/claude-code-cli/index.js +1 -1
  25. package/dist/resources/extensions/claude-code-cli/partial-builder.js +17 -106
  26. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +71 -57
  27. package/dist/resources/extensions/cmux/index.js +20 -0
  28. package/dist/resources/extensions/google-search/extension-manifest.json +5 -4
  29. package/dist/resources/extensions/google-search/index.js +2 -375
  30. package/dist/resources/extensions/gsd/abandon-detect.js +44 -0
  31. package/dist/resources/extensions/gsd/auto/resolve.js +24 -0
  32. package/dist/resources/extensions/gsd/auto/run-unit.js +10 -2
  33. package/dist/resources/extensions/gsd/auto/turn-epoch.js +95 -0
  34. package/dist/resources/extensions/gsd/auto-dispatch.js +24 -0
  35. package/dist/resources/extensions/gsd/auto-loop.js +1 -1
  36. package/dist/resources/extensions/gsd/auto-post-unit.js +31 -0
  37. package/dist/resources/extensions/gsd/auto-timeout-recovery.js +11 -5
  38. package/dist/resources/extensions/gsd/auto-unit-closeout.js +11 -2
  39. package/dist/resources/extensions/gsd/auto-worktree.js +58 -8
  40. package/dist/resources/extensions/gsd/auto.js +31 -14
  41. package/dist/resources/extensions/gsd/bootstrap/provider-error-resume.js +4 -2
  42. package/dist/resources/extensions/gsd/bootstrap/register-extension.js +11 -0
  43. package/dist/resources/extensions/gsd/bootstrap/system-context.js +11 -6
  44. package/dist/resources/extensions/gsd/commands/handlers/workflow.js +31 -4
  45. package/dist/resources/extensions/gsd/commands-cmux.js +9 -6
  46. package/dist/resources/extensions/gsd/commands-extensions.js +634 -43
  47. package/dist/resources/extensions/gsd/file-lock.js +49 -9
  48. package/dist/resources/extensions/gsd/git-service.js +1 -0
  49. package/dist/resources/extensions/gsd/gitignore.js +1 -0
  50. package/dist/resources/extensions/gsd/guided-flow-queue.js +4 -1
  51. package/dist/resources/extensions/gsd/guided-flow.js +1 -1
  52. package/dist/resources/extensions/gsd/journal.js +17 -2
  53. package/dist/resources/extensions/gsd/milestone-actions.js +15 -0
  54. package/dist/resources/extensions/gsd/notifications.js +30 -16
  55. package/dist/resources/extensions/gsd/reports.js +5 -4
  56. package/dist/resources/extensions/gsd/tools/complete-slice.js +21 -0
  57. package/dist/resources/extensions/gsd/tools/complete-task.js +31 -0
  58. package/dist/resources/extensions/gsd/uok/audit.js +18 -2
  59. package/dist/resources/extensions/gsd/workflow-logger.js +10 -2
  60. package/dist/resources/extensions/gsd/worktree-manager.js +1 -0
  61. package/dist/resources/extensions/mcp-client/auth.js +10 -1
  62. package/dist/resources/extensions/mcp-client/index.js +119 -10
  63. package/dist/resources/extensions/ollama/index.js +2 -1
  64. package/dist/resources/extensions/ollama/ollama-chat-provider.js +15 -5
  65. package/dist/resources/extensions/remote-questions/config.js +1 -12
  66. package/dist/resources/extensions/shared/cmux-events.js +12 -0
  67. package/dist/resources/extensions/shared/rtk-session-stats.js +1 -2
  68. package/dist/resources/extensions/universal-config/index.js +1 -1
  69. package/dist/resources/skills/create-skill/SKILL.md +2 -2
  70. package/dist/resources/skills/create-skill/references/gsd-skill-ecosystem.md +4 -4
  71. package/dist/resources/skills/create-skill/workflows/audit-skill.md +4 -4
  72. package/dist/resources/skills/create-skill/workflows/create-new-skill.md +5 -5
  73. package/dist/security-overrides.d.ts +1 -4
  74. package/dist/security-overrides.js +3 -16
  75. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  76. package/dist/web/standalone/.next/BUILD_ID +1 -1
  77. package/dist/web/standalone/.next/app-path-routes-manifest.json +11 -11
  78. package/dist/web/standalone/.next/build-manifest.json +3 -3
  79. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  80. package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
  81. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  82. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  83. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  84. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  85. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  86. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  87. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  88. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  89. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  90. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  91. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  92. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  93. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  94. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  95. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  96. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  97. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  98. package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
  99. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  100. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
  101. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  102. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
  103. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +1 -1
  104. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
  105. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  106. package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
  107. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  108. package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
  109. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  110. package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
  111. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
  113. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  114. package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  115. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  116. package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
  117. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  118. package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  119. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  120. package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  121. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  122. package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
  123. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  124. package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
  125. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  126. package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
  127. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
  129. package/dist/web/standalone/.next/server/app/api/notifications/route.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
  131. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
  133. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  135. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
  137. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
  139. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
  141. package/dist/web/standalone/.next/server/app/api/session/events/route.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
  143. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
  145. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
  147. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
  149. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
  151. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
  153. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
  157. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  159. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
  161. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
  163. package/dist/web/standalone/.next/server/app/index.html +1 -1
  164. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  165. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  166. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  167. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  168. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  169. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  170. package/dist/web/standalone/.next/server/app-paths-manifest.json +11 -11
  171. package/dist/web/standalone/.next/server/chunks/1926.js +1 -0
  172. package/dist/web/standalone/.next/server/chunks/6897.js +2 -2
  173. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  174. package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
  175. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  177. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  178. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  179. package/dist/web/standalone/.next/static/chunks/2826.e9f5195e91f9cad2.js +11 -0
  180. package/dist/web/standalone/.next/static/chunks/{webpack-1832629448831fdc.js → webpack-2e68521d7c82f7c2.js} +1 -1
  181. package/dist/web-mode.js +1 -1
  182. package/dist/welcome-screen.js +20 -19
  183. package/dist/wizard.js +5 -2
  184. package/package.json +16 -32
  185. package/packages/mcp-server/README.md +3 -3
  186. package/packages/mcp-server/dist/env-writer.d.ts +1 -0
  187. package/packages/mcp-server/dist/env-writer.d.ts.map +1 -1
  188. package/packages/mcp-server/dist/env-writer.js +74 -6
  189. package/packages/mcp-server/dist/env-writer.js.map +1 -1
  190. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  191. package/packages/mcp-server/dist/server.js +36 -17
  192. package/packages/mcp-server/dist/server.js.map +1 -1
  193. package/packages/mcp-server/package.json +5 -0
  194. package/packages/mcp-server/src/env-writer.test.ts +79 -1
  195. package/packages/mcp-server/src/env-writer.ts +76 -6
  196. package/packages/mcp-server/src/readers/readers.test.ts +5 -1
  197. package/packages/mcp-server/src/server.ts +45 -19
  198. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  199. package/packages/native/package.json +5 -0
  200. package/packages/native/src/__tests__/clipboard.test.mjs +69 -23
  201. package/packages/native/tsconfig.json +1 -2
  202. package/packages/native/tsconfig.tsbuildinfo +1 -0
  203. package/packages/pi-agent-core/package.json +5 -0
  204. package/packages/pi-agent-core/src/agent-loop.test.ts +220 -15
  205. package/packages/pi-ai/package.json +5 -0
  206. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  207. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +25 -0
  208. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  209. package/packages/pi-coding-agent/dist/core/compaction/compaction.js +105 -6
  210. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  211. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js +230 -28
  212. package/packages/pi-coding-agent/dist/core/compaction/compaction.test.js.map +1 -1
  213. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +30 -2
  214. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
  215. package/packages/pi-coding-agent/dist/core/compaction/utils.js +113 -12
  216. package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
  217. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts +1 -0
  218. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts.map +1 -1
  219. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +29 -18
  220. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -1
  221. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.d.ts +2 -0
  222. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.d.ts.map +1 -0
  223. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.js +130 -0
  224. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.test.js.map +1 -0
  225. package/packages/pi-coding-agent/dist/core/compaction-utils.test.js +56 -1
  226. package/packages/pi-coding-agent/dist/core/compaction-utils.test.js.map +1 -1
  227. package/packages/pi-coding-agent/dist/core/discovery-cache.test.js +8 -15
  228. package/packages/pi-coding-agent/dist/core/discovery-cache.test.js.map +1 -1
  229. package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.d.ts +25 -0
  230. package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.d.ts.map +1 -0
  231. package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.js +109 -0
  232. package/packages/pi-coding-agent/dist/core/extensions/extension-discovery.js.map +1 -0
  233. package/packages/pi-coding-agent/dist/core/extensions/extension-registry.d.ts +67 -0
  234. package/packages/pi-coding-agent/dist/core/extensions/extension-registry.d.ts.map +1 -0
  235. package/packages/pi-coding-agent/dist/core/extensions/extension-registry.js +167 -0
  236. package/packages/pi-coding-agent/dist/core/extensions/extension-registry.js.map +1 -0
  237. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +3 -2
  238. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  239. package/packages/pi-coding-agent/dist/core/extensions/loader.js +24 -8
  240. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  241. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +7 -0
  242. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  243. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  244. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js +11 -0
  245. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -1
  246. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +2 -2
  247. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
  248. package/packages/pi-coding-agent/dist/core/resource-loader.js +1 -1
  249. package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  250. package/packages/pi-coding-agent/dist/core/sdk.d.ts +1 -0
  251. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  252. package/packages/pi-coding-agent/dist/core/sdk.js +4 -1
  253. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  254. package/packages/pi-coding-agent/dist/core/sdk.test.js +19 -1
  255. package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -1
  256. package/packages/pi-coding-agent/dist/core/system-prompt.js +3 -3
  257. package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  258. package/packages/pi-coding-agent/dist/core/tools/path-utils.test.js +2 -1
  259. package/packages/pi-coding-agent/dist/core/tools/path-utils.test.js.map +1 -1
  260. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.js +15 -6
  261. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/provider-display-name.test.js.map +1 -1
  262. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  263. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -5
  264. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  265. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts +7 -1
  266. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  267. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +31 -9
  268. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
  269. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +14 -0
  270. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
  271. package/packages/pi-coding-agent/package.json +5 -0
  272. package/packages/pi-coding-agent/src/core/compaction/compaction.test.ts +368 -28
  273. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +122 -6
  274. package/packages/pi-coding-agent/src/core/compaction/utils.ts +111 -13
  275. package/packages/pi-coding-agent/src/core/compaction-orchestrator.test.ts +154 -0
  276. package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +32 -18
  277. package/packages/pi-coding-agent/src/core/compaction-utils.test.ts +68 -1
  278. package/packages/pi-coding-agent/src/core/discovery-cache.test.ts +9 -18
  279. package/packages/pi-coding-agent/src/core/extensions/extension-discovery.ts +119 -0
  280. package/packages/pi-coding-agent/src/core/extensions/extension-registry.ts +222 -0
  281. package/packages/pi-coding-agent/src/core/extensions/loader.ts +24 -11
  282. package/packages/pi-coding-agent/src/core/extensions/types.ts +8 -0
  283. package/packages/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +13 -0
  284. package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +2 -2
  285. package/packages/pi-coding-agent/src/core/resource-loader.ts +1 -1
  286. package/packages/pi-coding-agent/src/core/sdk.test.ts +25 -1
  287. package/packages/pi-coding-agent/src/core/sdk.ts +10 -3
  288. package/packages/pi-coding-agent/src/core/system-prompt.ts +3 -3
  289. package/packages/pi-coding-agent/src/core/tools/path-utils.test.ts +2 -1
  290. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/provider-display-name.test.ts +17 -7
  291. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +14 -5
  292. package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +45 -11
  293. package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +14 -0
  294. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  295. package/packages/pi-tui/dist/__tests__/autocomplete.test.js +12 -5
  296. package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -1
  297. package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js +19 -0
  298. package/packages/pi-tui/dist/__tests__/stdin-buffer.test.js.map +1 -1
  299. package/packages/pi-tui/dist/stdin-buffer.d.ts +7 -0
  300. package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
  301. package/packages/pi-tui/dist/stdin-buffer.js +20 -0
  302. package/packages/pi-tui/dist/stdin-buffer.js.map +1 -1
  303. package/packages/pi-tui/package.json +5 -0
  304. package/packages/pi-tui/src/__tests__/autocomplete.test.ts +20 -5
  305. package/packages/pi-tui/src/__tests__/stdin-buffer.test.ts +25 -0
  306. package/packages/pi-tui/src/stdin-buffer.ts +26 -0
  307. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  308. package/packages/rpc-client/package.json +5 -0
  309. package/pkg/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  310. package/pkg/dist/core/export-html/ansi-to-html.js +0 -1
  311. package/pkg/dist/core/export-html/ansi-to-html.js.map +1 -1
  312. package/pkg/dist/core/export-html/index.d.ts +1 -1
  313. package/pkg/dist/core/export-html/index.d.ts.map +1 -1
  314. package/pkg/dist/core/export-html/index.js +5 -39
  315. package/pkg/dist/core/export-html/index.js.map +1 -1
  316. package/pkg/dist/core/export-html/tool-renderer.d.ts +2 -2
  317. package/pkg/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  318. package/pkg/dist/core/export-html/tool-renderer.js.map +1 -1
  319. package/scripts/ensure-workspace-builds.cjs +0 -2
  320. package/scripts/lib/workspace-manifest.cjs +86 -0
  321. package/scripts/link-workspace-packages.cjs +5 -19
  322. package/src/resources/extensions/async-jobs/async-bash-tool.ts +1 -1
  323. package/src/resources/extensions/aws-auth/index.ts +1 -2
  324. package/src/resources/extensions/bg-shell/bg-shell-lifecycle.ts +7 -4
  325. package/src/resources/extensions/bg-shell/index.ts +1 -2
  326. package/src/resources/extensions/bg-shell/process-manager.ts +1 -2
  327. package/src/resources/extensions/browser-tools/index.ts +1 -2
  328. package/src/resources/extensions/claude-code-cli/index.ts +1 -1
  329. package/src/resources/extensions/claude-code-cli/partial-builder.ts +23 -115
  330. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +81 -61
  331. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +91 -22
  332. package/src/resources/extensions/cmux/index.ts +35 -10
  333. package/src/resources/extensions/google-search/extension-manifest.json +5 -4
  334. package/src/resources/extensions/google-search/index.ts +8 -470
  335. package/src/resources/extensions/gsd/abandon-detect.ts +62 -0
  336. package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -1
  337. package/src/resources/extensions/gsd/auto/resolve.ts +29 -0
  338. package/src/resources/extensions/gsd/auto/run-unit.ts +16 -2
  339. package/src/resources/extensions/gsd/auto/turn-epoch.ts +108 -0
  340. package/src/resources/extensions/gsd/auto/types.ts +1 -1
  341. package/src/resources/extensions/gsd/auto-dispatch.ts +20 -0
  342. package/src/resources/extensions/gsd/auto-loop.ts +1 -1
  343. package/src/resources/extensions/gsd/auto-post-unit.ts +30 -0
  344. package/src/resources/extensions/gsd/auto-timeout-recovery.ts +12 -5
  345. package/src/resources/extensions/gsd/auto-unit-closeout.ts +14 -3
  346. package/src/resources/extensions/gsd/auto-worktree.ts +60 -5
  347. package/src/resources/extensions/gsd/auto.ts +37 -18
  348. package/src/resources/extensions/gsd/bootstrap/provider-error-resume.ts +6 -2
  349. package/src/resources/extensions/gsd/bootstrap/register-extension.ts +11 -0
  350. package/src/resources/extensions/gsd/bootstrap/system-context.ts +13 -9
  351. package/src/resources/extensions/gsd/commands/handlers/workflow.ts +27 -8
  352. package/src/resources/extensions/gsd/commands-cmux.ts +10 -6
  353. package/src/resources/extensions/gsd/commands-extensions.ts +747 -41
  354. package/src/resources/extensions/gsd/file-lock.ts +84 -11
  355. package/src/resources/extensions/gsd/git-service.ts +1 -0
  356. package/src/resources/extensions/gsd/gitignore.ts +1 -0
  357. package/src/resources/extensions/gsd/guided-flow-queue.ts +4 -1
  358. package/src/resources/extensions/gsd/guided-flow.ts +1 -1
  359. package/src/resources/extensions/gsd/journal.ts +27 -2
  360. package/src/resources/extensions/gsd/milestone-actions.ts +18 -0
  361. package/src/resources/extensions/gsd/notifications.ts +27 -15
  362. package/src/resources/extensions/gsd/reports.ts +5 -4
  363. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +11 -2
  364. package/src/resources/extensions/gsd/tests/auto-mode-guards.test.ts +79 -0
  365. package/src/resources/extensions/gsd/tests/cmux.test.ts +5 -9
  366. package/src/resources/extensions/gsd/tests/file-lock.test.ts +86 -12
  367. package/src/resources/extensions/gsd/tests/google-search-stub.test.ts +121 -0
  368. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +30 -0
  369. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +3 -2
  370. package/src/resources/extensions/gsd/tests/mcp-client-security.test.ts +76 -0
  371. package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +4 -2
  372. package/src/resources/extensions/gsd/tests/parallel-commit-scope.test.ts +5 -0
  373. package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +150 -0
  374. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +39 -25
  375. package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +181 -0
  376. package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +13 -7
  377. package/src/resources/extensions/gsd/tests/require-slice-discussion-dispatch.test.ts +170 -0
  378. package/src/resources/extensions/gsd/tests/rewrite-docs-abandon-detect.test.ts +195 -0
  379. package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +2 -2
  380. package/src/resources/extensions/gsd/tests/triage-resolution.test.ts +50 -2
  381. package/src/resources/extensions/gsd/tests/turn-epoch.test.ts +162 -0
  382. package/src/resources/extensions/gsd/tests/validate-extension-package.test.ts +168 -0
  383. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +25 -2
  384. package/src/resources/extensions/gsd/tools/complete-slice.ts +38 -0
  385. package/src/resources/extensions/gsd/tools/complete-task.ts +49 -0
  386. package/src/resources/extensions/gsd/uok/audit.ts +20 -2
  387. package/src/resources/extensions/gsd/workflow-logger.ts +22 -3
  388. package/src/resources/extensions/gsd/worktree-manager.ts +1 -0
  389. package/src/resources/extensions/mcp-client/auth.ts +12 -1
  390. package/src/resources/extensions/mcp-client/index.ts +130 -11
  391. package/src/resources/extensions/ollama/index.ts +3 -3
  392. package/src/resources/extensions/ollama/ollama-chat-provider.ts +18 -6
  393. package/src/resources/extensions/remote-questions/config.ts +4 -15
  394. package/src/resources/extensions/search-the-web/index.ts +1 -2
  395. package/src/resources/extensions/shared/cmux-events.ts +59 -0
  396. package/src/resources/extensions/shared/rtk-session-stats.ts +1 -2
  397. package/src/resources/extensions/shared/tests/format-utils.test.ts +3 -5
  398. package/src/resources/extensions/universal-config/index.ts +1 -1
  399. package/src/resources/skills/create-skill/SKILL.md +2 -2
  400. package/src/resources/skills/create-skill/references/gsd-skill-ecosystem.md +4 -4
  401. package/src/resources/skills/create-skill/workflows/audit-skill.md +4 -4
  402. package/src/resources/skills/create-skill/workflows/create-new-skill.md +5 -5
  403. package/dist/web/standalone/.next/server/chunks/7461.js +0 -1
  404. package/dist/web/standalone/.next/static/chunks/2826.d445fb428ef41fa1.js +0 -9
  405. package/packages/gsd-agent-core/dist/agent-session.d.ts +0 -716
  406. package/packages/gsd-agent-core/dist/agent-session.d.ts.map +0 -1
  407. package/packages/gsd-agent-core/dist/agent-session.js +0 -2595
  408. package/packages/gsd-agent-core/dist/agent-session.js.map +0 -1
  409. package/packages/gsd-agent-core/dist/artifact-manager.d.ts +0 -52
  410. package/packages/gsd-agent-core/dist/artifact-manager.d.ts.map +0 -1
  411. package/packages/gsd-agent-core/dist/artifact-manager.js +0 -118
  412. package/packages/gsd-agent-core/dist/artifact-manager.js.map +0 -1
  413. package/packages/gsd-agent-core/dist/bash-executor.d.ts +0 -57
  414. package/packages/gsd-agent-core/dist/bash-executor.d.ts.map +0 -1
  415. package/packages/gsd-agent-core/dist/bash-executor.js +0 -282
  416. package/packages/gsd-agent-core/dist/bash-executor.js.map +0 -1
  417. package/packages/gsd-agent-core/dist/blob-store.d.ts +0 -39
  418. package/packages/gsd-agent-core/dist/blob-store.d.ts.map +0 -1
  419. package/packages/gsd-agent-core/dist/blob-store.js +0 -151
  420. package/packages/gsd-agent-core/dist/blob-store.js.map +0 -1
  421. package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts +0 -90
  422. package/packages/gsd-agent-core/dist/compaction/branch-summarization.d.ts.map +0 -1
  423. package/packages/gsd-agent-core/dist/compaction/branch-summarization.js +0 -207
  424. package/packages/gsd-agent-core/dist/compaction/branch-summarization.js.map +0 -1
  425. package/packages/gsd-agent-core/dist/compaction/compaction.d.ts +0 -137
  426. package/packages/gsd-agent-core/dist/compaction/compaction.d.ts.map +0 -1
  427. package/packages/gsd-agent-core/dist/compaction/compaction.js +0 -621
  428. package/packages/gsd-agent-core/dist/compaction/compaction.js.map +0 -1
  429. package/packages/gsd-agent-core/dist/compaction/index.d.ts +0 -7
  430. package/packages/gsd-agent-core/dist/compaction/index.d.ts.map +0 -1
  431. package/packages/gsd-agent-core/dist/compaction/index.js +0 -7
  432. package/packages/gsd-agent-core/dist/compaction/index.js.map +0 -1
  433. package/packages/gsd-agent-core/dist/compaction/utils.d.ts +0 -78
  434. package/packages/gsd-agent-core/dist/compaction/utils.d.ts.map +0 -1
  435. package/packages/gsd-agent-core/dist/compaction/utils.js +0 -263
  436. package/packages/gsd-agent-core/dist/compaction/utils.js.map +0 -1
  437. package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts +0 -90
  438. package/packages/gsd-agent-core/dist/compaction-orchestrator.d.ts.map +0 -1
  439. package/packages/gsd-agent-core/dist/compaction-orchestrator.js +0 -338
  440. package/packages/gsd-agent-core/dist/compaction-orchestrator.js.map +0 -1
  441. package/packages/gsd-agent-core/dist/contextual-tips.d.ts +0 -43
  442. package/packages/gsd-agent-core/dist/contextual-tips.d.ts.map +0 -1
  443. package/packages/gsd-agent-core/dist/contextual-tips.js +0 -208
  444. package/packages/gsd-agent-core/dist/contextual-tips.js.map +0 -1
  445. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts +0 -18
  446. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.d.ts.map +0 -1
  447. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js +0 -250
  448. package/packages/gsd-agent-core/dist/export-html/ansi-to-html.js.map +0 -1
  449. package/packages/gsd-agent-core/dist/export-html/index.d.ts +0 -37
  450. package/packages/gsd-agent-core/dist/export-html/index.d.ts.map +0 -1
  451. package/packages/gsd-agent-core/dist/export-html/index.js +0 -257
  452. package/packages/gsd-agent-core/dist/export-html/index.js.map +0 -1
  453. package/packages/gsd-agent-core/dist/export-html/template.css +0 -971
  454. package/packages/gsd-agent-core/dist/export-html/template.html +0 -54
  455. package/packages/gsd-agent-core/dist/export-html/template.js +0 -1583
  456. package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts +0 -38
  457. package/packages/gsd-agent-core/dist/export-html/tool-renderer.d.ts.map +0 -1
  458. package/packages/gsd-agent-core/dist/export-html/tool-renderer.js +0 -70
  459. package/packages/gsd-agent-core/dist/export-html/tool-renderer.js.map +0 -1
  460. package/packages/gsd-agent-core/dist/export-html/vendor/highlight.min.js +0 -1213
  461. package/packages/gsd-agent-core/dist/export-html/vendor/marked.min.js +0 -6
  462. package/packages/gsd-agent-core/dist/fallback-resolver.d.ts +0 -75
  463. package/packages/gsd-agent-core/dist/fallback-resolver.d.ts.map +0 -1
  464. package/packages/gsd-agent-core/dist/fallback-resolver.js +0 -118
  465. package/packages/gsd-agent-core/dist/fallback-resolver.js.map +0 -1
  466. package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts +0 -44
  467. package/packages/gsd-agent-core/dist/image-overflow-recovery.d.ts.map +0 -1
  468. package/packages/gsd-agent-core/dist/image-overflow-recovery.js +0 -99
  469. package/packages/gsd-agent-core/dist/image-overflow-recovery.js.map +0 -1
  470. package/packages/gsd-agent-core/dist/index.d.ts +0 -14
  471. package/packages/gsd-agent-core/dist/index.d.ts.map +0 -1
  472. package/packages/gsd-agent-core/dist/index.js +0 -19
  473. package/packages/gsd-agent-core/dist/index.js.map +0 -1
  474. package/packages/gsd-agent-core/dist/keybindings.d.ts +0 -47
  475. package/packages/gsd-agent-core/dist/keybindings.d.ts.map +0 -1
  476. package/packages/gsd-agent-core/dist/keybindings.js +0 -156
  477. package/packages/gsd-agent-core/dist/keybindings.js.map +0 -1
  478. package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts +0 -42
  479. package/packages/gsd-agent-core/dist/lifecycle-hooks.d.ts.map +0 -1
  480. package/packages/gsd-agent-core/dist/lifecycle-hooks.js +0 -204
  481. package/packages/gsd-agent-core/dist/lifecycle-hooks.js.map +0 -1
  482. package/packages/gsd-agent-core/dist/retry-handler.d.ts +0 -128
  483. package/packages/gsd-agent-core/dist/retry-handler.d.ts.map +0 -1
  484. package/packages/gsd-agent-core/dist/retry-handler.js +0 -518
  485. package/packages/gsd-agent-core/dist/retry-handler.js.map +0 -1
  486. package/packages/gsd-agent-core/dist/sdk.d.ts +0 -159
  487. package/packages/gsd-agent-core/dist/sdk.d.ts.map +0 -1
  488. package/packages/gsd-agent-core/dist/sdk.js +0 -375
  489. package/packages/gsd-agent-core/dist/sdk.js.map +0 -1
  490. package/packages/gsd-agent-core/dist/system-prompt.d.ts +0 -28
  491. package/packages/gsd-agent-core/dist/system-prompt.d.ts.map +0 -1
  492. package/packages/gsd-agent-core/dist/system-prompt.js +0 -201
  493. package/packages/gsd-agent-core/dist/system-prompt.js.map +0 -1
  494. package/packages/gsd-agent-core/package.json +0 -25
  495. package/packages/gsd-agent-core/scripts/copy-assets.cjs +0 -43
  496. package/packages/gsd-agent-core/src/agent-session.test.ts +0 -169
  497. package/packages/gsd-agent-core/src/agent-session.ts +0 -3358
  498. package/packages/gsd-agent-core/src/artifact-manager.ts +0 -126
  499. package/packages/gsd-agent-core/src/bash-executor.ts +0 -352
  500. package/packages/gsd-agent-core/src/blob-store.ts +0 -154
  501. package/packages/gsd-agent-core/src/compaction/branch-summarization.ts +0 -317
  502. package/packages/gsd-agent-core/src/compaction/compaction.ts +0 -855
  503. package/packages/gsd-agent-core/src/compaction/index.ts +0 -7
  504. package/packages/gsd-agent-core/src/compaction/utils.ts +0 -312
  505. package/packages/gsd-agent-core/src/compaction-orchestrator.ts +0 -449
  506. package/packages/gsd-agent-core/src/contextual-tips.ts +0 -232
  507. package/packages/gsd-agent-core/src/export-html/ansi-to-html.ts +0 -259
  508. package/packages/gsd-agent-core/src/export-html/index.ts +0 -345
  509. package/packages/gsd-agent-core/src/export-html/template.css +0 -971
  510. package/packages/gsd-agent-core/src/export-html/template.html +0 -54
  511. package/packages/gsd-agent-core/src/export-html/template.js +0 -1583
  512. package/packages/gsd-agent-core/src/export-html/tool-renderer.ts +0 -114
  513. package/packages/gsd-agent-core/src/export-html/vendor/highlight.min.js +0 -1213
  514. package/packages/gsd-agent-core/src/export-html/vendor/marked.min.js +0 -6
  515. package/packages/gsd-agent-core/src/fallback-resolver.ts +0 -193
  516. package/packages/gsd-agent-core/src/image-overflow-recovery.ts +0 -120
  517. package/packages/gsd-agent-core/src/index.ts +0 -68
  518. package/packages/gsd-agent-core/src/keybindings.ts +0 -220
  519. package/packages/gsd-agent-core/src/lifecycle-hooks.ts +0 -284
  520. package/packages/gsd-agent-core/src/retry-handler.ts +0 -620
  521. package/packages/gsd-agent-core/src/sdk.ts +0 -550
  522. package/packages/gsd-agent-core/src/system-prompt.ts +0 -270
  523. package/packages/gsd-agent-core/tsconfig.json +0 -28
  524. package/packages/gsd-agent-core/tsconfig.tsbuildinfo +0 -1
  525. package/packages/gsd-agent-modes/dist/cli/args.d.ts +0 -58
  526. package/packages/gsd-agent-modes/dist/cli/args.d.ts.map +0 -1
  527. package/packages/gsd-agent-modes/dist/cli/args.js +0 -324
  528. package/packages/gsd-agent-modes/dist/cli/args.js.map +0 -1
  529. package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts +0 -13
  530. package/packages/gsd-agent-modes/dist/cli/config-selector.d.ts.map +0 -1
  531. package/packages/gsd-agent-modes/dist/cli/config-selector.js +0 -32
  532. package/packages/gsd-agent-modes/dist/cli/config-selector.js.map +0 -1
  533. package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts +0 -15
  534. package/packages/gsd-agent-modes/dist/cli/file-processor.d.ts.map +0 -1
  535. package/packages/gsd-agent-modes/dist/cli/file-processor.js +0 -86
  536. package/packages/gsd-agent-modes/dist/cli/file-processor.js.map +0 -1
  537. package/packages/gsd-agent-modes/dist/cli/list-models.d.ts +0 -21
  538. package/packages/gsd-agent-modes/dist/cli/list-models.d.ts.map +0 -1
  539. package/packages/gsd-agent-modes/dist/cli/list-models.js +0 -114
  540. package/packages/gsd-agent-modes/dist/cli/list-models.js.map +0 -1
  541. package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts +0 -10
  542. package/packages/gsd-agent-modes/dist/cli/session-picker.d.ts.map +0 -1
  543. package/packages/gsd-agent-modes/dist/cli/session-picker.js +0 -37
  544. package/packages/gsd-agent-modes/dist/cli/session-picker.js.map +0 -1
  545. package/packages/gsd-agent-modes/dist/index.d.ts +0 -7
  546. package/packages/gsd-agent-modes/dist/index.d.ts.map +0 -1
  547. package/packages/gsd-agent-modes/dist/index.js +0 -7
  548. package/packages/gsd-agent-modes/dist/index.js.map +0 -1
  549. package/packages/gsd-agent-modes/dist/main.d.ts +0 -8
  550. package/packages/gsd-agent-modes/dist/main.d.ts.map +0 -1
  551. package/packages/gsd-agent-modes/dist/main.js +0 -491
  552. package/packages/gsd-agent-modes/dist/main.js.map +0 -1
  553. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts +0 -34
  554. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.d.ts.map +0 -1
  555. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js +0 -330
  556. package/packages/gsd-agent-modes/dist/modes/interactive/components/armin.js.map +0 -1
  557. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts +0 -29
  558. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
  559. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +0 -141
  560. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +0 -1
  561. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts +0 -36
  562. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
  563. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js +0 -157
  564. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js.map +0 -1
  565. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts +0 -16
  566. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
  567. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js +0 -48
  568. package/packages/gsd-agent-modes/dist/modes/interactive/components/bordered-loader.js.map +0 -1
  569. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts +0 -16
  570. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
  571. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js +0 -43
  572. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
  573. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts +0 -11
  574. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.d.ts.map +0 -1
  575. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js +0 -47
  576. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-frame.js.map +0 -1
  577. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -16
  578. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
  579. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js +0 -44
  580. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
  581. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts +0 -71
  582. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
  583. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js +0 -474
  584. package/packages/gsd-agent-modes/dist/modes/interactive/components/config-selector.js.map +0 -1
  585. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts +0 -15
  586. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
  587. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js +0 -32
  588. package/packages/gsd-agent-modes/dist/modes/interactive/components/countdown-timer.js.map +0 -1
  589. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts +0 -22
  590. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
  591. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js +0 -70
  592. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js.map +0 -1
  593. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts +0 -20
  594. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
  595. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js +0 -75
  596. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-message.js.map +0 -1
  597. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts +0 -23
  598. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.d.ts.map +0 -1
  599. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js +0 -140
  600. package/packages/gsd-agent-modes/dist/modes/interactive/components/daxnuts.js.map +0 -1
  601. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts +0 -12
  602. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.d.ts.map +0 -1
  603. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js +0 -133
  604. package/packages/gsd-agent-modes/dist/modes/interactive/components/diff.js.map +0 -1
  605. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts +0 -33
  606. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
  607. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js +0 -82
  608. package/packages/gsd-agent-modes/dist/modes/interactive/components/dynamic-border.js.map +0 -1
  609. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts +0 -20
  610. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
  611. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js +0 -111
  612. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-editor.js.map +0 -1
  613. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts +0 -24
  614. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
  615. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js +0 -63
  616. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-input.js.map +0 -1
  617. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts +0 -33
  618. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
  619. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js +0 -118
  620. package/packages/gsd-agent-modes/dist/modes/interactive/components/extension-selector.js.map +0 -1
  621. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts +0 -32
  622. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts.map +0 -1
  623. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js +0 -230
  624. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js.map +0 -1
  625. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts +0 -34
  626. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.d.ts.map +0 -1
  627. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js +0 -36
  628. package/packages/gsd-agent-modes/dist/modes/interactive/components/index.js.map +0 -1
  629. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts +0 -48
  630. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
  631. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js +0 -72
  632. package/packages/gsd-agent-modes/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
  633. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts +0 -63
  634. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
  635. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js +0 -213
  636. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js.map +0 -1
  637. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts +0 -86
  638. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
  639. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js +0 -536
  640. package/packages/gsd-agent-modes/dist/modes/interactive/components/model-selector.js.map +0 -1
  641. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts +0 -19
  642. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
  643. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js +0 -93
  644. package/packages/gsd-agent-modes/dist/modes/interactive/components/oauth-selector.js.map +0 -1
  645. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts +0 -30
  646. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.d.ts.map +0 -1
  647. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js +0 -169
  648. package/packages/gsd-agent-modes/dist/modes/interactive/components/provider-manager.js.map +0 -1
  649. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -49
  650. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
  651. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js +0 -267
  652. package/packages/gsd-agent-modes/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
  653. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts +0 -21
  654. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
  655. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js +0 -155
  656. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector-search.js.map +0 -1
  657. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts +0 -97
  658. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
  659. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js +0 -810
  660. package/packages/gsd-agent-modes/dist/modes/interactive/components/session-selector.js.map +0 -1
  661. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts +0 -71
  662. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
  663. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js +0 -320
  664. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js.map +0 -1
  665. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts +0 -10
  666. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
  667. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js +0 -34
  668. package/packages/gsd-agent-modes/dist/modes/interactive/components/show-images-selector.js.map +0 -1
  669. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -17
  670. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
  671. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js +0 -46
  672. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
  673. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts +0 -11
  674. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
  675. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js +0 -45
  676. package/packages/gsd-agent-modes/dist/modes/interactive/components/theme-selector.js.map +0 -1
  677. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts +0 -11
  678. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
  679. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js +0 -46
  680. package/packages/gsd-agent-modes/dist/modes/interactive/components/thinking-selector.js.map +0 -1
  681. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts +0 -15
  682. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.d.ts.map +0 -1
  683. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js +0 -40
  684. package/packages/gsd-agent-modes/dist/modes/interactive/components/timestamp.js.map +0 -1
  685. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts +0 -111
  686. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
  687. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +0 -984
  688. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +0 -1
  689. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts +0 -44
  690. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.d.ts.map +0 -1
  691. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js +0 -61
  692. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-render-utils.js.map +0 -1
  693. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts +0 -109
  694. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
  695. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js +0 -1035
  696. package/packages/gsd-agent-modes/dist/modes/interactive/components/tree-selector.js.map +0 -1
  697. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts +0 -30
  698. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
  699. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js +0 -112
  700. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message-selector.js.map +0 -1
  701. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts +0 -12
  702. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts.map +0 -1
  703. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js +0 -38
  704. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js.map +0 -1
  705. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts +0 -24
  706. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
  707. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js +0 -33
  708. package/packages/gsd-agent-modes/dist/modes/interactive/components/visual-truncate.js.map +0 -1
  709. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts +0 -27
  710. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +0 -1
  711. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +0 -793
  712. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +0 -1
  713. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts +0 -4
  714. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts.map +0 -1
  715. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js +0 -62
  716. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js.map +0 -1
  717. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts +0 -22
  718. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +0 -1
  719. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +0 -118
  720. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +0 -1
  721. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts +0 -7
  722. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.d.ts.map +0 -1
  723. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js +0 -68
  724. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/model-controller.js.map +0 -1
  725. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts +0 -50
  726. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts.map +0 -1
  727. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js +0 -2
  728. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js.map +0 -1
  729. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts +0 -358
  730. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
  731. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js +0 -3409
  732. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js.map +0 -1
  733. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts +0 -77
  734. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.d.ts.map +0 -1
  735. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js +0 -529
  736. package/packages/gsd-agent-modes/dist/modes/interactive/slash-command-handlers.js.map +0 -1
  737. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts +0 -6
  738. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.d.ts.map +0 -1
  739. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js +0 -15
  740. package/packages/gsd-agent-modes/dist/modes/interactive/utils/shorten-path.js.map +0 -1
  741. package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts +0 -28
  742. package/packages/gsd-agent-modes/dist/modes/print-mode.d.ts.map +0 -1
  743. package/packages/gsd-agent-modes/dist/modes/print-mode.js +0 -84
  744. package/packages/gsd-agent-modes/dist/modes/print-mode.js.map +0 -1
  745. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts +0 -17
  746. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.d.ts.map +0 -1
  747. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js +0 -49
  748. package/packages/gsd-agent-modes/dist/modes/rpc/jsonl.js.map +0 -1
  749. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts +0 -37
  750. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.d.ts.map +0 -1
  751. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js +0 -84
  752. package/packages/gsd-agent-modes/dist/modes/rpc/remote-terminal.js.map +0 -1
  753. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts +0 -243
  754. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.d.ts.map +0 -1
  755. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js +0 -464
  756. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-client.js.map +0 -1
  757. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts +0 -25
  758. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
  759. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js +0 -750
  760. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js.map +0 -1
  761. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts +0 -511
  762. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.d.ts.map +0 -1
  763. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js +0 -8
  764. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-types.js.map +0 -1
  765. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts +0 -19
  766. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.d.ts.map +0 -1
  767. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js +0 -45
  768. package/packages/gsd-agent-modes/dist/modes/shared/command-context-actions.js.map +0 -1
  769. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts +0 -22
  770. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.d.ts.map +0 -1
  771. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js +0 -21
  772. package/packages/gsd-agent-modes/dist/pi-coding-agent-compat.js.map +0 -1
  773. package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts +0 -4
  774. package/packages/gsd-agent-modes/dist/pi-tui-compat.d.ts.map +0 -1
  775. package/packages/gsd-agent-modes/dist/pi-tui-compat.js +0 -3
  776. package/packages/gsd-agent-modes/dist/pi-tui-compat.js.map +0 -1
  777. package/packages/gsd-agent-modes/dist/theme.d.ts +0 -15
  778. package/packages/gsd-agent-modes/dist/theme.d.ts.map +0 -1
  779. package/packages/gsd-agent-modes/dist/theme.js +0 -23
  780. package/packages/gsd-agent-modes/dist/theme.js.map +0 -1
  781. package/packages/gsd-agent-modes/dist/utils/theme.d.ts +0 -16
  782. package/packages/gsd-agent-modes/dist/utils/theme.d.ts.map +0 -1
  783. package/packages/gsd-agent-modes/dist/utils/theme.js +0 -11
  784. package/packages/gsd-agent-modes/dist/utils/theme.js.map +0 -1
  785. package/packages/gsd-agent-modes/package.json +0 -23
  786. package/packages/gsd-agent-modes/src/cli/args.ts +0 -350
  787. package/packages/gsd-agent-modes/src/cli/config-selector.ts +0 -54
  788. package/packages/gsd-agent-modes/src/cli/file-processor.ts +0 -107
  789. package/packages/gsd-agent-modes/src/cli/list-models.ts +0 -141
  790. package/packages/gsd-agent-modes/src/cli/session-picker.ts +0 -59
  791. package/packages/gsd-agent-modes/src/index.ts +0 -6
  792. package/packages/gsd-agent-modes/src/main.ts +0 -614
  793. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/login-dialog.test.ts +0 -24
  794. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/provider-display-name.test.ts +0 -18
  795. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/timestamp.test.ts +0 -38
  796. package/packages/gsd-agent-modes/src/modes/interactive/components/__tests__/tool-execution.test.ts +0 -171
  797. package/packages/gsd-agent-modes/src/modes/interactive/components/armin.ts +0 -382
  798. package/packages/gsd-agent-modes/src/modes/interactive/components/assistant-message.ts +0 -178
  799. package/packages/gsd-agent-modes/src/modes/interactive/components/bash-execution.ts +0 -212
  800. package/packages/gsd-agent-modes/src/modes/interactive/components/bordered-loader.ts +0 -66
  801. package/packages/gsd-agent-modes/src/modes/interactive/components/branch-summary-message.ts +0 -59
  802. package/packages/gsd-agent-modes/src/modes/interactive/components/chat-frame.ts +0 -67
  803. package/packages/gsd-agent-modes/src/modes/interactive/components/compaction-summary-message.ts +0 -60
  804. package/packages/gsd-agent-modes/src/modes/interactive/components/config-selector.ts +0 -597
  805. package/packages/gsd-agent-modes/src/modes/interactive/components/countdown-timer.ts +0 -41
  806. package/packages/gsd-agent-modes/src/modes/interactive/components/custom-editor.ts +0 -88
  807. package/packages/gsd-agent-modes/src/modes/interactive/components/custom-message.ts +0 -100
  808. package/packages/gsd-agent-modes/src/modes/interactive/components/daxnuts.ts +0 -165
  809. package/packages/gsd-agent-modes/src/modes/interactive/components/diff.ts +0 -147
  810. package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.test.ts +0 -73
  811. package/packages/gsd-agent-modes/src/modes/interactive/components/dynamic-border.ts +0 -89
  812. package/packages/gsd-agent-modes/src/modes/interactive/components/extension-editor.ts +0 -151
  813. package/packages/gsd-agent-modes/src/modes/interactive/components/extension-input.ts +0 -100
  814. package/packages/gsd-agent-modes/src/modes/interactive/components/extension-selector.ts +0 -156
  815. package/packages/gsd-agent-modes/src/modes/interactive/components/footer.ts +0 -257
  816. package/packages/gsd-agent-modes/src/modes/interactive/components/index.ts +0 -35
  817. package/packages/gsd-agent-modes/src/modes/interactive/components/keybinding-hints.ts +0 -84
  818. package/packages/gsd-agent-modes/src/modes/interactive/components/login-dialog.ts +0 -257
  819. package/packages/gsd-agent-modes/src/modes/interactive/components/model-selector.ts +0 -656
  820. package/packages/gsd-agent-modes/src/modes/interactive/components/oauth-selector.ts +0 -122
  821. package/packages/gsd-agent-modes/src/modes/interactive/components/provider-manager.ts +0 -210
  822. package/packages/gsd-agent-modes/src/modes/interactive/components/scoped-models-selector.ts +0 -342
  823. package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector-search.ts +0 -194
  824. package/packages/gsd-agent-modes/src/modes/interactive/components/session-selector.ts +0 -1011
  825. package/packages/gsd-agent-modes/src/modes/interactive/components/settings-selector.ts +0 -452
  826. package/packages/gsd-agent-modes/src/modes/interactive/components/show-images-selector.ts +0 -45
  827. package/packages/gsd-agent-modes/src/modes/interactive/components/skill-invocation-message.ts +0 -56
  828. package/packages/gsd-agent-modes/src/modes/interactive/components/theme-selector.ts +0 -63
  829. package/packages/gsd-agent-modes/src/modes/interactive/components/thinking-selector.ts +0 -64
  830. package/packages/gsd-agent-modes/src/modes/interactive/components/timestamp.ts +0 -48
  831. package/packages/gsd-agent-modes/src/modes/interactive/components/tool-execution.ts +0 -1157
  832. package/packages/gsd-agent-modes/src/modes/interactive/components/tree-render-utils.ts +0 -81
  833. package/packages/gsd-agent-modes/src/modes/interactive/components/tree-selector.ts +0 -1208
  834. package/packages/gsd-agent-modes/src/modes/interactive/components/user-message-selector.ts +0 -145
  835. package/packages/gsd-agent-modes/src/modes/interactive/components/user-message.ts +0 -44
  836. package/packages/gsd-agent-modes/src/modes/interactive/components/visual-truncate.ts +0 -50
  837. package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller-ordering.test.ts +0 -1430
  838. package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.test.ts +0 -71
  839. package/packages/gsd-agent-modes/src/modes/interactive/controllers/chat-controller.ts +0 -957
  840. package/packages/gsd-agent-modes/src/modes/interactive/controllers/extension-ui-controller.ts +0 -63
  841. package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.test.ts +0 -183
  842. package/packages/gsd-agent-modes/src/modes/interactive/controllers/input-controller.ts +0 -140
  843. package/packages/gsd-agent-modes/src/modes/interactive/controllers/model-controller.ts +0 -77
  844. package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-ordering.test.ts +0 -44
  845. package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode-state.ts +0 -49
  846. package/packages/gsd-agent-modes/src/modes/interactive/interactive-mode.ts +0 -4195
  847. package/packages/gsd-agent-modes/src/modes/interactive/slash-command-handlers.ts +0 -670
  848. package/packages/gsd-agent-modes/src/modes/interactive/utils/shorten-path.ts +0 -14
  849. package/packages/gsd-agent-modes/src/modes/print-mode.ts +0 -106
  850. package/packages/gsd-agent-modes/src/modes/rpc/jsonl.ts +0 -58
  851. package/packages/gsd-agent-modes/src/modes/rpc/remote-terminal.ts +0 -109
  852. package/packages/gsd-agent-modes/src/modes/rpc/rpc-client.ts +0 -572
  853. package/packages/gsd-agent-modes/src/modes/rpc/rpc-mode.ts +0 -902
  854. package/packages/gsd-agent-modes/src/modes/rpc/rpc-protocol-v2.test.ts +0 -971
  855. package/packages/gsd-agent-modes/src/modes/rpc/rpc-types.ts +0 -335
  856. package/packages/gsd-agent-modes/src/modes/shared/command-context-actions.ts +0 -53
  857. package/packages/gsd-agent-modes/src/pi-coding-agent-compat.ts +0 -42
  858. package/packages/gsd-agent-modes/src/pi-tui-compat.ts +0 -4
  859. package/packages/gsd-agent-modes/src/theme.ts +0 -25
  860. package/packages/gsd-agent-modes/src/utils/theme.ts +0 -24
  861. package/packages/gsd-agent-modes/tsconfig.json +0 -28
  862. package/packages/gsd-agent-modes/tsconfig.tsbuildinfo +0 -1
  863. package/packages/gsd-agent-types/dist/index.d.ts +0 -176
  864. package/packages/gsd-agent-types/dist/index.d.ts.map +0 -1
  865. package/packages/gsd-agent-types/dist/index.js +0 -24
  866. package/packages/gsd-agent-types/dist/index.js.map +0 -1
  867. package/packages/gsd-agent-types/package.json +0 -24
  868. package/packages/gsd-agent-types/src/index.ts +0 -206
  869. package/packages/gsd-agent-types/tsconfig.json +0 -25
  870. package/packages/gsd-agent-types/tsconfig.tsbuildinfo +0 -1
  871. package/packages/native/dist/tsconfig.tsbuildinfo +0 -1
  872. package/src/resources/extensions/claude-code-cli/tests/provider-registration.test.ts +0 -27
  873. /package/dist/web/standalone/.next/static/{gy6_foLMsEzdGBT19c3hr → 5wbu35_C2_MQ3Jj1lEVDx}/_buildManifest.js +0 -0
  874. /package/dist/web/standalone/.next/static/{gy6_foLMsEzdGBT19c3hr → 5wbu35_C2_MQ3Jj1lEVDx}/_ssgManifest.js +0 -0
@@ -1,1430 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { test } from "node:test";
3
-
4
- import { handleAgentEvent } from "./chat-controller.js";
5
-
6
- function makeUsage() {
7
- return {
8
- input: 0,
9
- output: 0,
10
- cacheRead: 0,
11
- cacheWrite: 0,
12
- totalTokens: 0,
13
- cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
14
- };
15
- }
16
-
17
- function makeAssistant(content: any[]) {
18
- return {
19
- role: "assistant",
20
- content,
21
- api: "anthropic-messages",
22
- provider: "claude-code",
23
- model: "claude-sonnet-4",
24
- usage: makeUsage(),
25
- stopReason: "stop",
26
- timestamp: Date.now(),
27
- };
28
- }
29
-
30
- function createHost() {
31
- const chatContainer = {
32
- children: [] as any[],
33
- addChild(component: any) {
34
- this.children.push(component);
35
- },
36
- removeChild(component: any) {
37
- const idx = this.children.indexOf(component);
38
- if (idx !== -1) this.children.splice(idx, 1);
39
- },
40
- clear() {
41
- this.children = [];
42
- },
43
- };
44
-
45
- const pinnedMessageContainer = {
46
- children: [] as any[],
47
- addChild(component: any) {
48
- this.children.push(component);
49
- },
50
- removeChild(component: any) {
51
- const idx = this.children.indexOf(component);
52
- if (idx !== -1) this.children.splice(idx, 1);
53
- },
54
- clear() {
55
- this.children = [];
56
- },
57
- };
58
-
59
- const host: any = {
60
- isInitialized: true,
61
- init: async () => {},
62
- defaultEditor: { onEscape: undefined },
63
- editor: {},
64
- session: { retryAttempt: 0, abortCompaction: () => {}, abortRetry: () => {} },
65
- // rows:1 keeps the pinned-zone off-screen-threshold at its floor (1) so
66
- // any rendered segment after a pinnable text block triggers the pin.
67
- // Real terminals are larger; see chat-controller rowsRenderedAfterContentIndex.
68
- ui: { requestRender: () => {}, terminal: { rows: 1, columns: 80 } },
69
- footer: { invalidate: () => {} },
70
- keybindings: {},
71
- statusContainer: { clear: () => {}, addChild: () => {} },
72
- chatContainer,
73
- settingsManager: { getTimestampFormat: () => "date-time-iso", getShowImages: () => false },
74
- pendingTools: new Map(),
75
- toolOutputExpanded: false,
76
- hideThinkingBlock: false,
77
- isBashMode: false,
78
- defaultWorkingMessage: "Working...",
79
- compactionQueuedMessages: [],
80
- editorContainer: {},
81
- pendingMessagesContainer: { clear: () => {} },
82
- pinnedMessageContainer,
83
- addMessageToChat: () => {},
84
- getMarkdownThemeWithSettings: () => ({}),
85
- formatWebSearchResult: () => "",
86
- getRegisteredToolDefinition: () => undefined,
87
- checkShutdownRequested: async () => {},
88
- rebuildChatFromMessages: () => {},
89
- flushCompactionQueue: async () => {},
90
- showStatus: () => {},
91
- showError: () => {},
92
- updatePendingMessagesDisplay: () => {},
93
- updateTerminalTitle: () => {},
94
- updateEditorBorderColor: () => {},
95
- };
96
-
97
- return host;
98
- }
99
-
100
- test("chat-controller renders content blocks in content[] index order (tool-first stream)", async () => {
101
- // ToolExecutionComponent uses the global theme singleton.
102
- // Install a minimal no-op theme implementation for this unit test.
103
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
104
- fg: (_key: string, text: string) => text,
105
- bg: (_key: string, text: string) => text,
106
- bold: (text: string) => text,
107
- italic: (text: string) => text,
108
- truncate: (text: string) => text,
109
- };
110
-
111
- const host = createHost();
112
- const toolId = "mcp-tool-1";
113
- const toolCall = {
114
- type: "toolCall",
115
- id: toolId,
116
- name: "exec_command",
117
- arguments: { cmd: "echo hi" },
118
- };
119
-
120
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
121
-
122
- assert.equal(host.chatContainer.children.length, 0, "nothing should render before content arrives");
123
-
124
- await handleAgentEvent(
125
- host,
126
- {
127
- type: "message_update",
128
- message: makeAssistant([toolCall]),
129
- assistantMessageEvent: {
130
- type: "toolcall_end",
131
- contentIndex: 0,
132
- toolCall: {
133
- ...toolCall,
134
- externalResult: {
135
- content: [{ type: "text", text: "tool output" }],
136
- details: {},
137
- isError: false,
138
- },
139
- },
140
- partial: makeAssistant([toolCall]),
141
- },
142
- } as any,
143
- );
144
-
145
- // content[0] = toolCall → ToolExecutionComponent renders first
146
- assert.equal(host.chatContainer.children.length, 1, "tool execution block should render immediately");
147
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
148
-
149
- host.getMarkdownThemeWithSettings = () => ({});
150
-
151
- await handleAgentEvent(
152
- host,
153
- {
154
- type: "message_update",
155
- message: makeAssistant([toolCall, { type: "text", text: "done" }]),
156
- assistantMessageEvent: {
157
- type: "text_delta",
158
- contentIndex: 1,
159
- delta: "done",
160
- partial: makeAssistant([toolCall, { type: "text", text: "done" }]),
161
- },
162
- } as any,
163
- );
164
-
165
- // content[0]=toolCall, content[1]=text → order: tool, then text
166
- assert.equal(host.chatContainer.children.length, 2, "text run should render after tool in content[] order");
167
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
168
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
169
- });
170
-
171
- test("chat-controller renders serverToolUse before trailing text matching content[] index order", async () => {
172
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
173
- fg: (_key: string, text: string) => text,
174
- bg: (_key: string, text: string) => text,
175
- bold: (text: string) => text,
176
- italic: (text: string) => text,
177
- truncate: (text: string) => text,
178
- };
179
-
180
- const host = createHost();
181
- const toolId = "mcp-secure-1";
182
- const serverToolUse = {
183
- type: "serverToolUse",
184
- id: toolId,
185
- name: "mcp__gsd-workflow__secure_env_collect",
186
- input: { projectDir: "/tmp/project", keys: [{ key: "SECURE_PASSWORD" }], destination: "dotenv" },
187
- };
188
-
189
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
190
-
191
- await handleAgentEvent(
192
- host,
193
- {
194
- type: "message_update",
195
- message: makeAssistant([serverToolUse]),
196
- assistantMessageEvent: {
197
- type: "server_tool_use",
198
- contentIndex: 0,
199
- partial: makeAssistant([serverToolUse]),
200
- },
201
- } as any,
202
- );
203
-
204
- // content[0] = serverToolUse → ToolExecutionComponent renders first
205
- assert.equal(host.chatContainer.children.length, 1, "server tool block should render immediately");
206
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
207
-
208
- host.getMarkdownThemeWithSettings = () => ({});
209
- const resultMessage = makeAssistant([
210
- {
211
- ...serverToolUse,
212
- externalResult: {
213
- content: [{ type: "text", text: "secure_env_collect was cancelled by user." }],
214
- details: {},
215
- isError: true,
216
- },
217
- },
218
- { type: "text", text: "The secure password collection was cancelled." },
219
- ]);
220
-
221
- await handleAgentEvent(
222
- host,
223
- {
224
- type: "message_update",
225
- message: resultMessage,
226
- assistantMessageEvent: {
227
- type: "server_tool_use",
228
- contentIndex: 0,
229
- partial: resultMessage,
230
- },
231
- } as any,
232
- );
233
-
234
- // content[0]=serverToolUse, content[1]=text → order: tool, then text
235
- assert.equal(host.chatContainer.children.length, 2, "text run should render after server tool in content[] order");
236
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
237
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
238
- });
239
-
240
- test("chat-controller replays final message_end content when result adds unstreamed trailing text", async () => {
241
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
242
- fg: (_key: string, text: string) => text,
243
- bg: (_key: string, text: string) => text,
244
- bold: (text: string) => text,
245
- italic: (text: string) => text,
246
- truncate: (text: string) => text,
247
- };
248
-
249
- const host = createHost();
250
- host.getMarkdownThemeWithSettings = () => ({});
251
-
252
- const tool = {
253
- type: "toolCall",
254
- id: "mcp-end-replay-1",
255
- name: "read",
256
- mcpServer: "filesystem",
257
- arguments: { filePath: "/tmp/demo.txt" },
258
- };
259
-
260
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
261
-
262
- const streamedContent = [
263
- tool,
264
- { type: "thinking", thinking: "I am analyzing tool output..." },
265
- ];
266
- await handleAgentEvent(
267
- host,
268
- {
269
- type: "message_update",
270
- message: makeAssistant(streamedContent),
271
- assistantMessageEvent: {
272
- type: "thinking_delta",
273
- contentIndex: 1,
274
- delta: "I am analyzing tool output...",
275
- partial: makeAssistant(streamedContent),
276
- },
277
- } as any,
278
- );
279
-
280
- assert.equal(host.chatContainer.children.length, 2, "streaming shows tool + thinking only");
281
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
282
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
283
-
284
- // Final payload includes trailing text that never arrived as message_update.
285
- const finalContent = [
286
- tool,
287
- { type: "thinking", thinking: "I am analyzing tool output..." },
288
- { type: "text", text: "Correct anything important I missed?" },
289
- ];
290
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
291
-
292
- assert.equal(host.chatContainer.children.length, 3, "message_end should replay and include trailing text segment");
293
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
294
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
295
- assert.equal(host.chatContainer.children[2]?.constructor?.name, "AssistantMessageComponent");
296
- });
297
-
298
- test("chat-controller keeps pre-tool prose visible until post-tool prose arrives, then prunes it", async () => {
299
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
300
- fg: (_key: string, text: string) => text,
301
- bg: (_key: string, text: string) => text,
302
- bold: (text: string) => text,
303
- italic: (text: string) => text,
304
- truncate: (text: string) => text,
305
- };
306
-
307
- const host = createHost();
308
- host.getMarkdownThemeWithSettings = () => ({});
309
-
310
- const mcpTool = {
311
- type: "toolCall",
312
- id: "mcp-tool-1",
313
- name: "read",
314
- mcpServer: "filesystem",
315
- arguments: { filePath: "/tmp/demo.txt" },
316
- };
317
-
318
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
319
-
320
- // Provisional assistant text arrives first.
321
- await handleAgentEvent(
322
- host,
323
- {
324
- type: "message_update",
325
- message: makeAssistant([{ type: "text", text: "Let me inspect the workspace first." }]),
326
- assistantMessageEvent: {
327
- type: "text_delta",
328
- contentIndex: 0,
329
- delta: "Let me inspect the workspace first.",
330
- partial: makeAssistant([{ type: "text", text: "Let me inspect the workspace first." }]),
331
- },
332
- } as any,
333
- );
334
- assert.equal(host.chatContainer.children.length, 1);
335
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
336
-
337
- // MCP tool appears; provisional text should remain visible until post-tool prose exists.
338
- await handleAgentEvent(
339
- host,
340
- {
341
- type: "message_update",
342
- message: makeAssistant([{ type: "text", text: "Let me inspect the workspace first." }, mcpTool]),
343
- assistantMessageEvent: {
344
- type: "toolcall_end",
345
- contentIndex: 1,
346
- toolCall: {
347
- ...mcpTool,
348
- externalResult: {
349
- content: [{ type: "text", text: "file preview" }],
350
- details: {},
351
- isError: false,
352
- },
353
- },
354
- partial: makeAssistant([{ type: "text", text: "Let me inspect the workspace first." }, mcpTool]),
355
- },
356
- } as any,
357
- );
358
- assert.equal(host.chatContainer.children.length, 2, "pre-tool prose should remain during tool-only window");
359
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
360
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent");
361
-
362
- // Post-tool prose arrives: pre-tool prose should now be pruned.
363
- const finalContent = [
364
- { type: "text", text: "Let me inspect the workspace first." },
365
- mcpTool,
366
- { type: "text", text: "Which missing feature matters most to you?" },
367
- ];
368
- await handleAgentEvent(
369
- host,
370
- {
371
- type: "message_update",
372
- message: makeAssistant(finalContent),
373
- assistantMessageEvent: {
374
- type: "text_delta",
375
- contentIndex: 2,
376
- delta: "Which missing feature matters most to you?",
377
- partial: makeAssistant(finalContent),
378
- },
379
- } as any,
380
- );
381
- assert.equal(host.chatContainer.children.length, 2);
382
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
383
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
384
-
385
- // Finalize to tear down any pinned spinner state.
386
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
387
- });
388
-
389
- test("chat-controller keeps pre-tool thinking visible for claude-code MCP turns without post-tool prose", async () => {
390
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
391
- fg: (_key: string, text: string) => text,
392
- bg: (_key: string, text: string) => text,
393
- bold: (text: string) => text,
394
- italic: (text: string) => text,
395
- truncate: (text: string) => text,
396
- };
397
-
398
- const host = createHost();
399
- host.getMarkdownThemeWithSettings = () => ({});
400
-
401
- const mcpTool = {
402
- type: "toolCall",
403
- id: "mcp-tool-thinking-1",
404
- name: "read",
405
- mcpServer: "filesystem",
406
- arguments: { filePath: "/tmp/demo.txt" },
407
- };
408
-
409
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
410
-
411
- const thinkingOnly = [{ type: "thinking", thinking: "I should inspect the workspace." }];
412
- await handleAgentEvent(
413
- host,
414
- {
415
- type: "message_update",
416
- message: makeAssistant(thinkingOnly),
417
- assistantMessageEvent: {
418
- type: "thinking_delta",
419
- contentIndex: 0,
420
- delta: "I should inspect the workspace.",
421
- partial: makeAssistant(thinkingOnly),
422
- },
423
- } as any,
424
- );
425
- assert.equal(host.chatContainer.children.length, 1);
426
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
427
-
428
- await handleAgentEvent(
429
- host,
430
- {
431
- type: "message_update",
432
- message: makeAssistant([thinkingOnly[0], mcpTool]),
433
- assistantMessageEvent: {
434
- type: "toolcall_end",
435
- contentIndex: 1,
436
- toolCall: {
437
- ...mcpTool,
438
- externalResult: {
439
- content: [{ type: "text", text: "file preview" }],
440
- details: {},
441
- isError: false,
442
- },
443
- },
444
- partial: makeAssistant([thinkingOnly[0], mcpTool]),
445
- },
446
- } as any,
447
- );
448
-
449
- assert.equal(host.chatContainer.children.length, 2, "thinking should remain visible while only tool output is present");
450
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
451
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent");
452
-
453
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant([thinkingOnly[0], mcpTool]) } as any);
454
- });
455
-
456
- test("chat-controller keeps pre-tool question text for claude-code MCP when post-tool prose exists", async () => {
457
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
458
- fg: (_key: string, text: string) => text,
459
- bg: (_key: string, text: string) => text,
460
- bold: (text: string) => text,
461
- italic: (text: string) => text,
462
- truncate: (text: string) => text,
463
- };
464
-
465
- const host = createHost();
466
- host.getMarkdownThemeWithSettings = () => ({});
467
-
468
- const mcpTool = {
469
- type: "toolCall",
470
- id: "mcp-tool-question-1",
471
- name: "glob",
472
- mcpServer: "filesystem",
473
- arguments: { pattern: "**/*" },
474
- };
475
-
476
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
477
-
478
- const questionText = { type: "text", text: "Which file should I inspect?" };
479
-
480
- await handleAgentEvent(
481
- host,
482
- {
483
- type: "message_update",
484
- message: makeAssistant([questionText]),
485
- assistantMessageEvent: {
486
- type: "text_delta",
487
- contentIndex: 0,
488
- delta: questionText.text,
489
- partial: makeAssistant([questionText]),
490
- },
491
- } as any,
492
- );
493
-
494
- await handleAgentEvent(
495
- host,
496
- {
497
- type: "message_update",
498
- message: makeAssistant([questionText, mcpTool]),
499
- assistantMessageEvent: {
500
- type: "toolcall_end",
501
- contentIndex: 1,
502
- toolCall: {
503
- ...mcpTool,
504
- externalResult: {
505
- content: [{ type: "text", text: "glob output" }],
506
- details: {},
507
- isError: false,
508
- },
509
- },
510
- partial: makeAssistant([questionText, mcpTool]),
511
- },
512
- } as any,
513
- );
514
-
515
- const postTool = { type: "text", text: "I'll review that next." };
516
- const finalContent = [questionText, mcpTool, postTool];
517
- await handleAgentEvent(
518
- host,
519
- {
520
- type: "message_update",
521
- message: makeAssistant(finalContent),
522
- assistantMessageEvent: {
523
- type: "text_delta",
524
- contentIndex: 2,
525
- delta: postTool.text,
526
- partial: makeAssistant(finalContent),
527
- },
528
- } as any,
529
- );
530
-
531
- assert.equal(host.chatContainer.children.length, 3, "question text should remain alongside MCP tool and post-tool prose");
532
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent", "pre-tool question stays visible");
533
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent", "tool renders in the middle");
534
- assert.equal(host.chatContainer.children[2]?.constructor?.name, "AssistantMessageComponent", "post-tool prose renders last");
535
-
536
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
537
- });
538
-
539
- test("chat-controller prunes orphaned provisional text after claude-code sub-turn shrink when MCP tools appear", async () => {
540
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
541
- fg: (_key: string, text: string) => text,
542
- bg: (_key: string, text: string) => text,
543
- bold: (text: string) => text,
544
- italic: (text: string) => text,
545
- truncate: (text: string) => text,
546
- };
547
-
548
- const host = createHost();
549
- host.getMarkdownThemeWithSettings = () => ({});
550
-
551
- const mcpTool = {
552
- type: "toolCall",
553
- id: "mcp-tool-shrink-1",
554
- name: "glob",
555
- mcpServer: "filesystem",
556
- arguments: { pattern: "**/*" },
557
- };
558
-
559
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
560
-
561
- // Sub-turn 1: generate longer provisional text content.
562
- await handleAgentEvent(
563
- host,
564
- {
565
- type: "message_update",
566
- message: makeAssistant([{ type: "text", text: "Old provisional preface." }, { type: "text", text: "More old text." }]),
567
- assistantMessageEvent: {
568
- type: "text_delta",
569
- contentIndex: 1,
570
- delta: "More old text.",
571
- partial: makeAssistant([{ type: "text", text: "Old provisional preface." }, { type: "text", text: "More old text." }]),
572
- },
573
- } as any,
574
- );
575
- assert.equal(host.chatContainer.children.length, 1, "first sub-turn text run should render");
576
-
577
- // Sub-turn 2 starts (content shrink): old component is orphaned by design.
578
- await handleAgentEvent(
579
- host,
580
- {
581
- type: "message_update",
582
- message: makeAssistant([{ type: "text", text: "New provisional text before tool." }]),
583
- assistantMessageEvent: {
584
- type: "text_delta",
585
- contentIndex: 0,
586
- delta: "New provisional text before tool.",
587
- partial: makeAssistant([{ type: "text", text: "New provisional text before tool." }]),
588
- },
589
- } as any,
590
- );
591
- assert.equal(host.chatContainer.children.length, 2, "shrink keeps prior text until MCP tool context appears");
592
-
593
- // MCP tool appears in sub-turn 2: tool-only windows keep provisional prose visible.
594
- await handleAgentEvent(
595
- host,
596
- {
597
- type: "message_update",
598
- message: makeAssistant([{ type: "text", text: "New provisional text before tool." }, mcpTool]),
599
- assistantMessageEvent: {
600
- type: "toolcall_end",
601
- contentIndex: 1,
602
- toolCall: {
603
- ...mcpTool,
604
- externalResult: {
605
- content: [{ type: "text", text: "glob output" }],
606
- details: {},
607
- isError: false,
608
- },
609
- },
610
- partial: makeAssistant([{ type: "text", text: "New provisional text before tool." }, mcpTool]),
611
- },
612
- } as any,
613
- );
614
- assert.equal(host.chatContainer.children.length, 3, "stale text runs are deferred until post-tool prose arrives");
615
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
616
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
617
- assert.equal(host.chatContainer.children[2]?.constructor?.name, "ToolExecutionComponent");
618
-
619
- const finalContent = [mcpTool, { type: "text", text: "Final visible question?" }];
620
- await handleAgentEvent(
621
- host,
622
- {
623
- type: "message_update",
624
- message: makeAssistant(finalContent),
625
- assistantMessageEvent: {
626
- type: "text_delta",
627
- contentIndex: 1,
628
- delta: "Final visible question?",
629
- partial: makeAssistant(finalContent),
630
- },
631
- } as any,
632
- );
633
- assert.equal(host.chatContainer.children.length, 2);
634
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
635
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
636
-
637
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
638
- });
639
-
640
- test("chat-controller prunes orphans from multiple sub-turn shrinks before MCP post-tool prose", async () => {
641
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
642
- fg: (_key: string, text: string) => text,
643
- bg: (_key: string, text: string) => text,
644
- bold: (text: string) => text,
645
- italic: (text: string) => text,
646
- truncate: (text: string) => text,
647
- };
648
-
649
- const host = createHost();
650
- host.getMarkdownThemeWithSettings = () => ({});
651
-
652
- const mcpTool = {
653
- type: "toolCall",
654
- id: "mcp-tool-multi-shrink-1",
655
- name: "glob",
656
- mcpServer: "filesystem",
657
- arguments: { pattern: "**/*" },
658
- };
659
-
660
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
661
-
662
- // Sub-turn 1: 3 text blocks (merged into one text-run).
663
- const subTurn1 = [
664
- { type: "text", text: "First provisional A." },
665
- { type: "text", text: "First provisional B." },
666
- { type: "text", text: "First provisional C." },
667
- ];
668
- await handleAgentEvent(
669
- host,
670
- {
671
- type: "message_update",
672
- message: makeAssistant(subTurn1),
673
- assistantMessageEvent: {
674
- type: "text_delta",
675
- contentIndex: 2,
676
- delta: "First provisional C.",
677
- partial: makeAssistant(subTurn1),
678
- },
679
- } as any,
680
- );
681
- assert.equal(host.chatContainer.children.length, 1, "first sub-turn renders 1 text-run");
682
-
683
- // Sub-turn 2 (first shrink 3 → 2 blocks).
684
- const subTurn2 = [
685
- { type: "text", text: "Second provisional A." },
686
- { type: "text", text: "Second provisional B." },
687
- ];
688
- await handleAgentEvent(
689
- host,
690
- {
691
- type: "message_update",
692
- message: makeAssistant(subTurn2),
693
- assistantMessageEvent: {
694
- type: "text_delta",
695
- contentIndex: 1,
696
- delta: "Second provisional B.",
697
- partial: makeAssistant(subTurn2),
698
- },
699
- } as any,
700
- );
701
- assert.equal(host.chatContainer.children.length, 2, "first shrink appends, keeps prior text as frozen history");
702
-
703
- // Sub-turn 3 (second shrink 2 → 1 block). This is the critical step —
704
- // without orphan accumulation, sub-turn 1's orphaned segment would be
705
- // dropped from tracking here and later strand in the container.
706
- const subTurn3 = [{ type: "text", text: "Third provisional." }];
707
- await handleAgentEvent(
708
- host,
709
- {
710
- type: "message_update",
711
- message: makeAssistant(subTurn3),
712
- assistantMessageEvent: {
713
- type: "text_delta",
714
- contentIndex: 0,
715
- delta: "Third provisional.",
716
- partial: makeAssistant(subTurn3),
717
- },
718
- } as any,
719
- );
720
- assert.equal(host.chatContainer.children.length, 3, "second shrink appends again, still no prune (no post-tool text)");
721
-
722
- // MCP tool appears — tool-only window still keeps provisional prose visible.
723
- await handleAgentEvent(
724
- host,
725
- {
726
- type: "message_update",
727
- message: makeAssistant([{ type: "text", text: "Third provisional." }, mcpTool]),
728
- assistantMessageEvent: {
729
- type: "toolcall_end",
730
- contentIndex: 1,
731
- toolCall: {
732
- ...mcpTool,
733
- externalResult: {
734
- content: [{ type: "text", text: "glob output" }],
735
- details: {},
736
- isError: false,
737
- },
738
- },
739
- partial: makeAssistant([{ type: "text", text: "Third provisional." }, mcpTool]),
740
- },
741
- } as any,
742
- );
743
- assert.equal(host.chatContainer.children.length, 4, "tool-only window keeps all three provisional text-runs");
744
-
745
- // Final post-tool text arrives — prune must drop ALL three pre-tool
746
- // provisional text-runs across both shrinks, leaving only tool + final text.
747
- const finalContent = [mcpTool, { type: "text", text: "Final answer." }];
748
- await handleAgentEvent(
749
- host,
750
- {
751
- type: "message_update",
752
- message: makeAssistant(finalContent),
753
- assistantMessageEvent: {
754
- type: "text_delta",
755
- contentIndex: 1,
756
- delta: "Final answer.",
757
- partial: makeAssistant(finalContent),
758
- },
759
- } as any,
760
- );
761
- assert.equal(
762
- host.chatContainer.children.length,
763
- 2,
764
- "all pre-tool provisional segments from every shrink must be pruned once post-tool prose arrives",
765
- );
766
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "ToolExecutionComponent");
767
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "AssistantMessageComponent");
768
-
769
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
770
- });
771
-
772
- test("chat-controller pins latest assistant text above editor when tool calls are present", async () => {
773
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
774
- fg: (_key: string, text: string) => text,
775
- bg: (_key: string, text: string) => text,
776
- bold: (text: string) => text,
777
- italic: (text: string) => text,
778
- truncate: (text: string) => text,
779
- };
780
-
781
- const host = createHost();
782
- const toolId = "tool-pin-1";
783
- const toolCall = {
784
- type: "toolCall",
785
- id: toolId,
786
- name: "exec_command",
787
- arguments: { cmd: "echo hi" },
788
- };
789
-
790
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
791
-
792
- assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should be empty at message_start");
793
-
794
- // Send a message with text followed by a tool call
795
- host.getMarkdownThemeWithSettings = () => ({});
796
- await handleAgentEvent(
797
- host,
798
- {
799
- type: "message_update",
800
- message: makeAssistant([
801
- { type: "text", text: "Looking at the files now." },
802
- toolCall,
803
- ]),
804
- assistantMessageEvent: {
805
- type: "toolcall_end",
806
- contentIndex: 1,
807
- toolCall: {
808
- ...toolCall,
809
- externalResult: {
810
- content: [{ type: "text", text: "file contents" }],
811
- details: {},
812
- isError: false,
813
- },
814
- },
815
- partial: makeAssistant([{ type: "text", text: "Looking at the files now." }, toolCall]),
816
- },
817
- } as any,
818
- );
819
-
820
- // Pinned zone should now have a DynamicBorder and a Markdown component
821
- assert.equal(host.pinnedMessageContainer.children.length, 2, "pinned zone should have border + markdown");
822
- assert.equal(host.pinnedMessageContainer.children[0]?.constructor?.name, "DynamicBorder");
823
- assert.equal(host.pinnedMessageContainer.children[1]?.constructor?.name, "Markdown");
824
- });
825
-
826
- test("chat-controller clears pinned zone when a new assistant message starts", async () => {
827
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
828
- fg: (_key: string, text: string) => text,
829
- bg: (_key: string, text: string) => text,
830
- bold: (text: string) => text,
831
- italic: (text: string) => text,
832
- truncate: (text: string) => text,
833
- };
834
-
835
- const host = createHost();
836
- const toolCall = {
837
- type: "toolCall",
838
- id: "tool-clear-1",
839
- name: "exec_command",
840
- arguments: { cmd: "echo hi" },
841
- };
842
-
843
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
844
-
845
- // Populate the pinned zone
846
- host.getMarkdownThemeWithSettings = () => ({});
847
- await handleAgentEvent(
848
- host,
849
- {
850
- type: "message_update",
851
- message: makeAssistant([{ type: "text", text: "Working on it." }, toolCall]),
852
- assistantMessageEvent: {
853
- type: "toolcall_end",
854
- contentIndex: 1,
855
- toolCall: {
856
- ...toolCall,
857
- externalResult: {
858
- content: [{ type: "text", text: "ok" }],
859
- details: {},
860
- isError: false,
861
- },
862
- },
863
- partial: makeAssistant([{ type: "text", text: "Working on it." }, toolCall]),
864
- },
865
- } as any,
866
- );
867
-
868
- assert.ok(host.pinnedMessageContainer.children.length > 0, "pinned zone should be populated");
869
-
870
- // Start a new assistant message — pinned zone should clear
871
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
872
-
873
- assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should clear on new assistant message");
874
- });
875
-
876
- test("chat-controller clears pinned zone when the agent turn ends", async () => {
877
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
878
- fg: (_key: string, text: string) => text,
879
- bg: (_key: string, text: string) => text,
880
- bold: (text: string) => text,
881
- italic: (text: string) => text,
882
- truncate: (text: string) => text,
883
- };
884
-
885
- const host = createHost();
886
- const toolCall = {
887
- type: "toolCall",
888
- id: "tool-clear-on-end-1",
889
- name: "exec_command",
890
- arguments: { cmd: "echo hi" },
891
- };
892
-
893
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
894
-
895
- host.getMarkdownThemeWithSettings = () => ({});
896
- await handleAgentEvent(
897
- host,
898
- {
899
- type: "message_update",
900
- message: makeAssistant([{ type: "text", text: "Working on it." }, toolCall]),
901
- assistantMessageEvent: {
902
- type: "toolcall_end",
903
- contentIndex: 1,
904
- toolCall: {
905
- ...toolCall,
906
- externalResult: {
907
- content: [{ type: "text", text: "ok" }],
908
- details: {},
909
- isError: false,
910
- },
911
- },
912
- partial: makeAssistant([{ type: "text", text: "Working on it." }, toolCall]),
913
- },
914
- } as any,
915
- );
916
-
917
- assert.ok(host.pinnedMessageContainer.children.length > 0, "pinned zone should be populated before agent_end");
918
-
919
- await handleAgentEvent(host, { type: "agent_end" } as any);
920
-
921
- assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should clear on agent_end");
922
- });
923
-
924
- test("chat-controller clears pinned zone when assistant message ends", async () => {
925
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
926
- fg: (_key: string, text: string) => text,
927
- bg: (_key: string, text: string) => text,
928
- bold: (text: string) => text,
929
- italic: (text: string) => text,
930
- truncate: (text: string) => text,
931
- };
932
-
933
- const host = createHost();
934
- const toolCall = {
935
- type: "toolCall",
936
- id: "tool-msg-end-1",
937
- name: "exec_command",
938
- arguments: { cmd: "echo hi" },
939
- };
940
-
941
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
942
-
943
- host.getMarkdownThemeWithSettings = () => ({});
944
- const msgContent = [{ type: "text", text: "Summary after tools." }, toolCall];
945
- await handleAgentEvent(
946
- host,
947
- {
948
- type: "message_update",
949
- message: makeAssistant(msgContent),
950
- assistantMessageEvent: {
951
- type: "toolcall_end",
952
- contentIndex: 1,
953
- toolCall: {
954
- ...toolCall,
955
- externalResult: {
956
- content: [{ type: "text", text: "ok" }],
957
- details: {},
958
- isError: false,
959
- },
960
- },
961
- partial: makeAssistant(msgContent),
962
- },
963
- } as any,
964
- );
965
-
966
- assert.ok(host.pinnedMessageContainer.children.length > 0, "pinned zone should be populated during streaming");
967
-
968
- // End the assistant message (e.g. before form elicitation) — pinned zone should clear
969
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant(msgContent) } as any);
970
-
971
- assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should clear on message_end to prevent duplicate display");
972
- });
973
-
974
- test("chat-controller does not pin when there are no tool calls", async () => {
975
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
976
- fg: (_key: string, text: string) => text,
977
- bg: (_key: string, text: string) => text,
978
- bold: (text: string) => text,
979
- italic: (text: string) => text,
980
- truncate: (text: string) => text,
981
- };
982
-
983
- const host = createHost();
984
-
985
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
986
-
987
- host.getMarkdownThemeWithSettings = () => ({});
988
- await handleAgentEvent(
989
- host,
990
- {
991
- type: "message_update",
992
- message: makeAssistant([{ type: "text", text: "Just some text, no tools." }]),
993
- assistantMessageEvent: {
994
- type: "text_delta",
995
- contentIndex: 0,
996
- delta: "Just some text, no tools.",
997
- partial: makeAssistant([{ type: "text", text: "Just some text, no tools." }]),
998
- },
999
- } as any,
1000
- );
1001
-
1002
- assert.equal(host.pinnedMessageContainer.children.length, 0, "pinned zone should stay empty without tool calls");
1003
- });
1004
-
1005
- // Regression test for issue #4144: interleaved text/tool content must render in content[] index order.
1006
- // Stream: [text "A", toolCall T1, text "B", toolCall T2, text "C"]
1007
- // Expected chatContainer order: textRun(A), toolExec(T1), textRun(B), toolExec(T2), textRun(C)
1008
- // Each AssistantMessageComponent must render ONLY its own text — no duplication after message_end.
1009
- test("chat-controller renders interleaved text and tool blocks in content[] index order (#4144)", async () => {
1010
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
1011
- fg: (_key: string, text: string) => text,
1012
- bg: (_key: string, text: string) => text,
1013
- bold: (text: string) => text,
1014
- italic: (text: string) => text,
1015
- truncate: (text: string) => text,
1016
- };
1017
-
1018
- const host = createHost();
1019
- host.getMarkdownThemeWithSettings = () => ({});
1020
-
1021
- const t1 = { type: "toolCall", id: "t1", name: "tool_one", arguments: {} };
1022
- const t2 = { type: "toolCall", id: "t2", name: "tool_two", arguments: {} };
1023
-
1024
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
1025
-
1026
- // Stream text "A" at index 0
1027
- await handleAgentEvent(host, {
1028
- type: "message_update",
1029
- message: makeAssistant([{ type: "text", text: "A" }]),
1030
- assistantMessageEvent: {
1031
- type: "text_delta",
1032
- contentIndex: 0,
1033
- delta: "A",
1034
- partial: makeAssistant([{ type: "text", text: "A" }]),
1035
- },
1036
- } as any);
1037
-
1038
- // Stream toolCall T1 at index 1
1039
- await handleAgentEvent(host, {
1040
- type: "message_update",
1041
- message: makeAssistant([{ type: "text", text: "A" }, t1]),
1042
- assistantMessageEvent: {
1043
- type: "toolcall_end",
1044
- contentIndex: 1,
1045
- toolCall: {
1046
- ...t1,
1047
- externalResult: { content: [{ type: "text", text: "result1" }], details: {}, isError: false },
1048
- },
1049
- partial: makeAssistant([{ type: "text", text: "A" }, t1]),
1050
- },
1051
- } as any);
1052
-
1053
- // Stream text "B" at index 2
1054
- await handleAgentEvent(host, {
1055
- type: "message_update",
1056
- message: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }]),
1057
- assistantMessageEvent: {
1058
- type: "text_delta",
1059
- contentIndex: 2,
1060
- delta: "B",
1061
- partial: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }]),
1062
- },
1063
- } as any);
1064
-
1065
- // Stream toolCall T2 at index 3
1066
- await handleAgentEvent(host, {
1067
- type: "message_update",
1068
- message: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }, t2]),
1069
- assistantMessageEvent: {
1070
- type: "toolcall_end",
1071
- contentIndex: 3,
1072
- toolCall: {
1073
- ...t2,
1074
- externalResult: { content: [{ type: "text", text: "result2" }], details: {}, isError: false },
1075
- },
1076
- partial: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }, t2]),
1077
- },
1078
- } as any);
1079
-
1080
- // Stream text "C" at index 4
1081
- const finalContent = [
1082
- { type: "text", text: "A" }, t1, { type: "text", text: "B" }, t2, { type: "text", text: "C" },
1083
- ];
1084
- await handleAgentEvent(host, {
1085
- type: "message_update",
1086
- message: makeAssistant(finalContent),
1087
- assistantMessageEvent: {
1088
- type: "text_delta",
1089
- contentIndex: 4,
1090
- delta: "C",
1091
- partial: makeAssistant(finalContent),
1092
- },
1093
- } as any);
1094
-
1095
- // Finalize — exercises the message_end path where a buggy setRange(undefined) would cause duplication
1096
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
1097
-
1098
- // Assert interleaved order: textRun(A), toolExec(T1), textRun(B), toolExec(T2), textRun(C)
1099
- assert.equal(host.chatContainer.children.length, 5, "should have 5 children in interleaved order");
1100
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent", "index 0: text run A");
1101
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent", "index 1: tool T1");
1102
- assert.equal(host.chatContainer.children[2]?.constructor?.name, "AssistantMessageComponent", "index 2: text run B");
1103
- assert.equal(host.chatContainer.children[3]?.constructor?.name, "ToolExecutionComponent", "index 3: tool T2");
1104
- assert.equal(host.chatContainer.children[4]?.constructor?.name, "AssistantMessageComponent", "index 4: text run C");
1105
-
1106
- // Helper: collect the text of all Markdown children inside an AssistantMessageComponent.
1107
- // Structure: AssistantMessageComponent (Container) -> contentContainer (children[0]) -> Markdown nodes.
1108
- function getRenderedTexts(comp: any): string[] {
1109
- const contentContainer = comp.children?.[0];
1110
- if (!contentContainer) return [];
1111
- return (contentContainer.children ?? [])
1112
- .filter((c: any) => c.constructor?.name === "Markdown")
1113
- .map((c: any) => (c as any).text as string);
1114
- }
1115
-
1116
- // Each text-run component must contain only its own text — no cross-contamination after message_end
1117
- assert.deepEqual(getRenderedTexts(host.chatContainer.children[0]), ["A"], "text run A must contain only 'A'");
1118
- assert.deepEqual(getRenderedTexts(host.chatContainer.children[2]), ["B"], "text run B must contain only 'B'");
1119
- assert.deepEqual(getRenderedTexts(host.chatContainer.children[4]), ["C"], "text run C must contain only 'C'");
1120
- });
1121
-
1122
- test("chat-controller does not duplicate text when content is [text, tool, text] (interleaved stream)", async () => {
1123
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
1124
- fg: (_key: string, text: string) => text,
1125
- bg: (_key: string, text: string) => text,
1126
- bold: (text: string) => text,
1127
- italic: (text: string) => text,
1128
- truncate: (text: string) => text,
1129
- };
1130
-
1131
- const host = createHost();
1132
- host.getMarkdownThemeWithSettings = () => ({});
1133
-
1134
- const t1 = { type: "toolCall", id: "t1", name: "tool_one", arguments: {} };
1135
-
1136
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
1137
-
1138
- // Step 1: text "A" at index 0
1139
- await handleAgentEvent(host, {
1140
- type: "message_update",
1141
- message: makeAssistant([{ type: "text", text: "A" }]),
1142
- assistantMessageEvent: {
1143
- type: "text_delta",
1144
- contentIndex: 0,
1145
- delta: "A",
1146
- partial: makeAssistant([{ type: "text", text: "A" }]),
1147
- },
1148
- } as any);
1149
-
1150
- // Step 2: toolCall at index 1
1151
- await handleAgentEvent(host, {
1152
- type: "message_update",
1153
- message: makeAssistant([{ type: "text", text: "A" }, t1]),
1154
- assistantMessageEvent: {
1155
- type: "toolcall_end",
1156
- contentIndex: 1,
1157
- toolCall: {
1158
- ...t1,
1159
- externalResult: { content: [{ type: "text", text: "result1" }], details: {}, isError: false },
1160
- },
1161
- partial: makeAssistant([{ type: "text", text: "A" }, t1]),
1162
- },
1163
- } as any);
1164
-
1165
- // Step 3: text "B" at index 2
1166
- const finalContent = [{ type: "text", text: "A" }, t1, { type: "text", text: "B" }];
1167
- await handleAgentEvent(host, {
1168
- type: "message_update",
1169
- message: makeAssistant(finalContent),
1170
- assistantMessageEvent: {
1171
- type: "text_delta",
1172
- contentIndex: 2,
1173
- delta: "B",
1174
- partial: makeAssistant(finalContent),
1175
- },
1176
- } as any);
1177
-
1178
- assert.equal(host.chatContainer.children.length, 3);
1179
- assert.equal(host.chatContainer.children[0]?.constructor?.name, "AssistantMessageComponent");
1180
- assert.equal(host.chatContainer.children[1]?.constructor?.name, "ToolExecutionComponent");
1181
- assert.equal(host.chatContainer.children[2]?.constructor?.name, "AssistantMessageComponent");
1182
-
1183
- const firstText = host.chatContainer.children[0];
1184
- const secondText = host.chatContainer.children[2];
1185
- assert.notEqual(firstText, secondText, "text-before-tool and text-after-tool must be separate component instances");
1186
- assert.deepEqual((firstText as any).range, { startIndex: 0, endIndex: 0 }, "first text-run covers only content[0]");
1187
- assert.deepEqual((secondText as any).range, { startIndex: 2, endIndex: 2 }, "second text-run covers only content[2]");
1188
-
1189
- // Finalize — regression guard: range must NOT be cleared on message_end (would cause duplication)
1190
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant(finalContent) } as any);
1191
-
1192
- assert.deepEqual((secondText as any).range, { startIndex: 2, endIndex: 2 }, "range must not be cleared on message_end (would cause duplication)");
1193
- });
1194
-
1195
- // Regression for the claude-code sub-turn bug that followed #4144:
1196
- // an adapter can reset content[] back to 0/1 mid-lifecycle when a new provider
1197
- // sub-turn begins. The segment walker must NOT update prior-sub-turn text-run
1198
- // components in place (which would destroy earlier history) and must NOT reuse
1199
- // stale tool registrations for a new tool at the same contentIndex. Prior
1200
- // sub-turn children must stay frozen; new sub-turn segments must append after
1201
- // them, and the pinned "Latest Output" mirror must re-evaluate for the new sub-turn.
1202
- test("chat-controller freezes prior sub-turn and appends new segments when content shrinks", async () => {
1203
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
1204
- fg: (_key: string, text: string) => text,
1205
- bg: (_key: string, text: string) => text,
1206
- bold: (text: string) => text,
1207
- italic: (text: string) => text,
1208
- truncate: (text: string) => text,
1209
- };
1210
-
1211
- const host = createHost();
1212
- host.getMarkdownThemeWithSettings = () => ({});
1213
-
1214
- const t1 = { type: "toolCall", id: "t1", name: "tool_one", arguments: {} };
1215
- const t2 = { type: "toolCall", id: "t2", name: "tool_two", arguments: {} };
1216
-
1217
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
1218
-
1219
- // Sub-turn 1: grow to [A, T1, B]
1220
- await handleAgentEvent(host, {
1221
- type: "message_update",
1222
- message: makeAssistant([{ type: "text", text: "A" }]),
1223
- assistantMessageEvent: {
1224
- type: "text_delta", contentIndex: 0, delta: "A",
1225
- partial: makeAssistant([{ type: "text", text: "A" }]),
1226
- },
1227
- } as any);
1228
- await handleAgentEvent(host, {
1229
- type: "message_update",
1230
- message: makeAssistant([{ type: "text", text: "A" }, t1]),
1231
- assistantMessageEvent: {
1232
- type: "toolcall_end", contentIndex: 1,
1233
- toolCall: { ...t1, externalResult: { content: [{ type: "text", text: "r1" }], details: {}, isError: false } },
1234
- partial: makeAssistant([{ type: "text", text: "A" }, t1]),
1235
- },
1236
- } as any);
1237
- await handleAgentEvent(host, {
1238
- type: "message_update",
1239
- message: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }]),
1240
- assistantMessageEvent: {
1241
- type: "text_delta", contentIndex: 2, delta: "B",
1242
- partial: makeAssistant([{ type: "text", text: "A" }, t1, { type: "text", text: "B" }]),
1243
- },
1244
- } as any);
1245
-
1246
- assert.equal(host.chatContainer.children.length, 3, "sub-turn 1 renders 3 children");
1247
- const priorA = host.chatContainer.children[0];
1248
- const priorT1 = host.chatContainer.children[1];
1249
- const priorB = host.chatContainer.children[2];
1250
-
1251
- // Sub-turn boundary: adapter resets content[] to [C]
1252
- await handleAgentEvent(host, {
1253
- type: "message_update",
1254
- message: makeAssistant([{ type: "text", text: "C" }]),
1255
- assistantMessageEvent: {
1256
- type: "text_delta", contentIndex: 0, delta: "C",
1257
- partial: makeAssistant([{ type: "text", text: "C" }]),
1258
- },
1259
- } as any);
1260
-
1261
- // Prior 3 children must still exist in DOM — and a NEW text-run for "C" appended after them.
1262
- assert.equal(host.chatContainer.children.length, 4, "shrink must append new segment, not replace prior history");
1263
- assert.equal(host.chatContainer.children[0], priorA, "prior A component stays at index 0");
1264
- assert.equal(host.chatContainer.children[1], priorT1, "prior T1 component stays at index 1");
1265
- assert.equal(host.chatContainer.children[2], priorB, "prior B component stays at index 2");
1266
- assert.notEqual(host.chatContainer.children[3], priorA, "new C text-run must be a different component from prior A");
1267
- assert.equal(host.chatContainer.children[3]?.constructor?.name, "AssistantMessageComponent");
1268
-
1269
- // Prior A component must still render "A", not be overwritten with "C".
1270
- function getRenderedTexts(comp: any): string[] {
1271
- const contentContainer = comp.children?.[0];
1272
- if (!contentContainer) return [];
1273
- return (contentContainer.children ?? [])
1274
- .filter((c: any) => c.constructor?.name === "Markdown")
1275
- .map((c: any) => (c as any).text as string);
1276
- }
1277
- assert.deepEqual(getRenderedTexts(priorA), ["A"], "prior A text-run must still contain 'A' after shrink");
1278
- assert.deepEqual(getRenderedTexts(priorB), ["B"], "prior B text-run must still contain 'B' after shrink");
1279
- assert.deepEqual(getRenderedTexts(host.chatContainer.children[3]), ["C"], "new text-run must contain only 'C'");
1280
-
1281
- // Sub-turn 2 grows with a new tool T2 at contentIndex=1.
1282
- await handleAgentEvent(host, {
1283
- type: "message_update",
1284
- message: makeAssistant([{ type: "text", text: "C" }, t2]),
1285
- assistantMessageEvent: {
1286
- type: "toolcall_end", contentIndex: 1,
1287
- toolCall: { ...t2, externalResult: { content: [{ type: "text", text: "r2" }], details: {}, isError: false } },
1288
- partial: makeAssistant([{ type: "text", text: "C" }, t2]),
1289
- },
1290
- } as any);
1291
-
1292
- // T2 must be appended after the new C text-run, not conflated with the stale T1 registration.
1293
- assert.equal(host.chatContainer.children.length, 5, "new tool appends after new text-run");
1294
- assert.equal(host.chatContainer.children[4]?.constructor?.name, "ToolExecutionComponent");
1295
- assert.notEqual(host.chatContainer.children[4], priorT1, "new T2 must be a different component from prior T1");
1296
-
1297
- // Finalize so the module-level pinned spinner (setInterval) is torn down and the test process can exit.
1298
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant([{ type: "text", text: "C" }, t2]) } as any);
1299
- });
1300
-
1301
- // Regression: after a sub-turn shrink, lastPinnedText must be cleared so the
1302
- // pinned "Latest Output" mirror can display text from the new sub-turn instead
1303
- // of staying frozen on a stale snapshot (the "bottom green stays" symptom).
1304
- test("chat-controller updates pinned zone after sub-turn shrink", async () => {
1305
- (globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
1306
- fg: (_key: string, text: string) => text,
1307
- bg: (_key: string, text: string) => text,
1308
- bold: (text: string) => text,
1309
- italic: (text: string) => text,
1310
- truncate: (text: string) => text,
1311
- };
1312
-
1313
- const host = createHost();
1314
- host.getMarkdownThemeWithSettings = () => ({});
1315
-
1316
- const t1 = { type: "toolCall", id: "t1", name: "tool_one", arguments: {} };
1317
- const t2 = { type: "toolCall", id: "t2", name: "tool_two", arguments: {} };
1318
-
1319
- await handleAgentEvent(host, { type: "message_start", message: makeAssistant([]) } as any);
1320
-
1321
- // Sub-turn 1 with pinnable text before a tool → populates pinned zone with "first".
1322
- await handleAgentEvent(host, {
1323
- type: "message_update",
1324
- message: makeAssistant([{ type: "text", text: "first" }, t1]),
1325
- assistantMessageEvent: {
1326
- type: "toolcall_end", contentIndex: 1,
1327
- toolCall: { ...t1, externalResult: { content: [{ type: "text", text: "r1" }], details: {}, isError: false } },
1328
- partial: makeAssistant([{ type: "text", text: "first" }, t1]),
1329
- },
1330
- } as any);
1331
- const pinnedMarkdown = host.pinnedMessageContainer.children[1];
1332
- assert.equal((pinnedMarkdown as any)?.text, "first", "pinned zone seeded with sub-turn 1 text");
1333
-
1334
- // Sub-turn boundary: content resets to [second, t2].
1335
- await handleAgentEvent(host, {
1336
- type: "message_update",
1337
- message: makeAssistant([{ type: "text", text: "second" }, t2]),
1338
- assistantMessageEvent: {
1339
- type: "toolcall_end", contentIndex: 1,
1340
- toolCall: { ...t2, externalResult: { content: [{ type: "text", text: "r2" }], details: {}, isError: false } },
1341
- partial: makeAssistant([{ type: "text", text: "second" }, t2]),
1342
- },
1343
- } as any);
1344
-
1345
- // Pinned markdown must now reflect the new sub-turn's text, not stay frozen on "first".
1346
- assert.equal((pinnedMarkdown as any)?.text, "second", "pinned zone must update after sub-turn shrink (#4144 regression)");
1347
-
1348
- // Finalize so the module-level pinned spinner (setInterval) is torn down and the test process can exit.
1349
- await handleAgentEvent(host, { type: "message_end", message: makeAssistant([{ type: "text", text: "second" }, t2]) } as any);
1350
- });
1351
-
1352
- test("chat-controller: agent_end without message_end must not remove streaming component from DOM (regression #4197)", async () => {
1353
- const host = createHost();
1354
-
1355
- await handleAgentEvent(host, {
1356
- type: "message_start",
1357
- message: makeAssistant([]),
1358
- } as any);
1359
-
1360
- // Simulate partial streaming that creates an AssistantMessageComponent
1361
- await handleAgentEvent(host, {
1362
- type: "message_update",
1363
- message: makeAssistant([{ type: "text", text: "partial answer" }]),
1364
- assistantMessageEvent: {
1365
- type: "text_delta",
1366
- contentIndex: 0,
1367
- delta: "partial answer",
1368
- partial: makeAssistant([{ type: "text", text: "partial answer" }]),
1369
- },
1370
- } as any);
1371
-
1372
- // Precondition: component is in DOM
1373
- assert.equal(
1374
- host.chatContainer.children.length,
1375
- 1,
1376
- "streaming component must be in DOM after message_update",
1377
- );
1378
- const comp = host.chatContainer.children[0];
1379
-
1380
- // Simulate abort: agent_end fires WITHOUT message_end
1381
- await handleAgentEvent(host, { type: "agent_end" } as any);
1382
-
1383
- assert.equal(
1384
- host.chatContainer.children.length,
1385
- 1,
1386
- "agent_end must NOT remove the streaming component from the DOM (issue #4197)",
1387
- );
1388
- assert.equal(
1389
- host.chatContainer.children[0],
1390
- comp,
1391
- "the same component instance must remain in the DOM after agent_end",
1392
- );
1393
- });
1394
-
1395
- test("chat-controller: agent_end after message_end must not alter DOM", async () => {
1396
- const host = createHost();
1397
- const content = [{ type: "text", text: "complete answer" }];
1398
-
1399
- await handleAgentEvent(host, {
1400
- type: "message_start",
1401
- message: makeAssistant([]),
1402
- } as any);
1403
-
1404
- await handleAgentEvent(host, {
1405
- type: "message_update",
1406
- message: makeAssistant(content),
1407
- assistantMessageEvent: {
1408
- type: "text_delta",
1409
- contentIndex: 0,
1410
- delta: "complete answer",
1411
- partial: makeAssistant(content),
1412
- },
1413
- } as any);
1414
-
1415
- await handleAgentEvent(host, {
1416
- type: "message_end",
1417
- message: makeAssistant(content),
1418
- } as any);
1419
-
1420
- const countAfterMessageEnd = host.chatContainer.children.length;
1421
- assert.ok(countAfterMessageEnd > 0, "component must be present after message_end");
1422
-
1423
- await handleAgentEvent(host, { type: "agent_end" } as any);
1424
-
1425
- assert.equal(
1426
- host.chatContainer.children.length,
1427
- countAfterMessageEnd,
1428
- "agent_end after message_end must not add or remove DOM nodes",
1429
- );
1430
- });