@easbot/skills 0.3.14 → 0.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/chunks/{blob-SCUVTYVE.cjs → blob-RYNC3CVY.cjs} +1 -1
  2. package/dist/chunks/{chunk-NH4TYEPW.mjs → chunk-5DAHAO55.mjs} +1 -1
  3. package/dist/chunks/{chunk-AQYRRXU5.mjs → chunk-6OLPTZDO.mjs} +2 -2
  4. package/dist/chunks/{chunk-5BDDXFOF.mjs → chunk-BQ6QWQEM.mjs} +1 -1
  5. package/dist/chunks/{chunk-5RWSXDNO.cjs → chunk-BWDTT6SA.cjs} +2 -2
  6. package/dist/chunks/chunk-CF3VBJAY.mjs +265 -0
  7. package/dist/chunks/chunk-HOK3SUH4.cjs +22 -0
  8. package/dist/chunks/{chunk-UGHF4GOW.cjs → chunk-IJI72D6W.cjs} +2 -2
  9. package/dist/chunks/{chunk-ISMGLHYS.cjs → chunk-JUNIAQ2A.cjs} +1 -1
  10. package/dist/chunks/{chunk-DFBKA5A6.cjs → chunk-LJ63Q26N.cjs} +1 -1
  11. package/dist/chunks/{chunk-2E6BHPFV.cjs → chunk-TXYXJIUS.cjs} +46 -46
  12. package/dist/chunks/chunk-UUZB3HCD.mjs +22 -0
  13. package/dist/chunks/chunk-Y6D5Z6AU.mjs +1 -0
  14. package/dist/chunks/cli-handler-5WWBIOMA.mjs +1 -0
  15. package/dist/chunks/cli-handler-PQCHQKLK.cjs +1 -0
  16. package/dist/chunks/installer-3ZLHOVAO.cjs +1 -0
  17. package/dist/chunks/{installer-NJN3PT5F.mjs → installer-UUEXYC7I.mjs} +1 -1
  18. package/dist/chunks/{interfaces-5BH4K5TM.cjs → interfaces-T3TO7GQW.cjs} +1 -1
  19. package/dist/chunks/local-lock-KNX2RUIV.cjs +1 -0
  20. package/dist/chunks/{local-lock-ZHTDWYXF.mjs → local-lock-UYZTKIET.mjs} +1 -1
  21. package/dist/chunks/scan-6EBCZDVK.cjs +1 -0
  22. package/dist/chunks/scan-BZA5LEZN.mjs +1 -0
  23. package/dist/chunks/{skill-lock-MNRZ7TIX.mjs → skill-lock-CDMLVBYH.mjs} +1 -1
  24. package/dist/chunks/skill-lock-WPACLO4W.cjs +1 -0
  25. package/dist/chunks/store-2ULHEVHS.cjs +1 -0
  26. package/dist/chunks/{store-UJPPYDBG.mjs → store-FRXO6UWU.mjs} +1 -1
  27. package/dist/chunks/{telemetry-B4PS27S5.cjs → telemetry-TAVF3FAM.cjs} +1 -1
  28. package/dist/cli.cjs +1 -1
  29. package/dist/cli.mjs +1 -1
  30. package/dist/index.cjs +1 -1
  31. package/dist/index.d.cts +1 -0
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.mjs +1 -1
  34. package/package.json +7 -7
  35. package/dist/chunks/chunk-6NTEYECA.mjs +0 -22
  36. package/dist/chunks/chunk-J6PRUXFG.mjs +0 -265
  37. package/dist/chunks/chunk-JCOXRETY.cjs +0 -22
  38. package/dist/chunks/chunk-ML6B4IQL.mjs +0 -1
  39. package/dist/chunks/cli-handler-3FSM4C7L.mjs +0 -1
  40. package/dist/chunks/cli-handler-B6H4RZEM.cjs +0 -1
  41. package/dist/chunks/installer-YDJBZTQ7.cjs +0 -1
  42. package/dist/chunks/local-lock-SPZB3AB7.cjs +0 -1
  43. package/dist/chunks/scan-6W47D2KJ.mjs +0 -1
  44. package/dist/chunks/scan-L6UNVP3V.cjs +0 -1
  45. package/dist/chunks/skill-lock-VX2HGPTY.cjs +0 -1
  46. package/dist/chunks/store-TSS4BMBF.cjs +0 -1
  47. /package/dist/chunks/{chunk-GWUDKZEH.cjs → chunk-BWPPLYIF.cjs} +0 -0
@@ -1,19 +1,19 @@
1
- 'use strict';var chunkQ2MOP5ZW_cjs=require('./chunk-Q2MOP5ZW.cjs'),chunk5RWSXDNO_cjs=require('./chunk-5RWSXDNO.cjs'),chunkDFBKA5A6_cjs=require('./chunk-DFBKA5A6.cjs'),chunkUGHF4GOW_cjs=require('./chunk-UGHF4GOW.cjs'),chunkJCOXRETY_cjs=require('./chunk-JCOXRETY.cjs'),chunkISMGLHYS_cjs=require('./chunk-ISMGLHYS.cjs'),chunkXGUPIAAF_cjs=require('./chunk-XGUPIAAF.cjs'),chunkDNE3XPCJ_cjs=require('./chunk-DNE3XPCJ.cjs'),chunkE7AHWFZN_cjs=require('./chunk-E7AHWFZN.cjs'),chunkGWUDKZEH_cjs=require('./chunk-GWUDKZEH.cjs'),fs$1=require('fs'),os=require('os'),path=require('path'),utils=require('@easbot/utils'),terminal=require('@easbot/terminal'),promises=require('fs/promises'),crypto=require('crypto'),url=require('url'),Ol=require('readline'),child_process=require('child_process');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Ol__namespace=/*#__PURE__*/_interopNamespace(Ol);async function el(e){let t=crypto.createHash("sha256");try{let s=await promises.readFile(path.join(e,"SKILL.md"),"utf-8");t.update("SKILL.md"),t.update(s);}catch{t.update("EMPTY");}return t.digest("hex")}async function ns(e,t){let s;try{s=await promises.lstat(e);}catch{return "absent"}if(s.isSymbolicLink())try{let u=utils.Filesystem.toUnixPath(await promises.realpath(e)),p=utils.Filesystem.toUnixPath(await promises.realpath(t));return u===p?"symlinked":"orphan"}catch{return "orphan"}let n=path.join(e,"SKILL.md");try{await promises.access(n);}catch{return "absent"}if(!await chunkJCOXRETY_cjs.y(n))return "divergent";let o=await el(e),r=await el(t);return o===r?"copied":"divergent"}function tl(e,t){let s=[];for(let n of e)for(let l of ["global","project"]){let o=n.cells[l];o.state==="absent"?s.push({kind:"install",agentId:n.agentId,scope:l,mode:t,targetPath:o.targetPath}):o.state==="symlinked"||o.state==="copied"?s.push({kind:"skip",agentId:n.agentId,scope:l,state:o.state}):s.push({kind:"report",agentId:n.agentId,scope:l,state:o.state});}return s}async function sl(e,t){let s=[],n=[];for(let l of e)if(l.kind!=="skip"){if(l.kind==="report"){n.push(l);continue}try{await promises.mkdir(path.dirname(l.targetPath),{recursive:!0});let o;l.mode==="symlink"?o=await chunkUGHF4GOW_cjs.i(t.sourceDir,l.targetPath,{isGlobal:t.installGlobally&&l.scope==="global",agentType:l.agentId,cwd:t.cwd}):o=await chunkUGHF4GOW_cjs.j(t.sourceDir,l.targetPath,{agentType:l.agentId,isGlobal:t.installGlobally&&l.scope==="global"}),o.success?(o.symlinkFailed,s.push(l)):n.push({kind:"report",agentId:l.agentId,scope:l.scope,state:"divergent"});}catch{n.push({kind:"report",agentId:l.agentId,scope:l.scope,state:"divergent"});}}return {installed:s,reported:n}}function ll(e,t){let s=[];for(let n of e)if(n==="eve"&&t.includeEveSubagents!==false){let l=chunkISMGLHYS_cjs.f(t.cwd);if(l.length===0)s.push($n(t));else for(let o of l)s.push({agentId:n,cells:{global:et("global",n,true,t,o),project:et("project",n,false,t,o)}});}else s.push({agentId:n,cells:{global:et("global",n,true,t),project:et("project",n,false,t)}});return s}function et(e,t,s,n,l){return {scope:e,state:"absent",targetPath:path.join(chunkUGHF4GOW_cjs.g(t,s,n.cwd,l),n.skillId),sourceDir:n.sourceDir}}function $n(e){return {agentId:"eve",cells:{global:et("global","eve",true,e),project:et("project","eve",false,e)}}}async function is(e){let t=e.cwd??process.cwd(),s=utils.Filesystem.toUnixPath(e.sourceDir),n=e.includeEveSubagents??true;if(e.assumeYes)return {skipped:true,installed:[],reported:[]};let l=ll(e.targetAgents,{skillId:e.skillId,sourceDir:s,cwd:t,includeEveSubagents:n}),o=[];for(let d of l){let h={...d.cells.global,state:await ns(d.cells.global.targetPath,s)},f={...d.cells.project,state:await ns(d.cells.project.targetPath,s)};o.push({agentId:d.agentId,cells:{global:h,project:f}});}let r=tl(o,e.defaultMode),{installed:u,reported:p}=await sl(r,{sourceDir:s,installGlobally:e.installGlobally,cwd:t});return {skipped:false,installed:u,reported:p,matrix:o}}function Ct(e){return chunk5RWSXDNO_cjs.h(chunk5RWSXDNO_cjs.g(chunk5RWSXDNO_cjs.f(` ${e} `)))}var wn="/opt/.devin",nl="easbot",vn="cursor",An="cursor-cli",xn="claude",Tn="cowork",Ln="devin",In="replit",jn="gemini",Pn="codex",_n="antigravity",Cn="augment-cli",Rn="opencode",rs="github-copilot",Nn="github-copilot-cli",ol="v0";async function il(){if(process.env.AI_AGENT){let e=process.env.AI_AGENT.trim();if(e)return e===nl?{isAgent:true,agent:{name:nl}}:e===rs||e===Nn?{isAgent:true,agent:{name:rs}}:e===ol?{isAgent:true,agent:{name:ol}}:{isAgent:true,agent:{name:e}}}if(process.env.CURSOR_TRACE_ID)return {isAgent:true,agent:{name:vn}};if(process.env.CURSOR_AGENT||process.env.CURSOR_EXTENSION_HOST_ROLE==="agent-exec")return {isAgent:true,agent:{name:An}};if(process.env.GEMINI_CLI)return {isAgent:true,agent:{name:jn}};if(process.env.CODEX_SANDBOX||process.env.CODEX_CI||process.env.CODEX_THREAD_ID)return {isAgent:true,agent:{name:Pn}};if(process.env.ANTIGRAVITY_AGENT)return {isAgent:true,agent:{name:_n}};if(process.env.AUGMENT_AGENT)return {isAgent:true,agent:{name:Cn}};if(process.env.OPENCODE_CLIENT)return {isAgent:true,agent:{name:Rn}};if(process.env.CLAUDECODE||process.env.CLAUDE_CODE)return process.env.CLAUDE_CODE_IS_COWORK?{isAgent:true,agent:{name:Tn}}:{isAgent:true,agent:{name:xn}};if(process.env.REPL_ID)return {isAgent:true,agent:{name:In}};if(process.env.COPILOT_MODEL||process.env.COPILOT_ALLOW_ALL||process.env.COPILOT_GITHUB_TOKEN)return {isAgent:true,agent:{name:rs}};try{return await promises.access(wn,fs$1.constants.F_OK),{isAgent:!0,agent:{name:Ln}}}catch{}return {isAgent:false,agent:void 0}}var tt=null,On={cursor:"cursor","cursor-cli":"cursor",claude:"claude-code",cowork:"claude-code",devin:"universal",replit:"replit",gemini:"gemini-cli",codex:"codex",antigravity:"antigravity","augment-cli":"augment",opencode:"opencode","github-copilot":"github-copilot"};async function st(){return tt||(tt=await il(),tt.isAgent&&chunkQ2MOP5ZW_cjs.a(tt.agent.name),tt)}async function Rt(){return (await st()).isAgent}async function dr(){let e=await st();return e.isAgent?e.agent.name:null}function rl(e){return On[e]??null}function as(e,t){return t?`${e}#${t}`:e}function B(e,t,s=true){return t===void 0?{ok:s,data:e}:{ok:s,data:e,meta:t}}function Dn(e,t=2){console.log(JSON.stringify(e,null,t));}function J(e){Dn(e);}function q(e,t={}){let s=e.length>0?e.join(`
2
- `):t.empty??chunk5RWSXDNO_cjs.a("No results."),n=e.length>0?t.title:t.emptyTitle??t.title;n?terminal.note(s,n):console.log(s),t.outro&&!t.skipOutro?terminal.Prompt.outro(t.outro):t.skipOutro||terminal.Prompt.outro(chunk5RWSXDNO_cjs.c("Done!"));}var i="\x1B[0m",G="\x1B[1m",a="\x1B[38;5;102m",U="\x1B[38;5;145m",Te="\x1B[36m";var lt="\x1B[33m";path.dirname(url.fileURLToPath(chunkGWUDKZEH_cjs.c));var Et=Number(process.env.SKILLS_UPDATE_TIMEOUT??6e4);async function Dt(e,t,s){let n=null,l=new Promise((o,r)=>{n=setTimeout(()=>r(new Error(`${s} timed out after ${t}ms`)),t);});try{return await Promise.race([e,l])}finally{n&&clearTimeout(n);}}function ul(e,t){if(!e)return [];let n=e.message.includes("timed out")?"Fetch timeout":"Source unreachable";return t.map(({name:l,entry:o})=>({name:l,reason:n,sourceUrl:o.source,sourceType:o.sourceType,ref:o.ref}))}async function gl(e){try{return await chunkE7AHWFZN_cjs.b(e)}catch{return}}async function dl(e,t,s,n){let{rm:l,readdir:o,stat:r}=await import('fs/promises'),u=chunkJCOXRETY_cjs.L(e),p=chunkJCOXRETY_cjs.M(e),d=utils.Filesystem.join(utils.Filesystem.normalize(t),s),h=utils.Filesystem.join(p,s);if(!await utils.Filesystem.exists(d))return {ok:false};let f=new Set([".git","node_modules"]),C=async m=>{let S=[],v=async j=>{try{let A=[...await o(j,{withFileTypes:!0})].filter(O=>!f.has(O.name)).sort((O,D)=>O.name.localeCompare(D.name)),R=await Promise.all(A.map(async O=>{let D=utils.Filesystem.join(j,O.name);try{let N=await r(D);return `${D.slice(utils.Filesystem.normalize(m).length+1).split(/[\\/]/).join("/")}|${N.size}|${O.isDirectory()?"d":"f"}|${(N.mode&511).toString(8)}`}catch{return `${O.name}|?|?|?`}}));for(let O of R)S.push(O);for(let O of A)if(O.isDirectory()&&!await v(utils.Filesystem.join(j,O.name)))return !1;return !0}catch{return false}};if(await v(utils.Filesystem.normalize(m)))return S.sort(),crypto.createHash("sha256").update(S.join(`
3
- `)).digest("hex")},w=await C(d),$=await C(h);if(w&&$&&w===$){let S=(await chunkJCOXRETY_cjs.Y(u,chunkJCOXRETY_cjs.O(e,s),n))?.entry.computedHash;if(S)return {ok:true,hash:S,skipped:true}}try{await l(h,{recursive:!0,force:!0}),await utils.Filesystem.cp(d,h);}catch{return {ok:false}}let c=await gl(h);if(!c)return {ok:false};let g=e.type==="local"?e.localPath??e.url:utils.Filesystem.normalize(t);try{await chunkJCOXRETY_cjs.aa([{skillName:n,parsed:e,sourceKey:u,sourcePath:g,storePath:p,skillPath:s,computedHash:c}]);}catch{}return {ok:true,hash:c}}function Ut(e,t,s){return e||!t||!s?true:t!==s}function Gn(e,t={}){let s={};t.cwd&&(s.cwd=t.cwd);let n=[];for(let l=0;l<e.length;l++){let o=e[l];if(o==="-g"||o==="--global")s.global=true;else if(o==="-p"||o==="--project")s.project=true;else if(o==="-y"||o==="--yes")s.yes=true;else if(o==="--all")s.all=true;else if(o==="--json")s.json=true;else if(o==="--force")s.force=true;else if(o==="-a"||o==="--agent")for(s.agent=s.agent??[];l+1<e.length&&!e[l+1].startsWith("-");)s.agent.push(e[++l]);else o&&!o.startsWith("-")&&n.push(o);}return n.length>0&&(s.skills=n),s}function qr(e){let t=e||process.cwd();return fs$1.existsSync(path.join(t,"skills-lock.json"))}async function Kn(e){if(e.skills&&e.skills.length>0)return e.global?"global":e.project?"project":"both";if(e.global&&e.project)return "both";if(e.global)return "global";if(e.project)return "project";if(e.yes||!process.stdin.isTTY)return "both";let t=await terminal.Prompt.select({message:"Update scope",options:[{value:"project",label:"Project",hint:"Update skills in current directory (committed with your project)"},{value:"global",label:"Global",hint:"Update skills in home directory (available across all projects)"},{value:"both",label:"Both",hint:"Update all skills (project + global)"}]});return terminal.Prompt.isCancel(t)&&terminal.Prompt.cancel("Cancelled"),t}function fl(e,t){if(!t||t.length===0)return true;let s=e.toLowerCase();return t.some(n=>{let l=n.toLowerCase();return l==="*"?true:l===s})}function Hn(e){return e.sourceType==="local"?"Local path":e.sourceType==="git"?"Git URL":e.sourceType==="well-known"?"Well-known skill":e.computedHash?e.skillPath?"No version tracking":"No skill path recorded":"Private or deleted repo"}function Wn(e){let t=e.sourceUrl;if(e.sourceType==="well-known"){let s=t.indexOf("/.well-known/");s!==-1&&(t=t.slice(0,s));}return as(t,e.ref)}function Nt(e){if(e.length===0)return;console.log(),console.log(`${a}${e.length} skill(s) cannot be checked automatically:${i}`);let t=new Map;for(let s of e){let n=Wn(s),l=t.get(n)||[];l.push(s),t.set(n,l);}for(let[s,n]of t){if(n.length===1){let l=n[0];console.log(` ${U}\u2022${i} ${chunkDNE3XPCJ_cjs.b(l.name)} ${a}(${l.reason})${i}`);}else {let l=n[0].reason,o=n.map(r=>chunkDNE3XPCJ_cjs.b(r.name)).join(", ");console.log(` ${U}\u2022${i} ${o} ${a}(${l})${i}`);}console.log(` ${a}To update: ${U}easbot skills add ${s} -g -y${i}`);}}async function ml(e){let t={skills:[],refreshedSkillCount:0,upToDateSkillCount:0,failedSkillCount:0},s=new Map,n=(c,g)=>{let m=`${g}::${c}`,S=s.get(m);return S||(S={skillName:c,scope:g,sharedAgents:[],copiedAgents:[],linkedAgents:[],upToDateAgents:[],deadLinkAgents:[],failed:[],ok:true,failedCount:0},s.set(m,S),t.skills.push(S)),S},l=e.scope??"both",o=chunkISMGLHYS_cjs.q(e.agentFilter??[]),r=o.length>0?o:void 0,p=(await chunkDFBKA5A6_cjs.a({scope:l,cwd:e.cwd,agentFilter:r})).map(c=>({name:c.name,description:"",path:c.skillDir,canonicalPath:c.skillDir,scope:c.scope,agents:[...c.agents]})),d=e.skillNames??[];if(!(d.length===1&&d[0]==="*")){let c=new Set(d.map(g=>g.toLowerCase()));p=p.filter(g=>c.has(g.name.toLowerCase()));}let{readLocalLock:h}=await import('./local-lock-SPZB3AB7.cjs'),{readSkillLock:f}=await import('./skill-lock-VX2HGPTY.cjs'),C=await h(),w=await f();for(let c of p){let g=c.scope==="global"?w.skills[c.name]:C.skills[c.name];if(!g?.marketId||!g.pluginId)continue;let m=await chunkJCOXRETY_cjs.Y(g.marketId,g.pluginId,c.name);if(!m)continue;let{readStoreIndex:S}=await import('./store-TSS4BMBF.cjs'),T=(await S()).markets[m.marketId];if(!T)continue;let y=`${T.storePath.replace(/\\/g,"/").replace(/\/+$/,"")}/${m.entry.skillPath}`.replace(/\\/g,"/");c.path=y,c.canonicalPath=y;}let $=new Map;for(let c of p){let g=`${c.scope}::${c.name}::${c.path}`;$.set(g,c);}for(let c of d){if(c==="*")continue;let g=c.replace(/\.+$/,""),m=d.indexOf(c),v=e.skillStorePaths?.[m]?.split(/[\\/]/).filter(Boolean).pop();if(v){for(let[T,j]of $)if(T.startsWith(`${j.scope}::`)&&T.endsWith(`::${v}`)){let y=`${j.scope}::${g}::${j.path}`;$.has(y)||$.set(y,j);break}}}if($.size===0)return t;for(let[c,g]of $){let S=c.split("::")[1].replace(/\.+$/,""),v=g.path,T=n(S,g.scope),y=fs$1.existsSync(v)?await chunkJCOXRETY_cjs.y(`${v}/SKILL.md`.replace(/\\/g,"/")):void 0;if(!y){if(!await zn(S,g.scope==="global"))continue;for(let O of g.agents)T.failed.push({agent:O,reason:"store source missing \u2014 run `easbot skills add <source>` to rebuild"}),T.failedCount++,T.ok=false;continue}let A=y;for(let R of g.agents){let O=chunkISMGLHYS_cjs.o(R,g.scope),N=await chunkUGHF4GOW_cjs.h(A,R,{global:g.scope==="global",mode:"symlink",cwd:e.cwd});if(!N.success){T.failed.push({agent:R,reason:N.error??"install failed"}),T.failedCount++,T.ok=false;continue}N.skippedReason==="up-to-date"?T.upToDateAgents.push(R):O?T.sharedAgents.push(R):T.copiedAgents.push(R);}}for(let c of t.skills){let g=c.failedCount>0,m=c.sharedAgents.length+c.copiedAgents.length+c.linkedAgents.length>0,S=c.upToDateAgents.length+c.deadLinkAgents.length>0||m;g?t.failedSkillCount++:m?t.refreshedSkillCount++:S&&t.upToDateSkillCount++;}return t}async function zn(e,t){return t?(await chunk5RWSXDNO_cjs.l()).skills[e]:(await chunkJCOXRETY_cjs.t()).skills[e]}function Bn(e){let t=[...e.skills].sort((o,r)=>o.skillName.localeCompare(r.skillName)),s=[];for(let o of t){let r=[...o.sharedAgents,...o.copiedAgents,...o.linkedAgents,...o.upToDateAgents];r.length!==0&&s.push({skill:o.skillName,agents:r});}let n=["global","project"],l=[];for(let o of n){let r=e.skills.filter(p=>p.scope===o);if(r.length===0)continue;let u=[...r].sort((p,d)=>p.skillName.localeCompare(d.skillName));for(let p of u){let d=[];p.sharedAgents.length>0&&d.push({label:"universal",agents:p.sharedAgents}),p.copiedAgents.length>0&&d.push({label:"copied",agents:p.copiedAgents}),p.linkedAgents.length>0&&d.push({label:"symlinked",agents:p.linkedAgents}),p.upToDateAgents.length>0&&d.push({label:"up-to-date",agents:p.upToDateAgents}),l.push({scope:o,skill:p.skillName,sections:d,failed:p.failed.map(h=>({agent:h.agent,reason:h.reason}))});}}return {updatingFor:s,sections:l,summary:{refreshed:e.refreshedSkillCount,upToDate:e.upToDateSkillCount,failed:e.failedSkillCount}}}function hl(e){if(e.skills.length===0)return;let t=Bn(e),s=l=>{let o=l.map(r=>chunkISMGLHYS_cjs.b[r]?.displayName??r);return o.length<=5?o.join(", "):`${o.slice(0,5).join(", ")} +${o.length-5} more`};if(t.updatingFor.length>0){console.log(`${U}Updating for:${i}`);for(let l of t.updatingFor){let o=s(l.agents);console.log(` ${a}\u2514${i} ${Te}${chunkDNE3XPCJ_cjs.b(l.skill)}${i} ${a}(${o})${i}`);}}let n=null;for(let l of t.sections){if(l.scope!==n&&(console.log(`${G}${l.scope==="global"?"Global Skills":"Project Skills"}${i}`),n=l.scope),console.log(` ${a}\u2514${i} ${Te}${chunkDNE3XPCJ_cjs.b(l.skill)}${i}`),l.sections.length===0&&l.failed.length===0){console.log(` ${a}\u2514(no install targets)${i}`);continue}for(let o of l.sections)console.log(` ${a}\u2514${i} (${o.agents.length} agents) ${o.label}: ${s(o.agents)}`);for(let{agent:o,reason:r}of l.failed){let u=chunkISMGLHYS_cjs.b[o]?.displayName??o;console.log(` ${U}\u2717 ${u}:${i} ${a}${r}${i}`);}}console.log();}async function Jn(e){let t=await chunkJCOXRETY_cjs.t(),s=[];for(let[n,l]of Object.entries(t.skills))fl(n,e)&&l.sourceType!=="node_modules"&&s.push({name:n,source:l.source,entry:l});return s}async function Yn(e={}){let t=e.cwd||process.cwd(),s=await chunk5RWSXDNO_cjs.l(),n=Object.keys(s.skills),l=0,o=0,r=0;if(n.length===0)return terminal.note(e.skills&&e.skills.length>0?`${chunk5RWSXDNO_cjs.d(`No installed skills found matching: ${e.skills.join(", ")}`)}`:`${chunk5RWSXDNO_cjs.a("No global skills tracked in lock file.")}`,chunk5RWSXDNO_cjs.e("Global Skills Update")),terminal.Prompt.outro(`${chunk5RWSXDNO_cjs.c("Done!")}${chunk5RWSXDNO_cjs.a(" Install with `easbot skills add <package> -g` to get started.")}`),{successCount:l,failCount:o,checkedCount:0};let{listInstalledSkills:u}=await import('./installer-YDJBZTQ7.cjs'),p=await u({scope:"global",agentFilter:e.agent,cwd:t}),d=new Set(p.map(g=>g.name)),h=[],f=[],C=[];for(let g of n){if(!fl(g,e.skills))continue;let m=s.skills[g];if(m){if(!m.skillPath){f.push({name:g,reason:Hn(m),sourceUrl:m.source,sourceType:m.sourceType,ref:m.ref});continue}d.has(g)&&C.push({name:g,entry:m});}}let w=new Map;for(let g of C){let m=g.entry.source,S=w.get(m)||[];S.push(g),w.set(m,S);}for(let[g,m]of w){let S=m[0].entry,v=S.source,T=S.sourceType,j=null;if(process.stdout.write(`\r${a}Checking skills from source: ${g}${i}\x1B[K
4
- `),T==="github"){let A=chunkJCOXRETY_cjs.e(v),R=chunkJCOXRETY_cjs.a(A);if(R)try{let{fetchGitHubMarketSnapshot:O}=await import('./blob-SCUVTYVE.cjs'),D=await Dt(O(R,S.ref??void 0),Et,`update market-snapshot ${g}`),F=(await chunkJCOXRETY_cjs.S()).markets[chunkJCOXRETY_cjs.L(A)]?.snapshotHash;if(D&&F&&F===D.snapshotHash){console.log(` ${a}\u2713 Source ${g} unchanged (market snapshotHash match)${i}`),r+=m.length;continue}}catch{}}let y=null;try{let A=T??"git",R=chunkJCOXRETY_cjs.e(v),O=await Dt(chunkJCOXRETY_cjs.Q({type:A,url:R.url,ref:S.ref??void 0,mode:"update"}),Et,`update fetch ${g}`);if(j=O.tempDir,O.cloneError&&(y=O.cloneError),!y&&j){let D=await chunkJCOXRETY_cjs.A(j),N=j.replace(/\\/g,"/").replace(/\/+$/,""),F=D.map(V=>{let Q=V.path.replace(/\\/g,"/");return path.relative(N,Q).split(path.sep).join("/")});if(D.length===0)y=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${g}`);else {let V=new Set,Q=new Set(F),we=chunkJCOXRETY_cjs.e(v);for(let{name:le,entry:X}of m){if(V.has(le))continue;let Ae=X.skillPath.split(path.sep).join("/").replace(/\/SKILL\.md$/,"");if(!Q.has(Ae))continue;let he=await dl(we,j,Ae,le);if(!he.ok){f.push({name:le,reason:"Store sync failed",sourceUrl:X.source,sourceType:X.sourceType,ref:X.ref});continue}Ut(e.force,X.computedHash,he.hash)&&h.push({name:le,source:g,entry:X});}}}}catch(A){y=A instanceof Error?A:new Error(String(A));}finally{j&&T!=="local"&&!chunkJCOXRETY_cjs.ga(j)&&await chunkJCOXRETY_cjs.l(j);}y&&(console.log(` ${a}\u2717 Failed to check skills from ${g}: ${y.message}${i}`),f.push(...ul(y,m)));}C.length>0&&process.stdout.write("\r\x1B[K");let $=C.length+f.length+r;if(C.length===0&&f.length===0)return e.skills||console.log(`${a}No global skills to check.${i}`),{successCount:l,failCount:o,checkedCount:0};if(C.length===0&&f.length>0)return Nt(f),{successCount:l,failCount:o,checkedCount:$};if(h.length===0)return console.log(`${U}\u2713 All global skills are up to date${i}`),{successCount:l,failCount:o,checkedCount:$};if(console.log(`${U}Found ${h.length} global update(s)${i}`),console.log(),h.length===0)return Nt(f),{successCount:l,failCount:o,checkedCount:$};try{let g=[],m=[];for(let v of h){g.push(v.name);let T=chunkJCOXRETY_cjs.e(v.entry.source),j=chunkJCOXRETY_cjs.M(T),A=(v.entry.skillPath??v.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");m.push(path.join(j,A));}let S=await ml({skillNames:g,skillStorePaths:m,scope:"global",agentFilter:e.agent,cwd:t});hl(S),S.failedSkillCount>0?o+=S.failedSkillCount:l+=S.skills.length;}catch(g){o+=h.length,console.log(`${a}\u2717 Failed to refresh: ${g instanceof Error?g.message:String(g)}${i}`);}if(h.length>0)try{let g=await chunk5RWSXDNO_cjs.l(),m=new Date().toISOString(),S=!1,v=0;for(let T of h){let j=g.skills[T.name];if(!j)continue;let y=chunkJCOXRETY_cjs.e(T.entry.source),A=chunkJCOXRETY_cjs.M(y),O=(T.entry.skillPath??T.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,""),D=path.join(A,O),N=await gl(D);N&&j.computedHash!==N&&(j.computedHash=N,j.updatedAt=m,S=!0,v++);}S&&(await chunk5RWSXDNO_cjs.m(g),console.log(`${a}\u2192 updated global lock: ${v} skill(s) refreshed, ${Object.keys(g.skills).length} total tracked${i}`));}catch(g){console.log(`${a}\u26A0 Failed to write global lock: ${g instanceof Error?g.message:String(g)}${i}`);}Nt(f);let c=[];if(l>0&&o>0)c.push(`${chunk5RWSXDNO_cjs.c(`\u2713 ${l} refreshed`)} ${chunk5RWSXDNO_cjs.a("|")} ${chunk5RWSXDNO_cjs.b(`\u2717 ${o} failed`)}`);else if(l>0)c.push(`${chunk5RWSXDNO_cjs.c(`\u2713 ${l} refreshed`)}`);else if(o>0)c.push(`${chunk5RWSXDNO_cjs.b(`\u2717 ${o} failed`)}`);else if($>0)c.push(`${chunk5RWSXDNO_cjs.c("All global skills are up to date.")}`);else return {successCount:l,failCount:o,checkedCount:$};return f.length>0&&c.push(`${chunk5RWSXDNO_cjs.d(`\u26A0 ${f.length} skipped`)}`),console.log(),terminal.note(c.join(`
5
- `),chunk5RWSXDNO_cjs.e("Global Skills Update")),terminal.Prompt.outro(`${chunk5RWSXDNO_cjs.c("Done!")}${chunk5RWSXDNO_cjs.a(" Run `easbot skills list` to see current state.")}`),{successCount:l,failCount:o,checkedCount:$}}async function qn(e={}){let t=e.cwd||process.cwd(),s=await Jn(e.skills),n=0,l=0,o=[];if(s.length===0)return e.skills||(console.log(`${a}No project skills to update.${i}`),console.log(`${a}Install project skills with${i} ${U}easbot skills add <package>${i}`)),terminal.note(s.length===0&&e.skills?`${chunk5RWSXDNO_cjs.d(`No installed skills found matching: ${e.skills.join(", ")}`)}`:`${chunk5RWSXDNO_cjs.a("No project skills tracked in lock file.")}`,chunk5RWSXDNO_cjs.e("Project Skills Update")),terminal.Prompt.outro(`${chunk5RWSXDNO_cjs.c("Done!")}${chunk5RWSXDNO_cjs.a(" Install with `easbot skills add <package>` to get started.")}`),{successCount:n,failCount:l,foundCount:0};let{listInstalledSkills:r}=await import('./installer-YDJBZTQ7.cjs'),u=await r({scope:"project",agentFilter:e.agent,cwd:t}),p=new Set(u.map(c=>c.name)),d=s.filter(c=>p.has(c.name)),h=d.filter(c=>c.entry.skillPath),f=d.filter(c=>!c.entry.skillPath);if(h.length===0)return console.log(`${a}No project skills can be updated in place.${i}`),cl(f),{successCount:n,failCount:l,foundCount:s.length};console.log(`${U}Checking ${h.length} skill(s)...${i}`),console.log();let C=new Map;for(let c of h){let g=c.entry.source,m=C.get(g)||[];m.push(c),C.set(g,m);}let w=await chunkJCOXRETY_cjs.t(),$=[];for(let[c,g]of C){let m=g[0].entry,S=m.source,v=m.ref;if(m.sourceType==="github"){let N=chunkJCOXRETY_cjs.e(S),F=chunkJCOXRETY_cjs.a(N);if(F)try{let{fetchGitHubMarketSnapshot:V}=await import('./blob-SCUVTYVE.cjs'),Q=await Dt(V(F,m.ref??void 0),Et,`update market-snapshot ${c}`),le=(await chunkJCOXRETY_cjs.S()).markets[chunkJCOXRETY_cjs.L(N)]?.snapshotHash;if(Q&&le&&le===Q.snapshotHash){console.log(` ${a}\u2713 Source ${c} unchanged (market snapshotHash match)${i}`);continue}}catch{}}Object.entries(w.skills).filter(([N,F])=>F.source===c).map(([N,F])=>N);let j=null,y=[],A=new Map,R=null;try{let N=m.sourceType??"git",F=chunkJCOXRETY_cjs.e(S),V=await Dt(chunkJCOXRETY_cjs.Q({type:N,url:F.url,ref:v,mode:"update"}),Et,`update fetch ${c}`);if(j=V.tempDir,V.cloneError)R=V.cloneError;else {let Q=await chunkJCOXRETY_cjs.A(j);if(Q.length===0)R=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${c}`);else {let we=Q.map(X=>{let ve=path.relative(j,X.path);return path.join(ve,"SKILL.md").split(path.sep).join("/")}),le=chunkJCOXRETY_cjs.e(S);for(let X of Q){let Ae=path.join(path.relative(j,X.path),"SKILL.md").split(path.sep).join("/").replace(/\/SKILL\.md$/,""),he=await dl(le,j,Ae,X.name);he.ok&&he.hash&&A.set(X.name,he.hash);}}}}catch(N){R=N instanceof Error?N:new Error(String(N));}finally{j&&!chunkJCOXRETY_cjs.ga(j)&&await chunkJCOXRETY_cjs.l(j);}if(R){console.log(` ${a}\u2717 Failed to check for deleted skills from ${c}: ${R.message}${i}`);let N=g.map(F=>({name:F.name,entry:{source:F.source,sourceType:F.entry.sourceType,ref:F.entry.ref}}));$.push(...ul(R,N));continue}let O=g.filter(N=>!y.includes(N.name)),D=[];for(let N of O){let F=w.skills[N.name],V=A.get(N.name);if(!V)continue;let Q=F?.computedHash;if(!Ut(e.force,Q,V))continue;let we=chunkJCOXRETY_cjs.e(N.entry.source),le=chunkJCOXRETY_cjs.M(we),ve=(N.entry.skillPath??N.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");D.push({name:N.name,source:N.entry.source,skillPath:ve,storeRoot:le});}if(D.length!==0)try{let N=D.map(Q=>Q.name),F=D.map(Q=>path.join(Q.storeRoot,Q.skillPath)),V=await ml({skillNames:N,skillStorePaths:F,scope:"project",agentFilter:e.agent,cwd:t});hl(V),V.failedSkillCount>0?l+=V.failedSkillCount:n+=V.skills.length;for(let Q of D)o.push(Q.name);}catch(N){l+=D.length,console.log(` ${a}\u2717 Failed to refresh: ${N instanceof Error?N.message:String(N)}${i}`);}}if(cl(f),Nt($),h.length>0)if(console.log(),o.length>0||$.length>0||f.length>0){let c=[];o.length>0&&c.push(`${chunk5RWSXDNO_cjs.c(`\u2713 Refreshed ${o.length} skill(s)${chunk5RWSXDNO_cjs.i("")}`)}`),n>0&&l>0?c.push(`${chunk5RWSXDNO_cjs.c(`\u2713 ${n} ok`)} ${chunk5RWSXDNO_cjs.a("|")} ${chunk5RWSXDNO_cjs.b(`\u2717 ${l} failed`)}`):n>0?c.push(`${chunk5RWSXDNO_cjs.c(`\u2713 ${n} ok`)}`):l>0&&c.push(`${chunk5RWSXDNO_cjs.b(`\u2717 ${l} failed`)}`),$.length>0&&c.push(`${chunk5RWSXDNO_cjs.d(`\u26A0 ${$.length} skipped`)}`),f.length>0&&c.push(`${chunk5RWSXDNO_cjs.a(`${f.length} legacy (cannot update)`)}`),terminal.note(c.join(`
6
- `),chunk5RWSXDNO_cjs.e("Project Skills Update")),terminal.Prompt.outro(`${chunk5RWSXDNO_cjs.c("Done!")}${chunk5RWSXDNO_cjs.a(" Run `easbot skills list` to see current state.")}`);}else terminal.note(`${chunk5RWSXDNO_cjs.c("All project skills are up to date.")}`,chunk5RWSXDNO_cjs.e("Project Skills Update")),terminal.Prompt.outro(`${chunk5RWSXDNO_cjs.c("Done!")}`);if(n>0&&o.length>0)try{let c=await chunkJCOXRETY_cjs.t(),g=new Date().toISOString(),m=!1,S=0;for(let v of o){let T=c.skills[v];if(!T)continue;let y=(await chunkJCOXRETY_cjs.Y(T.marketId,T.pluginId,v))?.entry.computedHash;y&&T.computedHash!==y&&(T.computedHash=y,T.updatedAt=g,m=!0,S++);}if(m){let{writeLocalLock:v}=await import('./local-lock-SPZB3AB7.cjs');await v(c),console.log(`${a}\u2192 updated project lock: ${S} skill(s) refreshed, ${Object.keys(c.skills).length} total tracked${i}`);}}catch(c){console.log(`${a}\u26A0 Failed to write project lock: ${c instanceof Error?c.message:String(c)}${i}`);}return {successCount:n,failCount:l,foundCount:s.length}}function cl(e){if(e.length!==0){console.log(),console.log(`${a}${e.length} project skill(s) cannot be updated automatically (installed before skillPath tracking):${i}`);for(let t of e){let s=as(t.entry.source,t.entry.ref);console.log(` ${U}\u2022${i} ${chunkDNE3XPCJ_cjs.b(t.name)}`),console.log(` ${a}To refresh: ${U}easbot skills add ${s} -y${i}`);}}}async function kl(e=[],t={}){let s=Gn(e,t);s.all===true&&(s.yes=true,(!s.skills||s.skills.length===0)&&(s.skills=["*"]));let n=await Kn(s);s.skills?console.log(`${U}Updating ${s.skills.join(", ")}...${i}`):console.log(`${U}Checking for skill updates...${i}`),console.log();let l=0,o=0,r=0;if(n==="global"||n==="both"){n==="both"&&!s.skills&&console.log(`${G}Global Skills${i}`);let{successCount:u,failCount:p,checkedCount:d}=await Yn(s);l+=u,o+=p,r+=d,n==="both"&&!s.skills&&console.log();}if(n==="project"||n==="both"){n==="both"&&!s.skills&&console.log(`${G}Project Skills${i}`);let{successCount:u,failCount:p,foundCount:d}=await qn(s);l+=u,o+=p,r+=d;}s.skills&&r===0&&console.log(`${a}No installed skills found matching: ${s.skills.join(", ")}${i}`),console.log(),l>0&&console.log(`${U}\u2713 Updated ${l} skill(s)${i}`),o>0&&console.log(`${a}Failed to update ${o} skill(s)${i}`),chunkQ2MOP5ZW_cjs.d({event:"update",scope:n,skillCount:String(l+o),successCount:String(l),failCount:String(o)}),s.json&&J(B({scope:n,totals:{checked:r,refreshed:l,failed:o},detail:{project:r>0,global:r>0},...s.skills&&{skills:s.skills},...s.agent&&{agents:s.agent}},{scope:n,checked:r,refreshed:l,failed:o})),console.log();}var yl={version:"0.3.14"};var vl="eve agent";function Qn(e,t){return e.startsWith("git@")||e.startsWith("ssh://")?e:t}function Al(e){chunkQ2MOP5ZW_cjs.b(e);}async function eo(e,t,s,n){let{agent:l,subagent:o}=t,{installMode:r,installGlobally:u}=n,h=await chunkUGHF4GOW_cjs.h(e,l,{global:u,mode:r,eveSubagent:o});return {skill:chunkJCOXRETY_cjs.B(e),agent:dt(t),pluginName:e.pluginName,...h}}var to=(()=>{let e=process.env.SKILLS_AUDIT_DISPLAY_TIMEOUT_MS;if(!e)return 3e4;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e4})();function bl(e){switch(e){case "critical":return chunk5RWSXDNO_cjs.b(chunk5RWSXDNO_cjs.f("Critical Risk"));case "high":return chunk5RWSXDNO_cjs.b("High Risk");case "medium":return chunk5RWSXDNO_cjs.d("Med Risk");case "low":return chunk5RWSXDNO_cjs.c("Low Risk");case "safe":return chunk5RWSXDNO_cjs.c("Safe");default:return chunk5RWSXDNO_cjs.a("--")}}function so(e){if(!e)return chunk5RWSXDNO_cjs.a("--");let t=e.alerts??0;return t>0?chunk5RWSXDNO_cjs.b(`${t} alert${t!==1?"s":""}`):chunk5RWSXDNO_cjs.c("0 alerts")}function ot(e,t){let s=chunkDNE3XPCJ_cjs.a(e),n=Math.max(0,t-s.length);return e+" ".repeat(n)}function lo(e,t,s){if(!e)return [];if(!t.some(u=>{let p=e[u.slug];return p&&Object.keys(p).length>0}))return [];let l=Math.min(Math.max(...t.map(u=>u.displayName.length)),36),o=[],r=ot("",l+2)+ot(chunk5RWSXDNO_cjs.a("Gen"),18)+ot(chunk5RWSXDNO_cjs.a("Socket"),18)+chunk5RWSXDNO_cjs.a("Snyk");o.push(r);for(let u of t){let p=e[u.slug],d=u.displayName.length>l?u.displayName.slice(0,l-1)+"\u2026":u.displayName,h=p?.ath?bl(p.ath.risk):chunk5RWSXDNO_cjs.a("--"),f=p?.socket?so(p.socket):chunk5RWSXDNO_cjs.a("--"),C=p?.snyk?bl(p.snyk.risk):chunk5RWSXDNO_cjs.a("--");o.push(ot(chunk5RWSXDNO_cjs.e(d),l+2)+ot(h,18)+ot(f,18)+C);}return o.push(""),o.push(`${chunk5RWSXDNO_cjs.a("Details:")} ${chunk5RWSXDNO_cjs.a(`https://skills.sh/${s}`)}`),o}function gs(e,t){let s=os.homedir();return e===s||e.startsWith(s+path.sep)?"~"+e.slice(s.length):e===t||e.startsWith(t+path.sep)?"."+e.slice(t.length):e}function ye(e,t=5){if(e.length<=t)return e.join(", ");let s=e.slice(0,t),n=e.length-t;return `${s.join(", ")} +${n} more`}function no(e){let t=e.map(n=>chunk5RWSXDNO_cjs.e(chunkJCOXRETY_cjs.B(n))),s=ye(t,3);return chunkDNE3XPCJ_cjs.a(s).length<=80?s:`${e.length} selected skills`}function oo(e){return `Detected an eve project. Install ${no(e)} for your ${vl} to use?`}function io(e,t,s){let n=[],l=[],o=[],r=new Map;if(e)for(let u of e)u.mode&&r.set(u.agent,u.mode);for(let u of t){let p=chunkISMGLHYS_cjs.b[u].displayName,d=r.get(p);chunkISMGLHYS_cjs.o(u,s?"global":"project")?n.push(p):d==="symlink"?o.push(p):l.push(p);}return {universal:n,copied:l,symlinked:o}}function dt(e){let t=chunkISMGLHYS_cjs.b[e.agent].displayName;return e.subagent?`${t} (${e.subagent})`:t}function Ft(e){return e.subagent?`${e.agent}:${e.subagent}`:e.agent}function ro(e,t){let s=[];for(let n of e)if(n==="eve")for(let l of t)s.push({agent:n,subagent:l});else s.push({agent:n});return s}function ao(e,t,s,n=[]){let l=[],o=e.filter(f=>!f.subagent).map(f=>f.agent),r=e.filter(f=>f.subagent).map(dt),u,p;if(n.length>0){let f=new Set(n);u=o.filter(C=>f.has(C)),p=o.filter(C=>!f.has(C));}else u=o.filter(f=>chunkISMGLHYS_cjs.o(f,s?"global":"project")),p=o.filter(f=>!chunkISMGLHYS_cjs.o(f,s?"global":"project"));let d=u.map(f=>chunkISMGLHYS_cjs.b[f].displayName),h=p.map(f=>chunkISMGLHYS_cjs.b[f].displayName);return t==="symlink"?(d.length>0&&l.push(` ${chunk5RWSXDNO_cjs.c("universal:")} ${ye(d)}`),h.length>0&&l.push(` ${chunk5RWSXDNO_cjs.a("symlinked:")} ${ye(h)}`),r.length>0&&l.push(` ${chunk5RWSXDNO_cjs.a("copied:")} ${ye(r)}`)):(d.length>0&&l.push(` ${chunk5RWSXDNO_cjs.c("universal:")} ${ye(d)}`),h.length>0&&l.push(` ${chunk5RWSXDNO_cjs.a("copied:")} ${ye(h)}`),r.length>0&&l.push(` ${chunk5RWSXDNO_cjs.a("copied (subagent):")} ${ye(r)}`)),l}function Sl(e,t){let s=chunkISMGLHYS_cjs.h(t),n=[...e];for(let l of s)n.includes(l)||n.push(l);return n}function co(e,t,s){let n=[],{universal:l,copied:o,symlinked:r}=io(e,t,s),u=o,p=e.filter(d=>d.symlinkFailed&&!d.skipped).map(d=>d.agent);return l.length>0&&n.push(` ${chunk5RWSXDNO_cjs.c("universal:")} ${ye(l)}`),u.length>0&&n.push(` ${chunk5RWSXDNO_cjs.e("copied:")} ${ye(u)}`),r.length>0&&n.push(` ${chunk5RWSXDNO_cjs.a("symlinked:")} ${ye(r)}`),p.length>0&&n.push(` ${chunk5RWSXDNO_cjs.d("symlink-failed:")} ${ye(p)}`),n}async function po(e,t){let s=[];return await terminal.Prompt.multiselect({message:e,options:t,initialValues:s,required:true})}async function wl(e){let t=e.global===true?"global":"project",s=p=>t!=="global"||chunkISMGLHYS_cjs.b[p].globalSkillsDir!==void 0,n=chunkISMGLHYS_cjs.h(t).filter(s),l=chunkISMGLHYS_cjs.i(t).filter(p=>p!=="eve"&&s(p)),o={title:"Universal (.agents/skills)",items:n.map(p=>({value:p,label:chunkISMGLHYS_cjs.b[p].displayName}))},r=l.map(p=>({value:p,label:chunkISMGLHYS_cjs.b[p].displayName,hint:e.global?chunkISMGLHYS_cjs.b[p].globalSkillsDir:chunkISMGLHYS_cjs.b[p].skillsDir})),u=await terminal.Prompt.multiselect({message:"Which agents do you want to install to?",options:r,initialValues:[],lockedSection:o});if(Array.isArray(u)){let p=u,d=new Set(n),h=[],f=[],C=new Set;for(let w of p)C.has(w)||(C.add(w),d.has(w)?h.push(w):f.push(w));return {locked:h,selected:f}}return u}var uo=yl.version;chunkQ2MOP5ZW_cjs.b(uo);async function ft(e,t={}){let s=e[0],n=false,l=()=>{n||(terminal.Prompt.Log.message(chunk5RWSXDNO_cjs.a("Tip: use the --yes (-y) and --global (-g) flags to install without prompts.")),n=true);};if(!s){let{readStoreIndex:p,resolveDefaultSource:d}=await import('./store-TSS4BMBF.cjs'),h=await p();s=await d(h);}t.all&&(t.skill=["*"],t.agent=["*"],t.yes=true);let o=t.global??false;if(!(t.global!==void 0)&&!t.yes&&!t.all&&process.stdin.isTTY&&Object.values(chunkISMGLHYS_cjs.b).some(f=>f.globalSkillsDir!==void 0)){let f=await terminal.Prompt.select({message:"Installation scope",options:[{value:false,label:"Project",hint:"Install in current directory (committed with your project)"},{value:true,label:"Global",hint:"Install in home directory (available across all projects)"}]});terminal.Prompt.isCancel(f)&&(await de(null),terminal.Prompt.cancel("Installation cancelled")),o=f,terminal.Prompt.Log.info(`${chunk5RWSXDNO_cjs.f(o?"Global":"Project")} scope selected`);}let r=await st();if(r.isAgent&&(t.yes=true,!t.agent||t.agent.length===0)){let p=rl(r.agent.name);if(p){let d=o?"global":"project";t.agent=Sl([p],d);}}console.log(),r.isAgent||terminal.Prompt.intro(" skills "),r.isAgent?terminal.Prompt.Log.info(Ct(r.agent.name)+" Agent detected \u2014 installing non-interactively"):!process.stdin.isTTY&&!t.yes&&l();let u=null;try{let p=terminal.Prompt.spinner();p.start("Parsing source...");let d=chunkJCOXRETY_cjs.e(s);p.stop(`Source: ${d.type==="local"?d.localPath:d.url}${d.ref?` #${chunk5RWSXDNO_cjs.d(d.ref)}`:""}${d.subpath?` @${chunk5RWSXDNO_cjs.e(d.subpath)}`:""}`);let h=chunkJCOXRETY_cjs.a(d),f=(()=>{if(!h)return Promise.resolve(null);let k=chunkJCOXRETY_cjs.b(h);return k?chunkJCOXRETY_cjs.c(k.owner,k.repo).catch(()=>null):Promise.resolve(null)})(),C=Array.isArray(t?.skill)&&t.skill.length>0||t.fullDepth===!0||!!d.subpath;p.start("Loading source...");let w;try{w=await chunkJCOXRETY_cjs.da(d,{includeInternal:C,fullDepth:t.fullDepth});}catch(k){throw k instanceof chunkJCOXRETY_cjs.R&&(p.stop(chunk5RWSXDNO_cjs.b("Path not found")),terminal.Prompt.outro(chunk5RWSXDNO_cjs.b(`Local path does not exist: ${k.localPath}`)),process.exit(1)),k}u=w.storeDir,p.stop(w.cacheHit?"Repository loaded from cache":w.source==="blob-fetch"?"Fetched via GitHub API":w.source==="well-known-fetch"?"Well-known index fetched":w.source==="local-cp"?"Local path cached":"Repository cloned");let $=w.skills,c=d.subpath?$.filter(k=>k.path.includes(`/${d.subpath}/`)||k.path.endsWith(`/${d.subpath}`)):$;if(p.start("Discovering skills..."),c.length===0&&w.cloneError){p.stop(chunk5RWSXDNO_cjs.b("Failed to clone repository"));for(let k of w.cloneError.message.split(`
7
- `))terminal.Prompt.Log.message(chunk5RWSXDNO_cjs.a(k));await de(u),process.exit(1);}if(c.length===0&&(p.stop(chunk5RWSXDNO_cjs.b("No skills found")),terminal.Prompt.outro(chunk5RWSXDNO_cjs.b("No valid skills found. Skills require a SKILL.md with name and description.")),await de(u),process.exit(1)),p.stop(`Found ${chunk5RWSXDNO_cjs.c(String(c.length))} skill${c.length>1?"s":""}`),t.list){console.log(),terminal.Prompt.Log.step(chunk5RWSXDNO_cjs.f("Available Skills"));let k={},x=[];for(let L of c)if(L.pluginName){let E=L.pluginName;k[E]||(k[E]=[]),k[E].push(L);}else x.push(L);let _=Object.keys(k).sort();for(let L of _){let E=L.split("-").map(K=>K.charAt(0).toUpperCase()+K.slice(1)).join(" ");console.log(chunk5RWSXDNO_cjs.f(E));for(let K of k[L])terminal.Prompt.Log.message(` ${chunk5RWSXDNO_cjs.e(chunkJCOXRETY_cjs.B(K))}`),terminal.Prompt.Log.message(` ${chunk5RWSXDNO_cjs.a(K.description)}`);console.log();}if(x.length>0){_.length>0&&console.log(chunk5RWSXDNO_cjs.f("General"));for(let L of x)terminal.Prompt.Log.message(` ${chunk5RWSXDNO_cjs.e(chunkJCOXRETY_cjs.B(L))}`),terminal.Prompt.Log.message(` ${chunk5RWSXDNO_cjs.a(L.description)}`);}console.log(),terminal.Prompt.outro("Use --skill <name> to install specific skills"),await de(u),process.exit(0);}let g;if(t.skill&&t.skill.length>0){let k=c.map(_=>chunkJCOXRETY_cjs.B(_)),x=chunkJCOXRETY_cjs.E(t.skill,k);if(x.wildcard)g=c,terminal.Prompt.Log.info(`Installing all ${c.length} skills`);else if(x.invalid.length>0){terminal.Prompt.Log.error(`No matching skills found for: ${x.invalid.join(", ")}`),terminal.Prompt.Log.info("Available skills:");for(let _ of c)terminal.Prompt.Log.message(` - ${chunkJCOXRETY_cjs.B(_)}`);await de(u),process.exit(1);}else g=chunkJCOXRETY_cjs.C(c,x.matched),g.length===0&&(terminal.Prompt.Log.error(`No matching skills found for: ${x.matched.join(", ")}`),await de(u),process.exit(1)),terminal.Prompt.Log.info(`Selected ${g.length} skill${g.length!==1?"s":""}: ${g.map(_=>chunk5RWSXDNO_cjs.e(chunkJCOXRETY_cjs.B(_))).join(", ")}`);}else if(c.length===1){g=c;let k=c[0];terminal.Prompt.Log.info(`Skill: ${chunk5RWSXDNO_cjs.e(chunkJCOXRETY_cjs.B(k))}`),terminal.Prompt.Log.message(chunk5RWSXDNO_cjs.a(k.description));}else if(t.yes)g=c,terminal.Prompt.Log.info(`Installing all ${c.length} skills`);else {let k=[...c].sort((L,E)=>L.pluginName&&!E.pluginName?-1:!L.pluginName&&E.pluginName?1:L.pluginName&&E.pluginName&&L.pluginName!==E.pluginName?L.pluginName.localeCompare(E.pluginName):chunkJCOXRETY_cjs.B(L).localeCompare(chunkJCOXRETY_cjs.B(E))),x=k.some(L=>L.pluginName),_;if(x){let L=K=>K.split("-").map(z=>z.charAt(0).toUpperCase()+z.slice(1)).join(" "),E={};for(let K of k){let z=K.pluginName?L(K.pluginName):"Other";E[z]||(E[z]=[]),E[z].push({value:K,label:chunkJCOXRETY_cjs.B(K),hint:K.description.length>60?K.description.slice(0,57)+"...":K.description});}_=await terminal.Prompt.groupMultiselect({message:`Select skills to install ${chunk5RWSXDNO_cjs.a("(space to toggle)")}`,options:E,required:!0});}else {let L=k.map(E=>({value:E,label:chunkJCOXRETY_cjs.B(E),hint:E.description.length>60?E.description.slice(0,57)+"...":E.description}));_=await terminal.Prompt.multiselect({message:"Select skills to install",options:L,required:!0});}terminal.Prompt.isCancel(_)&&(await de(u),terminal.Prompt.cancel("Installation cancelled")),g=_;}let m=chunkJCOXRETY_cjs.a(d),S=m?chunkQ2MOP5ZW_cjs.c(m,g.map(k=>chunkJCOXRETY_cjs.B(k))):Promise.resolve(null),v,T=Object.keys(chunkISMGLHYS_cjs.b),j=o?"global":"project",y=[];if(t.agent&&t.agent.length>0){let k=chunkISMGLHYS_cjs.p(t.agent);k.length>0&&(terminal.Prompt.Log.error(`Invalid agents: ${k.join(", ")}`),terminal.Prompt.Log.info(`Valid agents: ${T.join(", ")}`),await de(u),process.exit(1)),v=chunkISMGLHYS_cjs.q(t.agent),t.agent.includes("*")&&terminal.Prompt.Log.info(`Installing to all ${v.length} agents`);}else {p.start("Loading agents...");let k=await chunkISMGLHYS_cjs.c(),x=Object.keys(chunkISMGLHYS_cjs.b).length;if(p.stop(`${x} agents`),k.includes("eve")&&(t.yes||!r.isAgent)){let _=t.yes?!0:await terminal.Prompt.confirm({message:oo(g),initialValue:!0});if(terminal.Prompt.isCancel(_)&&(await de(u),terminal.Prompt.cancel("Installation cancelled")),_)v=["eve"],terminal.Prompt.Log.info(`Installing to: ${chunk5RWSXDNO_cjs.e(vl)}`);else {let L=await wl({global:j==="global"});terminal.Prompt.isCancel(L)&&(await de(u),terminal.Prompt.cancel("Installation cancelled")),y=L.locked,v=[...L.locked,...L.selected];}}else if(k.length===0)if(t.yes)v=T,terminal.Prompt.Log.info("Installing to all agents");else {terminal.Prompt.Log.info("Select agents to install skills to");let _=Object.entries(chunkISMGLHYS_cjs.b).filter(([E])=>E!=="eve").map(([E,K])=>({value:E,label:K.displayName})),L=await po("Which agents do you want to install to?",_);terminal.Prompt.isCancel(L)&&(await de(u),terminal.Prompt.cancel("Installation cancelled")),v=L;}else if(k.length===1||t.yes)if(v=Sl(k,j),k.length===1){let _=k[0];terminal.Prompt.Log.info(`Installing to: ${chunk5RWSXDNO_cjs.e(chunkISMGLHYS_cjs.b[_].displayName)}`);}else terminal.Prompt.Log.info(`Installing to: ${k.map(_=>chunk5RWSXDNO_cjs.e(chunkISMGLHYS_cjs.b[_].displayName)).join(", ")}`);else {let _=await wl({global:j==="global"});terminal.Prompt.isCancel(_)&&(await de(u),terminal.Prompt.cancel("Installation cancelled")),y=_.locked,v=[..._.locked,..._.selected];}}t.subagent&&t.subagent.length>0&&!v.includes("eve")&&(v=[...v,"eve"]);let A=[void 0];if(v.includes("eve")){let k=chunkISMGLHYS_cjs.f(process.cwd());if(t.subagent&&t.subagent.length>0)A=t.subagent.map(x=>x==="root"||x==="."?void 0:x);else if(k.length>0&&!t.yes){let x=[{value:"",label:"Root agent",hint:"agent/skills"},...k.map(L=>({value:L,label:L,hint:`agent/subagents/${L}/skills`}))],_=await terminal.Prompt.multiselect({message:"Where should Eve skills be installed?",options:x,initialValues:[""],required:!0});terminal.Prompt.isCancel(_)&&(await de(u),terminal.Prompt.cancel("Installation cancelled")),A=_.map(L=>L===""?void 0:L);}}let R=ro(v,A),O=t.copy?"copy":"symlink";if(R.every(k=>k.agent==="eve"))O="copy";else if(t.copy||t.yes)O="copy";else {let k=await terminal.Prompt.select({message:"Installation method",options:[{value:"symlink",label:"Share (Recommended)",hint:"Single source: 1 copy in .agents/skills + symlinks for non-universal agents"},{value:"copy",label:"Independent",hint:"Physical copy in each agent dir; updates must be re-run per agent"}]});terminal.Prompt.isCancel(k)&&(await de(u),terminal.Prompt.cancel("Installation cancelled")),O=k;}let N=process.cwd(),F=[],V=o?null:await chunkJCOXRETY_cjs.t(N),Q=await Promise.all(g.flatMap(k=>R.map(async x=>{let _=await chunkUGHF4GOW_cjs.l(k.name,x.agent,{global:o,eveSubagent:x.subagent}),L=_.installed,E;try{E=await chunkE7AHWFZN_cjs.b(k.path);}catch{E=void 0;}let z=V?.skills[k.name]?.computedHash,ee=!Ut(!1,z,E),ie=L&&_.mode==="copy"&&O==="copy"&&ee,ce=!!L;return {skillName:k.name,target:x,installed:L,installedMode:_.mode,sourceHash:E,upToDate:!!ie,overwrite:ce}}))),we=new Map,le=new Map;for(let{skillName:k,target:x,overwrite:_,upToDate:L}of Q)we.has(k)||(we.set(k,new Map),le.set(k,new Map)),we.get(k).set(Ft(x),_),le.get(k).set(Ft(x),L);let X={},ve=[];for(let k of g)if(k.pluginName){let x=k.pluginName;X[x]||(X[x]=[]),X[x].push(k);}else ve.push(k);let Ae=k=>{for(let x of k){F.length>0&&F.push("");let _=R[0];R.length>1&&(_=R.find(ie=>chunkISMGLHYS_cjs.o(ie.agent,o?"global":"project"))??R[0]);let L=chunkUGHF4GOW_cjs.o(x.name,{global:o,agent:_.agent,eveSubagent:_.subagent}),E=gs(L,N);F.push(`${chunk5RWSXDNO_cjs.e(E)}`),F.push(...ao(R,O,o,y));let K=we.get(x.name),z=R.filter(ee=>!chunkISMGLHYS_cjs.o(ee.agent,o?"global":"project")&&K?.get(Ft(ee))).map(dt);z.length>0&&F.push(` ${chunk5RWSXDNO_cjs.d("overwrites:")} ${ye(z)}`);}},he=Object.keys(X).sort();for(let k of he){let x=k.split("-").map(_=>_.charAt(0).toUpperCase()+_.slice(1)).join(" ");F.push(""),F.push(chunk5RWSXDNO_cjs.f(x)),Ae(X[k]);}ve.length>0&&(he.length>0&&(F.push(""),F.push(chunk5RWSXDNO_cjs.f("General"))),Ae(ve)),console.log(),terminal.note(F.join(`
8
- `),"Installation Summary");try{let k=await Promise.race([S,new Promise(x=>setTimeout(()=>x(null),to))]);if(k&&m){let x=lo(k,g.map(_=>({slug:chunkJCOXRETY_cjs.B(_),displayName:chunkJCOXRETY_cjs.B(_)})),m);x.length>0&&terminal.note(x.join(`
9
- `),"Security Risk Assessments");}}catch{}if(!t.yes){let k=await terminal.Prompt.confirm({message:"Proceed with installation?"});(terminal.Prompt.isCancel(k)||!k)&&(await de(u),terminal.Prompt.cancel("Installation cancelled"));}p.start("Installing skills...");let Le=[],Ye=await Promise.all(g.map(async k=>{let x=new Map;for(let L of R){let E=chunkUGHF4GOW_cjs.g(L.agent,o,N,L.subagent),K=(L.agent==="eve"||L.agent==="easbot")&&O==="symlink",z=O==="copy"||K?E:chunkUGHF4GOW_cjs.e(o,N),ee=chunkUGHF4GOW_cjs.d(k.name||path.basename(k.path)),ie=path.join(z,ee),ce=path.join(E,ee),M=ie,Y=x.get(M);Y||(Y={canonicalDir:ie,members:[]},x.set(M,Y)),Y.members.push({target:L,agentDir:ce});}return (await Promise.all([...x.values()].map(async L=>{let[E,...K]=L.members;if(!E)return [];if(le.get(k.name)?.get(Ft(E.target))??!1)return L.members.map(({target:ce,agentDir:M})=>({skill:chunkJCOXRETY_cjs.B(k),agent:dt(ce),pluginName:k.pluginName,success:!0,path:M,canonicalPath:M,mode:O,skipped:!0,skippedReason:"up-to-date"}));let ee=await eo(k,E.target,E.agentDir,{installMode:O,installGlobally:o,cwd:N,tempDir:u}),ie=await Promise.all(K.map(async({target:ce,agentDir:M})=>{let Y=O==="copy"?await chunkUGHF4GOW_cjs.j(L.canonicalDir,M,{agentType:ce.agent}):await chunkUGHF4GOW_cjs.i(L.canonicalDir,M,{isGlobal:o,agentType:ce.agent,cwd:N,storePath:k.path});return {skill:chunkJCOXRETY_cjs.B(k),agent:dt(ce),pluginName:k.pluginName,...Y}}));return [ee,...ie]}))).flat()}));for(let k of Ye)Le.push(...k);p.stop("Installation complete"),console.log();let Re=Le.filter(k=>k.success),kt=Le.filter(k=>!k.success),Ge={};for(let k of g)if(u&&k.path===u)Ge[k.name]="SKILL.md";else if(u&&k.path.startsWith(u+path.sep))Ge[k.name]=`${k.path.slice(u.length+1).split(path.sep).join("/")}/SKILL.md`;else if(u&&k.path.startsWith(u)){let x=u.split(path.sep).join("/"),_=k.path.split(path.sep).join("/");_.startsWith(`${x}/`)&&(Ge[k.name]=`${_.slice(x.length+1)}/SKILL.md`);}let qe=chunkJCOXRETY_cjs.a(d),vs=Qn(d.url,qe);if(qe&&(chunkJCOXRETY_cjs.b(qe)?f.then(x=>{x===!1&&chunkQ2MOP5ZW_cjs.d({event:"install",source:qe,skills:g.map(_=>_.name).join(","),agents:v.join(","),...o&&{global:"1"},skillFiles:JSON.stringify(Ge)});}):chunkQ2MOP5ZW_cjs.d({event:"install",source:qe,skills:g.map(x=>x.name).join(","),agents:v.join(","),...o&&{global:"1"},skillFiles:JSON.stringify(Ge)})),Re.length>0&&o){let k=new Set(Re.map(x=>x.skill));for(let x of g){if(!k.has(chunkJCOXRETY_cjs.B(x)))continue;let{derivePluginSlug:_,findSkillByLocation:L,readStoreIndex:E}=await import('./store-TSS4BMBF.cjs'),K=chunkJCOXRETY_cjs.L(d),z;{let Y=(await E()).markets[K],fe=Y?.plugins&&Object.keys(Y.plugins).find(xe=>Y.plugins[xe]?.skills[x.name]);fe?z=fe.slice(K.length+1):z=_(d,void 0,x.pluginName);}let ee,ie;{let M=await L(K,`${K}:${z}`,x.name);ee=M?.entry.computedHash,ie=M?.entry.skillPath;}if(ie===void 0){let M=d.type==="local"?d.localPath??d.url:d.url;if(x.path.startsWith(M))ie=utils.Filesystem.relative(M,x.path).replace(/^\/+/,"");else {let Y=Ge[x.name];Y&&(ie=utils.Filesystem.toUnixPath(utils.Filesystem.dirname(Y)));}}ee===void 0&&(ee=await chunkE7AHWFZN_cjs.b(x.path));let ce=`${K}:${z}`;await chunk5RWSXDNO_cjs.r(x.name,{source:vs||qe||d.url,sourceType:d.type,ref:d.ref,...ie&&{skillPath:ie},computedHash:ee,marketId:K,pluginId:ce});}}if(Re.length>0&&!o){let k=new Set(Re.map(L=>L.skill)),x=v.includes("eve")?A.map(L=>L??""):void 0,_=x&&(x.length>1||x.some(L=>L!==""));for(let L of g)if(k.has(chunkJCOXRETY_cjs.B(L)))try{let{derivePluginSlug:E,findSkillByLocation:K,readStoreIndex:z}=await import('./store-TSS4BMBF.cjs'),ee=chunkJCOXRETY_cjs.L(d),ie=g.find(xe=>chunkJCOXRETY_cjs.B(xe)===L.name),ce;{let _e=(await z()).markets[ee],ke=_e?.plugins&&Object.keys(_e.plugins).find(Ne=>_e.plugins[Ne]?.skills[L.name]);ke?ce=ke.slice(ee.length+1):ce=E(d,void 0,ie?.pluginName);}let M,Y;{let xe=await K(ee,`${ee}:${ce}`,L.name);M=xe?.entry.computedHash,Y=xe?.entry.skillPath??Ge[L.name];}M===void 0&&(M=await chunkE7AHWFZN_cjs.b(L.path));let fe=`${ee}:${ce}`;await chunkJCOXRETY_cjs.v(L.name,{source:vs||d.url,ref:d.ref,sourceType:d.type,...Y&&{skillPath:Y},computedHash:M,marketId:ee,pluginId:fe,..._&&{subagents:x}},N);}catch{}}if(Re.length>0){let k=new Map,x={},_=[];for(let M of Re){let Y=k.get(M.skill)||[];if(Y.push(M),k.set(M.skill,Y),Y.length===1)if(M.pluginName){let fe=M.pluginName;x[fe]||(x[fe]=[]),x[fe].push(M);}else _.push(M);}let L=k.size,E=Re.filter(M=>M.mode==="symlink"&&M.symlinkFailed),K=E.map(M=>M.agent),z=[],ee=M=>{for(let Y of M){let fe=k.get(Y.skill)||[],xe=fe[0];if(z.push(`${terminal.Symbol.statusIcon("success")} ${Y.skill}`),xe.canonicalPath){let ke=gs(xe.canonicalPath,N);z.push(` ${chunk5RWSXDNO_cjs.a("source:")} ${ke}`);}let _e=new Map;for(let ke of fe){if(ke.symlinkFailed||ke.skipped||xe.canonicalPath&&ke.path===xe.canonicalPath)continue;let Ne=ke.path;_e.has(Ne)?_e.get(Ne)!=="symlink"&&ke.mode==="symlink"&&_e.set(Ne,"symlink"):_e.set(Ne,ke.mode);}for(let[ke,Ne]of _e){let pn=gs(ke,N),un=Ne==="symlink"?chunk5RWSXDNO_cjs.e("(link)"):chunk5RWSXDNO_cjs.a("(copied)");z.push(` ${chunk5RWSXDNO_cjs.a("target:")} ${pn} ${un}`);}z.push(...co(fe,v,o));}},ie=Object.keys(x).sort();for(let M of ie){let Y=M.split("-").map(fe=>fe.charAt(0).toUpperCase()+fe.slice(1)).join(" ");z.push(""),z.push(chunk5RWSXDNO_cjs.f(Y)),ee(x[M]);}_.length>0&&(ie.length>0&&(z.push(""),z.push(chunk5RWSXDNO_cjs.f("General"))),ee(_));let ce=chunk5RWSXDNO_cjs.c(`Installed ${L} skill${L!==1?"s":""}`);terminal.note(z.join(`
10
- `),ce),E.length>0&&(terminal.Prompt.Log.warn(chunk5RWSXDNO_cjs.d(`Symlinks failed for: ${ye(K)}`)),terminal.Prompt.Log.message(chunk5RWSXDNO_cjs.a(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(kt.length>0){console.log(),terminal.Prompt.Log.error(chunk5RWSXDNO_cjs.b(`Failed to install ${kt.length}`));for(let k of kt)terminal.Prompt.Log.message(` ${terminal.Symbol.statusIcon("error")} ${k.skill} \u2192 ${k.agent}: ${chunk5RWSXDNO_cjs.a(k.error??"")}`);}if(console.log(),terminal.Prompt.outro(chunk5RWSXDNO_cjs.c("Done!")+chunk5RWSXDNO_cjs.a(" Review skills before use; they run with full agent permissions.")),t.json){let k=Re.map(_=>({skill:_.skill,agent:_.agent,canonicalPath:_.canonicalPath??null,path:_.path,mode:_.mode,..._.pluginName&&{pluginName:_.pluginName}})),x=kt.map(_=>({skill:_.skill,agent:_.agent,error:_.error??"unknown error"}));J(B({scope:o?"global":"project",source:d.url,sourceType:d.type,...d.subpath&&{subpath:d.subpath},...d.ref&&{ref:d.ref},installed:k,failed:x,summary:{total:Le.length,installed:k.length,failed:x.length,agents:v,mode:O}},{scope:o?"global":"project",source:d.url,installed:k.length,failed:x.length,total:Le.length,agents:v.length}));return}await go(t,v);}catch(p){if(p instanceof chunkJCOXRETY_cjs.g){terminal.Prompt.Log.error(chunk5RWSXDNO_cjs.b("Failed to clone repository"));for(let d of p.message.split(`
11
- `))terminal.Prompt.Log.message(chunk5RWSXDNO_cjs.a(d));}else terminal.Prompt.Log.error(p instanceof Error?p.message:"Unknown error occurred");process.stdin.isTTY||l(),terminal.Prompt.outro(chunk5RWSXDNO_cjs.b("Installation failed")),process.exit(1);}finally{await de(u);}}async function de(e){if(e){if(chunkJCOXRETY_cjs.ga(e))return;try{await chunkJCOXRETY_cjs.l(e);}catch{}}}async function go(e,t){if(process.stdin.isTTY&&!e?.yes)try{if(await chunk5RWSXDNO_cjs.w("findSkillsPrompt"))return;if(await chunkUGHF4GOW_cjs.k("eas-skill-find","claude-code",{global:!0})){await chunk5RWSXDNO_cjs.y("findSkillsPrompt");return}console.log(),terminal.Prompt.Log.message(chunk5RWSXDNO_cjs.a("One-time prompt - you won't be asked again if you dismiss."));let l=await terminal.Prompt.confirm({message:`Install the ${chunk5RWSXDNO_cjs.e("eas-skill-find")} skill? It helps your agent discover and suggest skills.`});if(terminal.Prompt.isCancel(l)){await chunk5RWSXDNO_cjs.y("findSkillsPrompt");return}if(l){await chunk5RWSXDNO_cjs.y("findSkillsPrompt");let o=t?.filter(r=>r!=="replit");if(!o||o.length===0)return;console.log(),terminal.Prompt.Log.step("Installing eas-skill-find skill...");try{await ft(["houjallen/agent-skills@skills/builtin/eas-skill-find"],{global:!0,yes:!0,agent:o});let r=path.join(chunkUGHF4GOW_cjs.e(!0),"eas-skill-find"),u=await is({skillId:"eas-skill-find",sourceDir:r,targetAgents:o,installGlobally:!0,defaultMode:"symlink",assumeYes:e?.yes===!0});u.reported.length>0&&terminal.Prompt.Log.warn(`${u.reported.length} cell(s) reported divergent/orphan (not auto-fixed). Run 'easbot skills repair' to fix.`);}catch{terminal.Prompt.Log.warn("Failed to install eas-skill-find. You can try again with:"),terminal.Prompt.Log.message(chunk5RWSXDNO_cjs.a(" easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find -g -y --all"));}}else await chunk5RWSXDNO_cjs.y("findSkillsPrompt"),terminal.Prompt.Log.message(chunk5RWSXDNO_cjs.a("You can install it later with: easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find"));}catch{}}function Mt(e){let t={},s=[];for(let n=0;n<e.length;n++){let l=e[n];if(l==="-g"||l==="--global")t.global=true;else if(l==="-y"||l==="--yes")t.yes=true;else if(l==="-l"||l==="--list")t.list=true;else if(l==="--all")t.all=true;else if(l==="--json")t.json=true;else if(l==="-a"||l==="--agent"){t.agent=t.agent||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.agent.push(o),n++,o=e[n];n--;}else if(l==="-s"||l==="--skill"){t.skill=t.skill||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.skill.push(o),n++,o=e[n];n--;}else if(l==="--full-depth")t.fullDepth=true;else if(l==="--copy")t.copy=true;else if(l==="--subagent"){t.subagent=t.subagent||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.subagent.push(o),n++,o=e[n];n--;}else l&&!l.startsWith("-")&&s.push(l);}return {source:s,options:t}}var xl={languages:[{value:"zh-CN",name:"\u7B80\u4F53\u4E2D\u6587",example:"\u4F60\u597D\uFF0CEASBOT\uFF01",supported:true},{value:"en-US",name:"English (United States)",example:"Hello, EASBOT!",supported:true}]};var mo=xl.languages,ho=mo.filter(e=>e.supported).map(e=>e.value),Be={defaultLocale:"zh-CN",locales:ho},mt={},Gt=(e,t)=>{let s=mt[e]||{translation:{}};return mt[e]={translation:{...s.translation,...t.translation}},mt[e]},Kt=(e=Be.defaultLocale)=>(mt[e]||Gt(e,{translation:{}}),{locale:e,resources:mt[e]||{translation:{}}});var ko={translation:{"cli.banner.tagline":"easbot-skills \u2014 Agent \u6280\u80FD\u751F\u6001","cli.banner.try_hint":"\u8BD5\u8BD5:","cli.banner.discover":"\u5728 {{url}} \u53D1\u73B0\u66F4\u591A\u6280\u80FD","cli.banner.cmd.add":"{{cmd}} add {{dim}}<package>{{reset}} \u6DFB\u52A0\u65B0\u6280\u80FD","cli.banner.cmd.use":"{{cmd}} use {{dim}}<package>@<skill>{{reset}} \u4E0D\u5B89\u88C5\u76F4\u63A5\u4F7F\u7528\u4E00\u4E2A\u6280\u80FD","cli.banner.cmd.remove":"{{cmd}} remove \u79FB\u9664\u5DF2\u5B89\u88C5\u6280\u80FD","cli.banner.cmd.list":"{{cmd}} list \u5217\u51FA\u5DF2\u5B89\u88C5\u6280\u80FD","cli.banner.cmd.find":"{{cmd}} find {{dim}}[query]{{reset}} \u641C\u7D22\u6280\u80FD","cli.banner.cmd.update":"{{cmd}} update \u66F4\u65B0\u5DF2\u5B89\u88C5\u6280\u80FD","cli.banner.cmd.init":"{{cmd}} init {{dim}}[name]{{reset}} \u521B\u5EFA\u4E00\u4E2A\u65B0\u6280\u80FD","cli.banner.cmd.sync":"{{cmd}} experimental_sync \u4ECE node_modules \u540C\u6B65\u6280\u80FD","cli.help.usage":"\u7528\u6CD5: skills <command> [options]","cli.help.section.manage":"\u6280\u80FD\u7BA1\u7406","cli.help.section.find_options":"Find \u9009\u9879","cli.help.section.updates":"\u66F4\u65B0","cli.help.section.update_options":"Update \u9009\u9879","cli.help.section.project":"\u9879\u76EE","cli.help.section.add_options":"Add \u9009\u9879","cli.help.section.use_options":"Use \u9009\u9879","cli.help.section.remove_options":"Remove \u9009\u9879","cli.help.section.sync_options":"\uFF08\u5DF2\u5E9F\u5F03\uFF09Sync \u9009\u9879","cli.help.section.list_options":"List \u9009\u9879","cli.help.section.options":"\u901A\u7528\u9009\u9879","cli.help.store.desc":"\u8FD0\u7EF4\u5B50\u547D\u4EE4\u65CF\uFF08\u4EE5 store \u4E3A\u4E2D\u5FC3\u7BA1\u7406 store / cache\uFF09","cli.help.store.usage_title":"\u7528\u6CD5","cli.help.store.concepts_title":"\u6838\u5FC3\u6982\u5FF5","cli.help.store.local_protection_title":"local \u6E90\u4FDD\u62A4\uFF08\u786C\u89C4\u5219\uFF0C\u4E0D\u53EF\u7ED5\u8FC7\uFF09","cli.help.store.options_title":"\u9009\u9879","cli.help.store.examples_title":"\u793A\u4F8B","cli.help.store.list_desc":"\u5217\u51FA store skills\uFF08\u53EF\u9009 skill name \u8FC7\u6EE4\uFF1B\u4EBA\u7C7B\u53EF\u8BFB\u6A21\u5F0F\u5C55\u793A\u5B8C\u6574 64 \u4F4D hex sourceKey\uFF09","cli.help.store.clean_desc":"\u91CD\u7F6E store\uFF1A\u5220 store \u7269\u7406 + \u6E05 index.json\uFF08cache \u4FDD\u7559\uFF09","cli.help.store.clean_force_desc":"\u540C\u4E0A + \u6E05 cache \u7269\u7406\uFF08local \u6E90 cache \u4FDD\u62A4\uFF09","cli.help.store.update_desc":"\u4ECE\u539F\u59CB\u6E90\u91CD\u65B0\u62C9\u53D6 store\uFF08\u4E0D\u52A8 agent \u524D\u7AEF\uFF1Bsource-key \u4E3A 64 \u4F4D hex marketId\uFF0C\u4ECE `store list` \u53D6\uFF09","cli.help.store.remove_desc":"\u79FB\u9664 store source\uFF1A\u5220 store \u7269\u7406 + index entries","cli.help.store.remove_force_desc":"\u989D\u5916\u6E05 cache \u7269\u7406\uFF08remote \u6E90\uFF1Blocal \u6E90\u5FFD\u7565\uFF09","cli.help.store.help_desc":"\u672C\u5E2E\u52A9","cli.help.store.concept_store":"\u5F52\u4E00\u5316\u6E90\u76EE\u5F55\uFF08add \u5199\u4E00\u6B21\uFF0Cadd \u590D\u7528\uFF09","cli.help.store.concept_cache":"\u4E0B\u8F7D/\u7269\u5316\u7F13\u5B58\uFF08remote \u6E90\u624D\u6709\uFF1Blocal \u6E90 = \u7528\u6237\u539F\u76EE\u5F55\uFF09","cli.help.store.concept_index":"store defs \u7D22\u5F15\uFF08key = skillName\uFF09","cli.help.store.local_clean":"`store clean --force` \u5BF9 local \u6E90\u8DF3\u8FC7 cache\uFF08\u7528\u6237\u539F\u76EE\u5F55\u7EDD\u4E0D\u5220\uFF09","cli.help.store.local_remove_force":"`store remove --force` \u5BF9 local \u6E90\u7B49\u540C\u9ED8\u8BA4\uFF08cache \u8DF3\u8FC7\uFF09","cli.help.store.local_remove":"`store remove` \u5BF9 local \u6E90\u53EA\u5220 store + index\uFF0C\u7EDD\u4E0D\u5220\u7528\u6237\u539F\u76EE\u5F55","cli.help.store.opt_yes":"\u8DF3\u8FC7\u786E\u8BA4\u63D0\u793A","cli.help.store.opt_force":"`clean` / `remove`\uFF1A\u989D\u5916\u6E05 cache \u7269\u7406\uFF08local \u6E90\u5FFD\u7565\uFF09","cli.help.store.opt_json":"\u8F93\u51FA JSON \u683C\u5F0F\uFF08\u673A\u5668\u53EF\u8BFB\uFF09","cli.store.unknown_subcommand":"\u672A\u77E5 store \u5B50\u547D\u4EE4: {{sub}}","cli.help.add.flag.global":"\u5B89\u88C5\u5230\u5168\u5C40\uFF08\u7528\u6237\u76EE\u5F55\uFF09\uFF0C\u800C\u975E\u9879\u76EE\u7EA7\uFF08\u9ED8\u8BA4\u9879\u76EE\u7EA7\uFF09","cli.help.add.flag.agent":"\u6307\u5B9A Agent\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.add.flag.skill":"\u6307\u5B9A\u6280\u80FD\u540D\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.add.flag.list":"\u53EA\u5217\u51FA\u4ED3\u5E93\u4E2D\u7684\u6280\u80FD\uFF0C\u4E0D\u5B89\u88C5","cli.help.add.flag.yes":"\u8DF3\u8FC7\u6240\u6709\u786E\u8BA4\u63D0\u793A","cli.help.add.flag.copy":"\u62F7\u8D1D\u6587\u4EF6\u5230 Agent \u76EE\u5F55\uFF08\u9ED8\u8BA4\u4F7F\u7528\u7B26\u53F7\u94FE\u63A5\uFF09","cli.help.add.flag.subagent":"\u5B89\u88C5\u5230 Eve subagent\uFF08\u7528 root \u8868\u793A\u6839 agent\uFF09","cli.help.add.flag.all":"\u7B49\u540C\u4E8E --skill * --agent * -y","cli.help.add.flag.full_depth":"\u904D\u5386\u6240\u6709\u5B50\u76EE\u5F55\uFF0C\u5373\u4F7F\u5B58\u5728\u6839 SKILL.md","cli.help.use.flag.skill":"\u6307\u5B9A\u8981\u4F7F\u7528\u7684\u6280\u80FD\u540D\uFF08\u4EC5\u5355\u503C\uFF09","cli.help.use.flag.agent":"\u6307\u5B9A\u4EA4\u4E92\u542F\u52A8\u7684 Agent\uFF08\u4EC5\u652F\u6301 claude-code / codex\uFF09","cli.help.use.flag.full_depth":"\u904D\u5386\u6240\u6709\u5B50\u76EE\u5F55","cli.help.use.flag.openclaw_risks":"\u5141\u8BB8\u672A\u5BA1\u6838\u7684 OpenClaw \u793E\u533A\u6280\u80FD","cli.help.remove.flag.global":"\u4ECE\u5168\u5C40\uFF08~\uFF09\u79FB\u9664\uFF0C\u800C\u975E\u9879\u76EE\u7EA7\uFF08\u9ED8\u8BA4\u9879\u76EE\u7EA7\uFF09","cli.help.remove.flag.agent":"\u6307\u5B9A Agent\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.remove.flag.skill":"\u6307\u5B9A\u6280\u80FD\u540D\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.remove.flag.yes":"\u8DF3\u8FC7\u6240\u6709\u786E\u8BA4\u63D0\u793A","cli.help.remove.flag.all":"\u7B49\u540C\u4E8E --skill * --agent * -y","cli.help.list.flag.global":"\u5217\u51FA\u5168\u5C40\u6280\u80FD\uFF08\u9ED8\u8BA4 both \u5168\u5C40 + \u9879\u76EE\uFF09","cli.help.list.flag.project":"\u53EA\u5217\u9879\u76EE\u7EA7\u6280\u80FD\uFF08\u4E0E -g \u4E92\u65A5\uFF1B\u4E24\u8005\u540C\u4F20 = both\uFF09","cli.help.list.flag.agent":"\u6307\u5B9A Agent\uFF08\u53EF\u591A\u6B21\u4F20 / \u7A7A\u683C\u5206\u9694\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.list.flag.json":"\u4EE5 JSON \u8F93\u51FA\uFF08\u65E0 ANSI\uFF09","cli.help.list.flag.all":"\u7B49\u540C\u4E8E --agent *","cli.help.doctor.flag.global":"\u53EA\u68C0\u67E5\u5168\u5C40\uFF08\u4E0E -p \u4E92\u65A5\uFF1B\u9ED8\u8BA4 both\uFF09","cli.help.doctor.flag.project":"\u53EA\u68C0\u67E5\u9879\u76EE\u7EA7\uFF08\u4E0E -g \u4E92\u65A5\uFF1B\u9ED8\u8BA4 both\uFF09","cli.help.doctor.flag.agent":"\u6307\u5B9A Agent\uFF08\u7A7A\u683C\u5206\u9694\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.doctor.flag.yes":"\u8DF3\u8FC7\u786E\u8BA4\u76F4\u63A5\u6E05\u7406\u5931\u6548 link\uFF08\u9ED8\u8BA4\u9700 TTY \u786E\u8BA4\uFF09","cli.help.doctor.flag.all":"\u7B49\u540C\u4E8E --agent *","cli.help.doctor.usage":"\u7528\u6CD5: easbot-skills doctor [options]","cli.help.doctor.description":"\u4F53\u68C0 + \u6E05\u7406 agent baseDir \u4E0B\u7684\u5931\u6548 symlink\uFF08\u9ED8\u8BA4\u53EA\u626B\u63CF\uFF1B\u7528 --yes \u76F4\u63A5\u6E05\u7406\uFF09\u3002\u540E\u7EED\u4F1A\u6269\u5C55 skill \u9A8C\u8BC1\u3001LLM \u8BC4\u5BA1\u7B49\u529F\u80FD\u3002","cli.commands.doctor":"\u4F53\u68C0\uFF1A\u626B\u63CF\u5931\u6548 link / \u540E\u7EED\u6269\u5C55\u9A8C\u8BC1","cli.example.doctor":"\u4EA4\u4E92\u5F0F\u4F53\u68C0 + \u6E05\u7406\u5931\u6548 link","cli.example.doctor_agent_yes":"\u68C0\u67E5\u5355\u4E2A agent + \u76F4\u63A5\u6E05\u7406","cli.example.doctor_global":"\u53EA\u68C0\u67E5\u5168\u5C40\u4F5C\u7528\u57DF","cli.help.find.flag.owner":"\u53EA\u5728\u6307\u5B9A GitHub owner \u4E0B\u641C\u7D22","cli.help.update.flag.global":"\u53EA\u66F4\u65B0\u5168\u5C40\u6280\u80FD\uFF08\u4E0E -p \u4E92\u65A5\uFF1B\u9ED8\u8BA4 -y \u8D70 both\uFF09","cli.help.update.flag.project":"\u53EA\u66F4\u65B0\u9879\u76EE\u7EA7\u6280\u80FD\uFF08\u4E0E -g \u4E92\u65A5\uFF1B\u9ED8\u8BA4 -y \u8D70 both\uFF09","cli.help.update.flag.yes":"\u8DF3\u8FC7\u4F5C\u7528\u57DF\u9009\u62E9\u63D0\u793A\uFF08\u9ED8\u8BA4 both \u5168\u5C40 + \u9879\u76EE\uFF09","cli.help.update.flag.all":"\u7B49\u540C\u4E8E --skill * -y","cli.help.sync.flag.agent":"\u6307\u5B9A Agent\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.sync.flag.yes":"\u8DF3\u8FC7\u6240\u6709\u786E\u8BA4\u63D0\u793A","cli.help.remove.usage":"\u7528\u6CD5: easbot-skills remove [skills...] [options]","cli.help.remove.description":"\u4ECE Agent \u4E2D\u79FB\u9664\u5DF2\u5B89\u88C5\u6280\u80FD\u3002\u672A\u4F20\u6280\u80FD\u540D\u65F6\u8FDB\u5165\u4EA4\u4E92\u5F0F\u9009\u62E9\u83DC\u5355\u3002","cli.help.remove.arguments":"skills \u53EF\u9009\u6280\u80FD\u540D\uFF08\u7A7A\u683C\u5206\u9694\uFF09","cli.example.add":"\u6DFB\u52A0\u4E00\u4E2A\u6280\u80FD\u5305","cli.example.use":"\u4E00\u6B21\u6027\u4F7F\u7528\u67D0\u4E2A\u6280\u80FD","cli.example.use_with_agent":"\u6307\u5B9A\u6280\u80FD + Agent","cli.example.add_global":"\u5168\u5C40\u5B89\u88C5","cli.example.add_multi_agent":"\u5B89\u88C5\u5230\u591A\u4E2A Agent","cli.example.add_multi_skill":"\u5B89\u88C5\u591A\u4E2A\u6280\u80FD","cli.example.remove_interactive":"\u4EA4\u4E92\u5F0F\u5220\u9664","cli.example.remove_by_name":"\u6309\u540D\u79F0\u5220\u9664","cli.example.remove_global":"\u4ECE\u5168\u5C40\u8303\u56F4\u5220\u9664","cli.example.remove_by_agent":"\u4ECE\u6307\u5B9A Agent \u5220\u9664","cli.example.remove_all":"\u5220\u9664\u5168\u90E8","cli.example.remove_agent_all":"\u5220\u9664\u6307\u5B9A Agent \u7684\u6240\u6709\u6280\u80FD","cli.example.list_project":"\u5217\u51FA\u9879\u76EE\u7EA7\u6280\u80FD","cli.example.list_global":"\u5217\u51FA\u5168\u5C40\u6280\u80FD","cli.example.list_filter_agent":"\u6309 Agent \u8FC7\u6EE4","cli.example.list_json":"JSON \u8F93\u51FA","cli.example.find_interactive":"\u4EA4\u4E92\u5F0F\u641C\u7D22","cli.example.find_keyword":"\u6309\u5173\u952E\u5B57\u641C\u7D22","cli.example.find_owner":"\u5728\u6307\u5B9A owner \u4E0B\u641C\u7D22","cli.example.update_one":"\u66F4\u65B0\u5355\u4E2A\u6280\u80FD","cli.example.update_global":"\u4EC5\u66F4\u65B0\u5168\u5C40\u6280\u80FD","cli.example.init":"\u521B\u5EFA\u65B0\u6280\u80FD","cli.example.sync":"\u4ECE node_modules \u540C\u6B65","cli.example.sync_no_prompt":"\u540C\u6B65\u4E14\u8DF3\u8FC7\u786E\u8BA4","cli.example.store":"\u7BA1\u7406 store / cache \u6E90","cli.example.store_list":"\u5217\u51FA store skills","cli.example.store_clean_force":"\u91CD\u7F6E store + \u6E05 cache","cli.example.help":"\u663E\u793A\u6B64\u5E2E\u52A9","cli.init.exists":"\u6280\u80FD\u5DF2\u5B58\u5728: {{path}}","cli.init.created":"\u5DF2\u521B\u5EFA\u6280\u80FD: {{name}}","cli.init.created_label":"\u5DF2\u521B\u5EFA","cli.init.next.title":"\u4E0B\u4E00\u6B65","cli.init.next.edit":"\u7F16\u8F91 {{path}} \u5B9A\u4E49\u6280\u80FD\u6307\u4EE4","cli.init.next.frontmatter":"\u66F4\u65B0 frontmatter \u4E2D\u7684 name \u4E0E description","cli.init.publish.title":"\u53D1\u5E03\u65B9\u5F0F","cli.init.publish.github":"\u63A8\u9001\u5230\u4ED3\u5E93\u540E\u4F7F\u7528 {{cmd}} add <owner>/<repo>","cli.init.publish.url":"\u6258\u7BA1\u6587\u4EF6\u540E\u4F7F\u7528 {{cmd}} add https://example.com/{{path}}","cli.init.browse_hint":"\u5728 {{url}} \u6D4F\u89C8\u5176\u4ED6\u6280\u80FD\u83B7\u53D6\u7075\u611F","cli.unknown_command":"\u672A\u77E5\u547D\u4EE4: {{command}}","cli.help_hint":"\u8FD0\u884C {{cmd}} --help \u67E5\u770B\u7528\u6CD5"}},Tl=ko;var yo={translation:{"cli.banner.tagline":"easbot-skills \u2014 agent skills ecosystem","cli.banner.try_hint":"try:","cli.banner.discover":"Discover more skills at {{url}}","cli.banner.cmd.add":"{{cmd}} add {{dim}}<package>{{reset}} Add a new skill","cli.banner.cmd.use":"{{cmd}} use {{dim}}<package>@<skill>{{reset}} Use a skill without installing","cli.banner.cmd.remove":"{{cmd}} remove Remove installed skills","cli.banner.cmd.list":"{{cmd}} list List installed skills","cli.banner.cmd.find":"{{cmd}} find {{dim}}[query]{{reset}} Search for skills","cli.banner.cmd.update":"{{cmd}} update Update installed skills","cli.banner.cmd.init":"{{cmd}} init {{dim}}[name]{{reset}} Create a new skill","cli.banner.cmd.sync":"{{cmd}} experimental_sync Sync skills from node_modules","cli.help.usage":"Usage: skills <command> [options]","cli.help.section.manage":"Manage Skills","cli.help.section.find_options":"Find Options","cli.help.section.updates":"Updates","cli.help.section.update_options":"Update Options","cli.help.section.project":"Project","cli.help.section.add_options":"Add Options","cli.help.section.use_options":"Use Options","cli.help.section.remove_options":"Remove Options","cli.help.section.sync_options":"(Deprecated) Sync Options","cli.help.section.list_options":"List Options","cli.help.section.options":"Options","cli.help.store.desc":"Ops subcommands (store / cache management, store-centric)","cli.help.store.usage_title":"Usage","cli.help.store.concepts_title":"Concepts","cli.help.store.local_protection_title":"Local source protection (hard rule)","cli.help.store.options_title":"Options","cli.help.store.examples_title":"Examples","cli.help.store.list_desc":"List store skills (optional name filter; human-readable mode shows full 64-hex sourceKey)","cli.help.store.clean_desc":"Reset store: delete store dirs + clear index.json (cache preserved)","cli.help.store.clean_force_desc":"Same + clear cache (local source cache protected)","cli.help.store.update_desc":"Refresh store from source (no agent distribution touched; source-key = 64-hex marketId, copy from `store list`)","cli.help.store.remove_desc":"Remove store source: delete store + index entries","cli.help.store.remove_force_desc":"Extra clear cache (remote sources; local source ignored)","cli.help.store.help_desc":"This help","cli.help.store.concept_store":"normalized source dir (write once, reuse)","cli.help.store.concept_cache":"download/materialize cache (remote only; local = user dir)","cli.help.store.concept_index":"store defs index (key = skillName)","cli.help.store.local_clean":"`store clean --force` skips local source cache (user directory never deleted)","cli.help.store.local_remove_force":"`store remove --force` for local source is same as default (cache skipped)","cli.help.store.local_remove":"`store remove` for local source deletes store + index only, never user directory","cli.help.store.opt_yes":"Skip confirmation prompts","cli.help.store.opt_force":"`clean` / `remove`: extra clear cache (local source ignored)","cli.help.store.opt_json":"Output as JSON (machine-readable)","cli.store.unknown_subcommand":"Unknown store subcommand: {{sub}}","cli.help.add.flag.global":"Install to global (user-level) instead of project-level (default: project)","cli.help.add.flag.agent":"Target agents (repeatable; use * for all)","cli.help.add.flag.skill":"Skill names (repeatable; use * for all)","cli.help.add.flag.list":"Only list available skills in the repo, do not install","cli.help.add.flag.yes":"Skip all confirmation prompts","cli.help.add.flag.copy":"Copy files instead of symlinking","cli.help.add.flag.subagent":"Install to Eve subagents (use root for the root agent)","cli.help.add.flag.all":"Shorthand for --skill * --agent * -y","cli.help.add.flag.full_depth":"Search all subdirectories even when a root SKILL.md exists","cli.help.use.flag.skill":"Specify the skill to use (single value only)","cli.help.use.flag.agent":"Start one supported agent interactively (only claude-code / codex)","cli.help.use.flag.full_depth":"Search all subdirectories","cli.help.use.flag.openclaw_risks":"Allow unverified OpenClaw community skills","cli.help.remove.flag.global":"Remove from global (~) instead of project-level (default: project)","cli.help.remove.flag.agent":"Target agents (repeatable; use * for all)","cli.help.remove.flag.skill":"Skill names (repeatable; use * for all)","cli.help.remove.flag.yes":"Skip all confirmation prompts","cli.help.remove.flag.all":"Shorthand for --skill * --agent * -y","cli.help.list.flag.global":"List global skills (default: both global + project)","cli.help.list.flag.project":"List project-level skills only (mutually exclusive with -g; passing both = both)","cli.help.list.flag.agent":"Target agents (repeatable; use * for all)","cli.help.list.flag.json":"Output as JSON (no ANSI)","cli.help.list.flag.all":"Shorthand for --agent *","cli.help.doctor.flag.global":"Check global scope only (mutually exclusive with -p; default: both)","cli.help.doctor.flag.project":"Check project scope only (mutually exclusive with -g; default: both)","cli.help.doctor.flag.agent":"Target agents (repeatable; use * for all)","cli.help.doctor.flag.yes":"Skip confirmation; unlink dangling symlinks directly","cli.help.doctor.flag.all":"Shorthand for --agent *","cli.help.doctor.usage":"Usage: easbot-skills doctor [options]","cli.help.doctor.description":"Check + cleanup dangling symlinks in agent baseDirs (scan only by default; use --yes to clean). Extensible for skill validation, llm review, etc.","cli.commands.doctor":"Health check: scan dangling symlinks (extensible: validate, llm review, etc.)","cli.example.doctor":"Interactive check + cleanup","cli.example.doctor_agent_yes":"Check one agent + auto-cleanup","cli.example.doctor_global":"Check global scope only","cli.help.find.flag.owner":"Search only repositories from a GitHub owner","cli.help.update.flag.global":"Update global skills only (mutually exclusive with -p; default with -y is both)","cli.help.update.flag.project":"Update project-level skills only (mutually exclusive with -g; default with -y is both)","cli.help.update.flag.yes":"Skip the scope prompt (default: both global + project)","cli.help.update.flag.all":"Shorthand for --skill * -y","cli.help.sync.flag.agent":"Target agents (repeatable; use * for all)","cli.help.sync.flag.yes":"Skip all confirmation prompts","cli.help.remove.usage":"Usage: easbot-skills remove [skills...] [options]","cli.help.remove.description":"Remove installed skills from agents. If no skill names are provided, an interactive selection menu will be shown.","cli.help.remove.arguments":"skills Optional skill names to remove (space-separated)","cli.example.add":"Add a skill package","cli.example.use":"Use a skill one-shot","cli.example.use_with_agent":"Specify skill + agent","cli.example.add_global":"Install globally","cli.example.add_multi_agent":"Install to multiple agents","cli.example.add_multi_skill":"Install multiple skills","cli.example.remove_interactive":"Interactive remove","cli.example.remove_by_name":"Remove by name","cli.example.remove_global":"Remove from global scope","cli.example.remove_by_agent":"Remove from specific agent","cli.example.remove_all":"Remove all skills","cli.example.remove_agent_all":"Remove all skills from one agent","cli.example.list_project":"List project skills","cli.example.list_global":"List global skills","cli.example.list_filter_agent":"Filter by agent","cli.example.list_json":"JSON output","cli.example.find_interactive":"Interactive search","cli.example.find_keyword":"Search by keyword","cli.example.find_owner":"Search within an owner","cli.example.update_one":"Update a single skill","cli.example.update_global":"Update global skills only","cli.example.init":"Create a new skill","cli.example.sync":"Sync from node_modules","cli.example.sync_no_prompt":"Sync without prompts","cli.example.store":"Manage store / cache sources","cli.example.store_list":"List store skills","cli.example.store_clean_force":"Reset store + clear cache","cli.example.help":"Show this help","cli.init.exists":"Skill already exists at {{path}}","cli.init.created":"Initialized skill: {{name}}","cli.init.created_label":"Created","cli.init.next.title":"Next steps","cli.init.next.edit":"Edit {{path}} to define your skill instructions","cli.init.next.frontmatter":"Update the name and description in the frontmatter","cli.init.publish.title":"Publishing","cli.init.publish.github":"Push to a repo, then {{cmd}} add <owner>/<repo>","cli.init.publish.url":"Host the file, then {{cmd}} add https://example.com/{{path}}","cli.init.browse_hint":"Browse existing skills for inspiration at {{url}}","cli.unknown_command":"Unknown command: {{command}}","cli.help_hint":"Run {{cmd}} --help for usage"}},Ll=yo;var $o=()=>{Kt("zh-CN"),Kt("en-US"),Gt("zh-CN",Tl),Gt("en-US",Ll);};$o();var fs=new Map,ms=new Map,bo=e=>{if(ms.has(e))return ms.get(e);let t=/{{\s*(\w+)\s*}}/g,s=[],n;for(;(n=t.exec(e))!==null;){let r=n[1];r&&!s.includes(r)&&s.push(r);}let l=new RegExp("{{\\s*("+s.join("|")+")\\s*}}","g"),o={keys:s,regex:l};return ms.set(e,o),o},Il=(e,t)=>{if(!e||typeof e!="string")return "";if(!t||Object.keys(t).length===0)return e;let{regex:s,keys:n}=bo(e);return n.length===0||!n.some(o=>o in t)?e:e.replace(s,(o,r)=>{let u=t[r];return u==null?"":String(u)})},So=e=>{if(e&&Be.locales.includes(e))return e;let t=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(t){let s=t.replace(/_/g,"-");if(Be.locales.includes(s))return s;let n=s.split("-")[0];if(n==="zh")return "zh-CN";if(n==="en")return "en-US"}return Be.defaultLocale},jl=e=>{if(!fs.has(e)){let{resources:t}=Kt(e);fs.set(e,t);}return fs.get(e)},wo=(e,t={})=>{let s=So(t.locale),l=jl(s)?.translation[e];if(l&&typeof l=="string"){let o=Il(l,t.vars);return o!=null?String(o):String(e)}if(s!==Be.defaultLocale){let r=jl(Be.defaultLocale)?.translation[e];if(r&&typeof r=="string"){let u=Il(r,t.vars);return u!=null?String(u):String(e)}}return String(t.fallback??e)},b=wo;function vo(e){let t=e[0]??"list",s=e.slice(1);return {subcommand:t,restArgs:s}}async function Rl(e,t={}){let{subcommand:s,restArgs:n}=vo(e),l=Ao(n,t);switch(s){case "list":return xo(Pl(n),l);case "clean":return Lo(l);case "update":return Po(Pl(n),l);case "remove":return Co(n,l);case "--help":case "-h":return _l(),0;default:return console.log(chunk5RWSXDNO_cjs.d(b("cli.store.unknown_subcommand",{vars:{sub:s},fallback:`Unknown store subcommand: ${s}`}))),_l(),1}}async function Nl(e){if(!fs$1.existsSync(e))return;let t=fs$1.readdirSync(e,{withFileTypes:true});for(let s of t){if(s.name==="index.json")continue;let n=utils.Filesystem.join(e,s.name);await promises.rm(n,{recursive:true,force:true}).catch(()=>{});}}function Pl(e){for(let t of e)if(t&&!t.startsWith("-"))return t}function Ao(e,t){let s={...t};for(let n=0;n<e.length;n++){let l=e[n];l!==void 0&&(l==="--force"?s.force=true:l==="--yes"||l==="-y"?s.yes=true:l==="--json"&&(s.json=true));}return s}async function xo(e,t={}){let s=await chunkJCOXRETY_cjs.S(),n=await chunkJCOXRETY_cjs.W(),l=e?n.filter(h=>h.skillName.toLowerCase().includes(e.toLowerCase())):n;if(l.length===0)return t.json?(J(B([],{count:0,keyword:e??null,sources:0})),0):(q([],{emptyTitle:"Store skills",outro:e?`${a}No store skills matching "${e}".`:`${a}No store sources. Run \`skills add <source>\` first.`}),0);let o=new Map(Object.values(s.markets).map(h=>[h.id,h]));if(t.json){let h=l.map(f=>{let C=o.get(f.marketId);return {skillName:f.skillName,marketId:f.marketId,pluginId:f.pluginId,sourceKey:f.marketId,type:C?.type??null,url:C?.url??null,storePath:C?.storePath??null,cachePath:C?.cachePath??null,entry:f.entry}});return J(B(h,{count:h.length,keyword:e??null,sources:new Set(l.map(f=>f.marketId)).size})),0}let r=[];r.push("");let u=new Map;for(let h of l){u.has(h.marketId)||u.set(h.marketId,new Map);let f=u.get(h.marketId);f.has(h.pluginId)||f.set(h.pluginId,[]),f.get(h.pluginId).push(h);}let p=Array.from(new Set(l.map(h=>h.marketId))),d=0;for(let h of p){let f=o.get(h),C=h,w=C.slice(0,8),$=f?.storePath??utils.Filesystem.join(chunkJCOXRETY_cjs.J(),h),c=f?.type??"unknown",g=f?.url??"(local)",m=chunk5RWSXDNO_cjs.a("(n/a)");if(f?.cachePath)try{let T=fs$1.readdirSync(f.cachePath);m=chunk5RWSXDNO_cjs.c(`${T.length} files`);}catch{m=chunk5RWSXDNO_cjs.b("missing");}r.push(`${chunk5RWSXDNO_cjs.f(C)} ${chunk5RWSXDNO_cjs.a("("+c+")")} ${g}`),r.push(` ${chunk5RWSXDNO_cjs.a("\u2514")} ${chunk5RWSXDNO_cjs.a("key="+w)} ${chunk5RWSXDNO_cjs.a("store="+$)} ${chunk5RWSXDNO_cjs.a("cache="+(f?.cachePath??"(n/a)"))} ${m}`);let S=u.get(h),v=Array.from(S.keys()).sort();for(let T of v){let j=S.get(T),y=T.split(":").slice(1).join(":")||T;r.push(` ${chunk5RWSXDNO_cjs.a("\u2514")} ${chunk5RWSXDNO_cjs.e(y)} ${chunk5RWSXDNO_cjs.a("("+j.length+" skill"+(j.length>1?"s":"")+")")}`);let A=[...j].sort((R,O)=>R.skillName.localeCompare(O.skillName));for(let R of A)r.push(` ${To(R.skillName)}`),d++;}r.push("");}return q(r,{title:`Store skills (${d})`,outro:chunk5RWSXDNO_cjs.a(`Total: ${d} skill(s)${e?` matching "${e}"`:""}. Use \`skills store clean [--force]\` to reset store, \`skills store update [source-key]\` to refresh from source (copy the source key above).`)}),0}function To(e){return e.replace(/[\x00-\x1f\x7f]/g,"").trim()}async function Lo(e={}){return e.force?jo(e):Io(e)}async function Io(e){await chunkJCOXRETY_cjs.S();let s=await chunkJCOXRETY_cjs.W(),n=Array.from(new Set(s.map(u=>u.marketId))),l=s.length;if(!e.yes&&!e.json&&process.stdin.isTTY){l>0&&terminal.Prompt.Log.warn(chunk5RWSXDNO_cjs.d(`This will reset store: ${n.length} source(s) / ${l} skill(s). Cache is preserved; next \`skills add <source>\` will reuse cache if present.`));let u=await terminal.Prompt.confirm({message:"Reset store (delete store contents + clear index.json)?"});if(terminal.Prompt.isCancel(u)||!u)return terminal.Prompt.cancel("Cancelled."),1}let o=chunkJCOXRETY_cjs.J();await Nl(o);let r=utils.Filesystem.join(o,"index.json");if(fs$1.existsSync(r)){let{Filesystem:u}=await import('@easbot/utils');await u.writeJson(r,{version:6,markets:{}});}if(fs$1.existsSync(o)&&await promises.rm(utils.Filesystem.normalize(o),{recursive:true,force:true}).catch(()=>{}),chunkQ2MOP5ZW_cjs.d({event:"store_clean"}),e.json)return J(B({cleaned:true,path:o,affectedSources:n.length,affectedSkills:l,cacheCleared:false},{affectedSources:n.length,affectedSkills:l,cacheCleared:false})),0;{let u=l>0?` (${l} skill(s) reset)`:"";q([],{emptyTitle:"Store clean",outro:`${chunk5RWSXDNO_cjs.c(`\u2713 Reset store: ${o}${u} (cache preserved)`)}`});}return 0}async function jo(e){let t=await chunkJCOXRETY_cjs.S(),s=await chunkJCOXRETY_cjs.W(),n=Array.from(new Set(s.map(w=>w.marketId))),l=s.length,o=new Set,r=new Set;for(let w of Object.values(t.markets))w.type==="local"?o.add(w.localPath??w.url):r.add(w.id);if(!e.yes&&!e.json&&process.stdin.isTTY){let w=o.size,$=w>0?chunk5RWSXDNO_cjs.d(` ${w} local source(s) cache = user directory; will be SKIPPED (never removed by force).`):"";terminal.Prompt.Log.warn(chunk5RWSXDNO_cjs.d(`This will reset store AND clear cache: ${n.length} source(s) / ${l} skill(s).${$}`));let c=await terminal.Prompt.confirm({message:"Reset store + clear cache (local sources protected)?"});if(terminal.Prompt.isCancel(c)||!c)return terminal.Prompt.cancel("Cancelled."),1}let u=chunkJCOXRETY_cjs.J(),p=utils.Filesystem.normalize(chunkJCOXRETY_cjs.N()),d=utils.Filesystem.normalize(u);for(let w of o){let $=utils.Filesystem.normalize(w);if($.startsWith(d+"/")||$===d)throw new Error(`[INVARIANT 0048-yyy] localPath falls inside storeRoot (suspected configuration error): ${$}
12
- This is a program bug: a local source must be the user's original directory and must not live inside storeRoot.`);if($.startsWith(p+"/")||$===p)throw new Error(`[INVARIANT 0048-yyy] localPath falls inside cacheRoot (suspected configuration error): ${$}
13
- This is a program bug: a local source must not live inside cacheRoot.`)}await Nl(u);let h=utils.Filesystem.join(u,"index.json");if(fs$1.existsSync(h)){let{Filesystem:w}=await import('@easbot/utils');await w.writeJson(h,{version:6,markets:{}});}let f=chunkJCOXRETY_cjs.N(),C=false;if(fs$1.existsSync(f)&&r.size>0?(await chunkJCOXRETY_cjs.ja(),C=true):fs$1.existsSync(f)&&(await chunkJCOXRETY_cjs.ja(),C=true),fs$1.existsSync(u)&&await promises.rm(utils.Filesystem.normalize(u),{recursive:true,force:true}).catch(()=>{}),chunkQ2MOP5ZW_cjs.d({event:"store_clean_force"}),e.json)J(B({cleaned:true,path:u,cachePath:f,affectedSources:n.length,affectedSkills:l,cacheCleared:C,localSourcesSkipped:o.size},{affectedSources:n.length,affectedSkills:l,cacheCleared:C,localSourcesSkipped:o.size}));else {let w=o.size>0?chunk5RWSXDNO_cjs.a(` (${o.size} local source(s) cache preserved)`):"";q([],{emptyTitle:"Store clean (force)",outro:`${chunk5RWSXDNO_cjs.c(`\u2713 Reset store + cleared cache${w}`)}`});}return 0}async function Po(e,t={}){let s=await chunkJCOXRETY_cjs.S(),n=await chunkJCOXRETY_cjs.W();if(n.length===0)return t.json?(J(B({updated:0,reason:"no store sources"},{updated:0,reason:"no store sources"})),0):(q([],{emptyTitle:"Store update",outro:`${a}No store sources to update.`}),0);let l=new Set;if(e){if(!new Set(Object.keys(s.markets)).has(e))return t.json?(J(B({updated:0,reason:`source key not found: ${e}`},{updated:0,reason:`source key not found: ${e}`})),1):(q([],{emptyTitle:"Store update",outro:`${a}Source key not found: ${e}. Run \`skills store list\` to see available source keys.`}),1);l.add(e);}else for(let p of n)l.add(p.marketId);let o=0,r=0,u=[];for(let p of l){let d=await _o(p,s,{...t});d.ok?(o++,u.push({sourceKey:p,skills:d.skills})):(r++,u.push({sourceKey:p,skills:[],cloneError:d.error}));}return chunkQ2MOP5ZW_cjs.d({event:"store_update",sourceKey:e??"",sourceCount:String(o+r),successCount:String(o),failCount:String(r)}),t.json?J(B({updated:o,failed:r,total:l.size,sourceKey:e??null,results:u},{failed:r,total:l.size,sourceKey:e??null})):(r>0&&terminal.Prompt.Log.warn(chunk5RWSXDNO_cjs.d(`${r} source(s) failed to refresh (clone errors); see above.`)),terminal.Prompt.outro(chunk5RWSXDNO_cjs.c(`\u2713 Refreshed ${o}/${l.size} store source(s)${e?` (source-key ${e.slice(0,8)}\u2026)`:""}`)),o>0&&terminal.Prompt.Log.info(chunk5RWSXDNO_cjs.a("Agent junctions refresh automatically; agents using copy mode need `skills update <skill>`."))),r>0?2:0}async function _o(e,t,s){let n=t.markets[e];if(!n)return {ok:false,error:`source key not found: ${e}`};let l=chunkJCOXRETY_cjs.e(n.url);if(n.subpath&&(l.subpath=n.subpath),n.ref&&(l.ref=n.ref),false);let o=await chunkJCOXRETY_cjs.da(l,{mode:"update"});return o.cloneError?{ok:false,error:o.cloneError.message}:{ok:true,skills:o.skills.map(r=>r.name)}}async function Co(e,t={}){let s=e[0];if(!s)return t.json?(J(B({removed:false,reason:"source key required"},{removed:false,reason:"source key required"})),1):(terminal.Prompt.Log.error(chunk5RWSXDNO_cjs.b("Usage: skills store remove <source-key> [--force]")),1);let n=await chunkJCOXRETY_cjs.S(),l=(await chunkJCOXRETY_cjs.W()).filter(f=>f.marketId===s);if(l.length===0)return t.json?(J(B({removed:false,reason:`source key not found: ${s}`},{removed:false,reason:`source key not found: ${s}`})),1):(terminal.Prompt.Log.error(chunk5RWSXDNO_cjs.b(`Source key not found: ${s}`)),q([],{emptyTitle:"Store remove",outro:`${a}Run \`skills store list\` to see available sources.`}),1);let o=n.markets[s],r=utils.Filesystem.join(chunkJCOXRETY_cjs.J(),s),u=o.type==="local",p=u?` (local: ${utils.Filesystem.normalize(o.url).replace(/[/\\]+$/,"")})`:"",d=s.length>12?`${s.slice(0,12)}\u2026`:s;if(!t.yes&&!t.json&&process.stdin.isTTY){let f=u?" [local source: user directory protected]":"",C=t.force&&!u?" (+ cache)":"",w=await terminal.Prompt.confirm({message:`Remove store source ${d}${p} (${l.length} skill(s))${f}${C}?`});(terminal.Prompt.isCancel(w)||!w)&&terminal.Prompt.cancel("Cancelled.");}let h=await chunkJCOXRETY_cjs.S();if(h.markets[s]&&(delete h.markets[s],await utils.Filesystem.writeJson(utils.Filesystem.join(chunkJCOXRETY_cjs.J(),"index.json"),h)),fs$1.existsSync(r)&&await promises.rm(r,{recursive:true,force:true}),!u&&t.force&&await chunkJCOXRETY_cjs.ia({type:o.type,url:o.url,subpath:o.subpath,ref:o.ref}),chunkQ2MOP5ZW_cjs.d({event:t.force?"store_remove_force":"store_remove",source:s,sourceType:o.type,removedSkills:l.map(f=>f.skillName).join(",")}),t.json)J(B({removed:true,sourceKey:s,sourceType:o.type,isLocal:u,cacheCleared:!u&&t.force===true,skills:l.map(f=>f.skillName)},{sourceType:o.type,cacheCleared:!u&&t.force===true,count:l.length}));else {let f=`\u2713 Removed store source ${s.slice(0,8)}\u2026 (${l.length} skill(s))`;u?f+=chunk5RWSXDNO_cjs.a(" [local: user directory preserved]"):t.force?f+=chunk5RWSXDNO_cjs.a(" (+ cache cleared)"):f+=chunk5RWSXDNO_cjs.a(" (cache preserved; use --force to clear)"),q([],{emptyTitle:"Store remove",outro:`${chunk5RWSXDNO_cjs.c(f)}`});}return 0}function _l(){let e=(t,s,n)=>b(`cli.help.store.${t}`,{fallback:s,vars:n});console.log(`
14
- ${chunk5RWSXDNO_cjs.f(chunk5RWSXDNO_cjs.e("skills store"))} - ${e("desc","Ops subcommands (store / cache management, store-centric)")}
15
-
16
- ${chunk5RWSXDNO_cjs.f(e("usage_title","Usage:"))}
1
+ 'use strict';var chunkQ2MOP5ZW_cjs=require('./chunk-Q2MOP5ZW.cjs'),chunkBWDTT6SA_cjs=require('./chunk-BWDTT6SA.cjs'),chunkLJ63Q26N_cjs=require('./chunk-LJ63Q26N.cjs'),chunkIJI72D6W_cjs=require('./chunk-IJI72D6W.cjs'),chunkHOK3SUH4_cjs=require('./chunk-HOK3SUH4.cjs'),chunkJUNIAQ2A_cjs=require('./chunk-JUNIAQ2A.cjs'),chunkXGUPIAAF_cjs=require('./chunk-XGUPIAAF.cjs'),chunkDNE3XPCJ_cjs=require('./chunk-DNE3XPCJ.cjs'),chunkE7AHWFZN_cjs=require('./chunk-E7AHWFZN.cjs'),chunkBWPPLYIF_cjs=require('./chunk-BWPPLYIF.cjs'),fs$1=require('fs'),os=require('os'),path=require('path'),utils=require('@easbot/utils'),terminal=require('@easbot/terminal'),promises=require('fs/promises'),crypto=require('crypto'),url=require('url'),Ol=require('readline'),child_process=require('child_process');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Ol__namespace=/*#__PURE__*/_interopNamespace(Ol);async function el(e){let t=crypto.createHash("sha256");try{let s=await promises.readFile(path.join(e,"SKILL.md"),"utf-8");t.update("SKILL.md"),t.update(s);}catch{t.update("EMPTY");}return t.digest("hex")}async function ns(e,t){let s;try{s=await promises.lstat(e);}catch{return "absent"}if(s.isSymbolicLink())try{let p=utils.Filesystem.toUnixPath(await promises.realpath(e)),u=utils.Filesystem.toUnixPath(await promises.realpath(t));return p===u?"symlinked":"orphan"}catch{return "orphan"}let n=path.join(e,"SKILL.md");try{await promises.access(n);}catch{return "absent"}if(!await chunkHOK3SUH4_cjs.y(n))return "divergent";let o=await el(e),r=await el(t);return o===r?"copied":"divergent"}function tl(e,t){let s=[];for(let n of e)for(let l of ["global","project"]){let o=n.cells[l];o.state==="absent"?s.push({kind:"install",agentId:n.agentId,scope:l,mode:t,targetPath:o.targetPath}):o.state==="symlinked"||o.state==="copied"?s.push({kind:"skip",agentId:n.agentId,scope:l,state:o.state}):s.push({kind:"report",agentId:n.agentId,scope:l,state:o.state});}return s}async function sl(e,t){let s=[],n=[];for(let l of e)if(l.kind!=="skip"){if(l.kind==="report"){n.push(l);continue}try{await promises.mkdir(path.dirname(l.targetPath),{recursive:!0});let o;l.mode==="symlink"?o=await chunkIJI72D6W_cjs.i(t.sourceDir,l.targetPath,{isGlobal:t.installGlobally&&l.scope==="global",agentType:l.agentId,cwd:t.cwd}):o=await chunkIJI72D6W_cjs.j(t.sourceDir,l.targetPath,{agentType:l.agentId,isGlobal:t.installGlobally&&l.scope==="global"}),o.success?(o.symlinkFailed,s.push(l)):n.push({kind:"report",agentId:l.agentId,scope:l.scope,state:"divergent"});}catch{n.push({kind:"report",agentId:l.agentId,scope:l.scope,state:"divergent"});}}return {installed:s,reported:n}}function ll(e,t){let s=[];for(let n of e)if(n==="eve"&&t.includeEveSubagents!==false){let l=chunkJUNIAQ2A_cjs.f(t.cwd);if(l.length===0)s.push($n(t));else for(let o of l)s.push({agentId:n,cells:{global:tt("global",n,true,t,o),project:tt("project",n,false,t,o)}});}else s.push({agentId:n,cells:{global:tt("global",n,true,t),project:tt("project",n,false,t)}});return s}function tt(e,t,s,n,l){return {scope:e,state:"absent",targetPath:path.join(chunkIJI72D6W_cjs.g(t,s,n.cwd,l),n.skillId),sourceDir:n.sourceDir}}function $n(e){return {agentId:"eve",cells:{global:tt("global","eve",true,e),project:tt("project","eve",false,e)}}}async function is(e){let t=e.cwd??process.cwd(),s=utils.Filesystem.toUnixPath(e.sourceDir),n=e.includeEveSubagents??true;if(e.assumeYes)return {skipped:true,installed:[],reported:[]};let l=ll(e.targetAgents,{skillId:e.skillId,sourceDir:s,cwd:t,includeEveSubagents:n}),o=[];for(let d of l){let h={...d.cells.global,state:await ns(d.cells.global.targetPath,s)},f={...d.cells.project,state:await ns(d.cells.project.targetPath,s)};o.push({agentId:d.agentId,cells:{global:h,project:f}});}let r=tl(o,e.defaultMode),{installed:p,reported:u}=await sl(r,{sourceDir:s,installGlobally:e.installGlobally,cwd:t});return {skipped:false,installed:p,reported:u,matrix:o}}function Ct(e){return chunkBWDTT6SA_cjs.h(chunkBWDTT6SA_cjs.g(chunkBWDTT6SA_cjs.f(` ${e} `)))}var wn="/opt/.devin",nl="easbot",vn="cursor",An="cursor-cli",xn="claude",Ln="cowork",Tn="devin",In="replit",jn="gemini",Pn="codex",_n="antigravity",Cn="augment-cli",Rn="opencode",rs="github-copilot",Nn="github-copilot-cli",ol="v0";async function il(){if(process.env.AI_AGENT){let e=process.env.AI_AGENT.trim();if(e)return e===nl?{isAgent:true,agent:{name:nl}}:e===rs||e===Nn?{isAgent:true,agent:{name:rs}}:e===ol?{isAgent:true,agent:{name:ol}}:{isAgent:true,agent:{name:e}}}if(process.env.CURSOR_TRACE_ID)return {isAgent:true,agent:{name:vn}};if(process.env.CURSOR_AGENT||process.env.CURSOR_EXTENSION_HOST_ROLE==="agent-exec")return {isAgent:true,agent:{name:An}};if(process.env.GEMINI_CLI)return {isAgent:true,agent:{name:jn}};if(process.env.CODEX_SANDBOX||process.env.CODEX_CI||process.env.CODEX_THREAD_ID)return {isAgent:true,agent:{name:Pn}};if(process.env.ANTIGRAVITY_AGENT)return {isAgent:true,agent:{name:_n}};if(process.env.AUGMENT_AGENT)return {isAgent:true,agent:{name:Cn}};if(process.env.OPENCODE_CLIENT)return {isAgent:true,agent:{name:Rn}};if(process.env.CLAUDECODE||process.env.CLAUDE_CODE)return process.env.CLAUDE_CODE_IS_COWORK?{isAgent:true,agent:{name:Ln}}:{isAgent:true,agent:{name:xn}};if(process.env.REPL_ID)return {isAgent:true,agent:{name:In}};if(process.env.COPILOT_MODEL||process.env.COPILOT_ALLOW_ALL||process.env.COPILOT_GITHUB_TOKEN)return {isAgent:true,agent:{name:rs}};try{return await promises.access(wn,fs$1.constants.F_OK),{isAgent:!0,agent:{name:Tn}}}catch{}return {isAgent:false,agent:void 0}}var st=null,On={cursor:"cursor","cursor-cli":"cursor",claude:"claude-code",cowork:"claude-code",devin:"universal",replit:"replit",gemini:"gemini-cli",codex:"codex",antigravity:"antigravity","augment-cli":"augment",opencode:"opencode","github-copilot":"github-copilot"};async function lt(){return st||(st=await il(),st.isAgent&&chunkQ2MOP5ZW_cjs.a(st.agent.name),st)}async function Rt(){return (await lt()).isAgent}async function dr(){let e=await lt();return e.isAgent?e.agent.name:null}function rl(e){return On[e]??null}function as(e,t){return t?`${e}#${t}`:e}function z(e,t,s=true){return t===void 0?{ok:s,data:e}:{ok:s,data:e,meta:t}}function Dn(e,t=2){console.log(JSON.stringify(e,null,t));}function J(e){Dn(e);}function q(e,t={}){let s=e.length===0,n=s?t.empty??chunkBWDTT6SA_cjs.a("No results."):e.join(`
2
+ `);if(!(s&&t.hideBoxWhenEmpty)){let l=s?t.emptyTitle??t.title:t.title;l?terminal.note(n,l):console.log(n);}t.outro&&!t.skipOutro?terminal.Prompt.outro(t.outro):t.skipOutro||terminal.Prompt.outro(chunkBWDTT6SA_cjs.c("Done!"));}var i="\x1B[0m",G="\x1B[1m",a="\x1B[38;5;102m",U="\x1B[38;5;145m",Le="\x1B[36m";var Fe="\x1B[33m";path.dirname(url.fileURLToPath(chunkBWPPLYIF_cjs.c));var Et=Number(process.env.SKILLS_UPDATE_TIMEOUT??6e4);async function Dt(e,t,s){let n=null,l=new Promise((o,r)=>{n=setTimeout(()=>r(new Error(`${s} timed out after ${t}ms`)),t);});try{return await Promise.race([e,l])}finally{n&&clearTimeout(n);}}function ul(e,t){if(!e)return [];let n=e.message.includes("timed out")?"Fetch timeout":"Source unreachable";return t.map(({name:l,entry:o})=>({name:l,reason:n,sourceUrl:o.source,sourceType:o.sourceType,ref:o.ref}))}async function gl(e){try{return await chunkE7AHWFZN_cjs.b(e)}catch{return}}async function dl(e,t,s,n){let{rm:l,readdir:o,stat:r}=await import('fs/promises'),p=chunkHOK3SUH4_cjs.L(e),u=chunkHOK3SUH4_cjs.M(e),d=utils.Filesystem.join(utils.Filesystem.normalize(t),s),h=utils.Filesystem.join(u,s);if(!await utils.Filesystem.exists(d))return {ok:false};let f=new Set([".git","node_modules"]),C=async m=>{let S=[],v=async j=>{try{let A=[...await o(j,{withFileTypes:!0})].filter(O=>!f.has(O.name)).sort((O,D)=>O.name.localeCompare(D.name)),R=await Promise.all(A.map(async O=>{let D=utils.Filesystem.join(j,O.name);try{let N=await r(D);return `${D.slice(utils.Filesystem.normalize(m).length+1).split(/[\\/]/).join("/")}|${N.size}|${O.isDirectory()?"d":"f"}|${(N.mode&511).toString(8)}`}catch{return `${O.name}|?|?|?`}}));for(let O of R)S.push(O);for(let O of A)if(O.isDirectory()&&!await v(utils.Filesystem.join(j,O.name)))return !1;return !0}catch{return false}};if(await v(utils.Filesystem.normalize(m)))return S.sort(),crypto.createHash("sha256").update(S.join(`
3
+ `)).digest("hex")},w=await C(d),$=await C(h);if(w&&$&&w===$){let S=(await chunkHOK3SUH4_cjs.Y(p,chunkHOK3SUH4_cjs.O(e,s),n))?.entry.computedHash;if(S)return {ok:true,hash:S,skipped:true}}try{await l(h,{recursive:!0,force:!0}),await utils.Filesystem.cp(d,h);}catch{return {ok:false}}let c=await gl(h);if(!c)return {ok:false};let g=e.type==="local"?e.localPath??e.url:utils.Filesystem.normalize(t);try{await chunkHOK3SUH4_cjs.aa([{skillName:n,parsed:e,sourceKey:p,sourcePath:g,storePath:u,skillPath:s,computedHash:c}]);}catch{}return {ok:true,hash:c}}function Ut(e,t,s){return e||!t||!s?true:t!==s}function Gn(e,t={}){let s={};t.cwd&&(s.cwd=t.cwd);let n=[];for(let l=0;l<e.length;l++){let o=e[l];if(o==="-g"||o==="--global")s.global=true;else if(o==="-p"||o==="--project")s.project=true;else if(o==="-y"||o==="--yes")s.yes=true;else if(o==="--all")s.all=true;else if(o==="--json")s.json=true;else if(o==="--force")s.force=true;else if(o==="-a"||o==="--agent")for(s.agent=s.agent??[];l+1<e.length&&!e[l+1].startsWith("-");)s.agent.push(e[++l]);else if(o==="-s"||o==="--skill")for(s.skills=s.skills??[];l+1<e.length&&!e[l+1].startsWith("-");)s.skills.push(e[++l]);else o&&!o.startsWith("-")&&n.push(o);}return n.length>0&&(s.skills=n),s}function qr(e){let t=e||process.cwd();return fs$1.existsSync(path.join(t,"skills-lock.json"))}async function Kn(e){if(e.skills&&e.skills.length>0)return e.global?"global":e.project?"project":"both";if(e.global&&e.project)return "both";if(e.global)return "global";if(e.project)return "project";if(e.yes||!process.stdin.isTTY)return "both";let t=await terminal.Prompt.select({message:"Update scope",options:[{value:"project",label:"Project",hint:"Update skills in current directory (committed with your project)"},{value:"global",label:"Global",hint:"Update skills in home directory (available across all projects)"},{value:"both",label:"Both",hint:"Update all skills (project + global)"}]});return terminal.Prompt.isCancel(t)&&terminal.Prompt.cancel("Cancelled"),t}function fl(e,t){if(!t||t.length===0)return true;let s=e.toLowerCase();return t.some(n=>{let l=n.toLowerCase();return l==="*"?true:l===s})}function Hn(e){return e.sourceType==="local"?"Local path":e.sourceType==="git"?"Git URL":e.sourceType==="well-known"?"Well-known skill":e.computedHash?e.skillPath?"No version tracking":"No skill path recorded":"Private or deleted repo"}function Wn(e){let t=e.sourceUrl;if(e.sourceType==="well-known"){let s=t.indexOf("/.well-known/");s!==-1&&(t=t.slice(0,s));}return as(t,e.ref)}function Nt(e){if(e.length===0)return;console.log(),console.log(`${a}${e.length} skill(s) cannot be checked automatically:${i}`);let t=new Map;for(let s of e){let n=Wn(s),l=t.get(n)||[];l.push(s),t.set(n,l);}for(let[s,n]of t){if(n.length===1){let l=n[0];console.log(` ${U}\u2022${i} ${chunkDNE3XPCJ_cjs.b(l.name)} ${a}(${l.reason})${i}`);}else {let l=n[0].reason,o=n.map(r=>chunkDNE3XPCJ_cjs.b(r.name)).join(", ");console.log(` ${U}\u2022${i} ${o} ${a}(${l})${i}`);}console.log(` ${a}To update: ${U}easbot skills add ${s} -g -y${i}`);}}async function ml(e){let t={skills:[],refreshedSkillCount:0,upToDateSkillCount:0,failedSkillCount:0},s=new Map,n=(c,g)=>{let m=`${g}::${c}`,S=s.get(m);return S||(S={skillName:c,scope:g,sharedAgents:[],copiedAgents:[],linkedAgents:[],upToDateAgents:[],deadLinkAgents:[],failed:[],ok:true,failedCount:0},s.set(m,S),t.skills.push(S)),S},l=e.scope??"both",o=chunkJUNIAQ2A_cjs.q(e.agentFilter??[]),r=o.length>0?o:void 0,u=(await chunkLJ63Q26N_cjs.a({scope:l,cwd:e.cwd,agentFilter:r})).map(c=>({name:c.name,description:"",path:c.skillDir,canonicalPath:c.skillDir,scope:c.scope,agents:[...c.agents]})),d=e.skillNames??[];if(!(d.length===1&&d[0]==="*")){let c=new Set(d.map(g=>g.toLowerCase()));u=u.filter(g=>c.has(g.name.toLowerCase()));}let{readLocalLock:h}=await import('./local-lock-KNX2RUIV.cjs'),{readSkillLock:f}=await import('./skill-lock-WPACLO4W.cjs'),C=await h(),w=await f();for(let c of u){let g=c.scope==="global"?w.skills[c.name]:C.skills[c.name];if(!g?.marketId||!g.pluginId)continue;let m=await chunkHOK3SUH4_cjs.Y(g.marketId,g.pluginId,c.name);if(!m)continue;let{readStoreIndex:S}=await import('./store-2ULHEVHS.cjs'),L=(await S()).markets[m.marketId];if(!L)continue;let y=`${L.storePath.replace(/\\/g,"/").replace(/\/+$/,"")}/${m.entry.skillPath}`.replace(/\\/g,"/");c.path=y,c.canonicalPath=y;}let $=new Map;for(let c of u){let g=`${c.scope}::${c.name}::${c.path}`;$.set(g,c);}for(let c of d){if(c==="*")continue;let g=c.replace(/\.+$/,""),m=d.indexOf(c),v=e.skillStorePaths?.[m]?.split(/[\\/]/).filter(Boolean).pop();if(v){for(let[L,j]of $)if(L.startsWith(`${j.scope}::`)&&L.endsWith(`::${v}`)){let y=`${j.scope}::${g}::${j.path}`;$.has(y)||$.set(y,j);break}}}if($.size===0)return t;for(let[c,g]of $){let S=c.split("::")[1].replace(/\.+$/,""),v=g.path,L=n(S,g.scope),y=fs$1.existsSync(v)?await chunkHOK3SUH4_cjs.y(`${v}/SKILL.md`.replace(/\\/g,"/")):void 0;if(!y){if(!await Bn(S,g.scope==="global"))continue;for(let O of g.agents)L.failed.push({agent:O,reason:"store source missing \u2014 run `easbot skills add <source>` to rebuild"}),L.failedCount++,L.ok=false;continue}let A=y;for(let R of g.agents){let O=chunkJUNIAQ2A_cjs.o(R,g.scope),N=await chunkIJI72D6W_cjs.h(A,R,{global:g.scope==="global",mode:"symlink",cwd:e.cwd});if(!N.success){L.failed.push({agent:R,reason:N.error??"install failed"}),L.failedCount++,L.ok=false;continue}N.skippedReason==="up-to-date"?L.upToDateAgents.push(R):O?L.sharedAgents.push(R):L.copiedAgents.push(R);}}for(let c of t.skills){let g=c.failedCount>0,m=c.sharedAgents.length+c.copiedAgents.length+c.linkedAgents.length>0,S=c.upToDateAgents.length+c.deadLinkAgents.length>0||m;g?t.failedSkillCount++:m?t.refreshedSkillCount++:S&&t.upToDateSkillCount++;}return t}async function Bn(e,t){return t?(await chunkBWDTT6SA_cjs.l()).skills[e]:(await chunkHOK3SUH4_cjs.t()).skills[e]}function zn(e){let t=[...e.skills].sort((o,r)=>o.skillName.localeCompare(r.skillName)),s=[];for(let o of t){let r=[...o.sharedAgents,...o.copiedAgents,...o.linkedAgents,...o.upToDateAgents];r.length!==0&&s.push({skill:o.skillName,agents:r});}let n=["global","project"],l=[];for(let o of n){let r=e.skills.filter(u=>u.scope===o);if(r.length===0)continue;let p=[...r].sort((u,d)=>u.skillName.localeCompare(d.skillName));for(let u of p){let d=[];u.sharedAgents.length>0&&d.push({label:"universal",agents:u.sharedAgents}),u.copiedAgents.length>0&&d.push({label:"copied",agents:u.copiedAgents}),u.linkedAgents.length>0&&d.push({label:"symlinked",agents:u.linkedAgents}),u.upToDateAgents.length>0&&d.push({label:"up-to-date",agents:u.upToDateAgents}),l.push({scope:o,skill:u.skillName,sections:d,failed:u.failed.map(h=>({agent:h.agent,reason:h.reason}))});}}return {updatingFor:s,sections:l,summary:{refreshed:e.refreshedSkillCount,upToDate:e.upToDateSkillCount,failed:e.failedSkillCount}}}function hl(e){if(e.skills.length===0)return;let t=zn(e),s=l=>{let o=l.map(r=>chunkJUNIAQ2A_cjs.b[r]?.displayName??r);return o.length<=5?o.join(", "):`${o.slice(0,5).join(", ")} +${o.length-5} more`};if(t.updatingFor.length>0){console.log(`${U}Updating for:${i}`);for(let l of t.updatingFor){let o=s(l.agents);console.log(` ${a}\u2514${i} ${Le}${chunkDNE3XPCJ_cjs.b(l.skill)}${i} ${a}(${o})${i}`);}}let n=null;for(let l of t.sections){if(l.scope!==n&&(console.log(`${G}${l.scope==="global"?"Global Skills":"Project Skills"}${i}`),n=l.scope),console.log(` ${a}\u2514${i} ${Le}${chunkDNE3XPCJ_cjs.b(l.skill)}${i}`),l.sections.length===0&&l.failed.length===0){console.log(` ${a}\u2514(no install targets)${i}`);continue}for(let o of l.sections)console.log(` ${a}\u2514${i} (${o.agents.length} agents) ${o.label}: ${s(o.agents)}`);for(let{agent:o,reason:r}of l.failed){let p=chunkJUNIAQ2A_cjs.b[o]?.displayName??o;console.log(` ${U}\u2717 ${p}:${i} ${a}${r}${i}`);}}console.log();}async function Jn(e){let t=await chunkHOK3SUH4_cjs.t(),s=[];for(let[n,l]of Object.entries(t.skills))fl(n,e)&&l.sourceType!=="node_modules"&&s.push({name:n,source:l.source,entry:l});return s}async function Yn(e={}){let t=e.cwd||process.cwd(),s=await chunkBWDTT6SA_cjs.l(),n=Object.keys(s.skills),l=0,o=0,r=0;if(n.length===0)return terminal.note(e.skills&&e.skills.length>0?`${chunkBWDTT6SA_cjs.d(`No installed skills found matching: ${e.skills.join(", ")}`)}`:`${chunkBWDTT6SA_cjs.a("No global skills tracked in lock file.")}`,chunkBWDTT6SA_cjs.e("Global Skills Update")),terminal.Prompt.outro(`${chunkBWDTT6SA_cjs.c("Done!")}${chunkBWDTT6SA_cjs.a(" Install with `easbot skills add <package> -g` to get started.")}`),{successCount:l,failCount:o,checkedCount:0};let{listInstalledSkills:p}=await import('./installer-3ZLHOVAO.cjs'),u=await p({scope:"global",agentFilter:e.agent,cwd:t}),d=new Set(u.map(g=>g.name)),h=[],f=[],C=[];for(let g of n){if(!fl(g,e.skills))continue;let m=s.skills[g];if(m){if(!m.skillPath){f.push({name:g,reason:Hn(m),sourceUrl:m.source,sourceType:m.sourceType,ref:m.ref});continue}d.has(g)&&C.push({name:g,entry:m});}}let w=new Map;for(let g of C){let m=g.entry.source,S=w.get(m)||[];S.push(g),w.set(m,S);}for(let[g,m]of w){let S=m[0].entry,v=S.source,L=S.sourceType,j=null;if(process.stdout.write(`\r${a}Checking skills from source: ${g}${i}\x1B[K
4
+ `),L==="github"){let A=chunkHOK3SUH4_cjs.e(v),R=chunkHOK3SUH4_cjs.a(A);if(R)try{let{fetchGitHubMarketSnapshot:O}=await import('./blob-RYNC3CVY.cjs'),D=await Dt(O(R,S.ref??void 0),Et,`update market-snapshot ${g}`),F=(await chunkHOK3SUH4_cjs.S()).markets[chunkHOK3SUH4_cjs.L(A)]?.snapshotHash;if(D&&F&&F===D.snapshotHash){console.log(` ${a}\u2713 Source ${g} unchanged (market snapshotHash match)${i}`),r+=m.length;continue}}catch{}}let y=null;try{let A=L??"git",R=chunkHOK3SUH4_cjs.e(v),O=await Dt(chunkHOK3SUH4_cjs.Q({type:A,url:R.url,ref:S.ref??void 0,mode:"update"}),Et,`update fetch ${g}`);if(j=O.tempDir,O.cloneError&&(y=O.cloneError),!y&&j){let D=await chunkHOK3SUH4_cjs.A(j),N=j.replace(/\\/g,"/").replace(/\/+$/,""),F=D.map(V=>{let Q=V.path.replace(/\\/g,"/");return path.relative(N,Q).split(path.sep).join("/")});if(D.length===0)y=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${g}`);else {let V=new Set,Q=new Set(F),we=chunkHOK3SUH4_cjs.e(v);for(let{name:le,entry:X}of m){if(V.has(le))continue;let Ae=X.skillPath.split(path.sep).join("/").replace(/\/SKILL\.md$/,"");if(!Q.has(Ae))continue;let he=await dl(we,j,Ae,le);if(!he.ok){f.push({name:le,reason:"Store sync failed",sourceUrl:X.source,sourceType:X.sourceType,ref:X.ref});continue}Ut(e.force,X.computedHash,he.hash)&&h.push({name:le,source:g,entry:X});}}}}catch(A){y=A instanceof Error?A:new Error(String(A));}finally{j&&L!=="local"&&!chunkHOK3SUH4_cjs.ga(j)&&await chunkHOK3SUH4_cjs.l(j);}y&&(console.log(` ${a}\u2717 Failed to check skills from ${g}: ${y.message}${i}`),f.push(...ul(y,m)));}C.length>0&&process.stdout.write("\r\x1B[K");let $=C.length+f.length+r;if(C.length===0&&f.length===0)return e.skills||console.log(`${a}No global skills to check.${i}`),{successCount:l,failCount:o,checkedCount:0};if(C.length===0&&f.length>0)return Nt(f),{successCount:l,failCount:o,checkedCount:$};if(h.length===0)return console.log(`${U}\u2713 All global skills are up to date${i}`),{successCount:l,failCount:o,checkedCount:$};if(console.log(`${U}Found ${h.length} global update(s)${i}`),console.log(),h.length===0)return Nt(f),{successCount:l,failCount:o,checkedCount:$};try{let g=[],m=[];for(let v of h){g.push(v.name);let L=chunkHOK3SUH4_cjs.e(v.entry.source),j=chunkHOK3SUH4_cjs.M(L),A=(v.entry.skillPath??v.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");m.push(path.join(j,A));}let S=await ml({skillNames:g,skillStorePaths:m,scope:"global",agentFilter:e.agent,cwd:t});hl(S),S.failedSkillCount>0?o+=S.failedSkillCount:l+=S.skills.length;}catch(g){o+=h.length,console.log(`${a}\u2717 Failed to refresh: ${g instanceof Error?g.message:String(g)}${i}`);}if(h.length>0)try{let g=await chunkBWDTT6SA_cjs.l(),m=new Date().toISOString(),S=!1,v=0;for(let L of h){let j=g.skills[L.name];if(!j)continue;let y=chunkHOK3SUH4_cjs.e(L.entry.source),A=chunkHOK3SUH4_cjs.M(y),O=(L.entry.skillPath??L.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,""),D=path.join(A,O),N=await gl(D);N&&j.computedHash!==N&&(j.computedHash=N,j.updatedAt=m,S=!0,v++);}S&&(await chunkBWDTT6SA_cjs.m(g),console.log(`${a}\u2192 updated global lock: ${v} skill(s) refreshed, ${Object.keys(g.skills).length} total tracked${i}`));}catch(g){console.log(`${a}\u26A0 Failed to write global lock: ${g instanceof Error?g.message:String(g)}${i}`);}Nt(f);let c=[];if(l>0&&o>0)c.push(`${chunkBWDTT6SA_cjs.c(`\u2713 ${l} refreshed`)} ${chunkBWDTT6SA_cjs.a("|")} ${chunkBWDTT6SA_cjs.b(`\u2717 ${o} failed`)}`);else if(l>0)c.push(`${chunkBWDTT6SA_cjs.c(`\u2713 ${l} refreshed`)}`);else if(o>0)c.push(`${chunkBWDTT6SA_cjs.b(`\u2717 ${o} failed`)}`);else if($>0)c.push(`${chunkBWDTT6SA_cjs.c("All global skills are up to date.")}`);else return {successCount:l,failCount:o,checkedCount:$};return f.length>0&&c.push(`${chunkBWDTT6SA_cjs.d(`\u26A0 ${f.length} skipped`)}`),console.log(),terminal.note(c.join(`
5
+ `),chunkBWDTT6SA_cjs.e("Global Skills Update")),terminal.Prompt.outro(`${chunkBWDTT6SA_cjs.c("Done!")}${chunkBWDTT6SA_cjs.a(" Run `easbot skills list` to see current state.")}`),{successCount:l,failCount:o,checkedCount:$}}async function qn(e={}){let t=e.cwd||process.cwd(),s=await Jn(e.skills),n=0,l=0,o=[];if(s.length===0)return e.skills||(console.log(`${a}No project skills to update.${i}`),console.log(`${a}Install project skills with${i} ${U}easbot skills add <package>${i}`)),terminal.note(s.length===0&&e.skills?`${chunkBWDTT6SA_cjs.d(`No installed skills found matching: ${e.skills.join(", ")}`)}`:`${chunkBWDTT6SA_cjs.a("No project skills tracked in lock file.")}`,chunkBWDTT6SA_cjs.e("Project Skills Update")),terminal.Prompt.outro(`${chunkBWDTT6SA_cjs.c("Done!")}${chunkBWDTT6SA_cjs.a(" Install with `easbot skills add <package>` to get started.")}`),{successCount:n,failCount:l,foundCount:0};let{listInstalledSkills:r}=await import('./installer-3ZLHOVAO.cjs'),p=await r({scope:"project",agentFilter:e.agent,cwd:t}),u=new Set(p.map(c=>c.name)),d=s.filter(c=>u.has(c.name)),h=d.filter(c=>c.entry.skillPath),f=d.filter(c=>!c.entry.skillPath);if(h.length===0)return console.log(`${a}No project skills can be updated in place.${i}`),cl(f),{successCount:n,failCount:l,foundCount:s.length};console.log(`${U}Checking ${h.length} skill(s)...${i}`),console.log();let C=new Map;for(let c of h){let g=c.entry.source,m=C.get(g)||[];m.push(c),C.set(g,m);}let w=await chunkHOK3SUH4_cjs.t(),$=[];for(let[c,g]of C){let m=g[0].entry,S=m.source,v=m.ref;if(m.sourceType==="github"){let N=chunkHOK3SUH4_cjs.e(S),F=chunkHOK3SUH4_cjs.a(N);if(F)try{let{fetchGitHubMarketSnapshot:V}=await import('./blob-RYNC3CVY.cjs'),Q=await Dt(V(F,m.ref??void 0),Et,`update market-snapshot ${c}`),le=(await chunkHOK3SUH4_cjs.S()).markets[chunkHOK3SUH4_cjs.L(N)]?.snapshotHash;if(Q&&le&&le===Q.snapshotHash){console.log(` ${a}\u2713 Source ${c} unchanged (market snapshotHash match)${i}`);continue}}catch{}}Object.entries(w.skills).filter(([N,F])=>F.source===c).map(([N,F])=>N);let j=null,y=[],A=new Map,R=null;try{let N=m.sourceType??"git",F=chunkHOK3SUH4_cjs.e(S),V=await Dt(chunkHOK3SUH4_cjs.Q({type:N,url:F.url,ref:v,mode:"update"}),Et,`update fetch ${c}`);if(j=V.tempDir,V.cloneError)R=V.cloneError;else {let Q=await chunkHOK3SUH4_cjs.A(j);if(Q.length===0)R=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${c}`);else {let we=Q.map(X=>{let ve=path.relative(j,X.path);return path.join(ve,"SKILL.md").split(path.sep).join("/")}),le=chunkHOK3SUH4_cjs.e(S);for(let X of Q){let Ae=path.join(path.relative(j,X.path),"SKILL.md").split(path.sep).join("/").replace(/\/SKILL\.md$/,""),he=await dl(le,j,Ae,X.name);he.ok&&he.hash&&A.set(X.name,he.hash);}}}}catch(N){R=N instanceof Error?N:new Error(String(N));}finally{j&&!chunkHOK3SUH4_cjs.ga(j)&&await chunkHOK3SUH4_cjs.l(j);}if(R){console.log(` ${a}\u2717 Failed to check for deleted skills from ${c}: ${R.message}${i}`);let N=g.map(F=>({name:F.name,entry:{source:F.source,sourceType:F.entry.sourceType,ref:F.entry.ref}}));$.push(...ul(R,N));continue}let O=g.filter(N=>!y.includes(N.name)),D=[];for(let N of O){let F=w.skills[N.name],V=A.get(N.name);if(!V)continue;let Q=F?.computedHash;if(!Ut(e.force,Q,V))continue;let we=chunkHOK3SUH4_cjs.e(N.entry.source),le=chunkHOK3SUH4_cjs.M(we),ve=(N.entry.skillPath??N.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");D.push({name:N.name,source:N.entry.source,skillPath:ve,storeRoot:le});}if(D.length!==0)try{let N=D.map(Q=>Q.name),F=D.map(Q=>path.join(Q.storeRoot,Q.skillPath)),V=await ml({skillNames:N,skillStorePaths:F,scope:"project",agentFilter:e.agent,cwd:t});hl(V),V.failedSkillCount>0?l+=V.failedSkillCount:n+=V.skills.length;for(let Q of D)o.push(Q.name);}catch(N){l+=D.length,console.log(` ${a}\u2717 Failed to refresh: ${N instanceof Error?N.message:String(N)}${i}`);}}if(cl(f),Nt($),h.length>0)if(console.log(),o.length>0||$.length>0||f.length>0){let c=[];o.length>0&&c.push(`${chunkBWDTT6SA_cjs.c(`\u2713 Refreshed ${o.length} skill(s)${chunkBWDTT6SA_cjs.i("")}`)}`),n>0&&l>0?c.push(`${chunkBWDTT6SA_cjs.c(`\u2713 ${n} ok`)} ${chunkBWDTT6SA_cjs.a("|")} ${chunkBWDTT6SA_cjs.b(`\u2717 ${l} failed`)}`):n>0?c.push(`${chunkBWDTT6SA_cjs.c(`\u2713 ${n} ok`)}`):l>0&&c.push(`${chunkBWDTT6SA_cjs.b(`\u2717 ${l} failed`)}`),$.length>0&&c.push(`${chunkBWDTT6SA_cjs.d(`\u26A0 ${$.length} skipped`)}`),f.length>0&&c.push(`${chunkBWDTT6SA_cjs.a(`${f.length} legacy (cannot update)`)}`),terminal.note(c.join(`
6
+ `),chunkBWDTT6SA_cjs.e("Project Skills Update")),terminal.Prompt.outro(`${chunkBWDTT6SA_cjs.c("Done!")}${chunkBWDTT6SA_cjs.a(" Run `easbot skills list` to see current state.")}`);}else terminal.note(`${chunkBWDTT6SA_cjs.c("All project skills are up to date.")}`,chunkBWDTT6SA_cjs.e("Project Skills Update")),terminal.Prompt.outro(`${chunkBWDTT6SA_cjs.c("Done!")}`);if(n>0&&o.length>0)try{let c=await chunkHOK3SUH4_cjs.t(),g=new Date().toISOString(),m=!1,S=0;for(let v of o){let L=c.skills[v];if(!L)continue;let y=(await chunkHOK3SUH4_cjs.Y(L.marketId,L.pluginId,v))?.entry.computedHash;y&&L.computedHash!==y&&(L.computedHash=y,L.updatedAt=g,m=!0,S++);}if(m){let{writeLocalLock:v}=await import('./local-lock-KNX2RUIV.cjs');await v(c),console.log(`${a}\u2192 updated project lock: ${S} skill(s) refreshed, ${Object.keys(c.skills).length} total tracked${i}`);}}catch(c){console.log(`${a}\u26A0 Failed to write project lock: ${c instanceof Error?c.message:String(c)}${i}`);}return {successCount:n,failCount:l,foundCount:s.length}}function cl(e){if(e.length!==0){console.log(),console.log(`${a}${e.length} project skill(s) cannot be updated automatically (installed before skillPath tracking):${i}`);for(let t of e){let s=as(t.entry.source,t.entry.ref);console.log(` ${U}\u2022${i} ${chunkDNE3XPCJ_cjs.b(t.name)}`),console.log(` ${a}To refresh: ${U}easbot skills add ${s} -y${i}`);}}}async function kl(e=[],t={}){let s=Gn(e,t);if(s.skills&&s.skills.every(p=>/^[^\s]+\.[a-zA-Z0-9]+$/.test(p))&&(s.skills=["*"]),s.all===true&&(s.yes=true,(!s.skills||s.skills.length===0||s.skills.every(p=>/^[^\s]+\.[a-zA-Z0-9]+$/.test(p)))&&(s.skills=["*"]),(!s.agent||s.agent.length===0)&&(s.agent=["*"])),s.agent&&s.agent.length>0){let p=chunkJUNIAQ2A_cjs.p(s.agent);if(p.length>0){let u=Object.keys(chunkJUNIAQ2A_cjs.b);console.log(`${Fe}Invalid agents: ${p.join(", ")}${i}`),console.log(`${a}Valid agents: ${u.join(", ")}${i}`),console.log(`${a}Tip: wrap '*' in quotes to avoid shell expansion: '-a' '"*"'${i}`),process.exit(1);}}let n=await Kn(s);s.skills?console.log(`${U}Updating ${s.skills.join(", ")}...${i}`):console.log(`${U}Checking for skill updates...${i}`),console.log();let l=0,o=0,r=0;if(n==="global"||n==="both"){n==="both"&&!s.skills&&console.log(`${G}Global Skills${i}`);let{successCount:p,failCount:u,checkedCount:d}=await Yn(s);l+=p,o+=u,r+=d,n==="both"&&!s.skills&&console.log();}if(n==="project"||n==="both"){n==="both"&&!s.skills&&console.log(`${G}Project Skills${i}`);let{successCount:p,failCount:u,foundCount:d}=await qn(s);l+=p,o+=u,r+=d;}s.skills&&r===0&&console.log(`${a}No installed skills found matching: ${s.skills.join(", ")}${i}`),console.log(),l>0&&console.log(`${U}\u2713 Updated ${l} skill(s)${i}`),o>0&&console.log(`${a}Failed to update ${o} skill(s)${i}`),chunkQ2MOP5ZW_cjs.d({event:"update",scope:n,skillCount:String(l+o),successCount:String(l),failCount:String(o)}),s.json&&J(z({scope:n,totals:{checked:r,refreshed:l,failed:o},detail:{project:r>0,global:r>0},...s.skills&&{skills:s.skills},...s.agent&&{agents:s.agent}},{scope:n,checked:r,refreshed:l,failed:o})),console.log();}var yl={version:"0.3.17"};var vl="eve agent";function Qn(e,t){return e.startsWith("git@")||e.startsWith("ssh://")?e:t}function Al(e){chunkQ2MOP5ZW_cjs.b(e);}async function eo(e,t,s,n){let{agent:l,subagent:o}=t,{installMode:r,installGlobally:p}=n,h=await chunkIJI72D6W_cjs.h(e,l,{global:p,mode:r,eveSubagent:o});return {skill:chunkHOK3SUH4_cjs.B(e),agent:dt(t),pluginName:e.pluginName,...h}}var to=(()=>{let e=process.env.SKILLS_AUDIT_DISPLAY_TIMEOUT_MS;if(!e)return 3e4;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e4})();function bl(e){switch(e){case "critical":return chunkBWDTT6SA_cjs.b(chunkBWDTT6SA_cjs.f("Critical Risk"));case "high":return chunkBWDTT6SA_cjs.b("High Risk");case "medium":return chunkBWDTT6SA_cjs.d("Med Risk");case "low":return chunkBWDTT6SA_cjs.c("Low Risk");case "safe":return chunkBWDTT6SA_cjs.c("Safe");default:return chunkBWDTT6SA_cjs.a("--")}}function so(e){if(!e)return chunkBWDTT6SA_cjs.a("--");let t=e.alerts??0;return t>0?chunkBWDTT6SA_cjs.b(`${t} alert${t!==1?"s":""}`):chunkBWDTT6SA_cjs.c("0 alerts")}function ot(e,t){let s=chunkDNE3XPCJ_cjs.a(e),n=Math.max(0,t-s.length);return e+" ".repeat(n)}function lo(e,t,s){if(!e)return [];if(!t.some(p=>{let u=e[p.slug];return u&&Object.keys(u).length>0}))return [];let l=Math.min(Math.max(...t.map(p=>p.displayName.length)),36),o=[],r=ot("",l+2)+ot(chunkBWDTT6SA_cjs.a("Gen"),18)+ot(chunkBWDTT6SA_cjs.a("Socket"),18)+chunkBWDTT6SA_cjs.a("Snyk");o.push(r);for(let p of t){let u=e[p.slug],d=p.displayName.length>l?p.displayName.slice(0,l-1)+"\u2026":p.displayName,h=u?.ath?bl(u.ath.risk):chunkBWDTT6SA_cjs.a("--"),f=u?.socket?so(u.socket):chunkBWDTT6SA_cjs.a("--"),C=u?.snyk?bl(u.snyk.risk):chunkBWDTT6SA_cjs.a("--");o.push(ot(chunkBWDTT6SA_cjs.e(d),l+2)+ot(h,18)+ot(f,18)+C);}return o.push(""),o.push(`${chunkBWDTT6SA_cjs.a("Details:")} ${chunkBWDTT6SA_cjs.a(`https://skills.sh/${s}`)}`),o}function gs(e,t){let s=os.homedir();return e===s||e.startsWith(s+path.sep)?"~"+e.slice(s.length):e===t||e.startsWith(t+path.sep)?"."+e.slice(t.length):e}function ye(e,t=5){if(e.length<=t)return e.join(", ");let s=e.slice(0,t),n=e.length-t;return `${s.join(", ")} +${n} more`}function no(e){let t=e.map(n=>chunkBWDTT6SA_cjs.e(chunkHOK3SUH4_cjs.B(n))),s=ye(t,3);return chunkDNE3XPCJ_cjs.a(s).length<=80?s:`${e.length} selected skills`}function oo(e){return `Detected an eve project. Install ${no(e)} for your ${vl} to use?`}function io(e,t,s){let n=[],l=[],o=[],r=new Map;if(e)for(let p of e)p.mode&&r.set(p.agent,p.mode);for(let p of t){let u=chunkJUNIAQ2A_cjs.b[p].displayName,d=r.get(u);chunkJUNIAQ2A_cjs.o(p,s?"global":"project")?n.push(u):d==="symlink"?o.push(u):l.push(u);}return {universal:n,copied:l,symlinked:o}}function dt(e){let t=chunkJUNIAQ2A_cjs.b[e.agent].displayName;return e.subagent?`${t} (${e.subagent})`:t}function Ft(e){return e.subagent?`${e.agent}:${e.subagent}`:e.agent}function ro(e,t){let s=[];for(let n of e)if(n==="eve")for(let l of t)s.push({agent:n,subagent:l});else s.push({agent:n});return s}function ao(e,t,s,n=[]){let l=[],o=e.filter(f=>!f.subagent).map(f=>f.agent),r=e.filter(f=>f.subagent).map(dt),p,u;if(n.length>0){let f=new Set(n);p=o.filter(C=>f.has(C)),u=o.filter(C=>!f.has(C));}else p=o.filter(f=>chunkJUNIAQ2A_cjs.o(f,s?"global":"project")),u=o.filter(f=>!chunkJUNIAQ2A_cjs.o(f,s?"global":"project"));let d=p.map(f=>chunkJUNIAQ2A_cjs.b[f].displayName),h=u.map(f=>chunkJUNIAQ2A_cjs.b[f].displayName);return t==="symlink"?(d.length>0&&l.push(` ${chunkBWDTT6SA_cjs.c("universal:")} ${ye(d)}`),h.length>0&&l.push(` ${chunkBWDTT6SA_cjs.a("symlinked:")} ${ye(h)}`),r.length>0&&l.push(` ${chunkBWDTT6SA_cjs.a("copied:")} ${ye(r)}`)):(d.length>0&&l.push(` ${chunkBWDTT6SA_cjs.c("universal:")} ${ye(d)}`),h.length>0&&l.push(` ${chunkBWDTT6SA_cjs.a("copied:")} ${ye(h)}`),r.length>0&&l.push(` ${chunkBWDTT6SA_cjs.a("copied (subagent):")} ${ye(r)}`)),l}function Sl(e,t){let s=chunkJUNIAQ2A_cjs.h(t),n=[...e];for(let l of s)n.includes(l)||n.push(l);return n}function co(e,t,s){let n=[],{universal:l,copied:o,symlinked:r}=io(e,t,s),p=o,u=e.filter(d=>d.symlinkFailed&&!d.skipped).map(d=>d.agent);return l.length>0&&n.push(` ${chunkBWDTT6SA_cjs.c("universal:")} ${ye(l)}`),p.length>0&&n.push(` ${chunkBWDTT6SA_cjs.e("copied:")} ${ye(p)}`),r.length>0&&n.push(` ${chunkBWDTT6SA_cjs.a("symlinked:")} ${ye(r)}`),u.length>0&&n.push(` ${chunkBWDTT6SA_cjs.d("symlink-failed:")} ${ye(u)}`),n}async function po(e,t){let s=[];return await terminal.Prompt.multiselect({message:e,options:t,initialValues:s,required:true})}async function wl(e){let t=e.global===true?"global":"project",s=u=>t!=="global"||chunkJUNIAQ2A_cjs.b[u].globalSkillsDir!==void 0,n=chunkJUNIAQ2A_cjs.h(t).filter(s),l=chunkJUNIAQ2A_cjs.i(t).filter(u=>u!=="eve"&&s(u)),o={title:"Universal (.agents/skills)",items:n.map(u=>({value:u,label:chunkJUNIAQ2A_cjs.b[u].displayName}))},r=l.map(u=>({value:u,label:chunkJUNIAQ2A_cjs.b[u].displayName,hint:e.global?chunkJUNIAQ2A_cjs.b[u].globalSkillsDir:chunkJUNIAQ2A_cjs.b[u].skillsDir})),p=await terminal.Prompt.multiselect({message:"Which agents do you want to install to?",options:r,initialValues:[],lockedSection:o});if(Array.isArray(p)){let u=p,d=new Set(n),h=[],f=[],C=new Set;for(let w of u)C.has(w)||(C.add(w),d.has(w)?h.push(w):f.push(w));return {locked:h,selected:f}}return p}var uo=yl.version;chunkQ2MOP5ZW_cjs.b(uo);async function ft(e,t={}){let s=e[0],n=false,l=()=>{n||(terminal.Prompt.Log.message(chunkBWDTT6SA_cjs.a("Tip: use the --yes (-y) and --global (-g) flags to install without prompts.")),n=true);};if(!s){let{readStoreIndex:u,resolveDefaultSource:d}=await import('./store-2ULHEVHS.cjs'),h=await u();s=await d(h);}t.all&&(t.skill=["*"],t.agent=["*"],t.yes=true);let o=t.global??false;if(!(t.global!==void 0)&&!t.yes&&!t.all&&process.stdin.isTTY&&Object.values(chunkJUNIAQ2A_cjs.b).some(f=>f.globalSkillsDir!==void 0)){let f=await terminal.Prompt.select({message:"Installation scope",options:[{value:false,label:"Project",hint:"Install in current directory (committed with your project)"},{value:true,label:"Global",hint:"Install in home directory (available across all projects)"}]});terminal.Prompt.isCancel(f)&&(await de(null),terminal.Prompt.cancel("Installation cancelled")),o=f,terminal.Prompt.Log.info(`${chunkBWDTT6SA_cjs.f(o?"Global":"Project")} scope selected`);}let r=await lt();if(r.isAgent&&(t.yes=true,!t.agent||t.agent.length===0)){let u=rl(r.agent.name);if(u){let d=o?"global":"project";t.agent=Sl([u],d);}}console.log(),r.isAgent||terminal.Prompt.intro(" skills "),r.isAgent?terminal.Prompt.Log.info(Ct(r.agent.name)+" Agent detected \u2014 installing non-interactively"):!process.stdin.isTTY&&!t.yes&&l();let p=null;try{let u=terminal.Prompt.spinner();u.start("Parsing source...");let d=chunkHOK3SUH4_cjs.e(s);u.stop(`Source: ${d.type==="local"?d.localPath:d.url}${d.ref?` #${chunkBWDTT6SA_cjs.d(d.ref)}`:""}${d.subpath?` @${chunkBWDTT6SA_cjs.e(d.subpath)}`:""}`);let h=chunkHOK3SUH4_cjs.a(d),f=(()=>{if(!h)return Promise.resolve(null);let k=chunkHOK3SUH4_cjs.b(h);return k?chunkHOK3SUH4_cjs.c(k.owner,k.repo).catch(()=>null):Promise.resolve(null)})(),C=Array.isArray(t?.skill)&&t.skill.length>0||t.fullDepth===!0||!!d.subpath;u.start("Loading source...");let w;try{w=await chunkHOK3SUH4_cjs.da(d,{includeInternal:C,fullDepth:t.fullDepth});}catch(k){throw k instanceof chunkHOK3SUH4_cjs.R&&(u.stop(chunkBWDTT6SA_cjs.b("Path not found")),terminal.Prompt.outro(chunkBWDTT6SA_cjs.b(`Local path does not exist: ${k.localPath}`)),process.exit(1)),k}p=w.storeDir,u.stop(w.cacheHit?"Repository loaded from cache":w.source==="blob-fetch"?"Fetched via GitHub API":w.source==="well-known-fetch"?"Well-known index fetched":w.source==="local-cp"?"Local path cached":"Repository cloned");let $=w.skills,c=d.subpath?$.filter(k=>k.path.includes(`/${d.subpath}/`)||k.path.endsWith(`/${d.subpath}`)):$;if(u.start("Discovering skills..."),c.length===0&&w.cloneError){u.stop(chunkBWDTT6SA_cjs.b("Failed to clone repository"));for(let k of w.cloneError.message.split(`
7
+ `))terminal.Prompt.Log.message(chunkBWDTT6SA_cjs.a(k));await de(p),process.exit(1);}if(c.length===0&&(u.stop(chunkBWDTT6SA_cjs.b("No skills found")),terminal.Prompt.outro(chunkBWDTT6SA_cjs.b("No valid skills found. Skills require a SKILL.md with name and description.")),await de(p),process.exit(1)),u.stop(`Found ${chunkBWDTT6SA_cjs.c(String(c.length))} skill${c.length>1?"s":""}`),t.list){console.log(),terminal.Prompt.Log.step(chunkBWDTT6SA_cjs.f("Available Skills"));let k={},x=[];for(let T of c)if(T.pluginName){let E=T.pluginName;k[E]||(k[E]=[]),k[E].push(T);}else x.push(T);let _=Object.keys(k).sort();for(let T of _){let E=T.split("-").map(H=>H.charAt(0).toUpperCase()+H.slice(1)).join(" ");console.log(chunkBWDTT6SA_cjs.f(E));for(let H of k[T])terminal.Prompt.Log.message(` ${chunkBWDTT6SA_cjs.e(chunkHOK3SUH4_cjs.B(H))}`),terminal.Prompt.Log.message(` ${chunkBWDTT6SA_cjs.a(H.description)}`);console.log();}if(x.length>0){_.length>0&&console.log(chunkBWDTT6SA_cjs.f("General"));for(let T of x)terminal.Prompt.Log.message(` ${chunkBWDTT6SA_cjs.e(chunkHOK3SUH4_cjs.B(T))}`),terminal.Prompt.Log.message(` ${chunkBWDTT6SA_cjs.a(T.description)}`);}console.log(),terminal.Prompt.outro("Use --skill <name> to install specific skills"),await de(p),process.exit(0);}let g;if(t.skill&&t.skill.length>0){let k=c.map(_=>chunkHOK3SUH4_cjs.B(_)),x=chunkHOK3SUH4_cjs.E(t.skill,k);if(x.wildcard)g=c,terminal.Prompt.Log.info(`Installing all ${c.length} skills`);else if(x.invalid.length>0){terminal.Prompt.Log.error(`No matching skills found for: ${x.invalid.join(", ")}`),terminal.Prompt.Log.info("Available skills:");for(let _ of c)terminal.Prompt.Log.message(` - ${chunkHOK3SUH4_cjs.B(_)}`);await de(p),process.exit(1);}else g=chunkHOK3SUH4_cjs.C(c,x.matched),g.length===0&&(terminal.Prompt.Log.error(`No matching skills found for: ${x.matched.join(", ")}`),await de(p),process.exit(1)),terminal.Prompt.Log.info(`Selected ${g.length} skill${g.length!==1?"s":""}: ${g.map(_=>chunkBWDTT6SA_cjs.e(chunkHOK3SUH4_cjs.B(_))).join(", ")}`);}else if(c.length===1){g=c;let k=c[0];terminal.Prompt.Log.info(`Skill: ${chunkBWDTT6SA_cjs.e(chunkHOK3SUH4_cjs.B(k))}`),terminal.Prompt.Log.message(chunkBWDTT6SA_cjs.a(k.description));}else if(t.yes)g=c,terminal.Prompt.Log.info(`Installing all ${c.length} skills`);else {let k=[...c].sort((T,E)=>T.pluginName&&!E.pluginName?-1:!T.pluginName&&E.pluginName?1:T.pluginName&&E.pluginName&&T.pluginName!==E.pluginName?T.pluginName.localeCompare(E.pluginName):chunkHOK3SUH4_cjs.B(T).localeCompare(chunkHOK3SUH4_cjs.B(E))),x=k.some(T=>T.pluginName),_;if(x){let T=H=>H.split("-").map(B=>B.charAt(0).toUpperCase()+B.slice(1)).join(" "),E={};for(let H of k){let B=H.pluginName?T(H.pluginName):"Other";E[B]||(E[B]=[]),E[B].push({value:H,label:chunkHOK3SUH4_cjs.B(H),hint:H.description.length>60?H.description.slice(0,57)+"...":H.description});}_=await terminal.Prompt.groupMultiselect({message:`Select skills to install ${chunkBWDTT6SA_cjs.a("(space to toggle)")}`,options:E,required:!0});}else {let T=k.map(E=>({value:E,label:chunkHOK3SUH4_cjs.B(E),hint:E.description.length>60?E.description.slice(0,57)+"...":E.description}));_=await terminal.Prompt.multiselect({message:"Select skills to install",options:T,required:!0});}terminal.Prompt.isCancel(_)&&(await de(p),terminal.Prompt.cancel("Installation cancelled")),g=_;}let m=chunkHOK3SUH4_cjs.a(d),S=m?chunkQ2MOP5ZW_cjs.c(m,g.map(k=>chunkHOK3SUH4_cjs.B(k))):Promise.resolve(null),v,L=Object.keys(chunkJUNIAQ2A_cjs.b),j=o?"global":"project",y=[];if(t.agent&&t.agent.length>0){let k=chunkJUNIAQ2A_cjs.p(t.agent);k.length>0&&(terminal.Prompt.Log.error(`Invalid agents: ${k.join(", ")}`),terminal.Prompt.Log.info(`Valid agents: ${L.join(", ")}`),await de(p),process.exit(1)),v=chunkJUNIAQ2A_cjs.q(t.agent),t.agent.includes("*")&&terminal.Prompt.Log.info(`Installing to all ${v.length} agents`);}else {u.start("Loading agents...");let k=await chunkJUNIAQ2A_cjs.c(),x=Object.keys(chunkJUNIAQ2A_cjs.b).length;if(u.stop(`${x} agents`),k.includes("eve")&&(t.yes||!r.isAgent)){let _=t.yes?!0:await terminal.Prompt.confirm({message:oo(g),initialValue:!0});if(terminal.Prompt.isCancel(_)&&(await de(p),terminal.Prompt.cancel("Installation cancelled")),_)v=["eve"],terminal.Prompt.Log.info(`Installing to: ${chunkBWDTT6SA_cjs.e(vl)}`);else {let T=await wl({global:j==="global"});terminal.Prompt.isCancel(T)&&(await de(p),terminal.Prompt.cancel("Installation cancelled")),y=T.locked,v=[...T.locked,...T.selected];}}else if(k.length===0)if(t.yes)v=L,terminal.Prompt.Log.info("Installing to all agents");else {terminal.Prompt.Log.info("Select agents to install skills to");let _=Object.entries(chunkJUNIAQ2A_cjs.b).filter(([E])=>E!=="eve").map(([E,H])=>({value:E,label:H.displayName})),T=await po("Which agents do you want to install to?",_);terminal.Prompt.isCancel(T)&&(await de(p),terminal.Prompt.cancel("Installation cancelled")),v=T;}else if(k.length===1||t.yes)if(v=Sl(k,j),k.length===1){let _=k[0];terminal.Prompt.Log.info(`Installing to: ${chunkBWDTT6SA_cjs.e(chunkJUNIAQ2A_cjs.b[_].displayName)}`);}else terminal.Prompt.Log.info(`Installing to: ${k.map(_=>chunkBWDTT6SA_cjs.e(chunkJUNIAQ2A_cjs.b[_].displayName)).join(", ")}`);else {let _=await wl({global:j==="global"});terminal.Prompt.isCancel(_)&&(await de(p),terminal.Prompt.cancel("Installation cancelled")),y=_.locked,v=[..._.locked,..._.selected];}}t.subagent&&t.subagent.length>0&&!v.includes("eve")&&(v=[...v,"eve"]);let A=[void 0];if(v.includes("eve")){let k=chunkJUNIAQ2A_cjs.f(process.cwd());if(t.subagent&&t.subagent.length>0)A=t.subagent.map(x=>x==="root"||x==="."?void 0:x);else if(k.length>0&&!t.yes){let x=[{value:"",label:"Root agent",hint:"agent/skills"},...k.map(T=>({value:T,label:T,hint:`agent/subagents/${T}/skills`}))],_=await terminal.Prompt.multiselect({message:"Where should Eve skills be installed?",options:x,initialValues:[""],required:!0});terminal.Prompt.isCancel(_)&&(await de(p),terminal.Prompt.cancel("Installation cancelled")),A=_.map(T=>T===""?void 0:T);}}let R=ro(v,A),O=t.copy?"copy":"symlink";if(R.every(k=>k.agent==="eve"))O="copy";else if(t.copy||t.yes)O="copy";else {let k=await terminal.Prompt.select({message:"Installation method",options:[{value:"symlink",label:"Share (Recommended)",hint:"Single source: 1 copy in .agents/skills + symlinks for non-universal agents"},{value:"copy",label:"Independent",hint:"Physical copy in each agent dir; updates must be re-run per agent"}]});terminal.Prompt.isCancel(k)&&(await de(p),terminal.Prompt.cancel("Installation cancelled")),O=k;}let N=process.cwd(),F=[],V=o?null:await chunkHOK3SUH4_cjs.t(N),Q=await Promise.all(g.flatMap(k=>R.map(async x=>{let _=await chunkIJI72D6W_cjs.l(k.name,x.agent,{global:o,eveSubagent:x.subagent}),T=_.installed,E;try{E=await chunkE7AHWFZN_cjs.b(k.path);}catch{E=void 0;}let B=V?.skills[k.name]?.computedHash,ee=!Ut(!1,B,E),ie=T&&_.mode==="copy"&&O==="copy"&&ee,ce=!!T;return {skillName:k.name,target:x,installed:T,installedMode:_.mode,sourceHash:E,upToDate:!!ie,overwrite:ce}}))),we=new Map,le=new Map;for(let{skillName:k,target:x,overwrite:_,upToDate:T}of Q)we.has(k)||(we.set(k,new Map),le.set(k,new Map)),we.get(k).set(Ft(x),_),le.get(k).set(Ft(x),T);let X={},ve=[];for(let k of g)if(k.pluginName){let x=k.pluginName;X[x]||(X[x]=[]),X[x].push(k);}else ve.push(k);let Ae=k=>{for(let x of k){F.length>0&&F.push("");let _=R[0];R.length>1&&(_=R.find(ie=>chunkJUNIAQ2A_cjs.o(ie.agent,o?"global":"project"))??R[0]);let T=chunkIJI72D6W_cjs.o(x.name,{global:o,agent:_.agent,eveSubagent:_.subagent}),E=gs(T,N);F.push(`${chunkBWDTT6SA_cjs.e(E)}`),F.push(...ao(R,O,o,y));let H=we.get(x.name),B=R.filter(ee=>!chunkJUNIAQ2A_cjs.o(ee.agent,o?"global":"project")&&H?.get(Ft(ee))).map(dt);B.length>0&&F.push(` ${chunkBWDTT6SA_cjs.d("overwrites:")} ${ye(B)}`);}},he=Object.keys(X).sort();for(let k of he){let x=k.split("-").map(_=>_.charAt(0).toUpperCase()+_.slice(1)).join(" ");F.push(""),F.push(chunkBWDTT6SA_cjs.f(x)),Ae(X[k]);}ve.length>0&&(he.length>0&&(F.push(""),F.push(chunkBWDTT6SA_cjs.f("General"))),Ae(ve)),console.log(),terminal.note(F.join(`
8
+ `),"Installation Summary");try{let k=await Promise.race([S,new Promise(x=>setTimeout(()=>x(null),to))]);if(k&&m){let x=lo(k,g.map(_=>({slug:chunkHOK3SUH4_cjs.B(_),displayName:chunkHOK3SUH4_cjs.B(_)})),m);x.length>0&&terminal.note(x.join(`
9
+ `),"Security Risk Assessments");}}catch{}if(!t.yes){let k=await terminal.Prompt.confirm({message:"Proceed with installation?"});(terminal.Prompt.isCancel(k)||!k)&&(await de(p),terminal.Prompt.cancel("Installation cancelled"));}u.start("Installing skills...");let Te=[],qe=await Promise.all(g.map(async k=>{let x=new Map;for(let T of R){let E=chunkIJI72D6W_cjs.g(T.agent,o,N,T.subagent),H=(T.agent==="eve"||T.agent==="easbot")&&O==="symlink",B=O==="copy"||H?E:chunkIJI72D6W_cjs.e(o,N),ee=chunkIJI72D6W_cjs.d(k.name||path.basename(k.path)),ie=path.join(B,ee),ce=path.join(E,ee),M=ie,Y=x.get(M);Y||(Y={canonicalDir:ie,members:[]},x.set(M,Y)),Y.members.push({target:T,agentDir:ce});}return (await Promise.all([...x.values()].map(async T=>{let[E,...H]=T.members;if(!E)return [];if(le.get(k.name)?.get(Ft(E.target))??!1)return T.members.map(({target:ce,agentDir:M})=>({skill:chunkHOK3SUH4_cjs.B(k),agent:dt(ce),pluginName:k.pluginName,success:!0,path:M,canonicalPath:M,mode:O,skipped:!0,skippedReason:"up-to-date"}));let ee=await eo(k,E.target,E.agentDir,{installMode:O,installGlobally:o,cwd:N,tempDir:p}),ie=await Promise.all(H.map(async({target:ce,agentDir:M})=>{let Y=O==="copy"?await chunkIJI72D6W_cjs.j(T.canonicalDir,M,{agentType:ce.agent}):await chunkIJI72D6W_cjs.i(T.canonicalDir,M,{isGlobal:o,agentType:ce.agent,cwd:N,storePath:k.path});return {skill:chunkHOK3SUH4_cjs.B(k),agent:dt(ce),pluginName:k.pluginName,...Y}}));return [ee,...ie]}))).flat()}));for(let k of qe)Te.push(...k);u.stop("Installation complete"),console.log();let Ne=Te.filter(k=>k.success),kt=Te.filter(k=>!k.success),Ke={};for(let k of g)if(p&&k.path===p)Ke[k.name]="SKILL.md";else if(p&&k.path.startsWith(p+path.sep))Ke[k.name]=`${k.path.slice(p.length+1).split(path.sep).join("/")}/SKILL.md`;else if(p&&k.path.startsWith(p)){let x=p.split(path.sep).join("/"),_=k.path.split(path.sep).join("/");_.startsWith(`${x}/`)&&(Ke[k.name]=`${_.slice(x.length+1)}/SKILL.md`);}let Ve=chunkHOK3SUH4_cjs.a(d),vs=Qn(d.url,Ve);if(Ve&&(chunkHOK3SUH4_cjs.b(Ve)?f.then(x=>{x===!1&&chunkQ2MOP5ZW_cjs.d({event:"install",source:Ve,skills:g.map(_=>_.name).join(","),agents:v.join(","),...o&&{global:"1"},skillFiles:JSON.stringify(Ke)});}):chunkQ2MOP5ZW_cjs.d({event:"install",source:Ve,skills:g.map(x=>x.name).join(","),agents:v.join(","),...o&&{global:"1"},skillFiles:JSON.stringify(Ke)})),Ne.length>0&&o){let k=new Set(Ne.map(x=>x.skill));for(let x of g){if(!k.has(chunkHOK3SUH4_cjs.B(x)))continue;let{derivePluginSlug:_,findSkillByLocation:T,readStoreIndex:E}=await import('./store-2ULHEVHS.cjs'),H=chunkHOK3SUH4_cjs.L(d),B;{let Y=(await E()).markets[H],fe=Y?.plugins&&Object.keys(Y.plugins).find(xe=>Y.plugins[xe]?.skills[x.name]);fe?B=fe.slice(H.length+1):B=_(d,void 0,x.pluginName);}let ee,ie;{let M=await T(H,`${H}:${B}`,x.name);ee=M?.entry.computedHash,ie=M?.entry.skillPath;}if(ie===void 0){let M=d.type==="local"?d.localPath??d.url:d.url;if(x.path.startsWith(M))ie=utils.Filesystem.relative(M,x.path).replace(/^\/+/,"");else {let Y=Ke[x.name];Y&&(ie=utils.Filesystem.toUnixPath(utils.Filesystem.dirname(Y)));}}ee===void 0&&(ee=await chunkE7AHWFZN_cjs.b(x.path));let ce=`${H}:${B}`;await chunkBWDTT6SA_cjs.r(x.name,{source:vs||Ve||d.url,sourceType:d.type,ref:d.ref,...ie&&{skillPath:ie},computedHash:ee,marketId:H,pluginId:ce});}}if(Ne.length>0&&!o){let k=new Set(Ne.map(T=>T.skill)),x=v.includes("eve")?A.map(T=>T??""):void 0,_=x&&(x.length>1||x.some(T=>T!==""));for(let T of g)if(k.has(chunkHOK3SUH4_cjs.B(T)))try{let{derivePluginSlug:E,findSkillByLocation:H,readStoreIndex:B}=await import('./store-2ULHEVHS.cjs'),ee=chunkHOK3SUH4_cjs.L(d),ie=g.find(xe=>chunkHOK3SUH4_cjs.B(xe)===T.name),ce;{let Ce=(await B()).markets[ee],ke=Ce?.plugins&&Object.keys(Ce.plugins).find(Oe=>Ce.plugins[Oe]?.skills[T.name]);ke?ce=ke.slice(ee.length+1):ce=E(d,void 0,ie?.pluginName);}let M,Y;{let xe=await H(ee,`${ee}:${ce}`,T.name);M=xe?.entry.computedHash,Y=xe?.entry.skillPath??Ke[T.name];}M===void 0&&(M=await chunkE7AHWFZN_cjs.b(T.path));let fe=`${ee}:${ce}`;await chunkHOK3SUH4_cjs.v(T.name,{source:vs||d.url,ref:d.ref,sourceType:d.type,...Y&&{skillPath:Y},computedHash:M,marketId:ee,pluginId:fe,..._&&{subagents:x}},N);}catch{}}if(Ne.length>0){let k=new Map,x={},_=[];for(let M of Ne){let Y=k.get(M.skill)||[];if(Y.push(M),k.set(M.skill,Y),Y.length===1)if(M.pluginName){let fe=M.pluginName;x[fe]||(x[fe]=[]),x[fe].push(M);}else _.push(M);}let T=k.size,E=Ne.filter(M=>M.mode==="symlink"&&M.symlinkFailed),H=E.map(M=>M.agent),B=[],ee=M=>{for(let Y of M){let fe=k.get(Y.skill)||[],xe=fe[0];if(B.push(`${terminal.Symbol.statusIcon("success")} ${Y.skill}`),xe.canonicalPath){let ke=gs(xe.canonicalPath,N);B.push(` ${chunkBWDTT6SA_cjs.a("source:")} ${ke}`);}let Ce=new Map;for(let ke of fe){if(ke.symlinkFailed||ke.skipped||xe.canonicalPath&&ke.path===xe.canonicalPath)continue;let Oe=ke.path;Ce.has(Oe)?Ce.get(Oe)!=="symlink"&&ke.mode==="symlink"&&Ce.set(Oe,"symlink"):Ce.set(Oe,ke.mode);}for(let[ke,Oe]of Ce){let pn=gs(ke,N),un=Oe==="symlink"?chunkBWDTT6SA_cjs.e("(link)"):chunkBWDTT6SA_cjs.a("(copied)");B.push(` ${chunkBWDTT6SA_cjs.a("target:")} ${pn} ${un}`);}B.push(...co(fe,v,o));}},ie=Object.keys(x).sort();for(let M of ie){let Y=M.split("-").map(fe=>fe.charAt(0).toUpperCase()+fe.slice(1)).join(" ");B.push(""),B.push(chunkBWDTT6SA_cjs.f(Y)),ee(x[M]);}_.length>0&&(ie.length>0&&(B.push(""),B.push(chunkBWDTT6SA_cjs.f("General"))),ee(_));let ce=chunkBWDTT6SA_cjs.c(`Installed ${T} skill${T!==1?"s":""}`);terminal.note(B.join(`
10
+ `),ce),E.length>0&&(terminal.Prompt.Log.warn(chunkBWDTT6SA_cjs.d(`Symlinks failed for: ${ye(H)}`)),terminal.Prompt.Log.message(chunkBWDTT6SA_cjs.a(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(kt.length>0){console.log(),terminal.Prompt.Log.error(chunkBWDTT6SA_cjs.b(`Failed to install ${kt.length}`));for(let k of kt)terminal.Prompt.Log.message(` ${terminal.Symbol.statusIcon("error")} ${k.skill} \u2192 ${k.agent}: ${chunkBWDTT6SA_cjs.a(k.error??"")}`);}if(console.log(),terminal.Prompt.outro(chunkBWDTT6SA_cjs.c("Done!")+chunkBWDTT6SA_cjs.a(" Review skills before use; they run with full agent permissions.")),t.json){let k=Ne.map(_=>({skill:_.skill,agent:_.agent,canonicalPath:_.canonicalPath??null,path:_.path,mode:_.mode,..._.pluginName&&{pluginName:_.pluginName}})),x=kt.map(_=>({skill:_.skill,agent:_.agent,error:_.error??"unknown error"}));J(z({scope:o?"global":"project",source:d.url,sourceType:d.type,...d.subpath&&{subpath:d.subpath},...d.ref&&{ref:d.ref},installed:k,failed:x,summary:{total:Te.length,installed:k.length,failed:x.length,agents:v,mode:O}},{scope:o?"global":"project",source:d.url,installed:k.length,failed:x.length,total:Te.length,agents:v.length}));return}await go(t,v);}catch(u){if(u instanceof chunkHOK3SUH4_cjs.g){terminal.Prompt.Log.error(chunkBWDTT6SA_cjs.b("Failed to clone repository"));for(let d of u.message.split(`
11
+ `))terminal.Prompt.Log.message(chunkBWDTT6SA_cjs.a(d));}else terminal.Prompt.Log.error(u instanceof Error?u.message:"Unknown error occurred");process.stdin.isTTY||l(),terminal.Prompt.outro(chunkBWDTT6SA_cjs.b("Installation failed")),process.exit(1);}finally{await de(p);}}async function de(e){if(e){if(chunkHOK3SUH4_cjs.ga(e))return;try{await chunkHOK3SUH4_cjs.l(e);}catch{}}}async function go(e,t){if(process.stdin.isTTY&&!e?.yes)try{if(await chunkBWDTT6SA_cjs.w("findSkillsPrompt"))return;if(await chunkIJI72D6W_cjs.k("eas-skill-find","claude-code",{global:!0})){await chunkBWDTT6SA_cjs.y("findSkillsPrompt");return}console.log(),terminal.Prompt.Log.message(chunkBWDTT6SA_cjs.a("One-time prompt - you won't be asked again if you dismiss."));let l=await terminal.Prompt.confirm({message:`Install the ${chunkBWDTT6SA_cjs.e("eas-skill-find")} skill? It helps your agent discover and suggest skills.`});if(terminal.Prompt.isCancel(l)){await chunkBWDTT6SA_cjs.y("findSkillsPrompt");return}if(l){await chunkBWDTT6SA_cjs.y("findSkillsPrompt");let o=t?.filter(r=>r!=="replit");if(!o||o.length===0)return;console.log(),terminal.Prompt.Log.step("Installing eas-skill-find skill...");try{await ft(["houjallen/agent-skills@skills/builtin/eas-skill-find"],{global:!0,yes:!0,agent:o});let r=path.join(chunkIJI72D6W_cjs.e(!0),"eas-skill-find"),p=await is({skillId:"eas-skill-find",sourceDir:r,targetAgents:o,installGlobally:!0,defaultMode:"symlink",assumeYes:e?.yes===!0});p.reported.length>0&&terminal.Prompt.Log.warn(`${p.reported.length} cell(s) reported divergent/orphan (not auto-fixed). Run 'easbot skills repair' to fix.`);}catch{terminal.Prompt.Log.warn("Failed to install eas-skill-find. You can try again with:"),terminal.Prompt.Log.message(chunkBWDTT6SA_cjs.a(" easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find -g -y --all"));}}else await chunkBWDTT6SA_cjs.y("findSkillsPrompt"),terminal.Prompt.Log.message(chunkBWDTT6SA_cjs.a("You can install it later with: easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find"));}catch{}}function Mt(e){let t={},s=[];for(let n=0;n<e.length;n++){let l=e[n];if(l==="-g"||l==="--global")t.global=true;else if(l==="-y"||l==="--yes")t.yes=true;else if(l==="-l"||l==="--list")t.list=true;else if(l==="--all")t.all=true;else if(l==="--json")t.json=true;else if(l==="-a"||l==="--agent"){t.agent=t.agent||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.agent.push(o),n++,o=e[n];n--;}else if(l==="-s"||l==="--skill"){t.skill=t.skill||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.skill.push(o),n++,o=e[n];n--;}else if(l==="--full-depth")t.fullDepth=true;else if(l==="--copy")t.copy=true;else if(l==="--subagent"){t.subagent=t.subagent||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.subagent.push(o),n++,o=e[n];n--;}else l&&!l.startsWith("-")&&s.push(l);}return {source:s,options:t}}var xl={languages:[{value:"zh-CN",name:"\u7B80\u4F53\u4E2D\u6587",example:"\u4F60\u597D\uFF0CEASBOT\uFF01",supported:true},{value:"en-US",name:"English (United States)",example:"Hello, EASBOT!",supported:true}]};var mo=xl.languages,ho=mo.filter(e=>e.supported).map(e=>e.value),Je={defaultLocale:"zh-CN",locales:ho},mt={},Gt=(e,t)=>{let s=mt[e]||{translation:{}};return mt[e]={translation:{...s.translation,...t.translation}},mt[e]},Kt=(e=Je.defaultLocale)=>(mt[e]||Gt(e,{translation:{}}),{locale:e,resources:mt[e]||{translation:{}}});var ko={translation:{"cli.banner.tagline":"easbot-skills \u2014 Agent \u6280\u80FD\u751F\u6001","cli.banner.try_hint":"\u8BD5\u8BD5:","cli.banner.discover":"\u5728 {{url}} \u53D1\u73B0\u66F4\u591A\u6280\u80FD","cli.banner.cmd.add":"{{cmd}} add {{dim}}<package>{{reset}} \u6DFB\u52A0\u65B0\u6280\u80FD","cli.banner.cmd.use":"{{cmd}} use {{dim}}<package>@<skill>{{reset}} \u4E0D\u5B89\u88C5\u76F4\u63A5\u4F7F\u7528\u4E00\u4E2A\u6280\u80FD","cli.banner.cmd.remove":"{{cmd}} remove \u79FB\u9664\u5DF2\u5B89\u88C5\u6280\u80FD","cli.banner.cmd.list":"{{cmd}} list \u5217\u51FA\u5DF2\u5B89\u88C5\u6280\u80FD","cli.banner.cmd.find":"{{cmd}} find {{dim}}[query]{{reset}} \u641C\u7D22\u6280\u80FD","cli.banner.cmd.update":"{{cmd}} update \u66F4\u65B0\u5DF2\u5B89\u88C5\u6280\u80FD","cli.banner.cmd.init":"{{cmd}} init {{dim}}[name]{{reset}} \u521B\u5EFA\u4E00\u4E2A\u65B0\u6280\u80FD","cli.banner.cmd.sync":"{{cmd}} experimental_sync \u4ECE node_modules \u540C\u6B65\u6280\u80FD","cli.help.usage":"\u7528\u6CD5: skills <command> [options]","cli.help.section.manage":"\u6280\u80FD\u7BA1\u7406","cli.help.section.find_options":"Find \u9009\u9879","cli.help.section.updates":"\u66F4\u65B0","cli.help.section.update_options":"Update \u9009\u9879","cli.help.section.project":"\u9879\u76EE","cli.help.section.add_options":"Add \u9009\u9879","cli.help.section.use_options":"Use \u9009\u9879","cli.help.section.remove_options":"Remove \u9009\u9879","cli.help.section.sync_options":"\uFF08\u5DF2\u5E9F\u5F03\uFF09Sync \u9009\u9879","cli.help.section.list_options":"List \u9009\u9879","cli.help.section.options":"\u901A\u7528\u9009\u9879","cli.help.store.desc":"\u8FD0\u7EF4\u5B50\u547D\u4EE4\u65CF\uFF08\u4EE5 store \u4E3A\u4E2D\u5FC3\u7BA1\u7406 store / cache\uFF09","cli.help.store.usage_title":"\u7528\u6CD5","cli.help.store.concepts_title":"\u6838\u5FC3\u6982\u5FF5","cli.help.store.local_protection_title":"local \u6E90\u4FDD\u62A4\uFF08\u786C\u89C4\u5219\uFF0C\u4E0D\u53EF\u7ED5\u8FC7\uFF09","cli.help.store.options_title":"\u9009\u9879","cli.help.store.examples_title":"\u793A\u4F8B","cli.help.store.list_desc":"\u5217\u51FA store skills\uFF08\u53EF\u9009 skill name \u8FC7\u6EE4\uFF1B\u4EBA\u7C7B\u53EF\u8BFB\u6A21\u5F0F\u5C55\u793A\u5B8C\u6574 64 \u4F4D hex sourceKey\uFF09","cli.help.store.clean_desc":"\u91CD\u7F6E store\uFF1A\u5220 store \u7269\u7406 + \u6E05 index.json\uFF08cache \u4FDD\u7559\uFF09","cli.help.store.clean_force_desc":"\u540C\u4E0A + \u6E05 cache \u7269\u7406\uFF08local \u6E90 cache \u4FDD\u62A4\uFF09","cli.help.store.update_desc":"\u4ECE\u539F\u59CB\u6E90\u91CD\u65B0\u62C9\u53D6 store\uFF08\u4E0D\u52A8 agent \u524D\u7AEF\uFF1Bsource-key \u4E3A 64 \u4F4D hex marketId\uFF0C\u4ECE `store list` \u53D6\uFF09","cli.help.store.remove_desc":"\u79FB\u9664 store source\uFF1A\u5220 store \u7269\u7406 + index entries","cli.help.store.remove_force_desc":"\u989D\u5916\u6E05 cache \u7269\u7406\uFF08remote \u6E90\uFF1Blocal \u6E90\u5FFD\u7565\uFF09","cli.help.store.help_desc":"\u672C\u5E2E\u52A9","cli.help.store.concept_store":"\u5F52\u4E00\u5316\u6E90\u76EE\u5F55\uFF08add \u5199\u4E00\u6B21\uFF0Cadd \u590D\u7528\uFF09","cli.help.store.concept_cache":"\u4E0B\u8F7D/\u7269\u5316\u7F13\u5B58\uFF08remote \u6E90\u624D\u6709\uFF1Blocal \u6E90 = \u7528\u6237\u539F\u76EE\u5F55\uFF09","cli.help.store.concept_index":"store defs \u7D22\u5F15\uFF08key = skillName\uFF09","cli.help.store.local_clean":"`store clean --force` \u5BF9 local \u6E90\u8DF3\u8FC7 cache\uFF08\u7528\u6237\u539F\u76EE\u5F55\u7EDD\u4E0D\u5220\uFF09","cli.help.store.local_remove_force":"`store remove --force` \u5BF9 local \u6E90\u7B49\u540C\u9ED8\u8BA4\uFF08cache \u8DF3\u8FC7\uFF09","cli.help.store.local_remove":"`store remove` \u5BF9 local \u6E90\u53EA\u5220 store + index\uFF0C\u7EDD\u4E0D\u5220\u7528\u6237\u539F\u76EE\u5F55","cli.help.store.opt_yes":"\u8DF3\u8FC7\u786E\u8BA4\u63D0\u793A","cli.help.store.opt_force":"`clean` / `remove`\uFF1A\u989D\u5916\u6E05 cache \u7269\u7406\uFF08local \u6E90\u5FFD\u7565\uFF09","cli.help.store.opt_json":"\u8F93\u51FA JSON \u683C\u5F0F\uFF08\u673A\u5668\u53EF\u8BFB\uFF09","cli.store.unknown_subcommand":"\u672A\u77E5 store \u5B50\u547D\u4EE4: {{sub}}","cli.help.add.flag.global":"\u5B89\u88C5\u5230\u5168\u5C40\uFF08\u7528\u6237\u76EE\u5F55\uFF09\uFF0C\u800C\u975E\u9879\u76EE\u7EA7\uFF08\u9ED8\u8BA4\u9879\u76EE\u7EA7\uFF09","cli.help.add.flag.agent":"\u6307\u5B9A Agent\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.add.flag.skill":"\u6307\u5B9A\u6280\u80FD\u540D\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.add.flag.list":"\u53EA\u5217\u51FA\u4ED3\u5E93\u4E2D\u7684\u6280\u80FD\uFF0C\u4E0D\u5B89\u88C5","cli.help.add.flag.yes":"\u8DF3\u8FC7\u6240\u6709\u786E\u8BA4\u63D0\u793A","cli.help.add.flag.copy":"\u62F7\u8D1D\u6587\u4EF6\u5230 Agent \u76EE\u5F55\uFF08\u9ED8\u8BA4\u4F7F\u7528\u7B26\u53F7\u94FE\u63A5\uFF09","cli.help.add.flag.subagent":"\u5B89\u88C5\u5230 Eve subagent\uFF08\u7528 root \u8868\u793A\u6839 agent\uFF09","cli.help.add.flag.all":"\u7B49\u540C\u4E8E --skill * --agent * -y","cli.help.add.flag.full_depth":"\u904D\u5386\u6240\u6709\u5B50\u76EE\u5F55\uFF0C\u5373\u4F7F\u5B58\u5728\u6839 SKILL.md","cli.help.use.flag.skill":"\u6307\u5B9A\u8981\u4F7F\u7528\u7684\u6280\u80FD\u540D\uFF08\u4EC5\u5355\u503C\uFF09","cli.help.use.flag.agent":"\u6307\u5B9A\u4EA4\u4E92\u542F\u52A8\u7684 Agent\uFF08\u4EC5\u652F\u6301 claude-code / codex\uFF09","cli.help.use.flag.full_depth":"\u904D\u5386\u6240\u6709\u5B50\u76EE\u5F55","cli.help.use.flag.openclaw_risks":"\u5141\u8BB8\u672A\u5BA1\u6838\u7684 OpenClaw \u793E\u533A\u6280\u80FD","cli.help.remove.flag.global":"\u4ECE\u5168\u5C40\uFF08~\uFF09\u79FB\u9664\uFF0C\u800C\u975E\u9879\u76EE\u7EA7\uFF08\u9ED8\u8BA4\u9879\u76EE\u7EA7\uFF09","cli.help.remove.flag.agent":"\u6307\u5B9A Agent\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.remove.flag.skill":"\u6307\u5B9A\u6280\u80FD\u540D\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.remove.flag.yes":"\u8DF3\u8FC7\u6240\u6709\u786E\u8BA4\u63D0\u793A","cli.help.remove.flag.all":"\u7B49\u540C\u4E8E --skill * --agent * -y","cli.help.list.flag.global":"\u5217\u51FA\u5168\u5C40\u6280\u80FD\uFF08\u9ED8\u8BA4 both \u5168\u5C40 + \u9879\u76EE\uFF09","cli.help.list.flag.project":"\u53EA\u5217\u9879\u76EE\u7EA7\u6280\u80FD\uFF08\u4E0E -g \u4E92\u65A5\uFF1B\u4E24\u8005\u540C\u4F20 = both\uFF09","cli.help.list.flag.agent":"\u6307\u5B9A Agent\uFF08\u53EF\u591A\u6B21\u4F20 / \u7A7A\u683C\u5206\u9694\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.list.flag.json":"\u4EE5 JSON \u8F93\u51FA\uFF08\u65E0 ANSI\uFF09","cli.help.list.flag.all":"\u7B49\u540C\u4E8E --agent *","cli.help.doctor.flag.global":"\u53EA\u68C0\u67E5\u5168\u5C40\uFF08\u4E0E -p \u4E92\u65A5\uFF1B\u9ED8\u8BA4 both\uFF09","cli.help.doctor.flag.project":"\u53EA\u68C0\u67E5\u9879\u76EE\u7EA7\uFF08\u4E0E -g \u4E92\u65A5\uFF1B\u9ED8\u8BA4 both\uFF09","cli.help.doctor.flag.agent":"\u6307\u5B9A Agent\uFF08\u7A7A\u683C\u5206\u9694\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.doctor.flag.yes":"\u8DF3\u8FC7\u786E\u8BA4\u76F4\u63A5\u6E05\u7406\u5931\u6548 link\uFF08\u9ED8\u8BA4\u9700 TTY \u786E\u8BA4\uFF09","cli.help.doctor.flag.all":"\u7B49\u540C\u4E8E --agent *","cli.help.doctor.usage":"\u7528\u6CD5: easbot-skills doctor [options]","cli.help.doctor.description":"\u4F53\u68C0 + \u6E05\u7406 agent baseDir \u4E0B\u7684\u5931\u6548 symlink\uFF08\u9ED8\u8BA4\u53EA\u626B\u63CF\uFF1B\u7528 --yes \u76F4\u63A5\u6E05\u7406\uFF09\u3002\u540E\u7EED\u4F1A\u6269\u5C55 skill \u9A8C\u8BC1\u3001LLM \u8BC4\u5BA1\u7B49\u529F\u80FD\u3002","cli.commands.doctor":"\u4F53\u68C0\uFF1A\u626B\u63CF\u5931\u6548 link / \u540E\u7EED\u6269\u5C55\u9A8C\u8BC1","cli.example.doctor":"\u4EA4\u4E92\u5F0F\u4F53\u68C0 + \u6E05\u7406\u5931\u6548 link","cli.example.doctor_agent_yes":"\u68C0\u67E5\u5355\u4E2A agent + \u76F4\u63A5\u6E05\u7406","cli.example.doctor_global":"\u53EA\u68C0\u67E5\u5168\u5C40\u4F5C\u7528\u57DF","cli.help.find.flag.owner":"\u53EA\u5728\u6307\u5B9A GitHub owner \u4E0B\u641C\u7D22","cli.help.update.flag.global":"\u53EA\u66F4\u65B0\u5168\u5C40\u6280\u80FD\uFF08\u4E0E -p \u4E92\u65A5\uFF1B\u9ED8\u8BA4 -y \u8D70 both\uFF09","cli.help.update.flag.project":"\u53EA\u66F4\u65B0\u9879\u76EE\u7EA7\u6280\u80FD\uFF08\u4E0E -g \u4E92\u65A5\uFF1B\u9ED8\u8BA4 -y \u8D70 both\uFF09","cli.help.update.flag.yes":"\u8DF3\u8FC7\u4F5C\u7528\u57DF\u9009\u62E9\u63D0\u793A\uFF08\u9ED8\u8BA4 both \u5168\u5C40 + \u9879\u76EE\uFF09","cli.help.update.flag.all":"\u7B49\u540C\u4E8E --skill * -y","cli.help.sync.flag.agent":"\u6307\u5B9A Agent\uFF08\u7A7A\u683C\u5206\u9694\u591A\u4E2A\u503C\uFF1B\u7528 * \u8868\u793A\u5168\u90E8\uFF09","cli.help.sync.flag.yes":"\u8DF3\u8FC7\u6240\u6709\u786E\u8BA4\u63D0\u793A","cli.help.remove.usage":"\u7528\u6CD5: easbot-skills remove [skills...] [options]","cli.help.remove.description":"\u4ECE Agent \u4E2D\u79FB\u9664\u5DF2\u5B89\u88C5\u6280\u80FD\u3002\u672A\u4F20\u6280\u80FD\u540D\u65F6\u8FDB\u5165\u4EA4\u4E92\u5F0F\u9009\u62E9\u83DC\u5355\u3002","cli.help.remove.arguments":"skills \u53EF\u9009\u6280\u80FD\u540D\uFF08\u7A7A\u683C\u5206\u9694\uFF09","cli.example.add":"\u6DFB\u52A0\u4E00\u4E2A\u6280\u80FD\u5305","cli.example.use":"\u4E00\u6B21\u6027\u4F7F\u7528\u67D0\u4E2A\u6280\u80FD","cli.example.use_with_agent":"\u6307\u5B9A\u6280\u80FD + Agent","cli.example.add_global":"\u5168\u5C40\u5B89\u88C5","cli.example.add_multi_agent":"\u5B89\u88C5\u5230\u591A\u4E2A Agent","cli.example.add_multi_skill":"\u5B89\u88C5\u591A\u4E2A\u6280\u80FD","cli.example.remove_interactive":"\u4EA4\u4E92\u5F0F\u5220\u9664","cli.example.remove_by_name":"\u6309\u540D\u79F0\u5220\u9664","cli.example.remove_global":"\u4ECE\u5168\u5C40\u8303\u56F4\u5220\u9664","cli.example.remove_by_agent":"\u4ECE\u6307\u5B9A Agent \u5220\u9664","cli.example.remove_all":"\u5220\u9664\u5168\u90E8","cli.example.remove_agent_all":"\u5220\u9664\u6307\u5B9A Agent \u7684\u6240\u6709\u6280\u80FD","cli.example.list_project":"\u5217\u51FA\u9879\u76EE\u7EA7\u6280\u80FD","cli.example.list_global":"\u5217\u51FA\u5168\u5C40\u6280\u80FD","cli.example.list_filter_agent":"\u6309 Agent \u8FC7\u6EE4","cli.example.list_json":"JSON \u8F93\u51FA","cli.example.find_interactive":"\u4EA4\u4E92\u5F0F\u641C\u7D22","cli.example.find_keyword":"\u6309\u5173\u952E\u5B57\u641C\u7D22","cli.example.find_owner":"\u5728\u6307\u5B9A owner \u4E0B\u641C\u7D22","cli.example.update_one":"\u66F4\u65B0\u5355\u4E2A\u6280\u80FD","cli.example.update_global":"\u4EC5\u66F4\u65B0\u5168\u5C40\u6280\u80FD","cli.example.init":"\u521B\u5EFA\u65B0\u6280\u80FD","cli.example.sync":"\u4ECE node_modules \u540C\u6B65","cli.example.sync_no_prompt":"\u540C\u6B65\u4E14\u8DF3\u8FC7\u786E\u8BA4","cli.example.store":"\u7BA1\u7406 store / cache \u6E90","cli.example.store_list":"\u5217\u51FA store skills","cli.example.store_clean_force":"\u91CD\u7F6E store + \u6E05 cache","cli.example.help":"\u663E\u793A\u6B64\u5E2E\u52A9","cli.init.exists":"\u6280\u80FD\u5DF2\u5B58\u5728: {{path}}","cli.init.created":"\u5DF2\u521B\u5EFA\u6280\u80FD: {{name}}","cli.init.created_label":"\u5DF2\u521B\u5EFA","cli.init.next.title":"\u4E0B\u4E00\u6B65","cli.init.next.edit":"\u7F16\u8F91 {{path}} \u5B9A\u4E49\u6280\u80FD\u6307\u4EE4","cli.init.next.frontmatter":"\u66F4\u65B0 frontmatter \u4E2D\u7684 name \u4E0E description","cli.init.publish.title":"\u53D1\u5E03\u65B9\u5F0F","cli.init.publish.github":"\u63A8\u9001\u5230\u4ED3\u5E93\u540E\u4F7F\u7528 {{cmd}} add <owner>/<repo>","cli.init.publish.url":"\u6258\u7BA1\u6587\u4EF6\u540E\u4F7F\u7528 {{cmd}} add https://example.com/{{path}}","cli.init.browse_hint":"\u5728 {{url}} \u6D4F\u89C8\u5176\u4ED6\u6280\u80FD\u83B7\u53D6\u7075\u611F","cli.unknown_command":"\u672A\u77E5\u547D\u4EE4: {{command}}","cli.help_hint":"\u8FD0\u884C {{cmd}} --help \u67E5\u770B\u7528\u6CD5"}},Ll=ko;var yo={translation:{"cli.banner.tagline":"easbot-skills \u2014 agent skills ecosystem","cli.banner.try_hint":"try:","cli.banner.discover":"Discover more skills at {{url}}","cli.banner.cmd.add":"{{cmd}} add {{dim}}<package>{{reset}} Add a new skill","cli.banner.cmd.use":"{{cmd}} use {{dim}}<package>@<skill>{{reset}} Use a skill without installing","cli.banner.cmd.remove":"{{cmd}} remove Remove installed skills","cli.banner.cmd.list":"{{cmd}} list List installed skills","cli.banner.cmd.find":"{{cmd}} find {{dim}}[query]{{reset}} Search for skills","cli.banner.cmd.update":"{{cmd}} update Update installed skills","cli.banner.cmd.init":"{{cmd}} init {{dim}}[name]{{reset}} Create a new skill","cli.banner.cmd.sync":"{{cmd}} experimental_sync Sync skills from node_modules","cli.help.usage":"Usage: skills <command> [options]","cli.help.section.manage":"Manage Skills","cli.help.section.find_options":"Find Options","cli.help.section.updates":"Updates","cli.help.section.update_options":"Update Options","cli.help.section.project":"Project","cli.help.section.add_options":"Add Options","cli.help.section.use_options":"Use Options","cli.help.section.remove_options":"Remove Options","cli.help.section.sync_options":"(Deprecated) Sync Options","cli.help.section.list_options":"List Options","cli.help.section.options":"Options","cli.help.store.desc":"Ops subcommands (store / cache management, store-centric)","cli.help.store.usage_title":"Usage","cli.help.store.concepts_title":"Concepts","cli.help.store.local_protection_title":"Local source protection (hard rule)","cli.help.store.options_title":"Options","cli.help.store.examples_title":"Examples","cli.help.store.list_desc":"List store skills (optional name filter; human-readable mode shows full 64-hex sourceKey)","cli.help.store.clean_desc":"Reset store: delete store dirs + clear index.json (cache preserved)","cli.help.store.clean_force_desc":"Same + clear cache (local source cache protected)","cli.help.store.update_desc":"Refresh store from source (no agent distribution touched; source-key = 64-hex marketId, copy from `store list`)","cli.help.store.remove_desc":"Remove store source: delete store + index entries","cli.help.store.remove_force_desc":"Extra clear cache (remote sources; local source ignored)","cli.help.store.help_desc":"This help","cli.help.store.concept_store":"normalized source dir (write once, reuse)","cli.help.store.concept_cache":"download/materialize cache (remote only; local = user dir)","cli.help.store.concept_index":"store defs index (key = skillName)","cli.help.store.local_clean":"`store clean --force` skips local source cache (user directory never deleted)","cli.help.store.local_remove_force":"`store remove --force` for local source is same as default (cache skipped)","cli.help.store.local_remove":"`store remove` for local source deletes store + index only, never user directory","cli.help.store.opt_yes":"Skip confirmation prompts","cli.help.store.opt_force":"`clean` / `remove`: extra clear cache (local source ignored)","cli.help.store.opt_json":"Output as JSON (machine-readable)","cli.store.unknown_subcommand":"Unknown store subcommand: {{sub}}","cli.help.add.flag.global":"Install to global (user-level) instead of project-level (default: project)","cli.help.add.flag.agent":"Target agents (repeatable; use * for all)","cli.help.add.flag.skill":"Skill names (repeatable; use * for all)","cli.help.add.flag.list":"Only list available skills in the repo, do not install","cli.help.add.flag.yes":"Skip all confirmation prompts","cli.help.add.flag.copy":"Copy files instead of symlinking","cli.help.add.flag.subagent":"Install to Eve subagents (use root for the root agent)","cli.help.add.flag.all":"Shorthand for --skill * --agent * -y","cli.help.add.flag.full_depth":"Search all subdirectories even when a root SKILL.md exists","cli.help.use.flag.skill":"Specify the skill to use (single value only)","cli.help.use.flag.agent":"Start one supported agent interactively (only claude-code / codex)","cli.help.use.flag.full_depth":"Search all subdirectories","cli.help.use.flag.openclaw_risks":"Allow unverified OpenClaw community skills","cli.help.remove.flag.global":"Remove from global (~) instead of project-level (default: project)","cli.help.remove.flag.agent":"Target agents (repeatable; use * for all)","cli.help.remove.flag.skill":"Skill names (repeatable; use * for all)","cli.help.remove.flag.yes":"Skip all confirmation prompts","cli.help.remove.flag.all":"Shorthand for --skill * --agent * -y","cli.help.list.flag.global":"List global skills (default: both global + project)","cli.help.list.flag.project":"List project-level skills only (mutually exclusive with -g; passing both = both)","cli.help.list.flag.agent":"Target agents (repeatable; use * for all)","cli.help.list.flag.json":"Output as JSON (no ANSI)","cli.help.list.flag.all":"Shorthand for --agent *","cli.help.doctor.flag.global":"Check global scope only (mutually exclusive with -p; default: both)","cli.help.doctor.flag.project":"Check project scope only (mutually exclusive with -g; default: both)","cli.help.doctor.flag.agent":"Target agents (repeatable; use * for all)","cli.help.doctor.flag.yes":"Skip confirmation; unlink dangling symlinks directly","cli.help.doctor.flag.all":"Shorthand for --agent *","cli.help.doctor.usage":"Usage: easbot-skills doctor [options]","cli.help.doctor.description":"Check + cleanup dangling symlinks in agent baseDirs (scan only by default; use --yes to clean). Extensible for skill validation, llm review, etc.","cli.commands.doctor":"Health check: scan dangling symlinks (extensible: validate, llm review, etc.)","cli.example.doctor":"Interactive check + cleanup","cli.example.doctor_agent_yes":"Check one agent + auto-cleanup","cli.example.doctor_global":"Check global scope only","cli.help.find.flag.owner":"Search only repositories from a GitHub owner","cli.help.update.flag.global":"Update global skills only (mutually exclusive with -p; default with -y is both)","cli.help.update.flag.project":"Update project-level skills only (mutually exclusive with -g; default with -y is both)","cli.help.update.flag.yes":"Skip the scope prompt (default: both global + project)","cli.help.update.flag.all":"Shorthand for --skill * -y","cli.help.sync.flag.agent":"Target agents (repeatable; use * for all)","cli.help.sync.flag.yes":"Skip all confirmation prompts","cli.help.remove.usage":"Usage: easbot-skills remove [skills...] [options]","cli.help.remove.description":"Remove installed skills from agents. If no skill names are provided, an interactive selection menu will be shown.","cli.help.remove.arguments":"skills Optional skill names to remove (space-separated)","cli.example.add":"Add a skill package","cli.example.use":"Use a skill one-shot","cli.example.use_with_agent":"Specify skill + agent","cli.example.add_global":"Install globally","cli.example.add_multi_agent":"Install to multiple agents","cli.example.add_multi_skill":"Install multiple skills","cli.example.remove_interactive":"Interactive remove","cli.example.remove_by_name":"Remove by name","cli.example.remove_global":"Remove from global scope","cli.example.remove_by_agent":"Remove from specific agent","cli.example.remove_all":"Remove all skills","cli.example.remove_agent_all":"Remove all skills from one agent","cli.example.list_project":"List project skills","cli.example.list_global":"List global skills","cli.example.list_filter_agent":"Filter by agent","cli.example.list_json":"JSON output","cli.example.find_interactive":"Interactive search","cli.example.find_keyword":"Search by keyword","cli.example.find_owner":"Search within an owner","cli.example.update_one":"Update a single skill","cli.example.update_global":"Update global skills only","cli.example.init":"Create a new skill","cli.example.sync":"Sync from node_modules","cli.example.sync_no_prompt":"Sync without prompts","cli.example.store":"Manage store / cache sources","cli.example.store_list":"List store skills","cli.example.store_clean_force":"Reset store + clear cache","cli.example.help":"Show this help","cli.init.exists":"Skill already exists at {{path}}","cli.init.created":"Initialized skill: {{name}}","cli.init.created_label":"Created","cli.init.next.title":"Next steps","cli.init.next.edit":"Edit {{path}} to define your skill instructions","cli.init.next.frontmatter":"Update the name and description in the frontmatter","cli.init.publish.title":"Publishing","cli.init.publish.github":"Push to a repo, then {{cmd}} add <owner>/<repo>","cli.init.publish.url":"Host the file, then {{cmd}} add https://example.com/{{path}}","cli.init.browse_hint":"Browse existing skills for inspiration at {{url}}","cli.unknown_command":"Unknown command: {{command}}","cli.help_hint":"Run {{cmd}} --help for usage"}},Tl=yo;var $o=()=>{Kt("zh-CN"),Kt("en-US"),Gt("zh-CN",Ll),Gt("en-US",Tl);};$o();var fs=new Map,ms=new Map,bo=e=>{if(ms.has(e))return ms.get(e);let t=/{{\s*(\w+)\s*}}/g,s=[],n;for(;(n=t.exec(e))!==null;){let r=n[1];r&&!s.includes(r)&&s.push(r);}let l=new RegExp("{{\\s*("+s.join("|")+")\\s*}}","g"),o={keys:s,regex:l};return ms.set(e,o),o},Il=(e,t)=>{if(!e||typeof e!="string")return "";if(!t||Object.keys(t).length===0)return e;let{regex:s,keys:n}=bo(e);return n.length===0||!n.some(o=>o in t)?e:e.replace(s,(o,r)=>{let p=t[r];return p==null?"":String(p)})},So=e=>{if(e&&Je.locales.includes(e))return e;let t=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(t){let s=t.replace(/_/g,"-");if(Je.locales.includes(s))return s;let n=s.split("-")[0];if(n==="zh")return "zh-CN";if(n==="en")return "en-US"}return Je.defaultLocale},jl=e=>{if(!fs.has(e)){let{resources:t}=Kt(e);fs.set(e,t);}return fs.get(e)},wo=(e,t={})=>{let s=So(t.locale),l=jl(s)?.translation[e];if(l&&typeof l=="string"){let o=Il(l,t.vars);return o!=null?String(o):String(e)}if(s!==Je.defaultLocale){let r=jl(Je.defaultLocale)?.translation[e];if(r&&typeof r=="string"){let p=Il(r,t.vars);return p!=null?String(p):String(e)}}return String(t.fallback??e)},b=wo;function vo(e){let t=e[0]??"list",s=e.slice(1);return {subcommand:t,restArgs:s}}async function Rl(e,t={}){let{subcommand:s,restArgs:n}=vo(e),l=Ao(n,t);switch(s){case "list":return xo(Pl(n),l);case "clean":return To(l);case "update":return Po(Pl(n),l);case "remove":return Co(n,l);case "--help":case "-h":return _l(),0;default:return console.log(chunkBWDTT6SA_cjs.d(b("cli.store.unknown_subcommand",{vars:{sub:s},fallback:`Unknown store subcommand: ${s}`}))),_l(),1}}async function Nl(e){if(!fs$1.existsSync(e))return;let t=fs$1.readdirSync(e,{withFileTypes:true});for(let s of t){if(s.name==="index.json")continue;let n=utils.Filesystem.join(e,s.name);await promises.rm(n,{recursive:true,force:true}).catch(()=>{});}}function Pl(e){for(let t of e)if(t&&!t.startsWith("-"))return t}function Ao(e,t){let s={...t};for(let n=0;n<e.length;n++){let l=e[n];l!==void 0&&(l==="--force"?s.force=true:l==="--yes"||l==="-y"?s.yes=true:l==="--json"&&(s.json=true));}return s}async function xo(e,t={}){let s=await chunkHOK3SUH4_cjs.S(),n=await chunkHOK3SUH4_cjs.W(),l=e?n.filter(h=>h.skillName.toLowerCase().includes(e.toLowerCase())):n;if(l.length===0)return t.json?(J(z([],{count:0,keyword:e??null,sources:0})),0):(q([],{emptyTitle:"Store skills",outro:e?`${a}No store skills matching "${e}".`:`${a}No store sources. Run \`skills add <source>\` first.`}),0);let o=new Map(Object.values(s.markets).map(h=>[h.id,h]));if(t.json){let h=l.map(f=>{let C=o.get(f.marketId);return {skillName:f.skillName,marketId:f.marketId,pluginId:f.pluginId,sourceKey:f.marketId,type:C?.type??null,url:C?.url??null,storePath:C?.storePath??null,cachePath:C?.cachePath??null,entry:f.entry}});return J(z(h,{count:h.length,keyword:e??null,sources:new Set(l.map(f=>f.marketId)).size})),0}let r=[];r.push("");let p=new Map;for(let h of l){p.has(h.marketId)||p.set(h.marketId,new Map);let f=p.get(h.marketId);f.has(h.pluginId)||f.set(h.pluginId,[]),f.get(h.pluginId).push(h);}let u=Array.from(new Set(l.map(h=>h.marketId))),d=0;for(let h of u){let f=o.get(h),C=h,w=C.slice(0,8),$=f?.storePath??utils.Filesystem.join(chunkHOK3SUH4_cjs.J(),h),c=f?.type??"unknown",g=f?.url??"(local)",m=chunkBWDTT6SA_cjs.a("(n/a)");if(f?.cachePath)try{let L=fs$1.readdirSync(f.cachePath);m=chunkBWDTT6SA_cjs.c(`${L.length} files`);}catch{m=chunkBWDTT6SA_cjs.b("missing");}r.push(`${chunkBWDTT6SA_cjs.f(C)} ${chunkBWDTT6SA_cjs.a("("+c+")")} ${g}`),r.push(` ${chunkBWDTT6SA_cjs.a("\u2514")} ${chunkBWDTT6SA_cjs.a("key="+w)} ${chunkBWDTT6SA_cjs.a("store="+$)} ${chunkBWDTT6SA_cjs.a("cache="+(f?.cachePath??"(n/a)"))} ${m}`);let S=p.get(h),v=Array.from(S.keys()).sort();for(let L of v){let j=S.get(L),y=L.split(":").slice(1).join(":")||L;r.push(` ${chunkBWDTT6SA_cjs.a("\u2514")} ${chunkBWDTT6SA_cjs.e(y)} ${chunkBWDTT6SA_cjs.a("("+j.length+" skill"+(j.length>1?"s":"")+")")}`);let A=[...j].sort((R,O)=>R.skillName.localeCompare(O.skillName));for(let R of A)r.push(` ${Lo(R.skillName)}`),d++;}r.push("");}return q(r,{title:`Store skills (${d})`,outro:chunkBWDTT6SA_cjs.a(`Total: ${d} skill(s)${e?` matching "${e}"`:""}. Use \`skills store clean [--force]\` to reset store, \`skills store update [source-key]\` to refresh from source (copy the source key above).`)}),0}function Lo(e){return e.replace(/[\x00-\x1f\x7f]/g,"").trim()}async function To(e={}){return e.force?jo(e):Io(e)}async function Io(e){await chunkHOK3SUH4_cjs.S();let s=await chunkHOK3SUH4_cjs.W(),n=Array.from(new Set(s.map(p=>p.marketId))),l=s.length;if(!e.yes&&!e.json&&process.stdin.isTTY){l>0&&terminal.Prompt.Log.warn(chunkBWDTT6SA_cjs.d(`This will reset store: ${n.length} source(s) / ${l} skill(s). Cache is preserved; next \`skills add <source>\` will reuse cache if present.`));let p=await terminal.Prompt.confirm({message:"Reset store (delete store contents + clear index.json)?"});if(terminal.Prompt.isCancel(p)||!p)return terminal.Prompt.cancel("Cancelled."),1}let o=chunkHOK3SUH4_cjs.J();await Nl(o);let r=utils.Filesystem.join(o,"index.json");if(fs$1.existsSync(r)){let{Filesystem:p}=await import('@easbot/utils');await p.writeJson(r,{version:6,markets:{}});}if(fs$1.existsSync(o)&&await promises.rm(utils.Filesystem.normalize(o),{recursive:true,force:true}).catch(()=>{}),chunkQ2MOP5ZW_cjs.d({event:"store_clean"}),e.json)return J(z({cleaned:true,path:o,affectedSources:n.length,affectedSkills:l,cacheCleared:false},{affectedSources:n.length,affectedSkills:l,cacheCleared:false})),0;{let p=l>0?` (${l} skill(s) reset)`:"";q([],{emptyTitle:"Store clean",outro:`${chunkBWDTT6SA_cjs.c(`\u2713 Reset store: ${o}${p} (cache preserved)`)}`,hideBoxWhenEmpty:true});}return 0}async function jo(e){let t=await chunkHOK3SUH4_cjs.S(),s=await chunkHOK3SUH4_cjs.W(),n=Array.from(new Set(s.map(w=>w.marketId))),l=s.length,o=new Set,r=new Set;for(let w of Object.values(t.markets))w.type==="local"?o.add(w.localPath??w.url):r.add(w.id);if(!e.yes&&!e.json&&process.stdin.isTTY){let w=o.size,$=w>0?chunkBWDTT6SA_cjs.d(` ${w} local source(s) cache = user directory; will be SKIPPED (never removed by force).`):"";terminal.Prompt.Log.warn(chunkBWDTT6SA_cjs.d(`This will reset store AND clear cache: ${n.length} source(s) / ${l} skill(s).${$}`));let c=await terminal.Prompt.confirm({message:"Reset store + clear cache (local sources protected)?"});if(terminal.Prompt.isCancel(c)||!c)return terminal.Prompt.cancel("Cancelled."),1}let p=chunkHOK3SUH4_cjs.J(),u=utils.Filesystem.normalize(chunkHOK3SUH4_cjs.N()),d=utils.Filesystem.normalize(p);for(let w of o){let $=utils.Filesystem.normalize(w);if($.startsWith(d+"/")||$===d)throw new Error(`[INVARIANT 0048-yyy] localPath falls inside storeRoot (suspected configuration error): ${$}
12
+ This is a program bug: a local source must be the user's original directory and must not live inside storeRoot.`);if($.startsWith(u+"/")||$===u)throw new Error(`[INVARIANT 0048-yyy] localPath falls inside cacheRoot (suspected configuration error): ${$}
13
+ This is a program bug: a local source must not live inside cacheRoot.`)}await Nl(p);let h=utils.Filesystem.join(p,"index.json");if(fs$1.existsSync(h)){let{Filesystem:w}=await import('@easbot/utils');await w.writeJson(h,{version:6,markets:{}});}let f=chunkHOK3SUH4_cjs.N(),C=false;if(fs$1.existsSync(f)&&r.size>0?(await chunkHOK3SUH4_cjs.ja(),C=true):fs$1.existsSync(f)&&(await chunkHOK3SUH4_cjs.ja(),C=true),fs$1.existsSync(p)&&await promises.rm(utils.Filesystem.normalize(p),{recursive:true,force:true}).catch(()=>{}),chunkQ2MOP5ZW_cjs.d({event:"store_clean_force"}),e.json)J(z({cleaned:true,path:p,cachePath:f,affectedSources:n.length,affectedSkills:l,cacheCleared:C,localSourcesSkipped:o.size},{affectedSources:n.length,affectedSkills:l,cacheCleared:C,localSourcesSkipped:o.size}));else {let w=o.size>0?chunkBWDTT6SA_cjs.a(` (${o.size} local source(s) cache preserved)`):"";q([],{emptyTitle:"Store clean (force)",outro:`${chunkBWDTT6SA_cjs.c(`\u2713 Reset store + cleared cache${w}`)}`,hideBoxWhenEmpty:true});}return 0}async function Po(e,t={}){let s=await chunkHOK3SUH4_cjs.S(),n=await chunkHOK3SUH4_cjs.W();if(n.length===0)return t.json?(J(z({updated:0,reason:"no store sources"},{updated:0,reason:"no store sources"})),0):(q([],{emptyTitle:"Store update",outro:`${a}No store sources to update.`,hideBoxWhenEmpty:true}),0);let l=new Set;if(e){if(!new Set(Object.keys(s.markets)).has(e))return t.json?(J(z({updated:0,reason:`source key not found: ${e}`},{updated:0,reason:`source key not found: ${e}`})),1):(q([],{emptyTitle:"Store update",outro:`${a}Source key not found: ${e}. Run \`skills store list\` to see available source keys.`}),1);l.add(e);}else for(let u of n)l.add(u.marketId);let o=0,r=0,p=[];for(let u of l){let d=await _o(u,s,{...t});d.ok?(o++,p.push({sourceKey:u,skills:d.skills})):(r++,p.push({sourceKey:u,skills:[],cloneError:d.error}));}return chunkQ2MOP5ZW_cjs.d({event:"store_update",sourceKey:e??"",sourceCount:String(o+r),successCount:String(o),failCount:String(r)}),t.json?J(z({updated:o,failed:r,total:l.size,sourceKey:e??null,results:p},{failed:r,total:l.size,sourceKey:e??null})):(r>0&&terminal.Prompt.Log.warn(chunkBWDTT6SA_cjs.d(`${r} source(s) failed to refresh (clone errors); see above.`)),terminal.Prompt.outro(chunkBWDTT6SA_cjs.c(`\u2713 Refreshed ${o}/${l.size} store source(s)${e?` (source-key ${e.slice(0,8)}\u2026)`:""}`)),o>0&&terminal.Prompt.Log.info(chunkBWDTT6SA_cjs.a("Agent junctions refresh automatically; agents using copy mode need `skills update <skill>`."))),r>0?2:0}async function _o(e,t,s){let n=t.markets[e];if(!n)return {ok:false,error:`source key not found: ${e}`};let l=chunkHOK3SUH4_cjs.e(n.url);if(n.subpath&&(l.subpath=n.subpath),n.ref&&(l.ref=n.ref),false);let o=await chunkHOK3SUH4_cjs.da(l,{mode:"update"});return o.cloneError?{ok:false,error:o.cloneError.message}:{ok:true,skills:o.skills.map(r=>r.name)}}async function Co(e,t={}){let s=e[0];if(!s)return t.json?(J(z({removed:false,reason:"source key required"},{removed:false,reason:"source key required"})),1):(terminal.Prompt.Log.error(chunkBWDTT6SA_cjs.b("Usage: skills store remove <source-key> [--force]")),1);let n=await chunkHOK3SUH4_cjs.S(),l=(await chunkHOK3SUH4_cjs.W()).filter(f=>f.marketId===s);if(l.length===0)return t.json?(J(z({removed:false,reason:`source key not found: ${s}`},{removed:false,reason:`source key not found: ${s}`})),1):(terminal.Prompt.Log.error(chunkBWDTT6SA_cjs.b(`Source key not found: ${s}`)),q([],{emptyTitle:"Store remove",outro:`${a}Run \`skills store list\` to see available sources.`}),1);let o=n.markets[s],r=utils.Filesystem.join(chunkHOK3SUH4_cjs.J(),s),p=o.type==="local",u=p?` (local: ${utils.Filesystem.normalize(o.url).replace(/[/\\]+$/,"")})`:"",d=s.length>12?`${s.slice(0,12)}\u2026`:s;if(!t.yes&&!t.json&&process.stdin.isTTY){let f=p?" [local source: user directory protected]":"",C=t.force&&!p?" (+ cache)":"",w=await terminal.Prompt.confirm({message:`Remove store source ${d}${u} (${l.length} skill(s))${f}${C}?`});(terminal.Prompt.isCancel(w)||!w)&&terminal.Prompt.cancel("Cancelled.");}let h=await chunkHOK3SUH4_cjs.S();if(h.markets[s]&&(delete h.markets[s],await utils.Filesystem.writeJson(utils.Filesystem.join(chunkHOK3SUH4_cjs.J(),"index.json"),h)),fs$1.existsSync(r)&&await promises.rm(r,{recursive:true,force:true}),!p&&t.force&&await chunkHOK3SUH4_cjs.ia({type:o.type,url:o.url,subpath:o.subpath,ref:o.ref}),chunkQ2MOP5ZW_cjs.d({event:t.force?"store_remove_force":"store_remove",source:s,sourceType:o.type,removedSkills:l.map(f=>f.skillName).join(",")}),t.json)J(z({removed:true,sourceKey:s,sourceType:o.type,isLocal:p,cacheCleared:!p&&t.force===true,skills:l.map(f=>f.skillName)},{sourceType:o.type,cacheCleared:!p&&t.force===true,count:l.length}));else {let f=`\u2713 Removed store source ${s.slice(0,8)}\u2026 (${l.length} skill(s))`;p?f+=chunkBWDTT6SA_cjs.a(" [local: user directory preserved]"):t.force?f+=chunkBWDTT6SA_cjs.a(" (+ cache cleared)"):f+=chunkBWDTT6SA_cjs.a(" (cache preserved; use --force to clear)"),q([],{emptyTitle:"Store remove",outro:`${chunkBWDTT6SA_cjs.c(f)}`,hideBoxWhenEmpty:true});}return 0}function _l(){let e=(t,s,n)=>b(`cli.help.store.${t}`,{fallback:s,vars:n});console.log(`
14
+ ${chunkBWDTT6SA_cjs.f(chunkBWDTT6SA_cjs.e("skills store"))} - ${e("desc","Ops subcommands (store / cache management, store-centric)")}
15
+
16
+ ${chunkBWDTT6SA_cjs.f(e("usage_title","Usage:"))}
17
17
  skills store list [keyword] ${e("list_desc","List store skills (optional name filter)")}
18
18
  skills store clean ${e("clean_desc","Reset store: delete store dirs + clear index.json (cache preserved)")}
19
19
  skills store clean --force ${e("clean_force_desc","Same + clear cache (local source cache protected)")}
@@ -22,38 +22,38 @@ ${chunk5RWSXDNO_cjs.f(e("usage_title","Usage:"))}
22
22
  skills store remove <key> --force ${e("remove_force_desc","Extra clear cache (remote sources; local source ignored)")}
23
23
  skills store --help ${e("help_desc","This help")}
24
24
 
25
- ${chunk5RWSXDNO_cjs.f(e("concepts_title","Concepts:"))}
25
+ ${chunkBWDTT6SA_cjs.f(e("concepts_title","Concepts:"))}
26
26
  - store = \`<storeRoot>/<sourceKey>/\` ${e("concept_store","normalized source dir (write once, reuse)")}
27
27
  - cache = \`<cacheRoot>/<owner>/<repo>/\` ${e("concept_cache","download/materialize cache (remote only; local = user dir)")}
28
28
  - index = \`<storeRoot>/index.json\` ${e("concept_index","store defs index (key = skillName)")}
29
29
 
30
- ${chunk5RWSXDNO_cjs.f(e("local_protection_title","Local source protection (hard rule):"))}
30
+ ${chunkBWDTT6SA_cjs.f(e("local_protection_title","Local source protection (hard rule):"))}
31
31
  - ${e("local_clean","`store clean --force` skips local source cache (user directory never deleted)")}
32
32
  - ${e("local_remove_force","`store remove --force` for local source is same as default (cache skipped)")}
33
33
  - ${e("local_remove","`store remove` for local source deletes store + index only, never user directory")}
34
34
 
35
- ${chunk5RWSXDNO_cjs.f(e("options_title","Options:"))}
35
+ ${chunkBWDTT6SA_cjs.f(e("options_title","Options:"))}
36
36
  -y, --yes ${e("opt_yes","Skip confirmation prompts")}
37
37
  --force ${e("opt_force","`clean` / `remove`: extra clear cache (local source ignored)")}
38
38
  --json ${e("opt_json","Output as JSON (machine-readable)")}
39
39
 
40
- ${chunk5RWSXDNO_cjs.f(e("examples_title","Examples:"))}
41
- ${chunk5RWSXDNO_cjs.a("$")} skills store list
42
- ${chunk5RWSXDNO_cjs.a("$")} skills store list eas-skill-find
43
- ${chunk5RWSXDNO_cjs.a("$")} skills store list --json
44
- ${chunk5RWSXDNO_cjs.a("$")} skills store clean
45
- ${chunk5RWSXDNO_cjs.a("$")} skills store clean --force
46
- ${chunk5RWSXDNO_cjs.a("$")} skills store update
47
- ${chunk5RWSXDNO_cjs.a("$")} skills store update <full-source-key-from-list>
48
- ${chunk5RWSXDNO_cjs.a("$")} skills store remove a1b2c3d4e5f67890
49
- ${chunk5RWSXDNO_cjs.a("$")} skills store remove a1b2c3d4e5f67890 --force
50
- ${chunk5RWSXDNO_cjs.a("$")} skills store clean -y --json
51
- `);}var Wt=utils.Log.create({service:"skills-find"}),Eo=process.env.SKILLS_API_URL||"https://skills.sh";function El(e){return !e||e<=0?"":e>=1e6?`${(e/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${e} install${e===1?"":"s"}`}var Do=/^[a-z0-9](?:[a-z0-9-]{0,38})$/i;function Uo(e){let t=[],s={},n=[];for(let l=0;l<e.length;l++){let o=e[l];if(!o)continue;if(o==="--json"){s.json=true;continue}if(o==="--local"){s.local=true;continue}if(o==="--path"&&l+1<e.length){s.path=e[l+1],l++;continue}if(o.startsWith("--path=")){s.path=o.slice(7);continue}let r;if(o==="--owner"){let p=e[l+1];if(!p||p.startsWith("-")){n.push("--owner requires a GitHub owner");continue}r=p,l++;}else if(o.startsWith("--owner=")){if(r=o.slice(8),!r){n.push("--owner requires a GitHub owner");continue}}else {t.push(o);continue}let u=r.trim().toLowerCase();if(!Do.test(u)){n.push("--owner must be a valid GitHub owner");continue}s.owner=u;}return {query:t.join(" "),options:s,errors:n}}async function Dl(e,t){try{let s=new URLSearchParams({q:e,limit:"10"});t&&s.set("owner",t);let n=`${Eo}/api/search?${s.toString()}`,l=await fetch(n);return l.ok?(await l.json()).skills.map(r=>({name:chunkDNE3XPCJ_cjs.b(r.name),slug:chunkDNE3XPCJ_cjs.b(r.id),source:chunkDNE3XPCJ_cjs.b(r.source||""),installs:r.installs})).sort((r,u)=>(u.installs||0)-(r.installs||0)):[]}catch(s){return console.warn(`${a}[find] skills.sh search API failed: ${s instanceof Error?s.message:String(s)}${i}`),[]}}async function Fo(e){let t=await chunkJCOXRETY_cjs.W(),s=e?.toLowerCase().trim()??"",n=await chunkJCOXRETY_cjs.S(),l=[];for(let o of t){if(s&&!o.skillName.toLowerCase().includes(s))continue;let r=n.markets[o.marketId];l.push({skillName:o.skillName,sourceKey:o.marketId,pluginId:o.pluginId,type:r?.type??"unknown",url:r?.url??"",storePath:r?.storePath??""});}return l.sort((o,r)=>o.skillName.localeCompare(r.skillName)),l}async function Mo(e,t){let s=[];try{for await(let o of utils.Grep.files({cwd:e,glob:["**/SKILL.md"]}))s.push(o);}catch{return []}let n=t?.toLowerCase().trim()??"",l=[];for(let o of s){let r=Go(e,o),u=await chunkJCOXRETY_cjs.y(r);if(!u)continue;let p=u.name;if(n&&!p.toLowerCase().includes(n))continue;let d=path.dirname(r);l.push({skillName:p,sourceKey:"",pluginId:"",type:"scan",url:"",storePath:d});}return l.sort((o,r)=>o.skillName.localeCompare(r.skillName)),l}function Go(e,t){let s=process.platform==="win32"?"\\":"/",n=t.replaceAll("/",s);return e.endsWith("/")||e.endsWith("\\")?e+n:e+s+n}var Ko="\x1B[?25l",Ho="\x1B[?25h",Wo="\x1B[J",zo=e=>`\x1B[${e}A`,Bo=e=>`\x1B[${e}G`;async function Jo(e="",t){let s=[],n=0,l=e,o=false,r=null,u=0;process.stdin.isTTY&&process.stdin.setRawMode(true),Ol__namespace.emitKeypressEvents(process.stdin),process.stdin.resume(),process.stdout.write(Ko);function p(){u>0&&process.stdout.write(zo(u)+Bo(1)),process.stdout.write(Wo);let h=[],f=`${G}_${i}`;if(h.push(`${U}Search skills:${i} ${l}${f}`),h.push(""),!l||l.length<2)h.push(`${a}Start typing to search (min 2 chars)${i}`);else if(s.length===0&&o)h.push(`${a}Searching...${i}`);else if(s.length===0)h.push(`${a}No skills found${i}`);else {let w=s.slice(0,8);for(let $=0;$<w.length;$++){let c=w[$],g=$===n,m=g?`${G}>${i}`:" ",S=g?`${G}${c.name}${i}`:`${U}${c.name}${i}`,v=c.source?` ${a}${c.source}${i}`:"",T=El(c.installs),j=T?` ${Te}${T}${i}`:"",y=o&&$===0?` ${a}...${i}`:"";h.push(` ${m} ${S}${v}${j}${y}`);}}h.push(""),h.push(`${a}up/down navigate | enter select | esc cancel${i}`);for(let C of h)process.stdout.write(C+`
52
- `);u=h.length;}function d(h){if(r&&(clearTimeout(r),r=null),o=false,!h||h.length<2){s=[],n=0,p();return}o=true,p();let f=Math.max(150,350-h.length*50);r=setTimeout(async()=>{try{s=await Dl(h,t),n=0;}catch{s=[];}finally{o=false,r=null,p();}},f);}return e&&d(e),p(),new Promise(h=>{function f(){process.stdin.removeListener("keypress",C),process.stdin.isTTY&&process.stdin.setRawMode(false),process.stdout.write(Ho),process.stdin.pause();}function C(w,$){if($){if($.name==="escape"||$.ctrl&&$.name==="c"){f(),h(null);return}if($.name==="return"){f(),h(s[n]||null);return}if($.name==="up"){n=Math.max(0,n-1),p();return}if($.name==="down"){n=Math.min(Math.max(0,s.length-1),n+1),p();return}if($.name==="backspace"){l.length>0&&(l=l.slice(0,-1),d(l));return}if($.sequence&&!$.ctrl&&!$.meta&&$.sequence.length===1){let c=$.sequence;c>=" "&&c<="~"&&(l+=c,d(l));}}}process.stdin.on("keypress",C);})}function Yo(e){let t=e.lastIndexOf("@"),n=(t>0?e.slice(0,t):e).match(/^([^/]+)\/([^/]+)$/);return n?{owner:n[1],repo:n[2]}:null}async function qo(e,t){return await chunkJCOXRETY_cjs.c(e,t)===false}async function Vo(e,t,s={}){let n=typeof s.path=="string"&&s.path.length>0,l=n?s.path:chunkJCOXRETY_cjs.J(),o,r;if(n?(o=await Mo(l,e||void 0),r="scan"):(o=await Fo(e||void 0),r="index"),chunkQ2MOP5ZW_cjs.d({event:"find",query:e,resultCount:String(o.length),mode:"local"}),t)return J(B(o,{count:o.length,query:e||null,mode:r,rootDir:n?l:null})),0;if(o.length===0){let $=e?` matching "${e}"`:"",c=n?` under "${l}"`:" in store";return q([`${a}No skills found${$}${c}.${i}`],{emptyTitle:`Local skills${e?` matching "${e}"`:""}`}),0}let u=r==="scan"?` (scanned ${l})`:"",p=[];if(p.push(""),r==="scan"){let $=[...o].sort((g,m)=>g.skillName.localeCompare(m.skillName)),c={};for(let g of $){let m=c[g.skillName]??[];m.push(g),c[g.skillName]=m;}for(let g of Object.keys(c).sort()){let m=c[g];p.push(`${Te}${g}${i}`);for(let S of m)p.push(` ${a}\u2514${i} ${S.storePath}`);}return p.push(""),q(p,{title:`Local skills${e?` matching "${e}"`:""}${u} (${o.length})`,outro:"Run `skills add <source>` to install a discovered skill."}),0}let d=await chunkJCOXRETY_cjs.S(),h=new Map(Object.values(d.markets).map($=>[$.id,$])),f=new Map;for(let $ of o){f.has($.sourceKey)||f.set($.sourceKey,new Map);let c=f.get($.sourceKey);c.has($.pluginId)||c.set($.pluginId,[]),c.get($.pluginId).push($);}let C=Array.from(new Set(o.map($=>$.sourceKey))),w=0;for(let $ of C){let c=h.get($),g=$.slice(0,8),m=c?.storePath??"",S=c?.type??"unknown",v=c?.url??"(local)";p.push(`${G}${g}${i} ${a}(${S})${i} ${v} ${a}store=${g}${i} ${a}${m}${i}`);let T=f.get($),j=Array.from(T.keys()).sort();for(let y of j){let A=T.get(y),R=y.includes(":")&&y.split(":").slice(1).join(":")||y;p.push(` ${a}\u2514${i} ${a}plugin:${i} ${Te}${R}${i} ${a}(${A.length} skill${A.length>1?"s":""})${i}`);let O=[...A].sort((D,N)=>D.skillName.localeCompare(N.skillName));for(let D of O)p.push(` ${D.skillName}`),w++;}p.push("");}return q(p,{title:`Local skills${e?` matching "${e}"`:""}${u} (${o.length})`,outro:`${a}Total: ${w} skill(s). Use \`skills store clean [--force]\` to reset store, \`skills store update [source-key]\` to refresh from source (source-key from \`skills store list\`).${i}`}),0}async function Ul(e){let{query:t,options:s,errors:n}=Uo(e),l=s.owner,o=!process.stdin.isTTY;Wt.debug("runFind enter",{args:e,query:t,owner:l,errors:n,isNonInteractive:o,stdinTTY:process.stdin.isTTY});let r=`${a}Tip: if running in a coding agent, follow these steps:${i}
40
+ ${chunkBWDTT6SA_cjs.f(e("examples_title","Examples:"))}
41
+ ${chunkBWDTT6SA_cjs.a("$")} skills store list
42
+ ${chunkBWDTT6SA_cjs.a("$")} skills store list eas-skill-find
43
+ ${chunkBWDTT6SA_cjs.a("$")} skills store list --json
44
+ ${chunkBWDTT6SA_cjs.a("$")} skills store clean
45
+ ${chunkBWDTT6SA_cjs.a("$")} skills store clean --force
46
+ ${chunkBWDTT6SA_cjs.a("$")} skills store update
47
+ ${chunkBWDTT6SA_cjs.a("$")} skills store update <full-source-key-from-list>
48
+ ${chunkBWDTT6SA_cjs.a("$")} skills store remove a1b2c3d4e5f67890
49
+ ${chunkBWDTT6SA_cjs.a("$")} skills store remove a1b2c3d4e5f67890 --force
50
+ ${chunkBWDTT6SA_cjs.a("$")} skills store clean -y --json
51
+ `);}var Wt=utils.Log.create({service:"skills-find"}),Eo=process.env.SKILLS_API_URL||"https://skills.sh";function El(e){return !e||e<=0?"":e>=1e6?`${(e/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${e} install${e===1?"":"s"}`}var Do=/^[a-z0-9](?:[a-z0-9-]{0,38})$/i;function Uo(e){let t=[],s={},n=[];for(let l=0;l<e.length;l++){let o=e[l];if(!o)continue;if(o==="--json"){s.json=true;continue}if(o==="--local"){s.local=true;continue}if(o==="--path"&&l+1<e.length){s.path=e[l+1],l++;continue}if(o.startsWith("--path=")){s.path=o.slice(7);continue}let r;if(o==="--owner"){let u=e[l+1];if(!u||u.startsWith("-")){n.push("--owner requires a GitHub owner");continue}r=u,l++;}else if(o.startsWith("--owner=")){if(r=o.slice(8),!r){n.push("--owner requires a GitHub owner");continue}}else {t.push(o);continue}let p=r.trim().toLowerCase();if(!Do.test(p)){n.push("--owner must be a valid GitHub owner");continue}s.owner=p;}return {query:t.join(" "),options:s,errors:n}}async function Dl(e,t){try{let s=new URLSearchParams({q:e,limit:"10"});t&&s.set("owner",t);let n=`${Eo}/api/search?${s.toString()}`,l=await fetch(n);return l.ok?(await l.json()).skills.map(r=>({name:chunkDNE3XPCJ_cjs.b(r.name),slug:chunkDNE3XPCJ_cjs.b(r.id),source:chunkDNE3XPCJ_cjs.b(r.source||""),installs:r.installs})).sort((r,p)=>(p.installs||0)-(r.installs||0)):[]}catch(s){return console.warn(`${a}[find] skills.sh search API failed: ${s instanceof Error?s.message:String(s)}${i}`),[]}}async function Fo(e){let t=await chunkHOK3SUH4_cjs.W(),s=e?.toLowerCase().trim()??"",n=await chunkHOK3SUH4_cjs.S(),l=[];for(let o of t){if(s&&!o.skillName.toLowerCase().includes(s))continue;let r=n.markets[o.marketId];l.push({skillName:o.skillName,sourceKey:o.marketId,pluginId:o.pluginId,type:r?.type??"unknown",url:r?.url??"",storePath:r?.storePath??""});}return l.sort((o,r)=>o.skillName.localeCompare(r.skillName)),l}async function Mo(e,t){let s=[];try{for await(let o of utils.Grep.files({cwd:e,glob:["**/SKILL.md"]}))s.push(o);}catch{return []}let n=t?.toLowerCase().trim()??"",l=[];for(let o of s){let r=Go(e,o),p=await chunkHOK3SUH4_cjs.y(r);if(!p)continue;let u=p.name;if(n&&!u.toLowerCase().includes(n))continue;let d=path.dirname(r);l.push({skillName:u,sourceKey:"",pluginId:"",type:"scan",url:"",storePath:d});}return l.sort((o,r)=>o.skillName.localeCompare(r.skillName)),l}function Go(e,t){let s=process.platform==="win32"?"\\":"/",n=t.replaceAll("/",s);return e.endsWith("/")||e.endsWith("\\")?e+n:e+s+n}var Ko="\x1B[?25l",Ho="\x1B[?25h",Wo="\x1B[J",Bo=e=>`\x1B[${e}A`,zo=e=>`\x1B[${e}G`;async function Jo(e="",t){let s=[],n=0,l=e,o=false,r=null,p=0;process.stdin.isTTY&&process.stdin.setRawMode(true),Ol__namespace.emitKeypressEvents(process.stdin),process.stdin.resume(),process.stdout.write(Ko);function u(){p>0&&process.stdout.write(Bo(p)+zo(1)),process.stdout.write(Wo);let h=[],f=`${G}_${i}`;if(h.push(`${U}Search skills:${i} ${l}${f}`),h.push(""),!l||l.length<2)h.push(`${a}Start typing to search (min 2 chars)${i}`);else if(s.length===0&&o)h.push(`${a}Searching...${i}`);else if(s.length===0)h.push(`${a}No skills found${i}`);else {let w=s.slice(0,8);for(let $=0;$<w.length;$++){let c=w[$],g=$===n,m=g?`${G}>${i}`:" ",S=g?`${G}${c.name}${i}`:`${U}${c.name}${i}`,v=c.source?` ${a}${c.source}${i}`:"",L=El(c.installs),j=L?` ${Le}${L}${i}`:"",y=o&&$===0?` ${a}...${i}`:"";h.push(` ${m} ${S}${v}${j}${y}`);}}h.push(""),h.push(`${a}up/down navigate | enter select | esc cancel${i}`);for(let C of h)process.stdout.write(C+`
52
+ `);p=h.length;}function d(h){if(r&&(clearTimeout(r),r=null),o=false,!h||h.length<2){s=[],n=0,u();return}o=true,u();let f=Math.max(150,350-h.length*50);r=setTimeout(async()=>{try{s=await Dl(h,t),n=0;}catch{s=[];}finally{o=false,r=null,u();}},f);}return e&&d(e),u(),new Promise(h=>{function f(){process.stdin.removeListener("keypress",C),process.stdin.isTTY&&process.stdin.setRawMode(false),process.stdout.write(Ho),process.stdin.pause();}function C(w,$){if($){if($.name==="escape"||$.ctrl&&$.name==="c"){f(),h(null);return}if($.name==="return"){f(),h(s[n]||null);return}if($.name==="up"){n=Math.max(0,n-1),u();return}if($.name==="down"){n=Math.min(Math.max(0,s.length-1),n+1),u();return}if($.name==="backspace"){l.length>0&&(l=l.slice(0,-1),d(l));return}if($.sequence&&!$.ctrl&&!$.meta&&$.sequence.length===1){let c=$.sequence;c>=" "&&c<="~"&&(l+=c,d(l));}}}process.stdin.on("keypress",C);})}function Yo(e){let t=e.lastIndexOf("@"),n=(t>0?e.slice(0,t):e).match(/^([^/]+)\/([^/]+)$/);return n?{owner:n[1],repo:n[2]}:null}async function qo(e,t){return await chunkHOK3SUH4_cjs.c(e,t)===false}async function Vo(e,t,s={}){let n=typeof s.path=="string"&&s.path.length>0,l=n?s.path:chunkHOK3SUH4_cjs.J(),o,r;if(n?(o=await Mo(l,e||void 0),r="scan"):(o=await Fo(e||void 0),r="index"),chunkQ2MOP5ZW_cjs.d({event:"find",query:e,resultCount:String(o.length),mode:"local"}),t)return J(z(o,{count:o.length,query:e||null,mode:r,rootDir:n?l:null})),0;if(o.length===0){let $=e?` matching "${e}"`:"",c=n?` under "${l}"`:" in store";return q([`${a}No skills found${$}${c}.${i}`],{emptyTitle:`Local skills${e?` matching "${e}"`:""}`}),0}let p=r==="scan"?` (scanned ${l})`:"",u=[];if(u.push(""),r==="scan"){let $=[...o].sort((g,m)=>g.skillName.localeCompare(m.skillName)),c={};for(let g of $){let m=c[g.skillName]??[];m.push(g),c[g.skillName]=m;}for(let g of Object.keys(c).sort()){let m=c[g];u.push(`${Le}${g}${i}`);for(let S of m)u.push(` ${a}\u2514${i} ${S.storePath}`);}return u.push(""),q(u,{title:`Local skills${e?` matching "${e}"`:""}${p} (${o.length})`,outro:"Run `skills add <source>` to install a discovered skill."}),0}let d=await chunkHOK3SUH4_cjs.S(),h=new Map(Object.values(d.markets).map($=>[$.id,$])),f=new Map;for(let $ of o){f.has($.sourceKey)||f.set($.sourceKey,new Map);let c=f.get($.sourceKey);c.has($.pluginId)||c.set($.pluginId,[]),c.get($.pluginId).push($);}let C=Array.from(new Set(o.map($=>$.sourceKey))),w=0;for(let $ of C){let c=h.get($),g=$.slice(0,8),m=c?.storePath??"",S=c?.type??"unknown",v=c?.url??"(local)";u.push(`${G}${g}${i} ${a}(${S})${i} ${v} ${a}store=${g}${i} ${a}${m}${i}`);let L=f.get($),j=Array.from(L.keys()).sort();for(let y of j){let A=L.get(y),R=y.includes(":")&&y.split(":").slice(1).join(":")||y;u.push(` ${a}\u2514${i} ${a}plugin:${i} ${Le}${R}${i} ${a}(${A.length} skill${A.length>1?"s":""})${i}`);let O=[...A].sort((D,N)=>D.skillName.localeCompare(N.skillName));for(let D of O)u.push(` ${D.skillName}`),w++;}u.push("");}return q(u,{title:`Local skills${e?` matching "${e}"`:""}${p} (${o.length})`,outro:`${a}Total: ${w} skill(s). Use \`skills store clean [--force]\` to reset store, \`skills store update [source-key]\` to refresh from source (source-key from \`skills store list\`).${i}`}),0}async function Ul(e){let{query:t,options:s,errors:n}=Uo(e),l=s.owner,o=!process.stdin.isTTY;Wt.debug("runFind enter",{args:e,query:t,owner:l,errors:n,isNonInteractive:o,stdinTTY:process.stdin.isTTY});let r=`${a}Tip: if running in a coding agent, follow these steps:${i}
53
53
  ${a} 1) easbot skills find [query] [--owner <owner>]${i}
54
- ${a} 2) easbot skills add <owner/repo@skill>${i}`;if(n.length>0){for(let $ of n)console.error($);return console.error("Usage: easbot skills find <query> [--owner <owner>]"),1}if(s.local)return Vo(t,s.json??false,s);if(t){Wt.debug("runFind enter query branch",{query:t,owner:l,json:s.json});let $=await Dl(t,l);if(Wt.debug("runFind searchSkillsAPI returned",{count:$.length}),chunkQ2MOP5ZW_cjs.d({event:"find",query:t,resultCount:String($.length)}),s.json)return J(B($.map(g=>({name:g.name,slug:g.slug,source:g.source,installs:g.installs,url:`https://skills.sh/${g.slug}`})),{count:$.length,query:t,owner:l??null,truncated:$.length>6})),0;if($.length===0){let g=l?` from owner "${l}"`:"";return q([`${a}No skills found for "${t}"${g}${i}`],{emptyTitle:`Search results for "${t}"`}),0}let c=[];c.push(`${a}Install with${i} ${U}easbot skills add <owner/repo@skill>${i}`),c.push("");for(let g of $.slice(0,6)){let m=g.source||g.slug,S=El(g.installs);c.push(`${U}${m}@${g.name}${i}${S?` ${Te}${S}${i}`:""}`),c.push(`${a}\u2514 https://skills.sh/${g.slug}${i}`),c.push("");}return q(c,{title:`Search results for "${t}" (${$.length})`,outro:"Run `easbot skills add <owner/repo@skill>` to install one."}),0}if(o||await Rt())return console.log(r),console.log(),console.log(`${a}Usage: easbot skills find <query> [--owner <owner>]${i}`),0;let u=await Jo("",l);if(chunkQ2MOP5ZW_cjs.d({event:"find",query:"",resultCount:u?"1":"0",interactive:"1"}),!u)return console.log(`${a}Search cancelled${i}`),console.log(),0;let p=u.source||u.slug,d=u.name;console.log(),console.log(`${U}Installing ${G}${d}${i} from ${a}${p}${i}...`),console.log();let{source:h,options:f}=Mt([p,"--skill",d]),C=0;try{await ft(h,f);}catch($){C=1,Wt.error("runAdd failed during find\u2192install",{err:$});}console.log();let w=Yo(p);return w&&await qo(w.owner,w.repo)?console.log(`${a}View the skill at${i} ${U}https://skills.sh/${u.slug}${i}`):console.log(`${a}Discover more skills at${i} ${U}https://skills.sh${i}`),console.log(),C}function hs(e,t){let s=os.homedir();return e.startsWith(s)?e.replace(s,"~"):e.startsWith(t)?"."+e.slice(t.length):e}function ks(e,t=5){if(e.length<=t)return e.join(", ");let s=e.slice(0,t),n=e.length-t;return `${s.join(", ")} +${n} more`}function Zo(e){let t={};for(let s=0;s<e.length;s++){let n=e[s];if(n==="-g"||n==="--global")t.global=true;else if(n==="-p"||n==="--project")t.project=true;else if(n==="--json")t.json=true;else if(n==="--all")t.all=true;else if(n==="-y"||n==="--yes")t.yes=true;else if(n==="-a"||n==="--agent")for(t.agent=t.agent||[];s+1<e.length&&!e[s+1].startsWith("-");)t.agent.push(e[++s]);}return t}function Qo(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":(e.all===true,"both")}async function Fl(e,t={}){let s=Zo(e),n=t.cwd??process.cwd();s.all===true&&(!s.agent||s.agent.length===0)&&(s.agent=["*"]);let l=Qo(s),o;if(s.agent&&s.agent.length>0){let m=chunkISMGLHYS_cjs.p(s.agent);if(m.length>0){let S=Object.keys(chunkISMGLHYS_cjs.b);console.log(`${lt}Invalid agents: ${m.join(", ")}${i}`),console.log(`${a}Valid agents: ${S.join(", ")}${i}`),process.exit(1);}o=chunkISMGLHYS_cjs.q(s.agent);}let r=await chunkUGHF4GOW_cjs.s({scope:l,agentFilter:o,cwd:n}),u=s.json?await chunkJCOXRETY_cjs.W():[],p=s.json?await chunkJCOXRETY_cjs.S():{markets:{}};if(s.json){let m=new Map;for(let T of u)m.has(T.skillName)||m.set(T.skillName,T);let S=new Map(Object.values(p.markets).map(T=>[T.id,T])),v=r.map(T=>{let j=m.get(T.name),y=j?S.get(j.marketId):void 0,A=y?.storePath&&j?`${y.storePath}/${j.entry.skillPath}`:void 0;return {name:T.name,path:A??T.canonicalPath,canonicalPath:T.canonicalPath,scope:T.scope,agents:T.agents.map(R=>chunkISMGLHYS_cjs.b[R].displayName),...j&&{marketId:j.marketId,pluginId:j.pluginId,sourceKey:j.marketId},...j?.entry.computedHash&&{computedHash:j.entry.computedHash},...y?.addedAt&&{addedAt:y.addedAt},...y?.storePath&&{storePath:y.storePath},...y?.localPath&&{sourcePath:y.localPath},...j?.entry.skillPath&&{skillPath:j.entry.skillPath},...y?.type&&{sourceType:y.type},...y?.url&&{sourceUrl:y.url}}});J(B(v,{count:v.length,scope:l,agentFilter:o?[...o]:null}));return}let d=await chunk5RWSXDNO_cjs.u(),h=l==="both"?"All":l==="global"?"Global":"Project";if(r.length===0){if(s.json){J(B([],{count:0,scope:l,agentFilter:o?[...o]:null}));return}q([`${a}No skills found.${i}`],{emptyTitle:`${h} Skills`,outro:`${`${lt}No skills found${i}`} ${a}(run \`easbot skills add <source>\` to install)${i}`});return}let C=(m,S)=>{let v=m.name.localeCompare(S.name);return v!==0?v:m.canonicalPath.localeCompare(S.canonicalPath)},w=[...r].sort(C),$={};for(let m of w){let S=$[m.name]??[];S.push(m),$[m.name]=S;}let c=Object.keys($).sort(),g=[];g.push("");for(let m of c){let S=$[m],v=d[m],T=v?.pluginId?.includes(":")?v.pluginId.split(":",2)[1]:void 0,j=T?` ${a}(${T})${i}`:"",y=S.length>1?` ${a}(${S.length} paths)${i}`:"";if(S.length===1){let A=S[0],R=hs(A.canonicalPath,n),O=A.agents.map(N=>chunkISMGLHYS_cjs.b[N].displayName),D=A.agents.length>0?ks(O):`${lt}not linked${i}`;g.push(`${Te}${chunkDNE3XPCJ_cjs.b(A.name)}${i}${j} ${a}${R}${i} ${a}Agents:${i} ${D}`);}else {g.push(`${Te}${chunkDNE3XPCJ_cjs.b(m)}${i}${j}${y}`);for(let A of S){let R=hs(A.canonicalPath,n),O=A.agents.map(N=>chunkISMGLHYS_cjs.b[N].displayName),D=A.agents.length>0?ks(O):`${lt}not linked${i}`;g.push(` ${a}\u2514${i} ${R} ${a}Agents:${i} ${D}`);}}g.push("");}q(g,{title:`${h} Skills (${w.length})`,outro:"Run `easbot skills find <query>` to discover new skills."});}async function Kl(e,t){let s=await st(),n=t.yes||s.isAgent;if(s.isAgent&&terminal.Prompt.Log.info(Ct(s.agent.name)+" Agent detected \u2014 removing non-interactively"),t.global===void 0&&!n&&process.stdin.isTTY&&!s.isAgent){let y=await terminal.Prompt.select({message:"Removal scope (use --global to switch)",options:[{value:false,label:"Project",hint:"Remove from current directory (committed with your project)"},{value:true,label:"Global",hint:"Remove from home directory (available across all projects)"}]});terminal.Prompt.isCancel(y)&&terminal.Prompt.cancel("Removal cancelled"),t.global=y;}let l=t.global??false,o=process.cwd(),r=t.json===true,u=r?{start:()=>{},stop:()=>{},update:()=>{},line:()=>""}:terminal.Prompt.spinner();r||u.start("Scanning for installed skills...");let{scanInstalledSkillDirs:p}=await import('./scan-L6UNVP3V.cjs'),d;if(t.agent&&t.agent.length>0){let y=chunkISMGLHYS_cjs.q(t.agent),A=chunkISMGLHYS_cjs.p(t.agent);A.length>0&&(console.log(`Invalid agents: ${A.join(", ")}`),console.log(`Valid agents: ${Object.keys(chunkISMGLHYS_cjs.b).join(", ")}`),process.exit(1)),d=y;}let h=await p({scope:l?"global":"project",cwd:o,agentFilter:d}),f=new Set;for(let y of h)f.add(y.name);let C=Array.from(f).sort();if(u.stop(`Found ${C.length} unique installed skill(s)`),C.length===0){if(t.json){J(B({scope:l?"global":"project",successful:[],failed:[],summary:{total:0,removed:0,failed:0,agents:[]}},{count:0,scope:l?"global":"project",removed:0,failed:0,agents:0}));return}console.log("No skills found to remove.");return}if(t.skill&&t.skill.length>0&&t.all!==true){let y=chunkJCOXRETY_cjs.D(t.skill,C);y.length>0&&(process.stdout.write(`Invalid skills: ${y.join(", ")}
54
+ ${a} 2) easbot skills add <owner/repo@skill>${i}`;if(n.length>0){for(let $ of n)console.error($);return console.error("Usage: easbot skills find <query> [--owner <owner>]"),1}if(s.local)return Vo(t,s.json??false,s);if(t){Wt.debug("runFind enter query branch",{query:t,owner:l,json:s.json});let $=await Dl(t,l);if(Wt.debug("runFind searchSkillsAPI returned",{count:$.length}),chunkQ2MOP5ZW_cjs.d({event:"find",query:t,resultCount:String($.length)}),s.json)return J(z($.map(g=>({name:g.name,slug:g.slug,source:g.source,installs:g.installs,url:`https://skills.sh/${g.slug}`})),{count:$.length,query:t,owner:l??null,truncated:$.length>6})),0;if($.length===0){let g=l?` from owner "${l}"`:"";return q([`${a}No skills found for "${t}"${g}${i}`],{emptyTitle:`Search results for "${t}"`}),0}let c=[];c.push(`${a}Install with${i} ${U}easbot skills add <owner/repo@skill>${i}`),c.push("");for(let g of $.slice(0,6)){let m=g.source||g.slug,S=El(g.installs);c.push(`${U}${m}@${g.name}${i}${S?` ${Le}${S}${i}`:""}`),c.push(`${a}\u2514 https://skills.sh/${g.slug}${i}`),c.push("");}return q(c,{title:`Search results for "${t}" (${$.length})`,outro:"Run `easbot skills add <owner/repo@skill>` to install one."}),0}if(o||await Rt())return console.log(r),console.log(),console.log(`${a}Usage: easbot skills find <query> [--owner <owner>]${i}`),0;let p=await Jo("",l);if(chunkQ2MOP5ZW_cjs.d({event:"find",query:"",resultCount:p?"1":"0",interactive:"1"}),!p)return console.log(`${a}Search cancelled${i}`),console.log(),0;let u=p.source||p.slug,d=p.name;console.log(),console.log(`${U}Installing ${G}${d}${i} from ${a}${u}${i}...`),console.log();let{source:h,options:f}=Mt([u,"--skill",d]),C=0;try{await ft(h,f);}catch($){C=1,Wt.error("runAdd failed during find\u2192install",{err:$});}console.log();let w=Yo(u);return w&&await qo(w.owner,w.repo)?console.log(`${a}View the skill at${i} ${U}https://skills.sh/${p.slug}${i}`):console.log(`${a}Discover more skills at${i} ${U}https://skills.sh${i}`),console.log(),C}function hs(e,t){let s=os.homedir();return e.startsWith(s)?e.replace(s,"~"):e.startsWith(t)?"."+e.slice(t.length):e}function ks(e,t=5){if(e.length<=t)return e.join(", ");let s=e.slice(0,t),n=e.length-t;return `${s.join(", ")} +${n} more`}function Zo(e){let t={};for(let s=0;s<e.length;s++){let n=e[s];if(n==="-g"||n==="--global")t.global=true;else if(n==="-p"||n==="--project")t.project=true;else if(n==="--json")t.json=true;else if(n==="--all")t.all=true;else if(n==="-y"||n==="--yes")t.yes=true;else if(n==="-a"||n==="--agent")for(t.agent=t.agent||[];s+1<e.length&&!e[s+1].startsWith("-");)t.agent.push(e[++s]);}return t}function Qo(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":(e.all===true,"both")}async function Fl(e,t={}){let s=Zo(e),n=t.cwd??process.cwd();s.all===true&&(!s.agent||s.agent.length===0)&&(s.agent=["*"]);let l=Qo(s),o;if(s.agent&&s.agent.length>0){let m=chunkJUNIAQ2A_cjs.p(s.agent);if(m.length>0){let S=Object.keys(chunkJUNIAQ2A_cjs.b);console.log(`${Fe}Invalid agents: ${m.join(", ")}${i}`),console.log(`${a}Valid agents: ${S.join(", ")}${i}`),process.exit(1);}o=chunkJUNIAQ2A_cjs.q(s.agent);}let r=await chunkIJI72D6W_cjs.s({scope:l,agentFilter:o,cwd:n}),p=s.json?await chunkHOK3SUH4_cjs.W():[],u=s.json?await chunkHOK3SUH4_cjs.S():{markets:{}};if(s.json){let m=new Map;for(let L of p)m.has(L.skillName)||m.set(L.skillName,L);let S=new Map(Object.values(u.markets).map(L=>[L.id,L])),v=r.map(L=>{let j=m.get(L.name),y=j?S.get(j.marketId):void 0,A=y?.storePath&&j?`${y.storePath}/${j.entry.skillPath}`:void 0;return {name:L.name,path:A??L.canonicalPath,canonicalPath:L.canonicalPath,scope:L.scope,agents:L.agents.map(R=>chunkJUNIAQ2A_cjs.b[R].displayName),...j&&{marketId:j.marketId,pluginId:j.pluginId,sourceKey:j.marketId},...j?.entry.computedHash&&{computedHash:j.entry.computedHash},...y?.addedAt&&{addedAt:y.addedAt},...y?.storePath&&{storePath:y.storePath},...y?.localPath&&{sourcePath:y.localPath},...j?.entry.skillPath&&{skillPath:j.entry.skillPath},...y?.type&&{sourceType:y.type},...y?.url&&{sourceUrl:y.url}}});J(z(v,{count:v.length,scope:l,agentFilter:o?[...o]:null}));return}let d=await chunkBWDTT6SA_cjs.u(),h=l==="both"?"All":l==="global"?"Global":"Project";if(r.length===0){if(s.json){J(z([],{count:0,scope:l,agentFilter:o?[...o]:null}));return}q([`${a}No skills found.${i}`],{emptyTitle:`${h} Skills`,outro:`${`${Fe}No skills found${i}`} ${a}(run \`easbot skills add <source>\` to install)${i}`});return}let C=(m,S)=>{let v=m.name.localeCompare(S.name);return v!==0?v:m.canonicalPath.localeCompare(S.canonicalPath)},w=[...r].sort(C),$={};for(let m of w){let S=$[m.name]??[];S.push(m),$[m.name]=S;}let c=Object.keys($).sort(),g=[];g.push("");for(let m of c){let S=$[m],v=d[m],L=v?.pluginId?.includes(":")?v.pluginId.split(":",2)[1]:void 0,j=L?` ${a}(${L})${i}`:"",y=S.length>1?` ${a}(${S.length} paths)${i}`:"";if(S.length===1){let A=S[0],R=hs(A.canonicalPath,n),O=A.agents.map(N=>chunkJUNIAQ2A_cjs.b[N].displayName),D=A.agents.length>0?ks(O):`${Fe}not linked${i}`;g.push(`${Le}${chunkDNE3XPCJ_cjs.b(A.name)}${i}${j} ${a}${R}${i} ${a}Agents:${i} ${D}`);}else {g.push(`${Le}${chunkDNE3XPCJ_cjs.b(m)}${i}${j}${y}`);for(let A of S){let R=hs(A.canonicalPath,n),O=A.agents.map(N=>chunkJUNIAQ2A_cjs.b[N].displayName),D=A.agents.length>0?ks(O):`${Fe}not linked${i}`;g.push(` ${a}\u2514${i} ${R} ${a}Agents:${i} ${D}`);}}g.push("");}q(g,{title:`${h} Skills (${w.length})`,outro:"Run `easbot skills find <query>` to discover new skills."});}async function Kl(e,t){let s=await lt(),n=t.yes||s.isAgent;if(s.isAgent&&terminal.Prompt.Log.info(Ct(s.agent.name)+" Agent detected \u2014 removing non-interactively"),t.global===void 0&&!n&&process.stdin.isTTY&&!s.isAgent){let y=await terminal.Prompt.select({message:"Removal scope (use --global to switch)",options:[{value:false,label:"Project",hint:"Remove from current directory (committed with your project)"},{value:true,label:"Global",hint:"Remove from home directory (available across all projects)"}]});terminal.Prompt.isCancel(y)&&terminal.Prompt.cancel("Removal cancelled"),t.global=y;}let l=t.global??false,o=process.cwd(),r=t.json===true,p=r?{start:()=>{},stop:()=>{},update:()=>{},line:()=>""}:terminal.Prompt.spinner();r||p.start("Scanning for installed skills...");let{scanInstalledSkillDirs:u}=await import('./scan-6EBCZDVK.cjs'),d;if(t.agent&&t.agent.length>0){let y=chunkJUNIAQ2A_cjs.q(t.agent),A=chunkJUNIAQ2A_cjs.p(t.agent);A.length>0&&(console.log(`Invalid agents: ${A.join(", ")}`),console.log(`Valid agents: ${Object.keys(chunkJUNIAQ2A_cjs.b).join(", ")}`),process.exit(1)),d=y;}let h=await u({scope:l?"global":"project",cwd:o,agentFilter:d}),f=new Set;for(let y of h)f.add(y.name);let C=Array.from(f).sort();if(p.stop(`Found ${C.length} unique installed skill(s)`),C.length===0){if(t.json){J(z({scope:l?"global":"project",successful:[],failed:[],summary:{total:0,removed:0,failed:0,agents:[]}},{count:0,scope:l?"global":"project",removed:0,failed:0,agents:0}));return}console.log("No skills found to remove.");return}if(t.skill&&t.skill.length>0&&t.all!==true){let y=chunkHOK3SUH4_cjs.D(t.skill,C);y.length>0&&(process.stdout.write(`Invalid skills: ${y.join(", ")}
55
55
  `),process.stdout.write(`Installed skills: ${C.join(", ")||"(none)"}
56
- `),process.exit(1));}let w=[];if(t.all)w=C;else if(e.length>0||t.skill&&t.skill.length>0){let y=[...e];if(t.skill&&t.skill.length>0){let A=chunkJCOXRETY_cjs.E(t.skill,C);if(A.wildcard)w=C;else for(let R of A.matched)y.push(R);}if(w.length===0){let A=new Set;w=[];for(let R of y){let O=C.find(D=>D.toLowerCase()===R.toLowerCase());O&&!A.has(O)&&(A.add(O),w.push(O));}}if(w.length===0){console.log(`No matching skills found for: ${y.join(", ")}`);return}}else {let y=C.map(R=>({value:R,label:R})),A=await terminal.Prompt.multiselect({message:`Select skills to remove ${chunk5RWSXDNO_cjs.a("(space to toggle)")}`,options:y,required:true});terminal.Prompt.isCancel(A)&&terminal.Prompt.cancel("Removal cancelled"),w=A;}let $=new Map;for(let y of h){let A=$.get(y.name);A||(A=new Set,$.set(y.name,A));for(let R of y.agents)A.add(R);}let c=new Set;for(let y of w){let A=$.get(y);if(A)for(let R of A)c.add(R);}let g=Array.from(c);if(g.length===0){console.log("No installed agents match the filter for the selected skill(s).");return}if(!t.yes){let y=l?"Global (use --project to switch)":"Project (use --global to switch)",A=g.map(D=>chunkISMGLHYS_cjs.b[D]?.displayName??D),R=D=>D.length<=5?D.join(", "):`${D.slice(0,5).join(", ")} +${D.length-5} more`;console.log(),terminal.Prompt.Log.warn(chunk5RWSXDNO_cjs.d(`About to remove ${w.length} skill(s) from ${g.length} agent(s):`)),console.log(),console.log(` ${chunk5RWSXDNO_cjs.a("Scope:")} ${y}`),console.log(` ${chunk5RWSXDNO_cjs.a("Agents ("+g.length+"):")}`),console.log(` ${terminal.Symbol.colorize(terminal.Symbol.bar.bullet,"error")} ${R(A)}`),console.log(` ${chunk5RWSXDNO_cjs.a("Skills ("+w.length+"):")}`);for(let D of w)console.log(` ${chunk5RWSXDNO_cjs.b("\u2022")} ${D}`);console.log(),console.log(chunk5RWSXDNO_cjs.a(" Each skill will be uninstalled from every targeted agent.")),console.log();let O=await terminal.Prompt.confirm({message:"Continue? (y/N)"});(terminal.Prompt.isCancel(O)||!O)&&terminal.Prompt.cancel("Removal cancelled");}u.start("Removing skills...");let m=[];for(let y of w)try{let A=chunkUGHF4GOW_cjs.o(y,{global:l,cwd:o});for(let le of g){let X=chunkISMGLHYS_cjs.b[le],ve=chunkUGHF4GOW_cjs.m(y,le,{global:l,cwd:o}),Ae=new Set([ve]),he=chunkUGHF4GOW_cjs.d(y);if(l&&X.globalSkillsDir)Ae.add(path.join(X.globalSkillsDir,he));else if(Ae.add(path.join(o,X.skillsDir,he)),le==="eve")for(let Le of chunkISMGLHYS_cjs.f(o))Ae.add(path.join(chunkUGHF4GOW_cjs.f(Le,o),he));for(let Le of Ae)if(Le!==A)try{await promises.lstat(Le).catch(()=>null)&&await promises.rm(Le,{recursive:!0,force:!0});}catch(Ye){terminal.Prompt.Log.warn(`Could not remove skill from ${X.displayName}: ${Ye instanceof Error?Ye.message:String(Ye)}`);}}let O=(await chunkISMGLHYS_cjs.c()).filter(le=>!g.includes(le)),D=!1;for(let le of O){let X=chunkUGHF4GOW_cjs.m(y,le,{global:l,cwd:o});if(await promises.lstat(X).catch(()=>null)){D=!0;break}}D||await promises.rm(A,{recursive:!0,force:!0});let N=l?await chunk5RWSXDNO_cjs.t(y):null,F=await ei(y),V=F?(await chunkJCOXRETY_cjs.S()).markets[F.marketId]:void 0,Q=V?.url??N?.source??"local",we=V?.type??N?.sourceType??"local";l?await chunk5RWSXDNO_cjs.s(y):await chunkJCOXRETY_cjs.w(y,o),m.push({skill:y,success:!0,source:Q,sourceType:we,...F?.marketId&&{sourceKey:F.marketId},...V?.storePath&&{storePath:V.storePath}});}catch(A){m.push({skill:y,success:false,error:A instanceof Error?A.message:String(A)});}u.stop("Removal process complete");let S=m.filter(y=>y.success),v=m.filter(y=>!y.success);if(S.length>0){let y=new Map;for(let A of S){let R=A.source||"local",O=y.get(R)||{skills:[]};O.skills.push(A.skill),O.sourceType=A.sourceType,y.set(R,O);}for(let[A,R]of y)chunkQ2MOP5ZW_cjs.d({event:"remove",source:A,skills:R.skills.join(","),agents:g.join(","),...l&&{global:"1"},sourceType:R.sourceType});}let T=l?"Global Skills":"Project Skills";if(t.json){J(B({scope:l?"global":"project",successful:S.map(y=>({skill:y.skill,source:y.source,sourceType:y.sourceType,...y.sourceKey&&{sourceKey:y.sourceKey},...y.storePath&&{storePath:y.storePath}})),failed:v.map(y=>({skill:y.skill,error:y.error})),summary:{total:m.length,removed:S.length,failed:v.length,agents:g}},{count:m.length,scope:l?"global":"project",removed:S.length,failed:v.length,agents:g.length}));return}let j=[];j.push(` ${chunk5RWSXDNO_cjs.a(chunk5RWSXDNO_cjs.f(T))}`);for(let y of S)j.push(` ${chunk5RWSXDNO_cjs.c("\u2713")} ${y.skill}`);if(S.length>0&&(j.push(""),j.push(`${terminal.Symbol.statusIcon("success")} Successfully removed ${S.length} skill(s)`)),v.length>0){j.push(""),j.push(`${terminal.Symbol.statusIcon("error")} Failed to remove ${v.length} skill(s)`);for(let y of v)j.push(` ${terminal.Symbol.statusIcon("error")} ${y.skill}: ${y.error}`);}q(j,{title:`${T} Removal${S.length>0?` (${S.length} removed)`:""}`,outro:chunk5RWSXDNO_cjs.c("Done!")});}async function ei(e){return (await chunkJCOXRETY_cjs.X(e))[0]}function Hl(e){let t={},s=[];for(let n=0;n<e.length;n++){let l=e[n];if(l==="-g"||l==="--global")t.global=true;else if(l==="-y"||l==="--yes")t.yes=true;else if(l==="--all")t.all=true;else if(l==="--json")t.json=true;else if(l==="-a"||l==="--agent"){t.agent=t.agent||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.agent.push(o),n++,o=e[n];n--;}else if(l==="-s"||l==="--skill"){t.skill=t.skill||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.skill.push(o),n++,o=e[n];n--;}else l&&!l.startsWith("-")&&s.push(l);}return {skills:s,options:t}}function oi(e){let t={};for(let s=0;s<e.length;s++){let n=e[s];if(n==="-g"||n==="--global")t.global=true;else if(n==="-p"||n==="--project")t.project=true;else if(n==="-y"||n==="--yes")t.yes=true;else if(n==="--all")t.all=true;else if(n==="--json")t.json=true;else if(n==="-a"||n==="--agent")for(t.agent=t.agent??[];s+1<e.length&&!e[s+1].startsWith("-");)t.agent.push(e[++s]);}return t}function ii(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":("both")}function ri(e,t,s){let n=chunkISMGLHYS_cjs.b[e];if(t){if(n.globalSkillsDir!==void 0)return n.globalSkillsDir;let l=chunkGWUDKZEH_cjs.a("os").homedir();return utils.Filesystem.join(l,n.skillsDir)}return utils.Filesystem.join(s,n.skillsDir)}async function Wl(e,t={}){let s=t.cwd??process.cwd(),n=oi(e),l=ii(n),o=n.agent??["*"],r=o.includes("*")?null:new Set(o),u=l==="both"?["project","global"]:[l],p=[];for(let c of u){let g=chunkISMGLHYS_cjs.i(c);for(let m of g){if(m==="eve"||r&&!r.has(m))continue;let S=c==="global";try{let v=ri(m,S,s);p.push({agent:m,isGlobal:S,baseDir:v});}catch{}}}let d=[];for(let c of p){let g;try{g=fs$1.readdirSync(c.baseDir);}catch{continue}for(let m of g){if(m.startsWith("."))continue;let S=utils.Filesystem.join(c.baseDir,m),v;try{v=fs$1.lstatSync(S);}catch{continue}if(!v.isSymbolicLink())continue;let T;try{T=fs$1.realpathSync(S);}catch{T="<unreadable>";}T==="<unreadable>"&&d.push({agent:c.agent,isGlobal:c.isGlobal,baseDir:c.baseDir,name:m,target:T});}}if(n.json){J(B({scope:l,targets:p.length,dangling:d.map(c=>({agent:c.agent,scope:c.isGlobal?"global":"project",name:c.name,baseDir:c.baseDir,target:c.target}))},{scope:l,targets:p.length,danglingCount:d.length}));return}if(d.length===0){q([`${U}No dangling symlinks found across ${p.length} baseDir(s).${i}`],{emptyTitle:"Doctor check",outro:`${a}All symlinks are healthy.${i}`});return}let h=[];for(let c of d){let g=c.isGlobal?"global":"project";h.push(` ${U}${c.name}${i} ${a}(${c.agent} \xB7 ${g})${i}`),h.push(` ${a}${c.baseDir}${i}`),h.push(` ${a}\u2192 ${c.target}${i}`);}if(n.yes!==true&&!process.stdin.isTTY){q(h,{title:`Doctor check: ${d.length} dangling symlink(s) found`,outro:`${a}Skipping cleanup (non-TTY environment; re-run with --yes to clean, or use a TTY).${i}`});return}let{Prompt:f}=await import('@easbot/terminal');if(!await f.confirm({message:`Unlink these ${d.length} dangling symlink(s)?`,initialValue:true})){q(h,{title:`Doctor check: ${d.length} dangling symlink(s) found`,outro:`${a}Skipped cleanup.${i}`});return}let w=0,$=0;for(let c of d){let g=utils.Filesystem.join(c.baseDir,c.name);try{fs$1.unlinkSync(g);let m=c.isGlobal?"global":"project";h.push(` ${U}\u2713 unlinked ${c.name}${i} ${a}(${c.agent} \xB7 ${m})${i}`),w++;}catch(m){let S=m instanceof Error?m.message:String(m);h.push(` ${a}\u2717 failed ${c.name}: ${S}${i}`),$++;}}if(n.json){J(B({scope:l,targets:p.length,dangling:d.map(c=>({agent:c.agent,scope:c.isGlobal?"global":"project",name:c.name,baseDir:c.baseDir,target:c.target,unlinked:true})),cleanup:{removed:w,failed:$}},{scope:l,targets:p.length,danglingCount:d.length,removed:w,failed:$}));return}q(h,{title:`Doctor check: ${w} unlinked, ${$} failed`,outro:`${U}Done!${i}`});}var hi=new Set(["metadata.json"]),ki=new Set([".git","__pycache__","__pypackages__"]),bs={"claude-code":{command:"claude",args:[]},codex:{command:"codex",args:[]}},Zl=Object.keys(bs);function Ql(e){let t=[],s={},n=[];for(let l=0;l<e.length;l++){let o=e[l];if(o)if(o==="--help"||o==="-h")s.help=true;else if(o==="--json")s.json=true;else if(o==="--full-depth")s.fullDepth=true;else if(o==="--dangerously-accept-openclaw-risks")s.dangerouslyAcceptOpenclawRisks=true;else if(o==="--skill"||o==="-s"){let r=e[l+1];!r||r.startsWith("-")?n.push(`${o} requires a skill name`):s.skill?(n.push("Only one --skill value can be provided"),l++):(s.skill=r,l++);}else if(o==="--agent"||o==="-a"){s.agent=s.agent||[],l++;let r=e[l],u=s.agent.length;for(;l<e.length&&r&&!r.startsWith("-");)s.agent.push(r),l++,r=e[l];s.agent.length===u&&n.push(`${o} requires an agent name`),l--;}else o.startsWith("-")?n.push(`Unknown option: ${o}`):t.push(o);}return n.push(...Ai(s.agent)),{source:t,options:s,errors:n}}function yi(e){let t=["You are being given a Skill to execute for the user's next request.","Use the following SKILL.md as your instructions:",`<SKILL.md>
56
+ `),process.exit(1));}let w=[];if(t.all)w=C;else if(e.length>0||t.skill&&t.skill.length>0){let y=[...e];if(t.skill&&t.skill.length>0){let A=chunkHOK3SUH4_cjs.E(t.skill,C);if(A.wildcard)w=C;else for(let R of A.matched)y.push(R);}if(w.length===0){let A=new Set;w=[];for(let R of y){let O=C.find(D=>D.toLowerCase()===R.toLowerCase());O&&!A.has(O)&&(A.add(O),w.push(O));}}if(w.length===0){console.log(`No matching skills found for: ${y.join(", ")}`);return}}else {let y=C.map(R=>({value:R,label:R})),A=await terminal.Prompt.multiselect({message:`Select skills to remove ${chunkBWDTT6SA_cjs.a("(space to toggle)")}`,options:y,required:true});terminal.Prompt.isCancel(A)&&terminal.Prompt.cancel("Removal cancelled"),w=A;}let $=new Map;for(let y of h){let A=$.get(y.name);A||(A=new Set,$.set(y.name,A));for(let R of y.agents)A.add(R);}let c=new Set;for(let y of w){let A=$.get(y);if(A)for(let R of A)c.add(R);}let g=Array.from(c);if(g.length===0){console.log("No installed agents match the filter for the selected skill(s).");return}if(!t.yes){let y=l?"Global (use --project to switch)":"Project (use --global to switch)",A=g.map(D=>chunkJUNIAQ2A_cjs.b[D]?.displayName??D),R=D=>D.length<=5?D.join(", "):`${D.slice(0,5).join(", ")} +${D.length-5} more`;console.log(),terminal.Prompt.Log.warn(chunkBWDTT6SA_cjs.d(`About to remove ${w.length} skill(s) from ${g.length} agent(s):`)),console.log(),console.log(` ${chunkBWDTT6SA_cjs.a("Scope:")} ${y}`),console.log(` ${chunkBWDTT6SA_cjs.a("Agents ("+g.length+"):")}`),console.log(` ${terminal.Symbol.colorize(terminal.Symbol.bar.bullet,"error")} ${R(A)}`),console.log(` ${chunkBWDTT6SA_cjs.a("Skills ("+w.length+"):")}`);for(let D of w)console.log(` ${chunkBWDTT6SA_cjs.b("\u2022")} ${D}`);console.log(),console.log(chunkBWDTT6SA_cjs.a(" Each skill will be uninstalled from every targeted agent.")),console.log();let O=await terminal.Prompt.confirm({message:"Continue? (y/N)"});(terminal.Prompt.isCancel(O)||!O)&&terminal.Prompt.cancel("Removal cancelled");}p.start("Removing skills...");let m=[];for(let y of w)try{let A=chunkIJI72D6W_cjs.o(y,{global:l,cwd:o});for(let le of g){let X=chunkJUNIAQ2A_cjs.b[le],ve=chunkIJI72D6W_cjs.m(y,le,{global:l,cwd:o}),Ae=new Set([ve]),he=chunkIJI72D6W_cjs.d(y);if(l&&X.globalSkillsDir)Ae.add(path.join(X.globalSkillsDir,he));else if(Ae.add(path.join(o,X.skillsDir,he)),le==="eve")for(let Te of chunkJUNIAQ2A_cjs.f(o))Ae.add(path.join(chunkIJI72D6W_cjs.f(Te,o),he));for(let Te of Ae)if(Te!==A)try{await promises.lstat(Te).catch(()=>null)&&await promises.rm(Te,{recursive:!0,force:!0});}catch(qe){terminal.Prompt.Log.warn(`Could not remove skill from ${X.displayName}: ${qe instanceof Error?qe.message:String(qe)}`);}}let O=(await chunkJUNIAQ2A_cjs.c()).filter(le=>!g.includes(le)),D=!1;for(let le of O){let X=chunkIJI72D6W_cjs.m(y,le,{global:l,cwd:o});if(await promises.lstat(X).catch(()=>null)){D=!0;break}}D||await promises.rm(A,{recursive:!0,force:!0});let N=l?await chunkBWDTT6SA_cjs.t(y):null,F=await ei(y),V=F?(await chunkHOK3SUH4_cjs.S()).markets[F.marketId]:void 0,Q=V?.url??N?.source??"local",we=V?.type??N?.sourceType??"local";l?await chunkBWDTT6SA_cjs.s(y):await chunkHOK3SUH4_cjs.w(y,o),m.push({skill:y,success:!0,source:Q,sourceType:we,...F?.marketId&&{sourceKey:F.marketId},...V?.storePath&&{storePath:V.storePath}});}catch(A){m.push({skill:y,success:false,error:A instanceof Error?A.message:String(A)});}p.stop("Removal process complete");let S=m.filter(y=>y.success),v=m.filter(y=>!y.success);if(S.length>0){let y=new Map;for(let A of S){let R=A.source||"local",O=y.get(R)||{skills:[]};O.skills.push(A.skill),O.sourceType=A.sourceType,y.set(R,O);}for(let[A,R]of y)chunkQ2MOP5ZW_cjs.d({event:"remove",source:A,skills:R.skills.join(","),agents:g.join(","),...l&&{global:"1"},sourceType:R.sourceType});}let L=l?"Global Skills":"Project Skills";if(t.json){J(z({scope:l?"global":"project",successful:S.map(y=>({skill:y.skill,source:y.source,sourceType:y.sourceType,...y.sourceKey&&{sourceKey:y.sourceKey},...y.storePath&&{storePath:y.storePath}})),failed:v.map(y=>({skill:y.skill,error:y.error})),summary:{total:m.length,removed:S.length,failed:v.length,agents:g}},{count:m.length,scope:l?"global":"project",removed:S.length,failed:v.length,agents:g.length}));return}let j=[];j.push(` ${chunkBWDTT6SA_cjs.a(chunkBWDTT6SA_cjs.f(L))}`);for(let y of S)j.push(` ${chunkBWDTT6SA_cjs.c("\u2713")} ${y.skill}`);if(S.length>0&&(j.push(""),j.push(`${terminal.Symbol.statusIcon("success")} Successfully removed ${S.length} skill(s)`)),v.length>0){j.push(""),j.push(`${terminal.Symbol.statusIcon("error")} Failed to remove ${v.length} skill(s)`);for(let y of v)j.push(` ${terminal.Symbol.statusIcon("error")} ${y.skill}: ${y.error}`);}q(j,{title:`${L} Removal${S.length>0?` (${S.length} removed)`:""}`,outro:chunkBWDTT6SA_cjs.c("Done!")});}async function ei(e){return (await chunkHOK3SUH4_cjs.X(e))[0]}function Hl(e){let t={},s=[];for(let n=0;n<e.length;n++){let l=e[n];if(l==="-g"||l==="--global")t.global=true;else if(l==="-y"||l==="--yes")t.yes=true;else if(l==="--all")t.all=true;else if(l==="--json")t.json=true;else if(l==="-a"||l==="--agent"){t.agent=t.agent||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.agent.push(o),n++,o=e[n];n--;}else if(l==="-s"||l==="--skill"){t.skill=t.skill||[],n++;let o=e[n];for(;n<e.length&&o&&!o.startsWith("-");)t.skill.push(o),n++,o=e[n];n--;}else l&&!l.startsWith("-")&&s.push(l);}return {skills:s,options:t}}function oi(e){let t={};for(let s=0;s<e.length;s++){let n=e[s];if(n==="-g"||n==="--global")t.global=true;else if(n==="-p"||n==="--project")t.project=true;else if(n==="-y"||n==="--yes")t.yes=true;else if(n==="--all")t.all=true;else if(n==="--json")t.json=true;else if(n==="-a"||n==="--agent")for(t.agent=t.agent??[];s+1<e.length&&!e[s+1].startsWith("-");)t.agent.push(e[++s]);}return t}function ii(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":("both")}function ri(e,t,s){let n=chunkJUNIAQ2A_cjs.b[e];if(t){if(n.globalSkillsDir!==void 0)return n.globalSkillsDir;let l=chunkBWPPLYIF_cjs.a("os").homedir();return utils.Filesystem.join(l,n.skillsDir)}return utils.Filesystem.join(s,n.skillsDir)}async function Wl(e,t={}){let s=t.cwd??process.cwd(),n=oi(e),l=ii(n),o=n.agent??["*"],r=o.includes("*")?null:new Set(o),p=l==="both"?["project","global"]:[l],u=[];for(let c of p){let g=chunkJUNIAQ2A_cjs.i(c);for(let m of g){if(m==="eve"||r&&!r.has(m))continue;let S=c==="global";try{let v=ri(m,S,s);u.push({agent:m,isGlobal:S,baseDir:v});}catch{}}}let d=[];for(let c of u){let g;try{g=fs$1.readdirSync(c.baseDir);}catch{continue}for(let m of g){if(m.startsWith("."))continue;let S=utils.Filesystem.join(c.baseDir,m),v;try{v=fs$1.lstatSync(S);}catch{continue}if(!v.isSymbolicLink())continue;let L;try{L=fs$1.realpathSync(S);}catch{L="<unreadable>";}L==="<unreadable>"&&d.push({agent:c.agent,isGlobal:c.isGlobal,baseDir:c.baseDir,name:m,target:L});}}if(n.json){J(z({scope:l,targets:u.length,dangling:d.map(c=>({agent:c.agent,scope:c.isGlobal?"global":"project",name:c.name,baseDir:c.baseDir,target:c.target}))},{scope:l,targets:u.length,danglingCount:d.length}));return}if(d.length===0){q([`${U}No dangling symlinks found across ${u.length} baseDir(s).${i}`],{emptyTitle:"Doctor check",outro:`${a}All symlinks are healthy.${i}`});return}let h=[];for(let c of d){let g=c.isGlobal?"global":"project";h.push(` ${U}${c.name}${i} ${a}(${c.agent} \xB7 ${g})${i}`),h.push(` ${a}${c.baseDir}${i}`),h.push(` ${a}\u2192 ${c.target}${i}`);}if(n.yes!==true&&!process.stdin.isTTY){q(h,{title:`Doctor check: ${d.length} dangling symlink(s) found`,outro:`${a}Skipping cleanup (non-TTY environment; re-run with --yes to clean, or use a TTY).${i}`});return}let{Prompt:f}=await import('@easbot/terminal');if(!await f.confirm({message:`Unlink these ${d.length} dangling symlink(s)?`,initialValue:true})){q(h,{title:`Doctor check: ${d.length} dangling symlink(s) found`,outro:`${a}Skipped cleanup.${i}`});return}let w=0,$=0;for(let c of d){let g=utils.Filesystem.join(c.baseDir,c.name);try{fs$1.unlinkSync(g);let m=c.isGlobal?"global":"project";h.push(` ${U}\u2713 unlinked ${c.name}${i} ${a}(${c.agent} \xB7 ${m})${i}`),w++;}catch(m){let S=m instanceof Error?m.message:String(m);h.push(` ${a}\u2717 failed ${c.name}: ${S}${i}`),$++;}}if(n.json){J(z({scope:l,targets:u.length,dangling:d.map(c=>({agent:c.agent,scope:c.isGlobal?"global":"project",name:c.name,baseDir:c.baseDir,target:c.target,unlinked:true})),cleanup:{removed:w,failed:$}},{scope:l,targets:u.length,danglingCount:d.length,removed:w,failed:$}));return}q(h,{title:`Doctor check: ${w} unlinked, ${$} failed`,outro:`${U}Done!${i}`});}var hi=new Set(["metadata.json"]),ki=new Set([".git","__pycache__","__pypackages__"]),bs={"claude-code":{command:"claude",args:[]},codex:{command:"codex",args:[]}},Zl=Object.keys(bs);function Ql(e){let t=[],s={},n=[];for(let l=0;l<e.length;l++){let o=e[l];if(o)if(o==="--help"||o==="-h")s.help=true;else if(o==="--json")s.json=true;else if(o==="--full-depth")s.fullDepth=true;else if(o==="--dangerously-accept-openclaw-risks")s.dangerouslyAcceptOpenclawRisks=true;else if(o==="--skill"||o==="-s"){let r=e[l+1];!r||r.startsWith("-")?n.push(`${o} requires a skill name`):s.skill?(n.push("Only one --skill value can be provided"),l++):(s.skill=r,l++);}else if(o==="--agent"||o==="-a"){s.agent=s.agent||[],l++;let r=e[l],p=s.agent.length;for(;l<e.length&&r&&!r.startsWith("-");)s.agent.push(r),l++,r=e[l];s.agent.length===p&&n.push(`${o} requires an agent name`),l--;}else o.startsWith("-")?n.push(`Unknown option: ${o}`):t.push(o);}return n.push(...Ai(s.agent)),{source:t,options:s,errors:n}}function yi(e){let t=["You are being given a Skill to execute for the user's next request.","Use the following SKILL.md as your instructions:",`<SKILL.md>
57
57
  ${e.skillMd}
58
58
  </SKILL.md>`];return e.hasSupportingFiles&&e.supportDir&&t.push(`Supporting files for this skill were downloaded to:
59
59
  ${e.supportDir}
@@ -61,11 +61,11 @@ ${e.supportDir}
61
61
  When the SKILL.md references relative paths, read them from that directory.`),t.join(`
62
62
 
63
63
  `)+`
64
- `}async function $i(e){let t=await promises.mkdtemp(path.join(os.tmpdir(),"skills-use-")),s=path.join(t,chunkUGHF4GOW_cjs.d(e.directoryName||e.name));if(!Ss(t,s))throw new Error("Invalid skill name: potential path traversal detected");await promises.mkdir(s,{recursive:true}),e.kind==="blob"?await xi(s,e.files):e.kind==="well-known"?await Ti(s,e.files):await on(e.path,s);let n=e.rawContent??await promises.readFile(path.join(s,"SKILL.md"),"utf-8"),l=await rn(s,s);return {tempRoot:t,skillDir:s,skillMd:n,hasSupportingFiles:l}}async function en(e,t={},s=[]){let n=null;try{if(t.help){console.log(Yl());return}s.length>0&&Ce(s.join(`
65
- `)),e.length===0&&Ce(`Missing required argument: source
64
+ `}async function $i(e){let t=await promises.mkdtemp(path.join(os.tmpdir(),"skills-use-")),s=path.join(t,chunkIJI72D6W_cjs.d(e.directoryName||e.name));if(!Ss(t,s))throw new Error("Invalid skill name: potential path traversal detected");await promises.mkdir(s,{recursive:true}),e.kind==="blob"?await xi(s,e.files):e.kind==="well-known"?await Li(s,e.files):await on(e.path,s);let n=e.rawContent??await promises.readFile(path.join(s,"SKILL.md"),"utf-8"),l=await rn(s,s);return {tempRoot:t,skillDir:s,skillMd:n,hasSupportingFiles:l}}async function en(e,t={},s=[]){let n=null;try{if(t.help){console.log(Yl());return}s.length>0&&Re(s.join(`
65
+ `)),e.length===0&&Re(`Missing required argument: source
66
66
 
67
- ${Yl()}`),e.length>1&&Ce(`Expected one source, received ${e.length}: ${e.join(", ")}`);let l=t.agent?.[0];l&&!bs[l]&&Ce(ln(l));let o=e[0],r=chunkJCOXRETY_cjs.e(o);chunkJCOXRETY_cjs.a(r)?.split("/")[0]?.toLowerCase()==="openclaw"&&!t.dangerouslyAcceptOpenclawRisks&&Ce(["OpenClaw skills are unverified community submissions.","Skills run with full agent permissions and could be malicious.",`If you understand the risks, re-run with: skills use ${o} --dangerously-accept-openclaw-risks`].join(`
68
- `));let d=t.skill,h=!!(d||t.fullDepth||r.subpath),f;if(r.type==="well-known"){let $=await chunkJCOXRETY_cjs.n.fetchAllSkills(r.url);f=vi($,d,o);}else {let $,c=null;if(r.type==="local")fs$1.existsSync(r.localPath)||Ce(`Local path does not exist: ${r.localPath}`),$=await chunkJCOXRETY_cjs.A(r.localPath,r.subpath,{includeInternal:h,fullDepth:t.fullDepth});else if(r.type==="github"&&!t.fullDepth){let m=chunkJCOXRETY_cjs.a(r),S=m?.split("/")[0]?.toLowerCase();m&&S&&chunkDNE3XPCJ_cjs.d.includes(S)&&(c=await chunkDNE3XPCJ_cjs.l(m,{subpath:r.subpath,ref:r.ref,getToken:chunk5RWSXDNO_cjs.p,includeInternal:h})),c?$=c.skills:(n=await chunkJCOXRETY_cjs.k(r.url,r.ref),$=await chunkJCOXRETY_cjs.A(n,r.subpath,{includeInternal:h,fullDepth:t.fullDepth}));}else n=await chunkJCOXRETY_cjs.k(r.url,r.ref),$=await chunkJCOXRETY_cjs.A(n,r.subpath,{includeInternal:h,fullDepth:t.fullDepth});let g=wi($,d,o);c&&Li(g)?f={kind:"blob",name:g.name,directoryName:g.name,rawContent:g.rawContent??Ii(g.files),files:g.files}:f={kind:"disk",name:g.name,directoryName:g.name,rawContent:g.rawContent,path:g.path};}let C=await $i(f);await ql(n),n=null;let w=yi({skillMd:C.skillMd,supportDir:C.skillDir,hasSupportingFiles:C.hasSupportingFiles});if(t.json&&!l){J(B({skill:f.name,source:e[0],agent:l??null,tempRoot:C.tempRoot,skillDir:C.skillDir,prompt:w},{kind:f.kind}));return}if(l){let $=await bi(l,w);$!==0&&process.exit($);return}process.stdout.write(w);}catch(l){await ql(n),l instanceof chunkJCOXRETY_cjs.g&&Ce(l.message),l instanceof Se&&Ce(l.message),Ce(l instanceof Error?l.message:"Unknown error");}}async function bi(e,t,s=Si){let n=bs[e];if(!n)throw new Se(ln(e));return new Promise((l,o)=>{let r=s(n.command,[...n.args,t],{stdio:"inherit"}),u=false;r.on("error",p=>{if(!u){if(u=true,p.code==="ENOENT"){o(new Se(`Could not launch ${chunkISMGLHYS_cjs.b[e].displayName}: command not found: ${n.command}`));return}o(p);}}),r.on("close",p=>{u||(u=true,l(p??1));});})}function Si(e,t){return child_process.spawn(e,t,{stdio:"inherit"})}function Yl(){return `Usage: skills use <source>[@<skill>] [options]
67
+ ${Yl()}`),e.length>1&&Re(`Expected one source, received ${e.length}: ${e.join(", ")}`);let l=t.agent?.[0];l&&!bs[l]&&Re(ln(l));let o=e[0],r=chunkHOK3SUH4_cjs.e(o);chunkHOK3SUH4_cjs.a(r)?.split("/")[0]?.toLowerCase()==="openclaw"&&!t.dangerouslyAcceptOpenclawRisks&&Re(["OpenClaw skills are unverified community submissions.","Skills run with full agent permissions and could be malicious.",`If you understand the risks, re-run with: skills use ${o} --dangerously-accept-openclaw-risks`].join(`
68
+ `));let d=t.skill,h=!!(d||t.fullDepth||r.subpath),f;if(r.type==="well-known"){let $=await chunkHOK3SUH4_cjs.n.fetchAllSkills(r.url);f=vi($,d,o);}else {let $,c=null;if(r.type==="local")fs$1.existsSync(r.localPath)||Re(`Local path does not exist: ${r.localPath}`),$=await chunkHOK3SUH4_cjs.A(r.localPath,r.subpath,{includeInternal:h,fullDepth:t.fullDepth});else if(r.type==="github"&&!t.fullDepth){let m=chunkHOK3SUH4_cjs.a(r),S=m?.split("/")[0]?.toLowerCase();m&&S&&chunkDNE3XPCJ_cjs.d.includes(S)&&(c=await chunkDNE3XPCJ_cjs.l(m,{subpath:r.subpath,ref:r.ref,getToken:chunkBWDTT6SA_cjs.p,includeInternal:h})),c?$=c.skills:(n=await chunkHOK3SUH4_cjs.k(r.url,r.ref),$=await chunkHOK3SUH4_cjs.A(n,r.subpath,{includeInternal:h,fullDepth:t.fullDepth}));}else n=await chunkHOK3SUH4_cjs.k(r.url,r.ref),$=await chunkHOK3SUH4_cjs.A(n,r.subpath,{includeInternal:h,fullDepth:t.fullDepth});let g=wi($,d,o);c&&Ti(g)?f={kind:"blob",name:g.name,directoryName:g.name,rawContent:g.rawContent??Ii(g.files),files:g.files}:f={kind:"disk",name:g.name,directoryName:g.name,rawContent:g.rawContent,path:g.path};}let C=await $i(f);await ql(n),n=null;let w=yi({skillMd:C.skillMd,supportDir:C.skillDir,hasSupportingFiles:C.hasSupportingFiles});if(t.json&&!l){J(z({skill:f.name,source:e[0],agent:l??null,tempRoot:C.tempRoot,skillDir:C.skillDir,prompt:w},{kind:f.kind}));return}if(l){let $=await bi(l,w);$!==0&&process.exit($);return}process.stdout.write(w);}catch(l){await ql(n),l instanceof chunkHOK3SUH4_cjs.g&&Re(l.message),l instanceof Se&&Re(l.message),Re(l instanceof Error?l.message:"Unknown error");}}async function bi(e,t,s=Si){let n=bs[e];if(!n)throw new Se(ln(e));return new Promise((l,o)=>{let r=s(n.command,[...n.args,t],{stdio:"inherit"}),p=false;r.on("error",u=>{if(!p){if(p=true,u.code==="ENOENT"){o(new Se(`Could not launch ${chunkJUNIAQ2A_cjs.b[e].displayName}: command not found: ${n.command}`));return}o(u);}}),r.on("close",u=>{p||(p=true,l(u??1));});})}function Si(e,t){return child_process.spawn(e,t,{stdio:"inherit"})}function Yl(){return `Usage: skills use <source>[@<skill>] [options]
69
69
 
70
70
  Generate a prompt for using one skill without installing it.
71
71
 
@@ -80,13 +80,13 @@ Options:
80
80
  Examples:
81
81
  skills use houjallen/agent-skills@web-design-guidelines | claude
82
82
  skills use houjallen/agent-skills --skill web-design-guidelines --agent claude-code
83
- skills use houjallen/agent-skills@web-design-guidelines --agent codex`}function wi(e,t,s){if(e.length===0)throw new Se("No valid skills found. Skills require a SKILL.md with name and description.");if(!t){if(e.length===1)return e[0];throw new Se(tn(s,e.map(chunkJCOXRETY_cjs.B)))}let n=chunkJCOXRETY_cjs.C(e,[t]);if(n.length===0)throw new Se(sn(t,e.map(chunkJCOXRETY_cjs.B)));if(n.length>1)throw new Se(`Skill selector "${t}" matched multiple skills.`);return n[0]}function vi(e,t,s){if(e.length===0)throw new Se("No skills found at this URL. Make sure the server has a /.well-known/agent-skills/index.json or /.well-known/skills/index.json file.");let n;if(t){if(n=e.filter(o=>o.installName.toLowerCase()===t.toLowerCase()||o.name.toLowerCase()===t.toLowerCase()),n.length===0)throw new Se(sn(t,e.map(o=>o.installName)));if(n.length>1)throw new Se(`Skill selector "${t}" matched multiple skills.`)}else {if(e.length!==1)throw new Se(tn(s,e.map(o=>o.installName)));n=e;}let l=n[0];return {kind:"well-known",name:l.name,directoryName:l.installName,rawContent:l.content,files:l.files}}function tn(e,t){return ["This source contains multiple skills. Specify exactly one skill:",...t.map(s=>` - ${s}`),"",`Examples:
83
+ skills use houjallen/agent-skills@web-design-guidelines --agent codex`}function wi(e,t,s){if(e.length===0)throw new Se("No valid skills found. Skills require a SKILL.md with name and description.");if(!t){if(e.length===1)return e[0];throw new Se(tn(s,e.map(chunkHOK3SUH4_cjs.B)))}let n=chunkHOK3SUH4_cjs.C(e,[t]);if(n.length===0)throw new Se(sn(t,e.map(chunkHOK3SUH4_cjs.B)));if(n.length>1)throw new Se(`Skill selector "${t}" matched multiple skills.`);return n[0]}function vi(e,t,s){if(e.length===0)throw new Se("No skills found at this URL. Make sure the server has a /.well-known/agent-skills/index.json or /.well-known/skills/index.json file.");let n;if(t){if(n=e.filter(o=>o.installName.toLowerCase()===t.toLowerCase()||o.name.toLowerCase()===t.toLowerCase()),n.length===0)throw new Se(sn(t,e.map(o=>o.installName)));if(n.length>1)throw new Se(`Skill selector "${t}" matched multiple skills.`)}else {if(e.length!==1)throw new Se(tn(s,e.map(o=>o.installName)));n=e;}let l=n[0];return {kind:"well-known",name:l.name,directoryName:l.installName,rawContent:l.content,files:l.files}}function tn(e,t){return ["This source contains multiple skills. Specify exactly one skill:",...t.map(s=>` - ${s}`),"",`Examples:
84
84
  skills use ${e}@${t[0]??"<skill>"}
85
85
  skills use ${e} --skill ${t[0]??"<skill>"}`].join(`
86
86
  `)}function sn(e,t){return [`No matching skill found for: ${e}`,"Available skills:",...t.map(s=>` - ${s}`)].join(`
87
- `)}function Ai(e){if(!e||e.length===0)return [];let t=[];e.includes("*")&&t.push("skills use --agent does not support '*'; specify exactly one agent."),e.length>1&&t.push("skills use --agent accepts exactly one agent.");let s=chunkISMGLHYS_cjs.p(e);if(s.length>0){let n=Object.keys(chunkISMGLHYS_cjs.b);t.push(`Invalid agents: ${s.join(", ")}
88
- Valid agents: ${n.join(", ")}`);}return t}function ln(e){return [`Running ${chunkISMGLHYS_cjs.b[e].displayName} is not supported yet.`,`Supported agents for skills use --agent: ${Zl.join(", ")}`].join(`
89
- `)}async function xi(e,t){for(let s of t)await nn(e,s.path,s.contents);}async function Ti(e,t){for(let[s,n]of t)await nn(e,s,n);}async function nn(e,t,s){let n=path.join(e,t);Ss(e,n)&&(await promises.mkdir(path.dirname(n),{recursive:true}),typeof s=="string"?await promises.writeFile(n,s,"utf-8"):await promises.writeFile(n,s));}async function on(e,t){await promises.mkdir(t,{recursive:true});let s=await promises.readdir(e,{withFileTypes:true});await Promise.all(s.filter(n=>!ji(n.name,n.isDirectory())).map(async n=>{let l=path.join(e,n.name),o=path.join(t,n.name);if(Ss(t,o)){if(n.isDirectory()){await on(l,o);return}try{await promises.cp(l,o,{dereference:!0,recursive:!0});}catch(r){if(r instanceof Error&&"code"in r&&r.code==="ENOENT"&&n.isSymbolicLink()){console.error(`Skipping broken symlink: ${l}`);return}throw r}}}));}async function rn(e,t){let s=await promises.readdir(t,{withFileTypes:true});for(let n of s){let l=path.join(t,n.name),o=path.relative(e,l).split(path.sep).join("/");if(n.isDirectory()){if(await rn(e,l))return true}else if(o.toLowerCase()!=="skill.md")return true}return false}function Li(e){return Array.isArray(e.files)}function Ii(e){let s=e.find(n=>n.path.toLowerCase()==="skill.md")?.contents;return s===void 0?"":typeof s=="string"?s:s.toString("utf-8")}function ji(e,t){return hi.has(e)||t&&ki.has(e)}function Ss(e,t){let s=path.normalize(path.resolve(e)),n=path.normalize(path.resolve(t));return n.startsWith(s+path.sep)||n===s}async function ql(e){e&&await chunkJCOXRETY_cjs.l(e).catch(()=>{});}function Ce(e){console.error(e),process.exit(1);}var Se=class extends Error{};var _i={"zh-CN":utils.loadTextFile("./template/skill-template-zh-CN.txt",chunkGWUDKZEH_cjs.c),"en-US":utils.loadTextFile("./template/skill-template-en-US.txt",chunkGWUDKZEH_cjs.c)};function Ci(e){return e.split(/[-_\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ri(e){return _i[e]()}var Ni=/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;function cn(e,t){let s=utils.formatLocalISO(new Date,false).slice(0,10),n={skill_name:t,skill_title:Ci(t),version:"1.0.0",date:s};return Ri(e).replace(Ni,(o,r)=>Object.hasOwn(n,r)?n[r]:o)}function Fi(e){return e&&Al(e),e??"0.0.0"}function rt(e){return utils.resolveLocaleLang(e?.locale)}function Mi(e){let t=rt(e);console.log(),console.log(`${a}${b("cli.banner.tagline",{locale:t,fallback:"easbot-skills \u2014 agent skills ecosystem"})}${i}`),console.log(),console.log(` ${a}$${i} ${U}easbot-skills add ${a}<package>${i} ${a}${b("cli.banner.cmd.add",{locale:t,vars:{cmd:"",dim:"",reset:""},fallback:"Add a new skill"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills use ${a}<package>@<skill>${i} ${a}${b("cli.banner.cmd.use",{locale:t,vars:{cmd:"",dim:"",reset:""},fallback:"Use a skill without installing"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills remove${i} ${a}${b("cli.example.remove_interactive",{locale:t,fallback:"Remove installed skills"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills list${i} ${a}${b("cli.example.list_project",{locale:t,fallback:"List installed skills"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills find ${a}[query]${i} ${a}${b("cli.example.find_interactive",{locale:t,fallback:"Search for skills"})}${i}`),console.log(),console.log(` ${a}$${i} ${U}easbot-skills update${i} ${a}${b("cli.example.update_global",{locale:t,fallback:"Update installed skills"})}${i}`),console.log(),console.log(` ${a}$${i} ${U}easbot-skills doctor${i} ${a}${b("cli.commands.doctor",{locale:t,fallback:"Check + cleanup broken links & more"})}${i}`),console.log(),console.log(` ${a}$${i} ${U}easbot-skills init ${a}[name]${i} ${a}${b("cli.example.init",{locale:t,fallback:"Create a new skill"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills store ${a}<sub>${i} ${a}${b("cli.example.store",{locale:t,fallback:"Manage store / cache sources"})}${i}`),console.log(),console.log(`${a}${b("cli.banner.try_hint",{locale:t,fallback:"try:"})}${i} easbot-skills add houjallen/agent-skills`),console.log(),console.log(`${a}${b("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}`),console.log();}function vp(e){let t=rt(e),s=(n,l)=>a+b(n,{locale:t,fallback:l})+i;console.log(`
87
+ `)}function Ai(e){if(!e||e.length===0)return [];let t=[];e.includes("*")&&t.push("skills use --agent does not support '*'; specify exactly one agent."),e.length>1&&t.push("skills use --agent accepts exactly one agent.");let s=chunkJUNIAQ2A_cjs.p(e);if(s.length>0){let n=Object.keys(chunkJUNIAQ2A_cjs.b);t.push(`Invalid agents: ${s.join(", ")}
88
+ Valid agents: ${n.join(", ")}`);}return t}function ln(e){return [`Running ${chunkJUNIAQ2A_cjs.b[e].displayName} is not supported yet.`,`Supported agents for skills use --agent: ${Zl.join(", ")}`].join(`
89
+ `)}async function xi(e,t){for(let s of t)await nn(e,s.path,s.contents);}async function Li(e,t){for(let[s,n]of t)await nn(e,s,n);}async function nn(e,t,s){let n=path.join(e,t);Ss(e,n)&&(await promises.mkdir(path.dirname(n),{recursive:true}),typeof s=="string"?await promises.writeFile(n,s,"utf-8"):await promises.writeFile(n,s));}async function on(e,t){await promises.mkdir(t,{recursive:true});let s=await promises.readdir(e,{withFileTypes:true});await Promise.all(s.filter(n=>!ji(n.name,n.isDirectory())).map(async n=>{let l=path.join(e,n.name),o=path.join(t,n.name);if(Ss(t,o)){if(n.isDirectory()){await on(l,o);return}try{await promises.cp(l,o,{dereference:!0,recursive:!0});}catch(r){if(r instanceof Error&&"code"in r&&r.code==="ENOENT"&&n.isSymbolicLink()){console.error(`Skipping broken symlink: ${l}`);return}throw r}}}));}async function rn(e,t){let s=await promises.readdir(t,{withFileTypes:true});for(let n of s){let l=path.join(t,n.name),o=path.relative(e,l).split(path.sep).join("/");if(n.isDirectory()){if(await rn(e,l))return true}else if(o.toLowerCase()!=="skill.md")return true}return false}function Ti(e){return Array.isArray(e.files)}function Ii(e){let s=e.find(n=>n.path.toLowerCase()==="skill.md")?.contents;return s===void 0?"":typeof s=="string"?s:s.toString("utf-8")}function ji(e,t){return hi.has(e)||t&&ki.has(e)}function Ss(e,t){let s=path.normalize(path.resolve(e)),n=path.normalize(path.resolve(t));return n.startsWith(s+path.sep)||n===s}async function ql(e){e&&await chunkHOK3SUH4_cjs.l(e).catch(()=>{});}function Re(e){console.error(e),process.exit(1);}var Se=class extends Error{};var _i={"zh-CN":utils.loadTextFile("./template/skill-template-zh-CN.txt",chunkBWPPLYIF_cjs.c),"en-US":utils.loadTextFile("./template/skill-template-en-US.txt",chunkBWPPLYIF_cjs.c)};function Ci(e){return e.split(/[-_\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ri(e){return _i[e]()}var Ni=/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;function cn(e,t){let s=utils.formatLocalISO(new Date,false).slice(0,10),n={skill_name:t,skill_title:Ci(t),version:"1.0.0",date:s};return Ri(e).replace(Ni,(o,r)=>Object.hasOwn(n,r)?n[r]:o)}function Fi(e){return e&&Al(e),e??"0.0.0"}function rt(e){return utils.resolveLocaleLang(e?.locale)}function Mi(e){let t=rt(e);console.log(),console.log(`${a}${b("cli.banner.tagline",{locale:t,fallback:"easbot-skills \u2014 agent skills ecosystem"})}${i}`),console.log(),console.log(` ${a}$${i} ${U}easbot-skills add ${a}<package>${i} ${a}${b("cli.banner.cmd.add",{locale:t,vars:{cmd:"",dim:"",reset:""},fallback:"Add a new skill"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills use ${a}<package>@<skill>${i} ${a}${b("cli.banner.cmd.use",{locale:t,vars:{cmd:"",dim:"",reset:""},fallback:"Use a skill without installing"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills remove${i} ${a}${b("cli.example.remove_interactive",{locale:t,fallback:"Remove installed skills"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills list${i} ${a}${b("cli.example.list_project",{locale:t,fallback:"List installed skills"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills find ${a}[query]${i} ${a}${b("cli.example.find_interactive",{locale:t,fallback:"Search for skills"})}${i}`),console.log(),console.log(` ${a}$${i} ${U}easbot-skills update${i} ${a}${b("cli.example.update_global",{locale:t,fallback:"Update installed skills"})}${i}`),console.log(),console.log(` ${a}$${i} ${U}easbot-skills doctor${i} ${a}${b("cli.commands.doctor",{locale:t,fallback:"Check + cleanup broken links & more"})}${i}`),console.log(),console.log(` ${a}$${i} ${U}easbot-skills init ${a}[name]${i} ${a}${b("cli.example.init",{locale:t,fallback:"Create a new skill"})}${i}`),console.log(` ${a}$${i} ${U}easbot-skills store ${a}<sub>${i} ${a}${b("cli.example.store",{locale:t,fallback:"Manage store / cache sources"})}${i}`),console.log(),console.log(`${a}${b("cli.banner.try_hint",{locale:t,fallback:"try:"})}${i} easbot-skills add houjallen/agent-skills`),console.log(),console.log(`${a}${b("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}`),console.log();}function vp(e){let t=rt(e),s=(n,l)=>a+b(n,{locale:t,fallback:l})+i;console.log(`
90
90
  ${G}${b("cli.help.usage",{locale:t,fallback:"Usage: skills <command> [options]"})}${i}
91
91
 
92
92
  ${G}${b("cli.help.section.manage",{locale:t,fallback:"Manage Skills"})}${i}:
@@ -259,7 +259,7 @@ ${G}Examples:${i}
259
259
  ${a}$${i} easbot-skills remove --skill '*' -a cursor ${a}# ${b("cli.example.remove_agent_all",{locale:t,fallback:"Remove all skills from one agent"})}${i}
260
260
 
261
261
  ${a}${b("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}
262
- `);}function ws(){console.log();}function Hi(e,t){let s=rt(t),n=t?.cwd??chunkXGUPIAAF_cjs.p()??process.cwd(),l=e[0]||utils.Filesystem.basename(n),o=e[0]!==void 0,r=e.includes("--json"),u=o?utils.Filesystem.join(n,"skills",l):utils.Filesystem.join(n,"skills"),p=utils.Filesystem.join(u,"SKILL.md"),d=o?`${l}/SKILL.md`:"SKILL.md";if(fs$1.existsSync(p))return r?(process.stdout.write(`${JSON.stringify({ok:false,data:{action:"exists",path:d},meta:{skillName:l,hasName:o}},null,2)}
263
- `),0):(console.log(`${U}${b("cli.init.exists",{locale:s,vars:{path:d},fallback:`Skill already exists at ${d}`})}${i}`),0);fs$1.mkdirSync(u,{recursive:true});let h=cn(s,l);if(fs$1.writeFileSync(p,h),r)return process.stdout.write(`${JSON.stringify({ok:true,data:{action:"created",skillName:l,path:d,absolutePath:p},meta:{hasName:o,locale:s}},null,2)}
264
- `),0;let f=[];return f.push(`${U}${b("cli.init.created",{locale:s,vars:{name:l},fallback:`Initialized skill: ${l}`})}${i}`),f.push(""),f.push(`${a}${b("cli.init.created_label",{locale:s,fallback:"Created"})}${i}:`),f.push(` ${d}`),f.push(""),f.push(`${a}${b("cli.init.next.title",{locale:s,fallback:"Next steps"})}${i}:`),f.push(` 1. ${b("cli.init.next.edit",{locale:s,vars:{path:d},fallback:`Edit ${d} to define your skill instructions`})}`),f.push(` 2. ${b("cli.init.next.frontmatter",{locale:s,fallback:"Update the name and description in the frontmatter"})}`),f.push(""),f.push(`${a}${b("cli.init.publish.title",{locale:s,fallback:"Publishing"})}${i}:`),f.push(` ${a}GitHub:${i} ${b("cli.init.publish.github",{locale:s,vars:{cmd:"easbot skills"},fallback:"Push to a repo, then easbot skills add <owner>/<repo>"})}`),f.push(` ${a}URL:${i} ${b("cli.init.publish.url",{locale:s,vars:{cmd:"easbot skills",path:d},fallback:"Host the file, then easbot skills add https://example.com/"+d})}`),q(f,{title:`${b("cli.init.created_label",{locale:s,fallback:"Created"})}: ${d}`,outro:`${a}${b("cli.init.browse_hint",{locale:s,vars:{url:"https://skills.sh/"},fallback:"Browse existing skills for inspiration at https://skills.sh/"})}${i}`}),0}async function Ap(e,t){Fi(t?.version);let s=t?.inAgent??await Rt();if(e.length===0)return s||Mi(t),{code:0,handled:false};let n=e[0],l=e.slice(1);switch(n){case "find":case "search":case "f":case "s":return s||ws(),console.log(),{code:await Ul(l),handled:true,command:n};case "init":return s||ws(),console.log(),{code:Hi(l,t),handled:true,command:n};case "a":case "add":{s||ws();let{source:o,options:r}=Mt(l);return await ft(o,r),{code:0,handled:true,command:n}}case "use":{let{source:o,options:r,errors:u}=Ql(l);return await en(o,r,u),{code:0,handled:true,command:n}}case "remove":case "rm":case "r":{if(l.includes("--help")||l.includes("-h"))return Ki(t),{code:0,handled:true,command:n};let{skills:o,options:r}=Hl(l);return await Kl(o,r),{code:0,handled:true,command:n}}case "list":case "ls":return await Fl(l,{cwd:t?.cwd}),{code:0,handled:true,command:n};case "doctor":case "dr":return l.includes("--help")||l.includes("-h")?(Gi(t),{code:0,handled:true,command:n}):(await Wl(l,t?.cwd?{cwd:t.cwd}:void 0),{code:0,handled:true,command:n});case "check":case "update":case "upgrade":return await kl(l,{cwd:t?.cwd}),{code:0,handled:true,command:n};case "store":return {code:await Rl(l),handled:true,command:n};default:{let o=rt(t);return console.log(b("cli.unknown_command",{locale:o,vars:{command:n??""},fallback:`Unknown command: ${n}`})),console.log(b("cli.help_hint",{locale:o,vars:{cmd:"skills"},fallback:"Run skills --help for usage."})),{code:1,handled:true,command:n}}}}
265
- exports.A=Zo;exports.B=Fl;exports.C=Kl;exports.D=Hl;exports.E=Wl;exports.F=Ql;exports.G=yi;exports.H=$i;exports.I=en;exports.J=bi;exports.K=Mi;exports.L=vp;exports.M=Ap;exports.a=ns;exports.b=tl;exports.c=sl;exports.d=ll;exports.e=is;exports.f=st;exports.g=Rt;exports.h=dr;exports.i=rl;exports.j=Gn;exports.k=qr;exports.l=Kn;exports.m=fl;exports.n=kl;exports.o=Al;exports.p=ft;exports.q=Mt;exports.r=vo;exports.s=Rl;exports.t=xo;exports.u=Lo;exports.v=Po;exports.w=Co;exports.x=Uo;exports.y=Dl;exports.z=Ul;
262
+ `);}function ws(){console.log();}function Hi(e,t){let s=rt(t),n=t?.cwd??chunkXGUPIAAF_cjs.p()??process.cwd(),l=e[0]||utils.Filesystem.basename(n),o=e[0]!==void 0,r=e.includes("--json"),p=o?utils.Filesystem.join(n,"skills",l):utils.Filesystem.join(n,"skills"),u=utils.Filesystem.join(p,"SKILL.md"),d=o?`${l}/SKILL.md`:"SKILL.md";if(fs$1.existsSync(u))return r?(process.stdout.write(`${JSON.stringify({ok:false,data:{action:"exists",path:d},meta:{skillName:l,hasName:o}},null,2)}
263
+ `),0):(console.log(`${U}${b("cli.init.exists",{locale:s,vars:{path:d},fallback:`Skill already exists at ${d}`})}${i}`),0);fs$1.mkdirSync(p,{recursive:true});let h=cn(s,l);if(fs$1.writeFileSync(u,h),r)return process.stdout.write(`${JSON.stringify({ok:true,data:{action:"created",skillName:l,path:d,absolutePath:u},meta:{hasName:o,locale:s}},null,2)}
264
+ `),0;let f=[];return f.push(`${U}${b("cli.init.created",{locale:s,vars:{name:l},fallback:`Initialized skill: ${l}`})}${i}`),f.push(""),f.push(`${a}${b("cli.init.created_label",{locale:s,fallback:"Created"})}${i}:`),f.push(` ${d}`),f.push(""),f.push(`${a}${b("cli.init.next.title",{locale:s,fallback:"Next steps"})}${i}:`),f.push(` 1. ${b("cli.init.next.edit",{locale:s,vars:{path:d},fallback:`Edit ${d} to define your skill instructions`})}`),f.push(` 2. ${b("cli.init.next.frontmatter",{locale:s,fallback:"Update the name and description in the frontmatter"})}`),f.push(""),f.push(`${a}${b("cli.init.publish.title",{locale:s,fallback:"Publishing"})}${i}:`),f.push(` ${a}GitHub:${i} ${b("cli.init.publish.github",{locale:s,vars:{cmd:"easbot skills"},fallback:"Push to a repo, then easbot skills add <owner>/<repo>"})}`),f.push(` ${a}URL:${i} ${b("cli.init.publish.url",{locale:s,vars:{cmd:"easbot skills",path:d},fallback:"Host the file, then easbot skills add https://example.com/"+d})}`),q(f,{title:`${b("cli.init.created_label",{locale:s,fallback:"Created"})}: ${d}`,outro:`${a}${b("cli.init.browse_hint",{locale:s,vars:{url:"https://skills.sh/"},fallback:"Browse existing skills for inspiration at https://skills.sh/"})}${i}`}),0}async function Ap(e,t){Fi(t?.version);let s=t?.inAgent??await Rt();if(e.length===0)return s||Mi(t),{code:0,handled:false};let n=e[0],l=e.slice(1);switch(n){case "find":case "search":case "f":case "s":return s||ws(),console.log(),{code:await Ul(l),handled:true,command:n};case "init":return s||ws(),console.log(),{code:Hi(l,t),handled:true,command:n};case "a":case "add":{s||ws();let{source:o,options:r}=Mt(l);return await ft(o,r),{code:0,handled:true,command:n}}case "use":{let{source:o,options:r,errors:p}=Ql(l);return await en(o,r,p),{code:0,handled:true,command:n}}case "remove":case "rm":case "r":{if(l.includes("--help")||l.includes("-h"))return Ki(t),{code:0,handled:true,command:n};let{skills:o,options:r}=Hl(l);return await Kl(o,r),{code:0,handled:true,command:n}}case "list":case "ls":return await Fl(l,{cwd:t?.cwd}),{code:0,handled:true,command:n};case "doctor":case "dr":return l.includes("--help")||l.includes("-h")?(Gi(t),{code:0,handled:true,command:n}):(await Wl(l,t?.cwd?{cwd:t.cwd}:void 0),{code:0,handled:true,command:n});case "check":case "update":case "upgrade":return await kl(l,{cwd:t?.cwd}),{code:0,handled:true,command:n};case "store":return {code:await Rl(l),handled:true,command:n};default:{let o=rt(t);return console.log(b("cli.unknown_command",{locale:o,vars:{command:n??""},fallback:`Unknown command: ${n}`})),console.log(b("cli.help_hint",{locale:o,vars:{cmd:"skills"},fallback:"Run skills --help for usage."})),{code:1,handled:true,command:n}}}}
265
+ exports.A=Zo;exports.B=Fl;exports.C=Kl;exports.D=Hl;exports.E=Wl;exports.F=Ql;exports.G=yi;exports.H=$i;exports.I=en;exports.J=bi;exports.K=Mi;exports.L=vp;exports.M=Ap;exports.a=ns;exports.b=tl;exports.c=sl;exports.d=ll;exports.e=is;exports.f=lt;exports.g=Rt;exports.h=dr;exports.i=rl;exports.j=Gn;exports.k=qr;exports.l=Kn;exports.m=fl;exports.n=kl;exports.o=Al;exports.p=ft;exports.q=Mt;exports.r=vo;exports.s=Rl;exports.t=xo;exports.u=To;exports.v=Po;exports.w=Co;exports.x=Uo;exports.y=Dl;exports.z=Ul;