@vascend/talos 0.1.0
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 +202 -0
- package/dist/backend/asset-events.d.ts +31 -0
- package/dist/backend/asset-events.js +149 -0
- package/dist/backend/assets.d.ts +31 -0
- package/dist/backend/assets.js +210 -0
- package/dist/backend/auth.d.ts +18 -0
- package/dist/backend/auth.js +59 -0
- package/dist/backend/config.d.ts +14 -0
- package/dist/backend/config.js +41 -0
- package/dist/backend/conversations.d.ts +21 -0
- package/dist/backend/conversations.js +141 -0
- package/dist/backend/crypto.d.ts +9 -0
- package/dist/backend/crypto.js +68 -0
- package/dist/backend/engine.d.ts +13 -0
- package/dist/backend/engine.js +78 -0
- package/dist/backend/http.d.ts +25 -0
- package/dist/backend/http.js +112 -0
- package/dist/backend/index.d.ts +1 -0
- package/dist/backend/index.js +24 -0
- package/dist/backend/routes.d.ts +14 -0
- package/dist/backend/routes.js +169 -0
- package/dist/backend/sdk.d.ts +12 -0
- package/dist/backend/sdk.js +11 -0
- package/dist/backend/server.d.ts +12 -0
- package/dist/backend/server.js +91 -0
- package/dist/backend/temp-image-store.d.ts +46 -0
- package/dist/backend/temp-image-store.js +197 -0
- package/dist/backend/types.d.ts +103 -0
- package/dist/backend/types.js +29 -0
- package/dist/backend/users.d.ts +13 -0
- package/dist/backend/users.js +76 -0
- package/dist/backend/ws-handler.d.ts +14 -0
- package/dist/backend/ws-handler.js +72 -0
- package/dist/backend/ws.d.ts +19 -0
- package/dist/backend/ws.js +146 -0
- package/dist/core/agent.d.ts +56 -0
- package/dist/core/agent.js +1783 -0
- package/dist/core/background.d.ts +45 -0
- package/dist/core/background.js +140 -0
- package/dist/core/bootstrap.d.ts +45 -0
- package/dist/core/bootstrap.js +294 -0
- package/dist/core/cli-args.d.ts +41 -0
- package/dist/core/cli-args.js +282 -0
- package/dist/core/collapsible-output.d.ts +38 -0
- package/dist/core/collapsible-output.js +143 -0
- package/dist/core/compaction-checkpoint.d.ts +9 -0
- package/dist/core/compaction-checkpoint.js +58 -0
- package/dist/core/compaction.d.ts +42 -0
- package/dist/core/compaction.js +270 -0
- package/dist/core/config.d.ts +49 -0
- package/dist/core/config.js +417 -0
- package/dist/core/context-ledger.d.ts +99 -0
- package/dist/core/context-ledger.js +222 -0
- package/dist/core/context-policy.d.ts +17 -0
- package/dist/core/context-policy.js +81 -0
- package/dist/core/continuation-review.d.ts +23 -0
- package/dist/core/continuation-review.js +64 -0
- package/dist/core/crash-report.d.ts +3 -0
- package/dist/core/crash-report.js +27 -0
- package/dist/core/credentials.d.ts +11 -0
- package/dist/core/credentials.js +183 -0
- package/dist/core/doctor.d.ts +24 -0
- package/dist/core/doctor.js +125 -0
- package/dist/core/effort.d.ts +5 -0
- package/dist/core/effort.js +42 -0
- package/dist/core/env-paths.d.ts +3 -0
- package/dist/core/env-paths.js +38 -0
- package/dist/core/execution-guidance.d.ts +9 -0
- package/dist/core/execution-guidance.js +73 -0
- package/dist/core/execution-target.d.ts +41 -0
- package/dist/core/execution-target.js +69 -0
- package/dist/core/file-coordination.d.ts +66 -0
- package/dist/core/file-coordination.js +176 -0
- package/dist/core/file-lease-store.d.ts +14 -0
- package/dist/core/file-lease-store.js +89 -0
- package/dist/core/image-limits.d.ts +26 -0
- package/dist/core/image-limits.js +205 -0
- package/dist/core/interruptible-completion.d.ts +3 -0
- package/dist/core/interruptible-completion.js +42 -0
- package/dist/core/kingdoms-mode-state.d.ts +24 -0
- package/dist/core/kingdoms-mode-state.js +139 -0
- package/dist/core/licenza.d.ts +38 -0
- package/dist/core/licenza.js +125 -0
- package/dist/core/model-limits.d.ts +2 -0
- package/dist/core/model-limits.js +36 -0
- package/dist/core/output-lifecycle.d.ts +44 -0
- package/dist/core/output-lifecycle.js +190 -0
- package/dist/core/package-update.d.ts +15 -0
- package/dist/core/package-update.js +121 -0
- package/dist/core/permission-queue.d.ts +2 -0
- package/dist/core/permission-queue.js +20 -0
- package/dist/core/prompt-attachment.d.ts +21 -0
- package/dist/core/prompt-attachment.js +123 -0
- package/dist/core/request-plan.d.ts +16 -0
- package/dist/core/request-plan.js +36 -0
- package/dist/core/run-timing.d.ts +17 -0
- package/dist/core/run-timing.js +123 -0
- package/dist/core/self-update.d.ts +17 -0
- package/dist/core/self-update.js +54 -0
- package/dist/core/session-refs.d.ts +27 -0
- package/dist/core/session-refs.js +126 -0
- package/dist/core/session-storage.d.ts +4 -0
- package/dist/core/session-storage.js +48 -0
- package/dist/core/session-title.d.ts +1 -0
- package/dist/core/session-title.js +21 -0
- package/dist/core/session-usage.d.ts +17 -0
- package/dist/core/session-usage.js +74 -0
- package/dist/core/session.d.ts +58 -0
- package/dist/core/session.js +296 -0
- package/dist/core/settings.d.ts +17 -0
- package/dist/core/settings.js +107 -0
- package/dist/core/storage-retention.d.ts +21 -0
- package/dist/core/storage-retention.js +227 -0
- package/dist/core/text-sanitize.d.ts +1 -0
- package/dist/core/text-sanitize.js +35 -0
- package/dist/core/tool-artifacts.d.ts +6 -0
- package/dist/core/tool-artifacts.js +51 -0
- package/dist/core/tool-compress.d.ts +8 -0
- package/dist/core/tool-compress.js +111 -0
- package/dist/core/tool-executor.d.ts +16 -0
- package/dist/core/tool-executor.js +97 -0
- package/dist/core/tool-result-index.d.ts +52 -0
- package/dist/core/tool-result-index.js +327 -0
- package/dist/core/tool-result-store.d.ts +38 -0
- package/dist/core/tool-result-store.js +190 -0
- package/dist/core/tool-scheduler.d.ts +16 -0
- package/dist/core/tool-scheduler.js +35 -0
- package/dist/core/trust.d.ts +21 -0
- package/dist/core/trust.js +95 -0
- package/dist/core/types.d.ts +402 -0
- package/dist/core/types.js +1 -0
- package/dist/core/update-check.d.ts +26 -0
- package/dist/core/update-check.js +89 -0
- package/dist/core/update-process.d.ts +10 -0
- package/dist/core/update-process.js +31 -0
- package/dist/core/user-inbox.d.ts +23 -0
- package/dist/core/user-inbox.js +56 -0
- package/dist/core/user-input.d.ts +10 -0
- package/dist/core/user-input.js +35 -0
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +10 -0
- package/dist/core/vibe-modes.d.ts +38 -0
- package/dist/core/vibe-modes.js +383 -0
- package/dist/core/workspace-roots.d.ts +13 -0
- package/dist/core/workspace-roots.js +91 -0
- package/dist/core/workspace-sessions.d.ts +51 -0
- package/dist/core/workspace-sessions.js +243 -0
- package/dist/cowork/client.d.ts +29 -0
- package/dist/cowork/client.js +49 -0
- package/dist/cowork/engine-bridge.d.ts +22 -0
- package/dist/cowork/engine-bridge.js +98 -0
- package/dist/cowork/index.d.ts +11 -0
- package/dist/cowork/index.js +16 -0
- package/dist/cowork/ipc.d.ts +97 -0
- package/dist/cowork/ipc.js +96 -0
- package/dist/cowork/manager.d.ts +66 -0
- package/dist/cowork/manager.js +325 -0
- package/dist/cowork/store.d.ts +23 -0
- package/dist/cowork/store.js +182 -0
- package/dist/cowork/sync.d.ts +20 -0
- package/dist/cowork/sync.js +164 -0
- package/dist/cowork/types.d.ts +78 -0
- package/dist/cowork/types.js +21 -0
- package/dist/extensions/ext-tools.d.ts +3 -0
- package/dist/extensions/ext-tools.js +73 -0
- package/dist/extensions/loader.d.ts +91 -0
- package/dist/extensions/loader.js +474 -0
- package/dist/extensions/settings.d.ts +20 -0
- package/dist/extensions/settings.js +86 -0
- package/dist/extensions/types.d.ts +219 -0
- package/dist/extensions/types.js +1 -0
- package/dist/horizon/async-queue.d.ts +9 -0
- package/dist/horizon/async-queue.js +46 -0
- package/dist/horizon/engine.d.ts +85 -0
- package/dist/horizon/engine.js +603 -0
- package/dist/horizon/index.d.ts +4 -0
- package/dist/horizon/index.js +2 -0
- package/dist/horizon/main-team.d.ts +163 -0
- package/dist/horizon/main-team.js +774 -0
- package/dist/horizon/types.d.ts +233 -0
- package/dist/horizon/types.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +233 -0
- package/dist/mcp/protocol.d.ts +81 -0
- package/dist/mcp/protocol.js +122 -0
- package/dist/package.json +1 -0
- package/dist/packages/packages.d.ts +12 -0
- package/dist/packages/packages.js +323 -0
- package/dist/prompts/templates.d.ts +13 -0
- package/dist/prompts/templates.js +139 -0
- package/dist/providers/anthropic-oauth.d.ts +13 -0
- package/dist/providers/anthropic-oauth.js +124 -0
- package/dist/providers/anthropic.d.ts +27 -0
- package/dist/providers/anthropic.js +526 -0
- package/dist/providers/catalog.d.ts +15 -0
- package/dist/providers/catalog.js +166 -0
- package/dist/providers/effort.d.ts +12 -0
- package/dist/providers/effort.js +102 -0
- package/dist/providers/model-catalog.d.ts +43 -0
- package/dist/providers/model-catalog.js +70 -0
- package/dist/providers/model-effort.d.ts +5 -0
- package/dist/providers/model-effort.js +43 -0
- package/dist/providers/model-registry.d.ts +39 -0
- package/dist/providers/model-registry.js +142 -0
- package/dist/providers/models-dev.d.ts +9 -0
- package/dist/providers/models-dev.js +97 -0
- package/dist/providers/oauth-callback-server.d.ts +28 -0
- package/dist/providers/oauth-callback-server.js +184 -0
- package/dist/providers/oauth-orchestrator.d.ts +58 -0
- package/dist/providers/oauth-orchestrator.js +159 -0
- package/dist/providers/oauth-store.d.ts +12 -0
- package/dist/providers/oauth-store.js +139 -0
- package/dist/providers/open-browser.d.ts +20 -0
- package/dist/providers/open-browser.js +92 -0
- package/dist/providers/openai-compat.d.ts +14 -0
- package/dist/providers/openai-compat.js +523 -0
- package/dist/providers/openai-oauth.d.ts +15 -0
- package/dist/providers/openai-oauth.js +382 -0
- package/dist/providers/openrouter-auth.d.ts +73 -0
- package/dist/providers/openrouter-auth.js +321 -0
- package/dist/providers/openrouter-manual-fallback.d.ts +25 -0
- package/dist/providers/openrouter-manual-fallback.js +161 -0
- package/dist/providers/openrouter.d.ts +15 -0
- package/dist/providers/openrouter.js +107 -0
- package/dist/providers/plan-limits.d.ts +6 -0
- package/dist/providers/plan-limits.js +175 -0
- package/dist/providers/provider-reset.d.ts +4 -0
- package/dist/providers/provider-reset.js +83 -0
- package/dist/providers/quota-limits.d.ts +4 -0
- package/dist/providers/quota-limits.js +33 -0
- package/dist/providers/registry.d.ts +33 -0
- package/dist/providers/registry.js +213 -0
- package/dist/providers/retry.d.ts +37 -0
- package/dist/providers/retry.js +347 -0
- package/dist/rpc/server.d.ts +23 -0
- package/dist/rpc/server.js +222 -0
- package/dist/sdk.d.ts +67 -0
- package/dist/sdk.js +64 -0
- package/dist/skills/skills.d.ts +17 -0
- package/dist/skills/skills.js +155 -0
- package/dist/text-sanitize.js +28 -0
- package/dist/tools/ask-user.d.ts +2 -0
- package/dist/tools/ask-user.js +60 -0
- package/dist/tools/builtin.d.ts +48 -0
- package/dist/tools/builtin.js +2494 -0
- package/dist/tools/capabilities.d.ts +5 -0
- package/dist/tools/capabilities.js +55 -0
- package/dist/tools/computer-capture.d.ts +2 -0
- package/dist/tools/computer-capture.js +91 -0
- package/dist/tools/computer-posix.d.ts +5 -0
- package/dist/tools/computer-posix.js +136 -0
- package/dist/tools/computer-use.d.ts +14 -0
- package/dist/tools/computer-use.js +108 -0
- package/dist/tools/discovery.d.ts +12 -0
- package/dist/tools/discovery.js +205 -0
- package/dist/tools/execute.d.ts +2 -0
- package/dist/tools/execute.js +73 -0
- package/dist/tools/normalize-input.d.ts +17 -0
- package/dist/tools/normalize-input.js +174 -0
- package/dist/tools/output-artifact.d.ts +3 -0
- package/dist/tools/output-artifact.js +80 -0
- package/dist/tools/pagination.d.ts +15 -0
- package/dist/tools/pagination.js +93 -0
- package/dist/tools/plan-status.d.ts +2 -0
- package/dist/tools/plan-status.js +109 -0
- package/dist/tools/program-input.d.ts +3 -0
- package/dist/tools/program-input.js +19 -0
- package/dist/tools/program.d.ts +3 -0
- package/dist/tools/program.js +567 -0
- package/dist/tools/protocol-catalog.d.ts +12 -0
- package/dist/tools/protocol-catalog.js +46 -0
- package/dist/tools/ramification-tools.d.ts +12 -0
- package/dist/tools/ramification-tools.js +528 -0
- package/dist/tools/regex-compat.d.ts +9 -0
- package/dist/tools/regex-compat.js +96 -0
- package/dist/tools/registry.d.ts +51 -0
- package/dist/tools/registry.js +185 -0
- package/dist/tools/resolve.d.ts +2 -0
- package/dist/tools/resolve.js +107 -0
- package/dist/tools/shell-env.d.ts +2 -0
- package/dist/tools/shell-env.js +7 -0
- package/dist/tools/team-input.d.ts +3 -0
- package/dist/tools/team-input.js +129 -0
- package/dist/tools/team-tools.d.ts +7 -0
- package/dist/tools/team-tools.js +348 -0
- package/dist/tools/workspace-sessions.d.ts +2 -0
- package/dist/tools/workspace-sessions.js +35 -0
- package/dist/tui/account-entry.d.ts +1 -0
- package/dist/tui/account-entry.js +93 -0
- package/dist/tui/attachment-highlight.d.ts +1 -0
- package/dist/tui/attachment-highlight.js +24 -0
- package/dist/tui/attachment-refs.d.ts +2 -0
- package/dist/tui/attachment-refs.js +3 -0
- package/dist/tui/bottom-input.d.ts +219 -0
- package/dist/tui/bottom-input.js +1958 -0
- package/dist/tui/branding.d.ts +107 -0
- package/dist/tui/branding.js +750 -0
- package/dist/tui/clipboard-image.d.ts +10 -0
- package/dist/tui/clipboard-image.js +163 -0
- package/dist/tui/clipboard-text.d.ts +9 -0
- package/dist/tui/clipboard-text.js +51 -0
- package/dist/tui/clipboard-windows.d.ts +8 -0
- package/dist/tui/clipboard-windows.js +84 -0
- package/dist/tui/collapsible-command.d.ts +15 -0
- package/dist/tui/collapsible-command.js +48 -0
- package/dist/tui/command-feedback.d.ts +10 -0
- package/dist/tui/command-feedback.js +46 -0
- package/dist/tui/command-output-registry.d.ts +28 -0
- package/dist/tui/command-output-registry.js +103 -0
- package/dist/tui/command-transcript.d.ts +12 -0
- package/dist/tui/command-transcript.js +90 -0
- package/dist/tui/commands.d.ts +20 -0
- package/dist/tui/commands.js +131 -0
- package/dist/tui/context-bar.d.ts +4 -0
- package/dist/tui/context-bar.js +74 -0
- package/dist/tui/context-meter.d.ts +25 -0
- package/dist/tui/context-meter.js +81 -0
- package/dist/tui/cost-binding.d.ts +8 -0
- package/dist/tui/cost-binding.js +43 -0
- package/dist/tui/cost-tracker.d.ts +49 -0
- package/dist/tui/cost-tracker.js +122 -0
- package/dist/tui/diff.d.ts +9 -0
- package/dist/tui/diff.js +119 -0
- package/dist/tui/i18n-catalog.d.ts +5 -0
- package/dist/tui/i18n-catalog.js +184 -0
- package/dist/tui/i18n.d.ts +6 -0
- package/dist/tui/i18n.js +10 -0
- package/dist/tui/image-attachments.d.ts +46 -0
- package/dist/tui/image-attachments.js +167 -0
- package/dist/tui/images.d.ts +12 -0
- package/dist/tui/images.js +87 -0
- package/dist/tui/intro.d.ts +13 -0
- package/dist/tui/intro.js +109 -0
- package/dist/tui/language-preference.d.ts +6 -0
- package/dist/tui/language-preference.js +24 -0
- package/dist/tui/live-output.d.ts +2 -0
- package/dist/tui/live-output.js +18 -0
- package/dist/tui/locales.d.ts +19 -0
- package/dist/tui/locales.js +22 -0
- package/dist/tui/login-menu.d.ts +17 -0
- package/dist/tui/login-menu.js +58 -0
- package/dist/tui/logo.d.ts +8 -0
- package/dist/tui/logo.js +305 -0
- package/dist/tui/markdown-inline.d.ts +3 -0
- package/dist/tui/markdown-inline.js +99 -0
- package/dist/tui/markdown-table.d.ts +4 -0
- package/dist/tui/markdown-table.js +63 -0
- package/dist/tui/markdown.d.ts +11 -0
- package/dist/tui/markdown.js +257 -0
- package/dist/tui/mcp-transcript.d.ts +7 -0
- package/dist/tui/mcp-transcript.js +40 -0
- package/dist/tui/model-details.d.ts +2 -0
- package/dist/tui/model-details.js +21 -0
- package/dist/tui/model-selection.d.ts +7 -0
- package/dist/tui/model-selection.js +41 -0
- package/dist/tui/native-scrollback.d.ts +27 -0
- package/dist/tui/native-scrollback.js +134 -0
- package/dist/tui/onboarding.d.ts +72 -0
- package/dist/tui/onboarding.js +207 -0
- package/dist/tui/paste-collapse.d.ts +39 -0
- package/dist/tui/paste-collapse.js +117 -0
- package/dist/tui/perm-mode.d.ts +8 -0
- package/dist/tui/perm-mode.js +41 -0
- package/dist/tui/prompt-queue-store.d.ts +26 -0
- package/dist/tui/prompt-queue-store.js +87 -0
- package/dist/tui/prompt-queue.d.ts +47 -0
- package/dist/tui/prompt-queue.js +187 -0
- package/dist/tui/provider-menu.d.ts +33 -0
- package/dist/tui/provider-menu.js +175 -0
- package/dist/tui/question.d.ts +24 -0
- package/dist/tui/question.js +32 -0
- package/dist/tui/queue-screen.d.ts +25 -0
- package/dist/tui/queue-screen.js +152 -0
- package/dist/tui/queue-team.d.ts +3 -0
- package/dist/tui/queue-team.js +28 -0
- package/dist/tui/queued-questions.d.ts +20 -0
- package/dist/tui/queued-questions.js +163 -0
- package/dist/tui/quick-help.d.ts +1 -0
- package/dist/tui/quick-help.js +53 -0
- package/dist/tui/repl.d.ts +78 -0
- package/dist/tui/repl.js +4130 -0
- package/dist/tui/restore-queued-input.d.ts +3 -0
- package/dist/tui/restore-queued-input.js +20 -0
- package/dist/tui/review-detail.d.ts +6 -0
- package/dist/tui/review-detail.js +56 -0
- package/dist/tui/review-files.d.ts +3 -0
- package/dist/tui/review-files.js +22 -0
- package/dist/tui/review-render.d.ts +22 -0
- package/dist/tui/review-render.js +98 -0
- package/dist/tui/review-screen.d.ts +38 -0
- package/dist/tui/review-screen.js +358 -0
- package/dist/tui/review-store.d.ts +60 -0
- package/dist/tui/review-store.js +270 -0
- package/dist/tui/review-team.d.ts +2 -0
- package/dist/tui/review-team.js +27 -0
- package/dist/tui/selector-mouse.d.ts +26 -0
- package/dist/tui/selector-mouse.js +65 -0
- package/dist/tui/selector.d.ts +51 -0
- package/dist/tui/selector.js +299 -0
- package/dist/tui/session-replay.d.ts +10 -0
- package/dist/tui/session-replay.js +78 -0
- package/dist/tui/session-usage.d.ts +22 -0
- package/dist/tui/session-usage.js +55 -0
- package/dist/tui/skill-transcript.d.ts +5 -0
- package/dist/tui/skill-transcript.js +31 -0
- package/dist/tui/startup.d.ts +5 -0
- package/dist/tui/startup.js +61 -0
- package/dist/tui/status-line-loader.d.ts +8 -0
- package/dist/tui/status-line-loader.js +33 -0
- package/dist/tui/status-line.d.ts +38 -0
- package/dist/tui/status-line.js +213 -0
- package/dist/tui/system-language.d.ts +8 -0
- package/dist/tui/system-language.js +41 -0
- package/dist/tui/task-labels.d.ts +2 -0
- package/dist/tui/task-labels.js +7 -0
- package/dist/tui/term-bg.d.ts +4 -0
- package/dist/tui/term-bg.js +67 -0
- package/dist/tui/terminal-screen.d.ts +12 -0
- package/dist/tui/terminal-screen.js +1 -0
- package/dist/tui/terminal-text.d.ts +7 -0
- package/dist/tui/terminal-text.js +123 -0
- package/dist/tui/theme.d.ts +25 -0
- package/dist/tui/theme.js +383 -0
- package/dist/tui/tool-style.d.ts +7 -0
- package/dist/tui/tool-style.js +119 -0
- package/dist/tui/update-prompt.d.ts +14 -0
- package/dist/tui/update-prompt.js +104 -0
- package/dist/tui/usage-footer.d.ts +9 -0
- package/dist/tui/usage-footer.js +123 -0
- package/dist/tui/vascend-login.d.ts +68 -0
- package/dist/tui/vascend-login.js +355 -0
- package/dist/tui/web-login.d.ts +28 -0
- package/dist/tui/web-login.js +115 -0
- package/dist/vascend/activity-status.d.ts +12 -0
- package/dist/vascend/activity-status.js +68 -0
- package/dist/vascend/architecture-map.d.ts +73 -0
- package/dist/vascend/architecture-map.js +424 -0
- package/dist/vascend/attention-layout.d.ts +19 -0
- package/dist/vascend/attention-layout.js +141 -0
- package/dist/vascend/budget-allocator.d.ts +31 -0
- package/dist/vascend/budget-allocator.js +79 -0
- package/dist/vascend/candidate-collector.d.ts +20 -0
- package/dist/vascend/candidate-collector.js +220 -0
- package/dist/vascend/code-events.d.ts +24 -0
- package/dist/vascend/code-events.js +304 -0
- package/dist/vascend/code-graph-memory.d.ts +38 -0
- package/dist/vascend/code-graph-memory.js +334 -0
- package/dist/vascend/code-graph-runtime.d.ts +19 -0
- package/dist/vascend/code-graph-runtime.js +190 -0
- package/dist/vascend/code-graph-types.d.ts +58 -0
- package/dist/vascend/code-graph-types.js +50 -0
- package/dist/vascend/code-parser.d.ts +4 -0
- package/dist/vascend/code-parser.js +257 -0
- package/dist/vascend/competitor-knowledge.d.ts +53 -0
- package/dist/vascend/competitor-knowledge.js +262 -0
- package/dist/vascend/completeness.d.ts +16 -0
- package/dist/vascend/completeness.js +90 -0
- package/dist/vascend/context-autotuner.d.ts +45 -0
- package/dist/vascend/context-autotuner.js +231 -0
- package/dist/vascend/context-candidate.d.ts +45 -0
- package/dist/vascend/context-candidate.js +150 -0
- package/dist/vascend/context-capsule.d.ts +51 -0
- package/dist/vascend/context-capsule.js +133 -0
- package/dist/vascend/context-fabric.d.ts +108 -0
- package/dist/vascend/context-fabric.js +480 -0
- package/dist/vascend/context-feedback-loop.d.ts +56 -0
- package/dist/vascend/context-feedback-loop.js +204 -0
- package/dist/vascend/context-learning-identity.d.ts +4 -0
- package/dist/vascend/context-learning-identity.js +8 -0
- package/dist/vascend/context-links.d.ts +14 -0
- package/dist/vascend/context-links.js +83 -0
- package/dist/vascend/context-lint.d.ts +22 -0
- package/dist/vascend/context-lint.js +91 -0
- package/dist/vascend/context-market-selection.d.ts +17 -0
- package/dist/vascend/context-market-selection.js +50 -0
- package/dist/vascend/context-metrics.d.ts +25 -0
- package/dist/vascend/context-metrics.js +57 -0
- package/dist/vascend/context-pack-render.d.ts +16 -0
- package/dist/vascend/context-pack-render.js +52 -0
- package/dist/vascend/context-pareto.d.ts +33 -0
- package/dist/vascend/context-pareto.js +165 -0
- package/dist/vascend/context-pattern-explorer.d.ts +41 -0
- package/dist/vascend/context-pattern-explorer.js +276 -0
- package/dist/vascend/context-regret.d.ts +32 -0
- package/dist/vascend/context-regret.js +93 -0
- package/dist/vascend/context-retriever.d.ts +22 -0
- package/dist/vascend/context-retriever.js +243 -0
- package/dist/vascend/context-scope-index.d.ts +5 -0
- package/dist/vascend/context-scope-index.js +96 -0
- package/dist/vascend/context-scorer.d.ts +35 -0
- package/dist/vascend/context-scorer.js +162 -0
- package/dist/vascend/context-search-index.d.ts +12 -0
- package/dist/vascend/context-search-index.js +25 -0
- package/dist/vascend/context-snapshot.d.ts +22 -0
- package/dist/vascend/context-snapshot.js +135 -0
- package/dist/vascend/context-window-compiler.d.ts +42 -0
- package/dist/vascend/context-window-compiler.js +237 -0
- package/dist/vascend/contract-memory.d.ts +61 -0
- package/dist/vascend/contract-memory.js +435 -0
- package/dist/vascend/council.d.ts +58 -0
- package/dist/vascend/council.js +337 -0
- package/dist/vascend/decision-promotion.d.ts +48 -0
- package/dist/vascend/decision-promotion.js +410 -0
- package/dist/vascend/delta-context.d.ts +12 -0
- package/dist/vascend/delta-context.js +36 -0
- package/dist/vascend/dev-context-compiler.d.ts +27 -0
- package/dist/vascend/dev-context-compiler.js +133 -0
- package/dist/vascend/dev-context-layout.d.ts +30 -0
- package/dist/vascend/dev-context-layout.js +262 -0
- package/dist/vascend/evidence-slots.d.ts +14 -0
- package/dist/vascend/evidence-slots.js +55 -0
- package/dist/vascend/expansion-levels.d.ts +15 -0
- package/dist/vascend/expansion-levels.js +178 -0
- package/dist/vascend/file-lock.d.ts +7 -0
- package/dist/vascend/file-lock.js +95 -0
- package/dist/vascend/granular-kingdom.d.ts +25 -0
- package/dist/vascend/granular-kingdom.js +259 -0
- package/dist/vascend/granular-launcher.d.ts +48 -0
- package/dist/vascend/granular-launcher.js +202 -0
- package/dist/vascend/kingdom-bus.d.ts +25 -0
- package/dist/vascend/kingdom-bus.js +54 -0
- package/dist/vascend/kingdom-channel.d.ts +22 -0
- package/dist/vascend/kingdom-channel.js +180 -0
- package/dist/vascend/kingdom-kpi.d.ts +48 -0
- package/dist/vascend/kingdom-kpi.js +172 -0
- package/dist/vascend/kingdom-live.d.ts +28 -0
- package/dist/vascend/kingdom-live.js +61 -0
- package/dist/vascend/kingdom-run.d.ts +18 -0
- package/dist/vascend/kingdom-run.js +506 -0
- package/dist/vascend/kingdom-scribe.d.ts +20 -0
- package/dist/vascend/kingdom-scribe.js +52 -0
- package/dist/vascend/kingdom.d.ts +79 -0
- package/dist/vascend/kingdom.js +870 -0
- package/dist/vascend/lexical-index.d.ts +10 -0
- package/dist/vascend/lexical-index.js +99 -0
- package/dist/vascend/lexical-search.d.ts +29 -0
- package/dist/vascend/lexical-search.js +262 -0
- package/dist/vascend/long-term-context.d.ts +51 -0
- package/dist/vascend/long-term-context.js +194 -0
- package/dist/vascend/mandate.d.ts +33 -0
- package/dist/vascend/mandate.js +107 -0
- package/dist/vascend/memory-packet.d.ts +13 -0
- package/dist/vascend/memory-packet.js +155 -0
- package/dist/vascend/memory-status.d.ts +22 -0
- package/dist/vascend/memory-status.js +73 -0
- package/dist/vascend/memory-store.d.ts +62 -0
- package/dist/vascend/memory-store.js +273 -0
- package/dist/vascend/objective-revision.d.ts +69 -0
- package/dist/vascend/objective-revision.js +319 -0
- package/dist/vascend/patch-plan-store.d.ts +33 -0
- package/dist/vascend/patch-plan-store.js +240 -0
- package/dist/vascend/patch-plan.d.ts +97 -0
- package/dist/vascend/patch-plan.js +345 -0
- package/dist/vascend/plan-progress.d.ts +11 -0
- package/dist/vascend/plan-progress.js +68 -0
- package/dist/vascend/plan-store.d.ts +64 -0
- package/dist/vascend/plan-store.js +460 -0
- package/dist/vascend/proof-chains.d.ts +19 -0
- package/dist/vascend/proof-chains.js +120 -0
- package/dist/vascend/ramification-store.d.ts +25 -0
- package/dist/vascend/ramification-store.js +94 -0
- package/dist/vascend/ramification.d.ts +193 -0
- package/dist/vascend/ramification.js +583 -0
- package/dist/vascend/recall-planner.d.ts +17 -0
- package/dist/vascend/recall-planner.js +109 -0
- package/dist/vascend/requirements.d.ts +31 -0
- package/dist/vascend/requirements.js +151 -0
- package/dist/vascend/reviewer.d.ts +9 -0
- package/dist/vascend/reviewer.js +93 -0
- package/dist/vascend/room-graph.d.ts +29 -0
- package/dist/vascend/room-graph.js +242 -0
- package/dist/vascend/room-memory.d.ts +57 -0
- package/dist/vascend/room-memory.js +631 -0
- package/dist/vascend/runtime.d.ts +84 -0
- package/dist/vascend/runtime.js +286 -0
- package/dist/vascend/self-improve.d.ts +104 -0
- package/dist/vascend/self-improve.js +396 -0
- package/dist/vascend/session-search.d.ts +52 -0
- package/dist/vascend/session-search.js +349 -0
- package/dist/vascend/supersession-graph.d.ts +14 -0
- package/dist/vascend/supersession-graph.js +70 -0
- package/dist/vascend/team-areas.d.ts +9 -0
- package/dist/vascend/team-areas.js +28 -0
- package/dist/vascend/team-handoff.d.ts +24 -0
- package/dist/vascend/team-handoff.js +37 -0
- package/dist/vascend/team-scheduler.d.ts +13 -0
- package/dist/vascend/team-scheduler.js +74 -0
- package/dist/vascend/team-session.d.ts +42 -0
- package/dist/vascend/team-session.js +142 -0
- package/dist/vascend/test-failure-memory.d.ts +76 -0
- package/dist/vascend/test-failure-memory.js +354 -0
- package/dist/vascend/token-market.d.ts +42 -0
- package/dist/vascend/token-market.js +144 -0
- package/dist/vascend/tuner-baseline-store.d.ts +52 -0
- package/dist/vascend/tuner-baseline-store.js +446 -0
- package/dist/vascend/user-profile.d.ts +44 -0
- package/dist/vascend/user-profile.js +131 -0
- package/dist/vascend/vision.d.ts +94 -0
- package/dist/vascend/vision.js +375 -0
- package/dist/vascend/work-agent.d.ts +12 -0
- package/dist/vascend/work-agent.js +83 -0
- package/dist/vascend/work-queue.d.ts +62 -0
- package/dist/vascend/work-queue.js +255 -0
- package/dist/vascend/work-runner.d.ts +64 -0
- package/dist/vascend/work-runner.js +137 -0
- package/dist/vascend/worktree.d.ts +38 -0
- package/dist/vascend/worktree.js +206 -0
- package/dist/vendor/computer-use/README.md +7 -0
- package/dist/vendor/computer-use/computer-desktop.js +211 -0
- package/dist/vendor/computer-use/computer-observe.js +315 -0
- package/dist/vendor/computer-use/computer-scripts.js +1230 -0
- package/dist/vendor/computer-use/computer-tools.js +2136 -0
- package/dist/vendor/computer-use/package.json +1 -0
- package/dist/vendor/computer-use/rac/atomic-input.js +91 -0
- package/dist/vendor/computer-use/rac/grammatica.js +101 -0
- package/dist/vendor/computer-use/rac/parser.js +185 -0
- package/dist/vendor/computer-use/rac/protocol.js +136 -0
- package/install.ps1 +30 -0
- package/install.sh +50 -0
- package/package.json +56 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// Catalogo dei provider noti. Ogni voce dice come costruire il provider dalla
|
|
2
|
+
// chiave d'ambiente. 'anthropic' usa il provider nativo; tutti gli altri sono
|
|
3
|
+
// API in stile OpenAI (cambiano solo baseUrl + chiave).
|
|
4
|
+
//
|
|
5
|
+
// I `models` sono SUGGERIMENTI per /models e l'autocompletamento: l'utente puo'
|
|
6
|
+
// sempre indicare qualsiasi id con `provider/<id>`.
|
|
7
|
+
// Cataloghi condivisi tra API key, OAuth e UI. I modelli correnti restano in
|
|
8
|
+
// testa alla lista; i precedenti restano selezionabili per sessioni salvate e
|
|
9
|
+
// compatibilita' con account che non hanno ancora il rollout piu' recente.
|
|
10
|
+
export const ANTHROPIC_MODELS = [
|
|
11
|
+
"claude-fable-5-1",
|
|
12
|
+
"claude-fable-5",
|
|
13
|
+
"claude-opus-5",
|
|
14
|
+
"claude-sonnet-5",
|
|
15
|
+
"claude-haiku-4-5-20251001",
|
|
16
|
+
"claude-opus-4-8",
|
|
17
|
+
"claude-sonnet-4-6",
|
|
18
|
+
];
|
|
19
|
+
export const OPENAI_MODELS = [
|
|
20
|
+
"gpt-5.6-sol",
|
|
21
|
+
"gpt-5.6-terra",
|
|
22
|
+
"gpt-5.6-luna",
|
|
23
|
+
"gpt-4o",
|
|
24
|
+
"gpt-4o-mini",
|
|
25
|
+
"o3",
|
|
26
|
+
"o4-mini",
|
|
27
|
+
];
|
|
28
|
+
// Il provider ChatGPT usa il login Codex e un endpoint sperimentale distinto
|
|
29
|
+
// dall'API a consumo: conserva quindi anche i vecchi id dell'abbonamento.
|
|
30
|
+
export const CHATGPT_MODELS = [
|
|
31
|
+
"gpt-5.6-sol",
|
|
32
|
+
"gpt-5.6-terra",
|
|
33
|
+
"gpt-5.6-luna",
|
|
34
|
+
"gpt-6-astra",
|
|
35
|
+
"gpt-5-codex",
|
|
36
|
+
"gpt-5",
|
|
37
|
+
"gpt-5-mini",
|
|
38
|
+
"o4-mini",
|
|
39
|
+
];
|
|
40
|
+
export const PROVIDER_CATALOG = [
|
|
41
|
+
{
|
|
42
|
+
id: "anthropic",
|
|
43
|
+
label: "Anthropic",
|
|
44
|
+
kind: "anthropic",
|
|
45
|
+
envKey: "ANTHROPIC_API_KEY",
|
|
46
|
+
models: ANTHROPIC_MODELS,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "openai",
|
|
50
|
+
label: "OpenAI",
|
|
51
|
+
kind: "openai",
|
|
52
|
+
envKey: "OPENAI_API_KEY",
|
|
53
|
+
baseUrl: "https://api.openai.com/v1",
|
|
54
|
+
models: OPENAI_MODELS,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "openrouter",
|
|
58
|
+
label: "OpenRouter",
|
|
59
|
+
kind: "openai",
|
|
60
|
+
envKey: "OPENROUTER_API_KEY",
|
|
61
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
62
|
+
models: [
|
|
63
|
+
"openrouter/fusion",
|
|
64
|
+
"anthropic/claude-sonnet-4-6",
|
|
65
|
+
"openai/gpt-4o",
|
|
66
|
+
"google/gemini-2.5-flash",
|
|
67
|
+
"meta-llama/llama-3.3-70b-instruct",
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "mistral",
|
|
72
|
+
label: "Mistral",
|
|
73
|
+
kind: "openai",
|
|
74
|
+
envKey: "MISTRAL_API_KEY",
|
|
75
|
+
baseUrl: "https://api.mistral.ai/v1",
|
|
76
|
+
models: ["mistral-large-latest", "mistral-small-latest"],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "deepseek",
|
|
80
|
+
label: "DeepSeek",
|
|
81
|
+
kind: "openai",
|
|
82
|
+
envKey: "DEEPSEEK_API_KEY",
|
|
83
|
+
baseUrl: "https://api.deepseek.com/v1",
|
|
84
|
+
models: ["deepseek-chat", "deepseek-reasoner"],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "xai",
|
|
88
|
+
label: "Grok",
|
|
89
|
+
kind: "openai",
|
|
90
|
+
envKey: "XAI_API_KEY",
|
|
91
|
+
baseUrl: "https://api.x.ai/v1",
|
|
92
|
+
models: ["grok-4.5", "grok-4.20-reasoning", "grok-latest"],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "together",
|
|
96
|
+
label: "Together",
|
|
97
|
+
kind: "openai",
|
|
98
|
+
envKey: "TOGETHER_API_KEY",
|
|
99
|
+
baseUrl: "https://api.together.xyz/v1",
|
|
100
|
+
models: ["meta-llama/Llama-3.3-70B-Instruct-Turbo"],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "minimax",
|
|
104
|
+
label: "MiniMax",
|
|
105
|
+
kind: "openai",
|
|
106
|
+
envKey: "MINIMAX_API_KEY",
|
|
107
|
+
baseUrl: "https://api.minimax.io/v1",
|
|
108
|
+
models: ["MiniMax-M3"],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "nvidia",
|
|
112
|
+
label: "NVIDIA NIM",
|
|
113
|
+
kind: "openai",
|
|
114
|
+
envKey: "NVIDIA_API_KEY",
|
|
115
|
+
baseUrl: "https://integrate.api.nvidia.com/v1",
|
|
116
|
+
models: ["meta/llama-3.3-70b-instruct", "deepseek-ai/deepseek-r1"],
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "antling",
|
|
120
|
+
label: "Ant Ling",
|
|
121
|
+
kind: "openai",
|
|
122
|
+
envKey: "ANT_LING_API_KEY",
|
|
123
|
+
baseUrl: "https://antchat.antgroup.com/v1",
|
|
124
|
+
models: ["Ling-1.5", "Ring-1.5"],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: "google",
|
|
128
|
+
label: "Google Gemini",
|
|
129
|
+
kind: "openai",
|
|
130
|
+
envKey: "GEMINI_API_KEY",
|
|
131
|
+
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
132
|
+
models: ["gemini-2.5-pro", "gemini-2.5-flash"],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: "opensource",
|
|
136
|
+
label: "Open source (OpenAI-compatible)",
|
|
137
|
+
kind: "openai",
|
|
138
|
+
envKey: "",
|
|
139
|
+
baseUrlEnv: "OPEN_SOURCE_HOST",
|
|
140
|
+
defaultBaseUrl: "",
|
|
141
|
+
optionalEndpoint: true,
|
|
142
|
+
// Unsloth/vLLM/llama.cpp/Transformers server sono interrogati via
|
|
143
|
+
// /v1/models: nessun id Hugging Face viene duplicato nel catalogo.
|
|
144
|
+
models: [],
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: "lmstudio",
|
|
148
|
+
label: "LM Studio (locale)",
|
|
149
|
+
kind: "openai",
|
|
150
|
+
envKey: "", // server OpenAI-compatible locale, senza chiave
|
|
151
|
+
baseUrlEnv: "LMSTUDIO_HOST",
|
|
152
|
+
defaultBaseUrl: "http://127.0.0.1:1234/v1",
|
|
153
|
+
// I modelli non sono suggerimenti statici: Terminal interroga /v1/models
|
|
154
|
+
// e mostra esclusivamente quelli realmente caricati in LM Studio.
|
|
155
|
+
models: [],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: "ollama",
|
|
159
|
+
label: "Ollama (locale)",
|
|
160
|
+
kind: "openai",
|
|
161
|
+
envKey: "", // nessuna chiave: e' locale
|
|
162
|
+
baseUrlEnv: "OLLAMA_HOST",
|
|
163
|
+
defaultBaseUrl: "http://localhost:11434/v1",
|
|
164
|
+
models: ["llama3.1", "qwen2.5-coder"],
|
|
165
|
+
},
|
|
166
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type EffortLevel = "" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
2
|
+
export declare function openaiReasoningEffort(effort: string | undefined, env: NodeJS.ProcessEnv): string | null;
|
|
3
|
+
export declare function responsesReasoningEffort(model: string, effort: string | undefined, env: NodeJS.ProcessEnv): string | null;
|
|
4
|
+
export declare function geminiReasoningEffort(effort: string | undefined): string | null;
|
|
5
|
+
export declare function openrouterReasoning(effort: string | undefined): {
|
|
6
|
+
effort: string;
|
|
7
|
+
} | null;
|
|
8
|
+
export declare function anthropicEffort(effort: string | undefined, model?: string): Record<string, unknown> | null;
|
|
9
|
+
export declare function compatReasoningField(baseUrl: string, effort: string | undefined, env: NodeJS.ProcessEnv, model?: string): {
|
|
10
|
+
key: string;
|
|
11
|
+
value: unknown;
|
|
12
|
+
} | null;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Mappatura del livello di effort (low/medium/high/max) verso il parametro
|
|
2
|
+
// nativo di reasoning di ciascuna famiglia di provider. Verificato sui doc dei
|
|
3
|
+
// provider (giugno 2026). Conservativo: per i provider che NON espongono un
|
|
4
|
+
// parametro standard si invia NULLA, per evitare 400 da campi sconosciuti.
|
|
5
|
+
import { modelCapabilities } from "./models-dev.js";
|
|
6
|
+
import { modelEfforts } from "./model-effort.js";
|
|
7
|
+
function norm(effort) {
|
|
8
|
+
const e = (effort ?? "").trim().toLowerCase();
|
|
9
|
+
return e === "none" || e === "minimal" || e === "low" || e === "medium" || e === "high" || e === "xhigh" || e === "max" ? e : "";
|
|
10
|
+
}
|
|
11
|
+
function nativeEffort(model, effort, env) {
|
|
12
|
+
const metadata = modelCapabilities(model, env);
|
|
13
|
+
if (!metadata)
|
|
14
|
+
return undefined;
|
|
15
|
+
const e = norm(effort);
|
|
16
|
+
return modelEfforts(model, metadata).includes(e) ? e || null : null;
|
|
17
|
+
}
|
|
18
|
+
// OpenAI Chat Completions: reasoning_effort top-level. "xhigh" esiste solo sui
|
|
19
|
+
// modelli piu' recenti -> "max" viene mappato a "high" per sicurezza, salvo
|
|
20
|
+
// override esplicito via TALOS_OPENAI_MAX_EFFORT=xhigh.
|
|
21
|
+
export function openaiReasoningEffort(effort, env) {
|
|
22
|
+
const e = norm(effort);
|
|
23
|
+
if (!e)
|
|
24
|
+
return null;
|
|
25
|
+
if (e === "max")
|
|
26
|
+
return /^xhigh$/i.test(env["TALOS_OPENAI_MAX_EFFORT"] ?? "") ? "xhigh" : "high";
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
// Responses espone `max` nativo su Astra; gli altri modelli conservano la
|
|
30
|
+
// mappatura esistente. Il livello scelto deve raggiungere anche il canale OAuth.
|
|
31
|
+
export function responsesReasoningEffort(model, effort, env) {
|
|
32
|
+
const native = nativeEffort(`openai/${model}`, effort, env);
|
|
33
|
+
if (native !== undefined)
|
|
34
|
+
return native;
|
|
35
|
+
if (/(?:^|\/)gpt-6-astra(?:$|-)/i.test(model))
|
|
36
|
+
return norm(effort) || null;
|
|
37
|
+
return openaiReasoningEffort(effort, env);
|
|
38
|
+
}
|
|
39
|
+
// Gemini via endpoint OpenAI-compat: reasoning_effort accetta solo low/med/high
|
|
40
|
+
// ("max" non e' valido -> high).
|
|
41
|
+
export function geminiReasoningEffort(effort) {
|
|
42
|
+
const e = norm(effort);
|
|
43
|
+
if (!e)
|
|
44
|
+
return null;
|
|
45
|
+
return e === "max" || e === "xhigh" ? "high" : e;
|
|
46
|
+
}
|
|
47
|
+
// OpenRouter: oggetto reasoning:{effort}. Accetta xhigh; "max" -> "high" per
|
|
48
|
+
// sicurezza cross-modello (alcuni backend non hanno xhigh).
|
|
49
|
+
export function openrouterReasoning(effort) {
|
|
50
|
+
const e = norm(effort);
|
|
51
|
+
if (!e)
|
|
52
|
+
return null;
|
|
53
|
+
return { effort: e === "max" ? "high" : e };
|
|
54
|
+
}
|
|
55
|
+
// Anthropic Messages (Opus 4.8 / Sonnet 4.x): adaptive thinking + output_config
|
|
56
|
+
// effort. NB: su Opus 4.8 budget_tokens da' 400 -> mai inviarlo. Ritorna i campi
|
|
57
|
+
// da fondere nel body, o null se effort non impostato.
|
|
58
|
+
export function anthropicEffort(effort, model) {
|
|
59
|
+
const native = model ? nativeEffort(`anthropic/${model}`, effort, process.env) : undefined;
|
|
60
|
+
const e = native === undefined ? norm(effort) : native;
|
|
61
|
+
if (!e)
|
|
62
|
+
return null;
|
|
63
|
+
if (model && !modelEfforts(`anthropic/${model}`).includes(e))
|
|
64
|
+
return null;
|
|
65
|
+
return { output_config: { effort: native !== undefined || (model && /claude-(?:fable|opus)-5/.test(model)) ? e : e === "xhigh" ? "high" : e }, thinking: { type: "adaptive" } };
|
|
66
|
+
}
|
|
67
|
+
// Provider OpenAI-compat che supportano reasoning_effort top-level (allowlist).
|
|
68
|
+
// baseUrl-based: openai, gemini-compat, together. Gli altri (mistral/xai/
|
|
69
|
+
// deepseek/ollama) ricevono NULLA.
|
|
70
|
+
export function compatReasoningField(baseUrl, effort, env, model) {
|
|
71
|
+
if (!norm(effort))
|
|
72
|
+
return null;
|
|
73
|
+
const provider = /openrouter\.ai/i.test(baseUrl) ? "openrouter" : /generativelanguage\.googleapis\.com/i.test(baseUrl) ? "google"
|
|
74
|
+
: /api\.openai\.com/i.test(baseUrl) ? "openai" : /api\.together\.xyz/i.test(baseUrl) ? "togetherai" : undefined;
|
|
75
|
+
const native = provider && model ? nativeEffort(`${provider}/${model}`, effort, env) : undefined;
|
|
76
|
+
if (native !== undefined)
|
|
77
|
+
return native ? { key: provider === "openrouter" ? "reasoning" : "reasoning_effort", value: provider === "openrouter" ? { effort: native } : native } : null;
|
|
78
|
+
if (provider && model) {
|
|
79
|
+
const levels = modelEfforts(`${provider}/${model}`);
|
|
80
|
+
if (levels.length > 1 && levels.includes(norm(effort)))
|
|
81
|
+
return { key: provider === "openrouter" ? "reasoning" : "reasoning_effort", value: provider === "openrouter" ? { effort: norm(effort) } : norm(effort) };
|
|
82
|
+
if (provider === "openai" && /^gpt-4/.test(model))
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
if (/openrouter\.ai/i.test(baseUrl)) {
|
|
86
|
+
const r = openrouterReasoning(effort);
|
|
87
|
+
return r ? { key: "reasoning", value: r } : null;
|
|
88
|
+
}
|
|
89
|
+
if (/generativelanguage\.googleapis\.com/i.test(baseUrl)) {
|
|
90
|
+
const v = geminiReasoningEffort(effort);
|
|
91
|
+
return v ? { key: "reasoning_effort", value: v } : null;
|
|
92
|
+
}
|
|
93
|
+
if (/api\.openai\.com/i.test(baseUrl)) {
|
|
94
|
+
const v = openaiReasoningEffort(effort, env);
|
|
95
|
+
return v ? { key: "reasoning_effort", value: v } : null;
|
|
96
|
+
}
|
|
97
|
+
if (/api\.together\.xyz/i.test(baseUrl)) {
|
|
98
|
+
const e = norm(effort);
|
|
99
|
+
return { key: "reasoning_effort", value: e };
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type ReasoningOption = {
|
|
2
|
+
readonly type: "effort";
|
|
3
|
+
readonly values: readonly string[];
|
|
4
|
+
} | {
|
|
5
|
+
readonly type: "toggle";
|
|
6
|
+
} | {
|
|
7
|
+
readonly type: "budget_tokens";
|
|
8
|
+
readonly min?: number;
|
|
9
|
+
readonly max?: number;
|
|
10
|
+
};
|
|
11
|
+
export interface CatalogModel {
|
|
12
|
+
readonly provider: string;
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description?: string;
|
|
16
|
+
readonly family?: string;
|
|
17
|
+
readonly reasoning?: boolean;
|
|
18
|
+
readonly reasoningOptions?: readonly ReasoningOption[];
|
|
19
|
+
readonly toolCall?: boolean;
|
|
20
|
+
readonly structuredOutput?: boolean;
|
|
21
|
+
readonly temperature?: boolean;
|
|
22
|
+
readonly attachment?: boolean;
|
|
23
|
+
readonly openWeights?: boolean;
|
|
24
|
+
readonly inputModalities: readonly string[];
|
|
25
|
+
readonly outputModalities: readonly string[];
|
|
26
|
+
readonly context?: number;
|
|
27
|
+
readonly inputLimit?: number;
|
|
28
|
+
readonly outputLimit?: number;
|
|
29
|
+
readonly cost: Readonly<Record<string, number>>;
|
|
30
|
+
readonly releaseDate?: string;
|
|
31
|
+
readonly updatedAt?: string;
|
|
32
|
+
readonly knowledge?: string;
|
|
33
|
+
readonly status?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function catalogProvider(provider: string): string;
|
|
36
|
+
export declare class ModelCatalog {
|
|
37
|
+
readonly models: readonly CatalogModel[];
|
|
38
|
+
private readonly byId;
|
|
39
|
+
constructor(models?: readonly CatalogModel[]);
|
|
40
|
+
get(fullModel: string): CatalogModel | undefined;
|
|
41
|
+
list(provider: string): readonly CatalogModel[];
|
|
42
|
+
}
|
|
43
|
+
export declare function parseModelCatalog(payload: unknown): ModelCatalog;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
function record(value) {
|
|
2
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
3
|
+
}
|
|
4
|
+
function str(value) {
|
|
5
|
+
return typeof value === "string" ? value.replace(/[\x00-\x1f\x7f-\x9f]/g, " ").slice(0, 4000) : undefined;
|
|
6
|
+
}
|
|
7
|
+
function num(value) {
|
|
8
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : undefined;
|
|
9
|
+
}
|
|
10
|
+
function bool(value) { return typeof value === "boolean" ? value : undefined; }
|
|
11
|
+
function strings(value) {
|
|
12
|
+
return Array.isArray(value) ? value.flatMap(v => typeof v === "string" ? [str(v)] : []) : [];
|
|
13
|
+
}
|
|
14
|
+
export function catalogProvider(provider) {
|
|
15
|
+
return { "claude-code": "anthropic", chatgpt: "openai", gemini: "google", together: "togetherai" }[provider] ?? provider;
|
|
16
|
+
}
|
|
17
|
+
export class ModelCatalog {
|
|
18
|
+
models;
|
|
19
|
+
byId;
|
|
20
|
+
constructor(models = []) {
|
|
21
|
+
this.models = models;
|
|
22
|
+
this.byId = new Map(models.map(m => [`${m.provider}/${m.id}`, m]));
|
|
23
|
+
}
|
|
24
|
+
get(fullModel) {
|
|
25
|
+
const slash = fullModel.indexOf("/");
|
|
26
|
+
if (slash < 0)
|
|
27
|
+
return undefined; // Never borrow limits/prices from a different provider.
|
|
28
|
+
return this.byId.get(`${catalogProvider(fullModel.slice(0, slash))}/${fullModel.slice(slash + 1)}`);
|
|
29
|
+
}
|
|
30
|
+
list(provider) {
|
|
31
|
+
const id = catalogProvider(provider);
|
|
32
|
+
return this.models.filter(m => m.provider === id);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export function parseModelCatalog(payload) {
|
|
36
|
+
const out = [];
|
|
37
|
+
for (const [provider, rawProvider] of Object.entries(record(payload))) {
|
|
38
|
+
if (!/^[a-zA-Z0-9_.-]+$/.test(provider))
|
|
39
|
+
continue;
|
|
40
|
+
for (const [id, raw] of Object.entries(record(record(rawProvider)["models"]))) {
|
|
41
|
+
if (!id || id.length > 256 || /[\s\x00-\x1f\x7f-\x9f]/.test(id))
|
|
42
|
+
continue;
|
|
43
|
+
const m = record(raw);
|
|
44
|
+
if (!Object.keys(m).length)
|
|
45
|
+
continue;
|
|
46
|
+
const limit = record(m["limit"]), modalities = record(m["modalities"]);
|
|
47
|
+
const options = [];
|
|
48
|
+
if (Array.isArray(m["reasoning_options"]))
|
|
49
|
+
for (const rawOption of m["reasoning_options"]) {
|
|
50
|
+
const option = record(rawOption);
|
|
51
|
+
if (option["type"] === "effort")
|
|
52
|
+
options.push({ type: "effort", values: strings(option["values"]) });
|
|
53
|
+
if (option["type"] === "toggle")
|
|
54
|
+
options.push({ type: "toggle" });
|
|
55
|
+
if (option["type"] === "budget_tokens")
|
|
56
|
+
options.push({ type: "budget_tokens", min: num(option["min"]), max: num(option["max"]) });
|
|
57
|
+
}
|
|
58
|
+
out.push({ provider, id, name: str(m["name"]) ?? id,
|
|
59
|
+
description: str(m["description"]), family: str(m["family"]),
|
|
60
|
+
reasoning: bool(m["reasoning"]), reasoningOptions: Array.isArray(m["reasoning_options"]) ? options : undefined,
|
|
61
|
+
toolCall: bool(m["tool_call"]), structuredOutput: bool(m["structured_output"]),
|
|
62
|
+
temperature: bool(m["temperature"]), attachment: bool(m["attachment"]), openWeights: bool(m["open_weights"]),
|
|
63
|
+
inputModalities: strings(modalities["input"]), outputModalities: strings(modalities["output"]),
|
|
64
|
+
context: num(limit["context"]), inputLimit: num(limit["input"]), outputLimit: num(limit["output"]),
|
|
65
|
+
cost: Object.fromEntries(Object.entries(record(m["cost"])).flatMap(([k, v]) => num(v) === undefined ? [] : [[k, num(v)]])),
|
|
66
|
+
releaseDate: str(m["release_date"]), updatedAt: str(m["last_updated"]), knowledge: str(m["knowledge"]), status: str(m["status"]), });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return new ModelCatalog(out);
|
|
70
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CatalogModel } from "./model-catalog.js";
|
|
2
|
+
export declare const EFFORT_LEVELS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
3
|
+
export type ModelEffort = "" | typeof EFFORT_LEVELS[number];
|
|
4
|
+
export declare function modelEfforts(fullModel: string, metadata?: CatalogModel | undefined): readonly ModelEffort[];
|
|
5
|
+
export declare function supportedModelEffort(fullModel: string, effort: string | undefined): ModelEffort;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { modelCapabilities } from "./models-dev.js";
|
|
2
|
+
import { catalogProvider } from "./model-catalog.js";
|
|
3
|
+
export const EFFORT_LEVELS = ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
4
|
+
// Only expose controls the Talos adapter can transmit. A reasoning=true flag
|
|
5
|
+
// alone is not proof that a provider supports an adjustable effort parameter.
|
|
6
|
+
export function modelEfforts(fullModel, metadata = modelCapabilities(fullModel)) {
|
|
7
|
+
const slash = fullModel.indexOf("/"), provider = catalogProvider(fullModel.slice(0, slash));
|
|
8
|
+
const id = fullModel.slice(slash + 1);
|
|
9
|
+
if (slash < 0 || !["anthropic", "openai", "google", "openrouter", "togetherai"].includes(provider))
|
|
10
|
+
return [""];
|
|
11
|
+
if (metadata?.reasoning === false)
|
|
12
|
+
return [""];
|
|
13
|
+
if (metadata?.reasoningOptions !== undefined) {
|
|
14
|
+
const declared = metadata.reasoningOptions.flatMap(o => o.type === "effort" ? o.values : []);
|
|
15
|
+
return ["", ...EFFORT_LEVELS.filter(e => declared.includes(e) &&
|
|
16
|
+
(provider !== "anthropic" || !["none", "minimal"].includes(e)) &&
|
|
17
|
+
(provider !== "google" || ["minimal", "low", "medium", "high"].includes(e)))];
|
|
18
|
+
}
|
|
19
|
+
// Conservative offline fallback for models already supported by Talos.
|
|
20
|
+
if (provider === "anthropic") {
|
|
21
|
+
if (/claude-fable-5|claude-opus-5/.test(id))
|
|
22
|
+
return ["", "low", "medium", "high", "xhigh", "max"];
|
|
23
|
+
if (/claude-opus-4-[678]/.test(id))
|
|
24
|
+
return ["", "low", "medium", "high", "max"];
|
|
25
|
+
if (/claude-sonnet-(?:4-6|5)/.test(id))
|
|
26
|
+
return ["", "low", "medium", "high"];
|
|
27
|
+
}
|
|
28
|
+
if (provider === "openai") {
|
|
29
|
+
if (/gpt-6-astra/.test(id))
|
|
30
|
+
return ["", "low", "medium", "high", "xhigh", "max"];
|
|
31
|
+
if (/gpt-5\.[456]/.test(id))
|
|
32
|
+
return ["", "low", "medium", "high", "xhigh"];
|
|
33
|
+
if (/gpt-5|^o[134](?:-|$)/.test(id))
|
|
34
|
+
return ["", "low", "medium", "high"];
|
|
35
|
+
}
|
|
36
|
+
if (provider === "google" && /gemini-3/.test(id))
|
|
37
|
+
return ["", "low", "high"];
|
|
38
|
+
return [""];
|
|
39
|
+
}
|
|
40
|
+
// A stale saved effort must not make a different model reject every request.
|
|
41
|
+
export function supportedModelEffort(fullModel, effort) {
|
|
42
|
+
return modelEfforts(fullModel).find(e => e === effort) ?? "";
|
|
43
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type OpenRouterModel } from "./openrouter.js";
|
|
2
|
+
export interface ModelInfo {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly name?: string;
|
|
5
|
+
readonly contextLength?: number;
|
|
6
|
+
readonly inputPricePerM?: number;
|
|
7
|
+
readonly outputPricePerM?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface CostEstimate {
|
|
10
|
+
readonly inputCost: number;
|
|
11
|
+
readonly outputCost: number;
|
|
12
|
+
readonly totalCost: number;
|
|
13
|
+
readonly known: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function toModelInfo(m: OpenRouterModel): ModelInfo;
|
|
16
|
+
export declare class ModelRegistry {
|
|
17
|
+
private readonly legacyOpenRouterAlias;
|
|
18
|
+
private readonly byId;
|
|
19
|
+
private readonly ordered;
|
|
20
|
+
constructor(models?: readonly ModelInfo[], legacyOpenRouterAlias?: boolean);
|
|
21
|
+
get size(): number;
|
|
22
|
+
isEmpty(): boolean;
|
|
23
|
+
get(id: string): ModelInfo | undefined;
|
|
24
|
+
has(id: string): boolean;
|
|
25
|
+
list(): readonly ModelInfo[];
|
|
26
|
+
ids(): readonly string[];
|
|
27
|
+
search(query: string): readonly ModelInfo[];
|
|
28
|
+
pricing(id: string): {
|
|
29
|
+
readonly input?: number;
|
|
30
|
+
readonly output?: number;
|
|
31
|
+
} | undefined;
|
|
32
|
+
estimateCost(id: string, inputTokens: number, outputTokens: number): CostEstimate;
|
|
33
|
+
}
|
|
34
|
+
export declare function loadModelRegistry(env?: NodeJS.ProcessEnv, opts?: {
|
|
35
|
+
readonly force?: boolean;
|
|
36
|
+
readonly timeoutMs?: number;
|
|
37
|
+
}): Promise<ModelRegistry>;
|
|
38
|
+
export declare function modelRegistryFrom(models: readonly OpenRouterModel[]): ModelRegistry;
|
|
39
|
+
export declare function _resetModelRegistry(): void;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { loadModelsDev } from "./models-dev.js";
|
|
2
|
+
// Registro dei modelli OpenRouter. Recupera l'elenco dei modelli disponibili con
|
|
3
|
+
// i relativi metadati di pricing (costo per token input/output) e li espone via
|
|
4
|
+
// un'API interna stabile: lookup per id, elenco, ricerca e stima del costo di
|
|
5
|
+
// una chiamata. Si appoggia al fetch gia' presente in openrouter.ts (endpoint
|
|
6
|
+
// pubblico /models) e ne normalizza i dati in `ModelInfo`.
|
|
7
|
+
import { fetchOpenRouterModels, } from "./openrouter.js";
|
|
8
|
+
// Converte un modello "grezzo" OpenRouter nel formato interno del registro.
|
|
9
|
+
export function toModelInfo(m) {
|
|
10
|
+
return {
|
|
11
|
+
id: m.id,
|
|
12
|
+
name: m.name,
|
|
13
|
+
contextLength: m.contextLength,
|
|
14
|
+
inputPricePerM: m.promptPrice,
|
|
15
|
+
outputPricePerM: m.completionPrice,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
// Calcola il costo (USD) dati i token e il prezzo per 1M.
|
|
19
|
+
function costFor(tokens, pricePerM) {
|
|
20
|
+
if (!pricePerM || !Number.isFinite(tokens) || tokens <= 0)
|
|
21
|
+
return 0;
|
|
22
|
+
return (tokens / 1_000_000) * pricePerM;
|
|
23
|
+
}
|
|
24
|
+
// Registro immutabile: si costruisce da un elenco di ModelInfo e offre una vista
|
|
25
|
+
// di sola lettura con indice per id (lookup O(1)).
|
|
26
|
+
export class ModelRegistry {
|
|
27
|
+
legacyOpenRouterAlias;
|
|
28
|
+
byId;
|
|
29
|
+
ordered;
|
|
30
|
+
constructor(models = [], legacyOpenRouterAlias = true) {
|
|
31
|
+
this.legacyOpenRouterAlias = legacyOpenRouterAlias;
|
|
32
|
+
const map = new Map();
|
|
33
|
+
for (const m of models) {
|
|
34
|
+
if (m.id && !map.has(m.id))
|
|
35
|
+
map.set(m.id, m);
|
|
36
|
+
}
|
|
37
|
+
this.ordered = [...map.values()].sort((a, b) => a.id.localeCompare(b.id));
|
|
38
|
+
this.byId = map;
|
|
39
|
+
}
|
|
40
|
+
// Numero di modelli registrati.
|
|
41
|
+
get size() {
|
|
42
|
+
return this.byId.size;
|
|
43
|
+
}
|
|
44
|
+
// Vero se il registro non contiene alcun modello.
|
|
45
|
+
isEmpty() {
|
|
46
|
+
return this.byId.size === 0;
|
|
47
|
+
}
|
|
48
|
+
// Modello per id esatto (accetta anche il prefisso "openrouter/").
|
|
49
|
+
get(id) {
|
|
50
|
+
if (!id)
|
|
51
|
+
return undefined;
|
|
52
|
+
const direct = this.byId.get(id);
|
|
53
|
+
if (direct)
|
|
54
|
+
return direct;
|
|
55
|
+
const stripped = this.legacyOpenRouterAlias && id.startsWith("openrouter/") ? id.slice("openrouter/".length) : undefined;
|
|
56
|
+
return stripped ? this.byId.get(stripped) : undefined;
|
|
57
|
+
}
|
|
58
|
+
// Vero se il modello e' presente.
|
|
59
|
+
has(id) {
|
|
60
|
+
return this.get(id) !== undefined;
|
|
61
|
+
}
|
|
62
|
+
// Elenco completo, ordinato per id.
|
|
63
|
+
list() {
|
|
64
|
+
return this.ordered;
|
|
65
|
+
}
|
|
66
|
+
// Solo gli id, ordinati.
|
|
67
|
+
ids() {
|
|
68
|
+
return this.ordered.map((m) => m.id);
|
|
69
|
+
}
|
|
70
|
+
// Ricerca per substring case-insensitive su id e nome. Query vuota = tutti.
|
|
71
|
+
search(query) {
|
|
72
|
+
const q = query.trim().toLowerCase();
|
|
73
|
+
if (!q)
|
|
74
|
+
return this.ordered;
|
|
75
|
+
const terms = q.split(/\s+/).filter(Boolean);
|
|
76
|
+
return this.ordered.filter((m) => {
|
|
77
|
+
const hay = `${m.id} ${m.name ?? ""}`.toLowerCase();
|
|
78
|
+
return terms.every((t) => hay.includes(t));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
// Pricing di un modello (input/output per 1M token), se noto.
|
|
82
|
+
pricing(id) {
|
|
83
|
+
const m = this.get(id);
|
|
84
|
+
if (!m)
|
|
85
|
+
return undefined;
|
|
86
|
+
return { input: m.inputPricePerM, output: m.outputPricePerM };
|
|
87
|
+
}
|
|
88
|
+
// Stima il costo in USD di una chiamata con i token di input e output indicati.
|
|
89
|
+
// Se il modello e' sconosciuto o senza pricing, ritorna 0 con `known: false`.
|
|
90
|
+
estimateCost(id, inputTokens, outputTokens) {
|
|
91
|
+
const m = this.get(id);
|
|
92
|
+
const hasPricing = !!m && (m.inputPricePerM !== undefined || m.outputPricePerM !== undefined);
|
|
93
|
+
const inputCost = costFor(inputTokens, m?.inputPricePerM);
|
|
94
|
+
const outputCost = costFor(outputTokens, m?.outputPricePerM);
|
|
95
|
+
return {
|
|
96
|
+
inputCost,
|
|
97
|
+
outputCost,
|
|
98
|
+
totalCost: inputCost + outputCost,
|
|
99
|
+
known: hasPricing,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Cache di sessione del registro: l'elenco modelli cambia di rado.
|
|
104
|
+
let cachedRegistry = null;
|
|
105
|
+
let inflight = null;
|
|
106
|
+
// Recupera la lista modelli OpenRouter e ne costruisce il registro. Fallisce in
|
|
107
|
+
// modo morbido: se il fetch non restituisce nulla, il registro risulta vuoto ma
|
|
108
|
+
// l'API resta utilizzabile. `force` ignora la cache di sessione.
|
|
109
|
+
export async function loadModelRegistry(env = process.env, opts = {}) {
|
|
110
|
+
if (cachedRegistry && !opts.force)
|
|
111
|
+
return cachedRegistry;
|
|
112
|
+
if (inflight && !opts.force)
|
|
113
|
+
return inflight;
|
|
114
|
+
const run = (async () => {
|
|
115
|
+
try {
|
|
116
|
+
const [raw, catalog] = await Promise.all([fetchOpenRouterModels(env, opts), loadModelsDev(env, opts)]);
|
|
117
|
+
const reg = new ModelRegistry([
|
|
118
|
+
...catalog.models.map(m => ({ id: `${m.provider}/${m.id}`, name: m.name, contextLength: m.context,
|
|
119
|
+
inputPricePerM: m.cost["input"], outputPricePerM: m.cost["output"] })),
|
|
120
|
+
...raw.map(m => ({ ...toModelInfo(m), id: `openrouter/${m.id}` })),
|
|
121
|
+
], false);
|
|
122
|
+
if (!reg.isEmpty())
|
|
123
|
+
cachedRegistry = reg;
|
|
124
|
+
return cachedRegistry ?? reg;
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
inflight = null;
|
|
128
|
+
}
|
|
129
|
+
})();
|
|
130
|
+
inflight = run;
|
|
131
|
+
return run;
|
|
132
|
+
}
|
|
133
|
+
// Costruisce un registro direttamente da modelli gia' noti (utile per test e per
|
|
134
|
+
// alimentarlo da un payload gia' scaricato altrove).
|
|
135
|
+
export function modelRegistryFrom(models) {
|
|
136
|
+
return new ModelRegistry(models.map(toModelInfo));
|
|
137
|
+
}
|
|
138
|
+
// Solo per i test: azzera la cache di sessione del registro.
|
|
139
|
+
export function _resetModelRegistry() {
|
|
140
|
+
cachedRegistry = null;
|
|
141
|
+
inflight = null;
|
|
142
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModelCatalog, type CatalogModel } from "./model-catalog.js";
|
|
2
|
+
export declare function cachedModelCatalog(env?: NodeJS.ProcessEnv): ModelCatalog;
|
|
3
|
+
export declare function modelCapabilities(model: string, env?: NodeJS.ProcessEnv): CatalogModel | undefined;
|
|
4
|
+
export declare function loadModelsDev(env?: NodeJS.ProcessEnv, opts?: {
|
|
5
|
+
readonly force?: boolean;
|
|
6
|
+
readonly timeoutMs?: number;
|
|
7
|
+
readonly fetch?: typeof fetch;
|
|
8
|
+
readonly now?: number;
|
|
9
|
+
}): Promise<ModelCatalog>;
|