gsd-pi 2.73.1 → 2.74.0-dev.6e23363

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 (471) hide show
  1. package/dist/cli-web-branch.d.ts +4 -3
  2. package/dist/cli-web-branch.js +10 -7
  3. package/dist/cli.js +184 -206
  4. package/dist/headless-query.js +4 -1
  5. package/dist/help-text.js +23 -0
  6. package/dist/logo.d.ts +1 -1
  7. package/dist/logo.js +1 -1
  8. package/dist/onboarding.js +59 -53
  9. package/dist/resource-loader.js +2 -2
  10. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +68 -4
  11. package/dist/resources/extensions/gsd/activity-log.js +16 -0
  12. package/dist/resources/extensions/gsd/auto/detect-stuck.js +11 -4
  13. package/dist/resources/extensions/gsd/auto/loop.js +147 -10
  14. package/dist/resources/extensions/gsd/auto/phases.js +173 -13
  15. package/dist/resources/extensions/gsd/auto/session.js +10 -0
  16. package/dist/resources/extensions/gsd/auto-dispatch.js +22 -4
  17. package/dist/resources/extensions/gsd/auto-model-selection.js +105 -16
  18. package/dist/resources/extensions/gsd/auto-post-unit.js +254 -15
  19. package/dist/resources/extensions/gsd/auto-prompts.js +12 -0
  20. package/dist/resources/extensions/gsd/auto-start.js +23 -6
  21. package/dist/resources/extensions/gsd/auto-timeout-recovery.js +13 -0
  22. package/dist/resources/extensions/gsd/auto-unit-closeout.js +18 -0
  23. package/dist/resources/extensions/gsd/auto-verification.js +186 -3
  24. package/dist/resources/extensions/gsd/auto.js +65 -12
  25. package/dist/resources/extensions/gsd/bootstrap/register-extension.js +21 -8
  26. package/dist/resources/extensions/gsd/commands/catalog.js +26 -1
  27. package/dist/resources/extensions/gsd/commands/handlers/ops.js +20 -0
  28. package/dist/resources/extensions/gsd/commands/handlers/workflow.js +68 -9
  29. package/dist/resources/extensions/gsd/commands-add-tests.js +111 -0
  30. package/dist/resources/extensions/gsd/commands-backlog.js +140 -0
  31. package/dist/resources/extensions/gsd/commands-do.js +79 -0
  32. package/dist/resources/extensions/gsd/commands-handlers.js +8 -2
  33. package/dist/resources/extensions/gsd/commands-maintenance.js +6 -6
  34. package/dist/resources/extensions/gsd/commands-pr-branch.js +180 -0
  35. package/dist/resources/extensions/gsd/commands-prefs-wizard.js +1 -1
  36. package/dist/resources/extensions/gsd/commands-session-report.js +82 -0
  37. package/dist/resources/extensions/gsd/commands-ship.js +187 -0
  38. package/dist/resources/extensions/gsd/db-writer.js +3 -5
  39. package/dist/resources/extensions/gsd/docs/preferences-reference.md +15 -2
  40. package/dist/resources/extensions/gsd/git-service.js +49 -1
  41. package/dist/resources/extensions/gsd/graph-context.js +157 -0
  42. package/dist/resources/extensions/gsd/gsd-db.js +581 -2
  43. package/dist/resources/extensions/gsd/guided-flow.js +23 -0
  44. package/dist/resources/extensions/gsd/index.js +15 -2
  45. package/dist/resources/extensions/gsd/init-wizard.js +1 -0
  46. package/dist/resources/extensions/gsd/journal.js +27 -0
  47. package/dist/resources/extensions/gsd/md-importer.js +3 -4
  48. package/dist/resources/extensions/gsd/memory-store.js +19 -51
  49. package/dist/resources/extensions/gsd/metrics.js +19 -0
  50. package/dist/resources/extensions/gsd/milestone-validation-gates.js +13 -12
  51. package/dist/resources/extensions/gsd/native-git-bridge.js +7 -4
  52. package/dist/resources/extensions/gsd/notification-widget.js +2 -2
  53. package/dist/resources/extensions/gsd/parallel-orchestrator.js +33 -1
  54. package/dist/resources/extensions/gsd/preferences-models.js +63 -3
  55. package/dist/resources/extensions/gsd/preferences-types.js +2 -0
  56. package/dist/resources/extensions/gsd/preferences-validation.js +130 -2
  57. package/dist/resources/extensions/gsd/preferences.js +26 -0
  58. package/dist/resources/extensions/gsd/prompts/add-tests.md +35 -0
  59. package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +12 -2
  60. package/dist/resources/extensions/gsd/state.js +66 -15
  61. package/dist/resources/extensions/gsd/templates/PREFERENCES.md +18 -0
  62. package/dist/resources/extensions/gsd/tools/complete-slice.js +20 -0
  63. package/dist/resources/extensions/gsd/tools/validate-milestone.js +39 -4
  64. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +3 -14
  65. package/dist/resources/extensions/gsd/triage-resolution.js +2 -5
  66. package/dist/resources/extensions/gsd/unit-ownership.js +1 -1
  67. package/dist/resources/extensions/gsd/uok/audit-toggle.js +7 -0
  68. package/dist/resources/extensions/gsd/uok/audit.js +40 -0
  69. package/dist/resources/extensions/gsd/uok/contracts.js +1 -0
  70. package/dist/resources/extensions/gsd/uok/execution-graph.js +179 -0
  71. package/dist/resources/extensions/gsd/uok/flags.js +29 -0
  72. package/dist/resources/extensions/gsd/uok/gate-runner.js +109 -0
  73. package/dist/resources/extensions/gsd/uok/gitops.js +53 -0
  74. package/dist/resources/extensions/gsd/uok/kernel.js +80 -0
  75. package/dist/resources/extensions/gsd/uok/loop-adapter.js +133 -0
  76. package/dist/resources/extensions/gsd/uok/model-policy.js +66 -0
  77. package/dist/resources/extensions/gsd/uok/plan-v2.js +132 -0
  78. package/dist/resources/extensions/gsd/workflow-logger.js +22 -0
  79. package/dist/resources/extensions/gsd/workflow-manifest.js +8 -69
  80. package/dist/resources/extensions/gsd/workflow-migration.js +21 -22
  81. package/dist/resources/extensions/gsd/workflow-projections.js +4 -1
  82. package/dist/resources/extensions/gsd/workflow-reconcile.js +14 -11
  83. package/dist/resources/extensions/ttsr/ttsr-manager.js +3 -1
  84. package/dist/tsconfig.extensions.tsbuildinfo +1 -0
  85. package/dist/update-check.d.ts +1 -0
  86. package/dist/update-check.js +13 -5
  87. package/dist/update-cmd.js +4 -3
  88. package/dist/web/standalone/.next/BUILD_ID +1 -1
  89. package/dist/web/standalone/.next/app-path-routes-manifest.json +5 -5
  90. package/dist/web/standalone/.next/build-manifest.json +3 -3
  91. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  92. package/dist/web/standalone/.next/required-server-files.json +3 -3
  93. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  94. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  95. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  96. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  97. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  98. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  99. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  100. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  101. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  102. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  103. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  104. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  105. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  106. package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
  107. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  108. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  109. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  110. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  111. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  112. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  113. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  114. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  115. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  116. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  117. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  118. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  119. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  120. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  121. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  122. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  123. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  124. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  125. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  126. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  127. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  132. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  152. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  162. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  163. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  168. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
  182. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  184. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  185. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  186. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  187. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
  188. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  189. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  190. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  191. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  192. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  193. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  194. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  195. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  196. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  197. package/dist/web/standalone/.next/server/app/index.html +1 -1
  198. package/dist/web/standalone/.next/server/app/index.rsc +4 -4
  199. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  200. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  201. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  202. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  203. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  204. package/dist/web/standalone/.next/server/app/page.js +2 -2
  205. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  206. package/dist/web/standalone/.next/server/app-paths-manifest.json +5 -5
  207. package/dist/web/standalone/.next/server/chunks/63.js +3 -3
  208. package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
  209. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  210. package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
  211. package/dist/web/standalone/.next/server/middleware.js +2 -2
  212. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  213. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  214. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  215. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  216. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  217. package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
  218. package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
  219. package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
  220. package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
  221. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  222. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  223. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  224. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  225. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  226. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  227. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  228. package/dist/web/standalone/server.js +1 -1
  229. package/package.json +3 -3
  230. package/packages/daemon/package.json +2 -2
  231. package/packages/mcp-server/dist/index.d.ts +3 -0
  232. package/packages/mcp-server/dist/index.d.ts.map +1 -1
  233. package/packages/mcp-server/dist/index.js +3 -0
  234. package/packages/mcp-server/dist/index.js.map +1 -1
  235. package/packages/mcp-server/dist/readers/graph.d.ts +87 -0
  236. package/packages/mcp-server/dist/readers/graph.d.ts.map +1 -0
  237. package/packages/mcp-server/dist/readers/graph.js +548 -0
  238. package/packages/mcp-server/dist/readers/graph.js.map +1 -0
  239. package/packages/mcp-server/dist/readers/index.d.ts +2 -0
  240. package/packages/mcp-server/dist/readers/index.d.ts.map +1 -1
  241. package/packages/mcp-server/dist/readers/index.js +1 -0
  242. package/packages/mcp-server/dist/readers/index.js.map +1 -1
  243. package/packages/mcp-server/dist/server.d.ts.map +1 -1
  244. package/packages/mcp-server/dist/server.js +65 -0
  245. package/packages/mcp-server/dist/server.js.map +1 -1
  246. package/packages/mcp-server/package.json +2 -2
  247. package/packages/mcp-server/src/index.ts +15 -0
  248. package/packages/mcp-server/src/readers/graph.test.ts +426 -0
  249. package/packages/mcp-server/src/readers/graph.ts +708 -0
  250. package/packages/mcp-server/src/readers/index.ts +12 -0
  251. package/packages/mcp-server/src/server.ts +83 -0
  252. package/packages/mcp-server/tsconfig.json +1 -0
  253. package/packages/mcp-server/tsconfig.tsbuildinfo +1 -0
  254. package/packages/native/package.json +2 -2
  255. package/packages/native/tsconfig.tsbuildinfo +1 -0
  256. package/packages/pi-agent-core/package.json +1 -1
  257. package/packages/pi-agent-core/tsconfig.json +1 -0
  258. package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -0
  259. package/packages/pi-ai/dist/index.d.ts +1 -0
  260. package/packages/pi-ai/dist/index.d.ts.map +1 -1
  261. package/packages/pi-ai/dist/index.js +1 -0
  262. package/packages/pi-ai/dist/index.js.map +1 -1
  263. package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  264. package/packages/pi-ai/dist/utils/overflow.js +12 -0
  265. package/packages/pi-ai/dist/utils/overflow.js.map +1 -1
  266. package/packages/pi-ai/dist/utils/tests/overflow.test.d.ts +2 -0
  267. package/packages/pi-ai/dist/utils/tests/overflow.test.d.ts.map +1 -0
  268. package/packages/pi-ai/dist/utils/tests/overflow.test.js +50 -0
  269. package/packages/pi-ai/dist/utils/tests/overflow.test.js.map +1 -0
  270. package/packages/pi-ai/package.json +1 -1
  271. package/packages/pi-ai/src/index.ts +4 -0
  272. package/packages/pi-ai/src/utils/overflow.ts +14 -1
  273. package/packages/pi-ai/src/utils/tests/overflow.test.ts +58 -0
  274. package/packages/pi-ai/tsconfig.json +1 -0
  275. package/packages/pi-ai/tsconfig.tsbuildinfo +1 -0
  276. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +433 -8
  277. package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
  278. package/packages/pi-coding-agent/dist/core/compaction/utils.js +5 -5
  279. package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
  280. package/packages/pi-coding-agent/dist/core/compaction-utils.test.d.ts +2 -0
  281. package/packages/pi-coding-agent/dist/core/compaction-utils.test.d.ts.map +1 -0
  282. package/packages/pi-coding-agent/dist/core/compaction-utils.test.js +45 -0
  283. package/packages/pi-coding-agent/dist/core/compaction-utils.test.js.map +1 -0
  284. package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.d.ts +2 -0
  285. package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.d.ts.map +1 -0
  286. package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.js +52 -0
  287. package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.js.map +1 -0
  288. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  289. package/packages/pi-coding-agent/dist/core/model-registry.js +2 -2
  290. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  291. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +12 -2
  292. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  293. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +61 -28
  294. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
  295. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +2 -1
  296. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  297. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +9 -3
  298. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  299. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.d.ts +2 -0
  300. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.d.ts.map +1 -0
  301. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js +52 -0
  302. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js.map +1 -0
  303. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
  304. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +142 -20
  305. package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
  306. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  307. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +11 -3
  308. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  309. package/packages/pi-coding-agent/package.json +1 -1
  310. package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +521 -8
  311. package/packages/pi-coding-agent/src/core/compaction/utils.ts +5 -5
  312. package/packages/pi-coding-agent/src/core/compaction-utils.test.ts +50 -0
  313. package/packages/pi-coding-agent/src/core/model-registry-env-fallback.test.ts +59 -0
  314. package/packages/pi-coding-agent/src/core/model-registry.ts +2 -1
  315. package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +74 -32
  316. package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.test.ts +73 -0
  317. package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +9 -3
  318. package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +166 -25
  319. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +11 -3
  320. package/packages/pi-coding-agent/src/types/ambient-modules.d.ts +69 -0
  321. package/packages/pi-coding-agent/tsconfig.json +3 -2
  322. package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -0
  323. package/packages/pi-tui/dist/__tests__/tui.test.js +60 -1
  324. package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
  325. package/packages/pi-tui/dist/tui.d.ts +8 -0
  326. package/packages/pi-tui/dist/tui.d.ts.map +1 -1
  327. package/packages/pi-tui/dist/tui.js +32 -3
  328. package/packages/pi-tui/dist/tui.js.map +1 -1
  329. package/packages/pi-tui/package.json +1 -1
  330. package/packages/pi-tui/src/__tests__/tui.test.ts +76 -1
  331. package/packages/pi-tui/src/tui.ts +31 -3
  332. package/packages/pi-tui/tsconfig.json +1 -0
  333. package/packages/pi-tui/tsconfig.tsbuildinfo +1 -0
  334. package/packages/rpc-client/package.json +1 -1
  335. package/packages/rpc-client/tsconfig.json +1 -0
  336. package/packages/rpc-client/tsconfig.tsbuildinfo +1 -0
  337. package/pkg/package.json +1 -1
  338. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +107 -5
  339. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +111 -2
  340. package/src/resources/extensions/gsd/activity-log.ts +21 -0
  341. package/src/resources/extensions/gsd/auto/detect-stuck.ts +12 -4
  342. package/src/resources/extensions/gsd/auto/loop-deps.ts +10 -0
  343. package/src/resources/extensions/gsd/auto/loop.ts +159 -10
  344. package/src/resources/extensions/gsd/auto/phases.ts +213 -13
  345. package/src/resources/extensions/gsd/auto/session.ts +10 -0
  346. package/src/resources/extensions/gsd/auto-dispatch.ts +26 -10
  347. package/src/resources/extensions/gsd/auto-model-selection.ts +151 -16
  348. package/src/resources/extensions/gsd/auto-post-unit.ts +278 -16
  349. package/src/resources/extensions/gsd/auto-prompts.ts +13 -0
  350. package/src/resources/extensions/gsd/auto-start.ts +30 -6
  351. package/src/resources/extensions/gsd/auto-timeout-recovery.ts +17 -0
  352. package/src/resources/extensions/gsd/auto-unit-closeout.ts +25 -1
  353. package/src/resources/extensions/gsd/auto-verification.ts +225 -3
  354. package/src/resources/extensions/gsd/auto.ts +72 -16
  355. package/src/resources/extensions/gsd/bootstrap/register-extension.ts +24 -8
  356. package/src/resources/extensions/gsd/commands/catalog.ts +26 -1
  357. package/src/resources/extensions/gsd/commands/handlers/ops.ts +20 -0
  358. package/src/resources/extensions/gsd/commands/handlers/workflow.ts +74 -9
  359. package/src/resources/extensions/gsd/commands-add-tests.ts +137 -0
  360. package/src/resources/extensions/gsd/commands-backlog.ts +182 -0
  361. package/src/resources/extensions/gsd/commands-do.ts +109 -0
  362. package/src/resources/extensions/gsd/commands-handlers.ts +8 -2
  363. package/src/resources/extensions/gsd/commands-maintenance.ts +6 -6
  364. package/src/resources/extensions/gsd/commands-pr-branch.ts +234 -0
  365. package/src/resources/extensions/gsd/commands-prefs-wizard.ts +1 -1
  366. package/src/resources/extensions/gsd/commands-session-report.ts +101 -0
  367. package/src/resources/extensions/gsd/commands-ship.ts +219 -0
  368. package/src/resources/extensions/gsd/db-writer.ts +3 -5
  369. package/src/resources/extensions/gsd/docs/preferences-reference.md +15 -2
  370. package/src/resources/extensions/gsd/git-service.ts +68 -0
  371. package/src/resources/extensions/gsd/graph-context.ts +212 -0
  372. package/src/resources/extensions/gsd/gsd-db.ts +788 -3
  373. package/src/resources/extensions/gsd/guided-flow.ts +32 -0
  374. package/src/resources/extensions/gsd/index.ts +18 -2
  375. package/src/resources/extensions/gsd/init-wizard.ts +3 -2
  376. package/src/resources/extensions/gsd/journal.ts +30 -0
  377. package/src/resources/extensions/gsd/md-importer.ts +3 -5
  378. package/src/resources/extensions/gsd/memory-store.ts +31 -62
  379. package/src/resources/extensions/gsd/metrics.ts +26 -0
  380. package/src/resources/extensions/gsd/milestone-validation-gates.ts +13 -14
  381. package/src/resources/extensions/gsd/native-git-bridge.ts +11 -12
  382. package/src/resources/extensions/gsd/notification-widget.ts +2 -2
  383. package/src/resources/extensions/gsd/parallel-orchestrator.ts +40 -1
  384. package/src/resources/extensions/gsd/preferences-models.ts +61 -3
  385. package/src/resources/extensions/gsd/preferences-types.ts +44 -0
  386. package/src/resources/extensions/gsd/preferences-validation.ts +130 -2
  387. package/src/resources/extensions/gsd/preferences.ts +28 -0
  388. package/src/resources/extensions/gsd/prompts/add-tests.md +35 -0
  389. package/src/resources/extensions/gsd/session-lock.ts +14 -2
  390. package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +20 -1
  391. package/src/resources/extensions/gsd/state.ts +80 -17
  392. package/src/resources/extensions/gsd/templates/PREFERENCES.md +18 -0
  393. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +9 -5
  394. package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +20 -0
  395. package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +53 -0
  396. package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +7 -3
  397. package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +51 -2
  398. package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +6 -2
  399. package/src/resources/extensions/gsd/tests/commands-backlog.test.ts +158 -0
  400. package/src/resources/extensions/gsd/tests/commands-do.test.ts +127 -0
  401. package/src/resources/extensions/gsd/tests/commands-pr-branch.test.ts +68 -0
  402. package/src/resources/extensions/gsd/tests/commands-session-report.test.ts +82 -0
  403. package/src/resources/extensions/gsd/tests/commands-ship.test.ts +71 -0
  404. package/src/resources/extensions/gsd/tests/commands-workflow-custom.test.ts +14 -0
  405. package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +142 -0
  406. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
  407. package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
  408. package/src/resources/extensions/gsd/tests/completed-at-reconcile.test.ts +42 -0
  409. package/src/resources/extensions/gsd/tests/derive-state-crossval.test.ts +3 -2
  410. package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +3 -2
  411. package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +68 -8
  412. package/src/resources/extensions/gsd/tests/derive-state.test.ts +3 -3
  413. package/src/resources/extensions/gsd/tests/extension-bootstrap-isolation.test.ts +154 -0
  414. package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +10 -7
  415. package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +137 -1
  416. package/src/resources/extensions/gsd/tests/graph-context.test.ts +337 -0
  417. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +1 -1
  418. package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +4 -2
  419. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +68 -1
  420. package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -2
  421. package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -3
  422. package/src/resources/extensions/gsd/tests/model-isolation.test.ts +91 -2
  423. package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +140 -0
  424. package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +79 -1
  425. package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +2 -1
  426. package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +40 -1
  427. package/src/resources/extensions/gsd/tests/preferences.test.ts +47 -0
  428. package/src/resources/extensions/gsd/tests/single-writer-invariant.test.ts +180 -0
  429. package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +5 -7
  430. package/src/resources/extensions/gsd/tests/token-profile.test.ts +9 -6
  431. package/src/resources/extensions/gsd/tests/uok-audit-unified.test.ts +101 -0
  432. package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +85 -0
  433. package/src/resources/extensions/gsd/tests/uok-execution-graph.test.ts +69 -0
  434. package/src/resources/extensions/gsd/tests/uok-flags.test.ts +39 -0
  435. package/src/resources/extensions/gsd/tests/uok-gate-runner.test.ts +70 -0
  436. package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +85 -0
  437. package/src/resources/extensions/gsd/tests/uok-gitops-wiring.test.ts +35 -0
  438. package/src/resources/extensions/gsd/tests/uok-model-policy.test.ts +89 -0
  439. package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +167 -0
  440. package/src/resources/extensions/gsd/tests/uok-preferences.test.ts +42 -0
  441. package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +179 -0
  442. package/src/resources/extensions/gsd/tests/validate-milestone-write-order.test.ts +39 -0
  443. package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +223 -0
  444. package/src/resources/extensions/gsd/tools/complete-slice.ts +26 -0
  445. package/src/resources/extensions/gsd/tools/validate-milestone.ts +48 -3
  446. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +3 -11
  447. package/src/resources/extensions/gsd/triage-resolution.ts +2 -7
  448. package/src/resources/extensions/gsd/types.ts +1 -1
  449. package/src/resources/extensions/gsd/unit-ownership.ts +2 -2
  450. package/src/resources/extensions/gsd/uok/audit-toggle.ts +9 -0
  451. package/src/resources/extensions/gsd/uok/audit.ts +51 -0
  452. package/src/resources/extensions/gsd/uok/contracts.ts +135 -0
  453. package/src/resources/extensions/gsd/uok/execution-graph.ts +241 -0
  454. package/src/resources/extensions/gsd/uok/flags.ts +45 -0
  455. package/src/resources/extensions/gsd/uok/gate-runner.ts +146 -0
  456. package/src/resources/extensions/gsd/uok/gitops.ts +75 -0
  457. package/src/resources/extensions/gsd/uok/kernel.ts +105 -0
  458. package/src/resources/extensions/gsd/uok/loop-adapter.ts +162 -0
  459. package/src/resources/extensions/gsd/uok/model-policy.ts +112 -0
  460. package/src/resources/extensions/gsd/uok/plan-v2.ts +156 -0
  461. package/src/resources/extensions/gsd/workflow-logger.ts +25 -0
  462. package/src/resources/extensions/gsd/workflow-manifest.ts +9 -104
  463. package/src/resources/extensions/gsd/workflow-migration.ts +21 -29
  464. package/src/resources/extensions/gsd/workflow-projections.ts +8 -1
  465. package/src/resources/extensions/gsd/workflow-reconcile.ts +15 -15
  466. package/src/resources/extensions/ttsr/ttsr-manager.ts +10 -5
  467. package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
  468. package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
  469. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
  470. /package/dist/web/standalone/.next/static/{Qr27MOHx0lxRGnJvlhxxu → bc2gRVFTgD7j--BsJE7vP}/_buildManifest.js +0 -0
  471. /package/dist/web/standalone/.next/static/{Qr27MOHx0lxRGnJvlhxxu → bc2gRVFTgD7j--BsJE7vP}/_ssgManifest.js +0 -0
