@easbot/skills 0.3.13 → 0.3.16

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 (62) hide show
  1. package/README.en.md +432 -125
  2. package/README.md +427 -125
  3. package/dist/chunks/blob-RYNC3CVY.cjs +1 -0
  4. package/dist/chunks/{blob-3PZEQWTP.mjs → blob-WZAGX4RO.mjs} +1 -1
  5. package/dist/chunks/chunk-5DAHAO55.mjs +3 -0
  6. package/dist/chunks/{chunk-4D5RQDWJ.mjs → chunk-6OLPTZDO.mjs} +2 -2
  7. package/dist/chunks/{chunk-ZBKGF7PA.mjs → chunk-BQ6QWQEM.mjs} +1 -1
  8. package/dist/chunks/chunk-BWDTT6SA.cjs +3 -0
  9. package/dist/chunks/chunk-DNE3XPCJ.cjs +2 -0
  10. package/dist/chunks/chunk-HI5IN4UL.mjs +265 -0
  11. package/dist/chunks/chunk-HOK3SUH4.cjs +22 -0
  12. package/dist/chunks/{chunk-5BL3KG26.cjs → chunk-IJI72D6W.cjs} +2 -2
  13. package/dist/chunks/{chunk-ISMGLHYS.cjs → chunk-JUNIAQ2A.cjs} +1 -1
  14. package/dist/chunks/{chunk-CY6UI6SJ.cjs → chunk-LJ63Q26N.cjs} +1 -1
  15. package/dist/chunks/{chunk-S6YNGR7S.cjs → chunk-Q2MOP5ZW.cjs} +2 -2
  16. package/dist/chunks/chunk-S5OLAC7X.cjs +265 -0
  17. package/dist/chunks/chunk-UUZB3HCD.mjs +22 -0
  18. package/dist/chunks/chunk-Y6D5Z6AU.mjs +1 -0
  19. package/dist/chunks/chunk-ZJS7IO5V.mjs +2 -0
  20. package/dist/chunks/cli-handler-2G4ZYO2S.cjs +1 -0
  21. package/dist/chunks/cli-handler-F4DUEULA.mjs +1 -0
  22. package/dist/chunks/installer-3ZLHOVAO.cjs +1 -0
  23. package/dist/chunks/{installer-REG45DC2.mjs → installer-UUEXYC7I.mjs} +1 -1
  24. package/dist/chunks/{interfaces-UIS44Q7A.cjs → interfaces-T3TO7GQW.cjs} +1 -1
  25. package/dist/chunks/local-lock-KNX2RUIV.cjs +1 -0
  26. package/dist/chunks/local-lock-UYZTKIET.mjs +1 -0
  27. package/dist/chunks/scan-6EBCZDVK.cjs +1 -0
  28. package/dist/chunks/scan-BZA5LEZN.mjs +1 -0
  29. package/dist/chunks/skill-lock-CDMLVBYH.mjs +1 -0
  30. package/dist/chunks/skill-lock-WPACLO4W.cjs +1 -0
  31. package/dist/chunks/store-2ULHEVHS.cjs +1 -0
  32. package/dist/chunks/{store-IVDLGLET.mjs → store-FRXO6UWU.mjs} +1 -1
  33. package/dist/chunks/telemetry-TAVF3FAM.cjs +1 -0
  34. package/dist/cli.cjs +1 -1
  35. package/dist/cli.mjs +1 -1
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.d.cts +3 -2
  38. package/dist/index.d.ts +3 -2
  39. package/dist/index.mjs +1 -1
  40. package/package.json +7 -8
  41. package/dist/chunks/blob-ZDEX2HRV.cjs +0 -1
  42. package/dist/chunks/chunk-5W7HC7BY.mjs +0 -22
  43. package/dist/chunks/chunk-CXH3OTTQ.cjs +0 -22
  44. package/dist/chunks/chunk-K2XGYOXP.mjs +0 -267
  45. package/dist/chunks/chunk-ML6B4IQL.mjs +0 -1
  46. package/dist/chunks/chunk-NKIQLESR.mjs +0 -3
  47. package/dist/chunks/chunk-ROCFLAYZ.mjs +0 -2
  48. package/dist/chunks/chunk-RVR3DSD2.cjs +0 -2
  49. package/dist/chunks/chunk-SXUY2J75.cjs +0 -3
  50. package/dist/chunks/chunk-UJWB7QQ6.cjs +0 -267
  51. package/dist/chunks/cli-handler-667TYY4I.cjs +0 -1
  52. package/dist/chunks/cli-handler-YSDUNKKZ.mjs +0 -1
  53. package/dist/chunks/installer-SOVGUW3M.cjs +0 -1
  54. package/dist/chunks/local-lock-AWD3LLEY.mjs +0 -1
  55. package/dist/chunks/local-lock-GIZDVF3X.cjs +0 -1
  56. package/dist/chunks/scan-57D2H7LP.cjs +0 -1
  57. package/dist/chunks/scan-WAXGJM5N.mjs +0 -1
  58. package/dist/chunks/skill-lock-DZMA75MY.mjs +0 -1
  59. package/dist/chunks/skill-lock-XTWQYBRG.cjs +0 -1
  60. package/dist/chunks/store-F7PGGZIO.cjs +0 -1
  61. package/dist/chunks/telemetry-LCGTSJDM.cjs +0 -1
  62. /package/dist/chunks/{chunk-VRHWDHQV.cjs → chunk-BWPPLYIF.cjs} +0 -0
