@easbot/skills 0.3.11 → 0.3.13
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.
- package/README.en.md +167 -60
- package/README.md +173 -63
- package/dist/chunks/blob-3PZEQWTP.mjs +1 -0
- package/dist/chunks/blob-ZDEX2HRV.cjs +1 -0
- package/dist/chunks/chunk-4D5RQDWJ.mjs +5 -0
- package/dist/chunks/chunk-5BL3KG26.cjs +5 -0
- package/dist/chunks/chunk-5W7HC7BY.mjs +22 -0
- package/dist/chunks/chunk-CFMOYU7R.mjs +2 -0
- package/dist/chunks/chunk-CXH3OTTQ.cjs +22 -0
- package/dist/chunks/chunk-CY6UI6SJ.cjs +1 -0
- package/dist/chunks/chunk-E7AHWFZN.cjs +2 -0
- package/dist/chunks/chunk-ISMGLHYS.cjs +1 -0
- package/dist/chunks/chunk-K2XGYOXP.mjs +267 -0
- package/dist/chunks/chunk-ML6B4IQL.mjs +1 -0
- package/dist/chunks/chunk-NKIQLESR.mjs +3 -0
- package/dist/chunks/chunk-ROCFLAYZ.mjs +2 -0
- package/dist/chunks/chunk-RVR3DSD2.cjs +2 -0
- package/dist/chunks/chunk-RWZ4LFSN.mjs +1 -0
- package/dist/chunks/chunk-S6YNGR7S.cjs +2 -0
- package/dist/chunks/chunk-SXUY2J75.cjs +3 -0
- package/dist/chunks/chunk-UJWB7QQ6.cjs +267 -0
- package/dist/chunks/chunk-VRHWDHQV.cjs +1 -0
- package/dist/chunks/chunk-WQGSYA5D.mjs +1 -0
- package/dist/chunks/chunk-XGUPIAAF.cjs +1 -0
- package/dist/chunks/chunk-ZBKGF7PA.mjs +1 -0
- package/dist/chunks/chunk-ZYDDQV73.mjs +2 -0
- package/dist/chunks/cli-handler-667TYY4I.cjs +1 -0
- package/dist/chunks/cli-handler-YSDUNKKZ.mjs +1 -0
- package/dist/chunks/installer-REG45DC2.mjs +1 -0
- package/dist/chunks/installer-SOVGUW3M.cjs +1 -0
- package/dist/chunks/interfaces-S47ZGORM.mjs +1 -0
- package/dist/chunks/interfaces-UIS44Q7A.cjs +1 -0
- package/dist/chunks/local-lock-AWD3LLEY.mjs +1 -0
- package/dist/chunks/local-lock-GIZDVF3X.cjs +1 -0
- package/dist/chunks/scan-57D2H7LP.cjs +1 -0
- package/dist/chunks/scan-WAXGJM5N.mjs +1 -0
- package/dist/chunks/skill-lock-DZMA75MY.mjs +1 -0
- package/dist/chunks/skill-lock-XTWQYBRG.cjs +1 -0
- package/dist/chunks/store-F7PGGZIO.cjs +1 -0
- package/dist/chunks/store-IVDLGLET.mjs +1 -0
- package/dist/chunks/telemetry-7T6MUW5A.mjs +1 -0
- package/dist/chunks/telemetry-LCGTSJDM.cjs +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +288 -129
- package/dist/index.d.ts +288 -129
- package/dist/index.mjs +1 -1
- package/package.json +4 -5
- package/dist/chunks/blob-LYSE5I24.mjs +0 -1
- package/dist/chunks/blob-NYUAIVUS.cjs +0 -1
- package/dist/chunks/chunk-4IO7TNWC.mjs +0 -223
- package/dist/chunks/chunk-IWCI7DET.mjs +0 -6
- package/dist/chunks/chunk-KJPMAUXZ.cjs +0 -1
- package/dist/chunks/chunk-L6KE3VIY.mjs +0 -2
- package/dist/chunks/chunk-PGDLW2JN.cjs +0 -2
- package/dist/chunks/chunk-S76WRD5J.cjs +0 -6
- package/dist/chunks/chunk-WQJKBJSM.cjs +0 -223
- package/dist/chunks/chunk-Y2X6FBMZ.mjs +0 -1
- package/dist/chunks/scan-47YPOLJX.mjs +0 -1
- package/dist/chunks/scan-5G765ZEF.cjs +0 -1
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import {b,a,d,c as c$2}from'./chunk-CFMOYU7R.mjs';import {i as i$2,n,p as p$1,l as l$2,k as k$1,j as j$1,g as g$2,c as c$4,d as d$3}from'./chunk-NKIQLESR.mjs';import {a as a$3}from'./chunk-ZBKGF7PA.mjs';import {i as i$1,j,g,l,o as o$1,e as e$1,d as d$1,k,s,m,f as f$1,h as h$1}from'./chunk-4D5RQDWJ.mjs';import {y,e,a as a$1,b as b$2,c as c$1,da as da$1,R,B,E,C,t,L,v as v$1,g as g$1,ga,l as l$1,S as S$1,W,J,N,ja,ia,D,w,X,n as n$1,A,k as k$2,Q as Q$1,M as M$1,Y,O,aa}from'./chunk-5W7HC7BY.mjs';import {f,b as b$1,p,q,c as c$3,o,i as i$3,h}from'./chunk-ML6B4IQL.mjs';import {p as p$2}from'./chunk-RWZ4LFSN.mjs';import {b as b$4,d as d$2,l as l$3,a as a$4}from'./chunk-ROCFLAYZ.mjs';import {b as b$3}from'./chunk-ZYDDQV73.mjs';import {a as a$2}from'./chunk-WQGSYA5D.mjs';import {existsSync,readdirSync,lstatSync,realpathSync,unlinkSync,constants,mkdirSync,writeFileSync}from'fs';import {dirname,join,basename,sep,relative,normalize,resolve}from'path';import*as v from'@clack/prompts';import x from'picocolors';import {tmpdir,homedir}from'os';import {Log,loadTextFile,Filesystem,resolveLocaleLang,Grep,formatLocalISO}from'@easbot/utils';import*as Pt from'readline';import {stripVTControlCharacters}from'util';import {Writable}from'stream';import {lstat,realpath,access,mkdir,rm,mkdtemp,readFile,writeFile,readdir,cp}from'fs/promises';import {createHash}from'crypto';import {fileURLToPath}from'url';import {spawn}from'child_process';var dn=new Writable({write(e,t,l){l();}}),gn=x.green("\u25C6"),fn=x.red("\u25A0"),mn=x.green("\u25C7"),hn=x.green("\u25CF"),kn=x.dim("\u25CB");x.green("\u2713");var $n=x.green("\u2022"),fe=x.dim("\u2502"),st=x.dim("\u2500"),yn=Symbol("cancel");function bn(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 Sn(e,t){let l=stripVTControlCharacters(e),s=Math.max(1,t),n=bn(l);return Math.max(1,Math.ceil(n/s))}function wn(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+Sn(n,l),0)}async function ls(e){let{message:t,items:l,maxVisible:s=8,initialSelected:n=[],required:o=false,lockedSection:r}=e;return new Promise(d=>{let g=Pt.createInterface({input:process.stdin,output:dn,terminal:false});process.stdin.isTTY&&process.stdin.setRawMode(true),Pt.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"?gn:f==="cancel"?fn:mn;if(y.push(`${O} ${x.bold(t)}`),f==="active"){if(r&&r.items.length>0){y.push(`${fe}`);let ne=`${x.bold(r.title)} ${x.dim("\u2500\u2500 always included")}`;y.push(`${fe} ${st}${st} ${ne} ${st.repeat(12)}`);for(let q of r.items)y.push(`${fe} ${$n} ${x.bold(q.label)}`);r.hiddenCount&&r.hiddenCount>0&&y.push(`${fe} ${x.dim(`...and ${r.hiddenCount} more`)}`),y.push(`${fe}`),y.push(`${fe} ${st}${st} ${x.bold("Additional agents")} ${st.repeat(29)}`);}let E=`${fe} ${x.dim("Search:")} ${a}${x.inverse(" ")}`;y.push(E),y.push(`${fe} ${x.dim("\u2191\u2193 move, space select, enter confirm")}`),y.push(`${fe}`);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(`${fe} ${x.dim("No matches found")}`);else {for(let H=0;H<Y.length;H++){let pe=Y[H],Se=N+H,$e=h.has(pe.value),we=Se===k,De=$e?hn:kn,_e=we?x.underline(pe.label):pe.label,qe=pe.hint?x.dim(` (${pe.hint})`):"",Ne=we?x.cyan("\u276F"):" ";y.push(`${fe} ${Ne} ${De} ${_e}${qe}`);}let ne=N,q=I.length-U;if(ne>0||q>0){let H=[];ne>0&&H.push(`\u2191 ${ne} more`),q>0&&H.push(`\u2193 ${q} more`),y.push(`${fe} ${x.dim(H.join(" "))}`);}}y.push(`${fe}`);let J=[];for(let ne of l)h.has(ne.value)&&J.push(ne.label);if(J.length===0)y.push(`${fe} ${x.dim("Selected: (none \u2014 only locked universal)")}`);else {let ne=J.length<=3?J.join(", "):`${J.slice(0,3).join(", ")} +${J.length-3} more`;y.push(`${fe} ${x.green("Selected:")} ${ne}`);}y.push(`${x.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(`${fe} ${x.dim(N)}`);}else f==="cancel"&&y.push(`${fe} ${x.strikethrough(x.dim("Cancelled"))}`);process.stdout.write(y.join(`
|
|
2
|
+
`)+`
|
|
3
|
+
`),C=wn(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(yn);},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 Zs(e){let t=createHash("sha256");try{let l=await readFile(join(e,"SKILL.md"),"utf-8");t.update("SKILL.md"),t.update(l);}catch{t.update("EMPTY");}return t.digest("hex")}async function os(e,t){let l;try{l=await lstat(e);}catch{return "absent"}if(l.isSymbolicLink())try{let d=Filesystem.toUnixPath(await realpath(e)),g=Filesystem.toUnixPath(await realpath(t));return d===g?"symlinked":"orphan"}catch{return "orphan"}let s=join(e,"SKILL.md");try{await access(s);}catch{return "absent"}if(!await y(s))return "divergent";let o=await Zs(e),r=await Zs(t);return o===r?"copied":"divergent"}function Qs(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 el(e,t){let l=[],s=[];for(let n of e)if(n.kind!=="skip"){if(n.kind==="report"){s.push(n);continue}try{await mkdir(dirname(n.targetPath),{recursive:!0});let o;n.mode==="symlink"?o=await i$1(t.sourceDir,n.targetPath,{isGlobal:t.installGlobally&&n.scope==="global",agentType:n.agentId,cwd:t.cwd}):o=await 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 tl(e,t){let l=[];for(let s of e)if(s==="eve"&&t.includeEveSubagents!==false){let n=f(t.cwd);if(n.length===0)l.push(Ln(t));else for(let o of n)l.push({agentId:s,cells:{global:lt("global",s,true,t,o),project:lt("project",s,false,t,o)}});}else l.push({agentId:s,cells:{global:lt("global",s,true,t),project:lt("project",s,false,t)}});return l}function lt(e,t,l,s,n){return {scope:e,state:"absent",targetPath:join(g(t,l,s.cwd,n),s.skillId),sourceDir:s.sourceDir}}function Ln(e){return {agentId:"eve",cells:{global:lt("global","eve",true,e),project:lt("project","eve",false,e)}}}async function rs(e){let t=e.cwd??process.cwd(),l=Filesystem.toUnixPath(e.sourceDir),s=e.includeEveSubagents??true;if(e.assumeYes)return {skipped:true,installed:[],reported:[]};let n=tl(e.targetAgents,{skillId:e.skillId,sourceDir:l,cwd:t,includeEveSubagents:s}),o=[];for(let a of n){let k={...a.cells.global,state:await os(a.cells.global.targetPath,l)},h={...a.cells.project,state:await os(a.cells.project.targetPath,l)};o.push({agentId:a.agentId,cells:{global:k,project:h}});}let r=Qs(o,e.defaultMode),{installed:d,reported:g}=await el(r,{sourceDir:l,installGlobally:e.installGlobally,cwd:t});return {skipped:false,installed:d,reported:g,matrix:o}}function Rt(e){return x.bgCyan(x.black(x.bold(` ${e} `)))}var Pn="/opt/.devin",sl="easbot",Rn="cursor",Nn="cursor-cli",On="claude",En="cowork",Dn="devin",Un="replit",Mn="gemini",Fn="codex",Kn="antigravity",Gn="augment-cli",Hn="opencode",cs="github-copilot",Wn="github-copilot-cli",ll="v0";async function nl(){if(process.env.AI_AGENT){let e=process.env.AI_AGENT.trim();if(e)return e===sl?{isAgent:true,agent:{name:sl}}:e===cs||e===Wn?{isAgent:true,agent:{name:cs}}:e===ll?{isAgent:true,agent:{name:ll}}:{isAgent:true,agent:{name:e}}}if(process.env.CURSOR_TRACE_ID)return {isAgent:true,agent:{name:Rn}};if(process.env.CURSOR_AGENT||process.env.CURSOR_EXTENSION_HOST_ROLE==="agent-exec")return {isAgent:true,agent:{name:Nn}};if(process.env.GEMINI_CLI)return {isAgent:true,agent:{name:Mn}};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:Kn}};if(process.env.AUGMENT_AGENT)return {isAgent:true,agent:{name:Gn}};if(process.env.OPENCODE_CLIENT)return {isAgent:true,agent:{name:Hn}};if(process.env.CLAUDECODE||process.env.CLAUDE_CODE)return process.env.CLAUDE_CODE_IS_COWORK?{isAgent:true,agent:{name:En}}:{isAgent:true,agent:{name:On}};if(process.env.REPL_ID)return {isAgent:true,agent:{name:Un}};if(process.env.COPILOT_MODEL||process.env.COPILOT_ALLOW_ALL||process.env.COPILOT_GITHUB_TOKEN)return {isAgent:true,agent:{name:cs}};try{return await access(Pn,constants.F_OK),{isAgent:!0,agent:{name:Dn}}}catch{}return {isAgent:false,agent:void 0}}var nt=null,Bn={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 ot(){return nt||(nt=await nl(),nt.isAgent&&a(nt.agent.name),nt)}async function Nt(){return (await ot()).isAgent}async function _r(){let e=await ot();return e.isAgent?e.agent.name:null}function ol(e){return Bn[e]??null}function ps(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 zn(e,t=2){console.log(JSON.stringify(e,null,t));}function Q(e){zn(e);}function ee(e,t={}){let l=e.length>0?e.join(`
|
|
4
|
+
`):t.empty??x.dim("No results."),s=e.length>0?t.title:t.emptyTitle??t.title;s?v.note(l,s):console.log(l),t.outro&&!t.skipOutro?v.outro(t.outro):t.skipOutro||v.outro(x.green("Done!"));}var i="\x1B[0m",G="\x1B[1m",c="\x1B[38;5;102m",M="\x1B[38;5;145m",je="\x1B[36m";var it="\x1B[33m";dirname(fileURLToPath(import.meta.url));var Dt=Number(process.env.SKILLS_UPDATE_TIMEOUT??6e4);async function Ut(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 cl(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 pl(e){try{return await b$3(e)}catch{return}}async function ul(e,t,l,s){let{rm:n,readdir:o,stat:r}=await import('fs/promises'),d=L(e),g=M$1(e),a=Filesystem.join(Filesystem.normalize(t),l),k=Filesystem.join(g,l);if(!await 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=Filesystem.join(L,O.name);try{let N=await r(E);return `${E.slice(Filesystem.normalize(m).length+1).split(/[\\/]/).join("/")}|${N.size}|${O.isDirectory()?"d":"f"}|${(N.mode&511).toString(8)}`}catch{return `${O.name}|?|?|?`}}));for(let O of I)w.push(O);for(let O of y)if(O.isDirectory()&&!await T(Filesystem.join(L,O.name)))return !1;return !0}catch{return false}};if(await T(Filesystem.normalize(m)))return w.sort(),createHash("sha256").update(w.join(`
|
|
5
|
+
`)).digest("hex")},A=await C(a),$=await C(k);if(A&&$&&A===$){let w=(await Y(d,O(e,l),s))?.entry.computedHash;if(w)return {ok:true,hash:w,skipped:true}}try{await n(k,{recursive:!0,force:!0}),await Filesystem.cp(a,k);}catch{return {ok:false}}let p=await pl(k);if(!p)return {ok:false};let u=e.type==="local"?e.localPath??e.url:Filesystem.normalize(t);try{await aa([{skillName:s,parsed:e,sourceKey:d,sourcePath:u,storePath:g,skillPath:l,computedHash:p}]);}catch{}return {ok:true,hash:p}}function Mt(e,t,l){return e||!t||!l?true:t!==l}function qn(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 da(e){let t=e||process.cwd();return existsSync(join(t,"skills-lock.json"))}async function Xn(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.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.isCancel(t)&&(v.cancel("Cancelled"),process.exit(0)),t}function dl(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 Zn(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 Qn(e){let t=e.sourceUrl;if(e.sourceType==="well-known"){let l=t.indexOf("/.well-known/");l!==-1&&(t=t.slice(0,l));}return ps(t,e.ref)}function Ot(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=Qn(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(` ${M}\u2022${i} ${b$4(n.name)} ${c}(${n.reason})${i}`);}else {let n=s[0].reason,o=s.map(r=>b$4(r.name)).join(", ");console.log(` ${M}\u2022${i} ${o} ${c}(${n})${i}`);}console.log(` ${c}To update: ${M}easbot skills add ${l} -g -y${i}`);}}async function gl(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$1=q(e.agentFilter??[]),r=o$1.length>0?o$1:void 0,g=(await a$3({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-AWD3LLEY.mjs'),{readSkillLock:h}=await import('./skill-lock-DZMA75MY.mjs'),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 Y(u.marketId,u.pluginId,p.name);if(!m)continue;let{readStoreIndex:w}=await import('./store-IVDLGLET.mjs'),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=existsSync(T)?await y(`${T}/SKILL.md`.replace(/\\/g,"/")):void 0;if(!f){if(!await eo(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$1=f;for(let I of u.agents){let O=o(I,u.scope),N=await h$1(y$1,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 eo(e,t$1){return t$1?(await c$4()).skills[e]:(await t()).skills[e]}function to(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 fl(e){if(e.skills.length===0)return;let t=to(e),l=n=>{let o=n.map(r=>b$1[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(`${M}Updating for:${i}`);for(let n of t.updatingFor){let o=l(n.agents);console.log(` ${c}\u2514${i} ${je}${b$4(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} ${je}${b$4(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=b$1[o]?.displayName??o;console.log(` ${M}\u2717 ${d}:${i} ${c}${r}${i}`);}}console.log();}async function so(e){let t$1=await t(),l=[];for(let[s,n]of Object.entries(t$1.skills))dl(s,e)&&n.sourceType!=="node_modules"&&l.push({name:s,source:n.source,entry:n});return l}async function lo(e$1={}){let t=e$1.cwd||process.cwd(),l=await c$4(),s=Object.keys(l.skills),n=0,o=0,r=0;if(s.length===0)return v.note(e$1.skills&&e$1.skills.length>0?`${x.yellow(`No installed skills found matching: ${e$1.skills.join(", ")}`)}`:`${x.dim("No global skills tracked in lock file.")}`,x.cyan("Global Skills Update")),v.outro(`${x.green("Done!")}${x.dim(" Install with `easbot skills add <package> -g` to get started.")}`),{successCount:n,failCount:o,checkedCount:0};let{listInstalledSkills:d}=await import('./installer-REG45DC2.mjs'),g=await d({scope:"global",agentFilter:e$1.agent,cwd:t}),a=new Set(g.map(u=>u.name)),k=[],h=[],C=[];for(let u of s){if(!dl(u,e$1.skills))continue;let m=l.skills[u];if(m){if(!m.skillPath){h.push({name:u,reason:Zn(m),sourceUrl:m.source,sourceType:m.sourceType,ref:m.ref});continue}a.has(u)&&C.push({name:u,entry:m});}}let A$1=new Map;for(let u of C){let m=u.entry.source,w=A$1.get(m)||[];w.push(u),A$1.set(m,w);}for(let[u,m]of A$1){let w=m[0].entry,T=w.source,P=w.sourceType,L$1=null;if(process.stdout.write(`\r${c}Checking skills from source: ${u}${i}\x1B[K
|
|
6
|
+
`),P==="github"){let y=e(T),I=a$1(y);if(I)try{let{fetchGitHubMarketSnapshot:O}=await import('./blob-3PZEQWTP.mjs'),E=await Ut(O(I,w.ref??void 0),Dt,`update market-snapshot ${u}`),U=(await S$1()).markets[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=e(T),O=await Ut(Q$1({type:y,url:I.url,ref:w.ref??void 0,mode:"update"}),Dt,`update fetch ${u}`);if(L$1=O.tempDir,O.cloneError&&(f=O.cloneError),!f&&L$1){let E=await A(L$1),N=L$1.replace(/\\/g,"/").replace(/\/+$/,""),U=E.map(Y=>{let J=Y.path.replace(/\\/g,"/");return relative(N,J).split(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),ne=e(T);for(let{name:q,entry:H}of m){if(Y.has(q))continue;let Se=H.skillPath.split(sep).join("/").replace(/\/SKILL\.md$/,"");if(!J.has(Se))continue;let $e=await ul(ne,L$1,Se,q);if(!$e.ok){h.push({name:q,reason:"Store sync failed",sourceUrl:H.source,sourceType:H.sourceType,ref:H.ref});continue}Mt(e$1.force,H.computedHash,$e.hash)&&k.push({name:q,source:u,entry:H});}}}}catch(y){f=y instanceof Error?y:new Error(String(y));}finally{L$1&&P!=="local"&&!ga(L$1)&&await l$1(L$1);}f&&(console.log(` ${c}\u2717 Failed to check skills from ${u}: ${f.message}${i}`),h.push(...cl(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$1.skills||console.log(`${c}No global skills to check.${i}`),{successCount:n,failCount:o,checkedCount:0};if(C.length===0&&h.length>0)return Ot(h),{successCount:n,failCount:o,checkedCount:$};if(k.length===0)return console.log(`${M}\u2713 All global skills are up to date${i}`),{successCount:n,failCount:o,checkedCount:$};if(console.log(`${M}Found ${k.length} global update(s)${i}`),console.log(),k.length===0)return Ot(h),{successCount:n,failCount:o,checkedCount:$};try{let u=[],m=[];for(let T of k){u.push(T.name);let P=e(T.entry.source),L=M$1(P),y=(T.entry.skillPath??T.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");m.push(join(L,y));}let w=await gl({skillNames:u,skillStorePaths:m,scope:"global",agentFilter:e$1.agent,cwd:t});fl(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 c$4(),m=new Date().toISOString(),w=!1,T=0;for(let P of k){let L=u.skills[P.name];if(!L)continue;let f=e(P.entry.source),y=M$1(f),O=(P.entry.skillPath??P.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,""),E=join(y,O),N=await pl(E);N&&L.computedHash!==N&&(L.computedHash=N,L.updatedAt=m,w=!0,T++);}w&&(await d$3(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}`);}Ot(h);let p=[];if(n>0&&o>0)p.push(`${x.green(`\u2713 ${n} refreshed`)} ${x.dim("|")} ${x.red(`\u2717 ${o} failed`)}`);else if(n>0)p.push(`${x.green(`\u2713 ${n} refreshed`)}`);else if(o>0)p.push(`${x.red(`\u2717 ${o} failed`)}`);else if($>0)p.push(`${x.green("All global skills are up to date.")}`);else return {successCount:n,failCount:o,checkedCount:$};return h.length>0&&p.push(`${x.yellow(`\u26A0 ${h.length} skipped`)}`),console.log(),v.note(p.join(`
|
|
7
|
+
`),x.cyan("Global Skills Update")),v.outro(`${x.green("Done!")}${x.dim(" Run `easbot skills list` to see current state.")}`),{successCount:n,failCount:o,checkedCount:$}}async function no(e$1={}){let t$1=e$1.cwd||process.cwd(),l=await so(e$1.skills),s=0,n=0,o=[];if(l.length===0)return e$1.skills||(console.log(`${c}No project skills to update.${i}`),console.log(`${c}Install project skills with${i} ${M}easbot skills add <package>${i}`)),v.note(l.length===0&&e$1.skills?`${x.yellow(`No installed skills found matching: ${e$1.skills.join(", ")}`)}`:`${x.dim("No project skills tracked in lock file.")}`,x.cyan("Project Skills Update")),v.outro(`${x.green("Done!")}${x.dim(" Install with `easbot skills add <package>` to get started.")}`),{successCount:s,failCount:n,foundCount:0};let{listInstalledSkills:r}=await import('./installer-REG45DC2.mjs'),d=await r({scope:"project",agentFilter:e$1.agent,cwd:t$1}),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}`),rl(h),{successCount:s,failCount:n,foundCount:l.length};console.log(`${M}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$1=await t(),$=[];for(let[p,u]of C){let m=u[0].entry,w=m.source,T=m.ref;if(m.sourceType==="github"){let N=e(w),U=a$1(N);if(U)try{let{fetchGitHubMarketSnapshot:Y}=await import('./blob-3PZEQWTP.mjs'),J=await Ut(Y(U,m.ref??void 0),Dt,`update market-snapshot ${p}`),q=(await S$1()).markets[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$1.skills).filter(([N,U])=>U.source===p).map(([N,U])=>N);let L$1=null,f=[],y=new Map,I=null;try{let N=m.sourceType??"git",U=e(w),Y=await Ut(Q$1({type:N,url:U.url,ref:T,mode:"update"}),Dt,`update fetch ${p}`);if(L$1=Y.tempDir,Y.cloneError)I=Y.cloneError;else {let J=await A(L$1);if(J.length===0)I=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${p}`);else {let ne=J.map(H=>{let pe=relative(L$1,H.path);return join(pe,"SKILL.md").split(sep).join("/")}),q=e(w);for(let H of J){let Se=join(relative(L$1,H.path),"SKILL.md").split(sep).join("/").replace(/\/SKILL\.md$/,""),$e=await ul(q,L$1,Se,H.name);$e.ok&&$e.hash&&y.set(H.name,$e.hash);}}}}catch(N){I=N instanceof Error?N:new Error(String(N));}finally{L$1&&!ga(L$1)&&await l$1(L$1);}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(...cl(I,N));continue}let O=u.filter(N=>!f.includes(N.name)),E=[];for(let N of O){let U=A$1.skills[N.name],Y=y.get(N.name);if(!Y)continue;let J=U?.computedHash;if(!Mt(e$1.force,J,Y))continue;let ne=e(N.entry.source),q=M$1(ne),pe=(N.entry.skillPath??N.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");E.push({name:N.name,source:N.entry.source,skillPath:pe,storeRoot:q});}if(E.length!==0)try{let N=E.map(J=>J.name),U=E.map(J=>join(J.storeRoot,J.skillPath)),Y=await gl({skillNames:N,skillStorePaths:U,scope:"project",agentFilter:e$1.agent,cwd:t$1});fl(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(rl(h),Ot($),k.length>0)if(console.log(),o.length>0||$.length>0||h.length>0){let p=[];o.length>0&&p.push(`${x.green(`\u2713 Refreshed ${o.length} skill(s)${x.reset("")}`)}`),s>0&&n>0?p.push(`${x.green(`\u2713 ${s} ok`)} ${x.dim("|")} ${x.red(`\u2717 ${n} failed`)}`):s>0?p.push(`${x.green(`\u2713 ${s} ok`)}`):n>0&&p.push(`${x.red(`\u2717 ${n} failed`)}`),$.length>0&&p.push(`${x.yellow(`\u26A0 ${$.length} skipped`)}`),h.length>0&&p.push(`${x.dim(`${h.length} legacy (cannot update)`)}`),v.note(p.join(`
|
|
8
|
+
`),x.cyan("Project Skills Update")),v.outro(`${x.green("Done!")}${x.dim(" Run `easbot skills list` to see current state.")}`);}else v.note(`${x.green("All project skills are up to date.")}`,x.cyan("Project Skills Update")),v.outro(`${x.green("Done!")}`);if(s>0&&o.length>0)try{let p=await 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 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-AWD3LLEY.mjs');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 rl(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=ps(t.entry.source,t.entry.ref);console.log(` ${M}\u2022${i} ${b$4(t.name)}`),console.log(` ${c}To refresh: ${M}easbot skills add ${l} -y${i}`);}}}async function ml(e=[],t={}){let l=qn(e,t);l.all===true&&(l.yes=true,(!l.skills||l.skills.length===0)&&(l.skills=["*"]));let s=await Xn(l);l.skills?console.log(`${M}Updating ${l.skills.join(", ")}...${i}`):console.log(`${M}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 lo(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 no(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(`${M}\u2713 Updated ${n} skill(s)${i}`),o>0&&console.log(`${c}Failed to update ${o} skill(s)${i}`),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 hl={version:"0.3.13"};var bl="eve agent";function ao(e,t){return e.startsWith("git@")||e.startsWith("ssh://")?e:t}function Sl(e){b(e);}async function co(e,t,l,s){let{agent:n,subagent:o}=t,{installMode:r,installGlobally:d}=s,k=await h$1(e,n,{global:d,mode:r,eveSubagent:o});return {skill:B(e),agent:mt(t),pluginName:e.pluginName,...k}}var po=(()=>{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 kl(e){switch(e){case "critical":return x.red(x.bold("Critical Risk"));case "high":return x.red("High Risk");case "medium":return x.yellow("Med Risk");case "low":return x.green("Low Risk");case "safe":return x.green("Safe");default:return x.dim("--")}}function uo(e){if(!e)return x.dim("--");let t=e.alerts??0;return t>0?x.red(`${t} alert${t!==1?"s":""}`):x.green("0 alerts")}function at(e,t){let l=a$4(e),s=Math.max(0,t-l.length);return e+" ".repeat(s)}function go(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=at("",n+2)+at(x.dim("Gen"),18)+at(x.dim("Socket"),18)+x.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?kl(g.ath.risk):x.dim("--"),h=g?.socket?uo(g.socket):x.dim("--"),C=g?.snyk?kl(g.snyk.risk):x.dim("--");o.push(at(x.cyan(a),n+2)+at(k,18)+at(h,18)+C);}return o.push(""),o.push(`${x.dim("Details:")} ${x.dim(`https://skills.sh/${l}`)}`),o}function gs(e,t){let l=homedir();return e===l||e.startsWith(l+sep)?"~"+e.slice(l.length):e===t||e.startsWith(t+sep)?"."+e.slice(t.length):e}function Ae(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 fo(e){let t=e.map(s=>x.cyan(B(s))),l=Ae(t,3);return a$4(l).length<=80?l:`${e.length} selected skills`}function mo(e){return `Detected an eve project. Install ${fo(e)} for your ${bl} to use?`}function ho(e,t,l){let s=[],n=[],o$1=[],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=b$1[d].displayName,a=r.get(g);o(d,l?"global":"project")?s.push(g):a==="symlink"?o$1.push(g):n.push(g);}return {universal:s,copied:n,symlinked:o$1}}function mt(e){let t=b$1[e.agent].displayName;return e.subagent?`${t} (${e.subagent})`:t}function Ft(e){return e.subagent?`${e.agent}:${e.subagent}`:e.agent}function ko(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 $o(e,t,l,s=[]){let n=[],o$1=e.filter(h=>!h.subagent).map(h=>h.agent),r=e.filter(h=>h.subagent).map(mt),d,g;if(s.length>0){let h=new Set(s);d=o$1.filter(C=>h.has(C)),g=o$1.filter(C=>!h.has(C));}else d=o$1.filter(h=>o(h,l?"global":"project")),g=o$1.filter(h=>!o(h,l?"global":"project"));let a=d.map(h=>b$1[h].displayName),k=g.map(h=>b$1[h].displayName);return t==="symlink"?(a.length>0&&n.push(` ${x.green("universal:")} ${Ae(a)}`),k.length>0&&n.push(` ${x.dim("symlinked:")} ${Ae(k)}`),r.length>0&&n.push(` ${x.dim("copied:")} ${Ae(r)}`)):(a.length>0&&n.push(` ${x.green("universal:")} ${Ae(a)}`),k.length>0&&n.push(` ${x.dim("copied:")} ${Ae(k)}`),r.length>0&&n.push(` ${x.dim("copied (subagent):")} ${Ae(r)}`)),n}function $l(e,t){let l=h(t),s=[...e];for(let n of l)s.includes(n)||s.push(n);return s}function yo(e,t,l){let s=[],{universal:n,copied:o,symlinked:r}=ho(e,t,l),d=o,g=e.filter(a=>a.symlinkFailed&&!a.skipped).map(a=>a.agent);return n.length>0&&s.push(` ${x.green("universal:")} ${Ae(n)}`),d.length>0&&s.push(` ${x.cyan("copied:")} ${Ae(d)}`),r.length>0&&s.push(` ${x.dim("symlinked:")} ${Ae(r)}`),g.length>0&&s.push(` ${x.yellow("symlink-failed:")} ${Ae(g)}`),s}function bo(e){return v.multiselect({...e,options:e.options,message:`${e.message} ${x.dim("(space to toggle)")}`})}async function So(e,t){return await ls({message:e,items:t,initialSelected:[],required:true})}async function yl(e){let t=e.global===true?"global":"project",l=a=>t!=="global"||b$1[a].globalSkillsDir!==void 0,s=h(t).filter(l),n=i$3(t).filter(a=>a!=="eve"&&l(a)),o={title:"Universal (.agents/skills)",items:s.map(a=>({value:a,label:b$1[a].displayName}))},r=n.map(a=>({value:a,label:b$1[a].displayName,hint:e.global?b$1[a].globalSkillsDir:b$1[a].skillsDir})),g=await ls({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 wo=hl.version;b(wo);async function ht(e$2,t$1={}){let l$1=e$2[0],s=false,n=()=>{s||(v.log.message(x.dim("Tip: use the --yes (-y) and --global (-g) flags to install without prompts.")),s=true);};if(!l$1){let{readStoreIndex:g,resolveDefaultSource:a}=await import('./store-IVDLGLET.mjs'),k=await g();l$1=await a(k);}t$1.all&&(t$1.skill=["*"],t$1.agent=["*"],t$1.yes=true);let o$2=t$1.global??false;if(!(t$1.global!==void 0)&&!t$1.yes&&!t$1.all&&process.stdin.isTTY&&Object.values(b$1).some(h=>h.globalSkillsDir!==void 0)){let h=await v.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.isCancel(h)&&(v.cancel("Installation cancelled"),await ke(null),process.exit(0)),o$2=h,v.log.info(`${x.bold(o$2?"Global":"Project")} scope selected`);}let r=await ot();if(r.isAgent&&(t$1.yes=true,!t$1.agent||t$1.agent.length===0)){let g=ol(r.agent.name);if(g){let a=o$2?"global":"project";t$1.agent=$l([g],a);}}console.log(),r.isAgent||v.intro(x.bgCyan(x.black(" skills "))),r.isAgent?v.log.info(Rt(r.agent.name)+" Agent detected \u2014 installing non-interactively"):!process.stdin.isTTY&&!t$1.yes&&n();let d$2=null;try{let g$1=v.spinner();g$1.start("Parsing source...");let a=e(l$1);g$1.stop(`Source: ${a.type==="local"?a.localPath:a.url}${a.ref?` #${x.yellow(a.ref)}`:""}${a.subpath?` @${x.cyan(a.subpath)}`:""}`);let k=a$1(a),h=(()=>{if(!k)return Promise.resolve(null);let b=b$2(k);return b?c$1(b.owner,b.repo).catch(()=>null):Promise.resolve(null)})(),C$1=Array.isArray(t$1?.skill)&&t$1.skill.length>0||t$1.fullDepth===!0||!!a.subpath;g$1.start("Loading source...");let A;try{A=await da$1(a,{includeInternal:C$1,fullDepth:t$1.fullDepth});}catch(b){throw b instanceof R&&(g$1.stop(x.red("Path not found")),v.outro(x.red(`Local path does not exist: ${b.localPath}`)),process.exit(1)),b}d$2=A.storeDir,g$1.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$1=a.subpath?$.filter(b=>b.path.includes(`/${a.subpath}/`)||b.path.endsWith(`/${a.subpath}`)):$;if(g$1.start("Discovering skills..."),p$1.length===0&&A.cloneError){g$1.stop(x.red("Failed to clone repository"));for(let b of A.cloneError.message.split(`
|
|
9
|
+
`))v.log.message(x.dim(b));await ke(d$2),process.exit(1);}if(p$1.length===0&&(g$1.stop(x.red("No skills found")),v.outro(x.red("No valid skills found. Skills require a SKILL.md with name and description.")),await ke(d$2),process.exit(1)),g$1.stop(`Found ${x.green(p$1.length)} skill${p$1.length>1?"s":""}`),t$1.list){console.log(),v.log.step(x.bold("Available Skills"));let b={},j=[];for(let _ of p$1)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.bold(D));for(let W of b[_])v.log.message(` ${x.cyan(B(W))}`),v.log.message(` ${x.dim(W.description)}`);console.log();}if(j.length>0){R.length>0&&console.log(x.bold("General"));for(let _ of j)v.log.message(` ${x.cyan(B(_))}`),v.log.message(` ${x.dim(_.description)}`);}console.log(),v.outro("Use --skill <name> to install specific skills"),await ke(d$2),process.exit(0);}let u;if(t$1.skill&&t$1.skill.length>0){let b=p$1.map(R=>B(R)),j=E(t$1.skill,b);if(j.wildcard)u=p$1,v.log.info(`Installing all ${p$1.length} skills`);else if(j.invalid.length>0){v.log.error(`No matching skills found for: ${j.invalid.join(", ")}`),v.log.info("Available skills:");for(let R of p$1)v.log.message(` - ${B(R)}`);await ke(d$2),process.exit(1);}else u=C(p$1,j.matched),u.length===0&&(v.log.error(`No matching skills found for: ${j.matched.join(", ")}`),await ke(d$2),process.exit(1)),v.log.info(`Selected ${u.length} skill${u.length!==1?"s":""}: ${u.map(R=>x.cyan(B(R))).join(", ")}`);}else if(p$1.length===1){u=p$1;let b=p$1[0];v.log.info(`Skill: ${x.cyan(B(b))}`),v.log.message(x.dim(b.description));}else if(t$1.yes)u=p$1,v.log.info(`Installing all ${p$1.length} skills`);else {let b=[...p$1].sort((_,D)=>_.pluginName&&!D.pluginName?-1:!_.pluginName&&D.pluginName?1:_.pluginName&&D.pluginName&&_.pluginName!==D.pluginName?_.pluginName.localeCompare(D.pluginName):B(_).localeCompare(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:B(W),hint:W.description.length>60?W.description.slice(0,57)+"...":W.description});}R=await v.groupMultiselect({message:`Select skills to install ${x.dim("(space to toggle)")}`,options:D,required:!0});}else {let _=b.map(D=>({value:D,label:B(D),hint:D.description.length>60?D.description.slice(0,57)+"...":D.description}));R=await bo({message:"Select skills to install",options:_,required:!0});}v.isCancel(R)&&(v.cancel("Installation cancelled"),await ke(d$2),process.exit(0)),u=R;}let m=a$1(a),w=m?c$2(m,u.map(b=>B(b))):Promise.resolve(null),T,P=Object.keys(b$1),L$1=o$2?"global":"project",f$1=[];if(t$1.agent&&t$1.agent.length>0){let b=p(t$1.agent);b.length>0&&(v.log.error(`Invalid agents: ${b.join(", ")}`),v.log.info(`Valid agents: ${P.join(", ")}`),await ke(d$2),process.exit(1)),T=q(t$1.agent),t$1.agent.includes("*")&&v.log.info(`Installing to all ${T.length} agents`);}else {g$1.start("Loading agents...");let b=await c$3(),j=Object.keys(b$1).length;if(g$1.stop(`${j} agents`),b.includes("eve")&&(t$1.yes||!r.isAgent)){let R=t$1.yes?!0:await v.confirm({message:mo(u),initialValue:!0});if(v.isCancel(R)&&(v.cancel("Installation cancelled"),await ke(d$2),process.exit(0)),R)T=["eve"],v.log.info(`Installing to: ${x.cyan(bl)}`);else {let _=await yl({global:L$1==="global"});typeof _=="symbol"&&(v.cancel("Installation cancelled"),await ke(d$2),process.exit(0)),f$1=_.locked,T=[..._.locked,..._.selected];}}else if(b.length===0)if(t$1.yes)T=P,v.log.info("Installing to all agents");else {v.log.info("Select agents to install skills to");let R=Object.entries(b$1).filter(([D])=>D!=="eve").map(([D,W])=>({value:D,label:W.displayName})),_=await So("Which agents do you want to install to?",R);v.isCancel(_)&&(v.cancel("Installation cancelled"),await ke(d$2),process.exit(0)),T=_;}else if(b.length===1||t$1.yes)if(T=$l(b,L$1),b.length===1){let R=b[0];v.log.info(`Installing to: ${x.cyan(b$1[R].displayName)}`);}else v.log.info(`Installing to: ${b.map(R=>x.cyan(b$1[R].displayName)).join(", ")}`);else {let R=await yl({global:L$1==="global"});typeof R=="symbol"&&(v.cancel("Installation cancelled"),await ke(d$2),process.exit(0)),f$1=R.locked,T=[...R.locked,...R.selected];}}t$1.subagent&&t$1.subagent.length>0&&!T.includes("eve")&&(T=[...T,"eve"]);let y=[void 0];if(T.includes("eve")){let b=f(process.cwd());if(t$1.subagent&&t$1.subagent.length>0)y=t$1.subagent.map(j=>j==="root"||j==="."?void 0:j);else if(b.length>0&&!t$1.yes){let j=[{value:"",label:"Root agent",hint:"agent/skills"},...b.map(_=>({value:_,label:_,hint:`agent/subagents/${_}/skills`}))],R=await v.multiselect({message:"Where should Eve skills be installed?",options:j,initialValues:[""],required:!0});v.isCancel(R)&&(v.cancel("Installation cancelled"),await ke(d$2),process.exit(0)),y=R.map(_=>_===""?void 0:_);}}let I=ko(T,y),O=t$1.copy?"copy":"symlink";if(I.every(b=>b.agent==="eve"))O="copy";else if(t$1.copy||t$1.yes)O="copy";else {let b=await v.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.isCancel(b)&&(v.cancel("Installation cancelled"),await ke(d$2),process.exit(0)),O=b;}let N=process.cwd(),U=[],Y=o$2?null:await t(N),J=await Promise.all(u.flatMap(b=>I.map(async j=>{let R=await l(b.name,j.agent,{global:o$2,eveSubagent:j.subagent}),_=R.installed,D;try{D=await b$3(b.path);}catch{D=void 0;}let V=Y?.skills[b.name]?.computedHash,se=!Mt(!1,V,D),ae=_&&R.mode==="copy"&&O==="copy"&&se,ue=!!_;return {skillName:b.name,target:j,installed:_,installedMode:R.mode,sourceHash:D,upToDate:!!ae,overwrite:ue}}))),ne=new Map,q$1=new Map;for(let{skillName:b,target:j,overwrite:R,upToDate:_}of J)ne.has(b)||(ne.set(b,new Map),q$1.set(b,new Map)),ne.get(b).set(Ft(j),R),q$1.get(b).set(Ft(j),_);let H={},pe=[];for(let b of u)if(b.pluginName){let j=b.pluginName;H[j]||(H[j]=[]),H[j].push(b);}else pe.push(b);let Se=b=>{for(let j of b){U.length>0&&U.push("");let R=I[0];I.length>1&&(R=I.find(ae=>o(ae.agent,o$2?"global":"project"))??I[0]);let _=o$1(j.name,{global:o$2,agent:R.agent,eveSubagent:R.subagent}),D=gs(_,N);U.push(`${x.cyan(D)}`),U.push(...$o(I,O,o$2,f$1));let W=ne.get(j.name),V=I.filter(se=>!o(se.agent,o$2?"global":"project")&&W?.get(Ft(se))).map(mt);V.length>0&&U.push(` ${x.yellow("overwrites:")} ${Ae(V)}`);}},$e=Object.keys(H).sort();for(let b of $e){let j=b.split("-").map(R=>R.charAt(0).toUpperCase()+R.slice(1)).join(" ");U.push(""),U.push(x.bold(j)),Se(H[b]);}pe.length>0&&($e.length>0&&(U.push(""),U.push(x.bold("General"))),Se(pe)),console.log(),v.note(U.join(`
|
|
10
|
+
`),"Installation Summary");try{let b=await Promise.race([w,new Promise(j=>setTimeout(()=>j(null),po))]);if(b&&m){let j=go(b,u.map(R=>({slug:B(R),displayName:B(R)})),m);j.length>0&&v.note(j.join(`
|
|
11
|
+
`),"Security Risk Assessments");}}catch{}if(!t$1.yes){let b=await v.confirm({message:"Proceed with installation?"});(v.isCancel(b)||!b)&&(v.cancel("Installation cancelled"),await ke(d$2),process.exit(0));}g$1.start("Installing skills...");let we=[],De=await Promise.all(u.map(async b=>{let j$1=new Map;for(let _ of I){let D=g(_.agent,o$2,N,_.subagent),W=(_.agent==="eve"||_.agent==="easbot")&&O==="symlink",V=O==="copy"||W?D:e$1(o$2,N),se=d$1(b.name||basename(b.path)),ae=join(V,se),ue=join(D,se),K=ae,te=j$1.get(K);te||(te={canonicalDir:ae,members:[]},j$1.set(K,te)),te.members.push({target:_,agentDir:ue});}return (await Promise.all([...j$1.values()].map(async _=>{let[D,...W]=_.members;if(!D)return [];if(q$1.get(b.name)?.get(Ft(D.target))??!1)return _.members.map(({target:ue,agentDir:K})=>({skill:B(b),agent:mt(ue),pluginName:b.pluginName,success:!0,path:K,canonicalPath:K,mode:O,skipped:!0,skippedReason:"up-to-date"}));let se=await co(b,D.target,D.agentDir,{installMode:O,installGlobally:o$2,cwd:N,tempDir:d$2}),ae=await Promise.all(W.map(async({target:ue,agentDir:K})=>{let te=O==="copy"?await j(_.canonicalDir,K,{agentType:ue.agent}):await i$1(_.canonicalDir,K,{isGlobal:o$2,agentType:ue.agent,cwd:N,storePath:b.path});return {skill:B(b),agent:mt(ue),pluginName:b.pluginName,...te}}));return [se,...ae]}))).flat()}));for(let b of De)we.push(...b);g$1.stop("Installation complete"),console.log();let _e=we.filter(b=>b.success),qe=we.filter(b=>!b.success),Ne={};for(let b of u)if(d$2&&b.path===d$2)Ne[b.name]="SKILL.md";else if(d$2&&b.path.startsWith(d$2+sep))Ne[b.name]=`${b.path.slice(d$2.length+1).split(sep).join("/")}/SKILL.md`;else if(d$2&&b.path.startsWith(d$2)){let j=d$2.split(sep).join("/"),R=b.path.split(sep).join("/");R.startsWith(`${j}/`)&&(Ne[b.name]=`${R.slice(j.length+1)}/SKILL.md`);}let Xe=a$1(a),xs=ao(a.url,Xe);if(Xe&&(b$2(Xe)?h.then(j=>{j===!1&&d({event:"install",source:Xe,skills:u.map(R=>R.name).join(","),agents:T.join(","),...o$2&&{global:"1"},skillFiles:JSON.stringify(Ne)});}):d({event:"install",source:Xe,skills:u.map(j=>j.name).join(","),agents:T.join(","),...o$2&&{global:"1"},skillFiles:JSON.stringify(Ne)})),_e.length>0&&o$2){let b=new Set(_e.map(j=>j.skill));for(let j of u){if(!b.has(B(j)))continue;let{derivePluginSlug:R,findSkillByLocation:_,readStoreIndex:D}=await import('./store-IVDLGLET.mjs'),W=L(a),V;{let te=(await D()).markets[W],ye=te?.plugins&&Object.keys(te.plugins).find(Ie=>te.plugins[Ie]?.skills[j.name]);ye?V=ye.slice(W.length+1):V=R(a,void 0,j.pluginName);}let se,ae;{let K=await _(W,`${W}:${V}`,j.name);se=K?.entry.computedHash,ae=K?.entry.skillPath;}if(ae===void 0){let K=a.type==="local"?a.localPath??a.url:a.url;if(j.path.startsWith(K))ae=Filesystem.relative(K,j.path).replace(/^\/+/,"");else {let te=Ne[j.name];te&&(ae=Filesystem.toUnixPath(Filesystem.dirname(te)));}}se===void 0&&(se=await b$3(j.path));let ue=`${W}:${V}`;await i$2(j.name,{source:xs||Xe||a.url,sourceType:a.type,ref:a.ref,...ae&&{skillPath:ae},computedHash:se,marketId:W,pluginId:ue});}}if(_e.length>0&&!o$2){let b=new Set(_e.map(_=>_.skill)),j=T.includes("eve")?y.map(_=>_??""):void 0,R=j&&(j.length>1||j.some(_=>_!==""));for(let _ of u)if(b.has(B(_)))try{let{derivePluginSlug:D,findSkillByLocation:W,readStoreIndex:V}=await import('./store-IVDLGLET.mjs'),se=L(a),ae=u.find(Ie=>B(Ie)===_.name),ue;{let Oe=(await V()).markets[se],xe=Oe?.plugins&&Object.keys(Oe.plugins).find(Ue=>Oe.plugins[Ue]?.skills[_.name]);xe?ue=xe.slice(se.length+1):ue=D(a,void 0,ae?.pluginName);}let K,te;{let Ie=await W(se,`${se}:${ue}`,_.name);K=Ie?.entry.computedHash,te=Ie?.entry.skillPath??Ne[_.name];}K===void 0&&(K=await b$3(_.path));let ye=`${se}:${ue}`;await v$1(_.name,{source:xs||a.url,ref:a.ref,sourceType:a.type,...te&&{skillPath:te},computedHash:K,marketId:se,pluginId:ye,...R&&{subagents:j}},N);}catch{}}if(_e.length>0){let b=new Map,j={},R=[];for(let K of _e){let te=b.get(K.skill)||[];if(te.push(K),b.set(K.skill,te),te.length===1)if(K.pluginName){let ye=K.pluginName;j[ye]||(j[ye]=[]),j[ye].push(K);}else R.push(K);}let _=b.size,D=_e.filter(K=>K.mode==="symlink"&&K.symlinkFailed),W=D.map(K=>K.agent),V=[],se=K=>{for(let te of K){let ye=b.get(te.skill)||[],Ie=ye[0];if(V.push(`${x.green("\u2713")} ${te.skill}`),Ie.canonicalPath){let xe=gs(Ie.canonicalPath,N);V.push(` ${x.dim("source:")} ${xe}`);}let Oe=new Map;for(let xe of ye){if(xe.symlinkFailed||xe.skipped||Ie.canonicalPath&&xe.path===Ie.canonicalPath)continue;let Ue=xe.path;Oe.has(Ue)?Oe.get(Ue)!=="symlink"&&xe.mode==="symlink"&&Oe.set(Ue,"symlink"):Oe.set(Ue,xe.mode);}for(let[xe,Ue]of Oe){let rn=gs(xe,N),an=Ue==="symlink"?x.cyan("(link)"):x.dim("(copied)");V.push(` ${x.dim("target:")} ${rn} ${an}`);}V.push(...yo(ye,T,o$2));}},ae=Object.keys(j).sort();for(let K of ae){let te=K.split("-").map(ye=>ye.charAt(0).toUpperCase()+ye.slice(1)).join(" ");V.push(""),V.push(x.bold(te)),se(j[K]);}R.length>0&&(ae.length>0&&(V.push(""),V.push(x.bold("General"))),se(R));let ue=x.green(`Installed ${_} skill${_!==1?"s":""}`);v.note(V.join(`
|
|
12
|
+
`),ue),D.length>0&&(v.log.warn(x.yellow(`Symlinks failed for: ${Ae(W)}`)),v.log.message(x.dim(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(qe.length>0){console.log(),v.log.error(x.red(`Failed to install ${qe.length}`));for(let b of qe)v.log.message(` ${x.red("\u2717")} ${b.skill} \u2192 ${b.agent}: ${x.dim(b.error)}`);}if(console.log(),v.outro(x.green("Done!")+x.dim(" Review skills before use; they run with full agent permissions.")),t$1.json){let b=_e.map(R=>({skill:R.skill,agent:R.agent,canonicalPath:R.canonicalPath??null,path:R.path,mode:R.mode,...R.pluginName&&{pluginName:R.pluginName}})),j=qe.map(R=>({skill:R.skill,agent:R.agent,error:R.error??"unknown error"}));Q(Z({scope:o$2?"global":"project",source:a.url,sourceType:a.type,...a.subpath&&{subpath:a.subpath},...a.ref&&{ref:a.ref},installed:b,failed:j,summary:{total:we.length,installed:b.length,failed:j.length,agents:T,mode:O}},{scope:o$2?"global":"project",source:a.url,installed:b.length,failed:j.length,total:we.length,agents:T.length}));return}await vo(t$1,T);}catch(g){if(g instanceof g$1){v.log.error(x.red("Failed to clone repository"));for(let a of g.message.split(`
|
|
13
|
+
`))v.log.message(x.dim(a));}else v.log.error(g instanceof Error?g.message:"Unknown error occurred");process.stdin.isTTY||n(),v.outro(x.red("Installation failed")),process.exit(1);}finally{await ke(d$2);}}async function ke(e){if(e){if(ga(e))return;try{await l$1(e);}catch{}}}async function vo(e,t){if(process.stdin.isTTY&&!e?.yes)try{if(await n("findSkillsPrompt"))return;if(await k("eas-skill-find","claude-code",{global:!0})){await p$1("findSkillsPrompt");return}console.log(),v.log.message(x.dim("One-time prompt - you won't be asked again if you dismiss."));let n$1=await v.confirm({message:`Install the ${x.cyan("eas-skill-find")} skill? It helps your agent discover and suggest skills.`});if(v.isCancel(n$1)){await p$1("findSkillsPrompt");return}if(n$1){await p$1("findSkillsPrompt");let o=t?.filter(r=>r!=="replit");if(!o||o.length===0)return;console.log(),v.log.step("Installing eas-skill-find skill...");try{await ht(["houjallen/agent-skills@skills/builtin/eas-skill-find"],{global:!0,yes:!0,agent:o});let r=join(e$1(!0),"eas-skill-find"),d=await rs({skillId:"eas-skill-find",sourceDir:r,targetAgents:o,installGlobally:!0,defaultMode:"symlink",assumeYes:e?.yes===!0});d.reported.length>0&&v.log.warn(`${d.reported.length} cell(s) reported divergent/orphan (not auto-fixed). Run 'easbot skills repair' to fix.`);}catch{v.log.warn("Failed to install eas-skill-find. You can try again with:"),v.log.message(x.dim(" easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find -g -y --all"));}}else await p$1("findSkillsPrompt"),v.log.message(x.dim("You can install it later with: easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find"));}catch{}}function Kt(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 wl={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 Ao=wl.languages,To=Ao.filter(e=>e.supported).map(e=>e.value),Ve={defaultLocale:"zh-CN",locales:To},kt={},Gt=(e,t)=>{let l=kt[e]||{translation:{}};return kt[e]={translation:{...l.translation,...t.translation}},kt[e]},Ht=(e=Ve.defaultLocale)=>(kt[e]||Gt(e,{translation:{}}),{locale:e,resources:kt[e]||{translation:{}}});var Io={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"}},vl=Io;var jo={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"}},xl=jo;var Lo=()=>{Ht("zh-CN"),Ht("en-US"),Gt("zh-CN",vl),Gt("en-US",xl);};Lo();var ms=new Map,hs=new Map,_o=e=>{if(hs.has(e))return hs.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 hs.set(e,o),o},Al=(e,t)=>{if(!e||typeof e!="string")return "";if(!t||Object.keys(t).length===0)return e;let{regex:l,keys:s}=_o(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)})},Co=e=>{if(e&&Ve.locales.includes(e))return e;let t=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(t){let l=t.replace(/_/g,"-");if(Ve.locales.includes(l))return l;let s=l.split("-")[0];if(s==="zh")return "zh-CN";if(s==="en")return "en-US"}return Ve.defaultLocale},Tl=e=>{if(!ms.has(e)){let{resources:t}=Ht(e);ms.set(e,t);}return ms.get(e)},Po=(e,t={})=>{let l=Co(t.locale),n=Tl(l)?.translation[e];if(n&&typeof n=="string"){let o=Al(n,t.vars);return o!=null?String(o):String(e)}if(l!==Ve.defaultLocale){let r=Tl(Ve.defaultLocale)?.translation[e];if(r&&typeof r=="string"){let d=Al(r,t.vars);return d!=null?String(d):String(e)}}return String(t.fallback??e)},S=Po;function No(e){let t=e[0]??"list",l=e.slice(1);return {subcommand:t,restArgs:l}}async function Ll(e,t={}){let{subcommand:l,restArgs:s}=No(e),n=Oo(s,t);switch(l){case "list":return Eo(Il(s),n);case "clean":return Uo(n);case "update":return Ko(Il(s),n);case "remove":return Ho(s,n);case "--help":case "-h":return jl(),0;default:return console.log(x.yellow(S("cli.store.unknown_subcommand",{vars:{sub:l},fallback:`Unknown store subcommand: ${l}`}))),jl(),1}}async function _l(e){if(!existsSync(e))return;let t=readdirSync(e,{withFileTypes:true});for(let l of t){if(l.name==="index.json")continue;let s=Filesystem.join(e,l.name);await rm(s,{recursive:true,force:true}).catch(()=>{});}}function Il(e){for(let t of e)if(t&&!t.startsWith("-"))return t}function Oo(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 Eo(e,t={}){let l=await S$1(),s=await 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??Filesystem.join(J(),k),$=h?.type??"unknown",p=h?.url??"(local)";r.push(`${x.bold(C)} ${x.dim("("+$+")")} ${p} ${x.dim("store="+C)} ${x.dim(A)} ${x.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.dim("\u2514")} ${x.cyan(P)} ${x.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(` ${Do(f.skillName)}`),a++;}r.push("");}return ee(r,{title:`Store skills (${a})`,outro:x.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 Do(e){return e.replace(/[\x00-\x1f\x7f]/g,"").trim()}async function Uo(e={}){return e.force?Fo(e):Mo(e)}async function Mo(e){await S$1();let l=await 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.log.warn(x.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.confirm({message:"Reset store (delete store contents + clear index.json)?"});if(v.isCancel(d)||!d)return v.cancel("Cancelled."),1}let o=J();await _l(o);let r=Filesystem.join(o,"index.json");if(existsSync(r)){let{Filesystem:d}=await import('@easbot/utils');await d.writeJson(r,{version:6,markets:{}});}if(existsSync(o)&&await rm(Filesystem.normalize(o),{recursive:true,force:true}).catch(()=>{}),d({event:"store_clean"}),e.json)return 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.green(`\u2713 Reset store: ${o}${d} (cache preserved)`)}`});}return 0}async function Fo(e){let t=await S$1(),l=await 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.yellow(` ${A} local source(s) cache = user directory; will be SKIPPED (never removed by force).`):"";v.log.warn(x.yellow(`This will reset store AND clear cache: ${s.length} source(s) / ${n} skill(s).${$}`));let p=await v.confirm({message:"Reset store + clear cache (local sources protected)?"});if(v.isCancel(p)||!p)return v.cancel("Cancelled."),1}let d$1=J(),g=Filesystem.normalize(N()),a=Filesystem.normalize(d$1);for(let A of o){let $=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 _l(d$1);let k=Filesystem.join(d$1,"index.json");if(existsSync(k)){let{Filesystem:A}=await import('@easbot/utils');await A.writeJson(k,{version:6,markets:{}});}let h=N(),C=false;if(existsSync(h)&&r.size>0?(await ja(),C=true):existsSync(h)&&(await ja(),C=true),existsSync(d$1)&&await rm(Filesystem.normalize(d$1),{recursive:true,force:true}).catch(()=>{}),d({event:"store_clean_force"}),e.json)Q(Z({cleaned:true,path:d$1,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.dim(` (${o.size} local source(s) cache preserved)`):"";ee([],{emptyTitle:"Store clean (force)",outro:`${x.green(`\u2713 Reset store + cleared cache${A}`)}`});}return 0}async function Ko(e,t={}){let l=await S$1(),s=await 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$1=[];for(let g of n){let a=await Go(g,l,{...t});a.ok?(o++,d$1.push({sourceKey:g,skills:a.skills})):(r++,d$1.push({sourceKey:g,skills:[],cloneError:a.error}));}return 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$1},{failed:r,total:n.size,keyword:e??null})):(r>0&&v.log.warn(x.yellow(`${r} source(s) failed to refresh (clone errors); see above.`)),ee([],{emptyTitle:"Store update",outro:`${x.green(`\u2713 Refreshed ${o}/${n.size} store source(s)${e?` matching "${e}"`:""}`)}`})),r>0?2:0}async function Go(e$1,t,l){let s=t.markets[e$1];if(!s)return {ok:false,error:`source key not found: ${e$1}`};let n=e(s.url);if(s.subpath&&(n.subpath=s.subpath),s.ref&&(n.ref=s.ref),false);let o=await da$1(n);return o.cloneError?{ok:false,error:o.cloneError.message}:{ok:true,skills:o.skills.map(r=>r.name)}}async function Ho(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.log.error(x.red("Usage: skills store remove <source-key> [--force]")),1);let s=await S$1(),n=(await 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.log.error(x.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=Filesystem.join(J(),l),d$1=o.type==="local";if(!t.yes&&!t.json&&process.stdin.isTTY){let a=d$1?" [local source: user directory protected]":"",k=t.force&&!d$1?" (+ cache)":"",h=await v.confirm({message:`Remove store source ${l.slice(0,8)}\u2026 (${n.length} skill(s))${a}${k}?`});if(v.isCancel(h)||!h)return v.cancel("Cancelled."),1}existsSync(r)&&await rm(r,{recursive:true,force:true}),!d$1&&t.force&&await ia({type:o.type,url:o.url,subpath:o.subpath,ref:o.ref});let g=await S$1();if(g.markets[l]){delete g.markets[l];let{Filesystem:a}=await import('@easbot/utils');await a.writeJson(Filesystem.join(J(),"index.json"),g);}if(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$1,cacheCleared:!d$1&&t.force===true,skills:n.map(a=>a.skillName)},{sourceType:o.type,cacheCleared:!d$1&&t.force===true,count:n.length}));else {let a=`\u2713 Removed store source ${l.slice(0,8)}\u2026 (${n.length} skill(s))`;d$1?a+=x.dim(" [local: user directory preserved]"):t.force?a+=x.dim(" (+ cache cleared)"):a+=x.dim(" (cache preserved; use --force to clear)"),ee([],{emptyTitle:"Store remove",outro:`${x.green(a)}`});}return 0}function jl(){let e=(t,l,s)=>S(`cli.help.store.${t}`,{fallback:l,vars:s});console.log(`
|
|
16
|
+
${x.bold(x.cyan("skills store"))} - ${e("desc","Ops subcommands (store / cache management, store-centric)")}
|
|
17
|
+
|
|
18
|
+
${x.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.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.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.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.bold(e("examples_title","Examples:"))}
|
|
43
|
+
${x.dim("$")} skills store list
|
|
44
|
+
${x.dim("$")} skills store list eas-skill-find
|
|
45
|
+
${x.dim("$")} skills store list --json
|
|
46
|
+
${x.dim("$")} skills store clean
|
|
47
|
+
${x.dim("$")} skills store clean --force
|
|
48
|
+
${x.dim("$")} skills store update
|
|
49
|
+
${x.dim("$")} skills store update eas-skill-find
|
|
50
|
+
${x.dim("$")} skills store remove a1b2c3d4e5f67890
|
|
51
|
+
${x.dim("$")} skills store remove a1b2c3d4e5f67890 --force
|
|
52
|
+
${x.dim("$")} skills store clean -y --json
|
|
53
|
+
`);}var Bt=Log.create({service:"skills-find"}),Jo=process.env.SKILLS_API_URL||"https://skills.sh";function Pl(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 Vo=/^[a-z0-9](?:[a-z0-9-]{0,38})$/i;function Yo(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(!Vo.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 Rl(e,t){try{let l=new URLSearchParams({q:e,limit:"10"});t&&l.set("owner",t);let s=`${Jo}/api/search?${l.toString()}`,n=await fetch(s);return n.ok?(await n.json()).skills.map(r=>({name:b$4(r.name),slug:b$4(r.id),source:b$4(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 qo(e){let t=await W(),l=e?.toLowerCase().trim()??"",s=await S$1(),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 Xo(e,t){let l=[];try{for await(let o of 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=Zo(e,o),d=await y(r);if(!d)continue;let g=d.name;if(s&&!g.toLowerCase().includes(s))continue;let a=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 Zo(e,t){let l=process.platform==="win32"?"\\":"/",s=t.replaceAll("/",l);return e.endsWith("/")||e.endsWith("\\")?e+s:e+l+s}var Qo="\x1B[?25l",ei="\x1B[?25h",ti="\x1B[J",si=e=>`\x1B[${e}A`,li=e=>`\x1B[${e}G`;async function ni(e="",t){let l=[],s=0,n=e,o=false,r=null,d=0;process.stdin.isTTY&&process.stdin.setRawMode(true),Pt.emitKeypressEvents(process.stdin),process.stdin.resume(),process.stdout.write(Qo);function g(){d>0&&process.stdout.write(si(d)+li(1)),process.stdout.write(ti);let k=[],h=`${G}_${i}`;if(k.push(`${M}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}`:`${M}${p.name}${i}`,T=p.source?` ${c}${p.source}${i}`:"",P=Pl(p.installs),L=P?` ${je}${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 Rl(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(ei),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 oi(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 ii(e,t){return await c$1(e,t)===false}async function ri(e,t,l={}){let s=typeof l.path=="string"&&l.path.length>0,n=s?l.path:J(),o,r;if(s?(o=await Xo(n,e||void 0),r="scan"):(o=await qo(e||void 0),r="index"),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$1=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(`${je}${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$1} (${o.length})`,outro:"Run `skills add <source>` to install a discovered skill."}),0}let a=await S$1(),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} ${je}${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$1} (${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 Nl(e){let{query:t,options:l,errors:s}=Yo(e),n=l.owner,o=!process.stdin.isTTY;Bt.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 ri(t,l.json??false,l);if(t){Bt.debug("runFind enter query branch",{query:t,owner:n,json:l.json});let $=await Rl(t,n);if(Bt.debug("runFind searchSkillsAPI returned",{count:$.length}),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} ${M}easbot skills add <owner/repo@skill>${i}`),p.push("");for(let u of $.slice(0,6)){let m=u.source||u.slug,w=Pl(u.installs);p.push(`${M}${m}@${u.name}${i}${w?` ${je}${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 Nt())return console.log(r),console.log(),console.log(`${c}Usage: easbot skills find <query> [--owner <owner>]${i}`),0;let d$1=await ni("",n);if(d({event:"find",query:"",resultCount:d$1?"1":"0",interactive:"1"}),!d$1)return console.log(`${c}Search cancelled${i}`),console.log(),0;let g=d$1.source||d$1.slug,a=d$1.name;console.log(),console.log(`${M}Installing ${G}${a}${i} from ${c}${g}${i}...`),console.log();let{source:k,options:h}=Kt([g,"--skill",a]),C=0;try{await ht(k,h);}catch($){C=1,Bt.error("runAdd failed during find\u2192install",{err:$});}console.log();let A=oi(g);return A&&await ii(A.owner,A.repo)?console.log(`${c}View the skill at${i} ${M}https://skills.sh/${d$1.slug}${i}`):console.log(`${c}Discover more skills at${i} ${M}https://skills.sh${i}`),console.log(),C}function ks(e,t){let l=homedir();return e.startsWith(l)?e.replace(l,"~"):e.startsWith(t)?"."+e.slice(t.length):e}function $s(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 ci(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 pi(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":(e.all===true,"both")}async function Ol(e,t={}){let l=ci(e),s$1=t.cwd??process.cwd();l.all===true&&(!l.agent||l.agent.length===0)&&(l.agent=["*"]);let n=pi(l),o;if(l.agent&&l.agent.length>0){let m=p(l.agent);if(m.length>0){let w=Object.keys(b$1);console.log(`${it}Invalid agents: ${m.join(", ")}${i}`),console.log(`${c}Valid agents: ${w.join(", ")}${i}`),process.exit(1);}o=q(l.agent);}let r=await s({scope:n,agentFilter:o,cwd:s$1}),d=l.json?await W():[],g=l.json?await S$1():{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=>b$1[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 l$2(),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:`${`${it}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$1=Object.keys($).sort(),u=[];u.push("");for(let m of p$1){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=ks(y.canonicalPath,s$1),O=y.agents.map(N=>b$1[N].displayName),E=y.agents.length>0?$s(O):`${it}not linked${i}`;u.push(`${je}${b$4(y.name)}${i}${L} ${c}${I}${i} ${c}Agents:${i} ${E}`);}else {u.push(`${je}${b$4(m)}${i}${L}${f}`);for(let y of w){let I=ks(y.canonicalPath,s$1),O=y.agents.map(N=>b$1[N].displayName),E=y.agents.length>0?$s(O):`${it}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 Ul(e,t){let l=await ot(),s=t.yes||l.isAgent;if(l.isAgent&&v.log.info(Rt(l.agent.name)+" Agent detected \u2014 removing non-interactively"),t.global===void 0&&!s&&process.stdin.isTTY&&!l.isAgent){let f=await v.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.isCancel(f)&&(v.cancel("Removal cancelled"),process.exit(0)),t.global=f;}let n=t.global??false,o=process.cwd(),r=t.json===true,d$2=r?{start:()=>{},stop:()=>{},message:()=>{}}:v.spinner();r||d$2.start("Scanning for installed skills...");let{scanInstalledSkillDirs:g}=await import('./scan-WAXGJM5N.mjs'),a;if(t.agent&&t.agent.length>0){let f=q(t.agent),y=p(t.agent);y.length>0&&(console.log(`Invalid agents: ${y.join(", ")}`),console.log(`Valid agents: ${Object.keys(b$1).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$2.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=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=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.multiselect({message:`Select skills to remove ${x.dim("(space to toggle)")}`,options:f,required:true});v.isCancel(y)&&(v.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$1=new Set;for(let f of A){let y=$.get(f);if(y)for(let I of y)p$1.add(I);}let u=Array.from(p$1);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=>b$1[E]?.displayName??E),I=E=>E.length<=5?E.join(", "):`${E.slice(0,5).join(", ")} +${E.length-5} more`;console.log(),v.log.warn(x.yellow(`About to remove ${A.length} skill(s) from ${u.length} agent(s):`)),console.log(),console.log(` ${x.dim("Scope:")} ${f}`),console.log(` ${x.dim("Agents ("+u.length+"):")}`),console.log(` ${x.red("\u2022")} ${I(y)}`),console.log(` ${x.dim("Skills ("+A.length+"):")}`);for(let E of A)console.log(` ${x.red("\u2022")} ${E}`);console.log(),console.log(x.dim(" Each skill will be uninstalled from every targeted agent.")),console.log();let O=await v.confirm({message:"Continue? (y/N)"});(v.isCancel(O)||!O)&&(v.cancel("Removal cancelled"),process.exit(0));}d$2.start("Removing skills...");let m$1=[];for(let f$2 of A)try{let y=o$1(f$2,{global:n,cwd:o});for(let q of u){let H=b$1[q],pe=m(f$2,q,{global:n,cwd:o}),Se=new Set([pe]),$e=d$1(f$2);if(n&&H.globalSkillsDir)Se.add(join(H.globalSkillsDir,$e));else if(Se.add(join(o,H.skillsDir,$e)),q==="eve")for(let we of f(o))Se.add(join(f$1(we,o),$e));for(let we of Se)if(we!==y)try{await lstat(we).catch(()=>null)&&await rm(we,{recursive:!0,force:!0});}catch(De){v.log.warn(`Could not remove skill from ${H.displayName}: ${De instanceof Error?De.message:String(De)}`);}}let O=(await c$3()).filter(q=>!u.includes(q)),E=!1;for(let q of O){let H=m(f$2,q,{global:n,cwd:o});if(await lstat(H).catch(()=>null)){E=!0;break}}E||await rm(y,{recursive:!0,force:!0});let N=n?await k$1(f$2):null,U=await ui(f$2),Y=U?(await S$1()).markets[U.marketId]:void 0,J=Y?.url??N?.source??"local",ne=Y?.type??N?.sourceType??"local";n?await j$1(f$2):await w(f$2,o),m$1.push({skill:f$2,success:!0,source:J,sourceType:ne,...U?.marketId&&{sourceKey:U.marketId},...Y?.storePath&&{storePath:Y.storePath}});}catch(y){m$1.push({skill:f$2,success:false,error:y instanceof Error?y.message:String(y)});}d$2.stop("Removal process complete");let w$1=m$1.filter(f=>f.success),T=m$1.filter(f=>!f.success);if(w$1.length>0){let f=new Map;for(let y of w$1){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)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$1.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$1.length,removed:w$1.length,failed:T.length,agents:u}},{count:m$1.length,scope:n?"global":"project",removed:w$1.length,failed:T.length,agents:u.length}));return}let L=[];L.push(` ${x.dim(x.bold(P))}`);for(let f of w$1)L.push(` ${x.green("\u2713")} ${f.skill}`);if(w$1.length>0&&(L.push(""),L.push(`${x.green("\u2713")} Successfully removed ${w$1.length} skill(s)`)),T.length>0){L.push(""),L.push(`${x.red("\u2717")} Failed to remove ${T.length} skill(s)`);for(let f of T)L.push(` ${x.red("\u2717")} ${f.skill}: ${f.error}`);}ee(L,{title:`${P} Removal${w$1.length>0?` (${w$1.length} removed)`:""}`,outro:x.green("Done!")});}async function ui(e){return (await X(e))[0]}function Ml(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 hi(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 ki(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":("both")}function $i(e,t,l){let s=b$1[e];if(t){if(s.globalSkillsDir!==void 0)return s.globalSkillsDir;let n=a$2("os").homedir();return Filesystem.join(n,s.skillsDir)}return Filesystem.join(l,s.skillsDir)}async function Fl(e,t={}){let l=t.cwd??process.cwd(),s=hi(e),n=ki(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=i$3(p);for(let m of u){if(m==="eve"||r&&!r.has(m))continue;let w=p==="global";try{let T=$i(m,w,l);g.push({agent:m,isGlobal:w,baseDir:T});}catch{}}}let a=[];for(let p of g){let u;try{u=readdirSync(p.baseDir);}catch{continue}for(let m of u){if(m.startsWith("."))continue;let w=Filesystem.join(p.baseDir,m),T;try{T=lstatSync(w);}catch{continue}if(!T.isSymbolicLink())continue;let P;try{P=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([`${M}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(` ${M}${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=Filesystem.join(p.baseDir,p.name);try{unlinkSync(u);let m=p.isGlobal?"global":"project";k.push(` ${M}\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:`${M}Done!${i}`});}var Ii=new Set(["metadata.json"]),ji=new Set([".git","__pycache__","__pypackages__"]),Ss={"claude-code":{command:"claude",args:[]},codex:{command:"codex",args:[]}},Vl=Object.keys(Ss);function Yl(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(...Oi(l.agent)),{source:t,options:l,errors:s}}function Li(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 _i(e){let t=await mkdtemp(join(tmpdir(),"skills-use-")),l=join(t,d$1(e.directoryName||e.name));if(!ws(t,l))throw new Error("Invalid skill name: potential path traversal detected");await mkdir(l,{recursive:true}),e.kind==="blob"?await Ei(l,e.files):e.kind==="well-known"?await Di(l,e.files):await tn(e.path,l);let s=e.rawContent??await readFile(join(l,"SKILL.md"),"utf-8"),n=await sn(l,l);return {tempRoot:t,skillDir:l,skillMd:s,hasSupportingFiles:n}}async function ql(e$1,t={},l=[]){let s=null;try{if(t.help){console.log(Wl());return}l.length>0&&Ee(l.join(`
|
|
67
|
+
`)),e$1.length===0&&Ee(`Missing required argument: source
|
|
68
|
+
|
|
69
|
+
${Wl()}`),e$1.length>1&&Ee(`Expected one source, received ${e$1.length}: ${e$1.join(", ")}`);let n=t.agent?.[0];n&&!Ss[n]&&Ee(Ql(n));let o=e$1[0],r=e(o);a$1(r)?.split("/")[0]?.toLowerCase()==="openclaw"&&!t.dangerouslyAcceptOpenclawRisks&&Ee(["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 n$1.fetchAllSkills(r.url);h=Ni($,a,o);}else {let $,p=null;if(r.type==="local")existsSync(r.localPath)||Ee(`Local path does not exist: ${r.localPath}`),$=await A(r.localPath,r.subpath,{includeInternal:k,fullDepth:t.fullDepth});else if(r.type==="github"&&!t.fullDepth){let m=a$1(r),w=m?.split("/")[0]?.toLowerCase();m&&w&&d$2.includes(w)&&(p=await l$3(m,{subpath:r.subpath,ref:r.ref,getToken:g$2,includeInternal:k})),p?$=p.skills:(s=await k$2(r.url,r.ref),$=await A(s,r.subpath,{includeInternal:k,fullDepth:t.fullDepth}));}else s=await k$2(r.url,r.ref),$=await A(s,r.subpath,{includeInternal:k,fullDepth:t.fullDepth});let u=Ri($,a,o);p&&Ui(u)?h={kind:"blob",name:u.name,directoryName:u.name,rawContent:u.rawContent??Mi(u.files),files:u.files}:h={kind:"disk",name:u.name,directoryName:u.name,rawContent:u.rawContent,path:u.path};}let C=await _i(h);await Bl(s),s=null;let A$1=Li({skillMd:C.skillMd,supportDir:C.skillDir,hasSupportingFiles:C.hasSupportingFiles});if(t.json&&!n){Q(Z({skill:h.name,source:e$1[0],agent:n??null,tempRoot:C.tempRoot,skillDir:C.skillDir,prompt:A$1},{kind:h.kind}));return}if(n){let $=await Ci(n,A$1);$!==0&&process.exit($);return}process.stdout.write(A$1);}catch(n){await Bl(s),n instanceof g$1&&Ee(n.message),n instanceof Te&&Ee(n.message),Ee(n instanceof Error?n.message:"Unknown error");}}async function Ci(e,t,l=Pi){let s=Ss[e];if(!s)throw new Te(Ql(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 Te(`Could not launch ${b$1[e].displayName}: command not found: ${s.command}`));return}o(g);}}),r.on("close",g=>{d||(d=true,n(g??1));});})}function Pi(e,t){return spawn(e,t,{stdio:"inherit"})}function Wl(){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 (${Vl.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 Ri(e,t,l){if(e.length===0)throw new Te("No valid skills found. Skills require a SKILL.md with name and description.");if(!t){if(e.length===1)return e[0];throw new Te(Xl(l,e.map(B)))}let s=C(e,[t]);if(s.length===0)throw new Te(Zl(t,e.map(B)));if(s.length>1)throw new Te(`Skill selector "${t}" matched multiple skills.`);return s[0]}function Ni(e,t,l){if(e.length===0)throw new Te("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 Te(Zl(t,e.map(o=>o.installName)));if(s.length>1)throw new Te(`Skill selector "${t}" matched multiple skills.`)}else {if(e.length!==1)throw new Te(Xl(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 Xl(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 Zl(e,t){return [`No matching skill found for: ${e}`,"Available skills:",...t.map(l=>` - ${l}`)].join(`
|
|
89
|
+
`)}function Oi(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=p(e);if(l.length>0){let s=Object.keys(b$1);t.push(`Invalid agents: ${l.join(", ")}
|
|
90
|
+
Valid agents: ${s.join(", ")}`);}return t}function Ql(e){return [`Running ${b$1[e].displayName} is not supported yet.`,`Supported agents for skills use --agent: ${Vl.join(", ")}`].join(`
|
|
91
|
+
`)}async function Ei(e,t){for(let l of t)await en(e,l.path,l.contents);}async function Di(e,t){for(let[l,s]of t)await en(e,l,s);}async function en(e,t,l){let s=join(e,t);ws(e,s)&&(await mkdir(dirname(s),{recursive:true}),typeof l=="string"?await writeFile(s,l,"utf-8"):await writeFile(s,l));}async function tn(e,t){await mkdir(t,{recursive:true});let l=await readdir(e,{withFileTypes:true});await Promise.all(l.filter(s=>!Fi(s.name,s.isDirectory())).map(async s=>{let n=join(e,s.name),o=join(t,s.name);if(ws(t,o)){if(s.isDirectory()){await tn(n,o);return}try{await 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 sn(e,t){let l=await readdir(t,{withFileTypes:true});for(let s of l){let n=join(t,s.name),o=relative(e,n).split(sep).join("/");if(s.isDirectory()){if(await sn(e,n))return true}else if(o.toLowerCase()!=="skill.md")return true}return false}function Ui(e){return Array.isArray(e.files)}function Mi(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 Ii.has(e)||t&&ji.has(e)}function ws(e,t){let l=normalize(resolve(e)),s=normalize(resolve(t));return s.startsWith(l+sep)||s===l}async function Bl(e){e&&await l$1(e).catch(()=>{});}function Ee(e){console.error(e),process.exit(1);}var Te=class extends Error{};var Gi={"zh-CN":loadTextFile("./template/skill-template-zh-CN.txt",import.meta.url),"en-US":loadTextFile("./template/skill-template-en-US.txt",import.meta.url)};function Hi(e){return e.split(/[-_\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Wi(e){return Gi[e]()}var Bi=/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;function nn(e,t){let l=formatLocalISO(new Date,false).slice(0,10),s={skill_name:t,skill_title:Hi(t),version:"1.0.0",date:l};return Wi(e).replace(Bi,(o,r)=>Object.hasOwn(s,r)?s[r]:o)}function Xi(e){return e&&Sl(e),e??"0.0.0"}function pt(e){return resolveLocaleLang(e?.locale)}function Zi(e){let t=pt(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} ${M}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} ${M}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} ${M}easbot-skills remove${i} ${c}${S("cli.example.remove_interactive",{locale:t,fallback:"Remove installed skills"})}${i}`),console.log(` ${c}$${i} ${M}easbot-skills list${i} ${c}${S("cli.example.list_project",{locale:t,fallback:"List installed skills"})}${i}`),console.log(` ${c}$${i} ${M}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} ${M}easbot-skills update${i} ${c}${S("cli.example.update_global",{locale:t,fallback:"Update installed skills"})}${i}`),console.log(),console.log(` ${c}$${i} ${M}easbot-skills doctor${i} ${c}${S("cli.commands.doctor",{locale:t,fallback:"Check + cleanup broken links & more"})}${i}`),console.log(),console.log(` ${c}$${i} ${M}easbot-skills init ${c}[name]${i} ${c}${S("cli.example.init",{locale:t,fallback:"Create a new skill"})}${i}`),console.log(` ${c}$${i} ${M}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 Gp(e){let t=pt(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 Qi(e){let t=pt(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 er(e){let t=pt(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 vs(){console.log();}function tr(e,t){let l=pt(t),s=t?.cwd??p$2()??process.cwd(),n=e[0]||basename(s),o=e[0]!==void 0,r=e.includes("--json"),d=o?join(s,n):s,g=join(d,"SKILL.md"),a=o?`${n}/SKILL.md`:"SKILL.md";if(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(`${M}${S("cli.init.exists",{locale:l,vars:{path:a},fallback:`Skill already exists at ${a}`})}${i}`),0);o&&mkdirSync(d,{recursive:true});let k=nn(l,n);if(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(`${M}${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 Hp(e,t){Xi(t?.version);let l=t?.inAgent??await Nt();if(e.length===0)return l||Zi(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||vs(),console.log(),{code:await Nl(n),handled:true,command:s};case "init":return l||vs(),console.log(),{code:tr(n,t),handled:true,command:s};case "a":case "add":{l||vs();let{source:o,options:r}=Kt(n);return await ht(o,r),{code:0,handled:true,command:s}}case "use":{let{source:o,options:r,errors:d}=Yl(n);return await ql(o,r,d),{code:0,handled:true,command:s}}case "remove":case "rm":case "r":{if(n.includes("--help")||n.includes("-h"))return er(t),{code:0,handled:true,command:s};let{skills:o,options:r}=Ml(n);return await Ul(o,r),{code:0,handled:true,command:s}}case "list":case "ls":return await Ol(n,{cwd:t?.cwd}),{code:0,handled:true,command:s};case "doctor":case "dr":return n.includes("--help")||n.includes("-h")?(Qi(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 ml(n,{cwd:t?.cwd}),{code:0,handled:true,command:s};case "store":return {code:await Ll(n),handled:true,command:s};default:{let o=pt(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
|
+
export{ci as A,Ol as B,Ul as C,Ml as D,Fl as E,Yl as F,Li as G,_i as H,ql as I,Ci as J,Zi as K,Gp as L,Hp as M,os as a,Qs as b,el as c,tl as d,rs as e,ot as f,Nt as g,_r as h,ol as i,qn as j,da as k,Xn as l,dl as m,ml as n,Sl as o,ht as p,Kt as q,No as r,Ll as s,Eo as t,Uo as u,Ko as v,Ho as w,Yo as x,Rl as y,Nl as z};
|