@@ -1,9 +1,10 @@
1
1
  import { launchWebMode, stopWebMode, type WebModeLaunchStatus, type WebModeStopOptions, type WebModeStopResult } from './web-mode.js';
2
2
  export interface CliFlags {
3
- mode?: 'text' | 'json' | 'rpc';
3
+ mode?: 'text' | 'json' | 'rpc' | 'mcp';
4
4
  print?: boolean;
5
5
  continue?: boolean;
6
6
  noSession?: boolean;
7
+ worktree?: boolean | string;
7
8
  model?: string;
8
9
  listModels?: string | true;
9
10
  extensions: string[];
@@ -19,8 +20,8 @@ export interface CliFlags {
19
20
  webPort?: number;
20
21
  /** Additional allowed origins for CORS: `--allowed-origins http://192.168.1.10:8080` */
21
22
  webAllowedOrigins?: string[];
22
- help?: boolean;
23
- version?: boolean;
23
+ /** Set by `gsd sessions` when the user picks a specific session to resume */
24
+ _selectedSessionPath?: string;
24
25
  }
25
26
  type WritableLike = Pick<typeof process.stderr, 'write'>;
26
27
  export interface RunWebCliBranchDeps {
@@ -10,7 +10,7 @@ export function parseCliArgs(argv) {
10
10
  const arg = args[i];
11
11
  if (arg === '--mode' && i + 1 < args.length) {
12
12
  const mode = args[++i];
13
- if (mode === 'text' || mode === 'json' || mode === 'rpc')
13
+ if (mode === 'text' || mode === 'json' || mode === 'rpc' || mode === 'mcp')
14
14
  flags.mode = mode;
15
15
  }
16
16
  else if (arg === '--print' || arg === '-p') {
@@ -22,6 +22,15 @@ export function parseCliArgs(argv) {
22
22
  else if (arg === '--no-session') {
23
23
  flags.noSession = true;
24
24
  }
25
+ else if (arg === '--worktree' || arg === '-w') {
26
+ // -w with no value → auto-generate name; -w <name> → use that name
27
+ if (i + 1 < args.length && !args[i + 1].startsWith('-')) {
28
+ flags.worktree = args[++i];
29
+ }
30
+ else {
31
+ flags.worktree = true;
32
+ }
33
+ }
25
34
  else if (arg === '--web') {
26
35
  flags.web = true;
27
36
  // Peek at next arg — if it looks like a path (not another flag), capture it
@@ -58,12 +67,6 @@ export function parseCliArgs(argv) {
58
67
  else if (arg === '--list-models') {
59
68
  flags.listModels = (i + 1 < args.length && !args[i + 1].startsWith('-')) ? args[++i] : true;
60
69
  }
61
- else if (arg === '--version' || arg === '-v') {
62
- flags.version = true;
63
- }
64
- else if (arg === '--help' || arg === '-h') {
65
- flags.help = true;
66
- }
67
70
  else if (!arg.startsWith('--') && !arg.startsWith('-')) {
68
71
  flags.messages.push(arg);
69
72
  }
package/dist/cli.js CHANGED
@@ -5,13 +5,14 @@ import { agentDir, sessionsDir, authFilePath } from './app-paths.js';
5
5
  import { initResources, buildResourceLoader, getNewerManagedResourceVersion } from './resource-loader.js';
6
6
  import { ensureManagedTools } from './tool-bootstrap.js';
7
7
  import { loadStoredEnvKeys } from './wizard.js';
8
- import { migratePiCredentials, getPiDefaultModelAndProvider } from './pi-migration.js';
8
+ import { migratePiCredentials } from './pi-migration.js';
9
9
  import { shouldRunOnboarding, runOnboarding } from './onboarding.js';
10
10
  import chalk from 'chalk';
11
11
  import { checkForUpdates } from './update-check.js';
12
12
  import { printHelp, printSubcommandHelp } from './help-text.js';
13
13
  import { applySecurityOverrides } from './security-overrides.js';
14
- import { parseCliArgs as parseWebCliArgs, runWebCliBranch, migrateLegacyFlatSessions, } from './cli-web-branch.js';
14
+ import { validateConfiguredModel } from './startup-model-validation.js';
15
+ import { parseCliArgs, runWebCliBranch, migrateLegacyFlatSessions, } from './cli-web-branch.js';
15
16
  import { stopWebMode } from './web-mode.js';
16
17
  import { getProjectSessionsDir } from './project-sessions.js';
17
18
  import { markStartup, printStartupTimings } from './startup-timings.js';
@@ -36,112 +37,85 @@ function exitIfManagedResourcesAreNewer(currentAgentDir) {
36
37
  `[gsd] Run ${chalk.bold('npm install -g gsd-pi@latest')} or ${chalk.bold('gsd update')}, then try again.\n`);
37
38
  process.exit(1);
38
39
  }
39
- function parseCliArgs(argv) {
40
- const flags = { extensions: [], messages: [] };
41
- const args = argv.slice(2); // skip node + script
42
- for (let i = 0; i < args.length; i++) {
43
- const arg = args[i];
44
- if (arg === '--mode' && i + 1 < args.length) {
45
- const m = args[++i];
46
- if (m === 'text' || m === 'json' || m === 'rpc' || m === 'mcp')
47
- flags.mode = m;
48
- }
49
- else if (arg === '--print' || arg === '-p') {
50
- flags.print = true;
51
- }
52
- else if (arg === '--continue' || arg === '-c') {
53
- flags.continue = true;
54
- }
55
- else if (arg === '--no-session') {
56
- flags.noSession = true;
57
- }
58
- else if (arg === '--model' && i + 1 < args.length) {
59
- flags.model = args[++i];
60
- }
61
- else if (arg === '--extension' && i + 1 < args.length) {
62
- flags.extensions.push(args[++i]);
63
- }
64
- else if (arg === '--append-system-prompt' && i + 1 < args.length) {
65
- flags.appendSystemPrompt = args[++i];
66
- }
67
- else if (arg === '--tools' && i + 1 < args.length) {
68
- flags.tools = args[++i].split(',');
69
- }
70
- else if (arg === '--list-models') {
71
- flags.listModels = (i + 1 < args.length && !args[i + 1].startsWith('-')) ? args[++i] : true;
72
- }
73
- else if (arg === '--version' || arg === '-v') {
74
- process.stdout.write((process.env.GSD_VERSION || '0.0.0') + '\n');
75
- process.exit(0);
76
- }
77
- else if (arg === '--worktree' || arg === '-w') {
78
- // -w with no value → auto-generate name; -w <name> → use that name
79
- if (i + 1 < args.length && !args[i + 1].startsWith('-')) {
80
- flags.worktree = args[++i];
81
- }
82
- else {
83
- flags.worktree = true;
84
- }
85
- }
86
- else if (arg === '--help' || arg === '-h') {
87
- printHelp(process.env.GSD_VERSION || '0.0.0');
88
- process.exit(0);
89
- }
90
- else if (arg === '--web') {
91
- flags.web = true;
92
- // Capture optional project path after --web (not a flag)
93
- if (i + 1 < args.length && !args[i + 1].startsWith('-')) {
94
- flags.webPath = args[++i];
95
- }
96
- }
97
- else if (!arg.startsWith('--') && !arg.startsWith('-')) {
98
- flags.messages.push(arg);
99
- }
40
+ // ---------------------------------------------------------------------------
41
+ // Shared helpers used by both the print and interactive code paths
42
+ // ---------------------------------------------------------------------------
43
+ /**
44
+ * Print the non-interactive-mode error and exit. Called both from the early
45
+ * TTY gate (before heavy init) and from the interactive-mode TTY gate right
46
+ * before `InteractiveMode.run()`. The `includeWebHint` variant also lists
47
+ * `--web` and `headless` as alternatives.
48
+ */
49
+ function printNonTtyErrorAndExit(missing, includeWebHint) {
50
+ const suffix = missing ? ` but ${missing} not a TTY` : '';
51
+ process.stderr.write(`[gsd] Error: Interactive mode requires a terminal (TTY)${suffix}.\n`);
52
+ process.stderr.write('[gsd] Non-interactive alternatives:\n');
53
+ process.stderr.write('[gsd] gsd auto Auto-mode (pipeable, no TUI)\n');
54
+ process.stderr.write('[gsd] gsd --print "your message" Single-shot prompt\n');
55
+ if (includeWebHint) {
56
+ process.stderr.write('[gsd] gsd --web [path] Browser-only web mode\n');
57
+ }
58
+ process.stderr.write('[gsd] gsd --mode rpc JSON-RPC over stdin/stdout\n');
59
+ process.stderr.write('[gsd] gsd --mode mcp MCP server over stdin/stdout\n');
60
+ process.stderr.write('[gsd] gsd --mode text "message" Text output mode\n');
61
+ if (includeWebHint) {
62
+ process.stderr.write('[gsd] gsd headless Auto-mode without TUI\n');
100
63
  }
101
- return flags;
64
+ process.exit(1);
102
65
  }
103
66
  /**
104
- * Validate the configured default model against the registry and reset it if
105
- * it no longer exists. Must run AFTER extensions have registered their
106
- * providers so that extension models (e.g. pi-claude-cli) are visible.
67
+ * Print extension load/conflict errors from an extensions result. Downgrades
68
+ * conflicts with built-in tools to warnings (#1347).
107
69
  */
108
- function validateConfiguredModel(modelRegistry, settingsManager) {
109
- const configuredProvider = settingsManager.getDefaultProvider();
110
- const configuredModel = settingsManager.getDefaultModel();
111
- const allModels = modelRegistry.getAll();
112
- const availableModels = modelRegistry.getAvailable();
113
- const configuredExists = configuredProvider && configuredModel &&
114
- allModels.some((m) => m.provider === configuredProvider && m.id === configuredModel);
115
- const configuredAvailable = configuredProvider && configuredModel &&
116
- availableModels.some((m) => m.provider === configuredProvider && m.id === configuredModel);
117
- if (!configuredModel || !configuredExists) {
118
- // Model not configured at all, or removed from registry — pick a fallback.
119
- // Only fires when the model is genuinely unknown (not just temporarily unavailable).
120
- const piDefault = getPiDefaultModelAndProvider();
121
- const preferred = (piDefault
122
- ? availableModels.find((m) => m.provider === piDefault.provider && m.id === piDefault.model)
123
- : undefined) ||
124
- availableModels.find((m) => m.provider === 'openai' && m.id === 'gpt-5.4') ||
125
- availableModels.find((m) => m.provider === 'openai') ||
126
- availableModels.find((m) => m.provider === 'anthropic' && m.id === 'claude-opus-4-6') ||
127
- availableModels.find((m) => m.provider === 'anthropic' && m.id.includes('opus')) ||
128
- availableModels.find((m) => m.provider === 'anthropic') ||
129
- availableModels[0];
130
- if (preferred) {
131
- settingsManager.setDefaultModelAndProvider(preferred.provider, preferred.id);
132
- }
70
+ function printExtensionErrors(errors) {
71
+ for (const err of errors) {
72
+ const isConflict = err.error.includes('supersedes') || err.error.includes('conflicts with');
73
+ const prefix = isConflict ? 'Extension conflict' : 'Extension load error';
74
+ process.stderr.write(`[gsd] ${prefix}: ${err.error}\n`);
75
+ }
76
+ }
77
+ /**
78
+ * Re-apply the validated model to the session when `createAgentSession()`
79
+ * reports that it had to use a fallback. Prevents silently overriding the
80
+ * persisted model of resumed conversations (#3534).
81
+ */
82
+ async function reapplyValidatedModelOnFallback(session, modelRegistry, settingsManager, fallbackMessage) {
83
+ if (!fallbackMessage)
84
+ return;
85
+ const validatedProvider = settingsManager.getDefaultProvider();
86
+ const validatedModelId = settingsManager.getDefaultModel();
87
+ if (!validatedProvider || !validatedModelId)
88
+ return;
89
+ const correctModel = modelRegistry.getAvailable()
90
+ .find((m) => m.provider === validatedProvider && m.id === validatedModelId);
91
+ if (!correctModel)
92
+ return;
93
+ try {
94
+ await session.setModel(correctModel);
133
95
  }
134
- if (settingsManager.getDefaultThinkingLevel() !== 'off' && !configuredExists) {
135
- settingsManager.setDefaultThinkingLevel('off');
96
+ catch {
97
+ // Provider not ready — leave session on its current model
136
98
  }
137
99
  }
138
100
  const cliFlags = parseCliArgs(process.argv);
139
101
  const isPrintMode = cliFlags.print || cliFlags.mode !== undefined;
140
- // Early resource-skew checkmust run before TTY gate so version mismatch
141
- // errors surface even in non-TTY environments.
142
- async function ensureRtkBootstrap() {
143
- if (ensureRtkBootstrap._done)
144
- return;
102
+ // `gsd [subcommand] --help` / `-h` print help before any subcommand runs.
103
+ // loader.ts only catches --help/-h as the *first* arg; here we handle the
104
+ // case where it appears later (e.g. `gsd update --help`, `gsd --foo --help`).
105
+ // Prefer subcommand-specific help when the first positional is a known
106
+ // subcommand, otherwise fall back to general help.
107
+ if (process.argv.includes('--help') || process.argv.includes('-h')) {
108
+ const helpSubcommand = cliFlags.messages[0];
109
+ const version = process.env.GSD_VERSION || '0.0.0';
110
+ if (!helpSubcommand || !printSubcommandHelp(helpSubcommand, version)) {
111
+ printHelp(version);
112
+ }
113
+ process.exit(0);
114
+ }
115
+ // RTK bootstrap — runs once per process, memoized via a module-level promise
116
+ // so concurrent callers await the same initialization.
117
+ let rtkBootstrapPromise;
118
+ async function doRtkBootstrap() {
145
119
  // RTK is opt-in via experimental.rtk preference. Default: disabled.
146
120
  // Honor GSD_RTK_DISABLED if already explicitly set in the environment
147
121
  // (env var takes precedence over preferences for manual override).
@@ -149,42 +123,115 @@ async function ensureRtkBootstrap() {
149
123
  const prefs = loadEffectiveGSDPreferences();
150
124
  const rtkEnabled = prefs?.preferences.experimental?.rtk === true;
151
125
  if (!rtkEnabled) {
152
- process.env[GSD_RTK_DISABLED_ENV] = "1";
126
+ process.env[GSD_RTK_DISABLED_ENV] = '1';
153
127
  }
154
128
  }
155
129
  const rtkStatus = await bootstrapRtk();
156
- ensureRtkBootstrap._done = true;
157
130
  markStartup('bootstrapRtk');
158
131
  if (!rtkStatus.available && rtkStatus.supported && rtkStatus.enabled && rtkStatus.reason) {
159
132
  process.stderr.write(`[gsd] Warning: RTK unavailable — continuing without shell-command compression (${rtkStatus.reason}).\n`);
160
133
  }
161
134
  }
135
+ function ensureRtkBootstrap() {
136
+ return (rtkBootstrapPromise ??= doRtkBootstrap());
137
+ }
162
138
  // `gsd update` — update to the latest version via npm
163
139
  if (cliFlags.messages[0] === 'update') {
164
140
  const { runUpdate } = await import('./update-cmd.js');
165
141
  await runUpdate();
166
142
  process.exit(0);
167
143
  }
144
+ // ---------------------------------------------------------------------------
145
+ // Graph subcommand — `gsd graph build|status|query|diff`
146
+ // ---------------------------------------------------------------------------
147
+ if (cliFlags.messages[0] === 'graph') {
148
+ const sub = cliFlags.messages[1];
149
+ const { buildGraph, writeGraph, graphStatus, graphQuery, graphDiff, resolveGsdRoot } = await import('@gsd-build/mcp-server');
150
+ const projectDir = process.cwd();
151
+ const gsdRoot = resolveGsdRoot(projectDir);
152
+ if (!sub || sub === 'build') {
153
+ try {
154
+ const graph = await buildGraph(projectDir);
155
+ await writeGraph(gsdRoot, graph);
156
+ process.stdout.write(`Graph built: ${graph.nodes.length} nodes, ${graph.edges.length} edges\n`);
157
+ }
158
+ catch (err) {
159
+ process.stderr.write(`[gsd] graph build failed: ${err instanceof Error ? err.message : String(err)}\n`);
160
+ process.exit(1);
161
+ }
162
+ }
163
+ else if (sub === 'status') {
164
+ try {
165
+ const result = await graphStatus(projectDir);
166
+ if (!result.exists) {
167
+ process.stdout.write('Graph: not built yet. Run: gsd graph build\n');
168
+ }
169
+ else {
170
+ process.stdout.write(`Graph status:\n`);
171
+ process.stdout.write(` exists: ${result.exists}\n`);
172
+ process.stdout.write(` nodes: ${result.nodeCount}\n`);
173
+ process.stdout.write(` edges: ${result.edgeCount}\n`);
174
+ process.stdout.write(` stale: ${result.stale}\n`);
175
+ process.stdout.write(` ageHours: ${result.ageHours !== undefined ? result.ageHours.toFixed(2) : 'n/a'}\n`);
176
+ process.stdout.write(` lastBuild: ${result.lastBuild ?? 'n/a'}\n`);
177
+ }
178
+ }
179
+ catch (err) {
180
+ process.stderr.write(`[gsd] graph status failed: ${err instanceof Error ? err.message : String(err)}\n`);
181
+ process.exit(1);
182
+ }
183
+ }
184
+ else if (sub === 'query') {
185
+ const term = cliFlags.messages[2];
186
+ if (!term) {
187
+ process.stderr.write('Usage: gsd graph query <term>\n');
188
+ process.exit(1);
189
+ }
190
+ try {
191
+ const result = await graphQuery(projectDir, term);
192
+ if (result.nodes.length === 0) {
193
+ process.stdout.write(`No nodes found for term: "${term}"\n`);
194
+ }
195
+ else {
196
+ process.stdout.write(`Query results for "${term}" (${result.nodes.length} nodes, ${result.edges.length} edges):\n`);
197
+ for (const node of result.nodes) {
198
+ process.stdout.write(` [${node.type}] ${node.label} (${node.confidence})\n`);
199
+ }
200
+ }
201
+ }
202
+ catch (err) {
203
+ process.stderr.write(`[gsd] graph query failed: ${err instanceof Error ? err.message : String(err)}\n`);
204
+ process.exit(1);
205
+ }
206
+ }
207
+ else if (sub === 'diff') {
208
+ try {
209
+ const result = await graphDiff(projectDir);
210
+ process.stdout.write(`Graph diff:\n`);
211
+ process.stdout.write(` nodes added: ${result.nodes.added.length}\n`);
212
+ process.stdout.write(` nodes removed: ${result.nodes.removed.length}\n`);
213
+ process.stdout.write(` nodes changed: ${result.nodes.changed.length}\n`);
214
+ process.stdout.write(` edges added: ${result.edges.added.length}\n`);
215
+ process.stdout.write(` edges removed: ${result.edges.removed.length}\n`);
216
+ }
217
+ catch (err) {
218
+ process.stderr.write(`[gsd] graph diff failed: ${err instanceof Error ? err.message : String(err)}\n`);
219
+ process.exit(1);
220
+ }
221
+ }
222
+ else {
223
+ process.stderr.write(`Unknown graph command: ${sub}\n`);
224
+ process.stderr.write('Commands: build, status, query <term>, diff\n');
225
+ process.exit(1);
226
+ }
227
+ process.exit(0);
228
+ }
168
229
  exitIfManagedResourcesAreNewer(agentDir);
169
230
  // Early TTY check — must come before heavy initialization to avoid dangling
170
231
  // handles that prevent process.exit() from completing promptly.
171
232
  const hasSubcommand = cliFlags.messages.length > 0;
172
233
  if (!process.stdin.isTTY && !isPrintMode && !hasSubcommand && !cliFlags.listModels && !cliFlags.web) {
173
- process.stderr.write('[gsd] Error: Interactive mode requires a terminal (TTY).\n');
174
- process.stderr.write('[gsd] Non-interactive alternatives:\n');
175
- process.stderr.write('[gsd] gsd auto Auto-mode (pipeable, no TUI)\n');
176
- process.stderr.write('[gsd] gsd --print "your message" Single-shot prompt\n');
177
- process.stderr.write('[gsd] gsd --mode rpc JSON-RPC over stdin/stdout\n');
178
- process.stderr.write('[gsd] gsd --mode mcp MCP server over stdin/stdout\n');
179
- process.stderr.write('[gsd] gsd --mode text "message" Text output mode\n');
180
- process.exit(1);
181
- }
182
- // `gsd <subcommand> --help` — show subcommand-specific help
183
- const subcommand = cliFlags.messages[0];
184
- if (subcommand && process.argv.includes('--help')) {
185
- if (printSubcommandHelp(subcommand, process.env.GSD_VERSION || '0.0.0')) {
186
- process.exit(0);
187
- }
234
+ printNonTtyErrorAndExit(undefined, false);
188
235
  }
189
236
  const packageCommand = await runPackageCommand({
190
237
  appName: 'gsd',
@@ -207,8 +254,7 @@ if (cliFlags.messages[0] === 'config') {
207
254
  }
208
255
  // `gsd web stop [path|all]` — stop web server before anything else
209
256
  if (cliFlags.messages[0] === 'web' && cliFlags.messages[1] === 'stop') {
210
- const webFlags = parseWebCliArgs(process.argv);
211
- const webBranch = await runWebCliBranch(webFlags, {
257
+ const webBranch = await runWebCliBranch(cliFlags, {
212
258
  stopWebMode,
213
259
  stderr: process.stderr,
214
260
  baseSessionsDir: sessionsDir,
@@ -221,8 +267,7 @@ if (cliFlags.messages[0] === 'web' && cliFlags.messages[1] === 'stop') {
221
267
  // `gsd --web [path]` or `gsd web [start] [path]` — launch browser-only web mode
222
268
  if (cliFlags.web || (cliFlags.messages[0] === 'web' && cliFlags.messages[1] !== 'stop')) {
223
269
  await ensureRtkBootstrap();
224
- const webFlags = parseWebCliArgs(process.argv);
225
- const webBranch = await runWebCliBranch(webFlags, {
270
+ const webBranch = await runWebCliBranch(cliFlags, {
226
271
  stderr: process.stderr,
227
272
  baseSessionsDir: sessionsDir,
228
273
  agentDir,
@@ -297,21 +342,23 @@ if (cliFlags.messages[0] === 'headless') {
297
342
  await runHeadless(parseHeadlessArgs(process.argv));
298
343
  process.exit(0);
299
344
  }
345
+ /**
346
+ * Run a headless command by invoking the headless entrypoint with a synthetic
347
+ * argv. Shared by the `auto` shorthand (#2732) and the auto-piped-stdout
348
+ * redirect so they use the same bootstrap + dynamic-import dance.
349
+ */
350
+ async function runHeadlessFromAuto(headlessArgs) {
351
+ await ensureRtkBootstrap();
352
+ const { runHeadless, parseHeadlessArgs } = await import('./headless.js');
353
+ const argv = [process.argv[0], process.argv[1], 'headless', ...headlessArgs];
354
+ await runHeadless(parseHeadlessArgs(argv));
355
+ process.exit(0);
356
+ }
300
357
  // `gsd auto [args...]` — shorthand for `gsd headless auto [args...]` (#2732)
301
358
  // Without this, `gsd auto` falls through to the interactive TUI which hangs
302
359
  // when stdin/stdout are piped (non-TTY environments).
303
360
  if (cliFlags.messages[0] === 'auto') {
304
- await ensureRtkBootstrap();
305
- const { runHeadless, parseHeadlessArgs } = await import('./headless.js');
306
- // Rewrite argv so parseHeadlessArgs sees: [node, gsd, headless, auto, ...rest]
307
- const rewrittenArgv = [
308
- process.argv[0],
309
- process.argv[1],
310
- 'headless',
311
- ...cliFlags.messages, // ['auto', ...extra args]
312
- ];
313
- await runHeadless(parseHeadlessArgs(rewrittenArgv));
314
- process.exit(0);
361
+ await runHeadlessFromAuto(cliFlags.messages);
315
362
  }
316
363
  // Pi's tool bootstrap can mis-detect already-installed fd/rg on some systems
317
364
  // because spawnSync(..., ["--version"]) returns EPERM despite a zero exit code.
@@ -458,37 +505,8 @@ if (isPrintMode) {
458
505
  // Before this, extension-provided models (e.g. claude-code/*) were not yet in the
459
506
  // registry, causing the user's valid choice to be silently overwritten.
460
507
  validateConfiguredModel(modelRegistry, settingsManager);
461
- // Re-apply the validated model to the session only when findInitialModel() used a
462
- // fallback (not when restoring an existing session's model). This prevents silently
463
- // overriding the persisted model of resumed conversations (#3534).
464
- if (modelFallbackMessage) {
465
- const validatedProvider = settingsManager.getDefaultProvider();
466
- const validatedModelId = settingsManager.getDefaultModel();
467
- if (validatedProvider && validatedModelId) {
468
- const correctModel = modelRegistry.getAvailable()
469
- .find((m) => m.provider === validatedProvider && m.id === validatedModelId);
470
- if (correctModel) {
471
- try {
472
- await session.setModel(correctModel);
473
- }
474
- catch {
475
- // Provider not ready — leave session on its current model
476
- }
477
- }
478
- }
479
- }
480
- if (extensionsResult.errors.length > 0) {
481
- for (const err of extensionsResult.errors) {
482
- // Downgrade conflicts with built-in tools to warnings (#1347)
483
- const isConflict = err.error.includes("supersedes") || err.error.includes("conflicts with");
484
- const prefix = isConflict ? "Extension conflict" : "Extension load error";
485
- process.stderr.write(`[gsd] ${prefix}: ${err.error}\n`);
486
- }
487
- }
488
- // Validate configured model now that extension providers are registered.
489
- // Must run after createAgentSession() which flushes pendingProviderRegistrations
490
- // so extension models (e.g. pi-claude-cli) are visible in the registry.
491
- validateConfiguredModel(modelRegistry, settingsManager);
508
+ await reapplyValidatedModelOnFallback(session, modelRegistry, settingsManager, modelFallbackMessage);
509
+ printExtensionErrors(extensionsResult.errors);
492
510
  // Apply --model override if specified
493
511
  if (cliFlags.model) {
494
512
  const available = modelRegistry.getAvailable();
@@ -579,11 +597,8 @@ if (!cliFlags.worktree && !isPrintMode) {
579
597
  // which handles non-interactive output gracefully.
580
598
  // ---------------------------------------------------------------------------
581
599
  if (cliFlags.messages[0] === 'auto' && !process.stdout.isTTY) {
582
- await ensureRtkBootstrap();
583
- const { runHeadless, parseHeadlessArgs } = await import('./headless.js');
584
600
  process.stderr.write('[gsd] stdout is not a terminal — running auto-mode in headless mode.\n');
585
- await runHeadless(parseHeadlessArgs(['node', 'gsd', 'headless', ...cliFlags.messages.slice(1)]));
586
- process.exit(0);
601
+ await runHeadlessFromAuto(cliFlags.messages.slice(1));
587
602
  }
588
603
  // ---------------------------------------------------------------------------
589
604
  // Interactive mode — normal TTY session
@@ -627,36 +642,8 @@ markStartup('createAgentSession');
627
642
  // Before this, extension-provided models (e.g. claude-code/*) were not yet in the
628
643
  // registry, causing the user's valid choice to be silently overwritten.
629
644
  validateConfiguredModel(modelRegistry, settingsManager);
630
- // Re-apply the validated model to the session only when findInitialModel() used a
631
- // fallback (not when restoring an existing session's model). This prevents silently
632
- // overriding the persisted model of resumed conversations (#3534).
633
- if (interactiveFallbackMsg) {
634
- const validatedProvider = settingsManager.getDefaultProvider();
635
- const validatedModelId = settingsManager.getDefaultModel();
636
- if (validatedProvider && validatedModelId) {
637
- const correctModel = modelRegistry.getAvailable()
638
- .find((m) => m.provider === validatedProvider && m.id === validatedModelId);
639
- if (correctModel) {
640
- try {
641
- await session.setModel(correctModel);
642
- }
643
- catch {
644
- // Provider not ready — leave session on its current model
645
- }
646
- }
647
- }
648
- }
649
- if (extensionsResult.errors.length > 0) {
650
- for (const err of extensionsResult.errors) {
651
- const isConflict = err.error.includes("supersedes") || err.error.includes("conflicts with");
652
- const prefix = isConflict ? "Extension conflict" : "Extension load error";
653
- process.stderr.write(`[gsd] ${prefix}: ${err.error}\n`);
654
- }
655
- }
656
- // Validate configured model now that extension providers are registered.
657
- // Must run after createAgentSession() which flushes pendingProviderRegistrations
658
- // so extension models (e.g. pi-claude-cli) are visible in the registry.
659
- validateConfiguredModel(modelRegistry, settingsManager);
645
+ await reapplyValidatedModelOnFallback(session, modelRegistry, settingsManager, interactiveFallbackMsg);
646
+ printExtensionErrors(extensionsResult.errors);
660
647
  // Restore scoped models from settings on startup.
661
648
  // The upstream InteractiveMode reads enabledModels from settings when /scoped-models is opened,
662
649
  // but doesn't apply them to the session at startup — so Ctrl+P cycles all models instead of
@@ -704,16 +691,7 @@ if (!process.stdin.isTTY || !process.stdout.isTTY) {
704
691
  : !process.stdin.isTTY
705
692
  ? 'stdin is'
706
693
  : 'stdout is';
707
- process.stderr.write(`[gsd] Error: Interactive mode requires a terminal (TTY) but ${missing} not a TTY.\n`);
708
- process.stderr.write('[gsd] Non-interactive alternatives:\n');
709
- process.stderr.write('[gsd] gsd auto Auto-mode (pipeable, no TUI)\n');
710
- process.stderr.write('[gsd] gsd --print "your message" Single-shot prompt\n');
711
- process.stderr.write('[gsd] gsd --web [path] Browser-only web mode\n');
712
- process.stderr.write('[gsd] gsd --mode rpc JSON-RPC over stdin/stdout\n');
713
- process.stderr.write('[gsd] gsd --mode mcp MCP server over stdin/stdout\n');
714
- process.stderr.write('[gsd] gsd --mode text "message" Text output mode\n');
715
- process.stderr.write('[gsd] gsd headless Auto-mode without TUI\n');
716
- process.exit(1);
694
+ printNonTtyErrorAndExit(missing, true);
717
695
  }
718
696
  // Welcome screen — shown on every fresh interactive session before TUI takes over.
719
697
  // Skip when the first-run banner was already printed in loader.ts (prevents double banner).
@@ -33,7 +33,9 @@ async function loadExtensionModules() {
33
33
  const dispatchModule = await jiti.import(gsdExtensionPath('auto-dispatch.ts'), {});
34
34
  const sessionModule = await jiti.import(gsdExtensionPath('session-status-io.ts'), {});
35
35
  const prefsModule = await jiti.import(gsdExtensionPath('preferences.ts'), {});
36
+ const autoStartModule = await jiti.import(gsdExtensionPath('auto-start.ts'), {});
36
37
  return {
38
+ openProjectDbIfPresent: autoStartModule.openProjectDbIfPresent,
37
39
  deriveState: stateModule.deriveState,
38
40
  resolveDispatch: dispatchModule.resolveDispatch,
39
41
  readAllSessionStatuses: sessionModule.readAllSessionStatuses,
@@ -42,7 +44,8 @@ async function loadExtensionModules() {
42
44
  }
43
45
  // ─── Implementation ─────────────────────────────────────────────────────────
44
46
  export async function handleQuery(basePath) {
45
- const { deriveState, resolveDispatch, readAllSessionStatuses, loadEffectiveGSDPreferences } = await loadExtensionModules();
47
+ const { openProjectDbIfPresent, deriveState, resolveDispatch, readAllSessionStatuses, loadEffectiveGSDPreferences, } = await loadExtensionModules();
48
+ await openProjectDbIfPresent(basePath);
46
49
  const state = await deriveState(basePath);
47
50
  // Derive next dispatch action
48
51
  let next;
package/dist/help-text.js CHANGED
@@ -84,6 +84,28 @@ const SUBCOMMAND_HELP = {
84
84
  ' gsd worktree remove old-branch Remove a specific worktree',
85
85
  ' gsd worktree remove old-branch --force Remove even with unmerged changes',
86
86
  ].join('\n'),
87
+ graph: [
88
+ 'Usage: gsd graph <subcommand> [options]',
89
+ '',
90
+ 'Manage the GSD project knowledge graph. Reads .gsd/ artifacts and builds',
91
+ 'a queryable graph of milestones, slices, tasks, rules, patterns, and lessons.',
92
+ '',
93
+ 'Subcommands:',
94
+ ' build Parse .gsd/ artifacts (STATE.md, milestone ROADMAPs, slice PLANs,',
95
+ ' KNOWLEDGE.md) and write .gsd/graphs/graph.json atomically.',
96
+ ' query Search graph nodes by term (BFS from seed matches, budget-trimmed).',
97
+ ' Returns matching nodes and reachable edges within the token budget.',
98
+ ' status Show whether graph.json exists, its age, node/edge counts, and',
99
+ ' whether it is stale (built more than 24 hours ago).',
100
+ ' diff Compare current graph.json with .last-build-snapshot.json.',
101
+ ' Returns added, removed, and changed nodes and edges.',
102
+ '',
103
+ 'Examples:',
104
+ ' gsd graph build Build the graph from .gsd/ artifacts',
105
+ ' gsd graph status Check graph age and node/edge counts',
106
+ ' gsd graph query auth Find nodes related to "auth"',
107
+ ' gsd graph diff Show changes since last snapshot',
108
+ ].join('\n'),
87
109
  headless: [
88
110
  'Usage: gsd headless [flags] [command] [args...]',
89
111
  '',
@@ -165,6 +187,7 @@ export function printHelp(version) {
165
187
  process.stdout.write(' worktree <cmd> Manage worktrees (list, merge, clean, remove)\n');
166
188
  process.stdout.write(' auto [args] Run auto-mode without TUI (pipeable)\n');
167
189
  process.stdout.write(' headless [cmd] [args] Run /gsd commands without TUI (default: auto)\n');
190
+ process.stdout.write(' graph <subcommand> Manage knowledge graph (build, query, status, diff)\n');
168
191
  process.stdout.write('\nRun gsd <subcommand> --help for subcommand-specific help.\n');
169
192
  }
170
193
  export function printSubcommandHelp(subcommand, version) {
package/dist/logo.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare const GSD_LOGO: readonly string[];
10
10
  /**
11
11
  * Render the logo block with a color function applied to each line.
12
12
  *
13
- * @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or picocolors.cyan
13
+ * @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or chalk.cyan
14
14
  * @returns Ready-to-write string with leading/trailing newlines.
15
15
  */
16
16
  export declare function renderLogo(color: (s: string) => string): string;
package/dist/logo.js CHANGED
@@ -17,7 +17,7 @@ export const GSD_LOGO = [
17
17
  /**
18
18
  * Render the logo block with a color function applied to each line.
19
19
  *
20
- * @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or picocolors.cyan
20
+ * @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or chalk.cyan
21
21
  * @returns Ready-to-write string with leading/trailing newlines.
22
22
  */
23
23
  export function renderLogo(color) {