@opengsd/gsd-pi 1.8.0 → 1.8.1-dev.897b3c90

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 (463) hide show
  1. package/README.md +8 -3
  2. package/dist/cli.js +5 -1
  3. package/dist/headless-events.d.ts +2 -1
  4. package/dist/headless-events.js +11 -3
  5. package/dist/headless-milestone-readiness.d.ts +29 -0
  6. package/dist/headless-milestone-readiness.js +161 -0
  7. package/dist/headless.js +25 -2
  8. package/dist/print-mode-exit.d.ts +12 -0
  9. package/dist/print-mode-exit.js +14 -0
  10. package/dist/resources/.managed-resources-content-hash +1 -1
  11. package/dist/resources/GSD-WORKFLOW.md +16 -47
  12. package/dist/resources/extensions/browser-tools/capture.js +2 -77
  13. package/dist/resources/extensions/browser-tools/screenshot-constraints.js +83 -0
  14. package/dist/resources/extensions/claude-code-cli/stream-adapter.js +17 -2
  15. package/dist/resources/extensions/claude-code-cli/turn-assembler.js +30 -2
  16. package/dist/resources/extensions/gsd/auto-artifact-paths.js +2 -2
  17. package/dist/resources/extensions/gsd/auto-dispatch.js +74 -19
  18. package/dist/resources/extensions/gsd/auto-post-unit.js +4 -0
  19. package/dist/resources/extensions/gsd/auto-prompts.js +35 -1
  20. package/dist/resources/extensions/gsd/auto.js +5 -1
  21. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +78 -4
  22. package/dist/resources/extensions/gsd/bootstrap/write-gate.js +84 -26
  23. package/dist/resources/extensions/gsd/command-feedback.js +16 -12
  24. package/dist/resources/extensions/gsd/compat/compat-marker.js +19 -2
  25. package/dist/resources/extensions/gsd/db/command-queue.js +7 -2
  26. package/dist/resources/extensions/gsd/db/engine.js +51 -16
  27. package/dist/resources/extensions/gsd/db/writers/cascades.js +5 -1
  28. package/dist/resources/extensions/gsd/db/writers/status.js +13 -3
  29. package/dist/resources/extensions/gsd/db-base-schema.js +28 -0
  30. package/dist/resources/extensions/gsd/db-migration-steps.js +30 -0
  31. package/dist/resources/extensions/gsd/db-schema-metadata.js +4 -1
  32. package/dist/resources/extensions/gsd/docs/preferences-reference.md +4 -4
  33. package/dist/resources/extensions/gsd/doctor-history.js +65 -0
  34. package/dist/resources/extensions/gsd/doctor-state-checks.js +509 -0
  35. package/dist/resources/extensions/gsd/doctor-workspace-checks.js +91 -0
  36. package/dist/resources/extensions/gsd/doctor.js +14 -653
  37. package/dist/resources/extensions/gsd/flat-phase-migration.js +156 -21
  38. package/dist/resources/extensions/gsd/gsd-db.js +187 -45
  39. package/dist/resources/extensions/gsd/guided-flow.js +29 -10
  40. package/dist/resources/extensions/gsd/markdown-renderer.js +16 -2
  41. package/dist/resources/extensions/gsd/md-importer.js +109 -16
  42. package/dist/resources/extensions/gsd/migrate/command.js +19 -162
  43. package/dist/resources/extensions/gsd/migrate/execution.js +98 -0
  44. package/dist/resources/extensions/gsd/migrate/plan.js +49 -0
  45. package/dist/resources/extensions/gsd/migrate/planning-writer.js +20 -19
  46. package/dist/resources/extensions/gsd/migrate/presentation.js +64 -0
  47. package/dist/resources/extensions/gsd/migration-auto-check.js +4 -0
  48. package/dist/resources/extensions/gsd/parallel-eligibility.js +5 -4
  49. package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +28 -43
  50. package/dist/resources/extensions/gsd/paths.js +4 -1
  51. package/dist/resources/extensions/gsd/phase-anchor.js +7 -2
  52. package/dist/resources/extensions/gsd/post-execution-checks.js +4 -4
  53. package/dist/resources/extensions/gsd/prompts/refine-slice.md +2 -2
  54. package/dist/resources/extensions/gsd/safety/evidence-collector.js +26 -1
  55. package/dist/resources/extensions/gsd/safety/evidence-cross-ref.js +30 -5
  56. package/dist/resources/extensions/gsd/state-reconciliation/drift/external-markdown-edit.js +27 -13
  57. package/dist/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.js +13 -3
  58. package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +54 -14
  59. package/dist/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.js +48 -5
  60. package/dist/resources/extensions/gsd/stop-notice.js +15 -1
  61. package/dist/resources/extensions/gsd/sync-lock.js +13 -7
  62. package/dist/resources/extensions/gsd/tools/complete-task.js +82 -1
  63. package/dist/resources/extensions/gsd/tools/plan-task.js +13 -15
  64. package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +18 -15
  65. package/dist/resources/extensions/gsd/tools/replan-task.js +128 -0
  66. package/dist/resources/extensions/gsd/tools/rework-brief.js +74 -0
  67. package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +81 -0
  68. package/dist/resources/extensions/gsd/unit-registry.js +4 -0
  69. package/dist/resources/extensions/gsd/uok/plan-v2.js +19 -3
  70. package/dist/resources/extensions/gsd/worktree-state-projection.js +6 -0
  71. package/dist/resources/extensions/mac-tools/index.js +31 -9
  72. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  73. package/dist/web/standalone/.next/BUILD_ID +1 -1
  74. package/dist/web/standalone/.next/app-path-routes-manifest.json +5 -5
  75. package/dist/web/standalone/.next/build-manifest.json +3 -3
  76. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  77. package/dist/web/standalone/.next/required-server-files.json +3 -3
  78. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  79. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  80. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  81. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  82. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  83. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  84. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  85. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  86. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  87. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  88. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  89. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  90. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  91. package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -4
  92. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  93. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  94. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  95. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  96. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  97. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  98. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  99. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  100. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  101. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  102. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  103. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  104. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  105. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  106. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  107. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  108. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  109. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  110. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  111. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  113. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  114. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  115. package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
  116. package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
  117. package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
  118. package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
  119. package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
  120. package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
  121. package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  122. package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
  123. package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
  124. package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
  125. package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  126. package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
  127. package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
  128. package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
  129. package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
  130. package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
  131. package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
  132. package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
  133. package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  134. package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
  135. package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
  136. package/dist/web/standalone/.next/server/app/api/mcp-connections/route.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/mcp-connections/route_client-reference-manifest.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
  139. package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  145. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
  149. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  151. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  155. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  163. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  164. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  165. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
  168. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  170. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  171. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  172. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
  175. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  181. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  182. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  183. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  184. package/dist/web/standalone/.next/server/app/index.html +1 -1
  185. package/dist/web/standalone/.next/server/app/index.rsc +5 -5
  186. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  187. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
  188. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  189. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -4
  190. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  191. package/dist/web/standalone/.next/server/app/page.js +2 -2
  192. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  193. package/dist/web/standalone/.next/server/app-paths-manifest.json +5 -5
  194. package/dist/web/standalone/.next/server/chunks/2842.js +4 -4
  195. package/dist/web/standalone/.next/server/chunks/8357.js +3 -3
  196. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  197. package/dist/web/standalone/.next/server/middleware.js +3 -3
  198. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  199. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  200. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  201. package/dist/web/standalone/.next/static/chunks/app/_not-found/page-a6fb1847f67f167c.js +1 -0
  202. package/dist/web/standalone/.next/static/chunks/app/{layout-b35cbfff38aaf4cf.js → layout-4ae2d68984392bbf.js} +1 -1
  203. package/dist/web/standalone/.next/static/chunks/app/page-72a856634ad14c10.js +1 -0
  204. package/dist/web/standalone/.next/static/chunks/{main-app-590a74400e35f685.js → main-app-90d1d8d5e5d2dc6b.js} +1 -1
  205. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-1115d46ac61b9823.js +1 -0
  206. package/dist/web/standalone/.next/static/css/3b1ceb7abfb9a230.css +1 -0
  207. package/dist/web/standalone/node_modules/@gsd/native/package.json +1 -1
  208. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  209. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  210. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  211. package/dist/web/standalone/package.json +0 -1
  212. package/dist/web/standalone/server.js +1 -1
  213. package/dist/web-mode.js +31 -3
  214. package/integrations/hermes/open_gsd_hermes/gsd_client.py +1 -1
  215. package/integrations/hermes/pyproject.toml +1 -1
  216. package/package.json +12 -10
  217. package/packages/cloud-mcp-gateway/package.json +2 -2
  218. package/packages/contracts/dist/workflow.d.ts +14 -0
  219. package/packages/contracts/dist/workflow.d.ts.map +1 -1
  220. package/packages/contracts/dist/workflow.js +16 -0
  221. package/packages/contracts/dist/workflow.js.map +1 -1
  222. package/packages/contracts/package.json +1 -1
  223. package/packages/daemon/dist/cloud-config.d.ts +1 -1
  224. package/packages/daemon/dist/cloud-config.d.ts.map +1 -1
  225. package/packages/daemon/dist/cloud-config.js +5 -1
  226. package/packages/daemon/dist/cloud-config.js.map +1 -1
  227. package/packages/daemon/dist/cloud-config.test.js +51 -1
  228. package/packages/daemon/dist/cloud-config.test.js.map +1 -1
  229. package/packages/daemon/dist/local-tool-executor.d.ts.map +1 -1
  230. package/packages/daemon/dist/local-tool-executor.js +2 -0
  231. package/packages/daemon/dist/local-tool-executor.js.map +1 -1
  232. package/packages/daemon/package.json +6 -6
  233. package/packages/gsd-agent-core/package.json +5 -5
  234. package/packages/gsd-agent-modes/package.json +7 -7
  235. package/packages/gsd-cloud/dist/cli.d.ts +5 -0
  236. package/packages/gsd-cloud/dist/cli.d.ts.map +1 -0
  237. package/packages/gsd-cloud/dist/cli.js +160 -0
  238. package/packages/gsd-cloud/dist/cli.js.map +1 -0
  239. package/packages/gsd-cloud/dist/cloud-config.d.ts +19 -0
  240. package/packages/gsd-cloud/dist/cloud-config.d.ts.map +1 -0
  241. package/packages/gsd-cloud/dist/cloud-config.js +231 -0
  242. package/packages/gsd-cloud/dist/cloud-config.js.map +1 -0
  243. package/packages/gsd-cloud/dist/cloud-config.test.d.ts +2 -0
  244. package/packages/gsd-cloud/dist/cloud-config.test.d.ts.map +1 -0
  245. package/packages/gsd-cloud/dist/cloud-config.test.js +118 -0
  246. package/packages/gsd-cloud/dist/cloud-config.test.js.map +1 -0
  247. package/packages/gsd-cloud/dist/cloud-gateway-lookup.test.d.ts +2 -0
  248. package/packages/gsd-cloud/dist/cloud-gateway-lookup.test.d.ts.map +1 -0
  249. package/packages/gsd-cloud/dist/cloud-gateway-lookup.test.js +37 -0
  250. package/packages/gsd-cloud/dist/cloud-gateway-lookup.test.js.map +1 -0
  251. package/packages/gsd-cloud/dist/cloud-runtime.d.ts +35 -0
  252. package/packages/gsd-cloud/dist/cloud-runtime.d.ts.map +1 -0
  253. package/packages/gsd-cloud/dist/cloud-runtime.js +258 -0
  254. package/packages/gsd-cloud/dist/cloud-runtime.js.map +1 -0
  255. package/packages/gsd-cloud/dist/cloud-runtime.test.d.ts +2 -0
  256. package/packages/gsd-cloud/dist/cloud-runtime.test.d.ts.map +1 -0
  257. package/packages/gsd-cloud/dist/cloud-runtime.test.js +88 -0
  258. package/packages/gsd-cloud/dist/cloud-runtime.test.js.map +1 -0
  259. package/packages/gsd-cloud/dist/cloud-token.d.ts +3 -0
  260. package/packages/gsd-cloud/dist/cloud-token.d.ts.map +1 -0
  261. package/packages/gsd-cloud/dist/cloud-token.js +37 -0
  262. package/packages/gsd-cloud/dist/cloud-token.js.map +1 -0
  263. package/packages/gsd-cloud/dist/config.d.ts +17 -0
  264. package/packages/gsd-cloud/dist/config.d.ts.map +1 -0
  265. package/packages/gsd-cloud/dist/config.js +146 -0
  266. package/packages/gsd-cloud/dist/config.js.map +1 -0
  267. package/packages/gsd-cloud/dist/device-flow.d.ts +24 -0
  268. package/packages/gsd-cloud/dist/device-flow.d.ts.map +1 -0
  269. package/packages/gsd-cloud/dist/device-flow.js +128 -0
  270. package/packages/gsd-cloud/dist/device-flow.js.map +1 -0
  271. package/packages/gsd-cloud/dist/device-flow.test.d.ts +2 -0
  272. package/packages/gsd-cloud/dist/device-flow.test.d.ts.map +1 -0
  273. package/packages/gsd-cloud/dist/device-flow.test.js +155 -0
  274. package/packages/gsd-cloud/dist/device-flow.test.js.map +1 -0
  275. package/packages/gsd-cloud/dist/executors/claude-executor.d.ts +6 -0
  276. package/packages/gsd-cloud/dist/executors/claude-executor.d.ts.map +1 -0
  277. package/packages/gsd-cloud/dist/executors/claude-executor.js +15 -0
  278. package/packages/gsd-cloud/dist/executors/claude-executor.js.map +1 -0
  279. package/packages/gsd-cloud/dist/executors/codex-executor.d.ts +6 -0
  280. package/packages/gsd-cloud/dist/executors/codex-executor.d.ts.map +1 -0
  281. package/packages/gsd-cloud/dist/executors/codex-executor.js +15 -0
  282. package/packages/gsd-cloud/dist/executors/codex-executor.js.map +1 -0
  283. package/packages/gsd-cloud/dist/executors/executor.d.ts +28 -0
  284. package/packages/gsd-cloud/dist/executors/executor.d.ts.map +1 -0
  285. package/packages/gsd-cloud/dist/executors/executor.js +11 -0
  286. package/packages/gsd-cloud/dist/executors/executor.js.map +1 -0
  287. package/packages/gsd-cloud/dist/executors/gsd-pi-executor.d.ts +34 -0
  288. package/packages/gsd-cloud/dist/executors/gsd-pi-executor.d.ts.map +1 -0
  289. package/packages/gsd-cloud/dist/executors/gsd-pi-executor.js +179 -0
  290. package/packages/gsd-cloud/dist/executors/gsd-pi-executor.js.map +1 -0
  291. package/packages/gsd-cloud/dist/executors/gsd-pi-executor.test.d.ts +2 -0
  292. package/packages/gsd-cloud/dist/executors/gsd-pi-executor.test.d.ts.map +1 -0
  293. package/packages/gsd-cloud/dist/executors/gsd-pi-executor.test.js +44 -0
  294. package/packages/gsd-cloud/dist/executors/gsd-pi-executor.test.js.map +1 -0
  295. package/packages/gsd-cloud/dist/executors/index.d.ts +17 -0
  296. package/packages/gsd-cloud/dist/executors/index.d.ts.map +1 -0
  297. package/packages/gsd-cloud/dist/executors/index.js +29 -0
  298. package/packages/gsd-cloud/dist/executors/index.js.map +1 -0
  299. package/packages/gsd-cloud/dist/executors/mcp-stdio-client.d.ts +36 -0
  300. package/packages/gsd-cloud/dist/executors/mcp-stdio-client.d.ts.map +1 -0
  301. package/packages/gsd-cloud/dist/executors/mcp-stdio-client.js +176 -0
  302. package/packages/gsd-cloud/dist/executors/mcp-stdio-client.js.map +1 -0
  303. package/packages/gsd-cloud/dist/executors/mcp-stdio-client.test.d.ts +2 -0
  304. package/packages/gsd-cloud/dist/executors/mcp-stdio-client.test.d.ts.map +1 -0
  305. package/packages/gsd-cloud/dist/executors/mcp-stdio-client.test.js +34 -0
  306. package/packages/gsd-cloud/dist/executors/mcp-stdio-client.test.js.map +1 -0
  307. package/packages/gsd-cloud/dist/index.d.ts +7 -0
  308. package/packages/gsd-cloud/dist/index.d.ts.map +1 -0
  309. package/packages/gsd-cloud/dist/index.js +8 -0
  310. package/packages/gsd-cloud/dist/index.js.map +1 -0
  311. package/packages/gsd-cloud/dist/inject-gateway.d.ts +16 -0
  312. package/packages/gsd-cloud/dist/inject-gateway.d.ts.map +1 -0
  313. package/packages/gsd-cloud/dist/inject-gateway.js +29 -0
  314. package/packages/gsd-cloud/dist/inject-gateway.js.map +1 -0
  315. package/packages/gsd-cloud/dist/inject-gateway.test.d.ts +2 -0
  316. package/packages/gsd-cloud/dist/inject-gateway.test.d.ts.map +1 -0
  317. package/packages/gsd-cloud/dist/inject-gateway.test.js +41 -0
  318. package/packages/gsd-cloud/dist/inject-gateway.test.js.map +1 -0
  319. package/packages/gsd-cloud/dist/logger.d.ts +25 -0
  320. package/packages/gsd-cloud/dist/logger.d.ts.map +1 -0
  321. package/packages/gsd-cloud/dist/logger.js +72 -0
  322. package/packages/gsd-cloud/dist/logger.js.map +1 -0
  323. package/packages/gsd-cloud/dist/types.d.ts +51 -0
  324. package/packages/gsd-cloud/dist/types.d.ts.map +1 -0
  325. package/packages/gsd-cloud/dist/types.js +9 -0
  326. package/packages/gsd-cloud/dist/types.js.map +1 -0
  327. package/packages/gsd-cloud/package.json +3 -3
  328. package/packages/mcp-server/README.md +8 -0
  329. package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
  330. package/packages/mcp-server/dist/workflow-tools.js +64 -2
  331. package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
  332. package/packages/mcp-server/package.json +4 -4
  333. package/packages/native/package.json +1 -1
  334. package/packages/pi-agent-core/package.json +1 -1
  335. package/packages/pi-ai/dist/models.generated.d.ts +60 -0
  336. package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
  337. package/packages/pi-ai/dist/models.generated.js +54 -0
  338. package/packages/pi-ai/dist/models.generated.js.map +1 -1
  339. package/packages/pi-ai/dist/providers/amazon-bedrock.js +1 -0
  340. package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  341. package/packages/pi-ai/dist/providers/anthropic.js +19 -0
  342. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
  343. package/packages/pi-ai/package.json +1 -1
  344. package/packages/pi-coding-agent/package.json +7 -7
  345. package/packages/pi-tui/package.json +2 -2
  346. package/packages/rpc-client/package.json +2 -2
  347. package/pkg/package.json +1 -1
  348. package/src/resources/GSD-WORKFLOW.md +16 -47
  349. package/src/resources/extensions/browser-tools/capture.ts +2 -86
  350. package/src/resources/extensions/browser-tools/screenshot-constraints.ts +94 -0
  351. package/src/resources/extensions/claude-code-cli/stream-adapter.ts +18 -1
  352. package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +108 -0
  353. package/src/resources/extensions/claude-code-cli/turn-assembler.ts +30 -2
  354. package/src/resources/extensions/gsd/auto-artifact-paths.ts +2 -2
  355. package/src/resources/extensions/gsd/auto-dispatch.ts +86 -19
  356. package/src/resources/extensions/gsd/auto-post-unit.ts +4 -0
  357. package/src/resources/extensions/gsd/auto-prompts.ts +38 -1
  358. package/src/resources/extensions/gsd/auto.ts +5 -1
  359. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +91 -4
  360. package/src/resources/extensions/gsd/bootstrap/write-gate.ts +80 -24
  361. package/src/resources/extensions/gsd/command-feedback.ts +19 -12
  362. package/src/resources/extensions/gsd/compat/compat-marker.ts +21 -4
  363. package/src/resources/extensions/gsd/db/command-queue.ts +7 -1
  364. package/src/resources/extensions/gsd/db/engine.ts +53 -17
  365. package/src/resources/extensions/gsd/db/writers/cascades.ts +5 -1
  366. package/src/resources/extensions/gsd/db/writers/status.ts +25 -8
  367. package/src/resources/extensions/gsd/db-base-schema.ts +30 -0
  368. package/src/resources/extensions/gsd/db-migration-steps.ts +32 -0
  369. package/src/resources/extensions/gsd/db-schema-metadata.ts +4 -1
  370. package/src/resources/extensions/gsd/docs/preferences-reference.md +4 -4
  371. package/src/resources/extensions/gsd/doctor-history.ts +81 -0
  372. package/src/resources/extensions/gsd/doctor-state-checks.ts +527 -0
  373. package/src/resources/extensions/gsd/doctor-workspace-checks.ts +97 -0
  374. package/src/resources/extensions/gsd/doctor.ts +14 -673
  375. package/src/resources/extensions/gsd/flat-phase-migration.ts +160 -19
  376. package/src/resources/extensions/gsd/gsd-db.ts +255 -52
  377. package/src/resources/extensions/gsd/guided-flow.ts +39 -10
  378. package/src/resources/extensions/gsd/markdown-renderer.ts +23 -7
  379. package/src/resources/extensions/gsd/md-importer.ts +116 -13
  380. package/src/resources/extensions/gsd/migrate/command.ts +21 -227
  381. package/src/resources/extensions/gsd/migrate/execution.ts +136 -0
  382. package/src/resources/extensions/gsd/migrate/plan.ts +101 -0
  383. package/src/resources/extensions/gsd/migrate/planning-writer.ts +21 -23
  384. package/src/resources/extensions/gsd/migrate/presentation.ts +83 -0
  385. package/src/resources/extensions/gsd/migration-auto-check.ts +3 -0
  386. package/src/resources/extensions/gsd/parallel-eligibility.ts +5 -4
  387. package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +37 -40
  388. package/src/resources/extensions/gsd/paths.ts +4 -1
  389. package/src/resources/extensions/gsd/phase-anchor.ts +8 -2
  390. package/src/resources/extensions/gsd/post-execution-checks.ts +4 -4
  391. package/src/resources/extensions/gsd/prompts/refine-slice.md +2 -2
  392. package/src/resources/extensions/gsd/safety/evidence-collector.ts +28 -1
  393. package/src/resources/extensions/gsd/safety/evidence-cross-ref.ts +31 -5
  394. package/src/resources/extensions/gsd/state-reconciliation/drift/external-markdown-edit.ts +30 -13
  395. package/src/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.ts +16 -3
  396. package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +67 -20
  397. package/src/resources/extensions/gsd/state-reconciliation/drift/sketch-flag.ts +47 -5
  398. package/src/resources/extensions/gsd/state-reconciliation/types.ts +2 -2
  399. package/src/resources/extensions/gsd/stop-notice.ts +18 -1
  400. package/src/resources/extensions/gsd/sync-lock.ts +14 -6
  401. package/src/resources/extensions/gsd/tests/closeout-git-deferral.test.ts +96 -1
  402. package/src/resources/extensions/gsd/tests/command-feedback.test.ts +12 -0
  403. package/src/resources/extensions/gsd/tests/compat-marker.test.ts +104 -0
  404. package/src/resources/extensions/gsd/tests/complete-task.test.ts +286 -0
  405. package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +76 -1
  406. package/src/resources/extensions/gsd/tests/db-engine-migrate-guards.test.ts +186 -0
  407. package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +29 -0
  408. package/src/resources/extensions/gsd/tests/discuss-routing-fixes.test.ts +123 -0
  409. package/src/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +50 -0
  410. package/src/resources/extensions/gsd/tests/dispatch-rule-coverage.test.ts +49 -0
  411. package/src/resources/extensions/gsd/tests/doctor-history-public-api.test.ts +25 -0
  412. package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +81 -0
  413. package/src/resources/extensions/gsd/tests/evidence-xref-gsd-exec.test.ts +22 -0
  414. package/src/resources/extensions/gsd/tests/external-edit-scoped-import.test.ts +262 -0
  415. package/src/resources/extensions/gsd/tests/flat-phase-migration.test.ts +202 -0
  416. package/src/resources/extensions/gsd/tests/gate-storage.test.ts +29 -0
  417. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +25 -0
  418. package/src/resources/extensions/gsd/tests/import-slice-milestone-completion-preserve.test.ts +116 -0
  419. package/src/resources/extensions/gsd/tests/migrate-hierarchy.test.ts +53 -0
  420. package/src/resources/extensions/gsd/tests/migrate-plan.test.ts +68 -0
  421. package/src/resources/extensions/gsd/tests/migrate-presentation.test.ts +98 -0
  422. package/src/resources/extensions/gsd/tests/migrate-safety-audit.test.ts +1 -1
  423. package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +53 -0
  424. package/src/resources/extensions/gsd/tests/milestone-leases.test.ts +55 -0
  425. package/src/resources/extensions/gsd/tests/parallel-eligibility-file-overlap.test.ts +146 -0
  426. package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +59 -0
  427. package/src/resources/extensions/gsd/tests/parsers-legacy-importers.test.ts +4 -0
  428. package/src/resources/extensions/gsd/tests/phase-anchor.test.ts +32 -4
  429. package/src/resources/extensions/gsd/tests/plan-task.test.ts +26 -23
  430. package/src/resources/extensions/gsd/tests/planning-writer.test.ts +47 -1
  431. package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +22 -0
  432. package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +18 -3
  433. package/src/resources/extensions/gsd/tests/reassess-handler.test.ts +50 -0
  434. package/src/resources/extensions/gsd/tests/replan-task-handler.test.ts +103 -0
  435. package/src/resources/extensions/gsd/tests/rework-brief.test.ts +197 -0
  436. package/src/resources/extensions/gsd/tests/skip-slice-cascades-tasks.test.ts +21 -0
  437. package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +177 -25
  438. package/src/resources/extensions/gsd/tests/stop-notice.test.ts +17 -0
  439. package/src/resources/extensions/gsd/tests/sync-lock.test.ts +19 -0
  440. package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +34 -0
  441. package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +93 -1
  442. package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -0
  443. package/src/resources/extensions/gsd/tests/workflow-migration-gates.test.ts +139 -0
  444. package/src/resources/extensions/gsd/tests/worktree-state-projection.test.ts +36 -0
  445. package/src/resources/extensions/gsd/tests/write-gate-seam.test.ts +52 -0
  446. package/src/resources/extensions/gsd/tools/complete-task.ts +120 -0
  447. package/src/resources/extensions/gsd/tools/plan-task.ts +14 -16
  448. package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +18 -17
  449. package/src/resources/extensions/gsd/tools/replan-task.ts +160 -0
  450. package/src/resources/extensions/gsd/tools/rework-brief.ts +91 -0
  451. package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +92 -0
  452. package/src/resources/extensions/gsd/types.ts +11 -0
  453. package/src/resources/extensions/gsd/unit-registry.ts +4 -0
  454. package/src/resources/extensions/gsd/uok/plan-v2.ts +20 -3
  455. package/src/resources/extensions/gsd/worktree-state-projection.ts +12 -0
  456. package/src/resources/extensions/mac-tools/index.ts +52 -9
  457. package/src/resources/extensions/mac-tools/tests/mac-screenshot-payload.test.cjs +70 -0
  458. package/dist/web/standalone/.next/static/chunks/app/_not-found/page-49f565245e1e4afe.js +0 -1
  459. package/dist/web/standalone/.next/static/chunks/app/page-bc4c723c6a19c6f0.js +0 -1
  460. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ec3eaffc9785ba48.js +0 -1
  461. package/dist/web/standalone/.next/static/css/18c2fdf261bfc1b7.css +0 -1
  462. /package/dist/web/standalone/.next/static/{seHIUVbR1mm7LfG83nWJO → TezjdjSHBVRRr54XjAvte}/_buildManifest.js +0 -0
  463. /package/dist/web/standalone/.next/static/{seHIUVbR1mm7LfG83nWJO → TezjdjSHBVRRr54XjAvte}/_ssgManifest.js +0 -0
