gsd-pi 2.43.0 → 2.44.0-dev.62b5d6c

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 (568) hide show
  1. package/dist/cli.js +13 -1
  2. package/dist/help-text.js +24 -0
  3. package/dist/resources/extensions/bg-shell/overlay.js +3 -0
  4. package/dist/resources/extensions/github-sync/sync.js +2 -1
  5. package/dist/resources/extensions/gsd/auto/loop.js +0 -2
  6. package/dist/resources/extensions/gsd/auto/phases.js +7 -12
  7. package/dist/resources/extensions/gsd/auto-dashboard.js +19 -18
  8. package/dist/resources/extensions/gsd/auto-direct-dispatch.js +34 -19
  9. package/dist/resources/extensions/gsd/auto-dispatch.js +36 -21
  10. package/dist/resources/extensions/gsd/auto-post-unit.js +128 -14
  11. package/dist/resources/extensions/gsd/auto-prompts.js +202 -92
  12. package/dist/resources/extensions/gsd/auto-recovery.js +83 -135
  13. package/dist/resources/extensions/gsd/auto-supervisor.js +14 -0
  14. package/dist/resources/extensions/gsd/auto-timeout-recovery.js +4 -7
  15. package/dist/resources/extensions/gsd/auto-verification.js +5 -10
  16. package/dist/resources/extensions/gsd/auto-worktree.js +123 -30
  17. package/dist/resources/extensions/gsd/auto.js +1 -4
  18. package/dist/resources/extensions/gsd/bootstrap/db-tools.js +611 -0
  19. package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +28 -3
  20. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +7 -0
  21. package/dist/resources/extensions/gsd/commands/catalog.js +3 -1
  22. package/dist/resources/extensions/gsd/commands/handlers/ops.js +15 -1
  23. package/dist/resources/extensions/gsd/commands-handlers.js +1 -1
  24. package/dist/resources/extensions/gsd/commands-maintenance.js +78 -3
  25. package/dist/resources/extensions/gsd/dashboard-overlay.js +32 -31
  26. package/dist/resources/extensions/gsd/db-writer.js +95 -4
  27. package/dist/resources/extensions/gsd/dispatch-guard.js +35 -30
  28. package/dist/resources/extensions/gsd/doctor-checks.js +28 -11
  29. package/dist/resources/extensions/gsd/doctor-environment.js +28 -0
  30. package/dist/resources/extensions/gsd/doctor-types.js +0 -15
  31. package/dist/resources/extensions/gsd/doctor.js +46 -282
  32. package/dist/resources/extensions/gsd/file-watcher.js +5 -1
  33. package/dist/resources/extensions/gsd/files.js +14 -198
  34. package/dist/resources/extensions/gsd/git-service.js +4 -0
  35. package/dist/resources/extensions/gsd/gitignore.js +4 -0
  36. package/dist/resources/extensions/gsd/gsd-db.js +819 -197
  37. package/dist/resources/extensions/gsd/guided-flow.js +18 -8
  38. package/dist/resources/extensions/gsd/markdown-renderer.js +862 -0
  39. package/dist/resources/extensions/gsd/md-importer.js +182 -4
  40. package/dist/resources/extensions/gsd/native-git-bridge.js +10 -1
  41. package/dist/resources/extensions/gsd/parallel-eligibility.js +14 -19
  42. package/dist/resources/extensions/gsd/parallel-orchestrator.js +38 -0
  43. package/dist/resources/extensions/gsd/parsers-legacy.js +239 -0
  44. package/dist/resources/extensions/gsd/preferences-types.js +1 -0
  45. package/dist/resources/extensions/gsd/preferences-validation.js +9 -0
  46. package/dist/resources/extensions/gsd/preferences.js +1 -0
  47. package/dist/resources/extensions/gsd/prompts/complete-slice.md +22 -9
  48. package/dist/resources/extensions/gsd/prompts/discuss.md +2 -2
  49. package/dist/resources/extensions/gsd/prompts/execute-task.md +15 -5
  50. package/dist/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
  51. package/dist/resources/extensions/gsd/prompts/guided-execute-task.md +1 -1
  52. package/dist/resources/extensions/gsd/prompts/guided-plan-milestone.md +1 -1
  53. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +6 -10
  54. package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -7
  55. package/dist/resources/extensions/gsd/prompts/reactive-execute.md +3 -3
  56. package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +6 -7
  57. package/dist/resources/extensions/gsd/prompts/replan-slice.md +6 -6
  58. package/dist/resources/extensions/gsd/reactive-graph.js +33 -3
  59. package/dist/resources/extensions/gsd/skill-health.js +3 -1
  60. package/dist/resources/extensions/gsd/state.js +484 -30
  61. package/dist/resources/extensions/gsd/tools/complete-milestone.js +128 -0
  62. package/dist/resources/extensions/gsd/tools/complete-slice.js +244 -0
  63. package/dist/resources/extensions/gsd/tools/complete-task.js +204 -0
  64. package/dist/resources/extensions/gsd/tools/plan-milestone.js +205 -0
  65. package/dist/resources/extensions/gsd/tools/plan-slice.js +155 -0
  66. package/dist/resources/extensions/gsd/tools/plan-task.js +94 -0
  67. package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +152 -0
  68. package/dist/resources/extensions/gsd/tools/replan-slice.js +146 -0
  69. package/dist/resources/extensions/gsd/triage-resolution.js +17 -1
  70. package/dist/resources/extensions/gsd/undo.js +197 -3
  71. package/dist/resources/extensions/gsd/visualizer-data.js +53 -16
  72. package/dist/resources/extensions/gsd/workspace-index.js +63 -39
  73. package/dist/web/standalone/.next/BUILD_ID +1 -1
  74. package/dist/web/standalone/.next/app-path-routes-manifest.json +17 -16
  75. package/dist/web/standalone/.next/build-manifest.json +4 -4
  76. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  77. package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
  78. package/dist/web/standalone/.next/required-server-files.json +4 -4
  79. package/dist/web/standalone/.next/routes-manifest.json +6 -0
  80. package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
  81. package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  82. package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
  83. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  84. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  85. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  86. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  87. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  88. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  89. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  90. package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
  91. package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  92. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  93. package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -4
  94. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  95. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  96. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  97. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  98. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  99. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  100. package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
  101. package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
  102. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
  103. package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
  104. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
  105. package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
  106. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
  107. package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
  108. package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
  109. package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
  110. package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
  111. package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
  112. package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
  113. package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  114. package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
  115. package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
  116. package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
  117. package/dist/web/standalone/.next/server/app/api/doctor/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/onboarding/route.js +1 -1
  137. package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
  138. package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
  139. package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
  140. package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
  141. package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  142. package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
  143. package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
  144. package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +5 -5
  145. package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
  146. package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
  147. package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
  148. package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
  149. package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
  150. package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
  151. package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
  152. package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
  153. package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
  154. package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
  155. package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
  156. package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
  157. package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  158. package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
  159. package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
  160. package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
  161. package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
  162. package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -0
  163. package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -0
  164. package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -0
  165. package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
  166. package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
  167. package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
  168. package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
  169. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
  170. package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
  171. package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
  172. package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
  173. package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
  174. package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
  175. package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
  176. package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
  177. package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
  178. package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  179. package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
  180. package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
  181. package/dist/web/standalone/.next/server/app/index.html +1 -1
  182. package/dist/web/standalone/.next/server/app/index.rsc +5 -5
  183. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  184. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
  185. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  186. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -4
  187. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  188. package/dist/web/standalone/.next/server/app/page.js +2 -2
  189. package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  190. package/dist/web/standalone/.next/server/app-paths-manifest.json +17 -16
  191. package/dist/web/standalone/.next/server/chunks/229.js +3 -3
  192. package/dist/web/standalone/.next/server/chunks/471.js +3 -3
  193. package/dist/web/standalone/.next/server/functions-config-manifest.json +1 -0
  194. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  195. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  196. package/dist/web/standalone/.next/server/middleware.js +2 -2
  197. package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
  198. package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
  199. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  200. package/dist/web/standalone/.next/server/pages/500.html +2 -2
  201. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  202. package/dist/web/standalone/.next/static/chunks/{4024.c195dc1fdd2adbea.js → 4024.0de81b543b28b9fe.js} +2 -2
  203. package/dist/web/standalone/.next/static/chunks/app/_global-error/{page-d07a2c023f1aef1e.js → page-d83ba70a25a85472.js} +1 -1
  204. package/dist/web/standalone/.next/static/chunks/app/_not-found/page-f2a7482d42a5614b.js +1 -0
  205. package/dist/web/standalone/.next/static/chunks/app/api/boot/{route-d07a2c023f1aef1e.js → route-d83ba70a25a85472.js} +1 -1
  206. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/input/{route-d07a2c023f1aef1e.js → route-d83ba70a25a85472.js} +1 -1
  207. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/resize/{route-d07a2c023f1aef1e.js → route-d83ba70a25a85472.js} +1 -1
  208. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/stream/route-d83ba70a25a85472.js +1 -0
  209. package/dist/web/standalone/.next/static/chunks/app/api/browse-directories/route-d83ba70a25a85472.js +1 -0
  210. package/dist/web/standalone/.next/static/chunks/app/api/captures/route-d83ba70a25a85472.js +1 -0
  211. package/dist/web/standalone/.next/static/chunks/app/api/cleanup/route-d83ba70a25a85472.js +1 -0
  212. package/dist/web/standalone/.next/static/chunks/app/api/dev-mode/route-d83ba70a25a85472.js +1 -0
  213. package/dist/web/standalone/.next/static/chunks/app/api/doctor/route-d83ba70a25a85472.js +1 -0
  214. package/dist/web/standalone/.next/static/chunks/app/api/export-data/route-d83ba70a25a85472.js +1 -0
  215. package/dist/web/standalone/.next/static/chunks/app/api/files/route-d83ba70a25a85472.js +1 -0
  216. package/dist/web/standalone/.next/static/chunks/app/api/forensics/route-d83ba70a25a85472.js +1 -0
  217. package/dist/web/standalone/.next/static/chunks/app/api/git/route-d83ba70a25a85472.js +1 -0
  218. package/dist/web/standalone/.next/static/chunks/app/api/history/route-d83ba70a25a85472.js +1 -0
  219. package/dist/web/standalone/.next/static/chunks/app/api/hooks/route-d83ba70a25a85472.js +1 -0
  220. package/dist/web/standalone/.next/static/chunks/app/api/inspect/route-d83ba70a25a85472.js +1 -0
  221. package/dist/web/standalone/.next/static/chunks/app/api/knowledge/route-d83ba70a25a85472.js +1 -0
  222. package/dist/web/standalone/.next/static/chunks/app/api/live-state/route-d83ba70a25a85472.js +1 -0
  223. package/dist/web/standalone/.next/static/chunks/app/api/onboarding/route-d83ba70a25a85472.js +1 -0
  224. package/dist/web/standalone/.next/static/chunks/app/api/preferences/route-d83ba70a25a85472.js +1 -0
  225. package/dist/web/standalone/.next/static/chunks/app/api/projects/route-d83ba70a25a85472.js +1 -0
  226. package/dist/web/standalone/.next/static/chunks/app/api/recovery/route-d83ba70a25a85472.js +1 -0
  227. package/dist/web/standalone/.next/static/chunks/app/api/remote-questions/route-d83ba70a25a85472.js +1 -0
  228. package/dist/web/standalone/.next/static/chunks/app/api/session/browser/route-d83ba70a25a85472.js +1 -0
  229. package/dist/web/standalone/.next/static/chunks/app/api/session/command/route-d83ba70a25a85472.js +1 -0
  230. package/dist/web/standalone/.next/static/chunks/app/api/session/events/route-d83ba70a25a85472.js +1 -0
  231. package/dist/web/standalone/.next/static/chunks/app/api/session/manage/route-d83ba70a25a85472.js +1 -0
  232. package/dist/web/standalone/.next/static/chunks/app/api/settings-data/route-d83ba70a25a85472.js +1 -0
  233. package/dist/web/standalone/.next/static/chunks/app/api/shutdown/route-d83ba70a25a85472.js +1 -0
  234. package/dist/web/standalone/.next/static/chunks/app/api/skill-health/route-d83ba70a25a85472.js +1 -0
  235. package/dist/web/standalone/.next/static/chunks/app/api/steer/route-d83ba70a25a85472.js +1 -0
  236. package/dist/web/standalone/.next/static/chunks/app/api/switch-root/route-d83ba70a25a85472.js +1 -0
  237. package/dist/web/standalone/.next/static/chunks/app/api/terminal/input/route-d83ba70a25a85472.js +1 -0
  238. package/dist/web/standalone/.next/static/chunks/app/api/terminal/resize/route-d83ba70a25a85472.js +1 -0
  239. package/dist/web/standalone/.next/static/chunks/app/api/terminal/sessions/route-d83ba70a25a85472.js +1 -0
  240. package/dist/web/standalone/.next/static/chunks/app/api/terminal/stream/route-d83ba70a25a85472.js +1 -0
  241. package/dist/web/standalone/.next/static/chunks/app/api/terminal/upload/route-d83ba70a25a85472.js +1 -0
  242. package/dist/web/standalone/.next/static/chunks/app/api/undo/route-d83ba70a25a85472.js +1 -0
  243. package/dist/web/standalone/.next/static/chunks/app/api/update/route-d83ba70a25a85472.js +1 -0
  244. package/dist/web/standalone/.next/static/chunks/app/api/visualizer/route-d83ba70a25a85472.js +1 -0
  245. package/dist/web/standalone/.next/static/chunks/app/layout-a16c7a7ecdf0c2cf.js +1 -0
  246. package/dist/web/standalone/.next/static/chunks/app/page-b9367c5ae13b99c6.js +1 -0
  247. package/dist/web/standalone/.next/static/chunks/{main-app-2f2ee7b85712c2bd.js → main-app-fdab67f7802d7832.js} +1 -1
  248. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-d83ba70a25a85472.js +1 -0
  249. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-d83ba70a25a85472.js +1 -0
  250. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
  251. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-d83ba70a25a85472.js +1 -0
  252. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d83ba70a25a85472.js +1 -0
  253. package/dist/web/standalone/.next/static/chunks/{webpack-fa307370fcf9fb2c.js → webpack-9014b5adb127a98a.js} +1 -1
  254. package/dist/web/standalone/.next/static/css/8a727f372cf53002.css +1 -0
  255. package/dist/web/standalone/.next/static/fOnWQBjWXMKUs4bqTg530/_buildManifest.js +1 -0
  256. package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
  257. package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
  258. package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
  259. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
  260. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
  261. package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
  262. package/dist/web/standalone/server.js +1 -1
  263. package/package.json +4 -4
  264. package/packages/pi-ai/dist/models.custom.d.ts +173 -0
  265. package/packages/pi-ai/dist/models.custom.d.ts.map +1 -0
  266. package/packages/pi-ai/dist/models.custom.js +170 -0
  267. package/packages/pi-ai/dist/models.custom.js.map +1 -0
  268. package/packages/pi-ai/dist/models.d.ts.map +1 -1
  269. package/packages/pi-ai/dist/models.js +16 -1
  270. package/packages/pi-ai/dist/models.js.map +1 -1
  271. package/packages/pi-ai/dist/models.test.d.ts +2 -0
  272. package/packages/pi-ai/dist/models.test.d.ts.map +1 -0
  273. package/packages/pi-ai/dist/models.test.js +67 -0
  274. package/packages/pi-ai/dist/models.test.js.map +1 -0
  275. package/packages/pi-ai/src/models.custom.ts +172 -0
  276. package/packages/pi-ai/src/models.test.ts +85 -0
  277. package/packages/pi-ai/src/models.ts +17 -1
  278. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +10 -3
  279. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  280. package/packages/pi-coding-agent/dist/core/agent-session.js +21 -34
  281. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  282. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts +2 -2
  283. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  284. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
  285. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +2 -2
  286. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  287. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  288. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +4 -4
  289. package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -1
  290. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  291. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  292. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  293. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +6 -0
  294. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  295. package/packages/pi-coding-agent/dist/core/extensions/loader.js +80 -0
  296. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  297. package/packages/pi-coding-agent/dist/core/extensions/loader.test.js +63 -0
  298. package/packages/pi-coding-agent/dist/core/extensions/loader.test.js.map +1 -1
  299. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +37 -0
  300. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  301. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  302. package/packages/pi-coding-agent/dist/core/fallback-resolver.d.ts.map +1 -1
  303. package/packages/pi-coding-agent/dist/core/fallback-resolver.js +2 -3
  304. package/packages/pi-coding-agent/dist/core/fallback-resolver.js.map +1 -1
  305. package/packages/pi-coding-agent/dist/core/fallback-resolver.test.js +12 -2
  306. package/packages/pi-coding-agent/dist/core/fallback-resolver.test.js.map +1 -1
  307. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.d.ts +38 -0
  308. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.d.ts.map +1 -0
  309. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.js +192 -0
  310. package/packages/pi-coding-agent/dist/core/lifecycle-hooks.js.map +1 -0
  311. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts +5 -0
  312. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -1
  313. package/packages/pi-coding-agent/dist/core/lsp/client.js +69 -21
  314. package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -1
  315. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.d.ts +2 -0
  316. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.d.ts.map +1 -0
  317. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +255 -0
  318. package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -0
  319. package/packages/pi-coding-agent/dist/core/model-registry.d.ts +15 -0
  320. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  321. package/packages/pi-coding-agent/dist/core/model-registry.js +40 -3
  322. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  323. package/packages/pi-coding-agent/dist/core/package-commands.d.ts +25 -0
  324. package/packages/pi-coding-agent/dist/core/package-commands.d.ts.map +1 -0
  325. package/packages/pi-coding-agent/dist/core/package-commands.js +253 -0
  326. package/packages/pi-coding-agent/dist/core/package-commands.js.map +1 -0
  327. package/packages/pi-coding-agent/dist/core/package-commands.test.d.ts +2 -0
  328. package/packages/pi-coding-agent/dist/core/package-commands.test.d.ts.map +1 -0
  329. package/packages/pi-coding-agent/dist/core/package-commands.test.js +225 -0
  330. package/packages/pi-coding-agent/dist/core/package-commands.test.js.map +1 -0
  331. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  332. package/packages/pi-coding-agent/dist/core/sdk.js +4 -0
  333. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
  334. package/packages/pi-coding-agent/dist/index.d.ts +3 -1
  335. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  336. package/packages/pi-coding-agent/dist/index.js +1 -0
  337. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  338. package/packages/pi-coding-agent/dist/main.d.ts.map +1 -1
  339. package/packages/pi-coding-agent/dist/main.js +11 -199
  340. package/packages/pi-coding-agent/dist/main.js.map +1 -1
  341. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts +6 -0
  342. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  343. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +21 -0
  344. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  345. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -1
  346. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  347. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +8 -15
  348. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  349. package/packages/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
  350. package/packages/pi-coding-agent/dist/modes/print-mode.js +45 -34
  351. package/packages/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
  352. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +1 -0
  353. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  354. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js +7 -2
  355. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
  356. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  357. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +2 -1
  358. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
  359. package/packages/pi-coding-agent/package.json +1 -1
  360. package/packages/pi-coding-agent/src/core/agent-session.ts +26 -37
  361. package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +2 -2
  362. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +3 -3
  363. package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +4 -4
  364. package/packages/pi-coding-agent/src/core/extensions/index.ts +5 -0
  365. package/packages/pi-coding-agent/src/core/extensions/loader.test.ts +96 -0
  366. package/packages/pi-coding-agent/src/core/extensions/loader.ts +89 -0
  367. package/packages/pi-coding-agent/src/core/extensions/types.ts +44 -0
  368. package/packages/pi-coding-agent/src/core/fallback-resolver.test.ts +15 -2
  369. package/packages/pi-coding-agent/src/core/fallback-resolver.ts +2 -3
  370. package/packages/pi-coding-agent/src/core/lifecycle-hooks.ts +274 -0
  371. package/packages/pi-coding-agent/src/core/lsp/client.ts +83 -21
  372. package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +288 -0
  373. package/packages/pi-coding-agent/src/core/model-registry.ts +39 -3
  374. package/packages/pi-coding-agent/src/core/package-commands.test.ts +240 -0
  375. package/packages/pi-coding-agent/src/core/package-commands.ts +310 -0
  376. package/packages/pi-coding-agent/src/core/sdk.ts +4 -0
  377. package/packages/pi-coding-agent/src/index.ts +7 -0
  378. package/packages/pi-coding-agent/src/main.ts +11 -232
  379. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +20 -0
  380. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +9 -16
  381. package/packages/pi-coding-agent/src/modes/print-mode.ts +42 -32
  382. package/packages/pi-coding-agent/src/modes/rpc/rpc-client.ts +8 -2
  383. package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +2 -1
  384. package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -1
  385. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  386. package/pkg/dist/modes/interactive/theme/theme.js +8 -15
  387. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  388. package/pkg/package.json +1 -1
  389. package/src/resources/extensions/bg-shell/overlay.ts +4 -0
  390. package/src/resources/extensions/github-sync/sync.ts +2 -1
  391. package/src/resources/extensions/gsd/auto/loop-deps.ts +0 -8
  392. package/src/resources/extensions/gsd/auto/loop.ts +0 -2
  393. package/src/resources/extensions/gsd/auto/phases.ts +7 -20
  394. package/src/resources/extensions/gsd/auto/types.ts +0 -1
  395. package/src/resources/extensions/gsd/auto-dashboard.ts +20 -16
  396. package/src/resources/extensions/gsd/auto-direct-dispatch.ts +34 -19
  397. package/src/resources/extensions/gsd/auto-dispatch.ts +38 -21
  398. package/src/resources/extensions/gsd/auto-post-unit.ts +150 -15
  399. package/src/resources/extensions/gsd/auto-prompts.ts +186 -103
  400. package/src/resources/extensions/gsd/auto-recovery.ts +77 -142
  401. package/src/resources/extensions/gsd/auto-supervisor.ts +14 -0
  402. package/src/resources/extensions/gsd/auto-timeout-recovery.ts +6 -7
  403. package/src/resources/extensions/gsd/auto-verification.ts +4 -9
  404. package/src/resources/extensions/gsd/auto-worktree.ts +126 -30
  405. package/src/resources/extensions/gsd/auto.ts +0 -9
  406. package/src/resources/extensions/gsd/bootstrap/db-tools.ts +675 -4
  407. package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +31 -3
  408. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +7 -0
  409. package/src/resources/extensions/gsd/commands/catalog.ts +3 -1
  410. package/src/resources/extensions/gsd/commands/handlers/ops.ts +15 -1
  411. package/src/resources/extensions/gsd/commands-handlers.ts +1 -1
  412. package/src/resources/extensions/gsd/commands-maintenance.ts +86 -3
  413. package/src/resources/extensions/gsd/dashboard-overlay.ts +17 -13
  414. package/src/resources/extensions/gsd/db-writer.ts +105 -4
  415. package/src/resources/extensions/gsd/dispatch-guard.ts +32 -30
  416. package/src/resources/extensions/gsd/doctor-checks.ts +25 -11
  417. package/src/resources/extensions/gsd/doctor-environment.ts +31 -0
  418. package/src/resources/extensions/gsd/doctor-types.ts +0 -23
  419. package/src/resources/extensions/gsd/doctor.ts +45 -295
  420. package/src/resources/extensions/gsd/file-watcher.ts +4 -1
  421. package/src/resources/extensions/gsd/files.ts +16 -220
  422. package/src/resources/extensions/gsd/git-service.ts +4 -0
  423. package/src/resources/extensions/gsd/gitignore.ts +4 -0
  424. package/src/resources/extensions/gsd/gsd-db.ts +1157 -370
  425. package/src/resources/extensions/gsd/guided-flow.ts +20 -8
  426. package/src/resources/extensions/gsd/markdown-renderer.ts +1098 -0
  427. package/src/resources/extensions/gsd/md-importer.ts +211 -2
  428. package/src/resources/extensions/gsd/native-git-bridge.ts +12 -1
  429. package/src/resources/extensions/gsd/parallel-eligibility.ts +14 -18
  430. package/src/resources/extensions/gsd/parallel-orchestrator.ts +43 -0
  431. package/src/resources/extensions/gsd/parsers-legacy.ts +271 -0
  432. package/src/resources/extensions/gsd/preferences-types.ts +3 -0
  433. package/src/resources/extensions/gsd/preferences-validation.ts +9 -0
  434. package/src/resources/extensions/gsd/preferences.ts +1 -0
  435. package/src/resources/extensions/gsd/prompts/complete-slice.md +22 -9
  436. package/src/resources/extensions/gsd/prompts/discuss.md +2 -2
  437. package/src/resources/extensions/gsd/prompts/execute-task.md +15 -5
  438. package/src/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
  439. package/src/resources/extensions/gsd/prompts/guided-execute-task.md +1 -1
  440. package/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +1 -1
  441. package/src/resources/extensions/gsd/prompts/plan-milestone.md +6 -10
  442. package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -7
  443. package/src/resources/extensions/gsd/prompts/reactive-execute.md +3 -3
  444. package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +6 -7
  445. package/src/resources/extensions/gsd/prompts/replan-slice.md +6 -6
  446. package/src/resources/extensions/gsd/reactive-graph.ts +33 -3
  447. package/src/resources/extensions/gsd/skill-health.ts +2 -1
  448. package/src/resources/extensions/gsd/state.ts +547 -29
  449. package/src/resources/extensions/gsd/tests/atomic-task-closeout.test.ts +8 -120
  450. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +20 -11
  451. package/src/resources/extensions/gsd/tests/auto-preflight.test.ts +1 -1
  452. package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +150 -5
  453. package/src/resources/extensions/gsd/tests/auto-stash-merge.test.ts +121 -0
  454. package/src/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +15 -20
  455. package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +1 -1
  456. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +410 -0
  457. package/src/resources/extensions/gsd/tests/complete-task.test.ts +439 -0
  458. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +0 -2
  459. package/src/resources/extensions/gsd/tests/derive-state-crossval.test.ts +527 -0
  460. package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +593 -2
  461. package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +104 -57
  462. package/src/resources/extensions/gsd/tests/doctor-completion-deferral.test.ts +22 -80
  463. package/src/resources/extensions/gsd/tests/doctor-enhancements.test.ts +5 -7
  464. package/src/resources/extensions/gsd/tests/doctor-environment-worktree.test.ts +175 -0
  465. package/src/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +38 -130
  466. package/src/resources/extensions/gsd/tests/doctor-roadmap-summary-atomicity.test.ts +38 -76
  467. package/src/resources/extensions/gsd/tests/doctor.test.ts +9 -19
  468. package/src/resources/extensions/gsd/tests/flag-file-db.test.ts +290 -0
  469. package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +240 -0
  470. package/src/resources/extensions/gsd/tests/git-service.test.ts +6 -2
  471. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +1 -1
  472. package/src/resources/extensions/gsd/tests/gsd-recover.test.ts +462 -0
  473. package/src/resources/extensions/gsd/tests/idle-recovery.test.ts +4 -172
  474. package/src/resources/extensions/gsd/tests/integration-proof.test.ts +643 -0
  475. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +0 -3
  476. package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +1205 -0
  477. package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
  478. package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
  479. package/src/resources/extensions/gsd/tests/migrate-hierarchy.test.ts +439 -0
  480. package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +2 -1
  481. package/src/resources/extensions/gsd/tests/migrate-writer.test.ts +2 -0
  482. package/src/resources/extensions/gsd/tests/parsers.test.ts +2 -1
  483. package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +176 -113
  484. package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +7 -0
  485. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +179 -0
  486. package/src/resources/extensions/gsd/tests/plan-task.test.ts +145 -0
  487. package/src/resources/extensions/gsd/tests/planning-crossval.test.ts +305 -0
  488. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +139 -0
  489. package/src/resources/extensions/gsd/tests/reassess-handler.test.ts +325 -0
  490. package/src/resources/extensions/gsd/tests/replan-handler.test.ts +410 -0
  491. package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +1 -1
  492. package/src/resources/extensions/gsd/tests/rogue-file-detection.test.ts +296 -0
  493. package/src/resources/extensions/gsd/tests/schema-v9-sequence.test.ts +176 -0
  494. package/src/resources/extensions/gsd/tests/shared-wal.test.ts +216 -0
  495. package/src/resources/extensions/gsd/tests/token-cost-display.test.ts +118 -0
  496. package/src/resources/extensions/gsd/tests/tool-naming.test.ts +11 -3
  497. package/src/resources/extensions/gsd/tests/undo.test.ts +321 -1
  498. package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +1 -1
  499. package/src/resources/extensions/gsd/tests/verification-evidence.test.ts +0 -142
  500. package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +12 -5
  501. package/src/resources/extensions/gsd/tools/complete-milestone.ts +176 -0
  502. package/src/resources/extensions/gsd/tools/complete-slice.ts +300 -0
  503. package/src/resources/extensions/gsd/tools/complete-task.ts +245 -0
  504. package/src/resources/extensions/gsd/tools/plan-milestone.ts +249 -0
  505. package/src/resources/extensions/gsd/tools/plan-slice.ts +194 -0
  506. package/src/resources/extensions/gsd/tools/plan-task.ts +116 -0
  507. package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +203 -0
  508. package/src/resources/extensions/gsd/tools/replan-slice.ts +192 -0
  509. package/src/resources/extensions/gsd/triage-resolution.ts +20 -1
  510. package/src/resources/extensions/gsd/types.ts +50 -0
  511. package/src/resources/extensions/gsd/undo.ts +247 -3
  512. package/src/resources/extensions/gsd/visualizer-data.ts +54 -17
  513. package/src/resources/extensions/gsd/workspace-index.ts +64 -46
  514. package/dist/resources/extensions/gsd/auto-observability.js +0 -56
  515. package/dist/resources/extensions/gsd/observability-validator.js +0 -422
  516. package/dist/resources/extensions/gsd/roadmap-mutations.js +0 -110
  517. package/dist/web/standalone/.next/static/VvclDCW6TAWjEyLU-EYL1/_buildManifest.js +0 -1
  518. package/dist/web/standalone/.next/static/chunks/app/_not-found/page-e07acdb7dd069836.js +0 -1
  519. package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/stream/route-d07a2c023f1aef1e.js +0 -1
  520. package/dist/web/standalone/.next/static/chunks/app/api/browse-directories/route-d07a2c023f1aef1e.js +0 -1
  521. package/dist/web/standalone/.next/static/chunks/app/api/captures/route-d07a2c023f1aef1e.js +0 -1
  522. package/dist/web/standalone/.next/static/chunks/app/api/cleanup/route-d07a2c023f1aef1e.js +0 -1
  523. package/dist/web/standalone/.next/static/chunks/app/api/dev-mode/route-d07a2c023f1aef1e.js +0 -1
  524. package/dist/web/standalone/.next/static/chunks/app/api/doctor/route-d07a2c023f1aef1e.js +0 -1
  525. package/dist/web/standalone/.next/static/chunks/app/api/export-data/route-d07a2c023f1aef1e.js +0 -1
  526. package/dist/web/standalone/.next/static/chunks/app/api/files/route-d07a2c023f1aef1e.js +0 -1
  527. package/dist/web/standalone/.next/static/chunks/app/api/forensics/route-d07a2c023f1aef1e.js +0 -1
  528. package/dist/web/standalone/.next/static/chunks/app/api/git/route-d07a2c023f1aef1e.js +0 -1
  529. package/dist/web/standalone/.next/static/chunks/app/api/history/route-d07a2c023f1aef1e.js +0 -1
  530. package/dist/web/standalone/.next/static/chunks/app/api/hooks/route-d07a2c023f1aef1e.js +0 -1
  531. package/dist/web/standalone/.next/static/chunks/app/api/inspect/route-d07a2c023f1aef1e.js +0 -1
  532. package/dist/web/standalone/.next/static/chunks/app/api/knowledge/route-d07a2c023f1aef1e.js +0 -1
  533. package/dist/web/standalone/.next/static/chunks/app/api/live-state/route-d07a2c023f1aef1e.js +0 -1
  534. package/dist/web/standalone/.next/static/chunks/app/api/onboarding/route-d07a2c023f1aef1e.js +0 -1
  535. package/dist/web/standalone/.next/static/chunks/app/api/preferences/route-d07a2c023f1aef1e.js +0 -1
  536. package/dist/web/standalone/.next/static/chunks/app/api/projects/route-d07a2c023f1aef1e.js +0 -1
  537. package/dist/web/standalone/.next/static/chunks/app/api/recovery/route-d07a2c023f1aef1e.js +0 -1
  538. package/dist/web/standalone/.next/static/chunks/app/api/remote-questions/route-d07a2c023f1aef1e.js +0 -1
  539. package/dist/web/standalone/.next/static/chunks/app/api/session/browser/route-d07a2c023f1aef1e.js +0 -1
  540. package/dist/web/standalone/.next/static/chunks/app/api/session/command/route-d07a2c023f1aef1e.js +0 -1
  541. package/dist/web/standalone/.next/static/chunks/app/api/session/events/route-d07a2c023f1aef1e.js +0 -1
  542. package/dist/web/standalone/.next/static/chunks/app/api/session/manage/route-d07a2c023f1aef1e.js +0 -1
  543. package/dist/web/standalone/.next/static/chunks/app/api/settings-data/route-d07a2c023f1aef1e.js +0 -1
  544. package/dist/web/standalone/.next/static/chunks/app/api/shutdown/route-d07a2c023f1aef1e.js +0 -1
  545. package/dist/web/standalone/.next/static/chunks/app/api/skill-health/route-d07a2c023f1aef1e.js +0 -1
  546. package/dist/web/standalone/.next/static/chunks/app/api/steer/route-d07a2c023f1aef1e.js +0 -1
  547. package/dist/web/standalone/.next/static/chunks/app/api/terminal/input/route-d07a2c023f1aef1e.js +0 -1
  548. package/dist/web/standalone/.next/static/chunks/app/api/terminal/resize/route-d07a2c023f1aef1e.js +0 -1
  549. package/dist/web/standalone/.next/static/chunks/app/api/terminal/sessions/route-d07a2c023f1aef1e.js +0 -1
  550. package/dist/web/standalone/.next/static/chunks/app/api/terminal/stream/route-d07a2c023f1aef1e.js +0 -1
  551. package/dist/web/standalone/.next/static/chunks/app/api/terminal/upload/route-d07a2c023f1aef1e.js +0 -1
  552. package/dist/web/standalone/.next/static/chunks/app/api/undo/route-d07a2c023f1aef1e.js +0 -1
  553. package/dist/web/standalone/.next/static/chunks/app/api/update/route-d07a2c023f1aef1e.js +0 -1
  554. package/dist/web/standalone/.next/static/chunks/app/api/visualizer/route-d07a2c023f1aef1e.js +0 -1
  555. package/dist/web/standalone/.next/static/chunks/app/layout-745c6ed5fea5fb06.js +0 -1
  556. package/dist/web/standalone/.next/static/chunks/app/page-801b53eff6e83579.js +0 -1
  557. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-d07a2c023f1aef1e.js +0 -1
  558. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-d07a2c023f1aef1e.js +0 -1
  559. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-e6255954dccfcf0a.js +0 -1
  560. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-d07a2c023f1aef1e.js +0 -1
  561. package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d07a2c023f1aef1e.js +0 -1
  562. package/dist/web/standalone/.next/static/css/123c0bb039697968.css +0 -1
  563. package/src/resources/extensions/gsd/auto-observability.ts +0 -74
  564. package/src/resources/extensions/gsd/observability-validator.ts +0 -456
  565. package/src/resources/extensions/gsd/roadmap-mutations.ts +0 -134
  566. package/src/resources/extensions/gsd/tests/doctor-task-done-missing-summary-slice-loop.test.ts +0 -174
  567. package/src/resources/extensions/gsd/tests/plan-quality-validator.test.ts +0 -474
  568. /package/dist/web/standalone/.next/static/{VvclDCW6TAWjEyLU-EYL1 → fOnWQBjWXMKUs4bqTg530}/_ssgManifest.js +0 -0
