async function e(e){if(!(!e.client||!e.connected)){e.skillsManagerLoading=!0,e.requestUpdate?.();try{e.skillsManagerInstalled=await e.client.request(`skills.status`,{}),e.skillsManagerError=null}catch(t){e.skillsManagerError=String(t)}finally{e.skillsManagerLoading=!1,e.requestUpdate?.()}}}async function t(e,t){if(!(!e.client||!e.connected)){e.skillsManagerSearchQuery=t,e.requestUpdate?.();try{e.skillsManagerSearchResults=(await e.client.request(`skills.search`,{query:t,limit:20})).results??[]}catch{e.skillsManagerSearchResults=[]}e.requestUpdate?.()}}async function n(t,n){if(!(!t.client||!t.connected)){t.skillsManagerInstalling=!0,t.skillsManagerActionSlug=n,t.requestUpdate?.();try{await t.client.request(`skills.install`,{source:`clawhub`,slug:n}),t.skillsManagerError=null}catch(e){t.skillsManagerError=String(e)}finally{t.skillsManagerInstalling=!1,t.skillsManagerActionSlug=null,t.requestUpdate?.(),await e(t)}}}async function r(t,n){if(!(!t.client||!t.connected)){t.skillsManagerUpdating=!0,t.skillsManagerActionSlug=n,t.requestUpdate?.();try{await t.client.request(`skills.update`,{source:`clawhub`,slug:n}),t.skillsManagerError=null}catch(e){t.skillsManagerError=String(e)}finally{t.skillsManagerUpdating=!1,t.skillsManagerActionSlug=null,t.requestUpdate?.(),await e(t)}}}export{n as installSkill,e as loadSkillsInstalled,t as searchSkills,r as updateSkill};
//# sourceMappingURL=skills-manager-B75Sxkl6.js.map