gsd-pi 2.80.0-dev.8b3a59f5c → 2.80.0-dev.b0acf17e9

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 (659) hide show
  1. package/README.md +4 -2
  2. package/dist/claude-cli-check.d.ts +30 -0
  3. package/dist/claude-cli-check.js +18 -7
  4. package/dist/cli.js +0 -19
  5. package/dist/headless-query.d.ts +10 -0
  6. package/dist/headless-query.js +6 -4
  7. package/dist/loader-entrypoint.d.ts +8 -0
  8. package/dist/loader-entrypoint.js +27 -0
  9. package/dist/loader.js +2 -11
  10. package/dist/mcp-server.d.ts +1 -0
  11. package/dist/mcp-server.js +6 -3
  12. package/dist/resources/.managed-resources-content-hash +1 -1
  13. package/dist/resources/GSD-WORKFLOW.md +2 -2
  14. package/dist/resources/extensions/claude-code-cli/readiness.js +18 -7
  15. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +29 -0
  16. package/dist/resources/extensions/github-sync/sync.js +4 -1
  17. package/dist/resources/extensions/gsd/auto/loop.js +103 -9
  18. package/dist/resources/extensions/gsd/auto/phases.js +240 -139
  19. package/dist/resources/extensions/gsd/auto/resolve.js +29 -0
  20. package/dist/resources/extensions/gsd/auto/run-unit.js +22 -30
  21. package/dist/resources/extensions/gsd/auto/session.js +8 -0
  22. package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +33 -1
  23. package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +9 -1
  24. package/dist/resources/extensions/gsd/auto-direct-dispatch.js +5 -32
  25. package/dist/resources/extensions/gsd/auto-dispatch.js +26 -0
  26. package/dist/resources/extensions/gsd/auto-post-unit.js +103 -86
  27. package/dist/resources/extensions/gsd/auto-prompts.js +214 -17
  28. package/dist/resources/extensions/gsd/auto-recovery.js +43 -1
  29. package/dist/resources/extensions/gsd/auto-start.js +240 -15
  30. package/dist/resources/extensions/gsd/auto-supervisor.js +8 -1
  31. package/dist/resources/extensions/gsd/auto-timeout-recovery.js +2 -2
  32. package/dist/resources/extensions/gsd/auto-worktree.js +165 -28
  33. package/dist/resources/extensions/gsd/auto.js +165 -45
  34. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +99 -10
  35. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +50 -37
  36. package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +35 -10
  37. package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +36 -20
  38. package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +10 -1
  39. package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +12 -4
  40. package/dist/resources/extensions/gsd/bootstrap/query-tools.js +11 -3
  41. package/dist/resources/extensions/gsd/bootstrap/register-extension.js +1 -1
  42. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +319 -54
  43. package/dist/resources/extensions/gsd/bootstrap/system-context.js +82 -23
  44. package/dist/resources/extensions/gsd/clean-root-preflight.js +65 -9
  45. package/dist/resources/extensions/gsd/commands/dispatcher.js +5 -0
  46. package/dist/resources/extensions/gsd/commands/handlers/ops.js +2 -2
  47. package/dist/resources/extensions/gsd/commands-config.js +1 -1
  48. package/dist/resources/extensions/gsd/commands-handlers.js +23 -9
  49. package/dist/resources/extensions/gsd/context-budget.js +37 -2
  50. package/dist/resources/extensions/gsd/crash-recovery.js +56 -10
  51. package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
  52. package/dist/resources/extensions/gsd/db/unit-dispatches.js +92 -0
  53. package/dist/resources/extensions/gsd/db-base-schema.js +4 -2
  54. package/dist/resources/extensions/gsd/db-migration-steps.js +6 -0
  55. package/dist/resources/extensions/gsd/detection.js +106 -0
  56. package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +2 -0
  57. package/dist/resources/extensions/gsd/git-service.js +73 -5
  58. package/dist/resources/extensions/gsd/gsd-db.js +46 -13
  59. package/dist/resources/extensions/gsd/guided-flow.js +143 -48
  60. package/dist/resources/extensions/gsd/init-wizard.js +4 -1
  61. package/dist/resources/extensions/gsd/memory-store.js +69 -12
  62. package/dist/resources/extensions/gsd/migrate/command.js +40 -1
  63. package/dist/resources/extensions/gsd/migration-auto-check.js +87 -0
  64. package/dist/resources/extensions/gsd/native-git-bridge.js +32 -8
  65. package/dist/resources/extensions/gsd/orphan-stash-audit.js +101 -0
  66. package/dist/resources/extensions/gsd/parallel-orchestrator.js +13 -3
  67. package/dist/resources/extensions/gsd/planning-path-scope.js +26 -0
  68. package/dist/resources/extensions/gsd/pre-execution-checks.js +22 -0
  69. package/dist/resources/extensions/gsd/prompt-loader.js +28 -2
  70. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +21 -19
  71. package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  72. package/dist/resources/extensions/gsd/prompts/execute-task.md +4 -2
  73. package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
  74. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
  75. package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  76. package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -5
  77. package/dist/resources/extensions/gsd/prompts/replan-slice.md +2 -2
  78. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
  79. package/dist/resources/extensions/gsd/quick.js +34 -2
  80. package/dist/resources/extensions/gsd/safety/evidence-collector.js +10 -2
  81. package/dist/resources/extensions/gsd/slice-cadence.js +45 -2
  82. package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +15 -9
  83. package/dist/resources/extensions/gsd/tools/complete-task.js +1 -1
  84. package/dist/resources/extensions/gsd/tools/context-mode-tool-result.js +15 -0
  85. package/dist/resources/extensions/gsd/tools/exec-search-tool.js +5 -0
  86. package/dist/resources/extensions/gsd/tools/exec-tool.js +3 -15
  87. package/dist/resources/extensions/gsd/tools/memory-tools.js +1 -0
  88. package/dist/resources/extensions/gsd/tools/plan-slice.js +9 -0
  89. package/dist/resources/extensions/gsd/tools/plan-task.js +9 -0
  90. package/dist/resources/extensions/gsd/tools/resume-tool.js +5 -0
  91. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +1 -1
  92. package/dist/resources/extensions/gsd/unit-context-composer.js +12 -3
  93. package/dist/resources/extensions/gsd/unit-runtime.js +22 -0
  94. package/dist/resources/extensions/gsd/workflow-protocol.js +131 -0
  95. package/dist/resources/extensions/gsd/worktree-manager.js +16 -14
  96. package/dist/resources/extensions/gsd/worktree-resolver.js +90 -22
  97. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  98. package/dist/web/standalone/.next/BUILD_ID +1 -1
  99. package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
  100. package/dist/web/standalone/.next/build-manifest.json +3 -3
  101. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  102. package/dist/web/standalone/.next/react-loadable-manifest.json +2 -2
  103. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  104. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  105. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  106. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  107. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  108. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  109. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  110. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  111. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  112. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  113. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  114. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  115. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  116. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  117. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  118. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  119. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  120. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  121. package/dist/web/standalone/.next/server/app/index.html +1 -1
  122. package/dist/web/standalone/.next/server/app/index.rsc +2 -2
  123. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  124. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
  125. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  126. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  127. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  128. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  129. package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
  130. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  131. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  132. package/dist/web/standalone/.next/server/middleware.js +3 -3
  133. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  134. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  135. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  136. package/dist/web/standalone/.next/static/chunks/8359.e059d86b255fce1c.js +10 -0
  137. package/dist/web/standalone/.next/static/chunks/app/{page-fab3ebb85b006001.js → page-752f1e2ebdaa3e45.js} +1 -1
  138. package/dist/web/standalone/.next/static/chunks/{webpack-0481f1221120a7c6.js → webpack-de742b64187e13fe.js} +1 -1
  139. package/dist/welcome-screen.d.ts +2 -0
  140. package/dist/welcome-screen.js +9 -7
  141. package/package.json +6 -4
  142. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  143. package/packages/mcp-server/dist/workflow-tools.js +22 -17
  144. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  145. package/packages/mcp-server/src/workflow-tools.test.ts +75 -2
  146. package/packages/mcp-server/src/workflow-tools.ts +30 -16
  147. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  148. package/packages/native/tsconfig.tsbuildinfo +1 -1
  149. package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  150. package/packages/pi-agent-core/dist/agent-loop.js +4 -1
  151. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
  152. package/packages/pi-agent-core/dist/agent.d.ts +5 -0
  153. package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
  154. package/packages/pi-agent-core/dist/agent.js +2 -0
  155. package/packages/pi-agent-core/dist/agent.js.map +1 -1
  156. package/packages/pi-agent-core/dist/index.d.ts +1 -0
  157. package/packages/pi-agent-core/dist/index.d.ts.map +1 -1
  158. package/packages/pi-agent-core/dist/index.js +2 -0
  159. package/packages/pi-agent-core/dist/index.js.map +1 -1
  160. package/packages/pi-agent-core/dist/token-audit.d.ts +47 -0
  161. package/packages/pi-agent-core/dist/token-audit.d.ts.map +1 -0
  162. package/packages/pi-agent-core/dist/token-audit.js +221 -0
  163. package/packages/pi-agent-core/dist/token-audit.js.map +1 -0
  164. package/packages/pi-agent-core/dist/types.d.ts +9 -0
  165. package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
  166. package/packages/pi-agent-core/dist/types.js.map +1 -1
  167. package/packages/pi-agent-core/src/agent-loop.test.ts +128 -0
  168. package/packages/pi-agent-core/src/agent-loop.ts +4 -1
  169. package/packages/pi-agent-core/src/agent.ts +8 -0
  170. package/packages/pi-agent-core/src/index.ts +2 -0
  171. package/packages/pi-agent-core/src/token-audit.test.ts +189 -0
  172. package/packages/pi-agent-core/src/token-audit.ts +287 -0
  173. package/packages/pi-agent-core/src/types.ts +14 -0
  174. package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
  175. package/packages/pi-ai/dist/providers/anthropic-auth.test.js +35 -13
  176. package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
  177. package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +21 -11
  178. package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -1
  179. package/packages/pi-ai/dist/providers/anthropic.d.ts +7 -0
  180. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  181. package/packages/pi-ai/dist/providers/anthropic.js +9 -7
  182. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  183. package/packages/pi-ai/dist/providers/minimax-tool-name.test.js +23 -14
  184. package/packages/pi-ai/dist/providers/minimax-tool-name.test.js.map +1 -1
  185. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +48 -21
  186. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
  187. package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +22 -21
  188. package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -1
  189. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +22 -21
  190. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -1
  191. package/packages/pi-ai/src/providers/anthropic-auth.test.ts +39 -25
  192. package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -22
  193. package/packages/pi-ai/src/providers/anthropic.ts +22 -9
  194. package/packages/pi-ai/src/providers/minimax-tool-name.test.ts +34 -21
  195. package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +56 -22
  196. package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +24 -28
  197. package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +24 -28
  198. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  199. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +32 -0
  200. package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
  201. package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js +18 -0
  202. package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js.map +1 -1
  203. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +12 -0
  204. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  205. package/packages/pi-coding-agent/dist/core/agent-session.js +44 -7
  206. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  207. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +35 -1
  208. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
  209. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +11 -0
  210. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  211. package/packages/pi-coding-agent/dist/core/compaction/compaction.js +9 -0
  212. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  213. package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts +2 -0
  214. package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts.map +1 -0
  215. package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js +103 -0
  216. package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js.map +1 -0
  217. package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts +15 -0
  218. package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts.map +1 -0
  219. package/packages/pi-coding-agent/dist/core/db-snapshot.js +66 -0
  220. package/packages/pi-coding-agent/dist/core/db-snapshot.js.map +1 -0
  221. package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts +2 -0
  222. package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts.map +1 -0
  223. package/packages/pi-coding-agent/dist/core/db-snapshot.test.js +24 -0
  224. package/packages/pi-coding-agent/dist/core/db-snapshot.test.js.map +1 -0
  225. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  226. package/packages/pi-coding-agent/dist/core/extensions/loader.js +8 -0
  227. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  228. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +5 -0
  229. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  230. package/packages/pi-coding-agent/dist/core/extensions/runner.js +20 -7
  231. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  232. package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +102 -3
  233. package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
  234. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +41 -3
  235. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  236. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  237. package/packages/pi-coding-agent/dist/core/hooks-runner.test.js +2 -0
  238. package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -1
  239. package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts +2 -0
  240. package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts.map +1 -0
  241. package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js +46 -0
  242. package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js.map +1 -0
  243. package/packages/pi-coding-agent/dist/core/sdk.d.ts +10 -2
  244. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  245. package/packages/pi-coding-agent/dist/core/sdk.js +74 -2
  246. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  247. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +20 -0
  248. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  249. package/packages/pi-coding-agent/dist/core/settings-manager.js +25 -0
  250. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  251. package/packages/pi-coding-agent/dist/core/skill-tool.test.js +22 -0
  252. package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
  253. package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +6 -7
  254. package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
  255. package/packages/pi-coding-agent/dist/core/system-prompt.js +2 -3
  256. package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  257. package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js +22 -56
  258. package/packages/pi-coding-agent/dist/core/tools/bash-spawn-windows.test.js.map +1 -1
  259. package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +1 -0
  260. package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
  261. package/packages/pi-coding-agent/dist/core/tools/bash.js +3 -1
  262. package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
  263. package/packages/pi-coding-agent/dist/core/tools/edit.d.ts +2 -0
  264. package/packages/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
  265. package/packages/pi-coding-agent/dist/core/tools/edit.js +12 -1
  266. package/packages/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
  267. package/packages/pi-coding-agent/dist/core/tools/find.d.ts +2 -0
  268. package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  269. package/packages/pi-coding-agent/dist/core/tools/find.js +14 -6
  270. package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  271. package/packages/pi-coding-agent/dist/core/tools/grep.d.ts +2 -0
  272. package/packages/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
  273. package/packages/pi-coding-agent/dist/core/tools/grep.js +12 -3
  274. package/packages/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
  275. package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts +2 -0
  276. package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -1
  277. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +3 -1
  278. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -1
  279. package/packages/pi-coding-agent/dist/core/tools/index.d.ts +2 -1
  280. package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
  281. package/packages/pi-coding-agent/dist/core/tools/index.js +1 -0
  282. package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
  283. package/packages/pi-coding-agent/dist/core/tools/ls.d.ts +2 -0
  284. package/packages/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
  285. package/packages/pi-coding-agent/dist/core/tools/ls.js +10 -3
  286. package/packages/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
  287. package/packages/pi-coding-agent/dist/core/tools/read.d.ts +2 -0
  288. package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  289. package/packages/pi-coding-agent/dist/core/tools/read.js +3 -1
  290. package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  291. package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js +7 -62
  292. package/packages/pi-coding-agent/dist/core/tools/spawn-shell-windows.test.js.map +1 -1
  293. package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts +2 -0
  294. package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.d.ts.map +1 -0
  295. package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js +115 -0
  296. package/packages/pi-coding-agent/dist/core/tools/tool-target-metadata.test.js.map +1 -0
  297. package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts +19 -0
  298. package/packages/pi-coding-agent/dist/core/tools/tool-target.d.ts.map +1 -0
  299. package/packages/pi-coding-agent/dist/core/tools/tool-target.js +20 -0
  300. package/packages/pi-coding-agent/dist/core/tools/tool-target.js.map +1 -0
  301. package/packages/pi-coding-agent/dist/core/tools/write.d.ts +4 -0
  302. package/packages/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
  303. package/packages/pi-coding-agent/dist/core/tools/write.js +9 -1
  304. package/packages/pi-coding-agent/dist/core/tools/write.js.map +1 -1
  305. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js +6 -4
  306. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -1
  307. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +114 -22
  308. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  309. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +2 -2
  310. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -1
  311. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  312. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
  313. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
  314. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +2 -1
  315. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
  316. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +7 -6
  317. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
  318. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +6 -0
  319. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  320. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +177 -19
  321. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  322. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  323. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +33 -6
  324. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  325. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +71 -0
  326. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
  327. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  328. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +3 -0
  329. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  330. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  331. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +36 -27
  332. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
  333. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +21 -0
  334. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -1
  335. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts +2 -0
  336. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts.map +1 -0
  337. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +28 -0
  338. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -0
  339. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
  340. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +3 -2
  341. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
  342. package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +36 -0
  343. package/packages/pi-coding-agent/src/core/agent-session-tool-refresh.test.ts +25 -0
  344. package/packages/pi-coding-agent/src/core/agent-session.ts +48 -7
  345. package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +41 -1
  346. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +18 -0
  347. package/packages/pi-coding-agent/src/core/compaction-threshold.test.ts +121 -0
  348. package/packages/pi-coding-agent/src/core/db-snapshot.test.ts +32 -0
  349. package/packages/pi-coding-agent/src/core/db-snapshot.ts +66 -0
  350. package/packages/pi-coding-agent/src/core/extensions/loader.ts +10 -0
  351. package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +113 -3
  352. package/packages/pi-coding-agent/src/core/extensions/runner.ts +24 -6
  353. package/packages/pi-coding-agent/src/core/extensions/types.ts +44 -2
  354. package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +2 -0
  355. package/packages/pi-coding-agent/src/core/sdk-tool-filter.test.ts +60 -0
  356. package/packages/pi-coding-agent/src/core/sdk.ts +85 -3
  357. package/packages/pi-coding-agent/src/core/settings-manager.ts +39 -1
  358. package/packages/pi-coding-agent/src/core/skill-tool.test.ts +28 -0
  359. package/packages/pi-coding-agent/src/core/system-prompt.ts +8 -10
  360. package/packages/pi-coding-agent/src/core/tools/bash-spawn-windows.test.ts +22 -66
  361. package/packages/pi-coding-agent/src/core/tools/bash.ts +4 -1
  362. package/packages/pi-coding-agent/src/core/tools/edit.ts +13 -1
  363. package/packages/pi-coding-agent/src/core/tools/find.ts +15 -6
  364. package/packages/pi-coding-agent/src/core/tools/grep.ts +13 -3
  365. package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +4 -1
  366. package/packages/pi-coding-agent/src/core/tools/index.ts +8 -0
  367. package/packages/pi-coding-agent/src/core/tools/ls.ts +11 -3
  368. package/packages/pi-coding-agent/src/core/tools/read.ts +4 -1
  369. package/packages/pi-coding-agent/src/core/tools/spawn-shell-windows.test.ts +11 -72
  370. package/packages/pi-coding-agent/src/core/tools/tool-target-metadata.test.ts +127 -0
  371. package/packages/pi-coding-agent/src/core/tools/tool-target.ts +48 -0
  372. package/packages/pi-coding-agent/src/core/tools/write.ts +14 -2
  373. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.ts +7 -5
  374. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +144 -22
  375. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +2 -2
  376. package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +1 -0
  377. package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +2 -1
  378. package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +10 -9
  379. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +208 -19
  380. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +75 -0
  381. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +41 -8
  382. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +3 -0
  383. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +36 -27
  384. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +25 -0
  385. package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +31 -0
  386. package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +3 -2
  387. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  388. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  389. package/packages/pi-tui/dist/tui.js +18 -8
  390. package/packages/pi-tui/dist/tui.js.map +1 -1
  391. package/packages/pi-tui/src/tui.ts +20 -8
  392. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  393. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  394. package/pkg/dist/modes/interactive/theme/themes.js +36 -27
  395. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
  396. package/src/resources/GSD-WORKFLOW.md +2 -2
  397. package/src/resources/extensions/claude-code-cli/readiness.ts +25 -7
  398. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +30 -0
  399. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +26 -0
  400. package/src/resources/extensions/github-sync/sync.ts +8 -1
  401. package/src/resources/extensions/github-sync/tests/sync-source.test.ts +6 -18
  402. package/src/resources/extensions/gsd/auto/loop-deps.ts +3 -2
  403. package/src/resources/extensions/gsd/auto/loop.ts +134 -16
  404. package/src/resources/extensions/gsd/auto/phases.ts +328 -200
  405. package/src/resources/extensions/gsd/auto/resolve.ts +42 -1
  406. package/src/resources/extensions/gsd/auto/run-unit.ts +28 -30
  407. package/src/resources/extensions/gsd/auto/session.ts +8 -0
  408. package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +63 -1
  409. package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +14 -1
  410. package/src/resources/extensions/gsd/auto-direct-dispatch.ts +8 -34
  411. package/src/resources/extensions/gsd/auto-dispatch.ts +33 -0
  412. package/src/resources/extensions/gsd/auto-post-unit.ts +116 -88
  413. package/src/resources/extensions/gsd/auto-prompts.ts +228 -16
  414. package/src/resources/extensions/gsd/auto-recovery.ts +54 -0
  415. package/src/resources/extensions/gsd/auto-start.ts +293 -21
  416. package/src/resources/extensions/gsd/auto-supervisor.ts +7 -0
  417. package/src/resources/extensions/gsd/auto-timeout-recovery.ts +2 -2
  418. package/src/resources/extensions/gsd/auto-worktree.ts +199 -30
  419. package/src/resources/extensions/gsd/auto.ts +216 -40
  420. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +120 -8
  421. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +51 -37
  422. package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +35 -10
  423. package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +38 -19
  424. package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +11 -1
  425. package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +13 -4
  426. package/src/resources/extensions/gsd/bootstrap/query-tools.ts +12 -3
  427. package/src/resources/extensions/gsd/bootstrap/register-extension.ts +1 -1
  428. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +369 -54
  429. package/src/resources/extensions/gsd/bootstrap/system-context.ts +90 -22
  430. package/src/resources/extensions/gsd/clean-root-preflight.ts +72 -9
  431. package/src/resources/extensions/gsd/commands/dispatcher.ts +6 -0
  432. package/src/resources/extensions/gsd/commands/handlers/ops.ts +4 -2
  433. package/src/resources/extensions/gsd/commands-config.ts +1 -1
  434. package/src/resources/extensions/gsd/commands-handlers.ts +34 -15
  435. package/src/resources/extensions/gsd/context-budget.ts +44 -2
  436. package/src/resources/extensions/gsd/crash-recovery.ts +67 -10
  437. package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
  438. package/src/resources/extensions/gsd/db/unit-dispatches.ts +107 -0
  439. package/src/resources/extensions/gsd/db-base-schema.ts +4 -2
  440. package/src/resources/extensions/gsd/db-migration-steps.ts +8 -0
  441. package/src/resources/extensions/gsd/detection.ts +128 -0
  442. package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +3 -0
  443. package/src/resources/extensions/gsd/git-service.ts +87 -10
  444. package/src/resources/extensions/gsd/gsd-db.ts +50 -13
  445. package/src/resources/extensions/gsd/guided-flow.ts +169 -55
  446. package/src/resources/extensions/gsd/init-wizard.ts +5 -1
  447. package/src/resources/extensions/gsd/memory-store.ts +77 -12
  448. package/src/resources/extensions/gsd/migrate/command.ts +47 -1
  449. package/src/resources/extensions/gsd/migration-auto-check.ts +129 -0
  450. package/src/resources/extensions/gsd/native-git-bridge.ts +39 -6
  451. package/src/resources/extensions/gsd/orphan-stash-audit.ts +117 -0
  452. package/src/resources/extensions/gsd/parallel-orchestrator.ts +13 -3
  453. package/src/resources/extensions/gsd/planning-path-scope.ts +35 -0
  454. package/src/resources/extensions/gsd/pre-execution-checks.ts +23 -0
  455. package/src/resources/extensions/gsd/preferences-types.ts +1 -1
  456. package/src/resources/extensions/gsd/prompt-loader.ts +27 -2
  457. package/src/resources/extensions/gsd/prompts/complete-milestone.md +21 -19
  458. package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  459. package/src/resources/extensions/gsd/prompts/execute-task.md +4 -2
  460. package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
  461. package/src/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
  462. package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  463. package/src/resources/extensions/gsd/prompts/quick-task.md +1 -5
  464. package/src/resources/extensions/gsd/prompts/replan-slice.md +2 -2
  465. package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
  466. package/src/resources/extensions/gsd/quick.ts +37 -2
  467. package/src/resources/extensions/gsd/safety/evidence-collector.ts +11 -2
  468. package/src/resources/extensions/gsd/slice-cadence.ts +49 -2
  469. package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +23 -9
  470. package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +59 -89
  471. package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +47 -172
  472. package/src/resources/extensions/gsd/tests/artifacts-table-preserved-on-cache-invalidate.test.ts +0 -35
  473. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +35 -9
  474. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +433 -11
  475. package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +80 -59
  476. package/src/resources/extensions/gsd/tests/auto-paused-session-validation.test.ts +3 -47
  477. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +76 -18
  478. package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +160 -11
  479. package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +54 -95
  480. package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +67 -26
  481. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +14 -1
  482. package/src/resources/extensions/gsd/tests/auto-remediate-slice-status.test.ts +32 -30
  483. package/src/resources/extensions/gsd/tests/auto-start-bootstrap-await-3420.test.ts +32 -128
  484. package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +20 -54
  485. package/src/resources/extensions/gsd/tests/auto-start-cold-db-bootstrap.test.ts +20 -30
  486. package/src/resources/extensions/gsd/tests/auto-start-index-lock.test.ts +17 -29
  487. package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +138 -0
  488. package/src/resources/extensions/gsd/tests/auto-start-time-persistence.test.ts +21 -39
  489. package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +15 -24
  490. package/src/resources/extensions/gsd/tests/auto-thinking-restore.test.ts +44 -29
  491. package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +39 -51
  492. package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +159 -213
  493. package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +15 -32
  494. package/src/resources/extensions/gsd/tests/browser-teardown.test.ts +0 -41
  495. package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +97 -2
  496. package/src/resources/extensions/gsd/tests/clear-stale-autostart.test.ts +34 -27
  497. package/src/resources/extensions/gsd/tests/cmux.test.ts +42 -53
  498. package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +39 -61
  499. package/src/resources/extensions/gsd/tests/commands-config.test.ts +26 -19
  500. package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +14 -1
  501. package/src/resources/extensions/gsd/tests/complete-milestone-excerpt.test.ts +31 -0
  502. package/src/resources/extensions/gsd/tests/complete-slice-composer.test.ts +3 -2
  503. package/src/resources/extensions/gsd/tests/complete-task-normalize-lists.test.ts +29 -33
  504. package/src/resources/extensions/gsd/tests/completed-units-metrics-sync.test.ts +45 -108
  505. package/src/resources/extensions/gsd/tests/context-budget.test.ts +10 -1
  506. package/src/resources/extensions/gsd/tests/context-store.test.ts +7 -1
  507. package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +90 -31
  508. package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +22 -0
  509. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +5 -1
  510. package/src/resources/extensions/gsd/tests/cwd-fallback-hardening.test.ts +138 -0
  511. package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +4 -68
  512. package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +4 -9
  513. package/src/resources/extensions/gsd/tests/deferred-milestone-dir-4996.test.ts +14 -65
  514. package/src/resources/extensions/gsd/tests/detection.test.ts +140 -0
  515. package/src/resources/extensions/gsd/tests/discuss-tool-scoping.test.ts +44 -37
  516. package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +58 -40
  517. package/src/resources/extensions/gsd/tests/dispatch-guard-closed-status.test.ts +25 -15
  518. package/src/resources/extensions/gsd/tests/dispatch-rule-coverage.test.ts +313 -0
  519. package/src/resources/extensions/gsd/tests/dispatcher-stuck-planning.test.ts +35 -17
  520. package/src/resources/extensions/gsd/tests/error-success-mask.test.ts +16 -21
  521. package/src/resources/extensions/gsd/tests/est-annotation-timeout.test.ts +15 -82
  522. package/src/resources/extensions/gsd/tests/exec-history.test.ts +15 -0
  523. package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +65 -0
  524. package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +5 -2
  525. package/src/resources/extensions/gsd/tests/fast-forward-reused-milestone-branch.test.ts +219 -0
  526. package/src/resources/extensions/gsd/tests/finalize-survivor-branch.test.ts +132 -0
  527. package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +2 -20
  528. package/src/resources/extensions/gsd/tests/frontmatter-parse-noise.test.ts +18 -26
  529. package/src/resources/extensions/gsd/tests/has-pending-deep-stage.test.ts +33 -1
  530. package/src/resources/extensions/gsd/tests/init-skip-git.test.ts +9 -12
  531. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +35 -0
  532. package/src/resources/extensions/gsd/tests/integration/git-locale.test.ts +31 -20
  533. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +66 -0
  534. package/src/resources/extensions/gsd/tests/integration/milestone-transition-worktree.test.ts +0 -47
  535. package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +60 -202
  536. package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +13 -56
  537. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +239 -1
  538. package/src/resources/extensions/gsd/tests/journal-query-tool.test.ts +32 -0
  539. package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -0
  540. package/src/resources/extensions/gsd/tests/lazy-pi-tui-import.test.ts +44 -6
  541. package/src/resources/extensions/gsd/tests/memory-decay-factor.test.ts +90 -0
  542. package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +21 -35
  543. package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +1 -0
  544. package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +48 -0
  545. package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +127 -0
  546. package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +242 -0
  547. package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +79 -98
  548. package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +70 -278
  549. package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +34 -2
  550. package/src/resources/extensions/gsd/tests/needs-remediation-revalidation.test.ts +37 -30
  551. package/src/resources/extensions/gsd/tests/note-captures-executed.test.ts +32 -28
  552. package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +3 -0
  553. package/src/resources/extensions/gsd/tests/orphan-merge-bootstrap.test.ts +133 -0
  554. package/src/resources/extensions/gsd/tests/orphan-stash-audit.test.ts +201 -0
  555. package/src/resources/extensions/gsd/tests/parallel-orchestrator-fast-forward.test.ts +113 -0
  556. package/src/resources/extensions/gsd/tests/phantom-ghost-detection.test.ts +24 -37
  557. package/src/resources/extensions/gsd/tests/phantom-milestone-default-queued.test.ts +9 -24
  558. package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +91 -75
  559. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +50 -0
  560. package/src/resources/extensions/gsd/tests/plan-task.test.ts +21 -0
  561. package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +36 -22
  562. package/src/resources/extensions/gsd/tests/pre-exec-backtick-strip.test.ts +36 -30
  563. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +45 -5
  564. package/src/resources/extensions/gsd/tests/preferences-worktree-sync.test.ts +20 -22
  565. package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +130 -32
  566. package/src/resources/extensions/gsd/tests/project-root-cwd-crash.test.ts +18 -36
  567. package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +35 -73
  568. package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +76 -138
  569. package/src/resources/extensions/gsd/tests/prompt-duplication-cuts.test.ts +230 -0
  570. package/src/resources/extensions/gsd/tests/prompt-path-audit.test.ts +40 -0
  571. package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +70 -106
  572. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +59 -161
  573. package/src/resources/extensions/gsd/tests/query-tools-db-open.test.ts +33 -29
  574. package/src/resources/extensions/gsd/tests/queue-auto-guard.test.ts +22 -196
  575. package/src/resources/extensions/gsd/tests/quick-auto-guard.test.ts +23 -93
  576. package/src/resources/extensions/gsd/tests/quick-external-gsd.test.ts +40 -0
  577. package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +50 -79
  578. package/src/resources/extensions/gsd/tests/reassess-default-optin.test.ts +27 -13
  579. package/src/resources/extensions/gsd/tests/remote-questions.test.ts +151 -251
  580. package/src/resources/extensions/gsd/tests/resource-loader-import-path.test.ts +41 -29
  581. package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +58 -69
  582. package/src/resources/extensions/gsd/tests/resume-dispatch-worktree.test.ts +32 -164
  583. package/src/resources/extensions/gsd/tests/right-sized-workflow-prompts.test.ts +192 -0
  584. package/src/resources/extensions/gsd/tests/run-uat-replay-cap.test.ts +57 -41
  585. package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +29 -0
  586. package/src/resources/extensions/gsd/tests/schema-v27-v28-sequence.test.ts +156 -0
  587. package/src/resources/extensions/gsd/tests/select-resumable-milestone.test.ts +96 -0
  588. package/src/resources/extensions/gsd/tests/session-model-override.test.ts +14 -9
  589. package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +77 -0
  590. package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +166 -0
  591. package/src/resources/extensions/gsd/tests/show-config-command.test.ts +44 -42
  592. package/src/resources/extensions/gsd/tests/signal-handlers.test.ts +27 -0
  593. package/src/resources/extensions/gsd/tests/skip-slice-state-rebuild.test.ts +56 -24
  594. package/src/resources/extensions/gsd/tests/skipped-validation-db-atomicity.test.ts +51 -11
  595. package/src/resources/extensions/gsd/tests/slice-cadence.test.ts +23 -0
  596. package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +66 -50
  597. package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +68 -107
  598. package/src/resources/extensions/gsd/tests/slice-sequence-insert.test.ts +115 -42
  599. package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +21 -59
  600. package/src/resources/extensions/gsd/tests/smart-entry-draft.test.ts +25 -116
  601. package/src/resources/extensions/gsd/tests/sqlite-unavailable-gate.test.ts +21 -57
  602. package/src/resources/extensions/gsd/tests/stale-dirlistcache-4648.test.ts +29 -76
  603. package/src/resources/extensions/gsd/tests/stale-lockfile-recovery.test.ts +33 -24
  604. package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +39 -30
  605. package/src/resources/extensions/gsd/tests/stalled-tool-recovery.test.ts +49 -1
  606. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +101 -2
  607. package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +1 -0
  608. package/src/resources/extensions/gsd/tests/status-db-open.test.ts +35 -40
  609. package/src/resources/extensions/gsd/tests/stop-auto-merge-back.test.ts +36 -45
  610. package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +14 -102
  611. package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +78 -232
  612. package/src/resources/extensions/gsd/tests/sync-worktree-skip-current.test.ts +32 -35
  613. package/src/resources/extensions/gsd/tests/system-context-memory.test.ts +112 -0
  614. package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +7 -9
  615. package/src/resources/extensions/gsd/tests/token-profile.test.ts +84 -309
  616. package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +291 -0
  617. package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +134 -341
  618. package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +136 -4
  619. package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +8 -25
  620. package/src/resources/extensions/gsd/tests/unit-dispatches.test.ts +80 -1
  621. package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +37 -0
  622. package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +5 -99
  623. package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +43 -36
  624. package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +84 -444
  625. package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +142 -0
  626. package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +44 -189
  627. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -57
  628. package/src/resources/extensions/gsd/tests/workflow-protocol-excerpt.test.ts +99 -0
  629. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +3 -0
  630. package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +32 -1
  631. package/src/resources/extensions/gsd/tests/worktree-db-same-file.test.ts +21 -44
  632. package/src/resources/extensions/gsd/tests/worktree-expected-warnings.test.ts +27 -26
  633. package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +38 -6
  634. package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +1 -0
  635. package/src/resources/extensions/gsd/tests/worktree-main-branch.test.ts +20 -18
  636. package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +7 -0
  637. package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +9 -2
  638. package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +22 -19
  639. package/src/resources/extensions/gsd/tests/worktree-project-root-degrade.test.ts +66 -0
  640. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +203 -4
  641. package/src/resources/extensions/gsd/tests/zero-slice-roadmap-guided.test.ts +19 -13
  642. package/src/resources/extensions/gsd/tools/complete-task.ts +1 -1
  643. package/src/resources/extensions/gsd/tools/context-mode-tool-result.ts +25 -0
  644. package/src/resources/extensions/gsd/tools/exec-search-tool.ts +7 -7
  645. package/src/resources/extensions/gsd/tools/exec-tool.ts +4 -23
  646. package/src/resources/extensions/gsd/tools/memory-tools.ts +1 -0
  647. package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -0
  648. package/src/resources/extensions/gsd/tools/plan-task.ts +10 -0
  649. package/src/resources/extensions/gsd/tools/resume-tool.ts +7 -7
  650. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +1 -1
  651. package/src/resources/extensions/gsd/unit-context-composer.ts +19 -4
  652. package/src/resources/extensions/gsd/unit-runtime.ts +25 -0
  653. package/src/resources/extensions/gsd/workflow-protocol.ts +160 -0
  654. package/src/resources/extensions/gsd/worktree-manager.ts +15 -4
  655. package/src/resources/extensions/gsd/worktree-resolver.ts +119 -20
  656. package/src/resources/skills/create-gsd-extension/templates/templates.test.ts +86 -40
  657. package/dist/web/standalone/.next/static/chunks/8336.631939fb583761fa.js +0 -10
  658. /package/dist/web/standalone/.next/static/{k-MDjzPMF62Rg1-FR437h → naNyn5ToUBzCQtuLbEYXC}/_buildManifest.js +0 -0
  659. /package/dist/web/standalone/.next/static/{k-MDjzPMF62Rg1-FR437h → naNyn5ToUBzCQtuLbEYXC}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"tool-card-cleanup-and-success-runtime.test.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,sBAAsB;AACtB,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC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ression tests for the post-compaction tool-card cleanup and the\n// green-bordered success-notification rendering. Replaces the source-grep\n// `src/tests/tui-running-and-success-box.test.ts` that was deleted in #4875\n// (tracked as #4872).\n//\n// The previous tests asserted on identifier presence and method signature\n// shape via regex. A regression that routed `success` notifications through\n// `showStatus` (dim text) by accident would not have failed because the\n// `showSuccess` method would still exist and still match the regex. These\n// tests instead drive the components through the actual scenario and assert\n// on rendered output.\n\nimport assert from \"node:assert/strict\";\nimport { describe, it, before } from \"node:test\";\n\nimport { Container, Text } from \"@gsd/pi-tui\";\nimport stripAnsi from \"strip-ansi\";\n\nimport { initTheme, theme } from \"../theme/theme.js\";\nimport { renderExtensionNotifyInChat, shouldRenderExtensionNotifyInChat } from \"../interactive-mode.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { ToolExecutionComponent } from \"./tool-execution.js\";\n\n// Theme is a globalThis-shared singleton that throws if not initialized.\n// Initialize once before any test that exercises themed rendering.\nbefore(() => {\n\tinitTheme(\"dark\");\n});\n\ndescribe(\"Extension warning notifications\", () => {\n\tit(\"do not render into chat output\", () => {\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"warning\"), false);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"error\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"success\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"info\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(undefined), true);\n\n\t\tconst warningChat = new Container();\n\t\tconst warningResult = renderExtensionNotifyInChat(warningChat, \"extension warning\", \"warning\");\n\t\tassert.equal(warningResult.rendered, false);\n\t\tassert.equal(\n\t\t\twarningChat.render(80).map(stripAnsi).join(\"\\n\"),\n\t\t\t\"\",\n\t\t\t\"warning notifications must not add chat output\",\n\t\t);\n\n\t\tfor (const type of [\"error\", \"success\", \"info\"] as const) {\n\t\t\tconst chat = new Container();\n\t\t\tconst result = renderExtensionNotifyInChat(chat, `${type} notification`, type);\n\t\t\tassert.equal(result.rendered, true, `${type} notification should render`);\n\t\t\tassert.match(\n\t\t\t\tchat.render(80).map(stripAnsi).join(\"\\n\"),\n\t\t\t\tnew RegExp(`${type} notification`),\n\t\t\t\t`${type} notification text should appear in chat output`,\n\t\t\t);\n\t\t}\n\t});\n});\n\ninterface MockTui {\n\trenderCount: number;\n\trequestRender(): void;\n}\n\nfunction makeMockTUI(): MockTui {\n\treturn {\n\t\trenderCount: 0,\n\t\trequestRender() {\n\t\t\tthis.renderCount++;\n\t\t},\n\t};\n}\n\n// ─── Bug 1: tool cards stuck in \"Running\" after compaction ──────────────\n\ndescribe(\"ToolExecutionComponent post-compaction cleanup\", () => {\n\tit(\"renders 'Running' status while the tool call has no result\", () => {\n\t\t// Baseline: a freshly-constructed component (mid-stream) must show\n\t\t// the running badge — this is the state we need to flip OUT of when\n\t\t// compaction removes the result message.\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\t\tconst rendered = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\trendered.includes(\"Running\"),\n\t\t\t\"freshly constructed component should render 'Running' badge\",\n\t\t);\n\t});\n\n\tit(\"markHistoricalNoResult flips a stuck tool card OUT of 'Running'\", () => {\n\t\t// Real bug: after session-history replay (post-compaction or session\n\t\t// switch), tool calls without matching tool_result messages stay in\n\t\t// isPartial = true forever. markHistoricalNoResult must produce a\n\t\t// rendered output that no longer reads \"Running\".\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\n\t\tc.markHistoricalNoResult();\n\n\t\tconst rendered = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\t!rendered.includes(\"Running\"),\n\t\t\t\"after markHistoricalNoResult, the tool card must NOT render 'Running' — got:\\n\" +\n\t\t\t\trendered,\n\t\t);\n\t\tassert.ok(\n\t\t\trendered.includes(\"Done\"),\n\t\t\t\"flipped card should render 'Done' status (no-result success)\",\n\t\t);\n\t});\n\n\tit(\"markHistoricalNoResult is idempotent when a real result already exists\", () => {\n\t\t// Late-arriving stream events must not clobber legitimate results.\n\t\t// We observe the no-clobber via behaviour: a card that completed\n\t\t// with a real result keeps its \"Done\" badge and content even if\n\t\t// markHistoricalNoResult fires again afterwards.\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\n\t\t// Use the public completion path the runtime calls.\n\t\tc.updateResult(\n\t\t\t{\n\t\t\t\tcontent: [{ type: \"text\", text: \"real-result-payload\" }],\n\t\t\t\tisError: false,\n\t\t\t},\n\t\t\tfalse, // isPartial = false → \"Done\"\n\t\t);\n\n\t\tconst before = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(before.includes(\"Done\"), \"after complete(), card shows 'Done'\");\n\n\t\tc.markHistoricalNoResult(); // must early-return\n\t\tconst after = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.equal(\n\t\t\tafter,\n\t\t\tbefore,\n\t\t\t\"markHistoricalNoResult must NOT mutate state when a real result is already present\",\n\t\t);\n\t});\n});\n\n// ─── Bug 2: success notifications render as a green bordered box ────────\n\ndescribe(\"Success-notification rendering — DynamicBorder + success theme\", () => {\n\t// We drive the same component composition that interactive-mode.showSuccess\n\t// builds (DynamicBorder + Text + DynamicBorder, all themed with\n\t// theme.fg(\"success\", …)) and assert on the rendered output, rather than\n\t// trying to instantiate the full InteractiveMode (which requires a real\n\t// session, bridge, and TUI runtime).\n\tfunction buildSuccessNotification(message: string): Container {\n\t\tconst c = new Container();\n\t\tconst successColor = (text: string) => theme.fg(\"success\", text);\n\t\tc.addChild(new DynamicBorder(successColor));\n\t\tc.addChild(new Text(theme.fg(\"success\", message), 1, 0));\n\t\tc.addChild(new DynamicBorder(successColor));\n\t\treturn c;\n\t}\n\n\tit(\"renders a top and bottom horizontal border framing the message\", () => {\n\t\tconst c = buildSuccessNotification(\"Milestone M042 ready.\");\n\t\tconst lines = c.render(40);\n\n\t\t// First and last lines should be horizontal-rule borders\n\t\t// (DynamicBorder renders a row of \"─\" characters).\n\t\tconst firstStripped = stripAnsi(lines[0]);\n\t\tconst lastStripped = stripAnsi(lines[lines.length - 1]);\n\n\t\tassert.ok(\n\t\t\tfirstStripped.includes(\"─\"),\n\t\t\t`first line should be a border (got: ${JSON.stringify(firstStripped)})`,\n\t\t);\n\t\tassert.ok(\n\t\t\tlastStripped.includes(\"─\"),\n\t\t\t`last line should be a border (got: ${JSON.stringify(lastStripped)})`,\n\t\t);\n\t\tassert.ok(\n\t\t\tlines.length >= 3,\n\t\t\t`success notification must have at least 3 lines (top border, message, bottom border) — got ${lines.length}`,\n\t\t);\n\t});\n\n\tit(\"the message text appears between the two borders\", () => {\n\t\tconst c = buildSuccessNotification(\"Milestone M042 ready.\");\n\t\tconst lines = c.render(40);\n\n\t\tconst messageRow = lines.findIndex((l) => stripAnsi(l).includes(\"Milestone M042 ready.\"));\n\t\tassert.ok(messageRow > 0, \"message must appear after the top border\");\n\t\tassert.ok(\n\t\t\tmessageRow < lines.length - 1,\n\t\t\t\"message must appear before the bottom border\",\n\t\t);\n\t});\n\n\tit(\"borders carry ANSI styling (not plain dim text like showStatus)\", () => {\n\t\t// Goodhart-resistant: if a regression routed success through\n\t\t// showStatus, the borders would be missing AND the rendered text\n\t\t// would be plain (or only dim-styled, not success-colored). We\n\t\t// observe the border lines carry ANSI escape codes — the literal\n\t\t// foreground color depends on the theme (which is system-dependent\n\t\t// in CI), so we don't pin a specific code but DO require styling\n\t\t// to be present.\n\t\tconst c = buildSuccessNotification(\"ok\");\n\t\tconst lines = c.render(40);\n\t\tconst top = lines[0];\n\t\tassert.ok(\n\t\t\ttop !== stripAnsi(top),\n\t\t\t\"top border must contain ANSI styling — a plain unstyled border \" +\n\t\t\t\t\"would indicate the rendering bypassed theme.fg('success', ...)\",\n\t\t);\n\t});\n\n\tit(\"plain Text status (the showStatus path) does NOT produce a bordered box\", () => {\n\t\t// Counter-test: this is what the bug looked like — a single dim Text\n\t\t// with no surrounding border. If anyone ever \"fixes\" the showSuccess\n\t\t// regression by also adding borders to showStatus, this test will\n\t\t// surface the conflation.\n\t\tconst plain = new Text(theme.fg(\"dim\", \"Milestone M042 ready.\"), 1, 0);\n\t\tconst lines = plain.render(40);\n\t\tconst joined = lines.map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\t!joined.includes(\"─\"),\n\t\t\t\"plain Text (showStatus path) must NOT contain border characters\",\n\t\t);\n\t});\n});\n"]}
