openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
22 lines (21 loc) • 1.16 kB
JavaScript
import { i as normalizeModelCatalogProviderId } from "./model-catalog-normalize-CkJjoy4K.js";
import { c as resolveEffectiveEnableState, s as normalizePluginsConfig } from "./config-state-CikNNz7T.js";
import { n as loadOpenClawProviderIndex, t as planProviderIndexModelCatalogRows } from "./model-catalog-DfA8Fq9U.js";
//#region src/commands/models/list.provider-index-catalog.ts
/** Provider-index-backed model catalog rows for bundled model-list output. */
/** Loads enabled bundled provider-index catalog rows, optionally scoped by provider. */
function loadProviderIndexCatalogRowsForList(params) {
const providerFilter = params.providerFilter ? normalizeModelCatalogProviderId(params.providerFilter) : void 0;
return planProviderIndexModelCatalogRows({
index: loadOpenClawProviderIndex(),
...providerFilter ? { providerFilter } : {}
}).entries.filter((entry) => resolveEffectiveEnableState({
id: entry.pluginId,
origin: "bundled",
config: normalizePluginsConfig(params.cfg.plugins),
rootConfig: params.cfg,
enabledByDefault: true
}).enabled).flatMap((entry) => entry.rows);
}
//#endregion
export { loadProviderIndexCatalogRowsForList };