@fased/fased 0.1.54 → 0.1.56
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/config/capability-catalog.json +12 -0
- package/dist/acp/client.js +2 -2
- package/dist/acp/secret-file.js +2 -2
- package/dist/agents/agent-scope.js +2 -2
- package/dist/agents/apply-patch.js +8 -8
- package/dist/agents/auth-profiles/paths.js +2 -2
- package/dist/agents/auth-profiles/store.js +2 -2
- package/dist/agents/authenticated-model-catalog.js +28 -0
- package/dist/agents/bash-tools.exec-host-node.js +1 -1
- package/dist/agents/bash-tools.exec.js +1 -1
- package/dist/agents/bash-tools.shared.js +2 -2
- package/dist/agents/cli-credentials.js +4 -4
- package/dist/agents/copilot-dynamic-headers.js +37 -0
- package/dist/agents/current-model-catalog.js +9 -13
- package/dist/agents/docs-path.js +3 -3
- package/dist/agents/embedded-pi-mcp.js +4 -4
- package/dist/agents/identity-avatar.js +3 -3
- package/dist/agents/identity-file.js +2 -2
- package/dist/agents/model-catalog-normalized.js +1 -0
- package/dist/agents/model-catalog-source.js +2 -2
- package/dist/agents/model-catalog.js +1 -1
- package/dist/agents/model-metadata.js +58 -9
- package/dist/agents/openai-codex-app-server.js +499 -0
- package/dist/agents/pi-embedded-runner/compact.js +3 -3
- package/dist/agents/pi-embedded-runner/extra-params.js +168 -79
- package/dist/agents/pi-embedded-runner/model.js +62 -1
- package/dist/agents/pi-embedded-runner/moonshot-stream-wrappers.js +46 -0
- package/dist/agents/pi-embedded-runner/openai-stream-wrappers.js +221 -0
- package/dist/agents/pi-embedded-runner/run/attempt.js +6 -4
- package/dist/agents/pi-embedded-runner/run.js +5 -2
- package/dist/agents/pi-embedded-runner/utils.js +1 -1
- package/dist/agents/pi-embedded-runner.js +1 -1
- package/dist/agents/pi-embedded-subscribe.raw-stream.js +3 -3
- package/dist/agents/pi-extensions/compaction-safeguard.js +3 -3
- package/dist/agents/pi-model-discovery.js +6 -6
- package/dist/agents/pi-project-settings.js +3 -3
- package/dist/agents/pi-tools.js +2 -2
- package/dist/agents/sandbox/fs-bridge.js +2 -2
- package/dist/agents/session-dirs.js +4 -4
- package/dist/agents/session-write-lock.js +13 -13
- package/dist/agents/shell-utils.js +5 -5
- package/dist/agents/skills/bundled-dir.js +4 -4
- package/dist/agents/skills/local-loader.js +6 -6
- package/dist/agents/skills/plugin-skills.js +2 -2
- package/dist/agents/skills/workspace.js +13 -13
- package/dist/agents/skills-install-download.js +7 -7
- package/dist/agents/skills-install-plan.js +2 -2
- package/dist/agents/skills-install.js +2 -2
- package/dist/agents/skills-status.js +2 -2
- package/dist/agents/subagent-depth.js +2 -2
- package/dist/agents/system-prompt-params.js +2 -2
- package/dist/agents/tools/discord-actions-messaging.js +1 -1
- package/dist/agents/tools/message-tool.js +1 -1
- package/dist/agents/tools/session-status-tool.js +3 -3
- package/dist/agents/tools/slack-actions.js +1 -1
- package/dist/agents/tools/tts-tool.js +1 -1
- package/dist/agents/workspace.js +22 -22
- package/dist/auto-reply/reply/agent-runner-execution.js +2 -2
- package/dist/auto-reply/reply/agent-runner.js +2 -2
- package/dist/auto-reply/reply/commands-export-session.js +7 -7
- package/dist/auto-reply/reply/commands-models.js +1 -1
- package/dist/auto-reply/reply/directive-handling.impl.js +4 -1
- package/dist/auto-reply/reply/dispatch-acp.js +1 -1
- package/dist/auto-reply/reply/dispatch-from-config.js +1 -1
- package/dist/auto-reply/reply/get-reply-run.js +20 -2
- package/dist/auto-reply/reply/model-selection.js +1 -1
- package/dist/auto-reply/reply/post-compaction-audit.js +3 -3
- package/dist/auto-reply/reply/post-compaction-context.js +3 -3
- package/dist/auto-reply/reply/session-reset-model.js +1 -1
- package/dist/auto-reply/reply/session.js +3 -3
- package/dist/auto-reply/skill-commands.js +3 -3
- package/dist/auto-reply/status.js +7 -7
- package/dist/auto-reply/thinking.js +1 -1
- package/dist/brand.js +1 -1
- package/dist/browser/cdp.helpers.js +2 -2
- package/dist/browser/chrome.executables.js +3 -3
- package/dist/browser/chrome.js +5 -5
- package/dist/browser/chrome.profile-decoration.js +6 -6
- package/dist/browser/extension-relay.js +7 -7
- package/dist/browser/profiles-service.js +2 -2
- package/dist/browser/server-context.js +2 -2
- package/dist/browser/trash.js +4 -4
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/canvas-host/server.js +4 -4
- package/dist/capabilities/catalog.js +3 -3
- package/dist/channels/plugins/catalog.js +3 -3
- package/dist/cli/browser-cli-extension.js +6 -6
- package/dist/cli/command-format.js +2 -2
- package/dist/cli/cron-cli/register.cron-add.js +1 -1
- package/dist/cli/cron-cli/register.cron-simple.js +2 -2
- package/dist/cli/dns-cli.js +9 -9
- package/dist/cli/gateway-cli/dev.js +5 -5
- package/dist/cli/gateway-cli/run.js +2 -2
- package/dist/cli/hooks-cli.js +5 -5
- package/dist/cli/lightweight/gateway-runtime-probe.js +2 -2
- package/dist/cli/memory-cli.js +7 -7
- package/dist/cli/nodes-media-utils.js +2 -2
- package/dist/cli/plugins-cli.js +2 -2
- package/dist/cli/program/register.agent.js +1 -1
- package/dist/cli/providers-cli.js +3 -2
- package/dist/cli/secrets-cli.js +3 -3
- package/dist/cli/windows-argv.js +2 -2
- package/dist/commands/agent.js +22 -3
- package/dist/commands/auth-choice.apply.api-providers.js +3 -8
- package/dist/commands/auth-choice.apply.openai.js +13 -7
- package/dist/commands/auth-choice.model-check.js +1 -2
- package/dist/commands/configure.gateway-auth.js +14 -16
- package/dist/commands/dashboard-link.js +3 -3
- package/dist/commands/doctor-config-flow.js +1 -1
- package/dist/commands/doctor-install.js +5 -5
- package/dist/commands/doctor-memory-search.js +2 -2
- package/dist/commands/doctor-platform-notes.js +2 -2
- package/dist/commands/doctor-sandbox.js +2 -2
- package/dist/commands/doctor-state-integrity.js +23 -23
- package/dist/commands/doctor-workspace.js +3 -3
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/hosted-dashboard-probe.js +3 -3
- package/dist/commands/managed-up.js +2 -2
- package/dist/commands/model-picker.js +27 -8
- package/dist/commands/models/list.probe.js +1 -1
- package/dist/commands/models/list.registry.js +13 -17
- package/dist/commands/models/list.status-command.js +2 -2
- package/dist/commands/onboard-auth.config-core.js +1 -1
- package/dist/commands/onboard-auth.config-litellm.js +21 -21
- package/dist/commands/onboard-auth.credentials.js +3 -4
- package/dist/commands/onboard-auth.js +0 -1
- package/dist/commands/onboarding/plugin-install.js +2 -2
- package/dist/commands/openai-codex-model-default.js +28 -5
- package/dist/commands/sessions-cleanup.js +2 -2
- package/dist/commands/signal-install.js +6 -6
- package/dist/commands/status-all/channels.js +2 -2
- package/dist/commands/wallet.js +47 -47
- package/dist/config/cache-utils.js +2 -2
- package/dist/config/includes.js +5 -5
- package/dist/config/io.js +2 -2
- package/dist/config/paths.js +3 -3
- package/dist/config/sat-runtime-ids.js +3 -3
- package/dist/config/sessions/disk-budget.js +6 -6
- package/dist/config/sessions/paths.js +2 -2
- package/dist/config/sessions/store.js +17 -17
- package/dist/config/sessions/transcript.js +4 -4
- package/dist/config/talk.js +2 -2
- package/dist/config/zod-schema.agent-defaults.js +6 -2
- package/dist/config/zod-schema.agent-runtime.js +6 -2
- package/dist/config/zod-schema.core.js +6 -2
- package/dist/control-ui/assets/{app-BKlu6OKz.js → app-D7TXyNRi.js} +1548 -1540
- package/dist/control-ui/assets/chat-model-ref-Djkv93yn.js +2 -0
- package/dist/control-ui/assets/{index-nrFcGMv-.js → index-BmSBom-w.js} +3 -3
- package/dist/control-ui/assets/{providers-BQFrRqym.js → providers-Cc89iMdx.js} +5 -5
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/version.json +1 -0
- package/dist/cron/isolated-agent/run.js +6 -2
- package/dist/cron/service/jobs.js +11 -1
- package/dist/cron/service/store.js +2 -2
- package/dist/cron/store.js +6 -6
- package/dist/daemon/systemd-system.js +5 -5
- package/dist/discord/monitor/gateway-plugin.js +2 -2
- package/dist/discord/monitor/thread-bindings.state.js +2 -2
- package/dist/discord/voice/manager.js +1 -1
- package/dist/extensions/sat-mining/src/sat-bond-layout.js +9 -9
- package/dist/gateway/client.js +4 -4
- package/dist/gateway/control-ui-boot-check.js +6 -6
- package/dist/gateway/control-ui-login.js +7 -7
- package/dist/gateway/control-ui.js +11 -9
- package/dist/gateway/hooks-mapping.js +4 -4
- package/dist/gateway/protocol/schema/agents-models-skills.js +66 -4
- package/dist/gateway/server-discovery.js +2 -2
- package/dist/gateway/server-http.js +4 -4
- package/dist/gateway/server-methods/chat.js +3 -3
- package/dist/gateway/server-methods/models.js +8 -8
- package/dist/gateway/server-methods/sessions.js +8 -8
- package/dist/gateway/server-methods/tts.js +2 -2
- package/dist/gateway/server-methods/usage.js +2 -2
- package/dist/gateway/server-model-catalog.js +3 -0
- package/dist/gateway/server.impl.js +3 -3
- package/dist/gateway/session-compaction-checkpoints.js +4 -4
- package/dist/gateway/session-utils.fs.js +24 -24
- package/dist/gateway/session-utils.js +6 -6
- package/dist/gateway/sessions-patch.js +27 -24
- package/dist/hooks/bundled-dir.js +4 -4
- package/dist/hooks/gmail-setup-utils.js +6 -6
- package/dist/hooks/import-url.js +2 -2
- package/dist/hooks/loader.js +4 -4
- package/dist/hooks/workspace.js +7 -7
- package/dist/infra/archive.js +17 -17
- package/dist/infra/boundary-file-read.js +2 -2
- package/dist/infra/boundary-path.js +15 -15
- package/dist/infra/brew.js +2 -2
- package/dist/infra/control-ui-assets.js +14 -14
- package/dist/infra/device-auth-store.js +8 -8
- package/dist/infra/device-identity.js +8 -8
- package/dist/infra/dotenv.js +2 -2
- package/dist/infra/exec-approvals.js +8 -8
- package/dist/infra/exec-command-resolution.js +4 -4
- package/dist/infra/exec-safe-bin-trust.js +2 -2
- package/dist/infra/fased-root.js +5 -5
- package/dist/infra/fs-safe.js +14 -14
- package/dist/infra/gateway-lock.js +11 -11
- package/dist/infra/git-commit.js +5 -5
- package/dist/infra/git-root.js +4 -4
- package/dist/infra/hosted-runtime-artifact.js +3 -3
- package/dist/infra/is-main.js +2 -2
- package/dist/infra/json-file.js +7 -7
- package/dist/infra/outbound/delivery-queue.js +16 -16
- package/dist/infra/path-env.js +3 -3
- package/dist/infra/ports-lsof.js +4 -4
- package/dist/infra/provider-usage.auth.js +3 -3
- package/dist/infra/safe-open-sync.js +2 -2
- package/dist/infra/session-cost-usage.js +9 -9
- package/dist/infra/shell-env.js +2 -2
- package/dist/infra/state-migrations.fs.js +6 -6
- package/dist/infra/state-migrations.js +23 -23
- package/dist/infra/tmp-fased-dir.js +6 -6
- package/dist/infra/update-runner.js +31 -3
- package/dist/infra/widearea-dns.js +3 -3
- package/dist/infra/wsl.js +2 -2
- package/dist/light-update-status.js +1 -1
- package/dist/line/accounts.js +2 -2
- package/dist/line/download.js +2 -2
- package/dist/logging/config.js +3 -3
- package/dist/logging/logger.js +7 -7
- package/dist/managed/federation.js +3 -3
- package/dist/managed/tunnel.js +3 -3
- package/dist/media/store.js +13 -13
- package/dist/media-understanding/runner.js +3 -3
- package/dist/memory/embeddings.js +2 -2
- package/dist/memory/internal.js +10 -10
- package/dist/memory/inventory.js +19 -2
- package/dist/memory/manager-sync-ops.js +7 -7
- package/dist/memory/repair-executor.js +17 -17
- package/dist/node-host/invoke-system-run-plan.js +8 -8
- package/dist/node-host/invoke.js +2 -2
- package/dist/node-host/runner.js +3 -3
- package/dist/pairing/pairing-store.js +3 -3
- package/dist/plugin-sdk/{accounts-DW9OS5Ll.js → accounts-DzWlKv1U.js} +1 -1
- package/dist/plugin-sdk/{actions-DQUXohRr.js → actions-BplQVLL6.js} +4 -4
- package/dist/plugin-sdk/{active-listener-BZQWZPF7.js → active-listener-x4MLhYUw.js} +1 -1
- package/dist/plugin-sdk/{allow-list-BYeKk0Sy.js → allow-list-DyAxs4yw.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-t4mmHsI2.js → audio-preflight-G8h3Sn8_.js} +43 -47
- package/dist/plugin-sdk/{audit-BZk_6Buw.js → audit-CWknklvI.js} +1 -1
- package/dist/plugin-sdk/{channel-access-CN5HiWdb.js → channel-access-a9Dnfw7-.js} +1 -1
- package/dist/plugin-sdk/{channel-access-configure-B7Kkvx9K.js → channel-access-configure-CD4QDN5E.js} +1 -1
- package/dist/plugin-sdk/{channel-adapters.discord-IOZP8Cv5.js → channel-adapters.discord-BS4S4Svh.js} +1 -1
- package/dist/plugin-sdk/channel-plugin-common.d.ts +3 -3
- package/dist/plugin-sdk/channel-plugin-common.js +4 -4
- package/dist/plugin-sdk/{chunk-B2ffJ-LR.js → chunk-B8EZkwiT.js} +1 -1
- package/dist/plugin-sdk/{chunk-items-jOdkyP53.js → chunk-items-CEPklxGe.js} +1 -1
- package/dist/plugin-sdk/command-status.d.ts +2 -2
- package/dist/plugin-sdk/command-status.js +43 -47
- package/dist/plugin-sdk/{commands-registry-BWb4NcfW.js → commands-registry-BfEa4tFA.js} +2 -2
- package/dist/plugin-sdk/{common-C4XrB73N.js → common-CbfckC19.js} +1 -1
- package/dist/plugin-sdk/{config-rySyVtKs.js → config-Bt5GhnA-.js} +105 -73
- package/dist/plugin-sdk/{config-schema-BaybPPrJ.js → config-schema-B9DKr6J5.js} +96239 -81587
- package/dist/plugin-sdk/device-pair.d.ts +1 -1
- package/dist/plugin-sdk/device-pair.js +2 -3
- package/dist/plugin-sdk/{diagnostic-Dfn1iERm.js → diagnostic-DLL_zekv.js} +3 -3
- package/dist/plugin-sdk/{directory-live-DatqU-eS.js → directory-live-CSuYxdwk.js} +1 -1
- package/dist/plugin-sdk/{directory-live-ClwN5KKq.js → directory-live-Dw7ZgC9_.js} +1 -1
- package/dist/plugin-sdk/discord.d.ts +5 -5
- package/dist/plugin-sdk/discord.js +31 -32
- package/dist/plugin-sdk/{draft-stream-controls-D4Tb_iS_.js → draft-stream-controls-BqchW1vi.js} +1 -1
- package/dist/plugin-sdk/{fetch-guard-BuYrl6q2.js → fetch-guard-CeG6u6ld.js} +1 -1
- package/dist/plugin-sdk/{filesystem-manager-B9DDPgfU.js → filesystem-manager-BGGGrkiN.js} +2 -2
- package/dist/plugin-sdk/{fs-safe-BG-VzVkL.js → fs-safe-xBqok6yR.js} +1 -1
- package/dist/plugin-sdk/{group-mentions-DLOOve8d.d.ts → group-mentions-BHRff6j8.d.ts} +1 -1
- package/dist/plugin-sdk/{guilds-BeT3iHHJ.js → guilds-CDhRIX57.js} +1 -1
- package/dist/plugin-sdk/{handle-action-CGF-Qnp0.js → handle-action-DbzZFYnG.js} +24 -25
- package/dist/plugin-sdk/{helpers-DgRMfCnT.js → helpers-CluGKuIV.js} +1 -1
- package/dist/plugin-sdk/{image-ops-CcBfoMLW.js → image-ops-CUaLtIFj.js} +1 -1
- package/dist/plugin-sdk/index.d.ts +8 -8
- package/dist/plugin-sdk/index.js +47 -51
- package/dist/plugin-sdk/json-store.js +6 -6
- package/dist/plugin-sdk/{login-DpDQyM7r.js → login-DJuHYDiK.js} +3 -3
- package/dist/plugin-sdk/{login-qr-COaSAPY5.js → login-qr-CbHL5ayf.js} +3 -3
- package/dist/plugin-sdk/{manager-Cqz30lA3.js → manager-oHAvZCT3.js} +7 -7
- package/dist/plugin-sdk/{markdown-tables-BOG5sSQQ.js → markdown-tables-Mkx7k92Y.js} +1 -1
- package/dist/plugin-sdk/{media-Bu-nJpPs.js → media-CA8sTmVE.js} +4 -4
- package/dist/plugin-sdk/{monitor-II_NIq3G.js → monitor-CZrN9pev.js} +51 -55
- package/dist/plugin-sdk/{monitor-DL6oEVo8.js → monitor-CmwGqNyV.js} +61 -65
- package/dist/plugin-sdk/{openresponses-http-vkHBBpGY.js → openresponses-http-CWOd4war.js} +43 -47
- package/dist/plugin-sdk/{optional-runtime-dependency-DEojVNfv.js → optional-runtime-dependency-DKmk9PZa.js} +1 -1
- package/dist/plugin-sdk/{outbound-mf2y6KuY.js → outbound-0oN9IfNw.js} +9 -9
- package/dist/plugin-sdk/{outbound-attachment-ivAHpWnn.js → outbound-attachment-DdVkqUzE.js} +2 -2
- package/dist/plugin-sdk/{pairing-message-CvJ6Qa1Q.d.ts → pairing-message-BMkkS038.d.ts} +2 -2
- package/dist/plugin-sdk/{pairing-message-CqYG12t-.js → pairing-message-ClqhfCUk.js} +1 -1
- package/dist/plugin-sdk/{pairing-store-D-21Sphe.js → pairing-store-B01mCSct.js} +2 -2
- package/dist/plugin-sdk/{pi-model-discovery-B6gD1clF.js → pi-model-discovery-Buz0JC1Y.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-3yDxS3ro.js → pi-model-discovery-runtime-DuwuoteY.js} +2 -2
- package/dist/plugin-sdk/{probe-Cyb-DGA3.js → probe--7xtfzMm.js} +3 -3
- package/dist/plugin-sdk/{probe-Dlk0Jxpw.js → probe-BFroeK3g.js} +1 -1
- package/dist/plugin-sdk/{probe-D8JAILir.js → probe-l_whvGLY.js} +1 -1
- package/dist/plugin-sdk/{resolve-channels-zEnvugag.js → probe-xY3Ky0Tx.js} +3 -4
- package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +2 -2
- package/dist/plugin-sdk/{pw-ai-CMplwiwf.js → pw-ai-B0domrii.js} +6 -8
- package/dist/plugin-sdk/{qmd-manager-DCUE21Kj.js → qmd-manager-CFFeM4Fl.js} +3 -3
- package/dist/plugin-sdk/{query-expansion-Zr9qQixm.js → query-expansion-CAI2kKLQ.js} +1 -1
- package/dist/plugin-sdk/{replies-wiI4veI7.js → replies-1macZ1mZ.js} +4 -4
- package/dist/plugin-sdk/{resolve-channels-ChWKWtA9.js → resolve-channels-87LZrFk_.js} +2 -2
- package/dist/plugin-sdk/resolve-channels-CwB2_019.js +4 -0
- package/dist/plugin-sdk/{resolve-outbound-target-bm9RUK5q.js → resolve-outbound-target-BdH6LUoW.js} +2 -2
- package/dist/plugin-sdk/{resolve-route-ekGNc6os.js → resolve-route-CkNIKKEW.js} +1 -1
- package/dist/plugin-sdk/{resolve-users-BTvjQuui.js → resolve-users-Cxb5wpAQ.js} +1 -1
- package/dist/plugin-sdk/{resolve-users-CTzoruIZ.js → resolve-users-V6dHh_2B.js} +2 -2
- package/dist/plugin-sdk/{retry-policy-BvlC2SPh.js → retry-policy-9ybIh4Fq.js} +1 -1
- package/dist/plugin-sdk/{runtime-ClSakPxR.js → runtime-Dy420wBu.js} +3 -3
- package/dist/plugin-sdk/{runtime-dependency-yAWxH4El.js → runtime-dependency-CIw9t7-k.js} +123 -15
- package/dist/plugin-sdk/{sandbox-paths-lj7_EVuA.js → sandbox-paths-w64tYl0v.js} +1 -1
- package/dist/plugin-sdk/sat-runtime.d.ts +3 -3
- package/dist/plugin-sdk/sat-runtime.js +44 -10
- package/dist/plugin-sdk/{send-D264hFVb.js → send-2VcOMTN5.js} +9 -9
- package/dist/plugin-sdk/{send-CgyS75Av.js → send-BQUtCJFW.js} +10 -10
- package/dist/plugin-sdk/{send-D58yEeH4.js → send-DPJIIYAs.js} +6 -6
- package/dist/plugin-sdk/{send-C7x6gzSl.js → send-Dqes9tdU.js} +13 -13
- package/dist/plugin-sdk/{send-DrAtUGLM.js → send-J4JWKP62.js} +8 -8
- package/dist/plugin-sdk/{session-DyMtb5YQ.js → session-C_n2S5ub.js} +3 -3
- package/dist/plugin-sdk/{skill-commands-Q80wCyry.js → skill-commands-B7wx9ax8.js} +102 -102
- package/dist/plugin-sdk/{slack-C-I6q3NB.js → slack-BouRQG-W.js} +64 -68
- package/dist/plugin-sdk/{slack-actions-dGE_t_Un.js → slack-actions-CasHVtiq.js} +20 -21
- package/dist/plugin-sdk/slack.d.ts +5 -5
- package/dist/plugin-sdk/slack.js +13 -13
- package/dist/plugin-sdk/{ssrf-BZG8Ztod.js → ssrf-fG4UHKBw.js} +180 -2
- package/dist/plugin-sdk/{sticker-cache-DCrDTYIi.js → sticker-cache-BvGEUas3.js} +3 -3
- package/dist/plugin-sdk/{tables-0mhUOh5v.js → tables-CjlQJV4r.js} +2 -2
- package/dist/plugin-sdk/{device-pairing-D2Yq-_U6.js → tailscale-status-DwpNdO3Z.js} +104 -2
- package/dist/plugin-sdk/{targets-znKHngSk.js → targets-QfP164Dh.js} +2 -2
- package/dist/plugin-sdk/{telegram-actions-GBYY8-x9.js → telegram-actions-CwYjV6Db.js} +48 -52
- package/dist/plugin-sdk/telegram.d.ts +5 -5
- package/dist/plugin-sdk/telegram.js +11 -11
- package/dist/plugin-sdk/{thread-bindings.lifecycle-ClzPBK70.js → thread-bindings.lifecycle-DU4iX_Jr.js} +3 -3
- package/dist/plugin-sdk/{thread-bindings.state-Ha01nmrq.js → thread-bindings.state-BgYWFjNF.js} +2 -2
- package/dist/plugin-sdk/{tmp-fased-dir-C_xfeEN9.d.ts → tmp-fased-dir-BdFQvrvw.d.ts} +2 -2
- package/dist/plugin-sdk/{types-DV5TNhMK.d.ts → types-BYDL6dQj.d.ts} +2 -2
- package/dist/plugin-sdk/{types-BI2njxWJ.d.ts → types-CLIvQaVg.d.ts} +39 -5
- package/dist/plugin-sdk/{types-CBCtqtMn.d.ts → types-DyhXnYUr.d.ts} +1 -1
- package/dist/plugin-sdk/{types.plugin-CvUiB3Kh.d.ts → types.plugin-_fbu40Re.d.ts} +8 -5
- package/dist/plugin-sdk/{web-CJMfhGFY.js → web-D0yENDve.js} +52 -56
- package/dist/plugin-sdk/{whatsapp-actions-0ZbGo5ZV.js → whatsapp-actions-BT2nPLyo.js} +18 -19
- package/dist/plugin-sdk/{whatsapp-heartbeat-DGTsuvQ8.js → whatsapp-heartbeat-CiABSZ6G.js} +2 -2
- package/dist/plugin-sdk/whatsapp.d.ts +5 -5
- package/dist/plugin-sdk/whatsapp.js +14 -14
- package/dist/plugin-sdk/{wsl-D5jDUlms.js → wsl-B_ojyEtC.js} +53 -53
- package/dist/plugins/bundled-dir.js +3 -3
- package/dist/plugins/discovery.js +11 -11
- package/dist/plugins/loader.js +13 -13
- package/dist/plugins/manifest-registry.js +2 -2
- package/dist/plugins/manifest.js +4 -4
- package/dist/plugins/path-safety.js +3 -3
- package/dist/plugins/runtime/index.js +1 -1
- package/dist/plugins/status-cache.js +9 -9
- package/dist/plugins/update.js +3 -3
- package/dist/plugins/web-search-install-catalog.js +3 -3
- package/dist/providers/github-copilot-model-discovery.js +51 -0
- package/dist/providers/litellm-models.js +1 -1
- package/dist/providers/openai-codex-model-discovery.js +166 -0
- package/dist/providers/refresh.js +311 -67
- package/dist/providers/registry.js +16 -6
- package/dist/providers/runtime-model-catalog.js +250 -0
- package/dist/secrets/apply.js +16 -16
- package/dist/secrets/audit.js +11 -11
- package/dist/secrets/shared.js +9 -9
- package/dist/security/scan-paths.js +2 -2
- package/dist/shared/config-eval.js +2 -2
- package/dist/shared/model-thinking.js +54 -4
- package/dist/shared/pid-alive.js +2 -2
- package/dist/tasks/standing-orders.js +5 -5
- package/dist/tasks/task-flow-registry.js +5 -5
- package/dist/tasks/task-registry.js +5 -5
- package/dist/tasks/workflow-definitions.js +6 -6
- package/dist/telegram/bot-message-context.js +1 -1
- package/dist/telegram/token.js +5 -5
- package/dist/utils.js +5 -5
- package/dist/wallet/local-socket-signer-broker.js +16 -16
- package/dist/wallet/providers/embedded-keystore-adapter.js +5 -5
- package/dist/wallet/providers/local-socket-signer-adapter.js +2 -2
- package/dist/wallet/wallet-approval-auth.js +5 -5
- package/dist/wallet/wallet-audit-log.js +5 -5
- package/dist/wallet/wallet-custody.js +21 -21
- package/dist/wallet/wallet-inbound-events.js +5 -5
- package/dist/wallet/wallet-observability.js +5 -5
- package/dist/wallet/wallet-policy.js +9 -9
- package/dist/wallet/wallet-provider-registry.js +7 -7
- package/dist/wallet/wallet-runtime-config.js +3 -3
- package/dist/wallet/wallet-secrets-store.js +22 -22
- package/dist/wallet/wallet-send-approvals.js +5 -5
- package/dist/wallet/wallet-settlement-links.js +5 -5
- package/dist/web/accounts.js +3 -3
- package/dist/web/auth-store.js +18 -18
- package/dist/web/session.js +4 -4
- package/dist/wizard/host-security-capability.js +2 -2
- package/dist/wizard/onboarding.host-security.js +7 -7
- package/dist/wizard/onboarding.js +31 -13
- package/dist/wizard/onboarding.wallet.js +44 -44
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/fased-federation/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +12 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +2 -2
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +12 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +12 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/sat-mining/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +12 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +12 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +12 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +12 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +2 -1
- package/dist/control-ui/assets/chat-model-ref-B9sWop67.js +0 -2
- package/dist/plugin-sdk/ip-C70a-YlD.js +0 -181
- package/dist/plugin-sdk/tailscale-status-ClsquRGs.js +0 -104
- package/dist/plugin-sdk/wallet-status-CyovJojz.js +0 -11944
- package/dist/plugin-sdk/ws-CocpWGhl.js +0 -114
- /package/dist/plugin-sdk/{blocks-input-Dcitfh7h.js → blocks-input-Bg-8S2pl.js} +0 -0
- /package/dist/plugin-sdk/{channel-activity-Cg1xRoc2.js → channel-activity-DBDMQ3yI.js} +0 -0
- /package/dist/plugin-sdk/{channel-core-BOkyXXLa.js → channel-core-CFRs8LPy.js} +0 -0
- /package/dist/plugin-sdk/{client-D2N7hqVu.js → client-pI228AVT.js} +0 -0
- /package/dist/plugin-sdk/{command-poll-backoff-NAePk3eL.js → command-poll-backoff-yJU83wEq.js} +0 -0
- /package/dist/plugin-sdk/{date-time-CE3Uer3C.js → date-time-uUevHscU.js} +0 -0
- /package/dist/plugin-sdk/{diagnostic-session-state-HO94DMou.js → diagnostic-session-state-DqgfGYqZ.js} +0 -0
- /package/dist/plugin-sdk/{draft-stream-loop-CKyHn8IX.js → draft-stream-loop-CrOPfV3F.js} +0 -0
- /package/dist/plugin-sdk/{fetch-Cu-ahkie.js → fetch-BtmoPIlf.js} +0 -0
- /package/dist/plugin-sdk/{gateway-registry-DFsoY6C0.js → gateway-registry-DZDsqicG.js} +0 -0
- /package/dist/plugin-sdk/{inbound-context-BFnIdcqI.js → inbound-context-DrAcXE0y.js} +0 -0
- /package/dist/plugin-sdk/{internal-qo16nNU1.js → internal-CG_nHo-2.js} +0 -0
- /package/dist/plugin-sdk/{memory-search-C3C0bD2H.js → memory-search-VFll-AIb.js} +0 -0
- /package/dist/plugin-sdk/{pairing-token-N_6Jbt1L.js → pairing-token-Cs3BRKc0.js} +0 -0
- /package/dist/plugin-sdk/{path-alias-guards-Dg3gU-MA.js → path-alias-guards-BJZD5JMJ.js} +0 -0
- /package/dist/plugin-sdk/{polls-DQrR-qT3.js → polls-DKQXVfJp.js} +0 -0
- /package/dist/plugin-sdk/{proxy-7xs_rsnV.js → proxy-DWpYcsvR.js} +0 -0
- /package/dist/plugin-sdk/{qmd-scope-D1sSG_Rx.js → qmd-scope-CdX34VCV.js} +0 -0
- /package/dist/plugin-sdk/{redact-identifier-Q3tkvxhm.js → redact-identifier-Lt7t3l7S.js} +0 -0
- /package/dist/plugin-sdk/{redact-sensitive-url-dPvnFFsK.js → redact-sensitive-url-g-ukZjwA.js} +0 -0
- /package/dist/plugin-sdk/{render-Bwu_WxwA.js → render-e7fENCYH.js} +0 -0
- /package/dist/plugin-sdk/{reply-prefix-Bqzm6DC1.js → reply-prefix-ClpxvL_w.js} +0 -0
- /package/dist/plugin-sdk/{reply-reference-BkbK_DWT.js → reply-reference-Bqk-7HXE.js} +0 -0
- /package/dist/plugin-sdk/{secure-random-Bl-AVLVb.js → secure-random-BIkG-k4s.js} +0 -0
- /package/dist/plugin-sdk/{shared-clhhbWN3.js → shared-CBgp_GBw.js} +0 -0
- /package/dist/plugin-sdk/{target-errors-C_SVKoEv.js → target-errors-Ckufe179.js} +0 -0
- /package/dist/plugin-sdk/{targets-BDvvnlph.js → targets-CoMJ1ry1.js} +0 -0
- /package/dist/plugin-sdk/{tokens-BvtlOzVP.js → tokens-BbnqfVuu.js} +0 -0
- /package/dist/plugin-sdk/{tool-loop-detection-CWphm1k_.js → tool-loop-detection-Bp8bPJLs.js} +0 -0
- /package/dist/plugin-sdk/{ui-e020ouhJ.js → ui-Be8cLHIS.js} +0 -0
- /package/dist/plugin-sdk/{with-timeout-BYrRAYFV.js → with-timeout-ckWB8rTo.js} +0 -0
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { BASE_THINKING_LEVELS } from "../shared/model-thinking.js";
|
|
2
2
|
import { CLOUDFLARE_AI_GATEWAY_MODEL_IDS, CLOUDFLARE_AI_GATEWAY_PROVIDER_BRAND_ID, CLOUDFLARE_AI_GATEWAY_ROUTE_ID } from "./cloudflare-ai-gateway-shared.js";
|
|
3
3
|
import { HUGGINGFACE_MODEL_IDS } from "./huggingface-models.js";
|
|
4
|
-
import { LITELLM_BASE_URL, LITELLM_MODEL_IDS } from "./litellm-models.js";
|
|
5
4
|
import { OPENCODE_ZEN_MODEL_IDS } from "./opencode-zen-shared.js";
|
|
6
5
|
import { SYNTHETIC_MODEL_IDS } from "./synthetic-models.js";
|
|
7
6
|
import { TOGETHER_MODEL_IDS } from "./together-models.js";
|
|
8
7
|
import { VENICE_MODEL_IDS } from "./venice-models.js";
|
|
9
8
|
import { VERCEL_AI_GATEWAY_MODEL_IDS } from "./vercel-ai-gateway-models.js";
|
|
10
9
|
import { XIAOMI_MODEL_IDS } from "./xiaomi-models.js";
|
|
10
|
+
import { LITELLM_BASE_URL } from "./litellm-models.js";
|
|
11
11
|
import { ANTHROPIC_MODEL_IDS, ANTHROPIC_PROVIDER_BRAND_ID, ANTHROPIC_ROUTE_ID, BYTEPLUS_CODING_MODEL_IDS, BYTEPLUS_CODING_ROUTE_ID, BYTEPLUS_MODEL_IDS, BYTEPLUS_PLAN_ROUTE_ID, BYTEPLUS_PROVIDER_BRAND_ID, BYTEPLUS_ROUTE_ID, CHUTES_MODEL_IDS, CHUTES_PROVIDER_BRAND_ID, CHUTES_ROUTE_ID, COPILOT_PROVIDER_BRAND_ID, COPILOT_PROXY_MODEL_IDS, COPILOT_PROXY_ROUTE_ID, CUSTOM_PROVIDER_BRAND_ID, CUSTOM_PROVIDER_ROUTE_ID, GITHUB_COPILOT_ROUTE_ID, GOOGLE_API_ROUTE_ID, GOOGLE_GEMINI_CLI_ROUTE_ID, GOOGLE_GEMINI_MODEL_IDS, GOOGLE_PROVIDER_BRAND_ID, HUGGINGFACE_PROVIDER_BRAND_ID, HUGGINGFACE_ROUTE_ID, KIMI_CODING_MODEL_IDS, KIMI_CODING_ROUTE_ID, LITELLM_PROVIDER_BRAND_ID, LITELLM_ROUTE_ID, LMSTUDIO_PROVIDER_BRAND_ID, LMSTUDIO_ROUTE_ID, MINIMAX_API_ROUTE_ID, MINIMAX_CN_ROUTE_ID, MINIMAX_MODEL_IDS, MINIMAX_PORTAL_ROUTE_ID, MINIMAX_PROVIDER_BRAND_ID, MISTRAL_MODEL_IDS, MISTRAL_PROVIDER_BRAND_ID, MISTRAL_ROUTE_ID, MOONSHOT_MODEL_IDS, MOONSHOT_PROVIDER_BRAND_ID, MOONSHOT_ROUTE_ID, OLLAMA_PROVIDER_BRAND_ID, OLLAMA_ROUTE_ID, OPENAI_API_MODEL_IDS, OPENAI_API_ROUTE_ID, OPENAI_CODEX_ROUTE_ID, OPENAI_PROVIDER_BRAND_ID, OPENAI_SIGN_IN_MODEL_IDS, OPENCODE_ZEN_PROVIDER_BRAND_ID, OPENCODE_ZEN_ROUTE_ID, OPENROUTER_MODEL_IDS, OPENROUTER_PROVIDER_BRAND_ID, OPENROUTER_ROUTE_ID, QIANFAN_MODEL_IDS, QIANFAN_PROVIDER_BRAND_ID, QIANFAN_ROUTE_ID, QWEN_API_MODEL_IDS, QWEN_API_ROUTE_ID, QWEN_CODING_PLAN_MODEL_IDS, QWEN_CODING_PLAN_ROUTE_ID, QWEN_PROVIDER_BRAND_ID, SYNTHETIC_PROVIDER_BRAND_ID, SYNTHETIC_ROUTE_ID, TOGETHER_PROVIDER_BRAND_ID, TOGETHER_ROUTE_ID, VENICE_PROVIDER_BRAND_ID, VENICE_ROUTE_ID, VERCEL_AI_GATEWAY_PROVIDER_BRAND_ID, VERCEL_AI_GATEWAY_ROUTE_ID, VLLM_PROVIDER_BRAND_ID, VLLM_ROUTE_ID, VOLCENGINE_CODING_MODEL_IDS, VOLCENGINE_CODING_ROUTE_ID, VOLCENGINE_MODEL_IDS, VOLCENGINE_PLAN_ROUTE_ID, VOLCENGINE_PROVIDER_BRAND_ID, VOLCENGINE_ROUTE_ID, XAI_MODEL_IDS, XAI_PROVIDER_BRAND_ID, XAI_ROUTE_ID, XIAOMI_PROVIDER_BRAND_ID, XIAOMI_ROUTE_ID, ZAI_MODEL_IDS, ZAI_PROVIDER_BRAND_ID, ZAI_ROUTE_ID, listProviderBrandManifests, lookupProviderManifestModelCapability, resolveProviderRouteModelCapability } from "./registry.js";
|
|
12
12
|
import { readFile } from "node:fs/promises";
|
|
13
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
13
14
|
|
|
14
15
|
//#region src/providers/refresh.ts
|
|
15
16
|
const OPENAI_DOCS_MODELS_URL = "https://developers.openai.com/api/docs/models/all";
|
|
17
|
+
const OPENAI_API_MODELS_URL = "https://api.openai.com/v1/models";
|
|
16
18
|
const CHUTES_MODELS_URL = "https://llm.chutes.ai/v1/models";
|
|
17
19
|
const OPENROUTER_MODELS_URL = "https://openrouter.ai/api/v1/models";
|
|
18
20
|
const VERCEL_AI_GATEWAY_MODELS_URL = "https://ai-gateway.vercel.sh/v1/models";
|
|
19
21
|
const OPENCODE_ZEN_MODELS_URL = "https://opencode.ai/zen/v1/models";
|
|
20
22
|
const HUGGINGFACE_MODELS_URL = "https://router.huggingface.co/v1/models";
|
|
21
23
|
const VENICE_MODELS_URL = "https://api.venice.ai/api/v1/models";
|
|
24
|
+
const PROVIDER_CATALOG_TIMEOUT_MS = 8e3;
|
|
22
25
|
const ANTHROPIC_MODELS_URL = "https://api.anthropic.com/v1/models";
|
|
23
26
|
const GOOGLE_GEMINI_MODELS_URL = "https://generativelanguage.googleapis.com/v1beta/models";
|
|
24
|
-
const
|
|
27
|
+
const XAI_LANGUAGE_MODELS_URL = "https://api.x.ai/v1/language-models";
|
|
25
28
|
const MISTRAL_MODELS_URL = "https://api.mistral.ai/v1/models";
|
|
26
29
|
const MINIMAX_MODELS_URL = "https://api.minimax.io/v1/models";
|
|
27
30
|
const MINIMAX_PORTAL_DEFAULT_BASE_URL = "https://api.minimax.io/anthropic";
|
|
@@ -44,9 +47,7 @@ const VLLM_DEFAULT_BASE_URL = "http://127.0.0.1:8000/v1";
|
|
|
44
47
|
const OLLAMA_DEFAULT_BASE_URL = "http://127.0.0.1:11434";
|
|
45
48
|
const LMSTUDIO_DEFAULT_BASE_URL = "http://127.0.0.1:1234/v1";
|
|
46
49
|
const LITELLM_DEFAULT_BASE_URL = LITELLM_BASE_URL;
|
|
47
|
-
const
|
|
48
|
-
const OPENAI_CURRENT_SIGN_IN_MODEL_RE = /^gpt-(?:5\.6-(?:sol|terra|luna)|5\.(?:[4-9]|\d{2,})(?:-mini)?|5\.3-codex-spark)$/;
|
|
49
|
-
const CHUTES_CURRENT_NORMAL_UI_MODEL_RE = /^(?:google\/gemma-4-[^/]+-TEE|Qwen\/Qwen3(?:\.\d+)?-[^/]+-TEE|deepseek-ai\/DeepSeek-V3\.2-TEE|zai-org\/GLM-5(?:\.\d+)?-TEE|moonshotai\/Kimi-K2\.6-TEE)$/;
|
|
50
|
+
const providerCatalogView = new AsyncLocalStorage();
|
|
50
51
|
function normalizeModelIds(values, options = {}) {
|
|
51
52
|
const seen = new Set();
|
|
52
53
|
const result = [];
|
|
@@ -108,9 +109,19 @@ function metadataString(metadata, key) {
|
|
|
108
109
|
function setProviderRefreshEnvFromProfile(params) {
|
|
109
110
|
const provider = params.profile.provider.trim();
|
|
110
111
|
const apiKey = resolveApiKeyProfileValue(params.profile, params.env);
|
|
112
|
+
const token = resolveTokenProfileValue(params.profile, params.env);
|
|
111
113
|
switch (provider) {
|
|
114
|
+
case "openai":
|
|
115
|
+
setProviderRefreshEnvValue(params.target, "OPENAI_API_KEY", apiKey);
|
|
116
|
+
break;
|
|
117
|
+
case "chutes":
|
|
118
|
+
setProviderRefreshEnvValue(params.target, "CHUTES_API_KEY", token);
|
|
119
|
+
break;
|
|
112
120
|
case "anthropic":
|
|
113
121
|
setProviderRefreshEnvValue(params.target, "ANTHROPIC_API_KEY", apiKey);
|
|
122
|
+
if (params.profile.type !== "api_key") {
|
|
123
|
+
setProviderRefreshEnvValue(params.target, "ANTHROPIC_OAUTH_TOKEN", token);
|
|
124
|
+
}
|
|
114
125
|
break;
|
|
115
126
|
case "google":
|
|
116
127
|
case "gemini":
|
|
@@ -124,7 +135,7 @@ function setProviderRefreshEnvFromProfile(params) {
|
|
|
124
135
|
break;
|
|
125
136
|
}
|
|
126
137
|
case "xai":
|
|
127
|
-
setProviderRefreshEnvValue(params.target, "XAI_API_KEY",
|
|
138
|
+
setProviderRefreshEnvValue(params.target, "XAI_API_KEY", token);
|
|
128
139
|
break;
|
|
129
140
|
case "mistral":
|
|
130
141
|
setProviderRefreshEnvValue(params.target, "MISTRAL_API_KEY", apiKey);
|
|
@@ -187,6 +198,23 @@ function setProviderRefreshEnvFromProfile(params) {
|
|
|
187
198
|
case "together":
|
|
188
199
|
setProviderRefreshEnvValue(params.target, "TOGETHER_API_KEY", apiKey);
|
|
189
200
|
break;
|
|
201
|
+
case "openrouter":
|
|
202
|
+
setProviderRefreshEnvValue(params.target, "OPENROUTER_API_KEY", token);
|
|
203
|
+
break;
|
|
204
|
+
case "vercel-ai-gateway":
|
|
205
|
+
case "ai-gateway":
|
|
206
|
+
setProviderRefreshEnvValue(params.target, "AI_GATEWAY_API_KEY", apiKey);
|
|
207
|
+
break;
|
|
208
|
+
case "opencode":
|
|
209
|
+
case "opencode-zen":
|
|
210
|
+
setProviderRefreshEnvValue(params.target, "OPENCODE_API_KEY", apiKey);
|
|
211
|
+
break;
|
|
212
|
+
case "huggingface":
|
|
213
|
+
setProviderRefreshEnvValue(params.target, "HUGGINGFACE_HUB_TOKEN", apiKey);
|
|
214
|
+
break;
|
|
215
|
+
case "venice":
|
|
216
|
+
setProviderRefreshEnvValue(params.target, "VENICE_API_KEY", apiKey);
|
|
217
|
+
break;
|
|
190
218
|
default:
|
|
191
219
|
if (provider.startsWith("custom-")) {
|
|
192
220
|
setProviderRefreshEnvValue(params.target, "CUSTOM_PROVIDER_API_KEY", apiKey);
|
|
@@ -198,6 +226,28 @@ function setProviderRefreshEnvFromModelProvider(params) {
|
|
|
198
226
|
const apiKey = resolveEnvSecretValue(params.provider.apiKey, params.env);
|
|
199
227
|
const baseUrl = typeof params.provider.baseUrl === "string" ? params.provider.baseUrl.trim() : undefined;
|
|
200
228
|
switch (params.providerId) {
|
|
229
|
+
case "openai":
|
|
230
|
+
setProviderRefreshEnvValue(params.target, "OPENAI_API_KEY", apiKey);
|
|
231
|
+
break;
|
|
232
|
+
case "chutes":
|
|
233
|
+
setProviderRefreshEnvValue(params.target, "CHUTES_API_KEY", apiKey);
|
|
234
|
+
break;
|
|
235
|
+
case "openrouter":
|
|
236
|
+
setProviderRefreshEnvValue(params.target, "OPENROUTER_API_KEY", apiKey);
|
|
237
|
+
break;
|
|
238
|
+
case "vercel-ai-gateway":
|
|
239
|
+
case "ai-gateway":
|
|
240
|
+
setProviderRefreshEnvValue(params.target, "AI_GATEWAY_API_KEY", apiKey);
|
|
241
|
+
break;
|
|
242
|
+
case "opencode":
|
|
243
|
+
setProviderRefreshEnvValue(params.target, "OPENCODE_API_KEY", apiKey);
|
|
244
|
+
break;
|
|
245
|
+
case "huggingface":
|
|
246
|
+
setProviderRefreshEnvValue(params.target, "HUGGINGFACE_HUB_TOKEN", apiKey);
|
|
247
|
+
break;
|
|
248
|
+
case "venice":
|
|
249
|
+
setProviderRefreshEnvValue(params.target, "VENICE_API_KEY", apiKey);
|
|
250
|
+
break;
|
|
201
251
|
case "vllm":
|
|
202
252
|
setProviderRefreshEnvValue(params.target, "VLLM_API_KEY", apiKey);
|
|
203
253
|
setProviderRefreshEnvValue(params.target, "VLLM_BASE_URL", baseUrl);
|
|
@@ -278,6 +328,7 @@ function normalizeProviderRefreshModelEntry(entry) {
|
|
|
278
328
|
}
|
|
279
329
|
return {
|
|
280
330
|
id,
|
|
331
|
+
...entry.name ? { name: entry.name } : {},
|
|
281
332
|
...entry.input ? { input: entry.input } : {},
|
|
282
333
|
...entry.reasoning !== undefined ? { reasoning: entry.reasoning } : {},
|
|
283
334
|
...entry.tools !== undefined ? { tools: entry.tools } : {},
|
|
@@ -291,6 +342,7 @@ function normalizeProviderRefreshModelEntry(entry) {
|
|
|
291
342
|
...entry.reasoningBudgetSupported !== undefined ? { reasoningBudgetSupported: entry.reasoningBudgetSupported } : {},
|
|
292
343
|
...typeof entry.contextWindow === "number" && entry.contextWindow > 0 ? { contextWindow: entry.contextWindow } : {},
|
|
293
344
|
...typeof entry.maxTokens === "number" && entry.maxTokens > 0 ? { maxTokens: entry.maxTokens } : {},
|
|
345
|
+
...entry.price ? { price: entry.price } : {},
|
|
294
346
|
...entry.source ? { source: entry.source } : {}
|
|
295
347
|
};
|
|
296
348
|
}
|
|
@@ -744,6 +796,57 @@ function readPositiveNumber(value) {
|
|
|
744
796
|
}
|
|
745
797
|
return undefined;
|
|
746
798
|
}
|
|
799
|
+
function readNonNegativeNumber(value) {
|
|
800
|
+
if (typeof value === "number" && Number.isFinite(value) && value >= 0) {
|
|
801
|
+
return value;
|
|
802
|
+
}
|
|
803
|
+
if (typeof value === "string") {
|
|
804
|
+
const parsed = Number(value);
|
|
805
|
+
return Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined;
|
|
806
|
+
}
|
|
807
|
+
return undefined;
|
|
808
|
+
}
|
|
809
|
+
function readNonNegativeNumberFrom(record, keys) {
|
|
810
|
+
for (const key of keys) {
|
|
811
|
+
const value = readNonNegativeNumber(record[key]);
|
|
812
|
+
if (value !== undefined) {
|
|
813
|
+
return value;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
return undefined;
|
|
817
|
+
}
|
|
818
|
+
function readModelPrice(record) {
|
|
819
|
+
const pricing = asRecord(record.pricing);
|
|
820
|
+
const perTokenInput = readNonNegativeNumberFrom(pricing, ["prompt", "input"]);
|
|
821
|
+
const perTokenOutput = readNonNegativeNumberFrom(pricing, ["completion", "output"]);
|
|
822
|
+
if (perTokenInput !== undefined || perTokenOutput !== undefined) {
|
|
823
|
+
return {
|
|
824
|
+
input: (perTokenInput ?? 0) * 1e6,
|
|
825
|
+
output: (perTokenOutput ?? 0) * 1e6,
|
|
826
|
+
cacheRead: (readNonNegativeNumberFrom(pricing, ["input_cache_read", "cache_read"]) ?? 0) * 1e6,
|
|
827
|
+
cacheWrite: (readNonNegativeNumberFrom(pricing, ["input_cache_write", "cache_write"]) ?? 0) * 1e6
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
const input = readNonNegativeNumberFrom(record, [
|
|
831
|
+
"input_price_per_million",
|
|
832
|
+
"inputPricePerMillion",
|
|
833
|
+
"prompt_price_per_million"
|
|
834
|
+
]);
|
|
835
|
+
const output = readNonNegativeNumberFrom(record, [
|
|
836
|
+
"output_price_per_million",
|
|
837
|
+
"outputPricePerMillion",
|
|
838
|
+
"completion_price_per_million"
|
|
839
|
+
]);
|
|
840
|
+
if (input === undefined && output === undefined) {
|
|
841
|
+
return undefined;
|
|
842
|
+
}
|
|
843
|
+
return {
|
|
844
|
+
input: input ?? 0,
|
|
845
|
+
output: output ?? 0,
|
|
846
|
+
cacheRead: readNonNegativeNumberFrom(record, ["cache_read_price_per_million", "cacheReadPerMillion"]) ?? 0,
|
|
847
|
+
cacheWrite: readNonNegativeNumberFrom(record, ["cache_write_price_per_million", "cacheWritePerMillion"]) ?? 0
|
|
848
|
+
};
|
|
849
|
+
}
|
|
747
850
|
function asRecord(value) {
|
|
748
851
|
return value && typeof value === "object" ? value : {};
|
|
749
852
|
}
|
|
@@ -875,8 +978,10 @@ function parseOpenRouterModelSnapshotsFromModelsResponse(payload) {
|
|
|
875
978
|
const speech = outputModalities.has("audio");
|
|
876
979
|
const contextWindow = readPositiveNumber(record.context_length) ?? readPositiveNumber(record.context_window) ?? readPositiveNumber(record.contextWindow);
|
|
877
980
|
const maxTokens = readPositiveNumber(topProvider.max_completion_tokens) ?? readPositiveNumber(record.max_tokens) ?? readPositiveNumber(record.maxTokens);
|
|
981
|
+
const price = readModelPrice(record);
|
|
878
982
|
return [{
|
|
879
983
|
id: entry.id,
|
|
984
|
+
...readString(record.name) ? { name: readString(record.name) } : {},
|
|
880
985
|
...input.length > 0 ? { input } : {},
|
|
881
986
|
...reasoning ? { reasoning } : {},
|
|
882
987
|
...tools ? { tools } : {},
|
|
@@ -886,6 +991,7 @@ function parseOpenRouterModelSnapshotsFromModelsResponse(payload) {
|
|
|
886
991
|
...speech ? { speech } : {},
|
|
887
992
|
...contextWindow ? { contextWindow } : {},
|
|
888
993
|
...maxTokens ? { maxTokens } : {},
|
|
994
|
+
...price ? { price } : {},
|
|
889
995
|
source: "catalog"
|
|
890
996
|
}];
|
|
891
997
|
}
|
|
@@ -965,8 +1071,11 @@ function parseGenericModelSnapshotsFromModelsResponse(payload) {
|
|
|
965
1071
|
"outputTokenLimit",
|
|
966
1072
|
"max_completion_tokens"
|
|
967
1073
|
]);
|
|
1074
|
+
const price = readModelPrice(record);
|
|
1075
|
+
const displayName = readString(record.display_name) ?? readString(record.displayName) ?? (readString(record.id) || readString(record.key) || readString(record.model) ? readString(record.name) : undefined);
|
|
968
1076
|
return [{
|
|
969
1077
|
id: normalizeProviderModelId(id),
|
|
1078
|
+
...displayName ? { name: displayName } : {},
|
|
970
1079
|
...input ? { input } : {},
|
|
971
1080
|
...reasoning !== undefined ? { reasoning } : {},
|
|
972
1081
|
...tools !== undefined ? { tools } : {},
|
|
@@ -980,6 +1089,7 @@ function parseGenericModelSnapshotsFromModelsResponse(payload) {
|
|
|
980
1089
|
...thinking.reasoningBudgetSupported !== undefined ? { reasoningBudgetSupported: thinking.reasoningBudgetSupported } : {},
|
|
981
1090
|
...contextWindow ? { contextWindow } : {},
|
|
982
1091
|
...maxTokens ? { maxTokens } : {},
|
|
1092
|
+
...price ? { price } : {},
|
|
983
1093
|
source: "catalog"
|
|
984
1094
|
}];
|
|
985
1095
|
});
|
|
@@ -1087,17 +1197,21 @@ function selectModelSnapshotsByIds(entries, selectedIds, route) {
|
|
|
1087
1197
|
});
|
|
1088
1198
|
}
|
|
1089
1199
|
function selectManifestModelsForNormalUi(modelIds, preferred) {
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1200
|
+
const normalized = normalizeModelIds(modelIds);
|
|
1201
|
+
if (providerCatalogView.getStore() === "available") {
|
|
1202
|
+
return sortWithPreferredOrder(normalized, preferred);
|
|
1203
|
+
}
|
|
1204
|
+
const recommended = new Set(preferred.map((id) => id.toLowerCase()));
|
|
1205
|
+
return sortWithPreferredOrder(normalized.filter((id) => recommended.has(id.toLowerCase())), preferred);
|
|
1092
1206
|
}
|
|
1093
1207
|
function selectOpenAIApiModelsForNormalUi(modelIds) {
|
|
1094
|
-
return
|
|
1208
|
+
return selectManifestModelsForNormalUi(modelIds, OPENAI_API_MODEL_IDS);
|
|
1095
1209
|
}
|
|
1096
1210
|
function selectOpenAISignInModelsForNormalUi(modelIds) {
|
|
1097
|
-
return
|
|
1211
|
+
return selectManifestModelsForNormalUi(modelIds, OPENAI_SIGN_IN_MODEL_IDS);
|
|
1098
1212
|
}
|
|
1099
1213
|
function selectChutesModelsForNormalUi(modelIds) {
|
|
1100
|
-
return
|
|
1214
|
+
return selectManifestModelsForNormalUi(modelIds, CHUTES_MODEL_IDS);
|
|
1101
1215
|
}
|
|
1102
1216
|
function selectAnthropicModelsForNormalUi(modelIds) {
|
|
1103
1217
|
return selectManifestModelsForNormalUi(modelIds, ANTHROPIC_MODEL_IDS);
|
|
@@ -1163,8 +1277,7 @@ function selectDynamicProviderModelsForNormalUi(modelIds) {
|
|
|
1163
1277
|
return normalizeModelIds(modelIds);
|
|
1164
1278
|
}
|
|
1165
1279
|
function selectLitellmModelsForNormalUi(modelIds) {
|
|
1166
|
-
|
|
1167
|
-
return discovered.length > 0 ? discovered : [...LITELLM_MODEL_IDS];
|
|
1280
|
+
return selectDynamicProviderModelsForNormalUi(modelIds);
|
|
1168
1281
|
}
|
|
1169
1282
|
function selectOpenRouterModelsForNormalUi(modelIds) {
|
|
1170
1283
|
return selectManifestModelsForNormalUi(modelIds, OPENROUTER_MODEL_IDS);
|
|
@@ -1176,12 +1289,10 @@ function selectOpencodeZenModelsForNormalUi(modelIds) {
|
|
|
1176
1289
|
return selectManifestModelsForNormalUi(modelIds, OPENCODE_ZEN_MODEL_IDS);
|
|
1177
1290
|
}
|
|
1178
1291
|
function selectHuggingfaceModelsForNormalUi(modelIds) {
|
|
1179
|
-
|
|
1180
|
-
return sortWithPreferredOrder(normalizeModelIds(modelIds).filter((id) => allowed.has(id)), HUGGINGFACE_MODEL_IDS);
|
|
1292
|
+
return selectManifestModelsForNormalUi(modelIds, HUGGINGFACE_MODEL_IDS);
|
|
1181
1293
|
}
|
|
1182
1294
|
function selectVeniceModelsForNormalUi(modelIds) {
|
|
1183
|
-
|
|
1184
|
-
return sortWithPreferredOrder(normalizeModelIds(modelIds).filter((id) => allowed.has(id)), VENICE_MODEL_IDS);
|
|
1295
|
+
return selectManifestModelsForNormalUi(modelIds, VENICE_MODEL_IDS);
|
|
1185
1296
|
}
|
|
1186
1297
|
function readEnv(env, names) {
|
|
1187
1298
|
for (const name of names) {
|
|
@@ -1193,7 +1304,10 @@ function readEnv(env, names) {
|
|
|
1193
1304
|
return undefined;
|
|
1194
1305
|
}
|
|
1195
1306
|
async function fetchJsonCatalog(params) {
|
|
1196
|
-
const response = await params.fetch(params.url, {
|
|
1307
|
+
const response = await params.fetch(params.url, {
|
|
1308
|
+
headers: params.headers,
|
|
1309
|
+
signal: AbortSignal.timeout(PROVIDER_CATALOG_TIMEOUT_MS)
|
|
1310
|
+
});
|
|
1197
1311
|
if (!response.ok) {
|
|
1198
1312
|
throw new Error(`${params.label} model catalog fetch failed: HTTP ${response.status}`);
|
|
1199
1313
|
}
|
|
@@ -1269,7 +1383,25 @@ function cloudflareAiGatewayHeaders(env, providerKey) {
|
|
|
1269
1383
|
}
|
|
1270
1384
|
async function fetchOpenAIProviderRefreshSnapshot(params = {}) {
|
|
1271
1385
|
const fetchImpl = params.fetch ?? fetch;
|
|
1272
|
-
const
|
|
1386
|
+
const token = readEnv(params.env ?? process.env, ["OPENAI_API_KEY"]);
|
|
1387
|
+
if (token) {
|
|
1388
|
+
const payload = await fetchJsonCatalog({
|
|
1389
|
+
fetch: fetchImpl,
|
|
1390
|
+
url: OPENAI_API_MODELS_URL,
|
|
1391
|
+
headers: bearerHeaders(token),
|
|
1392
|
+
label: "OpenAI"
|
|
1393
|
+
});
|
|
1394
|
+
const models = parseGenericModelSnapshotsFromModelsResponse(payload);
|
|
1395
|
+
const ids = selectOpenAIApiModelsForNormalUi(models.map((model) => model.id));
|
|
1396
|
+
return { providers: { [OPENAI_PROVIDER_BRAND_ID]: {
|
|
1397
|
+
missing: { [OPENAI_CODEX_ROUTE_ID]: {
|
|
1398
|
+
reason: "catalog-unsupported",
|
|
1399
|
+
detail: "ChatGPT sign-in models are discovered from the authenticated runtime."
|
|
1400
|
+
} },
|
|
1401
|
+
routes: { [OPENAI_API_ROUTE_ID]: selectModelSnapshotsByIds(models, ids, OPENAI_API_ROUTE_ID) }
|
|
1402
|
+
} } };
|
|
1403
|
+
}
|
|
1404
|
+
const response = await fetchImpl(OPENAI_DOCS_MODELS_URL, { signal: AbortSignal.timeout(PROVIDER_CATALOG_TIMEOUT_MS) });
|
|
1273
1405
|
if (!response.ok) {
|
|
1274
1406
|
throw new Error(`OpenAI docs model fetch failed: HTTP ${response.status}`);
|
|
1275
1407
|
}
|
|
@@ -1280,34 +1412,47 @@ async function fetchOpenAIProviderRefreshSnapshot(params = {}) {
|
|
|
1280
1412
|
reason: "catalog-unsupported",
|
|
1281
1413
|
detail: "OpenAI public model docs do not verify ChatGPT sign-in route compatibility."
|
|
1282
1414
|
} },
|
|
1283
|
-
routes: { [OPENAI_API_ROUTE_ID]: selectOpenAIApiModelsForNormalUi(ids)
|
|
1415
|
+
routes: { [OPENAI_API_ROUTE_ID]: selectOpenAIApiModelsForNormalUi(ids).map((id) => ({
|
|
1416
|
+
id,
|
|
1417
|
+
source: "official-docs"
|
|
1418
|
+
})) }
|
|
1284
1419
|
} } };
|
|
1285
1420
|
}
|
|
1286
1421
|
async function fetchChutesProviderRefreshSnapshot(params = {}) {
|
|
1287
|
-
const
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1422
|
+
const token = readEnv(params.env ?? process.env, ["CHUTES_API_KEY"]);
|
|
1423
|
+
const payload = await fetchJsonCatalog({
|
|
1424
|
+
fetch: params.fetch ?? fetch,
|
|
1425
|
+
url: CHUTES_MODELS_URL,
|
|
1426
|
+
headers: optionalBearerHeaders(token),
|
|
1427
|
+
label: "Chutes"
|
|
1428
|
+
});
|
|
1293
1429
|
const models = parseGenericModelSnapshotsFromModelsResponse(payload);
|
|
1294
1430
|
const ids = models.map((model) => model.id);
|
|
1295
1431
|
return { providers: { [CHUTES_PROVIDER_BRAND_ID]: { routes: { [CHUTES_ROUTE_ID]: selectModelSnapshotsByIds(models, selectChutesModelsForNormalUi(ids), CHUTES_ROUTE_ID) } } } };
|
|
1296
1432
|
}
|
|
1297
1433
|
async function fetchAnthropicProviderRefreshSnapshot(params = {}) {
|
|
1298
|
-
const
|
|
1434
|
+
const env = params.env ?? process.env;
|
|
1435
|
+
const apiKey = readEnv(env, ["ANTHROPIC_API_KEY"]);
|
|
1436
|
+
const oauthToken = readEnv(env, ["ANTHROPIC_OAUTH_TOKEN"]);
|
|
1437
|
+
const token = apiKey ?? oauthToken;
|
|
1299
1438
|
if (!token) {
|
|
1300
1439
|
return missingProviderRoutes(ANTHROPIC_PROVIDER_BRAND_ID, { [ANTHROPIC_ROUTE_ID]: {
|
|
1301
1440
|
reason: "credential-missing",
|
|
1302
|
-
detail: "
|
|
1441
|
+
detail: "Configure Anthropic sign-in, setup-token, or API-key credentials before model discovery."
|
|
1303
1442
|
} });
|
|
1304
1443
|
}
|
|
1305
1444
|
const payload = await fetchJsonCatalog({
|
|
1306
1445
|
fetch: params.fetch ?? fetch,
|
|
1307
1446
|
url: ANTHROPIC_MODELS_URL,
|
|
1308
|
-
headers: {
|
|
1309
|
-
"x-api-key":
|
|
1447
|
+
headers: apiKey ? {
|
|
1448
|
+
"x-api-key": apiKey,
|
|
1310
1449
|
"anthropic-version": "2023-06-01"
|
|
1450
|
+
} : {
|
|
1451
|
+
Authorization: `Bearer ${oauthToken}`,
|
|
1452
|
+
"anthropic-version": "2023-06-01",
|
|
1453
|
+
"anthropic-beta": "claude-code-20250219,oauth-2025-04-20",
|
|
1454
|
+
"user-agent": "fased-agent",
|
|
1455
|
+
"x-app": "cli"
|
|
1311
1456
|
},
|
|
1312
1457
|
label: "Anthropic"
|
|
1313
1458
|
});
|
|
@@ -1370,7 +1515,7 @@ async function fetchXaiProviderRefreshSnapshot(params = {}) {
|
|
|
1370
1515
|
}
|
|
1371
1516
|
const payload = await fetchJsonCatalog({
|
|
1372
1517
|
fetch: params.fetch ?? fetch,
|
|
1373
|
-
url:
|
|
1518
|
+
url: XAI_LANGUAGE_MODELS_URL,
|
|
1374
1519
|
headers: bearerHeaders(token),
|
|
1375
1520
|
label: "xAI"
|
|
1376
1521
|
});
|
|
@@ -1864,56 +2009,73 @@ async function fetchTogetherProviderRefreshSnapshot(params = {}) {
|
|
|
1864
2009
|
return { providers: { [TOGETHER_PROVIDER_BRAND_ID]: { routes: { [TOGETHER_ROUTE_ID]: selectModelSnapshotsByIds(models, ids, TOGETHER_ROUTE_ID) } } } };
|
|
1865
2010
|
}
|
|
1866
2011
|
async function fetchOpenRouterProviderRefreshSnapshot(params = {}) {
|
|
1867
|
-
const
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
2012
|
+
const token = readEnv(params.env ?? process.env, ["OPENROUTER_API_KEY"]);
|
|
2013
|
+
const payload = await fetchJsonCatalog({
|
|
2014
|
+
fetch: params.fetch ?? fetch,
|
|
2015
|
+
url: OPENROUTER_MODELS_URL,
|
|
2016
|
+
headers: optionalBearerHeaders(token),
|
|
2017
|
+
label: "OpenRouter"
|
|
2018
|
+
});
|
|
1873
2019
|
const models = parseOpenRouterModelSnapshotsFromModelsResponse(payload);
|
|
1874
2020
|
const ids = selectOpenRouterModelsForNormalUi(models.map((model) => model.id));
|
|
1875
2021
|
return { providers: { [OPENROUTER_PROVIDER_BRAND_ID]: { routes: { [OPENROUTER_ROUTE_ID]: selectModelSnapshotsByIds(models, ids, OPENROUTER_ROUTE_ID) } } } };
|
|
1876
2022
|
}
|
|
1877
2023
|
async function fetchVercelAiGatewayProviderRefreshSnapshot(params = {}) {
|
|
1878
|
-
const
|
|
1879
|
-
const
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
2024
|
+
const token = readEnv(params.env ?? process.env, ["AI_GATEWAY_API_KEY"]);
|
|
2025
|
+
const payload = await fetchJsonCatalog({
|
|
2026
|
+
fetch: params.fetch ?? fetch,
|
|
2027
|
+
url: VERCEL_AI_GATEWAY_MODELS_URL,
|
|
2028
|
+
headers: optionalBearerHeaders(token),
|
|
2029
|
+
label: "Vercel AI Gateway"
|
|
2030
|
+
});
|
|
1884
2031
|
const models = parseOpenRouterModelSnapshotsFromModelsResponse(payload);
|
|
1885
2032
|
const ids = selectVercelAiGatewayModelsForNormalUi(models.map((model) => model.id));
|
|
1886
2033
|
return { providers: { [VERCEL_AI_GATEWAY_PROVIDER_BRAND_ID]: { routes: { [VERCEL_AI_GATEWAY_ROUTE_ID]: selectModelSnapshotsByIds(models, ids, VERCEL_AI_GATEWAY_ROUTE_ID) } } } };
|
|
1887
2034
|
}
|
|
1888
2035
|
async function fetchOpencodeZenProviderRefreshSnapshot(params = {}) {
|
|
1889
|
-
const
|
|
1890
|
-
const
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
2036
|
+
const token = readEnv(params.env ?? process.env, ["OPENCODE_API_KEY"]);
|
|
2037
|
+
const payload = await fetchJsonCatalog({
|
|
2038
|
+
fetch: params.fetch ?? fetch,
|
|
2039
|
+
url: OPENCODE_ZEN_MODELS_URL,
|
|
2040
|
+
headers: optionalBearerHeaders(token),
|
|
2041
|
+
label: "OpenCode Zen"
|
|
2042
|
+
});
|
|
1895
2043
|
const models = parseOpenRouterModelSnapshotsFromModelsResponse(payload);
|
|
1896
2044
|
const ids = selectOpencodeZenModelsForNormalUi(models.map((model) => model.id));
|
|
1897
2045
|
return { providers: { [OPENCODE_ZEN_PROVIDER_BRAND_ID]: { routes: { [OPENCODE_ZEN_ROUTE_ID]: selectModelSnapshotsByIds(models, ids, OPENCODE_ZEN_ROUTE_ID) } } } };
|
|
1898
2046
|
}
|
|
1899
2047
|
async function fetchHuggingfaceProviderRefreshSnapshot(params = {}) {
|
|
1900
|
-
const
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
2048
|
+
const token = readEnv(params.env ?? process.env, ["HUGGINGFACE_HUB_TOKEN", "HF_TOKEN"]);
|
|
2049
|
+
if (!token) {
|
|
2050
|
+
return missingProviderRoutes(HUGGINGFACE_PROVIDER_BRAND_ID, { [HUGGINGFACE_ROUTE_ID]: {
|
|
2051
|
+
reason: "credential-missing",
|
|
2052
|
+
detail: "Set HUGGINGFACE_HUB_TOKEN/HF_TOKEN or configure a Hugging Face token profile."
|
|
2053
|
+
} });
|
|
1904
2054
|
}
|
|
1905
|
-
const payload = await
|
|
2055
|
+
const payload = await fetchJsonCatalog({
|
|
2056
|
+
fetch: params.fetch ?? fetch,
|
|
2057
|
+
url: HUGGINGFACE_MODELS_URL,
|
|
2058
|
+
headers: bearerHeaders(token),
|
|
2059
|
+
label: "Hugging Face"
|
|
2060
|
+
});
|
|
1906
2061
|
const models = parseHuggingfaceModelSnapshotsFromModelsResponse(payload);
|
|
1907
2062
|
const ids = selectHuggingfaceModelsForNormalUi(models.map((model) => model.id));
|
|
1908
2063
|
return { providers: { [HUGGINGFACE_PROVIDER_BRAND_ID]: { routes: { [HUGGINGFACE_ROUTE_ID]: selectModelSnapshotsByIds(models, ids, HUGGINGFACE_ROUTE_ID) } } } };
|
|
1909
2064
|
}
|
|
1910
2065
|
async function fetchVeniceProviderRefreshSnapshot(params = {}) {
|
|
1911
|
-
const
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
2066
|
+
const token = readEnv(params.env ?? process.env, ["VENICE_API_KEY"]);
|
|
2067
|
+
if (!token) {
|
|
2068
|
+
return missingProviderRoutes(VENICE_PROVIDER_BRAND_ID, { [VENICE_ROUTE_ID]: {
|
|
2069
|
+
reason: "credential-missing",
|
|
2070
|
+
detail: "Set VENICE_API_KEY or configure a Venice API-key auth profile."
|
|
2071
|
+
} });
|
|
1915
2072
|
}
|
|
1916
|
-
const payload = await
|
|
2073
|
+
const payload = await fetchJsonCatalog({
|
|
2074
|
+
fetch: params.fetch ?? fetch,
|
|
2075
|
+
url: VENICE_MODELS_URL,
|
|
2076
|
+
headers: bearerHeaders(token),
|
|
2077
|
+
label: "Venice AI"
|
|
2078
|
+
});
|
|
1917
2079
|
const models = parseVeniceModelSnapshotsFromModelsResponse(payload);
|
|
1918
2080
|
const ids = selectVeniceModelsForNormalUi(models.map((model) => model.id));
|
|
1919
2081
|
return { providers: { [VENICE_PROVIDER_BRAND_ID]: { routes: { [VENICE_ROUTE_ID]: selectModelSnapshotsByIds(models, ids, VENICE_ROUTE_ID) } } } };
|
|
@@ -1924,6 +2086,67 @@ function fetchStaticUnsupportedProviderRefreshSnapshot() {
|
|
|
1924
2086
|
detail: "Direct GitHub Copilot model catalog probing is not implemented; configure Copilot Proxy for a probeable /models route."
|
|
1925
2087
|
} })]);
|
|
1926
2088
|
}
|
|
2089
|
+
function providerRefreshFetcherForBrand(brandId) {
|
|
2090
|
+
switch (brandId) {
|
|
2091
|
+
case OPENAI_PROVIDER_BRAND_ID: return fetchOpenAIProviderRefreshSnapshot;
|
|
2092
|
+
case CHUTES_PROVIDER_BRAND_ID: return fetchChutesProviderRefreshSnapshot;
|
|
2093
|
+
case ANTHROPIC_PROVIDER_BRAND_ID: return fetchAnthropicProviderRefreshSnapshot;
|
|
2094
|
+
case GOOGLE_PROVIDER_BRAND_ID: return fetchGoogleGeminiProviderRefreshSnapshot;
|
|
2095
|
+
case XAI_PROVIDER_BRAND_ID: return fetchXaiProviderRefreshSnapshot;
|
|
2096
|
+
case MISTRAL_PROVIDER_BRAND_ID: return fetchMistralProviderRefreshSnapshot;
|
|
2097
|
+
case VOLCENGINE_PROVIDER_BRAND_ID: return fetchVolcengineProviderRefreshSnapshot;
|
|
2098
|
+
case BYTEPLUS_PROVIDER_BRAND_ID: return fetchBytePlusProviderRefreshSnapshot;
|
|
2099
|
+
case MINIMAX_PROVIDER_BRAND_ID: return fetchMinimaxProviderRefreshSnapshot;
|
|
2100
|
+
case MOONSHOT_PROVIDER_BRAND_ID: return fetchMoonshotProviderRefreshSnapshot;
|
|
2101
|
+
case QWEN_PROVIDER_BRAND_ID: return fetchQwenProviderRefreshSnapshot;
|
|
2102
|
+
case COPILOT_PROVIDER_BRAND_ID: return fetchCopilotProviderRefreshSnapshot;
|
|
2103
|
+
case XIAOMI_PROVIDER_BRAND_ID: return fetchXiaomiProviderRefreshSnapshot;
|
|
2104
|
+
case SYNTHETIC_PROVIDER_BRAND_ID: return fetchSyntheticProviderRefreshSnapshot;
|
|
2105
|
+
case TOGETHER_PROVIDER_BRAND_ID: return fetchTogetherProviderRefreshSnapshot;
|
|
2106
|
+
case OPENROUTER_PROVIDER_BRAND_ID: return fetchOpenRouterProviderRefreshSnapshot;
|
|
2107
|
+
case ZAI_PROVIDER_BRAND_ID: return fetchZaiProviderRefreshSnapshot;
|
|
2108
|
+
case QIANFAN_PROVIDER_BRAND_ID: return fetchQianfanProviderRefreshSnapshot;
|
|
2109
|
+
case VERCEL_AI_GATEWAY_PROVIDER_BRAND_ID: return fetchVercelAiGatewayProviderRefreshSnapshot;
|
|
2110
|
+
case OPENCODE_ZEN_PROVIDER_BRAND_ID: return fetchOpencodeZenProviderRefreshSnapshot;
|
|
2111
|
+
case OLLAMA_PROVIDER_BRAND_ID: return fetchOllamaProviderRefreshSnapshot;
|
|
2112
|
+
case LMSTUDIO_PROVIDER_BRAND_ID: return fetchLmStudioProviderRefreshSnapshot;
|
|
2113
|
+
case VLLM_PROVIDER_BRAND_ID: return fetchVllmProviderRefreshSnapshot;
|
|
2114
|
+
case LITELLM_PROVIDER_BRAND_ID: return fetchLitellmProviderRefreshSnapshot;
|
|
2115
|
+
case CLOUDFLARE_AI_GATEWAY_PROVIDER_BRAND_ID: return fetchCloudflareAiGatewayProviderRefreshSnapshot;
|
|
2116
|
+
case CUSTOM_PROVIDER_BRAND_ID: return fetchCustomProviderRefreshSnapshot;
|
|
2117
|
+
case HUGGINGFACE_PROVIDER_BRAND_ID: return fetchHuggingfaceProviderRefreshSnapshot;
|
|
2118
|
+
case VENICE_PROVIDER_BRAND_ID: return fetchVeniceProviderRefreshSnapshot;
|
|
2119
|
+
default: return undefined;
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
function listProviderRefreshContractGaps(manifests = listProviderBrandManifests()) {
|
|
2123
|
+
return manifests.flatMap((manifest) => providerRefreshFetcherForBrand(manifest.id) ? [] : [`${manifest.id}: no authenticated or operator catalog fetcher`]);
|
|
2124
|
+
}
|
|
2125
|
+
async function fetchProviderRefreshSnapshotForRoutes(params) {
|
|
2126
|
+
return await providerCatalogView.run("available", async () => {
|
|
2127
|
+
const requestedRoutes = new Set([...params.routes].map((route) => route.trim().toLowerCase()).filter(Boolean));
|
|
2128
|
+
const fetchers = new Set();
|
|
2129
|
+
for (const manifest of listProviderBrandManifests()) {
|
|
2130
|
+
const routes = new Set([
|
|
2131
|
+
...manifest.methods.map((method) => method.route.trim().toLowerCase()),
|
|
2132
|
+
...(manifest.modelProviderIds ?? []).map((route) => route.trim().toLowerCase()),
|
|
2133
|
+
...(manifest.routeAliases ?? []).map((route) => route.trim().toLowerCase())
|
|
2134
|
+
]);
|
|
2135
|
+
if (![...routes].some((route) => requestedRoutes.has(route))) {
|
|
2136
|
+
continue;
|
|
2137
|
+
}
|
|
2138
|
+
const fetcher = providerRefreshFetcherForBrand(manifest.id);
|
|
2139
|
+
if (fetcher) {
|
|
2140
|
+
fetchers.add(fetcher);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
const results = await Promise.allSettled([...fetchers].map((fetcher) => fetcher({
|
|
2144
|
+
fetch: params.fetch,
|
|
2145
|
+
env: params.env
|
|
2146
|
+
})));
|
|
2147
|
+
return mergeProviderRefreshSnapshots(results.flatMap((result) => result.status === "fulfilled" ? [result.value] : []));
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
1927
2150
|
function mergeProviderRefreshSnapshots(snapshots) {
|
|
1928
2151
|
const providers = {};
|
|
1929
2152
|
for (const snapshot of snapshots) {
|
|
@@ -1948,8 +2171,14 @@ function mergeProviderRefreshSnapshots(snapshots) {
|
|
|
1948
2171
|
async function fetchOfficialProviderRefreshSnapshot(params = {}) {
|
|
1949
2172
|
const fetchImpl = params.fetch ?? fetch;
|
|
1950
2173
|
const [openai, chutes, anthropic, google, xai, mistral, volcengine, byteplus, minimax, moonshot, qwen, copilot, xiaomi, synthetic, together, openrouter, zai, qianfan, vercelAiGateway, opencodeZen, ollama, lmstudio, vllm, litellm, cloudflareAiGateway, custom, huggingface, venice, staticUnsupported] = await Promise.all([
|
|
1951
|
-
fetchOpenAIProviderRefreshSnapshot({
|
|
1952
|
-
|
|
2174
|
+
fetchOpenAIProviderRefreshSnapshot({
|
|
2175
|
+
fetch: fetchImpl,
|
|
2176
|
+
env: params.env
|
|
2177
|
+
}),
|
|
2178
|
+
fetchChutesProviderRefreshSnapshot({
|
|
2179
|
+
fetch: fetchImpl,
|
|
2180
|
+
env: params.env
|
|
2181
|
+
}),
|
|
1953
2182
|
fetchAnthropicProviderRefreshSnapshot({
|
|
1954
2183
|
fetch: fetchImpl,
|
|
1955
2184
|
env: params.env
|
|
@@ -2002,7 +2231,10 @@ async function fetchOfficialProviderRefreshSnapshot(params = {}) {
|
|
|
2002
2231
|
fetch: fetchImpl,
|
|
2003
2232
|
env: params.env
|
|
2004
2233
|
}),
|
|
2005
|
-
fetchOpenRouterProviderRefreshSnapshot({
|
|
2234
|
+
fetchOpenRouterProviderRefreshSnapshot({
|
|
2235
|
+
fetch: fetchImpl,
|
|
2236
|
+
env: params.env
|
|
2237
|
+
}),
|
|
2006
2238
|
fetchZaiProviderRefreshSnapshot({
|
|
2007
2239
|
fetch: fetchImpl,
|
|
2008
2240
|
env: params.env
|
|
@@ -2011,8 +2243,14 @@ async function fetchOfficialProviderRefreshSnapshot(params = {}) {
|
|
|
2011
2243
|
fetch: fetchImpl,
|
|
2012
2244
|
env: params.env
|
|
2013
2245
|
}),
|
|
2014
|
-
fetchVercelAiGatewayProviderRefreshSnapshot({
|
|
2015
|
-
|
|
2246
|
+
fetchVercelAiGatewayProviderRefreshSnapshot({
|
|
2247
|
+
fetch: fetchImpl,
|
|
2248
|
+
env: params.env
|
|
2249
|
+
}),
|
|
2250
|
+
fetchOpencodeZenProviderRefreshSnapshot({
|
|
2251
|
+
fetch: fetchImpl,
|
|
2252
|
+
env: params.env
|
|
2253
|
+
}),
|
|
2016
2254
|
fetchOllamaProviderRefreshSnapshot({
|
|
2017
2255
|
fetch: fetchImpl,
|
|
2018
2256
|
env: params.env
|
|
@@ -2037,8 +2275,14 @@ async function fetchOfficialProviderRefreshSnapshot(params = {}) {
|
|
|
2037
2275
|
fetch: fetchImpl,
|
|
2038
2276
|
env: params.env
|
|
2039
2277
|
}),
|
|
2040
|
-
fetchHuggingfaceProviderRefreshSnapshot({
|
|
2041
|
-
|
|
2278
|
+
fetchHuggingfaceProviderRefreshSnapshot({
|
|
2279
|
+
fetch: fetchImpl,
|
|
2280
|
+
env: params.env
|
|
2281
|
+
}),
|
|
2282
|
+
fetchVeniceProviderRefreshSnapshot({
|
|
2283
|
+
fetch: fetchImpl,
|
|
2284
|
+
env: params.env
|
|
2285
|
+
}),
|
|
2042
2286
|
Promise.resolve(fetchStaticUnsupportedProviderRefreshSnapshot())
|
|
2043
2287
|
]);
|
|
2044
2288
|
return mergeProviderRefreshSnapshots([
|
|
@@ -2075,4 +2319,4 @@ async function fetchOfficialProviderRefreshSnapshot(params = {}) {
|
|
|
2075
2319
|
}
|
|
2076
2320
|
|
|
2077
2321
|
//#endregion
|
|
2078
|
-
export { applyProviderRefreshToRegistrySource, buildProviderCapabilityOverridesSource, buildProviderRefreshEnvFromCredentials, buildProviderRefreshReport, buildProviderRegistryReviewPatch, fetchOfficialProviderRefreshSnapshot, loadProviderRefreshSnapshotFromFile };
|
|
2322
|
+
export { applyProviderRefreshToRegistrySource, buildProviderCapabilityOverridesSource, buildProviderRefreshEnvFromCredentials, buildProviderRefreshReport, buildProviderRegistryReviewPatch, fetchOfficialProviderRefreshSnapshot, fetchProviderRefreshSnapshotForRoutes, loadProviderRefreshSnapshotFromFile, parseGenericModelSnapshotsFromModelsResponse };
|