@easbot/skills 0.3.13 → 0.3.14

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 (59) hide show
  1. package/README.en.md +432 -125
  2. package/README.md +427 -125
  3. package/dist/chunks/blob-SCUVTYVE.cjs +1 -0
  4. package/dist/chunks/{blob-3PZEQWTP.mjs → blob-WZAGX4RO.mjs} +1 -1
  5. package/dist/chunks/chunk-2E6BHPFV.cjs +265 -0
  6. package/dist/chunks/{chunk-ZBKGF7PA.mjs → chunk-5BDDXFOF.mjs} +1 -1
  7. package/dist/chunks/chunk-5RWSXDNO.cjs +3 -0
  8. package/dist/chunks/chunk-6NTEYECA.mjs +22 -0
  9. package/dist/chunks/{chunk-4D5RQDWJ.mjs → chunk-AQYRRXU5.mjs} +2 -2
  10. package/dist/chunks/{chunk-CY6UI6SJ.cjs → chunk-DFBKA5A6.cjs} +1 -1
  11. package/dist/chunks/chunk-DNE3XPCJ.cjs +2 -0
  12. package/dist/chunks/chunk-J6PRUXFG.mjs +265 -0
  13. package/dist/chunks/chunk-JCOXRETY.cjs +22 -0
  14. package/dist/chunks/chunk-NH4TYEPW.mjs +3 -0
  15. package/dist/chunks/{chunk-S6YNGR7S.cjs → chunk-Q2MOP5ZW.cjs} +2 -2
  16. package/dist/chunks/{chunk-5BL3KG26.cjs → chunk-UGHF4GOW.cjs} +2 -2
  17. package/dist/chunks/chunk-ZJS7IO5V.mjs +2 -0
  18. package/dist/chunks/cli-handler-3FSM4C7L.mjs +1 -0
  19. package/dist/chunks/cli-handler-B6H4RZEM.cjs +1 -0
  20. package/dist/chunks/{installer-REG45DC2.mjs → installer-NJN3PT5F.mjs} +1 -1
  21. package/dist/chunks/installer-YDJBZTQ7.cjs +1 -0
  22. package/dist/chunks/{interfaces-UIS44Q7A.cjs → interfaces-5BH4K5TM.cjs} +1 -1
  23. package/dist/chunks/local-lock-SPZB3AB7.cjs +1 -0
  24. package/dist/chunks/local-lock-ZHTDWYXF.mjs +1 -0
  25. package/dist/chunks/scan-6W47D2KJ.mjs +1 -0
  26. package/dist/chunks/scan-L6UNVP3V.cjs +1 -0
  27. package/dist/chunks/skill-lock-MNRZ7TIX.mjs +1 -0
  28. package/dist/chunks/skill-lock-VX2HGPTY.cjs +1 -0
  29. package/dist/chunks/store-TSS4BMBF.cjs +1 -0
  30. package/dist/chunks/{store-IVDLGLET.mjs → store-UJPPYDBG.mjs} +1 -1
  31. package/dist/chunks/telemetry-B4PS27S5.cjs +1 -0
  32. package/dist/cli.cjs +1 -1
  33. package/dist/cli.mjs +1 -1
  34. package/dist/index.cjs +1 -1
  35. package/dist/index.d.cts +2 -2
  36. package/dist/index.d.ts +2 -2
  37. package/dist/index.mjs +1 -1
  38. package/package.json +5 -6
  39. package/dist/chunks/blob-ZDEX2HRV.cjs +0 -1
  40. package/dist/chunks/chunk-5W7HC7BY.mjs +0 -22
  41. package/dist/chunks/chunk-CXH3OTTQ.cjs +0 -22
  42. package/dist/chunks/chunk-K2XGYOXP.mjs +0 -267
  43. package/dist/chunks/chunk-NKIQLESR.mjs +0 -3
  44. package/dist/chunks/chunk-ROCFLAYZ.mjs +0 -2
  45. package/dist/chunks/chunk-RVR3DSD2.cjs +0 -2
  46. package/dist/chunks/chunk-SXUY2J75.cjs +0 -3
  47. package/dist/chunks/chunk-UJWB7QQ6.cjs +0 -267
  48. package/dist/chunks/cli-handler-667TYY4I.cjs +0 -1
  49. package/dist/chunks/cli-handler-YSDUNKKZ.mjs +0 -1
  50. package/dist/chunks/installer-SOVGUW3M.cjs +0 -1
  51. package/dist/chunks/local-lock-AWD3LLEY.mjs +0 -1
  52. package/dist/chunks/local-lock-GIZDVF3X.cjs +0 -1
  53. package/dist/chunks/scan-57D2H7LP.cjs +0 -1
  54. package/dist/chunks/scan-WAXGJM5N.mjs +0 -1
  55. package/dist/chunks/skill-lock-DZMA75MY.mjs +0 -1
  56. package/dist/chunks/skill-lock-XTWQYBRG.cjs +0 -1
  57. package/dist/chunks/store-F7PGGZIO.cjs +0 -1
  58. package/dist/chunks/telemetry-LCGTSJDM.cjs +0 -1
  59. /package/dist/chunks/{chunk-VRHWDHQV.cjs → chunk-GWUDKZEH.cjs} +0 -0
