UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

26 lines (25 loc) 884 B
import { i as parseModelCatalogRef } from "./model-catalog-refs-BdjEHOKQ.js"; import { c as stripSelfProviderModelPrefix, n as normalizeBuiltInProviderModelId } from "./provider-model-id-normalization-BFjPahr6.js"; //#region src/plugins/model-allowlist.ts function compileModelAllowlist(params) { const models = /* @__PURE__ */ new Set(); let allowAny = false; for (const raw of params.values ?? []) { const trimmed = raw.trim(); if (trimmed === "*") { allowAny = true; continue; } const parsed = parseModelCatalogRef(trimmed); if (!parsed) continue; const modelId = normalizeBuiltInProviderModelId(parsed.provider, stripSelfProviderModelPrefix(parsed.provider, parsed.modelId)); models.add(params.formatKey(parsed.provider, modelId)); } return { configured: params.configured, allowAny, models }; } //#endregion export { compileModelAllowlist as t };