import { getProviderDisplayName, getRegisteredAdapter, getRegisteredAdapterIds, isRegisteredProvider, listRegisteredProviders } from "./registry.js";
import "./adapters/store/adapter.js";
import "./adapters/skillhub/adapter.js";
import "./adapters/clawhub/adapter.js";
//#region src/agent/skills/marketplace/resolve-adapter.ts
/** Resolve the default marketplace provider from env / config. */
function resolveSkillsMarketplaceProvider(config) {
	const env = process.env.XOPC_SKILLS_MARKETPLACE_PROVIDER?.trim().toLowerCase();
	if (env && isRegisteredProvider(env)) return env;
	const fromConfig = config.gateway?.skillsMarketplaceProvider?.trim().toLowerCase();
	if (fromConfig && isRegisteredProvider(fromConfig)) return fromConfig;
	return "skillhub";
}
function getMarketplaceProviderDisplayName(provider) {
	return getProviderDisplayName(provider);
}
function getMarketplaceAdapterForProvider(id) {
	const adapter = getRegisteredAdapter(id);
	if (!adapter) throw new Error(`Unknown marketplace provider: "${id}". Registered: ${getRegisteredAdapterIds().join(", ")}`);
	return adapter;
}
function getMarketplaceAdapter(config) {
	return getMarketplaceAdapterForProvider(resolveSkillsMarketplaceProvider(config));
}
//#endregion
export { getMarketplaceAdapter, getMarketplaceAdapterForProvider, getMarketplaceProviderDisplayName, isRegisteredProvider, listRegisteredProviders, resolveSkillsMarketplaceProvider };

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