@@ -1,267 +0,0 @@
1
- 'use strict';var chunkS6YNGR7S_cjs=require('./chunk-S6YNGR7S.cjs'),chunkSXUY2J75_cjs=require('./chunk-SXUY2J75.cjs'),chunkCY6UI6SJ_cjs=require('./chunk-CY6UI6SJ.cjs'),chunk5BL3KG26_cjs=require('./chunk-5BL3KG26.cjs'),chunkCXH3OTTQ_cjs=require('./chunk-CXH3OTTQ.cjs'),chunkISMGLHYS_cjs=require('./chunk-ISMGLHYS.cjs'),chunkXGUPIAAF_cjs=require('./chunk-XGUPIAAF.cjs'),chunkRVR3DSD2_cjs=require('./chunk-RVR3DSD2.cjs'),chunkE7AHWFZN_cjs=require('./chunk-E7AHWFZN.cjs'),chunkVRHWDHQV_cjs=require('./chunk-VRHWDHQV.cjs'),fs$1=require('fs'),path=require('path'),v=require('@clack/prompts'),x=require('picocolors'),os=require('os'),utils=require('@easbot/utils'),Ct=require('readline'),util=require('util'),stream=require('stream'),promises=require('fs/promises'),crypto=require('crypto'),url=require('url'),child_process=require('child_process');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var v__namespace=/*#__PURE__*/_interopNamespace(v);var x__default=/*#__PURE__*/_interopDefault(x);var Ct__namespace=/*#__PURE__*/_interopNamespace(Ct);var un=new stream.Writable({write(e,t,l){l();}}),dn=x__default.default.green("\u25C6"),gn=x__default.default.red("\u25A0"),fn=x__default.default.green("\u25C7"),mn=x__default.default.green("\u25CF"),hn=x__default.default.dim("\u25CB");x__default.default.green("\u2713");var kn=x__default.default.green("\u2022"),ge=x__default.default.dim("\u2502"),tt=x__default.default.dim("\u2500"),$n=Symbol("cancel");function yn(e){let t=0;for(let l of e){let s=l.codePointAt(0);if(s===0)continue;let n=s>=4352&&s<=4447||s>=8986&&s<=8987||s>=9001&&s<=9002||s>=9193&&s<=9196||s===9200||s===9203||s>=9725&&s<=9726||s>=9748&&s<=9749||s>=9800&&s<=9811||s>=9855&&s<=9855||s>=9875&&s<=9875||s>=9889&&s<=9889||s>=9898&&s<=9899||s>=9917&&s<=9918||s>=9924&&s<=9925||s>=9934&&s<=9934||s>=9940&&s<=9940||s>=9962&&s<=9962||s>=9970&&s<=9971||s>=9973&&s<=9973||s>=9978&&s<=9978||s>=9981&&s<=9981||s>=9989&&s<=9989||s>=9994&&s<=9995||s>=10024&&s<=10024||s>=10060&&s<=10060||s>=10062&&s<=10062||s>=10067&&s<=10069||s>=10071&&s<=10071||s>=10133&&s<=10135||s>=10160&&s<=10160||s>=10175&&s<=10175||s>=11035&&s<=11036||s>=11088&&s<=11088||s>=11093&&s<=11093||s>=11904&&s<=42191&&s!==12351||s>=43360&&s<=43388||s>=44032&&s<=55203||s>=63744&&s<=64255||s>=65040&&s<=65049||s>=65072&&s<=65135||s>=65280&&s<=65376||s>=65504&&s<=65510||s>=126976&&s<=129535;t+=n?2:1;}return t}function bn(e,t){let l=util.stripVTControlCharacters(e),s=Math.max(1,t),n=yn(l);return Math.max(1,Math.ceil(n/s))}function Sn(e,t){let l=t!==void 0&&t>0?t:process.stdout.columns&&process.stdout.columns>0?process.stdout.columns:80;return e.reduce((s,n)=>s+bn(n,l),0)}async function ss(e){let{message:t,items:l,maxVisible:s=8,initialSelected:n=[],required:o=false,lockedSection:r}=e;return new Promise(d=>{let g=Ct__namespace.createInterface({input:process.stdin,output:un,terminal:false});process.stdin.isTTY&&process.stdin.setRawMode(true),Ct__namespace.emitKeypressEvents(process.stdin,g);let a="",k=0,h=new Set(n),C=0,A=r?r.items.map(f=>f.value):[],$=(f,y)=>{if(!y)return true;let I=y.toLowerCase();return f.label.toLowerCase().includes(I)||String(f.value).toLowerCase().includes(I)},p=()=>l.filter(f=>$(f,a)),u=()=>{if(C>0){process.stdout.write(`\x1B[${C}A`);for(let f=0;f<C;f++)process.stdout.write("\x1B[2K\x1B[1B");process.stdout.write(`\x1B[${C}A`);}},m=(f="active")=>{u();let y=[],I=p(),O=f==="active"?dn:f==="cancel"?gn:fn;if(y.push(`${O} ${x__default.default.bold(t)}`),f==="active"){if(r&&r.items.length>0){y.push(`${ge}`);let oe=`${x__default.default.bold(r.title)} ${x__default.default.dim("\u2500\u2500 always included")}`;y.push(`${ge} ${tt}${tt} ${oe} ${tt.repeat(12)}`);for(let q of r.items)y.push(`${ge} ${kn} ${x__default.default.bold(q.label)}`);r.hiddenCount&&r.hiddenCount>0&&y.push(`${ge} ${x__default.default.dim(`...and ${r.hiddenCount} more`)}`),y.push(`${ge}`),y.push(`${ge} ${tt}${tt} ${x__default.default.bold("Additional agents")} ${tt.repeat(29)}`);}let E=`${ge} ${x__default.default.dim("Search:")} ${a}${x__default.default.inverse(" ")}`;y.push(E),y.push(`${ge} ${x__default.default.dim("\u2191\u2193 move, space select, enter confirm")}`),y.push(`${ge}`);let N=Math.max(0,Math.min(k-Math.floor(s/2),I.length-s)),U=Math.min(I.length,N+s),Y=I.slice(N,U);if(I.length===0)y.push(`${ge} ${x__default.default.dim("No matches found")}`);else {for(let H=0;H<Y.length;H++){let ce=Y[H],be=N+H,ke=h.has(ce.value),Se=be===k,Ee=ke?mn:hn,Le=Se?x__default.default.underline(ce.label):ce.label,Ye=ce.hint?x__default.default.dim(` (${ce.hint})`):"",Re=Se?x__default.default.cyan("\u276F"):" ";y.push(`${ge} ${Re} ${Ee} ${Le}${Ye}`);}let oe=N,q=I.length-U;if(oe>0||q>0){let H=[];oe>0&&H.push(`\u2191 ${oe} more`),q>0&&H.push(`\u2193 ${q} more`),y.push(`${ge} ${x__default.default.dim(H.join(" "))}`);}}y.push(`${ge}`);let J=[];for(let oe of l)h.has(oe.value)&&J.push(oe.label);if(J.length===0)y.push(`${ge} ${x__default.default.dim("Selected: (none \u2014 only locked universal)")}`);else {let oe=J.length<=3?J.join(", "):`${J.slice(0,3).join(", ")} +${J.length-3} more`;y.push(`${ge} ${x__default.default.green("Selected:")} ${oe}`);}y.push(`${x__default.default.dim("\u2514")}`);}else if(f==="submit"){let E=l.filter(U=>h.has(U.value)).map(U=>U.label),N=E.length===0?"(none \u2014 only locked universal)":E.join(", ");y.push(`${ge} ${x__default.default.dim(N)}`);}else f==="cancel"&&y.push(`${ge} ${x__default.default.strikethrough(x__default.default.dim("Cancelled"))}`);process.stdout.write(y.join(`
2
- `)+`
3
- `),C=Sn(y,process.stdout.columns);},w=()=>{process.stdin.removeListener("keypress",L),process.stdin.isTTY&&process.stdin.setRawMode(false),g.close();},T=()=>{if(o&&h.size===0&&A.length===0)return;m("submit"),w();let f=new Set(A),y=[...A];for(let I of h)f.has(I)||(f.add(I),y.push(I));d(y);},P=()=>{m("cancel"),w(),d($n);},L=(f,y)=>{if(!y)return;let I=p();if(y.name==="return"){T();return}if(y.name==="escape"||y.ctrl&&y.name==="c"){P();return}if(y.name==="up"){k=Math.max(0,k-1),m();return}if(y.name==="down"){k=Math.min(I.length-1,k+1),m();return}if(y.name==="space"){let O=I[k];O&&(h.has(O.value)?h.delete(O.value):h.add(O.value)),m();return}if(y.name==="backspace"){a=a.slice(0,-1),k=0,m();return}if(y.sequence&&!y.ctrl&&!y.meta&&y.sequence.length===1){a+=y.sequence,k=0,m();return}};process.stdin.on("keypress",L),m();})}async function Xs(e){let t=crypto.createHash("sha256");try{let l=await promises.readFile(path.join(e,"SKILL.md"),"utf-8");t.update("SKILL.md"),t.update(l);}catch{t.update("EMPTY");}return t.digest("hex")}async function ns(e,t){let l;try{l=await promises.lstat(e);}catch{return "absent"}if(l.isSymbolicLink())try{let d=utils.Filesystem.toUnixPath(await promises.realpath(e)),g=utils.Filesystem.toUnixPath(await promises.realpath(t));return d===g?"symlinked":"orphan"}catch{return "orphan"}let s=path.join(e,"SKILL.md");try{await promises.access(s);}catch{return "absent"}if(!await chunkCXH3OTTQ_cjs.y(s))return "divergent";let o=await Xs(e),r=await Xs(t);return o===r?"copied":"divergent"}function Zs(e,t){let l=[];for(let s of e)for(let n of ["global","project"]){let o=s.cells[n];o.state==="absent"?l.push({kind:"install",agentId:s.agentId,scope:n,mode:t,targetPath:o.targetPath}):o.state==="symlinked"||o.state==="copied"?l.push({kind:"skip",agentId:s.agentId,scope:n,state:o.state}):l.push({kind:"report",agentId:s.agentId,scope:n,state:o.state});}return l}async function Qs(e,t){let l=[],s=[];for(let n of e)if(n.kind!=="skip"){if(n.kind==="report"){s.push(n);continue}try{await promises.mkdir(path.dirname(n.targetPath),{recursive:!0});let o;n.mode==="symlink"?o=await chunk5BL3KG26_cjs.i(t.sourceDir,n.targetPath,{isGlobal:t.installGlobally&&n.scope==="global",agentType:n.agentId,cwd:t.cwd}):o=await chunk5BL3KG26_cjs.j(t.sourceDir,n.targetPath,{agentType:n.agentId,isGlobal:t.installGlobally&&n.scope==="global"}),o.success?(o.symlinkFailed,l.push(n)):s.push({kind:"report",agentId:n.agentId,scope:n.scope,state:"divergent"});}catch{s.push({kind:"report",agentId:n.agentId,scope:n.scope,state:"divergent"});}}return {installed:l,reported:s}}function el(e,t){let l=[];for(let s of e)if(s==="eve"&&t.includeEveSubagents!==false){let n=chunkISMGLHYS_cjs.f(t.cwd);if(n.length===0)l.push(jn(t));else for(let o of n)l.push({agentId:s,cells:{global:st("global",s,true,t,o),project:st("project",s,false,t,o)}});}else l.push({agentId:s,cells:{global:st("global",s,true,t),project:st("project",s,false,t)}});return l}function st(e,t,l,s,n){return {scope:e,state:"absent",targetPath:path.join(chunk5BL3KG26_cjs.g(t,l,s.cwd,n),s.skillId),sourceDir:s.sourceDir}}function jn(e){return {agentId:"eve",cells:{global:st("global","eve",true,e),project:st("project","eve",false,e)}}}async function is(e){let t=e.cwd??process.cwd(),l=utils.Filesystem.toUnixPath(e.sourceDir),s=e.includeEveSubagents??true;if(e.assumeYes)return {skipped:true,installed:[],reported:[]};let n=el(e.targetAgents,{skillId:e.skillId,sourceDir:l,cwd:t,includeEveSubagents:s}),o=[];for(let a of n){let k={...a.cells.global,state:await ns(a.cells.global.targetPath,l)},h={...a.cells.project,state:await ns(a.cells.project.targetPath,l)};o.push({agentId:a.agentId,cells:{global:k,project:h}});}let r=Zs(o,e.defaultMode),{installed:d,reported:g}=await Qs(r,{sourceDir:l,installGlobally:e.installGlobally,cwd:t});return {skipped:false,installed:d,reported:g,matrix:o}}function Pt(e){return x__default.default.bgCyan(x__default.default.black(x__default.default.bold(` ${e} `)))}var Cn="/opt/.devin",tl="easbot",Pn="cursor",Rn="cursor-cli",Nn="claude",On="cowork",En="devin",Dn="replit",Un="gemini",Fn="codex",Mn="antigravity",Kn="augment-cli",Gn="opencode",as="github-copilot",Hn="github-copilot-cli",sl="v0";async function ll(){if(process.env.AI_AGENT){let e=process.env.AI_AGENT.trim();if(e)return e===tl?{isAgent:true,agent:{name:tl}}:e===as||e===Hn?{isAgent:true,agent:{name:as}}:e===sl?{isAgent:true,agent:{name:sl}}:{isAgent:true,agent:{name:e}}}if(process.env.CURSOR_TRACE_ID)return {isAgent:true,agent:{name:Pn}};if(process.env.CURSOR_AGENT||process.env.CURSOR_EXTENSION_HOST_ROLE==="agent-exec")return {isAgent:true,agent:{name:Rn}};if(process.env.GEMINI_CLI)return {isAgent:true,agent:{name:Un}};if(process.env.CODEX_SANDBOX||process.env.CODEX_CI||process.env.CODEX_THREAD_ID)return {isAgent:true,agent:{name:Fn}};if(process.env.ANTIGRAVITY_AGENT)return {isAgent:true,agent:{name:Mn}};if(process.env.AUGMENT_AGENT)return {isAgent:true,agent:{name:Kn}};if(process.env.OPENCODE_CLIENT)return {isAgent:true,agent:{name:Gn}};if(process.env.CLAUDECODE||process.env.CLAUDE_CODE)return process.env.CLAUDE_CODE_IS_COWORK?{isAgent:true,agent:{name:On}}:{isAgent:true,agent:{name:Nn}};if(process.env.REPL_ID)return {isAgent:true,agent:{name:Dn}};if(process.env.COPILOT_MODEL||process.env.COPILOT_ALLOW_ALL||process.env.COPILOT_GITHUB_TOKEN)return {isAgent:true,agent:{name:as}};try{return await promises.access(Cn,fs$1.constants.F_OK),{isAgent:!0,agent:{name:En}}}catch{}return {isAgent:false,agent:void 0}}var lt=null,Wn={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 nt(){return lt||(lt=await ll(),lt.isAgent&&chunkS6YNGR7S_cjs.a(lt.agent.name),lt)}async function Rt(){return (await nt()).isAgent}async function Lr(){let e=await nt();return e.isAgent?e.agent.name:null}function nl(e){return Wn[e]??null}function cs(e,t){return t?`${e}#${t}`:e}function Z(e,t,l=true){return t===void 0?{ok:l,data:e}:{ok:l,data:e,meta:t}}function Bn(e,t=2){console.log(JSON.stringify(e,null,t));}function Q(e){Bn(e);}function ee(e,t={}){let l=e.length>0?e.join(`
4
- `):t.empty??x__default.default.dim("No results."),s=e.length>0?t.title:t.emptyTitle??t.title;s?v__namespace.note(l,s):console.log(l),t.outro&&!t.skipOutro?v__namespace.outro(t.outro):t.skipOutro||v__namespace.outro(x__default.default.green("Done!"));}var i="\x1B[0m",G="\x1B[1m",c="\x1B[38;5;102m",F="\x1B[38;5;145m",Ie="\x1B[36m";var ot="\x1B[33m";path.dirname(url.fileURLToPath(chunkVRHWDHQV_cjs.c));var Et=Number(process.env.SKILLS_UPDATE_TIMEOUT??6e4);async function Dt(e,t,l){let s=null,n=new Promise((o,r)=>{s=setTimeout(()=>r(new Error(`${l} timed out after ${t}ms`)),t);});try{return await Promise.race([e,n])}finally{s&&clearTimeout(s);}}function al(e,t){if(!e)return [];let s=e.message.includes("timed out")?"Fetch timeout":"Source unreachable";return t.map(({name:n,entry:o})=>({name:n,reason:s,sourceUrl:o.source,sourceType:o.sourceType,ref:o.ref}))}async function cl(e){try{return await chunkE7AHWFZN_cjs.b(e)}catch{return}}async function pl(e,t,l,s){let{rm:n,readdir:o,stat:r}=await import('fs/promises'),d=chunkCXH3OTTQ_cjs.L(e),g=chunkCXH3OTTQ_cjs.M(e),a=utils.Filesystem.join(utils.Filesystem.normalize(t),l),k=utils.Filesystem.join(g,l);if(!await utils.Filesystem.exists(a))return {ok:false};let h=new Set([".git","node_modules"]),C=async m=>{let w=[],T=async L=>{try{let y=[...await o(L,{withFileTypes:!0})].filter(O=>!h.has(O.name)).sort((O,E)=>O.name.localeCompare(E.name)),I=await Promise.all(y.map(async O=>{let E=utils.Filesystem.join(L,O.name);try{let N=await r(E);return `${E.slice(utils.Filesystem.normalize(m).length+1).split(/[\\/]/).join("/")}|${N.size}|${O.isDirectory()?"d":"f"}|${(N.mode&511).toString(8)}`}catch{return `${O.name}|?|?|?`}}));for(let O of I)w.push(O);for(let O of y)if(O.isDirectory()&&!await T(utils.Filesystem.join(L,O.name)))return !1;return !0}catch{return false}};if(await T(utils.Filesystem.normalize(m)))return w.sort(),crypto.createHash("sha256").update(w.join(`
5
- `)).digest("hex")},A=await C(a),$=await C(k);if(A&&$&&A===$){let w=(await chunkCXH3OTTQ_cjs.Y(d,chunkCXH3OTTQ_cjs.O(e,l),s))?.entry.computedHash;if(w)return {ok:true,hash:w,skipped:true}}try{await n(k,{recursive:!0,force:!0}),await utils.Filesystem.cp(a,k);}catch{return {ok:false}}let p=await cl(k);if(!p)return {ok:false};let u=e.type==="local"?e.localPath??e.url:utils.Filesystem.normalize(t);try{await chunkCXH3OTTQ_cjs.aa([{skillName:s,parsed:e,sourceKey:d,sourcePath:u,storePath:g,skillPath:l,computedHash:p}]);}catch{}return {ok:true,hash:p}}function Ut(e,t,l){return e||!t||!l?true:t!==l}function Yn(e,t={}){let l={};t.cwd&&(l.cwd=t.cwd);let s=[];for(let n=0;n<e.length;n++){let o=e[n];if(o==="-g"||o==="--global")l.global=true;else if(o==="-p"||o==="--project")l.project=true;else if(o==="-y"||o==="--yes")l.yes=true;else if(o==="--all")l.all=true;else if(o==="--json")l.json=true;else if(o==="--force")l.force=true;else if(o==="-a"||o==="--agent")for(l.agent=l.agent??[];n+1<e.length&&!e[n+1].startsWith("-");)l.agent.push(e[++n]);else o&&!o.startsWith("-")&&s.push(o);}return s.length>0&&(l.skills=s),l}function ua(e){let t=e||process.cwd();return fs$1.existsSync(path.join(t,"skills-lock.json"))}async function qn(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 v__namespace.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 v__namespace.isCancel(t)&&(v__namespace.cancel("Cancelled"),process.exit(0)),t}function ul(e,t){if(!t||t.length===0)return true;let l=e.toLowerCase();return t.some(s=>{let n=s.toLowerCase();return n==="*"?true:n===l})}function Xn(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 l=t.indexOf("/.well-known/");l!==-1&&(t=t.slice(0,l));}return cs(t,e.ref)}function Nt(e){if(e.length===0)return;console.log(),console.log(`${c}${e.length} skill(s) cannot be checked automatically:${i}`);let t=new Map;for(let l of e){let s=Zn(l),n=t.get(s)||[];n.push(l),t.set(s,n);}for(let[l,s]of t){if(s.length===1){let n=s[0];console.log(` ${F}\u2022${i} ${chunkRVR3DSD2_cjs.b(n.name)} ${c}(${n.reason})${i}`);}else {let n=s[0].reason,o=s.map(r=>chunkRVR3DSD2_cjs.b(r.name)).join(", ");console.log(` ${F}\u2022${i} ${o} ${c}(${n})${i}`);}console.log(` ${c}To update: ${F}easbot skills add ${l} -g -y${i}`);}}async function dl(e){let t={skills:[],refreshedSkillCount:0,upToDateSkillCount:0,failedSkillCount:0},l=new Map,s=(p,u)=>{let m=`${u}::${p}`,w=l.get(m);return w||(w={skillName:p,scope:u,sharedAgents:[],copiedAgents:[],linkedAgents:[],upToDateAgents:[],deadLinkAgents:[],failed:[],ok:true,failedCount:0},l.set(m,w),t.skills.push(w)),w},n=e.scope??"both",o=chunkISMGLHYS_cjs.q(e.agentFilter??[]),r=o.length>0?o:void 0,g=(await chunkCY6UI6SJ_cjs.a({scope:n,cwd:e.cwd,agentFilter:r})).map(p=>({name:p.name,description:"",path:p.skillDir,canonicalPath:p.skillDir,scope:p.scope,agents:[...p.agents]})),a=e.skillNames??[];if(!(a.length===1&&a[0]==="*")){let p=new Set(a.map(u=>u.toLowerCase()));g=g.filter(u=>p.has(u.name.toLowerCase()));}let{readLocalLock:k}=await import('./local-lock-GIZDVF3X.cjs'),{readSkillLock:h}=await import('./skill-lock-XTWQYBRG.cjs'),C=await k(),A=await h();for(let p of g){let u=p.scope==="global"?A.skills[p.name]:C.skills[p.name];if(!u?.marketId||!u.pluginId)continue;let m=await chunkCXH3OTTQ_cjs.Y(u.marketId,u.pluginId,p.name);if(!m)continue;let{readStoreIndex:w}=await import('./store-F7PGGZIO.cjs'),P=(await w()).markets[m.marketId];if(!P)continue;let f=`${P.storePath.replace(/\\/g,"/").replace(/\/+$/,"")}/${m.entry.skillPath}`.replace(/\\/g,"/");p.path=f,p.canonicalPath=f;}let $=new Map;for(let p of g){let u=`${p.scope}::${p.name}::${p.path}`;$.set(u,p);}for(let p of a){if(p==="*")continue;let u=p.replace(/\.+$/,""),m=a.indexOf(p),T=e.skillStorePaths?.[m]?.split(/[\\/]/).filter(Boolean).pop();if(T){for(let[P,L]of $)if(P.startsWith(`${L.scope}::`)&&P.endsWith(`::${T}`)){let f=`${L.scope}::${u}::${L.path}`;$.has(f)||$.set(f,L);break}}}if($.size===0)return t;for(let[p,u]of $){let w=p.split("::")[1].replace(/\.+$/,""),T=u.path,P=s(w,u.scope),f=fs$1.existsSync(T)?await chunkCXH3OTTQ_cjs.y(`${T}/SKILL.md`.replace(/\\/g,"/")):void 0;if(!f){if(!await Qn(w,u.scope==="global"))continue;for(let O of u.agents)P.failed.push({agent:O,reason:"store source missing \u2014 run `easbot skills add <source>` to rebuild"}),P.failedCount++,P.ok=false;continue}let y=f;for(let I of u.agents){let O=chunkISMGLHYS_cjs.o(I,u.scope),N=await chunk5BL3KG26_cjs.h(y,I,{global:u.scope==="global",mode:"symlink",cwd:e.cwd});if(!N.success){P.failed.push({agent:I,reason:N.error??"install failed"}),P.failedCount++,P.ok=false;continue}N.skippedReason==="up-to-date"?P.upToDateAgents.push(I):O?P.sharedAgents.push(I):P.copiedAgents.push(I);}}for(let p of t.skills){let u=p.failedCount>0,m=p.sharedAgents.length+p.copiedAgents.length+p.linkedAgents.length>0,w=p.upToDateAgents.length+p.deadLinkAgents.length>0||m;u?t.failedSkillCount++:m?t.refreshedSkillCount++:w&&t.upToDateSkillCount++;}return t}async function Qn(e,t){return t?(await chunkSXUY2J75_cjs.c()).skills[e]:(await chunkCXH3OTTQ_cjs.t()).skills[e]}function eo(e){let t=[...e.skills].sort((o,r)=>o.skillName.localeCompare(r.skillName)),l=[];for(let o of t){let r=[...o.sharedAgents,...o.copiedAgents,...o.linkedAgents,...o.upToDateAgents];r.length!==0&&l.push({skill:o.skillName,agents:r});}let s=["global","project"],n=[];for(let o of s){let r=e.skills.filter(g=>g.scope===o);if(r.length===0)continue;let d=[...r].sort((g,a)=>g.skillName.localeCompare(a.skillName));for(let g of d){let a=[];g.sharedAgents.length>0&&a.push({label:"universal",agents:g.sharedAgents}),g.copiedAgents.length>0&&a.push({label:"copied",agents:g.copiedAgents}),g.linkedAgents.length>0&&a.push({label:"symlinked",agents:g.linkedAgents}),g.upToDateAgents.length>0&&a.push({label:"up-to-date",agents:g.upToDateAgents}),n.push({scope:o,skill:g.skillName,sections:a,failed:g.failed.map(k=>({agent:k.agent,reason:k.reason}))});}}return {updatingFor:l,sections:n,summary:{refreshed:e.refreshedSkillCount,upToDate:e.upToDateSkillCount,failed:e.failedSkillCount}}}function gl(e){if(e.skills.length===0)return;let t=eo(e),l=n=>{let o=n.map(r=>chunkISMGLHYS_cjs.b[r]?.displayName??r);return o.length<=5?o.join(", "):`${o.slice(0,5).join(", ")} +${o.length-5} more`};if(t.updatingFor.length>0){console.log(`${F}Updating for:${i}`);for(let n of t.updatingFor){let o=l(n.agents);console.log(` ${c}\u2514${i} ${Ie}${chunkRVR3DSD2_cjs.b(n.skill)}${i} ${c}(${o})${i}`);}}let s=null;for(let n of t.sections){if(n.scope!==s&&(console.log(`${G}${n.scope==="global"?"Global Skills":"Project Skills"}${i}`),s=n.scope),console.log(` ${c}\u2514${i} ${Ie}${chunkRVR3DSD2_cjs.b(n.skill)}${i}`),n.sections.length===0&&n.failed.length===0){console.log(` ${c}\u2514(no install targets)${i}`);continue}for(let o of n.sections)console.log(` ${c}\u2514${i} (${o.agents.length} agents) ${o.label}: ${l(o.agents)}`);for(let{agent:o,reason:r}of n.failed){let d=chunkISMGLHYS_cjs.b[o]?.displayName??o;console.log(` ${F}\u2717 ${d}:${i} ${c}${r}${i}`);}}console.log();}async function to(e){let t=await chunkCXH3OTTQ_cjs.t(),l=[];for(let[s,n]of Object.entries(t.skills))ul(s,e)&&n.sourceType!=="node_modules"&&l.push({name:s,source:n.source,entry:n});return l}async function so(e={}){let t=e.cwd||process.cwd(),l=await chunkSXUY2J75_cjs.c(),s=Object.keys(l.skills),n=0,o=0,r=0;if(s.length===0)return v__namespace.note(e.skills&&e.skills.length>0?`${x__default.default.yellow(`No installed skills found matching: ${e.skills.join(", ")}`)}`:`${x__default.default.dim("No global skills tracked in lock file.")}`,x__default.default.cyan("Global Skills Update")),v__namespace.outro(`${x__default.default.green("Done!")}${x__default.default.dim(" Install with `easbot skills add <package> -g` to get started.")}`),{successCount:n,failCount:o,checkedCount:0};let{listInstalledSkills:d}=await import('./installer-SOVGUW3M.cjs'),g=await d({scope:"global",agentFilter:e.agent,cwd:t}),a=new Set(g.map(u=>u.name)),k=[],h=[],C=[];for(let u of s){if(!ul(u,e.skills))continue;let m=l.skills[u];if(m){if(!m.skillPath){h.push({name:u,reason:Xn(m),sourceUrl:m.source,sourceType:m.sourceType,ref:m.ref});continue}a.has(u)&&C.push({name:u,entry:m});}}let A=new Map;for(let u of C){let m=u.entry.source,w=A.get(m)||[];w.push(u),A.set(m,w);}for(let[u,m]of A){let w=m[0].entry,T=w.source,P=w.sourceType,L=null;if(process.stdout.write(`\r${c}Checking skills from source: ${u}${i}\x1B[K
6
- `),P==="github"){let y=chunkCXH3OTTQ_cjs.e(T),I=chunkCXH3OTTQ_cjs.a(y);if(I)try{let{fetchGitHubMarketSnapshot:O}=await import('./blob-ZDEX2HRV.cjs'),E=await Dt(O(I,w.ref??void 0),Et,`update market-snapshot ${u}`),U=(await chunkCXH3OTTQ_cjs.S()).markets[chunkCXH3OTTQ_cjs.L(y)]?.snapshotHash;if(E&&U&&U===E.snapshotHash){console.log(` ${c}\u2713 Source ${u} unchanged (market snapshotHash match)${i}`),r+=m.length;continue}}catch{}}let f=null;try{let y=P??"git",I=chunkCXH3OTTQ_cjs.e(T),O=await Dt(chunkCXH3OTTQ_cjs.Q({type:y,url:I.url,ref:w.ref??void 0,mode:"update"}),Et,`update fetch ${u}`);if(L=O.tempDir,O.cloneError&&(f=O.cloneError),!f&&L){let E=await chunkCXH3OTTQ_cjs.A(L),N=L.replace(/\\/g,"/").replace(/\/+$/,""),U=E.map(Y=>{let J=Y.path.replace(/\\/g,"/");return path.relative(N,J).split(path.sep).join("/")});if(E.length===0)f=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${u}`);else {let Y=new Set,J=new Set(U),oe=chunkCXH3OTTQ_cjs.e(T);for(let{name:q,entry:H}of m){if(Y.has(q))continue;let be=H.skillPath.split(path.sep).join("/").replace(/\/SKILL\.md$/,"");if(!J.has(be))continue;let ke=await pl(oe,L,be,q);if(!ke.ok){h.push({name:q,reason:"Store sync failed",sourceUrl:H.source,sourceType:H.sourceType,ref:H.ref});continue}Ut(e.force,H.computedHash,ke.hash)&&k.push({name:q,source:u,entry:H});}}}}catch(y){f=y instanceof Error?y:new Error(String(y));}finally{L&&P!=="local"&&!chunkCXH3OTTQ_cjs.ga(L)&&await chunkCXH3OTTQ_cjs.l(L);}f&&(console.log(` ${c}\u2717 Failed to check skills from ${u}: ${f.message}${i}`),h.push(...al(f,m)));}C.length>0&&process.stdout.write("\r\x1B[K");let $=C.length+h.length+r;if(C.length===0&&h.length===0)return e.skills||console.log(`${c}No global skills to check.${i}`),{successCount:n,failCount:o,checkedCount:0};if(C.length===0&&h.length>0)return Nt(h),{successCount:n,failCount:o,checkedCount:$};if(k.length===0)return console.log(`${F}\u2713 All global skills are up to date${i}`),{successCount:n,failCount:o,checkedCount:$};if(console.log(`${F}Found ${k.length} global update(s)${i}`),console.log(),k.length===0)return Nt(h),{successCount:n,failCount:o,checkedCount:$};try{let u=[],m=[];for(let T of k){u.push(T.name);let P=chunkCXH3OTTQ_cjs.e(T.entry.source),L=chunkCXH3OTTQ_cjs.M(P),y=(T.entry.skillPath??T.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");m.push(path.join(L,y));}let w=await dl({skillNames:u,skillStorePaths:m,scope:"global",agentFilter:e.agent,cwd:t});gl(w),w.failedSkillCount>0?o+=w.failedSkillCount:n+=w.skills.length;}catch(u){o+=k.length,console.log(`${c}\u2717 Failed to refresh: ${u instanceof Error?u.message:String(u)}${i}`);}if(k.length>0)try{let u=await chunkSXUY2J75_cjs.c(),m=new Date().toISOString(),w=!1,T=0;for(let P of k){let L=u.skills[P.name];if(!L)continue;let f=chunkCXH3OTTQ_cjs.e(P.entry.source),y=chunkCXH3OTTQ_cjs.M(f),O=(P.entry.skillPath??P.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,""),E=path.join(y,O),N=await cl(E);N&&L.computedHash!==N&&(L.computedHash=N,L.updatedAt=m,w=!0,T++);}w&&(await chunkSXUY2J75_cjs.d(u),console.log(`${c}\u2192 updated global lock: ${T} skill(s) refreshed, ${Object.keys(u.skills).length} total tracked${i}`));}catch(u){console.log(`${c}\u26A0 Failed to write global lock: ${u instanceof Error?u.message:String(u)}${i}`);}Nt(h);let p=[];if(n>0&&o>0)p.push(`${x__default.default.green(`\u2713 ${n} refreshed`)} ${x__default.default.dim("|")} ${x__default.default.red(`\u2717 ${o} failed`)}`);else if(n>0)p.push(`${x__default.default.green(`\u2713 ${n} refreshed`)}`);else if(o>0)p.push(`${x__default.default.red(`\u2717 ${o} failed`)}`);else if($>0)p.push(`${x__default.default.green("All global skills are up to date.")}`);else return {successCount:n,failCount:o,checkedCount:$};return h.length>0&&p.push(`${x__default.default.yellow(`\u26A0 ${h.length} skipped`)}`),console.log(),v__namespace.note(p.join(`
7
- `),x__default.default.cyan("Global Skills Update")),v__namespace.outro(`${x__default.default.green("Done!")}${x__default.default.dim(" Run `easbot skills list` to see current state.")}`),{successCount:n,failCount:o,checkedCount:$}}async function lo(e={}){let t=e.cwd||process.cwd(),l=await to(e.skills),s=0,n=0,o=[];if(l.length===0)return e.skills||(console.log(`${c}No project skills to update.${i}`),console.log(`${c}Install project skills with${i} ${F}easbot skills add <package>${i}`)),v__namespace.note(l.length===0&&e.skills?`${x__default.default.yellow(`No installed skills found matching: ${e.skills.join(", ")}`)}`:`${x__default.default.dim("No project skills tracked in lock file.")}`,x__default.default.cyan("Project Skills Update")),v__namespace.outro(`${x__default.default.green("Done!")}${x__default.default.dim(" Install with `easbot skills add <package>` to get started.")}`),{successCount:s,failCount:n,foundCount:0};let{listInstalledSkills:r}=await import('./installer-SOVGUW3M.cjs'),d=await r({scope:"project",agentFilter:e.agent,cwd:t}),g=new Set(d.map(p=>p.name)),a=l.filter(p=>g.has(p.name)),k=a.filter(p=>p.entry.skillPath),h=a.filter(p=>!p.entry.skillPath);if(k.length===0)return console.log(`${c}No project skills can be updated in place.${i}`),il(h),{successCount:s,failCount:n,foundCount:l.length};console.log(`${F}Checking ${k.length} skill(s)...${i}`),console.log();let C=new Map;for(let p of k){let u=p.entry.source,m=C.get(u)||[];m.push(p),C.set(u,m);}let A=await chunkCXH3OTTQ_cjs.t(),$=[];for(let[p,u]of C){let m=u[0].entry,w=m.source,T=m.ref;if(m.sourceType==="github"){let N=chunkCXH3OTTQ_cjs.e(w),U=chunkCXH3OTTQ_cjs.a(N);if(U)try{let{fetchGitHubMarketSnapshot:Y}=await import('./blob-ZDEX2HRV.cjs'),J=await Dt(Y(U,m.ref??void 0),Et,`update market-snapshot ${p}`),q=(await chunkCXH3OTTQ_cjs.S()).markets[chunkCXH3OTTQ_cjs.L(N)]?.snapshotHash;if(J&&q&&q===J.snapshotHash){console.log(` ${c}\u2713 Source ${p} unchanged (market snapshotHash match)${i}`);continue}}catch{}}Object.entries(A.skills).filter(([N,U])=>U.source===p).map(([N,U])=>N);let L=null,f=[],y=new Map,I=null;try{let N=m.sourceType??"git",U=chunkCXH3OTTQ_cjs.e(w),Y=await Dt(chunkCXH3OTTQ_cjs.Q({type:N,url:U.url,ref:T,mode:"update"}),Et,`update fetch ${p}`);if(L=Y.tempDir,Y.cloneError)I=Y.cloneError;else {let J=await chunkCXH3OTTQ_cjs.A(L);if(J.length===0)I=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${p}`);else {let oe=J.map(H=>{let ce=path.relative(L,H.path);return path.join(ce,"SKILL.md").split(path.sep).join("/")}),q=chunkCXH3OTTQ_cjs.e(w);for(let H of J){let be=path.join(path.relative(L,H.path),"SKILL.md").split(path.sep).join("/").replace(/\/SKILL\.md$/,""),ke=await pl(q,L,be,H.name);ke.ok&&ke.hash&&y.set(H.name,ke.hash);}}}}catch(N){I=N instanceof Error?N:new Error(String(N));}finally{L&&!chunkCXH3OTTQ_cjs.ga(L)&&await chunkCXH3OTTQ_cjs.l(L);}if(I){console.log(` ${c}\u2717 Failed to check for deleted skills from ${p}: ${I.message}${i}`);let N=u.map(U=>({name:U.name,entry:{source:U.source,sourceType:U.entry.sourceType,ref:U.entry.ref}}));$.push(...al(I,N));continue}let O=u.filter(N=>!f.includes(N.name)),E=[];for(let N of O){let U=A.skills[N.name],Y=y.get(N.name);if(!Y)continue;let J=U?.computedHash;if(!Ut(e.force,J,Y))continue;let oe=chunkCXH3OTTQ_cjs.e(N.entry.source),q=chunkCXH3OTTQ_cjs.M(oe),ce=(N.entry.skillPath??N.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");E.push({name:N.name,source:N.entry.source,skillPath:ce,storeRoot:q});}if(E.length!==0)try{let N=E.map(J=>J.name),U=E.map(J=>path.join(J.storeRoot,J.skillPath)),Y=await dl({skillNames:N,skillStorePaths:U,scope:"project",agentFilter:e.agent,cwd:t});gl(Y),Y.failedSkillCount>0?n+=Y.failedSkillCount:s+=Y.skills.length;for(let J of E)o.push(J.name);}catch(N){n+=E.length,console.log(` ${c}\u2717 Failed to refresh: ${N instanceof Error?N.message:String(N)}${i}`);}}if(il(h),Nt($),k.length>0)if(console.log(),o.length>0||$.length>0||h.length>0){let p=[];o.length>0&&p.push(`${x__default.default.green(`\u2713 Refreshed ${o.length} skill(s)${x__default.default.reset("")}`)}`),s>0&&n>0?p.push(`${x__default.default.green(`\u2713 ${s} ok`)} ${x__default.default.dim("|")} ${x__default.default.red(`\u2717 ${n} failed`)}`):s>0?p.push(`${x__default.default.green(`\u2713 ${s} ok`)}`):n>0&&p.push(`${x__default.default.red(`\u2717 ${n} failed`)}`),$.length>0&&p.push(`${x__default.default.yellow(`\u26A0 ${$.length} skipped`)}`),h.length>0&&p.push(`${x__default.default.dim(`${h.length} legacy (cannot update)`)}`),v__namespace.note(p.join(`
8
- `),x__default.default.cyan("Project Skills Update")),v__namespace.outro(`${x__default.default.green("Done!")}${x__default.default.dim(" Run `easbot skills list` to see current state.")}`);}else v__namespace.note(`${x__default.default.green("All project skills are up to date.")}`,x__default.default.cyan("Project Skills Update")),v__namespace.outro(`${x__default.default.green("Done!")}`);if(s>0&&o.length>0)try{let p=await chunkCXH3OTTQ_cjs.t(),u=new Date().toISOString(),m=!1,w=0;for(let T of o){let P=p.skills[T];if(!P)continue;let f=(await chunkCXH3OTTQ_cjs.Y(P.marketId,P.pluginId,T))?.entry.computedHash;f&&P.computedHash!==f&&(P.computedHash=f,P.updatedAt=u,m=!0,w++);}if(m){let{writeLocalLock:T}=await import('./local-lock-GIZDVF3X.cjs');await T(p),console.log(`${c}\u2192 updated project lock: ${w} skill(s) refreshed, ${Object.keys(p.skills).length} total tracked${i}`);}}catch(p){console.log(`${c}\u26A0 Failed to write project lock: ${p instanceof Error?p.message:String(p)}${i}`);}return {successCount:s,failCount:n,foundCount:l.length}}function il(e){if(e.length!==0){console.log(),console.log(`${c}${e.length} project skill(s) cannot be updated automatically (installed before skillPath tracking):${i}`);for(let t of e){let l=cs(t.entry.source,t.entry.ref);console.log(` ${F}\u2022${i} ${chunkRVR3DSD2_cjs.b(t.name)}`),console.log(` ${c}To refresh: ${F}easbot skills add ${l} -y${i}`);}}}async function fl(e=[],t={}){let l=Yn(e,t);l.all===true&&(l.yes=true,(!l.skills||l.skills.length===0)&&(l.skills=["*"]));let s=await qn(l);l.skills?console.log(`${F}Updating ${l.skills.join(", ")}...${i}`):console.log(`${F}Checking for skill updates...${i}`),console.log();let n=0,o=0,r=0;if(s==="global"||s==="both"){s==="both"&&!l.skills&&console.log(`${G}Global Skills${i}`);let{successCount:d,failCount:g,checkedCount:a}=await so(l);n+=d,o+=g,r+=a,s==="both"&&!l.skills&&console.log();}if(s==="project"||s==="both"){s==="both"&&!l.skills&&console.log(`${G}Project Skills${i}`);let{successCount:d,failCount:g,foundCount:a}=await lo(l);n+=d,o+=g,r+=a;}l.skills&&r===0&&console.log(`${c}No installed skills found matching: ${l.skills.join(", ")}${i}`),console.log(),n>0&&console.log(`${F}\u2713 Updated ${n} skill(s)${i}`),o>0&&console.log(`${c}Failed to update ${o} skill(s)${i}`),chunkS6YNGR7S_cjs.d({event:"update",scope:s,skillCount:String(n+o),successCount:String(n),failCount:String(o)}),l.json&&Q(Z({scope:s,totals:{checked:r,refreshed:n,failed:o},detail:{project:r>0,global:r>0},...l.skills&&{skills:l.skills},...l.agent&&{agents:l.agent}},{scope:s,checked:r,refreshed:n,failed:o})),console.log();}var ml={version:"0.3.13"};var yl="eve agent";function ro(e,t){return e.startsWith("git@")||e.startsWith("ssh://")?e:t}function bl(e){chunkS6YNGR7S_cjs.b(e);}async function ao(e,t,l,s){let{agent:n,subagent:o}=t,{installMode:r,installGlobally:d}=s,k=await chunk5BL3KG26_cjs.h(e,n,{global:d,mode:r,eveSubagent:o});return {skill:chunkCXH3OTTQ_cjs.B(e),agent:ft(t),pluginName:e.pluginName,...k}}var co=(()=>{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 hl(e){switch(e){case "critical":return x__default.default.red(x__default.default.bold("Critical Risk"));case "high":return x__default.default.red("High Risk");case "medium":return x__default.default.yellow("Med Risk");case "low":return x__default.default.green("Low Risk");case "safe":return x__default.default.green("Safe");default:return x__default.default.dim("--")}}function po(e){if(!e)return x__default.default.dim("--");let t=e.alerts??0;return t>0?x__default.default.red(`${t} alert${t!==1?"s":""}`):x__default.default.green("0 alerts")}function rt(e,t){let l=chunkRVR3DSD2_cjs.a(e),s=Math.max(0,t-l.length);return e+" ".repeat(s)}function uo(e,t,l){if(!e)return [];if(!t.some(d=>{let g=e[d.slug];return g&&Object.keys(g).length>0}))return [];let n=Math.min(Math.max(...t.map(d=>d.displayName.length)),36),o=[],r=rt("",n+2)+rt(x__default.default.dim("Gen"),18)+rt(x__default.default.dim("Socket"),18)+x__default.default.dim("Snyk");o.push(r);for(let d of t){let g=e[d.slug],a=d.displayName.length>n?d.displayName.slice(0,n-1)+"\u2026":d.displayName,k=g?.ath?hl(g.ath.risk):x__default.default.dim("--"),h=g?.socket?po(g.socket):x__default.default.dim("--"),C=g?.snyk?hl(g.snyk.risk):x__default.default.dim("--");o.push(rt(x__default.default.cyan(a),n+2)+rt(k,18)+rt(h,18)+C);}return o.push(""),o.push(`${x__default.default.dim("Details:")} ${x__default.default.dim(`https://skills.sh/${l}`)}`),o}function ds(e,t){let l=os.homedir();return e===l||e.startsWith(l+path.sep)?"~"+e.slice(l.length):e===t||e.startsWith(t+path.sep)?"."+e.slice(t.length):e}function xe(e,t=5){if(e.length<=t)return e.join(", ");let l=e.slice(0,t),s=e.length-t;return `${l.join(", ")} +${s} more`}function go(e){let t=e.map(s=>x__default.default.cyan(chunkCXH3OTTQ_cjs.B(s))),l=xe(t,3);return chunkRVR3DSD2_cjs.a(l).length<=80?l:`${e.length} selected skills`}function fo(e){return `Detected an eve project. Install ${go(e)} for your ${yl} to use?`}function mo(e,t,l){let s=[],n=[],o=[],r=new Map;if(e)for(let d of e)d.mode&&r.set(d.agent,d.mode);for(let d of t){let g=chunkISMGLHYS_cjs.b[d].displayName,a=r.get(g);chunkISMGLHYS_cjs.o(d,l?"global":"project")?s.push(g):a==="symlink"?o.push(g):n.push(g);}return {universal:s,copied:n,symlinked:o}}function ft(e){let t=chunkISMGLHYS_cjs.b[e.agent].displayName;return e.subagent?`${t} (${e.subagent})`:t}function Ft(e){return e.subagent?`${e.agent}:${e.subagent}`:e.agent}function ho(e,t){let l=[];for(let s of e)if(s==="eve")for(let n of t)l.push({agent:s,subagent:n});else l.push({agent:s});return l}function ko(e,t,l,s=[]){let n=[],o=e.filter(h=>!h.subagent).map(h=>h.agent),r=e.filter(h=>h.subagent).map(ft),d,g;if(s.length>0){let h=new Set(s);d=o.filter(C=>h.has(C)),g=o.filter(C=>!h.has(C));}else d=o.filter(h=>chunkISMGLHYS_cjs.o(h,l?"global":"project")),g=o.filter(h=>!chunkISMGLHYS_cjs.o(h,l?"global":"project"));let a=d.map(h=>chunkISMGLHYS_cjs.b[h].displayName),k=g.map(h=>chunkISMGLHYS_cjs.b[h].displayName);return t==="symlink"?(a.length>0&&n.push(` ${x__default.default.green("universal:")} ${xe(a)}`),k.length>0&&n.push(` ${x__default.default.dim("symlinked:")} ${xe(k)}`),r.length>0&&n.push(` ${x__default.default.dim("copied:")} ${xe(r)}`)):(a.length>0&&n.push(` ${x__default.default.green("universal:")} ${xe(a)}`),k.length>0&&n.push(` ${x__default.default.dim("copied:")} ${xe(k)}`),r.length>0&&n.push(` ${x__default.default.dim("copied (subagent):")} ${xe(r)}`)),n}function kl(e,t){let l=chunkISMGLHYS_cjs.h(t),s=[...e];for(let n of l)s.includes(n)||s.push(n);return s}function $o(e,t,l){let s=[],{universal:n,copied:o,symlinked:r}=mo(e,t,l),d=o,g=e.filter(a=>a.symlinkFailed&&!a.skipped).map(a=>a.agent);return n.length>0&&s.push(` ${x__default.default.green("universal:")} ${xe(n)}`),d.length>0&&s.push(` ${x__default.default.cyan("copied:")} ${xe(d)}`),r.length>0&&s.push(` ${x__default.default.dim("symlinked:")} ${xe(r)}`),g.length>0&&s.push(` ${x__default.default.yellow("symlink-failed:")} ${xe(g)}`),s}function yo(e){return v__namespace.multiselect({...e,options:e.options,message:`${e.message} ${x__default.default.dim("(space to toggle)")}`})}async function bo(e,t){return await ss({message:e,items:t,initialSelected:[],required:true})}async function $l(e){let t=e.global===true?"global":"project",l=a=>t!=="global"||chunkISMGLHYS_cjs.b[a].globalSkillsDir!==void 0,s=chunkISMGLHYS_cjs.h(t).filter(l),n=chunkISMGLHYS_cjs.i(t).filter(a=>a!=="eve"&&l(a)),o={title:"Universal (.agents/skills)",items:s.map(a=>({value:a,label:chunkISMGLHYS_cjs.b[a].displayName}))},r=n.map(a=>({value:a,label:chunkISMGLHYS_cjs.b[a].displayName,hint:e.global?chunkISMGLHYS_cjs.b[a].globalSkillsDir:chunkISMGLHYS_cjs.b[a].skillsDir})),g=await ss({message:"Which agents do you want to install to?",items:r,initialSelected:[],lockedSection:o});if(Array.isArray(g)){let a=g,k=new Set(s),h=[],C=[],A=new Set;for(let $ of a)A.has($)||(A.add($),k.has($)?h.push($):C.push($));return {locked:h,selected:C}}return g}var So=ml.version;chunkS6YNGR7S_cjs.b(So);async function mt(e,t={}){let l=e[0],s=false,n=()=>{s||(v__namespace.log.message(x__default.default.dim("Tip: use the --yes (-y) and --global (-g) flags to install without prompts.")),s=true);};if(!l){let{readStoreIndex:g,resolveDefaultSource:a}=await import('./store-F7PGGZIO.cjs'),k=await g();l=await a(k);}t.all&&(t.skill=["*"],t.agent=["*"],t.yes=true);let o=t.global??false;if(!(t.global!==void 0)&&!t.yes&&!t.all&&process.stdin.isTTY&&Object.values(chunkISMGLHYS_cjs.b).some(h=>h.globalSkillsDir!==void 0)){let h=await v__namespace.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)"}]});v__namespace.isCancel(h)&&(v__namespace.cancel("Installation cancelled"),await he(null),process.exit(0)),o=h,v__namespace.log.info(`${x__default.default.bold(o?"Global":"Project")} scope selected`);}let r=await nt();if(r.isAgent&&(t.yes=true,!t.agent||t.agent.length===0)){let g=nl(r.agent.name);if(g){let a=o?"global":"project";t.agent=kl([g],a);}}console.log(),r.isAgent||v__namespace.intro(x__default.default.bgCyan(x__default.default.black(" skills "))),r.isAgent?v__namespace.log.info(Pt(r.agent.name)+" Agent detected \u2014 installing non-interactively"):!process.stdin.isTTY&&!t.yes&&n();let d=null;try{let g=v__namespace.spinner();g.start("Parsing source...");let a=chunkCXH3OTTQ_cjs.e(l);g.stop(`Source: ${a.type==="local"?a.localPath:a.url}${a.ref?` #${x__default.default.yellow(a.ref)}`:""}${a.subpath?` @${x__default.default.cyan(a.subpath)}`:""}`);let k=chunkCXH3OTTQ_cjs.a(a),h=(()=>{if(!k)return Promise.resolve(null);let b=chunkCXH3OTTQ_cjs.b(k);return b?chunkCXH3OTTQ_cjs.c(b.owner,b.repo).catch(()=>null):Promise.resolve(null)})(),C=Array.isArray(t?.skill)&&t.skill.length>0||t.fullDepth===!0||!!a.subpath;g.start("Loading source...");let A;try{A=await chunkCXH3OTTQ_cjs.da(a,{includeInternal:C,fullDepth:t.fullDepth});}catch(b){throw b instanceof chunkCXH3OTTQ_cjs.R&&(g.stop(x__default.default.red("Path not found")),v__namespace.outro(x__default.default.red(`Local path does not exist: ${b.localPath}`)),process.exit(1)),b}d=A.storeDir,g.stop(A.cacheHit?"Repository loaded from cache":A.source==="blob-fetch"?"Fetched via GitHub API":A.source==="well-known-fetch"?"Well-known index fetched":A.source==="local-cp"?"Local path cached":"Repository cloned");let $=A.skills,p=a.subpath?$.filter(b=>b.path.includes(`/${a.subpath}/`)||b.path.endsWith(`/${a.subpath}`)):$;if(g.start("Discovering skills..."),p.length===0&&A.cloneError){g.stop(x__default.default.red("Failed to clone repository"));for(let b of A.cloneError.message.split(`
9
- `))v__namespace.log.message(x__default.default.dim(b));await he(d),process.exit(1);}if(p.length===0&&(g.stop(x__default.default.red("No skills found")),v__namespace.outro(x__default.default.red("No valid skills found. Skills require a SKILL.md with name and description.")),await he(d),process.exit(1)),g.stop(`Found ${x__default.default.green(p.length)} skill${p.length>1?"s":""}`),t.list){console.log(),v__namespace.log.step(x__default.default.bold("Available Skills"));let b={},j=[];for(let _ of p)if(_.pluginName){let D=_.pluginName;b[D]||(b[D]=[]),b[D].push(_);}else j.push(_);let R=Object.keys(b).sort();for(let _ of R){let D=_.split("-").map(W=>W.charAt(0).toUpperCase()+W.slice(1)).join(" ");console.log(x__default.default.bold(D));for(let W of b[_])v__namespace.log.message(` ${x__default.default.cyan(chunkCXH3OTTQ_cjs.B(W))}`),v__namespace.log.message(` ${x__default.default.dim(W.description)}`);console.log();}if(j.length>0){R.length>0&&console.log(x__default.default.bold("General"));for(let _ of j)v__namespace.log.message(` ${x__default.default.cyan(chunkCXH3OTTQ_cjs.B(_))}`),v__namespace.log.message(` ${x__default.default.dim(_.description)}`);}console.log(),v__namespace.outro("Use --skill <name> to install specific skills"),await he(d),process.exit(0);}let u;if(t.skill&&t.skill.length>0){let b=p.map(R=>chunkCXH3OTTQ_cjs.B(R)),j=chunkCXH3OTTQ_cjs.E(t.skill,b);if(j.wildcard)u=p,v__namespace.log.info(`Installing all ${p.length} skills`);else if(j.invalid.length>0){v__namespace.log.error(`No matching skills found for: ${j.invalid.join(", ")}`),v__namespace.log.info("Available skills:");for(let R of p)v__namespace.log.message(` - ${chunkCXH3OTTQ_cjs.B(R)}`);await he(d),process.exit(1);}else u=chunkCXH3OTTQ_cjs.C(p,j.matched),u.length===0&&(v__namespace.log.error(`No matching skills found for: ${j.matched.join(", ")}`),await he(d),process.exit(1)),v__namespace.log.info(`Selected ${u.length} skill${u.length!==1?"s":""}: ${u.map(R=>x__default.default.cyan(chunkCXH3OTTQ_cjs.B(R))).join(", ")}`);}else if(p.length===1){u=p;let b=p[0];v__namespace.log.info(`Skill: ${x__default.default.cyan(chunkCXH3OTTQ_cjs.B(b))}`),v__namespace.log.message(x__default.default.dim(b.description));}else if(t.yes)u=p,v__namespace.log.info(`Installing all ${p.length} skills`);else {let b=[...p].sort((_,D)=>_.pluginName&&!D.pluginName?-1:!_.pluginName&&D.pluginName?1:_.pluginName&&D.pluginName&&_.pluginName!==D.pluginName?_.pluginName.localeCompare(D.pluginName):chunkCXH3OTTQ_cjs.B(_).localeCompare(chunkCXH3OTTQ_cjs.B(D))),j=b.some(_=>_.pluginName),R;if(j){let _=W=>W.split("-").map(V=>V.charAt(0).toUpperCase()+V.slice(1)).join(" "),D={};for(let W of b){let V=W.pluginName?_(W.pluginName):"Other";D[V]||(D[V]=[]),D[V].push({value:W,label:chunkCXH3OTTQ_cjs.B(W),hint:W.description.length>60?W.description.slice(0,57)+"...":W.description});}R=await v__namespace.groupMultiselect({message:`Select skills to install ${x__default.default.dim("(space to toggle)")}`,options:D,required:!0});}else {let _=b.map(D=>({value:D,label:chunkCXH3OTTQ_cjs.B(D),hint:D.description.length>60?D.description.slice(0,57)+"...":D.description}));R=await yo({message:"Select skills to install",options:_,required:!0});}v__namespace.isCancel(R)&&(v__namespace.cancel("Installation cancelled"),await he(d),process.exit(0)),u=R;}let m=chunkCXH3OTTQ_cjs.a(a),w=m?chunkS6YNGR7S_cjs.c(m,u.map(b=>chunkCXH3OTTQ_cjs.B(b))):Promise.resolve(null),T,P=Object.keys(chunkISMGLHYS_cjs.b),L=o?"global":"project",f=[];if(t.agent&&t.agent.length>0){let b=chunkISMGLHYS_cjs.p(t.agent);b.length>0&&(v__namespace.log.error(`Invalid agents: ${b.join(", ")}`),v__namespace.log.info(`Valid agents: ${P.join(", ")}`),await he(d),process.exit(1)),T=chunkISMGLHYS_cjs.q(t.agent),t.agent.includes("*")&&v__namespace.log.info(`Installing to all ${T.length} agents`);}else {g.start("Loading agents...");let b=await chunkISMGLHYS_cjs.c(),j=Object.keys(chunkISMGLHYS_cjs.b).length;if(g.stop(`${j} agents`),b.includes("eve")&&(t.yes||!r.isAgent)){let R=t.yes?!0:await v__namespace.confirm({message:fo(u),initialValue:!0});if(v__namespace.isCancel(R)&&(v__namespace.cancel("Installation cancelled"),await he(d),process.exit(0)),R)T=["eve"],v__namespace.log.info(`Installing to: ${x__default.default.cyan(yl)}`);else {let _=await $l({global:L==="global"});typeof _=="symbol"&&(v__namespace.cancel("Installation cancelled"),await he(d),process.exit(0)),f=_.locked,T=[..._.locked,..._.selected];}}else if(b.length===0)if(t.yes)T=P,v__namespace.log.info("Installing to all agents");else {v__namespace.log.info("Select agents to install skills to");let R=Object.entries(chunkISMGLHYS_cjs.b).filter(([D])=>D!=="eve").map(([D,W])=>({value:D,label:W.displayName})),_=await bo("Which agents do you want to install to?",R);v__namespace.isCancel(_)&&(v__namespace.cancel("Installation cancelled"),await he(d),process.exit(0)),T=_;}else if(b.length===1||t.yes)if(T=kl(b,L),b.length===1){let R=b[0];v__namespace.log.info(`Installing to: ${x__default.default.cyan(chunkISMGLHYS_cjs.b[R].displayName)}`);}else v__namespace.log.info(`Installing to: ${b.map(R=>x__default.default.cyan(chunkISMGLHYS_cjs.b[R].displayName)).join(", ")}`);else {let R=await $l({global:L==="global"});typeof R=="symbol"&&(v__namespace.cancel("Installation cancelled"),await he(d),process.exit(0)),f=R.locked,T=[...R.locked,...R.selected];}}t.subagent&&t.subagent.length>0&&!T.includes("eve")&&(T=[...T,"eve"]);let y=[void 0];if(T.includes("eve")){let b=chunkISMGLHYS_cjs.f(process.cwd());if(t.subagent&&t.subagent.length>0)y=t.subagent.map(j=>j==="root"||j==="."?void 0:j);else if(b.length>0&&!t.yes){let j=[{value:"",label:"Root agent",hint:"agent/skills"},...b.map(_=>({value:_,label:_,hint:`agent/subagents/${_}/skills`}))],R=await v__namespace.multiselect({message:"Where should Eve skills be installed?",options:j,initialValues:[""],required:!0});v__namespace.isCancel(R)&&(v__namespace.cancel("Installation cancelled"),await he(d),process.exit(0)),y=R.map(_=>_===""?void 0:_);}}let I=ho(T,y),O=t.copy?"copy":"symlink";if(I.every(b=>b.agent==="eve"))O="copy";else if(t.copy||t.yes)O="copy";else {let b=await v__namespace.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"}]});v__namespace.isCancel(b)&&(v__namespace.cancel("Installation cancelled"),await he(d),process.exit(0)),O=b;}let N=process.cwd(),U=[],Y=o?null:await chunkCXH3OTTQ_cjs.t(N),J=await Promise.all(u.flatMap(b=>I.map(async j=>{let R=await chunk5BL3KG26_cjs.l(b.name,j.agent,{global:o,eveSubagent:j.subagent}),_=R.installed,D;try{D=await chunkE7AHWFZN_cjs.b(b.path);}catch{D=void 0;}let V=Y?.skills[b.name]?.computedHash,le=!Ut(!1,V,D),re=_&&R.mode==="copy"&&O==="copy"&&le,pe=!!_;return {skillName:b.name,target:j,installed:_,installedMode:R.mode,sourceHash:D,upToDate:!!re,overwrite:pe}}))),oe=new Map,q=new Map;for(let{skillName:b,target:j,overwrite:R,upToDate:_}of J)oe.has(b)||(oe.set(b,new Map),q.set(b,new Map)),oe.get(b).set(Ft(j),R),q.get(b).set(Ft(j),_);let H={},ce=[];for(let b of u)if(b.pluginName){let j=b.pluginName;H[j]||(H[j]=[]),H[j].push(b);}else ce.push(b);let be=b=>{for(let j of b){U.length>0&&U.push("");let R=I[0];I.length>1&&(R=I.find(re=>chunkISMGLHYS_cjs.o(re.agent,o?"global":"project"))??I[0]);let _=chunk5BL3KG26_cjs.o(j.name,{global:o,agent:R.agent,eveSubagent:R.subagent}),D=ds(_,N);U.push(`${x__default.default.cyan(D)}`),U.push(...ko(I,O,o,f));let W=oe.get(j.name),V=I.filter(le=>!chunkISMGLHYS_cjs.o(le.agent,o?"global":"project")&&W?.get(Ft(le))).map(ft);V.length>0&&U.push(` ${x__default.default.yellow("overwrites:")} ${xe(V)}`);}},ke=Object.keys(H).sort();for(let b of ke){let j=b.split("-").map(R=>R.charAt(0).toUpperCase()+R.slice(1)).join(" ");U.push(""),U.push(x__default.default.bold(j)),be(H[b]);}ce.length>0&&(ke.length>0&&(U.push(""),U.push(x__default.default.bold("General"))),be(ce)),console.log(),v__namespace.note(U.join(`
10
- `),"Installation Summary");try{let b=await Promise.race([w,new Promise(j=>setTimeout(()=>j(null),co))]);if(b&&m){let j=uo(b,u.map(R=>({slug:chunkCXH3OTTQ_cjs.B(R),displayName:chunkCXH3OTTQ_cjs.B(R)})),m);j.length>0&&v__namespace.note(j.join(`
11
- `),"Security Risk Assessments");}}catch{}if(!t.yes){let b=await v__namespace.confirm({message:"Proceed with installation?"});(v__namespace.isCancel(b)||!b)&&(v__namespace.cancel("Installation cancelled"),await he(d),process.exit(0));}g.start("Installing skills...");let Se=[],Ee=await Promise.all(u.map(async b=>{let j=new Map;for(let _ of I){let D=chunk5BL3KG26_cjs.g(_.agent,o,N,_.subagent),W=(_.agent==="eve"||_.agent==="easbot")&&O==="symlink",V=O==="copy"||W?D:chunk5BL3KG26_cjs.e(o,N),le=chunk5BL3KG26_cjs.d(b.name||path.basename(b.path)),re=path.join(V,le),pe=path.join(D,le),K=re,te=j.get(K);te||(te={canonicalDir:re,members:[]},j.set(K,te)),te.members.push({target:_,agentDir:pe});}return (await Promise.all([...j.values()].map(async _=>{let[D,...W]=_.members;if(!D)return [];if(q.get(b.name)?.get(Ft(D.target))??!1)return _.members.map(({target:pe,agentDir:K})=>({skill:chunkCXH3OTTQ_cjs.B(b),agent:ft(pe),pluginName:b.pluginName,success:!0,path:K,canonicalPath:K,mode:O,skipped:!0,skippedReason:"up-to-date"}));let le=await ao(b,D.target,D.agentDir,{installMode:O,installGlobally:o,cwd:N,tempDir:d}),re=await Promise.all(W.map(async({target:pe,agentDir:K})=>{let te=O==="copy"?await chunk5BL3KG26_cjs.j(_.canonicalDir,K,{agentType:pe.agent}):await chunk5BL3KG26_cjs.i(_.canonicalDir,K,{isGlobal:o,agentType:pe.agent,cwd:N,storePath:b.path});return {skill:chunkCXH3OTTQ_cjs.B(b),agent:ft(pe),pluginName:b.pluginName,...te}}));return [le,...re]}))).flat()}));for(let b of Ee)Se.push(...b);g.stop("Installation complete"),console.log();let Le=Se.filter(b=>b.success),Ye=Se.filter(b=>!b.success),Re={};for(let b of u)if(d&&b.path===d)Re[b.name]="SKILL.md";else if(d&&b.path.startsWith(d+path.sep))Re[b.name]=`${b.path.slice(d.length+1).split(path.sep).join("/")}/SKILL.md`;else if(d&&b.path.startsWith(d)){let j=d.split(path.sep).join("/"),R=b.path.split(path.sep).join("/");R.startsWith(`${j}/`)&&(Re[b.name]=`${R.slice(j.length+1)}/SKILL.md`);}let qe=chunkCXH3OTTQ_cjs.a(a),vs=ro(a.url,qe);if(qe&&(chunkCXH3OTTQ_cjs.b(qe)?h.then(j=>{j===!1&&chunkS6YNGR7S_cjs.d({event:"install",source:qe,skills:u.map(R=>R.name).join(","),agents:T.join(","),...o&&{global:"1"},skillFiles:JSON.stringify(Re)});}):chunkS6YNGR7S_cjs.d({event:"install",source:qe,skills:u.map(j=>j.name).join(","),agents:T.join(","),...o&&{global:"1"},skillFiles:JSON.stringify(Re)})),Le.length>0&&o){let b=new Set(Le.map(j=>j.skill));for(let j of u){if(!b.has(chunkCXH3OTTQ_cjs.B(j)))continue;let{derivePluginSlug:R,findSkillByLocation:_,readStoreIndex:D}=await import('./store-F7PGGZIO.cjs'),W=chunkCXH3OTTQ_cjs.L(a),V;{let te=(await D()).markets[W],$e=te?.plugins&&Object.keys(te.plugins).find(Te=>te.plugins[Te]?.skills[j.name]);$e?V=$e.slice(W.length+1):V=R(a,void 0,j.pluginName);}let le,re;{let K=await _(W,`${W}:${V}`,j.name);le=K?.entry.computedHash,re=K?.entry.skillPath;}if(re===void 0){let K=a.type==="local"?a.localPath??a.url:a.url;if(j.path.startsWith(K))re=utils.Filesystem.relative(K,j.path).replace(/^\/+/,"");else {let te=Re[j.name];te&&(re=utils.Filesystem.toUnixPath(utils.Filesystem.dirname(te)));}}le===void 0&&(le=await chunkE7AHWFZN_cjs.b(j.path));let pe=`${W}:${V}`;await chunkSXUY2J75_cjs.i(j.name,{source:vs||qe||a.url,sourceType:a.type,ref:a.ref,...re&&{skillPath:re},computedHash:le,marketId:W,pluginId:pe});}}if(Le.length>0&&!o){let b=new Set(Le.map(_=>_.skill)),j=T.includes("eve")?y.map(_=>_??""):void 0,R=j&&(j.length>1||j.some(_=>_!==""));for(let _ of u)if(b.has(chunkCXH3OTTQ_cjs.B(_)))try{let{derivePluginSlug:D,findSkillByLocation:W,readStoreIndex:V}=await import('./store-F7PGGZIO.cjs'),le=chunkCXH3OTTQ_cjs.L(a),re=u.find(Te=>chunkCXH3OTTQ_cjs.B(Te)===_.name),pe;{let Ne=(await V()).markets[le],ve=Ne?.plugins&&Object.keys(Ne.plugins).find(De=>Ne.plugins[De]?.skills[_.name]);ve?pe=ve.slice(le.length+1):pe=D(a,void 0,re?.pluginName);}let K,te;{let Te=await W(le,`${le}:${pe}`,_.name);K=Te?.entry.computedHash,te=Te?.entry.skillPath??Re[_.name];}K===void 0&&(K=await chunkE7AHWFZN_cjs.b(_.path));let $e=`${le}:${pe}`;await chunkCXH3OTTQ_cjs.v(_.name,{source:vs||a.url,ref:a.ref,sourceType:a.type,...te&&{skillPath:te},computedHash:K,marketId:le,pluginId:$e,...R&&{subagents:j}},N);}catch{}}if(Le.length>0){let b=new Map,j={},R=[];for(let K of Le){let te=b.get(K.skill)||[];if(te.push(K),b.set(K.skill,te),te.length===1)if(K.pluginName){let $e=K.pluginName;j[$e]||(j[$e]=[]),j[$e].push(K);}else R.push(K);}let _=b.size,D=Le.filter(K=>K.mode==="symlink"&&K.symlinkFailed),W=D.map(K=>K.agent),V=[],le=K=>{for(let te of K){let $e=b.get(te.skill)||[],Te=$e[0];if(V.push(`${x__default.default.green("\u2713")} ${te.skill}`),Te.canonicalPath){let ve=ds(Te.canonicalPath,N);V.push(` ${x__default.default.dim("source:")} ${ve}`);}let Ne=new Map;for(let ve of $e){if(ve.symlinkFailed||ve.skipped||Te.canonicalPath&&ve.path===Te.canonicalPath)continue;let De=ve.path;Ne.has(De)?Ne.get(De)!=="symlink"&&ve.mode==="symlink"&&Ne.set(De,"symlink"):Ne.set(De,ve.mode);}for(let[ve,De]of Ne){let on=ds(ve,N),rn=De==="symlink"?x__default.default.cyan("(link)"):x__default.default.dim("(copied)");V.push(` ${x__default.default.dim("target:")} ${on} ${rn}`);}V.push(...$o($e,T,o));}},re=Object.keys(j).sort();for(let K of re){let te=K.split("-").map($e=>$e.charAt(0).toUpperCase()+$e.slice(1)).join(" ");V.push(""),V.push(x__default.default.bold(te)),le(j[K]);}R.length>0&&(re.length>0&&(V.push(""),V.push(x__default.default.bold("General"))),le(R));let pe=x__default.default.green(`Installed ${_} skill${_!==1?"s":""}`);v__namespace.note(V.join(`
12
- `),pe),D.length>0&&(v__namespace.log.warn(x__default.default.yellow(`Symlinks failed for: ${xe(W)}`)),v__namespace.log.message(x__default.default.dim(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(Ye.length>0){console.log(),v__namespace.log.error(x__default.default.red(`Failed to install ${Ye.length}`));for(let b of Ye)v__namespace.log.message(` ${x__default.default.red("\u2717")} ${b.skill} \u2192 ${b.agent}: ${x__default.default.dim(b.error)}`);}if(console.log(),v__namespace.outro(x__default.default.green("Done!")+x__default.default.dim(" Review skills before use; they run with full agent permissions.")),t.json){let b=Le.map(R=>({skill:R.skill,agent:R.agent,canonicalPath:R.canonicalPath??null,path:R.path,mode:R.mode,...R.pluginName&&{pluginName:R.pluginName}})),j=Ye.map(R=>({skill:R.skill,agent:R.agent,error:R.error??"unknown error"}));Q(Z({scope:o?"global":"project",source:a.url,sourceType:a.type,...a.subpath&&{subpath:a.subpath},...a.ref&&{ref:a.ref},installed:b,failed:j,summary:{total:Se.length,installed:b.length,failed:j.length,agents:T,mode:O}},{scope:o?"global":"project",source:a.url,installed:b.length,failed:j.length,total:Se.length,agents:T.length}));return}await wo(t,T);}catch(g){if(g instanceof chunkCXH3OTTQ_cjs.g){v__namespace.log.error(x__default.default.red("Failed to clone repository"));for(let a of g.message.split(`
13
- `))v__namespace.log.message(x__default.default.dim(a));}else v__namespace.log.error(g instanceof Error?g.message:"Unknown error occurred");process.stdin.isTTY||n(),v__namespace.outro(x__default.default.red("Installation failed")),process.exit(1);}finally{await he(d);}}async function he(e){if(e){if(chunkCXH3OTTQ_cjs.ga(e))return;try{await chunkCXH3OTTQ_cjs.l(e);}catch{}}}async function wo(e,t){if(process.stdin.isTTY&&!e?.yes)try{if(await chunkSXUY2J75_cjs.n("findSkillsPrompt"))return;if(await chunk5BL3KG26_cjs.k("eas-skill-find","claude-code",{global:!0})){await chunkSXUY2J75_cjs.p("findSkillsPrompt");return}console.log(),v__namespace.log.message(x__default.default.dim("One-time prompt - you won't be asked again if you dismiss."));let n=await v__namespace.confirm({message:`Install the ${x__default.default.cyan("eas-skill-find")} skill? It helps your agent discover and suggest skills.`});if(v__namespace.isCancel(n)){await chunkSXUY2J75_cjs.p("findSkillsPrompt");return}if(n){await chunkSXUY2J75_cjs.p("findSkillsPrompt");let o=t?.filter(r=>r!=="replit");if(!o||o.length===0)return;console.log(),v__namespace.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=path.join(chunk5BL3KG26_cjs.e(!0),"eas-skill-find"),d=await is({skillId:"eas-skill-find",sourceDir:r,targetAgents:o,installGlobally:!0,defaultMode:"symlink",assumeYes:e?.yes===!0});d.reported.length>0&&v__namespace.log.warn(`${d.reported.length} cell(s) reported divergent/orphan (not auto-fixed). Run 'easbot skills repair' to fix.`);}catch{v__namespace.log.warn("Failed to install eas-skill-find. You can try again with:"),v__namespace.log.message(x__default.default.dim(" easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find -g -y --all"));}}else await chunkSXUY2J75_cjs.p("findSkillsPrompt"),v__namespace.log.message(x__default.default.dim("You can install it later with: easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find"));}catch{}}function Mt(e){let t={},l=[];for(let s=0;s<e.length;s++){let n=e[s];if(n==="-g"||n==="--global")t.global=true;else if(n==="-y"||n==="--yes")t.yes=true;else if(n==="-l"||n==="--list")t.list=true;else if(n==="--all")t.all=true;else if(n==="--json")t.json=true;else if(n==="-a"||n==="--agent"){t.agent=t.agent||[],s++;let o=e[s];for(;s<e.length&&o&&!o.startsWith("-");)t.agent.push(o),s++,o=e[s];s--;}else if(n==="-s"||n==="--skill"){t.skill=t.skill||[],s++;let o=e[s];for(;s<e.length&&o&&!o.startsWith("-");)t.skill.push(o),s++,o=e[s];s--;}else if(n==="--full-depth")t.fullDepth=true;else if(n==="--copy")t.copy=true;else if(n==="--subagent"){t.subagent=t.subagent||[],s++;let o=e[s];for(;s<e.length&&o&&!o.startsWith("-");)t.subagent.push(o),s++,o=e[s];s--;}else n&&!n.startsWith("-")&&l.push(n);}return {source:l,options:t}}var Sl={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 xo=Sl.languages,Ao=xo.filter(e=>e.supported).map(e=>e.value),Je={defaultLocale:"zh-CN",locales:Ao},ht={},Kt=(e,t)=>{let l=ht[e]||{translation:{}};return ht[e]={translation:{...l.translation,...t.translation}},ht[e]},Gt=(e=Je.defaultLocale)=>(ht[e]||Kt(e,{translation:{}}),{locale:e,resources:ht[e]||{translation:{}}});var To={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\uFF09","cli.help.store.clean_desc":"\u91CD\u7F6E store\uFF1A\u5220 store \u7269\u7406 + \u6E05 index.ts\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\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"}},wl=To;var Io={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)","cli.help.store.clean_desc":"Reset store: delete store dirs + clear index.ts (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)","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"}},vl=Io;var jo=()=>{Gt("zh-CN"),Gt("en-US"),Kt("zh-CN",wl),Kt("en-US",vl);};jo();var fs=new Map,ms=new Map,Lo=e=>{if(ms.has(e))return ms.get(e);let t=/{{\s*(\w+)\s*}}/g,l=[],s;for(;(s=t.exec(e))!==null;){let r=s[1];r&&!l.includes(r)&&l.push(r);}let n=new RegExp("{{\\s*("+l.join("|")+")\\s*}}","g"),o={keys:l,regex:n};return ms.set(e,o),o},xl=(e,t)=>{if(!e||typeof e!="string")return "";if(!t||Object.keys(t).length===0)return e;let{regex:l,keys:s}=Lo(e);return s.length===0||!s.some(o=>o in t)?e:e.replace(l,(o,r)=>{let d=t[r];return d==null?"":String(d)})},_o=e=>{if(e&&Je.locales.includes(e))return e;let t=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(t){let l=t.replace(/_/g,"-");if(Je.locales.includes(l))return l;let s=l.split("-")[0];if(s==="zh")return "zh-CN";if(s==="en")return "en-US"}return Je.defaultLocale},Al=e=>{if(!fs.has(e)){let{resources:t}=Gt(e);fs.set(e,t);}return fs.get(e)},Co=(e,t={})=>{let l=_o(t.locale),n=Al(l)?.translation[e];if(n&&typeof n=="string"){let o=xl(n,t.vars);return o!=null?String(o):String(e)}if(l!==Je.defaultLocale){let r=Al(Je.defaultLocale)?.translation[e];if(r&&typeof r=="string"){let d=xl(r,t.vars);return d!=null?String(d):String(e)}}return String(t.fallback??e)},S=Co;function Ro(e){let t=e[0]??"list",l=e.slice(1);return {subcommand:t,restArgs:l}}async function jl(e,t={}){let{subcommand:l,restArgs:s}=Ro(e),n=No(s,t);switch(l){case "list":return Oo(Tl(s),n);case "clean":return Do(n);case "update":return Mo(Tl(s),n);case "remove":return Go(s,n);case "--help":case "-h":return Il(),0;default:return console.log(x__default.default.yellow(S("cli.store.unknown_subcommand",{vars:{sub:l},fallback:`Unknown store subcommand: ${l}`}))),Il(),1}}async function Ll(e){if(!fs$1.existsSync(e))return;let t=fs$1.readdirSync(e,{withFileTypes:true});for(let l of t){if(l.name==="index.json")continue;let s=utils.Filesystem.join(e,l.name);await promises.rm(s,{recursive:true,force:true}).catch(()=>{});}}function Tl(e){for(let t of e)if(t&&!t.startsWith("-"))return t}function No(e,t){let l={...t};for(let s=0;s<e.length;s++){let n=e[s];n!==void 0&&(n==="--force"?l.force=true:n==="--yes"||n==="-y"?l.yes=true:n==="--json"&&(l.json=true));}return l}async function Oo(e,t={}){let l=await chunkCXH3OTTQ_cjs.S(),s=await chunkCXH3OTTQ_cjs.W(),n=e?s.filter(k=>k.skillName.toLowerCase().includes(e.toLowerCase())):s;if(n.length===0)return t.json?(Q(Z([],{count:0,keyword:e??null,sources:0})),0):(ee([],{emptyTitle:"Store skills",outro:e?`${c}No store skills matching "${e}".`:`${c}No store sources. Run \`skills add <source>\` first.`}),0);let o=new Map(Object.values(l.markets).map(k=>[k.id,k]));if(t.json){let k=n.map(h=>{let C=o.get(h.marketId);return {skillName:h.skillName,marketId:h.marketId,pluginId:h.pluginId,sourceKey:h.marketId,type:C?.type??null,url:C?.url??null,storePath:C?.storePath??null,cachePath:C?.cachePath??null,entry:h.entry}});return Q(Z(k,{count:k.length,keyword:e??null,sources:new Set(n.map(h=>h.marketId)).size})),0}let r=[];r.push("");let d=new Map;for(let k of n){d.has(k.marketId)||d.set(k.marketId,new Map);let h=d.get(k.marketId);h.has(k.pluginId)||h.set(k.pluginId,[]),h.get(k.pluginId).push(k);}let g=Array.from(new Set(n.map(k=>k.marketId))),a=0;for(let k of g){let h=o.get(k),C=k.slice(0,8),A=h?.storePath??utils.Filesystem.join(chunkCXH3OTTQ_cjs.J(),k),$=h?.type??"unknown",p=h?.url??"(local)";r.push(`${x__default.default.bold(C)} ${x__default.default.dim("("+$+")")} ${p} ${x__default.default.dim("store="+C)} ${x__default.default.dim(A)} ${x__default.default.dim("cache="+(h?.cachePath??"(n/a)"))}`);let u=d.get(k),m=Array.from(u.keys()).sort();for(let w of m){let T=u.get(w),P=w.split(":").slice(1).join(":")||w;r.push(` ${x__default.default.dim("\u2514")} ${x__default.default.cyan(P)} ${x__default.default.dim("("+T.length+" skill"+(T.length>1?"s":"")+")")}`);let L=[...T].sort((f,y)=>f.skillName.localeCompare(y.skillName));for(let f of L)r.push(` ${Eo(f.skillName)}`),a++;}r.push("");}return ee(r,{title:`Store skills (${a})`,outro:x__default.default.dim(`Total: ${a} skill(s)${e?` matching "${e}"`:""}. Use \`skills store clean [--force]\` to reset store, \`skills store update [keyword]\` to refresh from source.`)}),0}function Eo(e){return e.replace(/[\x00-\x1f\x7f]/g,"").trim()}async function Do(e={}){return e.force?Fo(e):Uo(e)}async function Uo(e){await chunkCXH3OTTQ_cjs.S();let l=await chunkCXH3OTTQ_cjs.W(),s=Array.from(new Set(l.map(d=>d.marketId))),n=l.length;if(!e.yes&&!e.json&&process.stdin.isTTY){n>0&&v__namespace.log.warn(x__default.default.yellow(`This will reset store: ${s.length} source(s) / ${n} skill(s). Cache is preserved; next \`skills add <source>\` will reuse cache if present.`));let d=await v__namespace.confirm({message:"Reset store (delete store contents + clear index.json)?"});if(v__namespace.isCancel(d)||!d)return v__namespace.cancel("Cancelled."),1}let o=chunkCXH3OTTQ_cjs.J();await Ll(o);let r=utils.Filesystem.join(o,"index.json");if(fs$1.existsSync(r)){let{Filesystem:d}=await import('@easbot/utils');await d.writeJson(r,{version:6,markets:{}});}if(fs$1.existsSync(o)&&await promises.rm(utils.Filesystem.normalize(o),{recursive:true,force:true}).catch(()=>{}),chunkS6YNGR7S_cjs.d({event:"store_clean"}),e.json)return Q(Z({cleaned:true,path:o,affectedSources:s.length,affectedSkills:n,cacheCleared:false},{affectedSources:s.length,affectedSkills:n,cacheCleared:false})),0;{let d=n>0?` (${n} skill(s) reset)`:"";ee([],{emptyTitle:"Store clean",outro:`${x__default.default.green(`\u2713 Reset store: ${o}${d} (cache preserved)`)}`});}return 0}async function Fo(e){let t=await chunkCXH3OTTQ_cjs.S(),l=await chunkCXH3OTTQ_cjs.W(),s=Array.from(new Set(l.map(A=>A.marketId))),n=l.length,o=new Set,r=new Set;for(let A of Object.values(t.markets))A.type==="local"?o.add(A.localPath??A.url):r.add(A.id);if(!e.yes&&!e.json&&process.stdin.isTTY){let A=o.size,$=A>0?x__default.default.yellow(` ${A} local source(s) cache = user directory; will be SKIPPED (never removed by force).`):"";v__namespace.log.warn(x__default.default.yellow(`This will reset store AND clear cache: ${s.length} source(s) / ${n} skill(s).${$}`));let p=await v__namespace.confirm({message:"Reset store + clear cache (local sources protected)?"});if(v__namespace.isCancel(p)||!p)return v__namespace.cancel("Cancelled."),1}let d=chunkCXH3OTTQ_cjs.J(),g=utils.Filesystem.normalize(chunkCXH3OTTQ_cjs.N()),a=utils.Filesystem.normalize(d);for(let A of o){let $=utils.Filesystem.normalize(A);if($.startsWith(a+"/")||$===a)throw new Error(`[INVARIANT 0048-yyy] localPath falls inside storeRoot (suspected configuration error): ${$}
14
- This is a program bug: a local source must be the user's original directory and must not live inside storeRoot.`);if($.startsWith(g+"/")||$===g)throw new Error(`[INVARIANT 0048-yyy] localPath falls inside cacheRoot (suspected configuration error): ${$}
15
- This is a program bug: a local source must not live inside cacheRoot.`)}await Ll(d);let k=utils.Filesystem.join(d,"index.json");if(fs$1.existsSync(k)){let{Filesystem:A}=await import('@easbot/utils');await A.writeJson(k,{version:6,markets:{}});}let h=chunkCXH3OTTQ_cjs.N(),C=false;if(fs$1.existsSync(h)&&r.size>0?(await chunkCXH3OTTQ_cjs.ja(),C=true):fs$1.existsSync(h)&&(await chunkCXH3OTTQ_cjs.ja(),C=true),fs$1.existsSync(d)&&await promises.rm(utils.Filesystem.normalize(d),{recursive:true,force:true}).catch(()=>{}),chunkS6YNGR7S_cjs.d({event:"store_clean_force"}),e.json)Q(Z({cleaned:true,path:d,cachePath:h,affectedSources:s.length,affectedSkills:n,cacheCleared:C,localSourcesSkipped:o.size},{affectedSources:s.length,affectedSkills:n,cacheCleared:C,localSourcesSkipped:o.size}));else {let A=o.size>0?x__default.default.dim(` (${o.size} local source(s) cache preserved)`):"";ee([],{emptyTitle:"Store clean (force)",outro:`${x__default.default.green(`\u2713 Reset store + cleared cache${A}`)}`});}return 0}async function Mo(e,t={}){let l=await chunkCXH3OTTQ_cjs.S(),s=await chunkCXH3OTTQ_cjs.W();if(s.length===0)return t.json?(Q(Z({updated:0,reason:"no store sources"},{updated:0,reason:"no store sources"})),0):(ee([],{emptyTitle:"Store update",outro:`${c}No store sources to update.`}),0);let n=new Set;if(e){let g=e.toLowerCase();for(let a of s)a.skillName.toLowerCase().includes(g)&&n.add(a.marketId);if(n.size===0)return t.json?(Q(Z({updated:0,reason:`no skills matching "${e}"`},{updated:0,reason:`no skills matching "${e}"`})),0):(ee([],{emptyTitle:"Store update",outro:`${c}No store skills matching "${e}".`}),0)}else for(let g of s)n.add(g.marketId);let o=0,r=0,d=[];for(let g of n){let a=await Ko(g,l,{...t});a.ok?(o++,d.push({sourceKey:g,skills:a.skills})):(r++,d.push({sourceKey:g,skills:[],cloneError:a.error}));}return chunkS6YNGR7S_cjs.d({event:"store_update",keyword:e??"",sourceCount:String(o+r),successCount:String(o),failCount:String(r)}),t.json?Q(Z({updated:o,failed:r,total:n.size,keyword:e??null,results:d},{failed:r,total:n.size,keyword:e??null})):(r>0&&v__namespace.log.warn(x__default.default.yellow(`${r} source(s) failed to refresh (clone errors); see above.`)),ee([],{emptyTitle:"Store update",outro:`${x__default.default.green(`\u2713 Refreshed ${o}/${n.size} store source(s)${e?` matching "${e}"`:""}`)}`})),r>0?2:0}async function Ko(e,t,l){let s=t.markets[e];if(!s)return {ok:false,error:`source key not found: ${e}`};let n=chunkCXH3OTTQ_cjs.e(s.url);if(s.subpath&&(n.subpath=s.subpath),s.ref&&(n.ref=s.ref),false);let o=await chunkCXH3OTTQ_cjs.da(n);return o.cloneError?{ok:false,error:o.cloneError.message}:{ok:true,skills:o.skills.map(r=>r.name)}}async function Go(e,t={}){let l=e[0];if(!l)return t.json?(Q(Z({removed:false,reason:"source key required"},{removed:false,reason:"source key required"})),1):(v__namespace.log.error(x__default.default.red("Usage: skills store remove <source-key> [--force]")),1);let s=await chunkCXH3OTTQ_cjs.S(),n=(await chunkCXH3OTTQ_cjs.W()).filter(a=>a.marketId===l);if(n.length===0)return t.json?(Q(Z({removed:false,reason:`source key not found: ${l}`},{removed:false,reason:`source key not found: ${l}`})),1):(v__namespace.log.error(x__default.default.red(`Source key not found: ${l}`)),ee([],{emptyTitle:"Store remove",outro:`${c}Run \`skills store list\` to see available sources.`}),1);let o=s.markets[l],r=utils.Filesystem.join(chunkCXH3OTTQ_cjs.J(),l),d=o.type==="local";if(!t.yes&&!t.json&&process.stdin.isTTY){let a=d?" [local source: user directory protected]":"",k=t.force&&!d?" (+ cache)":"",h=await v__namespace.confirm({message:`Remove store source ${l.slice(0,8)}\u2026 (${n.length} skill(s))${a}${k}?`});if(v__namespace.isCancel(h)||!h)return v__namespace.cancel("Cancelled."),1}fs$1.existsSync(r)&&await promises.rm(r,{recursive:true,force:true}),!d&&t.force&&await chunkCXH3OTTQ_cjs.ia({type:o.type,url:o.url,subpath:o.subpath,ref:o.ref});let g=await chunkCXH3OTTQ_cjs.S();if(g.markets[l]){delete g.markets[l];let{Filesystem:a}=await import('@easbot/utils');await a.writeJson(utils.Filesystem.join(chunkCXH3OTTQ_cjs.J(),"index.json"),g);}if(chunkS6YNGR7S_cjs.d({event:t.force?"store_remove_force":"store_remove",source:l,sourceType:o.type,removedSkills:n.map(a=>a.skillName).join(",")}),t.json)Q(Z({removed:true,sourceKey:l,sourceType:o.type,isLocal:d,cacheCleared:!d&&t.force===true,skills:n.map(a=>a.skillName)},{sourceType:o.type,cacheCleared:!d&&t.force===true,count:n.length}));else {let a=`\u2713 Removed store source ${l.slice(0,8)}\u2026 (${n.length} skill(s))`;d?a+=x__default.default.dim(" [local: user directory preserved]"):t.force?a+=x__default.default.dim(" (+ cache cleared)"):a+=x__default.default.dim(" (cache preserved; use --force to clear)"),ee([],{emptyTitle:"Store remove",outro:`${x__default.default.green(a)}`});}return 0}function Il(){let e=(t,l,s)=>S(`cli.help.store.${t}`,{fallback:l,vars:s});console.log(`
16
- ${x__default.default.bold(x__default.default.cyan("skills store"))} - ${e("desc","Ops subcommands (store / cache management, store-centric)")}
17
-
18
- ${x__default.default.bold(e("usage_title","Usage:"))}
19
- skills store list [keyword] ${e("list_desc","List store skills (optional name filter)")}
20
- skills store clean ${e("clean_desc","Reset store: delete store dirs + clear index.ts (cache preserved)")}
21
- skills store clean --force ${e("clean_force_desc","Same + clear cache (local source cache protected)")}
22
- skills store update [keyword] ${e("update_desc","Refresh store from source (no agent distribution touched)")}
23
- skills store remove <key> ${e("remove_desc","Remove store source: delete store + index entries")}
24
- skills store remove <key> --force ${e("remove_force_desc","Extra clear cache (remote sources; local source ignored)")}
25
- skills store --help ${e("help_desc","This help")}
26
-
27
- ${x__default.default.bold(e("concepts_title","Concepts:"))}
28
- - store = \`<storeRoot>/<sourceKey>/\` ${e("concept_store","normalized source dir (write once, reuse)")}
29
- - cache = \`<cacheRoot>/<owner>/<repo>/\` ${e("concept_cache","download/materialize cache (remote only; local = user dir)")}
30
- - index = \`<storeRoot>/index.json\` ${e("concept_index","store defs index (key = skillName)")}
31
-
32
- ${x__default.default.bold(e("local_protection_title","Local source protection (hard rule):"))}
33
- - ${e("local_clean","`store clean --force` skips local source cache (user directory never deleted)")}
34
- - ${e("local_remove_force","`store remove --force` for local source is same as default (cache skipped)")}
35
- - ${e("local_remove","`store remove` for local source deletes store + index only, never user directory")}
36
-
37
- ${x__default.default.bold(e("options_title","Options:"))}
38
- -y, --yes ${e("opt_yes","Skip confirmation prompts")}
39
- --force ${e("opt_force","`clean` / `remove`: extra clear cache (local source ignored)")}
40
- --json ${e("opt_json","Output as JSON (machine-readable)")}
41
-
42
- ${x__default.default.bold(e("examples_title","Examples:"))}
43
- ${x__default.default.dim("$")} skills store list
44
- ${x__default.default.dim("$")} skills store list eas-skill-find
45
- ${x__default.default.dim("$")} skills store list --json
46
- ${x__default.default.dim("$")} skills store clean
47
- ${x__default.default.dim("$")} skills store clean --force
48
- ${x__default.default.dim("$")} skills store update
49
- ${x__default.default.dim("$")} skills store update eas-skill-find
50
- ${x__default.default.dim("$")} skills store remove a1b2c3d4e5f67890
51
- ${x__default.default.dim("$")} skills store remove a1b2c3d4e5f67890 --force
52
- ${x__default.default.dim("$")} skills store clean -y --json
53
- `);}var Wt=utils.Log.create({service:"skills-find"}),zo=process.env.SKILLS_API_URL||"https://skills.sh";function Cl(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 Jo=/^[a-z0-9](?:[a-z0-9-]{0,38})$/i;function Vo(e){let t=[],l={},s=[];for(let n=0;n<e.length;n++){let o=e[n];if(!o)continue;if(o==="--json"){l.json=true;continue}if(o==="--local"){l.local=true;continue}if(o==="--path"&&n+1<e.length){l.path=e[n+1],n++;continue}if(o.startsWith("--path=")){l.path=o.slice(7);continue}let r;if(o==="--owner"){let g=e[n+1];if(!g||g.startsWith("-")){s.push("--owner requires a GitHub owner");continue}r=g,n++;}else if(o.startsWith("--owner=")){if(r=o.slice(8),!r){s.push("--owner requires a GitHub owner");continue}}else {t.push(o);continue}let d=r.trim().toLowerCase();if(!Jo.test(d)){s.push("--owner must be a valid GitHub owner");continue}l.owner=d;}return {query:t.join(" "),options:l,errors:s}}async function Pl(e,t){try{let l=new URLSearchParams({q:e,limit:"10"});t&&l.set("owner",t);let s=`${zo}/api/search?${l.toString()}`,n=await fetch(s);return n.ok?(await n.json()).skills.map(r=>({name:chunkRVR3DSD2_cjs.b(r.name),slug:chunkRVR3DSD2_cjs.b(r.id),source:chunkRVR3DSD2_cjs.b(r.source||""),installs:r.installs})).sort((r,d)=>(d.installs||0)-(r.installs||0)):[]}catch(l){return console.warn(`${c}[find] skills.sh search API failed: ${l instanceof Error?l.message:String(l)}${i}`),[]}}async function Yo(e){let t=await chunkCXH3OTTQ_cjs.W(),l=e?.toLowerCase().trim()??"",s=await chunkCXH3OTTQ_cjs.S(),n=[];for(let o of t){if(l&&!o.skillName.toLowerCase().includes(l))continue;let r=s.markets[o.marketId];n.push({skillName:o.skillName,sourceKey:o.marketId,pluginId:o.pluginId,type:r?.type??"unknown",url:r?.url??"",storePath:r?.storePath??""});}return n.sort((o,r)=>o.skillName.localeCompare(r.skillName)),n}async function qo(e,t){let l=[];try{for await(let o of utils.Grep.files({cwd:e,glob:["**/SKILL.md"]}))l.push(o);}catch{return []}let s=t?.toLowerCase().trim()??"",n=[];for(let o of l){let r=Xo(e,o),d=await chunkCXH3OTTQ_cjs.y(r);if(!d)continue;let g=d.name;if(s&&!g.toLowerCase().includes(s))continue;let a=path.dirname(r);n.push({skillName:g,sourceKey:"",pluginId:"",type:"scan",url:"",storePath:a});}return n.sort((o,r)=>o.skillName.localeCompare(r.skillName)),n}function Xo(e,t){let l=process.platform==="win32"?"\\":"/",s=t.replaceAll("/",l);return e.endsWith("/")||e.endsWith("\\")?e+s:e+l+s}var Zo="\x1B[?25l",Qo="\x1B[?25h",ei="\x1B[J",ti=e=>`\x1B[${e}A`,si=e=>`\x1B[${e}G`;async function li(e="",t){let l=[],s=0,n=e,o=false,r=null,d=0;process.stdin.isTTY&&process.stdin.setRawMode(true),Ct__namespace.emitKeypressEvents(process.stdin),process.stdin.resume(),process.stdout.write(Zo);function g(){d>0&&process.stdout.write(ti(d)+si(1)),process.stdout.write(ei);let k=[],h=`${G}_${i}`;if(k.push(`${F}Search skills:${i} ${n}${h}`),k.push(""),!n||n.length<2)k.push(`${c}Start typing to search (min 2 chars)${i}`);else if(l.length===0&&o)k.push(`${c}Searching...${i}`);else if(l.length===0)k.push(`${c}No skills found${i}`);else {let A=l.slice(0,8);for(let $=0;$<A.length;$++){let p=A[$],u=$===s,m=u?`${G}>${i}`:" ",w=u?`${G}${p.name}${i}`:`${F}${p.name}${i}`,T=p.source?` ${c}${p.source}${i}`:"",P=Cl(p.installs),L=P?` ${Ie}${P}${i}`:"",f=o&&$===0?` ${c}...${i}`:"";k.push(` ${m} ${w}${T}${L}${f}`);}}k.push(""),k.push(`${c}up/down navigate | enter select | esc cancel${i}`);for(let C of k)process.stdout.write(C+`
54
- `);d=k.length;}function a(k){if(r&&(clearTimeout(r),r=null),o=false,!k||k.length<2){l=[],s=0,g();return}o=true,g();let h=Math.max(150,350-k.length*50);r=setTimeout(async()=>{try{l=await Pl(k,t),s=0;}catch{l=[];}finally{o=false,r=null,g();}},h);}return e&&a(e),g(),new Promise(k=>{function h(){process.stdin.removeListener("keypress",C),process.stdin.isTTY&&process.stdin.setRawMode(false),process.stdout.write(Qo),process.stdin.pause();}function C(A,$){if($){if($.name==="escape"||$.ctrl&&$.name==="c"){h(),k(null);return}if($.name==="return"){h(),k(l[s]||null);return}if($.name==="up"){s=Math.max(0,s-1),g();return}if($.name==="down"){s=Math.min(Math.max(0,l.length-1),s+1),g();return}if($.name==="backspace"){n.length>0&&(n=n.slice(0,-1),a(n));return}if($.sequence&&!$.ctrl&&!$.meta&&$.sequence.length===1){let p=$.sequence;p>=" "&&p<="~"&&(n+=p,a(n));}}}process.stdin.on("keypress",C);})}function ni(e){let t=e.lastIndexOf("@"),s=(t>0?e.slice(0,t):e).match(/^([^/]+)\/([^/]+)$/);return s?{owner:s[1],repo:s[2]}:null}async function oi(e,t){return await chunkCXH3OTTQ_cjs.c(e,t)===false}async function ii(e,t,l={}){let s=typeof l.path=="string"&&l.path.length>0,n=s?l.path:chunkCXH3OTTQ_cjs.J(),o,r;if(s?(o=await qo(n,e||void 0),r="scan"):(o=await Yo(e||void 0),r="index"),chunkS6YNGR7S_cjs.d({event:"find",query:e,resultCount:String(o.length),mode:"local"}),t)return Q(Z(o,{count:o.length,query:e||null,mode:r,rootDir:s?n:null})),0;if(o.length===0){let $=e?` matching "${e}"`:"",p=s?` under "${n}"`:" in store";return ee([`${c}No skills found${$}${p}.${i}`],{emptyTitle:`Local skills${e?` matching "${e}"`:""}`}),0}let d=r==="scan"?` (scanned ${n})`:"",g=[];if(g.push(""),r==="scan"){let $=[...o].sort((u,m)=>u.skillName.localeCompare(m.skillName)),p={};for(let u of $){let m=p[u.skillName]??[];m.push(u),p[u.skillName]=m;}for(let u of Object.keys(p).sort()){let m=p[u];g.push(`${Ie}${u}${i}`);for(let w of m)g.push(` ${c}\u2514${i} ${w.storePath}`);}return g.push(""),ee(g,{title:`Local skills${e?` matching "${e}"`:""}${d} (${o.length})`,outro:"Run `skills add <source>` to install a discovered skill."}),0}let a=await chunkCXH3OTTQ_cjs.S(),k=new Map(Object.values(a.markets).map($=>[$.id,$])),h=new Map;for(let $ of o){h.has($.sourceKey)||h.set($.sourceKey,new Map);let p=h.get($.sourceKey);p.has($.pluginId)||p.set($.pluginId,[]),p.get($.pluginId).push($);}let C=Array.from(new Set(o.map($=>$.sourceKey))),A=0;for(let $ of C){let p=k.get($),u=$.slice(0,8),m=p?.storePath??"",w=p?.type??"unknown",T=p?.url??"(local)";g.push(`${G}${u}${i} ${c}(${w})${i} ${T} ${c}store=${u}${i} ${c}${m}${i}`);let P=h.get($),L=Array.from(P.keys()).sort();for(let f of L){let y=P.get(f),I=f.includes(":")&&f.split(":").slice(1).join(":")||f;g.push(` ${c}\u2514${i} ${c}plugin:${i} ${Ie}${I}${i} ${c}(${y.length} skill${y.length>1?"s":""})${i}`);let O=[...y].sort((E,N)=>E.skillName.localeCompare(N.skillName));for(let E of O)g.push(` ${E.skillName}`),A++;}g.push("");}return ee(g,{title:`Local skills${e?` matching "${e}"`:""}${d} (${o.length})`,outro:`${c}Total: ${A} skill(s). Use \`skills store clean [--force]\` to reset store, \`skills store update [keyword]\` to refresh from source.${i}`}),0}async function Rl(e){let{query:t,options:l,errors:s}=Vo(e),n=l.owner,o=!process.stdin.isTTY;Wt.debug("runFind enter",{args:e,query:t,owner:n,errors:s,isNonInteractive:o,stdinTTY:process.stdin.isTTY});let r=`${c}Tip: if running in a coding agent, follow these steps:${i}
55
- ${c} 1) easbot skills find [query] [--owner <owner>]${i}
56
- ${c} 2) easbot skills add <owner/repo@skill>${i}`;if(s.length>0){for(let $ of s)console.error($);return console.error("Usage: easbot skills find <query> [--owner <owner>]"),1}if(l.local)return ii(t,l.json??false,l);if(t){Wt.debug("runFind enter query branch",{query:t,owner:n,json:l.json});let $=await Pl(t,n);if(Wt.debug("runFind searchSkillsAPI returned",{count:$.length}),chunkS6YNGR7S_cjs.d({event:"find",query:t,resultCount:String($.length)}),l.json)return Q(Z($.map(u=>({name:u.name,slug:u.slug,source:u.source,installs:u.installs,url:`https://skills.sh/${u.slug}`})),{count:$.length,query:t,owner:n??null,truncated:$.length>6})),0;if($.length===0){let u=n?` from owner "${n}"`:"";return ee([`${c}No skills found for "${t}"${u}${i}`],{emptyTitle:`Search results for "${t}"`}),0}let p=[];p.push(`${c}Install with${i} ${F}easbot skills add <owner/repo@skill>${i}`),p.push("");for(let u of $.slice(0,6)){let m=u.source||u.slug,w=Cl(u.installs);p.push(`${F}${m}@${u.name}${i}${w?` ${Ie}${w}${i}`:""}`),p.push(`${c}\u2514 https://skills.sh/${u.slug}${i}`),p.push("");}return ee(p,{title:`Search results for "${t}" (${$.length})`,outro:"Run `easbot skills add <owner/repo@skill>` to install one."}),0}if(o||await Rt())return console.log(r),console.log(),console.log(`${c}Usage: easbot skills find <query> [--owner <owner>]${i}`),0;let d=await li("",n);if(chunkS6YNGR7S_cjs.d({event:"find",query:"",resultCount:d?"1":"0",interactive:"1"}),!d)return console.log(`${c}Search cancelled${i}`),console.log(),0;let g=d.source||d.slug,a=d.name;console.log(),console.log(`${F}Installing ${G}${a}${i} from ${c}${g}${i}...`),console.log();let{source:k,options:h}=Mt([g,"--skill",a]),C=0;try{await mt(k,h);}catch($){C=1,Wt.error("runAdd failed during find\u2192install",{err:$});}console.log();let A=ni(g);return A&&await oi(A.owner,A.repo)?console.log(`${c}View the skill at${i} ${F}https://skills.sh/${d.slug}${i}`):console.log(`${c}Discover more skills at${i} ${F}https://skills.sh${i}`),console.log(),C}function hs(e,t){let l=os.homedir();return e.startsWith(l)?e.replace(l,"~"):e.startsWith(t)?"."+e.slice(t.length):e}function ks(e,t=5){if(e.length<=t)return e.join(", ");let l=e.slice(0,t),s=e.length-t;return `${l.join(", ")} +${s} more`}function ai(e){let t={};for(let l=0;l<e.length;l++){let s=e[l];if(s==="-g"||s==="--global")t.global=true;else if(s==="-p"||s==="--project")t.project=true;else if(s==="--json")t.json=true;else if(s==="--all")t.all=true;else if(s==="-y"||s==="--yes")t.yes=true;else if(s==="-a"||s==="--agent")for(t.agent=t.agent||[];l+1<e.length&&!e[l+1].startsWith("-");)t.agent.push(e[++l]);}return t}function ci(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":(e.all===true,"both")}async function Nl(e,t={}){let l=ai(e),s=t.cwd??process.cwd();l.all===true&&(!l.agent||l.agent.length===0)&&(l.agent=["*"]);let n=ci(l),o;if(l.agent&&l.agent.length>0){let m=chunkISMGLHYS_cjs.p(l.agent);if(m.length>0){let w=Object.keys(chunkISMGLHYS_cjs.b);console.log(`${ot}Invalid agents: ${m.join(", ")}${i}`),console.log(`${c}Valid agents: ${w.join(", ")}${i}`),process.exit(1);}o=chunkISMGLHYS_cjs.q(l.agent);}let r=await chunk5BL3KG26_cjs.s({scope:n,agentFilter:o,cwd:s}),d=l.json?await chunkCXH3OTTQ_cjs.W():[],g=l.json?await chunkCXH3OTTQ_cjs.S():{markets:{}};if(l.json){let m=new Map;for(let P of d)m.has(P.skillName)||m.set(P.skillName,P);let w=new Map(Object.values(g.markets).map(P=>[P.id,P])),T=r.map(P=>{let L=m.get(P.name),f=L?w.get(L.marketId):void 0,y=f?.storePath&&L?`${f.storePath}/${L.entry.skillPath}`:void 0;return {name:P.name,path:y??P.canonicalPath,canonicalPath:P.canonicalPath,scope:P.scope,agents:P.agents.map(I=>chunkISMGLHYS_cjs.b[I].displayName),...L&&{marketId:L.marketId,pluginId:L.pluginId,sourceKey:L.marketId},...L?.entry.computedHash&&{computedHash:L.entry.computedHash},...f?.addedAt&&{addedAt:f.addedAt},...f?.storePath&&{storePath:f.storePath},...f?.localPath&&{sourcePath:f.localPath},...L?.entry.skillPath&&{skillPath:L.entry.skillPath},...f?.type&&{sourceType:f.type},...f?.url&&{sourceUrl:f.url}}});Q(Z(T,{count:T.length,scope:n,agentFilter:o?[...o]:null}));return}let a=await chunkSXUY2J75_cjs.l(),k=n==="both"?"All":n==="global"?"Global":"Project";if(r.length===0){if(l.json){Q(Z([],{count:0,scope:n,agentFilter:o?[...o]:null}));return}ee([`${c}No skills found.${i}`],{emptyTitle:`${k} Skills`,outro:`${`${ot}No skills found${i}`} ${c}(run \`easbot skills add <source>\` to install)${i}`});return}let C=(m,w)=>{let T=m.name.localeCompare(w.name);return T!==0?T:m.canonicalPath.localeCompare(w.canonicalPath)},A=[...r].sort(C),$={};for(let m of A){let w=$[m.name]??[];w.push(m),$[m.name]=w;}let p=Object.keys($).sort(),u=[];u.push("");for(let m of p){let w=$[m],T=a[m],P=T?.pluginId?.includes(":")?T.pluginId.split(":",2)[1]:void 0,L=P?` ${c}(${P})${i}`:"",f=w.length>1?` ${c}(${w.length} paths)${i}`:"";if(w.length===1){let y=w[0],I=hs(y.canonicalPath,s),O=y.agents.map(N=>chunkISMGLHYS_cjs.b[N].displayName),E=y.agents.length>0?ks(O):`${ot}not linked${i}`;u.push(`${Ie}${chunkRVR3DSD2_cjs.b(y.name)}${i}${L} ${c}${I}${i} ${c}Agents:${i} ${E}`);}else {u.push(`${Ie}${chunkRVR3DSD2_cjs.b(m)}${i}${L}${f}`);for(let y of w){let I=hs(y.canonicalPath,s),O=y.agents.map(N=>chunkISMGLHYS_cjs.b[N].displayName),E=y.agents.length>0?ks(O):`${ot}not linked${i}`;u.push(` ${c}\u2514${i} ${I} ${c}Agents:${i} ${E}`);}}u.push("");}ee(u,{title:`${k} Skills (${A.length})`,outro:"Run `easbot skills find <query>` to discover new skills."});}async function Dl(e,t){let l=await nt(),s=t.yes||l.isAgent;if(l.isAgent&&v__namespace.log.info(Pt(l.agent.name)+" Agent detected \u2014 removing non-interactively"),t.global===void 0&&!s&&process.stdin.isTTY&&!l.isAgent){let f=await v__namespace.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)"}]});v__namespace.isCancel(f)&&(v__namespace.cancel("Removal cancelled"),process.exit(0)),t.global=f;}let n=t.global??false,o=process.cwd(),r=t.json===true,d=r?{start:()=>{},stop:()=>{},message:()=>{}}:v__namespace.spinner();r||d.start("Scanning for installed skills...");let{scanInstalledSkillDirs:g}=await import('./scan-57D2H7LP.cjs'),a;if(t.agent&&t.agent.length>0){let f=chunkISMGLHYS_cjs.q(t.agent),y=chunkISMGLHYS_cjs.p(t.agent);y.length>0&&(console.log(`Invalid agents: ${y.join(", ")}`),console.log(`Valid agents: ${Object.keys(chunkISMGLHYS_cjs.b).join(", ")}`),process.exit(1)),a=f;}let k=await g({scope:n?"global":"project",cwd:o,agentFilter:a}),h=new Set;for(let f of k)h.add(f.name);let C=Array.from(h).sort();if(d.stop(`Found ${C.length} unique installed skill(s)`),C.length===0){if(t.json){Q(Z({scope:n?"global":"project",successful:[],failed:[],summary:{total:0,removed:0,failed:0,agents:[]}},{count:0,scope:n?"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 f=chunkCXH3OTTQ_cjs.D(t.skill,C);f.length>0&&(process.stdout.write(`Invalid skills: ${f.join(", ")}
57
- `),process.stdout.write(`Installed skills: ${C.join(", ")||"(none)"}
58
- `),process.exit(1));}let A=[];if(t.all)A=C;else if(e.length>0||t.skill&&t.skill.length>0){let f=[...e];if(t.skill&&t.skill.length>0){let y=chunkCXH3OTTQ_cjs.E(t.skill,C);if(y.wildcard)A=C;else for(let I of y.matched)f.push(I);}if(A.length===0){let y=new Set;A=[];for(let I of f){let O=C.find(E=>E.toLowerCase()===I.toLowerCase());O&&!y.has(O)&&(y.add(O),A.push(O));}}if(A.length===0){console.log(`No matching skills found for: ${f.join(", ")}`);return}}else {let f=C.map(I=>({value:I,label:I})),y=await v__namespace.multiselect({message:`Select skills to remove ${x__default.default.dim("(space to toggle)")}`,options:f,required:true});v__namespace.isCancel(y)&&(v__namespace.cancel("Removal cancelled"),process.exit(0)),A=y;}let $=new Map;for(let f of k){let y=$.get(f.name);y||(y=new Set,$.set(f.name,y));for(let I of f.agents)y.add(I);}let p=new Set;for(let f of A){let y=$.get(f);if(y)for(let I of y)p.add(I);}let u=Array.from(p);if(u.length===0){console.log("No installed agents match the filter for the selected skill(s).");return}if(!t.yes){let f=n?"Global (use --project to switch)":"Project (use --global to switch)",y=u.map(E=>chunkISMGLHYS_cjs.b[E]?.displayName??E),I=E=>E.length<=5?E.join(", "):`${E.slice(0,5).join(", ")} +${E.length-5} more`;console.log(),v__namespace.log.warn(x__default.default.yellow(`About to remove ${A.length} skill(s) from ${u.length} agent(s):`)),console.log(),console.log(` ${x__default.default.dim("Scope:")} ${f}`),console.log(` ${x__default.default.dim("Agents ("+u.length+"):")}`),console.log(` ${x__default.default.red("\u2022")} ${I(y)}`),console.log(` ${x__default.default.dim("Skills ("+A.length+"):")}`);for(let E of A)console.log(` ${x__default.default.red("\u2022")} ${E}`);console.log(),console.log(x__default.default.dim(" Each skill will be uninstalled from every targeted agent.")),console.log();let O=await v__namespace.confirm({message:"Continue? (y/N)"});(v__namespace.isCancel(O)||!O)&&(v__namespace.cancel("Removal cancelled"),process.exit(0));}d.start("Removing skills...");let m=[];for(let f of A)try{let y=chunk5BL3KG26_cjs.o(f,{global:n,cwd:o});for(let q of u){let H=chunkISMGLHYS_cjs.b[q],ce=chunk5BL3KG26_cjs.m(f,q,{global:n,cwd:o}),be=new Set([ce]),ke=chunk5BL3KG26_cjs.d(f);if(n&&H.globalSkillsDir)be.add(path.join(H.globalSkillsDir,ke));else if(be.add(path.join(o,H.skillsDir,ke)),q==="eve")for(let Se of chunkISMGLHYS_cjs.f(o))be.add(path.join(chunk5BL3KG26_cjs.f(Se,o),ke));for(let Se of be)if(Se!==y)try{await promises.lstat(Se).catch(()=>null)&&await promises.rm(Se,{recursive:!0,force:!0});}catch(Ee){v__namespace.log.warn(`Could not remove skill from ${H.displayName}: ${Ee instanceof Error?Ee.message:String(Ee)}`);}}let O=(await chunkISMGLHYS_cjs.c()).filter(q=>!u.includes(q)),E=!1;for(let q of O){let H=chunk5BL3KG26_cjs.m(f,q,{global:n,cwd:o});if(await promises.lstat(H).catch(()=>null)){E=!0;break}}E||await promises.rm(y,{recursive:!0,force:!0});let N=n?await chunkSXUY2J75_cjs.k(f):null,U=await pi(f),Y=U?(await chunkCXH3OTTQ_cjs.S()).markets[U.marketId]:void 0,J=Y?.url??N?.source??"local",oe=Y?.type??N?.sourceType??"local";n?await chunkSXUY2J75_cjs.j(f):await chunkCXH3OTTQ_cjs.w(f,o),m.push({skill:f,success:!0,source:J,sourceType:oe,...U?.marketId&&{sourceKey:U.marketId},...Y?.storePath&&{storePath:Y.storePath}});}catch(y){m.push({skill:f,success:false,error:y instanceof Error?y.message:String(y)});}d.stop("Removal process complete");let w=m.filter(f=>f.success),T=m.filter(f=>!f.success);if(w.length>0){let f=new Map;for(let y of w){let I=y.source||"local",O=f.get(I)||{skills:[]};O.skills.push(y.skill),O.sourceType=y.sourceType,f.set(I,O);}for(let[y,I]of f)chunkS6YNGR7S_cjs.d({event:"remove",source:y,skills:I.skills.join(","),agents:u.join(","),...n&&{global:"1"},sourceType:I.sourceType});}let P=n?"Global Skills":"Project Skills";if(t.json){Q(Z({scope:n?"global":"project",successful:w.map(f=>({skill:f.skill,source:f.source,sourceType:f.sourceType,...f.sourceKey&&{sourceKey:f.sourceKey},...f.storePath&&{storePath:f.storePath}})),failed:T.map(f=>({skill:f.skill,error:f.error})),summary:{total:m.length,removed:w.length,failed:T.length,agents:u}},{count:m.length,scope:n?"global":"project",removed:w.length,failed:T.length,agents:u.length}));return}let L=[];L.push(` ${x__default.default.dim(x__default.default.bold(P))}`);for(let f of w)L.push(` ${x__default.default.green("\u2713")} ${f.skill}`);if(w.length>0&&(L.push(""),L.push(`${x__default.default.green("\u2713")} Successfully removed ${w.length} skill(s)`)),T.length>0){L.push(""),L.push(`${x__default.default.red("\u2717")} Failed to remove ${T.length} skill(s)`);for(let f of T)L.push(` ${x__default.default.red("\u2717")} ${f.skill}: ${f.error}`);}ee(L,{title:`${P} Removal${w.length>0?` (${w.length} removed)`:""}`,outro:x__default.default.green("Done!")});}async function pi(e){return (await chunkCXH3OTTQ_cjs.X(e))[0]}function Ul(e){let t={},l=[];for(let s=0;s<e.length;s++){let n=e[s];if(n==="-g"||n==="--global")t.global=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"){t.agent=t.agent||[],s++;let o=e[s];for(;s<e.length&&o&&!o.startsWith("-");)t.agent.push(o),s++,o=e[s];s--;}else if(n==="-s"||n==="--skill"){t.skill=t.skill||[],s++;let o=e[s];for(;s<e.length&&o&&!o.startsWith("-");)t.skill.push(o),s++,o=e[s];s--;}else n&&!n.startsWith("-")&&l.push(n);}return {skills:l,options:t}}function mi(e){let t={};for(let l=0;l<e.length;l++){let s=e[l];if(s==="-g"||s==="--global")t.global=true;else if(s==="-p"||s==="--project")t.project=true;else if(s==="-y"||s==="--yes")t.yes=true;else if(s==="--all")t.all=true;else if(s==="--json")t.json=true;else if(s==="-a"||s==="--agent")for(t.agent=t.agent??[];l+1<e.length&&!e[l+1].startsWith("-");)t.agent.push(e[++l]);}return t}function hi(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":("both")}function ki(e,t,l){let s=chunkISMGLHYS_cjs.b[e];if(t){if(s.globalSkillsDir!==void 0)return s.globalSkillsDir;let n=chunkVRHWDHQV_cjs.a("os").homedir();return utils.Filesystem.join(n,s.skillsDir)}return utils.Filesystem.join(l,s.skillsDir)}async function Fl(e,t={}){let l=t.cwd??process.cwd(),s=mi(e),n=hi(s),o=s.agent??["*"],r=o.includes("*")?null:new Set(o),d=n==="both"?["project","global"]:[n],g=[];for(let p of d){let u=chunkISMGLHYS_cjs.i(p);for(let m of u){if(m==="eve"||r&&!r.has(m))continue;let w=p==="global";try{let T=ki(m,w,l);g.push({agent:m,isGlobal:w,baseDir:T});}catch{}}}let a=[];for(let p of g){let u;try{u=fs$1.readdirSync(p.baseDir);}catch{continue}for(let m of u){if(m.startsWith("."))continue;let w=utils.Filesystem.join(p.baseDir,m),T;try{T=fs$1.lstatSync(w);}catch{continue}if(!T.isSymbolicLink())continue;let P;try{P=fs$1.realpathSync(w);}catch{P="<unreadable>";}P==="<unreadable>"&&a.push({agent:p.agent,isGlobal:p.isGlobal,baseDir:p.baseDir,name:m,target:P});}}if(s.json){Q(Z({scope:n,targets:g.length,dangling:a.map(p=>({agent:p.agent,scope:p.isGlobal?"global":"project",name:p.name,baseDir:p.baseDir,target:p.target}))},{scope:n,targets:g.length,danglingCount:a.length}));return}if(a.length===0){ee([`${F}No dangling symlinks found across ${g.length} baseDir(s).${i}`],{emptyTitle:"Doctor check",outro:`${c}All symlinks are healthy.${i}`});return}let k=[];for(let p of a){let u=p.isGlobal?"global":"project";k.push(` ${F}${p.name}${i} ${c}(${p.agent} \xB7 ${u})${i}`),k.push(` ${c}${p.baseDir}${i}`),k.push(` ${c}\u2192 ${p.target}${i}`);}if(s.yes!==true&&!process.stdin.isTTY){ee(k,{title:`Doctor check: ${a.length} dangling symlink(s) found`,outro:`${c}Skipping cleanup (non-TTY environment; re-run with --yes to clean, or use a TTY).${i}`});return}if(!await(await import('@clack/prompts')).confirm({message:`Unlink these ${a.length} dangling symlink(s)?`,initialValue:true})){ee(k,{title:`Doctor check: ${a.length} dangling symlink(s) found`,outro:`${c}Skipped cleanup.${i}`});return}let A=0,$=0;for(let p of a){let u=utils.Filesystem.join(p.baseDir,p.name);try{fs$1.unlinkSync(u);let m=p.isGlobal?"global":"project";k.push(` ${F}\u2713 unlinked ${p.name}${i} ${c}(${p.agent} \xB7 ${m})${i}`),A++;}catch(m){let w=m instanceof Error?m.message:String(m);k.push(` ${c}\u2717 failed ${p.name}: ${w}${i}`),$++;}}if(s.json){Q(Z({scope:n,targets:g.length,dangling:a.map(p=>({agent:p.agent,scope:p.isGlobal?"global":"project",name:p.name,baseDir:p.baseDir,target:p.target,unlinked:true})),cleanup:{removed:A,failed:$}},{scope:n,targets:g.length,danglingCount:a.length,removed:A,failed:$}));return}ee(k,{title:`Doctor check: ${A} unlinked, ${$} failed`,outro:`${F}Done!${i}`});}var Ti=new Set(["metadata.json"]),Ii=new Set([".git","__pycache__","__pypackages__"]),bs={"claude-code":{command:"claude",args:[]},codex:{command:"codex",args:[]}},Jl=Object.keys(bs);function Vl(e){let t=[],l={},s=[];for(let n=0;n<e.length;n++){let o=e[n];if(o)if(o==="--help"||o==="-h")l.help=true;else if(o==="--json")l.json=true;else if(o==="--full-depth")l.fullDepth=true;else if(o==="--dangerously-accept-openclaw-risks")l.dangerouslyAcceptOpenclawRisks=true;else if(o==="--skill"||o==="-s"){let r=e[n+1];!r||r.startsWith("-")?s.push(`${o} requires a skill name`):l.skill?(s.push("Only one --skill value can be provided"),n++):(l.skill=r,n++);}else if(o==="--agent"||o==="-a"){l.agent=l.agent||[],n++;let r=e[n],d=l.agent.length;for(;n<e.length&&r&&!r.startsWith("-");)l.agent.push(r),n++,r=e[n];l.agent.length===d&&s.push(`${o} requires an agent name`),n--;}else o.startsWith("-")?s.push(`Unknown option: ${o}`):t.push(o);}return s.push(...Ni(l.agent)),{source:t,options:l,errors:s}}function ji(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>
59
- ${e.skillMd}
60
- </SKILL.md>`];return e.hasSupportingFiles&&e.supportDir&&t.push(`Supporting files for this skill were downloaded to:
61
- ${e.supportDir}
62
-
63
- When the SKILL.md references relative paths, read them from that directory.`),t.join(`
64
-
65
- `)+`
66
- `}async function Li(e){let t=await promises.mkdtemp(path.join(os.tmpdir(),"skills-use-")),l=path.join(t,chunk5BL3KG26_cjs.d(e.directoryName||e.name));if(!Ss(t,l))throw new Error("Invalid skill name: potential path traversal detected");await promises.mkdir(l,{recursive:true}),e.kind==="blob"?await Oi(l,e.files):e.kind==="well-known"?await Ei(l,e.files):await en(e.path,l);let s=e.rawContent??await promises.readFile(path.join(l,"SKILL.md"),"utf-8"),n=await tn(l,l);return {tempRoot:t,skillDir:l,skillMd:s,hasSupportingFiles:n}}async function Yl(e,t={},l=[]){let s=null;try{if(t.help){console.log(Hl());return}l.length>0&&Oe(l.join(`
67
- `)),e.length===0&&Oe(`Missing required argument: source
68
-
69
- ${Hl()}`),e.length>1&&Oe(`Expected one source, received ${e.length}: ${e.join(", ")}`);let n=t.agent?.[0];n&&!bs[n]&&Oe(Zl(n));let o=e[0],r=chunkCXH3OTTQ_cjs.e(o);chunkCXH3OTTQ_cjs.a(r)?.split("/")[0]?.toLowerCase()==="openclaw"&&!t.dangerouslyAcceptOpenclawRisks&&Oe(["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(`
70
- `));let a=t.skill,k=!!(a||t.fullDepth||r.subpath),h;if(r.type==="well-known"){let $=await chunkCXH3OTTQ_cjs.n.fetchAllSkills(r.url);h=Ri($,a,o);}else {let $,p=null;if(r.type==="local")fs$1.existsSync(r.localPath)||Oe(`Local path does not exist: ${r.localPath}`),$=await chunkCXH3OTTQ_cjs.A(r.localPath,r.subpath,{includeInternal:k,fullDepth:t.fullDepth});else if(r.type==="github"&&!t.fullDepth){let m=chunkCXH3OTTQ_cjs.a(r),w=m?.split("/")[0]?.toLowerCase();m&&w&&chunkRVR3DSD2_cjs.d.includes(w)&&(p=await chunkRVR3DSD2_cjs.l(m,{subpath:r.subpath,ref:r.ref,getToken:chunkSXUY2J75_cjs.g,includeInternal:k})),p?$=p.skills:(s=await chunkCXH3OTTQ_cjs.k(r.url,r.ref),$=await chunkCXH3OTTQ_cjs.A(s,r.subpath,{includeInternal:k,fullDepth:t.fullDepth}));}else s=await chunkCXH3OTTQ_cjs.k(r.url,r.ref),$=await chunkCXH3OTTQ_cjs.A(s,r.subpath,{includeInternal:k,fullDepth:t.fullDepth});let u=Pi($,a,o);p&&Di(u)?h={kind:"blob",name:u.name,directoryName:u.name,rawContent:u.rawContent??Ui(u.files),files:u.files}:h={kind:"disk",name:u.name,directoryName:u.name,rawContent:u.rawContent,path:u.path};}let C=await Li(h);await Wl(s),s=null;let A=ji({skillMd:C.skillMd,supportDir:C.skillDir,hasSupportingFiles:C.hasSupportingFiles});if(t.json&&!n){Q(Z({skill:h.name,source:e[0],agent:n??null,tempRoot:C.tempRoot,skillDir:C.skillDir,prompt:A},{kind:h.kind}));return}if(n){let $=await _i(n,A);$!==0&&process.exit($);return}process.stdout.write(A);}catch(n){await Wl(s),n instanceof chunkCXH3OTTQ_cjs.g&&Oe(n.message),n instanceof Ae&&Oe(n.message),Oe(n instanceof Error?n.message:"Unknown error");}}async function _i(e,t,l=Ci){let s=bs[e];if(!s)throw new Ae(Zl(e));return new Promise((n,o)=>{let r=l(s.command,[...s.args,t],{stdio:"inherit"}),d=false;r.on("error",g=>{if(!d){if(d=true,g.code==="ENOENT"){o(new Ae(`Could not launch ${chunkISMGLHYS_cjs.b[e].displayName}: command not found: ${s.command}`));return}o(g);}}),r.on("close",g=>{d||(d=true,n(g??1));});})}function Ci(e,t){return child_process.spawn(e,t,{stdio:"inherit"})}function Hl(){return `Usage: skills use <source>[@<skill>] [options]
71
-
72
- Generate a prompt for using one skill without installing it.
73
-
74
- Options:
75
- -s, --skill <skill> Select the skill to use
76
- -a, --agent <agent> Start one supported agent interactively (${Jl.join(", ")})
77
- --full-depth Search nested directories like skills add --full-depth
78
- --dangerously-accept-openclaw-risks
79
- Allow unverified OpenClaw community skills
80
- -h, --help Show this help message
81
-
82
- Examples:
83
- skills use houjallen/agent-skills@web-design-guidelines | claude
84
- skills use houjallen/agent-skills --skill web-design-guidelines --agent claude-code
85
- skills use houjallen/agent-skills@web-design-guidelines --agent codex`}function Pi(e,t,l){if(e.length===0)throw new Ae("No valid skills found. Skills require a SKILL.md with name and description.");if(!t){if(e.length===1)return e[0];throw new Ae(ql(l,e.map(chunkCXH3OTTQ_cjs.B)))}let s=chunkCXH3OTTQ_cjs.C(e,[t]);if(s.length===0)throw new Ae(Xl(t,e.map(chunkCXH3OTTQ_cjs.B)));if(s.length>1)throw new Ae(`Skill selector "${t}" matched multiple skills.`);return s[0]}function Ri(e,t,l){if(e.length===0)throw new Ae("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 s;if(t){if(s=e.filter(o=>o.installName.toLowerCase()===t.toLowerCase()||o.name.toLowerCase()===t.toLowerCase()),s.length===0)throw new Ae(Xl(t,e.map(o=>o.installName)));if(s.length>1)throw new Ae(`Skill selector "${t}" matched multiple skills.`)}else {if(e.length!==1)throw new Ae(ql(l,e.map(o=>o.installName)));s=e;}let n=s[0];return {kind:"well-known",name:n.name,directoryName:n.installName,rawContent:n.content,files:n.files}}function ql(e,t){return ["This source contains multiple skills. Specify exactly one skill:",...t.map(l=>` - ${l}`),"",`Examples:
86
- skills use ${e}@${t[0]??"<skill>"}
87
- skills use ${e} --skill ${t[0]??"<skill>"}`].join(`
88
- `)}function Xl(e,t){return [`No matching skill found for: ${e}`,"Available skills:",...t.map(l=>` - ${l}`)].join(`
89
- `)}function Ni(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 l=chunkISMGLHYS_cjs.p(e);if(l.length>0){let s=Object.keys(chunkISMGLHYS_cjs.b);t.push(`Invalid agents: ${l.join(", ")}
90
- Valid agents: ${s.join(", ")}`);}return t}function Zl(e){return [`Running ${chunkISMGLHYS_cjs.b[e].displayName} is not supported yet.`,`Supported agents for skills use --agent: ${Jl.join(", ")}`].join(`
91
- `)}async function Oi(e,t){for(let l of t)await Ql(e,l.path,l.contents);}async function Ei(e,t){for(let[l,s]of t)await Ql(e,l,s);}async function Ql(e,t,l){let s=path.join(e,t);Ss(e,s)&&(await promises.mkdir(path.dirname(s),{recursive:true}),typeof l=="string"?await promises.writeFile(s,l,"utf-8"):await promises.writeFile(s,l));}async function en(e,t){await promises.mkdir(t,{recursive:true});let l=await promises.readdir(e,{withFileTypes:true});await Promise.all(l.filter(s=>!Fi(s.name,s.isDirectory())).map(async s=>{let n=path.join(e,s.name),o=path.join(t,s.name);if(Ss(t,o)){if(s.isDirectory()){await en(n,o);return}try{await promises.cp(n,o,{dereference:!0,recursive:!0});}catch(r){if(r instanceof Error&&"code"in r&&r.code==="ENOENT"&&s.isSymbolicLink()){console.error(`Skipping broken symlink: ${n}`);return}throw r}}}));}async function tn(e,t){let l=await promises.readdir(t,{withFileTypes:true});for(let s of l){let n=path.join(t,s.name),o=path.relative(e,n).split(path.sep).join("/");if(s.isDirectory()){if(await tn(e,n))return true}else if(o.toLowerCase()!=="skill.md")return true}return false}function Di(e){return Array.isArray(e.files)}function Ui(e){let l=e.find(s=>s.path.toLowerCase()==="skill.md")?.contents;return l===void 0?"":typeof l=="string"?l:l.toString("utf-8")}function Fi(e,t){return Ti.has(e)||t&&Ii.has(e)}function Ss(e,t){let l=path.normalize(path.resolve(e)),s=path.normalize(path.resolve(t));return s.startsWith(l+path.sep)||s===l}async function Wl(e){e&&await chunkCXH3OTTQ_cjs.l(e).catch(()=>{});}function Oe(e){console.error(e),process.exit(1);}var Ae=class extends Error{};var Ki={"zh-CN":utils.loadTextFile("./template/skill-template-zh-CN.txt",chunkVRHWDHQV_cjs.c),"en-US":utils.loadTextFile("./template/skill-template-en-US.txt",chunkVRHWDHQV_cjs.c)};function Gi(e){return e.split(/[-_\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Hi(e){return Ki[e]()}var Wi=/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;function ln(e,t){let l=utils.formatLocalISO(new Date,false).slice(0,10),s={skill_name:t,skill_title:Gi(t),version:"1.0.0",date:l};return Hi(e).replace(Wi,(o,r)=>Object.hasOwn(s,r)?s[r]:o)}function qi(e){return e&&bl(e),e??"0.0.0"}function ct(e){return utils.resolveLocaleLang(e?.locale)}function Xi(e){let t=ct(e);console.log(),console.log(`${c}${S("cli.banner.tagline",{locale:t,fallback:"easbot-skills \u2014 agent skills ecosystem"})}${i}`),console.log(),console.log(` ${c}$${i} ${F}easbot-skills add ${c}<package>${i} ${c}${S("cli.banner.cmd.add",{locale:t,vars:{cmd:"",dim:"",reset:""},fallback:"Add a new skill"})}${i}`),console.log(` ${c}$${i} ${F}easbot-skills use ${c}<package>@<skill>${i} ${c}${S("cli.banner.cmd.use",{locale:t,vars:{cmd:"",dim:"",reset:""},fallback:"Use a skill without installing"})}${i}`),console.log(` ${c}$${i} ${F}easbot-skills remove${i} ${c}${S("cli.example.remove_interactive",{locale:t,fallback:"Remove installed skills"})}${i}`),console.log(` ${c}$${i} ${F}easbot-skills list${i} ${c}${S("cli.example.list_project",{locale:t,fallback:"List installed skills"})}${i}`),console.log(` ${c}$${i} ${F}easbot-skills find ${c}[query]${i} ${c}${S("cli.example.find_interactive",{locale:t,fallback:"Search for skills"})}${i}`),console.log(),console.log(` ${c}$${i} ${F}easbot-skills update${i} ${c}${S("cli.example.update_global",{locale:t,fallback:"Update installed skills"})}${i}`),console.log(),console.log(` ${c}$${i} ${F}easbot-skills doctor${i} ${c}${S("cli.commands.doctor",{locale:t,fallback:"Check + cleanup broken links & more"})}${i}`),console.log(),console.log(` ${c}$${i} ${F}easbot-skills init ${c}[name]${i} ${c}${S("cli.example.init",{locale:t,fallback:"Create a new skill"})}${i}`),console.log(` ${c}$${i} ${F}easbot-skills store ${c}<sub>${i} ${c}${S("cli.example.store",{locale:t,fallback:"Manage store / cache sources"})}${i}`),console.log(),console.log(`${c}${S("cli.banner.try_hint",{locale:t,fallback:"try:"})}${i} easbot-skills add houjallen/agent-skills`),console.log(),console.log(`${c}${S("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}`),console.log();}function Kp(e){let t=ct(e),l=(s,n)=>c+S(s,{locale:t,fallback:n})+i;console.log(`
92
- ${G}${S("cli.help.usage",{locale:t,fallback:"Usage: skills <command> [options]"})}${i}
93
-
94
- ${G}${S("cli.help.section.manage",{locale:t,fallback:"Manage Skills"})}${i}:
95
- add <source> Add a skill package (alias: a).
96
- <source> accepts 4 forms:
97
- <owner>/<repo> e.g. houjallen/agent-skills
98
- GitHub URL e.g. https://github.com/houjallen/agent-skills
99
- local path e.g. ./skills/foo or /abs/path/to/skills
100
- .well-known URL served from /.well-known/agent-skills/index.json
101
- use <package>@<skill>
102
- Generate a prompt for using one skill without installing it
103
- remove [skills] Remove installed skills
104
- list, ls List installed skills
105
- find [query] Search for skills interactively
106
- doctor, dr Check & cleanup broken links (scope: -g/-p, default both)
107
-
108
- ${G}${S("cli.help.section.updates",{locale:t,fallback:"Updates"})}${i}:
109
- update [skills...] Update skills to latest versions (alias: upgrade)
110
-
111
- ${G}${S("cli.help.section.maintenance",{locale:t,fallback:"Maintenance (Operations)"})}${i}:
112
- store <subcommand> Manage store sources (store + cache + index):
113
- list [keyword] List store skills (optional name filter)
114
- clean [--force] Reset store (--force also clears cache)
115
- update [keyword] Refresh store from source
116
- remove <key> [--force] Drop store source (--force also clears cache)
117
-
118
- ${G}${S("cli.help.section.update_options",{locale:t,fallback:"Update Options"})}${i}:
119
- -g, --global ${S("cli.help.update.flag.global",{locale:t,fallback:"Update global skills only"})}
120
- -p, --project ${S("cli.help.update.flag.project",{locale:t,fallback:"Update project skills only"})}
121
- -y, --yes ${S("cli.help.update.flag.yes",{locale:t,fallback:"Skip scope prompt (defaults to both project + global)"})}
122
- --all ${S("cli.help.update.flag.all",{locale:t,fallback:"Shorthand for --skill '*' -y (update all installed skills)"})}
123
- --force ${S("cli.help.update.flag.force",{locale:t,fallback:"Skip SKILL.md hash check; reinstall every selected skill"})}
124
-
125
- ${G}${S("cli.help.section.project",{locale:t,fallback:"Project"})}${i}:
126
- init [name] Initialize a skill (creates <name>/SKILL.md or ./SKILL.md)
127
- store <subcommand> Manage store sources (store + cache + index; --force clears cache)
128
-
129
- ${G}${S("cli.help.section.list_options",{locale:t,fallback:"List Options"})}${i}:
130
- -g, --global ${S("cli.help.list.flag.global",{locale:t,fallback:"List global skills (default: project)"})}
131
- -p, --project ${S("cli.help.list.flag.project",{locale:t,fallback:"List project skills only"})}
132
- -a, --agent <agents> ${S("cli.help.list.flag.agent",{locale:t,fallback:"Filter by specific agents (use '*' for all agents)"})}
133
- --json ${S("cli.help.list.flag.json",{locale:t,fallback:"Output as JSON (machine-readable, no ANSI codes)"})}
134
- --all ${S("cli.help.list.flag.all",{locale:t,fallback:"Shorthand for --agent *"})}
135
-
136
- ${G}${S("cli.help.section.find_options",{locale:t,fallback:"Find Options"})}${i}:
137
- --owner <owner> ${S("cli.help.find.flag.owner",{locale:t,fallback:"Search only repositories from a GitHub owner"})}
138
- --json Output as JSON (machine-readable, no ANSI codes)
139
-
140
- ${G}${S("cli.help.section.add_options",{locale:t,fallback:"Add Options"})}${i}:
141
- -g, --global ${S("cli.help.add.flag.global",{locale:t,fallback:"Install skill globally (user-level) instead of project-level"})}
142
- -a, --agent <agents> ${S("cli.help.add.flag.agent",{locale:t,fallback:"Specify agents to install to (use '*' for all agents)"})}
143
- -s, --skill <skills> ${S("cli.help.add.flag.skill",{locale:t,fallback:"Specify skill names to install (use '*' for all skills)"})}
144
- -l, --list ${S("cli.help.add.flag.list",{locale:t,fallback:"List available skills in the repository without installing"})}
145
- -y, --yes ${S("cli.help.add.flag.yes",{locale:t,fallback:"Skip confirmation prompts"})}
146
- --copy ${S("cli.help.add.flag.copy",{locale:t,fallback:"Copy files instead of symlinking to agent directories"})}
147
- --subagent <names> ${S("cli.help.add.flag.subagent",{locale:t,fallback:"Install to Eve subagents (use 'root' for the root agent)"})}
148
- --all ${S("cli.help.add.flag.all",{locale:t,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
149
- --full-depth ${S("cli.help.add.flag.full_depth",{locale:t,fallback:"Search all subdirectories even when a root SKILL.md exists"})}
150
- --json Output as JSON (machine-readable, no ANSI codes)
151
-
152
- ${G}${S("cli.help.section.update_options",{locale:t,fallback:"Update Options"})}${i}:
153
- -g, --global ${S("cli.help.update.flag.global",{locale:t,fallback:"Update global skills only"})}
154
- -p, --project ${S("cli.help.update.flag.project",{locale:t,fallback:"Update project skills only"})}
155
- -y, --yes ${S("cli.help.update.flag.yes",{locale:t,fallback:"Skip scope prompt (defaults to both project + global)"})}
156
- --all ${S("cli.help.update.flag.all",{locale:t,fallback:"Shorthand for --skill '*' -y (update all installed skills)"})}
157
- --force ${S("cli.help.update.flag.force",{locale:t,fallback:"Skip SKILL.md hash check; reinstall every selected skill"})}
158
- --json Output as JSON (machine-readable, no ANSI codes)
159
-
160
- ${G}${S("cli.help.section.remove_options",{locale:t,fallback:"Remove Options"})}${i}:
161
- -g, --global ${S("cli.help.remove.flag.global",{locale:t,fallback:"Remove from global scope"})}
162
- -a, --agent <agents> ${S("cli.help.remove.flag.agent",{locale:t,fallback:"Remove from specific agents (use '*' for all agents)"})}
163
- -s, --skill <skills> ${S("cli.help.remove.flag.skill",{locale:t,fallback:"Specify skills to remove (use '*' for all skills)"})}
164
- -y, --yes ${S("cli.help.remove.flag.yes",{locale:t,fallback:"Skip confirmation prompts"})}
165
- --all ${S("cli.help.remove.flag.all",{locale:t,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
166
- --json Output as JSON (machine-readable, no ANSI codes)
167
-
168
- ${G}${S("cli.help.section.doctor_options",{locale:t,fallback:"Doctor Options"})}${i}:
169
- -g, --global ${S("cli.help.doctor.flag.global",{locale:t,fallback:"Check global scope only"})}
170
- -p, --project ${S("cli.help.doctor.flag.project",{locale:t,fallback:"Check project scope only"})}
171
- -a, --agent <agents> ${S("cli.help.doctor.flag.agent",{locale:t,fallback:"Check specific agents (use '*' for all)"})}
172
- -y, --yes ${S("cli.help.doctor.flag.yes",{locale:t,fallback:"Skip confirm; remove broken links directly"})}
173
- --all ${S("cli.help.doctor.flag.all",{locale:t,fallback:"Shorthand for --agent *"})}
174
- --json Output as JSON (machine-readable, no ANSI codes)
175
-
176
- ${G}${S("cli.help.section.use_options",{locale:t,fallback:"Use Options"})}${i}:
177
- -s, --skill <skill> ${S("cli.help.use.flag.skill",{locale:t,fallback:"Specify the skill to use"})}
178
- -a, --agent <agent> ${S("cli.help.use.flag.agent",{locale:t,fallback:"Start one supported agent interactively"})}
179
- --full-depth ${S("cli.help.use.flag.full_depth",{locale:t,fallback:"Search all subdirectories even when a root SKILL.md exists"})}
180
- --dangerously-accept-openclaw-risks
181
- ${S("cli.help.use.flag.openclaw_risks",{locale:t,fallback:"Allow unverified OpenClaw community skills"})}
182
- --json Output as JSON (machine-readable, no ANSI codes)
183
-
184
- ${G}${S("cli.help.section.options",{locale:t,fallback:"Options"})}${i}:
185
- --help, -h Show this help message
186
- --version, -v Show version number
187
-
188
- ${G}Examples:${i}
189
- ${c}$${i} easbot-skills add houjallen/agent-skills ${l("cli.example.add","Add a skill package")}
190
- ${c}$${i} easbot-skills use houjallen/agent-skills@houjallen | claude ${l("cli.example.use","Use a skill one-shot")}
191
- ${c}$${i} easbot-skills use houjallen/agent-skills --skill houjallen --agent claude ${l("cli.example.use_with_agent","Specify skill + agent")}
192
- ${c}$${i} easbot-skills add houjallen/agent-skills -g ${l("cli.example.add_global","Install globally")}
193
- ${c}$${i} easbot-skills add houjallen/agent-skills --agent claude-code cursor ${l("cli.example.add_multi_agent","Install to multiple agents")}
194
- ${c}$${i} easbot-skills add houjallen/agent-skills --skill pr-review commit ${l("cli.example.add_multi_skill","Install multiple skills")}
195
- ${c}$${i} easbot-skills remove ${c}# ${l("cli.example.remove_interactive","Interactive remove")}${i}
196
- ${c}$${i} easbot-skills remove web-design ${c}# ${l("cli.example.remove_by_name","Remove by name")}${i}
197
- ${c}$${i} easbot-skills rm --global frontend-design
198
- ${c}$${i} easbot-skills list ${c}# ${l("cli.example.list_project","List project skills")}${i}
199
- ${c}$${i} easbot-skills ls -g ${c}# ${l("cli.example.list_global","List global skills")}${i}
200
- ${c}$${i} easbot-skills ls -a claude-code ${c}# ${l("cli.example.list_filter_agent","Filter by agent")}${i}
201
- ${c}$${i} easbot-skills ls --json ${c}# ${l("cli.example.list_json","JSON output")}${i}
202
- ${c}$${i} easbot-skills find ${c}# ${l("cli.example.find_interactive","Interactive search")}${i}
203
- ${c}$${i} easbot-skills find typescript ${c}# ${l("cli.example.find_keyword","Search by keyword")}${i}
204
- ${c}$${i} easbot-skills find react --owner houjallen ${c}# ${l("cli.example.find_owner","Search within an owner")}${i}
205
- ${c}$${i} easbot-skills update
206
- ${c}$${i} easbot-skills update my-skill ${c}# ${l("cli.example.update_one","Update a single skill")}${i}
207
- ${c}$${i} easbot-skills update -g ${c}# ${l("cli.example.update_global","Update global skills only")}${i}
208
- ${c}$${i} easbot-skills init my-skill ${c}# ${l("cli.example.init","Create a new skill")}${i}
209
- ${c}$${i} easbot-skills store list ${c}# ${l("cli.example.store_list","List store skills")}${i}
210
- ${c}$${i} easbot-skills store clean --force ${c}# ${l("cli.example.store_clean_force","Reset store + clear cache")}${i}
211
- ${c}$${i} easbot-skills doctor ${c}# ${l("cli.example.doctor","Check & cleanup dangling symlinks (interactive)")}${i}
212
- ${c}$${i} easbot-skills doctor -a easbot -y ${c}# ${l("cli.example.doctor_agent_yes","Check one agent + auto-cleanup")}${i}
213
-
214
- ${c}${S("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}
215
- `);}function Zi(e){let t=ct(e);console.log(`
216
- ${G}${S("cli.help.doctor.usage",{locale:t,fallback:"Usage: easbot skills doctor [options]"})}${i}
217
-
218
- ${G}Description:${i}
219
- ${S("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."})}
220
-
221
- ${G}Scope (tri-state, same as list / update):${i}
222
- -g, --global ${S("cli.help.doctor.flag.global",{locale:t,fallback:"Check global scope only"})}
223
- -p, --project ${S("cli.help.doctor.flag.project",{locale:t,fallback:"Check project scope only"})}
224
- ${c}(default: both \u2014 scan project + global)${i}
225
-
226
- ${G}Filter:${i}
227
- -a, --agent <agents> ${S("cli.help.doctor.flag.agent",{locale:t,fallback:"Target agents (repeatable; use * for all)"})}
228
- --all ${S("cli.help.doctor.flag.all",{locale:t,fallback:"Shorthand for --agent *"})}
229
-
230
- ${G}Cleanup:${i}
231
- -y, --yes ${S("cli.help.doctor.flag.yes",{locale:t,fallback:"Skip confirm; unlink dangling symlinks directly"})}
232
- ${c}(TTY: confirm prompt; non-TTY: report only)${i}
233
-
234
- ${G}Examples:${i}
235
- ${c}$${i} easbot-skills doctor ${c}# ${S("cli.example.doctor",{locale:t,fallback:"Interactive check + cleanup"})}${i}
236
- ${c}$${i} easbot-skills doctor -a easbot -y ${c}# ${S("cli.example.doctor_agent_yes",{locale:t,fallback:"Check one agent + auto-cleanup"})}${i}
237
- ${c}$${i} easbot-skills dr -g ${c}# ${S("cli.example.doctor_global",{locale:t,fallback:"Check global scope only"})}${i}
238
- `);}function Qi(e){let t=ct(e);console.log(`
239
- ${G}${S("cli.help.remove.usage",{locale:t,fallback:"Usage: easbot skills remove [skills...] [options]"})}${i}
240
-
241
- ${G}Description:${i}
242
- ${S("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."})}
243
-
244
- ${G}Arguments:${i}
245
- ${S("cli.help.remove.arguments",{locale:t,fallback:"skills Optional skill names to remove (space-separated)"})}
246
-
247
- ${G}Options:${i}
248
- -g, --global ${S("cli.help.remove.flag.global",{locale:t,fallback:"Remove from global scope (~/) instead of project scope"})}
249
- -a, --agent ${S("cli.help.remove.flag.agent",{locale:t,fallback:"Remove from specific agents (use '*' for all agents)"})}
250
- -s, --skill ${S("cli.help.remove.flag.skill",{locale:t,fallback:"Specify skills to remove (use '*' for all skills)"})}
251
- -y, --yes ${S("cli.help.remove.flag.yes",{locale:t,fallback:"Skip confirmation prompts"})}
252
- --all ${S("cli.help.remove.flag.all",{locale:t,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
253
-
254
- ${G}Examples:${i}
255
- ${c}$${i} easbot-skills remove ${c}# ${S("cli.example.remove_interactive",{locale:t,fallback:"Interactive remove"})}${i}
256
- ${c}$${i} easbot-skills remove my-skill ${c}# ${S("cli.example.remove_by_name",{locale:t,fallback:"Remove by name"})}${i}
257
- ${c}$${i} easbot-skills remove skill1 skill2 -y ${c}# ${S("cli.example.remove_all",{locale:t,fallback:"Remove multiple skills"})}${i}
258
- ${c}$${i} easbot-skills remove --global my-skill ${c}# ${S("cli.example.remove_global",{locale:t,fallback:"Remove from global scope"})}${i}
259
- ${c}$${i} easbot-skills rm --agent claude-code my-skill ${c}# ${S("cli.example.remove_by_agent",{locale:t,fallback:"Remove from specific agent"})}${i}
260
- ${c}$${i} easbot-skills remove --all ${c}# ${S("cli.example.remove_all",{locale:t,fallback:"Remove all skills"})}${i}
261
- ${c}$${i} easbot-skills remove --skill '*' -a cursor ${c}# ${S("cli.example.remove_agent_all",{locale:t,fallback:"Remove all skills from one agent"})}${i}
262
-
263
- ${c}${S("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}
264
- `);}function ws(){console.log();}function er(e,t){let l=ct(t),s=t?.cwd??chunkXGUPIAAF_cjs.p()??process.cwd(),n=e[0]||path.basename(s),o=e[0]!==void 0,r=e.includes("--json"),d=o?path.join(s,n):s,g=path.join(d,"SKILL.md"),a=o?`${n}/SKILL.md`:"SKILL.md";if(fs$1.existsSync(g))return r?(process.stdout.write(`${JSON.stringify({ok:false,data:{action:"exists",path:a},meta:{skillName:n,hasName:o}},null,2)}
265
- `),0):(console.log(`${F}${S("cli.init.exists",{locale:l,vars:{path:a},fallback:`Skill already exists at ${a}`})}${i}`),0);o&&fs$1.mkdirSync(d,{recursive:true});let k=ln(l,n);if(fs$1.writeFileSync(g,k),r)return process.stdout.write(`${JSON.stringify({ok:true,data:{action:"created",skillName:n,path:a,absolutePath:g},meta:{hasName:o,locale:l}},null,2)}
266
- `),0;let h=[];return h.push(`${F}${S("cli.init.created",{locale:l,vars:{name:n},fallback:`Initialized skill: ${n}`})}${i}`),h.push(""),h.push(`${c}${S("cli.init.created_label",{locale:l,fallback:"Created"})}${i}:`),h.push(` ${a}`),h.push(""),h.push(`${c}${S("cli.init.next.title",{locale:l,fallback:"Next steps"})}${i}:`),h.push(` 1. ${S("cli.init.next.edit",{locale:l,vars:{path:a},fallback:`Edit ${a} to define your skill instructions`})}`),h.push(` 2. ${S("cli.init.next.frontmatter",{locale:l,fallback:"Update the name and description in the frontmatter"})}`),h.push(""),h.push(`${c}${S("cli.init.publish.title",{locale:l,fallback:"Publishing"})}${i}:`),h.push(` ${c}GitHub:${i} ${S("cli.init.publish.github",{locale:l,vars:{cmd:"easbot skills"},fallback:"Push to a repo, then easbot skills add <owner>/<repo>"})}`),h.push(` ${c}URL:${i} ${S("cli.init.publish.url",{locale:l,vars:{cmd:"easbot skills",path:a},fallback:"Host the file, then easbot skills add https://example.com/"+a})}`),ee(h,{title:`${S("cli.init.created_label",{locale:l,fallback:"Created"})}: ${a}`,outro:`${c}${S("cli.init.browse_hint",{locale:l,vars:{url:"https://skills.sh/"},fallback:"Browse existing skills for inspiration at https://skills.sh/"})}${i}`}),0}async function Gp(e,t){qi(t?.version);let l=t?.inAgent??await Rt();if(e.length===0)return l||Xi(t),{code:0,handled:false};let s=e[0],n=e.slice(1);switch(s){case "find":case "search":case "f":case "s":return l||ws(),console.log(),{code:await Rl(n),handled:true,command:s};case "init":return l||ws(),console.log(),{code:er(n,t),handled:true,command:s};case "a":case "add":{l||ws();let{source:o,options:r}=Mt(n);return await mt(o,r),{code:0,handled:true,command:s}}case "use":{let{source:o,options:r,errors:d}=Vl(n);return await Yl(o,r,d),{code:0,handled:true,command:s}}case "remove":case "rm":case "r":{if(n.includes("--help")||n.includes("-h"))return Qi(t),{code:0,handled:true,command:s};let{skills:o,options:r}=Ul(n);return await Dl(o,r),{code:0,handled:true,command:s}}case "list":case "ls":return await Nl(n,{cwd:t?.cwd}),{code:0,handled:true,command:s};case "doctor":case "dr":return n.includes("--help")||n.includes("-h")?(Zi(t),{code:0,handled:true,command:s}):(await Fl(n,t?.cwd?{cwd:t.cwd}:void 0),{code:0,handled:true,command:s});case "check":case "update":case "upgrade":return await fl(n,{cwd:t?.cwd}),{code:0,handled:true,command:s};case "store":return {code:await jl(n),handled:true,command:s};default:{let o=ct(t);return console.log(S("cli.unknown_command",{locale:o,vars:{command:s??""},fallback:`Unknown command: ${s}`})),console.log(S("cli.help_hint",{locale:o,vars:{cmd:"skills"},fallback:"Run skills --help for usage."})),{code:1,handled:true,command:s}}}}
267
- exports.A=ai;exports.B=Nl;exports.C=Dl;exports.D=Ul;exports.E=Fl;exports.F=Vl;exports.G=ji;exports.H=Li;exports.I=Yl;exports.J=_i;exports.K=Xi;exports.L=Kp;exports.M=Gp;exports.a=ns;exports.b=Zs;exports.c=Qs;exports.d=el;exports.e=is;exports.f=nt;exports.g=Rt;exports.h=Lr;exports.i=nl;exports.j=Yn;exports.k=ua;exports.l=qn;exports.m=ul;exports.n=fl;exports.o=bl;exports.p=mt;exports.q=Mt;exports.r=Ro;exports.s=jl;exports.t=Oo;exports.u=Do;exports.v=Mo;exports.w=Go;exports.x=Vo;exports.y=Pl;exports.z=Rl;