import { listMediaUnderstandingProviders } from "./registry.js";
//#region src/media-understanding/resolve-entries.ts
/**
* Resolve configured media model entries for a capability.
*
* Ported subset of openclaw/src/media-understanding/resolve.ts (`resolveModelEntries`).
*/
function resolveModelEntries(params) {
	const registry = new Map(listMediaUnderstandingProviders().map((provider) => [provider.id.toLowerCase(), provider]));
	const entries = [...(params.capabilityModels ?? []).map((entry) => ({
		entry,
		source: "capability"
	})), ...(params.sharedModels ?? []).map((entry) => ({
		entry,
		source: "shared"
	}))];
	if (entries.length === 0) return [];
	return entries.filter(({ entry, source }) => {
		if (entry.type === "cli") return false;
		const providerId = entry.provider?.trim().toLowerCase();
		if (!providerId && !entry.command) return source === "capability";
		const caps = entry.capabilities;
		if (!caps || caps.length === 0) {
			if (source === "shared") return false;
			return true;
		}
		if (!caps.includes(params.capability)) return false;
		if (providerId && !registry.has(providerId)) return source === "capability";
		return true;
	}).map(({ entry }) => entry);
}
//#endregion
export { resolveModelEntries };

//# sourceMappingURL=resolve-entries.js.map