@opengsd/gsd-pi 1.2.0-dev.0b870afa → 1.2.0-dev.23d85b63

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 (579) hide show
  1. package/dist/cli-model-override.d.ts +15 -0
  2. package/dist/cli-model-override.js +21 -0
  3. package/dist/cli.js +14 -19
  4. package/dist/headless-events.d.ts +16 -1
  5. package/dist/headless-events.js +19 -2
  6. package/dist/headless.js +8 -1
  7. package/dist/loader.js +6 -4
  8. package/dist/onboarding.js +9 -4
  9. package/dist/provider-migrations.d.ts +23 -0
  10. package/dist/provider-migrations.js +41 -0
  11. package/dist/register-agent-bundles.d.ts +11 -2
  12. package/dist/register-agent-bundles.js +18 -4
  13. package/dist/resource-loader.d.ts +10 -5
  14. package/dist/resource-loader.js +121 -6
  15. package/dist/resources/.managed-resources-content-hash +1 -1
  16. package/dist/resources/extensions/ask-user-questions.js +3 -2
  17. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +447 -215
  18. package/dist/resources/extensions/claude-code-cli/turn-assembler.js +33 -1
  19. package/dist/resources/extensions/google-cli/stream-adapter.js +16 -1
  20. package/dist/resources/extensions/gsd/auto/closeout.js +215 -0
  21. package/dist/resources/extensions/gsd/auto/dispatch-history.js +21 -6
  22. package/dist/resources/extensions/gsd/auto/dispatch.js +365 -0
  23. package/dist/resources/extensions/gsd/auto/finalize.js +347 -0
  24. package/dist/resources/extensions/gsd/auto/loop.js +4 -1
  25. package/dist/resources/extensions/gsd/auto/milestone-lease-reclaim.js +56 -0
  26. package/dist/resources/extensions/gsd/auto/orchestrator.js +119 -18
  27. package/dist/resources/extensions/gsd/auto/phase-helpers.js +146 -0
  28. package/dist/resources/extensions/gsd/auto/phases.js +17 -2372
  29. package/dist/resources/extensions/gsd/auto/pre-dispatch.js +542 -0
  30. package/dist/resources/extensions/gsd/auto/unit-phase.js +694 -0
  31. package/dist/resources/extensions/gsd/auto/workflow-unit-dispatch.js +1 -1
  32. package/dist/resources/extensions/gsd/auto/worktree-safety-phase.js +125 -0
  33. package/dist/resources/extensions/gsd/auto-closeout-messaging.js +90 -0
  34. package/dist/resources/extensions/gsd/auto-dashboard.js +255 -431
  35. package/dist/resources/extensions/gsd/auto-direct-dispatch.js +15 -3
  36. package/dist/resources/extensions/gsd/auto-dispatch.js +19 -1
  37. package/dist/resources/extensions/gsd/auto-model-selection.js +9 -6
  38. package/dist/resources/extensions/gsd/auto-post-unit.js +12 -8
  39. package/dist/resources/extensions/gsd/auto-prompts.js +5 -1
  40. package/dist/resources/extensions/gsd/auto-recovery.js +52 -6
  41. package/dist/resources/extensions/gsd/auto-start.js +28 -7
  42. package/dist/resources/extensions/gsd/auto-worktree.js +48 -3
  43. package/dist/resources/extensions/gsd/auto.js +83 -19
  44. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +4 -2
  45. package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +37 -7
  46. package/dist/resources/extensions/gsd/bootstrap/register-extension.js +3 -1
  47. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +32 -3
  48. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +56 -16
  49. package/dist/resources/extensions/gsd/closeout-wizard.js +8 -3
  50. package/dist/resources/extensions/gsd/commands/handlers/core.js +22 -8
  51. package/dist/resources/extensions/gsd/commands/handlers/ops.js +2 -2
  52. package/dist/resources/extensions/gsd/commands-mcp-status.js +2 -2
  53. package/dist/resources/extensions/gsd/commands-prefs-wizard.js +8 -0
  54. package/dist/resources/extensions/gsd/commands-workflow-templates.js +9 -2
  55. package/dist/resources/extensions/gsd/config-overlay.js +11 -8
  56. package/dist/resources/extensions/gsd/db/engine.js +24 -6
  57. package/dist/resources/extensions/gsd/db/queries.js +30 -0
  58. package/dist/resources/extensions/gsd/db/writers/reconcile.js +19 -1
  59. package/dist/resources/extensions/gsd/db-migration-backup.js +51 -8
  60. package/dist/resources/extensions/gsd/db-transaction.js +27 -23
  61. package/dist/resources/extensions/gsd/db-writer.js +8 -17
  62. package/dist/resources/extensions/gsd/doctor-environment.js +256 -125
  63. package/dist/resources/extensions/gsd/doctor-git-checks.js +5 -1
  64. package/dist/resources/extensions/gsd/doctor-providers.js +1 -1
  65. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +11 -9
  66. package/dist/resources/extensions/gsd/gsd-db.js +15 -20
  67. package/dist/resources/extensions/gsd/guided-flow.js +88 -2
  68. package/dist/resources/extensions/gsd/health-widget.js +87 -28
  69. package/dist/resources/extensions/gsd/mcp-bridge.js +10 -0
  70. package/dist/resources/extensions/gsd/memory-relations.js +1 -1
  71. package/dist/resources/extensions/gsd/milestone-settlement.js +2 -2
  72. package/dist/resources/extensions/gsd/notifications.js +12 -7
  73. package/dist/resources/extensions/gsd/preferences-models.js +17 -9
  74. package/dist/resources/extensions/gsd/preferences.js +91 -5
  75. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +8 -2
  76. package/dist/resources/extensions/gsd/prompts/complete-slice.md +6 -2
  77. package/dist/resources/extensions/gsd/prompts/execute-task.md +7 -2
  78. package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -1
  79. package/dist/resources/extensions/gsd/prompts/reactive-execute.md +2 -2
  80. package/dist/resources/extensions/gsd/prompts/run-uat.md +7 -1
  81. package/dist/resources/extensions/gsd/prompts/triage-captures.md +1 -1
  82. package/dist/resources/extensions/gsd/prompts/workflow-start.md +2 -1
  83. package/dist/resources/extensions/gsd/provider-error-guidance.js +24 -0
  84. package/dist/resources/extensions/gsd/session-lock.js +4 -3
  85. package/dist/resources/extensions/gsd/skill-activation.js +3 -6
  86. package/dist/resources/extensions/gsd/state-reconciliation/drift/artifact-db.js +13 -6
  87. package/dist/resources/extensions/gsd/state.js +6 -2
  88. package/dist/resources/extensions/gsd/tool-surface-readiness.js +83 -31
  89. package/dist/resources/extensions/gsd/tools/complete-task.js +62 -0
  90. package/dist/resources/extensions/gsd/tools/exec-tool.js +2 -109
  91. package/dist/resources/extensions/gsd/tui/render-kit.js +38 -13
  92. package/dist/resources/extensions/gsd/unit-context-composer.js +1 -1
  93. package/dist/resources/extensions/gsd/unit-registry.js +34 -4
  94. package/dist/resources/extensions/gsd/workflow-logger.js +4 -0
  95. package/dist/resources/extensions/gsd/workflow-mcp-auto-prep.js +2 -0
  96. package/dist/resources/extensions/gsd/workflow-mcp-readiness-cache.js +105 -0
  97. package/dist/resources/extensions/gsd/worktree-manager.js +101 -2
  98. package/dist/resources/extensions/gsd/worktree-safety.js +28 -26
  99. package/dist/resources/extensions/gsd/worktree-shell-guard.js +113 -0
  100. package/dist/resources/extensions/gsd/worktree.js +8 -1
  101. package/dist/resources/extensions/mcp-client/manager.js +6 -1
  102. package/dist/resources/extensions/search-the-web/index.js +41 -9
  103. package/dist/resources/extensions/search-the-web/native-search.js +18 -4
  104. package/dist/resources/extensions/shared/gsd-browser-cli.js +40 -2
  105. package/dist/resources/extensions/subagent/index.js +20 -15
  106. package/dist/resources/extensions/subagent/worktree-cwd.js +31 -0
  107. package/dist/resources/skills/create-skill/SKILL.md +3 -0
  108. package/dist/resources/skills/create-skill/references/skill-structure.md +1 -0
  109. package/dist/runtime-checks.d.ts +10 -0
  110. package/dist/runtime-checks.js +27 -0
  111. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  112. package/dist/web/standalone/.next/BUILD_ID +1 -1
  113. package/dist/web/standalone/.next/app-path-routes-manifest.json +10 -10
  114. package/dist/web/standalone/.next/build-manifest.json +2 -2
  115. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  116. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  117. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  118. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  119. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  120. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  121. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  122. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  123. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  124. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  125. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  126. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  127. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  128. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  129. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  130. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  131. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  132. package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
  133. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
  134. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
  135. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
  136. package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
  137. package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
  138. package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
  139. package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
  140. package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  141. package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
  142. package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  143. package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  144. package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
  145. package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
  146. package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
  147. package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
  148. package/dist/web/standalone/.next/server/app/api/mcp-connections/route.js.nft.json +1 -1
  149. package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
  150. package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
  151. package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  152. package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
  153. package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
  154. package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
  155. package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
  156. package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
  157. package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
  158. package/dist/web/standalone/.next/server/app/api/shutdown/route.js.nft.json +1 -1
  159. package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
  160. package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
  161. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
  162. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
  163. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  164. package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
  165. package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
  166. package/dist/web/standalone/.next/server/app/index.html +1 -1
  167. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  168. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  169. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  170. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  171. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  172. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  173. package/dist/web/standalone/.next/server/app-paths-manifest.json +10 -10
  174. package/dist/web/standalone/.next/server/chunks/{5942.js → 1128.js} +1 -1
  175. package/dist/web/standalone/.next/server/chunks/8357.js +1 -1
  176. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  177. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  178. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  179. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  180. package/dist/web/standalone/node_modules/node-pty/build/Makefile +1 -1
  181. package/package.json +4 -4
  182. package/packages/cloud-mcp-gateway/package.json +2 -2
  183. package/packages/contracts/package.json +1 -1
  184. package/packages/daemon/package.json +4 -4
  185. package/packages/gsd-agent-core/dist/sdk.d.ts.map +1 -1
  186. package/packages/gsd-agent-core/dist/sdk.js +12 -6
  187. package/packages/gsd-agent-core/dist/sdk.js.map +1 -1
  188. package/packages/gsd-agent-core/package.json +5 -5
  189. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts +5 -5
  190. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  191. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +12 -24
  192. package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +1 -1
  193. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js +5 -5
  194. package/packages/gsd-agent-modes/dist/modes/interactive/components/bash-execution.js.map +1 -1
  195. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts +3 -3
  196. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  197. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js +20 -11
  198. package/packages/gsd-agent-modes/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  199. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.d.ts +4 -3
  200. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.d.ts.map +1 -1
  201. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.js +5 -54
  202. package/packages/gsd-agent-modes/dist/modes/interactive/components/chat-turn-connect.js.map +1 -1
  203. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -4
  204. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  205. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js +2 -4
  206. package/packages/gsd-agent-modes/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  207. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts +2 -0
  208. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  209. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js +4 -0
  210. package/packages/gsd-agent-modes/dist/modes/interactive/components/custom-editor.js.map +1 -1
  211. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts +9 -12
  212. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.d.ts.map +1 -1
  213. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js +100 -166
  214. package/packages/gsd-agent-modes/dist/modes/interactive/components/footer.js.map +1 -1
  215. package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.d.ts +2 -0
  216. package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.d.ts.map +1 -0
  217. package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.js +4 -0
  218. package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-progress-state.js.map +1 -0
  219. package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.d.ts +23 -0
  220. package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.d.ts.map +1 -0
  221. package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.js +178 -0
  222. package/packages/gsd-agent-modes/dist/modes/interactive/components/gsd-status-widget.js.map +1 -0
  223. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts +8 -0
  224. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  225. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js +21 -9
  226. package/packages/gsd-agent-modes/dist/modes/interactive/components/login-dialog.js.map +1 -1
  227. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  228. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  229. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js +10 -0
  230. package/packages/gsd-agent-modes/dist/modes/interactive/components/settings-selector.js.map +1 -1
  231. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -3
  232. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  233. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js +2 -3
  234. package/packages/gsd-agent-modes/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  235. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts +11 -0
  236. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  237. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +85 -19
  238. package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +1 -1
  239. package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.d.ts +71 -3
  240. package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.d.ts.map +1 -1
  241. package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js +257 -37
  242. package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js.map +1 -1
  243. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts +3 -3
  244. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  245. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js +19 -19
  246. package/packages/gsd-agent-modes/dist/modes/interactive/components/user-message.js.map +1 -1
  247. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts +3 -0
  248. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  249. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +26 -10
  250. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  251. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.d.ts.map +1 -1
  252. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js +12 -1
  253. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/extension-ui-controller.js.map +1 -1
  254. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.d.ts.map +1 -1
  255. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js +5 -0
  256. package/packages/gsd-agent-modes/dist/modes/interactive/controllers/input-controller.js.map +1 -1
  257. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-autocomplete.d.ts.map +1 -1
  258. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-autocomplete.js +3 -1
  259. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  260. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.d.ts.map +1 -1
  261. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js +3 -5
  262. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js.map +1 -1
  263. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-dialogs.js +2 -2
  264. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  265. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.d.ts +1 -0
  266. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.d.ts.map +1 -1
  267. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.js +25 -0
  268. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-extension-widgets.js.map +1 -1
  269. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-key-handlers.d.ts.map +1 -1
  270. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-key-handlers.js +1 -0
  271. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-key-handlers.js.map +1 -1
  272. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.d.ts +1 -0
  273. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.d.ts.map +1 -1
  274. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.js +20 -49
  275. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-init.js.map +1 -1
  276. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts +4 -0
  277. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
  278. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode-state.js.map +1 -1
  279. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts +10 -2
  280. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  281. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js +48 -6
  282. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-mode.js.map +1 -1
  283. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-settings.d.ts.map +1 -1
  284. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-settings.js +4 -0
  285. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-selectors-settings.js.map +1 -1
  286. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-ui-messaging.d.ts.map +1 -1
  287. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-ui-messaging.js +0 -1
  288. package/packages/gsd-agent-modes/dist/modes/interactive/interactive-ui-messaging.js.map +1 -1
  289. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  290. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js +3 -0
  291. package/packages/gsd-agent-modes/dist/modes/rpc/rpc-mode.js.map +1 -1
  292. package/packages/gsd-agent-modes/package.json +7 -7
  293. package/packages/mcp-server/README.md +12 -3
  294. package/packages/mcp-server/dist/cli-runner.d.ts +40 -0
  295. package/packages/mcp-server/dist/cli-runner.d.ts.map +1 -0
  296. package/packages/mcp-server/dist/cli-runner.js +137 -0
  297. package/packages/mcp-server/dist/cli-runner.js.map +1 -0
  298. package/packages/mcp-server/dist/cli.js +2 -58
  299. package/packages/mcp-server/dist/cli.js.map +1 -1
  300. package/packages/mcp-server/dist/pid-registry.d.ts +46 -0
  301. package/packages/mcp-server/dist/pid-registry.d.ts.map +1 -0
  302. package/packages/mcp-server/dist/pid-registry.js +459 -0
  303. package/packages/mcp-server/dist/pid-registry.js.map +1 -0
  304. package/packages/mcp-server/dist/probe-mode.d.ts +4 -0
  305. package/packages/mcp-server/dist/probe-mode.d.ts.map +1 -0
  306. package/packages/mcp-server/dist/probe-mode.js +10 -0
  307. package/packages/mcp-server/dist/probe-mode.js.map +1 -0
  308. package/packages/mcp-server/dist/stdio-watchdog.d.ts +8 -0
  309. package/packages/mcp-server/dist/stdio-watchdog.d.ts.map +1 -0
  310. package/packages/mcp-server/dist/stdio-watchdog.js +40 -0
  311. package/packages/mcp-server/dist/stdio-watchdog.js.map +1 -0
  312. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  313. package/packages/mcp-server/dist/workflow-tools.js +62 -43
  314. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  315. package/packages/mcp-server/package.json +5 -5
  316. package/packages/native/package.json +1 -1
  317. package/packages/pi-agent-core/dist/agent-loop.js +52 -2
  318. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
  319. package/packages/pi-agent-core/package.json +1 -1
  320. package/packages/pi-ai/package.json +1 -1
  321. package/packages/pi-coding-agent/dist/core/extensions/extension-upstream-types.d.ts +28 -2
  322. package/packages/pi-coding-agent/dist/core/extensions/extension-upstream-types.d.ts.map +1 -1
  323. package/packages/pi-coding-agent/dist/core/extensions/extension-upstream-types.js.map +1 -1
  324. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  325. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  326. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  327. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +5 -1
  328. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  329. package/packages/pi-coding-agent/dist/core/extensions/runner.js +3 -1
  330. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  331. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +3 -0
  332. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  333. package/packages/pi-coding-agent/dist/core/settings-manager.js +11 -0
  334. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  335. package/packages/pi-coding-agent/dist/index.d.ts +1 -1
  336. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  337. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  338. package/packages/pi-coding-agent/dist/theme/theme.d.ts.map +1 -1
  339. package/packages/pi-coding-agent/dist/theme/theme.js +45 -17
  340. package/packages/pi-coding-agent/dist/theme/theme.js.map +1 -1
  341. package/packages/pi-coding-agent/package.json +8 -8
  342. package/packages/pi-tui/README.md +15 -0
  343. package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
  344. package/packages/pi-tui/dist/autocomplete.js +6 -1
  345. package/packages/pi-tui/dist/autocomplete.js.map +1 -1
  346. package/packages/pi-tui/dist/components/input.js +1 -1
  347. package/packages/pi-tui/dist/components/input.js.map +1 -1
  348. package/packages/pi-tui/dist/components/loader.d.ts.map +1 -1
  349. package/packages/pi-tui/dist/components/loader.js +1 -0
  350. package/packages/pi-tui/dist/components/loader.js.map +1 -1
  351. package/packages/pi-tui/dist/components/select-list.d.ts.map +1 -1
  352. package/packages/pi-tui/dist/components/select-list.js +8 -2
  353. package/packages/pi-tui/dist/components/select-list.js.map +1 -1
  354. package/packages/pi-tui/dist/index.d.ts +2 -2
  355. package/packages/pi-tui/dist/index.d.ts.map +1 -1
  356. package/packages/pi-tui/dist/index.js +2 -2
  357. package/packages/pi-tui/dist/index.js.map +1 -1
  358. package/packages/pi-tui/dist/terminal-image.d.ts +33 -0
  359. package/packages/pi-tui/dist/terminal-image.d.ts.map +1 -1
  360. package/packages/pi-tui/dist/terminal-image.js +54 -2
  361. package/packages/pi-tui/dist/terminal-image.js.map +1 -1
  362. package/packages/pi-tui/dist/terminal.d.ts +12 -0
  363. package/packages/pi-tui/dist/terminal.d.ts.map +1 -1
  364. package/packages/pi-tui/dist/terminal.js +70 -25
  365. package/packages/pi-tui/dist/terminal.js.map +1 -1
  366. package/packages/pi-tui/dist/tui.d.ts +15 -0
  367. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  368. package/packages/pi-tui/dist/tui.js +106 -21
  369. package/packages/pi-tui/dist/tui.js.map +1 -1
  370. package/packages/pi-tui/dist/utils.d.ts.map +1 -1
  371. package/packages/pi-tui/dist/utils.js +110 -36
  372. package/packages/pi-tui/dist/utils.js.map +1 -1
  373. package/packages/pi-tui/package.json +2 -2
  374. package/packages/rpc-client/package.json +2 -2
  375. package/pkg/dist/theme/theme.d.ts.map +1 -1
  376. package/pkg/dist/theme/theme.js +45 -17
  377. package/pkg/dist/theme/theme.js.map +1 -1
  378. package/pkg/package.json +1 -1
  379. package/src/resources/extensions/ask-user-questions.ts +7 -2
  380. package/src/resources/extensions/browser-tools/tests/gsd-browser-launch-config.test.mjs +80 -0
  381. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +531 -226
  382. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +672 -7
  383. package/src/resources/extensions/claude-code-cli/turn-assembler.ts +38 -1
  384. package/src/resources/extensions/google-cli/stream-adapter.ts +22 -1
  385. package/src/resources/extensions/gsd/auto/closeout.ts +309 -0
  386. package/src/resources/extensions/gsd/auto/dispatch-history.ts +22 -6
  387. package/src/resources/extensions/gsd/auto/dispatch.ts +449 -0
  388. package/src/resources/extensions/gsd/auto/finalize.ts +445 -0
  389. package/src/resources/extensions/gsd/auto/loop.ts +4 -1
  390. package/src/resources/extensions/gsd/auto/milestone-lease-reclaim.ts +74 -0
  391. package/src/resources/extensions/gsd/auto/orchestrator.ts +140 -18
  392. package/src/resources/extensions/gsd/auto/phase-helpers.ts +199 -0
  393. package/src/resources/extensions/gsd/auto/phases.ts +58 -3061
  394. package/src/resources/extensions/gsd/auto/pre-dispatch.ts +716 -0
  395. package/src/resources/extensions/gsd/auto/unit-phase.ts +910 -0
  396. package/src/resources/extensions/gsd/auto/workflow-unit-dispatch.ts +1 -1
  397. package/src/resources/extensions/gsd/auto/worktree-safety-phase.ts +149 -0
  398. package/src/resources/extensions/gsd/auto-closeout-messaging.ts +90 -0
  399. package/src/resources/extensions/gsd/auto-dashboard.ts +310 -454
  400. package/src/resources/extensions/gsd/auto-direct-dispatch.ts +15 -2
  401. package/src/resources/extensions/gsd/auto-dispatch.ts +24 -2
  402. package/src/resources/extensions/gsd/auto-model-selection.ts +20 -5
  403. package/src/resources/extensions/gsd/auto-post-unit.ts +16 -9
  404. package/src/resources/extensions/gsd/auto-prompts.ts +5 -1
  405. package/src/resources/extensions/gsd/auto-recovery.ts +62 -8
  406. package/src/resources/extensions/gsd/auto-start.ts +44 -7
  407. package/src/resources/extensions/gsd/auto-worktree.ts +51 -3
  408. package/src/resources/extensions/gsd/auto.ts +118 -18
  409. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +6 -2
  410. package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +56 -6
  411. package/src/resources/extensions/gsd/bootstrap/register-extension.ts +2 -1
  412. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +36 -3
  413. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +69 -16
  414. package/src/resources/extensions/gsd/closeout-wizard.ts +11 -2
  415. package/src/resources/extensions/gsd/commands/handlers/core.ts +27 -8
  416. package/src/resources/extensions/gsd/commands/handlers/ops.ts +5 -2
  417. package/src/resources/extensions/gsd/commands-mcp-status.ts +2 -2
  418. package/src/resources/extensions/gsd/commands-prefs-wizard.ts +7 -0
  419. package/src/resources/extensions/gsd/commands-workflow-templates.ts +11 -4
  420. package/src/resources/extensions/gsd/config-overlay.ts +22 -9
  421. package/src/resources/extensions/gsd/db/engine.ts +26 -6
  422. package/src/resources/extensions/gsd/db/queries.ts +29 -0
  423. package/src/resources/extensions/gsd/db/writers/reconcile.ts +24 -1
  424. package/src/resources/extensions/gsd/db-migration-backup.ts +56 -7
  425. package/src/resources/extensions/gsd/db-transaction.ts +37 -20
  426. package/src/resources/extensions/gsd/db-writer.ts +11 -19
  427. package/src/resources/extensions/gsd/doctor-environment.ts +267 -142
  428. package/src/resources/extensions/gsd/doctor-git-checks.ts +4 -1
  429. package/src/resources/extensions/gsd/doctor-providers.ts +1 -1
  430. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +10 -10
  431. package/src/resources/extensions/gsd/gsd-db.ts +15 -19
  432. package/src/resources/extensions/gsd/guided-flow.ts +128 -2
  433. package/src/resources/extensions/gsd/health-widget.ts +91 -27
  434. package/src/resources/extensions/gsd/mcp-bridge.ts +39 -0
  435. package/src/resources/extensions/gsd/memory-relations.ts +1 -1
  436. package/src/resources/extensions/gsd/milestone-settlement.ts +2 -2
  437. package/src/resources/extensions/gsd/notifications.ts +13 -6
  438. package/src/resources/extensions/gsd/preferences-models.ts +26 -8
  439. package/src/resources/extensions/gsd/preferences.ts +111 -5
  440. package/src/resources/extensions/gsd/prompts/complete-milestone.md +8 -2
  441. package/src/resources/extensions/gsd/prompts/complete-slice.md +6 -2
  442. package/src/resources/extensions/gsd/prompts/execute-task.md +7 -2
  443. package/src/resources/extensions/gsd/prompts/quick-task.md +1 -1
  444. package/src/resources/extensions/gsd/prompts/reactive-execute.md +2 -2
  445. package/src/resources/extensions/gsd/prompts/run-uat.md +7 -1
  446. package/src/resources/extensions/gsd/prompts/triage-captures.md +1 -1
  447. package/src/resources/extensions/gsd/prompts/workflow-start.md +2 -1
  448. package/src/resources/extensions/gsd/provider-error-guidance.ts +32 -0
  449. package/src/resources/extensions/gsd/session-lock.ts +8 -7
  450. package/src/resources/extensions/gsd/skill-activation.ts +3 -6
  451. package/src/resources/extensions/gsd/state-reconciliation/drift/artifact-db.ts +23 -10
  452. package/src/resources/extensions/gsd/state.ts +7 -1
  453. package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +1 -1
  454. package/src/resources/extensions/gsd/tests/auto-blocked-remediation-message.test.ts +1 -1
  455. package/src/resources/extensions/gsd/tests/auto-closeout-messaging.test.ts +71 -0
  456. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +68 -116
  457. package/src/resources/extensions/gsd/tests/auto-direct-dispatch-parse.test.ts +33 -0
  458. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +206 -22
  459. package/src/resources/extensions/gsd/tests/auto-model-selection-tool-poisoning.test.ts +7 -2
  460. package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +16 -1
  461. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +89 -22
  462. package/src/resources/extensions/gsd/tests/auto-pause-double-entry-guard.test.ts +1 -1
  463. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +97 -4
  464. package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +2 -1
  465. package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +236 -0
  466. package/src/resources/extensions/gsd/tests/auto-unit-closeout.test.ts +169 -1
  467. package/src/resources/extensions/gsd/tests/auto-verification.test.ts +36 -0
  468. package/src/resources/extensions/gsd/tests/blocker-placeholder-logs.test.ts +218 -0
  469. package/src/resources/extensions/gsd/tests/complete-milestone-prompt-rendering.test.ts +6 -2
  470. package/src/resources/extensions/gsd/tests/complete-task.test.ts +141 -5
  471. package/src/resources/extensions/gsd/tests/core-overlay-fallback.test.ts +1 -0
  472. package/src/resources/extensions/gsd/tests/db-engine-logs.test.ts +207 -0
  473. package/src/resources/extensions/gsd/tests/db-migration-backup.test.ts +68 -19
  474. package/src/resources/extensions/gsd/tests/db-transaction.test.ts +59 -0
  475. package/src/resources/extensions/gsd/tests/db-writer.test.ts +15 -4
  476. package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +2 -1
  477. package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +62 -0
  478. package/src/resources/extensions/gsd/tests/discuss-routing-fixes.test.ts +12 -2
  479. package/src/resources/extensions/gsd/tests/dispatch-db-degradation-logs.test.ts +98 -0
  480. package/src/resources/extensions/gsd/tests/dispatch-history.test.ts +55 -0
  481. package/src/resources/extensions/gsd/tests/dispatch-logs.test.ts +103 -0
  482. package/src/resources/extensions/gsd/tests/dispatch-reactive-logs.test.ts +98 -0
  483. package/src/resources/extensions/gsd/tests/dist-redirect.mjs +8 -0
  484. package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +6 -4
  485. package/src/resources/extensions/gsd/tests/engine-interfaces-contract.test.ts +117 -91
  486. package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +113 -0
  487. package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +2 -1
  488. package/src/resources/extensions/gsd/tests/gsd-command-home.test.ts +40 -7
  489. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +19 -0
  490. package/src/resources/extensions/gsd/tests/guided-dispatch-root.test.ts +16 -0
  491. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +75 -0
  492. package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +15 -0
  493. package/src/resources/extensions/gsd/tests/integration/doctor-environment-async.test.ts +104 -0
  494. package/src/resources/extensions/gsd/tests/integration/run-uat.test.ts +18 -0
  495. package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +1 -0
  496. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +47 -16
  497. package/src/resources/extensions/gsd/tests/loop.test.ts +60 -0
  498. package/src/resources/extensions/gsd/tests/mcp-readiness-preflight.test.ts +205 -0
  499. package/src/resources/extensions/gsd/tests/mcp-status.test.ts +6 -5
  500. package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +1 -1
  501. package/src/resources/extensions/gsd/tests/milestone-report-path.test.ts +1 -1
  502. package/src/resources/extensions/gsd/tests/milestone-settlement.test.ts +92 -0
  503. package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +1 -1
  504. package/src/resources/extensions/gsd/tests/model-router.test.ts +139 -0
  505. package/src/resources/extensions/gsd/tests/notifications.test.ts +64 -9
  506. package/src/resources/extensions/gsd/tests/oauth-api-model-routing.test.ts +13 -1
  507. package/src/resources/extensions/gsd/tests/orchestrator-legacy-parity.test.ts +1 -1
  508. package/src/resources/extensions/gsd/tests/orchestrator-logs.test.ts +335 -0
  509. package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +2 -2
  510. package/src/resources/extensions/gsd/tests/parsers-legacy-importers.test.ts +5 -0
  511. package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +1 -1
  512. package/src/resources/extensions/gsd/tests/phases-terminal-complete-idempotent.test.ts +1 -1
  513. package/src/resources/extensions/gsd/tests/plan-gate-failed-doctor-heal-hint.test.ts +3 -3
  514. package/src/resources/extensions/gsd/tests/prefs-missing-models-crash.test.ts +35 -4
  515. package/src/resources/extensions/gsd/tests/progress-strip-test-helpers.ts +79 -0
  516. package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +2 -0
  517. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +11 -2
  518. package/src/resources/extensions/gsd/tests/provider-error-guidance.test.ts +15 -0
  519. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +2 -4
  520. package/src/resources/extensions/gsd/tests/reconcile-logs.test.ts +244 -0
  521. package/src/resources/extensions/gsd/tests/recovery-finalize-logs.test.ts +119 -0
  522. package/src/resources/extensions/gsd/tests/recovery-verify-logs.test.ts +428 -0
  523. package/src/resources/extensions/gsd/tests/register-extension-guard.test.ts +25 -0
  524. package/src/resources/extensions/gsd/tests/remote-notification-from-desktop.test.ts +31 -81
  525. package/src/resources/extensions/gsd/tests/resume-missing-worktree-warning.test.ts +5 -5
  526. package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +7 -1
  527. package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +68 -0
  528. package/src/resources/extensions/gsd/tests/show-config-command.test.ts +3 -0
  529. package/src/resources/extensions/gsd/tests/single-writer-invariant.test.ts +170 -48
  530. package/src/resources/extensions/gsd/tests/skill-activation.test.ts +20 -17
  531. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +7 -3
  532. package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +17 -1
  533. package/src/resources/extensions/gsd/tests/stop-auto-race-null-unit.test.ts +1 -1
  534. package/src/resources/extensions/gsd/tests/teardown-chdir-failure-clears-registry.test.ts +17 -0
  535. package/src/resources/extensions/gsd/tests/thinking-level-resolution.test.ts +1 -1
  536. package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +4 -2
  537. package/src/resources/extensions/gsd/tests/tool-surface-readiness.test.ts +184 -10
  538. package/src/resources/extensions/gsd/tests/tui-header-lifecycle.test.ts +40 -86
  539. package/src/resources/extensions/gsd/tests/tui-render-kit.test.ts +44 -6
  540. package/src/resources/extensions/gsd/tests/uok-audit.test.ts +194 -0
  541. package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +1 -1
  542. package/src/resources/extensions/gsd/tests/workflow-mcp-readiness-cache.test.ts +119 -0
  543. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +65 -2
  544. package/src/resources/extensions/gsd/tests/workflow-phase-contract-matrix.test.ts +332 -0
  545. package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +92 -0
  546. package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +1 -1
  547. package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +36 -0
  548. package/src/resources/extensions/gsd/tests/worktree-project-root-degrade.test.ts +1 -1
  549. package/src/resources/extensions/gsd/tests/worktree-safety-phase.test.ts +100 -0
  550. package/src/resources/extensions/gsd/tests/worktree-safety.test.ts +72 -0
  551. package/src/resources/extensions/gsd/tests/worktree-teardown-safety.test.ts +22 -0
  552. package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +75 -3
  553. package/src/resources/extensions/gsd/tests/worktree.test.ts +18 -0
  554. package/src/resources/extensions/gsd/tool-surface-readiness.ts +126 -19
  555. package/src/resources/extensions/gsd/tools/complete-task.ts +87 -0
  556. package/src/resources/extensions/gsd/tools/exec-tool.ts +2 -118
  557. package/src/resources/extensions/gsd/tui/render-kit.ts +56 -13
  558. package/src/resources/extensions/gsd/unit-context-composer.ts +1 -1
  559. package/src/resources/extensions/gsd/unit-registry.ts +34 -4
  560. package/src/resources/extensions/gsd/workflow-logger.ts +5 -0
  561. package/src/resources/extensions/gsd/workflow-mcp-auto-prep.ts +2 -0
  562. package/src/resources/extensions/gsd/workflow-mcp-readiness-cache.ts +150 -0
  563. package/src/resources/extensions/gsd/worktree-manager.ts +97 -2
  564. package/src/resources/extensions/gsd/worktree-safety.ts +41 -39
  565. package/src/resources/extensions/gsd/worktree-shell-guard.ts +123 -0
  566. package/src/resources/extensions/gsd/worktree.ts +7 -1
  567. package/src/resources/extensions/mcp-client/manager.ts +7 -1
  568. package/src/resources/extensions/search-the-web/index.ts +45 -9
  569. package/src/resources/extensions/search-the-web/native-search.ts +16 -4
  570. package/src/resources/extensions/shared/gsd-browser-cli.ts +41 -2
  571. package/src/resources/extensions/subagent/index.ts +20 -15
  572. package/src/resources/extensions/subagent/tests/worktree-cwd.test.ts +57 -0
  573. package/src/resources/extensions/subagent/worktree-cwd.ts +35 -0
  574. package/src/resources/skills/create-skill/SKILL.md +3 -0
  575. package/src/resources/skills/create-skill/references/skill-structure.md +1 -0
  576. package/dist/resources/skills/gsd-browser/SKILL.md +0 -41
  577. package/src/resources/skills/gsd-browser/SKILL.md +0 -41
  578. /package/dist/web/standalone/.next/static/{T-LTxEw5wir5Lm5T3qEVd → Wn9u2NYq0cyUigB_3Z0_N}/_buildManifest.js +0 -0
  579. /package/dist/web/standalone/.next/static/{T-LTxEw5wir5Lm5T3qEVd → Wn9u2NYq0cyUigB_3Z0_N}/_ssgManifest.js +0 -0
