gsd-pi 2.79.0 → 2.80.0-dev.0aaa4fc17

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 (866) hide show
  1. package/README.md +94 -47
  2. package/dist/loader.js +0 -0
  3. package/dist/resources/.managed-resources-content-hash +1 -1
  4. package/dist/resources/GSD-WORKFLOW.md +2 -2
  5. package/dist/resources/extensions/github-sync/templates.js +90 -74
  6. package/dist/resources/extensions/gsd/auto/contracts.js +1 -0
  7. package/dist/resources/extensions/gsd/auto/custom-verify-retry-store.js +53 -0
  8. package/dist/resources/extensions/gsd/auto/loop.js +394 -520
  9. package/dist/resources/extensions/gsd/auto/orchestrator.js +146 -0
  10. package/dist/resources/extensions/gsd/auto/phases.js +98 -37
  11. package/dist/resources/extensions/gsd/auto/run-unit.js +19 -15
  12. package/dist/resources/extensions/gsd/auto/session.js +8 -0
  13. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-dispatch-outcome.js +12 -0
  14. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-iteration.js +24 -0
  15. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-reconcile-outcome.js +33 -0
  16. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-reconcile.js +26 -0
  17. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-retry.js +49 -0
  18. package/dist/resources/extensions/gsd/auto/workflow-custom-engine-verify-outcome.js +25 -0
  19. package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +48 -0
  20. package/dist/resources/extensions/gsd/auto/workflow-dispatch-ledger.js +26 -0
  21. package/dist/resources/extensions/gsd/auto/workflow-iteration-completion.js +10 -0
  22. package/dist/resources/extensions/gsd/auto/workflow-journal-reporter.js +16 -0
  23. package/dist/resources/extensions/gsd/auto/workflow-kernel.js +263 -0
  24. package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +36 -0
  25. package/dist/resources/extensions/gsd/auto/workflow-phase-reporter.js +9 -0
  26. package/dist/resources/extensions/gsd/auto/workflow-session-lock.js +35 -0
  27. package/dist/resources/extensions/gsd/auto/workflow-sidecar-iteration.js +24 -0
  28. package/dist/resources/extensions/gsd/auto/workflow-sidecar-queue.js +26 -0
  29. package/dist/resources/extensions/gsd/auto/workflow-turn-reporter.js +36 -0
  30. package/dist/resources/extensions/gsd/auto/workflow-unit-dispatch.js +44 -0
  31. package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +15 -0
  32. package/dist/resources/extensions/gsd/auto-artifact-paths.js +2 -2
  33. package/dist/resources/extensions/gsd/auto-dashboard.js +54 -15
  34. package/dist/resources/extensions/gsd/auto-dispatch.js +12 -0
  35. package/dist/resources/extensions/gsd/auto-post-unit.js +10 -10
  36. package/dist/resources/extensions/gsd/auto-prompts.js +331 -33
  37. package/dist/resources/extensions/gsd/auto-recovery.js +216 -62
  38. package/dist/resources/extensions/gsd/auto-runtime-state.js +4 -0
  39. package/dist/resources/extensions/gsd/auto-start.js +4 -4
  40. package/dist/resources/extensions/gsd/auto-verification.js +2 -11
  41. package/dist/resources/extensions/gsd/auto-worktree.js +87 -38
  42. package/dist/resources/extensions/gsd/auto.js +168 -3
  43. package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +24 -2
  44. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +10 -0
  45. package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +2 -2
  46. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +63 -51
  47. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +137 -9
  48. package/dist/resources/extensions/gsd/clean-root-preflight.js +42 -4
  49. package/dist/resources/extensions/gsd/commands/context.js +1 -1
  50. package/dist/resources/extensions/gsd/commands/dispatcher.js +5 -0
  51. package/dist/resources/extensions/gsd/commands-extract-learnings.js +17 -12
  52. package/dist/resources/extensions/gsd/commands-ship.js +23 -46
  53. package/dist/resources/extensions/gsd/commands-workflow-templates.js +12 -7
  54. package/dist/resources/extensions/gsd/component-loader.js +5 -11
  55. package/dist/resources/extensions/gsd/crash-recovery.js +56 -10
  56. package/dist/resources/extensions/gsd/custom-workflow-engine.js +25 -1
  57. package/dist/resources/extensions/gsd/db-adapter.js +47 -0
  58. package/dist/resources/extensions/gsd/db-base-schema.js +351 -0
  59. package/dist/resources/extensions/gsd/db-connection-cache.js +31 -0
  60. package/dist/resources/extensions/gsd/db-coordination-schema.js +104 -0
  61. package/dist/resources/extensions/gsd/db-decision-requirement-rows.js +71 -0
  62. package/dist/resources/extensions/gsd/db-gate-rows.js +16 -0
  63. package/dist/resources/extensions/gsd/db-lightweight-query-rows.js +29 -0
  64. package/dist/resources/extensions/gsd/db-memory-fts-schema.js +56 -0
  65. package/dist/resources/extensions/gsd/db-migration-backup.js +22 -0
  66. package/dist/resources/extensions/gsd/db-migration-steps.js +410 -0
  67. package/dist/resources/extensions/gsd/db-milestone-artifact-rows.js +35 -0
  68. package/dist/resources/extensions/gsd/db-open-state.js +32 -0
  69. package/dist/resources/extensions/gsd/db-provider.js +108 -0
  70. package/dist/resources/extensions/gsd/db-runtime-kv-schema.js +27 -0
  71. package/dist/resources/extensions/gsd/db-schema-metadata.js +23 -0
  72. package/dist/resources/extensions/gsd/db-task-slice-rows.js +86 -0
  73. package/dist/resources/extensions/gsd/db-transaction.js +63 -0
  74. package/dist/resources/extensions/gsd/db-verification-evidence-rows.js +3 -0
  75. package/dist/resources/extensions/gsd/db-verification-evidence-schema.js +19 -0
  76. package/dist/resources/extensions/gsd/detection.js +106 -0
  77. package/dist/resources/extensions/gsd/escalation.js +2 -0
  78. package/dist/resources/extensions/gsd/graph.js +9 -3
  79. package/dist/resources/extensions/gsd/gsd-db.js +316 -1520
  80. package/dist/resources/extensions/gsd/guided-flow.js +103 -12
  81. package/dist/resources/extensions/gsd/legacy-telemetry.js +70 -0
  82. package/dist/resources/extensions/gsd/markdown-renderer.js +2 -0
  83. package/dist/resources/extensions/gsd/migrate/command.js +40 -1
  84. package/dist/resources/extensions/gsd/migration-auto-check.js +87 -0
  85. package/dist/resources/extensions/gsd/model-router.js +9 -6
  86. package/dist/resources/extensions/gsd/notification-widget.js +21 -3
  87. package/dist/resources/extensions/gsd/paths.js +5 -1
  88. package/dist/resources/extensions/gsd/planning-path-scope.js +26 -0
  89. package/dist/resources/extensions/gsd/post-execution-checks.js +27 -6
  90. package/dist/resources/extensions/gsd/pr-evidence.js +117 -0
  91. package/dist/resources/extensions/gsd/pre-execution-checks.js +2 -0
  92. package/dist/resources/extensions/gsd/preferences-types.js +20 -2
  93. package/dist/resources/extensions/gsd/preferences-validation.js +3 -3
  94. package/dist/resources/extensions/gsd/process-task-path.js +61 -0
  95. package/dist/resources/extensions/gsd/prompt-loader.js +9 -5
  96. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +32 -31
  97. package/dist/resources/extensions/gsd/prompts/complete-slice.md +23 -34
  98. package/dist/resources/extensions/gsd/prompts/discuss-headless.md +50 -96
  99. package/dist/resources/extensions/gsd/prompts/discuss.md +81 -181
  100. package/dist/resources/extensions/gsd/prompts/execute-task.md +40 -67
  101. package/dist/resources/extensions/gsd/prompts/forensics.md +41 -84
  102. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +29 -39
  103. package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +30 -65
  104. package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +25 -52
  105. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +36 -36
  106. package/dist/resources/extensions/gsd/prompts/guided-research-project.md +20 -38
  107. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +47 -59
  108. package/dist/resources/extensions/gsd/prompts/plan-slice.md +25 -87
  109. package/dist/resources/extensions/gsd/prompts/queue.md +46 -53
  110. package/dist/resources/extensions/gsd/prompts/refine-slice.md +23 -23
  111. package/dist/resources/extensions/gsd/prompts/research-slice.md +23 -23
  112. package/dist/resources/extensions/gsd/prompts/rethink.md +10 -10
  113. package/dist/resources/extensions/gsd/prompts/system.md +65 -107
  114. package/dist/resources/extensions/gsd/prompts/triage-captures.md +15 -15
  115. package/dist/resources/extensions/gsd/prompts/validate-milestone.md +24 -24
  116. package/dist/resources/extensions/gsd/prompts/worktree-merge.md +35 -35
  117. package/dist/resources/extensions/gsd/safety/evidence-collector.js +10 -2
  118. package/dist/resources/extensions/gsd/state.js +4 -0
  119. package/dist/resources/extensions/gsd/tools/complete-milestone.js +14 -9
  120. package/dist/resources/extensions/gsd/tools/complete-task.js +2 -0
  121. package/dist/resources/extensions/gsd/tools/plan-slice.js +9 -0
  122. package/dist/resources/extensions/gsd/tools/plan-task.js +9 -0
  123. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +88 -3
  124. package/dist/resources/extensions/gsd/unit-context-composer.js +32 -0
  125. package/dist/resources/extensions/gsd/unit-context-manifest.js +21 -0
  126. package/dist/resources/extensions/gsd/unit-runtime.js +11 -0
  127. package/dist/resources/extensions/gsd/uok/audit.js +23 -9
  128. package/dist/resources/extensions/gsd/uok/contracts.js +69 -1
  129. package/dist/resources/extensions/gsd/uok/dispatch-envelope.js +3 -0
  130. package/dist/resources/extensions/gsd/uok/kernel.js +8 -3
  131. package/dist/resources/extensions/gsd/uok/loop-adapter.js +48 -33
  132. package/dist/resources/extensions/gsd/uok/plan-v2.js +2 -0
  133. package/dist/resources/extensions/gsd/uok/timeline.js +125 -0
  134. package/dist/resources/extensions/gsd/workflow-logger.js +13 -13
  135. package/dist/resources/extensions/gsd/workflow-manifest.js +2 -0
  136. package/dist/resources/extensions/gsd/workflow-projections.js +2 -0
  137. package/dist/resources/extensions/gsd/workflow-templates.js +9 -0
  138. package/dist/resources/extensions/gsd/working-output-messages.js +64 -0
  139. package/dist/resources/extensions/gsd/worktree-manager.js +16 -14
  140. package/dist/resources/extensions/shared/gsd-phase-state.js +45 -3
  141. package/dist/resources/extensions/shared/interview-ui.js +15 -4
  142. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  143. package/dist/web/standalone/.next/BUILD_ID +1 -1
  144. package/dist/web/standalone/.next/app-path-routes-manifest.json +12 -12
  145. package/dist/web/standalone/.next/build-manifest.json +4 -4
  146. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  147. package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
  148. package/dist/web/standalone/.next/required-server-files.json +4 -4
  149. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  150. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  151. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  152. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  153. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  154. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  155. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  156. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  157. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  158. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  159. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  160. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  161. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  162. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  163. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  164. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  165. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  166. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  167. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  168. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  169. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +1 -1
  171. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js.nft.json +1 -1
  174. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js.nft.json +1 -1
  177. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  179. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js.nft.json +1 -1
  180. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  184. package/dist/web/standalone/.next/server/app/api/captures/route.js.nft.json +1 -1
  185. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  186. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/cleanup/route.js.nft.json +1 -1
  188. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  192. package/dist/web/standalone/.next/server/app/api/doctor/route.js.nft.json +1 -1
  193. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  194. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  195. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  196. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  197. package/dist/web/standalone/.next/server/app/api/export-data/route.js.nft.json +1 -1
  198. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  199. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  200. package/dist/web/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  201. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  202. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  203. package/dist/web/standalone/.next/server/app/api/forensics/route.js.nft.json +1 -1
  204. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  205. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  206. package/dist/web/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  207. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  208. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  209. package/dist/web/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  210. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  211. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  212. package/dist/web/standalone/.next/server/app/api/hooks/route.js.nft.json +1 -1
  213. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  214. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  215. package/dist/web/standalone/.next/server/app/api/inspect/route.js.nft.json +1 -1
  216. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  217. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  218. package/dist/web/standalone/.next/server/app/api/knowledge/route.js.nft.json +1 -1
  219. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  220. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  221. package/dist/web/standalone/.next/server/app/api/live-state/route.js.nft.json +1 -1
  222. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  223. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  224. package/dist/web/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
  225. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  226. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  227. package/dist/web/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -1
  228. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  229. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  230. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  231. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  232. package/dist/web/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  233. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  234. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  235. package/dist/web/standalone/.next/server/app/api/recovery/route.js.nft.json +1 -1
  236. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  237. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  238. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  239. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  240. package/dist/web/standalone/.next/server/app/api/session/browser/route.js.nft.json +1 -1
  241. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  242. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  243. package/dist/web/standalone/.next/server/app/api/session/command/route.js.nft.json +1 -1
  244. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  245. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  246. package/dist/web/standalone/.next/server/app/api/session/events/route.js.nft.json +1 -1
  247. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  248. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  249. package/dist/web/standalone/.next/server/app/api/session/manage/route.js.nft.json +1 -1
  250. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  251. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  252. package/dist/web/standalone/.next/server/app/api/settings-data/route.js.nft.json +1 -1
  253. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  254. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  255. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  256. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  257. package/dist/web/standalone/.next/server/app/api/skill-health/route.js.nft.json +1 -1
  258. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  259. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  260. package/dist/web/standalone/.next/server/app/api/steer/route.js.nft.json +1 -1
  261. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  262. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  263. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -1
  264. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  265. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  266. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  267. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  268. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  269. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  270. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js.nft.json +1 -1
  271. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  272. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +2 -2
  273. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  274. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  275. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  276. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  277. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  278. package/dist/web/standalone/.next/server/app/api/undo/route.js.nft.json +1 -1
  279. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  280. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  281. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  282. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  283. package/dist/web/standalone/.next/server/app/api/visualizer/route.js.nft.json +1 -1
  284. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  285. package/dist/web/standalone/.next/server/app/index.html +1 -1
  286. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  287. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  288. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  289. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  290. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  291. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  292. package/dist/web/standalone/.next/server/app/page.js +2 -2
  293. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  294. package/dist/web/standalone/.next/server/app-paths-manifest.json +12 -12
  295. package/dist/web/standalone/.next/server/chunks/167.js +2 -0
  296. package/dist/web/standalone/.next/server/chunks/63.js +3 -3
  297. package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
  298. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  299. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  300. package/dist/web/standalone/.next/server/middleware.js +2 -2
  301. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  302. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  303. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  304. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  305. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  306. package/dist/web/standalone/.next/static/chunks/{8336.6f6f30e410419aff.js → 8336.631939fb583761fa.js} +1 -1
  307. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  308. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  309. package/dist/web/standalone/.next/static/chunks/app/page-fab3ebb85b006001.js +1 -0
  310. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.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/{webpack-d82dbee6356c1733.js → webpack-0481f1221120a7c6.js} +1 -1
  313. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  314. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  315. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  316. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  317. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  318. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  319. package/dist/web/standalone/package.json +1 -0
  320. package/dist/web/standalone/server.js +1 -1
  321. package/package.json +18 -7
  322. package/packages/contracts/dist/index.d.ts +3 -0
  323. package/packages/contracts/dist/index.d.ts.map +1 -0
  324. package/packages/contracts/dist/index.js +5 -0
  325. package/packages/contracts/dist/index.js.map +1 -0
  326. package/packages/contracts/dist/rpc.d.ts +549 -0
  327. package/packages/contracts/dist/rpc.d.ts.map +1 -0
  328. package/packages/contracts/dist/rpc.js +53 -0
  329. package/packages/contracts/dist/rpc.js.map +1 -0
  330. package/packages/contracts/dist/rpc.test.d.ts +2 -0
  331. package/packages/contracts/dist/rpc.test.d.ts.map +1 -0
  332. package/packages/contracts/dist/rpc.test.js +47 -0
  333. package/packages/contracts/dist/rpc.test.js.map +1 -0
  334. package/packages/contracts/dist/workflow.d.ts +180 -0
  335. package/packages/contracts/dist/workflow.d.ts.map +1 -0
  336. package/packages/contracts/dist/workflow.js +201 -0
  337. package/packages/contracts/dist/workflow.js.map +1 -0
  338. package/packages/contracts/package.json +39 -0
  339. package/packages/contracts/src/index.ts +5 -0
  340. package/packages/contracts/src/rpc.test.ts +72 -0
  341. package/packages/contracts/src/rpc.ts +286 -0
  342. package/packages/contracts/src/workflow.ts +213 -0
  343. package/packages/contracts/tsconfig.json +25 -0
  344. package/packages/daemon/package.json +3 -2
  345. package/packages/daemon/src/event-bridge.test.ts +2 -1
  346. package/packages/daemon/src/event-bridge.ts +1 -1
  347. package/packages/daemon/src/event-formatter.test.ts +1 -2
  348. package/packages/daemon/src/event-formatter.ts +1 -2
  349. package/packages/daemon/src/session-manager.ts +2 -2
  350. package/packages/daemon/src/types.ts +3 -18
  351. package/packages/mcp-server/dist/server.d.ts +13 -0
  352. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  353. package/packages/mcp-server/dist/server.js +77 -0
  354. package/packages/mcp-server/dist/server.js.map +1 -1
  355. package/packages/mcp-server/dist/session-manager.js +1 -1
  356. package/packages/mcp-server/dist/session-manager.js.map +1 -1
  357. package/packages/mcp-server/dist/types.d.ts +3 -11
  358. package/packages/mcp-server/dist/types.d.ts.map +1 -1
  359. package/packages/mcp-server/dist/types.js.map +1 -1
  360. package/packages/mcp-server/dist/workflow-tools.d.ts +1 -1
  361. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  362. package/packages/mcp-server/dist/workflow-tools.js +52 -37
  363. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  364. package/packages/mcp-server/package.json +3 -2
  365. package/packages/mcp-server/src/mcp-server.test.ts +138 -0
  366. package/packages/mcp-server/src/server.ts +99 -1
  367. package/packages/mcp-server/src/session-manager.ts +2 -2
  368. package/packages/mcp-server/src/types.ts +7 -18
  369. package/packages/mcp-server/src/workflow-tools.test.ts +129 -2
  370. package/packages/mcp-server/src/workflow-tools.ts +80 -37
  371. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
  372. package/packages/native/package.json +1 -1
  373. package/packages/pi-agent-core/package.json +1 -1
  374. package/packages/pi-ai/dist/models/fake-model.d.ts +12 -0
  375. package/packages/pi-ai/dist/models/fake-model.d.ts.map +1 -0
  376. package/packages/pi-ai/dist/models/fake-model.js +27 -0
  377. package/packages/pi-ai/dist/models/fake-model.js.map +1 -0
  378. package/packages/pi-ai/dist/models/index.d.ts.map +1 -1
  379. package/packages/pi-ai/dist/models/index.js +8 -0
  380. package/packages/pi-ai/dist/models/index.js.map +1 -1
  381. package/packages/pi-ai/dist/providers/fake.d.ts +42 -0
  382. package/packages/pi-ai/dist/providers/fake.d.ts.map +1 -0
  383. package/packages/pi-ai/dist/providers/fake.js +319 -0
  384. package/packages/pi-ai/dist/providers/fake.js.map +1 -0
  385. package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
  386. package/packages/pi-ai/dist/providers/register-builtins.js +24 -0
  387. package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -1
  388. package/packages/pi-ai/package.json +1 -1
  389. package/packages/pi-ai/src/models/fake-model.ts +30 -0
  390. package/packages/pi-ai/src/models/index.ts +9 -0
  391. package/packages/pi-ai/src/providers/fake.ts +376 -0
  392. package/packages/pi-ai/src/providers/register-builtins.ts +23 -0
  393. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
  394. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +74 -0
  395. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
  396. package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts +15 -0
  397. package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts.map +1 -0
  398. package/packages/pi-coding-agent/dist/core/db-snapshot.js +66 -0
  399. package/packages/pi-coding-agent/dist/core/db-snapshot.js.map +1 -0
  400. package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts +2 -0
  401. package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts.map +1 -0
  402. package/packages/pi-coding-agent/dist/core/db-snapshot.test.js +24 -0
  403. package/packages/pi-coding-agent/dist/core/db-snapshot.test.js.map +1 -0
  404. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +2 -0
  405. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  406. package/packages/pi-coding-agent/dist/core/extensions/runner.js +14 -1
  407. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  408. package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +97 -0
  409. package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
  410. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  411. package/packages/pi-coding-agent/dist/core/model-registry.js +5 -0
  412. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  413. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +4 -0
  414. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  415. package/packages/pi-coding-agent/dist/core/settings-manager.js +8 -0
  416. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  417. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  418. package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
  419. package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  420. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js +6 -4
  421. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -1
  422. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +67 -14
  423. package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
  424. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +26 -0
  425. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -0
  426. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +112 -0
  427. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -0
  428. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts +2 -0
  429. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts.map +1 -0
  430. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +51 -0
  431. package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -0
  432. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  433. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
  434. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
  435. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +10 -9
  436. package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
  437. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +3 -0
  438. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  439. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +11 -0
  440. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  441. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +27 -6
  442. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
  443. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +16 -0
  444. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  445. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +112 -18
  446. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  447. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  448. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +60 -1
  449. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  450. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +40 -1
  451. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
  452. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +1 -0
  453. package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
  454. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +1 -0
  455. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
  456. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
  457. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +12 -1
  458. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  459. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +54 -10
  460. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  461. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
  462. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +20 -0
  463. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
  464. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts +2 -0
  465. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts.map +1 -0
  466. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js +79 -0
  467. package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js.map +1 -0
  468. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
  469. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
  470. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +13 -0
  471. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -1
  472. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -1
  473. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  474. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +18 -1
  475. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  476. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  477. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +36 -27
  478. package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
  479. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts +11 -0
  480. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts.map +1 -0
  481. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js +18 -0
  482. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js.map +1 -0
  483. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts +2 -0
  484. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts.map +1 -0
  485. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +48 -0
  486. package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -0
  487. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +1 -512
  488. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  489. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js +3 -7
  490. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
  491. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts +2 -0
  492. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts.map +1 -0
  493. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +10 -0
  494. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -0
  495. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
  496. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +3 -2
  497. package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
  498. package/packages/pi-coding-agent/package.json +2 -1
  499. package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +87 -0
  500. package/packages/pi-coding-agent/src/core/db-snapshot.test.ts +32 -0
  501. package/packages/pi-coding-agent/src/core/db-snapshot.ts +66 -0
  502. package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +108 -0
  503. package/packages/pi-coding-agent/src/core/extensions/runner.ts +16 -1
  504. package/packages/pi-coding-agent/src/core/model-registry.ts +4 -0
  505. package/packages/pi-coding-agent/src/core/settings-manager.ts +12 -0
  506. package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
  507. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.ts +7 -5
  508. package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +100 -16
  509. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +59 -0
  510. package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +160 -0
  511. package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +1 -0
  512. package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +10 -9
  513. package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +15 -0
  514. package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +41 -9
  515. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +124 -18
  516. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +43 -1
  517. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +75 -1
  518. package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +1 -0
  519. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -1
  520. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +75 -9
  521. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.test.ts +95 -0
  522. package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +24 -1
  523. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +13 -0
  524. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +32 -2
  525. package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +36 -27
  526. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +65 -0
  527. package/packages/pi-coding-agent/src/modes/interactive/tui-mode.ts +29 -0
  528. package/packages/pi-coding-agent/src/modes/rpc/rpc-types.ts +3 -336
  529. package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +14 -0
  530. package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +3 -2
  531. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
  532. package/packages/pi-tui/dist/__tests__/style.test.d.ts +2 -0
  533. package/packages/pi-tui/dist/__tests__/style.test.d.ts.map +1 -0
  534. package/packages/pi-tui/dist/__tests__/style.test.js +63 -0
  535. package/packages/pi-tui/dist/__tests__/style.test.js.map +1 -0
  536. package/packages/pi-tui/dist/__tests__/tui.test.js +24 -3
  537. package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
  538. package/packages/pi-tui/dist/index.d.ts +1 -0
  539. package/packages/pi-tui/dist/index.d.ts.map +1 -1
  540. package/packages/pi-tui/dist/index.js +2 -0
  541. package/packages/pi-tui/dist/index.js.map +1 -1
  542. package/packages/pi-tui/dist/style.d.ts +41 -0
  543. package/packages/pi-tui/dist/style.d.ts.map +1 -0
  544. package/packages/pi-tui/dist/style.js +158 -0
  545. package/packages/pi-tui/dist/style.js.map +1 -0
  546. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  547. package/packages/pi-tui/dist/tui.js +1 -0
  548. package/packages/pi-tui/dist/tui.js.map +1 -1
  549. package/packages/pi-tui/package.json +1 -1
  550. package/packages/pi-tui/src/__tests__/style.test.ts +76 -0
  551. package/packages/pi-tui/src/__tests__/tui.test.ts +29 -3
  552. package/packages/pi-tui/src/index.ts +9 -0
  553. package/packages/pi-tui/src/style.ts +225 -0
  554. package/packages/pi-tui/src/tui.ts +1 -0
  555. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
  556. package/packages/rpc-client/README.md +3 -3
  557. package/packages/rpc-client/dist/index.d.ts +1 -1
  558. package/packages/rpc-client/dist/index.d.ts.map +1 -1
  559. package/packages/rpc-client/dist/index.js.map +1 -1
  560. package/packages/rpc-client/dist/rpc-client.d.ts +2 -6
  561. package/packages/rpc-client/dist/rpc-client.d.ts.map +1 -1
  562. package/packages/rpc-client/dist/rpc-client.js.map +1 -1
  563. package/packages/rpc-client/dist/rpc-types.d.ts +1 -565
  564. package/packages/rpc-client/dist/rpc-types.d.ts.map +1 -1
  565. package/packages/rpc-client/dist/rpc-types.js +3 -11
  566. package/packages/rpc-client/dist/rpc-types.js.map +1 -1
  567. package/packages/rpc-client/package.json +4 -1
  568. package/packages/rpc-client/src/index.ts +1 -1
  569. package/packages/rpc-client/src/rpc-client.ts +3 -6
  570. package/packages/rpc-client/src/rpc-types.ts +3 -398
  571. package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
  572. package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
  573. package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
  574. package/pkg/dist/modes/interactive/theme/theme-schema.js +13 -0
  575. package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -1
  576. package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -1
  577. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  578. package/pkg/dist/modes/interactive/theme/theme.js +18 -1
  579. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  580. package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
  581. package/pkg/dist/modes/interactive/theme/themes.js +36 -27
  582. package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
  583. package/pkg/package.json +1 -1
  584. package/src/resources/GSD-WORKFLOW.md +2 -2
  585. package/src/resources/extensions/github-sync/templates.ts +93 -88
  586. package/src/resources/extensions/github-sync/tests/inline-code.test.ts +66 -0
  587. package/src/resources/extensions/github-sync/tests/templates.test.ts +10 -2
  588. package/src/resources/extensions/gsd/auto/contracts.ts +87 -0
  589. package/src/resources/extensions/gsd/auto/custom-verify-retry-store.ts +72 -0
  590. package/src/resources/extensions/gsd/auto/loop-deps.ts +11 -3
  591. package/src/resources/extensions/gsd/auto/loop.ts +461 -599
  592. package/src/resources/extensions/gsd/auto/orchestrator.ts +161 -0
  593. package/src/resources/extensions/gsd/auto/phases.ts +130 -37
  594. package/src/resources/extensions/gsd/auto/run-unit.ts +24 -14
  595. package/src/resources/extensions/gsd/auto/session.ts +11 -0
  596. package/src/resources/extensions/gsd/auto/workflow-custom-engine-dispatch-outcome.ts +28 -0
  597. package/src/resources/extensions/gsd/auto/workflow-custom-engine-iteration.ts +52 -0
  598. package/src/resources/extensions/gsd/auto/workflow-custom-engine-reconcile-outcome.ts +58 -0
  599. package/src/resources/extensions/gsd/auto/workflow-custom-engine-reconcile.ts +71 -0
  600. package/src/resources/extensions/gsd/auto/workflow-custom-engine-retry.ts +90 -0
  601. package/src/resources/extensions/gsd/auto/workflow-custom-engine-verify-outcome.ts +50 -0
  602. package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +97 -0
  603. package/src/resources/extensions/gsd/auto/workflow-dispatch-ledger.ts +45 -0
  604. package/src/resources/extensions/gsd/auto/workflow-iteration-completion.ts +26 -0
  605. package/src/resources/extensions/gsd/auto/workflow-journal-reporter.ts +33 -0
  606. package/src/resources/extensions/gsd/auto/workflow-kernel.ts +520 -0
  607. package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +58 -0
  608. package/src/resources/extensions/gsd/auto/workflow-phase-reporter.ts +22 -0
  609. package/src/resources/extensions/gsd/auto/workflow-session-lock.ts +68 -0
  610. package/src/resources/extensions/gsd/auto/workflow-sidecar-iteration.ts +46 -0
  611. package/src/resources/extensions/gsd/auto/workflow-sidecar-queue.ts +46 -0
  612. package/src/resources/extensions/gsd/auto/workflow-turn-reporter.ts +68 -0
  613. package/src/resources/extensions/gsd/auto/workflow-unit-dispatch.ts +89 -0
  614. package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +38 -0
  615. package/src/resources/extensions/gsd/auto-artifact-paths.ts +2 -2
  616. package/src/resources/extensions/gsd/auto-dashboard.ts +61 -8
  617. package/src/resources/extensions/gsd/auto-dispatch.ts +18 -0
  618. package/src/resources/extensions/gsd/auto-post-unit.ts +10 -10
  619. package/src/resources/extensions/gsd/auto-prompts.ts +392 -32
  620. package/src/resources/extensions/gsd/auto-recovery.ts +211 -59
  621. package/src/resources/extensions/gsd/auto-runtime-state.ts +7 -0
  622. package/src/resources/extensions/gsd/auto-start.ts +9 -7
  623. package/src/resources/extensions/gsd/auto-verification.ts +5 -1
  624. package/src/resources/extensions/gsd/auto-worktree.ts +85 -36
  625. package/src/resources/extensions/gsd/auto.ts +179 -2
  626. package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +30 -2
  627. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +11 -0
  628. package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +2 -2
  629. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +79 -52
  630. package/src/resources/extensions/gsd/bootstrap/tests/write-gate-shouldblock-basepath.test.ts +97 -0
  631. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +143 -5
  632. package/src/resources/extensions/gsd/clean-root-preflight.ts +41 -3
  633. package/src/resources/extensions/gsd/commands/context.ts +1 -1
  634. package/src/resources/extensions/gsd/commands/dispatcher.ts +6 -0
  635. package/src/resources/extensions/gsd/commands-extract-learnings.ts +17 -12
  636. package/src/resources/extensions/gsd/commands-ship.ts +24 -51
  637. package/src/resources/extensions/gsd/commands-workflow-templates.ts +13 -0
  638. package/src/resources/extensions/gsd/component-loader.ts +5 -11
  639. package/src/resources/extensions/gsd/crash-recovery.ts +67 -10
  640. package/src/resources/extensions/gsd/custom-workflow-engine.ts +29 -0
  641. package/src/resources/extensions/gsd/db-adapter.ts +75 -0
  642. package/src/resources/extensions/gsd/db-base-schema.ts +383 -0
  643. package/src/resources/extensions/gsd/db-connection-cache.ts +45 -0
  644. package/src/resources/extensions/gsd/db-coordination-schema.ts +109 -0
  645. package/src/resources/extensions/gsd/db-decision-requirement-rows.ts +77 -0
  646. package/src/resources/extensions/gsd/db-gate-rows.ts +19 -0
  647. package/src/resources/extensions/gsd/db-lightweight-query-rows.ts +50 -0
  648. package/src/resources/extensions/gsd/db-memory-fts-schema.ts +66 -0
  649. package/src/resources/extensions/gsd/db-migration-backup.ts +34 -0
  650. package/src/resources/extensions/gsd/db-migration-steps.ts +451 -0
  651. package/src/resources/extensions/gsd/db-milestone-artifact-rows.ts +70 -0
  652. package/src/resources/extensions/gsd/db-open-state.ts +47 -0
  653. package/src/resources/extensions/gsd/db-provider.ts +148 -0
  654. package/src/resources/extensions/gsd/db-runtime-kv-schema.ts +30 -0
  655. package/src/resources/extensions/gsd/db-schema-metadata.ts +33 -0
  656. package/src/resources/extensions/gsd/db-task-slice-rows.ts +146 -0
  657. package/src/resources/extensions/gsd/db-transaction.ts +76 -0
  658. package/src/resources/extensions/gsd/db-verification-evidence-rows.ts +14 -0
  659. package/src/resources/extensions/gsd/db-verification-evidence-schema.ts +22 -0
  660. package/src/resources/extensions/gsd/detection.ts +128 -0
  661. package/src/resources/extensions/gsd/escalation.ts +3 -1
  662. package/src/resources/extensions/gsd/graph.ts +12 -5
  663. package/src/resources/extensions/gsd/gsd-db.ts +379 -1660
  664. package/src/resources/extensions/gsd/guided-flow.ts +113 -12
  665. package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
  666. package/src/resources/extensions/gsd/legacy-telemetry.ts +99 -0
  667. package/src/resources/extensions/gsd/markdown-renderer.ts +4 -1
  668. package/src/resources/extensions/gsd/migrate/command.ts +47 -1
  669. package/src/resources/extensions/gsd/migration-auto-check.ts +129 -0
  670. package/src/resources/extensions/gsd/model-router.ts +10 -6
  671. package/src/resources/extensions/gsd/notification-widget.ts +25 -4
  672. package/src/resources/extensions/gsd/paths.ts +6 -1
  673. package/src/resources/extensions/gsd/planning-path-scope.ts +35 -0
  674. package/src/resources/extensions/gsd/post-execution-checks.ts +35 -7
  675. package/src/resources/extensions/gsd/pr-evidence.ts +182 -0
  676. package/src/resources/extensions/gsd/pre-execution-checks.ts +4 -1
  677. package/src/resources/extensions/gsd/preferences-types.ts +23 -4
  678. package/src/resources/extensions/gsd/preferences-validation.ts +3 -3
  679. package/src/resources/extensions/gsd/process-task-path.ts +81 -0
  680. package/src/resources/extensions/gsd/prompt-loader.ts +9 -5
  681. package/src/resources/extensions/gsd/prompts/complete-milestone.md +32 -31
  682. package/src/resources/extensions/gsd/prompts/complete-slice.md +23 -34
  683. package/src/resources/extensions/gsd/prompts/discuss-headless.md +50 -96
  684. package/src/resources/extensions/gsd/prompts/discuss.md +81 -181
  685. package/src/resources/extensions/gsd/prompts/execute-task.md +40 -67
  686. package/src/resources/extensions/gsd/prompts/forensics.md +41 -84
  687. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +29 -39
  688. package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +30 -65
  689. package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +25 -52
  690. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +36 -36
  691. package/src/resources/extensions/gsd/prompts/guided-research-project.md +20 -38
  692. package/src/resources/extensions/gsd/prompts/plan-milestone.md +47 -59
  693. package/src/resources/extensions/gsd/prompts/plan-slice.md +25 -87
  694. package/src/resources/extensions/gsd/prompts/queue.md +46 -53
  695. package/src/resources/extensions/gsd/prompts/refine-slice.md +23 -23
  696. package/src/resources/extensions/gsd/prompts/research-slice.md +23 -23
  697. package/src/resources/extensions/gsd/prompts/rethink.md +10 -10
  698. package/src/resources/extensions/gsd/prompts/system.md +65 -107
  699. package/src/resources/extensions/gsd/prompts/triage-captures.md +15 -15
  700. package/src/resources/extensions/gsd/prompts/validate-milestone.md +24 -24
  701. package/src/resources/extensions/gsd/prompts/worktree-merge.md +35 -35
  702. package/src/resources/extensions/gsd/safety/evidence-collector.ts +11 -2
  703. package/src/resources/extensions/gsd/state.ts +6 -3
  704. package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +38 -0
  705. package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +98 -0
  706. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +118 -1
  707. package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +353 -0
  708. package/src/resources/extensions/gsd/tests/auto-pr-bugs.test.ts +19 -0
  709. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +277 -1
  710. package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +39 -0
  711. package/src/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +3 -0
  712. package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +2 -2
  713. package/src/resources/extensions/gsd/tests/check-auto-start-pending-gate.test.ts +203 -0
  714. package/src/resources/extensions/gsd/tests/check-auto-start-ready-guard.test.ts +148 -0
  715. package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +88 -2
  716. package/src/resources/extensions/gsd/tests/commands-eval-review.test.ts +2 -2
  717. package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +9 -0
  718. package/src/resources/extensions/gsd/tests/commands-ship-eval-warn.test.ts +3 -2
  719. package/src/resources/extensions/gsd/tests/complete-milestone-prompt-rendering.test.ts +47 -0
  720. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +19 -5
  721. package/src/resources/extensions/gsd/tests/component-loader.test.ts +2 -9
  722. package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +55 -0
  723. package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +22 -0
  724. package/src/resources/extensions/gsd/tests/current-directory-root-homedir-fallback.test.ts +63 -0
  725. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +144 -0
  726. package/src/resources/extensions/gsd/tests/custom-verify-retry-store.test.ts +139 -0
  727. package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +50 -0
  728. package/src/resources/extensions/gsd/tests/dashboard-custom-engine.test.ts +3 -3
  729. package/src/resources/extensions/gsd/tests/db-adapter.test.ts +82 -0
  730. package/src/resources/extensions/gsd/tests/db-base-schema.test.ts +62 -0
  731. package/src/resources/extensions/gsd/tests/db-connection-cache.test.ts +60 -0
  732. package/src/resources/extensions/gsd/tests/db-coordination-schema.test.ts +39 -0
  733. package/src/resources/extensions/gsd/tests/db-decision-requirement-rows.test.ts +135 -0
  734. package/src/resources/extensions/gsd/tests/db-gate-rows.test.ts +53 -0
  735. package/src/resources/extensions/gsd/tests/db-lightweight-query-rows.test.ts +45 -0
  736. package/src/resources/extensions/gsd/tests/db-memory-fts-schema.test.ts +86 -0
  737. package/src/resources/extensions/gsd/tests/db-migration-backup.test.ts +105 -0
  738. package/src/resources/extensions/gsd/tests/db-migration-steps.integration.test.ts +428 -0
  739. package/src/resources/extensions/gsd/tests/db-migration-steps.test.ts +159 -0
  740. package/src/resources/extensions/gsd/tests/db-milestone-artifact-rows.test.ts +53 -0
  741. package/src/resources/extensions/gsd/tests/db-open-state.test.ts +56 -0
  742. package/src/resources/extensions/gsd/tests/db-provider.test.ts +105 -0
  743. package/src/resources/extensions/gsd/tests/db-runtime-kv-schema.test.ts +37 -0
  744. package/src/resources/extensions/gsd/tests/db-schema-metadata.test.ts +115 -0
  745. package/src/resources/extensions/gsd/tests/db-task-slice-rows.test.ts +128 -0
  746. package/src/resources/extensions/gsd/tests/db-transaction.test.ts +110 -0
  747. package/src/resources/extensions/gsd/tests/db-verification-evidence-schema.test.ts +76 -0
  748. package/src/resources/extensions/gsd/tests/deep-planning-mode-dispatch.test.ts +42 -0
  749. package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +63 -2
  750. package/src/resources/extensions/gsd/tests/detection.test.ts +140 -0
  751. package/src/resources/extensions/gsd/tests/discuss-headless-rendering.test.ts +37 -0
  752. package/src/resources/extensions/gsd/tests/execute-summary-save-empty-project.test.ts +109 -0
  753. package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +59 -0
  754. package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-basic.md +52 -0
  755. package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-empty-optionals.md +42 -0
  756. package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-no-blockers.md +55 -0
  757. package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-with-blockers.md +60 -0
  758. package/src/resources/extensions/gsd/tests/forensics-prompt-rendering.test.ts +36 -0
  759. package/src/resources/extensions/gsd/tests/graph-operations.test.ts +10 -0
  760. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +139 -0
  761. package/src/resources/extensions/gsd/tests/guided-discuss-milestone-prompt-rendering.test.ts +43 -0
  762. package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +41 -0
  763. package/src/resources/extensions/gsd/tests/guided-discuss-requirements-prompt-rendering.test.ts +45 -0
  764. package/src/resources/extensions/gsd/tests/guided-flow-prompt-consolidation.test.ts +14 -0
  765. package/src/resources/extensions/gsd/tests/has-pending-deep-stage.test.ts +33 -1
  766. package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +79 -0
  767. package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +37 -0
  768. package/src/resources/extensions/gsd/tests/integration/state-machine-live-validation.test.ts +5 -3
  769. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +134 -0
  770. package/src/resources/extensions/gsd/tests/legacy-component-format-telemetry.test.ts +62 -0
  771. package/src/resources/extensions/gsd/tests/legacy-telemetry.test.ts +144 -0
  772. package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +40 -16
  773. package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +48 -0
  774. package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +127 -0
  775. package/src/resources/extensions/gsd/tests/model-router.test.ts +33 -12
  776. package/src/resources/extensions/gsd/tests/notification-store.test.ts +8 -0
  777. package/src/resources/extensions/gsd/tests/notification-widget.test.ts +40 -1
  778. package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +8 -0
  779. package/src/resources/extensions/gsd/tests/paused-session-via-db.test.ts +2 -0
  780. package/src/resources/extensions/gsd/tests/plan-milestone-rendering.test.ts +45 -0
  781. package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +65 -16
  782. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +77 -0
  783. package/src/resources/extensions/gsd/tests/plan-task.test.ts +21 -0
  784. package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +46 -0
  785. package/src/resources/extensions/gsd/tests/pr-evidence-equivalence.test.ts +102 -0
  786. package/src/resources/extensions/gsd/tests/pr-evidence-hardening.test.ts +165 -0
  787. package/src/resources/extensions/gsd/tests/pr-evidence.test.ts +79 -0
  788. package/src/resources/extensions/gsd/tests/pre-exec-gate-loop.test.ts +3 -0
  789. package/src/resources/extensions/gsd/tests/process-task-path.test.ts +51 -0
  790. package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +16 -1
  791. package/src/resources/extensions/gsd/tests/queue-prompt-rendering.test.ts +37 -0
  792. package/src/resources/extensions/gsd/tests/register-hooks-compaction-checkpoint.test.ts +85 -0
  793. package/src/resources/extensions/gsd/tests/right-sized-workflow-prompts.test.ts +192 -0
  794. package/src/resources/extensions/gsd/tests/run-uat-composer.test.ts +2 -0
  795. package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +29 -0
  796. package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +38 -0
  797. package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +46 -2
  798. package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +59 -0
  799. package/src/resources/extensions/gsd/tests/tool-naming.test.ts +32 -9
  800. package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +42 -4
  801. package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +32 -0
  802. package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +7 -0
  803. package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +109 -1
  804. package/src/resources/extensions/gsd/tests/uok-kernel-path.test.ts +12 -0
  805. package/src/resources/extensions/gsd/tests/uok-loop-adapter-writer.test.ts +98 -0
  806. package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +1 -1
  807. package/src/resources/extensions/gsd/tests/workflow-custom-engine-dispatch-outcome.test.ts +55 -0
  808. package/src/resources/extensions/gsd/tests/workflow-custom-engine-iteration.test.ts +93 -0
  809. package/src/resources/extensions/gsd/tests/workflow-custom-engine-reconcile-outcome.test.ts +108 -0
  810. package/src/resources/extensions/gsd/tests/workflow-custom-engine-reconcile.test.ts +146 -0
  811. package/src/resources/extensions/gsd/tests/workflow-custom-engine-retry.test.ts +136 -0
  812. package/src/resources/extensions/gsd/tests/workflow-custom-engine-verify-outcome.test.ts +95 -0
  813. package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +158 -0
  814. package/src/resources/extensions/gsd/tests/workflow-dispatch-ledger.test.ts +82 -0
  815. package/src/resources/extensions/gsd/tests/workflow-iteration-completion.test.ts +44 -0
  816. package/src/resources/extensions/gsd/tests/workflow-journal-reporter.test.ts +49 -0
  817. package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +607 -0
  818. package/src/resources/extensions/gsd/tests/workflow-logger.test.ts +20 -4
  819. package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +71 -0
  820. package/src/resources/extensions/gsd/tests/workflow-phase-reporter.test.ts +40 -0
  821. package/src/resources/extensions/gsd/tests/workflow-session-lock.test.ts +135 -0
  822. package/src/resources/extensions/gsd/tests/workflow-sidecar-iteration.test.ts +110 -0
  823. package/src/resources/extensions/gsd/tests/workflow-sidecar-queue.test.ts +116 -0
  824. package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +21 -0
  825. package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +164 -3
  826. package/src/resources/extensions/gsd/tests/workflow-turn-reporter.test.ts +87 -0
  827. package/src/resources/extensions/gsd/tests/workflow-unit-dispatch.test.ts +160 -0
  828. package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +123 -0
  829. package/src/resources/extensions/gsd/tests/working-output-messages.test.ts +93 -0
  830. package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +37 -6
  831. package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +7 -0
  832. package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +9 -2
  833. package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +3 -0
  834. package/src/resources/extensions/gsd/tests/worktree-submodule-safety.test.ts +17 -33
  835. package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +179 -0
  836. package/src/resources/extensions/gsd/tools/complete-milestone.ts +15 -9
  837. package/src/resources/extensions/gsd/tools/complete-task.ts +4 -1
  838. package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -0
  839. package/src/resources/extensions/gsd/tools/plan-task.ts +10 -0
  840. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +90 -2
  841. package/src/resources/extensions/gsd/unit-context-composer.ts +49 -0
  842. package/src/resources/extensions/gsd/unit-context-manifest.ts +34 -0
  843. package/src/resources/extensions/gsd/unit-runtime.ts +14 -0
  844. package/src/resources/extensions/gsd/uok/audit.ts +25 -9
  845. package/src/resources/extensions/gsd/uok/contracts.ts +105 -0
  846. package/src/resources/extensions/gsd/uok/dispatch-envelope.ts +4 -0
  847. package/src/resources/extensions/gsd/uok/kernel.ts +10 -3
  848. package/src/resources/extensions/gsd/uok/loop-adapter.ts +60 -45
  849. package/src/resources/extensions/gsd/uok/plan-v2.ts +5 -1
  850. package/src/resources/extensions/gsd/uok/timeline.ts +158 -0
  851. package/src/resources/extensions/gsd/workflow-logger.ts +13 -13
  852. package/src/resources/extensions/gsd/workflow-manifest.ts +6 -15
  853. package/src/resources/extensions/gsd/workflow-projections.ts +5 -1
  854. package/src/resources/extensions/gsd/workflow-templates.ts +11 -0
  855. package/src/resources/extensions/gsd/working-output-messages.ts +120 -0
  856. package/src/resources/extensions/gsd/worktree-manager.ts +15 -4
  857. package/src/resources/extensions/shared/gsd-phase-state.ts +56 -3
  858. package/src/resources/extensions/shared/interview-ui.ts +18 -5
  859. package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +43 -1
  860. package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +41 -0
  861. package/dist/web/standalone/.next/server/chunks/6336.js +0 -1
  862. package/dist/web/standalone/.next/static/chunks/app/page-ff639266d978f2a0.js +0 -1
  863. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  864. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  865. /package/dist/web/standalone/.next/static/{J-CU-p_sp45CJHT3R9TJS → YRK7-Es93MwpIn3VL35K0}/_buildManifest.js +0 -0
  866. /package/dist/web/standalone/.next/static/{J-CU-p_sp45CJHT3R9TJS → YRK7-Es93MwpIn3VL35K0}/_ssgManifest.js +0 -0