1
+ {"version":3,"file":"tool-card-cleanup-and-success-runtime.test.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,sBAAsB;AACtB,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,0EAA0E;AAC1E,4EAA4E;AAC5E,sBAAsB;AAEtB,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AACxG,O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,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,CAAC,EAAE,CACR,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,EACtB,iEAAiE;YAChE,gEAAgE,CACjE,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QAClF,qEAAqE;QACrE,qEAAqE;QACrE,kEAAkE;QAClE,0BAA0B;QAC1B,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,CAAC,EAAE,CACR,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EACrB,iEAAiE,CACjE,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// GSD2 TUI Tests - Runtime coverage for tool-card cleanup and success notification rendering.\n// Runtime regression tests for the post-compaction tool-card cleanup and the\n// green-bordered success-notification rendering. Replaces the source-grep\n// `src/tests/tui-running-and-success-box.test.ts` that was deleted in #4875\n// (tracked as #4872).\n//\n// The previous tests asserted on identifier presence and method signature\n// shape via regex. A regression that routed `success` notifications through\n// `showStatus` (dim text) by accident would not have failed because the\n// `showSuccess` method would still exist and still match the regex. These\n// tests instead drive the components through the actual scenario and assert\n// on rendered output.\n\nimport assert from \"node:assert/strict\";\nimport { describe, it, before } from \"node:test\";\n\nimport { Container, Text } from \"@gsd/pi-tui\";\nimport stripAnsi from \"strip-ansi\";\n\nimport { initTheme, theme } from \"../theme/theme.js\";\nimport { renderExtensionNotifyInChat, shouldRenderExtensionNotifyInChat } from \"../interactive-mode.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { ToolExecutionComponent } from \"./tool-execution.js\";\n\n// Theme is a globalThis-shared singleton that throws if not initialized.\n// Initialize once before any test that exercises themed rendering.\nbefore(() => {\n\tinitTheme(\"dark\");\n});\n\ndescribe(\"Extension warning notifications\", () => {\n\tit(\"do not render into chat output\", () => {\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"warning\"), false);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"error\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"success\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(\"info\"), true);\n\t\tassert.equal(shouldRenderExtensionNotifyInChat(undefined), true);\n\n\t\tconst warningChat = new Container();\n\t\tconst warningResult = renderExtensionNotifyInChat(warningChat, \"extension warning\", \"warning\");\n\t\tassert.equal(warningResult.rendered, false);\n\t\tassert.equal(\n\t\t\twarningChat.render(80).map(stripAnsi).join(\"\\n\"),\n\t\t\t\"\",\n\t\t\t\"warning notifications must not add chat output\",\n\t\t);\n\n\t\tfor (const type of [\"error\", \"success\", \"info\"] as const) {\n\t\t\tconst chat = new Container();\n\t\t\tconst result = renderExtensionNotifyInChat(chat, `${type} notification`, type);\n\t\t\tassert.equal(result.rendered, true, `${type} notification should render`);\n\t\t\tassert.match(\n\t\t\t\tchat.render(80).map(stripAnsi).join(\"\\n\"),\n\t\t\t\tnew RegExp(`${type} notification`),\n\t\t\t\t`${type} notification text should appear in chat output`,\n\t\t\t);\n\t\t}\n\t});\n});\n\ninterface MockTui {\n\trenderCount: number;\n\trequestRender(): void;\n}\n\nfunction makeMockTUI(): MockTui {\n\treturn {\n\t\trenderCount: 0,\n\t\trequestRender() {\n\t\t\tthis.renderCount++;\n\t\t},\n\t};\n}\n\n// ─── Bug 1: tool cards stuck in \"Running\" after compaction ──────────────\n\ndescribe(\"ToolExecutionComponent post-compaction cleanup\", () => {\n\tit(\"renders 'running' status while the tool call has no result\", () => {\n\t\t// Baseline: a freshly-constructed component (mid-stream) must show\n\t\t// the running badge — this is the state we need to flip OUT of when\n\t\t// compaction removes the result message.\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\t\tconst rendered = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\trendered.includes(\"running\"),\n\t\t\t\"freshly constructed component should render 'running' badge\",\n\t\t);\n\t});\n\n\tit(\"markHistoricalNoResult flips a stuck tool card OUT of 'running'\", () => {\n\t\t// Real bug: after session-history replay (post-compaction or session\n\t\t// switch), tool calls without matching tool_result messages stay in\n\t\t// isPartial = true forever. markHistoricalNoResult must produce a\n\t\t// rendered output that no longer reads \"Running\".\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\n\t\tc.markHistoricalNoResult();\n\n\t\tconst rendered = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\t!rendered.includes(\"running\"),\n\t\t\t\"after markHistoricalNoResult, the tool card must NOT render 'running' -- got:\\n\" +\n\t\t\t\trendered,\n\t\t);\n\t\tassert.ok(\n\t\t\trendered.includes(\"success\"),\n\t\t\t\"flipped card should render 'success' status (no-result success)\",\n\t\t);\n\t});\n\n\tit(\"markHistoricalNoResult is idempotent when a real result already exists\", () => {\n\t\t// Late-arriving stream events must not clobber legitimate results.\n\t\t// We observe the no-clobber via behaviour: a card that completed\n\t\t// with a real result keeps its \"Done\" badge and content even if\n\t\t// markHistoricalNoResult fires again afterwards.\n\t\tconst ui = makeMockTUI();\n\t\tconst c = new ToolExecutionComponent(\n\t\t\t\"read_file\",\n\t\t\t{ path: \"/tmp/x.txt\" },\n\t\t\t{},\n\t\t\tundefined,\n\t\t\tui as never,\n\t\t);\n\n\t\t// Use the public completion path the runtime calls.\n\t\tc.updateResult(\n\t\t\t{\n\t\t\t\tcontent: [{ type: \"text\", text: \"real-result-payload\" }],\n\t\t\t\tisError: false,\n\t\t\t},\n\t\t\tfalse, // isPartial = false → \"Done\"\n\t\t);\n\n\t\tconst before = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(before.includes(\"success\"), \"after complete(), card shows 'success'\");\n\n\t\tc.markHistoricalNoResult(); // must early-return\n\t\tconst after = c.render(60).map(stripAnsi).join(\"\\n\");\n\t\tassert.equal(\n\t\t\tafter,\n\t\t\tbefore,\n\t\t\t\"markHistoricalNoResult must NOT mutate state when a real result is already present\",\n\t\t);\n\t});\n});\n\n// ─── Bug 2: success notifications render as a green bordered box ────────\n\ndescribe(\"Success-notification rendering — DynamicBorder + success theme\", () => {\n\t// We drive the same component composition that interactive-mode.showSuccess\n\t// builds (DynamicBorder + Text + DynamicBorder, all themed with\n\t// theme.fg(\"success\", …)) and assert on the rendered output, rather than\n\t// trying to instantiate the full InteractiveMode (which requires a real\n\t// session, bridge, and TUI runtime).\n\tfunction buildSuccessNotification(message: string): Container {\n\t\tconst c = new Container();\n\t\tconst successColor = (text: string) => theme.fg(\"success\", text);\n\t\tc.addChild(new DynamicBorder(successColor));\n\t\tc.addChild(new Text(theme.fg(\"success\", message), 1, 0));\n\t\tc.addChild(new DynamicBorder(successColor));\n\t\treturn c;\n\t}\n\n\tit(\"renders a top and bottom horizontal border framing the message\", () => {\n\t\tconst c = buildSuccessNotification(\"Milestone M042 ready.\");\n\t\tconst lines = c.render(40);\n\n\t\t// First and last lines should be horizontal-rule borders\n\t\t// (DynamicBorder renders a row of \"─\" characters).\n\t\tconst firstStripped = stripAnsi(lines[0]);\n\t\tconst lastStripped = stripAnsi(lines[lines.length - 1]);\n\n\t\tassert.ok(\n\t\t\tfirstStripped.includes(\"─\"),\n\t\t\t`first line should be a border (got: ${JSON.stringify(firstStripped)})`,\n\t\t);\n\t\tassert.ok(\n\t\t\tlastStripped.includes(\"─\"),\n\t\t\t`last line should be a border (got: ${JSON.stringify(lastStripped)})`,\n\t\t);\n\t\tassert.ok(\n\t\t\tlines.length >= 3,\n\t\t\t`success notification must have at least 3 lines (top border, message, bottom border) — got ${lines.length}`,\n\t\t);\n\t});\n\n\tit(\"the message text appears between the two borders\", () => {\n\t\tconst c = buildSuccessNotification(\"Milestone M042 ready.\");\n\t\tconst lines = c.render(40);\n\n\t\tconst messageRow = lines.findIndex((l) => stripAnsi(l).includes(\"Milestone M042 ready.\"));\n\t\tassert.ok(messageRow > 0, \"message must appear after the top border\");\n\t\tassert.ok(\n\t\t\tmessageRow < lines.length - 1,\n\t\t\t\"message must appear before the bottom border\",\n\t\t);\n\t});\n\n\tit(\"borders carry ANSI styling (not plain dim text like showStatus)\", () => {\n\t\t// Goodhart-resistant: if a regression routed success through\n\t\t// showStatus, the borders would be missing AND the rendered text\n\t\t// would be plain (or only dim-styled, not success-colored). We\n\t\t// observe the border lines carry ANSI escape codes — the literal\n\t\t// foreground color depends on the theme (which is system-dependent\n\t\t// in CI), so we don't pin a specific code but DO require styling\n\t\t// to be present.\n\t\tconst c = buildSuccessNotification(\"ok\");\n\t\tconst lines = c.render(40);\n\t\tconst top = lines[0];\n\t\tassert.ok(\n\t\t\ttop !== stripAnsi(top),\n\t\t\t\"top border must contain ANSI styling — a plain unstyled border \" +\n\t\t\t\t\"would indicate the rendering bypassed theme.fg('success', ...)\",\n\t\t);\n\t});\n\n\tit(\"plain Text status (the showStatus path) does NOT produce a bordered box\", () => {\n\t\t// Counter-test: this is what the bug looked like — a single dim Text\n\t\t// with no surrounding border. If anyone ever \"fixes\" the showSuccess\n\t\t// regression by also adding borders to showStatus, this test will\n\t\t// surface the conflation.\n\t\tconst plain = new Text(theme.fg(\"dim\", \"Milestone M042 ready.\"), 1, 0);\n\t\tconst lines = plain.render(40);\n\t\tconst joined = lines.map(stripAnsi).join(\"\\n\");\n\t\tassert.ok(\n\t\t\t!joined.includes(\"─\"),\n\t\t\t\"plain Text (showStatus path) must NOT contain border characters\",\n\t\t);\n\t});\n});\n"]}
@@ -4,6 +4,8 @@ export type ToolExecutionPhase = {
4
4
  label: string;
5
5
  count: number;
6
6
  durationMs: number;
7
+ targets?: string[];
8
+ actionLabel?: string;
7
9
  };
