gsd-pi 2.63.0 → 2.64.0-dev.05b8a94

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 (612) hide show
  1. package/README.md +46 -134
  2. package/dist/cli.js +48 -6
  3. package/dist/headless-query.js +11 -1
  4. package/dist/headless.js +3 -1
  5. package/dist/help-text.js +4 -1
  6. package/dist/onboarding.js +15 -8
  7. package/dist/resource-loader.js +18 -3
  8. package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.js +22 -7
  9. package/dist/resources/extensions/bg-shell/process-manager.js +6 -1
  10. package/dist/resources/extensions/cmux/index.js +21 -12
  11. package/dist/resources/extensions/gsd/auto/detect-stuck.js +27 -0
  12. package/dist/resources/extensions/gsd/auto/finalize-timeout.js +40 -0
  13. package/dist/resources/extensions/gsd/auto/loop.js +4 -0
  14. package/dist/resources/extensions/gsd/auto/phases.js +157 -22
  15. package/dist/resources/extensions/gsd/auto/session.js +12 -0
  16. package/dist/resources/extensions/gsd/auto-dashboard.js +14 -8
  17. package/dist/resources/extensions/gsd/auto-model-selection.js +32 -0
  18. package/dist/resources/extensions/gsd/auto-post-unit.js +222 -11
  19. package/dist/resources/extensions/gsd/auto-prompts.js +25 -0
  20. package/dist/resources/extensions/gsd/auto-recovery.js +15 -7
  21. package/dist/resources/extensions/gsd/auto-start.js +10 -21
  22. package/dist/resources/extensions/gsd/auto-timers.js +2 -1
  23. package/dist/resources/extensions/gsd/auto-tool-tracking.js +17 -0
  24. package/dist/resources/extensions/gsd/auto-verification.js +138 -1
  25. package/dist/resources/extensions/gsd/auto-worktree.js +13 -7
  26. package/dist/resources/extensions/gsd/auto.js +24 -2
  27. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +158 -75
  28. package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +13 -0
  29. package/dist/resources/extensions/gsd/bootstrap/notify-interceptor.js +28 -0
  30. package/dist/resources/extensions/gsd/bootstrap/query-tools.js +85 -0
  31. package/dist/resources/extensions/gsd/bootstrap/register-extension.js +3 -0
  32. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +40 -1
  33. package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +15 -0
  34. package/dist/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.js +54 -0
  35. package/dist/resources/extensions/gsd/bootstrap/system-context.js +50 -2
  36. package/dist/resources/extensions/gsd/commands/catalog.js +7 -1
  37. package/dist/resources/extensions/gsd/commands/handlers/core.js +1 -0
  38. package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +103 -0
  39. package/dist/resources/extensions/gsd/commands/handlers/ops.js +5 -0
  40. package/dist/resources/extensions/gsd/commands-handlers.js +9 -4
  41. package/dist/resources/extensions/gsd/constants.js +42 -0
  42. package/dist/resources/extensions/gsd/db-writer.js +72 -4
  43. package/dist/resources/extensions/gsd/forensics.js +20 -4
  44. package/dist/resources/extensions/gsd/gsd-db.js +64 -17
  45. package/dist/resources/extensions/gsd/guided-flow.js +19 -0
  46. package/dist/resources/extensions/gsd/metrics.js +27 -1
  47. package/dist/resources/extensions/gsd/native-git-bridge.js +5 -3
  48. package/dist/resources/extensions/gsd/notification-overlay.js +224 -0
  49. package/dist/resources/extensions/gsd/notification-store.js +268 -0
  50. package/dist/resources/extensions/gsd/notification-widget.js +56 -0
  51. package/dist/resources/extensions/gsd/post-execution-checks.js +407 -0
  52. package/dist/resources/extensions/gsd/pre-execution-checks.js +464 -0
  53. package/dist/resources/extensions/gsd/preferences-types.js +6 -0
  54. package/dist/resources/extensions/gsd/preferences-validation.js +33 -0
  55. package/dist/resources/extensions/gsd/preferences.js +11 -2
  56. package/dist/resources/extensions/gsd/prompt-loader.js +7 -0
  57. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +2 -0
  58. package/dist/resources/extensions/gsd/prompts/complete-slice.md +2 -0
  59. package/dist/resources/extensions/gsd/prompts/doctor-heal.md +1 -0
  60. package/dist/resources/extensions/gsd/prompts/forensics.md +2 -0
  61. package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +2 -0
  62. package/dist/resources/extensions/gsd/prompts/system.md +4 -7
  63. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -0
  64. package/dist/resources/extensions/gsd/roadmap-mutations.js +1 -1
  65. package/dist/resources/extensions/gsd/roadmap-slices.js +9 -5
  66. package/dist/resources/extensions/gsd/safety/content-validator.js +73 -0
  67. package/dist/resources/extensions/gsd/safety/destructive-guard.js +34 -0
  68. package/dist/resources/extensions/gsd/safety/evidence-collector.js +109 -0
  69. package/dist/resources/extensions/gsd/safety/evidence-cross-ref.js +83 -0
  70. package/dist/resources/extensions/gsd/safety/file-change-validator.js +71 -0
  71. package/dist/resources/extensions/gsd/safety/git-checkpoint.js +91 -0
  72. package/dist/resources/extensions/gsd/safety/safety-harness.js +64 -0
  73. package/dist/resources/extensions/gsd/slice-parallel-conflict.js +67 -0
  74. package/dist/resources/extensions/gsd/slice-parallel-eligibility.js +51 -0
  75. package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +378 -0
  76. package/dist/resources/extensions/gsd/state.js +74 -14
  77. package/dist/resources/extensions/gsd/status-guards.js +11 -0
  78. package/dist/resources/extensions/gsd/tools/complete-milestone.js +17 -12
  79. package/dist/resources/extensions/gsd/tools/complete-slice.js +40 -26
  80. package/dist/resources/extensions/gsd/tools/complete-task.js +12 -12
  81. package/dist/resources/extensions/gsd/tools/plan-milestone.js +33 -25
  82. package/dist/resources/extensions/gsd/tools/plan-slice.js +5 -8
  83. package/dist/resources/extensions/gsd/verification-evidence.js +18 -0
  84. package/dist/resources/extensions/gsd/workflow-logger.js +8 -0
  85. package/dist/resources/extensions/gsd/workflow-projections.js +21 -5
  86. package/dist/resources/extensions/gsd/worktree-manager.js +82 -29
  87. package/dist/resources/extensions/gsd/worktree-resolver.js +4 -3
  88. package/dist/resources/extensions/mcp-client/auth.js +101 -0
  89. package/dist/resources/extensions/mcp-client/index.js +10 -1
  90. package/dist/resources/extensions/ollama/index.js +28 -22
  91. package/dist/resources/extensions/ollama/model-capabilities.js +37 -34
  92. package/dist/resources/extensions/ollama/ndjson-stream.js +54 -0
  93. package/dist/resources/extensions/ollama/ollama-chat-provider.js +380 -0
  94. package/dist/resources/extensions/ollama/ollama-client.js +23 -32
  95. package/dist/resources/extensions/ollama/ollama-discovery.js +2 -7
  96. package/dist/resources/extensions/ollama/ollama-tool.js +62 -0
  97. package/dist/resources/extensions/ollama/thinking-parser.js +104 -0
  98. package/dist/update-cmd.js +4 -2
  99. package/dist/web/standalone/.next/BUILD_ID +1 -1
  100. package/dist/web/standalone/.next/app-path-routes-manifest.json +20 -19
  101. package/dist/web/standalone/.next/build-manifest.json +3 -3
  102. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  103. package/dist/web/standalone/.next/required-server-files.json +4 -4
  104. package/dist/web/standalone/.next/routes-manifest.json +6 -0
  105. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  106. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  107. package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
  108. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  109. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  110. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  111. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  112. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  113. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  114. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  115. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  116. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  117. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  118. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  119. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  120. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  121. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  122. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  123. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  124. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  125. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  126. package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
  127. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
  130. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
  133. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  135. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
  136. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +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.js.nft.json +1 -1
  144. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
  149. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  151. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
  154. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  157. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
  160. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  163. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  166. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
  169. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
  172. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
  175. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
  178. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/notifications/route.js +3 -0
  180. package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -0
  181. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -0
  182. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
  184. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  188. package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  189. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
  192. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  194. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  196. package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
  197. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  198. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  199. package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
  200. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  201. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  202. package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
  203. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  204. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  205. package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
  206. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  207. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  208. package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
  209. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  210. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  211. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  212. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  213. package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
  214. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  215. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  216. package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
  217. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  218. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  219. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
  220. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  221. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
  222. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  223. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  224. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  225. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  226. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
  227. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  228. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
  229. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  230. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  231. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  232. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  233. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  234. package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
  235. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  236. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  237. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  238. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  239. package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
  240. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  241. package/dist/web/standalone/.next/server/app/index.html +1 -1
  242. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  243. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  244. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  245. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  246. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  247. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  248. package/dist/web/standalone/.next/server/app/page.js +2 -2
  249. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  250. package/dist/web/standalone/.next/server/app-paths-manifest.json +20 -19
  251. package/dist/web/standalone/.next/server/chunks/6897.js +12 -0
  252. package/dist/web/standalone/.next/server/chunks/7471.js +3 -3
  253. package/dist/web/standalone/.next/server/functions-config-manifest.json +1 -0
  254. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  255. package/dist/web/standalone/.next/server/middleware.js +2 -2
  256. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  257. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  258. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  259. package/dist/web/standalone/.next/server/pages/500.html +2 -2
  260. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  261. package/dist/web/standalone/.next/static/Vbx2-SrSBOgta6576xj9m/_buildManifest.js +1 -0
  262. package/dist/web/standalone/.next/static/chunks/app/_global-error/page-8805a20e15762c3c.js +1 -0
  263. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  264. package/dist/web/standalone/.next/static/chunks/app/api/boot/route-8805a20e15762c3c.js +1 -0
  265. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/input/route-8805a20e15762c3c.js +1 -0
  266. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/resize/route-8805a20e15762c3c.js +1 -0
  267. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/stream/route-8805a20e15762c3c.js +1 -0
  268. package/dist/web/standalone/.next/static/chunks/app/api/browse-directories/route-8805a20e15762c3c.js +1 -0
  269. package/dist/web/standalone/.next/static/chunks/app/api/captures/route-8805a20e15762c3c.js +1 -0
  270. package/dist/web/standalone/.next/static/chunks/app/api/cleanup/route-8805a20e15762c3c.js +1 -0
  271. package/dist/web/standalone/.next/static/chunks/app/api/dev-mode/route-8805a20e15762c3c.js +1 -0
  272. package/dist/web/standalone/.next/static/chunks/app/api/doctor/route-8805a20e15762c3c.js +1 -0
  273. package/dist/web/standalone/.next/static/chunks/app/api/experimental/route-8805a20e15762c3c.js +1 -0
  274. package/dist/web/standalone/.next/static/chunks/app/api/export-data/route-8805a20e15762c3c.js +1 -0
  275. package/dist/web/standalone/.next/static/chunks/app/api/files/route-8805a20e15762c3c.js +1 -0
  276. package/dist/web/standalone/.next/static/chunks/app/api/forensics/route-8805a20e15762c3c.js +1 -0
  277. package/dist/web/standalone/.next/static/chunks/app/api/git/route-8805a20e15762c3c.js +1 -0
  278. package/dist/web/standalone/.next/static/chunks/app/api/history/route-8805a20e15762c3c.js +1 -0
  279. package/dist/web/standalone/.next/static/chunks/app/api/hooks/route-8805a20e15762c3c.js +1 -0
  280. package/dist/web/standalone/.next/static/chunks/app/api/inspect/route-8805a20e15762c3c.js +1 -0
  281. package/dist/web/standalone/.next/static/chunks/app/api/knowledge/route-8805a20e15762c3c.js +1 -0
  282. package/dist/web/standalone/.next/static/chunks/app/api/live-state/route-8805a20e15762c3c.js +1 -0
  283. package/dist/web/standalone/.next/static/chunks/app/api/notifications/route-8805a20e15762c3c.js +1 -0
  284. package/dist/web/standalone/.next/static/chunks/app/api/onboarding/route-8805a20e15762c3c.js +1 -0
  285. package/dist/web/standalone/.next/static/chunks/app/api/preferences/route-8805a20e15762c3c.js +1 -0
  286. package/dist/web/standalone/.next/static/chunks/app/api/projects/route-8805a20e15762c3c.js +1 -0
  287. package/dist/web/standalone/.next/static/chunks/app/api/recovery/route-8805a20e15762c3c.js +1 -0
  288. package/dist/web/standalone/.next/static/chunks/app/api/remote-questions/route-8805a20e15762c3c.js +1 -0
  289. package/dist/web/standalone/.next/static/chunks/app/api/session/browser/route-8805a20e15762c3c.js +1 -0
  290. package/dist/web/standalone/.next/static/chunks/app/api/session/command/route-8805a20e15762c3c.js +1 -0
  291. package/dist/web/standalone/.next/static/chunks/app/api/session/events/route-8805a20e15762c3c.js +1 -0
  292. package/dist/web/standalone/.next/static/chunks/app/api/session/manage/route-8805a20e15762c3c.js +1 -0
  293. package/dist/web/standalone/.next/static/chunks/app/api/settings-data/route-8805a20e15762c3c.js +1 -0
  294. package/dist/web/standalone/.next/static/chunks/app/api/shutdown/route-8805a20e15762c3c.js +1 -0
  295. package/dist/web/standalone/.next/static/chunks/app/api/skill-health/route-8805a20e15762c3c.js +1 -0
  296. package/dist/web/standalone/.next/static/chunks/app/api/steer/route-8805a20e15762c3c.js +1 -0
  297. package/dist/web/standalone/.next/static/chunks/app/api/switch-root/route-8805a20e15762c3c.js +1 -0
  298. package/dist/web/standalone/.next/static/chunks/app/api/terminal/input/route-8805a20e15762c3c.js +1 -0
  299. package/dist/web/standalone/.next/static/chunks/app/api/terminal/resize/route-8805a20e15762c3c.js +1 -0
  300. package/dist/web/standalone/.next/static/chunks/app/api/terminal/sessions/route-8805a20e15762c3c.js +1 -0
  301. package/dist/web/standalone/.next/static/chunks/app/api/terminal/stream/route-8805a20e15762c3c.js +1 -0
  302. package/dist/web/standalone/.next/static/chunks/app/api/terminal/upload/route-8805a20e15762c3c.js +1 -0
  303. package/dist/web/standalone/.next/static/chunks/app/api/undo/route-8805a20e15762c3c.js +1 -0
  304. package/dist/web/standalone/.next/static/chunks/app/api/update/route-8805a20e15762c3c.js +1 -0
  305. package/dist/web/standalone/.next/static/chunks/app/api/visualizer/route-8805a20e15762c3c.js +1 -0
  306. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  307. package/dist/web/standalone/.next/static/chunks/app/page-0c485498795110d6.js +1 -0
  308. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  309. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-8805a20e15762c3c.js +1 -0
  310. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-8805a20e15762c3c.js +1 -0
  311. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  312. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-8805a20e15762c3c.js +1 -0
  313. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-8805a20e15762c3c.js +1 -0
  314. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  315. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  316. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  317. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  318. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  319. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  320. package/dist/web/standalone/server.js +1 -1
  321. package/dist/welcome-screen.js +1 -1
  322. package/package.json +1 -1
  323. package/packages/pi-agent-core/dist/agent-loop.d.ts +8 -0
  324. package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  325. package/packages/pi-agent-core/dist/agent-loop.js +70 -3
  326. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
  327. package/packages/pi-agent-core/src/agent-loop.test.ts +317 -5
  328. package/packages/pi-agent-core/src/agent-loop.ts +90 -6
  329. package/packages/pi-ai/dist/types.d.ts +16 -1
  330. package/packages/pi-ai/dist/types.d.ts.map +1 -1
  331. package/packages/pi-ai/dist/types.js.map +1 -1
  332. package/packages/pi-ai/src/types.ts +18 -1
  333. package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.d.ts +2 -0
  334. package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.d.ts.map +1 -0
  335. package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js +38 -0
  336. package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js.map +1 -0
  337. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  338. package/packages/pi-coding-agent/dist/core/agent-session.js +11 -0
  339. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  340. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +9 -0
  341. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  342. package/packages/pi-coding-agent/dist/core/auth-storage.js +50 -1
  343. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  344. package/packages/pi-coding-agent/dist/core/auth-storage.test.js +41 -0
  345. package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
  346. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +7 -0
  347. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  348. package/packages/pi-coding-agent/dist/core/extensions/loader.js +31 -4
  349. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  350. package/packages/pi-coding-agent/dist/core/extensions/loader.test.js +28 -1
  351. package/packages/pi-coding-agent/dist/core/extensions/loader.test.js.map +1 -1
  352. package/packages/pi-coding-agent/dist/core/extensions/provider-registration.test.d.ts +2 -0
  353. package/packages/pi-coding-agent/dist/core/extensions/provider-registration.test.d.ts.map +1 -0
  354. package/packages/pi-coding-agent/dist/core/extensions/provider-registration.test.js +46 -0
  355. package/packages/pi-coding-agent/dist/core/extensions/provider-registration.test.js.map +1 -0
  356. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +2 -0
  357. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  358. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  359. package/packages/pi-coding-agent/dist/core/model-registry.d.ts +1 -0
  360. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  361. package/packages/pi-coding-agent/dist/core/model-registry.js +12 -0
  362. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  363. package/packages/pi-coding-agent/dist/core/model-resolver.js +3 -3
  364. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  365. package/packages/pi-coding-agent/dist/core/resource-loader-cache-reset.test.d.ts +2 -0
  366. package/packages/pi-coding-agent/dist/core/resource-loader-cache-reset.test.d.ts.map +1 -0
  367. package/packages/pi-coding-agent/dist/core/resource-loader-cache-reset.test.js +24 -0
  368. package/packages/pi-coding-agent/dist/core/resource-loader-cache-reset.test.js.map +1 -0
  369. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +23 -1
  370. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  371. package/packages/pi-coding-agent/dist/core/resource-loader.js +84 -57
  372. package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  373. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  374. package/packages/pi-coding-agent/dist/core/sdk.js +9 -0
  375. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  376. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +1 -0
  377. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  378. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +8 -0
  379. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  380. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +6 -0
  381. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  382. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +36 -0
  383. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  384. package/packages/pi-coding-agent/package.json +1 -1
  385. package/packages/pi-coding-agent/src/core/agent-session-tool-refresh.test.ts +64 -0
  386. package/packages/pi-coding-agent/src/core/agent-session.ts +10 -0
  387. package/packages/pi-coding-agent/src/core/auth-storage.test.ts +53 -0
  388. package/packages/pi-coding-agent/src/core/auth-storage.ts +66 -1
  389. package/packages/pi-coding-agent/src/core/extensions/loader.test.ts +39 -1
  390. package/packages/pi-coding-agent/src/core/extensions/loader.ts +34 -4
  391. package/packages/pi-coding-agent/src/core/extensions/provider-registration.test.ts +81 -0
  392. package/packages/pi-coding-agent/src/core/extensions/types.ts +2 -0
  393. package/packages/pi-coding-agent/src/core/model-registry.ts +14 -0
  394. package/packages/pi-coding-agent/src/core/model-resolver.ts +3 -3
  395. package/packages/pi-coding-agent/src/core/resource-loader-cache-reset.test.ts +42 -0
  396. package/packages/pi-coding-agent/src/core/resource-loader.ts +94 -57
  397. package/packages/pi-coding-agent/src/core/sdk.ts +10 -0
  398. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +9 -0
  399. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +33 -0
  400. package/packages/pi-tui/dist/components/loader.d.ts +4 -2
  401. package/packages/pi-tui/dist/components/loader.d.ts.map +1 -1
  402. package/packages/pi-tui/dist/components/loader.js +27 -9
  403. package/packages/pi-tui/dist/components/loader.js.map +1 -1
  404. package/packages/pi-tui/dist/components/text.d.ts.map +1 -1
  405. package/packages/pi-tui/dist/components/text.js +2 -0
  406. package/packages/pi-tui/dist/components/text.js.map +1 -1
  407. package/packages/pi-tui/dist/tui.d.ts +2 -0
  408. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  409. package/packages/pi-tui/dist/tui.js +35 -0
  410. package/packages/pi-tui/dist/tui.js.map +1 -1
  411. package/packages/pi-tui/src/components/loader.ts +27 -10
  412. package/packages/pi-tui/src/components/text.ts +1 -0
  413. package/packages/pi-tui/src/tui.ts +32 -0
  414. package/pkg/package.json +1 -1
  415. package/src/resources/extensions/bg-shell/bg-shell-lifecycle.ts +19 -7
  416. package/src/resources/extensions/bg-shell/process-manager.ts +8 -2
  417. package/src/resources/extensions/cmux/index.ts +18 -12
  418. package/src/resources/extensions/gsd/auto/detect-stuck.ts +27 -0
  419. package/src/resources/extensions/gsd/auto/finalize-timeout.ts +46 -0
  420. package/src/resources/extensions/gsd/auto/loop.ts +5 -0
  421. package/src/resources/extensions/gsd/auto/phases.ts +194 -33
  422. package/src/resources/extensions/gsd/auto/session.ts +14 -0
  423. package/src/resources/extensions/gsd/auto-dashboard.ts +16 -7
  424. package/src/resources/extensions/gsd/auto-model-selection.ts +36 -0
  425. package/src/resources/extensions/gsd/auto-post-unit.ts +263 -12
  426. package/src/resources/extensions/gsd/auto-prompts.ts +21 -0
  427. package/src/resources/extensions/gsd/auto-recovery.ts +9 -8
  428. package/src/resources/extensions/gsd/auto-start.ts +11 -20
  429. package/src/resources/extensions/gsd/auto-timers.ts +2 -1
  430. package/src/resources/extensions/gsd/auto-tool-tracking.ts +19 -0
  431. package/src/resources/extensions/gsd/auto-verification.ts +190 -2
  432. package/src/resources/extensions/gsd/auto-worktree.ts +14 -6
  433. package/src/resources/extensions/gsd/auto.ts +26 -1
  434. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +172 -88
  435. package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +15 -0
  436. package/src/resources/extensions/gsd/bootstrap/notify-interceptor.ts +34 -0
  437. package/src/resources/extensions/gsd/bootstrap/query-tools.ts +98 -0
  438. package/src/resources/extensions/gsd/bootstrap/register-extension.ts +4 -0
  439. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +44 -1
  440. package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +19 -0
  441. package/src/resources/extensions/gsd/bootstrap/sanitize-complete-milestone.ts +57 -0
  442. package/src/resources/extensions/gsd/bootstrap/system-context.ts +59 -2
  443. package/src/resources/extensions/gsd/commands/catalog.ts +7 -1
  444. package/src/resources/extensions/gsd/commands/handlers/core.ts +1 -0
  445. package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +139 -0
  446. package/src/resources/extensions/gsd/commands/handlers/ops.ts +5 -0
  447. package/src/resources/extensions/gsd/commands-handlers.ts +10 -4
  448. package/src/resources/extensions/gsd/constants.ts +44 -0
  449. package/src/resources/extensions/gsd/db-writer.ts +78 -4
  450. package/src/resources/extensions/gsd/forensics.ts +21 -5
  451. package/src/resources/extensions/gsd/gsd-db.ts +64 -17
  452. package/src/resources/extensions/gsd/guided-flow.ts +22 -0
  453. package/src/resources/extensions/gsd/metrics.ts +28 -1
  454. package/src/resources/extensions/gsd/native-git-bridge.ts +5 -3
  455. package/src/resources/extensions/gsd/notification-overlay.ts +267 -0
  456. package/src/resources/extensions/gsd/notification-store.ts +288 -0
  457. package/src/resources/extensions/gsd/notification-widget.ts +68 -0
  458. package/src/resources/extensions/gsd/post-execution-checks.ts +539 -0
  459. package/src/resources/extensions/gsd/pre-execution-checks.ts +573 -0
  460. package/src/resources/extensions/gsd/preferences-types.ts +44 -0
  461. package/src/resources/extensions/gsd/preferences-validation.ts +33 -0
  462. package/src/resources/extensions/gsd/preferences.ts +13 -2
  463. package/src/resources/extensions/gsd/prompt-loader.ts +8 -0
  464. package/src/resources/extensions/gsd/prompts/complete-milestone.md +2 -0
  465. package/src/resources/extensions/gsd/prompts/complete-slice.md +2 -0
  466. package/src/resources/extensions/gsd/prompts/doctor-heal.md +1 -0
  467. package/src/resources/extensions/gsd/prompts/forensics.md +2 -0
  468. package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +2 -0
  469. package/src/resources/extensions/gsd/prompts/system.md +4 -7
  470. package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -0
  471. package/src/resources/extensions/gsd/roadmap-mutations.ts +1 -1
  472. package/src/resources/extensions/gsd/roadmap-slices.ts +10 -5
  473. package/src/resources/extensions/gsd/safety/content-validator.ts +98 -0
  474. package/src/resources/extensions/gsd/safety/destructive-guard.ts +49 -0
  475. package/src/resources/extensions/gsd/safety/evidence-collector.ts +151 -0
  476. package/src/resources/extensions/gsd/safety/evidence-cross-ref.ts +120 -0
  477. package/src/resources/extensions/gsd/safety/file-change-validator.ts +108 -0
  478. package/src/resources/extensions/gsd/safety/git-checkpoint.ts +106 -0
  479. package/src/resources/extensions/gsd/safety/safety-harness.ts +105 -0
  480. package/src/resources/extensions/gsd/slice-parallel-conflict.ts +86 -0
  481. package/src/resources/extensions/gsd/slice-parallel-eligibility.ts +73 -0
  482. package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +477 -0
  483. package/src/resources/extensions/gsd/state.ts +67 -12
  484. package/src/resources/extensions/gsd/status-guards.ts +13 -0
  485. package/src/resources/extensions/gsd/tests/artifact-corruption-2630.test.ts +288 -0
  486. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +34 -13
  487. package/src/resources/extensions/gsd/tests/auto-start-time-persistence.test.ts +50 -0
  488. package/src/resources/extensions/gsd/tests/cmux.test.ts +58 -0
  489. package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +51 -0
  490. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +140 -0
  491. package/src/resources/extensions/gsd/tests/complete-slice-string-coercion.test.ts +247 -0
  492. package/src/resources/extensions/gsd/tests/complete-task.test.ts +39 -0
  493. package/src/resources/extensions/gsd/tests/dashboard-model-label-ordering.test.ts +107 -0
  494. package/src/resources/extensions/gsd/tests/db-access-guardrails.test.ts +109 -0
  495. package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +13 -9
  496. package/src/resources/extensions/gsd/tests/db-writer.test.ts +134 -0
  497. package/src/resources/extensions/gsd/tests/deferred-slice-dispatch.test.ts +203 -0
  498. package/src/resources/extensions/gsd/tests/discuss-tool-scope-leak.test.ts +76 -0
  499. package/src/resources/extensions/gsd/tests/discuss-tool-scoping.test.ts +130 -0
  500. package/src/resources/extensions/gsd/tests/doctor-fix-flag.test.ts +92 -0
  501. package/src/resources/extensions/gsd/tests/enhanced-verification-integration.test.ts +526 -0
  502. package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +116 -0
  503. package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +50 -0
  504. package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +103 -0
  505. package/src/resources/extensions/gsd/tests/git-checkpoint.test.ts +94 -0
  506. package/src/resources/extensions/gsd/tests/insert-slice-no-wipe.test.ts +88 -0
  507. package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +27 -7
  508. package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +34 -0
  509. package/src/resources/extensions/gsd/tests/metrics.test.ts +116 -1
  510. package/src/resources/extensions/gsd/tests/milestone-status-tool.test.ts +201 -0
  511. package/src/resources/extensions/gsd/tests/notification-store.test.ts +249 -0
  512. package/src/resources/extensions/gsd/tests/plan-milestone-title.test.ts +2 -1
  513. package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +82 -18
  514. package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +312 -0
  515. package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +813 -0
  516. package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +999 -0
  517. package/src/resources/extensions/gsd/tests/pre-execution-fail-closed.test.ts +266 -0
  518. package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +457 -0
  519. package/src/resources/extensions/gsd/tests/preferences.test.ts +10 -0
  520. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +25 -0
  521. package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +69 -0
  522. package/src/resources/extensions/gsd/tests/shared-wal.test.ts +30 -0
  523. package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +50 -0
  524. package/src/resources/extensions/gsd/tests/slice-parallel-conflict.test.ts +92 -0
  525. package/src/resources/extensions/gsd/tests/slice-parallel-eligibility.test.ts +95 -0
  526. package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +83 -0
  527. package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +42 -0
  528. package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +103 -0
  529. package/src/resources/extensions/gsd/tests/tool-param-optionality.test.ts +349 -0
  530. package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +163 -0
  531. package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +35 -2
  532. package/src/resources/extensions/gsd/tests/worktree-health-monorepo.test.ts +73 -0
  533. package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +34 -0
  534. package/src/resources/extensions/gsd/tests/worktree-submodule-safety.test.ts +1 -1
  535. package/src/resources/extensions/gsd/tests/worktree-teardown-safety.test.ts +148 -0
  536. package/src/resources/extensions/gsd/tools/complete-milestone.ts +34 -20
  537. package/src/resources/extensions/gsd/tools/complete-slice.ts +41 -26
  538. package/src/resources/extensions/gsd/tools/complete-task.ts +12 -12
  539. package/src/resources/extensions/gsd/tools/plan-milestone.ts +55 -30
  540. package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -8
  541. package/src/resources/extensions/gsd/types.ts +44 -22
  542. package/src/resources/extensions/gsd/verification-evidence.ts +68 -0
  543. package/src/resources/extensions/gsd/workflow-logger.ts +15 -1
  544. package/src/resources/extensions/gsd/workflow-projections.ts +23 -5
  545. package/src/resources/extensions/gsd/worktree-manager.ts +76 -28
  546. package/src/resources/extensions/gsd/worktree-resolver.ts +4 -3
  547. package/src/resources/extensions/mcp-client/auth.ts +149 -0
  548. package/src/resources/extensions/mcp-client/index.ts +16 -1
  549. package/src/resources/extensions/ollama/index.ts +26 -25
  550. package/src/resources/extensions/ollama/model-capabilities.ts +41 -34
  551. package/src/resources/extensions/ollama/ndjson-stream.ts +63 -0
  552. package/src/resources/extensions/ollama/ollama-auth-mode.test.ts +20 -0
  553. package/src/resources/extensions/ollama/ollama-chat-provider.ts +459 -0
  554. package/src/resources/extensions/ollama/ollama-client.ts +30 -30
  555. package/src/resources/extensions/ollama/ollama-discovery.ts +5 -8
  556. package/src/resources/extensions/ollama/ollama-tool.ts +69 -0
  557. package/src/resources/extensions/ollama/tests/ollama-chat-provider-stream.test.ts +82 -0
  558. package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +0 -27
  559. package/src/resources/extensions/ollama/thinking-parser.ts +116 -0
  560. package/src/resources/extensions/ollama/types.ts +23 -0
  561. package/dist/web/standalone/.next/server/chunks/2229.js +0 -12
  562. package/dist/web/standalone/.next/static/5FLUBNdqolRyyehCyChPd/_buildManifest.js +0 -1
  563. package/dist/web/standalone/.next/static/chunks/app/_global-error/page-c4cc189e7b117ea2.js +0 -1
  564. package/dist/web/standalone/.next/static/chunks/app/api/boot/route-c4cc189e7b117ea2.js +0 -1
  565. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/input/route-c4cc189e7b117ea2.js +0 -1
  566. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/resize/route-c4cc189e7b117ea2.js +0 -1
  567. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/stream/route-c4cc189e7b117ea2.js +0 -1
  568. package/dist/web/standalone/.next/static/chunks/app/api/browse-directories/route-c4cc189e7b117ea2.js +0 -1
  569. package/dist/web/standalone/.next/static/chunks/app/api/captures/route-c4cc189e7b117ea2.js +0 -1
  570. package/dist/web/standalone/.next/static/chunks/app/api/cleanup/route-c4cc189e7b117ea2.js +0 -1
  571. package/dist/web/standalone/.next/static/chunks/app/api/dev-mode/route-c4cc189e7b117ea2.js +0 -1
  572. package/dist/web/standalone/.next/static/chunks/app/api/doctor/route-c4cc189e7b117ea2.js +0 -1
  573. package/dist/web/standalone/.next/static/chunks/app/api/experimental/route-c4cc189e7b117ea2.js +0 -1
  574. package/dist/web/standalone/.next/static/chunks/app/api/export-data/route-c4cc189e7b117ea2.js +0 -1
  575. package/dist/web/standalone/.next/static/chunks/app/api/files/route-c4cc189e7b117ea2.js +0 -1
  576. package/dist/web/standalone/.next/static/chunks/app/api/forensics/route-c4cc189e7b117ea2.js +0 -1
  577. package/dist/web/standalone/.next/static/chunks/app/api/git/route-c4cc189e7b117ea2.js +0 -1
  578. package/dist/web/standalone/.next/static/chunks/app/api/history/route-c4cc189e7b117ea2.js +0 -1
  579. package/dist/web/standalone/.next/static/chunks/app/api/hooks/route-c4cc189e7b117ea2.js +0 -1
  580. package/dist/web/standalone/.next/static/chunks/app/api/inspect/route-c4cc189e7b117ea2.js +0 -1
  581. package/dist/web/standalone/.next/static/chunks/app/api/knowledge/route-c4cc189e7b117ea2.js +0 -1
  582. package/dist/web/standalone/.next/static/chunks/app/api/live-state/route-c4cc189e7b117ea2.js +0 -1
  583. package/dist/web/standalone/.next/static/chunks/app/api/onboarding/route-c4cc189e7b117ea2.js +0 -1
  584. package/dist/web/standalone/.next/static/chunks/app/api/preferences/route-c4cc189e7b117ea2.js +0 -1
  585. package/dist/web/standalone/.next/static/chunks/app/api/projects/route-c4cc189e7b117ea2.js +0 -1
  586. package/dist/web/standalone/.next/static/chunks/app/api/recovery/route-c4cc189e7b117ea2.js +0 -1
  587. package/dist/web/standalone/.next/static/chunks/app/api/remote-questions/route-c4cc189e7b117ea2.js +0 -1
  588. package/dist/web/standalone/.next/static/chunks/app/api/session/browser/route-c4cc189e7b117ea2.js +0 -1
  589. package/dist/web/standalone/.next/static/chunks/app/api/session/command/route-c4cc189e7b117ea2.js +0 -1
  590. package/dist/web/standalone/.next/static/chunks/app/api/session/events/route-c4cc189e7b117ea2.js +0 -1
  591. package/dist/web/standalone/.next/static/chunks/app/api/session/manage/route-c4cc189e7b117ea2.js +0 -1
  592. package/dist/web/standalone/.next/static/chunks/app/api/settings-data/route-c4cc189e7b117ea2.js +0 -1
  593. package/dist/web/standalone/.next/static/chunks/app/api/shutdown/route-c4cc189e7b117ea2.js +0 -1
  594. package/dist/web/standalone/.next/static/chunks/app/api/skill-health/route-c4cc189e7b117ea2.js +0 -1
  595. package/dist/web/standalone/.next/static/chunks/app/api/steer/route-c4cc189e7b117ea2.js +0 -1
  596. package/dist/web/standalone/.next/static/chunks/app/api/switch-root/route-c4cc189e7b117ea2.js +0 -1
  597. package/dist/web/standalone/.next/static/chunks/app/api/terminal/input/route-c4cc189e7b117ea2.js +0 -1
  598. package/dist/web/standalone/.next/static/chunks/app/api/terminal/resize/route-c4cc189e7b117ea2.js +0 -1
  599. package/dist/web/standalone/.next/static/chunks/app/api/terminal/sessions/route-c4cc189e7b117ea2.js +0 -1
  600. package/dist/web/standalone/.next/static/chunks/app/api/terminal/stream/route-c4cc189e7b117ea2.js +0 -1
  601. package/dist/web/standalone/.next/static/chunks/app/api/terminal/upload/route-c4cc189e7b117ea2.js +0 -1
  602. package/dist/web/standalone/.next/static/chunks/app/api/undo/route-c4cc189e7b117ea2.js +0 -1
  603. package/dist/web/standalone/.next/static/chunks/app/api/update/route-c4cc189e7b117ea2.js +0 -1
  604. package/dist/web/standalone/.next/static/chunks/app/api/visualizer/route-c4cc189e7b117ea2.js +0 -1
  605. package/dist/web/standalone/.next/static/chunks/app/page-62be3b5fa91e4c8f.js +0 -1
  606. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  607. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-c4cc189e7b117ea2.js +0 -1
  608. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-c4cc189e7b117ea2.js +0 -1
  609. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  610. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-c4cc189e7b117ea2.js +0 -1
  611. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c4cc189e7b117ea2.js +0 -1
  612. /package/dist/web/standalone/.next/static/{5FLUBNdqolRyyehCyChPd → Vbx2-SrSBOgta6576xj9m}/_ssgManifest.js +0 -0