@@ -24,6 +24,17 @@ const clients = new Map<string, LspClient>();
24
24
  const clientLocks = new Map<string, Promise<LspClient>>();
25
25
  const fileOperationLocks = new Map<string, Promise<void>>();
26
26
 
27
+ /** Track stream listeners per client so they can be removed on shutdown. */
28
+ interface StreamHandlers {
29
+ stdoutData?: (chunk: Buffer) => void;
30
+ stdoutEnd?: () => void;
31
+ stdoutError?: () => void;
32
+ stderrData?: (chunk: Buffer) => void;
33
+ stderrEnd?: () => void;
34
+ stderrError?: () => void;
35
+ }
36
+ const clientStreamHandlers = new Map<string, StreamHandlers>();
37
+
27
38
  // Idle timeout configuration (disabled by default)
28
39
  let idleTimeoutMs: number | null = null;
29
40
  let idleCheckInterval: ReturnType<typeof setInterval> | null = null;
@@ -257,7 +268,9 @@ async function startMessageReader(client: LspClient): Promise<void> {
257
268
  }
258
269
 
259
270
  return new Promise<void>((resolve) => {
260
- stdout.on("data", async (chunk: Buffer) => {
271
+ const handlers = clientStreamHandlers.get(client.name) ?? {};
272
+
273
+ handlers.stdoutData = async (chunk: Buffer) => {
261
274
  const currentBuffer: Buffer = Buffer.concat([client.messageBuffer, chunk]);
262
275
 
263
276
  if (currentBuffer.length > MAX_MESSAGE_BUFFER_SIZE) {
@@ -307,17 +320,22 @@ async function startMessageReader(client: LspClient): Promise<void> {
307
320
  }
308
321
 
309
322
  client.messageBuffer = workingBuffer;
310
- });
323
+ };
324
+ stdout.on("data", handlers.stdoutData);
311
325
 
312
- stdout.on("end", () => {
326
+ handlers.stdoutEnd = () => {
313
327
  client.isReading = false;
314
328
  resolve();
315
- });
329
+ };
330
+ stdout.on("end", handlers.stdoutEnd);
316
331
 
317
- stdout.on("error", () => {
332
+ handlers.stdoutError = () => {
318
333
  client.isReading = false;
319
334
  resolve();
320
- });
335
+ };
336
+ stdout.on("error", handlers.stdoutError);
337
+
338
+ clientStreamHandlers.set(client.name, handlers);
321
339
  });
322
340
  }