@@ -11,6 +11,7 @@
11
11
  import type {
12
12
  ExtensionContext,
13
13
  ExtensionCommandContext,
14
+ GsdProgressState,
14
15
  ReadonlyFooterDataProvider,
15
16
  Theme,
16
17
  ThemeColor,
@@ -30,7 +31,7 @@ import { execFileSync } from "node:child_process";
30
31
  import { truncateToWidth, visibleWidth } from "@gsd/pi-tui";
31
32
  import { makeUI } from "../shared/tui.js";
32
33
  import { GLYPH, INDENT } from "../shared/mod.js";
33
- import { padRightVisible, renderPanel, renderProgressBar, rightAlign, wrapVisibleText } from "./tui/render-kit.js";
34
+ import { padRightVisible, renderPlainOutcome, renderProgressBar, rightAlign, wrapVisibleText } from "./tui/render-kit.js";
34
35
  import { computeProgressScore } from "./progress-score.js";
35
36
  import {
36
37
  getGlobalGSDPreferencesPath,
@@ -754,341 +755,88 @@ export function updateProgressWidget(
754
755
  updateSliceProgressCache(accessors.getBasePath(), mid.id, slice?.id);
755
756
  }
756
757
 
757
- ctx.ui.setWidget("gsd-progress", (tui, theme) => {
758
- let spinnerIndex = 0;
759
- let cachedLines: string[] | undefined;
760
- let cachedWidth: number | undefined;
761
- let cachedRuntimeRecord: AutoUnitRuntimeRecord | null = null;
762
-
763
- const refreshRuntimeRecord = (): void => {
764
- try {
765
- cachedRuntimeRecord = readUnitRuntimeRecord(accessors.getBasePath(), unitType, unitId);
766
- } catch {
767
- cachedRuntimeRecord = null;
768
- }
769
- };
770
-
771
- refreshRuntimeRecord();
772
-
773
- const spinnerTimer = setInterval(() => {
774
- spinnerIndex = (spinnerIndex + 1) % ACTIVE_SPINNER_FRAMES.length;
775
- cachedLines = undefined;
776
- tui.requestRender();
777
- }, 200);
778
- spinnerTimer.unref?.();
779
-
780
- // Refresh progress cache from disk every 15s so the widget reflects
781
- // task/slice completion mid-unit. Without this, the progress bar only
782
- // updates at dispatch time, appearing frozen during long-running units.
783
- // 15s (vs 5s) reduces synchronous file I/O on the hot path.
784
- const progressRefreshTimer = setInterval(() => {
785
- try {
786
- if (mid) {
787
- updateSliceProgressCache(accessors.getBasePath(), mid.id, slice?.id);
788
- }
789
- refreshRuntimeRecord();
790
- cachedLines = undefined;
791
- } catch (err) { /* non-fatal */
792
- logWarning("dashboard", `DB status update failed: ${err instanceof Error ? err.message : String(err)}`);
793
- }
794
- }, 15_000);
795
- progressRefreshTimer.unref?.();
796
-
797
- return {
798
- render(width: number): string[] {
799
- if (cachedLines && cachedWidth === width) return cachedLines;
800
-
801
- // While newSession() is in-flight, session state is mid-mutation.
802
- // Accessing cmdCtx.sessionManager or cmdCtx.getContextUsage() can
803
- // block the render loop and freeze the TUI. Return the last cached
804
- // frame (or an empty frame on first render) until the switch settles.
805
- if (accessors.isSessionSwitching()) {
806
- return cachedLines ?? [];
807
- }
808
-
809
- const ui = makeUI(theme, width);
810
- const lines: string[] = [];
811
- const pad = INDENT.base;
812
-
813
- // ── Line 1: Top bar ───────────────────────────────────────────────
814
- lines.push(...ui.bar());
815
-
816
- const spinner = theme.fg("accent", ACTIVE_SPINNER_FRAMES[spinnerIndex]);
817
- const elapsed = formatAutoElapsed(accessors.getAutoStartTime());
818
- const modeTag = accessors.isStepMode() ? "NEXT" : "AUTO";
819
-
820
- // Health indicator in header
821
- const score = computeProgressScore();
822
- const runtimeSignal = formatRuntimeHealthSignal(cachedRuntimeRecord);
823
- const healthLevel = runtimeSignal?.level ?? score.level;
824
- const healthSummary = runtimeSignal?.summary ?? score.summary;
825
- const healthColor = healthLevel === "green" ? "success"
826
- : healthLevel === "yellow" ? "warning"
827
- : "error";
828
- const healthIcon = healthLevel === "green" ? GLYPH.statusActive
829
- : healthLevel === "yellow" ? "!"
830
- : "x";
831
- const activeState = runtimeSignal?.state === "waiting" ? "waiting" : "running";
832
- const stateColor = runtimeSignal?.state === "waiting" ? "warning" : "success";
833
- const healthParts: string[] = [];
834
- if (runtimeSignal?.summary) {
835
- healthParts.push(theme.fg(healthColor, healthSummary));
836
- } else if (healthLevel !== "green") {
837
- healthParts.push(`${theme.fg(healthColor, healthIcon)} ${theme.fg(healthColor, healthSummary)}`);
838
- }
839
-
840
- const headerLeft = [
841
- `${pad}${spinner} ${theme.fg("accent", theme.bold("GSD"))}`,
842
- theme.fg("success", modeTag),
843
- theme.fg(stateColor, activeState),
844
- ...healthParts,
845
- ].join(` ${theme.fg("dim", "·")} `);
846
-
847
- // ETA in header right, after elapsed
848
- const eta = estimateTimeRemaining();
849
- const etaShort = eta ? eta.replace(" remaining", " left") : null;
850
- const headerRight = elapsed
851
- ? (etaShort
852
- ? `${theme.fg("dim", elapsed)} ${theme.fg("dim", "·")} ${theme.fg("dim", etaShort)}`
853
- : theme.fg("dim", elapsed))
854
- : "";
855
- lines.push(rightAlign(headerLeft, headerRight, width));
856
-
857
- // Show health signal details when degraded (yellow/red)
858
- if (runtimeSignal?.detail && widgetMode !== "min") {
859
- lines.push(`${pad} ${theme.fg("dim", runtimeSignal.detail)}`);
860
- } else if (score.level !== "green" && score.signals.length > 0 && widgetMode !== "min") {
861
- // Show up to 3 most relevant signals in compact form
862
- const topSignals = score.signals
863
- .filter(s => s.kind === "negative")
864
- .slice(0, 3);
865
- if (topSignals.length > 0) {
866
- const signalStr = topSignals
867
- .map(s => theme.fg("dim", s.label))
868
- .join(theme.fg("dim", " · "));
869
- lines.push(`${pad} ${signalStr}`);
870
- }
871
- }
872
-
873
- // ── Mode: off — return empty ──────────────────────────────────
874
- if (widgetMode === "off") {
875
- cachedLines = [];
876
- cachedWidth = width;
877
- return [];
878
- }
879
-
880
- // ── Mode: min — header line only ──────────────────────────────
881
- if (widgetMode === "min") {
882
- lines.push(...ui.bar());
883
- cachedLines = lines;
884
- cachedWidth = width;
885
- return lines;
886
- }
887
-
888
- // ── Mode: small — dense horizontal grid ───────────────────────
889
- if (widgetMode === "small") {
890
- lines.length = 0;
891
- lines.push(...ui.bar());
892
-
893
- const roadmapSlices = mid ? getRoadmapSlicesSync() : null;
894
- const unitLabel = unitId || [mid?.id, slice?.id, task?.id].filter(Boolean).join("/");
895
- const statusParts = [
896
- spinner,
897
- theme.fg("success", modeTag),
898
- theme.fg(stateColor, activeState),
899
- ];
900
- if (runtimeSignal?.summary) {
901
- statusParts.push(theme.fg(healthColor, healthSummary));
902
- } else if (healthLevel !== "green") {
903
- statusParts.push(`${theme.fg(healthColor, healthIcon)} ${theme.fg(healthColor, healthSummary)}`);
904
- }
905
-
906
- const timeValue = [elapsed, etaShort].filter(Boolean).join(" · ") || "--";
907
- const rowOne = widgetGridColumns(theme, width, [
908
- `${widgetGridLabel(theme, "status", "border")} ${statusParts.join(" ")}`,
909
- `${widgetGridLabel(theme, "unit")} ${theme.fg("text", unitLabel || "--")}`,
910
- `${widgetGridLabel(theme, "spend", "border")} ${theme.fg("dim", formatSmallWidgetSpend())}`,
911
- `${widgetGridLabel(theme, "time")} ${theme.fg("dim", timeValue)}`,
912
- ]);
913
-
914
- const target = task
915
- ? `${task.id}: ${task.title}`
916
- : slice
917
- ? `${slice.id}: ${slice.title}`
918
- : unitId;
919
-
920
- let taskValue = task?.id ?? "--";
921
- let sliceValue = slice?.id ?? "--";
922
- if (shouldRenderRoadmapProgress(roadmapSlices)) {
923
- const { done, total, activeSliceTasks } = roadmapSlices;
924
- const barWidth = Math.max(4, Math.min(14, Math.floor(width * 0.12)));
925
- const bar = renderProgressBar(theme, done, total, barWidth);
926
- sliceValue = `${bar} ${theme.fg("text", `${done}/${total}`)}`;
927
- if (activeSliceTasks && activeSliceTasks.total > 0) {
928
- const taskNum = isHook
929
- ? Math.max(activeSliceTasks.done, 1)
930
- : Math.min(activeSliceTasks.done + 1, activeSliceTasks.total);
931
- taskValue = `${theme.fg("accent", `${taskNum}`)}${theme.fg("dim", `/${activeSliceTasks.total}`)}`;
932
- }
933
- }
758
+ installGsdProgressStrip(ctx, accessors, unitType, unitId, mid, slice, task, isHook, verb);
759
+ }
934
760
 
935
- const rowTwo = widgetGridColumns(theme, width, [
936
- `${widgetGridLabel(theme, "phase", "border")} ${theme.fg("dim", unitType)}`,
937
- `${widgetGridLabel(theme, "work")} ${theme.fg("text", target || "--")}`,
938
- `${widgetGridLabel(theme, "task", "border")} ${taskValue}`,
939
- `${widgetGridLabel(theme, "slice")} ${sliceValue}`,
940
- ]);
941
-
942
- lines.push(rowOne);
943
- lines.push(rowTwo);
944
- lines.push(...ui.bar());
945
- cachedLines = lines;
946
- cachedWidth = width;
947
- return lines;
948
- }
761
+ function buildCompletionRollupLines(
762
+ theme: Theme,
763
+ snapshot: CompletionDashboardSnapshot,
764
+ width: number,
765
+ ): { lines: string[]; footerCommands?: string } {
766
+ const innerWidth = Math.max(8, width - 2);
767
+ const lines: string[] = [];
768
+
769
+ const add = (line: string): void => {
770
+ if (!line) return;
771
+ for (const wrapped of wrapVisibleText(line, innerWidth).slice(0, 12 - lines.length)) {
772
+ lines.push(wrapped);
773
+ }
774
+ };
949
775
 
950
- // ── Mode: full — complete two-column layout ───────────────────
951
- lines.push("");
776
+ if (snapshot.milestoneTitle) {
777
+ add(theme.fg("text", snapshot.milestoneTitle));
778
+ }
952
779
 
953
- // Context section: milestone + slice. Footer owns model/cost/context.
954
- const hasContext = !!(mid || (slice && unitType !== "research-milestone" && unitType !== "plan-milestone"));
955
- if (mid) {
956
- lines.push(truncateToWidth(`${pad}${theme.fg("dim", mid.title)}`, width, "…"));
957
- }
958
- if (slice && unitType !== "research-milestone" && unitType !== "plan-milestone") {
959
- lines.push(truncateToWidth(
960
- `${pad}${theme.fg("text", theme.bold(`${slice.id}: ${slice.title}`))}`,
961
- width, "…",
962
- ));
963
- }
964
- if (hasContext) lines.push("");
965
-
966
- const target = task ? `${task.id}: ${task.title}` : unitId;
967
- const actionLeft = `${pad}${theme.fg("accent", "▸")} ${theme.fg("accent", verb)} ${theme.fg("text", target)}`;
968
- const tierTag = tierBadge ? theme.fg("dim", `[${tierBadge}] `) : "";
969
- const phaseBadge = `${tierTag}${theme.fg("dim", phaseLabel)}`;
970
- lines.push(rightAlign(actionLeft, phaseBadge, width));
971
-
972
- lines.push("");
973
-
974
- // Two-column body
975
- const minTwoColWidth = 76;
976
- const roadmapSlices = mid ? getRoadmapSlicesSync() : null;
977
- const taskDetailsCol = roadmapSlices?.taskDetails ?? null;
978
- const useTwoCol = width >= minTwoColWidth && taskDetailsCol !== null && taskDetailsCol.length > 0;
979
- const leftColWidth = useTwoCol
980
- ? Math.floor(width * (width >= 100 ? 0.45 : 0.50))
981
- : width;
982
-
983
- const leftLines: string[] = [];
984
-
985
- if (shouldRenderRoadmapProgress(roadmapSlices)) {
986
- const { done, total, activeSliceTasks } = roadmapSlices;
987
- const barWidth = Math.max(6, Math.min(18, Math.floor(leftColWidth * 0.4)));
988
- const bar = renderProgressBar(theme, done, total, barWidth);
989
-
990
- let meta = `${theme.fg("text", `${done}`)}${theme.fg("dim", `/${total} slices`)}`;
991
- if (activeSliceTasks && activeSliceTasks.total > 0) {
992
- const taskNum = isHook
993
- ? Math.max(activeSliceTasks.done, 1)
994
- : Math.min(activeSliceTasks.done + 1, activeSliceTasks.total);
995
- meta += `${theme.fg("dim", " · task ")}${theme.fg("accent", `${taskNum}`)}${theme.fg("dim", `/${activeSliceTasks.total}`)}`;
996
- }
997
- leftLines.push(`${pad}${bar} ${meta}`);
998
- }
780
+ const oneLiner = normalizeRollupText(snapshot.oneLiner);
781
+ if (oneLiner) {
782
+ add(`${theme.fg("accent", "Outcome")} ${theme.fg("text", oneLiner)}`);
783
+ }
999
784
 
1000
- // Build right column: task checklist
1001
- const rightLines: string[] = [];
1002
- const maxVisibleTasks = 8;
785
+ const changed = [
786
+ ...(snapshot.successCriteriaResults ? [snapshot.successCriteriaResults] : []),
787
+ ...(snapshot.requirementOutcomes ? [snapshot.requirementOutcomes] : []),
788
+ ...(snapshot.keyDecisions ?? []),
789
+ ].map(normalizeRollupText).filter((v): v is string => !!v).slice(0, 4);
790
+ if (changed.length > 0) {
791
+ add(theme.fg("accent", "What changed"));
792
+ for (const item of changed) add(` - ${theme.fg("text", item)}`);
793
+ }
1003
794
 
1004
- // Max visible chars for task title text (before ANSI theming)
1005
- const maxTaskTitleLen = 45;
1006
- function truncTitle(s: string): string {
1007
- return s.length > maxTaskTitleLen ? s.slice(0, maxTaskTitleLen - 1) + "…" : s;
1008
- }
795
+ const verification = [
796
+ snapshot.definitionOfDoneResults,
797
+ snapshot.deviations ? `Deviations: ${snapshot.deviations}` : null,
798
+ snapshot.followUps ? `Follow-ups: ${snapshot.followUps}` : null,
799
+ ].map(normalizeRollupText).filter((v): v is string => !!v);
800
+ if (verification.length > 0 || (snapshot.keyFiles?.length ?? 0) > 0) {
801
+ add(theme.fg("accent", "Verification"));
802
+ for (const item of verification.slice(0, 3)) add(` - ${theme.fg("text", item)}`);
803
+ const files = (snapshot.keyFiles ?? []).map(normalizeRollupText).filter((v): v is string => !!v).slice(0, 4);
804
+ if (files.length > 0) {
805
+ add(` ${theme.fg("accent", "Files:")} ${theme.fg("text", files.join("; "))}`);
806
+ }
807
+ }
1009
808
 
1010
- function formatTaskLine(t: { id: string; title: string; done: boolean }, isCurrent: boolean): string {
1011
- const glyph = t.done
1012
- ? theme.fg("success", "*")
1013
- : isCurrent
1014
- ? theme.fg("accent", ">")
1015
- : theme.fg("dim", ".");
1016
- const id = isCurrent
1017
- ? theme.fg("accent", t.id)
1018
- : t.done
1019
- ? theme.fg("muted", t.id)
1020
- : theme.fg("dim", t.id);
1021
- const short = truncTitle(t.title);
1022
- const title = isCurrent
1023
- ? theme.fg("text", short)
1024
- : t.done
1025
- ? theme.fg("muted", short)
1026
- : theme.fg("text", short);
1027
- return `${glyph} ${id}: ${title}`;
1028
- }
809
+ const lessons = (snapshot.lessonsLearned ?? []).map(normalizeRollupText).filter((v): v is string => !!v).slice(0, 2);
810
+ if (lessons.length > 0) {
811
+ add(`${theme.fg("accent", "Lessons:")} ${theme.fg("text", lessons.join("; "))}`);
812
+ }
1029
813
 
1030
- if (useTwoCol && taskDetailsCol) {
1031
- for (const t of taskDetailsCol.slice(0, maxVisibleTasks)) {
1032
- rightLines.push(formatTaskLine(t, !!(task && t.id === task.id)));
1033
- }
1034
- if (taskDetailsCol.length > maxVisibleTasks) {
1035
- rightLines.push(theme.fg("dim", ` +${taskDetailsCol.length - maxVisibleTasks} more`));
1036
- }
1037
- } else if (!useTwoCol && taskDetailsCol && taskDetailsCol.length > 0) {
1038
- for (const t of taskDetailsCol.slice(0, maxVisibleTasks)) {
1039
- leftLines.push(`${pad}${formatTaskLine(t, !!(task && t.id === task.id))}`);
1040
- }
1041
- }
814
+ const nextAction = snapshot.allMilestonesComplete
815
+ ? snapshot.unmappedActiveRequirements && snapshot.unmappedActiveRequirements > 0
816
+ ? `Review ${snapshot.unmappedActiveRequirements} unmapped active requirement${snapshot.unmappedActiveRequirements === 1 ? "" : "s"}, then start a new milestone when ready.`
817
+ : "Review the roll-up, then start a new milestone when ready."
818
+ : "Review the roll-up, inspect status, or continue to the next milestone.";
819
+ add(`${theme.fg("success", "Next")} ${theme.fg("text", nextAction)}`);
820
+
821
+ if ((snapshot.requirementsBacklogPreview?.length ?? 0) > 0) {
822
+ add(theme.fg("accent", "Requirements backlog"));
823
+ for (const line of snapshot.requirementsBacklogPreview ?? []) {
824
+ add(` ${theme.fg("text", line)}`);
825
+ }
826
+ }
1042
827
 
1043
- // Compose columns
1044
- if (useTwoCol) {
1045
- const maxRows = Math.max(leftLines.length, rightLines.length);
1046
- if (maxRows > 0) {
1047
- lines.push("");
1048
- for (let i = 0; i < maxRows; i++) {
1049
- const left = padRightVisible(truncateToWidth(leftLines[i] ?? "", leftColWidth, "…"), leftColWidth);
1050
- const right = rightLines[i] ?? "";
1051
- lines.push(`${left}${right}`);
1052
- }
1053
- }
1054
- } else {
1055
- if (leftLines.length > 0) {
1056
- lines.push("");
1057
- for (const l of leftLines) lines.push(truncateToWidth(l, width, "…"));
1058
- }
1059
- }
828
+ const commands = snapshot.allMilestonesComplete
829
+ ? snapshot.unmappedActiveRequirements && snapshot.unmappedActiveRequirements > 0
830
+ ? ["/gsd to review requirements backlog", "/gsd status for overview", "/gsd visualize to inspect", "/gsd start for new work"]
831
+ : ["/gsd status for overview", "/gsd visualize to inspect", "/gsd notifications for history", "/gsd start for new work"]
832
+ : ["/gsd status for overview", "/gsd visualize to inspect", "/gsd notifications for history", "/gsd auto for next milestone"];
833
+ const footerCommands = theme.fg("dim", commands.join(" · "));
1060
834
 
1061
- // ── Auto controls. Footer owns cwd/branch/model/cost/context. ───
1062
- lines.push("");
1063
- // Step-mode guidance — shown above keyboard hints when auto is paused
1064
- if (accessors.isStepMode()) {
1065
- lines.push(`${pad}${theme.fg("accent", "→")} ${theme.fg("dim", "/gsd next to advance one step · /gsd status for overview")}`);
1066
- }
835
+ if (snapshot.reason) {
836
+ add(theme.fg("dim", snapshot.reason));
837
+ }
1067
838
 
1068
- // Hints line
1069
- const hintParts: string[] = [];
1070
- hintParts.push("esc pause");
1071
- hintParts.push(`${formattedShortcutPair("dashboard")} dashboard`);
1072
- hintParts.push(`${formattedShortcutPair("parallel")} parallel`);
1073
- const hintStr = theme.fg("dim", hintParts.join(" | "));
1074
- lines.push(rightAlign("", hintStr, width));
1075
-
1076
- lines.push(...ui.bar());
1077
-
1078
- cachedLines = lines;
1079
- cachedWidth = width;
1080
- return lines;
1081
- },
1082
- invalidate() {
1083
- cachedLines = undefined;
1084
- cachedWidth = undefined;
1085
- },
1086
- dispose() {
1087
- clearInterval(spinnerTimer);
1088
- if (progressRefreshTimer) clearInterval(progressRefreshTimer);
1089
- },
1090
- };
1091
- });
839
+ return { lines, footerCommands };
1092
840
  }
1093
841
 
1094
842
  export function setCompletionProgressWidget(
@@ -1096,8 +844,11 @@ export function setCompletionProgressWidget(
1096
844
  snapshot: CompletionDashboardSnapshot,
1097
845
  ): void {
1098
846
  if (!ctx.hasUI) return;
1099
- const widgetKey = "gsd-progress";
1100
847
  clearAutoOutcomeWidget(ctx);
848
+ // Clear the structured GSD progress strip so it does not linger behind
849
+ // the completion widget (the two use separate display channels).
850
+ ctx.ui?.setGsdProgress?.(undefined);
851
+ ctx.ui.setWidget("gsd-progress", undefined);
1101
852
 
1102
853
  if (typeof ctx.ui?.setHeader === "function") {
1103
854
  ctx.ui.setHeader(() => ({
@@ -1109,117 +860,20 @@ export function setCompletionProgressWidget(
1109
860
  ctx.ui.setStatus("gsd-step", undefined);
1110
861
  }
1111
862
 
1112
- ctx.ui.setWidget(widgetKey, (_tui, theme) => ({
863
+ ctx.ui.setWidget("gsd-outcome", (_tui, theme) => ({
1113
864
  render(width: number): string[] {
1114
- const ui = makeUI(theme, width);
1115
- const pad = INDENT.base;
1116
- const lines: string[] = [];
1117
- const contentWidth = Math.max(20, width - visibleWidth(pad));
1118
- const add = (line = ""): void => {
1119
- lines.push(line ? truncateToWidth(`${pad}${line}`, width, "…") : "");
1120
- };
1121
- const addSection = (label: string, value: string | null | undefined, indent = ""): void => {
1122
- const clean = normalizeRollupText(value);
1123
- if (!clean) return;
1124
- add(`${indent}${theme.fg("accent", label)} ${theme.fg("text", truncateToWidth(clean, contentWidth - indent.length - label.length - 1, "…"))}`);
1125
- };
1126
- const addList = (label: string, values: string[] | undefined, limit: number, indent = ""): void => {
1127
- const clean = (values ?? []).map(normalizeRollupText).filter((v): v is string => !!v);
1128
- if (clean.length === 0) return;
1129
- const shown = clean.slice(0, limit);
1130
- const more = clean.length > shown.length ? ` (+${clean.length - shown.length} more)` : "";
1131
- add(`${indent}${theme.fg("accent", label)} ${theme.fg("text", truncateToWidth(shown.join("; ") + more, contentWidth - indent.length - label.length - 1, "…"))}`);
1132
- };
1133
-
1134
- lines.push(...ui.bar());
1135
-
1136
865
  const elapsed = formatAutoElapsed(snapshot.startedAt);
1137
866
  const heading = snapshot.allMilestonesComplete
1138
867
  ? "All milestones complete"
1139
868
  : snapshot.milestoneId
1140
869
  ? `Milestone ${snapshot.milestoneId} roll-up`
1141
870
  : "Milestone roll-up";
1142
- lines.push(rightAlign(`${pad}${theme.fg("accent", theme.bold(heading))}`, elapsed ? theme.fg("dim", elapsed) : "", width));
1143
-
1144
- if (snapshot.milestoneTitle) {
1145
- add(theme.fg("text", snapshot.milestoneTitle));
1146
- }
1147
-
1148
- lines.push("");
1149
- add(theme.fg("accent", "Outcome"));
1150
- addSection("", snapshot.oneLiner, " ");
1151
-
1152
- const changed = [
1153
- ...(snapshot.successCriteriaResults ? [snapshot.successCriteriaResults] : []),
1154
- ...(snapshot.requirementOutcomes ? [snapshot.requirementOutcomes] : []),
1155
- ...(snapshot.keyDecisions ?? []),
1156
- ].map(normalizeRollupText).filter((v): v is string => !!v).slice(0, 4);
1157
- if (changed.length > 0) {
1158
- lines.push("");
1159
- add(theme.fg("accent", "What changed"));
1160
- for (const item of changed) add(` - ${theme.fg("text", item)}`);
1161
- }
1162
-
1163
- const verification = [
1164
- snapshot.definitionOfDoneResults,
1165
- snapshot.deviations ? `Deviations: ${snapshot.deviations}` : null,
1166
- snapshot.followUps ? `Follow-ups: ${snapshot.followUps}` : null,
1167
- ].map(normalizeRollupText).filter((v): v is string => !!v);
1168
- if (verification.length > 0 || (snapshot.keyFiles?.length ?? 0) > 0) {
1169
- lines.push("");
1170
- add(theme.fg("accent", "Verification"));
1171
- for (const item of verification.slice(0, 3)) add(` - ${theme.fg("text", item)}`);
1172
- addList("Files:", snapshot.keyFiles, 4, " ");
1173
- }
1174
-
1175
- if ((snapshot.lessonsLearned?.length ?? 0) > 0) {
1176
- lines.push("");
1177
- addList("Lessons:", snapshot.lessonsLearned, 2);
1178
- }
1179
-
1180
- const hasSliceTotals = typeof snapshot.completedSlices === "number" && typeof snapshot.totalSlices === "number" && snapshot.totalSlices > 0;
1181
-
1182
- lines.push("");
1183
- const stats: string[] = [];
1184
- if (hasSliceTotals) stats.push(theme.fg("success", `${snapshot.completedSlices}/${snapshot.totalSlices} slices`));
1185
- if (snapshot.unitCount > 0) stats.push(theme.fg("dim", `${snapshot.unitCount} units`));
1186
- if (snapshot.totalTokens > 0) stats.push(theme.fg("dim", `${formatWidgetTokens(snapshot.totalTokens)} tokens`));
1187
- if (snapshot.totalCost > 0) stats.push(theme.fg("warning", `$${snapshot.totalCost.toFixed(2)}`));
1188
- if (typeof snapshot.cacheHitRate === "number") {
1189
- const hitColor = snapshot.cacheHitRate >= 70 ? "success" : snapshot.cacheHitRate >= 40 ? "warning" : "error";
1190
- stats.push(theme.fg(hitColor, `${Math.round(snapshot.cacheHitRate)}% cache hit`));
1191
- }
1192
- if (stats.length > 0) {
1193
- add(`${theme.fg("accent", "Run totals")} ${stats.join(theme.fg("dim", " · "))}`);
1194
- }
1195
-
1196
- lines.push("");
1197
- const nextAction = snapshot.allMilestonesComplete
1198
- ? snapshot.unmappedActiveRequirements && snapshot.unmappedActiveRequirements > 0
1199
- ? `Review ${snapshot.unmappedActiveRequirements} unmapped active requirement${snapshot.unmappedActiveRequirements === 1 ? "" : "s"}, then start a new milestone when ready.`
1200
- : "Review the roll-up, then start a new milestone when ready."
1201
- : "Review the roll-up, inspect status, or continue to the next milestone.";
1202
- const commands = snapshot.allMilestonesComplete
1203
- ? snapshot.unmappedActiveRequirements && snapshot.unmappedActiveRequirements > 0
1204
- ? ["/gsd to review requirements backlog", "/gsd status for overview", "/gsd visualize to inspect", "/gsd start for new work"]
1205
- : ["/gsd status for overview", "/gsd visualize to inspect", "/gsd notifications for history", "/gsd start for new work"]
1206
- : ["/gsd status for overview", "/gsd visualize to inspect", "/gsd notifications for history", "/gsd auto for next milestone"];
1207
- add(`${theme.fg("success", "Next")} ${theme.fg("text", nextAction)}`);
1208
- if ((snapshot.requirementsBacklogPreview?.length ?? 0) > 0) {
1209
- lines.push("");
1210
- add(theme.fg("accent", "Requirements backlog"));
1211
- for (const line of snapshot.requirementsBacklogPreview ?? []) {
1212
- add(` ${theme.fg("text", line)}`);
1213
- }
1214
- }
1215
- add(theme.fg("dim", commands.join(" · ")));
1216
-
1217
- const location = snapshot.basePath ? theme.fg("dim", snapshot.basePath) : "";
1218
- const reason = theme.fg("dim", snapshot.reason);
1219
- lines.push(rightAlign(`${pad}${truncateToWidth(location, Math.max(0, width - 32), "…")}`, reason, width));
1220
- lines.push(...ui.bar());
1221
-
1222
- return lines;
871
+ const statusLine = `${theme.fg("success", "✓")} ${theme.fg("text", heading)}`;
872
+ const { lines, footerCommands } = buildCompletionRollupLines(theme, snapshot, width);
873
+ return renderPlainOutcome(theme, width, statusLine, lines, {
874
+ headerRight: elapsed ? theme.fg("dim", elapsed) : undefined,
875
+ footerRight: footerCommands,
876
+ });
1223
877
  },
1224
878
  invalidate(): void {},
1225
879
  dispose(): void {},
@@ -1231,6 +885,8 @@ export function setAutoOutcomeWidget(
1231
885
  snapshot: AutoOutcomeSurfaceSnapshot,
1232
886
  ): void {
1233
887
  if (!ctx.hasUI) return;
888
+ ctx.ui?.setGsdProgress?.(undefined);
889
+ ctx.ui.setWidget("gsd-progress", undefined);
1234
890
 
1235
891
  ctx.ui.setWidget("gsd-outcome", (_tui, theme) => ({
1236
892
  render(width: number): string[] {
@@ -1244,40 +900,57 @@ export function setAutoOutcomeWidget(
1244
900
  : snapshot.status === "blocked" ? "!"
1245
901
  : snapshot.status === "paused" ? "||"
1246
902
  : "●";
1247
- // renderPanel indents body lines by 2; mirror that for wrap width.
1248
- const innerWidth = Math.max(8, width - 2);
1249
- const maxLines = 7;
1250
- const lines: string[] = [];
1251
903
  const elapsed = snapshot.startedAt ? formatAutoElapsed(snapshot.startedAt) : "";
1252
- const heading = `${theme.fg(color, icon)} ${theme.fg("accent", theme.bold("GSD"))} ${theme.fg("text", snapshot.title)}`;
1253
- // Elapsed rides inline after the title on the header rule.
1254
- const title = elapsed ? `${heading} ${theme.fg("dim", elapsed)}` : heading;
904
+ const statusLine = `${theme.fg(color, icon)} ${theme.fg("text", snapshot.title)}`;
1255
905
  const commands = snapshot.commands?.filter(Boolean) ?? [];
1256
- const commandLine = commands.length > 0 ? theme.fg("dim", commands.join(" · ")) : null;
1257
-
1258
- const addWrapped = (text: string, prefix = ""): void => {
1259
- const reserve = commandLine ? 1 : 0;
1260
- const remaining = Math.max(0, maxLines - reserve - lines.length);
1261
- if (remaining === 0) return;
1262
- const available = Math.max(8, innerWidth - visibleWidth(prefix));
1263
- for (const [idx, line] of wrapVisibleText(text, available).slice(0, remaining).entries()) {
1264
- lines.push(`${idx === 0 ? prefix : " ".repeat(visibleWidth(prefix))}${line}`);
1265
- }
906
+ const commandLine = commands.length > 0 ? theme.fg("dim", commands.join(" · ")) : undefined;
907
+
908
+ const innerWidth = Math.max(8, width);
909
+ const maxLines = 7;
910
+ const splitRows: Array<{ left: string; right?: string }> = [];
911
+ let commandsPlaced = false;
912
+
913
+ const pushLeft = (left: string): void => {
914
+ if (splitRows.length >= maxLines - (commandLine ? 1 : 0)) return;
915
+ splitRows.push({ left });
1266
916
  };
1267
917
 
1268
918
  if (snapshot.detail) {
1269
- addWrapped(snapshot.detail, `${theme.fg("dim", "Reason")} `);
919
+ for (const line of wrapVisibleText(snapshot.detail, innerWidth).slice(0, maxLines)) {
920
+ pushLeft(theme.fg("text", line));
921
+ }
1270
922
  }
923
+
1271
924
  if (snapshot.unitLabel) {
1272
- addWrapped(snapshot.unitLabel, `${theme.fg("dim", "Last")} `);
925
+ const lastLeft = theme.fg("dim", "Last · ") + theme.fg("text", snapshot.unitLabel);
926
+ if (
927
+ commandLine &&
928
+ visibleWidth(lastLeft) + visibleWidth(commandLine) + 2 <= innerWidth &&
929
+ splitRows.length < maxLines
930
+ ) {
931
+ splitRows.push({ left: lastLeft, right: commandLine });
932
+ commandsPlaced = true;
933
+ } else {
934
+ pushLeft(lastLeft);
935
+ }
1273
936
  }
1274
- addWrapped(snapshot.nextAction, `${theme.fg("success", "Next")} `);
1275
937
 
1276
- if (commandLine && lines.length < maxLines) {
1277
- lines.push(commandLine);
938
+ const nextPrefix = theme.fg("success", "Next · ");
939
+ const nextPrefixWidth = visibleWidth(nextPrefix);
940
+ for (const [idx, line] of wrapVisibleText(
941
+ snapshot.nextAction,
942
+ Math.max(8, innerWidth - nextPrefixWidth),
943
+ ).entries()) {
944
+ if (splitRows.length >= maxLines - (commandLine && !commandsPlaced ? 1 : 0)) break;
945
+ const lead = idx === 0 ? nextPrefix : " ".repeat(nextPrefixWidth);
946
+ pushLeft(theme.fg("text", lead + line));
1278
947
  }
1279
948
 
1280
- return renderPanel(theme, title, lines, width, { ruleColor: color });
949
+ return renderPlainOutcome(theme, width, statusLine, [], {
950
+ headerRight: elapsed ? theme.fg("dim", elapsed) : undefined,
951
+ splitRows,
952
+ footerRight: commandLine && !commandsPlaced ? commandLine : undefined,
953
+ });
1281
954
  },
1282
955
  invalidate(): void {},
1283
956
  dispose(): void {},
@@ -1344,3 +1017,186 @@ function extractMessageText(value: unknown): string | null {
1344
1017
 
1345
1018
  return null;
1346
1019
  }
1020
+
1021
+ type MilestoneRef = NonNullable<GSDState["activeMilestone"]>;
1022
+ type SliceRef = NonNullable<GSDState["activeSlice"]>;
1023
+ type TaskRef = NonNullable<GSDState["activeTask"]>;
1024
+
1025
+ function buildGsdProgressPayload(
1026
+ accessors: WidgetStateAccessors,
1027
+ unitType: string,
1028
+ unitId: string,
1029
+ mid: MilestoneRef | null | undefined,
1030
+ slice: SliceRef | null | undefined,
1031
+ task: TaskRef | null | undefined,
1032
+ isHook: boolean,
1033
+ verb: string,
1034
+ runtimeRecord: AutoUnitRuntimeRecord | null,
1035
+ ): GsdProgressState | undefined {
1036
+ const mode = getWidgetMode();
1037
+ if (mode === "off") return undefined;
1038
+
1039
+ const elapsed = formatAutoElapsed(accessors.getAutoStartTime());
1040
+ const eta = estimateTimeRemaining();
1041
+ const etaShort = eta ? eta.replace(" remaining", " left") : undefined;
1042
+ const modeTag = accessors.isStepMode() ? "NEXT" : "AUTO";
1043
+
1044
+ const target = task
1045
+ ? `${task.id}: ${task.title}`
1046
+ : slice
1047
+ ? `${slice.id}: ${slice.title}`
1048
+ : unitId;
1049
+ const phase = `${verb} ${target}`.trim();
1050
+
1051
+ const roadmapSlices = mid ? getRoadmapSlicesSync() : null;
1052
+ let taskProgress: { done: number; total: number } | undefined;
1053
+ let sliceProgress: { done: number; total: number } | undefined;
1054
+ if (shouldRenderRoadmapProgress(roadmapSlices)) {
1055
+ if (roadmapSlices.total > 0) {
1056
+ sliceProgress = { done: roadmapSlices.done, total: roadmapSlices.total };
1057
+ }
1058
+ const { activeSliceTasks } = roadmapSlices;
1059
+ if (activeSliceTasks && activeSliceTasks.total > 0) {
1060
+ const taskNum = isHook
1061
+ ? Math.max(activeSliceTasks.done, 1)
1062
+ : Math.min(activeSliceTasks.done + 1, activeSliceTasks.total);
1063
+ taskProgress = { done: taskNum, total: activeSliceTasks.total };
1064
+ }
1065
+ }
1066
+
1067
+ const runtimeSignal = formatRuntimeHealthSignal(runtimeRecord);
1068
+ const score = computeProgressScore();
1069
+ let healthSummary: string | undefined;
1070
+ if (mode !== "min") {
1071
+ if (runtimeSignal?.detail) {
1072
+ healthSummary = runtimeSignal.detail;
1073
+ } else if (score.level !== "green") {
1074
+ healthSummary = score.signals
1075
+ .filter((signal) => signal.kind === "negative")
1076
+ .slice(0, 2)
1077
+ .map((signal) => signal.label)
1078
+ .join(" · ");
1079
+ }
1080
+ }
1081
+
1082
+ const unitLabel = unitId || [mid?.id, slice?.id, task?.id].filter(Boolean).join("/");
1083
+
1084
+ return {
1085
+ phase,
1086
+ modeTag,
1087
+ taskProgress,
1088
+ sliceProgress,
1089
+ sliceLabel: slice?.id,
1090
+ taskLabel: task?.id,
1091
+ unitLabel,
1092
+ elapsed,
1093
+ eta: etaShort,
1094
+ healthSummary,
1095
+ path: accessors.getBasePath(),
1096
+ widgetMode: mode,
1097
+ };
1098
+ }
1099
+
1100
+ function installGsdProgressStrip(
1101
+ ctx: ExtensionContext,
1102
+ accessors: WidgetStateAccessors,
1103
+ unitType: string,
1104
+ unitId: string,
1105
+ mid: MilestoneRef | null | undefined,
1106
+ slice: SliceRef | null | undefined,
1107
+ task: TaskRef | null | undefined,
1108
+ isHook: boolean,
1109
+ verb: string,
1110
+ ): void {
1111
+ if (!ctx.hasUI || typeof ctx.ui?.setGsdProgress !== "function") return;
1112
+
1113
+ ctx.ui.setWidget("gsd-progress", undefined);
1114
+
1115
+ let cachedRuntimeRecord: AutoUnitRuntimeRecord | null = null;
1116
+ const refreshRuntimeRecord = (): void => {
1117
+ try {
1118
+ cachedRuntimeRecord = readUnitRuntimeRecord(accessors.getBasePath(), unitType, unitId);
1119
+ } catch {
1120
+ cachedRuntimeRecord = null;
1121
+ }
1122
+ };
1123
+ refreshRuntimeRecord();
1124
+
1125
+ let progressRefreshTimer: ReturnType<typeof setInterval> | undefined;
1126
+ let elapsedRefreshTimer: ReturnType<typeof setInterval> | undefined;
1127
+
1128
+ const dispose = (): void => {
1129
+ if (progressRefreshTimer !== undefined) {
1130
+ clearInterval(progressRefreshTimer);
1131
+ progressRefreshTimer = undefined;
1132
+ }
1133
+ if (elapsedRefreshTimer !== undefined) {
1134
+ clearInterval(elapsedRefreshTimer);
1135
+ elapsedRefreshTimer = undefined;
1136
+ }
1137
+ // Do not call setGsdProgress here: callers (resetExtensionUI, unit transition,
1138
+ // setCompletionProgressWidget) clear gsdProgressState directly, and calling it
1139
+ // here would re-enter setGsdProgress which calls dispose again — infinite recursion.
1140
+ };
1141
+
1142
+ const publish = (registerDispose = false): boolean => {
1143
+ if (accessors.isSessionSwitching()) {
1144
+ // On initial install (registerDispose) clear any stale strip from the
1145
+ // previous unit. On timer refreshes, skip silently — calling
1146
+ // setGsdProgress(undefined) would run dispose() and permanently clear
1147
+ // the refresh timers, leaving the strip blank after the switch.
1148
+ if (registerDispose) {
1149
+ ctx.ui!.setGsdProgress!(undefined);
1150
+ }
1151
+ return false;
1152
+ }
1153
+ ctx.ui!.setGsdProgress!(
1154
+ buildGsdProgressPayload(
1155
+ accessors,
1156
+ unitType,
1157
+ unitId,
1158
+ mid,
1159
+ slice,
1160
+ task,
1161
+ isHook,
1162
+ verb,
1163
+ cachedRuntimeRecord,
1164
+ ),
1165
+ registerDispose ? dispose : undefined,
1166
+ );
1167
+ return true;
1168
+ };
1169
+
1170
+ const startElapsedRefreshTimer = (): void => {
1171
+ if (elapsedRefreshTimer !== undefined) return;
1172
+ elapsedRefreshTimer = setInterval(() => {
1173
+ try {
1174
+ publish();
1175
+ } catch (err) {
1176
+ logWarning("dashboard", `progress strip elapsed refresh failed: ${getErrorMessage(err)}`);
1177
+ }
1178
+ }, 1_000);
1179
+ elapsedRefreshTimer.unref?.();
1180
+ };
1181
+
1182
+ const startProgressRefreshTimer = (): void => {
1183
+ if (progressRefreshTimer !== undefined) return;
1184
+ progressRefreshTimer = setInterval(() => {
1185
+ try {
1186
+ if (mid) {
1187
+ updateSliceProgressCache(accessors.getBasePath(), mid.id, slice?.id);
1188
+ }
1189
+ refreshRuntimeRecord();
1190
+ publish();
1191
+ } catch (err) {
1192
+ logWarning("dashboard", `progress strip refresh failed: ${getErrorMessage(err)}`);
1193
+ }
1194
+ }, 15_000);
1195
+ progressRefreshTimer.unref?.();
1196
+ };
1197
+
1198
+ if (publish(true)) {
1199
+ startElapsedRefreshTimer();
1200
+ startProgressRefreshTimer();
1201
+ }
1202
+ }