gsd-pi 2.71.0 → 2.72.0-dev.de4c4b3

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 (459) hide show
  1. package/README.md +57 -17
  2. package/dist/cli.js +29 -3
  3. package/dist/headless-events.d.ts +2 -0
  4. package/dist/headless-events.js +7 -0
  5. package/dist/headless.js +16 -3
  6. package/dist/mcp-server.js +40 -17
  7. package/dist/provider-migrations.d.ts +10 -0
  8. package/dist/provider-migrations.js +12 -0
  9. package/dist/resource-loader.js +139 -13
  10. package/dist/resources/GSD-WORKFLOW.md +1 -1
  11. package/dist/resources/agents/debugger.md +58 -0
  12. package/dist/resources/agents/doc-writer.md +43 -0
  13. package/dist/resources/agents/git-ops.md +56 -0
  14. package/dist/resources/agents/javascript-pro.md +46 -271
  15. package/dist/resources/agents/planner.md +55 -0
  16. package/dist/resources/agents/refactorer.md +47 -0
  17. package/dist/resources/agents/reviewer.md +48 -0
  18. package/dist/resources/agents/security.md +59 -0
  19. package/dist/resources/agents/tester.md +50 -0
  20. package/dist/resources/agents/typescript-pro.md +41 -235
  21. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +113 -10
  22. package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
  23. package/dist/resources/extensions/gsd/auto/loop.js +32 -1
  24. package/dist/resources/extensions/gsd/auto/phases.js +5 -1
  25. package/dist/resources/extensions/gsd/auto/session.js +11 -0
  26. package/dist/resources/extensions/gsd/auto-dashboard.js +22 -16
  27. package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
  28. package/dist/resources/extensions/gsd/auto-prompts.js +88 -33
  29. package/dist/resources/extensions/gsd/auto-start.js +34 -7
  30. package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
  31. package/dist/resources/extensions/gsd/auto-worktree.js +1 -1
  32. package/dist/resources/extensions/gsd/auto.js +56 -0
  33. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
  34. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +2 -0
  35. package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +63 -51
  36. package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -0
  37. package/dist/resources/extensions/gsd/commands/context.js +15 -6
  38. package/dist/resources/extensions/gsd/commands/dispatcher.js +12 -2
  39. package/dist/resources/extensions/gsd/commands/handlers/auto.js +10 -33
  40. package/dist/resources/extensions/gsd/commands/handlers/core.js +56 -11
  41. package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +15 -6
  42. package/dist/resources/extensions/gsd/commands/handlers/workflow.js +4 -10
  43. package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
  44. package/dist/resources/extensions/gsd/dispatch-guard.js +18 -1
  45. package/dist/resources/extensions/gsd/doctor-providers.js +23 -0
  46. package/dist/resources/extensions/gsd/error-classifier.js +5 -2
  47. package/dist/resources/extensions/gsd/forensics.js +19 -6
  48. package/dist/resources/extensions/gsd/gate-registry.js +208 -0
  49. package/dist/resources/extensions/gsd/gsd-db.js +41 -0
  50. package/dist/resources/extensions/gsd/guided-flow.js +5 -10
  51. package/dist/resources/extensions/gsd/metrics.js +1 -0
  52. package/dist/resources/extensions/gsd/milestone-actions.js +10 -4
  53. package/dist/resources/extensions/gsd/milestone-validation-gates.js +11 -12
  54. package/dist/resources/extensions/gsd/notification-overlay.js +42 -13
  55. package/dist/resources/extensions/gsd/notification-store.js +56 -5
  56. package/dist/resources/extensions/gsd/notification-widget.js +5 -13
  57. package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +8 -3
  58. package/dist/resources/extensions/gsd/pre-execution-checks.js +35 -2
  59. package/dist/resources/extensions/gsd/prompt-validation.js +126 -0
  60. package/dist/resources/extensions/gsd/prompts/complete-slice.md +5 -3
  61. package/dist/resources/extensions/gsd/prompts/discuss.md +2 -0
  62. package/dist/resources/extensions/gsd/prompts/execute-task.md +22 -19
  63. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
  64. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
  65. package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  66. package/dist/resources/extensions/gsd/prompts/queue.md +3 -2
  67. package/dist/resources/extensions/gsd/prompts/system.md +1 -0
  68. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
  69. package/dist/resources/extensions/gsd/session-model-override.js +25 -0
  70. package/dist/resources/extensions/gsd/shortcut-defs.js +40 -0
  71. package/dist/resources/extensions/gsd/state.js +9 -2
  72. package/dist/resources/extensions/gsd/tools/complete-slice.js +52 -1
  73. package/dist/resources/extensions/gsd/tools/complete-task.js +51 -1
  74. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +4 -1
  75. package/dist/resources/extensions/ollama/index.js +13 -5
  76. package/dist/resources/extensions/shared/gsd-phase-state.js +35 -0
  77. package/dist/resources/extensions/subagent/agents.js +8 -0
  78. package/dist/resources/extensions/subagent/index.js +17 -0
  79. package/dist/resources/skills/create-skill/SKILL.md +2 -0
  80. package/dist/startup-model-validation.d.ts +0 -1
  81. package/dist/startup-model-validation.js +6 -2
  82. package/dist/web/standalone/.next/BUILD_ID +1 -1
  83. package/dist/web/standalone/.next/app-path-routes-manifest.json +10 -10
  84. package/dist/web/standalone/.next/build-manifest.json +3 -3
  85. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  86. package/dist/web/standalone/.next/required-server-files.json +3 -3
  87. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  88. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  89. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  90. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  91. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  92. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  93. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  94. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  95. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  96. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  97. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  98. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  99. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  100. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  101. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  102. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  103. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  104. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  105. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  106. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  107. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  108. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  109. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  110. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  111. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  113. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  114. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  115. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  116. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  117. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  118. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  119. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  120. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  121. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  122. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  123. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  124. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  125. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  126. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  127. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  146. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  156. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  162. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  163. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  178. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
  182. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  184. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  191. package/dist/web/standalone/.next/server/app/index.html +1 -1
  192. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  193. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  194. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  195. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  196. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  197. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  198. package/dist/web/standalone/.next/server/app/page.js +2 -2
  199. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  200. package/dist/web/standalone/.next/server/app-paths-manifest.json +10 -10
  201. package/dist/web/standalone/.next/server/chunks/63.js +3 -3
  202. package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
  203. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  204. package/dist/web/standalone/.next/server/middleware.js +2 -2
  205. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  206. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  207. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  208. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  209. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  210. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  211. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  212. package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
  213. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  214. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  215. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  216. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  217. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  218. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  219. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  220. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  221. package/dist/web/standalone/server.js +1 -1
  222. package/package.json +1 -1
  223. package/packages/mcp-server/dist/server.d.ts +12 -1
  224. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  225. package/packages/mcp-server/dist/server.js +90 -42
  226. package/packages/mcp-server/dist/server.js.map +1 -1
  227. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  228. package/packages/mcp-server/dist/workflow-tools.js +22 -12
  229. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  230. package/packages/mcp-server/src/server.ts +110 -38
  231. package/packages/mcp-server/src/workflow-tools.test.ts +110 -0
  232. package/packages/mcp-server/src/workflow-tools.ts +32 -12
  233. package/packages/pi-ai/dist/providers/amazon-bedrock.js +11 -2
  234. package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  235. package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts +2 -0
  236. package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts.map +1 -0
  237. package/packages/pi-ai/dist/providers/anthropic-auth.test.js +20 -0
  238. package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -0
  239. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +4 -1
  240. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
  241. package/packages/pi-ai/dist/providers/anthropic-shared.js +8 -3
  242. package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
  243. package/packages/pi-ai/dist/providers/anthropic-shared.test.js +44 -1
  244. package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
  245. package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -1
  246. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  247. package/packages/pi-ai/dist/providers/anthropic.js +7 -4
  248. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  249. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  250. package/packages/pi-ai/dist/providers/openai-completions.js +11 -0
  251. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
  252. package/packages/pi-ai/src/providers/amazon-bedrock.ts +13 -1
  253. package/packages/pi-ai/src/providers/anthropic-auth.test.ts +32 -0
  254. package/packages/pi-ai/src/providers/anthropic-shared.test.ts +55 -1
  255. package/packages/pi-ai/src/providers/anthropic-shared.ts +14 -3
  256. package/packages/pi-ai/src/providers/anthropic.ts +8 -4
  257. package/packages/pi-ai/src/providers/openai-completions.ts +14 -0
  258. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts +2 -0
  259. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts.map +1 -0
  260. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js +61 -0
  261. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js.map +1 -0
  262. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  263. package/packages/pi-coding-agent/dist/core/agent-session.js +2 -1
  264. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  265. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +10 -0
  266. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  267. package/packages/pi-coding-agent/dist/core/auth-storage.js +27 -0
  268. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  269. package/packages/pi-coding-agent/dist/core/auth-storage.test.js +85 -0
  270. package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
  271. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts +2 -0
  272. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts.map +1 -0
  273. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js +64 -0
  274. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js.map +1 -0
  275. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  276. package/packages/pi-coding-agent/dist/core/model-resolver.js +22 -18
  277. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  278. package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts +8 -0
  279. package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts.map +1 -0
  280. package/packages/pi-coding-agent/dist/core/model-resolver.test.js +75 -0
  281. package/packages/pi-coding-agent/dist/core/model-resolver.test.js.map +1 -0
  282. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +5 -0
  283. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
  284. package/packages/pi-coding-agent/dist/core/retry-handler.js +55 -1
  285. package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
  286. package/packages/pi-coding-agent/dist/core/retry-handler.test.js +57 -0
  287. package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
  288. package/packages/pi-coding-agent/dist/core/sdk.d.ts +11 -0
  289. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  290. package/packages/pi-coding-agent/dist/core/sdk.js +38 -5
  291. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  292. package/packages/pi-coding-agent/dist/core/sdk.test.d.ts +2 -0
  293. package/packages/pi-coding-agent/dist/core/sdk.test.d.ts.map +1 -0
  294. package/packages/pi-coding-agent/dist/core/sdk.test.js +71 -0
  295. package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -0
  296. package/packages/pi-coding-agent/dist/index.d.ts +1 -1
  297. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  298. package/packages/pi-coding-agent/dist/index.js +1 -1
  299. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  300. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts +2 -0
  301. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts.map +1 -0
  302. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js +13 -0
  303. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js.map +1 -0
  304. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +4 -0
  305. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  306. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +24 -2
  307. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
  308. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  309. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +9 -2
  310. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
  311. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +4 -0
  312. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  313. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +43 -0
  314. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  315. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  316. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +7 -2
  317. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  318. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -1
  319. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +6 -1
  320. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -1
  321. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  322. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -3
  323. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  324. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +4 -2
  325. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
  326. package/packages/pi-coding-agent/package.json +1 -1
  327. package/packages/pi-coding-agent/src/core/agent-session-renderable-tools.test.ts +70 -0
  328. package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
  329. package/packages/pi-coding-agent/src/core/auth-storage.test.ts +108 -0
  330. package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -0
  331. package/packages/pi-coding-agent/src/core/model-resolver-initial-model-auth.test.ts +78 -0
  332. package/packages/pi-coding-agent/src/core/model-resolver.test.ts +85 -0
  333. package/packages/pi-coding-agent/src/core/model-resolver.ts +22 -18
  334. package/packages/pi-coding-agent/src/core/retry-handler.test.ts +83 -0
  335. package/packages/pi-coding-agent/src/core/retry-handler.ts +60 -1
  336. package/packages/pi-coding-agent/src/core/sdk.test.ts +89 -0
  337. package/packages/pi-coding-agent/src/core/sdk.ts +45 -9
  338. package/packages/pi-coding-agent/src/index.ts +1 -0
  339. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
  340. package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +30 -2
  341. package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +15 -6
  342. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +47 -0
  343. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +7 -2
  344. package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
  345. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4 -3
  346. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
  347. package/pkg/package.json +1 -1
  348. package/src/resources/GSD-WORKFLOW.md +1 -1
  349. package/src/resources/agents/debugger.md +58 -0
  350. package/src/resources/agents/doc-writer.md +43 -0
  351. package/src/resources/agents/git-ops.md +56 -0
  352. package/src/resources/agents/javascript-pro.md +46 -271
  353. package/src/resources/agents/planner.md +55 -0
  354. package/src/resources/agents/refactorer.md +47 -0
  355. package/src/resources/agents/reviewer.md +48 -0
  356. package/src/resources/agents/security.md +59 -0
  357. package/src/resources/agents/tester.md +50 -0
  358. package/src/resources/agents/typescript-pro.md +41 -235
  359. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +122 -8
  360. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +189 -6
  361. package/src/resources/extensions/gsd/auto/infra-errors.ts +38 -0
  362. package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -0
  363. package/src/resources/extensions/gsd/auto/loop.ts +45 -1
  364. package/src/resources/extensions/gsd/auto/phases.ts +6 -0
  365. package/src/resources/extensions/gsd/auto/session.ts +11 -0
  366. package/src/resources/extensions/gsd/auto-dashboard.ts +29 -18
  367. package/src/resources/extensions/gsd/auto-model-selection.ts +9 -1
  368. package/src/resources/extensions/gsd/auto-prompts.ts +111 -33
  369. package/src/resources/extensions/gsd/auto-start.ts +41 -7
  370. package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
  371. package/src/resources/extensions/gsd/auto-worktree.ts +1 -1
  372. package/src/resources/extensions/gsd/auto.ts +72 -0
  373. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
  374. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +2 -0
  375. package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +79 -60
  376. package/src/resources/extensions/gsd/bootstrap/system-context.ts +7 -0
  377. package/src/resources/extensions/gsd/commands/context.ts +16 -5
  378. package/src/resources/extensions/gsd/commands/dispatcher.ts +14 -2
  379. package/src/resources/extensions/gsd/commands/handlers/auto.ts +10 -36
  380. package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -11
  381. package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +17 -7
  382. package/src/resources/extensions/gsd/commands/handlers/workflow.ts +4 -10
  383. package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
  384. package/src/resources/extensions/gsd/dispatch-guard.ts +18 -1
  385. package/src/resources/extensions/gsd/doctor-providers.ts +24 -0
  386. package/src/resources/extensions/gsd/error-classifier.ts +5 -2
  387. package/src/resources/extensions/gsd/forensics.ts +23 -7
  388. package/src/resources/extensions/gsd/gate-registry.ts +251 -0
  389. package/src/resources/extensions/gsd/gsd-db.ts +51 -0
  390. package/src/resources/extensions/gsd/guided-flow.ts +5 -10
  391. package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
  392. package/src/resources/extensions/gsd/metrics.ts +12 -1
  393. package/src/resources/extensions/gsd/milestone-actions.ts +10 -3
  394. package/src/resources/extensions/gsd/milestone-validation-gates.ts +11 -13
  395. package/src/resources/extensions/gsd/notification-overlay.ts +47 -14
  396. package/src/resources/extensions/gsd/notification-store.ts +54 -5
  397. package/src/resources/extensions/gsd/notification-widget.ts +5 -14
  398. package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -3
  399. package/src/resources/extensions/gsd/pre-execution-checks.ts +39 -2
  400. package/src/resources/extensions/gsd/prompt-validation.ts +157 -0
  401. package/src/resources/extensions/gsd/prompts/complete-slice.md +5 -3
  402. package/src/resources/extensions/gsd/prompts/discuss.md +2 -0
  403. package/src/resources/extensions/gsd/prompts/execute-task.md +22 -19
  404. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
  405. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
  406. package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  407. package/src/resources/extensions/gsd/prompts/queue.md +3 -2
  408. package/src/resources/extensions/gsd/prompts/system.md +1 -0
  409. package/src/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
  410. package/src/resources/extensions/gsd/session-model-override.ts +36 -0
  411. package/src/resources/extensions/gsd/shortcut-defs.ts +56 -0
  412. package/src/resources/extensions/gsd/state.ts +13 -2
  413. package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +25 -9
  414. package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +28 -0
  415. package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +39 -0
  416. package/src/resources/extensions/gsd/tests/complete-slice-gate-closure.test.ts +167 -0
  417. package/src/resources/extensions/gsd/tests/complete-slice-prompt-task-summary-layout.test.ts +18 -0
  418. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -0
  419. package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +36 -0
  420. package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts +33 -0
  421. package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +62 -0
  422. package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +31 -0
  423. package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +27 -0
  424. package/src/resources/extensions/gsd/tests/gate-registry.test.ts +140 -0
  425. package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +73 -0
  426. package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +180 -0
  427. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +66 -1
  428. package/src/resources/extensions/gsd/tests/model-isolation.test.ts +36 -51
  429. package/src/resources/extensions/gsd/tests/notification-store.test.ts +35 -0
  430. package/src/resources/extensions/gsd/tests/notification-widget.test.ts +26 -0
  431. package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +90 -0
  432. package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +1 -0
  433. package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +18 -0
  434. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +49 -0
  435. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +19 -0
  436. package/src/resources/extensions/gsd/tests/prompt-system-gate-coverage.test.ts +208 -0
  437. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +16 -0
  438. package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +63 -5
  439. package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -0
  440. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +90 -0
  441. package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +7 -0
  442. package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +18 -0
  443. package/src/resources/extensions/gsd/tools/complete-slice.ts +63 -0
  444. package/src/resources/extensions/gsd/tools/complete-task.ts +63 -0
  445. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +4 -1
  446. package/src/resources/extensions/gsd/types.ts +26 -0
  447. package/src/resources/extensions/ollama/index.ts +13 -3
  448. package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -0
  449. package/src/resources/extensions/shared/gsd-phase-state.ts +42 -0
  450. package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +48 -0
  451. package/src/resources/extensions/subagent/agents.ts +10 -0
  452. package/src/resources/extensions/subagent/index.ts +18 -0
  453. package/src/resources/extensions/subagent/tests/agents-conflicts.test.ts +33 -0
  454. package/src/resources/skills/create-skill/SKILL.md +2 -0
  455. package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
  456. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  457. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  458. /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → f-Gremw0nLxxFUySaHRPw}/_buildManifest.js +0 -0
  459. /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → f-Gremw0nLxxFUySaHRPw}/_ssgManifest.js +0 -0
