gsd-pi 2.71.0 → 2.72.0-dev.3118184

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 (578) hide show
  1. package/README.md +69 -19
  2. package/dist/cli.js +88 -6
  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/onboarding.js +10 -0
  8. package/dist/provider-migrations.d.ts +10 -0
  9. package/dist/provider-migrations.js +12 -0
  10. package/dist/resource-loader.js +139 -13
  11. package/dist/resources/GSD-WORKFLOW.md +1 -1
  12. package/dist/resources/agents/debugger.md +58 -0
  13. package/dist/resources/agents/doc-writer.md +43 -0
  14. package/dist/resources/agents/git-ops.md +56 -0
  15. package/dist/resources/agents/javascript-pro.md +46 -271
  16. package/dist/resources/agents/planner.md +55 -0
  17. package/dist/resources/agents/refactorer.md +47 -0
  18. package/dist/resources/agents/reviewer.md +48 -0
  19. package/dist/resources/agents/security.md +59 -0
  20. package/dist/resources/agents/tester.md +50 -0
  21. package/dist/resources/agents/typescript-pro.md +41 -235
  22. package/dist/resources/extensions/async-jobs/await-tool.js +7 -4
  23. package/dist/resources/extensions/async-jobs/job-manager.js +28 -3
  24. package/dist/resources/extensions/claude-code-cli/partial-builder.js +40 -12
  25. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +142 -14
  26. package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
  27. package/dist/resources/extensions/gsd/auto/loop.js +116 -2
  28. package/dist/resources/extensions/gsd/auto/phases.js +5 -1
  29. package/dist/resources/extensions/gsd/auto/session.js +11 -0
  30. package/dist/resources/extensions/gsd/auto-dashboard.js +22 -16
  31. package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
  32. package/dist/resources/extensions/gsd/auto-post-unit.js +6 -0
  33. package/dist/resources/extensions/gsd/auto-prompts.js +88 -33
  34. package/dist/resources/extensions/gsd/auto-recovery.js +11 -0
  35. package/dist/resources/extensions/gsd/auto-start.js +34 -7
  36. package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
  37. package/dist/resources/extensions/gsd/auto-worktree.js +1 -1
  38. package/dist/resources/extensions/gsd/auto.js +81 -19
  39. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
  40. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +11 -11
  41. package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +63 -51
  42. package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -0
  43. package/dist/resources/extensions/gsd/commands/context.js +15 -6
  44. package/dist/resources/extensions/gsd/commands/dispatcher.js +12 -2
  45. package/dist/resources/extensions/gsd/commands/handlers/auto.js +10 -33
  46. package/dist/resources/extensions/gsd/commands/handlers/core.js +56 -11
  47. package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +15 -6
  48. package/dist/resources/extensions/gsd/commands/handlers/workflow.js +4 -10
  49. package/dist/resources/extensions/gsd/commands-handlers.js +4 -1
  50. package/dist/resources/extensions/gsd/context-injector.js +1 -1
  51. package/dist/resources/extensions/gsd/custom-workflow-engine.js +3 -7
  52. package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
  53. package/dist/resources/extensions/gsd/definition-io.js +15 -0
  54. package/dist/resources/extensions/gsd/dispatch-guard.js +22 -1
  55. package/dist/resources/extensions/gsd/doctor-providers.js +23 -0
  56. package/dist/resources/extensions/gsd/doctor-runtime-checks.js +6 -3
  57. package/dist/resources/extensions/gsd/error-classifier.js +5 -2
  58. package/dist/resources/extensions/gsd/forensics.js +19 -6
  59. package/dist/resources/extensions/gsd/gate-registry.js +208 -0
  60. package/dist/resources/extensions/gsd/git-service.js +11 -8
  61. package/dist/resources/extensions/gsd/gitignore.js +12 -6
  62. package/dist/resources/extensions/gsd/gsd-db.js +90 -6
  63. package/dist/resources/extensions/gsd/guided-flow.js +5 -10
  64. package/dist/resources/extensions/gsd/key-manager.js +2 -0
  65. package/dist/resources/extensions/gsd/metrics.js +1 -0
  66. package/dist/resources/extensions/gsd/milestone-actions.js +10 -4
  67. package/dist/resources/extensions/gsd/milestone-validation-gates.js +11 -12
  68. package/dist/resources/extensions/gsd/notification-overlay.js +42 -13
  69. package/dist/resources/extensions/gsd/notification-store.js +56 -5
  70. package/dist/resources/extensions/gsd/notification-widget.js +5 -13
  71. package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +8 -3
  72. package/dist/resources/extensions/gsd/pre-execution-checks.js +35 -2
  73. package/dist/resources/extensions/gsd/preferences-skills.js +2 -34
  74. package/dist/resources/extensions/gsd/preferences-types.js +15 -0
  75. package/dist/resources/extensions/gsd/preferences.js +16 -3
  76. package/dist/resources/extensions/gsd/prompt-loader.js +4 -1
  77. package/dist/resources/extensions/gsd/prompt-validation.js +126 -0
  78. package/dist/resources/extensions/gsd/prompts/complete-slice.md +5 -3
  79. package/dist/resources/extensions/gsd/prompts/discuss.md +123 -12
  80. package/dist/resources/extensions/gsd/prompts/execute-task.md +22 -19
  81. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
  82. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
  83. package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  84. package/dist/resources/extensions/gsd/prompts/queue.md +3 -2
  85. package/dist/resources/extensions/gsd/prompts/system.md +1 -0
  86. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
  87. package/dist/resources/extensions/gsd/session-model-override.js +25 -0
  88. package/dist/resources/extensions/gsd/shortcut-defs.js +40 -0
  89. package/dist/resources/extensions/gsd/state.js +29 -2
  90. package/dist/resources/extensions/gsd/tools/complete-slice.js +52 -1
  91. package/dist/resources/extensions/gsd/tools/complete-task.js +51 -1
  92. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +4 -1
  93. package/dist/resources/extensions/gsd/workflow-projections.js +7 -0
  94. package/dist/resources/extensions/gsd/worktree-manager.js +30 -3
  95. package/dist/resources/extensions/gsd/write-intercept.js +10 -1
  96. package/dist/resources/extensions/ollama/index.js +17 -10
  97. package/dist/resources/extensions/ollama/ollama-client.js +35 -6
  98. package/dist/resources/extensions/ollama/ollama-discovery.js +32 -6
  99. package/dist/resources/extensions/shared/gsd-phase-state.js +35 -0
  100. package/dist/resources/extensions/subagent/agents.js +8 -0
  101. package/dist/resources/extensions/subagent/index.js +17 -0
  102. package/dist/resources/skills/create-skill/SKILL.md +2 -0
  103. package/dist/startup-model-validation.d.ts +0 -1
  104. package/dist/startup-model-validation.js +6 -2
  105. package/dist/web/standalone/.next/BUILD_ID +1 -1
  106. package/dist/web/standalone/.next/app-path-routes-manifest.json +15 -15
  107. package/dist/web/standalone/.next/build-manifest.json +3 -3
  108. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  109. package/dist/web/standalone/.next/required-server-files.json +3 -3
  110. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  111. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  112. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  113. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  114. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  115. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  116. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  117. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  118. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  119. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  120. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  121. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  122. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  123. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  124. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  125. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  126. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  127. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  128. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  129. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  130. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  137. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  149. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  163. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  169. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  179. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  184. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  185. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  192. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  194. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  196. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  197. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  198. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
  199. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  200. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  201. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  202. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  203. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  204. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +3 -3
  205. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  206. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  207. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  208. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  209. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  210. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  211. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  212. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  213. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  214. package/dist/web/standalone/.next/server/app/index.html +1 -1
  215. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  216. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  217. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  218. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  219. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  220. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  221. package/dist/web/standalone/.next/server/app/page.js +2 -2
  222. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  223. package/dist/web/standalone/.next/server/app-paths-manifest.json +15 -15
  224. package/dist/web/standalone/.next/server/chunks/2331.js +16 -16
  225. package/dist/web/standalone/.next/server/chunks/4741.js +12 -12
  226. package/dist/web/standalone/.next/server/chunks/5822.js +2 -2
  227. package/dist/web/standalone/.next/server/chunks/63.js +8 -8
  228. package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
  229. package/dist/web/standalone/.next/server/edge-runtime-webpack.js +2 -0
  230. package/dist/web/standalone/.next/server/functions-config-manifest.json +0 -9
  231. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  232. package/dist/web/standalone/.next/server/middleware-manifest.json +29 -2
  233. package/dist/web/standalone/.next/server/middleware.js +4 -12
  234. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  235. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  236. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  237. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  238. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  239. package/dist/web/standalone/.next/server/webpack-runtime.js +1 -1
  240. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  241. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  242. package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
  243. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  244. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  245. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  246. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  247. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  248. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  249. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  250. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  251. package/dist/web/standalone/server.js +1 -1
  252. package/package.json +1 -1
  253. package/packages/mcp-server/dist/server.d.ts +12 -1
  254. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  255. package/packages/mcp-server/dist/server.js +90 -42
  256. package/packages/mcp-server/dist/server.js.map +1 -1
  257. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  258. package/packages/mcp-server/dist/workflow-tools.js +22 -12
  259. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  260. package/packages/mcp-server/src/server.ts +110 -38
  261. package/packages/mcp-server/src/workflow-tools.test.ts +110 -0
  262. package/packages/mcp-server/src/workflow-tools.ts +32 -12
  263. package/packages/pi-ai/dist/env-api-keys.js +1 -0
  264. package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
  265. package/packages/pi-ai/dist/models.custom.d.ts +105 -0
  266. package/packages/pi-ai/dist/models.custom.d.ts.map +1 -1
  267. package/packages/pi-ai/dist/models.custom.js +97 -0
  268. package/packages/pi-ai/dist/models.custom.js.map +1 -1
  269. package/packages/pi-ai/dist/models.generated.d.ts +648 -140
  270. package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
  271. package/packages/pi-ai/dist/models.generated.js +867 -370
  272. package/packages/pi-ai/dist/models.generated.js.map +1 -1
  273. package/packages/pi-ai/dist/models.generated.test.d.ts +2 -0
  274. package/packages/pi-ai/dist/models.generated.test.d.ts.map +1 -0
  275. package/packages/pi-ai/dist/models.generated.test.js +334 -0
  276. package/packages/pi-ai/dist/models.generated.test.js.map +1 -0
  277. package/packages/pi-ai/dist/models.test.js +105 -0
  278. package/packages/pi-ai/dist/models.test.js.map +1 -1
  279. package/packages/pi-ai/dist/providers/amazon-bedrock.js +11 -2
  280. package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  281. package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts +2 -0
  282. package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts.map +1 -0
  283. package/packages/pi-ai/dist/providers/anthropic-auth.test.js +20 -0
  284. package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -0
  285. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +4 -1
  286. package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
  287. package/packages/pi-ai/dist/providers/anthropic-shared.js +8 -3
  288. package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
  289. package/packages/pi-ai/dist/providers/anthropic-shared.test.js +44 -1
  290. package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
  291. package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -1
  292. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  293. package/packages/pi-ai/dist/providers/anthropic.js +7 -4
  294. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  295. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  296. package/packages/pi-ai/dist/providers/openai-completions.js +11 -0
  297. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
  298. package/packages/pi-ai/dist/types.d.ts +1 -1
  299. package/packages/pi-ai/dist/types.d.ts.map +1 -1
  300. package/packages/pi-ai/dist/types.js.map +1 -1
  301. package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  302. package/packages/pi-ai/dist/utils/oauth/github-copilot.js +5 -1
  303. package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  304. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts +2 -0
  305. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts.map +1 -0
  306. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +57 -0
  307. package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -0
  308. package/packages/pi-ai/src/env-api-keys.ts +1 -0
  309. package/packages/pi-ai/src/models.custom.ts +98 -0
  310. package/packages/pi-ai/src/models.generated.test.ts +373 -0
  311. package/packages/pi-ai/src/models.generated.ts +867 -370
  312. package/packages/pi-ai/src/models.test.ts +135 -0
  313. package/packages/pi-ai/src/providers/amazon-bedrock.ts +13 -1
  314. package/packages/pi-ai/src/providers/anthropic-auth.test.ts +32 -0
  315. package/packages/pi-ai/src/providers/anthropic-shared.test.ts +55 -1
  316. package/packages/pi-ai/src/providers/anthropic-shared.ts +14 -3
  317. package/packages/pi-ai/src/providers/anthropic.ts +8 -4
  318. package/packages/pi-ai/src/providers/openai-completions.ts +14 -0
  319. package/packages/pi-ai/src/types.ts +1 -0
  320. package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +71 -0
  321. package/packages/pi-ai/src/utils/oauth/github-copilot.ts +4 -1
  322. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts +2 -0
  323. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts.map +1 -0
  324. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js +61 -0
  325. package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js.map +1 -0
  326. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  327. package/packages/pi-coding-agent/dist/core/agent-session.js +2 -1
  328. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  329. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +10 -0
  330. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  331. package/packages/pi-coding-agent/dist/core/auth-storage.js +27 -0
  332. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  333. package/packages/pi-coding-agent/dist/core/auth-storage.test.js +85 -0
  334. package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
  335. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts +2 -0
  336. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts.map +1 -0
  337. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js +64 -0
  338. package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js.map +1 -0
  339. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  340. package/packages/pi-coding-agent/dist/core/model-resolver.js +23 -18
  341. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  342. package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts +8 -0
  343. package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts.map +1 -0
  344. package/packages/pi-coding-agent/dist/core/model-resolver.test.js +75 -0
  345. package/packages/pi-coding-agent/dist/core/model-resolver.test.js.map +1 -0
  346. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +5 -0
  347. package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
  348. package/packages/pi-coding-agent/dist/core/retry-handler.js +55 -1
  349. package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
  350. package/packages/pi-coding-agent/dist/core/retry-handler.test.js +57 -0
  351. package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
  352. package/packages/pi-coding-agent/dist/core/sdk.d.ts +11 -0
  353. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  354. package/packages/pi-coding-agent/dist/core/sdk.js +47 -5
  355. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  356. package/packages/pi-coding-agent/dist/core/sdk.test.d.ts +2 -0
  357. package/packages/pi-coding-agent/dist/core/sdk.test.d.ts.map +1 -0
  358. package/packages/pi-coding-agent/dist/core/sdk.test.js +71 -0
  359. package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -0
  360. package/packages/pi-coding-agent/dist/index.d.ts +1 -1
  361. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  362. package/packages/pi-coding-agent/dist/index.js +1 -1
  363. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  364. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts +2 -0
  365. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts.map +1 -0
  366. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js +13 -0
  367. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js.map +1 -0
  368. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +36 -0
  369. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  370. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +4 -0
  371. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  372. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +24 -2
  373. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
  374. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  375. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +9 -2
  376. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
  377. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +4 -0
  378. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  379. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +130 -12
  380. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  381. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  382. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +7 -2
  383. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  384. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -1
  385. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +6 -1
  386. package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -1
  387. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  388. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -3
  389. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  390. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +4 -2
  391. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
  392. package/packages/pi-coding-agent/package.json +1 -1
  393. package/packages/pi-coding-agent/src/core/agent-session-renderable-tools.test.ts +70 -0
  394. package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
  395. package/packages/pi-coding-agent/src/core/auth-storage.test.ts +108 -0
  396. package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -0
  397. package/packages/pi-coding-agent/src/core/model-resolver-initial-model-auth.test.ts +78 -0
  398. package/packages/pi-coding-agent/src/core/model-resolver.test.ts +85 -0
  399. package/packages/pi-coding-agent/src/core/model-resolver.ts +23 -18
  400. package/packages/pi-coding-agent/src/core/retry-handler.test.ts +83 -0
  401. package/packages/pi-coding-agent/src/core/retry-handler.ts +60 -1
  402. package/packages/pi-coding-agent/src/core/sdk.test.ts +89 -0
  403. package/packages/pi-coding-agent/src/core/sdk.ts +55 -9
  404. package/packages/pi-coding-agent/src/index.ts +1 -0
  405. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
  406. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +72 -0
  407. package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +30 -2
  408. package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +15 -6
  409. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +131 -12
  410. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +7 -2
  411. package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
  412. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4 -3
  413. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
  414. package/packages/pi-tui/dist/components/__tests__/editor.test.js +12 -0
  415. package/packages/pi-tui/dist/components/__tests__/editor.test.js.map +1 -1
  416. package/packages/pi-tui/dist/components/__tests__/input.test.js +12 -0
  417. package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -1
  418. package/packages/pi-tui/dist/keys.d.ts.map +1 -1
  419. package/packages/pi-tui/dist/keys.js +27 -0
  420. package/packages/pi-tui/dist/keys.js.map +1 -1
  421. package/packages/pi-tui/src/components/__tests__/editor.test.ts +18 -0
  422. package/packages/pi-tui/src/components/__tests__/input.test.ts +18 -0
  423. package/packages/pi-tui/src/keys.ts +32 -0
  424. package/pkg/package.json +1 -1
  425. package/src/resources/GSD-WORKFLOW.md +1 -1
  426. package/src/resources/agents/debugger.md +58 -0
  427. package/src/resources/agents/doc-writer.md +43 -0
  428. package/src/resources/agents/git-ops.md +56 -0
  429. package/src/resources/agents/javascript-pro.md +46 -271
  430. package/src/resources/agents/planner.md +55 -0
  431. package/src/resources/agents/refactorer.md +47 -0
  432. package/src/resources/agents/reviewer.md +48 -0
  433. package/src/resources/agents/security.md +59 -0
  434. package/src/resources/agents/tester.md +50 -0
  435. package/src/resources/agents/typescript-pro.md +41 -235
  436. package/src/resources/extensions/async-jobs/await-tool.test.ts +40 -7
  437. package/src/resources/extensions/async-jobs/await-tool.ts +7 -4
  438. package/src/resources/extensions/async-jobs/job-manager.ts +33 -3
  439. package/src/resources/extensions/claude-code-cli/partial-builder.ts +45 -12
  440. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +152 -13
  441. package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +91 -2
  442. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +301 -6
  443. package/src/resources/extensions/gsd/auto/infra-errors.ts +38 -0
  444. package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -0
  445. package/src/resources/extensions/gsd/auto/loop.ts +134 -2
  446. package/src/resources/extensions/gsd/auto/phases.ts +6 -0
  447. package/src/resources/extensions/gsd/auto/session.ts +11 -0
  448. package/src/resources/extensions/gsd/auto-dashboard.ts +29 -18
  449. package/src/resources/extensions/gsd/auto-model-selection.ts +9 -1
  450. package/src/resources/extensions/gsd/auto-post-unit.ts +7 -0
  451. package/src/resources/extensions/gsd/auto-prompts.ts +111 -33
  452. package/src/resources/extensions/gsd/auto-recovery.ts +10 -0
  453. package/src/resources/extensions/gsd/auto-start.ts +41 -7
  454. package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
  455. package/src/resources/extensions/gsd/auto-worktree.ts +1 -1
  456. package/src/resources/extensions/gsd/auto.ts +97 -20
  457. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
  458. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +10 -10
  459. package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +79 -60
  460. package/src/resources/extensions/gsd/bootstrap/system-context.ts +7 -0
  461. package/src/resources/extensions/gsd/commands/context.ts +16 -5
  462. package/src/resources/extensions/gsd/commands/dispatcher.ts +14 -2
  463. package/src/resources/extensions/gsd/commands/handlers/auto.ts +10 -36
  464. package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -11
  465. package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +17 -7
  466. package/src/resources/extensions/gsd/commands/handlers/workflow.ts +4 -10
  467. package/src/resources/extensions/gsd/commands-handlers.ts +5 -1
  468. package/src/resources/extensions/gsd/context-injector.ts +1 -1
  469. package/src/resources/extensions/gsd/custom-workflow-engine.ts +4 -8
  470. package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
  471. package/src/resources/extensions/gsd/definition-io.ts +18 -0
  472. package/src/resources/extensions/gsd/dispatch-guard.ts +23 -1
  473. package/src/resources/extensions/gsd/doctor-providers.ts +24 -0
  474. package/src/resources/extensions/gsd/doctor-runtime-checks.ts +6 -3
  475. package/src/resources/extensions/gsd/error-classifier.ts +5 -2
  476. package/src/resources/extensions/gsd/forensics.ts +23 -7
  477. package/src/resources/extensions/gsd/gate-registry.ts +251 -0
  478. package/src/resources/extensions/gsd/git-service.ts +11 -8
  479. package/src/resources/extensions/gsd/gitignore.ts +12 -6
  480. package/src/resources/extensions/gsd/gsd-db.ts +105 -6
  481. package/src/resources/extensions/gsd/guided-flow.ts +5 -10
  482. package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
  483. package/src/resources/extensions/gsd/key-manager.ts +2 -0
  484. package/src/resources/extensions/gsd/metrics.ts +12 -1
  485. package/src/resources/extensions/gsd/milestone-actions.ts +10 -3
  486. package/src/resources/extensions/gsd/milestone-validation-gates.ts +11 -13
  487. package/src/resources/extensions/gsd/notification-overlay.ts +47 -14
  488. package/src/resources/extensions/gsd/notification-store.ts +54 -5
  489. package/src/resources/extensions/gsd/notification-widget.ts +5 -14
  490. package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -3
  491. package/src/resources/extensions/gsd/pre-execution-checks.ts +39 -2
  492. package/src/resources/extensions/gsd/preferences-skills.ts +2 -36
  493. package/src/resources/extensions/gsd/preferences-types.ts +16 -0
  494. package/src/resources/extensions/gsd/preferences.ts +19 -6
  495. package/src/resources/extensions/gsd/prompt-loader.ts +6 -1
  496. package/src/resources/extensions/gsd/prompt-validation.ts +157 -0
  497. package/src/resources/extensions/gsd/prompts/complete-slice.md +5 -3
  498. package/src/resources/extensions/gsd/prompts/discuss.md +123 -12
  499. package/src/resources/extensions/gsd/prompts/execute-task.md +22 -19
  500. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
  501. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
  502. package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  503. package/src/resources/extensions/gsd/prompts/queue.md +3 -2
  504. package/src/resources/extensions/gsd/prompts/system.md +1 -0
  505. package/src/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
  506. package/src/resources/extensions/gsd/session-model-override.ts +36 -0
  507. package/src/resources/extensions/gsd/shortcut-defs.ts +56 -0
  508. package/src/resources/extensions/gsd/state.ts +33 -2
  509. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +27 -0
  510. package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +25 -9
  511. package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +28 -0
  512. package/src/resources/extensions/gsd/tests/block-db-writes.test.ts +63 -0
  513. package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +39 -0
  514. package/src/resources/extensions/gsd/tests/complete-slice-gate-closure.test.ts +167 -0
  515. package/src/resources/extensions/gsd/tests/complete-slice-prompt-task-summary-layout.test.ts +18 -0
  516. package/src/resources/extensions/gsd/tests/definition-io.test.ts +57 -0
  517. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +53 -0
  518. package/src/resources/extensions/gsd/tests/doctor-heal-fixable-warnings.test.ts +14 -0
  519. package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +36 -0
  520. package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts +33 -0
  521. package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +104 -0
  522. package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +62 -0
  523. package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +31 -0
  524. package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +27 -0
  525. package/src/resources/extensions/gsd/tests/gate-registry.test.ts +140 -0
  526. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +107 -5
  527. package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +73 -0
  528. package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +180 -0
  529. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +66 -1
  530. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +8 -6
  531. package/src/resources/extensions/gsd/tests/key-manager.test.ts +63 -0
  532. package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +54 -0
  533. package/src/resources/extensions/gsd/tests/model-isolation.test.ts +36 -51
  534. package/src/resources/extensions/gsd/tests/notification-store.test.ts +35 -0
  535. package/src/resources/extensions/gsd/tests/notification-widget.test.ts +26 -0
  536. package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +90 -0
  537. package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +1 -0
  538. package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +18 -0
  539. package/src/resources/extensions/gsd/tests/plan-milestone-artifact-verification.test.ts +62 -0
  540. package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +34 -0
  541. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +49 -0
  542. package/src/resources/extensions/gsd/tests/preferences-formatting.test.ts +87 -0
  543. package/src/resources/extensions/gsd/tests/preferences.test.ts +53 -0
  544. package/src/resources/extensions/gsd/tests/projection-regression.test.ts +96 -1
  545. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +19 -0
  546. package/src/resources/extensions/gsd/tests/prompt-loader-working-directory.test.ts +19 -0
  547. package/src/resources/extensions/gsd/tests/prompt-system-gate-coverage.test.ts +208 -0
  548. package/src/resources/extensions/gsd/tests/provider-errors.test.ts +16 -0
  549. package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +97 -0
  550. package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +63 -5
  551. package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -0
  552. package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +41 -0
  553. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +90 -0
  554. package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +7 -0
  555. package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +18 -0
  556. package/src/resources/extensions/gsd/tools/complete-slice.ts +63 -0
  557. package/src/resources/extensions/gsd/tools/complete-task.ts +63 -0
  558. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +4 -1
  559. package/src/resources/extensions/gsd/types.ts +26 -0
  560. package/src/resources/extensions/gsd/workflow-projections.ts +8 -0
  561. package/src/resources/extensions/gsd/worktree-manager.ts +29 -3
  562. package/src/resources/extensions/gsd/write-intercept.ts +10 -1
  563. package/src/resources/extensions/ollama/index.ts +17 -8
  564. package/src/resources/extensions/ollama/ollama-client.ts +35 -6
  565. package/src/resources/extensions/ollama/ollama-discovery.ts +37 -6
  566. package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -0
  567. package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +54 -0
  568. package/src/resources/extensions/shared/gsd-phase-state.ts +42 -0
  569. package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +48 -0
  570. package/src/resources/extensions/subagent/agents.ts +10 -0
  571. package/src/resources/extensions/subagent/index.ts +18 -0
  572. package/src/resources/extensions/subagent/tests/agents-conflicts.test.ts +33 -0
  573. package/src/resources/skills/create-skill/SKILL.md +2 -0
  574. package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
  575. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  576. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  577. /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → NzO79SOz9jHX-VY5-0t2O}/_buildManifest.js +0 -0
  578. /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → NzO79SOz9jHX-VY5-0t2O}/_ssgManifest.js +0 -0