323
341
 
@@ -402,21 +420,28 @@ async function startStderrReader(client: LspClient): Promise<void> {
402
420
  if (!stderr) return;
403
421
 
404
422
  return new Promise<void>((resolve) => {
405
- stderr.on("data", (chunk: Buffer) => {
423
+ const handlers = clientStreamHandlers.get(client.name) ?? {};
424
+
425
+ handlers.stderrData = (chunk: Buffer) => {
406
426
  const text = chunk.toString("utf-8");
407
427
  client.stderrBuffer += text;
408
428
  if (client.stderrBuffer.length > 4096) {
409
429
  client.stderrBuffer = client.stderrBuffer.slice(-4096);
410
430
  }
411
- });
431
+ };
432
+ stderr.on("data", handlers.stderrData);
412
433
 
413
- stderr.on("end", () => {
434
+ handlers.stderrEnd = () => {
414
435
  resolve();
415
- });
436
+ };
437
+ stderr.on("end", handlers.stderrEnd);
416
438
 
417
- stderr.on("error", () => {
439
+ handlers.stderrError = () => {
418
440
  resolve();
419
- });
441
+ };
442
+ stderr.on("error", handlers.stderrError);
443
+
444
+ clientStreamHandlers.set(client.name, handlers);
420
445
  });
421
446
  }