@@ -0,0 +1,265 @@
1
+ import {b as b$1,a as a$1,d,c as c$2}from'./chunk-CFMOYU7R.mjs';import {f as f$1,d as d$1,e as e$1,b as b$4,a as a$3,c as c$1,r,w,y as y$1,u,t as t$1,s as s$1,p as p$1,l as l$3,m as m$1,i as i$3,h as h$1,g as g$2}from'./chunk-NH4TYEPW.mjs';import {a as a$5}from'./chunk-5BDDXFOF.mjs';import {i as i$1,j,g,l,o as o$1,e as e$2,d as d$2,k,s,m,f as f$2,h as h$2}from'./chunk-AQYRRXU5.mjs';import {y,e,a as a$2,b as b$3,c,da,R,B as B$1,E,C,t,L,v,g as g$1,ga,l as l$1,S,W,J as J$1,N,ja,ia,D,w as w$1,X,n,A,k as k$1,Q,M,Y,O,aa}from'./chunk-6NTEYECA.mjs';import {f,b as b$2,p,q as q$1,c as c$3,o,i as i$2,h}from'./chunk-ML6B4IQL.mjs';import {p as p$2}from'./chunk-RWZ4LFSN.mjs';import {b as b$6,d as d$3,l as l$2,a as a$6}from'./chunk-ZJS7IO5V.mjs';import {b as b$5}from'./chunk-ZYDDQV73.mjs';import {a as a$4}from'./chunk-WQGSYA5D.mjs';import {existsSync,readdirSync,lstatSync,realpathSync,unlinkSync,constants,mkdirSync,writeFileSync}from'fs';import {tmpdir,homedir}from'os';import {dirname,join,basename,sep,relative,normalize,resolve}from'path';import {Log,loadTextFile,Filesystem,resolveLocaleLang,Grep,formatLocalISO}from'@easbot/utils';import {Prompt,note,Symbol}from'@easbot/terminal';import {lstat,realpath,access,mkdir,rm,mkdtemp,readFile,writeFile,readdir,cp}from'fs/promises';import {createHash}from'crypto';import {fileURLToPath}from'url';import*as El from'readline';import {spawn}from'child_process';async function tl(e){let t=createHash("sha256");try{let s=await readFile(join(e,"SKILL.md"),"utf-8");t.update("SKILL.md"),t.update(s);}catch{t.update("EMPTY");}return t.digest("hex")}async function os(e,t){let s;try{s=await lstat(e);}catch{return "absent"}if(s.isSymbolicLink())try{let u=Filesystem.toUnixPath(await realpath(e)),p=Filesystem.toUnixPath(await realpath(t));return u===p?"symlinked":"orphan"}catch{return "orphan"}let n=join(e,"SKILL.md");try{await access(n);}catch{return "absent"}if(!await y(n))return "divergent";let o=await tl(e),r=await tl(t);return o===r?"copied":"divergent"}function sl(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 ll(e,t){let s=[],n=[];for(let l of e)if(l.kind!=="skip"){if(l.kind==="report"){n.push(l);continue}try{await mkdir(dirname(l.targetPath),{recursive:!0});let o;l.mode==="symlink"?o=await i$1(t.sourceDir,l.targetPath,{isGlobal:t.installGlobally&&l.scope==="global",agentType:l.agentId,cwd:t.cwd}):o=await 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 nl(e,t){let s=[];for(let n of e)if(n==="eve"&&t.includeEveSubagents!==false){let l=f(t.cwd);if(l.length===0)s.push(bn(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:join(g(t,s,n.cwd,l),n.skillId),sourceDir:n.sourceDir}}function bn(e){return {agentId:"eve",cells:{global:tt("global","eve",true,e),project:tt("project","eve",false,e)}}}async function rs(e){let t=e.cwd??process.cwd(),s=Filesystem.toUnixPath(e.sourceDir),n=e.includeEveSubagents??true;if(e.assumeYes)return {skipped:true,installed:[],reported:[]};let l=nl(e.targetAgents,{skillId:e.skillId,sourceDir:s,cwd:t,includeEveSubagents:n}),o=[];for(let d of l){let h={...d.cells.global,state:await os(d.cells.global.targetPath,s)},f={...d.cells.project,state:await os(d.cells.project.targetPath,s)};o.push({agentId:d.agentId,cells:{global:h,project:f}});}let r=sl(o,e.defaultMode),{installed:u,reported:p}=await ll(r,{sourceDir:s,installGlobally:e.installGlobally,cwd:t});return {skipped:false,installed:u,reported:p,matrix:o}}function Rt(e){return h$1(g$2(f$1(` ${e} `)))}var vn="/opt/.devin",ol="easbot",An="cursor",xn="cursor-cli",Tn="claude",Ln="cowork",In="devin",jn="replit",Pn="gemini",_n="codex",Cn="antigravity",Rn="augment-cli",Nn="opencode",as="github-copilot",On="github-copilot-cli",il="v0";async function rl(){if(process.env.AI_AGENT){let e=process.env.AI_AGENT.trim();if(e)return e===ol?{isAgent:true,agent:{name:ol}}:e===as||e===On?{isAgent:true,agent:{name:as}}:e===il?{isAgent:true,agent:{name:il}}:{isAgent:true,agent:{name:e}}}if(process.env.CURSOR_TRACE_ID)return {isAgent:true,agent:{name:An}};if(process.env.CURSOR_AGENT||process.env.CURSOR_EXTENSION_HOST_ROLE==="agent-exec")return {isAgent:true,agent:{name:xn}};if(process.env.GEMINI_CLI)return {isAgent:true,agent:{name:Pn}};if(process.env.CODEX_SANDBOX||process.env.CODEX_CI||process.env.CODEX_THREAD_ID)return {isAgent:true,agent:{name:_n}};if(process.env.ANTIGRAVITY_AGENT)return {isAgent:true,agent:{name:Cn}};if(process.env.AUGMENT_AGENT)return {isAgent:true,agent:{name:Rn}};if(process.env.OPENCODE_CLIENT)return {isAgent:true,agent:{name:Nn}};if(process.env.CLAUDECODE||process.env.CLAUDE_CODE)return process.env.CLAUDE_CODE_IS_COWORK?{isAgent:true,agent:{name:Ln}}:{isAgent:true,agent:{name:Tn}};if(process.env.REPL_ID)return {isAgent:true,agent:{name:jn}};if(process.env.COPILOT_MODEL||process.env.COPILOT_ALLOW_ALL||process.env.COPILOT_GITHUB_TOKEN)return {isAgent:true,agent:{name:as}};try{return await access(vn,constants.F_OK),{isAgent:!0,agent:{name:In}}}catch{}return {isAgent:false,agent:void 0}}var st=null,En={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 rl(),st.isAgent&&a$1(st.agent.name),st)}async function Nt(){return (await lt()).isAgent}async function fr(){let e=await lt();return e.isAgent?e.agent.name:null}function al(e){return En[e]??null}function cs(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 Un(e,t=2){console.log(JSON.stringify(e,null,t));}function J(e){Un(e);}function q(e,t={}){let s=e.length>0?e.join(`
2
+ `):t.empty??a$3("No results."),n=e.length>0?t.title:t.emptyTitle??t.title;n?note(s,n):console.log(s),t.outro&&!t.skipOutro?Prompt.outro(t.outro):t.skipOutro||Prompt.outro(c$1("Done!"));}var i="\x1B[0m",G="\x1B[1m",a="\x1B[38;5;102m",U="\x1B[38;5;145m",Le="\x1B[36m";var nt="\x1B[33m";dirname(fileURLToPath(import.meta.url));var Dt=Number(process.env.SKILLS_UPDATE_TIMEOUT??6e4);async function Ut(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 gl(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 dl(e){try{return await b$5(e)}catch{return}}async function fl(e,t,s,n){let{rm:l,readdir:o,stat:r}=await import('fs/promises'),u=L(e),p=M(e),d=Filesystem.join(Filesystem.normalize(t),s),h=Filesystem.join(p,s);if(!await 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=Filesystem.join(j,O.name);try{let N=await r(D);return `${D.slice(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(Filesystem.join(j,O.name)))return !1;return !0}catch{return false}};if(await v(Filesystem.normalize(m)))return S.sort(),createHash("sha256").update(S.join(`
3
+ `)).digest("hex")},w=await C(d),$=await C(h);if(w&&$&&w===$){let S=(await Y(u,O(e,s),n))?.entry.computedHash;if(S)return {ok:true,hash:S,skipped:true}}try{await l(h,{recursive:!0,force:!0}),await Filesystem.cp(d,h);}catch{return {ok:false}}let c=await dl(h);if(!c)return {ok:false};let g=e.type==="local"?e.localPath??e.url:Filesystem.normalize(t);try{await aa([{skillName:n,parsed:e,sourceKey:u,sourcePath:g,storePath:p,skillPath:s,computedHash:c}]);}catch{}return {ok:true,hash:c}}function Ft(e,t,s){return e||!t||!s?true:t!==s}function Kn(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 Vr(e){let t=e||process.cwd();return existsSync(join(t,"skills-lock.json"))}async function Hn(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 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 Prompt.isCancel(t)&&Prompt.cancel("Cancelled"),t}function ml(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 Wn(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 zn(e){let t=e.sourceUrl;if(e.sourceType==="well-known"){let s=t.indexOf("/.well-known/");s!==-1&&(t=t.slice(0,s));}return cs(t,e.ref)}function Ot(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=zn(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} ${b$6(l.name)} ${a}(${l.reason})${i}`);}else {let l=n[0].reason,o=n.map(r=>b$6(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 hl(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$1=q$1(e.agentFilter??[]),r=o$1.length>0?o$1:void 0,p=(await a$5({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-ZHTDWYXF.mjs'),{readSkillLock:f}=await import('./skill-lock-MNRZ7TIX.mjs'),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 Y(g.marketId,g.pluginId,c.name);if(!m)continue;let{readStoreIndex:S}=await import('./store-UJPPYDBG.mjs'),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$1=existsSync(v)?await y(`${v}/SKILL.md`.replace(/\\/g,"/")):void 0;if(!y$1){if(!await Bn(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$1;for(let R of g.agents){let O=o(R,g.scope),N=await h$2(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 Bn(e,t$1){return t$1?(await l$3()).skills[e]:(await t()).skills[e]}function Jn(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 kl(e){if(e.skills.length===0)return;let t=Jn(e),s=l=>{let o=l.map(r=>b$2[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}${b$6(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}${b$6(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=b$2[o]?.displayName??o;console.log(` ${U}\u2717 ${u}:${i} ${a}${r}${i}`);}}console.log();}async function Yn(e){let t$1=await t(),s=[];for(let[n,l]of Object.entries(t$1.skills))ml(n,e)&&l.sourceType!=="node_modules"&&s.push({name:n,source:l.source,entry:l});return s}async function qn(e$2={}){let t=e$2.cwd||process.cwd(),s=await l$3(),n=Object.keys(s.skills),l=0,o=0,r=0;if(n.length===0)return note(e$2.skills&&e$2.skills.length>0?`${d$1(`No installed skills found matching: ${e$2.skills.join(", ")}`)}`:`${a$3("No global skills tracked in lock file.")}`,e$1("Global Skills Update")),Prompt.outro(`${c$1("Done!")}${a$3(" Install with `easbot skills add <package> -g` to get started.")}`),{successCount:l,failCount:o,checkedCount:0};let{listInstalledSkills:u}=await import('./installer-NJN3PT5F.mjs'),p=await u({scope:"global",agentFilter:e$2.agent,cwd:t}),d=new Set(p.map(g=>g.name)),h=[],f=[],C=[];for(let g of n){if(!ml(g,e$2.skills))continue;let m=s.skills[g];if(m){if(!m.skillPath){f.push({name:g,reason:Wn(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$1=m[0].entry,v=S$1.source,T=S$1.sourceType,j=null;if(process.stdout.write(`\r${a}Checking skills from source: ${g}${i}\x1B[K
4
+ `),T==="github"){let A=e(v),R=a$2(A);if(R)try{let{fetchGitHubMarketSnapshot:O}=await import('./blob-WZAGX4RO.mjs'),D=await Ut(O(R,S$1.ref??void 0),Dt,`update market-snapshot ${g}`),F=(await S()).markets[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$1=T??"git",R=e(v),O=await Ut(Q({type:A$1,url:R.url,ref:S$1.ref??void 0,mode:"update"}),Dt,`update fetch ${g}`);if(j=O.tempDir,O.cloneError&&(y=O.cloneError),!y&&j){let D=await A(j),N=j.replace(/\\/g,"/").replace(/\/+$/,""),F=D.map(V=>{let Z=V.path.replace(/\\/g,"/");return relative(N,Z).split(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,Z=new Set(F),ve=e(v);for(let{name:se,entry:X}of m){if(V.has(se))continue;let xe=X.skillPath.split(sep).join("/").replace(/\/SKILL\.md$/,"");if(!Z.has(xe))continue;let ke=await fl(ve,j,xe,se);if(!ke.ok){f.push({name:se,reason:"Store sync failed",sourceUrl:X.source,sourceType:X.sourceType,ref:X.ref});continue}Ft(e$2.force,X.computedHash,ke.hash)&&h.push({name:se,source:g,entry:X});}}}}catch(A){y=A instanceof Error?A:new Error(String(A));}finally{j&&T!=="local"&&!ga(j)&&await l$1(j);}y&&(console.log(` ${a}\u2717 Failed to check skills from ${g}: ${y.message}${i}`),f.push(...gl(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$2.skills||console.log(`${a}No global skills to check.${i}`),{successCount:l,failCount:o,checkedCount:0};if(C.length===0&&f.length>0)return Ot(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 Ot(f),{successCount:l,failCount:o,checkedCount:$};try{let g=[],m=[];for(let v of h){g.push(v.name);let T=e(v.entry.source),j=M(T),A=(v.entry.skillPath??v.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");m.push(join(j,A));}let S=await hl({skillNames:g,skillStorePaths:m,scope:"global",agentFilter:e$2.agent,cwd:t});kl(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 l$3(),m=new Date().toISOString(),S=!1,v=0;for(let T of h){let j=g.skills[T.name];if(!j)continue;let y=e(T.entry.source),A=M(y),O=(T.entry.skillPath??T.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,""),D=join(A,O),N=await dl(D);N&&j.computedHash!==N&&(j.computedHash=N,j.updatedAt=m,S=!0,v++);}S&&(await m$1(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}`);}Ot(f);let c=[];if(l>0&&o>0)c.push(`${c$1(`\u2713 ${l} refreshed`)} ${a$3("|")} ${b$4(`\u2717 ${o} failed`)}`);else if(l>0)c.push(`${c$1(`\u2713 ${l} refreshed`)}`);else if(o>0)c.push(`${b$4(`\u2717 ${o} failed`)}`);else if($>0)c.push(`${c$1("All global skills are up to date.")}`);else return {successCount:l,failCount:o,checkedCount:$};return f.length>0&&c.push(`${d$1(`\u26A0 ${f.length} skipped`)}`),console.log(),note(c.join(`
5
+ `),e$1("Global Skills Update")),Prompt.outro(`${c$1("Done!")}${a$3(" Run `easbot skills list` to see current state.")}`),{successCount:l,failCount:o,checkedCount:$}}async function Vn(e$2={}){let t$1=e$2.cwd||process.cwd(),s=await Yn(e$2.skills),n=0,l=0,o=[];if(s.length===0)return e$2.skills||(console.log(`${a}No project skills to update.${i}`),console.log(`${a}Install project skills with${i} ${U}easbot skills add <package>${i}`)),note(s.length===0&&e$2.skills?`${d$1(`No installed skills found matching: ${e$2.skills.join(", ")}`)}`:`${a$3("No project skills tracked in lock file.")}`,e$1("Project Skills Update")),Prompt.outro(`${c$1("Done!")}${a$3(" Install with `easbot skills add <package>` to get started.")}`),{successCount:n,failCount:l,foundCount:0};let{listInstalledSkills:r}=await import('./installer-NJN3PT5F.mjs'),u=await r({scope:"project",agentFilter:e$2.agent,cwd:t$1}),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}`),pl(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 t(),$=[];for(let[c,g]of C){let m=g[0].entry,S$1=m.source,v=m.ref;if(m.sourceType==="github"){let N=e(S$1),F=a$2(N);if(F)try{let{fetchGitHubMarketSnapshot:V}=await import('./blob-WZAGX4RO.mjs'),Z=await Ut(V(F,m.ref??void 0),Dt,`update market-snapshot ${c}`),se=(await S()).markets[L(N)]?.snapshotHash;if(Z&&se&&se===Z.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$1=new Map,R=null;try{let N=m.sourceType??"git",F=e(S$1),V=await Ut(Q({type:N,url:F.url,ref:v,mode:"update"}),Dt,`update fetch ${c}`);if(j=V.tempDir,V.cloneError)R=V.cloneError;else {let Z=await A(j);if(Z.length===0)R=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${c}`);else {let ve=Z.map(X=>{let Ae=relative(j,X.path);return join(Ae,"SKILL.md").split(sep).join("/")}),se=e(S$1);for(let X of Z){let xe=join(relative(j,X.path),"SKILL.md").split(sep).join("/").replace(/\/SKILL\.md$/,""),ke=await fl(se,j,xe,X.name);ke.ok&&ke.hash&&A$1.set(X.name,ke.hash);}}}}catch(N){R=N instanceof Error?N:new Error(String(N));}finally{j&&!ga(j)&&await l$1(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(...gl(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$1.get(N.name);if(!V)continue;let Z=F?.computedHash;if(!Ft(e$2.force,Z,V))continue;let ve=e(N.entry.source),se=M(ve),Ae=(N.entry.skillPath??N.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");D.push({name:N.name,source:N.entry.source,skillPath:Ae,storeRoot:se});}if(D.length!==0)try{let N=D.map(Z=>Z.name),F=D.map(Z=>join(Z.storeRoot,Z.skillPath)),V=await hl({skillNames:N,skillStorePaths:F,scope:"project",agentFilter:e$2.agent,cwd:t$1});kl(V),V.failedSkillCount>0?l+=V.failedSkillCount:n+=V.skills.length;for(let Z of D)o.push(Z.name);}catch(N){l+=D.length,console.log(` ${a}\u2717 Failed to refresh: ${N instanceof Error?N.message:String(N)}${i}`);}}if(pl(f),Ot($),h.length>0)if(console.log(),o.length>0||$.length>0||f.length>0){let c=[];o.length>0&&c.push(`${c$1(`\u2713 Refreshed ${o.length} skill(s)${i$3("")}`)}`),n>0&&l>0?c.push(`${c$1(`\u2713 ${n} ok`)} ${a$3("|")} ${b$4(`\u2717 ${l} failed`)}`):n>0?c.push(`${c$1(`\u2713 ${n} ok`)}`):l>0&&c.push(`${b$4(`\u2717 ${l} failed`)}`),$.length>0&&c.push(`${d$1(`\u26A0 ${$.length} skipped`)}`),f.length>0&&c.push(`${a$3(`${f.length} legacy (cannot update)`)}`),note(c.join(`
6
+ `),e$1("Project Skills Update")),Prompt.outro(`${c$1("Done!")}${a$3(" Run `easbot skills list` to see current state.")}`);}else note(`${c$1("All project skills are up to date.")}`,e$1("Project Skills Update")),Prompt.outro(`${c$1("Done!")}`);if(n>0&&o.length>0)try{let c=await 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 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-ZHTDWYXF.mjs');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 pl(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=cs(t.entry.source,t.entry.ref);console.log(` ${U}\u2022${i} ${b$6(t.name)}`),console.log(` ${a}To refresh: ${U}easbot skills add ${s} -y${i}`);}}}async function yl(e=[],t={}){let s=Kn(e,t);s.all===true&&(s.yes=true,(!s.skills||s.skills.length===0)&&(s.skills=["*"]));let n=await Hn(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 qn(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 Vn(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}`),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 $l={version:"0.3.14"};var Al="eve agent";function eo(e,t){return e.startsWith("git@")||e.startsWith("ssh://")?e:t}function xl(e){b$1(e);}async function to(e,t,s,n){let{agent:l,subagent:o}=t,{installMode:r,installGlobally:u}=n,h=await h$2(e,l,{global:u,mode:r,eveSubagent:o});return {skill:B$1(e),agent:ft(t),pluginName:e.pluginName,...h}}var so=(()=>{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 Sl(e){switch(e){case "critical":return b$4(f$1("Critical Risk"));case "high":return b$4("High Risk");case "medium":return d$1("Med Risk");case "low":return c$1("Low Risk");case "safe":return c$1("Safe");default:return a$3("--")}}function lo(e){if(!e)return a$3("--");let t=e.alerts??0;return t>0?b$4(`${t} alert${t!==1?"s":""}`):c$1("0 alerts")}function it(e,t){let s=a$6(e),n=Math.max(0,t-s.length);return e+" ".repeat(n)}function no(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=it("",l+2)+it(a$3("Gen"),18)+it(a$3("Socket"),18)+a$3("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?Sl(p.ath.risk):a$3("--"),f=p?.socket?lo(p.socket):a$3("--"),C=p?.snyk?Sl(p.snyk.risk):a$3("--");o.push(it(e$1(d),l+2)+it(h,18)+it(f,18)+C);}return o.push(""),o.push(`${a$3("Details:")} ${a$3(`https://skills.sh/${s}`)}`),o}function ds(e,t){let s=homedir();return e===s||e.startsWith(s+sep)?"~"+e.slice(s.length):e===t||e.startsWith(t+sep)?"."+e.slice(t.length):e}function $e(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 oo(e){let t=e.map(n=>e$1(B$1(n))),s=$e(t,3);return a$6(s).length<=80?s:`${e.length} selected skills`}function io(e){return `Detected an eve project. Install ${oo(e)} for your ${Al} to use?`}function ro(e,t,s){let n=[],l=[],o$1=[],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=b$2[u].displayName,d=r.get(p);o(u,s?"global":"project")?n.push(p):d==="symlink"?o$1.push(p):l.push(p);}return {universal:n,copied:l,symlinked:o$1}}function ft(e){let t=b$2[e.agent].displayName;return e.subagent?`${t} (${e.subagent})`:t}function Mt(e){return e.subagent?`${e.agent}:${e.subagent}`:e.agent}function ao(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 co(e,t,s,n=[]){let l=[],o$1=e.filter(f=>!f.subagent).map(f=>f.agent),r=e.filter(f=>f.subagent).map(ft),u,p;if(n.length>0){let f=new Set(n);u=o$1.filter(C=>f.has(C)),p=o$1.filter(C=>!f.has(C));}else u=o$1.filter(f=>o(f,s?"global":"project")),p=o$1.filter(f=>!o(f,s?"global":"project"));let d=u.map(f=>b$2[f].displayName),h=p.map(f=>b$2[f].displayName);return t==="symlink"?(d.length>0&&l.push(` ${c$1("universal:")} ${$e(d)}`),h.length>0&&l.push(` ${a$3("symlinked:")} ${$e(h)}`),r.length>0&&l.push(` ${a$3("copied:")} ${$e(r)}`)):(d.length>0&&l.push(` ${c$1("universal:")} ${$e(d)}`),h.length>0&&l.push(` ${a$3("copied:")} ${$e(h)}`),r.length>0&&l.push(` ${a$3("copied (subagent):")} ${$e(r)}`)),l}function wl(e,t){let s=h(t),n=[...e];for(let l of s)n.includes(l)||n.push(l);return n}function po(e,t,s){let n=[],{universal:l,copied:o,symlinked:r}=ro(e,t,s),u=o,p=e.filter(d=>d.symlinkFailed&&!d.skipped).map(d=>d.agent);return l.length>0&&n.push(` ${c$1("universal:")} ${$e(l)}`),u.length>0&&n.push(` ${e$1("copied:")} ${$e(u)}`),r.length>0&&n.push(` ${a$3("symlinked:")} ${$e(r)}`),p.length>0&&n.push(` ${d$1("symlink-failed:")} ${$e(p)}`),n}async function uo(e,t){let s=[];return await Prompt.multiselect({message:e,options:t,initialValues:s,required:true})}async function vl(e){let t=e.global===true?"global":"project",s=p=>t!=="global"||b$2[p].globalSkillsDir!==void 0,n=h(t).filter(s),l=i$2(t).filter(p=>p!=="eve"&&s(p)),o={title:"Universal (.agents/skills)",items:n.map(p=>({value:p,label:b$2[p].displayName}))},r=l.map(p=>({value:p,label:b$2[p].displayName,hint:e.global?b$2[p].globalSkillsDir:b$2[p].skillsDir})),u=await 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 go=$l.version;b$1(go);async function mt(e$3,t$1={}){let s=e$3[0],n=false,l$1=()=>{n||(Prompt.Log.message(a$3("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-UJPPYDBG.mjs'),h=await p();s=await d(h);}t$1.all&&(t$1.skill=["*"],t$1.agent=["*"],t$1.yes=true);let o$2=t$1.global??false;if(!(t$1.global!==void 0)&&!t$1.yes&&!t$1.all&&process.stdin.isTTY&&Object.values(b$2).some(f=>f.globalSkillsDir!==void 0)){let f=await 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)"}]});Prompt.isCancel(f)&&(await fe(null),Prompt.cancel("Installation cancelled")),o$2=f,Prompt.Log.info(`${f$1(o$2?"Global":"Project")} scope selected`);}let r$1=await lt();if(r$1.isAgent&&(t$1.yes=true,!t$1.agent||t$1.agent.length===0)){let p=al(r$1.agent.name);if(p){let d=o$2?"global":"project";t$1.agent=wl([p],d);}}console.log(),r$1.isAgent||Prompt.intro(" skills "),r$1.isAgent?Prompt.Log.info(Rt(r$1.agent.name)+" Agent detected \u2014 installing non-interactively"):!process.stdin.isTTY&&!t$1.yes&&l$1();let u=null;try{let p$1=Prompt.spinner();p$1.start("Parsing source...");let d$3=e(s);p$1.stop(`Source: ${d$3.type==="local"?d$3.localPath:d$3.url}${d$3.ref?` #${d$1(d$3.ref)}`:""}${d$3.subpath?` @${e$1(d$3.subpath)}`:""}`);let h=a$2(d$3),f$2=(()=>{if(!h)return Promise.resolve(null);let k=b$3(h);return k?c(k.owner,k.repo).catch(()=>null):Promise.resolve(null)})(),C$1=Array.isArray(t$1?.skill)&&t$1.skill.length>0||t$1.fullDepth===!0||!!d$3.subpath;p$1.start("Loading source...");let w;try{w=await da(d$3,{includeInternal:C$1,fullDepth:t$1.fullDepth});}catch(k){throw k instanceof R&&(p$1.stop(b$4("Path not found")),Prompt.outro(b$4(`Local path does not exist: ${k.localPath}`)),process.exit(1)),k}u=w.storeDir,p$1.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$4=d$3.subpath?$.filter(k=>k.path.includes(`/${d$3.subpath}/`)||k.path.endsWith(`/${d$3.subpath}`)):$;if(p$1.start("Discovering skills..."),c$4.length===0&&w.cloneError){p$1.stop(b$4("Failed to clone repository"));for(let k of w.cloneError.message.split(`
7
+ `))Prompt.Log.message(a$3(k));await fe(u),process.exit(1);}if(c$4.length===0&&(p$1.stop(b$4("No skills found")),Prompt.outro(b$4("No valid skills found. Skills require a SKILL.md with name and description.")),await fe(u),process.exit(1)),p$1.stop(`Found ${c$1(String(c$4.length))} skill${c$4.length>1?"s":""}`),t$1.list){console.log(),Prompt.Log.step(f$1("Available Skills"));let k={},x=[];for(let L of c$4)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(f$1(E));for(let K of k[L])Prompt.Log.message(` ${e$1(B$1(K))}`),Prompt.Log.message(` ${a$3(K.description)}`);console.log();}if(x.length>0){_.length>0&&console.log(f$1("General"));for(let L of x)Prompt.Log.message(` ${e$1(B$1(L))}`),Prompt.Log.message(` ${a$3(L.description)}`);}console.log(),Prompt.outro("Use --skill <name> to install specific skills"),await fe(u),process.exit(0);}let g$1;if(t$1.skill&&t$1.skill.length>0){let k=c$4.map(_=>B$1(_)),x=E(t$1.skill,k);if(x.wildcard)g$1=c$4,Prompt.Log.info(`Installing all ${c$4.length} skills`);else if(x.invalid.length>0){Prompt.Log.error(`No matching skills found for: ${x.invalid.join(", ")}`),Prompt.Log.info("Available skills:");for(let _ of c$4)Prompt.Log.message(` - ${B$1(_)}`);await fe(u),process.exit(1);}else g$1=C(c$4,x.matched),g$1.length===0&&(Prompt.Log.error(`No matching skills found for: ${x.matched.join(", ")}`),await fe(u),process.exit(1)),Prompt.Log.info(`Selected ${g$1.length} skill${g$1.length!==1?"s":""}: ${g$1.map(_=>e$1(B$1(_))).join(", ")}`);}else if(c$4.length===1){g$1=c$4;let k=c$4[0];Prompt.Log.info(`Skill: ${e$1(B$1(k))}`),Prompt.Log.message(a$3(k.description));}else if(t$1.yes)g$1=c$4,Prompt.Log.info(`Installing all ${c$4.length} skills`);else {let k=[...c$4].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):B$1(L).localeCompare(B$1(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:B$1(K),hint:K.description.length>60?K.description.slice(0,57)+"...":K.description});}_=await Prompt.groupMultiselect({message:`Select skills to install ${a$3("(space to toggle)")}`,options:E,required:!0});}else {let L=k.map(E=>({value:E,label:B$1(E),hint:E.description.length>60?E.description.slice(0,57)+"...":E.description}));_=await Prompt.multiselect({message:"Select skills to install",options:L,required:!0});}Prompt.isCancel(_)&&(await fe(u),Prompt.cancel("Installation cancelled")),g$1=_;}let m=a$2(d$3),S=m?c$2(m,g$1.map(k=>B$1(k))):Promise.resolve(null),v$1,T=Object.keys(b$2),j$1=o$2?"global":"project",y=[];if(t$1.agent&&t$1.agent.length>0){let k=p(t$1.agent);k.length>0&&(Prompt.Log.error(`Invalid agents: ${k.join(", ")}`),Prompt.Log.info(`Valid agents: ${T.join(", ")}`),await fe(u),process.exit(1)),v$1=q$1(t$1.agent),t$1.agent.includes("*")&&Prompt.Log.info(`Installing to all ${v$1.length} agents`);}else {p$1.start("Loading agents...");let k=await c$3(),x=Object.keys(b$2).length;if(p$1.stop(`${x} agents`),k.includes("eve")&&(t$1.yes||!r$1.isAgent)){let _=t$1.yes?!0:await Prompt.confirm({message:io(g$1),initialValue:!0});if(Prompt.isCancel(_)&&(await fe(u),Prompt.cancel("Installation cancelled")),_)v$1=["eve"],Prompt.Log.info(`Installing to: ${e$1(Al)}`);else {let L=await vl({global:j$1==="global"});Prompt.isCancel(L)&&(await fe(u),Prompt.cancel("Installation cancelled")),y=L.locked,v$1=[...L.locked,...L.selected];}}else if(k.length===0)if(t$1.yes)v$1=T,Prompt.Log.info("Installing to all agents");else {Prompt.Log.info("Select agents to install skills to");let _=Object.entries(b$2).filter(([E])=>E!=="eve").map(([E,K])=>({value:E,label:K.displayName})),L=await uo("Which agents do you want to install to?",_);Prompt.isCancel(L)&&(await fe(u),Prompt.cancel("Installation cancelled")),v$1=L;}else if(k.length===1||t$1.yes)if(v$1=wl(k,j$1),k.length===1){let _=k[0];Prompt.Log.info(`Installing to: ${e$1(b$2[_].displayName)}`);}else Prompt.Log.info(`Installing to: ${k.map(_=>e$1(b$2[_].displayName)).join(", ")}`);else {let _=await vl({global:j$1==="global"});Prompt.isCancel(_)&&(await fe(u),Prompt.cancel("Installation cancelled")),y=_.locked,v$1=[..._.locked,..._.selected];}}t$1.subagent&&t$1.subagent.length>0&&!v$1.includes("eve")&&(v$1=[...v$1,"eve"]);let A=[void 0];if(v$1.includes("eve")){let k=f(process.cwd());if(t$1.subagent&&t$1.subagent.length>0)A=t$1.subagent.map(x=>x==="root"||x==="."?void 0:x);else if(k.length>0&&!t$1.yes){let x=[{value:"",label:"Root agent",hint:"agent/skills"},...k.map(L=>({value:L,label:L,hint:`agent/subagents/${L}/skills`}))],_=await Prompt.multiselect({message:"Where should Eve skills be installed?",options:x,initialValues:[""],required:!0});Prompt.isCancel(_)&&(await fe(u),Prompt.cancel("Installation cancelled")),A=_.map(L=>L===""?void 0:L);}}let R$1=ao(v$1,A),O=t$1.copy?"copy":"symlink";if(R$1.every(k=>k.agent==="eve"))O="copy";else if(t$1.copy||t$1.yes)O="copy";else {let k=await 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"}]});Prompt.isCancel(k)&&(await fe(u),Prompt.cancel("Installation cancelled")),O=k;}let N=process.cwd(),F=[],V=o$2?null:await t(N),Z=await Promise.all(g$1.flatMap(k=>R$1.map(async x=>{let _=await l(k.name,x.agent,{global:o$2,eveSubagent:x.subagent}),L=_.installed,E;try{E=await b$5(k.path);}catch{E=void 0;}let z=V?.skills[k.name]?.computedHash,Q=!Ft(!1,z,E),re=L&&_.mode==="copy"&&O==="copy"&&Q,pe=!!L;return {skillName:k.name,target:x,installed:L,installedMode:_.mode,sourceHash:E,upToDate:!!re,overwrite:pe}}))),ve=new Map,se=new Map;for(let{skillName:k,target:x,overwrite:_,upToDate:L}of Z)ve.has(k)||(ve.set(k,new Map),se.set(k,new Map)),ve.get(k).set(Mt(x),_),se.get(k).set(Mt(x),L);let X={},Ae=[];for(let k of g$1)if(k.pluginName){let x=k.pluginName;X[x]||(X[x]=[]),X[x].push(k);}else Ae.push(k);let xe=k=>{for(let x of k){F.length>0&&F.push("");let _=R$1[0];R$1.length>1&&(_=R$1.find(re=>o(re.agent,o$2?"global":"project"))??R$1[0]);let L=o$1(x.name,{global:o$2,agent:_.agent,eveSubagent:_.subagent}),E=ds(L,N);F.push(`${e$1(E)}`),F.push(...co(R$1,O,o$2,y));let K=ve.get(x.name),z=R$1.filter(Q=>!o(Q.agent,o$2?"global":"project")&&K?.get(Mt(Q))).map(ft);z.length>0&&F.push(` ${d$1("overwrites:")} ${$e(z)}`);}},ke=Object.keys(X).sort();for(let k of ke){let x=k.split("-").map(_=>_.charAt(0).toUpperCase()+_.slice(1)).join(" ");F.push(""),F.push(f$1(x)),xe(X[k]);}Ae.length>0&&(ke.length>0&&(F.push(""),F.push(f$1("General"))),xe(Ae)),console.log(),note(F.join(`
8
+ `),"Installation Summary");try{let k=await Promise.race([S,new Promise(x=>setTimeout(()=>x(null),so))]);if(k&&m){let x=no(k,g$1.map(_=>({slug:B$1(_),displayName:B$1(_)})),m);x.length>0&&note(x.join(`
9
+ `),"Security Risk Assessments");}}catch{}if(!t$1.yes){let k=await Prompt.confirm({message:"Proceed with installation?"});(Prompt.isCancel(k)||!k)&&(await fe(u),Prompt.cancel("Installation cancelled"));}p$1.start("Installing skills...");let Ie=[],qe=await Promise.all(g$1.map(async k=>{let x=new Map;for(let L of R$1){let E=g(L.agent,o$2,N,L.subagent),K=(L.agent==="eve"||L.agent==="easbot")&&O==="symlink",z=O==="copy"||K?E:e$2(o$2,N),Q=d$2(k.name||basename(k.path)),re=join(z,Q),pe=join(E,Q),M=re,Y=x.get(M);Y||(Y={canonicalDir:re,members:[]},x.set(M,Y)),Y.members.push({target:L,agentDir:pe});}return (await Promise.all([...x.values()].map(async L=>{let[E,...K]=L.members;if(!E)return [];if(se.get(k.name)?.get(Mt(E.target))??!1)return L.members.map(({target:pe,agentDir:M})=>({skill:B$1(k),agent:ft(pe),pluginName:k.pluginName,success:!0,path:M,canonicalPath:M,mode:O,skipped:!0,skippedReason:"up-to-date"}));let Q=await to(k,E.target,E.agentDir,{installMode:O,installGlobally:o$2,cwd:N,tempDir:u}),re=await Promise.all(K.map(async({target:pe,agentDir:M})=>{let Y=O==="copy"?await j(L.canonicalDir,M,{agentType:pe.agent}):await i$1(L.canonicalDir,M,{isGlobal:o$2,agentType:pe.agent,cwd:N,storePath:k.path});return {skill:B$1(k),agent:ft(pe),pluginName:k.pluginName,...Y}}));return [Q,...re]}))).flat()}));for(let k of qe)Ie.push(...k);p$1.stop("Installation complete"),console.log();let Ne=Ie.filter(k=>k.success),yt=Ie.filter(k=>!k.success),Ke={};for(let k of g$1)if(u&&k.path===u)Ke[k.name]="SKILL.md";else if(u&&k.path.startsWith(u+sep))Ke[k.name]=`${k.path.slice(u.length+1).split(sep).join("/")}/SKILL.md`;else if(u&&k.path.startsWith(u)){let x=u.split(sep).join("/"),_=k.path.split(sep).join("/");_.startsWith(`${x}/`)&&(Ke[k.name]=`${_.slice(x.length+1)}/SKILL.md`);}let Ve=a$2(d$3),As=eo(d$3.url,Ve);if(Ve&&(b$3(Ve)?f$2.then(x=>{x===!1&&d({event:"install",source:Ve,skills:g$1.map(_=>_.name).join(","),agents:v$1.join(","),...o$2&&{global:"1"},skillFiles:JSON.stringify(Ke)});}):d({event:"install",source:Ve,skills:g$1.map(x=>x.name).join(","),agents:v$1.join(","),...o$2&&{global:"1"},skillFiles:JSON.stringify(Ke)})),Ne.length>0&&o$2){let k=new Set(Ne.map(x=>x.skill));for(let x of g$1){if(!k.has(B$1(x)))continue;let{derivePluginSlug:_,findSkillByLocation:L$1,readStoreIndex:E}=await import('./store-UJPPYDBG.mjs'),K=L(d$3),z;{let Y=(await E()).markets[K],me=Y?.plugins&&Object.keys(Y.plugins).find(Te=>Y.plugins[Te]?.skills[x.name]);me?z=me.slice(K.length+1):z=_(d$3,void 0,x.pluginName);}let Q,re;{let M=await L$1(K,`${K}:${z}`,x.name);Q=M?.entry.computedHash,re=M?.entry.skillPath;}if(re===void 0){let M=d$3.type==="local"?d$3.localPath??d$3.url:d$3.url;if(x.path.startsWith(M))re=Filesystem.relative(M,x.path).replace(/^\/+/,"");else {let Y=Ke[x.name];Y&&(re=Filesystem.toUnixPath(Filesystem.dirname(Y)));}}Q===void 0&&(Q=await b$5(x.path));let pe=`${K}:${z}`;await r(x.name,{source:As||Ve||d$3.url,sourceType:d$3.type,ref:d$3.ref,...re&&{skillPath:re},computedHash:Q,marketId:K,pluginId:pe});}}if(Ne.length>0&&!o$2){let k=new Set(Ne.map(L=>L.skill)),x=v$1.includes("eve")?A.map(L=>L??""):void 0,_=x&&(x.length>1||x.some(L=>L!==""));for(let L$1 of g$1)if(k.has(B$1(L$1)))try{let{derivePluginSlug:E,findSkillByLocation:K,readStoreIndex:z}=await import('./store-UJPPYDBG.mjs'),Q=L(d$3),re=g$1.find(Te=>B$1(Te)===L$1.name),pe;{let Ce=(await z()).markets[Q],ye=Ce?.plugins&&Object.keys(Ce.plugins).find(Oe=>Ce.plugins[Oe]?.skills[L$1.name]);ye?pe=ye.slice(Q.length+1):pe=E(d$3,void 0,re?.pluginName);}let M,Y;{let Te=await K(Q,`${Q}:${pe}`,L$1.name);M=Te?.entry.computedHash,Y=Te?.entry.skillPath??Ke[L$1.name];}M===void 0&&(M=await b$5(L$1.path));let me=`${Q}:${pe}`;await v(L$1.name,{source:As||d$3.url,ref:d$3.ref,sourceType:d$3.type,...Y&&{skillPath:Y},computedHash:M,marketId:Q,pluginId:me,..._&&{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 me=M.pluginName;x[me]||(x[me]=[]),x[me].push(M);}else _.push(M);}let L=k.size,E=Ne.filter(M=>M.mode==="symlink"&&M.symlinkFailed),K=E.map(M=>M.agent),z=[],Q=M=>{for(let Y of M){let me=k.get(Y.skill)||[],Te=me[0];if(z.push(`${Symbol.statusIcon("success")} ${Y.skill}`),Te.canonicalPath){let ye=ds(Te.canonicalPath,N);z.push(` ${a$3("source:")} ${ye}`);}let Ce=new Map;for(let ye of me){if(ye.symlinkFailed||ye.skipped||Te.canonicalPath&&ye.path===Te.canonicalPath)continue;let Oe=ye.path;Ce.has(Oe)?Ce.get(Oe)!=="symlink"&&ye.mode==="symlink"&&Ce.set(Oe,"symlink"):Ce.set(Oe,ye.mode);}for(let[ye,Oe]of Ce){let un=ds(ye,N),gn=Oe==="symlink"?e$1("(link)"):a$3("(copied)");z.push(` ${a$3("target:")} ${un} ${gn}`);}z.push(...po(me,v$1,o$2));}},re=Object.keys(x).sort();for(let M of re){let Y=M.split("-").map(me=>me.charAt(0).toUpperCase()+me.slice(1)).join(" ");z.push(""),z.push(f$1(Y)),Q(x[M]);}_.length>0&&(re.length>0&&(z.push(""),z.push(f$1("General"))),Q(_));let pe=c$1(`Installed ${L} skill${L!==1?"s":""}`);note(z.join(`
10
+ `),pe),E.length>0&&(Prompt.Log.warn(d$1(`Symlinks failed for: ${$e(K)}`)),Prompt.Log.message(a$3(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(yt.length>0){console.log(),Prompt.Log.error(b$4(`Failed to install ${yt.length}`));for(let k of yt)Prompt.Log.message(` ${Symbol.statusIcon("error")} ${k.skill} \u2192 ${k.agent}: ${a$3(k.error??"")}`);}if(console.log(),Prompt.outro(c$1("Done!")+a$3(" Review skills before use; they run with full agent permissions.")),t$1.json){let k=Ne.map(_=>({skill:_.skill,agent:_.agent,canonicalPath:_.canonicalPath??null,path:_.path,mode:_.mode,..._.pluginName&&{pluginName:_.pluginName}})),x=yt.map(_=>({skill:_.skill,agent:_.agent,error:_.error??"unknown error"}));J(B({scope:o$2?"global":"project",source:d$3.url,sourceType:d$3.type,...d$3.subpath&&{subpath:d$3.subpath},...d$3.ref&&{ref:d$3.ref},installed:k,failed:x,summary:{total:Ie.length,installed:k.length,failed:x.length,agents:v$1,mode:O}},{scope:o$2?"global":"project",source:d$3.url,installed:k.length,failed:x.length,total:Ie.length,agents:v$1.length}));return}await fo(t$1,v$1);}catch(p){if(p instanceof g$1){Prompt.Log.error(b$4("Failed to clone repository"));for(let d of p.message.split(`
11
+ `))Prompt.Log.message(a$3(d));}else Prompt.Log.error(p instanceof Error?p.message:"Unknown error occurred");process.stdin.isTTY||l$1(),Prompt.outro(b$4("Installation failed")),process.exit(1);}finally{await fe(u);}}async function fe(e){if(e){if(ga(e))return;try{await l$1(e);}catch{}}}async function fo(e,t){if(process.stdin.isTTY&&!e?.yes)try{if(await w("findSkillsPrompt"))return;if(await k("eas-skill-find","claude-code",{global:!0})){await y$1("findSkillsPrompt");return}console.log(),Prompt.Log.message(a$3("One-time prompt - you won't be asked again if you dismiss."));let l=await Prompt.confirm({message:`Install the ${e$1("eas-skill-find")} skill? It helps your agent discover and suggest skills.`});if(Prompt.isCancel(l)){await y$1("findSkillsPrompt");return}if(l){await y$1("findSkillsPrompt");let o=t?.filter(r=>r!=="replit");if(!o||o.length===0)return;console.log(),Prompt.Log.step("Installing eas-skill-find skill...");try{await mt(["houjallen/agent-skills@skills/builtin/eas-skill-find"],{global:!0,yes:!0,agent:o});let r=join(e$2(!0),"eas-skill-find"),u=await rs({skillId:"eas-skill-find",sourceDir:r,targetAgents:o,installGlobally:!0,defaultMode:"symlink",assumeYes:e?.yes===!0});u.reported.length>0&&Prompt.Log.warn(`${u.reported.length} cell(s) reported divergent/orphan (not auto-fixed). Run 'easbot skills repair' to fix.`);}catch{Prompt.Log.warn("Failed to install eas-skill-find. You can try again with:"),Prompt.Log.message(a$3(" easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find -g -y --all"));}}else await y$1("findSkillsPrompt"),Prompt.Log.message(a$3("You can install it later with: easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find"));}catch{}}function Gt(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 Tl={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 ho=Tl.languages,ko=ho.filter(e=>e.supported).map(e=>e.value),Je={defaultLocale:"zh-CN",locales:ko},ht={},Kt=(e,t)=>{let s=ht[e]||{translation:{}};return ht[e]={translation:{...s.translation,...t.translation}},ht[e]},Ht=(e=Je.defaultLocale)=>(ht[e]||Kt(e,{translation:{}}),{locale:e,resources:ht[e]||{translation:{}}});var yo={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=yo;var $o={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"}},Il=$o;var bo=()=>{Ht("zh-CN"),Ht("en-US"),Kt("zh-CN",Ll),Kt("en-US",Il);};bo();var ms=new Map,hs=new Map,So=e=>{if(hs.has(e))return hs.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 hs.set(e,o),o},jl=(e,t)=>{if(!e||typeof e!="string")return "";if(!t||Object.keys(t).length===0)return e;let{regex:s,keys:n}=So(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)})},wo=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},Pl=e=>{if(!ms.has(e)){let{resources:t}=Ht(e);ms.set(e,t);}return ms.get(e)},vo=(e,t={})=>{let s=wo(t.locale),l=Pl(s)?.translation[e];if(l&&typeof l=="string"){let o=jl(l,t.vars);return o!=null?String(o):String(e)}if(s!==Je.defaultLocale){let r=Pl(Je.defaultLocale)?.translation[e];if(r&&typeof r=="string"){let u=jl(r,t.vars);return u!=null?String(u):String(e)}}return String(t.fallback??e)},b=vo;function Ao(e){let t=e[0]??"list",s=e.slice(1);return {subcommand:t,restArgs:s}}async function Nl(e,t={}){let{subcommand:s,restArgs:n}=Ao(e),l=xo(n,t);switch(s){case "list":return To(_l(n),l);case "clean":return Io(l);case "update":return _o(_l(n),l);case "remove":return Ro(n,l);case "--help":case "-h":return Cl(),0;default:return console.log(d$1(b("cli.store.unknown_subcommand",{vars:{sub:s},fallback:`Unknown store subcommand: ${s}`}))),Cl(),1}}async function Ol(e){if(!existsSync(e))return;let t=readdirSync(e,{withFileTypes:true});for(let s of t){if(s.name==="index.json")continue;let n=Filesystem.join(e,s.name);await rm(n,{recursive:true,force:true}).catch(()=>{});}}function _l(e){for(let t of e)if(t&&!t.startsWith("-"))return t}function xo(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 To(e,t={}){let s=await S(),n=await 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??Filesystem.join(J$1(),h),c=f?.type??"unknown",g=f?.url??"(local)",m=a$3("(n/a)");if(f?.cachePath)try{let T=readdirSync(f.cachePath);m=c$1(`${T.length} files`);}catch{m=b$4("missing");}r.push(`${f$1(C)} ${a$3("("+c+")")} ${g}`),r.push(` ${a$3("\u2514")} ${a$3("key="+w)} ${a$3("store="+$)} ${a$3("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(` ${a$3("\u2514")} ${e$1(y)} ${a$3("("+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:a$3(`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 Io(e={}){return e.force?Po(e):jo(e)}async function jo(e){await S();let s=await W(),n=Array.from(new Set(s.map(u=>u.marketId))),l=s.length;if(!e.yes&&!e.json&&process.stdin.isTTY){l>0&&Prompt.Log.warn(d$1(`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 Prompt.confirm({message:"Reset store (delete store contents + clear index.json)?"});if(Prompt.isCancel(u)||!u)return Prompt.cancel("Cancelled."),1}let o=J$1();await Ol(o);let r=Filesystem.join(o,"index.json");if(existsSync(r)){let{Filesystem:u}=await import('@easbot/utils');await u.writeJson(r,{version:6,markets:{}});}if(existsSync(o)&&await rm(Filesystem.normalize(o),{recursive:true,force:true}).catch(()=>{}),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:`${c$1(`\u2713 Reset store: ${o}${u} (cache preserved)`)}`});}return 0}async function Po(e){let t=await S(),s=await 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?d$1(` ${w} local source(s) cache = user directory; will be SKIPPED (never removed by force).`):"";Prompt.Log.warn(d$1(`This will reset store AND clear cache: ${n.length} source(s) / ${l} skill(s).${$}`));let c=await Prompt.confirm({message:"Reset store + clear cache (local sources protected)?"});if(Prompt.isCancel(c)||!c)return Prompt.cancel("Cancelled."),1}let u=J$1(),p=Filesystem.normalize(N()),d$2=Filesystem.normalize(u);for(let w of o){let $=Filesystem.normalize(w);if($.startsWith(d$2+"/")||$===d$2)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 Ol(u);let h=Filesystem.join(u,"index.json");if(existsSync(h)){let{Filesystem:w}=await import('@easbot/utils');await w.writeJson(h,{version:6,markets:{}});}let f=N(),C=false;if(existsSync(f)&&r.size>0?(await ja(),C=true):existsSync(f)&&(await ja(),C=true),existsSync(u)&&await rm(Filesystem.normalize(u),{recursive:true,force:true}).catch(()=>{}),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?a$3(` (${o.size} local source(s) cache preserved)`):"";q([],{emptyTitle:"Store clean (force)",outro:`${c$1(`\u2713 Reset store + cleared cache${w}`)}`});}return 0}async function _o(e,t={}){let s=await S(),n=await 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 Co(p,s,{...t});d.ok?(o++,u.push({sourceKey:p,skills:d.skills})):(r++,u.push({sourceKey:p,skills:[],cloneError:d.error}));}return 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&&Prompt.Log.warn(d$1(`${r} source(s) failed to refresh (clone errors); see above.`)),Prompt.outro(c$1(`\u2713 Refreshed ${o}/${l.size} store source(s)${e?` (source-key ${e.slice(0,8)}\u2026)`:""}`)),o>0&&Prompt.Log.info(a$3("Agent junctions refresh automatically; agents using copy mode need `skills update <skill>`."))),r>0?2:0}async function Co(e$1,t,s){let n=t.markets[e$1];if(!n)return {ok:false,error:`source key not found: ${e$1}`};let l=e(n.url);if(n.subpath&&(l.subpath=n.subpath),n.ref&&(l.ref=n.ref),false);let o=await da(l,{mode:"update"});return o.cloneError?{ok:false,error:o.cloneError.message}:{ok:true,skills:o.skills.map(r=>r.name)}}async function Ro(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):(Prompt.Log.error(b$4("Usage: skills store remove <source-key> [--force]")),1);let n=await S(),l=(await 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):(Prompt.Log.error(b$4(`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=Filesystem.join(J$1(),s),u=o.type==="local",p=u?` (local: ${Filesystem.normalize(o.url).replace(/[/\\]+$/,"")})`:"",d$1=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 Prompt.confirm({message:`Remove store source ${d$1}${p} (${l.length} skill(s))${f}${C}?`});(Prompt.isCancel(w)||!w)&&Prompt.cancel("Cancelled.");}let h=await S();if(h.markets[s]&&(delete h.markets[s],await Filesystem.writeJson(Filesystem.join(J$1(),"index.json"),h)),existsSync(r)&&await rm(r,{recursive:true,force:true}),!u&&t.force&&await ia({type:o.type,url:o.url,subpath:o.subpath,ref:o.ref}),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+=a$3(" [local: user directory preserved]"):t.force?f+=a$3(" (+ cache cleared)"):f+=a$3(" (cache preserved; use --force to clear)"),q([],{emptyTitle:"Store remove",outro:`${c$1(f)}`});}return 0}function Cl(){let e=(t,s,n)=>b(`cli.help.store.${t}`,{fallback:s,vars:n});console.log(`
14
+ ${f$1(e$1("skills store"))} - ${e("desc","Ops subcommands (store / cache management, store-centric)")}
15
+
16
+ ${f$1(e("usage_title","Usage:"))}
17
+ skills store list [keyword] ${e("list_desc","List store skills (optional name filter)")}
18
+ skills store clean ${e("clean_desc","Reset store: delete store dirs + clear index.json (cache preserved)")}
19
+ skills store clean --force ${e("clean_force_desc","Same + clear cache (local source cache protected)")}
20
+ skills store update [source-key] ${e("update_desc","Refresh store from source (no agent distribution touched; source-key = full 64-hex from `store list`)")}
21
+ skills store remove <key> ${e("remove_desc","Remove store source: delete store + index entries")}
22
+ skills store remove <key> --force ${e("remove_force_desc","Extra clear cache (remote sources; local source ignored)")}
23
+ skills store --help ${e("help_desc","This help")}
24
+
25
+ ${f$1(e("concepts_title","Concepts:"))}
26
+ - store = \`<storeRoot>/<sourceKey>/\` ${e("concept_store","normalized source dir (write once, reuse)")}
27
+ - cache = \`<cacheRoot>/<owner>/<repo>/\` ${e("concept_cache","download/materialize cache (remote only; local = user dir)")}
28
+ - index = \`<storeRoot>/index.json\` ${e("concept_index","store defs index (key = skillName)")}
29
+
30
+ ${f$1(e("local_protection_title","Local source protection (hard rule):"))}
31
+ - ${e("local_clean","`store clean --force` skips local source cache (user directory never deleted)")}
32
+ - ${e("local_remove_force","`store remove --force` for local source is same as default (cache skipped)")}
33
+ - ${e("local_remove","`store remove` for local source deletes store + index only, never user directory")}
34
+
35
+ ${f$1(e("options_title","Options:"))}
36
+ -y, --yes ${e("opt_yes","Skip confirmation prompts")}
37
+ --force ${e("opt_force","`clean` / `remove`: extra clear cache (local source ignored)")}
38
+ --json ${e("opt_json","Output as JSON (machine-readable)")}
39
+
40
+ ${f$1(e("examples_title","Examples:"))}
41
+ ${a$3("$")} skills store list
42
+ ${a$3("$")} skills store list eas-skill-find
43
+ ${a$3("$")} skills store list --json
44
+ ${a$3("$")} skills store clean
45
+ ${a$3("$")} skills store clean --force
46
+ ${a$3("$")} skills store update
47
+ ${a$3("$")} skills store update <full-source-key-from-list>
48
+ ${a$3("$")} skills store remove a1b2c3d4e5f67890
49
+ ${a$3("$")} skills store remove a1b2c3d4e5f67890 --force
50
+ ${a$3("$")} skills store clean -y --json
51
+ `);}var zt=Log.create({service:"skills-find"}),Do=process.env.SKILLS_API_URL||"https://skills.sh";function Dl(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 Uo=/^[a-z0-9](?:[a-z0-9-]{0,38})$/i;function Fo(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(!Uo.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 Ul(e,t){try{let s=new URLSearchParams({q:e,limit:"10"});t&&s.set("owner",t);let n=`${Do}/api/search?${s.toString()}`,l=await fetch(n);return l.ok?(await l.json()).skills.map(r=>({name:b$6(r.name),slug:b$6(r.id),source:b$6(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 Mo(e){let t=await W(),s=e?.toLowerCase().trim()??"",n=await 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 Go(e,t){let s=[];try{for await(let o of 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=Ko(e,o),u=await y(r);if(!u)continue;let p=u.name;if(n&&!p.toLowerCase().includes(n))continue;let d=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 Ko(e,t){let s=process.platform==="win32"?"\\":"/",n=t.replaceAll("/",s);return e.endsWith("/")||e.endsWith("\\")?e+n:e+s+n}var Ho="\x1B[?25l",Wo="\x1B[?25h",zo="\x1B[J",Bo=e=>`\x1B[${e}A`,Jo=e=>`\x1B[${e}G`;async function Yo(e="",t){let s=[],n=0,l=e,o=false,r=null,u=0;process.stdin.isTTY&&process.stdin.setRawMode(true),El.emitKeypressEvents(process.stdin),process.stdin.resume(),process.stdout.write(Ho);function p(){u>0&&process.stdout.write(Bo(u)+Jo(1)),process.stdout.write(zo);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=Dl(c.installs),j=T?` ${Le}${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 Ul(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(Wo),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 qo(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 Vo(e,t){return await c(e,t)===false}async function Xo(e,t,s={}){let n=typeof s.path=="string"&&s.path.length>0,l=n?s.path:J$1(),o,r;if(n?(o=await Go(l,e||void 0),r="scan"):(o=await Mo(e||void 0),r="index"),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(`${Le}${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$1=await S(),h=new Map(Object.values(d$1.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} ${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)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 Fl(e){let{query:t,options:s,errors:n}=Fo(e),l=s.owner,o=!process.stdin.isTTY;zt.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
+ ${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 Xo(t,s.json??false,s);if(t){zt.debug("runFind enter query branch",{query:t,owner:l,json:s.json});let $=await Ul(t,l);if(zt.debug("runFind searchSkillsAPI returned",{count:$.length}),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=Dl(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 Nt())return console.log(r),console.log(),console.log(`${a}Usage: easbot skills find <query> [--owner <owner>]${i}`),0;let u=await Yo("",l);if(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$1=u.name;console.log(),console.log(`${U}Installing ${G}${d$1}${i} from ${a}${p}${i}...`),console.log();let{source:h,options:f}=Gt([p,"--skill",d$1]),C=0;try{await mt(h,f);}catch($){C=1,zt.error("runAdd failed during find\u2192install",{err:$});}console.log();let w=qo(p);return w&&await Vo(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 ks(e,t){let s=homedir();return e.startsWith(s)?e.replace(s,"~"):e.startsWith(t)?"."+e.slice(t.length):e}function ys(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 Qo(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 ei(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":(e.all===true,"both")}async function Ml(e,t={}){let s$1=Qo(e),n=t.cwd??process.cwd();s$1.all===true&&(!s$1.agent||s$1.agent.length===0)&&(s$1.agent=["*"]);let l=ei(s$1),o;if(s$1.agent&&s$1.agent.length>0){let m=p(s$1.agent);if(m.length>0){let S=Object.keys(b$2);console.log(`${nt}Invalid agents: ${m.join(", ")}${i}`),console.log(`${a}Valid agents: ${S.join(", ")}${i}`),process.exit(1);}o=q$1(s$1.agent);}let r=await s({scope:l,agentFilter:o,cwd:n}),u$1=s$1.json?await W():[],p$1=s$1.json?await S():{markets:{}};if(s$1.json){let m=new Map;for(let T of u$1)m.has(T.skillName)||m.set(T.skillName,T);let S=new Map(Object.values(p$1.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=>b$2[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 u(),h=l==="both"?"All":l==="global"?"Global":"Project";if(r.length===0){if(s$1.json){J(B([],{count:0,scope:l,agentFilter:o?[...o]:null}));return}q([`${a}No skills found.${i}`],{emptyTitle:`${h} Skills`,outro:`${`${nt}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=ks(A.canonicalPath,n),O=A.agents.map(N=>b$2[N].displayName),D=A.agents.length>0?ys(O):`${nt}not linked${i}`;g.push(`${Le}${b$6(A.name)}${i}${j} ${a}${R}${i} ${a}Agents:${i} ${D}`);}else {g.push(`${Le}${b$6(m)}${i}${j}${y}`);for(let A of S){let R=ks(A.canonicalPath,n),O=A.agents.map(N=>b$2[N].displayName),D=A.agents.length>0?ys(O):`${nt}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 Hl(e,t){let s=await lt(),n=t.yes||s.isAgent;if(s.isAgent&&Prompt.Log.info(Rt(s.agent.name)+" Agent detected \u2014 removing non-interactively"),t.global===void 0&&!n&&process.stdin.isTTY&&!s.isAgent){let y=await 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)"}]});Prompt.isCancel(y)&&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:()=>""}:Prompt.spinner();r||u.start("Scanning for installed skills...");let{scanInstalledSkillDirs:p$1}=await import('./scan-6W47D2KJ.mjs'),d$3;if(t.agent&&t.agent.length>0){let y=q$1(t.agent),A=p(t.agent);A.length>0&&(console.log(`Invalid agents: ${A.join(", ")}`),console.log(`Valid agents: ${Object.keys(b$2).join(", ")}`),process.exit(1)),d$3=y;}let h=await p$1({scope:l?"global":"project",cwd:o,agentFilter:d$3}),f$3=new Set;for(let y of h)f$3.add(y.name);let C=Array.from(f$3).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=D(t.skill,C);y.length>0&&(process.stdout.write(`Invalid skills: ${y.join(", ")}
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=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 Prompt.multiselect({message:`Select skills to remove ${a$3("(space to toggle)")}`,options:y,required:true});Prompt.isCancel(A)&&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=>b$2[D]?.displayName??D),R=D=>D.length<=5?D.join(", "):`${D.slice(0,5).join(", ")} +${D.length-5} more`;console.log(),Prompt.Log.warn(d$1(`About to remove ${w.length} skill(s) from ${g.length} agent(s):`)),console.log(),console.log(` ${a$3("Scope:")} ${y}`),console.log(` ${a$3("Agents ("+g.length+"):")}`),console.log(` ${Symbol.colorize(Symbol.bar.bullet,"error")} ${R(A)}`),console.log(` ${a$3("Skills ("+w.length+"):")}`);for(let D of w)console.log(` ${b$4("\u2022")} ${D}`);console.log(),console.log(a$3(" Each skill will be uninstalled from every targeted agent.")),console.log();let O=await Prompt.confirm({message:"Continue? (y/N)"});(Prompt.isCancel(O)||!O)&&Prompt.cancel("Removal cancelled");}u.start("Removing skills...");let m$1=[];for(let y of w)try{let A=o$1(y,{global:l,cwd:o});for(let se of g){let X=b$2[se],Ae=m(y,se,{global:l,cwd:o}),xe=new Set([Ae]),ke=d$2(y);if(l&&X.globalSkillsDir)xe.add(join(X.globalSkillsDir,ke));else if(xe.add(join(o,X.skillsDir,ke)),se==="eve")for(let Ie of f(o))xe.add(join(f$2(Ie,o),ke));for(let Ie of xe)if(Ie!==A)try{await lstat(Ie).catch(()=>null)&&await rm(Ie,{recursive:!0,force:!0});}catch(qe){Prompt.Log.warn(`Could not remove skill from ${X.displayName}: ${qe instanceof Error?qe.message:String(qe)}`);}}let O=(await c$3()).filter(se=>!g.includes(se)),D=!1;for(let se of O){let X=m(y,se,{global:l,cwd:o});if(await lstat(X).catch(()=>null)){D=!0;break}}D||await rm(A,{recursive:!0,force:!0});let N=l?await t$1(y):null,F=await ti(y),V=F?(await S()).markets[F.marketId]:void 0,Z=V?.url??N?.source??"local",ve=V?.type??N?.sourceType??"local";l?await s$1(y):await w$1(y,o),m$1.push({skill:y,success:!0,source:Z,sourceType:ve,...F?.marketId&&{sourceKey:F.marketId},...V?.storePath&&{storePath:V.storePath}});}catch(A){m$1.push({skill:y,success:false,error:A instanceof Error?A.message:String(A)});}u.stop("Removal process complete");let S$1=m$1.filter(y=>y.success),v=m$1.filter(y=>!y.success);if(S$1.length>0){let y=new Map;for(let A of S$1){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)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$1.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$1.length,removed:S$1.length,failed:v.length,agents:g}},{count:m$1.length,scope:l?"global":"project",removed:S$1.length,failed:v.length,agents:g.length}));return}let j=[];j.push(` ${a$3(f$1(T))}`);for(let y of S$1)j.push(` ${c$1("\u2713")} ${y.skill}`);if(S$1.length>0&&(j.push(""),j.push(`${Symbol.statusIcon("success")} Successfully removed ${S$1.length} skill(s)`)),v.length>0){j.push(""),j.push(`${Symbol.statusIcon("error")} Failed to remove ${v.length} skill(s)`);for(let y of v)j.push(` ${Symbol.statusIcon("error")} ${y.skill}: ${y.error}`);}q(j,{title:`${T} Removal${S$1.length>0?` (${S$1.length} removed)`:""}`,outro:c$1("Done!")});}async function ti(e){return (await X(e))[0]}function Wl(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 ii(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 ri(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":("both")}function ai(e,t,s){let n=b$2[e];if(t){if(n.globalSkillsDir!==void 0)return n.globalSkillsDir;let l=a$4("os").homedir();return Filesystem.join(l,n.skillsDir)}return Filesystem.join(s,n.skillsDir)}async function zl(e,t={}){let s=t.cwd??process.cwd(),n=ii(e),l=ri(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=i$2(c);for(let m of g){if(m==="eve"||r&&!r.has(m))continue;let S=c==="global";try{let v=ai(m,S,s);p.push({agent:m,isGlobal:S,baseDir:v});}catch{}}}let d=[];for(let c of p){let g;try{g=readdirSync(c.baseDir);}catch{continue}for(let m of g){if(m.startsWith("."))continue;let S=Filesystem.join(c.baseDir,m),v;try{v=lstatSync(S);}catch{continue}if(!v.isSymbolicLink())continue;let T;try{T=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=Filesystem.join(c.baseDir,c.name);try{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 ki=new Set(["metadata.json"]),yi=new Set([".git","__pycache__","__pypackages__"]),Ss={"claude-code":{command:"claude",args:[]},codex:{command:"codex",args:[]}},Ql=Object.keys(Ss);function en(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(...xi(s.agent)),{source:t,options:s,errors:n}}function $i(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
+ ${e.skillMd}
58
+ </SKILL.md>`];return e.hasSupportingFiles&&e.supportDir&&t.push(`Supporting files for this skill were downloaded to:
59
+ ${e.supportDir}
60
+
61
+ When the SKILL.md references relative paths, read them from that directory.`),t.join(`
62
+
63
+ `)+`
64
+ `}async function bi(e){let t=await mkdtemp(join(tmpdir(),"skills-use-")),s=join(t,d$2(e.directoryName||e.name));if(!ws(t,s))throw new Error("Invalid skill name: potential path traversal detected");await mkdir(s,{recursive:true}),e.kind==="blob"?await Ti(s,e.files):e.kind==="well-known"?await Li(s,e.files):await rn(e.path,s);let n=e.rawContent??await readFile(join(s,"SKILL.md"),"utf-8"),l=await an(s,s);return {tempRoot:t,skillDir:s,skillMd:n,hasSupportingFiles:l}}async function tn(e$1,t={},s=[]){let n$1=null;try{if(t.help){console.log(ql());return}s.length>0&&Re(s.join(`
65
+ `)),e$1.length===0&&Re(`Missing required argument: source
66
+
67
+ ${ql()}`),e$1.length>1&&Re(`Expected one source, received ${e$1.length}: ${e$1.join(", ")}`);let l=t.agent?.[0];l&&!Ss[l]&&Re(nn(l));let o=e$1[0],r=e(o);a$2(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 n.fetchAllSkills(r.url);f=Ai($,d,o);}else {let $,c=null;if(r.type==="local")existsSync(r.localPath)||Re(`Local path does not exist: ${r.localPath}`),$=await A(r.localPath,r.subpath,{includeInternal:h,fullDepth:t.fullDepth});else if(r.type==="github"&&!t.fullDepth){let m=a$2(r),S=m?.split("/")[0]?.toLowerCase();m&&S&&d$3.includes(S)&&(c=await l$2(m,{subpath:r.subpath,ref:r.ref,getToken:p$1,includeInternal:h})),c?$=c.skills:(n$1=await k$1(r.url,r.ref),$=await A(n$1,r.subpath,{includeInternal:h,fullDepth:t.fullDepth}));}else n$1=await k$1(r.url,r.ref),$=await A(n$1,r.subpath,{includeInternal:h,fullDepth:t.fullDepth});let g=vi($,d,o);c&&Ii(g)?f={kind:"blob",name:g.name,directoryName:g.name,rawContent:g.rawContent??ji(g.files),files:g.files}:f={kind:"disk",name:g.name,directoryName:g.name,rawContent:g.rawContent,path:g.path};}let C=await bi(f);await Vl(n$1),n$1=null;let w=$i({skillMd:C.skillMd,supportDir:C.skillDir,hasSupportingFiles:C.hasSupportingFiles});if(t.json&&!l){J(B({skill:f.name,source:e$1[0],agent:l??null,tempRoot:C.tempRoot,skillDir:C.skillDir,prompt:w},{kind:f.kind}));return}if(l){let $=await Si(l,w);$!==0&&process.exit($);return}process.stdout.write(w);}catch(l){await Vl(n$1),l instanceof g$1&&Re(l.message),l instanceof we&&Re(l.message),Re(l instanceof Error?l.message:"Unknown error");}}async function Si(e,t,s=wi){let n=Ss[e];if(!n)throw new we(nn(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 we(`Could not launch ${b$2[e].displayName}: command not found: ${n.command}`));return}o(p);}}),r.on("close",p=>{u||(u=true,l(p??1));});})}function wi(e,t){return spawn(e,t,{stdio:"inherit"})}function ql(){return `Usage: skills use <source>[@<skill>] [options]
69
+
70
+ Generate a prompt for using one skill without installing it.
71
+
72
+ Options:
73
+ -s, --skill <skill> Select the skill to use
74
+ -a, --agent <agent> Start one supported agent interactively (${Ql.join(", ")})
75
+ --full-depth Search nested directories like skills add --full-depth
76
+ --dangerously-accept-openclaw-risks
77
+ Allow unverified OpenClaw community skills
78
+ -h, --help Show this help message
79
+
80
+ Examples:
81
+ skills use houjallen/agent-skills@web-design-guidelines | claude
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 vi(e,t,s){if(e.length===0)throw new we("No valid skills found. Skills require a SKILL.md with name and description.");if(!t){if(e.length===1)return e[0];throw new we(sn(s,e.map(B$1)))}let n=C(e,[t]);if(n.length===0)throw new we(ln(t,e.map(B$1)));if(n.length>1)throw new we(`Skill selector "${t}" matched multiple skills.`);return n[0]}function Ai(e,t,s){if(e.length===0)throw new we("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 we(ln(t,e.map(o=>o.installName)));if(n.length>1)throw new we(`Skill selector "${t}" matched multiple skills.`)}else {if(e.length!==1)throw new we(sn(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 sn(e,t){return ["This source contains multiple skills. Specify exactly one skill:",...t.map(s=>` - ${s}`),"",`Examples:
84
+ skills use ${e}@${t[0]??"<skill>"}
85
+ skills use ${e} --skill ${t[0]??"<skill>"}`].join(`
86
+ `)}function ln(e,t){return [`No matching skill found for: ${e}`,"Available skills:",...t.map(s=>` - ${s}`)].join(`
87
+ `)}function xi(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=p(e);if(s.length>0){let n=Object.keys(b$2);t.push(`Invalid agents: ${s.join(", ")}
88
+ Valid agents: ${n.join(", ")}`);}return t}function nn(e){return [`Running ${b$2[e].displayName} is not supported yet.`,`Supported agents for skills use --agent: ${Ql.join(", ")}`].join(`
89
+ `)}async function Ti(e,t){for(let s of t)await on(e,s.path,s.contents);}async function Li(e,t){for(let[s,n]of t)await on(e,s,n);}async function on(e,t,s){let n=join(e,t);ws(e,n)&&(await mkdir(dirname(n),{recursive:true}),typeof s=="string"?await writeFile(n,s,"utf-8"):await writeFile(n,s));}async function rn(e,t){await mkdir(t,{recursive:true});let s=await readdir(e,{withFileTypes:true});await Promise.all(s.filter(n=>!Pi(n.name,n.isDirectory())).map(async n=>{let l=join(e,n.name),o=join(t,n.name);if(ws(t,o)){if(n.isDirectory()){await rn(l,o);return}try{await 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 an(e,t){let s=await readdir(t,{withFileTypes:true});for(let n of s){let l=join(t,n.name),o=relative(e,l).split(sep).join("/");if(n.isDirectory()){if(await an(e,l))return true}else if(o.toLowerCase()!=="skill.md")return true}return false}function Ii(e){return Array.isArray(e.files)}function ji(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 Pi(e,t){return ki.has(e)||t&&yi.has(e)}function ws(e,t){let s=normalize(resolve(e)),n=normalize(resolve(t));return n.startsWith(s+sep)||n===s}async function Vl(e){e&&await l$1(e).catch(()=>{});}function Re(e){console.error(e),process.exit(1);}var we=class extends Error{};var Ci={"zh-CN":loadTextFile("./template/skill-template-zh-CN.txt",import.meta.url),"en-US":loadTextFile("./template/skill-template-en-US.txt",import.meta.url)};function Ri(e){return e.split(/[-_\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ni(e){return Ci[e]()}var Oi=/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;function pn(e,t){let s=formatLocalISO(new Date,false).slice(0,10),n={skill_name:t,skill_title:Ri(t),version:"1.0.0",date:s};return Ni(e).replace(Oi,(o,r)=>Object.hasOwn(n,r)?n[r]:o)}function Mi(e){return e&&xl(e),e??"0.0.0"}function at(e){return resolveLocaleLang(e?.locale)}function Gi(e){let t=at(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 Ap(e){let t=at(e),s=(n,l)=>a+b(n,{locale:t,fallback:l})+i;console.log(`
90
+ ${G}${b("cli.help.usage",{locale:t,fallback:"Usage: skills <command> [options]"})}${i}
91
+
92
+ ${G}${b("cli.help.section.manage",{locale:t,fallback:"Manage Skills"})}${i}:
93
+ add <source> Add a skill package (alias: a).
94
+ <source> accepts 4 forms:
95
+ <owner>/<repo> e.g. houjallen/agent-skills
96
+ GitHub URL e.g. https://github.com/houjallen/agent-skills
97
+ local path e.g. ./skills/foo or /abs/path/to/skills
98
+ .well-known URL served from /.well-known/agent-skills/index.json
99
+ use <package>@<skill>
100
+ Generate a prompt for using one skill without installing it
101
+ remove [skills] Remove installed skills
102
+ list, ls List installed skills
103
+ find [query] Search for skills interactively
104
+ doctor, dr Check & cleanup broken links (scope: -g/-p, default both)
105
+
106
+ ${G}${b("cli.help.section.updates",{locale:t,fallback:"Updates"})}${i}:
107
+ update [skills...] Update skills to latest versions (alias: upgrade)
108
+
109
+ ${G}${b("cli.help.section.maintenance",{locale:t,fallback:"Maintenance (Operations)"})}${i}:
110
+ store <subcommand> Manage store sources (store + cache + index):
111
+ list [keyword] List store skills (optional name filter)
112
+ clean [--force] Reset store (--force also clears cache)
113
+ update [keyword] Refresh store from source
114
+ remove <key> [--force] Drop store source (--force also clears cache)
115
+
116
+ ${G}${b("cli.help.section.update_options",{locale:t,fallback:"Update Options"})}${i}:
117
+ -g, --global ${b("cli.help.update.flag.global",{locale:t,fallback:"Update global skills only"})}
118
+ -p, --project ${b("cli.help.update.flag.project",{locale:t,fallback:"Update project skills only"})}
119
+ -y, --yes ${b("cli.help.update.flag.yes",{locale:t,fallback:"Skip scope prompt (defaults to both project + global)"})}
120
+ --all ${b("cli.help.update.flag.all",{locale:t,fallback:"Shorthand for --skill '*' -y (update all installed skills)"})}
121
+ --force ${b("cli.help.update.flag.force",{locale:t,fallback:"Skip SKILL.md hash check; reinstall every selected skill"})}
122
+
123
+ ${G}${b("cli.help.section.project",{locale:t,fallback:"Project"})}${i}:
124
+ init [name] Initialize a skill (creates <name>/SKILL.md or ./SKILL.md)
125
+ store <subcommand> Manage store sources (store + cache + index; --force clears cache)
126
+
127
+ ${G}${b("cli.help.section.list_options",{locale:t,fallback:"List Options"})}${i}:
128
+ -g, --global ${b("cli.help.list.flag.global",{locale:t,fallback:"List global skills (default: project)"})}
129
+ -p, --project ${b("cli.help.list.flag.project",{locale:t,fallback:"List project skills only"})}
130
+ -a, --agent <agents> ${b("cli.help.list.flag.agent",{locale:t,fallback:"Filter by specific agents (use '*' for all agents)"})}
131
+ --json ${b("cli.help.list.flag.json",{locale:t,fallback:"Output as JSON (machine-readable, no ANSI codes)"})}
132
+ --all ${b("cli.help.list.flag.all",{locale:t,fallback:"Shorthand for --agent *"})}
133
+
134
+ ${G}${b("cli.help.section.find_options",{locale:t,fallback:"Find Options"})}${i}:
135
+ --owner <owner> ${b("cli.help.find.flag.owner",{locale:t,fallback:"Search only repositories from a GitHub owner"})}
136
+ --json Output as JSON (machine-readable, no ANSI codes)
137
+
138
+ ${G}${b("cli.help.section.add_options",{locale:t,fallback:"Add Options"})}${i}:
139
+ -g, --global ${b("cli.help.add.flag.global",{locale:t,fallback:"Install skill globally (user-level) instead of project-level"})}
140
+ -a, --agent <agents> ${b("cli.help.add.flag.agent",{locale:t,fallback:"Specify agents to install to (use '*' for all agents)"})}
141
+ -s, --skill <skills> ${b("cli.help.add.flag.skill",{locale:t,fallback:"Specify skill names to install (use '*' for all skills)"})}
142
+ -l, --list ${b("cli.help.add.flag.list",{locale:t,fallback:"List available skills in the repository without installing"})}
143
+ -y, --yes ${b("cli.help.add.flag.yes",{locale:t,fallback:"Skip confirmation prompts"})}
144
+ --copy ${b("cli.help.add.flag.copy",{locale:t,fallback:"Copy files instead of symlinking to agent directories"})}
145
+ --subagent <names> ${b("cli.help.add.flag.subagent",{locale:t,fallback:"Install to Eve subagents (use 'root' for the root agent)"})}
146
+ --all ${b("cli.help.add.flag.all",{locale:t,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
147
+ --full-depth ${b("cli.help.add.flag.full_depth",{locale:t,fallback:"Search all subdirectories even when a root SKILL.md exists"})}
148
+ --json Output as JSON (machine-readable, no ANSI codes)
149
+
150
+ ${G}${b("cli.help.section.update_options",{locale:t,fallback:"Update Options"})}${i}:
151
+ -g, --global ${b("cli.help.update.flag.global",{locale:t,fallback:"Update global skills only"})}
152
+ -p, --project ${b("cli.help.update.flag.project",{locale:t,fallback:"Update project skills only"})}
153
+ -y, --yes ${b("cli.help.update.flag.yes",{locale:t,fallback:"Skip scope prompt (defaults to both project + global)"})}
154
+ --all ${b("cli.help.update.flag.all",{locale:t,fallback:"Shorthand for --skill '*' -y (update all installed skills)"})}
155
+ --force ${b("cli.help.update.flag.force",{locale:t,fallback:"Skip SKILL.md hash check; reinstall every selected skill"})}
156
+ --json Output as JSON (machine-readable, no ANSI codes)
157
+
158
+ ${G}${b("cli.help.section.remove_options",{locale:t,fallback:"Remove Options"})}${i}:
159
+ -g, --global ${b("cli.help.remove.flag.global",{locale:t,fallback:"Remove from global scope"})}
160
+ -a, --agent <agents> ${b("cli.help.remove.flag.agent",{locale:t,fallback:"Remove from specific agents (use '*' for all agents)"})}
161
+ -s, --skill <skills> ${b("cli.help.remove.flag.skill",{locale:t,fallback:"Specify skills to remove (use '*' for all skills)"})}
162
+ -y, --yes ${b("cli.help.remove.flag.yes",{locale:t,fallback:"Skip confirmation prompts"})}
163
+ --all ${b("cli.help.remove.flag.all",{locale:t,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
164
+ --json Output as JSON (machine-readable, no ANSI codes)
165
+
166
+ ${G}${b("cli.help.section.doctor_options",{locale:t,fallback:"Doctor Options"})}${i}:
167
+ -g, --global ${b("cli.help.doctor.flag.global",{locale:t,fallback:"Check global scope only"})}
168
+ -p, --project ${b("cli.help.doctor.flag.project",{locale:t,fallback:"Check project scope only"})}
169
+ -a, --agent <agents> ${b("cli.help.doctor.flag.agent",{locale:t,fallback:"Check specific agents (use '*' for all)"})}
170
+ -y, --yes ${b("cli.help.doctor.flag.yes",{locale:t,fallback:"Skip confirm; remove broken links directly"})}
171
+ --all ${b("cli.help.doctor.flag.all",{locale:t,fallback:"Shorthand for --agent *"})}
172
+ --json Output as JSON (machine-readable, no ANSI codes)
173
+
174
+ ${G}${b("cli.help.section.use_options",{locale:t,fallback:"Use Options"})}${i}:
175
+ -s, --skill <skill> ${b("cli.help.use.flag.skill",{locale:t,fallback:"Specify the skill to use"})}
176
+ -a, --agent <agent> ${b("cli.help.use.flag.agent",{locale:t,fallback:"Start one supported agent interactively"})}
177
+ --full-depth ${b("cli.help.use.flag.full_depth",{locale:t,fallback:"Search all subdirectories even when a root SKILL.md exists"})}
178
+ --dangerously-accept-openclaw-risks
179
+ ${b("cli.help.use.flag.openclaw_risks",{locale:t,fallback:"Allow unverified OpenClaw community skills"})}
180
+ --json Output as JSON (machine-readable, no ANSI codes)
181
+
182
+ ${G}${b("cli.help.section.options",{locale:t,fallback:"Options"})}${i}:
183
+ --help, -h Show this help message
184
+ --version, -v Show version number
185
+
186
+ ${G}Examples:${i}
187
+ ${a}$${i} easbot-skills add houjallen/agent-skills ${s("cli.example.add","Add a skill package")}
188
+ ${a}$${i} easbot-skills use houjallen/agent-skills@houjallen | claude ${s("cli.example.use","Use a skill one-shot")}
189
+ ${a}$${i} easbot-skills use houjallen/agent-skills --skill houjallen --agent claude ${s("cli.example.use_with_agent","Specify skill + agent")}
190
+ ${a}$${i} easbot-skills add houjallen/agent-skills -g ${s("cli.example.add_global","Install globally")}
191
+ ${a}$${i} easbot-skills add houjallen/agent-skills --agent claude-code cursor ${s("cli.example.add_multi_agent","Install to multiple agents")}
192
+ ${a}$${i} easbot-skills add houjallen/agent-skills --skill pr-review commit ${s("cli.example.add_multi_skill","Install multiple skills")}
193
+ ${a}$${i} easbot-skills remove ${a}# ${s("cli.example.remove_interactive","Interactive remove")}${i}
194
+ ${a}$${i} easbot-skills remove web-design ${a}# ${s("cli.example.remove_by_name","Remove by name")}${i}
195
+ ${a}$${i} easbot-skills rm --global frontend-design
196
+ ${a}$${i} easbot-skills list ${a}# ${s("cli.example.list_project","List project skills")}${i}
197
+ ${a}$${i} easbot-skills ls -g ${a}# ${s("cli.example.list_global","List global skills")}${i}
198
+ ${a}$${i} easbot-skills ls -a claude-code ${a}# ${s("cli.example.list_filter_agent","Filter by agent")}${i}
199
+ ${a}$${i} easbot-skills ls --json ${a}# ${s("cli.example.list_json","JSON output")}${i}
200
+ ${a}$${i} easbot-skills find ${a}# ${s("cli.example.find_interactive","Interactive search")}${i}
201
+ ${a}$${i} easbot-skills find typescript ${a}# ${s("cli.example.find_keyword","Search by keyword")}${i}
202
+ ${a}$${i} easbot-skills find react --owner houjallen ${a}# ${s("cli.example.find_owner","Search within an owner")}${i}
203
+ ${a}$${i} easbot-skills update
204
+ ${a}$${i} easbot-skills update my-skill ${a}# ${s("cli.example.update_one","Update a single skill")}${i}
205
+ ${a}$${i} easbot-skills update -g ${a}# ${s("cli.example.update_global","Update global skills only")}${i}
206
+ ${a}$${i} easbot-skills init my-skill ${a}# ${s("cli.example.init","Create a new skill")}${i}
207
+ ${a}$${i} easbot-skills store list ${a}# ${s("cli.example.store_list","List store skills")}${i}
208
+ ${a}$${i} easbot-skills store clean --force ${a}# ${s("cli.example.store_clean_force","Reset store + clear cache")}${i}
209
+ ${a}$${i} easbot-skills doctor ${a}# ${s("cli.example.doctor","Check & cleanup dangling symlinks (interactive)")}${i}
210
+ ${a}$${i} easbot-skills doctor -a easbot -y ${a}# ${s("cli.example.doctor_agent_yes","Check one agent + auto-cleanup")}${i}
211
+
212
+ ${a}${b("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}
213
+ `);}function Ki(e){let t=at(e);console.log(`
214
+ ${G}${b("cli.help.doctor.usage",{locale:t,fallback:"Usage: easbot skills doctor [options]"})}${i}
215
+
216
+ ${G}Description:${i}
217
+ ${b("cli.help.doctor.description",{locale:t,fallback:"Check + cleanup dangling symlinks in agent baseDirs (scan only by default; use --yes to clean). Future: skill validation, llm review, etc."})}
218
+
219
+ ${G}Scope (tri-state, same as list / update):${i}
220
+ -g, --global ${b("cli.help.doctor.flag.global",{locale:t,fallback:"Check global scope only"})}
221
+ -p, --project ${b("cli.help.doctor.flag.project",{locale:t,fallback:"Check project scope only"})}
222
+ ${a}(default: both \u2014 scan project + global)${i}
223
+
224
+ ${G}Filter:${i}
225
+ -a, --agent <agents> ${b("cli.help.doctor.flag.agent",{locale:t,fallback:"Target agents (repeatable; use * for all)"})}
226
+ --all ${b("cli.help.doctor.flag.all",{locale:t,fallback:"Shorthand for --agent *"})}
227
+
228
+ ${G}Cleanup:${i}
229
+ -y, --yes ${b("cli.help.doctor.flag.yes",{locale:t,fallback:"Skip confirm; unlink dangling symlinks directly"})}
230
+ ${a}(TTY: confirm prompt; non-TTY: report only)${i}
231
+
232
+ ${G}Examples:${i}
233
+ ${a}$${i} easbot-skills doctor ${a}# ${b("cli.example.doctor",{locale:t,fallback:"Interactive check + cleanup"})}${i}
234
+ ${a}$${i} easbot-skills doctor -a easbot -y ${a}# ${b("cli.example.doctor_agent_yes",{locale:t,fallback:"Check one agent + auto-cleanup"})}${i}
235
+ ${a}$${i} easbot-skills dr -g ${a}# ${b("cli.example.doctor_global",{locale:t,fallback:"Check global scope only"})}${i}
236
+ `);}function Hi(e){let t=at(e);console.log(`
237
+ ${G}${b("cli.help.remove.usage",{locale:t,fallback:"Usage: easbot skills remove [skills...] [options]"})}${i}
238
+
239
+ ${G}Description:${i}
240
+ ${b("cli.help.remove.description",{locale:t,fallback:"Remove installed skills from agents. If no skill names are provided, an interactive selection menu will be shown."})}
241
+
242
+ ${G}Arguments:${i}
243
+ ${b("cli.help.remove.arguments",{locale:t,fallback:"skills Optional skill names to remove (space-separated)"})}
244
+
245
+ ${G}Options:${i}
246
+ -g, --global ${b("cli.help.remove.flag.global",{locale:t,fallback:"Remove from global scope (~/) instead of project scope"})}
247
+ -a, --agent ${b("cli.help.remove.flag.agent",{locale:t,fallback:"Remove from specific agents (use '*' for all agents)"})}
248
+ -s, --skill ${b("cli.help.remove.flag.skill",{locale:t,fallback:"Specify skills to remove (use '*' for all skills)"})}
249
+ -y, --yes ${b("cli.help.remove.flag.yes",{locale:t,fallback:"Skip confirmation prompts"})}
250
+ --all ${b("cli.help.remove.flag.all",{locale:t,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
251
+
252
+ ${G}Examples:${i}
253
+ ${a}$${i} easbot-skills remove ${a}# ${b("cli.example.remove_interactive",{locale:t,fallback:"Interactive remove"})}${i}
254
+ ${a}$${i} easbot-skills remove my-skill ${a}# ${b("cli.example.remove_by_name",{locale:t,fallback:"Remove by name"})}${i}
255
+ ${a}$${i} easbot-skills remove skill1 skill2 -y ${a}# ${b("cli.example.remove_all",{locale:t,fallback:"Remove multiple skills"})}${i}
256
+ ${a}$${i} easbot-skills remove --global my-skill ${a}# ${b("cli.example.remove_global",{locale:t,fallback:"Remove from global scope"})}${i}
257
+ ${a}$${i} easbot-skills rm --agent claude-code my-skill ${a}# ${b("cli.example.remove_by_agent",{locale:t,fallback:"Remove from specific agent"})}${i}
258
+ ${a}$${i} easbot-skills remove --all ${a}# ${b("cli.example.remove_all",{locale:t,fallback:"Remove all skills"})}${i}
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
+
261
+ ${a}${b("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}
262
+ `);}function vs(){console.log();}function Wi(e,t){let s=at(t),n=t?.cwd??p$2()??process.cwd(),l=e[0]||Filesystem.basename(n),o=e[0]!==void 0,r=e.includes("--json"),u=o?Filesystem.join(n,"skills",l):Filesystem.join(n,"skills"),p=Filesystem.join(u,"SKILL.md"),d=o?`${l}/SKILL.md`:"SKILL.md";if(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);mkdirSync(u,{recursive:true});let h=pn(s,l);if(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 xp(e,t){Mi(t?.version);let s=t?.inAgent??await Nt();if(e.length===0)return s||Gi(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||vs(),console.log(),{code:await Fl(l),handled:true,command:n};case "init":return s||vs(),console.log(),{code:Wi(l,t),handled:true,command:n};case "a":case "add":{s||vs();let{source:o,options:r}=Gt(l);return await mt(o,r),{code:0,handled:true,command:n}}case "use":{let{source:o,options:r,errors:u}=en(l);return await tn(o,r,u),{code:0,handled:true,command:n}}case "remove":case "rm":case "r":{if(l.includes("--help")||l.includes("-h"))return Hi(t),{code:0,handled:true,command:n};let{skills:o,options:r}=Wl(l);return await Hl(o,r),{code:0,handled:true,command:n}}case "list":case "ls":return await Ml(l,{cwd:t?.cwd}),{code:0,handled:true,command:n};case "doctor":case "dr":return l.includes("--help")||l.includes("-h")?(Ki(t),{code:0,handled:true,command:n}):(await zl(l,t?.cwd?{cwd:t.cwd}:void 0),{code:0,handled:true,command:n});case "check":case "update":case "upgrade":return await yl(l,{cwd:t?.cwd}),{code:0,handled:true,command:n};case "store":return {code:await Nl(l),handled:true,command:n};default:{let o=at(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
+ export{Qo as A,Ml as B,Hl as C,Wl as D,zl as E,en as F,$i as G,bi as H,tn as I,Si as J,Gi as K,Ap as L,xp as M,os as a,sl as b,ll as c,nl as d,rs as e,lt as f,Nt as g,fr as h,al as i,Kn as j,Vr as k,Hn as l,ml as m,yl as n,xl as o,mt as p,Gt as q,Ao as r,Nl as s,To as t,Io as u,_o as v,Ro as w,Fo as x,Ul as y,Fl as z};