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.
- package/dist/cli.js +13 -1
- package/dist/help-text.js +24 -0
- package/dist/resources/extensions/bg-shell/overlay.js +3 -0
- package/dist/resources/extensions/github-sync/sync.js +2 -1
- package/dist/resources/extensions/gsd/auto/loop.js +0 -2
- package/dist/resources/extensions/gsd/auto/phases.js +7 -12
- package/dist/resources/extensions/gsd/auto-dashboard.js +19 -18
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +34 -19
- package/dist/resources/extensions/gsd/auto-dispatch.js +36 -21
- package/dist/resources/extensions/gsd/auto-post-unit.js +128 -14
- package/dist/resources/extensions/gsd/auto-prompts.js +202 -92
- package/dist/resources/extensions/gsd/auto-recovery.js +83 -135
- package/dist/resources/extensions/gsd/auto-supervisor.js +14 -0
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +4 -7
- package/dist/resources/extensions/gsd/auto-verification.js +5 -10
- package/dist/resources/extensions/gsd/auto-worktree.js +123 -30
- package/dist/resources/extensions/gsd/auto.js +1 -4
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +611 -0
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +28 -3
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +7 -0
- package/dist/resources/extensions/gsd/commands/catalog.js +3 -1
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +15 -1
- package/dist/resources/extensions/gsd/commands-handlers.js +1 -1
- package/dist/resources/extensions/gsd/commands-maintenance.js +78 -3
- package/dist/resources/extensions/gsd/dashboard-overlay.js +32 -31
- package/dist/resources/extensions/gsd/db-writer.js +95 -4
- package/dist/resources/extensions/gsd/dispatch-guard.js +35 -30
- package/dist/resources/extensions/gsd/doctor-checks.js +28 -11
- package/dist/resources/extensions/gsd/doctor-environment.js +28 -0
- package/dist/resources/extensions/gsd/doctor-types.js +0 -15
- package/dist/resources/extensions/gsd/doctor.js +46 -282
- package/dist/resources/extensions/gsd/file-watcher.js +5 -1
- package/dist/resources/extensions/gsd/files.js +14 -198
- package/dist/resources/extensions/gsd/git-service.js +4 -0
- package/dist/resources/extensions/gsd/gitignore.js +4 -0
- package/dist/resources/extensions/gsd/gsd-db.js +819 -197
- package/dist/resources/extensions/gsd/guided-flow.js +18 -8
- package/dist/resources/extensions/gsd/markdown-renderer.js +862 -0
- package/dist/resources/extensions/gsd/md-importer.js +182 -4
- package/dist/resources/extensions/gsd/native-git-bridge.js +10 -1
- package/dist/resources/extensions/gsd/parallel-eligibility.js +14 -19
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +38 -0
- package/dist/resources/extensions/gsd/parsers-legacy.js +239 -0
- package/dist/resources/extensions/gsd/preferences-types.js +1 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +9 -0
- package/dist/resources/extensions/gsd/preferences.js +1 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +22 -9
- package/dist/resources/extensions/gsd/prompts/discuss.md +2 -2
- package/dist/resources/extensions/gsd/prompts/execute-task.md +15 -5
- package/dist/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/guided-execute-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/guided-plan-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +6 -10
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -7
- package/dist/resources/extensions/gsd/prompts/reactive-execute.md +3 -3
- package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +6 -7
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +6 -6
- package/dist/resources/extensions/gsd/reactive-graph.js +33 -3
- package/dist/resources/extensions/gsd/skill-health.js +3 -1
- package/dist/resources/extensions/gsd/state.js +484 -30
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +128 -0
- package/dist/resources/extensions/gsd/tools/complete-slice.js +244 -0
- package/dist/resources/extensions/gsd/tools/complete-task.js +204 -0
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +205 -0
- package/dist/resources/extensions/gsd/tools/plan-slice.js +155 -0
- package/dist/resources/extensions/gsd/tools/plan-task.js +94 -0
- package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +152 -0
- package/dist/resources/extensions/gsd/tools/replan-slice.js +146 -0
- package/dist/resources/extensions/gsd/triage-resolution.js +17 -1
- package/dist/resources/extensions/gsd/undo.js +197 -3
- package/dist/resources/extensions/gsd/visualizer-data.js +53 -16
- package/dist/resources/extensions/gsd/workspace-index.js +63 -39
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +17 -16
- package/dist/web/standalone/.next/build-manifest.json +4 -4
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
- package/dist/web/standalone/.next/required-server-files.json +4 -4
- package/dist/web/standalone/.next/routes-manifest.json +6 -0
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -4
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +5 -5
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -0
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js.nft.json +1 -0
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -0
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +5 -5
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +17 -16
- package/dist/web/standalone/.next/server/chunks/229.js +3 -3
- package/dist/web/standalone/.next/server/chunks/471.js +3 -3
- package/dist/web/standalone/.next/server/functions-config-manifest.json +1 -0
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +2 -2
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/{4024.c195dc1fdd2adbea.js → 4024.0de81b543b28b9fe.js} +2 -2
- package/dist/web/standalone/.next/static/chunks/app/_global-error/{page-d07a2c023f1aef1e.js → page-d83ba70a25a85472.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/_not-found/page-f2a7482d42a5614b.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/boot/{route-d07a2c023f1aef1e.js → route-d83ba70a25a85472.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/input/{route-d07a2c023f1aef1e.js → route-d83ba70a25a85472.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/resize/{route-d07a2c023f1aef1e.js → route-d83ba70a25a85472.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/stream/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/browse-directories/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/captures/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/cleanup/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/dev-mode/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/doctor/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/export-data/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/files/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/forensics/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/git/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/history/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/hooks/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/inspect/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/knowledge/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/live-state/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/onboarding/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/preferences/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/projects/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/recovery/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/remote-questions/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/session/browser/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/session/command/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/session/events/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/session/manage/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/settings-data/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/shutdown/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/skill-health/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/steer/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/switch-root/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/input/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/resize/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/sessions/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/stream/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/upload/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/undo/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/update/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/api/visualizer/route-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/layout-a16c7a7ecdf0c2cf.js +1 -0
- package/dist/web/standalone/.next/static/chunks/app/page-b9367c5ae13b99c6.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{main-app-2f2ee7b85712c2bd.js → main-app-fdab67f7802d7832.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d83ba70a25a85472.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-fa307370fcf9fb2c.js → webpack-9014b5adb127a98a.js} +1 -1
- package/dist/web/standalone/.next/static/css/8a727f372cf53002.css +1 -0
- package/dist/web/standalone/.next/static/fOnWQBjWXMKUs4bqTg530/_buildManifest.js +1 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/package.json +4 -4
- package/packages/pi-ai/dist/models.custom.d.ts +173 -0
- package/packages/pi-ai/dist/models.custom.d.ts.map +1 -0
- package/packages/pi-ai/dist/models.custom.js +170 -0
- package/packages/pi-ai/dist/models.custom.js.map +1 -0
- package/packages/pi-ai/dist/models.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.js +16 -1
- package/packages/pi-ai/dist/models.js.map +1 -1
- package/packages/pi-ai/dist/models.test.d.ts +2 -0
- package/packages/pi-ai/dist/models.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/models.test.js +67 -0
- package/packages/pi-ai/dist/models.test.js.map +1 -0
- package/packages/pi-ai/src/models.custom.ts +172 -0
- package/packages/pi-ai/src/models.test.ts +85 -0
- package/packages/pi-ai/src/models.ts +17 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +10 -3
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +21 -34
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts +2 -2
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +2 -2
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +4 -4
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +6 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +80 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.test.js +63 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +37 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/fallback-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/fallback-resolver.js +2 -3
- package/packages/pi-coding-agent/dist/core/fallback-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/fallback-resolver.test.js +12 -2
- package/packages/pi-coding-agent/dist/core/fallback-resolver.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lifecycle-hooks.d.ts +38 -0
- package/packages/pi-coding-agent/dist/core/lifecycle-hooks.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lifecycle-hooks.js +192 -0
- package/packages/pi-coding-agent/dist/core/lifecycle-hooks.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/client.js +69 -21
- package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +255 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +40 -3
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/package-commands.d.ts +25 -0
- package/packages/pi-coding-agent/dist/core/package-commands.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/package-commands.js +253 -0
- package/packages/pi-coding-agent/dist/core/package-commands.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/package-commands.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/package-commands.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/package-commands.test.js +225 -0
- package/packages/pi-coding-agent/dist/core/package-commands.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +4 -0
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +3 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -0
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/main.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/main.js +11 -199
- package/packages/pi-coding-agent/dist/main.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts +6 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +21 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +8 -15
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/print-mode.js +45 -34
- package/packages/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js +7 -2
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +2 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +26 -37
- package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +2 -2
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +3 -3
- package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +4 -4
- package/packages/pi-coding-agent/src/core/extensions/index.ts +5 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.test.ts +96 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +89 -0
- package/packages/pi-coding-agent/src/core/extensions/types.ts +44 -0
- package/packages/pi-coding-agent/src/core/fallback-resolver.test.ts +15 -2
- package/packages/pi-coding-agent/src/core/fallback-resolver.ts +2 -3
- package/packages/pi-coding-agent/src/core/lifecycle-hooks.ts +274 -0
- package/packages/pi-coding-agent/src/core/lsp/client.ts +83 -21
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +288 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +39 -3
- package/packages/pi-coding-agent/src/core/package-commands.test.ts +240 -0
- package/packages/pi-coding-agent/src/core/package-commands.ts +310 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +4 -0
- package/packages/pi-coding-agent/src/index.ts +7 -0
- package/packages/pi-coding-agent/src/main.ts +11 -232
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +20 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +9 -16
- package/packages/pi-coding-agent/src/modes/print-mode.ts +42 -32
- package/packages/pi-coding-agent/src/modes/rpc/rpc-client.ts +8 -2
- package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +2 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +8 -15
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/bg-shell/overlay.ts +4 -0
- package/src/resources/extensions/github-sync/sync.ts +2 -1
- package/src/resources/extensions/gsd/auto/loop-deps.ts +0 -8
- package/src/resources/extensions/gsd/auto/loop.ts +0 -2
- package/src/resources/extensions/gsd/auto/phases.ts +7 -20
- package/src/resources/extensions/gsd/auto/types.ts +0 -1
- package/src/resources/extensions/gsd/auto-dashboard.ts +20 -16
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +34 -19
- package/src/resources/extensions/gsd/auto-dispatch.ts +38 -21
- package/src/resources/extensions/gsd/auto-post-unit.ts +150 -15
- package/src/resources/extensions/gsd/auto-prompts.ts +186 -103
- package/src/resources/extensions/gsd/auto-recovery.ts +77 -142
- package/src/resources/extensions/gsd/auto-supervisor.ts +14 -0
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +6 -7
- package/src/resources/extensions/gsd/auto-verification.ts +4 -9
- package/src/resources/extensions/gsd/auto-worktree.ts +126 -30
- package/src/resources/extensions/gsd/auto.ts +0 -9
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +675 -4
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +31 -3
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +7 -0
- package/src/resources/extensions/gsd/commands/catalog.ts +3 -1
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +15 -1
- package/src/resources/extensions/gsd/commands-handlers.ts +1 -1
- package/src/resources/extensions/gsd/commands-maintenance.ts +86 -3
- package/src/resources/extensions/gsd/dashboard-overlay.ts +17 -13
- package/src/resources/extensions/gsd/db-writer.ts +105 -4
- package/src/resources/extensions/gsd/dispatch-guard.ts +32 -30
- package/src/resources/extensions/gsd/doctor-checks.ts +25 -11
- package/src/resources/extensions/gsd/doctor-environment.ts +31 -0
- package/src/resources/extensions/gsd/doctor-types.ts +0 -23
- package/src/resources/extensions/gsd/doctor.ts +45 -295
- package/src/resources/extensions/gsd/file-watcher.ts +4 -1
- package/src/resources/extensions/gsd/files.ts +16 -220
- package/src/resources/extensions/gsd/git-service.ts +4 -0
- package/src/resources/extensions/gsd/gitignore.ts +4 -0
- package/src/resources/extensions/gsd/gsd-db.ts +1157 -370
- package/src/resources/extensions/gsd/guided-flow.ts +20 -8
- package/src/resources/extensions/gsd/markdown-renderer.ts +1098 -0
- package/src/resources/extensions/gsd/md-importer.ts +211 -2
- package/src/resources/extensions/gsd/native-git-bridge.ts +12 -1
- package/src/resources/extensions/gsd/parallel-eligibility.ts +14 -18
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +43 -0
- package/src/resources/extensions/gsd/parsers-legacy.ts +271 -0
- package/src/resources/extensions/gsd/preferences-types.ts +3 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +9 -0
- package/src/resources/extensions/gsd/preferences.ts +1 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +22 -9
- package/src/resources/extensions/gsd/prompts/discuss.md +2 -2
- package/src/resources/extensions/gsd/prompts/execute-task.md +15 -5
- package/src/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/guided-execute-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +6 -10
- package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -7
- package/src/resources/extensions/gsd/prompts/reactive-execute.md +3 -3
- package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +6 -7
- package/src/resources/extensions/gsd/prompts/replan-slice.md +6 -6
- package/src/resources/extensions/gsd/reactive-graph.ts +33 -3
- package/src/resources/extensions/gsd/skill-health.ts +2 -1
- package/src/resources/extensions/gsd/state.ts +547 -29
- package/src/resources/extensions/gsd/tests/atomic-task-closeout.test.ts +8 -120
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +20 -11
- package/src/resources/extensions/gsd/tests/auto-preflight.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +150 -5
- package/src/resources/extensions/gsd/tests/auto-stash-merge.test.ts +121 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +15 -20
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +410 -0
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +439 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +0 -2
- package/src/resources/extensions/gsd/tests/derive-state-crossval.test.ts +527 -0
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +593 -2
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +104 -57
- package/src/resources/extensions/gsd/tests/doctor-completion-deferral.test.ts +22 -80
- package/src/resources/extensions/gsd/tests/doctor-enhancements.test.ts +5 -7
- package/src/resources/extensions/gsd/tests/doctor-environment-worktree.test.ts +175 -0
- package/src/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +38 -130
- package/src/resources/extensions/gsd/tests/doctor-roadmap-summary-atomicity.test.ts +38 -76
- package/src/resources/extensions/gsd/tests/doctor.test.ts +9 -19
- package/src/resources/extensions/gsd/tests/flag-file-db.test.ts +290 -0
- package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +240 -0
- package/src/resources/extensions/gsd/tests/git-service.test.ts +6 -2
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/gsd-recover.test.ts +462 -0
- package/src/resources/extensions/gsd/tests/idle-recovery.test.ts +4 -172
- package/src/resources/extensions/gsd/tests/integration-proof.test.ts +643 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +0 -3
- package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +1205 -0
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/migrate-hierarchy.test.ts +439 -0
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/migrate-writer.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/parsers.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +176 -113
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +145 -0
- package/src/resources/extensions/gsd/tests/planning-crossval.test.ts +305 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +139 -0
- package/src/resources/extensions/gsd/tests/reassess-handler.test.ts +325 -0
- package/src/resources/extensions/gsd/tests/replan-handler.test.ts +410 -0
- package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/rogue-file-detection.test.ts +296 -0
- package/src/resources/extensions/gsd/tests/schema-v9-sequence.test.ts +176 -0
- package/src/resources/extensions/gsd/tests/shared-wal.test.ts +216 -0
- package/src/resources/extensions/gsd/tests/token-cost-display.test.ts +118 -0
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +11 -3
- package/src/resources/extensions/gsd/tests/undo.test.ts +321 -1
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/verification-evidence.test.ts +0 -142
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +12 -5
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +176 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +300 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +245 -0
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +249 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +194 -0
- package/src/resources/extensions/gsd/tools/plan-task.ts +116 -0
- package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +203 -0
- package/src/resources/extensions/gsd/tools/replan-slice.ts +192 -0
- package/src/resources/extensions/gsd/triage-resolution.ts +20 -1
- package/src/resources/extensions/gsd/types.ts +50 -0
- package/src/resources/extensions/gsd/undo.ts +247 -3
- package/src/resources/extensions/gsd/visualizer-data.ts +54 -17
- package/src/resources/extensions/gsd/workspace-index.ts +64 -46
- package/dist/resources/extensions/gsd/auto-observability.js +0 -56
- package/dist/resources/extensions/gsd/observability-validator.js +0 -422
- package/dist/resources/extensions/gsd/roadmap-mutations.js +0 -110
- package/dist/web/standalone/.next/static/VvclDCW6TAWjEyLU-EYL1/_buildManifest.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/_not-found/page-e07acdb7dd069836.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/bridge-terminal/stream/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/browse-directories/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/captures/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/cleanup/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/dev-mode/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/doctor/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/export-data/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/files/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/forensics/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/git/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/history/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/hooks/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/inspect/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/knowledge/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/live-state/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/onboarding/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/preferences/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/projects/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/recovery/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/remote-questions/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/session/browser/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/session/command/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/session/events/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/session/manage/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/settings-data/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/shutdown/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/skill-health/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/steer/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/input/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/resize/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/sessions/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/stream/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/terminal/upload/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/undo/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/update/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/api/visualizer/route-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/layout-745c6ed5fea5fb06.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/page-801b53eff6e83579.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-e6255954dccfcf0a.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d07a2c023f1aef1e.js +0 -1
- package/dist/web/standalone/.next/static/css/123c0bb039697968.css +0 -1
- package/src/resources/extensions/gsd/auto-observability.ts +0 -74
- package/src/resources/extensions/gsd/observability-validator.ts +0 -456
- package/src/resources/extensions/gsd/roadmap-mutations.ts +0 -134
- package/src/resources/extensions/gsd/tests/doctor-task-done-missing-summary-slice-loop.test.ts +0 -174
- package/src/resources/extensions/gsd/tests/plan-quality-validator.test.ts +0 -474
- /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
|
-
|
|
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
|
-
|
|
326
|
+
handlers.stdoutEnd = () => {
|
|
313
327
|
client.isReading = false;
|
|
314
328
|
resolve();
|
|
315
|
-
}
|
|
329
|
+
};
|
|
330
|
+
stdout.on("end", handlers.stdoutEnd);
|
|
316
331
|
|
|
317
|
-
|
|
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
|
-
|
|
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
|
-
|
|
434
|
+
handlers.stderrEnd = () => {
|
|
414
435
|
resolve();
|
|
415
|
-
}
|
|
436
|
+
};
|
|
437
|
+
stderr.on("end", handlers.stderrEnd);
|
|
416
438
|
|
|
417
|
-
|
|
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",
|
|
898
|
-
process.on("SIGINT",
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
|
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;
|