@@ -0,0 +1,7 @@
1
+ export { handleCloudCommand, formatUsage } from "./cli.js";
2
+ export { injectDefaultGateway, DEFAULT_GATEWAY } from "./inject-gateway.js";
3
+ export { CloudRuntime } from "./cloud-runtime.js";
4
+ export { runDeviceFlow } from "./device-flow.js";
5
+ export { selectExecutor, GsdPiExecutor, type Executor, type AdvertisedProject, type ExecutorKind, type SelectExecutorOptions, } from "./executors/index.js";
6
+ export type { DaemonConfig, LogLevel, LogEntry } from "./types.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,cAAc,EACd,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ // Project/App: Open GSD
2
+ // File Purpose: Public entry for @opengsd/gsd-cloud — the standalone cloud agent.
3
+ export { handleCloudCommand, formatUsage } from "./cli.js";
4
+ export { injectDefaultGateway, DEFAULT_GATEWAY } from "./inject-gateway.js";
5
+ export { CloudRuntime } from "./cloud-runtime.js";
6
+ export { runDeviceFlow } from "./device-flow.js";
7
+ export { selectExecutor, GsdPiExecutor, } from "./executors/index.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,kFAAkF;AAElF,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,cAAc,EACd,aAAa,GAKd,MAAM,sBAAsB,CAAC","sourcesContent":["// Project/App: Open GSD\n// File Purpose: Public entry for @opengsd/gsd-cloud — the standalone cloud agent.\n\nexport { handleCloudCommand, formatUsage } from \"./cli.js\";\nexport { injectDefaultGateway, DEFAULT_GATEWAY } from \"./inject-gateway.js\";\nexport { CloudRuntime } from \"./cloud-runtime.js\";\nexport { runDeviceFlow } from \"./device-flow.js\";\nexport {\n selectExecutor,\n GsdPiExecutor,\n type Executor,\n type AdvertisedProject,\n type ExecutorKind,\n type SelectExecutorOptions,\n} from \"./executors/index.js\";\nexport type { DaemonConfig, LogLevel, LogEntry } from \"./types.js\";\n"]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The public GSD Cloud gateway. This default lives ONLY in @opengsd/gsd-cloud
3
+ * (D-01): the SaaS-branded wrapper is the one place the cloud.opengsd.net URL is
4
+ * intended to appear. The generic @opengsd/daemon requires --gateway explicitly.
5
+ */
6
+ export declare const DEFAULT_GATEWAY = "https://cloud.opengsd.net";
7
+ /**
8
+ * Insert `--gateway https://cloud.opengsd.net` for the `login` and `pair`
9
+ * commands when the caller has not supplied their own `--gateway`. Any other
10
+ * command (status/connect/disconnect) is returned unchanged, as is an explicit
11
+ * `--gateway` (the caller-supplied flag always wins) and empty argv.
12
+ *
13
+ * Pure function — no process.argv side effects — so the contract is unit-testable.
14
+ */
15
+ export declare function injectDefaultGateway(argv: string[]): string[];
16
+ //# sourceMappingURL=inject-gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-gateway.d.ts","sourceRoot":"","sources":["../src/inject-gateway.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAW7D"}
@@ -0,0 +1,29 @@
1
+ // Project/App: Open GSD
2
+ // File Purpose: Default the cloud gateway for login/pair when the caller omits --gateway.
3
+ /**
4
+ * The public GSD Cloud gateway. This default lives ONLY in @opengsd/gsd-cloud
5
+ * (D-01): the SaaS-branded wrapper is the one place the cloud.opengsd.net URL is
6
+ * intended to appear. The generic @opengsd/daemon requires --gateway explicitly.
7
+ */
8
+ export const DEFAULT_GATEWAY = "https://cloud.opengsd.net";
9
+ /**
10
+ * Insert `--gateway https://cloud.opengsd.net` for the `login` and `pair`
11
+ * commands when the caller has not supplied their own `--gateway`. Any other
12
+ * command (status/connect/disconnect) is returned unchanged, as is an explicit
13
+ * `--gateway` (the caller-supplied flag always wins) and empty argv.
14
+ *
15
+ * Pure function — no process.argv side effects — so the contract is unit-testable.
16
+ */
17
+ export function injectDefaultGateway(argv) {
18
+ const command = argv[0];
19
+ const gatewayAwareCommand = command === "login" || command === "pair";
20
+ // Respect both flag forms `parseArgs` accepts: `--gateway <url>` and
21
+ // `--gateway=<url>`. Matching only the bare token let an explicit
22
+ // `--gateway=<url>` slip through and get overridden by the appended default.
23
+ const hasGateway = argv.some((arg) => arg === "--gateway" || arg.startsWith("--gateway="));
24
+ if (!gatewayAwareCommand || hasGateway) {
25
+ return argv;
26
+ }
27
+ return [...argv, "--gateway", DEFAULT_GATEWAY];
28
+ }
29
+ //# sourceMappingURL=inject-gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-gateway.js","sourceRoot":"","sources":["../src/inject-gateway.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,0FAA0F;AAE1F;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,2BAA2B,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAc;IACjD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,mBAAmB,GAAG,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,MAAM,CAAC;IACtE,qEAAqE;IACrE,kEAAkE;IAClE,6EAA6E;IAC7E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,WAAW,IAAI,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,mBAAmB,IAAI,UAAU,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AACjD,CAAC","sourcesContent":["// Project/App: Open GSD\n// File Purpose: Default the cloud gateway for login/pair when the caller omits --gateway.\n\n/**\n * The public GSD Cloud gateway. This default lives ONLY in @opengsd/gsd-cloud\n * (D-01): the SaaS-branded wrapper is the one place the cloud.opengsd.net URL is\n * intended to appear. The generic @opengsd/daemon requires --gateway explicitly.\n */\nexport const DEFAULT_GATEWAY = \"https://cloud.opengsd.net\";\n\n/**\n * Insert `--gateway https://cloud.opengsd.net` for the `login` and `pair`\n * commands when the caller has not supplied their own `--gateway`. Any other\n * command (status/connect/disconnect) is returned unchanged, as is an explicit\n * `--gateway` (the caller-supplied flag always wins) and empty argv.\n *\n * Pure function — no process.argv side effects — so the contract is unit-testable.\n */\nexport function injectDefaultGateway(argv: string[]): string[] {\n const command = argv[0];\n const gatewayAwareCommand = command === \"login\" || command === \"pair\";\n // Respect both flag forms `parseArgs` accepts: `--gateway <url>` and\n // `--gateway=<url>`. Matching only the bare token let an explicit\n // `--gateway=<url>` slip through and get overridden by the appended default.\n const hasGateway = argv.some((arg) => arg === \"--gateway\" || arg.startsWith(\"--gateway=\"));\n if (!gatewayAwareCommand || hasGateway) {\n return argv;\n }\n return [...argv, \"--gateway\", DEFAULT_GATEWAY];\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=inject-gateway.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-gateway.test.d.ts","sourceRoot":"","sources":["../src/inject-gateway.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ // Project/App: Open GSD
2
+ // File Purpose: Unit tests locking the default-gateway injection contract.
3
+ import { test } from "node:test";
4
+ import assert from "node:assert/strict";
5
+ import { injectDefaultGateway, DEFAULT_GATEWAY } from "./inject-gateway.js";
6
+ test("Test 1: login without --gateway injects the default gateway", () => {
7
+ const out = injectDefaultGateway(["login"]);
8
+ assert.ok(out.includes("--gateway"), "expected --gateway flag");
9
+ assert.ok(out.includes(DEFAULT_GATEWAY), "expected default gateway value");
10
+ assert.equal(DEFAULT_GATEWAY, "https://cloud.opengsd.net");
11
+ const idx = out.indexOf("--gateway");
12
+ assert.equal(out[idx + 1], DEFAULT_GATEWAY, "value must follow the flag");
13
+ });
14
+ test("Test 2: login with explicit --gateway is returned unchanged", () => {
15
+ const argv = ["login", "--gateway", "https://other.example"];
16
+ const out = injectDefaultGateway(argv);
17
+ assert.deepEqual(out, argv);
18
+ assert.equal(out.filter((a) => a === "--gateway").length, 1, "no double gateway");
19
+ });
20
+ test("Test 3: pair without --gateway injects the default gateway", () => {
21
+ const out = injectDefaultGateway(["pair", "--code", "X"]);
22
+ assert.ok(out.includes("--gateway"), "expected --gateway flag");
23
+ assert.ok(out.includes(DEFAULT_GATEWAY), "expected default gateway value");
24
+ });
25
+ test("Test 4: status/connect/disconnect are returned unchanged", () => {
26
+ for (const cmd of ["status", "connect", "disconnect"]) {
27
+ const out = injectDefaultGateway([cmd]);
28
+ assert.deepEqual(out, [cmd], `${cmd} must not inject a gateway`);
29
+ }
30
+ });
31
+ test("Test 5: empty argv (no command) is returned unchanged", () => {
32
+ assert.deepEqual(injectDefaultGateway([]), []);
33
+ });
34
+ test("Test 6: login with equals-form --gateway=... is returned unchanged", () => {
35
+ const argv = ["login", "--gateway=https://other.example"];
36
+ const out = injectDefaultGateway(argv);
37
+ assert.deepEqual(out, argv);
38
+ assert.ok(!out.includes(DEFAULT_GATEWAY), "default gateway must not be appended");
39
+ assert.equal(out.filter((a) => a === "--gateway" || a.startsWith("--gateway=")).length, 1, "no double gateway");
40
+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F,MAAM,CAAC,KAAK,CACV,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,WAAW,IAAI,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,EACzE,CAAC,EACD,mBAAmB,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Project/App: Open GSD\n// File Purpose: Unit tests locking the default-gateway injection contract.\nimport { test } from \"node:test\";\nimport assert from \"node:assert/strict\";\nimport { injectDefaultGateway, DEFAULT_GATEWAY } from \"./inject-gateway.js\";\n\ntest(\"Test 1: login without --gateway injects the default gateway\", () => {\n const out = injectDefaultGateway([\"login\"]);\n assert.ok(out.includes(\"--gateway\"), \"expected --gateway flag\");\n assert.ok(out.includes(DEFAULT_GATEWAY), \"expected default gateway value\");\n assert.equal(DEFAULT_GATEWAY, \"https://cloud.opengsd.net\");\n const idx = out.indexOf(\"--gateway\");\n assert.equal(out[idx + 1], DEFAULT_GATEWAY, \"value must follow the flag\");\n});\n\ntest(\"Test 2: login with explicit --gateway is returned unchanged\", () => {\n const argv = [\"login\", \"--gateway\", \"https://other.example\"];\n const out = injectDefaultGateway(argv);\n assert.deepEqual(out, argv);\n assert.equal(out.filter((a) => a === \"--gateway\").length, 1, \"no double gateway\");\n});\n\ntest(\"Test 3: pair without --gateway injects the default gateway\", () => {\n const out = injectDefaultGateway([\"pair\", \"--code\", \"X\"]);\n assert.ok(out.includes(\"--gateway\"), \"expected --gateway flag\");\n assert.ok(out.includes(DEFAULT_GATEWAY), \"expected default gateway value\");\n});\n\ntest(\"Test 4: status/connect/disconnect are returned unchanged\", () => {\n for (const cmd of [\"status\", \"connect\", \"disconnect\"]) {\n const out = injectDefaultGateway([cmd]);\n assert.deepEqual(out, [cmd], `${cmd} must not inject a gateway`);\n }\n});\n\ntest(\"Test 5: empty argv (no command) is returned unchanged\", () => {\n assert.deepEqual(injectDefaultGateway([]), []);\n});\n\ntest(\"Test 6: login with equals-form --gateway=... is returned unchanged\", () => {\n const argv = [\"login\", \"--gateway=https://other.example\"];\n const out = injectDefaultGateway(argv);\n assert.deepEqual(out, argv);\n assert.ok(!out.includes(DEFAULT_GATEWAY), \"default gateway must not be appended\");\n assert.equal(\n out.filter((a) => a === \"--gateway\" || a.startsWith(\"--gateway=\")).length,\n 1,\n \"no double gateway\",\n );\n});\n"]}
@@ -0,0 +1,25 @@
1
+ import type { LogLevel } from './types.js';
2
+ export interface LoggerOptions {
3
+ filePath: string;
4
+ level: LogLevel;
5
+ verbose?: boolean;
6
+ }
7
+ /**
8
+ * Structured JSON-lines file logger.
9
+ * Writes LogEntry objects one per line in append mode.
10
+ * The open write stream keeps the Node event loop alive (daemon keepalive).
11
+ */
12
+ export declare class Logger {
13
+ private readonly stream;
14
+ private readonly level;
15
+ private readonly verbose;
16
+ constructor(opts: LoggerOptions);
17
+ debug(msg: string, data?: Record<string, unknown>): void;
18
+ info(msg: string, data?: Record<string, unknown>): void;
19
+ warn(msg: string, data?: Record<string, unknown>): void;
20
+ error(msg: string, data?: Record<string, unknown>): void;
21
+ /** End the write stream. Resolves when the stream is fully flushed. */
22
+ close(): Promise<void>;
23
+ private write;
24
+ }
25
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,YAAY,CAAC;AASrD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAEtB,IAAI,EAAE,aAAa;IAe/B,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIxD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIvD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIvD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIxD,uEAAuE;IACvE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAUtB,OAAO,CAAC,KAAK;CAmBd"}
@@ -0,0 +1,72 @@
1
+ import { createWriteStream, mkdirSync } from 'node:fs';
2
+ import { dirname } from 'node:path';
3
+ const LEVEL_ORDER = {
4
+ debug: 0,
5
+ info: 1,
6
+ warn: 2,
7
+ error: 3,
8
+ };
9
+ /**
10
+ * Structured JSON-lines file logger.
11
+ * Writes LogEntry objects one per line in append mode.
12
+ * The open write stream keeps the Node event loop alive (daemon keepalive).
13
+ */
14
+ export class Logger {
15
+ stream;
16
+ level;
17
+ verbose;
18
+ constructor(opts) {
19
+ // Ensure parent directory exists
20
+ const dir = dirname(opts.filePath);
21
+ try {
22
+ mkdirSync(dir, { recursive: true });
23
+ }
24
+ catch (err) {
25
+ const msg = err instanceof Error ? err.message : String(err);
26
+ throw new Error(`Cannot create log directory ${dir}: ${msg}`);
27
+ }
28
+ this.stream = createWriteStream(opts.filePath, { flags: 'a' });
29
+ this.level = LEVEL_ORDER[opts.level] ?? LEVEL_ORDER.info;
30
+ this.verbose = opts.verbose ?? false;
31
+ }
32
+ debug(msg, data) {
33
+ this.write('debug', msg, data);
34
+ }
35
+ info(msg, data) {
36
+ this.write('info', msg, data);
37
+ }
38
+ warn(msg, data) {
39
+ this.write('warn', msg, data);
40
+ }
41
+ error(msg, data) {
42
+ this.write('error', msg, data);
43
+ }
44
+ /** End the write stream. Resolves when the stream is fully flushed. */
45
+ close() {
46
+ return new Promise((resolve, reject) => {
47
+ // Attach listeners BEFORE triggering end() so a synchronous error
48
+ // from end() or an immediate 'close' cannot slip past the listener.
49
+ this.stream.once('close', () => resolve());
50
+ this.stream.once('error', reject);
51
+ this.stream.end();
52
+ });
53
+ }
54
+ write(level, msg, data) {
55
+ if (LEVEL_ORDER[level] < this.level)
56
+ return;
57
+ const entry = {
58
+ ts: new Date().toISOString(),
59
+ level,
60
+ msg,
61
+ ...(data !== undefined ? { data } : {}),
62
+ };
63
+ const line = JSON.stringify(entry) + '\n';
64
+ this.stream.write(line);
65
+ if (this.verbose) {
66
+ const prefix = `[${entry.ts}] ${level.toUpperCase()}`;
67
+ const suffix = data ? ` ${JSON.stringify(data)}` : '';
68
+ process.stderr.write(`${prefix}: ${msg}${suffix}\n`);
69
+ }
70
+ }
71
+ }
72
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAoB,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,WAAW,GAA6B;IAC5C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;CACT,CAAC;AAQF;;;;GAIG;AACH,MAAM,OAAO,MAAM;IACA,MAAM,CAAc;IACpB,KAAK,CAAS;IACd,OAAO,CAAU;IAElC,YAAY,IAAmB;QAC7B,iCAAiC;QACjC,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,CAAC;YACH,SAAS,CAAC,GAAG,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,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,KAAe,EAAE,GAAW,EAAE,IAA8B;QACxE,IAAI,WAAW,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK;YAAE,OAAO;QAE5C,MAAM,KAAK,GAAa;YACtB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YAC5B,KAAK;YACL,GAAG;YACH,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxC,CAAC;QAEF,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;QAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAExB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACtD,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,KAAK,GAAG,GAAG,MAAM,IAAI,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;CACF","sourcesContent":["import { createWriteStream, mkdirSync, type WriteStream } from 'node:fs';\nimport { dirname } from 'node:path';\nimport type { LogLevel, LogEntry } from './types.js';\n\nconst LEVEL_ORDER: Record<LogLevel, number> = {\n debug: 0,\n info: 1,\n warn: 2,\n error: 3,\n};\n\nexport interface LoggerOptions {\n filePath: string;\n level: LogLevel;\n verbose?: boolean;\n}\n\n/**\n * Structured JSON-lines file logger.\n * Writes LogEntry objects one per line in append mode.\n * The open write stream keeps the Node event loop alive (daemon keepalive).\n */\nexport class Logger {\n private readonly stream: WriteStream;\n private readonly level: number;\n private readonly verbose: boolean;\n\n constructor(opts: LoggerOptions) {\n // Ensure parent directory exists\n const dir = dirname(opts.filePath);\n try {\n mkdirSync(dir, { recursive: true });\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err);\n throw new Error(`Cannot create log directory ${dir}: ${msg}`);\n }\n\n this.stream = createWriteStream(opts.filePath, { flags: 'a' });\n this.level = LEVEL_ORDER[opts.level] ?? LEVEL_ORDER.info;\n this.verbose = opts.verbose ?? false;\n }\n\n debug(msg: string, data?: Record<string, unknown>): void {\n this.write('debug', msg, data);\n }\n\n info(msg: string, data?: Record<string, unknown>): void {\n this.write('info', msg, data);\n }\n\n warn(msg: string, data?: Record<string, unknown>): void {\n this.write('warn', msg, data);\n }\n\n error(msg: string, data?: Record<string, unknown>): void {\n this.write('error', msg, data);\n }\n\n /** End the write stream. Resolves when the stream is fully flushed. */\n close(): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n // Attach listeners BEFORE triggering end() so a synchronous error\n // from end() or an immediate 'close' cannot slip past the listener.\n this.stream.once('close', () => resolve());\n this.stream.once('error', reject);\n this.stream.end();\n });\n }\n\n private write(level: LogLevel, msg: string, data?: Record<string, unknown>): void {\n if (LEVEL_ORDER[level] < this.level) return;\n\n const entry: LogEntry = {\n ts: new Date().toISOString(),\n level,\n msg,\n ...(data !== undefined ? { data } : {}),\n };\n\n const line = JSON.stringify(entry) + '\\n';\n this.stream.write(line);\n\n if (this.verbose) {\n const prefix = `[${entry.ts}] ${level.toUpperCase()}`;\n const suffix = data ? ` ${JSON.stringify(data)}` : '';\n process.stderr.write(`${prefix}: ${msg}${suffix}\\n`);\n }\n }\n}\n"]}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Log severity levels, ordered from most to least verbose.
3
+ */
4
+ export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
5
+ /**
6
+ * A single structured log entry written as JSON-lines.
7
+ */
8
+ export interface LogEntry {
9
+ /** ISO-8601 timestamp */
10
+ ts: string;
11
+ level: LogLevel;
12
+ msg: string;
13
+ data?: Record<string, unknown>;
14
+ }
15
+ /**
16
+ * Top-level daemon configuration, loaded from YAML.
17
+ *
18
+ * Only the `cloud` and `log` blocks are load-bearing for the standalone agent.
19
+ * The `discord` and `projects` blocks are preserved so an existing
20
+ * `~/.gsd/daemon.yaml` written by the full daemon parses without loss, but the
21
+ * standalone agent does not act on them (it uses its own project source).
22
+ */
23
+ export interface DaemonConfig {
24
+ cloud?: {
25
+ gateway_url: string;
26
+ device_token?: string;
27
+ runtime_id?: string;
28
+ runtime_name?: string;
29
+ enabled?: boolean;
30
+ };
31
+ discord?: {
32
+ token: string;
33
+ guild_id: string;
34
+ owner_id: string;
35
+ dm_on_blocker?: boolean;
36
+ control_channel_id?: string;
37
+ orchestrator?: {
38
+ model?: string;
39
+ max_tokens?: number;
40
+ };
41
+ };
42
+ projects: {
43
+ scan_roots: string[];
44
+ };
45
+ log: {
46
+ file: string;
47
+ level: LogLevel;
48
+ max_size_mb: number;
49
+ };
50
+ }
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,QAAQ,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE;QACN,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,YAAY,CAAC,EAAE;YACb,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IACF,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;IACF,GAAG,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,QAAQ,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}
@@ -0,0 +1,9 @@
1
+ // Project/App: Open GSD
2
+ // File Purpose: Trimmed, self-contained config/log types for the standalone cloud agent.
3
+ //
4
+ // This is a deliberately minimal copy of the daemon's types.ts. It defines ONLY
5
+ // what the extracted cloud path needs (config parsing, logging) and imports NO
6
+ // `@opengsd/rpc-client` or `@opengsd/contracts` — that is what makes this package
7
+ // installable without the internal `@gsd/*` scope.
8
+ export {};
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,yFAAyF;AACzF,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,kFAAkF;AAClF,mDAAmD","sourcesContent":["// Project/App: Open GSD\n// File Purpose: Trimmed, self-contained config/log types for the standalone cloud agent.\n//\n// This is a deliberately minimal copy of the daemon's types.ts. It defines ONLY\n// what the extracted cloud path needs (config parsing, logging) and imports NO\n// `@opengsd/rpc-client` or `@opengsd/contracts` — that is what makes this package\n// installable without the internal `@gsd/*` scope.\n\n/**\n * Log severity levels, ordered from most to least verbose.\n */\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\n/**\n * A single structured log entry written as JSON-lines.\n */\nexport interface LogEntry {\n /** ISO-8601 timestamp */\n ts: string;\n level: LogLevel;\n msg: string;\n data?: Record<string, unknown>;\n}\n\n/**\n * Top-level daemon configuration, loaded from YAML.\n *\n * Only the `cloud` and `log` blocks are load-bearing for the standalone agent.\n * The `discord` and `projects` blocks are preserved so an existing\n * `~/.gsd/daemon.yaml` written by the full daemon parses without loss, but the\n * standalone agent does not act on them (it uses its own project source).\n */\nexport interface DaemonConfig {\n cloud?: {\n gateway_url: string;\n device_token?: string;\n runtime_id?: string;\n runtime_name?: string;\n enabled?: boolean;\n };\n discord?: {\n token: string;\n guild_id: string;\n owner_id: string;\n dm_on_blocker?: boolean;\n control_channel_id?: string;\n orchestrator?: {\n model?: string;\n max_tokens?: number;\n };\n };\n projects: {\n scan_roots: string[];\n };\n log: {\n file: string;\n level: LogLevel;\n max_size_mb: number;\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengsd/gsd-cloud",
3
- "version": "1.8.0",
3
+ "version": "1.8.1-dev.897b3c90",
4
4
  "description": "Standalone CLI agent that connects a local GSD runtime to GSD Cloud (cloud.opengsd.net)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -16,8 +16,8 @@
16
16
  "gsd-cloud": "./bin/gsd-cloud.js"
17
17
  },
18
18
  "scripts": {
19
- "build": "node ../../scripts/clean-package-dist.cjs && tsc",
20
- "test": "pnpm run build && node --test dist/inject-gateway.test.js dist/cloud-gateway-lookup.test.js dist/cloud-runtime.test.js dist/executors/mcp-stdio-client.test.js dist/executors/gsd-pi-executor.test.js"
19
+ "build": "node ../../scripts/clean-package-dist.cjs && tsc -p tsconfig.json --incremental false",
20
+ "test": "pnpm run build && node --test dist/inject-gateway.test.js dist/cloud-gateway-lookup.test.js dist/cloud-config.test.js dist/device-flow.test.js dist/cloud-runtime.test.js dist/executors/mcp-stdio-client.test.js dist/executors/gsd-pi-executor.test.js"
21
21
  },
22
22
  "dependencies": {
23
23
  "ws": "^8.21.0",
@@ -87,6 +87,8 @@ The workflow MCP surface includes:
87
87
  - `gsd_plan_slice`
88
88
  - `gsd_plan_task`
89
89
  - `gsd_replan_slice`
90
+ - `gsd_replan_task`
91
+ - `gsd_rework_brief_save`
90
92
  - `gsd_slice_complete`
91
93
  - `gsd_skip_slice`
92
94
  - `gsd_complete_milestone`
@@ -116,6 +118,12 @@ These tools use the same GSD workflow handlers as the native in-process tool pat
116
118
 
117
119
  `gsd_summary_save` computes artifact paths from the supplied IDs. `milestone_id` is required for milestone-, slice-, and task-scoped artifact types (`SUMMARY`, `RESEARCH`, `CONTEXT`, `ASSESSMENT`, `CONTEXT-DRAFT`) and should be omitted only for root-level `PROJECT`, `PROJECT-DRAFT`, `REQUIREMENTS`, and `REQUIREMENTS-DRAFT` artifacts. The `content` field has a schema `maxLength` of 50,000 characters per save; callers that produce larger artifacts should save incrementally by writing a substantive draft, then re-save the enriched artifact as more detail is available. For final `REQUIREMENTS` saves, the tool renders content from active database requirement rows; callers must create those rows with `gsd_requirement_save` first.
118
120
 
121
+ `gsd_replan_task` updates one existing pending task's planning contract after rework without replacing sibling tasks. `projectDir` is optional; when omitted, the server uses its current project or worktree root. Required parameters are `milestoneId`, `sliceId`, `taskId`, `title`, `description`, `estimate`, `files`, `verify`, `inputs`, and `expectedOutput`; `reworkBriefRef` is optional and records the brief that triggered the update. The tool rejects missing tasks and closed/completed tasks; reopen a completed task first with `gsd_task_reopen`.
122
+
123
+ `gsd_rework_brief_save` persists structured rework findings for a task. `projectDir` is optional; required parameters are `milestoneId`, `sliceId`, `taskId`, and a non-empty `findings` array. Each finding requires `findingId`, `severity` (`blocking` or `advisory`), `description`, `requiredFix`, and `verificationCommands`; optional fields are `status`, `evidence`, and `decisionRef`.
124
+
125
+ Blocking findings saved by `gsd_rework_brief_save` gate `gsd_task_complete`. To complete the task, the `gsd_task_complete` call must include a `reworkResolution` entry for each pending blocking `findingId` with `status: "resolved"` and non-empty `evidence`. Deferred findings must use `status: "deferred-with-override"` with non-empty `evidence` and a `decisionRef`.
126
+
119
127
  ### Interactive tools
120
128
 
121
129
  The packaged server exposes `ask_user_questions` through MCP form elicitation. This keeps the existing GSD answer payload shape while allowing Claude Code CLI and other elicitation-capable clients to surface structured user choices.
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-tools.d.ts","sourceRoot":"","sources":["../src/workflow-tools.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwXxB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CA+BnG;AA+GD,wBAAgB,yBAAyB,CAAC,CAAC,SAAS;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,EACzE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,CAAC,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAE5B;AA6JD,4CAA4C;AAC5C,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAKrE;AAED,4CAA4C;AAC5C,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAE3E;AA6FD;;;;;;GAMG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAG7D;AAgCD,UAAU,aAAa;IACrB,IAAI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AqB,CACnC,UAAU,EAAE,aAAa,EACzB,OAAO,GAAE,4BAAiC,GACzC,IAAI,CA2zBN"}
@@ -216,6 +216,8 @@ function isWorkflowToolExecutors(value) {
216
216
  "executePlanMilestone",
217
217
  "executePlanSlice",
218
218
  "executeReplanSlice",
219
+ "executeReplanTask",
220
+ "executeReworkBriefSave",
219
221
  "executeSliceComplete",
220
222
  "executeCompleteMilestone",
221
223
  "executeValidateMilestone",
@@ -610,6 +612,18 @@ async function handleReplanSlice(projectDir, args) {
610
612
  const { projectDir: _projectDir, ...params } = args;
611
613
  return adaptExecutorResult(await runSerializedWorkflowOperation(() => executeReplanSlice(params, projectDir)));
612
614
  }
615
+ async function handleReplanTask(projectDir, args) {
616
+ await enforceWorkflowWriteGate("gsd_replan_task", projectDir, args.milestoneId);
617
+ const { executeReplanTask } = await getWorkflowToolExecutors();
618
+ const { projectDir: _projectDir, ...params } = args;
619
+ return adaptExecutorResult(await runSerializedWorkflowOperation(() => executeReplanTask(params, projectDir)));
620
+ }
621
+ async function handleReworkBriefSave(projectDir, args) {
622
+ await enforceWorkflowWriteGate("gsd_rework_brief_save", projectDir, args.milestoneId);
623
+ const { executeReworkBriefSave } = await getWorkflowToolExecutors();
624
+ const { projectDir: _projectDir, ...params } = args;
625
+ return adaptExecutorResult(await runSerializedWorkflowOperation(() => executeReworkBriefSave(params, projectDir)));
626
+ }
613
627
  async function handleCompleteMilestone(projectDir, args) {
614
628
  await enforceWorkflowWriteGate("gsd_complete_milestone", projectDir, args.milestoneId);
615
629
  const { executeCompleteMilestone } = await getWorkflowToolExecutors();
@@ -1085,6 +1099,40 @@ const replanSliceParams = {
1085
1099
  removedTaskIds: z.array(z.string()).describe("Task IDs to remove from the slice"),
1086
1100
  };
1087
1101
  const replanSliceSchema = z.object(replanSliceParams);
1102
+ const replanTaskParams = {
1103
+ projectDir: projectDirParam,
1104
+ milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
1105
+ sliceId: nonEmptyString("sliceId").describe("Slice ID (e.g. S01)"),
1106
+ taskId: nonEmptyString("taskId").describe("Task ID (e.g. T01)"),
1107
+ title: nonEmptyString("title").describe("Updated task title"),
1108
+ description: nonEmptyString("description").describe("Updated task description incorporating rework scope"),
1109
+ estimate: nonEmptyString("estimate").describe("Updated task estimate"),
1110
+ files: z.array(z.string()).describe("Updated files likely touched"),
1111
+ verify: nonEmptyString("verify").describe("Updated verification command or block"),
1112
+ inputs: z.array(z.string()).describe("Updated input files or references"),
1113
+ expectedOutput: z.array(z.string()).describe("Updated files this task creates or overwrites"),
1114
+ reworkBriefRef: z.string().optional().describe("Rework brief ID/reference that triggered this task replan"),
1115
+ };
1116
+ const replanTaskSchema = z.object(replanTaskParams);
1117
+ const reworkFindingSchema = z.object({
1118
+ findingId: nonEmptyString("findingId"),
1119
+ severity: z.enum(["blocking", "advisory"]),
1120
+ description: nonEmptyString("description"),
1121
+ requiredFix: nonEmptyString("requiredFix"),
1122
+ verificationCommands: z.array(z.string()),
1123
+ status: z.enum(["pending", "resolved", "deferred-with-override"]).optional(),
1124
+ evidence: z.string().optional(),
1125
+ decisionRef: z.string().optional(),
1126
+ });
1127
+ const reworkBriefSaveParams = {
1128
+ projectDir: projectDirParam,
1129
+ briefId: z.string().optional().describe("Stable brief ID"),
1130
+ milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
1131
+ sliceId: nonEmptyString("sliceId").describe("Slice ID (e.g. S01)"),
1132
+ taskId: nonEmptyString("taskId").describe("Task ID (e.g. T01)"),
1133
+ findings: z.array(reworkFindingSchema).min(1).describe("Structured rework findings for this task"),
1134
+ };
1135
+ const reworkBriefSaveSchema = z.object(reworkBriefSaveParams);
1088
1136
  const sliceCompleteParams = {
1089
1137
  projectDir: projectDirParam,
1090
1138
  sliceId: nonEmptyString("sliceId").describe("Slice ID (e.g. S01)"),
@@ -1242,6 +1290,12 @@ const taskCompleteParams = {
1242
1290
  continueWithDefault: z.boolean().describe("When true, the recommendation is recorded as the default, but auto-mode still pauses until the user resolves via /gsd escalate resolve."),
1243
1291
  }).optional().describe("ADR-011 Phase 2: optional escalation payload. Only honored when phases.mid_execution_escalation is true."),
1244
1292
  verificationEvidence: z.array(verificationEvidenceItemSchema).optional().describe("Verification evidence entries"),
1293
+ reworkResolution: z.array(z.object({
1294
+ findingId: nonEmptyString("findingId"),
1295
+ status: z.enum(["resolved", "deferred-with-override"]),
1296
+ evidence: nonEmptyString("evidence"),
1297
+ decisionRef: z.string().optional(),
1298
+ })).optional().describe("Resolution evidence for structured rework findings linked to this task"),
1245
1299
  };
1246
1300
  const taskCompleteSchema = z.object(taskCompleteParams);
1247
1301
  const taskReopenParams = {
@@ -1538,7 +1592,7 @@ export function registerWorkflowTools(realServer, options = {}) {
1538
1592
  const { executePlanSlice } = await getWorkflowToolExecutors();
1539
1593
  return adaptExecutorResult(await runSerializedWorkflowOperation(() => executePlanSlice(params, projectDir)));
1540
1594
  });
1541
- server.tool("gsd_plan_task", "Write task planning state to the GSD database and render tasks/T##-PLAN.md from DB.", planTaskParams, async (args) => {
1595
+ server.tool("gsd_plan_task", "Write task planning state to the GSD database and render the slice PLAN from DB.", planTaskParams, async (args) => {
1542
1596
  const parsed = parseWorkflowArgs(planTaskSchema, args);
1543
1597
  const { projectDir, ...params } = parsed;
1544
1598
  await enforceWorkflowWriteGate("gsd_plan_task", projectDir, params.milestoneId);
@@ -1553,7 +1607,7 @@ export function registerWorkflowTools(realServer, options = {}) {
1553
1607
  content: [{ type: "text", text: `Planned task ${result.taskId} (${result.sliceId}/${result.milestoneId})` }],
1554
1608
  };
1555
1609
  });
1556
- server.tool("gsd_task_plan", "Alias for gsd_plan_task. Write task planning state to the GSD database and render tasks/T##-PLAN.md from DB.", planTaskParams, async (args) => {
1610
+ server.tool("gsd_task_plan", "Alias for gsd_plan_task. Write task planning state to the GSD database and render the slice PLAN from DB.", planTaskParams, async (args) => {
1557
1611
  logAliasUsage("gsd_task_plan", "gsd_plan_task");
1558
1612
  const parsed = parseWorkflowArgs(planTaskSchema, args);
1559
1613
  const { projectDir, ...params } = parsed;
@@ -1578,6 +1632,14 @@ export function registerWorkflowTools(realServer, options = {}) {
1578
1632
  const parsed = parseWorkflowArgs(replanSliceSchema, args);
1579
1633
  return handleReplanSlice(parsed.projectDir, parsed);
1580
1634
  });
1635
+ server.tool("gsd_replan_task", "Update one pending task's planning contract after rework without touching sibling tasks.", replanTaskParams, async (args) => {
1636
+ const parsed = parseWorkflowArgs(replanTaskSchema, args);
1637
+ return handleReplanTask(parsed.projectDir, parsed);
1638
+ });
1639
+ server.tool("gsd_rework_brief_save", "Persist a structured task rework brief whose blocking findings gate gsd_task_complete.", reworkBriefSaveParams, async (args) => {
1640
+ const parsed = parseWorkflowArgs(reworkBriefSaveSchema, args);
1641
+ return handleReworkBriefSave(parsed.projectDir, parsed);
1642
+ });
1581
1643
  server.tool("gsd_slice_complete", "Record a completed slice to the GSD database, render SUMMARY.md + UAT.md, and update roadmap projection.", sliceCompleteParams, async (args) => {
1582
1644
  const parsed = parseWorkflowArgs(sliceCompleteSchema, args);
1583
1645
  return handleSliceComplete(parsed.projectDir, parsed);