@@ -501,28 +501,10 @@ export function registerDbTools(pi: ExtensionAPI): void {
501
501
  "Use the canonical name gsd_plan_milestone; gsd_milestone_plan is only an alias.",
502
502
  ],
503
503
  parameters: Type.Object({
504
+ // ── Core identification + content (required) ──────────────────────
504
505
  milestoneId: Type.String({ description: "Milestone ID (e.g. M001)" }),
505
506
  title: Type.String({ description: "Milestone title" }),
506
- status: Type.Optional(Type.String({ description: "Milestone status (defaults to active)" })),
507
- dependsOn: Type.Optional(Type.Array(Type.String(), { description: "Milestone dependencies" })),
508
507
  vision: Type.String({ description: "Milestone vision" }),
509
- successCriteria: Type.Array(Type.String(), { description: "Top-level success criteria bullets" }),
510
- keyRisks: Type.Array(Type.Object({
511
- risk: Type.String({ description: "Risk statement" }),
512
- whyItMatters: Type.String({ description: "Why the risk matters" }),
513
- }), { description: "Structured risk entries" }),
514
- proofStrategy: Type.Array(Type.Object({
515
- riskOrUnknown: Type.String({ description: "Risk or unknown to retire" }),
516
- retireIn: Type.String({ description: "Where it will be retired" }),
517
- whatWillBeProven: Type.String({ description: "What proof will be produced" }),
518
- }), { description: "Structured proof strategy entries" }),
519
- verificationContract: Type.String({ description: "Verification contract text" }),
520
- verificationIntegration: Type.String({ description: "Integration verification text" }),
521
- verificationOperational: Type.String({ description: "Operational verification text" }),
522
- verificationUat: Type.String({ description: "UAT verification text" }),
523
- definitionOfDone: Type.Array(Type.String(), { description: "Definition of done bullets" }),
524
- requirementCoverage: Type.String({ description: "Requirement coverage text" }),
525
- boundaryMapMarkdown: Type.String({ description: "Boundary map markdown block" }),
526
508
  slices: Type.Array(Type.Object({
527
509
  sliceId: Type.String({ description: "Slice ID (e.g. S01)" }),
528
510
  title: Type.String({ description: "Slice title" }),
@@ -535,6 +517,26 @@ export function registerDbTools(pi: ExtensionAPI): void {
535
517
  integrationClosure: Type.String({ description: "Slice integration closure" }),
536
518
  observabilityImpact: Type.String({ description: "Slice observability impact" }),
537
519
  }), { description: "Planned slices for the milestone" }),
520
+ // ── Enrichment metadata (optional — defaults to empty) ────────────
521
+ status: Type.Optional(Type.String({ description: "Milestone status (defaults to active)" })),
522
+ dependsOn: Type.Optional(Type.Array(Type.String(), { description: "Milestone dependencies" })),
523
+ successCriteria: Type.Optional(Type.Array(Type.String(), { description: "Top-level success criteria bullets" })),
524
+ keyRisks: Type.Optional(Type.Array(Type.Object({
525
+ risk: Type.String({ description: "Risk statement" }),
526
+ whyItMatters: Type.String({ description: "Why the risk matters" }),
527
+ }), { description: "Structured risk entries" })),
528
+ proofStrategy: Type.Optional(Type.Array(Type.Object({
529
+ riskOrUnknown: Type.String({ description: "Risk or unknown to retire" }),
530
+ retireIn: Type.String({ description: "Where it will be retired" }),
531
+ whatWillBeProven: Type.String({ description: "What proof will be produced" }),
532
+ }), { description: "Structured proof strategy entries" })),
533
+ verificationContract: Type.Optional(Type.String({ description: "Verification contract text" })),
534
+ verificationIntegration: Type.Optional(Type.String({ description: "Integration verification text" })),
535
+ verificationOperational: Type.Optional(Type.String({ description: "Operational verification text" })),
536
+ verificationUat: Type.Optional(Type.String({ description: "UAT verification text" })),
537
+ definitionOfDone: Type.Optional(Type.Array(Type.String(), { description: "Definition of done bullets" })),
538
+ requirementCoverage: Type.Optional(Type.String({ description: "Requirement coverage text" })),
539
+ boundaryMapMarkdown: Type.Optional(Type.String({ description: "Boundary map markdown block" })),
538
540
  }),
539
541
  execute: planMilestoneExecute,
540
542
  };