@@ -115,6 +115,7 @@ import {
115
115
  resetSkillTelemetry,
116
116
  } from "./skill-telemetry.js";
117
117
  import { getRtkSessionSavings } from "../shared/rtk-session-stats.js";
118
+ import { deactivateGSD } from "../shared/gsd-phase-state.js";
118
119
  import {
119
120
  initMetrics,
120
121
  resetMetrics,
@@ -165,6 +166,7 @@ import {
165
166
  reconcileMergeState,
166
167
  } from "./auto-recovery.js";
167
168
  import { resolveDispatch, DISPATCH_RULES } from "./auto-dispatch.js";
169
+ import { getErrorMessage } from "./error-utils.js";
168
170
  import { initRegistry, convertDispatchRules } from "./rule-registry.js";
169
171
  import { emitJournalEvent as _emitJournalEvent, type JournalEntry } from "./journal.js";
170
172
  import {
@@ -272,6 +274,53 @@ function restoreProjectRootEnv(): void {
272
274
  s.projectRootEnvCaptured = false;
273
275
  }
274
276
 
277
+ function captureMilestoneLockEnv(milestoneId: string | null): void {
278
+ if (!s.milestoneLockEnvCaptured) {
279
+ s.hadMilestoneLockEnv = Object.prototype.hasOwnProperty.call(process.env, "GSD_MILESTONE_LOCK");
280
+ s.previousMilestoneLockEnv = process.env.GSD_MILESTONE_LOCK ?? null;
281
+ s.milestoneLockEnvCaptured = true;
282
+ }
283
+
284
+ if (milestoneId) {
285
+ process.env.GSD_MILESTONE_LOCK = milestoneId;
286
+ } else {
287
+ delete process.env.GSD_MILESTONE_LOCK;
288
+ }
289
+ }
290
+
291
+ function restoreMilestoneLockEnv(): void {
292
+ if (!s.milestoneLockEnvCaptured) return;
293
+
294
+ if (s.hadMilestoneLockEnv && s.previousMilestoneLockEnv !== null) {
295
+ process.env.GSD_MILESTONE_LOCK = s.previousMilestoneLockEnv;
296
+ } else {
297
+ delete process.env.GSD_MILESTONE_LOCK;
298
+ }
299
+
300
+ s.previousMilestoneLockEnv = null;
301
+ s.hadMilestoneLockEnv = false;
302
+ s.milestoneLockEnvCaptured = false;
303
+ }
304
+
305
+ export function startAutoDetached(
306
+ ctx: ExtensionCommandContext,
307
+ pi: ExtensionAPI,
308
+ base: string,
309
+ verboseMode: boolean,
310
+ options?: {
311
+ step?: boolean;
312
+ interrupted?: InterruptedSessionAssessment;
313
+ milestoneLock?: string | null;
314
+ },
315
+ ): void {
316
+ void startAuto(ctx, pi, base, verboseMode, options).catch((err) => {
317
+ const message = getErrorMessage(err);
318
+ ctx.ui.notify(`Auto-start failed: ${message}`, "error");
319
+ logWarning("engine", `auto start error: ${message}`, { file: "auto.ts" });
320
+ debugLog("auto-start-failed", { error: message });
321
+ });
322
+ }
323
+
275
324
  export function shouldUseWorktreeIsolation(): boolean {
276
325
  const prefs = loadEffectiveGSDPreferences()?.preferences?.git;
277
326
  if (prefs?.isolation === "worktree") return true;
@@ -549,11 +598,13 @@ function buildSnapshotOpts(
549
598
  _unitType: string,
550
599
  _unitId: string,
551
600
  ): {
601
+ autoSessionKey?: string;
552
602
  continueHereFired?: boolean;
553
603
  promptCharCount?: number;
554
604
  baselineCharCount?: number;
555
605
  } & Record<string, unknown> {
556
606
  return {
607
+ ...(s.autoStartTime > 0 ? { autoSessionKey: String(s.autoStartTime) } : {}),
557
608
  promptCharCount: s.lastPromptCharCount,
558
609
  baselineCharCount: s.lastBaselineCharCount,
559
610
  ...(s.currentUnitRouting ?? {}),
@@ -572,8 +623,10 @@ function handleLostSessionLock(
572
623
  });
573
624
  s.active = false;
574
625
  s.paused = false;
626
+ deactivateGSD();
575
627
  clearUnitTimeout();
576
628
  restoreProjectRootEnv();
629
+ restoreMilestoneLockEnv();
577
630
  deregisterSigtermHandler();
578
631
  clearCmuxSidebar(loadEffectiveGSDPreferences()?.preferences);
579
632
  const base = lockBase();
@@ -608,8 +661,10 @@ function handleLostSessionLock(
608
661
  function cleanupAfterLoopExit(ctx: ExtensionContext): void {
609
662
  s.currentUnit = null;
610
663
  s.active = false;
664
+ deactivateGSD();
611
665
  clearUnitTimeout();
612
666
  restoreProjectRootEnv();
667
+ restoreMilestoneLockEnv();
613
668
 
614
669
  // Clear crash lock and release session lock so the next `/gsd next` does
615
670
  // not see a stale lock with the current PID and treat it as a "remote"
@@ -622,9 +677,13 @@ function cleanupAfterLoopExit(ctx: ExtensionContext): void {
622
677
  logWarning("session", `lock cleanup failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
623
678
  }
624
679
 
625
- ctx.ui.setStatus("gsd-auto", undefined);
626
- ctx.ui.setWidget("gsd-progress", undefined);
627
- ctx.ui.setFooter(undefined);
680
+ // A transient provider-error pause intentionally leaves the paused badge
681
+ // visible so the user still has a resumable auto-mode signal on screen.
682
+ if (!s.paused) {
683
+ ctx.ui.setStatus("gsd-auto", undefined);
684
+ ctx.ui.setWidget("gsd-progress", undefined);
685
+ ctx.ui.setFooter(undefined);
686
+ }
628
687
 
629
688
  // Restore CWD out of worktree back to original project root
630
689
  if (s.originalBasePath) {
@@ -736,7 +795,22 @@ export async function stopAuto(
736
795
  debugLog("stop-cleanup-worktree", { error: e instanceof Error ? e.message : String(e) });
737
796
  }
738
797
 
739
- // ── Step 5: DB cleanup ──
798
+ // ── Step 5: Rebuild state while DB is still open (#3599) ──
799
+ // rebuildState() calls deriveState() which needs the DB for authoritative
800
+ // state. Previously this ran after closeDatabase(), forcing a filesystem
801
+ // fallback that could disagree with the DB-backed dispatch decisions —
802
+ // a split-brain where dispatch says "blocked" but STATE.md shows work.
803
+ if (s.basePath) {
804
+ try {
805
+ await rebuildState(s.basePath);
806
+ } catch (e) {
807
+ debugLog("stop-rebuild-state-failed", {
808
+ error: e instanceof Error ? e.message : String(e),
809
+ });
810
+ }
811
+ }
812
+
813
+ // ── Step 6: DB cleanup ──
740
814
  if (isDbAvailable()) {
741
815
  try {
742
816
  const { closeDatabase } = await import("./gsd-db.js");
@@ -748,7 +822,7 @@ export async function stopAuto(
748
822
  }
749
823
  }
750
824
 
751
- // ── Step 6: Restore basePath and chdir ──
825
+ // ── Step 7: Restore basePath and chdir ──
752
826
  try {
753
827
  if (s.originalBasePath) {
754
828
  s.basePath = s.originalBasePath;
@@ -763,7 +837,7 @@ export async function stopAuto(
763
837
  debugLog("stop-cleanup-basepath", { error: e instanceof Error ? e.message : String(e) });
764
838
  }
765
839
 
766
- // ── Step 7: Ledger notification ──
840
+ // ── Step 8: Ledger notification ──
767
841
  try {
768
842
  const ledger = getLedger();
769
843
  if (ledger && ledger.units.length > 0) {
@@ -779,17 +853,6 @@ export async function stopAuto(
779
853
  debugLog("stop-cleanup-ledger", { error: e instanceof Error ? e.message : String(e) });
780
854
  }
781
855
 
782
- // ── Step 8: Rebuild state ──
783
- if (s.basePath) {
784
- try {
785
- await rebuildState(s.basePath);
786
- } catch (e) {
787
- debugLog("stop-rebuild-state-failed", {
788
- error: e instanceof Error ? e.message : String(e),
789
- });
790
- }
791
- }
792
-
793
856
  // ── Step 9: Cmux sidebar / event log ──
794
857
  try {
795
858
  clearCmuxSidebar(loadedPreferences);
@@ -880,6 +943,7 @@ export async function stopAuto(
880
943
  ctx?.ui.setWidget("gsd-progress", undefined);
881
944
  ctx?.ui.setFooter(undefined);
882
945
  restoreProjectRootEnv();
946
+ restoreMilestoneLockEnv();
883
947
 
884
948
  // Reset all session state in one call
885
949
  s.reset();
@@ -933,6 +997,7 @@ export async function pauseAuto(
933
997
  activeEngineId: s.activeEngineId,
934
998
  activeRunDir: s.activeRunDir,
935
999
  autoStartTime: s.autoStartTime,
1000
+ milestoneLock: s.sessionMilestoneLock ?? undefined,
936
1001
  };
937
1002
  const runtimeDir = join(gsdRoot(s.originalBasePath || s.basePath), "runtime");
938
1003
  mkdirSync(runtimeDir, { recursive: true });
@@ -970,7 +1035,9 @@ export async function pauseAuto(
970
1035
 
971
1036
  s.active = false;
972
1037
  s.paused = true;
1038
+ deactivateGSD();
973
1039
  restoreProjectRootEnv();
1040
+ restoreMilestoneLockEnv();
974
1041
  s.pendingVerificationRetry = null;
975
1042
  s.verificationRetryCount.clear();
976
1043
  ctx?.ui.setStatus("gsd-auto", "paused");
@@ -1154,6 +1221,7 @@ export async function startAuto(
1154
1221
  options?: {
1155
1222
  step?: boolean;
1156
1223
  interrupted?: InterruptedSessionAssessment;
1224
+ milestoneLock?: string | null;
1157
1225
  },
1158
1226
  ): Promise<void> {
1159
1227
  if (s.active) {
@@ -1163,6 +1231,12 @@ export async function startAuto(
1163
1231
 
1164
1232
  const requestedStepMode = options?.step ?? false;
1165
1233
  const interruptedAssessment = options?.interrupted ?? null;
1234
+ if (options?.milestoneLock !== undefined) {
1235
+ s.sessionMilestoneLock = options.milestoneLock ?? null;
1236
+ }
1237
+ if (s.sessionMilestoneLock) {
1238
+ captureMilestoneLockEnv(s.sessionMilestoneLock);
1239
+ }
1166
1240
 
1167
1241
  // Escape stale worktree cwd from a previous milestone (#608).
1168
1242
  base = escapeStaleWorktree(base);
@@ -1194,6 +1268,7 @@ export async function startAuto(
1194
1268
  s.originalBasePath = meta.originalBasePath || base;
1195
1269
  s.stepMode = meta.stepMode ?? requestedStepMode;
1196
1270
  s.autoStartTime = meta.autoStartTime || Date.now();
1271
+ s.sessionMilestoneLock = meta.milestoneLock ?? null;
1197
1272
  s.paused = true;
1198
1273
  try { unlinkSync(pausedPath); } catch (e) { logWarning("session", `pause file cleanup failed: ${e instanceof Error ? e.message : String(e)}`, { file: "auto.ts" }); }
1199
1274
  ctx.ui.notify(
@@ -1228,6 +1303,7 @@ export async function startAuto(
1228
1303
  s.pausedUnitType = meta.unitType ?? null;
1229
1304
  s.pausedUnitId = meta.unitId ?? null;
1230
1305
  s.autoStartTime = meta.autoStartTime || Date.now();
1306
+ s.sessionMilestoneLock = meta.milestoneLock ?? null;
1231
1307
  s.paused = true;
1232
1308
  try { unlinkSync(pausedPath); } catch (e) { logWarning("session", `pause file cleanup failed: ${e instanceof Error ? e.message : String(e)}`, { file: "auto.ts" }); }
1233
1309
  ctx.ui.notify(
@@ -1247,6 +1323,10 @@ export async function startAuto(
1247
1323
  if (!s.autoStartTime || s.autoStartTime <= 0) s.autoStartTime = Date.now();
1248
1324
  }
1249
1325
 
1326
+ if (s.sessionMilestoneLock) {
1327
+ captureMilestoneLockEnv(s.sessionMilestoneLock);
1328
+ }
1329
+
1250
1330
  if (!s.paused) {
1251
1331
  s.stepMode = requestedStepMode;
1252
1332
  }
@@ -1641,9 +1721,6 @@ export async function dispatchHookUnit(
1641
1721
  return true;
1642
1722
  }
1643
1723
 
1644
- // Direct phase dispatch → auto-direct-dispatch.ts
1645
- export { dispatchDirectPhase } from "./auto-direct-dispatch.js";
1646
-
1647
1724
  // Re-export recovery functions for external consumers
1648
1725
  export {
1649
1726
  buildLoopRemediationSteps,
@@ -1026,12 +1026,12 @@ export function registerDbTools(pi: ExtensionAPI): void {
1026
1026
  name: "gsd_save_gate_result",
1027
1027
  label: "Save Gate Result",
1028
1028
  description:
1029
- "Save the result of a quality gate evaluation (Q3-Q8) to the GSD database. " +
1029
+ "Save the result of a quality gate evaluation (Q3-Q8 or MV01-MV04) to the GSD database. " +
1030
1030
  "Called by gate evaluation sub-agents after analyzing a specific quality question.",
1031
1031
  promptSnippet: "Save quality gate evaluation result (verdict, rationale, findings)",
1032
1032
  promptGuidelines: [
1033
1033
  "Use gsd_save_gate_result after evaluating a quality gate question.",
1034
- "gateId must be one of: Q3, Q4, Q5, Q6, Q7, Q8.",
1034
+ "gateId must be one of: Q3, Q4, Q5, Q6, Q7, Q8, MV01, MV02, MV03, MV04.",
1035
1035
  "verdict must be: pass (no concerns), flag (concerns found), or omitted (not applicable).",
1036
1036
  "rationale should be a one-sentence justification for the verdict.",
1037
1037
  "findings should contain detailed markdown analysis (or empty string if omitted).",
@@ -1039,7 +1039,7 @@ export function registerDbTools(pi: ExtensionAPI): void {
1039
1039
  parameters: Type.Object({
1040
1040
  milestoneId: Type.String({ description: "Milestone ID (e.g. M001)" }),
1041
1041
  sliceId: Type.String({ description: "Slice ID (e.g. S01)" }),
1042
- gateId: Type.String({ description: "Gate ID: Q3, Q4, Q5, Q6, Q7, or Q8" }),
1042
+ gateId: Type.String({ description: "Gate ID: Q3, Q4, Q5, Q6, Q7, Q8, MV01, MV02, MV03, or MV04" }),
1043
1043
  taskId: Type.Optional(Type.String({ description: "Task ID for task-scoped gates (Q5/Q6/Q7)" })),
1044
1044
  verdict: Type.String({ description: "pass, flag, or omitted" }),
1045
1045
  rationale: Type.String({ description: "One-sentence justification" }),
@@ -121,6 +121,8 @@ export function registerHooks(pi: ExtensionAPI): void {
121
121
  return { cancel: true };
122
122
  }
123
123
  const basePath = process.cwd();
124
+ const { ensureDbOpen } = await import("./dynamic-tools.js");
125
+ await ensureDbOpen();
124
126
  const state = await deriveState(basePath);
125
127
  if (!state.activeMilestone || !state.activeSlice || !state.activeTask) return;
126
128
  if (state.phase !== "executing") return;
@@ -179,14 +181,10 @@ export function registerHooks(pi: ExtensionAPI): void {
179
181
  // Only gate-shaped ask_user_questions calls should block execution.
180
182
  // The gate stays pending until the user selects the approval option.
181
183
  if (event.toolName === "ask_user_questions") {
182
- const milestoneId = getDiscussionMilestoneId(discussionBasePath);
183
- const inDiscussion = milestoneId !== null || isQueuePhaseActive();
184
- if (inDiscussion) {
185
- const questions: any[] = (event.input as any)?.questions ?? [];
186
- const questionId = questions.find((question) => typeof question?.id === "string" && isGateQuestionId(question.id))?.id;
187
- if (typeof questionId === "string") {
188
- setPendingGate(questionId);
189
- }
184
+ const questions: any[] = (event.input as any)?.questions ?? [];
185
+ const questionId = questions.find((question) => typeof question?.id === "string" && isGateQuestionId(question.id))?.id;
186
+ if (typeof questionId === "string") {
187
+ setPendingGate(questionId);
190
188
  }
191
189
  }
192
190
 
@@ -284,7 +282,6 @@ export function registerHooks(pi: ExtensionAPI): void {
284
282
  if (event.toolName !== "ask_user_questions") return;
285
283
  const milestoneId = getDiscussionMilestoneId(process.cwd());
286
284
  const queueActive = isQueuePhaseActive();
287
- if (!milestoneId && !queueActive) return;
288
285
 
289
286
  const details = event.details as any;
290
287
 
@@ -317,13 +314,16 @@ export function registerHooks(pi: ExtensionAPI): void {
317
314
  // Only unlock the gate if the user selected the first option (confirmation).
318
315
  // Cross-references against the question's defined options to reject free-form "Other" text.
319
316
  const answer = details.response?.answers?.[question.id];
317
+ const inferredMilestoneId = extractDepthVerificationMilestoneId(question.id) ?? milestoneId;
320
318
  if (isDepthConfirmationAnswer(answer?.selected, question.options)) {
321
- markDepthVerified(extractDepthVerificationMilestoneId(question.id) ?? milestoneId);
319
+ markDepthVerified(inferredMilestoneId);
320
+ clearPendingGate();
322
321
  }
323
322
  break;
324
323
  }
325
324
  }
326
325
 
326
+ if (!milestoneId && !queueActive) return;
327
327
  if (!milestoneId) return;
328
328
 
329
329
  const basePath = process.cwd();
@@ -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");