mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 12:52:55 +00:00
Route internal model catalog imports to the extracted @openclaw/model-catalog-core package and delete obsolete internal facades. Keep public SDK declarations self-contained by wrapping core helpers at public boundaries instead of leaking private package imports. Verification: - pnpm test src/plugins/contracts/model-catalog-core-imports.test.ts src/plugins/sdk-alias.test.ts packages/model-catalog-core/src/configured-model-refs.test.ts packages/model-catalog-core/src/provider-model-id-normalize.test.ts packages/model-catalog-core/src/provider-model-id-normalization.test.ts src/config/config.model-ref-validation.test.ts src/agents/model-selection.test.ts src/plugin-sdk/provider-model-shared.test.ts -- --reporter=verbose - pnpm check:test-types - pnpm test:extensions:package-boundary:compile - pnpm build - rg "@openclaw/model-catalog-core" dist/plugin-sdk packages/plugin-sdk/dist -n --glob '*.d.ts' || true - git diff --check - autoreview clean after fix CI note: merged with admin override because checks-node-agentic-commands-doctor and checks-node-core-runtime-infra-state failed twice with exit 143/no-output watchdog termination after prior passing test output, while relevant local proof and the rest of CI were green.
21 lines
911 B
TypeScript
21 lines
911 B
TypeScript
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
|
|
import type { PluginManifestRecord } from "./manifest-registry.js";
|
|
|
|
type SetupDescriptorRecord = Pick<
|
|
PluginManifestRecord,
|
|
"providers" | "cliBackends" | "providerAuthAliases" | "setup"
|
|
>;
|
|
|
|
export function listSetupProviderIds(record: SetupDescriptorRecord): readonly string[] {
|
|
const providerIds = record.setup?.providers?.map((entry) => entry.id) ?? record.providers;
|
|
const normalizedProviderIds = new Set(providerIds.map(normalizeProviderId));
|
|
const aliases = Object.entries(record.providerAuthAliases ?? {})
|
|
.filter(([, target]) => normalizedProviderIds.has(normalizeProviderId(target)))
|
|
.map(([alias]) => alias);
|
|
return [...providerIds, ...aliases];
|
|
}
|
|
|
|
export function listSetupCliBackendIds(record: SetupDescriptorRecord): readonly string[] {
|
|
return record.setup?.cliBackends ?? record.cliBackends;
|
|
}
|