mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-20 06:02:14 +03:00
- canonical executable manifest (bin/cli/cli-manifest.mjs): run/configure/completion derive targets, aliases and --model wiring from one table; drift test cross-checks manifest x cliRuntime x UI catalog (tests/unit/cli/cli-manifest-drift.test.ts) - dashboard Codex generator converged to ~/.codex/config.toml (modern Codex v0.137+, verified against codex-cli 0.147.0): conservative merge, env_key auth (key never written), refuses invalid TOML, reports legacy config.yaml as migration note - omniroute run gemini: launcher over OmniRoute's /v1beta surface via GOOGLE_GEMINI_BASE_URL + isolated GEMINI_CLI_HOME forcing gemini-api-key auth (contract proven against @google/gemini-cli 0.50.0); ACP registration kept distinct - opt-in real smoke harness for upstream CLIs (RUN_CLI_SMOKE=1, credential by env NAME, redacted output): tests/integration/upstream-cli-smoke.int.test.ts - container-guard homologation for POST /api/cli-tools/apply (422 in container, dry-run preview allowed, host write passes) + docs; guard untouched - typecheck: omniglyphAdapter union narrowing, usageTracking typed signatures (UsageLike, no any), models.ts isValidModel params — typecheck:core and typecheck:noimplicit:core now clean - relay core (prior session of this effort): omniroute run for 6 CLIs, configure picker with per-context favorites/recents, contexts with optional keychain + 0600 fallback, provider CRUD with recursive redaction, completion updates, docs
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
// Import directly from file to avoid pulling in server-side dependencies via index.js
|
|
export {
|
|
PROVIDER_MODELS,
|
|
getProviderModels,
|
|
getDefaultModel,
|
|
isValidModel as isValidModelCore,
|
|
findModelName,
|
|
getModelTargetFormat,
|
|
PROVIDER_ID_TO_ALIAS,
|
|
getModelsByProviderId,
|
|
} from "@omniroute/open-sse/config/providerModels.ts";
|
|
|
|
import {
|
|
AI_PROVIDERS,
|
|
isAnthropicCompatibleProvider,
|
|
isOpenAICompatibleProvider,
|
|
} from "./providers";
|
|
import { PROVIDER_MODELS as MODELS } from "@omniroute/open-sse/config/providerModels.ts";
|
|
|
|
// Providers that accept any model (passthrough)
|
|
const PASSTHROUGH_PROVIDERS = new Set(
|
|
Object.entries(AI_PROVIDERS)
|
|
.filter(([, p]) => (p as any).passthroughModels)
|
|
.flatMap(([key, provider]) => {
|
|
const alias = (provider as { alias?: unknown }).alias;
|
|
return typeof alias === "string" && alias.length > 0 ? [key, alias] : [key];
|
|
})
|
|
);
|
|
|
|
// Wrap isValidModel with passthrough providers
|
|
export function isValidModel(aliasOrId: string, modelId: string) {
|
|
if (isOpenAICompatibleProvider(aliasOrId)) return true;
|
|
if (isAnthropicCompatibleProvider(aliasOrId)) return true;
|
|
if (PASSTHROUGH_PROVIDERS.has(aliasOrId)) return true;
|
|
const models = MODELS[aliasOrId];
|
|
if (!models) return false;
|
|
return models.some((m) => m.id === modelId);
|
|
}
|
|
|
|
// Legacy AI_MODELS for backward compatibility
|
|
export const AI_MODELS = Object.entries(MODELS).flatMap(([alias, models]) =>
|
|
models.map((m) => ({ provider: alias, model: m.id, name: m.name }))
|
|
);
|