gsd-pi 2.71.0 → 2.72.0-dev.3118184
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/README.md +69 -19
- package/dist/cli.js +88 -6
- package/dist/headless-events.d.ts +2 -0
- package/dist/headless-events.js +7 -0
- package/dist/headless.js +16 -3
- package/dist/mcp-server.js +40 -17
- package/dist/onboarding.js +10 -0
- package/dist/provider-migrations.d.ts +10 -0
- package/dist/provider-migrations.js +12 -0
- package/dist/resource-loader.js +139 -13
- package/dist/resources/GSD-WORKFLOW.md +1 -1
- package/dist/resources/agents/debugger.md +58 -0
- package/dist/resources/agents/doc-writer.md +43 -0
- package/dist/resources/agents/git-ops.md +56 -0
- package/dist/resources/agents/javascript-pro.md +46 -271
- package/dist/resources/agents/planner.md +55 -0
- package/dist/resources/agents/refactorer.md +47 -0
- package/dist/resources/agents/reviewer.md +48 -0
- package/dist/resources/agents/security.md +59 -0
- package/dist/resources/agents/tester.md +50 -0
- package/dist/resources/agents/typescript-pro.md +41 -235
- package/dist/resources/extensions/async-jobs/await-tool.js +7 -4
- package/dist/resources/extensions/async-jobs/job-manager.js +28 -3
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +40 -12
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +142 -14
- package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
- package/dist/resources/extensions/gsd/auto/loop.js +116 -2
- package/dist/resources/extensions/gsd/auto/phases.js +5 -1
- package/dist/resources/extensions/gsd/auto/session.js +11 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +22 -16
- package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
- package/dist/resources/extensions/gsd/auto-post-unit.js +6 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +88 -33
- package/dist/resources/extensions/gsd/auto-recovery.js +11 -0
- package/dist/resources/extensions/gsd/auto-start.js +34 -7
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
- package/dist/resources/extensions/gsd/auto-worktree.js +1 -1
- package/dist/resources/extensions/gsd/auto.js +81 -19
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +11 -11
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +63 -51
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -0
- package/dist/resources/extensions/gsd/commands/context.js +15 -6
- package/dist/resources/extensions/gsd/commands/dispatcher.js +12 -2
- package/dist/resources/extensions/gsd/commands/handlers/auto.js +10 -33
- package/dist/resources/extensions/gsd/commands/handlers/core.js +56 -11
- package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +15 -6
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +4 -10
- package/dist/resources/extensions/gsd/commands-handlers.js +4 -1
- package/dist/resources/extensions/gsd/context-injector.js +1 -1
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +3 -7
- package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
- package/dist/resources/extensions/gsd/definition-io.js +15 -0
- package/dist/resources/extensions/gsd/dispatch-guard.js +22 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +23 -0
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +6 -3
- package/dist/resources/extensions/gsd/error-classifier.js +5 -2
- package/dist/resources/extensions/gsd/forensics.js +19 -6
- package/dist/resources/extensions/gsd/gate-registry.js +208 -0
- package/dist/resources/extensions/gsd/git-service.js +11 -8
- package/dist/resources/extensions/gsd/gitignore.js +12 -6
- package/dist/resources/extensions/gsd/gsd-db.js +90 -6
- package/dist/resources/extensions/gsd/guided-flow.js +5 -10
- package/dist/resources/extensions/gsd/key-manager.js +2 -0
- package/dist/resources/extensions/gsd/metrics.js +1 -0
- package/dist/resources/extensions/gsd/milestone-actions.js +10 -4
- package/dist/resources/extensions/gsd/milestone-validation-gates.js +11 -12
- package/dist/resources/extensions/gsd/notification-overlay.js +42 -13
- package/dist/resources/extensions/gsd/notification-store.js +56 -5
- package/dist/resources/extensions/gsd/notification-widget.js +5 -13
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +8 -3
- package/dist/resources/extensions/gsd/pre-execution-checks.js +35 -2
- package/dist/resources/extensions/gsd/preferences-skills.js +2 -34
- package/dist/resources/extensions/gsd/preferences-types.js +15 -0
- package/dist/resources/extensions/gsd/preferences.js +16 -3
- package/dist/resources/extensions/gsd/prompt-loader.js +4 -1
- package/dist/resources/extensions/gsd/prompt-validation.js +126 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/dist/resources/extensions/gsd/prompts/discuss.md +123 -12
- package/dist/resources/extensions/gsd/prompts/execute-task.md +22 -19
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/queue.md +3 -2
- package/dist/resources/extensions/gsd/prompts/system.md +1 -0
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
- package/dist/resources/extensions/gsd/session-model-override.js +25 -0
- package/dist/resources/extensions/gsd/shortcut-defs.js +40 -0
- package/dist/resources/extensions/gsd/state.js +29 -2
- package/dist/resources/extensions/gsd/tools/complete-slice.js +52 -1
- package/dist/resources/extensions/gsd/tools/complete-task.js +51 -1
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +4 -1
- package/dist/resources/extensions/gsd/workflow-projections.js +7 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +30 -3
- package/dist/resources/extensions/gsd/write-intercept.js +10 -1
- package/dist/resources/extensions/ollama/index.js +17 -10
- package/dist/resources/extensions/ollama/ollama-client.js +35 -6
- package/dist/resources/extensions/ollama/ollama-discovery.js +32 -6
- package/dist/resources/extensions/shared/gsd-phase-state.js +35 -0
- package/dist/resources/extensions/subagent/agents.js +8 -0
- package/dist/resources/extensions/subagent/index.js +17 -0
- package/dist/resources/skills/create-skill/SKILL.md +2 -0
- package/dist/startup-model-validation.d.ts +0 -1
- package/dist/startup-model-validation.js +6 -2
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +15 -15
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/required-server-files.json +3 -3
- 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 +1 -1
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- 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 +1 -1
- 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/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/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/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/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 +2 -2
- 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 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- 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 +3 -3
- 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 +4 -4
- 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 +4 -4
- 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 +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- 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 +15 -15
- package/dist/web/standalone/.next/server/chunks/2331.js +16 -16
- package/dist/web/standalone/.next/server/chunks/4741.js +12 -12
- package/dist/web/standalone/.next/server/chunks/5822.js +2 -2
- package/dist/web/standalone/.next/server/chunks/63.js +8 -8
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- package/dist/web/standalone/.next/server/edge-runtime-webpack.js +2 -0
- package/dist/web/standalone/.next/server/functions-config-manifest.json +0 -9
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +29 -2
- package/dist/web/standalone/.next/server/middleware.js +4 -12
- 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 +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/server/webpack-runtime.js +1 -1
- package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.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/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 +1 -1
- package/packages/mcp-server/dist/server.d.ts +12 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +90 -42
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -12
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/server.ts +110 -38
- package/packages/mcp-server/src/workflow-tools.test.ts +110 -0
- package/packages/mcp-server/src/workflow-tools.ts +32 -12
- package/packages/pi-ai/dist/env-api-keys.js +1 -0
- package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
- package/packages/pi-ai/dist/models.custom.d.ts +105 -0
- package/packages/pi-ai/dist/models.custom.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.custom.js +97 -0
- package/packages/pi-ai/dist/models.custom.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +648 -140
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +867 -370
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.d.ts +2 -0
- package/packages/pi-ai/dist/models.generated.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/models.generated.test.js +334 -0
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -0
- package/packages/pi-ai/dist/models.test.js +105 -0
- package/packages/pi-ai/dist/models.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +11 -2
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +20 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +4 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +8 -3
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +44 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +7 -4
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +11 -0
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +1 -1
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +5 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +57 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -0
- package/packages/pi-ai/src/env-api-keys.ts +1 -0
- package/packages/pi-ai/src/models.custom.ts +98 -0
- package/packages/pi-ai/src/models.generated.test.ts +373 -0
- package/packages/pi-ai/src/models.generated.ts +867 -370
- package/packages/pi-ai/src/models.test.ts +135 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +13 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +32 -0
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +55 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +14 -3
- package/packages/pi-ai/src/providers/anthropic.ts +8 -4
- package/packages/pi-ai/src/providers/openai-completions.ts +14 -0
- package/packages/pi-ai/src/types.ts +1 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +71 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.ts +4 -1
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js +61 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +2 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +10 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +27 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js +85 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js +64 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +23 -18
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js +75 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +55 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js +57 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +47 -5
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js +71 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js +13 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +36 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +24 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +9 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +130 -12
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +7 -2
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +6 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -3
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +4 -2
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-renderable-tools.test.ts +70 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +108 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -0
- package/packages/pi-coding-agent/src/core/model-resolver-initial-model-auth.test.ts +78 -0
- package/packages/pi-coding-agent/src/core/model-resolver.test.ts +85 -0
- package/packages/pi-coding-agent/src/core/model-resolver.ts +23 -18
- package/packages/pi-coding-agent/src/core/retry-handler.test.ts +83 -0
- package/packages/pi-coding-agent/src/core/retry-handler.ts +60 -1
- package/packages/pi-coding-agent/src/core/sdk.test.ts +89 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +55 -9
- package/packages/pi-coding-agent/src/index.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +72 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +30 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +15 -6
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +131 -12
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +7 -2
- package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4 -3
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
- package/packages/pi-tui/dist/components/__tests__/editor.test.js +12 -0
- package/packages/pi-tui/dist/components/__tests__/editor.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/input.test.js +12 -0
- package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -1
- package/packages/pi-tui/dist/keys.d.ts.map +1 -1
- package/packages/pi-tui/dist/keys.js +27 -0
- package/packages/pi-tui/dist/keys.js.map +1 -1
- package/packages/pi-tui/src/components/__tests__/editor.test.ts +18 -0
- package/packages/pi-tui/src/components/__tests__/input.test.ts +18 -0
- package/packages/pi-tui/src/keys.ts +32 -0
- package/pkg/package.json +1 -1
- package/src/resources/GSD-WORKFLOW.md +1 -1
- package/src/resources/agents/debugger.md +58 -0
- package/src/resources/agents/doc-writer.md +43 -0
- package/src/resources/agents/git-ops.md +56 -0
- package/src/resources/agents/javascript-pro.md +46 -271
- package/src/resources/agents/planner.md +55 -0
- package/src/resources/agents/refactorer.md +47 -0
- package/src/resources/agents/reviewer.md +48 -0
- package/src/resources/agents/security.md +59 -0
- package/src/resources/agents/tester.md +50 -0
- package/src/resources/agents/typescript-pro.md +41 -235
- package/src/resources/extensions/async-jobs/await-tool.test.ts +40 -7
- package/src/resources/extensions/async-jobs/await-tool.ts +7 -4
- package/src/resources/extensions/async-jobs/job-manager.ts +33 -3
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +45 -12
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +152 -13
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +91 -2
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +301 -6
- package/src/resources/extensions/gsd/auto/infra-errors.ts +38 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -0
- package/src/resources/extensions/gsd/auto/loop.ts +134 -2
- package/src/resources/extensions/gsd/auto/phases.ts +6 -0
- package/src/resources/extensions/gsd/auto/session.ts +11 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +29 -18
- package/src/resources/extensions/gsd/auto-model-selection.ts +9 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +7 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +111 -33
- package/src/resources/extensions/gsd/auto-recovery.ts +10 -0
- package/src/resources/extensions/gsd/auto-start.ts +41 -7
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
- package/src/resources/extensions/gsd/auto-worktree.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +97 -20
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +10 -10
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +79 -60
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +7 -0
- package/src/resources/extensions/gsd/commands/context.ts +16 -5
- package/src/resources/extensions/gsd/commands/dispatcher.ts +14 -2
- package/src/resources/extensions/gsd/commands/handlers/auto.ts +10 -36
- package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -11
- package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +17 -7
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +4 -10
- package/src/resources/extensions/gsd/commands-handlers.ts +5 -1
- package/src/resources/extensions/gsd/context-injector.ts +1 -1
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +4 -8
- package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
- package/src/resources/extensions/gsd/definition-io.ts +18 -0
- package/src/resources/extensions/gsd/dispatch-guard.ts +23 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +24 -0
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +6 -3
- package/src/resources/extensions/gsd/error-classifier.ts +5 -2
- package/src/resources/extensions/gsd/forensics.ts +23 -7
- package/src/resources/extensions/gsd/gate-registry.ts +251 -0
- package/src/resources/extensions/gsd/git-service.ts +11 -8
- package/src/resources/extensions/gsd/gitignore.ts +12 -6
- package/src/resources/extensions/gsd/gsd-db.ts +105 -6
- package/src/resources/extensions/gsd/guided-flow.ts +5 -10
- package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
- package/src/resources/extensions/gsd/key-manager.ts +2 -0
- package/src/resources/extensions/gsd/metrics.ts +12 -1
- package/src/resources/extensions/gsd/milestone-actions.ts +10 -3
- package/src/resources/extensions/gsd/milestone-validation-gates.ts +11 -13
- package/src/resources/extensions/gsd/notification-overlay.ts +47 -14
- package/src/resources/extensions/gsd/notification-store.ts +54 -5
- package/src/resources/extensions/gsd/notification-widget.ts +5 -14
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -3
- package/src/resources/extensions/gsd/pre-execution-checks.ts +39 -2
- package/src/resources/extensions/gsd/preferences-skills.ts +2 -36
- package/src/resources/extensions/gsd/preferences-types.ts +16 -0
- package/src/resources/extensions/gsd/preferences.ts +19 -6
- package/src/resources/extensions/gsd/prompt-loader.ts +6 -1
- package/src/resources/extensions/gsd/prompt-validation.ts +157 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/src/resources/extensions/gsd/prompts/discuss.md +123 -12
- package/src/resources/extensions/gsd/prompts/execute-task.md +22 -19
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/queue.md +3 -2
- package/src/resources/extensions/gsd/prompts/system.md +1 -0
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
- package/src/resources/extensions/gsd/session-model-override.ts +36 -0
- package/src/resources/extensions/gsd/shortcut-defs.ts +56 -0
- package/src/resources/extensions/gsd/state.ts +33 -2
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +25 -9
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +28 -0
- package/src/resources/extensions/gsd/tests/block-db-writes.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/complete-slice-gate-closure.test.ts +167 -0
- package/src/resources/extensions/gsd/tests/complete-slice-prompt-task-summary-layout.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/definition-io.test.ts +57 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/doctor-heal-fixable-warnings.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +104 -0
- package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/gate-registry.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +107 -5
- package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +73 -0
- package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +66 -1
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +8 -6
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/model-isolation.test.ts +36 -51
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/plan-milestone-artifact-verification.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/preferences-formatting.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/projection-regression.test.ts +96 -1
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/prompt-loader-working-directory.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/prompt-system-gate-coverage.test.ts +208 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +97 -0
- package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +63 -5
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +41 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +18 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +63 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +63 -0
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +4 -1
- package/src/resources/extensions/gsd/types.ts +26 -0
- package/src/resources/extensions/gsd/workflow-projections.ts +8 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +29 -3
- package/src/resources/extensions/gsd/write-intercept.ts +10 -1
- package/src/resources/extensions/ollama/index.ts +17 -8
- package/src/resources/extensions/ollama/ollama-client.ts +35 -6
- package/src/resources/extensions/ollama/ollama-discovery.ts +37 -6
- package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -0
- package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +54 -0
- package/src/resources/extensions/shared/gsd-phase-state.ts +42 -0
- package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +48 -0
- package/src/resources/extensions/subagent/agents.ts +10 -0
- package/src/resources/extensions/subagent/index.ts +18 -0
- package/src/resources/extensions/subagent/tests/agents-conflicts.test.ts +33 -0
- package/src/resources/skills/create-skill/SKILL.md +2 -0
- package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
- /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → NzO79SOz9jHX-VY5-0t2O}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → NzO79SOz9jHX-VY5-0t2O}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
import { githubCopilotOAuthProvider } from "./github-copilot.js";
|
|
4
|
+
function makeModel(provider, id) {
|
|
5
|
+
return {
|
|
6
|
+
id,
|
|
7
|
+
name: id,
|
|
8
|
+
api: "openai-completions",
|
|
9
|
+
provider,
|
|
10
|
+
baseUrl: `${provider}:`,
|
|
11
|
+
reasoning: false,
|
|
12
|
+
input: ["text"],
|
|
13
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
14
|
+
contextWindow: 128000,
|
|
15
|
+
maxTokens: 16384,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function makeCredentials(overrides = {}) {
|
|
19
|
+
return {
|
|
20
|
+
type: "oauth",
|
|
21
|
+
access: "copilot-token",
|
|
22
|
+
refresh: "refresh-token",
|
|
23
|
+
expires: Date.now() + 60_000,
|
|
24
|
+
...overrides,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
test("githubCopilotOAuthProvider.modifyModels filters unavailable copilot models (#3849)", () => {
|
|
28
|
+
const models = [
|
|
29
|
+
makeModel("github-copilot", "gpt-5"),
|
|
30
|
+
makeModel("github-copilot", "claude-sonnet-4"),
|
|
31
|
+
makeModel("openai", "gpt-4.1"),
|
|
32
|
+
];
|
|
33
|
+
assert.ok(githubCopilotOAuthProvider.modifyModels, "github copilot provider should expose modifyModels");
|
|
34
|
+
const modified = githubCopilotOAuthProvider.modifyModels(models, makeCredentials({
|
|
35
|
+
modelLimits: {
|
|
36
|
+
"gpt-5": { contextWindow: 256000, maxTokens: 32000 },
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
assert.deepEqual(modified.map((model) => `${model.provider}/${model.id}`), ["github-copilot/gpt-5", "openai/gpt-4.1"]);
|
|
40
|
+
const copilotModel = modified.find((model) => model.provider === "github-copilot" && model.id === "gpt-5");
|
|
41
|
+
assert.ok(copilotModel, "available copilot model should remain");
|
|
42
|
+
assert.equal(copilotModel.contextWindow, 256000);
|
|
43
|
+
assert.equal(copilotModel.maxTokens, 32000);
|
|
44
|
+
assert.match(copilotModel.baseUrl, /githubcopilot\.com/);
|
|
45
|
+
});
|
|
46
|
+
test("githubCopilotOAuthProvider.modifyModels keeps all copilot models when limits are unavailable", () => {
|
|
47
|
+
const models = [
|
|
48
|
+
makeModel("github-copilot", "gpt-5"),
|
|
49
|
+
makeModel("github-copilot", "claude-sonnet-4"),
|
|
50
|
+
];
|
|
51
|
+
assert.ok(githubCopilotOAuthProvider.modifyModels, "github copilot provider should expose modifyModels");
|
|
52
|
+
const modified = githubCopilotOAuthProvider.modifyModels(models, makeCredentials());
|
|
53
|
+
assert.equal(modified.length, 2, "lack of limits should not hide every copilot model");
|
|
54
|
+
assert.ok(modified.every((model) => model.provider === "github-copilot"));
|
|
55
|
+
assert.ok(modified.every((model) => model.baseUrl.includes("githubcopilot.com")));
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=github-copilot.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-copilot.test.js","sourceRoot":"","sources":["../../../src/utils/oauth/github-copilot.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEjE,SAAS,SAAS,CAAC,QAAgB,EAAE,EAAU;IAC9C,OAAO;QACN,EAAE;QACF,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,oBAAoB;QACzB,QAAQ;QACR,OAAO,EAAE,GAAG,QAAQ,GAAG;QACvB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;QAC1D,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,KAAK;KAChB,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,YAAwH,EAAE;IAClJ,OAAO;QACN,IAAI,EAAE,OAAgB;QACtB,MAAM,EAAE,eAAe;QACvB,OAAO,EAAE,eAAe;QACxB,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM;QAC5B,GAAG,SAAS;KACZ,CAAC;AACH,CAAC;AAED,IAAI,CAAC,oFAAoF,EAAE,GAAG,EAAE;IAC/F,MAAM,MAAM,GAAG;QACd,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC;QACpC,SAAS,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;QAC9C,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC;KAC9B,CAAC;IAEF,MAAM,CAAC,EAAE,CAAC,0BAA0B,CAAC,YAAY,EAAE,oDAAoD,CAAC,CAAC;IACzG,MAAM,QAAQ,GAAG,0BAA0B,CAAC,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC;QAChF,WAAW,EAAE;YACZ,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE;SACpD;KACD,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,SAAS,CACf,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE,EAAE,CAAC,EACxD,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAC1C,CAAC;IAEF,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,gBAAgB,IAAI,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;IAC3G,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,uCAAuC,CAAC,CAAC;IACjE,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACjD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5C,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;AAC1D,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,8FAA8F,EAAE,GAAG,EAAE;IACzG,MAAM,MAAM,GAAG;QACd,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC;QACpC,SAAS,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;KAC9C,CAAC;IAEF,MAAM,CAAC,EAAE,CAAC,0BAA0B,CAAC,YAAY,EAAE,oDAAoD,CAAC,CAAC;IACzG,MAAM,QAAQ,GAAG,0BAA0B,CAAC,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;IAEpF,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,oDAAoD,CAAC,CAAC;IACvF,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,gBAAgB,CAAC,CAAC,CAAC;IAC1E,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC,CAAC,CAAC","sourcesContent":["import assert from \"node:assert/strict\";\nimport test from \"node:test\";\n\nimport type { Api, Model } from \"../../types.js\";\nimport type { OAuthCredentials } from \"./index.js\";\nimport { githubCopilotOAuthProvider } from \"./github-copilot.js\";\n\nfunction makeModel(provider: string, id: string): Model<Api> {\n\treturn {\n\t\tid,\n\t\tname: id,\n\t\tapi: \"openai-completions\",\n\t\tprovider,\n\t\tbaseUrl: `${provider}:`,\n\t\treasoning: false,\n\t\tinput: [\"text\"],\n\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\tcontextWindow: 128000,\n\t\tmaxTokens: 16384,\n\t};\n}\n\nfunction makeCredentials(overrides: Partial<OAuthCredentials & { modelLimits?: Record<string, { contextWindow: number; maxTokens: number }> }> = {}) {\n\treturn {\n\t\ttype: \"oauth\" as const,\n\t\taccess: \"copilot-token\",\n\t\trefresh: \"refresh-token\",\n\t\texpires: Date.now() + 60_000,\n\t\t...overrides,\n\t};\n}\n\ntest(\"githubCopilotOAuthProvider.modifyModels filters unavailable copilot models (#3849)\", () => {\n\tconst models = [\n\t\tmakeModel(\"github-copilot\", \"gpt-5\"),\n\t\tmakeModel(\"github-copilot\", \"claude-sonnet-4\"),\n\t\tmakeModel(\"openai\", \"gpt-4.1\"),\n\t];\n\n\tassert.ok(githubCopilotOAuthProvider.modifyModels, \"github copilot provider should expose modifyModels\");\n\tconst modified = githubCopilotOAuthProvider.modifyModels(models, makeCredentials({\n\t\tmodelLimits: {\n\t\t\t\"gpt-5\": { contextWindow: 256000, maxTokens: 32000 },\n\t\t},\n\t}));\n\n\tassert.deepEqual(\n\t\tmodified.map((model) => `${model.provider}/${model.id}`),\n\t\t[\"github-copilot/gpt-5\", \"openai/gpt-4.1\"],\n\t);\n\n\tconst copilotModel = modified.find((model) => model.provider === \"github-copilot\" && model.id === \"gpt-5\");\n\tassert.ok(copilotModel, \"available copilot model should remain\");\n\tassert.equal(copilotModel.contextWindow, 256000);\n\tassert.equal(copilotModel.maxTokens, 32000);\n\tassert.match(copilotModel.baseUrl, /githubcopilot\\.com/);\n});\n\ntest(\"githubCopilotOAuthProvider.modifyModels keeps all copilot models when limits are unavailable\", () => {\n\tconst models = [\n\t\tmakeModel(\"github-copilot\", \"gpt-5\"),\n\t\tmakeModel(\"github-copilot\", \"claude-sonnet-4\"),\n\t];\n\n\tassert.ok(githubCopilotOAuthProvider.modifyModels, \"github copilot provider should expose modifyModels\");\n\tconst modified = githubCopilotOAuthProvider.modifyModels(models, makeCredentials());\n\n\tassert.equal(modified.length, 2, \"lack of limits should not hide every copilot model\");\n\tassert.ok(modified.every((model) => model.provider === \"github-copilot\"));\n\tassert.ok(modified.every((model) => model.baseUrl.includes(\"githubcopilot.com\")));\n});\n"]}
|
|
@@ -137,6 +137,7 @@ export function getEnvApiKey(provider: any): string | undefined {
|
|
|
137
137
|
"opencode-go": "OPENCODE_API_KEY",
|
|
138
138
|
"kimi-coding": "KIMI_API_KEY",
|
|
139
139
|
"alibaba-coding-plan": "ALIBABA_API_KEY",
|
|
140
|
+
"alibaba-dashscope": "DASHSCOPE_API_KEY",
|
|
140
141
|
ollama: "OLLAMA_API_KEY",
|
|
141
142
|
"ollama-cloud": "OLLAMA_API_KEY",
|
|
142
143
|
"custom-openai": "CUSTOM_OPENAI_API_KEY",
|
|
@@ -170,6 +170,104 @@ export const CUSTOM_MODELS = {
|
|
|
170
170
|
} satisfies Model<"openai-completions">,
|
|
171
171
|
},
|
|
172
172
|
|
|
173
|
+
// ─── Alibaba DashScope ───────────────────────────────────────────────
|
|
174
|
+
// Regular DashScope API for users without the Coding Plan.
|
|
175
|
+
// Uses the international OpenAI-compatible endpoint.
|
|
176
|
+
// Requires DASHSCOPE_API_KEY from: dashscope.console.aliyun.com
|
|
177
|
+
// Pricing: https://www.alibabacloud.com/help/en/model-studio/model-pricing
|
|
178
|
+
"alibaba-dashscope": {
|
|
179
|
+
"qwen3-max": {
|
|
180
|
+
id: "qwen3-max",
|
|
181
|
+
name: "Qwen3 Max",
|
|
182
|
+
api: "openai-completions",
|
|
183
|
+
provider: "alibaba-dashscope",
|
|
184
|
+
baseUrl: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
|
185
|
+
reasoning: true,
|
|
186
|
+
input: ["text"],
|
|
187
|
+
cost: {
|
|
188
|
+
input: 1.2,
|
|
189
|
+
output: 6,
|
|
190
|
+
cacheRead: 0,
|
|
191
|
+
cacheWrite: 0,
|
|
192
|
+
},
|
|
193
|
+
contextWindow: 1000000,
|
|
194
|
+
maxTokens: 32768,
|
|
195
|
+
compat: { thinkingFormat: "qwen", supportsDeveloperRole: false },
|
|
196
|
+
} satisfies Model<"openai-completions">,
|
|
197
|
+
"qwen3.5-plus": {
|
|
198
|
+
id: "qwen3.5-plus",
|
|
199
|
+
name: "Qwen3.5 Plus",
|
|
200
|
+
api: "openai-completions",
|
|
201
|
+
provider: "alibaba-dashscope",
|
|
202
|
+
baseUrl: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
|
203
|
+
reasoning: true,
|
|
204
|
+
input: ["text"],
|
|
205
|
+
cost: {
|
|
206
|
+
input: 0.4,
|
|
207
|
+
output: 1.2,
|
|
208
|
+
cacheRead: 0,
|
|
209
|
+
cacheWrite: 0,
|
|
210
|
+
},
|
|
211
|
+
contextWindow: 1000000,
|
|
212
|
+
maxTokens: 65536,
|
|
213
|
+
compat: { thinkingFormat: "qwen", supportsDeveloperRole: false },
|
|
214
|
+
} satisfies Model<"openai-completions">,
|
|
215
|
+
"qwen3.5-flash": {
|
|
216
|
+
id: "qwen3.5-flash",
|
|
217
|
+
name: "Qwen3.5 Flash",
|
|
218
|
+
api: "openai-completions",
|
|
219
|
+
provider: "alibaba-dashscope",
|
|
220
|
+
baseUrl: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
|
221
|
+
reasoning: false,
|
|
222
|
+
input: ["text"],
|
|
223
|
+
cost: {
|
|
224
|
+
input: 0.1,
|
|
225
|
+
output: 0.4,
|
|
226
|
+
cacheRead: 0,
|
|
227
|
+
cacheWrite: 0,
|
|
228
|
+
},
|
|
229
|
+
contextWindow: 1000000,
|
|
230
|
+
maxTokens: 32768,
|
|
231
|
+
compat: { supportsDeveloperRole: false },
|
|
232
|
+
} satisfies Model<"openai-completions">,
|
|
233
|
+
"qwen3-coder-plus": {
|
|
234
|
+
id: "qwen3-coder-plus",
|
|
235
|
+
name: "Qwen3 Coder Plus",
|
|
236
|
+
api: "openai-completions",
|
|
237
|
+
provider: "alibaba-dashscope",
|
|
238
|
+
baseUrl: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
|
239
|
+
reasoning: false,
|
|
240
|
+
input: ["text"],
|
|
241
|
+
cost: {
|
|
242
|
+
input: 1.0,
|
|
243
|
+
output: 5.0,
|
|
244
|
+
cacheRead: 0,
|
|
245
|
+
cacheWrite: 0,
|
|
246
|
+
},
|
|
247
|
+
contextWindow: 1000000,
|
|
248
|
+
maxTokens: 65536,
|
|
249
|
+
compat: { supportsDeveloperRole: false },
|
|
250
|
+
} satisfies Model<"openai-completions">,
|
|
251
|
+
"qwen3.6-plus": {
|
|
252
|
+
id: "qwen3.6-plus",
|
|
253
|
+
name: "Qwen3.6 Plus",
|
|
254
|
+
api: "openai-completions",
|
|
255
|
+
provider: "alibaba-dashscope",
|
|
256
|
+
baseUrl: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
|
257
|
+
reasoning: true,
|
|
258
|
+
input: ["text"],
|
|
259
|
+
cost: {
|
|
260
|
+
input: 0.5,
|
|
261
|
+
output: 3.0,
|
|
262
|
+
cacheRead: 0,
|
|
263
|
+
cacheWrite: 0,
|
|
264
|
+
},
|
|
265
|
+
contextWindow: 1000000,
|
|
266
|
+
maxTokens: 65536,
|
|
267
|
+
compat: { thinkingFormat: "qwen", supportsDeveloperRole: false },
|
|
268
|
+
} satisfies Model<"openai-completions">,
|
|
269
|
+
},
|
|
270
|
+
|
|
173
271
|
// ─── Z.AI (GLM-5.1) ────────────────────────────────────────────────
|
|
174
272
|
// GLM-5.1 is the latest GLM model from Zhipu AI, not yet in models.dev.
|
|
175
273
|
// Uses the Z.AI Coding Plan endpoint (OpenAI-compatible).
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { describe, it } from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { MODELS } from "./models.generated.js";
|
|
4
|
+
import { getModel, getModels, getProviders } from "./models.js";
|
|
5
|
+
|
|
6
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
7
|
+
// Regression: qwen/qwen3.6-plus missing from OpenRouter (issue #3582)
|
|
8
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
9
|
+
|
|
10
|
+
describe("regression #3582 — qwen/qwen3.6-plus available via openrouter", () => {
|
|
11
|
+
it("qwen/qwen3.6-plus exists in MODELS['openrouter']", () => {
|
|
12
|
+
const model = MODELS["openrouter"]["qwen/qwen3.6-plus" as keyof (typeof MODELS)["openrouter"]];
|
|
13
|
+
assert.ok(model, "qwen/qwen3.6-plus must be present in MODELS.openrouter");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("qwen/qwen3.6-plus is accessible via getModel()", () => {
|
|
17
|
+
const model = getModel("openrouter", "qwen/qwen3.6-plus" as any);
|
|
18
|
+
assert.ok(model, "getModel('openrouter', 'qwen/qwen3.6-plus') must return a model");
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("qwen/qwen3.6-plus has id matching its registry key", () => {
|
|
22
|
+
const model = getModel("openrouter", "qwen/qwen3.6-plus" as any);
|
|
23
|
+
assert.equal(model.id, "qwen/qwen3.6-plus");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("qwen/qwen3.6-plus has provider set to openrouter", () => {
|
|
27
|
+
const model = getModel("openrouter", "qwen/qwen3.6-plus" as any);
|
|
28
|
+
assert.equal(model.provider, "openrouter");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("qwen/qwen3.6-plus has reasoning enabled", () => {
|
|
32
|
+
const model = getModel("openrouter", "qwen/qwen3.6-plus" as any);
|
|
33
|
+
assert.equal(model.reasoning, true, "Qwen3.6 Plus is a reasoning model");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("qwen/qwen3.6-plus has 1M context window", () => {
|
|
37
|
+
const model = getModel("openrouter", "qwen/qwen3.6-plus" as any);
|
|
38
|
+
assert.equal(model.contextWindow, 1_000_000);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
43
|
+
// Regression: z-ai/glm-5.1 missing from OpenRouter (issue #4069)
|
|
44
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
45
|
+
|
|
46
|
+
describe("regression #4069 — z-ai/glm-5.1 available via openrouter", () => {
|
|
47
|
+
it("z-ai/glm-5.1 exists in MODELS['openrouter']", () => {
|
|
48
|
+
const model = MODELS["openrouter"]["z-ai/glm-5.1" as keyof (typeof MODELS)["openrouter"]];
|
|
49
|
+
assert.ok(model, "z-ai/glm-5.1 must be present in MODELS.openrouter");
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("z-ai/glm-5.1 is accessible via getModel()", () => {
|
|
53
|
+
const model = getModel("openrouter", "z-ai/glm-5.1" as any);
|
|
54
|
+
assert.ok(model, "getModel('openrouter', 'z-ai/glm-5.1') must return a model");
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("z-ai/glm-5.1 has id matching its registry key", () => {
|
|
58
|
+
const model = getModel("openrouter", "z-ai/glm-5.1" as any);
|
|
59
|
+
assert.equal(model.id, "z-ai/glm-5.1");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("z-ai/glm-5.1 has provider set to openrouter", () => {
|
|
63
|
+
const model = getModel("openrouter", "z-ai/glm-5.1" as any);
|
|
64
|
+
assert.equal(model.provider, "openrouter");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("z-ai/glm-5.1 has a positive context window", () => {
|
|
68
|
+
const model = getModel("openrouter", "z-ai/glm-5.1" as any);
|
|
69
|
+
assert.ok(model.contextWindow > 0);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("z-ai/glm-5.1 uses the OpenRouter base URL", () => {
|
|
73
|
+
const model = getModel("openrouter", "z-ai/glm-5.1" as any);
|
|
74
|
+
assert.equal(model.baseUrl, "https://openrouter.ai/api/v1");
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
79
|
+
// Structural invariants — every model in MODELS must be well-formed
|
|
80
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
81
|
+
|
|
82
|
+
describe("MODELS structural invariants", () => {
|
|
83
|
+
type ModelEntry = { providerKey: string; modelKey: string; model: Record<string, unknown> };
|
|
84
|
+
|
|
85
|
+
function allModels(): ModelEntry[] {
|
|
86
|
+
const entries: ModelEntry[] = [];
|
|
87
|
+
for (const [providerKey, providerModels] of Object.entries(MODELS)) {
|
|
88
|
+
for (const [modelKey, model] of Object.entries(providerModels)) {
|
|
89
|
+
entries.push({ providerKey, modelKey, model: model as Record<string, unknown> });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return entries;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
it("every model's id field matches its key in MODELS", () => {
|
|
96
|
+
const mismatches: string[] = [];
|
|
97
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
98
|
+
if (model["id"] !== modelKey) {
|
|
99
|
+
mismatches.push(`${providerKey}/${modelKey}: id="${model["id"]}"`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
assert.deepEqual(mismatches, [], `Models where 'id' doesn't match registry key:\n ${mismatches.join("\n ")}`);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("every model's provider field matches its parent provider key", () => {
|
|
106
|
+
const mismatches: string[] = [];
|
|
107
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
108
|
+
if (model["provider"] !== providerKey) {
|
|
109
|
+
mismatches.push(`${providerKey}/${modelKey}: provider="${model["provider"]}"`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
assert.deepEqual(mismatches, [], `Models where 'provider' doesn't match parent key:\n ${mismatches.join("\n ")}`);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("every model has a non-empty string name", () => {
|
|
116
|
+
const invalid: string[] = [];
|
|
117
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
118
|
+
if (typeof model["name"] !== "string" || model["name"].trim() === "") {
|
|
119
|
+
invalid.push(`${providerKey}/${modelKey}`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
assert.deepEqual(invalid, [], `Models with missing or empty name:\n ${invalid.join("\n ")}`);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("every model has a non-empty string api", () => {
|
|
126
|
+
const invalid: string[] = [];
|
|
127
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
128
|
+
if (typeof model["api"] !== "string" || model["api"].trim() === "") {
|
|
129
|
+
invalid.push(`${providerKey}/${modelKey}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
assert.deepEqual(invalid, [], `Models with missing or empty api:\n ${invalid.join("\n ")}`);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("every model's baseUrl starts with https:// (or is empty for azure-openai-responses)", () => {
|
|
136
|
+
const invalid: string[] = [];
|
|
137
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
138
|
+
if (providerKey === "azure-openai-responses") continue;
|
|
139
|
+
const url = model["baseUrl"];
|
|
140
|
+
if (typeof url !== "string" || !url.startsWith("https://")) {
|
|
141
|
+
invalid.push(`${providerKey}/${modelKey}: baseUrl="${url}"`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
assert.deepEqual(invalid, [], `Models with missing or non-HTTPS baseUrl:\n ${invalid.join("\n ")}`);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it("azure-openai-responses models have an empty baseUrl (runtime-configured)", () => {
|
|
148
|
+
const models = getModels("azure-openai-responses");
|
|
149
|
+
assert.ok(models.length > 0, "azure-openai-responses must have at least one model");
|
|
150
|
+
for (const model of models) {
|
|
151
|
+
assert.equal(model.baseUrl, "", `azure-openai-responses/${model.id} should have empty baseUrl`);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it("every model has a boolean reasoning field", () => {
|
|
156
|
+
const invalid: string[] = [];
|
|
157
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
158
|
+
if (typeof model["reasoning"] !== "boolean") {
|
|
159
|
+
invalid.push(`${providerKey}/${modelKey}: reasoning=${model["reasoning"]}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
assert.deepEqual(invalid, [], `Models with non-boolean reasoning:\n ${invalid.join("\n ")}`);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it("every model has a non-empty input array", () => {
|
|
166
|
+
const invalid: string[] = [];
|
|
167
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
168
|
+
const input = model["input"];
|
|
169
|
+
if (!Array.isArray(input) || input.length === 0) {
|
|
170
|
+
invalid.push(`${providerKey}/${modelKey}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
assert.deepEqual(invalid, [], `Models with missing or empty input array:\n ${invalid.join("\n ")}`);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it("every model has a positive contextWindow", () => {
|
|
177
|
+
const invalid: string[] = [];
|
|
178
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
179
|
+
const cw = model["contextWindow"];
|
|
180
|
+
if (typeof cw !== "number" || cw <= 0 || !Number.isFinite(cw)) {
|
|
181
|
+
invalid.push(`${providerKey}/${modelKey}: contextWindow=${cw}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
assert.deepEqual(invalid, [], `Models with invalid contextWindow:\n ${invalid.join("\n ")}`);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it("every model has a positive maxTokens", () => {
|
|
188
|
+
const invalid: string[] = [];
|
|
189
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
190
|
+
const mt = model["maxTokens"];
|
|
191
|
+
if (typeof mt !== "number" || mt <= 0 || !Number.isFinite(mt)) {
|
|
192
|
+
invalid.push(`${providerKey}/${modelKey}: maxTokens=${mt}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
assert.deepEqual(invalid, [], `Models with invalid maxTokens:\n ${invalid.join("\n ")}`);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it("every model's maxTokens does not exceed contextWindow", () => {
|
|
199
|
+
const knownExceptions = new Set([
|
|
200
|
+
"openrouter/meta-llama/llama-3-8b-instruct",
|
|
201
|
+
"openrouter/nex-agi/deepseek-v3.1-nex-n1",
|
|
202
|
+
"openrouter/openai/gpt-3.5-turbo-0613",
|
|
203
|
+
"openrouter/z-ai/glm-5",
|
|
204
|
+
]);
|
|
205
|
+
|
|
206
|
+
const invalid: string[] = [];
|
|
207
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
208
|
+
if (knownExceptions.has(`${providerKey}/${modelKey}`)) continue;
|
|
209
|
+
const cw = model["contextWindow"] as number;
|
|
210
|
+
const mt = model["maxTokens"] as number;
|
|
211
|
+
if (typeof cw === "number" && typeof mt === "number" && mt > cw) {
|
|
212
|
+
invalid.push(`${providerKey}/${modelKey}: maxTokens(${mt}) > contextWindow(${cw})`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
assert.deepEqual(invalid, [], `Models where maxTokens exceeds contextWindow:\n ${invalid.join("\n ")}`);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it("every model has a cost object with non-negative numeric fields", () => {
|
|
219
|
+
const knownNegativeCostModels = new Set([
|
|
220
|
+
"openrouter/openrouter/auto",
|
|
221
|
+
]);
|
|
222
|
+
|
|
223
|
+
const invalid: string[] = [];
|
|
224
|
+
for (const { providerKey, modelKey, model } of allModels()) {
|
|
225
|
+
if (knownNegativeCostModels.has(`${providerKey}/${modelKey}`)) continue;
|
|
226
|
+
const cost = model["cost"] as Record<string, unknown> | undefined;
|
|
227
|
+
if (!cost || typeof cost !== "object") {
|
|
228
|
+
invalid.push(`${providerKey}/${modelKey}: missing cost object`);
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
for (const field of ["input", "output", "cacheRead", "cacheWrite"] as const) {
|
|
232
|
+
const val = cost[field];
|
|
233
|
+
if (typeof val !== "number" || val < 0 || !Number.isFinite(val)) {
|
|
234
|
+
invalid.push(`${providerKey}/${modelKey}: cost.${field}=${val}`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
assert.deepEqual(invalid, [], `Models with invalid cost fields:\n ${invalid.join("\n ")}`);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it("no provider has duplicate model IDs", () => {
|
|
242
|
+
const duplicates: string[] = [];
|
|
243
|
+
for (const [providerKey, providerModels] of Object.entries(MODELS)) {
|
|
244
|
+
const ids = Object.values(providerModels).map((m) => (m as Record<string, unknown>)["id"] as string);
|
|
245
|
+
const seen = new Set<string>();
|
|
246
|
+
for (const id of ids) {
|
|
247
|
+
if (seen.has(id)) duplicates.push(`${providerKey}/${id}`);
|
|
248
|
+
seen.add(id);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
assert.deepEqual(duplicates, [], `Duplicate model IDs within a provider:\n ${duplicates.join("\n ")}`);
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
256
|
+
// Registry shape
|
|
257
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
258
|
+
|
|
259
|
+
describe("MODELS registry shape", () => {
|
|
260
|
+
it("has exactly 23 providers", () => {
|
|
261
|
+
const count = Object.keys(MODELS).length;
|
|
262
|
+
assert.equal(count, 23, `Expected 23 providers, got ${count}: ${Object.keys(MODELS).join(", ")}`);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it("has at least 200 models in total (sanity check)", () => {
|
|
266
|
+
let total = 0;
|
|
267
|
+
for (const providerModels of Object.values(MODELS)) {
|
|
268
|
+
total += Object.keys(providerModels).length;
|
|
269
|
+
}
|
|
270
|
+
assert.ok(total >= 200, `Registry has only ${total} models — unexpectedly small`);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it("all 23 expected providers are present", () => {
|
|
274
|
+
const expected = [
|
|
275
|
+
"amazon-bedrock",
|
|
276
|
+
"anthropic",
|
|
277
|
+
"azure-openai-responses",
|
|
278
|
+
"cerebras",
|
|
279
|
+
"github-copilot",
|
|
280
|
+
"google",
|
|
281
|
+
"google-antigravity",
|
|
282
|
+
"google-gemini-cli",
|
|
283
|
+
"google-vertex",
|
|
284
|
+
"groq",
|
|
285
|
+
"huggingface",
|
|
286
|
+
"kimi-coding",
|
|
287
|
+
"minimax",
|
|
288
|
+
"minimax-cn",
|
|
289
|
+
"mistral",
|
|
290
|
+
"openai",
|
|
291
|
+
"openai-codex",
|
|
292
|
+
"opencode",
|
|
293
|
+
"opencode-go",
|
|
294
|
+
"openrouter",
|
|
295
|
+
"vercel-ai-gateway",
|
|
296
|
+
"xai",
|
|
297
|
+
"zai",
|
|
298
|
+
];
|
|
299
|
+
const actual = Object.keys(MODELS).sort();
|
|
300
|
+
assert.deepEqual(actual, expected.sort());
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it("getProviders() returns all generated providers", () => {
|
|
304
|
+
const providers = getProviders();
|
|
305
|
+
for (const p of Object.keys(MODELS)) {
|
|
306
|
+
assert.ok(providers.includes(p as any), `getProviders() missing generated provider: ${p}`);
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
312
|
+
// Removed models must not exist
|
|
313
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
314
|
+
|
|
315
|
+
describe("removed models are absent from the registry", () => {
|
|
316
|
+
const removedModels: Array<{ provider: string; id: string }> = [
|
|
317
|
+
{ provider: "openrouter", id: "anthropic/claude-3.5-sonnet" },
|
|
318
|
+
{ provider: "openrouter", id: "anthropic/claude-3.5-sonnet-20240620" },
|
|
319
|
+
{ provider: "openrouter", id: "mistralai/mistral-small-24b-instruct-2501" },
|
|
320
|
+
{ provider: "openrouter", id: "mistralai/mistral-small-3.1-24b-instruct:free" },
|
|
321
|
+
{ provider: "openrouter", id: "qwen/qwen3-4b:free" },
|
|
322
|
+
{ provider: "openrouter", id: "stepfun/step-3.5-flash:free" },
|
|
323
|
+
{ provider: "openrouter", id: "x-ai/grok-4.20-beta" },
|
|
324
|
+
{ provider: "openrouter", id: "arcee-ai/trinity-mini:free" },
|
|
325
|
+
{ provider: "openrouter", id: "google/gemini-3-pro-preview" },
|
|
326
|
+
{ provider: "openrouter", id: "kwaipilot/kat-coder-pro" },
|
|
327
|
+
{ provider: "openrouter", id: "meituan/longcat-flash-thinking" },
|
|
328
|
+
{ provider: "vercel-ai-gateway", id: "xai/grok-2-vision" },
|
|
329
|
+
{ provider: "anthropic", id: "claude-3-7-sonnet-latest" },
|
|
330
|
+
];
|
|
331
|
+
|
|
332
|
+
for (const { provider, id } of removedModels) {
|
|
333
|
+
it(`${provider}/${id} has been removed`, () => {
|
|
334
|
+
const model = getModel(provider as any, id as any);
|
|
335
|
+
assert.equal(model, undefined, `${provider}/${id} should be removed but is still present`);
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
341
|
+
// Spot-checks for notable models added in this regeneration
|
|
342
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
343
|
+
|
|
344
|
+
describe("spot-checks for models added in this regeneration", () => {
|
|
345
|
+
const newModels: Array<{ provider: string; id: string; reasoning?: boolean }> = [
|
|
346
|
+
{ provider: "openrouter", id: "z-ai/glm-5.1" },
|
|
347
|
+
{ provider: "openrouter", id: "z-ai/glm-5v-turbo" },
|
|
348
|
+
{ provider: "openrouter", id: "google/gemma-4-31b-it" },
|
|
349
|
+
{ provider: "openrouter", id: "google/gemma-4-26b-a4b-it" },
|
|
350
|
+
{ provider: "openrouter", id: "arcee-ai/trinity-large-thinking", reasoning: true },
|
|
351
|
+
{ provider: "openrouter", id: "openai/gpt-audio" },
|
|
352
|
+
{ provider: "openrouter", id: "anthropic/claude-opus-4.6-fast" },
|
|
353
|
+
{ provider: "openrouter", id: "qwen/qwen3.6-plus" },
|
|
354
|
+
{ provider: "groq", id: "groq/compound" },
|
|
355
|
+
{ provider: "groq", id: "groq/compound-mini" },
|
|
356
|
+
{ provider: "huggingface", id: "zai-org/GLM-5.1" },
|
|
357
|
+
{ provider: "openai", id: "gpt-5.3-chat-latest" },
|
|
358
|
+
{ provider: "mistral", id: "mistral-small-2603" },
|
|
359
|
+
{ provider: "zai", id: "glm-5.1" },
|
|
360
|
+
];
|
|
361
|
+
|
|
362
|
+
for (const { provider, id, reasoning } of newModels) {
|
|
363
|
+
it(`${provider}/${id} is present in the registry`, () => {
|
|
364
|
+
const model = getModel(provider as any, id as any);
|
|
365
|
+
assert.ok(model, `Expected ${provider}/${id} to be present after regeneration`);
|
|
366
|
+
assert.equal(model.id, id);
|
|
367
|
+
assert.equal(model.provider, provider);
|
|
368
|
+
if (reasoning !== undefined) {
|
|
369
|
+
assert.equal(model.reasoning, reasoning, `${id} reasoning should be ${reasoning}`);
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
});
|