@@ -594,13 +596,10 @@ export function registerDbTools(pi: ExtensionAPI): void {
594
596
  "Use the canonical name gsd_plan_slice; gsd_slice_plan is only an alias.",
595
597
  ],
596
598
  parameters: Type.Object({
599
+ // ── Core identification + content (required) ──────────────────────
597
600
  milestoneId: Type.String({ description: "Milestone ID (e.g. M001)" }),
598
601
  sliceId: Type.String({ description: "Slice ID (e.g. S01)" }),
599
602
  goal: Type.String({ description: "Slice goal" }),
600
- successCriteria: Type.String({ description: "Slice success criteria block" }),
601
- proofLevel: Type.String({ description: "Slice proof level" }),
602
- integrationClosure: Type.String({ description: "Slice integration closure" }),
603
- observabilityImpact: Type.String({ description: "Slice observability impact" }),
604
603
  tasks: Type.Array(Type.Object({
605
604
  taskId: Type.String({ description: "Task ID (e.g. T01)" }),
606
605
  title: Type.String({ description: "Task title" }),
@@ -612,6 +611,11 @@ export function registerDbTools(pi: ExtensionAPI): void {
612
611
  expectedOutput: Type.Array(Type.String(), { description: "Expected output files or artifacts" }),
613
612
  observabilityImpact: Type.Optional(Type.String({ description: "Task observability impact" })),
614
613
  }), { description: "Planned tasks for the slice" }),
614
+ // ── Enrichment metadata (optional — defaults to empty) ────────────
615
+ successCriteria: Type.Optional(Type.String({ description: "Slice success criteria block" })),
616
+ proofLevel: Type.Optional(Type.String({ description: "Slice proof level" })),
617
+ integrationClosure: Type.Optional(Type.String({ description: "Slice integration closure" })),
618
+ observabilityImpact: Type.Optional(Type.String({ description: "Slice observability impact" })),
615
619
  }),
616
620
  execute: planSliceExecute,
617
621
  };