8
10
  export interface ToolExecutionOptions {
9
11
  showImages?: boolean;
@@ -92,6 +94,9 @@ export declare class ToolExecutionComponent extends Container {
92
94
  getRollupPhase(): ToolExecutionPhase | null;
93
95
  private getPhaseLabel;
94
96
  private getCompactSummary;
97
+ private getCompactAction;
98
+ private getTargetMetadata;
99
+ private getCompactTarget;
95
100
  private updateDisplay;
96
101
  /**
97
102
  * Render bash content using visual line truncation (like bash-execution.ts)
@@ -103,6 +108,7 @@ export declare class ToolExecutionComponent extends Container {
103
108
  export declare class ToolPhaseSummaryComponent extends Container {
104
109
  private readonly phases;
105
110
  constructor(phases: ToolExecutionPhase[]);
111
+ getPhases(): ToolExecutionPhase[];
106
112
  render(width: number): string[];
107
113
  }
108
114
  //# sourceMappingURL=tool-execution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,SAAS,EAQT,KAAK,GAAG,EAGR,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAsHxE,MAAM,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AA+CF,MAAM,WAAW,oBAAoB;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC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zB,OAAO,CAAC,gBAAgB;IA6BxB,OAAO,CAAC,aAAa;IAoKrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmFzB,OAAO,CAAC,aAAa;IA0BrB,OAAO,CAAC,mBAAmB;CAsX3B;AAED,qBAAa,yBAA0B,SAAQ,SAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,kBAAkB,EAAE;IAIzD,SAAS,IAAI,kBAAkB,EAAE;IAIxB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CAgBxC"}
@@ -82,24 +82,40 @@ function renderToolFrame(contentLines, width, opts) {
82
82
  const contentWidth = Math.max(1, outerWidth - 2); // "│ " + content
83
83
  const borderColor = opts.tone === "error" ? "toolError" : opts.tone === "pending" ? "toolRunning" : "toolSuccess";
84
84
  const topColor = borderColor;
85
- const labelColor = opts.tone === "error" ? "toolError" : "surfaceTitle";
85
+ const labelColor = opts.tone === "error" ? "toolError" : opts.tone === "pending" ? "toolRunning" : "toolSuccess";
86
86
  const statusColor = opts.tone === "error" ? "toolError" : opts.tone === "pending" ? "toolRunning" : "toolSuccess";
87
- const leftStyled = theme.fg(labelColor, theme.bold(`• ${opts.label}`));
87
+ const leftStyled = theme.fg(labelColor, theme.bold(opts.label));
88
88
  const rightStyled = theme.fg(statusColor, opts.status);
89
- const gap = Math.max(1, outerWidth - visibleWidth(leftStyled) - visibleWidth(rightStyled));
89
+ const titleWidth = Math.max(1, outerWidth - 4);
90
+ const gap = Math.max(1, titleWidth - visibleWidth(leftStyled) - visibleWidth(rightStyled));
90
91
  const headerRow = `${leftStyled}${" ".repeat(gap)}${rightStyled}`;
91
- const headerPad = Math.max(0, outerWidth - visibleWidth(headerRow));
92
+ const headerPad = Math.max(0, titleWidth - visibleWidth(headerRow));
92
93
  const sourceLines = trimOuterBlankLines(contentLines);
93
94
  const bodyLines = (sourceLines.length > 0 ? sourceLines : [""]).map((line) => {
94
95
  const clipped = truncateToWidth(line, contentWidth, "");
95
96
  return clipped;
96
97
  });
97
98
  return style()
98
- .border("rule")
99
+ .border("rounded")
99
100
  .borderColor((line) => theme.fg(line.startsWith("─") ? topColor : borderColor, line))
100
101
  .title(headerRow + " ".repeat(headerPad))
101
102
  .render(bodyLines, outerWidth);
102
103
  }
104
+ function renderCollapsedToolRow(label, status, width, tone) {
105
+ const outerWidth = Math.max(20, width);
106
+ const contentWidth = Math.max(1, outerWidth - 2);
107
+ const statusColor = tone === "success" ? "toolSuccess" : "toolMuted";
108
+ const labelStyled = theme.fg(statusColor, label);
109
+ const statusStyled = theme.fg(statusColor, status);
110
+ const labelWidth = Math.max(1, contentWidth - visibleWidth(statusStyled) - 1);
111
+ const clippedLabel = truncateToWidth(labelStyled, labelWidth, "");
112
+ const gap = Math.max(1, contentWidth - visibleWidth(clippedLabel) - visibleWidth(statusStyled));
113
+ const line = `${clippedLabel}${" ".repeat(gap)}${statusStyled}`;
114
+ return style()
115
+ .border("minimal")
116
+ .borderColor((text) => theme.fg(statusColor, text))
117
+ .render([line], outerWidth);
118
+ }
103
119
  const COMPACT_ARG_VALUE_LIMIT = 60;
104
120
  const GENERIC_OUTPUT_PREVIEW_LINES = 10;
105
121
  const GENERIC_ARGS_JSON_PREVIEW_LINES = 10;
@@ -108,6 +124,97 @@ function formatElapsed(ms) {
108
124
  return `${ms}ms`;
109
125
  return `${Math.max(1, Math.round(ms / 1000))}s`;
110
126
  }
127
+ function formatCommandPreview(command) {
128
+ return truncateToWidth(command.replace(/\s+/g, " ").trim(), 64, "");
129
+ }
130
+ function appendLineOrRange(displayPath, target) {
131
+ if (!displayPath)
132
+ return undefined;
133
+ if (typeof target.line === "number" && Number.isFinite(target.line)) {
134
+ return `${displayPath}:${target.line}`;
135
+ }
136
+ const start = target.range?.start;
137
+ if (typeof start === "number" && Number.isFinite(start)) {
138
+ const end = target.range?.end;
139
+ const suffix = typeof end === "number" && Number.isFinite(end) && end !== start
140
+ ? `${start}-${end}`
141
+ : `${start}`;
142
+ return `${displayPath}:${suffix}`;
143
+ }
144
+ return displayPath;
145
+ }
146
+ function formatToolTarget(target) {
147
+ const path = target.resolvedPath || target.inputPath;
148
+ const displayPath = path ? shortenPath(path) : undefined;
149
+ if (target.kind === "search") {
150
+ const searchTarget = displayPath ?? target.inputPath ?? ".";
151
+ const label = target.pattern ? `${target.pattern} in ${searchTarget}` : searchTarget;
152
+ return target.glob ? `${label} (${target.glob})` : label;
153
+ }
154
+ return appendLineOrRange(displayPath, target);
155
+ }
156
+ function formatArgsPathTarget(path, args) {
157
+ if (!path)
158
+ return undefined;
159
+ const start = typeof args.offset === "number" ? args.offset : undefined;
160
+ const limit = typeof args.limit === "number" ? args.limit : undefined;
161
+ const range = start !== undefined || limit !== undefined
162
+ ? {
163
+ start: start ?? 1,
164
+ end: limit !== undefined ? (start ?? 1) + Math.max(0, limit - 1) : undefined,
165
+ }
166
+ : undefined;
167
+ return appendLineOrRange(shortenPath(path), { range });
168
+ }
169
+ function stripLineSuffix(target) {
170
+ return target.replace(/:\d+(?:-\d+)?$/, "");
171
+ }
172
+ function uniqueTargets(targets) {
173
+ const seen = new Set();
174
+ const unique = [];
175
+ for (const target of targets ?? []) {
176
+ if (!target || seen.has(target))
177
+ continue;
178
+ seen.add(target);
179
+ unique.push(target);
180
+ }
181
+ return unique;
182
+ }
183
+ function summarizePhaseLabel(phase) {
184
+ const phaseTargets = uniqueTargets(phase.targets);
185
+ const baseTargets = uniqueTargets(phaseTargets.map(stripLineSuffix));
186
+ if (phase.label === "File changes" && baseTargets.length > 0) {
187
+ const fileWord = baseTargets.length === 1 ? "file" : "files";
188
+ const actionWord = phase.actionLabel === "write"
189
+ ? phase.count === 1
190
+ ? "write"
191
+ : "writes"
192
+ : phase.actionLabel === undefined
193
+ ? phase.count === 1
194
+ ? "action"
195
+ : "actions"
196
+ : phase.count === 1
197
+ ? "edit"
198
+ : "edits";
199
+ return `${phase.label} · ${baseTargets.length} ${fileWord}, ${phase.count} ${actionWord}`;
200
+ }
201
+ if (phase.label === "Context reads" && baseTargets.length > 0) {
202
+ const fileWord = baseTargets.length === 1 ? "file" : "files";
203
+ return `${phase.label} · ${baseTargets.length} ${fileWord}`;
204
+ }
205
+ if (phase.label === "Setup / shell" && phaseTargets.length > 0) {
206
+ return `${phase.label} · ${phase.count} ${phase.count === 1 ? "command" : "commands"}`;
207
+ }
208
+ return `${phase.label} ${phase.count} ${phase.count === 1 ? "action" : "actions"}`;
209
+ }
210
+ function summarizePhaseTargets(phase, width) {
211
+ const phaseTargets = uniqueTargets(phase.targets);
212
+ if (phaseTargets.length === 0)
213
+ return undefined;
214
+ const shown = phaseTargets.slice(0, 3);
215
+ const suffix = phaseTargets.length > shown.length ? ` +${phaseTargets.length - shown.length} more` : "";
216
+ return truncateToWidth(shown.join(" · ") + suffix, width, "");
217
+ }
111
218
  /**
112
219
  * Format tool args for the generic-renderer fallback. Produces a one-line
113
220
  * `k=v, k=v` summary when every value is a primitive that fits inline; falls
@@ -445,18 +552,13 @@ export class ToolExecutionComponent extends Container {
445
552
  const contentWidth = Math.max(1, frameWidth - 4);
446
553
  const frameTone = this.result?.isError ? "error" : this.isPartial || !this.result ? "pending" : "success";
447
554
  const elapsed = formatElapsed((this.endedAt ?? Date.now()) - this.startedAt);
448
- const frameStatus = `${this.isPartial || !this.result ? "Running" : this.result.isError ? "Error" : "Done"} · ${elapsed}`;
555
+ const frameStatus = `${this.isPartial || !this.result ? "running" : this.result.isError ? "failed" : "success"} · ${elapsed}`;
449
556
  const parsed = parseMcpToolName(this.toolName);
450
557
  const frameLabel = parsed
451
- ? `Tool ${parsed.server}·${parsed.tool}`
452
- : `Tool ${prettifyToolName(this.toolName, this.toolDefinition?.label) || "unknown"}`;
558
+ ? `${parsed.server}·${parsed.tool}`
559
+ : prettifyToolName(this.toolName, this.toolDefinition?.label) || "unknown";
453
560
  if (this.shouldRenderCompactSuccess()) {
454
- const availableWidth = Math.max(1, frameWidth - 2);
455
- const summaryWidth = Math.max(1, availableWidth - visibleWidth(frameStatus) - 1);
456
- const summary = truncateToWidth(this.getCompactSummary(frameLabel), summaryWidth, "");
457
- const gap = Math.max(1, availableWidth - visibleWidth(summary) - visibleWidth(frameStatus));
458
- const line = `${theme.fg("toolSuccess", summary)}${" ".repeat(gap)}${theme.fg("toolSuccess", frameStatus)}`;
459
- return ["", ...style().border("minimal").borderColor((text) => theme.fg("toolSuccess", text)).render([line], frameWidth)];
561
+ return ["", ...renderCollapsedToolRow(this.getCompactSummary(frameLabel), frameStatus, frameWidth, "success")];
460
562
  }
461
563
  const lines = super.render(contentWidth);
462
564
  const framed = renderToolFrame(lines, frameWidth, {
@@ -470,17 +572,20 @@ export class ToolExecutionComponent extends Container {
470
572
  if (this.expanded || this.isPartial || !this.result || this.result.isError)
471
573
  return false;
472
574
  const hasImages = this.result.content?.some((block) => block.type === "image") ?? false;
473
- return !hasImages && this.getTextOutput().trim().length === 0;
575
+ return !hasImages;
474
576
  }
475
577
  getRollupPhase() {
476
578
  if (!this.shouldRenderCompactSuccess())
477
579
  return null;
478
580
  const label = this.getPhaseLabel();
479
581
  const endedAt = this.endedAt ?? Date.now();
582
+ const target = this.getCompactTarget();
480
583
  return {
481
584
  label,
482
585
  count: 1,
483
586
  durationMs: Math.max(0, endedAt - this.startedAt),
587
+ targets: target ? [target] : undefined,
588
+ actionLabel: this.getCompactAction(),
484
589
  };
485
590
  }
486
591
  getPhaseLabel() {
@@ -504,7 +609,51 @@ export class ToolExecutionComponent extends Container {
504
609
  return "Other tool actions";
505
610
  }
506
611
  getCompactSummary(frameLabel) {
507
- return `${frameLabel} Completed`;
612
+ if (this.normalizedToolName === "bash") {
613
+ const command = str(this.args?.command);
614
+ return command ? `bash ${formatCommandPreview(command)}` : frameLabel;
615
+ }
616
+ const target = this.getCompactTarget();
617
+ return target ? `${this.getCompactAction()} ${target}` : frameLabel;
618
+ }
619
+ getCompactAction() {
620
+ const target = this.getTargetMetadata();
621
+ if (target?.action)
622
+ return target.action === "list" ? "ls" : target.action;
623
+ return this.normalizedToolName;
624
+ }
625
+ getTargetMetadata() {
626
+ const target = this.result?.details?.target;
627
+ return target && typeof target === "object" ? target : undefined;
628
+ }
629
+ getCompactTarget() {
630
+ const metadata = this.getTargetMetadata();
631
+ const metadataTarget = metadata ? formatToolTarget(metadata) : undefined;
632
+ if (metadataTarget)
633
+ return metadataTarget;
634
+ const path = str(this.args?.file_path ?? this.args?.path);
635
+ if (path === null)
636
+ return undefined;
637
+ if (this.normalizedToolName === "read" || this.normalizedToolName === "hashline_read") {
638
+ return formatArgsPathTarget(path, this.args);
639
+ }
640
+ if (this.normalizedToolName === "write" || this.normalizedToolName === "edit") {
641
+ return path ? shortenPath(path) : undefined;
642
+ }
643
+ if (this.normalizedToolName === "ls") {
644
+ return shortenPath(path || ".");
645
+ }
646
+ if (this.normalizedToolName === "find") {
647
+ const pattern = str(this.args?.pattern);
648
+ return pattern ? `${pattern} in ${shortenPath(path || ".")}` : shortenPath(path || ".");
649
+ }
650
+ if (this.normalizedToolName === "grep") {
651
+ const pattern = str(this.args?.pattern);
652
+ const glob = str(this.args?.glob);
653
+ const label = pattern ? `${pattern} in ${shortenPath(path || ".")}` : shortenPath(path || ".");
654
+ return glob ? `${label} (${glob})` : label;
655
+ }
656
+ return undefined;
508
657
  }
509
658
  updateDisplay() {
510
659
  // Tool body now uses transparent background; status is conveyed in the frame header.
@@ -693,6 +842,10 @@ export class ToolExecutionComponent extends Container {
693
842
  // Truncation warnings
694
843
  const truncation = this.result.details?.truncation;
695
844
  const fullOutputPath = this.result.details?.fullOutputPath;
845
+ const cwd = this.result.details?.cwd;
846
+ if (this.expanded && typeof cwd === "string" && cwd.length > 0) {
847
+ this.contentBox.addChild(new Text(`\n${theme.fg("muted", `cwd ${shortenPath(cwd)}`)}`, 0, 0));
848
+ }
696
849
  if (truncation?.truncated || fullOutputPath) {
697
850
  const warnings = [];
698
851
  if (fullOutputPath) {
@@ -1082,16 +1235,21 @@ export class ToolPhaseSummaryComponent extends Container {
1082
1235
  super();
1083
1236
  this.phases = phases;
1084
1237
  }
1238
+ getPhases() {
1239
+ return this.phases.map((phase) => ({ ...phase, targets: phase.targets ? [...phase.targets] : undefined }));
1240
+ }
1085
1241
  render(width) {
1086
1242
  const frameWidth = Math.max(20, width);
1087
- const rows = this.phases.map((phase) => {
1088
- const left = `${phase.label} ${phase.count} ${phase.count === 1 ? "action" : "actions"}`;
1243
+ const rows = this.phases.flatMap((phase) => {
1244
+ const left = summarizePhaseLabel(phase);
1089
1245
  const right = `success · ${formatElapsed(phase.durationMs)}`;
1090
1246
  const contentWidth = Math.max(1, frameWidth - 2);
1091
1247
  const leftWidth = Math.max(1, contentWidth - visibleWidth(right) - 1);
1092
1248
  const leftText = truncateToWidth(left, leftWidth, "");
1093
1249
  const gap = Math.max(1, contentWidth - visibleWidth(leftText) - visibleWidth(right));
1094
- return `${theme.fg("toolSuccess", leftText)}${" ".repeat(gap)}${theme.fg("toolSuccess", right)}`;
1250
+ const summaryRow = `${theme.fg("toolSuccess", leftText)}${" ".repeat(gap)}${theme.fg("toolSuccess", right)}`;
1251
+ const targetRow = summarizePhaseTargets(phase, contentWidth);
1252
+ return targetRow ? [summaryRow, theme.fg("muted", targetRow)] : [summaryRow];
1095
1253
  });
1096
1254
  return ["", ...style().border("minimal").borderColor((text) => theme.fg("toolSuccess", text)).render(rows, frameWidth)];
1097
1255
  }