import { n as resolveSealseekApiContext, t as createSealseekShareClient } from "./sealseek-share-client-CN4eoXzW.js";
//#region src/commands/skill-share-enterprise.ts
async function runEnterpriseList(keyword, deps) {
	const log = deps.log ?? console.log;
	const ctx = resolveSealseekApiContext("user", deps.env);
	if (!ctx.token) throw new Error("未登录，请先完成设备登录");
	const items = await createSealseekShareClient({
		ctx,
		fetchImpl: deps.fetchImpl
	}).listEnterpriseSkills(keyword);
	if (items.length === 0) {
		log("（本企业暂无共享技能）");
		return;
	}
	for (const it of items) log(`${it.owned ? "✓" : " "} ${it.name}  ${it.title}  v${it.version ?? "-"}  [id=${it.skillId}]`);
}
async function runEnterpriseInstall(skillId, deps) {
	const ctx = resolveSealseekApiContext("user", deps.env);
	if (!ctx.token) throw new Error("未登录，请先完成设备登录");
	await createSealseekShareClient({
		ctx,
		fetchImpl: deps.fetchImpl
	}).installEnterpriseSkill(skillId);
	(deps.log ?? console.log)(`已安装企业技能 id=${skillId}（下次同步生效）`);
}
//#endregion
export { runEnterpriseInstall, runEnterpriseList };
