mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-04 06:12:10 +03:00
* chore(release): open v3.8.23 development cycle
* fix(anthropic): strip top_p when temperature is set to avoid 400 (#3691)
Integrated into release/v3.8.23
* fix(vertex): support Vertex AI Express-mode API keys (#3690)
Integrated into release/v3.8.23
* fix(stream): error on empty Claude SSE instead of synthetic success (#3689)
Integrated into release/v3.8.23
* fix(oauth): stop token-refresh invalidation loop + harden proxy resolution (#3692)
Integrated into release/v3.8.23
* docs: add FUNDING.yml and Support section to README (#3698)
Integrated into release/v3.8.23
* feat: gemini - handle known ratelimits (#3686)
Integrated into release/v3.8.23
* fix: stream combo fails over on empty content-filtered response (#3685) (#3702)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(antigravity): preserve gemini-3.1-pro high/low budget tiers (#3696) (#3703)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(auto-combo): add auto-updating model intelligence scoring (#3660)
Integrated into release/v3.8.23
* fix(gemini): context-mode fallback for signatureless tool calls (#3688) (#3704)
* chore(quality-gate): reconcile file-size baseline (27 files + providerLimits.ts) (#3705)
* feat(vertex): dynamic model discovery via Generative Language models API (#3712)
Integrated into release/v3.8.23. Vertex dynamic model discovery — surfaces image models (imagen-*, gemini-*-image), embeddings and audio from the live Generative Language catalog, with cached→static fallback and the shared parseGeminiModelsList helper. Validated: parser test 5/5, typecheck:core clean.
* fix(combo): gate reasoning token buffer (#3700)
Integrated into release/v3.8.23. Makes the #3588 reasoning token buffer safe and configurable: only inflates max_tokens when the model has a known, non-default output cap and the buffered value fits inside it; otherwise preserves/clamps the client limit. Adds the reasoningTokenBufferEnabled kill switch (default ON). Validated: combo-routing-engine 81/81, combo-config 25/25, combo-quality-validator-reasoning 12/12, phase1f 10/10, typecheck:core clean.
* refactor(#3501): god-component Phase 1g-1j — client 4062→3408 LOC (-654) (#3717)
Phase 1g-1j of #3501: client 4062→3408 LOC. Pure extraction (ProviderPlaygroundPanel, useCommandCodeAuth, useExternalLinkFlow+ExternalLinkModal, useAuthFileHandlers) + loadConnProxies ReferenceError fix + phase1f test path fix.
Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
* refactor(#3501): god-component Phase 1k-1m — client 3408→2553 LOC (-855) (#3721)
Phase 1k-1m of #3501: client 3408→2553 LOC. Pure extraction (useModelImportHandlers+ImportProgressModal, useModelVisibilityHandlers, ProviderModelsSection).
Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
* docs(changelog): restore #3590 bullet lost on the v3.8.20 release branch
The fix itself reached main pre-tag via cherry-pick #3591, but its changelog
bullet (commit e33fdd4ab) only ever existed on release/v3.8.20 after the
squash-merge. Restored under [3.8.20] per the 2026-06-12 release-branch
leftover audit (_tasks/release-audit/release-leftovers-audit-2026-06-12.md).
* fix(kiro): resolve quota for IAM Identity Center accounts missing a profileArn (#3722)
Integrated into release/v3.8.23
* refactor(#3501): god-component Phase 1n-1s — client 2553→1376 LOC (-1177) (#3725)
Phase 1n-1s of #3501: client 2553→1376 LOC. Pure extraction (ConnectionsListPanel, ConnectionsHeaderToolbar, ZedImportCard, BatchTestResultsModal, AdaptaTutorialModal, useApiKeySave + helpers).
Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
* feat(model-lockout): settings UI, backend integration, error classification, and success-decay recovery (#3629)
Integrated into release/v3.8.23
* refactor(#3501): god-component Phase 1t — client 1376→781 LOC (≤800 TARGET REACHED ✅) (#3727)
Phase 1t of #3501: client 1376→781 LOC (≤800 reached). Original god-component 12,882→781 (−94%).
Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
* fix: bundle @omniroute/opencode-plugin inside omniroute + add 'setup opencode' CLI command (#3726)
Integrated into release/v3.8.23
* feat(vertex): self-tracked USD spend since account added (#3724)
Integrated into release/v3.8.23
* fix(qwen-web): migrate to v2 chat API with full cookie-jar replay (#3288) (#3723)
Integrated into release/v3.8.23
* fix(sse): make safeLogEvents async — 'await' in a sync function broke every chatHelpers import
#3692 added a lazy 'await import(proxyEgress)' for egress-IP visibility inside
safeLogEvents, which is a sync function — an ES syntax error. It went unnoticed
because typecheck:core does not cover src/sse and no test in the merge gates
loaded chatHelpers via tsx; any consumer that did (chat-context-relay and
chat-route-coverage suites, integration harnesses) failed at module load with
'await can only be used inside an async function'.
safeLogEvents is fire-and-forget logging with an outer try/catch, so making it
async (and 'void'-ing the single chat.ts call site) preserves behavior exactly.
Validation: tests/unit/chat-context-relay.test.ts + chat-route-coverage.test.ts
went from failing-at-load to green (+14 tests destravados).
* fix(sse): remove cross-provider credential leak in emergency fallback + combo/proxy audit fixes (#3699)
Integrated into release/v3.8.23
* fix(executors): inject MiMoCode anti-abuse marker so free endpoint stops 403ing (#3728)
Integrated into release/v3.8.23
* fix(dashboard): repair "Test all models" — toast crash, status icons, auto-hide (#3729)
Integrated into release/v3.8.23
* chore(deps): bump actions/upload-artifact from 4 to 7 (#3735)
Integrated into release/v3.8.23 — aligns upload-artifact to v7 (already used across ci.yml).
* chore(deps): bump actions/cache from 4 to 5 (#3734)
Integrated into release/v3.8.23 — actions/cache v4→v5.
* chore(deps): bump actions/download-artifact from 4 to 8 (#3733)
Integrated into release/v3.8.23 — download-artifact v4→v8.
* feat(fallback): add OMNIROUTE_EMERGENCY_FALLBACK env switch (#3741)
Adds an OMNIROUTE_EMERGENCY_FALLBACK env switch to disable the emergency budget-exhaustion fallback (reroute to free nvidia/gpt-oss-120b). Default unchanged (enabled). Closes #3739, related #2879.
Integrated into release/v3.8.23.
* i18n: comprehensive zh-CN translation improvements (#3736)
Aligns zh-CN to en (hundreds of entries), translates batch-action labels + settings sidebar menu, adds categoryConfig/endpointTokenSaver keys, resolves __MISSING__ stubs. Sidebar/SidebarTab hardcoded strings replaced with t(). en.json purely additive (8 new sidebar.* keys, 0 removed); cli-i18n gate green.
Integrated into release/v3.8.23.
* chore(release): v3.8.23 — 2026-06-12
- CHANGELOG: complete v3.8.23 section (28 bullets, 27 commits)
- fix(webdav): resolve promise on writeStream finish, not req end — eliminates
intermittent 500 on PUT update (writeStream may not have flushed at rename time)
- test(autoCombo): stub DB calls from PR #3660 in tieredRotation.test.ts to prevent
5s timeout in vitest (getModelIntelligenceBySource DB init path)
- chore(env-sync): add XDG_DATA_HOME + OMNIROUTE_OPENCODE_PLUGIN_DIR to IGNORE_FROM_CODE
allowlist (introduced by PR #3726 setup-open-code.mjs, not OmniRoute config vars)
- chore(cli): regenerated bin/cli/api-commands/*.mjs (7 new, 27 updated)
* fix(model-family): fallback lookup also tries bare model name with dots
getNextFamilyFallback normalized dots-to-hyphens ("gemini-3.1-pro-high" →
"gemini-3-1-pro-high") but MODEL_FAMILIES keys use the literal dot form. The
lookup always missed, returning null for any model whose dots are part of the
name rather than a version separator.
Fallback: try MODEL_FAMILIES[lookupKey] ?? MODEL_FAMILIES[bareModel] so both
naming conventions are covered. Fixes T30 test (pre-existing since v3.8.22).
* feat: expose API key cost drilldown + quota % used (#3742)
Adds all-time USD cost per API key in the API Key Manager, a per-key deep-link into the Cost Explorer (filtered + grouped by model), URL-param hydration of range/groupBy/apiKeyIds, and a '% used' quota display. Review adjustments: extracted URL-param parsers to a tested module (Rule #18), i18n'd the new strings (en + zh-CN), dropped the redundant webdav-handler entry already on release.
Integrated into release/v3.8.23.
* feat: add provider display modes — All / Configured / Compact (#3743)
Replaces the Providers page configured-only toggle with All/Configured/Compact display modes (Compact = flat deduped grid, no-auth last). Persists the preference and migrates the legacy localStorage key. Rebased onto release/v3.8.23.
Integrated into release/v3.8.23.
* fix(cache): scope semantic-cache signature to API key (#3740)
Adds the api_key_id dimension to generateSignature's SHA-256 hash so two callers with different API keys never receive each other's cached responses. Threads apiKeyId through checkSemanticCache + both write sites; migration 098 clears pre-existing key-less entries; unauthenticated requests stay isolated from keyed ones. 3 TDD tests.
Integrated into release/v3.8.23.
* fix(responses): apply OpenAI Responses API stream=false spec default (#3708)
resolveStreamFlag now applies the stream=false-when-omitted default for sourceFormat=openai-responses (same as the existing claude path), so spec-compliant /v1/responses upstreams that return JSON no longer fall through to the wildcard-Accept heuristic and trigger STREAM_EARLY_EOF / 502. Codex CLI (stream:true) and explicit text/event-stream clients unaffected.
Integrated into release/v3.8.23.
* chore(release): reconcile CI gates for v3.8.23
- file-size baseline: re-freeze 8 files grown by PRs #3742/#3743/#3740
(cost drilldown, provider display modes, cache key isolation)
- ARCHITECTURE.md: update executor count 55→60 (check:docs-counts drift)
- .env.example: add OMNIROUTE_EMERGENCY_FALLBACK (#3741, env-doc-sync)
- CHANGELOG: add formatted bullets for #3742, #3743, #3708, #3740,
model-family-fallback fix; remove duplicate raw ### Fixed section
* test: restore assert count to satisfy check:test-masking gate
Three test files had net assertion removals after behavior-changing PRs:
- chatcore-translation-paths: emergency fallback moved to routing layer
(#3699) — add body error assertion + model-name guard
- executor-vertex-extended: non-JSON is now Express API key (#3690) —
add projects/-path guard to the express-key URL test
- stream-utils: empty streams now emit error (#3685) — add code/message/
status/completePayload guards to both passthrough and translate variants
All new assertions are meaningful (code enum value, 5xx range, non-empty
message, onComplete must-not-fire contract).
* fix(ci): move rtl-logical-classes test to ui/ so vitest:ui runner collects it
---------
Co-authored-by: Felipe Almeman <4226997+zhiru@users.noreply.github.com>
Co-authored-by: NOXX - Commiter <artur1992123@mail.ru>
Co-authored-by: Nick Sullivan <142708+TechNickAI@users.noreply.github.com>
Co-authored-by: Markus Hartung <mail@hartmark.se>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: PizzaV <103120356+pizzav-xyz@users.noreply.github.com>
Co-authored-by: Randi <55005611+rdself@users.noreply.github.com>
Co-authored-by: oyi77 <14921983+oyi77@users.noreply.github.com>
Co-authored-by: Chewji <126886556+Chewji9875@users.noreply.github.com>
Co-authored-by: Hernan Javier Ardila Sanchez <hjasgr@gmail.com>
Co-authored-by: Felipe Sartori <felipesartori.ti@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zois Pagoulatos <zpagoulatos@hotmail.com>
Co-authored-by: sdfsdfw2 <167810361+sdfsdfw2@users.noreply.github.com>
Co-authored-by: Witroch4 <witalo_rocha@hotmail.com>
766 lines
31 KiB
TypeScript
766 lines
31 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
const providerPageUtils =
|
|
await import("../../src/app/(dashboard)/dashboard/providers/providerPageUtils.ts");
|
|
const providerPageStorage =
|
|
await import("../../src/app/(dashboard)/dashboard/providers/providerPageStorage.ts");
|
|
const providers = await import("../../src/shared/constants/providers.ts");
|
|
const providerCatalog = await import("../../src/lib/providers/catalog.ts");
|
|
|
|
test("merged OAuth providers keep free-tier providers in the OAuth section", () => {
|
|
const statsCalls = [];
|
|
const getProviderStats = (providerId, authType) => {
|
|
statsCalls.push({ providerId, authType });
|
|
return { total: authType === "free" ? 1 : 0 };
|
|
};
|
|
|
|
const mockOauthProviders = { claude: { name: "Claude" } };
|
|
const mockFreeProviders = { "gemini-cli": { name: "Gemini CLI" } };
|
|
|
|
const entries = providerPageUtils.buildMergedOAuthProviderEntries(
|
|
mockOauthProviders,
|
|
mockFreeProviders,
|
|
getProviderStats
|
|
);
|
|
|
|
const oauthIds = Object.keys(mockOauthProviders);
|
|
const freeIds = Object.keys(mockFreeProviders);
|
|
|
|
assert.deepEqual(
|
|
entries.slice(0, oauthIds.length).map((entry) => entry.providerId),
|
|
oauthIds
|
|
);
|
|
assert.deepEqual(
|
|
entries.slice(oauthIds.length).map((entry) => entry.providerId),
|
|
freeIds
|
|
);
|
|
|
|
const freeEntry = entries.find((entry) => entry.providerId === freeIds[0]);
|
|
assert.ok(freeEntry, "Should find the free entry");
|
|
assert.equal(freeEntry.displayAuthType, "oauth");
|
|
assert.equal(freeEntry.toggleAuthType, "free");
|
|
assert.equal(
|
|
statsCalls.some((call) => call.providerId === freeIds[0] && call.authType === "free"),
|
|
true
|
|
);
|
|
});
|
|
|
|
test("configured-only filter keeps only providers with saved connections", () => {
|
|
const entries = [
|
|
{
|
|
providerId: "claude",
|
|
provider: { id: "claude" },
|
|
stats: { total: 2 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
{
|
|
providerId: "codex",
|
|
provider: { id: "codex" },
|
|
stats: { total: 0 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
{
|
|
providerId: "cursor",
|
|
provider: { id: "cursor" },
|
|
stats: { total: 1 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
];
|
|
|
|
const visible = providerPageUtils.filterConfiguredProviderEntries(entries, true);
|
|
|
|
assert.deepEqual(
|
|
visible.map((entry) => entry.providerId),
|
|
["claude", "cursor"]
|
|
);
|
|
assert.equal(providerPageUtils.filterConfiguredProviderEntries(entries, false).length, 3);
|
|
});
|
|
|
|
test("configured-only filter keeps no-auth providers even without a saved connection (#3290)", () => {
|
|
const entries = [
|
|
{
|
|
providerId: "claude",
|
|
provider: { id: "claude" },
|
|
stats: { total: 0 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
{
|
|
providerId: "opencode",
|
|
provider: { id: "opencode" },
|
|
stats: { total: 0 },
|
|
displayAuthType: "no-auth",
|
|
toggleAuthType: "no-auth",
|
|
},
|
|
{
|
|
providerId: "duckduckgo-web",
|
|
provider: { id: "duckduckgo-web" },
|
|
stats: { total: 0 },
|
|
displayAuthType: "no-auth",
|
|
toggleAuthType: "no-auth",
|
|
},
|
|
];
|
|
|
|
// no-auth providers never create a DB connection row (total === 0) but are
|
|
// always usable and appear in /v1/models — they must survive the filter.
|
|
const visible = providerPageUtils.filterConfiguredProviderEntries(entries, true);
|
|
assert.deepEqual(
|
|
visible.map((entry) => entry.providerId),
|
|
["duckduckgo-web", "opencode"]
|
|
);
|
|
});
|
|
|
|
test("compact provider entries dedupe providers and move no-auth entries to the end", () => {
|
|
const openRouterFromFree = {
|
|
providerId: "openrouter",
|
|
provider: { id: "openrouter", name: "OpenRouter" },
|
|
stats: { total: 1 },
|
|
displayAuthType: "apikey",
|
|
toggleAuthType: "apikey",
|
|
};
|
|
const openRouterFromAggregator = {
|
|
providerId: "openrouter",
|
|
provider: { id: "openrouter", name: "OpenRouter" },
|
|
stats: { total: 1 },
|
|
displayAuthType: "apikey",
|
|
toggleAuthType: "apikey",
|
|
};
|
|
const claude = {
|
|
providerId: "claude",
|
|
provider: { id: "claude", name: "Claude" },
|
|
stats: { total: 1 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
};
|
|
const opencode = {
|
|
providerId: "opencode",
|
|
provider: { id: "opencode", name: "OpenCode" },
|
|
stats: { total: 0 },
|
|
displayAuthType: "no-auth",
|
|
toggleAuthType: "no-auth",
|
|
};
|
|
|
|
const visible = providerPageUtils.buildCompactProviderEntries(
|
|
[[opencode, openRouterFromFree], [claude, openRouterFromAggregator], [opencode]],
|
|
{ deferNoAuth: true }
|
|
);
|
|
|
|
assert.deepEqual(
|
|
visible.map((entry) => entry.providerId),
|
|
["openrouter", "claude", "opencode"]
|
|
);
|
|
assert.equal(visible.filter((entry) => entry.providerId === "openrouter").length, 1);
|
|
});
|
|
|
|
test("compact provider entries prefer non-no-auth duplicates over deferred no-auth entries", () => {
|
|
const noAuthEntry = {
|
|
providerId: "opencode",
|
|
provider: { id: "opencode", name: "OpenCode" },
|
|
stats: { total: 0 },
|
|
displayAuthType: "no-auth",
|
|
toggleAuthType: "no-auth",
|
|
};
|
|
const configuredEntry = {
|
|
providerId: "opencode",
|
|
provider: { id: "opencode", name: "OpenCode" },
|
|
stats: { total: 1 },
|
|
displayAuthType: "apikey",
|
|
toggleAuthType: "apikey",
|
|
};
|
|
|
|
const visible = providerPageUtils.buildCompactProviderEntries(
|
|
[[noAuthEntry], [configuredEntry]],
|
|
{ deferNoAuth: true }
|
|
);
|
|
|
|
assert.equal(visible.length, 1);
|
|
assert.equal(visible[0].providerId, "opencode");
|
|
assert.equal(visible[0].displayAuthType, "apikey");
|
|
});
|
|
|
|
test("search filter matches provider name and id case-insensitively", () => {
|
|
const entries = [
|
|
{
|
|
providerId: "claude",
|
|
provider: { id: "claude", name: "Claude" },
|
|
stats: { total: 2 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
{
|
|
providerId: "openai",
|
|
provider: { id: "openai", name: "OpenAI" },
|
|
stats: { total: 1 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
{
|
|
providerId: "gemini",
|
|
provider: { id: "gemini", name: "Google Gemini" },
|
|
stats: { total: 1 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
];
|
|
|
|
const byName = providerPageUtils.filterConfiguredProviderEntries(entries, false, "claude");
|
|
assert.deepEqual(
|
|
byName.map((e) => e.providerId),
|
|
["claude"]
|
|
);
|
|
|
|
const byNameCaseInsensitive = providerPageUtils.filterConfiguredProviderEntries(
|
|
entries,
|
|
false,
|
|
"OPENAI"
|
|
);
|
|
assert.deepEqual(
|
|
byNameCaseInsensitive.map((e) => e.providerId),
|
|
["openai"]
|
|
);
|
|
|
|
const byPartialName = providerPageUtils.filterConfiguredProviderEntries(entries, false, "google");
|
|
assert.deepEqual(
|
|
byPartialName.map((e) => e.providerId),
|
|
["gemini"]
|
|
);
|
|
|
|
const byId = providerPageUtils.filterConfiguredProviderEntries(entries, false, "gem");
|
|
assert.deepEqual(
|
|
byId.map((e) => e.providerId),
|
|
["gemini"]
|
|
);
|
|
|
|
const noMatch = providerPageUtils.filterConfiguredProviderEntries(entries, false, "xyz");
|
|
assert.equal(noMatch.length, 0);
|
|
|
|
const emptySearch = providerPageUtils.filterConfiguredProviderEntries(entries, false, "");
|
|
assert.equal(emptySearch.length, 3);
|
|
|
|
const whitespaceSearch = providerPageUtils.filterConfiguredProviderEntries(entries, false, " ");
|
|
assert.equal(whitespaceSearch.length, 3);
|
|
});
|
|
|
|
test("search and configured-only filters work together", () => {
|
|
const entries = [
|
|
{
|
|
providerId: "claude",
|
|
provider: { id: "claude", name: "Claude" },
|
|
stats: { total: 2 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
{
|
|
providerId: "openai",
|
|
provider: { id: "openai", name: "OpenAI" },
|
|
stats: { total: 0 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
{
|
|
providerId: "gemini",
|
|
provider: { id: "gemini", name: "Google Gemini" },
|
|
stats: { total: 1 },
|
|
displayAuthType: "oauth",
|
|
toggleAuthType: "oauth",
|
|
},
|
|
];
|
|
|
|
const configuredAndSearched = providerPageUtils.filterConfiguredProviderEntries(
|
|
entries,
|
|
true,
|
|
"claude"
|
|
);
|
|
assert.deepEqual(
|
|
configuredAndSearched.map((e) => e.providerId),
|
|
["claude"]
|
|
);
|
|
|
|
const configuredButNoMatch = providerPageUtils.filterConfiguredProviderEntries(
|
|
entries,
|
|
true,
|
|
"openai"
|
|
);
|
|
assert.equal(configuredButNoMatch.length, 0);
|
|
});
|
|
|
|
test("configured-only preference parser only enables explicit true values", () => {
|
|
assert.equal(providerPageStorage.parseConfiguredOnlyPreference("true"), true);
|
|
assert.equal(providerPageStorage.parseConfiguredOnlyPreference("false"), false);
|
|
assert.equal(providerPageStorage.parseConfiguredOnlyPreference(null), false);
|
|
assert.equal(providerPageStorage.parseConfiguredOnlyPreference(undefined), false);
|
|
});
|
|
|
|
test("provider display mode preference parser accepts only known modes", () => {
|
|
assert.equal(providerPageStorage.parseProviderDisplayModePreference("all"), "all");
|
|
assert.equal(providerPageStorage.parseProviderDisplayModePreference("configured"), "configured");
|
|
assert.equal(providerPageStorage.parseProviderDisplayModePreference("compact"), "compact");
|
|
assert.equal(providerPageStorage.parseProviderDisplayModePreference("true"), null);
|
|
assert.equal(providerPageStorage.parseProviderDisplayModePreference(null), null);
|
|
});
|
|
|
|
test("configured-only filter is ignored before the first provider is connected", () => {
|
|
assert.equal(providerPageUtils.shouldApplyConfiguredOnlyFilter(true, 0), false);
|
|
assert.equal(providerPageUtils.shouldApplyConfiguredOnlyFilter(false, 0), false);
|
|
assert.equal(providerPageUtils.shouldApplyConfiguredOnlyFilter(true, 1), true);
|
|
});
|
|
|
|
test("compact display mode always uses the configured provider set", () => {
|
|
assert.equal(providerPageUtils.shouldFilterProviderEntriesForDisplayMode("all", 0), false);
|
|
assert.equal(providerPageUtils.shouldFilterProviderEntriesForDisplayMode("all", 2), false);
|
|
assert.equal(providerPageUtils.shouldFilterProviderEntriesForDisplayMode("configured", 0), false);
|
|
assert.equal(providerPageUtils.shouldFilterProviderEntriesForDisplayMode("configured", 2), true);
|
|
assert.equal(providerPageUtils.shouldFilterProviderEntriesForDisplayMode("compact", 0), true);
|
|
assert.equal(providerPageUtils.shouldFilterProviderEntriesForDisplayMode("compact", 2), true);
|
|
});
|
|
|
|
test("first-provider hint is shown only when no providers are connected and search is empty", () => {
|
|
assert.equal(providerPageUtils.shouldShowFirstProviderHint(0, ""), true);
|
|
assert.equal(providerPageUtils.shouldShowFirstProviderHint(0, " "), true);
|
|
assert.equal(providerPageUtils.shouldShowFirstProviderHint(0, "codex"), false);
|
|
assert.equal(providerPageUtils.shouldShowFirstProviderHint(1, ""), false);
|
|
});
|
|
|
|
test("configured-only preference storage round-trips correctly", () => {
|
|
const storage = new Map();
|
|
const mockStorage = {
|
|
getItem(key) {
|
|
return storage.has(key) ? storage.get(key) : null;
|
|
},
|
|
setItem(key, value) {
|
|
storage.set(key, value);
|
|
},
|
|
removeItem(key) {
|
|
storage.delete(key);
|
|
},
|
|
};
|
|
|
|
assert.equal(providerPageStorage.readConfiguredOnlyPreference(mockStorage), false);
|
|
|
|
providerPageStorage.writeConfiguredOnlyPreference(true, mockStorage);
|
|
assert.equal(storage.get(providerPageStorage.SHOW_CONFIGURED_ONLY_STORAGE_KEY), "true");
|
|
assert.equal(providerPageStorage.readConfiguredOnlyPreference(mockStorage), true);
|
|
|
|
providerPageStorage.writeConfiguredOnlyPreference(false, mockStorage);
|
|
assert.equal(storage.has(providerPageStorage.SHOW_CONFIGURED_ONLY_STORAGE_KEY), false);
|
|
assert.equal(providerPageStorage.readConfiguredOnlyPreference(mockStorage), false);
|
|
});
|
|
|
|
test("provider display mode storage round-trips and migrates the old configured-only key", () => {
|
|
const storage = new Map();
|
|
const mockStorage = {
|
|
getItem(key) {
|
|
return storage.has(key) ? storage.get(key) : null;
|
|
},
|
|
setItem(key, value) {
|
|
storage.set(key, value);
|
|
},
|
|
removeItem(key) {
|
|
storage.delete(key);
|
|
},
|
|
};
|
|
|
|
assert.equal(providerPageStorage.readProviderDisplayModePreference(mockStorage), "all");
|
|
|
|
storage.set(providerPageStorage.SHOW_CONFIGURED_ONLY_STORAGE_KEY, "true");
|
|
assert.equal(providerPageStorage.readProviderDisplayModePreference(mockStorage), "configured");
|
|
assert.equal(storage.get(providerPageStorage.PROVIDER_DISPLAY_MODE_STORAGE_KEY), "configured");
|
|
assert.equal(storage.has(providerPageStorage.SHOW_CONFIGURED_ONLY_STORAGE_KEY), false);
|
|
|
|
providerPageStorage.writeProviderDisplayModePreference("compact", mockStorage);
|
|
assert.equal(storage.get(providerPageStorage.PROVIDER_DISPLAY_MODE_STORAGE_KEY), "compact");
|
|
assert.equal(storage.has(providerPageStorage.SHOW_CONFIGURED_ONLY_STORAGE_KEY), false);
|
|
assert.equal(providerPageStorage.readProviderDisplayModePreference(mockStorage), "compact");
|
|
|
|
providerPageStorage.writeProviderDisplayModePreference("all", mockStorage);
|
|
assert.equal(storage.has(providerPageStorage.PROVIDER_DISPLAY_MODE_STORAGE_KEY), false);
|
|
assert.equal(providerPageStorage.readProviderDisplayModePreference(mockStorage), "all");
|
|
});
|
|
|
|
test("static catalog entries resolve local, search, audio, web-cookie and upstream providers", () => {
|
|
const freeProvider = providerPageUtils.resolveDashboardProviderInfo("amazon-q");
|
|
const localProvider = providerPageUtils.resolveDashboardProviderInfo("sdwebui");
|
|
const localChatProvider = providerPageUtils.resolveDashboardProviderInfo("lm-studio");
|
|
const lemonadeProvider = providerPageUtils.resolveDashboardProviderInfo("lemonade");
|
|
const searchProvider = providerPageUtils.resolveDashboardProviderInfo("brave-search");
|
|
const youcomSearchProvider = providerPageUtils.resolveDashboardProviderInfo("youcom-search");
|
|
const audioProvider = providerPageUtils.resolveDashboardProviderInfo("assemblyai");
|
|
const awsPollyProvider = providerPageUtils.resolveDashboardProviderInfo("aws-polly");
|
|
const webCookieProvider = providerPageUtils.resolveDashboardProviderInfo("grok-web");
|
|
const apiKeyProvider = providerPageUtils.resolveDashboardProviderInfo("glhf");
|
|
const gitlabProvider = providerPageUtils.resolveDashboardProviderInfo("gitlab");
|
|
const gitlabDuoProvider = providerPageUtils.resolveDashboardProviderInfo("gitlab-duo");
|
|
const chutesProvider = providerPageUtils.resolveDashboardProviderInfo("chutes");
|
|
const datarobotProvider = providerPageUtils.resolveDashboardProviderInfo("datarobot");
|
|
const clarifaiProvider = providerPageUtils.resolveDashboardProviderInfo("clarifai");
|
|
const empowerProvider = providerPageUtils.resolveDashboardProviderInfo("empower");
|
|
const nousProvider = providerPageUtils.resolveDashboardProviderInfo("nous-research");
|
|
const poeProvider = providerPageUtils.resolveDashboardProviderInfo("poe");
|
|
const azureOpenAiProvider = providerPageUtils.resolveDashboardProviderInfo("azure-openai");
|
|
const azureAiProvider = providerPageUtils.resolveDashboardProviderInfo("azure-ai");
|
|
const watsonxProvider = providerPageUtils.resolveDashboardProviderInfo("watsonx");
|
|
const ociProvider = providerPageUtils.resolveDashboardProviderInfo("oci");
|
|
const sapProvider = providerPageUtils.resolveDashboardProviderInfo("sap");
|
|
const modalProvider = providerPageUtils.resolveDashboardProviderInfo("modal");
|
|
const rekaProvider = providerPageUtils.resolveDashboardProviderInfo("reka");
|
|
const nlpCloudProvider = providerPageUtils.resolveDashboardProviderInfo("nlpcloud");
|
|
const runwayProvider = providerPageUtils.resolveDashboardProviderInfo("runwayml");
|
|
const embeddingProvider = providerPageUtils.resolveDashboardProviderInfo("voyage-ai");
|
|
const rerankProvider = providerPageUtils.resolveDashboardProviderInfo("jina-ai");
|
|
const perplexityWebProvider = providerPageUtils.resolveDashboardProviderInfo("perplexity-web");
|
|
const blackboxWebProvider = providerPageUtils.resolveDashboardProviderInfo("blackbox-web");
|
|
const museSparkWebProvider = providerPageUtils.resolveDashboardProviderInfo("muse-spark-web");
|
|
const upstreamProvider = providerPageUtils.resolveDashboardProviderInfo("cliproxyapi");
|
|
|
|
assert.equal(freeProvider?.category, "oauth");
|
|
assert.equal(freeProvider?.name, providers.OAUTH_PROVIDERS["amazon-q"].name);
|
|
|
|
assert.equal(localProvider?.category, "local");
|
|
assert.equal(localProvider?.name, providers.LOCAL_PROVIDERS.sdwebui.name);
|
|
assert.equal(localChatProvider?.category, "local");
|
|
assert.equal(localChatProvider?.name, providers.LOCAL_PROVIDERS["lm-studio"].name);
|
|
assert.equal(lemonadeProvider?.category, "local");
|
|
assert.equal(lemonadeProvider?.name, providers.LOCAL_PROVIDERS.lemonade.name);
|
|
|
|
assert.equal(searchProvider?.category, "search");
|
|
assert.equal(searchProvider?.name, providers.SEARCH_PROVIDERS["brave-search"].name);
|
|
assert.equal(youcomSearchProvider?.category, "search");
|
|
assert.equal(youcomSearchProvider?.name, providers.SEARCH_PROVIDERS["youcom-search"].name);
|
|
|
|
assert.equal(audioProvider?.category, "audio");
|
|
assert.equal(audioProvider?.name, providers.AUDIO_ONLY_PROVIDERS.assemblyai.name);
|
|
assert.equal(awsPollyProvider?.category, "audio");
|
|
assert.equal(awsPollyProvider?.name, providers.AUDIO_ONLY_PROVIDERS["aws-polly"].name);
|
|
|
|
assert.equal(apiKeyProvider?.category, "apikey");
|
|
assert.equal(apiKeyProvider?.name, providers.APIKEY_PROVIDERS.glhf.name);
|
|
assert.equal(gitlabProvider?.category, "apikey");
|
|
assert.equal(gitlabProvider?.name, providers.APIKEY_PROVIDERS.gitlab.name);
|
|
assert.equal(gitlabDuoProvider?.category, "oauth");
|
|
assert.equal(gitlabDuoProvider?.name, providers.OAUTH_PROVIDERS["gitlab-duo"].name);
|
|
assert.equal(chutesProvider?.category, "apikey");
|
|
assert.equal(chutesProvider?.name, providers.APIKEY_PROVIDERS.chutes.name);
|
|
assert.equal(datarobotProvider?.category, "apikey");
|
|
assert.equal(datarobotProvider?.name, providers.APIKEY_PROVIDERS.datarobot.name);
|
|
assert.equal(clarifaiProvider?.category, "apikey");
|
|
assert.equal(clarifaiProvider?.name, providers.APIKEY_PROVIDERS.clarifai.name);
|
|
assert.equal(empowerProvider?.category, "apikey");
|
|
assert.equal(empowerProvider?.name, providers.APIKEY_PROVIDERS.empower.name);
|
|
assert.equal(nousProvider?.category, "apikey");
|
|
assert.equal(nousProvider?.name, providers.APIKEY_PROVIDERS["nous-research"].name);
|
|
assert.equal(poeProvider?.category, "apikey");
|
|
assert.equal(poeProvider?.name, providers.APIKEY_PROVIDERS.poe.name);
|
|
assert.equal(azureOpenAiProvider?.category, "apikey");
|
|
assert.equal(azureOpenAiProvider?.name, providers.APIKEY_PROVIDERS["azure-openai"].name);
|
|
assert.equal(azureAiProvider?.category, "apikey");
|
|
assert.equal(azureAiProvider?.name, providers.APIKEY_PROVIDERS["azure-ai"].name);
|
|
assert.equal(watsonxProvider?.category, "apikey");
|
|
assert.equal(watsonxProvider?.name, providers.APIKEY_PROVIDERS.watsonx.name);
|
|
assert.equal(ociProvider?.category, "apikey");
|
|
assert.equal(ociProvider?.name, providers.APIKEY_PROVIDERS.oci.name);
|
|
assert.equal(sapProvider?.category, "apikey");
|
|
assert.equal(sapProvider?.name, providers.APIKEY_PROVIDERS.sap.name);
|
|
assert.equal(modalProvider?.category, "apikey");
|
|
assert.equal(modalProvider?.name, providers.APIKEY_PROVIDERS.modal.name);
|
|
assert.equal(rekaProvider?.category, "apikey");
|
|
assert.equal(rekaProvider?.name, providers.APIKEY_PROVIDERS.reka.name);
|
|
assert.equal(nlpCloudProvider?.category, "apikey");
|
|
assert.equal(nlpCloudProvider?.name, providers.APIKEY_PROVIDERS.nlpcloud.name);
|
|
assert.equal(runwayProvider?.category, "apikey");
|
|
assert.equal(runwayProvider?.name, providers.APIKEY_PROVIDERS.runwayml.name);
|
|
|
|
assert.equal(embeddingProvider?.category, "apikey");
|
|
assert.equal(embeddingProvider?.name, providers.APIKEY_PROVIDERS["voyage-ai"].name);
|
|
|
|
assert.equal(rerankProvider?.category, "apikey");
|
|
assert.equal(rerankProvider?.name, providers.APIKEY_PROVIDERS["jina-ai"].name);
|
|
|
|
assert.equal(webCookieProvider?.category, "web-cookie");
|
|
assert.equal(webCookieProvider?.name, providers.WEB_COOKIE_PROVIDERS["grok-web"].name);
|
|
|
|
assert.equal(perplexityWebProvider?.category, "web-cookie");
|
|
assert.equal(perplexityWebProvider?.name, providers.WEB_COOKIE_PROVIDERS["perplexity-web"].name);
|
|
|
|
assert.equal(blackboxWebProvider?.category, "web-cookie");
|
|
assert.equal(blackboxWebProvider?.name, providers.WEB_COOKIE_PROVIDERS["blackbox-web"].name);
|
|
|
|
assert.equal(museSparkWebProvider?.category, "web-cookie");
|
|
assert.equal(museSparkWebProvider?.name, providers.WEB_COOKIE_PROVIDERS["muse-spark-web"].name);
|
|
|
|
assert.equal(upstreamProvider?.category, "upstream-proxy");
|
|
assert.equal(
|
|
upstreamProvider?.name,
|
|
providerCatalog.STATIC_PROVIDER_CATALOG_GROUPS["upstream-proxy"].providers.cliproxyapi.name
|
|
);
|
|
});
|
|
|
|
test("managed provider connection ids include supported static categories and exclude upstream proxy", () => {
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("qoder"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("glhf"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("gitlab"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("cablyai"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("thebai"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("fenayai"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("chutes"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("datarobot"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("clarifai"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("empower"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("nous-research"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("poe"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("azure-openai"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("azure-ai"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("bedrock"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("watsonx"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("oci"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("sap"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("modal"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("reka"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("nlpcloud"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("runwayml"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("voyage-ai"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("jina-ai"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("sdwebui"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("lm-studio"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("vllm"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("lemonade"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("assemblyai"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("aws-polly"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("grok-web"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("perplexity-web"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("blackbox-web"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("muse-spark-web"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("brave-search"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("youcom-search"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("cliproxyapi"), false);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("claude"), false);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("jules"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("devin"), true);
|
|
assert.equal(providerCatalog.isManagedProviderConnectionId("codex-cloud"), true);
|
|
});
|
|
|
|
test("grok-web taxonomy stays web-cookie only and does not leak into api-key entries", () => {
|
|
assert.equal("grok-web" in providers.APIKEY_PROVIDERS, false);
|
|
assert.equal("grok-web" in providers.WEB_COOKIE_PROVIDERS, true);
|
|
assert.equal("sdwebui" in providers.APIKEY_PROVIDERS, false);
|
|
assert.equal("sdwebui" in providers.LOCAL_PROVIDERS, true);
|
|
assert.equal("lm-studio" in providers.APIKEY_PROVIDERS, false);
|
|
assert.equal("lm-studio" in providers.LOCAL_PROVIDERS, true);
|
|
assert.equal("vllm" in providers.APIKEY_PROVIDERS, false);
|
|
assert.equal("vllm" in providers.LOCAL_PROVIDERS, true);
|
|
assert.equal("lemonade" in providers.APIKEY_PROVIDERS, false);
|
|
assert.equal("lemonade" in providers.LOCAL_PROVIDERS, true);
|
|
assert.equal("comfyui" in providers.APIKEY_PROVIDERS, false);
|
|
assert.equal("comfyui" in providers.LOCAL_PROVIDERS, true);
|
|
assert.equal("blackbox-web" in providers.APIKEY_PROVIDERS, false);
|
|
assert.equal("blackbox-web" in providers.WEB_COOKIE_PROVIDERS, true);
|
|
assert.equal("muse-spark-web" in providers.APIKEY_PROVIDERS, false);
|
|
assert.equal("muse-spark-web" in providers.WEB_COOKIE_PROVIDERS, true);
|
|
assert.equal("glhf" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("gitlab" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("gitlab-duo" in providers.OAUTH_PROVIDERS, true);
|
|
assert.equal("cablyai" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("thebai" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("fenayai" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("chutes" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("datarobot" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("clarifai" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("empower" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("nous-research" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("poe" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("azure-ai" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("bedrock" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("watsonx" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("oci" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("sap" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("modal" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("reka" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("nlpcloud" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("runwayml" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("voyage-ai" in providers.APIKEY_PROVIDERS, true);
|
|
assert.equal("jina-ai" in providers.APIKEY_PROVIDERS, true);
|
|
|
|
const apiKeyEntries = providerPageUtils.buildStaticProviderEntries("apikey", () => ({
|
|
total: 0,
|
|
}));
|
|
const localEntries = providerPageUtils.buildStaticProviderEntries("local", () => ({
|
|
total: 0,
|
|
}));
|
|
const webCookieEntries = providerPageUtils.buildStaticProviderEntries("web-cookie", () => ({
|
|
total: 0,
|
|
}));
|
|
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "sdwebui"),
|
|
false
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "comfyui"),
|
|
false
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "lm-studio"),
|
|
false
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "vllm"),
|
|
false
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "lemonade"),
|
|
false
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "grok-web"),
|
|
false
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "glhf"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "gitlab"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "cablyai"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "thebai"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "fenayai"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "chutes"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "datarobot"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "clarifai"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "empower"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "nous-research"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "poe"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "azure-ai"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "bedrock"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "watsonx"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "oci"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "sap"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "modal"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "reka"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "nlpcloud"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "runwayml"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "voyage-ai"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
apiKeyEntries.some((entry) => entry.providerId === "jina-ai"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
localEntries.some((entry) => entry.providerId === "sdwebui"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
localEntries.some((entry) => entry.providerId === "comfyui"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
localEntries.some((entry) => entry.providerId === "lm-studio"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
localEntries.some((entry) => entry.providerId === "vllm"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
localEntries.some((entry) => entry.providerId === "lemonade"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
webCookieEntries.some((entry) => entry.providerId === "grok-web"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
webCookieEntries.some((entry) => entry.providerId === "blackbox-web"),
|
|
true
|
|
);
|
|
assert.equal(
|
|
webCookieEntries.some((entry) => entry.providerId === "muse-spark-web"),
|
|
true
|
|
);
|
|
});
|
|
|
|
test("compatible catalog entries keep dynamic compatible metadata", () => {
|
|
const compatibleProvider = providerPageUtils.resolveDashboardProviderInfo(
|
|
"openai-compatible-lab",
|
|
{
|
|
providerNode: {
|
|
id: "openai-compatible-lab",
|
|
type: "openai-compatible",
|
|
apiType: "responses",
|
|
baseUrl: "https://example.test",
|
|
},
|
|
compatibleLabels: {
|
|
ccCompatibleName: "CC Compatible",
|
|
anthropicCompatibleName: "Anthropic Compatible",
|
|
openAiCompatibleName: "OpenAI Compatible",
|
|
},
|
|
}
|
|
);
|
|
|
|
assert.equal(compatibleProvider?.category, "compatible");
|
|
assert.equal(compatibleProvider?.displayAuthType, "compatible");
|
|
assert.equal(compatibleProvider?.toggleAuthType, "apikey");
|
|
assert.equal(compatibleProvider?.apiType, "responses");
|
|
assert.equal(compatibleProvider?.baseUrl, "https://example.test");
|
|
});
|