@@ -1,79 +1,98 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
 
4
- import type { ExtensionAPI } from "@gsd/pi-coding-agent";
4
+ import type { ExtensionAPI, ExtensionContext } from "@gsd/pi-coding-agent";
5
5
  import { Key } from "@gsd/pi-tui";
6
6
 
7
7
  import { GSDDashboardOverlay } from "../dashboard-overlay.js";
8
8
  import { GSDNotificationOverlay } from "../notification-overlay.js";
9
9
  import { ParallelMonitorOverlay } from "../parallel-monitor-overlay.js";
10
+ import { GSD_SHORTCUTS } from "../shortcut-defs.js";
10
11
  import { projectRoot } from "../commands/context.js";
11
12
  import { shortcutDesc } from "../../shared/mod.js";
12
13
 
13
14
  export function registerShortcuts(pi: ExtensionAPI): void {
14
- pi.registerShortcut(Key.ctrlAlt("g"), {
15
- description: shortcutDesc("Open GSD dashboard", "/gsd status"),
16
- handler: async (ctx) => {
17
- const basePath = projectRoot();
18
- if (!existsSync(join(basePath, ".gsd"))) {
19
- ctx.ui.notify("No .gsd/ directory found. Run /gsd to start.", "info");
20
- return;
21
- }
22
- await ctx.ui.custom<boolean>(
23
- (tui, theme, _kb, done) => new GSDDashboardOverlay(tui, theme, () => done(true)),
24
- {
25
- overlay: true,
26
- overlayOptions: {
27
- width: "90%",
28
- minWidth: 80,
29
- maxHeight: "92%",
30
- anchor: "center",
31
- },
15
+ const overlayOptions = {
16
+ width: "90%",
17
+ minWidth: 80,
18
+ maxHeight: "92%",
19
+ anchor: "center",
20
+ } as const;
21
+
22
+ const openDashboardOverlay = async (ctx: ExtensionContext) => {
23
+ const basePath = projectRoot();
24
+ if (!existsSync(join(basePath, ".gsd"))) {
25
+ ctx.ui.notify("No .gsd/ directory found. Run /gsd to start.", "info");
26
+ return;
27
+ }
28
+ await ctx.ui.custom<boolean>(
29
+ (tui, theme, _kb, done) => new GSDDashboardOverlay(tui, theme, () => done(true)),
30
+ {
31
+ overlay: true,
32
+ overlayOptions,
33
+ },
34
+ );
35
+ };
36
+
37
+ const openNotificationsOverlay = async (ctx: ExtensionContext) => {
38
+ await ctx.ui.custom<boolean>(
39
+ (tui, theme, _kb, done) => new GSDNotificationOverlay(tui, theme, () => done(true)),
40
+ {
41
+ overlay: true,
42
+ overlayOptions: {
43
+ width: "80%",
44
+ minWidth: 60,
45
+ maxHeight: "88%",
46
+ anchor: "center",
47
+ backdrop: true,
32
48
  },
33
- );
34
- },
49
+ },
50
+ );
51
+ };
52
+
53
+ const openParallelOverlay = async (ctx: ExtensionContext) => {
54
+ const basePath = projectRoot();
55
+ const parallelDir = join(basePath, ".gsd", "parallel");
56
+ if (!existsSync(parallelDir)) {
57
+ ctx.ui.notify("No parallel workers found. Run /gsd parallel start first.", "info");
58
+ return;
59
+ }
60
+ await ctx.ui.custom<boolean>(
61
+ (tui, theme, _kb, done) => new ParallelMonitorOverlay(tui, theme, () => done(true), basePath),
62
+ {
63
+ overlay: true,
64
+ overlayOptions,
65
+ },
66
+ );
67
+ };
68
+
69
+ pi.registerShortcut(Key.ctrlAlt(GSD_SHORTCUTS.dashboard.key), {
70
+ description: shortcutDesc(GSD_SHORTCUTS.dashboard.action, GSD_SHORTCUTS.dashboard.command),
71
+ handler: openDashboardOverlay,
35
72
  });
36
73
 
37
- pi.registerShortcut(Key.ctrlAlt("n"), {
38
- description: shortcutDesc("Open notification history", "/gsd notifications"),
39
- handler: async (ctx) => {
40
- await ctx.ui.custom<boolean>(
41
- (tui, theme, _kb, done) => new GSDNotificationOverlay(tui, theme, () => done(true)),
42
- {
43
- overlay: true,
44
- overlayOptions: {
45
- width: "80%",
46
- minWidth: 60,
47
- maxHeight: "88%",
48
- anchor: "center",
49
- backdrop: true,
50
- },
51
- },
52
- );
53
- },
74
+ // Fallback for terminals where Ctrl+Alt letter chords are not forwarded reliably.
75
+ pi.registerShortcut(Key.ctrlShift(GSD_SHORTCUTS.dashboard.key), {
76
+ description: shortcutDesc(`${GSD_SHORTCUTS.dashboard.action} (fallback)`, GSD_SHORTCUTS.dashboard.command),
77
+ handler: openDashboardOverlay,
54
78
  });
55
79
 
56
- pi.registerShortcut(Key.ctrlAlt("p"), {
57
- description: shortcutDesc("Open parallel worker monitor", "/gsd parallel watch"),
58
- handler: async (ctx) => {
59
- const basePath = projectRoot();
60
- const parallelDir = join(basePath, ".gsd", "parallel");
61
- if (!existsSync(parallelDir)) {
62
- ctx.ui.notify("No parallel workers found. Run /gsd parallel start first.", "info");
63
- return;
64
- }
65
- await ctx.ui.custom<boolean>(
66
- (tui, theme, _kb, done) => new ParallelMonitorOverlay(tui, theme, () => done(true)),
67
- {
68
- overlay: true,
69
- overlayOptions: {
70
- width: "90%",
71
- minWidth: 80,
72
- maxHeight: "92%",
73
- anchor: "center",
74
- },
75
- },
76
- );
77
- },
80
+ pi.registerShortcut(Key.ctrlAlt(GSD_SHORTCUTS.notifications.key), {
81
+ description: shortcutDesc(GSD_SHORTCUTS.notifications.action, GSD_SHORTCUTS.notifications.command),
82
+ handler: openNotificationsOverlay,
78
83
  });
84
+
85
+ // Fallback for terminals where Ctrl+Alt letter chords are not forwarded reliably.
86
+ pi.registerShortcut(Key.ctrlShift(GSD_SHORTCUTS.notifications.key), {
87
+ description: shortcutDesc(`${GSD_SHORTCUTS.notifications.action} (fallback)`, GSD_SHORTCUTS.notifications.command),
88
+ handler: openNotificationsOverlay,
89
+ });
90
+
91
+ pi.registerShortcut(Key.ctrlAlt(GSD_SHORTCUTS.parallel.key), {
92
+ description: shortcutDesc(GSD_SHORTCUTS.parallel.action, GSD_SHORTCUTS.parallel.command),
93
+ handler: openParallelOverlay,
94
+ });
95
+
96
+ // No Ctrl+Shift+P fallback — conflicts with cycleModelBackward (shift+ctrl+p).
97
+ // Use Ctrl+Alt+P or /gsd parallel watch instead.
79
98
  }
@@ -293,6 +293,11 @@ function buildWorktreeContextBlock(): string {
293
293
  const RESUME_INTENT_PATTERNS = /^(continue|resume|ok|go|go ahead|proceed|keep going|carry on|next|yes|yeah|yep|sure|do it|let's go|pick up where you left off)$/;
294
294
 
295
295
  async function buildGuidedExecuteContextInjection(prompt: string, basePath: string): Promise<string | null> {
296
+ const ensureStateDbOpen = async () => {
297
+ const { ensureDbOpen } = await import("./dynamic-tools.js");
298
+ await ensureDbOpen();
299
+ };
300
+
296
301
  const executeMatch = prompt.match(/Execute the next task:\s+(T\d+)\s+\("([^"]+)"\)\s+in slice\s+(S\d+)\s+of milestone\s+(M\d+(?:-[a-z0-9]{6})?)/i);
297
302
  if (executeMatch) {
298
303
  const [, taskId, taskTitle, sliceId, milestoneId] = executeMatch;
@@ -302,6 +307,7 @@ async function buildGuidedExecuteContextInjection(prompt: string, basePath: stri
302
307
  const resumeMatch = prompt.match(/Resume interrupted work\.[\s\S]*?slice\s+(S\d+)\s+of milestone\s+(M\d+(?:-[a-z0-9]{6})?)/i);
303
308
  if (resumeMatch) {
304
309
  const [, sliceId, milestoneId] = resumeMatch;
310
+ await ensureStateDbOpen();
305
311
  const state = await deriveState(basePath);
306
312
  if (state.activeMilestone?.id === milestoneId && state.activeSlice?.id === sliceId && state.activeTask) {
307
313
  return buildTaskExecutionContextInjection(basePath, milestoneId, sliceId, state.activeTask.id, state.activeTask.title);
@@ -317,6 +323,7 @@ async function buildGuidedExecuteContextInjection(prompt: string, basePath: stri
317
323
  // replanning, gate evaluation, or other non-execution phases.
318
324
  const trimmed = prompt.trim().toLowerCase().replace(/[.!?,]+$/g, "");
319
325
  if (RESUME_INTENT_PATTERNS.test(trimmed)) {
326
+ await ensureStateDbOpen();
320
327
  const state = await deriveState(basePath);
321
328
  if (state.phase === "executing" && state.activeTask && state.activeMilestone && state.activeSlice) {
322
329
  return buildTaskExecutionContextInjection(
@@ -1,7 +1,7 @@
1
1
  import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
2
2
 
3
3
  import { checkRemoteAutoSession, isAutoActive, isAutoPaused, stopAutoRemote } from "../auto.js";
4
- import { assertSafeDirectory } from "../validate-directory.js";
4
+ import { validateDirectory } from "../validate-directory.js";
5
5
  import { resolveProjectRoot } from "../worktree.js";
6
6
  import { showNextAction } from "../../shared/tui.js";
7
7
  import { handleStatus } from "./handlers/core.js";
@@ -12,6 +12,17 @@ export interface GsdDispatchContext {
12
12
  trimmed: string;
13
13
  }
14
14
 
15
+ /**
16
+ * Typed error for when GSD is run outside a valid project directory.
17
+ * Command handlers catch this to show a friendly message instead of a raw exception.
18
+ */
19
+ export class GSDNoProjectError extends Error {
20
+ constructor(reason: string) {
21
+ super(reason);
22
+ this.name = "GSDNoProjectError";
23
+ }
24
+ }
25
+
15
26
  export function projectRoot(): string {
16
27
  let cwd: string;
17
28
  try {
@@ -21,10 +32,10 @@ export function projectRoot(): string {
21
32
  cwd = process.env.HOME ?? "/";
22
33
  }
23
34
  const root = resolveProjectRoot(cwd);
24
- if (root !== cwd) {
25
- assertSafeDirectory(cwd);
26
- } else {
27
- assertSafeDirectory(root);
35
+ const pathToCheck = root !== cwd ? cwd : root;
36
+ const result = validateDirectory(pathToCheck);
37
+ if (result.severity === "blocked") {
38
+ throw new GSDNoProjectError(result.reason ?? "GSD must be run inside a project directory.");
28
39
  }
29
40
  return root;
30
41
  }
@@ -1,5 +1,6 @@
1
1
  import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
2
2
 
3
+ import { GSDNoProjectError } from "./context.js";
3
4
  import { handleAutoCommand } from "./handlers/auto.js";
4
5
  import { handleCoreCommand } from "./handlers/core.js";
5
6
  import { handleOpsCommand } from "./handlers/ops.js";
@@ -21,10 +22,21 @@ export async function handleGSDCommand(
21
22
  () => handleOpsCommand(trimmed, ctx, pi),
22
23
  ];
23
24
 
24
- for (const handler of handlers) {
25
- if (await handler()) {
25
+ try {
26
+ for (const handler of handlers) {
27
+ if (await handler()) {
28
+ return;
29
+ }
30
+ }
31
+ } catch (err) {
32
+ if (err instanceof GSDNoProjectError) {
33
+ ctx.ui.notify(
34
+ `${err.message} \`cd\` into a project directory first.`,
35
+ "warning",
36
+ );
26
37
  return;
27
38
  }
39
+ throw err;
28
40
  }
29
41
 
30
42
  ctx.ui.notify(`Unknown: /gsd ${trimmed}. Run /gsd help for available commands.`, "warning");
@@ -4,7 +4,7 @@ import { existsSync, readFileSync } from "node:fs";
4
4
  import { resolve } from "node:path";
5
5
 
6
6
  import { enableDebug } from "../../debug-logger.js";
7
- import { getAutoDashboardData, isAutoActive, isAutoPaused, pauseAuto, startAuto, stopAuto, stopAutoRemote } from "../../auto.js";
7
+ import { getAutoDashboardData, isAutoActive, isAutoPaused, pauseAuto, startAutoDetached, stopAuto, stopAutoRemote } from "../../auto.js";
8
8
  import { handleRate } from "../../commands-rate.js";
9
9
  import { guardRemoteSession, projectRoot } from "../context.js";
10
10
  import { findMilestoneIds } from "../../milestone-id-utils.js";
@@ -42,26 +42,6 @@ export function parseMilestoneTarget(input: string): { milestoneId: string | nul
42
42
  return { milestoneId: match[1], rest };
43
43
  }
44
44
 
45
- /**
46
- * Set GSD_MILESTONE_LOCK to target a specific milestone, then run `fn`.
47
- * Clears the env var when `fn` resolves or rejects, so the lock does not
48
- * leak into subsequent commands in the same process.
49
- */
50
- async function withMilestoneLock(milestoneId: string, fn: () => Promise<void>): Promise<void> {
51
- const previous = process.env.GSD_MILESTONE_LOCK;
52
- process.env.GSD_MILESTONE_LOCK = milestoneId;
53
- try {
54
- await fn();
55
- } finally {
56
- // Restore previous value (undefined → delete, else restore).
57
- if (previous === undefined) {
58
- delete process.env.GSD_MILESTONE_LOCK;
59
- } else {
60
- process.env.GSD_MILESTONE_LOCK = previous;
61
- }
62
- }
63
- }
64
-
65
45
  export async function handleAutoCommand(trimmed: string, ctx: ExtensionCommandContext, pi: ExtensionAPI): Promise<boolean> {
66
46
  if (trimmed === "next" || trimmed.startsWith("next ")) {
67
47
  if (trimmed.includes("--dry-run")) {
@@ -84,13 +64,10 @@ export async function handleAutoCommand(trimmed: string, ctx: ExtensionCommandCo
84
64
  }
85
65
  }
86
66
 
87
- if (milestoneId) {
88
- await withMilestoneLock(milestoneId, () =>
89
- startAuto(ctx, pi, projectRoot(), verboseMode, { step: true }),
90
- );
91
- } else {
92
- await startAuto(ctx, pi, projectRoot(), verboseMode, { step: true });
93
- }
67
+ startAutoDetached(ctx, pi, projectRoot(), verboseMode, {
68
+ step: true,
69
+ milestoneLock: milestoneId,
70
+ });
94
71
  return true;
95
72
  }
96
73
 
@@ -128,13 +105,11 @@ export async function handleAutoCommand(trimmed: string, ctx: ExtensionCommandCo
128
105
  const { showHeadlessMilestoneCreation } = await import("../../guided-flow.js");
129
106
  await showHeadlessMilestoneCreation(ctx, pi, projectRoot(), seedContent);
130
107
  } else if (milestoneId) {
131
- // Target a specific milestone — use GSD_MILESTONE_LOCK so state
132
- // derivation only sees this milestone (#2521).
133
- await withMilestoneLock(milestoneId, () =>
134
- startAuto(ctx, pi, projectRoot(), verboseMode),
135
- );
108
+ startAutoDetached(ctx, pi, projectRoot(), verboseMode, {
109
+ milestoneLock: milestoneId,
110
+ });
136
111
  } else {
137
- await startAuto(ctx, pi, projectRoot(), verboseMode);
112
+ startAutoDetached(ctx, pi, projectRoot(), verboseMode);
138
113
  }
139
114
  return true;
140
115
  }
@@ -175,10 +150,9 @@ export async function handleAutoCommand(trimmed: string, ctx: ExtensionCommandCo
175
150
 
176
151
  if (trimmed === "") {
177
152
  if (!(await guardRemoteSession(ctx, pi))) return true;
178
- await startAuto(ctx, pi, projectRoot(), false, { step: true });
153
+ startAutoDetached(ctx, pi, projectRoot(), false, { step: true });
179
154
  return true;
180
155
  }
181
156
 
182
157
  return false;
183
158
  }
184
-
@@ -8,11 +8,45 @@ import { ensurePreferencesFile, handlePrefs, handlePrefsMode, handlePrefsWizard
8
8
  import { runEnvironmentChecks } from "../../doctor-environment.js";
9
9
  import { deriveState } from "../../state.js";
10
10
  import { handleCmux } from "../../commands-cmux.js";
11
+ import { setSessionModelOverride } from "../../session-model-override.js";
11
12
  import { projectRoot } from "../context.js";
12
- import { formatShortcut } from "../../files.js";
13
+ import { formattedShortcutPair } from "../../shortcut-defs.js";
13
14
 
14
- export function showHelp(ctx: ExtensionCommandContext): void {
15
- const lines = [
15
+ export function showHelp(ctx: ExtensionCommandContext, args = ""): void {
16
+ const summaryLines = [
17
+ "GSD — Get Shit Done\n",
18
+ "QUICK START",
19
+ " /gsd start <tpl> Start a workflow template",
20
+ " /gsd Run next unit (same as /gsd next)",
21
+ " /gsd auto Run all queued units continuously",
22
+ " /gsd pause Pause auto-mode",
23
+ " /gsd stop Stop auto-mode gracefully",
24
+ "",
25
+ "VISIBILITY",
26
+ ` /gsd status Dashboard (${formattedShortcutPair("dashboard")})`,
27
+ ` /gsd parallel watch Parallel monitor (${formattedShortcutPair("parallel")})`,
28
+ ` /gsd notifications Notification history (${formattedShortcutPair("notifications")})`,
29
+ " /gsd visualize Interactive 10-tab TUI",
30
+ " /gsd queue Show queued/dispatched units",
31
+ "",
32
+ "COURSE CORRECTION",
33
+ " /gsd steer <desc> Apply user override to active work",
34
+ " /gsd capture <text> Quick-capture a thought to CAPTURES.md",
35
+ " /gsd triage Classify and route pending captures",
36
+ " /gsd undo Revert last completed unit [--force]",
37
+ " /gsd rethink Conversational project reorganization",
38
+ "",
39
+ "SETUP",
40
+ " /gsd init Project init wizard",
41
+ " /gsd setup Global setup status [llm|search|remote|keys|prefs]",
42
+ " /gsd model Switch active session model",
43
+ " /gsd prefs Manage preferences",
44
+ " /gsd doctor Diagnose and repair .gsd/ state",
45
+ "",
46
+ "Use /gsd help full for the complete command reference.",
47
+ ];
48
+
49
+ const fullLines = [
16
50
  "GSD — Get Shit Done\n",
17
51
  "WORKFLOW",
18
52
  " /gsd start <tpl> Start a workflow template (bugfix, spike, feature, hotfix, etc.)",
@@ -26,12 +60,13 @@ export function showHelp(ctx: ExtensionCommandContext): void {
26
60
  " /gsd new-milestone Create milestone from headless context (used by gsd headless)",
27
61
  "",
28
62
  "VISIBILITY",
29
- ` /gsd status Show progress dashboard (${formatShortcut("Ctrl+Alt+G")})`,
63
+ ` /gsd status Show progress dashboard (${formattedShortcutPair("dashboard")})`,
64
+ ` /gsd parallel watch Open parallel worker monitor (${formattedShortcutPair("parallel")})`,
30
65
  " /gsd visualize Interactive 10-tab TUI (progress, timeline, deps, metrics, health, agent, changes, knowledge, captures, export)",
31
66
  " /gsd queue Show queued/dispatched units and execution order",
32
67
  " /gsd history View execution history [--cost] [--phase] [--model] [N]",
33
68
  " /gsd changelog Show categorized release notes [version]",
34
- ` /gsd notifications View persistent notification history [clear|tail|filter] (${formatShortcut("Ctrl+Alt+N")})`,
69
+ ` /gsd notifications View persistent notification history [clear|tail|filter] (${formattedShortcutPair("notifications")})`,
35
70
  "",
36
71
  "COURSE CORRECTION",
37
72
  " /gsd steer <desc> Apply user override to active work",
@@ -71,7 +106,8 @@ export function showHelp(ctx: ExtensionCommandContext): void {
71
106
  " /gsd inspect Show SQLite DB diagnostics (schema, row counts, recent entries)",
72
107
  " /gsd update Update GSD to the latest version via npm",
73
108
  ];
74
- ctx.ui.notify(lines.join("\n"), "info");
109
+ const full = ["full", "--full", "all"].includes(args.trim().toLowerCase());
110
+ ctx.ui.notify((full ? fullLines : summaryLines).join("\n"), "info");
75
111
  }
76
112
 
77
113
  export async function handleStatus(ctx: ExtensionCommandContext): Promise<void> {
@@ -92,9 +128,9 @@ export async function handleStatus(ctx: ExtensionCommandContext): Promise<void>
92
128
  {
93
129
  overlay: true,
94
130
  overlayOptions: {
95
- width: "70%",
96
- minWidth: 60,
97
- maxHeight: "90%",
131
+ width: "90%",
132
+ minWidth: 80,
133
+ maxHeight: "92%",
98
134
  anchor: "center",
99
135
  },
100
136
  },
@@ -301,6 +337,17 @@ async function handleModel(trimmedArgs: string, ctx: ExtensionCommandContext, pi
301
337
  return;
302
338
  }
303
339
 
340
+ // /gsd model is an explicit per-session pin for GSD dispatches.
341
+ // This is captured at auto bootstrap so it survives internal session
342
+ // switches during /gsd auto and /gsd next runs.
343
+ const sessionId = ctx.sessionManager?.getSessionId?.();
344
+ if (sessionId) {
345
+ setSessionModelOverride(sessionId, {
346
+ provider: targetModel.provider,
347
+ id: targetModel.id,
348
+ });
349
+ }
350
+
304
351
  ctx.ui.notify(`Model: ${targetModel.provider}/${targetModel.id}`, "info");
305
352
  }
306
353
 
@@ -309,8 +356,8 @@ export async function handleCoreCommand(
309
356
  ctx: ExtensionCommandContext,
310
357
  pi?: ExtensionAPI,
311
358
  ): Promise<boolean> {
312
- if (trimmed === "help" || trimmed === "h" || trimmed === "?") {
313
- showHelp(ctx);
359
+ if (trimmed === "help" || trimmed === "h" || trimmed === "?" || trimmed.startsWith("help ")) {
360
+ showHelp(ctx, trimmed.startsWith("help ") ? trimmed.slice(5).trim() : "");
314
361
  return true;
315
362
  }
316
363
  if (trimmed === "status") {
@@ -13,6 +13,8 @@ import {
13
13
  } from "../../notification-store.js";
14
14
  import { GSDNotificationOverlay } from "../../notification-overlay.js";
15
15
 
16
+ const MAX_INLINE_ENTRIES = 40;
17
+
16
18
  function severityIcon(severity: NotifySeverity): string {
17
19
  switch (severity) {
18
20
  case "error": return "✗";
@@ -54,8 +56,9 @@ export async function handleNotificationsCommand(
54
56
  if (args === "tail" || args.startsWith("tail ")) {
55
57
  const countStr = args.replace(/^tail\s*/, "").trim();
56
58
  const count = countStr ? parseInt(countStr, 10) : 20;
57
- const n = isNaN(count) || count < 1 ? 20 : Math.min(count, 100);
58
- const entries = readNotifications().slice(0, n);
59
+ const all = readNotifications();
60
+ const n = isNaN(count) || count < 1 ? 20 : Math.min(count, MAX_INLINE_ENTRIES);
61
+ const entries = all.slice(0, n);
59
62
 
60
63
  if (entries.length === 0) {
61
64
  ctx.ui.notify("No notifications.", "info");
@@ -65,7 +68,10 @@ export async function handleNotificationsCommand(
65
68
  const lines = entries.map((e) =>
66
69
  `${severityIcon(e.severity)} [${formatTimestamp(e.ts)}] ${e.message}`,
67
70
  );
68
- ctx.ui.notify(`Last ${entries.length} notification(s):\n${lines.join("\n")}`, "info");
71
+ const suffix = all.length > entries.length
72
+ ? `\n... and ${all.length - entries.length} more (open /gsd notifications to browse all)`
73
+ : "";
74
+ ctx.ui.notify(`Last ${entries.length} notification(s):\n${lines.join("\n")}${suffix}`, "info");
69
75
  return true;
70
76
  }
71
77
 
@@ -86,7 +92,9 @@ export async function handleNotificationsCommand(
86
92
  const lines = entries.slice(0, 20).map((e) =>
87
93
  `${severityIcon(e.severity)} [${formatTimestamp(e.ts)}] ${e.message}`,
88
94
  );
89
- const suffix = entries.length > 20 ? `\n... and ${entries.length - 20} more` : "";
95
+ const suffix = entries.length > 20
96
+ ? `\n... and ${entries.length - 20} more (open /gsd notifications to browse all)`
97
+ : "";
90
98
  ctx.ui.notify(`${severity} notifications (${entries.length}):\n${lines.join("\n")}${suffix}`, "info");
91
99
  return true;
92
100
  }
@@ -96,8 +104,8 @@ export async function handleNotificationsCommand(
96
104
  // Try overlay first (TUI mode)
97
105
  if (ctx.hasUI) {
98
106
  try {
99
- await ctx.ui.custom<void>(
100
- (tui, theme, _kb, done) => new GSDNotificationOverlay(tui, theme, () => done()),
107
+ const result = await ctx.ui.custom<boolean>(
108
+ (tui, theme, _kb, done) => new GSDNotificationOverlay(tui, theme, () => done(true)),
101
109
  {
102
110
  overlay: true,
103
111
  overlayOptions: {
@@ -109,7 +117,9 @@ export async function handleNotificationsCommand(
109
117
  },
110
118
  },
111
119
  );
112
- return true;
120
+ if (result !== undefined) {
121
+ return true;
122
+ }
113
123
  } catch {
114
124
  // Fall through to text output if overlay fails
115
125
  }
@@ -18,7 +18,7 @@ import { createRun, listRuns } from "../../run-manager.js";
18
18
  import {
19
19
  setActiveEngineId,
20
20
  setActiveRunDir,
21
- startAuto,
21
+ startAutoDetached,
22
22
  pauseAuto,
23
23
  isAutoActive,
24
24
  getActiveEngineId,
@@ -77,7 +77,7 @@ async function handleCustomWorkflow(
77
77
  setActiveEngineId("custom");
78
78
  setActiveRunDir(runDir);
79
79
  ctx.ui.notify(`Created workflow run: ${defName}\nRun dir: ${runDir}`, "info");
80
- await startAuto(ctx, pi, base, false);
80
+ startAutoDetached(ctx, pi, base, false);
81
81
  } catch (err) {
82
82
  // Clean up engine state so a failed workflow run doesn't pollute the next /gsd auto
83
83
  setActiveEngineId(null);
@@ -157,13 +157,8 @@ async function handleCustomWorkflow(
157
157
  ctx.ui.notify("No custom workflow to resume. Use /gsd auto for dev workflow.", "warning");
158
158
  return true;
159
159
  }
160
- try {
161
- await startAuto(ctx, pi, projectRoot(), false);
162
- ctx.ui.notify("Custom workflow resumed.", "info");
163
- } catch (err) {
164
- const msg = err instanceof Error ? err.message : String(err);
165
- ctx.ui.notify(`Failed to resume workflow: ${msg}`, "error");
166
- }
160
+ startAutoDetached(ctx, pi, projectRoot(), false);
161
+ ctx.ui.notify("Custom workflow resumed.", "info");
167
162
  return true;
168
163
  }
169
164
 
@@ -278,4 +273,3 @@ export function getNextMilestoneId(basePath: string): string {
278
273
  const uniqueIds = !!loadEffectiveGSDPreferences()?.preferences?.unique_milestone_ids;
279
274
  return nextMilestoneId(milestoneIds, uniqueIds);
280
275
  }
281
-
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Full-screen overlay showing auto-mode progress: milestone/slice/task
5
5
  * breakdown, current unit, completed units, timing, and activity log.
6
- * Toggled with Ctrl+Alt+G (⌃⌥G on macOS) or opened from /gsd status.
6
+ * Toggled with Ctrl+Alt+G (⌃⌥G on macOS), Ctrl+Shift+G fallback,
7
+ * or opened from /gsd status.
7
8
  */
8
9
 
9
10
  import type { Theme } from "@gsd/pi-coding-agent";
@@ -26,6 +27,7 @@ import { formatDuration, padRight, joinColumns, centerLine, fitColumns, STATUS_G
26
27
  import { estimateTimeRemaining } from "./auto-dashboard.js";
27
28
  import { computeProgressScore, formatProgressLine } from "./progress-score.js";
28
29
  import { runEnvironmentChecks, type EnvironmentCheckResult } from "./doctor-environment.js";
30
+ import { formattedShortcutPair } from "./shortcut-defs.js";
29
31
 
30
32
  function unitLabel(type: string): string {
31
33
  switch (type) {
@@ -203,7 +205,12 @@ export class GSDDashboardOverlay {
203
205
  }
204
206
 
205
207
  handleInput(data: string): void {
206
- if (matchesKey(data, Key.escape) || matchesKey(data, Key.ctrl("c")) || matchesKey(data, Key.ctrlAlt("g"))) {
208
+ if (
209
+ matchesKey(data, Key.escape) ||
210
+ matchesKey(data, Key.ctrl("c")) ||
211
+ matchesKey(data, Key.ctrlAlt("g")) ||
212
+ matchesKey(data, Key.ctrlShift("g"))
213
+ ) {
207
214
  this.dispose();
208
215
  this.onClose();
209
216
  return;
@@ -587,7 +594,7 @@ export class GSDDashboardOverlay {
587
594
 
588
595
  lines.push(blank());
589
596
  lines.push(hr());
590
- lines.push(centered(th.fg("dim", "↑↓ scroll · g/G top/end · esc close")));
597
+ lines.push(centered(th.fg("dim", `↑↓ scroll · g/G top/end · Esc/${formattedShortcutPair("dashboard")} close`)));
591
598
 
592
599
  return lines;
593
600
  }
@@ -107,10 +107,27 @@ export function getPriorSliceCompletionBlocker(
107
107
  // it may be a cross-milestone reference handled elsewhere.
108
108
  }
109
109
  } else {
110
+ // Positional fallback is only a heuristic for legacy slices with no
111
+ // declared dependencies. Skip any earlier slice that depends on the
112
+ // target, directly or transitively, or we can deadlock a valid zero-dep
113
+ // slice behind its own downstream dependents (#3720).
114
+ const reverseDependents = new Set<string>();
115
+ let changed = true;
116
+ while (changed) {
117
+ changed = false;
118
+ for (const slice of slices) {
119
+ if (reverseDependents.has(slice.id)) continue;
120
+ if (slice.depends.some((depId) => depId === targetSid || reverseDependents.has(depId))) {
121
+ reverseDependents.add(slice.id);
122
+ changed = true;
123
+ }
124
+ }
125
+ }
126
+
110
127
  const targetIndex = slices.findIndex((slice) => slice.id === targetSid);
111
128
  const incomplete = slices
112
129
  .slice(0, targetIndex)
113
- .find((slice) => !slice.done);
130
+ .find((slice) => !slice.done && !reverseDependents.has(slice.id));
114
131
  if (incomplete) {
115
132
  return `Cannot dispatch ${unitType} ${unitId}: earlier slice ${targetMid}/${incomplete.id} is not complete.`;
116
133
  }