@@ -0,0 +1,35 @@
1
+ import { isAbsolute, relative, resolve } from "node:path";
2
+ import { normalizePlannedFileReference } from "./files.js";
3
+
4
+ export interface PlanningPathScopeField {
5
+ field: string;
6
+ values: string[];
7
+ }
8
+
9
+ function isInsideBase(basePath: string, candidate: string): boolean {
10
+ const base = resolve(basePath);
11
+ const abs = resolve(candidate);
12
+ const rel = relative(base, abs);
13
+ return rel === "" || (!!rel && !rel.startsWith("..") && !isAbsolute(rel));
14
+ }
15
+
16
+ /**
17
+ * Planning IO fields are execution contracts. Absolute paths are only safe when
18
+ * they stay inside the active working directory; in worktree mode, an absolute
19
+ * path to the original checkout makes executors edit the wrong tree.
20
+ */
21
+ export function validatePlanningPathScope(
22
+ basePath: string,
23
+ fields: PlanningPathScopeField[],
24
+ ): string | null {
25
+ for (const { field, values } of fields) {
26
+ for (const raw of values) {
27
+ const candidate = normalizePlannedFileReference(raw);
28
+ if (!isAbsolute(candidate)) continue;
29
+ if (isInsideBase(basePath, candidate)) continue;
30
+ return `${field} contains absolute path outside working directory: ${candidate}. Use a path relative to ${basePath}.`;
31
+ }
32
+ }
33
+
34
+ return null;
35
+ }
@@ -1,3 +1,6 @@
1
+ // Project/App: GSD-2
2
+ // File Purpose: Post-execution validation checks for completed GSD task output.
3
+
1
4
  /**
2
5
  * Post-Execution Checks — Validate task output after execution completes.
3
6
  *
@@ -15,7 +18,7 @@
15
18
 
16
19
  import { existsSync, readFileSync } from "node:fs";
17
20
  import { resolve, dirname, join, extname } from "node:path";
18
- import type { TaskRow } from "./gsd-db.ts";
21
+ import type { TaskRow } from "./db-task-slice-rows.js";
19
22
 
20
23
  // ─── Result Types ────────────────────────────────────────────────────────────
21
24
 
@@ -144,12 +147,30 @@ export function resolveImportPath(
144
147
  if (existsSync(directPath)) {
145
148
  return { exists: true, resolvedPath: directPath };
146
149
  }
147
- // Only .js/.jsx/.mjs/.cjs imports legitimately fall through for the TS
148
- // ESM convention (.js .ts). Any other explicit extension (.css, .json,
149
- // .svg, images, fonts, .ts, .tsx, …) must stay unresolved when the direct
150
- // path is missing otherwise a stray `./missing.css.ts` could shadow a
151
- // genuinely missing `./missing.css` import.
152
- if (![".js", ".jsx", ".mjs", ".cjs"].includes(explicitExt)) {
150
+
151
+ // Known concrete extensions that should NOT fall through to code-shadow
152
+ // probing when missing. This preserves the "missing.css must stay missing"
153
+ // guarantee while still allowing dotted module stems like ./route.server
154
+ // to resolve as ./route.server.ts.
155
+ const nonFallbackExtensions = new Set([
156
+ ".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs",
157
+ ".json", ".css", ".scss", ".sass", ".less", ".styl",
158
+ ".svg", ".png", ".jpg", ".jpeg", ".gif", ".webp", ".avif", ".ico", ".bmp",
159
+ ".woff", ".woff2", ".ttf", ".otf", ".eot",
160
+ ]);
161
+ const runtimeFallbackExtensions = new Set([".js", ".jsx", ".mjs", ".cjs"]);
162
+ const dottedStemFallbackExtensions = new Set([".server", ".client", ".webhook"]);
163
+
164
+ if (
165
+ explicitExt !== "" &&
166
+ !runtimeFallbackExtensions.has(explicitExt) &&
167
+ !nonFallbackExtensions.has(explicitExt) &&
168
+ !dottedStemFallbackExtensions.has(explicitExt)
169
+ ) {
170
+ return { exists: false, resolvedPath: null };
171
+ }
172
+
173
+ if (nonFallbackExtensions.has(explicitExt) && !runtimeFallbackExtensions.has(explicitExt)) {
153
174
  return { exists: false, resolvedPath: null };
154
175
  }
155
176
  }
@@ -222,6 +243,13 @@ export function checkImportResolution(
222
243
  const imports = extractRelativeImports(source);
223
244
 
224
245
  for (const { importPath, lineNum } of imports) {
246
+ // React Router generated +types modules may not exist on disk during
247
+ // post-exec checks (generated during framework build). Don't block task
248
+ // completion on these imports.
249
+ if (/^\.{1,2}\/\+types\//.test(importPath)) {
250
+ continue;
251
+ }
252
+
225
253
  const resolution = resolveImportPath(importPath, file, basePath);
226
254
 
227
255
  if (!resolution.exists) {
@@ -0,0 +1,182 @@
1
+ // Project/App: GSD-2
2
+ // File Purpose: Shared pull request evidence generator for GSD shipping paths.
3
+
4
+ export type PrChangeType = "feat" | "fix" | "refactor" | "test" | "docs" | "chore";
5
+
6
+ export interface PrEvidenceInput {
7
+ milestoneId: string;
8
+ subjectId?: string;
9
+ subjectKind?: "milestone" | "slice" | "workflow";
10
+ milestoneTitle?: string;
11
+ changeType?: PrChangeType;
12
+ linkedIssue?: string;
13
+ summaries?: string[];
14
+ blockers?: string[];
15
+ roadmapItems?: string[];
16
+ metrics?: string[];
17
+ testsRun?: string[];
18
+ why?: string;
19
+ how?: string;
20
+ rollbackNotes?: string[];
21
+ aiAssisted?: boolean;
22
+ }
23
+
24
+ export interface PrEvidence {
25
+ title: string;
26
+ body: string;
27
+ }
28
+
29
+ const CHANGE_TYPE_LABELS: Record<PrChangeType, string> = {
30
+ feat: "New feature or capability",
31
+ fix: "Bug fix",
32
+ refactor: "Code restructuring",
33
+ test: "Adding or updating tests",
34
+ docs: "Documentation only",
35
+ chore: "Build, CI, or tooling changes",
36
+ };
37
+
38
+ // Per-item cap for user-supplied content. 2 KB gives slice titles plus
39
+ // descriptions room while still bounding malicious DoS-via-PR-body input.
40
+ const USER_CONTENT_CAP_BYTES = 2048;
41
+ const TRUNCATION_SUFFIX = " … [truncated]";
42
+
43
+ // Strips HTML comments, fake commit trailers (Co-Authored-By, Signed-off-by —
44
+ // case-insensitive on the trailer name), and caps total length. Designed to
45
+ // be a no-op for well-formed input; golden fixtures must remain byte-stable.
46
+ // Trailer lines are removed (not rejected) so that a single bad line in an
47
+ // otherwise legitimate description does not block the entire PR.
48
+ function sanitizeUserContent(s: string): string {
49
+ if (!s) return s;
50
+ // Strip HTML comments greedily across newlines.
51
+ let out = s.replace(/<!--[\s\S]*?-->/g, "");
52
+ // Drop lines that look like commit trailers we do not want forged.
53
+ out = out
54
+ .split("\n")
55
+ .filter((line) => !/^\s*(co-authored-by|signed-off-by)\s*:/i.test(line))
56
+ .join("\n");
57
+ if (Buffer.byteLength(out, "utf8") > USER_CONTENT_CAP_BYTES) {
58
+ const budget = USER_CONTENT_CAP_BYTES - Buffer.byteLength(TRUNCATION_SUFFIX, "utf8");
59
+ // Truncate by code units to stay safely under the byte budget for ASCII;
60
+ // for multibyte content we conservatively walk back until under budget.
61
+ let sliced = out.slice(0, Math.max(0, budget));
62
+ while (Buffer.byteLength(sliced, "utf8") > budget && sliced.length > 0) {
63
+ sliced = sliced.slice(0, -1);
64
+ }
65
+ out = sliced + TRUNCATION_SUFFIX;
66
+ }
67
+ return out;
68
+ }
69
+
70
+ // Strips HTML comments and fake trailers without applying the length cap.
71
+ // Used for short fields like linkedIssue where truncation would be confusing.
72
+ function sanitizeIssueRef(s: string): string {
73
+ if (!s) return s;
74
+ let out = s.replace(/<!--[\s\S]*?-->/g, "");
75
+ out = out
76
+ .split("\n")
77
+ .filter((line) => !/^\s*(co-authored-by|signed-off-by)\s*:/i.test(line))
78
+ .join("\n");
79
+ return out;
80
+ }
81
+
82
+ function normalizeList(values: readonly string[] | undefined): string[] {
83
+ return (values ?? [])
84
+ .map((value) => sanitizeUserContent(value).trim())
85
+ .filter(Boolean);
86
+ }
87
+
88
+ function changeTypeChecklist(selected: PrChangeType): string[] {
89
+ return (Object.keys(CHANGE_TYPE_LABELS) as PrChangeType[]).map((type) => {
90
+ const checked = type === selected ? "x" : " ";
91
+ return `- [${checked}] \`${type}\` - ${CHANGE_TYPE_LABELS[type]}`;
92
+ });
93
+ }
94
+
95
+ function bulletList(values: readonly string[], fallback: string): string {
96
+ if (values.length === 0) return `- ${fallback}`;
97
+ return values.map((value) => `- ${value}`).join("\n");
98
+ }
99
+
100
+ export function buildPrEvidence(input: PrEvidenceInput): PrEvidence {
101
+ const subjectId = input.subjectId?.trim() || input.milestoneId;
102
+ const subjectKind = input.subjectKind ?? "milestone";
103
+ const subjectTitle = input.milestoneTitle?.trim() || subjectId;
104
+ const changeType = input.changeType ?? "feat";
105
+ const summaries = normalizeList(input.summaries);
106
+ const blockers = normalizeList(input.blockers);
107
+ const roadmapItems = normalizeList(input.roadmapItems);
108
+ const metrics = normalizeList(input.metrics);
109
+ const testsRun = normalizeList(input.testsRun);
110
+ const rollbackNotes = normalizeList(input.rollbackNotes);
111
+ // linkedIssue is sanitized but not length-capped: legitimate issue refs
112
+ // are short by nature, and truncating "Closes #123" would be unhelpful.
113
+ const linkedIssueRaw = input.linkedIssue ? sanitizeIssueRef(input.linkedIssue).trim() : "";
114
+ const linkedIssue = linkedIssueRaw || "Not specified. Add an issue link before marking this PR ready if CONTRIBUTING.md requires one.";
115
+ const why = (input.why ? sanitizeUserContent(input.why).trim() : "") || `${capitalize(subjectKind)} work is complete and ready for review.`;
116
+ const how = (input.how ? sanitizeUserContent(input.how).trim() : "") || "Generated from GSD evidence and local workflow artifacts.";
117
+ const title = `${changeType}: ${subjectTitle}`;
118
+
119
+ const sections: string[] = [
120
+ "## TL;DR",
121
+ "",
122
+ `**What:** Ship ${subjectKind} ${subjectId} - ${subjectTitle}`,
123
+ `**Why:** ${why}`,
124
+ `**How:** ${how}`,
125
+ "",
126
+ "## What",
127
+ "",
128
+ summaries.length > 0 ? summaries.join("\n\n") : `${capitalize(subjectKind)} ${subjectId} completed.`,
129
+ ];
130
+
131
+ if (blockers.length > 0) {
132
+ sections.push("", "## Blockers", "", blockers.map((blocker) => `- ${blocker}`).join("\n"));
133
+ }
134
+
135
+ sections.push(
136
+ "",
137
+ "## Why",
138
+ "",
139
+ why,
140
+ "",
141
+ "## How",
142
+ "",
143
+ how,
144
+ "",
145
+ "## Linked Issue",
146
+ "",
147
+ linkedIssue,
148
+ );
149
+
150
+ if (roadmapItems.length > 0) {
151
+ sections.push("", "## Roadmap", "", roadmapItems.join("\n"));
152
+ }
153
+
154
+ if (metrics.length > 0) {
155
+ sections.push("", "## Metrics", "", bulletList(metrics, "No metrics recorded."));
156
+ }
157
+
158
+ sections.push(
159
+ "",
160
+ "## Tests Run",
161
+ "",
162
+ bulletList(testsRun, "Not specified. Add exact verification commands before requesting review."),
163
+ "",
164
+ "## Change Type",
165
+ "",
166
+ ...changeTypeChecklist(changeType),
167
+ "",
168
+ "## Rollback And Compatibility",
169
+ "",
170
+ bulletList(rollbackNotes, "No behavior-changing rollback notes recorded."),
171
+ );
172
+
173
+ if (input.aiAssisted !== false) {
174
+ sections.push("", "## AI Assistance Disclosure", "", "This PR was prepared with AI assistance.");
175
+ }
176
+
177
+ return { title, body: sections.join("\n") };
178
+ }
179
+
180
+ function capitalize(value: string): string {
181
+ return value.slice(0, 1).toUpperCase() + value.slice(1);
182
+ }
@@ -1,3 +1,6 @@
1
+ // Project/App: GSD-2
2
+ // File Purpose: Pre-execution validation checks for GSD task plans.
3
+
1
4
  /**
2
5
  * Pre-Execution Checks — Validate task plans before execution begins.
3
6
  *
@@ -18,7 +21,7 @@ import { existsSync } from "node:fs";
18
21
  import { spawn } from "node:child_process";
19
22
  import { homedir } from "node:os";
20
23
  import { resolve } from "node:path";
21
- import type { TaskRow } from "./gsd-db.ts";
24
+ import type { TaskRow } from "./db-task-slice-rows.js";
22
25
  import type { PreExecutionCheckJSON } from "./verification-evidence.ts";
23
26
 
24
27
  const NPM_COMMAND = process.platform === "win32" ? "npm.cmd" : "npm";
@@ -154,8 +154,26 @@ export const KNOWN_PREFERENCE_KEYS = new Set<string>([
154
154
  "planning_depth",
155
155
  ]);
156
156
 
157
- /** Canonical list of all dispatch unit types. */
158
- export const KNOWN_UNIT_TYPES = [
157
+ /**
158
+ * Broad union of every recognized unit-type *label* used across the codebase.
159
+ *
160
+ * This intentionally covers more than the manifest-tracked dispatch units in
161
+ * `unit-context-manifest.ts:KNOWN_UNIT_TYPES`. Examples that live here but not
162
+ * in the manifest:
163
+ * - `discuss-slice` — dispatched by `guided-flow.ts` rather than auto-mode;
164
+ * composer falls through to default behavior via `resolveManifest()` null path.
165
+ * - `worktree-merge` — used as a model-routing case, prompt-template name, and
166
+ * commit-message label, not as an LLM-dispatched unit.
167
+ *
168
+ * Used by `preferences-validation.ts` to validate user-provided unit-type
169
+ * references in preferences (model overrides, skill rules, etc.) — preferences
170
+ * may legitimately reference any label, including non-dispatched ones.
171
+ *
172
+ * The manifest-strict subset lives in `unit-context-manifest.ts:KNOWN_UNIT_TYPES`
173
+ * and is enforced 1:1 against `UNIT_MANIFESTS` by the parity test in
174
+ * `tests/unit-context-manifest.test.ts`.
175
+ */
176
+ export const KNOWN_UNIT_LABELS = [
159
177
  "research-milestone", "plan-milestone", "research-slice", "plan-slice", "refine-slice",
160
178
  "execute-task", "reactive-execute", "gate-evaluate", "complete-slice", "replan-slice", "reassess-roadmap",
161
179
  "run-uat", "complete-milestone", "validate-milestone", "rewrite-docs",
@@ -164,7 +182,7 @@ export const KNOWN_UNIT_TYPES = [
164
182
  "workflow-preferences", "discuss-project", "discuss-requirements",
165
183
  "research-decision", "research-project",
166
184
  ] as const;
167
- export type UnitType = (typeof KNOWN_UNIT_TYPES)[number];
185
+ export type UnitLabel = (typeof KNOWN_UNIT_LABELS)[number];
168
186
 
169
187
 
170
188
  export const SKILL_ACTIONS = new Set(["use", "prefer", "avoid"]);
@@ -343,7 +361,8 @@ export interface GSDPreferences {
343
361
  /**
344
362
  * Tool-output sandboxing via gsd_exec. Keeps sub-session context windows
345
363
  * clean by running scripts in a subprocess and only surfacing a short
346
- * digest. See `ContextModeConfig`. Default: disabled.
364
+ * digest. See `ContextModeConfig`. Default: enabled unless explicitly
365
+ * disabled with `context_mode.enabled: false`.
347
366
  */
348
367
  context_mode?: ContextModeConfig;
349
368
  token_profile?: TokenProfile;
@@ -14,7 +14,7 @@ import { normalizeStringArray } from "../shared/format-utils.js";
14
14
 
15
15
  import {
16
16
  KNOWN_PREFERENCE_KEYS,
17
- KNOWN_UNIT_TYPES,
17
+ KNOWN_UNIT_LABELS,
18
18
 
19
19
  SKILL_ACTIONS,
20
20
  type WorkflowMode,
@@ -441,7 +441,7 @@ export function validatePreferences(preferences: GSDPreferences): {
441
441
  if (preferences.post_unit_hooks && Array.isArray(preferences.post_unit_hooks)) {
442
442
  const validHooks: PostUnitHookConfig[] = [];
443
443
  const seenNames = new Set<string>();
444
- const knownUnitTypes = new Set<string>(KNOWN_UNIT_TYPES);
444
+ const knownUnitTypes = new Set<string>(KNOWN_UNIT_LABELS);
445
445
  for (const hook of preferences.post_unit_hooks) {
446
446
  if (!hook || typeof hook !== "object") {
447
447
  errors.push("post_unit_hooks entry must be an object");
@@ -503,7 +503,7 @@ export function validatePreferences(preferences: GSDPreferences): {
503
503
  if (preferences.pre_dispatch_hooks && Array.isArray(preferences.pre_dispatch_hooks)) {
504
504
  const validPreHooks: PreDispatchHookConfig[] = [];
505
505
  const seenPreNames = new Set<string>();
506
- const knownUnitTypes = new Set<string>(KNOWN_UNIT_TYPES);
506
+ const knownUnitTypes = new Set<string>(KNOWN_UNIT_LABELS);
507
507
  const validActions = new Set(["modify", "skip", "replace"]);
508
508
  for (const hook of preferences.pre_dispatch_hooks) {
509
509
  if (!hook || typeof hook !== "object") {
@@ -0,0 +1,81 @@
1
+ // Project/App: GSD-2
2
+ // File Purpose: Canonical process recommendations for routing work by task size.
3
+
4
+ export type ProcessTaskSize =
5
+ | "hotfix"
6
+ | "bugfix"
7
+ | "small-feature"
8
+ | "large-feature"
9
+ | "architecture-change";
10
+
11
+ export interface ProcessTaskPath {
12
+ taskSize: ProcessTaskSize;
13
+ label: string;
14
+ templateId: string;
15
+ command: string;
16
+ phases: string[];
17
+ guidance: string;
18
+ }
19
+
20
+ const TASK_PATHS: Record<ProcessTaskSize, ProcessTaskPath> = {
21
+ hotfix: {
22
+ taskSize: "hotfix",
23
+ label: "Hotfix",
24
+ templateId: "hotfix",
25
+ command: "/gsd start hotfix <description>",
26
+ phases: ["fix", "ship"],
27
+ guidance: "Use for urgent production fixes that need minimal ceremony and fast verification.",
28
+ },
29
+ bugfix: {
30
+ taskSize: "bugfix",
31
+ label: "Bugfix",
32
+ templateId: "bugfix",
33
+ command: "/gsd start bugfix <description> --issue <ref>",
34
+ phases: ["triage", "fix", "verify", "ship"],
35
+ guidance: "Use for reproducible defects where a linked issue and regression test are expected.",
36
+ },
37
+ "small-feature": {
38
+ taskSize: "small-feature",
39
+ label: "Small Feature",
40
+ templateId: "small-feature",
41
+ command: "/gsd start small-feature <description>",
42
+ phases: ["scope", "plan", "implement", "verify"],
43
+ guidance: "Use for contained feature work that does not need the full milestone machinery.",
44
+ },
45
+ "large-feature": {
46
+ taskSize: "large-feature",
47
+ label: "Large Feature",
48
+ templateId: "full-project",
49
+ command: "/gsd discuss <description>, then /gsd auto",
50
+ phases: ["discuss", "plan", "execute", "verify"],
51
+ guidance: "Use for multi-slice work that should run through the DB-backed milestone flow.",
52
+ },
53
+ "architecture-change": {
54
+ taskSize: "architecture-change",
55
+ label: "Architecture Change",
56
+ templateId: "refactor",
57
+ command: "/gsd start refactor <description>",
58
+ phases: ["inventory", "plan", "migrate", "verify"],
59
+ guidance: "Use for structural changes that require inventory, compatibility notes, and staged verification.",
60
+ },
61
+ };
62
+
63
+ export function recommendProcessPath(taskSize: ProcessTaskSize): ProcessTaskPath {
64
+ return TASK_PATHS[taskSize];
65
+ }
66
+
67
+ export function listRecommendedProcessPaths(): ProcessTaskPath[] {
68
+ return [
69
+ TASK_PATHS.hotfix,
70
+ TASK_PATHS.bugfix,
71
+ TASK_PATHS["small-feature"],
72
+ TASK_PATHS["large-feature"],
73
+ TASK_PATHS["architecture-change"],
74
+ ];
75
+ }
76
+
77
+ export function formatRecommendedProcessPaths(): string {
78
+ return listRecommendedProcessPaths()
79
+ .map((path) => ` ${path.taskSize.padEnd(19)} ${path.command}`)
80
+ .join("\n");
81
+ }
@@ -10,7 +10,7 @@
10
10
  * Templates are snapshotted shortly after module init via warmCache().
11
11
  * This keeps import/extension-registration fast while still preventing a
12
12
  * running session from being invalidated when another `gsd` launch overwrites
13
- * ~/.gsd/agent/ with newer templates via initResources(). Without caching, the
13
+ * the user-local agent tree with newer templates via initResources(). Without caching, the
14
14
  * in-memory extension code (which knows variable set A) can read a newer
15
15
  * template from disk (which expects variable set B), causing a
16
16
  * "template declares {{X}} but no value was provided" crash mid-session.
@@ -57,9 +57,9 @@ export function resolveExtensionDirFromCandidates(
57
57
  *
58
58
  * `import.meta.url` resolves to whichever copy of this module is executing.
59
59
  * On Windows (npm global install via MSYS2 / Git Bash) this can resolve to
60
- * the npm-global `AppData/Roaming/npm/…` path, which does NOT contain the
61
- * prompts/ and templates/ subtrees that initResources() copies to
62
- * `~/.gsd/agent/extensions/gsd/`. Detect the mismatch and fall back to
60
+ * the npm-global package path, which does NOT contain the prompts/ and
61
+ * templates/ subtrees that initResources() copies to the user-local agent
62
+ * extension directory. Detect the mismatch and fall back to
63
63
  * the user-local agent directory.
64
64
  */
65
65
  function resolveExtensionDir(): string {
@@ -74,7 +74,7 @@ const templatesDir = join(__extensionDir, "templates");
74
74
 
75
75
  /**
76
76
  * Return the resolved templates directory path for use in prompts.
77
- * Avoids hardcoding `~/.gsd/agent/extensions/gsd/templates/` in templates. (#3575)
77
+ * Avoids hardcoding the user-local templates directory in templates. (#3575)
78
78
  */
79
79
  export function getTemplatesDir(): string {
80
80
  return templatesDir;
@@ -155,6 +155,10 @@ export function loadPrompt(name: string, vars: Record<string, string> = {}): str
155
155
  }
156
156
 
157
157
  const effectiveVars = {
158
+ templatesDir: getTemplatesDir(),
159
+ planTemplatePath: join(getTemplatesDir(), "plan.md"),
160
+ taskPlanTemplatePath: join(getTemplatesDir(), "task-plan.md"),
161
+ taskSummaryTemplatePath: join(getTemplatesDir(), "task-summary.md"),
158
162
  skillActivation: "If a `GSD Skill Preferences` block is present in system context, use it and the `<available_skills>` catalog in your system prompt to decide which skills to load and follow for this unit, without relaxing required verification or artifact rules.",
159
163
  ...vars,
160
164
  };
@@ -6,55 +6,60 @@ You are executing GSD auto-mode.
6
6
 
7
7
  Your working directory is `{{workingDirectory}}`. All file reads, writes, and shell commands MUST operate relative to this directory. Do NOT `cd` to any other directory.
8
8
 
9
- ## Your Role in the Pipeline
9
+ ## Mission
10
10
 
11
- All slices are done. You are closing out the milestone — verifying that the assembled work actually delivers the promised outcome, writing the milestone summary, and updating project state. The milestone summary is the final record. After you finish, the system merges the worktree back to the integration branch. If there are queued milestones, the next one starts its own research → plan → execute cycle from a clean slate — the milestone summary is how it learns what was already built.
11
+ All slices are complete. Verify the integrated work, persist milestone completion, refresh project state, and write the final record future milestones will rely on.
12
12
 
13
- Preloaded context below — the roadmap, compact slice-summary excerpts, requirements, decisions, and project context. **Slice summaries are excerpts, not full files.** They include frontmatter fields, section heads (deviations, known limitations, follow-ups), and short narrative only. When drafting LEARNINGS, the Decision Re-evaluation table, or cross-slice narrative, Read the full slice SUMMARY.md files listed under "On-demand Slice Summaries" do that selectively as needed, not preemptively.
13
+ Preloaded context includes roadmap, requirements, decisions, project context, and compact slice-summary excerpts. Slice summaries are excerpts, not full files: use them first, then selectively read full SUMMARY.md files listed under "On-demand Slice Summaries" only when section headings indicate needed evidence for LEARNINGS, Decision Re-evaluation, deviations, limitations, or cross-slice narrative.
14
14
 
15
15
  Start with what the excerpts give you. Read full files when the section heads signal richer context you need.
16
16
 
17
- **On-demand Read ordering:** Complete all slice SUMMARY Reads you need for cross-slice synthesis, the Decision Re-evaluation table, and LEARNINGS **before** calling `gsd_complete_milestone` (step 10). Once that tool runs, the milestone is marked complete in the DB running out of tool budget between step 10 and the LEARNINGS write (step 12) leaves the milestone committed without its LEARNINGS artifact.
17
+ **On-demand Read ordering:** Complete all slice SUMMARY Reads you need for cross-slice synthesis, the Decision Re-evaluation table, and LEARNINGS **before** calling `gsd_complete_milestone` (step 12). Once that tool runs, the milestone is marked complete in the DB, so it must be the final persistent milestone-closeout write.
18
18
 
19
- ### Delegate Review Work
19
+ ### Closeout Review Mode
20
20
 
21
- This unit runs under the `planning-dispatch` tools-policy: you may use the `subagent` tool to delegate review work that benefits from a fresh context window. For non-trivial milestones, delegate before drafting LEARNINGS:
21
+ The inlined context includes a validation status block.
22
22
 
23
- - **Cross-slice integrations or new public APIs** dispatch the **reviewer** agent with the milestone diff and roadmap; treat its findings as input to your Decision Re-evaluation and LEARNINGS sections.
24
- - **Touched auth, network, parsing, file IO, shell exec, or crypto** dispatch the **security** agent for an OWASP-style audit across the merged slices.
25
- - **Significant test surface added or changed** → dispatch the **tester** agent to assess coverage gaps relative to the milestone success criteria.
23
+ - If it says a passing validation artifact is present, treat that artifact as authoritative for success criteria, requirement coverage, verification classes, and cross-slice integration. Do not delegate fresh reviewer/security/tester audits unless the validation artifact is internally inconsistent with the inlined summaries.
24
+ - If validation is missing, stale, non-pass, or internally inconsistent, use `subagent` for review work needing fresh context before drafting LEARNINGS: cross-slice integrations or new public APIs -> **reviewer**; auth, network, parsing, file IO, shell exec, or crypto -> **security**; significant tests added or changed -> **tester**.
26
25
 
27
- Subagents read the diff and report findings they do **not** write user source. Apply their feedback into the milestone summary and any captured decisions before calling `gsd_complete_milestone`.
26
+ Subagents report only; they do not write user source. Fold any findings into Decision Re-evaluation and LEARNINGS before completion.
28
27
 
29
28
  {{inlinedContext}}
30
29
 
31
- Then:
30
+ ## Steps
31
+
32
32
  1. Use the **Milestone Summary** output template from the inlined context above
33
33
  2. {{skillActivation}}
34
- 3. **Verify code changes exist.** Compare the milestone against its integration branch (usually `main`, `master`, or the recorded integration branch), using the merge-base as the older revision and `HEAD` as the newer revision. If that branch diff lists non-`.gsd/` files, code-change verification passes. If `HEAD` is already the same commit as the integration branch/merge-base (a retry-on-main self-diff), do **not** treat the empty branch diff as proof of missing code. Instead, inspect milestone-scoped commit evidence such as recent commits with `GSD-Unit: {{milestoneId}}` or production `GSD-Task: Sxx/Tyy` trailers whose diff also touches `.gsd/milestones/{{milestoneId}}/`, then check those commits for non-`.gsd/` files. Only record a **verification failure** when neither the branch diff nor milestone-scoped commit evidence shows implementation files.
35
- 4. Verify each **success criterion** from the milestone definition in `{{roadmapPath}}`. For each criterion, confirm it was met with specific evidence from slice summaries, test results, or observable behavior. Record any criterion that was NOT met as a **verification failure**.
36
- 5. Verify the milestone's **definition of done** all slices are `[x]`, all slice summaries exist, and any cross-slice integration points work correctly. Record any unmet items as a **verification failure**.
37
- 6. If the roadmap includes a **Horizontal Checklist**, verify each item was addressed during the milestone. Note unchecked items in the milestone summary.
38
- 7. Fill the **Decision Re-evaluation** table in the milestone summary. For each key decision from `.gsd/DECISIONS.md` made during this milestone, evaluate whether it is still valid given what was actually built. Flag decisions that should be revisited next milestone.
39
- 8. Validate **requirement status transitions**. For each requirement that changed status during this milestone, confirm the transition is supported by evidence. Requirements can move between Active, Validated, Deferred, Blocked, or Out of Scope — but only with proof.
34
+ 3. **Verify code changes exist.** Compare milestone work against the integration branch (`main`, `master`, or recorded branch), using merge-base as older revision and `HEAD` as newer. If the diff lists non-`.gsd/` files, pass. If `HEAD` equals the integration branch/merge-base, treat it as a self-diff retry: inspect milestone-scoped commit evidence (`GSD-Unit: {{milestoneId}}` or production `GSD-Task: Sxx/Tyy` trailers touching `.gsd/milestones/{{milestoneId}}/`) and verify those commits touched non-`.gsd/` files. Record **verification failure** only when neither source shows implementation files.
35
+ 4. Verify every **success criterion** from `{{roadmapPath}}`. If passing validation is present, summarize the validation evidence instead of re-auditing it; otherwise verify with evidence from summaries, tests, or observable behavior. Record unmet criteria as **verification failure**.
36
+ 5. Verify **definition of done**: all slices `[x]`, summaries exist, and integrations work. If passing validation is present, trust its integration/verification verdict unless inconsistent with current artifacts. Record unmet items as **verification failure**.
37
+ 6. If the roadmap includes a **Horizontal Checklist**, verify each item and note unchecked items in the summary.
38
+ 7. Fill the **Decision Re-evaluation** table: compare each key `.gsd/DECISIONS.md` decision from this milestone with what shipped, and flag decisions to revisit.
39
+ 8. Validate **requirement status transitions**. For each changed requirement, confirm evidence supports the new status. Requirements may move between Active, Validated, Deferred, Blocked, or Out of Scope only with proof.
40
40
 
41
- **DB access safety:** Do NOT query `.gsd/gsd.db` directly via `sqlite3` or `node -e require('better-sqlite3')` the engine owns the WAL connection. Use `gsd_milestone_status` to read milestone and slice state. All data you need is already inlined in the context above or accessible via the `gsd_*` tools never via direct SQL.
41
+ **DB access safety:** Do NOT query `.gsd/gsd.db` directly via `sqlite3` or `node -e require('better-sqlite3')`; the engine owns the WAL connection. Use `gsd_milestone_status`, inlined context, or `gsd_*` tools; never direct SQL.
42
42
 
43
43
  ### Verification Gate — STOP if verification failed
44
44
 
45
- **If ANY verification failure was recorded in steps 3, 4, or 5, you MUST follow the failure path below. Do NOT proceed to step 10.**
45
+ **If ANY verification failure was recorded in steps 3, 4, or 5, you MUST follow the failure path below. Do NOT proceed with steps 9–13.**
46
46
 
47
47
  **Failure path** (verification failed):
48
- - Do NOT call `gsd_complete_milestone` — the milestone must not be marked as complete.
48
+ - Do NOT call `gsd_complete_milestone`.
49
49
  - Do NOT update `.gsd/PROJECT.md` to reflect completion.
50
- - Do NOT update `.gsd/REQUIREMENTS.md` to mark requirements as validated.
51
- - Write a clear summary of what failed and why to help the next attempt.
50
+ - Do NOT update `.gsd/REQUIREMENTS.md` to mark requirements validated.
51
+ - Write a clear failed-verification summary for the next attempt.
52
52
  - Say: "Milestone {{milestoneId}} verification FAILED — not complete." and stop.
53
53
 
54
- **Success path** (all verifications passed — continue with steps 9–13):
54
+ **Success path** (all verifications passed):
55
55
 
56
56
  9. For each requirement whose status changed in step 8, call `gsd_requirement_update` with the requirement ID and updated `status` and `validation` fields — the tool regenerates `.gsd/REQUIREMENTS.md` automatically. Do this BEFORE completing the milestone so requirement updates are persisted.
57
- 10. **Persist completion through `gsd_complete_milestone`.** Call it with the parameters below. The tool updates the milestone status in the DB, renders `{{milestoneSummaryPath}}`, and validates all slices are complete before proceeding.
57
+ 10. Update `.gsd/PROJECT.md`: use the `write` tool with `path: ".gsd/PROJECT.md"` and `content` containing the full updated document reflecting milestone completion and current project state. Do NOT use the `edit` tool for this PROJECT.md is a full-document refresh.
58
+ 11. Extract structured learnings from this milestone and persist them to the GSD memory store. Follow the procedure block immediately below — it writes `{{milestoneId}}-LEARNINGS.md` as the audit trail and persists Patterns, Lessons, and Decisions via `capture_thought` (categories: pattern, gotcha/convention, architecture). The memory store is the single source of truth for cross-session durable knowledge (ADR-013).
59
+
60
+ {{extractLearningsSteps}}
61
+
62
+ 12. **Persist completion through `gsd_complete_milestone`.** Call it with the parameters below. This must be the final persistent write in the unit. The tool updates the milestone status in the DB, renders `{{milestoneSummaryPath}}`, and validates all slices are complete.
58
63
 
59
64
  **Required parameters:**
60
65
  - `milestoneId` (string) — Milestone ID (e.g. M001)
@@ -67,19 +72,15 @@ Then:
67
72
  - `keyDecisions` (array of strings) — Key architectural/pattern decisions made during the milestone
68
73
  - `keyFiles` (array of strings) — Key files created or modified during the milestone
69
74
  - `lessonsLearned` (array of strings) — Lessons learned during the milestone
70
- - `verificationPassed` (boolean) — Must be `true` confirms that code change verification, success criteria, and definition of done checks all passed before completion
75
+ - `verificationPassed` (boolean) — Must be `true`; confirms code-change verification, success criteria, and definition-of-done checks all passed
71
76
 
72
77
  **Optional parameters:**
73
78
  - `followUps` (string) — Follow-up items for future milestones
74
79
  - `deviations` (string) — Deviations from the original plan
75
- 11. Update `.gsd/PROJECT.md`: use the `write` tool with `path: ".gsd/PROJECT.md"` and `content` containing the full updated document reflecting milestone completion and current project state. Do NOT use the `edit` tool for this — PROJECT.md is a full-document refresh.
76
- 12. Extract structured learnings from this milestone and persist them to the GSD memory store. Follow the procedure block immediately below — it writes `{{milestoneId}}-LEARNINGS.md` as the audit trail and persists Patterns, Lessons, and Decisions via `capture_thought` (categories: pattern, gotcha/convention, architecture). The memory store is the single source of truth for cross-session durable knowledge (ADR-013).
77
-
78
- {{extractLearningsSteps}}
79
80
 
80
81
  13. Do not commit manually — the system auto-commits your changes after this unit completes.
81
82
  - Say: "Milestone {{milestoneId}} complete."
82
83
 
83
- **Important:** Do NOT skip the code change verification, success criteria, or definition of done verification (steps 3-5). The milestone summary must reflect actual verified outcomes, not assumed success. Verification failures BLOCK completion there is no override. The milestone stays in its current state until issues are resolved and verification is re-run. **If a verification tool itself fails, errors, or returns unexpected output, treat it as a verification failure** — never rationalize past a tool error ("tool didn't respond, assuming success" is forbidden). A tool that cannot verify is a tool that did not verify.
84
+ **Important:** Do NOT skip code-change, success-criteria, or definition-of-done verification (steps 3-5). The summary must reflect verified outcomes. Verification failures block completion; there is no override. If a verification tool fails, errors, or returns unexpected output, treat it as failure.
84
85
 
85
- **File system safety:** When scanning milestone directories for evidence, use `ls` or `find` to list directory contents first never pass a directory path (e.g. `tasks/`, `slices/`) directly to the `read` tool. The `read` tool only accepts file paths, not directories.
86
+ **File system safety:** When scanning milestone directories for evidence, use `ls` or `find` first. Never pass a directory path (e.g. `tasks/`, `slices/`) to `read`; it only accepts file paths.