import { i as normalizeModelCatalogProviderId } from "./model-catalog-normalize-V3qo99NY.js";
import { c as resolveEffectiveEnableState, s as normalizePluginsConfig } from "./config-state-DOXxUmcC.js";
import { n as loadOpenClawProviderIndex, t as planProviderIndexModelCatalogRows } from "./model-catalog-B2pPFwBH.js";
//#region src/commands/models/list.provider-index-catalog.ts
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 };
