import { isRegisteredProvider, listRegisteredProviders, registerMarketplaceAdapter } from "./marketplace/registry.js";
import { getMarketplaceAdapter, getMarketplaceAdapterForProvider, getMarketplaceProviderDisplayName, resolveSkillsMarketplaceProvider } from "./marketplace/resolve-adapter.js";
//#region src/agent/skills/skills-marketplace.ts
function marketplaceAdapter(config, provider) {
	if (provider && isRegisteredProvider(provider)) return getMarketplaceAdapterForProvider(provider);
	return getMarketplaceAdapter(config);
}
async function listMarketplaceCategories(config, provider) {
	return { items: await marketplaceAdapter(config, provider).listCategories(config) };
}
async function listMarketplacePackages(config, params, provider) {
	return marketplaceAdapter(config, provider).listPackages(config, params);
}
async function getMarketplacePackageDetail(config, packageName, provider) {
	return marketplaceAdapter(config, provider).getPackageDetail(config, packageName);
}
async function downloadFromMarketplace(config, packageName, version, provider) {
	return marketplaceAdapter(config, provider).downloadPackage(config, packageName, version);
}
//#endregion
export { downloadFromMarketplace, getMarketplaceAdapter, getMarketplacePackageDetail, getMarketplaceProviderDisplayName, isRegisteredProvider, listMarketplaceCategories, listMarketplacePackages, listRegisteredProviders, registerMarketplaceAdapter, resolveSkillsMarketplaceProvider };

//# sourceMappingURL=skills-marketplace.js.map