openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
26 lines (25 loc) • 784 B
JavaScript
import { i as parseModelCatalogRef } from "./model-catalog-refs-Bk2MNoCv.mjs";
import { n as normalizeBuiltInProviderModelId, s as stripSelfProviderModelPrefix } from "./provider-model-id-normalization-Yii1-7Le.mjs";
//#region src/plugins/model-allowlist.ts
function compileModelAllowlist(e) {
const t = /* @__PURE__ */ new Set();
let n = false;
for (const r of e.values ?? []) {
const i = r.trim();
if (i === "*") {
n = true;
continue;
}
const a = parseModelCatalogRef(i);
if (!a) continue;
const o = normalizeBuiltInProviderModelId(a.provider, stripSelfProviderModelPrefix(a.provider, a.modelId));
t.add(e.formatKey(a.provider, o));
}
return {
configured: e.configured,
allowAny: n,
models: t
};
}
//#endregion
export { compileModelAllowlist as t };