@@ -700,8 +704,14 @@ export function registerDbTools(pi: ExtensionAPI): void {
700
704
  };
701
705
  }
702
706
  try {
707
+ // Coerce string items to objects for verificationEvidence (#3541).
708
+ const coerced = { ...params };
709
+ coerced.verificationEvidence = (params.verificationEvidence ?? []).map((v: any) =>
710
+ typeof v === "string" ? { command: v, exitCode: -1, verdict: "unknown (coerced from string)", durationMs: 0 } : v,
711
+ );
712
+
703
713
  const { handleCompleteTask } = await import("../tools/complete-task.js");
704
- const result = await handleCompleteTask(params, process.cwd());
714
+ const result = await handleCompleteTask(coerced, process.cwd());
705
715
  if ("error" in result) {
706
716
  return {
707
717
  content: [{ type: "text" as const, text: `Error completing task: ${result.error}` }],
@@ -743,26 +753,31 @@ export function registerDbTools(pi: ExtensionAPI): void {
743
753
  "Idempotent — calling with the same params twice will upsert (INSERT OR REPLACE) without error.",
744
754
  ],
745
755
  parameters: Type.Object({
756
+ // ── Core identification + content (required) ──────────────────────
746
757
  taskId: Type.String({ description: "Task ID (e.g. T01)" }),
747
758
  sliceId: Type.String({ description: "Slice ID (e.g. S01)" }),
748
759
  milestoneId: Type.String({ description: "Milestone ID (e.g. M001)" }),
749
760
  oneLiner: Type.String({ description: "One-line summary of what was accomplished" }),
750
761
  narrative: Type.String({ description: "Detailed narrative of what happened during the task" }),
751
762
  verification: Type.String({ description: "What was verified and how — commands run, tests passed, behavior confirmed" }),
752
- deviations: Type.String({ description: "Deviations from the task plan, or 'None.'" }),
753
- knownIssues: Type.String({ description: "Known issues discovered but not fixed, or 'None.'" }),
754
- keyFiles: Type.Array(Type.String(), { description: "List of key files created or modified" }),
755
- keyDecisions: Type.Array(Type.String(), { description: "List of key decisions made during this task" }),
756
- blockerDiscovered: Type.Boolean({ description: "Whether a plan-invalidating blocker was discovered" }),
757
- verificationEvidence: Type.Array(
758
- Type.Object({
759
- command: Type.String({ description: "Verification command that was run" }),
760
- exitCode: Type.Number({ description: "Exit code of the command" }),
761
- verdict: Type.String({ description: "Pass/fail verdict (e.g. '✅ pass', '❌ fail')" }),
762
- durationMs: Type.Number({ description: "Duration of the command in milliseconds" }),
763
- }),
763
+ // ── Enrichment metadata (optional defaults to empty) ────────────
764
+ deviations: Type.Optional(Type.String({ description: "Deviations from the task plan, or 'None.'" })),
765
+ knownIssues: Type.Optional(Type.String({ description: "Known issues discovered but not fixed, or 'None.'" })),
766
+ keyFiles: Type.Optional(Type.Array(Type.String(), { description: "List of key files created or modified" })),
767
+ keyDecisions: Type.Optional(Type.Array(Type.String(), { description: "List of key decisions made during this task" })),
768
+ blockerDiscovered: Type.Optional(Type.Boolean({ description: "Whether a plan-invalidating blocker was discovered" })),
769
+ verificationEvidence: Type.Optional(Type.Array(
770
+ Type.Union([
771
+ Type.Object({
772
+ command: Type.String({ description: "Verification command that was run" }),
773
+ exitCode: Type.Number({ description: "Exit code of the command" }),
774
+ verdict: Type.String({ description: "Pass/fail verdict (e.g. '✅ pass', '❌ fail')" }),
775
+ durationMs: Type.Number({ description: "Duration of the command in milliseconds" }),
776
+ }),
777
+ Type.String({ description: "Fallback: verification summary string" }),
778
+ ]),
764
779
  { description: "Array of verification evidence entries" },
765
- ),
780
+ )),
766
781
  }),
767
782
  execute: taskCompleteExecute,
768
783
  };
@@ -781,8 +796,54 @@ export function registerDbTools(pi: ExtensionAPI): void {
781
796
  };
782
797
  }
783
798
  try {
799
+ // Coerce string items to objects for fields where LLMs sometimes pass
800
+ // plain strings instead of the expected { key, value } shape (#3541).
801
+ // Parses "key — value" or "key - value" format when possible.
802
+ const splitPair = (s: string): [string, string] => {
803
+ const m = s.match(/^(.+?)\s*(?:—|-)\s+(.+)$/);
804
+ return m ? [m[1].trim(), m[2].trim()] : [s.trim(), ""];
805
+ };
806
+ const coerced = { ...params };
807
+ // Coerce simple string-array fields: LLMs sometimes pass a plain string
808
+ // instead of a single-element array (#3585).
809
+ const wrapArray = (v: any): any[] =>
810
+ v == null ? [] : Array.isArray(v) ? v : [v];
811
+ coerced.provides = wrapArray(params.provides);
812
+ coerced.keyFiles = wrapArray(params.keyFiles);
813
+ coerced.keyDecisions = wrapArray(params.keyDecisions);
814
+ coerced.patternsEstablished = wrapArray(params.patternsEstablished);
815
+ coerced.observabilitySurfaces = wrapArray(params.observabilitySurfaces);
816
+ coerced.requirementsSurfaced = wrapArray(params.requirementsSurfaced);
817
+ coerced.drillDownPaths = wrapArray(params.drillDownPaths);
818
+ coerced.affects = wrapArray(params.affects);
819
+ coerced.filesModified = wrapArray(params.filesModified).map((f: any) => {
820
+ if (typeof f !== "string") return f;
821
+ const [path, description] = splitPair(f);
822
+ return { path, description };
823
+ });
824
+ coerced.requires = wrapArray(params.requires).map((r: any) => {
825
+ if (typeof r !== "string") return r;
826
+ const [slice, provides] = splitPair(r);
827
+ return { slice, provides };
828
+ });
829
+ coerced.requirementsAdvanced = wrapArray(params.requirementsAdvanced).map((r: any) => {
830
+ if (typeof r !== "string") return r;
831
+ const [id, how] = splitPair(r);
832
+ return { id, how };
833
+ });
834
+ coerced.requirementsValidated = wrapArray(params.requirementsValidated).map((r: any) => {
835
+ if (typeof r !== "string") return r;
836
+ const [id, proof] = splitPair(r);
837
+ return { id, proof };
838
+ });
839
+ coerced.requirementsInvalidated = wrapArray(params.requirementsInvalidated).map((r: any) => {
840
+ if (typeof r !== "string") return r;
841
+ const [id, what] = splitPair(r);
842
+ return { id, what };
843
+ });
844
+
784
845
  const { handleCompleteSlice } = await import("../tools/complete-slice.js");
785
- const result = await handleCompleteSlice(params, process.cwd());
846
+ const result = await handleCompleteSlice(coerced, process.cwd());
786
847
  if ("error" in result) {
787
848
  return {
788
849
  content: [{ type: "text" as const, text: `Error completing slice: ${result.error}` }],
@@ -823,59 +884,76 @@ export function registerDbTools(pi: ExtensionAPI): void {
823
884
  "Idempotent — calling with the same params twice will not crash.",
824
885
  ],
825
886
  parameters: Type.Object({
887
+ // ── Core identification + content (required) ──────────────────────
826
888
  sliceId: Type.String({ description: "Slice ID (e.g. S01)" }),
827
889
  milestoneId: Type.String({ description: "Milestone ID (e.g. M001)" }),
828
890
  sliceTitle: Type.String({ description: "Title of the slice" }),
829
891
  oneLiner: Type.String({ description: "One-line summary of what the slice accomplished" }),
830
892
  narrative: Type.String({ description: "Detailed narrative of what happened across all tasks" }),
831
893
  verification: Type.String({ description: "What was verified across all tasks" }),
832
- deviations: Type.String({ description: "Deviations from the slice plan, or 'None.'" }),
833
- knownLimitations: Type.String({ description: "Known limitations or gaps, or 'None.'" }),
834
- followUps: Type.String({ description: "Follow-up work discovered during execution, or 'None.'" }),
835
- keyFiles: Type.Array(Type.String(), { description: "Key files created or modified" }),
836
- keyDecisions: Type.Array(Type.String(), { description: "Key decisions made during this slice" }),
837
- patternsEstablished: Type.Array(Type.String(), { description: "Patterns established by this slice" }),
838
- observabilitySurfaces: Type.Array(Type.String(), { description: "Observability surfaces added" }),
839
- provides: Type.Array(Type.String(), { description: "What this slice provides to downstream slices" }),
840
- requirementsSurfaced: Type.Array(Type.String(), { description: "New requirements surfaced" }),
841
- drillDownPaths: Type.Array(Type.String(), { description: "Paths to task summaries for drill-down" }),
842
- affects: Type.Array(Type.String(), { description: "Downstream slices affected" }),
843
- requirementsAdvanced: Type.Array(
844
- Type.Object({
845
- id: Type.String({ description: "Requirement ID" }),
846
- how: Type.String({ description: "How it was advanced" }),
847
- }),
894
+ uatContent: Type.String({ description: "UAT test content (markdown body)" }),
895
+ // ── Enrichment metadata (optional defaults to empty) ────────────
896
+ deviations: Type.Optional(Type.String({ description: "Deviations from the slice plan, or 'None.'" })),
897
+ knownLimitations: Type.Optional(Type.String({ description: "Known limitations or gaps, or 'None.'" })),
898
+ followUps: Type.Optional(Type.String({ description: "Follow-up work discovered during execution, or 'None.'" })),
899
+ keyFiles: Type.Optional(Type.Union([Type.Array(Type.String()), Type.String()], { description: "Key files created or modified" })),
900
+ keyDecisions: Type.Optional(Type.Union([Type.Array(Type.String()), Type.String()], { description: "Key decisions made during this slice" })),
901
+ patternsEstablished: Type.Optional(Type.Union([Type.Array(Type.String()), Type.String()], { description: "Patterns established by this slice" })),
902
+ observabilitySurfaces: Type.Optional(Type.Union([Type.Array(Type.String()), Type.String()], { description: "Observability surfaces added" })),
903
+ provides: Type.Optional(Type.Union([Type.Array(Type.String()), Type.String()], { description: "What this slice provides to downstream slices" })),
904
+ requirementsSurfaced: Type.Optional(Type.Union([Type.Array(Type.String()), Type.String()], { description: "New requirements surfaced" })),
905
+ drillDownPaths: Type.Optional(Type.Union([Type.Array(Type.String()), Type.String()], { description: "Paths to task summaries for drill-down" })),
906
+ affects: Type.Optional(Type.Union([Type.Array(Type.String()), Type.String()], { description: "Downstream slices affected" })),
907
+ requirementsAdvanced: Type.Optional(Type.Array(
908
+ Type.Union([
909
+ Type.Object({
910
+ id: Type.String({ description: "Requirement ID" }),
911
+ how: Type.String({ description: "How it was advanced" }),
912
+ }),
913
+ Type.String({ description: "Fallback: 'ID — how' string" }),
914
+ ]),
848
915
  { description: "Requirements advanced by this slice" },
849
- ),
850
- requirementsValidated: Type.Array(
851
- Type.Object({
852
- id: Type.String({ description: "Requirement ID" }),
853
- proof: Type.String({ description: "What proof validates it" }),
854
- }),
916
+ )),
917
+ requirementsValidated: Type.Optional(Type.Array(
918
+ Type.Union([
919
+ Type.Object({
920
+ id: Type.String({ description: "Requirement ID" }),
921
+ proof: Type.String({ description: "What proof validates it" }),
922
+ }),
923
+ Type.String({ description: "Fallback: 'ID — proof' string" }),
924
+ ]),
855
925
  { description: "Requirements validated by this slice" },
856
- ),
857
- requirementsInvalidated: Type.Array(
858
- Type.Object({
859
- id: Type.String({ description: "Requirement ID" }),
860
- what: Type.String({ description: "What changed" }),
861
- }),
926
+ )),
927
+ requirementsInvalidated: Type.Optional(Type.Array(
928
+ Type.Union([
929
+ Type.Object({
930
+ id: Type.String({ description: "Requirement ID" }),
931
+ what: Type.String({ description: "What changed" }),
932
+ }),
933
+ Type.String({ description: "Fallback: 'ID — what' string" }),
934
+ ]),
862
935
  { description: "Requirements invalidated or re-scoped" },
863
- ),
864
- filesModified: Type.Array(
865
- Type.Object({
866
- path: Type.String({ description: "File path" }),
867
- description: Type.String({ description: "What changed" }),
868
- }),
936
+ )),
937
+ filesModified: Type.Optional(Type.Array(
938
+ Type.Union([
939
+ Type.Object({
940
+ path: Type.String({ description: "File path" }),
941
+ description: Type.String({ description: "What changed" }),
942
+ }),
943
+ Type.String({ description: "Fallback: file path string" }),
944
+ ]),
869
945
  { description: "Files modified with descriptions" },
870
- ),
871
- requires: Type.Array(
872
- Type.Object({
873
- slice: Type.String({ description: "Dependency slice ID" }),
874
- provides: Type.String({ description: "What was consumed from it" }),
875
- }),
946
+ )),
947
+ requires: Type.Optional(Type.Array(
948
+ Type.Union([
949
+ Type.Object({
950
+ slice: Type.String({ description: "Dependency slice ID" }),
951
+ provides: Type.String({ description: "What was consumed from it" }),
952
+ }),
953
+ Type.String({ description: "Fallback: slice ID string" }),
954
+ ]),
876
955
  { description: "Upstream slice dependencies consumed" },
877
- ),
878
- uatContent: Type.String({ description: "UAT test content (markdown body)" }),
956
+ )),
879
957
  }),
880
958
  execute: sliceCompleteExecute,
881
959
  };
@@ -972,8 +1050,12 @@ export function registerDbTools(pi: ExtensionAPI): void {
972
1050
  };
973
1051
  }
974
1052
  try {
1053
+ // ── Input sanitization: normalize markdown parameters (#3013) ──────
1054
+ const { sanitizeCompleteMilestoneParams } = await import("./sanitize-complete-milestone.js");
1055
+ const sanitized = sanitizeCompleteMilestoneParams(params);
1056
+
975
1057
  const { handleCompleteMilestone } = await import("../tools/complete-milestone.js");
976
- const result = await handleCompleteMilestone(params, process.cwd());
1058
+ const result = await handleCompleteMilestone(sanitized, process.cwd());
977
1059
  if ("error" in result) {
978
1060
  return {
979
1061
  content: [{ type: "text" as const, text: `Error completing milestone: ${result.error}` }],
@@ -1012,19 +1094,21 @@ export function registerDbTools(pi: ExtensionAPI): void {
1012
1094
  "On success, returns summaryPath where the MILESTONE-SUMMARY.md was written.",
1013
1095
  ],
1014
1096
  parameters: Type.Object({
1097
+ // ── Core identification + content (required) ──────────────────────
1015
1098
  milestoneId: Type.String({ description: "Milestone ID (e.g. M001)" }),
1016
1099
  title: Type.String({ description: "Milestone title" }),
1017
1100
  oneLiner: Type.String({ description: "One-sentence summary of what the milestone achieved" }),
1018
1101
  narrative: Type.String({ description: "Detailed narrative of what happened during the milestone" }),
1019
- successCriteriaResults: Type.String({ description: "Markdown detailing how each success criterion was met or not met" }),
1020
- definitionOfDoneResults: Type.String({ description: "Markdown detailing how each definition-of-done item was met" }),
1021
- requirementOutcomes: Type.String({ description: "Markdown detailing requirement status transitions with evidence" }),
1022
- keyDecisions: Type.Array(Type.String(), { description: "Key architectural/pattern decisions made during the milestone" }),
1023
- keyFiles: Type.Array(Type.String(), { description: "Key files created or modified during the milestone" }),
1024
- lessonsLearned: Type.Array(Type.String(), { description: "Lessons learned during the milestone" }),
1102
+ verificationPassed: Type.Boolean({ description: "Must be true confirms that code change verification, success criteria, and definition of done checks all passed before completion" }),
1103
+ // ── Enrichment metadata (optional defaults to empty) ────────────
1104
+ successCriteriaResults: Type.Optional(Type.String({ description: "Markdown detailing how each success criterion was met or not met" })),
1105
+ definitionOfDoneResults: Type.Optional(Type.String({ description: "Markdown detailing how each definition-of-done item was met" })),
1106
+ requirementOutcomes: Type.Optional(Type.String({ description: "Markdown detailing requirement status transitions with evidence" })),
1107
+ keyDecisions: Type.Optional(Type.Array(Type.String(), { description: "Key architectural/pattern decisions made during the milestone" })),
1108
+ keyFiles: Type.Optional(Type.Array(Type.String(), { description: "Key files created or modified during the milestone" })),
1109
+ lessonsLearned: Type.Optional(Type.Array(Type.String(), { description: "Lessons learned during the milestone" })),
1025
1110
  followUps: Type.Optional(Type.String({ description: "Follow-up items for future milestones" })),
1026
1111
  deviations: Type.Optional(Type.String({ description: "Deviations from the original plan" })),
1027
- verificationPassed: Type.Boolean({ description: "Must be true — confirms that code change verification, success criteria, and definition of done checks all passed before completion" }),
1028
1112
  }),
1029
1113
  execute: milestoneCompleteExecute,
1030
1114
  };
@@ -32,6 +32,20 @@ export function resolveProjectRootDbPath(basePath: string): string {
32
32
  return join(projectRoot, ".gsd", "gsd.db");
33
33
  }
34
34
 
35
+ // External-state layout: ~/.gsd/projects/<hash>/worktrees/<MID>/...
36
+ // Resolve to ~/.gsd/projects/<hash>/gsd.db (the canonical project DB) (#2952).
37
+ // Must be checked before the generic symlink-resolved handler: both match
38
+ // /.gsd/projects/<hash>/worktrees/ but require different resolution targets.
39
+ const extRe = /[/\\]\.gsd[/\\]projects[/\\][a-f0-9]+[/\\]worktrees(?:[/\\]|$)/;
40
+ const extMatch = extRe.exec(basePath);
41
+ if (extMatch) {
42
+ const matchStr = extMatch[0];
43
+ // Find the "/worktrees" portion within the match and slice up to it
44
+ const wtIdx = matchStr.search(/[/\\]worktrees(?:[/\\]|$)/);
45
+ const projectStateRoot = basePath.slice(0, extMatch.index + wtIdx);
46
+ return join(projectStateRoot, "gsd.db");
47
+ }
48
+
35
49
  // Symlink-resolved layout: /.gsd/projects/<hash>/worktrees/M001/...
36
50
  // The project root is everything before /.gsd/projects/ (#2517)
37
51
  const symlinkMarker = `${sep}.gsd${sep}projects${sep}`;
@@ -57,6 +71,7 @@ export function resolveProjectRootDbPath(basePath: string): string {
57
71
  }
58
72
  }
59
73
 
74
+
60
75
  return join(basePath, ".gsd", "gsd.db");
61
76
  }
62
77
 
@@ -0,0 +1,34 @@
1
+ // GSD Extension — Notify Interceptor
2
+ // Wraps ctx.ui.notify() in-place to persist every notification through the
3
+ // notification store. Uses a WeakSet to prevent double-wrapping and handle
4
+ // UI context replacement on /reload gracefully.
5
+
6
+ import type { ExtensionContext } from "@gsd/pi-coding-agent";
7
+
8
+ import { appendNotification, type NotifySeverity } from "../notification-store.js";
9
+
10
+ // Track which ui context objects have been wrapped to prevent double-install.
11
+ // WeakSet allows GC to collect replaced uiContext instances after /reload.
12
+ const _wrappedContexts = new WeakSet<object>();
13
+
14
+ /**
15
+ * Install the notify interceptor on a context's UI object.
16
+ * Mutates ctx.ui.notify in place — the original is called after persistence.
17
+ * Safe to call multiple times; no-ops if already installed on the same ui object.
18
+ */
19
+ export function installNotifyInterceptor(ctx: ExtensionContext): void {
20
+ if (_wrappedContexts.has(ctx.ui)) return;
21
+
22
+ const originalNotify = ctx.ui.notify.bind(ctx.ui);
23
+
24
+ (ctx.ui as any).notify = (message: string, type?: "info" | "warning" | "error" | "success"): void => {
25
+ try {
26
+ appendNotification(message, (type ?? "info") as NotifySeverity, "notify");
27
+ } catch {
28
+ // Non-fatal — never let persistence break the UI
29
+ }
30
+ originalNotify(message, type);
31
+ };
32
+
33
+ _wrappedContexts.add(ctx.ui);
34
+ }
@@ -0,0 +1,98 @@
1
+ // GSD2 — Read-only query tools exposing DB state to the LLM via the WAL connection
2
+
3
+ import { Type } from "@sinclair/typebox";
4
+ import type { ExtensionAPI } from "@gsd/pi-coding-agent";
5
+
6
+ import { logWarning } from "../workflow-logger.js";
7
+
8
+ export function registerQueryTools(pi: ExtensionAPI): void {
9
+ pi.registerTool({
10
+ name: "gsd_milestone_status",
11
+ label: "Milestone Status",
12
+ description:
13
+ "Read the current status of a milestone and all its slices from the GSD database. " +
14
+ "Returns milestone metadata, per-slice status, and task counts per slice. " +
15
+ "Use this instead of querying .gsd/gsd.db directly via sqlite3 or better-sqlite3.",
16
+ promptSnippet: "Get milestone status, slice statuses, and task counts for a given milestoneId",
17
+ promptGuidelines: [
18
+ "Use this tool — not sqlite3 or better-sqlite3 — to inspect milestone or slice state from the DB.",
19
+ ],
20
+ parameters: Type.Object({
21
+ milestoneId: Type.String({ description: "Milestone ID to query (e.g. M001)" }),
22
+ }),
23
+ async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
24
+ try {
25
+ // Strictly read-only: only use an already-open DB connection.
26
+ // Do NOT call ensureDbOpen() — it can create/migrate the DB as a side effect.
27
+ const {
28
+ isDbAvailable,
29
+ getMilestone,
30
+ getSliceStatusSummary,
31
+ getSliceTaskCounts,
32
+ _getAdapter,
33
+ } = await import("../gsd-db.js");
34
+
35
+ if (!isDbAvailable()) {
36
+ return {
37
+ content: [{ type: "text" as const, text: "Error: GSD database is not available." }],
38
+ details: { operation: "milestone_status", error: "db_unavailable" } as any,
39
+ };
40
+ }
41
+
42
+ // Wrap all reads in a single transaction for snapshot consistency.
43
+ // SQLite WAL mode guarantees reads within a transaction see a single
44
+ // consistent snapshot, preventing torn reads from concurrent writes.
45
+ const adapter = _getAdapter()!;
46
+ adapter.exec("BEGIN"); // eslint-disable-line -- SQLite exec, not child_process
47
+ try {
48
+ const milestone = getMilestone(params.milestoneId);
49
+ if (!milestone) {
50
+ adapter.exec("COMMIT"); // eslint-disable-line
51
+ return {
52
+ content: [{ type: "text" as const, text: `Milestone ${params.milestoneId} not found in database.` }],
53
+ details: { operation: "milestone_status", milestoneId: params.milestoneId, found: false } as any,
54
+ };
55
+ }
56
+
57
+ const sliceStatuses = getSliceStatusSummary(params.milestoneId);
58
+
59
+ const slices = sliceStatuses.map((s) => {
60
+ const counts = getSliceTaskCounts(params.milestoneId, s.id);
61
+ return {
62
+ id: s.id,
63
+ status: s.status,
64
+ taskCounts: counts,
65
+ };
66
+ });
67
+
68
+ adapter.exec("COMMIT"); // eslint-disable-line
69
+
70
+ const result = {
71
+ milestoneId: milestone.id,
72
+ title: milestone.title,
73
+ status: milestone.status,
74
+ createdAt: milestone.created_at,
75
+ completedAt: milestone.completed_at,
76
+ sliceCount: slices.length,
77
+ slices,
78
+ };
79
+
80
+ return {
81
+ content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
82
+ details: { operation: "milestone_status", milestoneId: milestone.id, sliceCount: slices.length } as any,
83
+ };
84
+ } catch (txErr) {
85
+ try { adapter.exec("ROLLBACK"); } catch { /* swallow */ } // eslint-disable-line
86
+ throw txErr;
87
+ }
88
+ } catch (err) {
89
+ const msg = err instanceof Error ? err.message : String(err);
90
+ logWarning("tool", `gsd_milestone_status tool failed: ${msg}`);
91
+ return {
92
+ content: [{ type: "text" as const, text: `Error querying milestone status: ${msg}` }],
93
+ details: { operation: "milestone_status", error: msg } as any,
94
+ };
95
+ }
96
+ },
97
+ });
98
+ }
@@ -1,3 +1,5 @@
1
+ // GSD2 — Extension registration: wires all GSD tools, commands, and hooks into pi
2
+
1
3
  import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
2
4
 
3
5
  import { registerGSDCommand } from "../commands.js";
@@ -6,6 +8,7 @@ import { registerWorktreeCommand } from "../worktree-command.js";
6
8
  import { registerDbTools } from "./db-tools.js";
7
9
  import { registerDynamicTools } from "./dynamic-tools.js";
8
10
  import { registerJournalTools } from "./journal-tools.js";
11
+ import { registerQueryTools } from "./query-tools.js";
9
12
  import { registerHooks } from "./register-hooks.js";
10
13
  import { registerShortcuts } from "./register-shortcuts.js";
11
14
 
@@ -56,6 +59,7 @@ export function registerGsdExtension(pi: ExtensionAPI): void {
56
59
  registerDynamicTools(pi);
57
60
  registerDbTools(pi);
58
61
  registerJournalTools(pi);
62
+ registerQueryTools(pi);
59
63
  registerShortcuts(pi);
60
64
  registerHooks(pi);
61
65
  }
@@ -13,11 +13,17 @@ import { getDiscussionMilestoneId } from "../guided-flow.js";
13
13
  import { loadToolApiKeys } from "../commands-config.js";
14
14
  import { loadFile, saveFile, formatContinue } from "../files.js";
15
15
  import { deriveState } from "../state.js";
16
- import { getAutoDashboardData, isAutoActive, isAutoPaused, markToolEnd, markToolStart } from "../auto.js";
16
+ import { getAutoDashboardData, isAutoActive, isAutoPaused, markToolEnd, markToolStart, recordToolInvocationError } from "../auto.js";
17
17
  import { isParallelActive, shutdownParallel } from "../parallel-orchestrator.js";
18
18
  import { checkToolCallLoop, resetToolCallLoopGuard } from "./tool-call-loop-guard.js";
19
19
  import { saveActivityLog } from "../activity-log.js";
20
20
  import { resetAskUserQuestionsCache } from "../../ask-user-questions.js";
21
+ import { recordToolCall as safetyRecordToolCall, recordToolResult as safetyRecordToolResult } from "../safety/evidence-collector.js";
22
+ import { classifyCommand } from "../safety/destructive-guard.js";
23
+ import { logWarning as safetyLogWarning } from "../workflow-logger.js";
24
+ import { installNotifyInterceptor } from "./notify-interceptor.js";
25
+ import { initNotificationStore } from "../notification-store.js";
26
+ import { initNotificationWidget } from "../notification-widget.js";
21
27
 
22
28
  // Skip the welcome screen on the very first session_start — cli.ts already
23
29
  // printed it before the TUI launched. Only re-print on /clear (subsequent sessions).
@@ -30,6 +36,9 @@ async function syncServiceTierStatus(ctx: ExtensionContext): Promise<void> {
30
36
 
31
37
  export function registerHooks(pi: ExtensionAPI): void {
32
38
  pi.on("session_start", async (_event, ctx) => {
39
+ initNotificationStore(process.cwd());
40
+ installNotifyInterceptor(ctx);
41
+ initNotificationWidget(ctx);
33
42
  resetWriteGateState();
34
43
  resetToolCallLoopGuard();
35
44
  resetAskUserQuestionsCache();
@@ -67,6 +76,8 @@ export function registerHooks(pi: ExtensionAPI): void {
67
76
  });
68
77
 
69
78
  pi.on("session_switch", async (_event, ctx) => {
79
+ initNotificationStore(process.cwd());
80
+ installNotifyInterceptor(ctx);
70
81
  resetWriteGateState();
71
82
  resetToolCallLoopGuard();
72
83
  resetAskUserQuestionsCache();
@@ -203,6 +214,26 @@ export function registerHooks(pi: ExtensionAPI): void {
203
214
  if (result.block) return result;
204
215
  });
205
216
 
217
+ // ── Safety harness: evidence collection + destructive command warnings ──
218
+ pi.on("tool_call", async (event, ctx) => {
219
+ if (!isAutoActive()) return;
220
+ safetyRecordToolCall(event.toolName, event.input as Record<string, unknown>);
221
+
222
+ // Destructive command classification (warn only, never block)
223
+ if (isToolCallEventType("bash", event)) {
224
+ const classification = classifyCommand(event.input.command);
225
+ if (classification.destructive) {
226
+ safetyLogWarning("safety", `destructive command: ${classification.labels.join(", ")}`, {
227
+ command: String(event.input.command).slice(0, 200),
228
+ });
229
+ ctx.ui.notify(
230
+ `Destructive command detected: ${classification.labels.join(", ")}`,
231
+ "warning",
232
+ );
233
+ }
234
+ }
235
+ });
236
+
206
237
  pi.on("tool_result", async (event) => {
207
238
  if (event.toolName !== "ask_user_questions") return;
208
239
  const milestoneId = getDiscussionMilestoneId();
@@ -260,6 +291,18 @@ export function registerHooks(pi: ExtensionAPI): void {
260
291
 
261
292
  pi.on("tool_execution_end", async (event) => {
262
293
  markToolEnd(event.toolCallId);
294
+ // #2883: Capture tool invocation errors (malformed/truncated JSON arguments)
295
+ // so postUnitPreVerification can break the retry loop instead of re-dispatching.
296
+ if (event.isError && event.toolName.startsWith("gsd_")) {
297
+ const errorText = typeof event.result === "string"
298
+ ? event.result
299
+ : (typeof event.result?.content?.[0]?.text === "string" ? event.result.content[0].text : String(event.result));
300
+ recordToolInvocationError(event.toolName, errorText);
301
+ }
302
+ // Safety harness: record tool execution results for evidence cross-referencing
303
+ if (isAutoActive()) {
304
+ safetyRecordToolResult(event.toolCallId, event.toolName, event.result, event.isError);
305
+ }
263
306
  });
264
307
 
265
308
  pi.on("model_select", async (_event, ctx) => {