422
447
 
@@ -706,6 +731,23 @@ export function notifyFileChanged(filePath: string): void {
706
731
  }
707
732
  }
708
733
 
734
+ /**
735
+ * Remove stdout/stderr stream listeners for a client to prevent leaks.
736
+ */
737
+ function removeStreamHandlers(client: LspClient): void {
738
+ const handlers = clientStreamHandlers.get(client.name);
739
+ if (!handlers) return;
740
+
741
+ if (handlers.stdoutData) client.proc.stdout?.removeListener("data", handlers.stdoutData);
742
+ if (handlers.stdoutEnd) client.proc.stdout?.removeListener("end", handlers.stdoutEnd);
743
+ if (handlers.stdoutError) client.proc.stdout?.removeListener("error", handlers.stdoutError);
744
+ if (handlers.stderrData) client.proc.stderr?.removeListener("data", handlers.stderrData);
745
+ if (handlers.stderrEnd) client.proc.stderr?.removeListener("end", handlers.stderrEnd);
746
+ if (handlers.stderrError) client.proc.stderr?.removeListener("error", handlers.stderrError);
747
+
748
+ clientStreamHandlers.delete(client.name);
749
+ }
750
+
709
751
  /**
710
752
  * Shutdown a specific client by key.
711
753
  */
@@ -720,6 +762,9 @@ function shutdownClient(key: string): void {
720
762
 
721
763
  sendRequest(client, "shutdown", null).catch(() => {});
722
764
 
765
+ // Remove stream listeners before killing the process
766
+ removeStreamHandlers(client);
767
+
723
768
  try {
724
769
  killProcessTree(client.proc.pid);
725
770
  } catch {
@@ -860,6 +905,9 @@ function shutdownAll(): void {
860
905
  pending.reject(err);
861
906
  }
862
907
 
908
+ // Remove stream listeners before killing the process
909
+ removeStreamHandlers(client);
910
+
863
911
  void (async () => {
864
912
  const timeout = new Promise<void>(resolve => setTimeout(resolve, 5_000));
865
913
  const result = sendRequest(client, "shutdown", null).catch(() => {});
@@ -893,14 +941,28 @@ export function getActiveClients(): LspServerStatus[] {
893
941
  // Process Cleanup
894
942
  // =============================================================================
895
943
 
944
+ const _beforeExitHandler = () => shutdownAll();
945
+ const _sigintHandler = () => {
946
+ shutdownAll();
947
+ process.exit(0);
948
+ };
949
+ const _sigtermHandler = () => {
950
+ shutdownAll();
951
+ process.exit(0);
952
+ };
953
+
896
954
  if (typeof process !== "undefined") {
897
- process.on("beforeExit", shutdownAll);
898
- process.on("SIGINT", () => {
899
- shutdownAll();
900
- process.exit(0);
901
- });
902
- process.on("SIGTERM", () => {
903
- shutdownAll();
904
- process.exit(0);
905
- });
955
+ process.on("beforeExit", _beforeExitHandler);
956
+ process.on("SIGINT", _sigintHandler);
957
+ process.on("SIGTERM", _sigtermHandler);
958
+ }
959
+
960
+ /**
961
+ * Remove process-level signal handlers registered at module load.
962
+ * Call this during graceful teardown to prevent leaked listeners.
963
+ */
964
+ export function removeProcessHandlers(): void {
965
+ process.off("beforeExit", _beforeExitHandler);
966
+ process.off("SIGINT", _sigintHandler);
967
+ process.off("SIGTERM", _sigtermHandler);
906
968
  }
@@ -0,0 +1,288 @@
1
+ import assert from "node:assert/strict";
2
+ import { describe, it } from "node:test";
3
+ import type { Api, Model } from "@gsd/pi-ai";
4
+ import type { AuthStorage } from "./auth-storage.js";
5
+ import { ModelRegistry } from "./model-registry.js";
6
+
7
+ function createRegistry(hasAuthFn?: (provider: string) => boolean): ModelRegistry {
8
+ const authStorage = {
9
+ setFallbackResolver: () => {},
10
+ onCredentialChange: () => {},
11
+ getOAuthProviders: () => [],
12
+ get: () => undefined,
13
+ hasAuth: hasAuthFn ?? (() => false),
14
+ getApiKey: async () => undefined,
15
+ } as unknown as AuthStorage;
16
+
17
+ return new ModelRegistry(authStorage, undefined);
18
+ }
19
+
20
+ function createProviderModel(id: string): NonNullable<Parameters<ModelRegistry["registerProvider"]>[1]["models"]>[number] {
21
+ return {
22
+ id,
23
+ name: id,
24
+ api: "openai-completions",
25
+ reasoning: false,
26
+ input: ["text"],
27
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
28
+ contextWindow: 128000,
29
+ maxTokens: 16384,
30
+ };
31
+ }
32
+
33
+ function findModel(registry: ModelRegistry, provider: string, id: string): Model<Api> | undefined {
34
+ return registry.getAvailable().find((m) => m.provider === provider && m.id === id);
35
+ }
36
+
37
+ // ─── Registration ─────────────────────────────────────────────────────────────
38
+
39
+ describe("ModelRegistry authMode — registration", () => {
40
+ it("registers externalCli provider without apiKey/oauth", () => {
41
+ const registry = createRegistry();
42
+ assert.doesNotThrow(() => {
43
+ registry.registerProvider("cli-provider", {
44
+ authMode: "externalCli",
45
+ baseUrl: "https://cli.local",
46
+ api: "openai-completions",
47
+ models: [createProviderModel("cli-model")],
48
+ });
49
+ });
50
+ });
51
+
52
+ it("registers none provider without apiKey/oauth", () => {
53
+ const registry = createRegistry();
54
+ assert.doesNotThrow(() => {
55
+ registry.registerProvider("none-provider", {
56
+ authMode: "none",
57
+ baseUrl: "http://localhost:11434",
58
+ api: "openai-completions",
59
+ models: [createProviderModel("local-model")],
60
+ });
61
+ });
62
+ });
63
+
64
+ it("rejects apiKey provider without apiKey or oauth", () => {
65
+ const registry = createRegistry();
66
+ assert.throws(() => {
67
+ registry.registerProvider("apikey-provider", {
68
+ authMode: "apiKey",
69
+ baseUrl: "https://api.local",
70
+ api: "openai-completions",
71
+ models: [createProviderModel("model")],
72
+ });
73
+ });
74
+ });
75
+
76
+ it("rejects provider with no authMode and no apiKey/oauth (defaults to apiKey)", () => {
77
+ const registry = createRegistry();
78
+ assert.throws(() => {
79
+ registry.registerProvider("bare-provider", {
80
+ baseUrl: "https://api.local",
81
+ api: "openai-completions",
82
+ models: [createProviderModel("model")],
83
+ });
84
+ });
85
+ });
86
+ });
87
+
88
+ // ─── getProviderAuthMode ──────────────────────────────────────────────────────
89
+
90
+ describe("ModelRegistry authMode — getProviderAuthMode", () => {
91
+ it("returns apiKey for unregistered (built-in) providers", () => {
92
+ const registry = createRegistry();
93
+ assert.equal(registry.getProviderAuthMode("anthropic"), "apiKey");
94
+ });
95
+
96
+ it("returns explicit authMode when set", () => {
97
+ const registry = createRegistry();
98
+ registry.registerProvider("cli", {
99
+ authMode: "externalCli",
100
+ baseUrl: "https://cli.local",
101
+ api: "openai-completions",
102
+ models: [createProviderModel("m")],
103
+ });
104
+ assert.equal(registry.getProviderAuthMode("cli"), "externalCli");
105
+ });
106
+
107
+ it("returns none when authMode is none", () => {
108
+ const registry = createRegistry();
109
+ registry.registerProvider("local", {
110
+ authMode: "none",
111
+ baseUrl: "http://localhost:11434",
112
+ api: "openai-completions",
113
+ models: [createProviderModel("m")],
114
+ });
115
+ assert.equal(registry.getProviderAuthMode("local"), "none");
116
+ });
117
+ });
118
+
119
+ // ─── isProviderRequestReady ───────────────────────────────────────────────────
120
+
121
+ describe("ModelRegistry authMode — isProviderRequestReady", () => {
122
+ it("returns true for externalCli without stored auth", () => {
123
+ const registry = createRegistry(() => false);
124
+ registry.registerProvider("cli", {
125
+ authMode: "externalCli",
126
+ baseUrl: "https://cli.local",
127
+ api: "openai-completions",
128
+ models: [createProviderModel("m")],
129
+ });
130
+ assert.equal(registry.isProviderRequestReady("cli"), true);
131
+ });
132
+
133
+ it("returns true for none without stored auth", () => {
134
+ const registry = createRegistry(() => false);
135
+ registry.registerProvider("local", {
136
+ authMode: "none",
137
+ baseUrl: "http://localhost:11434",
138
+ api: "openai-completions",
139
+ models: [createProviderModel("m")],
140
+ });
141
+ assert.equal(registry.isProviderRequestReady("local"), true);
142
+ });
143
+
144
+ it("returns false for apiKey provider without stored auth", () => {
145
+ const registry = createRegistry(() => false);
146
+ assert.equal(registry.isProviderRequestReady("anthropic"), false);
147
+ });
148
+
149
+ it("returns true for apiKey provider with stored auth", () => {
150
+ const registry = createRegistry(() => true);
151
+ assert.equal(registry.isProviderRequestReady("anthropic"), true);
152
+ });
153
+ });
154
+
155
+ // ─── isReady callback ─────────────────────────────────────────────────────────
156
+
157
+ describe("ModelRegistry authMode — isReady callback", () => {
158
+ it("calls isReady and returns its result for externalCli provider", () => {
159
+ const registry = createRegistry(() => false);
160
+ registry.registerProvider("cli-down", {
161
+ authMode: "externalCli",
162
+ baseUrl: "https://cli.local",
163
+ api: "openai-completions",
164
+ isReady: () => false,
165
+ models: [createProviderModel("m")],
166
+ });
167
+ assert.equal(registry.isProviderRequestReady("cli-down"), false);
168
+ });
169
+
170
+ it("calls isReady for apiKey provider (overrides hasAuth)", () => {
171
+ const registry = createRegistry(() => true);
172
+ registry.registerProvider("strict-provider", {
173
+ apiKey: "MY_KEY",
174
+ baseUrl: "https://api.local",
175
+ api: "openai-completions",
176
+ isReady: () => false,
177
+ models: [createProviderModel("m")],
178
+ });
179
+ assert.equal(registry.isProviderRequestReady("strict-provider"), false);
180
+ });
181
+
182
+ it("isReady returning true makes provider available", () => {
183
+ const registry = createRegistry(() => false);
184
+ registry.registerProvider("healthy-cli", {
185
+ authMode: "externalCli",
186
+ baseUrl: "https://cli.local",
187
+ api: "openai-completions",
188
+ isReady: () => true,
189
+ models: [createProviderModel("m")],
190
+ });
191
+ assert.equal(registry.isProviderRequestReady("healthy-cli"), true);
192
+ });
193
+
194
+ it("falls through to default behavior when isReady not provided", () => {
195
+ const registry = createRegistry(() => false);
196
+ registry.registerProvider("no-callback", {
197
+ authMode: "externalCli",
198
+ baseUrl: "https://cli.local",
199
+ api: "openai-completions",
200
+ models: [createProviderModel("m")],
201
+ });
202
+ // externalCli without isReady → true (default)
203
+ assert.equal(registry.isProviderRequestReady("no-callback"), true);
204
+ });
205
+ });
206
+
207
+ // ─── getAvailable ─────────────────────────────────────────────────────────────
208
+
209
+ describe("ModelRegistry authMode — getAvailable", () => {
210
+ it("includes externalCli models without stored auth", () => {
211
+ const registry = createRegistry(() => false);
212
+ registry.registerProvider("cli", {
213
+ authMode: "externalCli",
214
+ baseUrl: "https://cli.local",
215
+ api: "openai-completions",
216
+ models: [createProviderModel("cli-model")],
217
+ });
218
+ assert.ok(findModel(registry, "cli", "cli-model"));
219
+ });
220
+
221
+ it("includes none models without stored auth", () => {
222
+ const registry = createRegistry(() => false);
223
+ registry.registerProvider("local", {
224
+ authMode: "none",
225
+ baseUrl: "http://localhost:11434",
226
+ api: "openai-completions",
227
+ models: [createProviderModel("local-model")],
228
+ });
229
+ assert.ok(findModel(registry, "local", "local-model"));
230
+ });
231
+
232
+ it("excludes externalCli models when isReady returns false", () => {
233
+ const registry = createRegistry(() => false);
234
+ registry.registerProvider("cli-down", {
235
+ authMode: "externalCli",
236
+ baseUrl: "https://cli.local",
237
+ api: "openai-completions",
238
+ isReady: () => false,
239
+ models: [createProviderModel("m")],
240
+ });
241
+ assert.equal(findModel(registry, "cli-down", "m"), undefined);
242
+ });
243
+
244
+ it("excludes apiKey models without stored auth", () => {
245
+ const registry = createRegistry(() => false);
246
+ // Built-in providers have no registeredProviders entry, so authMode defaults to apiKey
247
+ // getAvailable filters by isProviderRequestReady → hasAuth → false
248
+ const available = registry.getAvailable();
249
+ // No models should be available since hasAuth returns false for everything
250
+ assert.equal(available.length, 0);
251
+ });
252
+ });
253
+
254
+ // ─── getApiKey ────────────────────────────────────────────────────────────────
255
+
256
+ describe("ModelRegistry authMode — getApiKey", () => {
257
+ it("returns undefined for externalCli provider", async () => {
258
+ const registry = createRegistry();
259
+ registry.registerProvider("cli", {
260
+ authMode: "externalCli",
261
+ baseUrl: "https://cli.local",
262
+ api: "openai-completions",
263
+ models: [createProviderModel("m")],
264
+ });
265
+ const model = registry.getAll().find((m) => m.provider === "cli")!;
266
+ assert.equal(await registry.getApiKey(model), undefined);
267
+ });
268
+
269
+ it("returns undefined for none provider", async () => {
270
+ const registry = createRegistry();
271
+ registry.registerProvider("local", {
272
+ authMode: "none",
273
+ baseUrl: "http://localhost:11434",
274
+ api: "openai-completions",
275
+ models: [createProviderModel("m")],
276
+ });
277
+ const model = registry.getAll().find((m) => m.provider === "local")!;
278
+ assert.equal(await registry.getApiKey(model), undefined);
279
+ });
280
+
281
+ it("delegates to authStorage for apiKey provider", async () => {
282
+ const registry = createRegistry();
283
+ // authStorage.getApiKey returns undefined (no key configured)
284
+ // For apiKey providers this is an expected "no key" response, not early exit
285
+ const key = await registry.getApiKeyForProvider("anthropic");
286
+ assert.equal(key, undefined);
287
+ });
288
+ });
@@ -128,6 +128,8 @@ ajv.addSchema(ModelsConfigSchema, "ModelsConfig");
128
128
 
129
129
  type ModelsConfig = Static<typeof ModelsConfigSchema>;
130
130
 
131
+ export type ProviderAuthMode = "apiKey" | "oauth" | "externalCli" | "none";
132
+
131
133
  /** Provider override config (baseUrl, headers, apiKey) without custom models */
132
134
  interface ProviderOverride {
133
135
  baseUrl?: string;
@@ -513,7 +515,31 @@ export class ModelRegistry {
513
515
  * This is a fast check that doesn't refresh OAuth tokens.
514
516
  */
515
517
  getAvailable(): Model<Api>[] {
516
- return this.models.filter((m) => this.authStorage.hasAuth(m.provider));
518
+ return this.models.filter((m) => this.isProviderRequestReady(m.provider));
519
+ }
520
+
521
+ /**
522
+ * Get auth mode for a provider.
523
+ * Defaults to "apiKey" for built-ins and providers without explicit mode.
524
+ */
525
+ getProviderAuthMode(provider: string): ProviderAuthMode {
526
+ const config = this.registeredProviders.get(provider);
527
+ if (!config) return "apiKey";
528
+ if (config.authMode) return config.authMode;
529
+ if (config.oauth) return "oauth";
530
+ if (config.apiKey) return "apiKey";
531
+ return "apiKey";
532
+ }
533
+
534
+ /**
535
+ * Whether a provider can be used for requests/fallback without hard auth gating.
536
+ */
537
+ isProviderRequestReady(provider: string): boolean {
538
+ const config = this.registeredProviders.get(provider);
539
+ if (config?.isReady) return config.isReady();
540
+ const authMode = this.getProviderAuthMode(provider);
541
+ if (authMode === "externalCli" || authMode === "none") return true;
542
+ return this.authStorage.hasAuth(provider);
517
543
  }
518
544
 
519
545
  /**
@@ -525,17 +551,23 @@ export class ModelRegistry {
525
551
 
526
552
  /**
527
553
  * Get API key for a model.
554
+ * Returns undefined for externalCli/none providers (no key needed).
528
555
  * @param sessionId - Optional session ID for sticky credential selection
529
556
  */
530
557
  async getApiKey(model: Model<Api>, sessionId?: string): Promise<string | undefined> {
558
+ const authMode = this.getProviderAuthMode(model.provider);
559
+ if (authMode === "externalCli" || authMode === "none") return undefined;
531
560
  return this.authStorage.getApiKey(model.provider, sessionId);
532
561
  }
533
562
 
534
563
  /**
535
564
  * Get API key for a provider.
565
+ * Returns undefined for externalCli/none providers (no key needed).
536
566
  * @param sessionId - Optional session ID for sticky credential selection
537
567
  */
538
568
  async getApiKeyForProvider(provider: string, sessionId?: string): Promise<string | undefined> {
569
+ const authMode = this.getProviderAuthMode(provider);
570
+ if (authMode === "externalCli" || authMode === "none") return undefined;
539
571
  return this.authStorage.getApiKey(provider, sessionId);
540
572
  }
541
573
 
@@ -614,7 +646,8 @@ export class ModelRegistry {
614
646
  if (!config.baseUrl) {
615
647
  throw new Error(`Provider ${providerName}: "baseUrl" is required when defining models.`);
616
648
  }
617
- if (!config.apiKey && !config.oauth) {
649
+ const authMode = config.authMode ?? (config.oauth ? "oauth" : config.apiKey ? "apiKey" : "apiKey");
650
+ if (authMode === "apiKey" && !config.apiKey && !config.oauth) {
618
651
  throw new Error(`Provider ${providerName}: "apiKey" or "oauth" is required when defining models.`);
619
652
  }
620
653
 
@@ -702,7 +735,7 @@ export class ModelRegistry {
702
735
 
703
736
  try {
704
737
  const apiKey = await this.authStorage.getApiKey(providerName);
705
- if (!apiKey && providerName !== "ollama") continue;
738
+ if (!apiKey && !this.isProviderRequestReady(providerName)) continue;
706
739
 
707
740
  const models = await adapter.fetchModels(apiKey ?? "", undefined);
708
741
  this.discoveryCache.set(providerName, models);
@@ -780,6 +813,9 @@ export class ModelRegistry {
780
813
  * Input type for registerProvider API.
781
814
  */
782
815
  export interface ProviderConfigInput {
816
+ authMode?: ProviderAuthMode;
817
+ /** Optional readiness check. Called by isProviderRequestReady() before default auth checks. */
818
+ isReady?: () => boolean;
783
819
  baseUrl?: string;
784
820
  apiKey?: string;
785
821
  api?: Api;