@easbot/skills 0.3.12 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +433 -126
- package/README.md +428 -126
- package/dist/chunks/blob-SCUVTYVE.cjs +1 -0
- package/dist/chunks/blob-WZAGX4RO.mjs +1 -0
- package/dist/chunks/chunk-2E6BHPFV.cjs +265 -0
- package/dist/chunks/chunk-5BDDXFOF.mjs +1 -0
- package/dist/chunks/chunk-5RWSXDNO.cjs +3 -0
- package/dist/chunks/chunk-6NTEYECA.mjs +22 -0
- package/dist/chunks/chunk-AQYRRXU5.mjs +5 -0
- package/dist/chunks/{chunk-2VZUPTI7.cjs → chunk-DFBKA5A6.cjs} +1 -1
- package/dist/chunks/chunk-DNE3XPCJ.cjs +2 -0
- package/dist/chunks/chunk-E7AHWFZN.cjs +2 -0
- package/dist/chunks/chunk-ISMGLHYS.cjs +1 -0
- package/dist/chunks/chunk-J6PRUXFG.mjs +265 -0
- package/dist/chunks/chunk-JCOXRETY.cjs +22 -0
- package/dist/chunks/chunk-ML6B4IQL.mjs +1 -0
- package/dist/chunks/chunk-NH4TYEPW.mjs +3 -0
- package/dist/chunks/{chunk-S6YNGR7S.cjs → chunk-Q2MOP5ZW.cjs} +2 -2
- package/dist/chunks/{chunk-OWG6N2K6.cjs → chunk-UGHF4GOW.cjs} +2 -2
- package/dist/chunks/chunk-ZJS7IO5V.mjs +2 -0
- package/dist/chunks/chunk-ZYDDQV73.mjs +2 -0
- package/dist/chunks/cli-handler-3FSM4C7L.mjs +1 -0
- package/dist/chunks/cli-handler-B6H4RZEM.cjs +1 -0
- package/dist/chunks/{installer-FB26E7JZ.mjs → installer-NJN3PT5F.mjs} +1 -1
- package/dist/chunks/installer-YDJBZTQ7.cjs +1 -0
- package/dist/chunks/{interfaces-UIS44Q7A.cjs → interfaces-5BH4K5TM.cjs} +1 -1
- package/dist/chunks/local-lock-SPZB3AB7.cjs +1 -0
- package/dist/chunks/local-lock-ZHTDWYXF.mjs +1 -0
- package/dist/chunks/scan-6W47D2KJ.mjs +1 -0
- package/dist/chunks/scan-L6UNVP3V.cjs +1 -0
- package/dist/chunks/skill-lock-MNRZ7TIX.mjs +1 -0
- package/dist/chunks/skill-lock-VX2HGPTY.cjs +1 -0
- package/dist/chunks/store-TSS4BMBF.cjs +1 -0
- package/dist/chunks/store-UJPPYDBG.mjs +1 -0
- package/dist/chunks/telemetry-B4PS27S5.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 +53 -9
- package/dist/index.d.ts +53 -9
- package/dist/index.mjs +1 -1
- package/package.json +5 -7
- package/dist/chunks/blob-DOVEGVIE.cjs +0 -1
- package/dist/chunks/blob-JSMTOYEN.mjs +0 -1
- package/dist/chunks/chunk-2YVJ7YP6.mjs +0 -22
- package/dist/chunks/chunk-4R6NKPNW.mjs +0 -3
- package/dist/chunks/chunk-676OG55M.mjs +0 -5
- package/dist/chunks/chunk-6PJ3YQA7.mjs +0 -2
- package/dist/chunks/chunk-72DXY4B7.mjs +0 -1
- package/dist/chunks/chunk-GR2NJUJ6.mjs +0 -255
- package/dist/chunks/chunk-JFEBB5CL.cjs +0 -22
- package/dist/chunks/chunk-KV7EP6AW.cjs +0 -255
- package/dist/chunks/chunk-RWSBKHQ2.cjs +0 -3
- package/dist/chunks/chunk-TCFGU43L.cjs +0 -2
- package/dist/chunks/cli-handler-RAJ42VDN.mjs +0 -1
- package/dist/chunks/cli-handler-YAJ5J5VA.cjs +0 -1
- package/dist/chunks/installer-GOQTCUJ4.cjs +0 -1
- package/dist/chunks/local-lock-4AA55ORE.cjs +0 -1
- package/dist/chunks/local-lock-LG5YL33V.mjs +0 -1
- package/dist/chunks/scan-QEVID2TF.mjs +0 -1
- package/dist/chunks/scan-XWU3FCE3.cjs +0 -1
- package/dist/chunks/skill-lock-KHPVP7AD.mjs +0 -1
- package/dist/chunks/skill-lock-LET33FVT.cjs +0 -1
- package/dist/chunks/store-3NRBE47N.mjs +0 -1
- package/dist/chunks/store-EHYH46YY.cjs +0 -1
- package/dist/chunks/telemetry-LCGTSJDM.cjs +0 -1
- /package/dist/chunks/{chunk-VRHWDHQV.cjs → chunk-GWUDKZEH.cjs} +0 -0
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import {b,a,d,c as c$2}from'./chunk-CFMOYU7R.mjs';import {i as i$3,n,p,l as l$2,k as k$1,j as j$1,g as g$2,c as c$3,d as d$2}from'./chunk-4R6NKPNW.mjs';import {a as a$3}from'./chunk-72DXY4B7.mjs';import {i as i$1,j,g,l,o,e as e$2,d as d$1,k,s as s$1,m,f as f$1,h}from'./chunk-676OG55M.mjs';import {z,e,a as a$1,b as b$1,c as c$1,ea,S,C,F as F$1,D,t as t$1,v,M as M$1,w,g as g$1,ha,l as l$1,T,X,K,O,ka,ja,E,x,Y,n as n$1,B,k as k$2,R,N,Z}from'./chunk-2YVJ7YP6.mjs';import {i as i$2,e as e$1,s,t,f,r,b as b$2,l as l$3,x as x$1,D as D$1,k as k$3,a as a$4}from'./chunk-6PJ3YQA7.mjs';import {p as p$1}from'./chunk-RWZ4LFSN.mjs';import {a as a$2}from'./chunk-WQGSYA5D.mjs';import {existsSync,readdirSync,lstatSync,realpathSync,unlinkSync,mkdirSync,writeFileSync}from'fs';import {dirname,join,basename,sep,relative,normalize,resolve}from'path';import*as I from'@clack/prompts';import L from'picocolors';import {tmpdir,homedir}from'os';import {Log,loadTextFile,Filesystem,resolveLocaleLang,Grep,formatLocalISO}from'@easbot/utils';import*as xt 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 {determineAgent}from'@vercel/detect-agent';import {fileURLToPath}from'url';import {spawn}from'child_process';var en=new Writable({write(e,t,s){s();}}),tn=L.green("\u25C6"),ln=L.red("\u25A0"),sn=L.green("\u25C7"),nn=L.green("\u25CF"),on=L.dim("\u25CB");L.green("\u2713");var rn=L.green("\u2022"),ce=L.dim("\u2502"),ze=L.dim("\u2500"),an=Symbol("cancel");function cn(e){let t=0;for(let s of e){let l=s.codePointAt(0);if(l===0)continue;let n=l>=4352&&l<=4447||l>=8986&&l<=8987||l>=9001&&l<=9002||l>=9193&&l<=9196||l===9200||l===9203||l>=9725&&l<=9726||l>=9748&&l<=9749||l>=9800&&l<=9811||l>=9855&&l<=9855||l>=9875&&l<=9875||l>=9889&&l<=9889||l>=9898&&l<=9899||l>=9917&&l<=9918||l>=9924&&l<=9925||l>=9934&&l<=9934||l>=9940&&l<=9940||l>=9962&&l<=9962||l>=9970&&l<=9971||l>=9973&&l<=9973||l>=9978&&l<=9978||l>=9981&&l<=9981||l>=9989&&l<=9989||l>=9994&&l<=9995||l>=10024&&l<=10024||l>=10060&&l<=10060||l>=10062&&l<=10062||l>=10067&&l<=10069||l>=10071&&l<=10071||l>=10133&&l<=10135||l>=10160&&l<=10160||l>=10175&&l<=10175||l>=11035&&l<=11036||l>=11088&&l<=11088||l>=11093&&l<=11093||l>=11904&&l<=42191&&l!==12351||l>=43360&&l<=43388||l>=44032&&l<=55203||l>=63744&&l<=64255||l>=65040&&l<=65049||l>=65072&&l<=65135||l>=65280&&l<=65376||l>=65504&&l<=65510||l>=126976&&l<=129535;t+=n?2:1;}return t}function pn(e,t){let s=stripVTControlCharacters(e),l=Math.max(1,t),n=cn(s);return Math.max(1,Math.ceil(n/l))}function un(e,t){let s=t!==void 0&&t>0?t:process.stdout.columns&&process.stdout.columns>0?process.stdout.columns:80;return e.reduce((l,n)=>l+pn(n,s),0)}async function Xt(e){let{message:t,items:s,maxVisible:l=8,initialSelected:n=[],required:o=false,lockedSection:r}=e;return new Promise(g=>{let d=xt.createInterface({input:process.stdin,output:en,terminal:false});process.stdin.isTTY&&process.stdin.setRawMode(true),xt.emitKeypressEvents(process.stdin,d);let u="",k=0,$=new Set(n),b=0,A=r?r.items.map(T=>T.value):[],p=(T,x)=>{if(!x)return true;let C=x.toLowerCase();return T.label.toLowerCase().includes(C)||String(T.value).toLowerCase().includes(C)},a=()=>s.filter(T=>p(T,u)),f=()=>{if(b>0){process.stdout.write(`\x1B[${b}A`);for(let T=0;T<b;T++)process.stdout.write("\x1B[2K\x1B[1B");process.stdout.write(`\x1B[${b}A`);}},S=(T="active")=>{f();let x=[],C=a(),B=T==="active"?tn:T==="cancel"?ln:sn;if(x.push(`${B} ${L.bold(t)}`),T==="active"){if(r&&r.items.length>0){x.push(`${ce}`);let J=`${L.bold(r.title)} ${L.dim("\u2500\u2500 always included")}`;x.push(`${ce} ${ze}${ze} ${J} ${ze.repeat(12)}`);for(let te of r.items)x.push(`${ce} ${rn} ${L.bold(te.label)}`);r.hiddenCount&&r.hiddenCount>0&&x.push(`${ce} ${L.dim(`...and ${r.hiddenCount} more`)}`),x.push(`${ce}`),x.push(`${ce} ${ze}${ze} ${L.bold("Additional agents")} ${ze.repeat(29)}`);}let U=`${ce} ${L.dim("Search:")} ${u}${L.inverse(" ")}`;x.push(U),x.push(`${ce} ${L.dim("\u2191\u2193 move, space select, enter confirm")}`),x.push(`${ce}`);let R=Math.max(0,Math.min(k-Math.floor(l/2),C.length-l)),z=Math.min(C.length,R+l),W=C.slice(R,z);if(C.length===0)x.push(`${ce} ${L.dim("No matches found")}`);else {for(let X=0;X<W.length;X++){let re=W[X],ae=R+X,ve=$.has(re.value),tt=ae===k,ct=ve?nn:on,lt=tt?L.underline(re.label):re.label,Dt=re.hint?L.dim(` (${re.hint})`):"",Ae=tt?L.cyan("\u276F"):" ";x.push(`${ce} ${Ae} ${ct} ${lt}${Dt}`);}let J=R,te=C.length-z;if(J>0||te>0){let X=[];J>0&&X.push(`\u2191 ${J} more`),te>0&&X.push(`\u2193 ${te} more`),x.push(`${ce} ${L.dim(X.join(" "))}`);}}x.push(`${ce}`);let O=[];for(let J of s)$.has(J.value)&&O.push(J.label);if(O.length===0)x.push(`${ce} ${L.dim("Selected: (none \u2014 only locked universal)")}`);else {let J=O.length<=3?O.join(", "):`${O.slice(0,3).join(", ")} +${O.length-3} more`;x.push(`${ce} ${L.green("Selected:")} ${J}`);}x.push(`${L.dim("\u2514")}`);}else if(T==="submit"){let U=s.filter(z=>$.has(z.value)).map(z=>z.label),R=U.length===0?"(none \u2014 only locked universal)":U.join(", ");x.push(`${ce} ${L.dim(R)}`);}else T==="cancel"&&x.push(`${ce} ${L.strikethrough(L.dim("Cancelled"))}`);process.stdout.write(x.join(`
|
|
2
|
-
`)+`
|
|
3
|
-
`),b=un(x,process.stdout.columns);},v=()=>{process.stdin.removeListener("keypress",w),process.stdin.isTTY&&process.stdin.setRawMode(false),d.close();},P=()=>{if(o&&$.size===0&&A.length===0)return;S("submit"),v();let T=new Set(A),x=[...A];for(let C of $)T.has(C)||(T.add(C),x.push(C));g(x);},m=()=>{S("cancel"),v(),g(an);},w=(T,x)=>{if(!x)return;let C=a();if(x.name==="return"){P();return}if(x.name==="escape"||x.ctrl&&x.name==="c"){m();return}if(x.name==="up"){k=Math.max(0,k-1),S();return}if(x.name==="down"){k=Math.min(C.length-1,k+1),S();return}if(x.name==="space"){let B=C[k];B&&($.has(B.value)?$.delete(B.value):$.add(B.value)),S();return}if(x.name==="backspace"){u=u.slice(0,-1),k=0,S();return}if(x.sequence&&!x.ctrl&&!x.meta&&x.sequence.length===1){u+=x.sequence,k=0,S();return}};process.stdin.on("keypress",w),S();})}async function Gl(e){let t=createHash("sha256");try{let s=await readFile(join(e,"SKILL.md"),"utf-8");t.update("SKILL.md"),t.update(s);}catch{t.update("EMPTY");}return t.digest("hex")}async function Qt(e,t){let s;try{s=await lstat(e);}catch{return "absent"}if(s.isSymbolicLink())try{let g=Filesystem.toUnixPath(await realpath(e)),d=Filesystem.toUnixPath(await realpath(t));return g===d?"symlinked":"orphan"}catch{return "orphan"}let l=join(e,"SKILL.md");try{await access(l);}catch{return "absent"}if(!await z(l))return "divergent";let o=await Gl(e),r=await Gl(t);return o===r?"copied":"divergent"}function Wl(e,t){let s=[];for(let l of e)for(let n of ["global","project"]){let o=l.cells[n];o.state==="absent"?s.push({kind:"install",agentId:l.agentId,scope:n,mode:t,targetPath:o.targetPath}):o.state==="symlinked"||o.state==="copied"?s.push({kind:"skip",agentId:l.agentId,scope:n,state:o.state}):s.push({kind:"report",agentId:l.agentId,scope:n,state:o.state});}return s}async function Hl(e,t){let s=[],l=[];for(let n of e)if(n.kind!=="skip"){if(n.kind==="report"){l.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,s.push(n)):l.push({kind:"report",agentId:n.agentId,scope:n.scope,state:"divergent"});}catch{l.push({kind:"report",agentId:n.agentId,scope:n.scope,state:"divergent"});}}return {installed:s,reported:l}}function zl(e,t){let s=[];for(let l of e)if(l==="eve"&&t.includeEveSubagents!==false){let n=i$2(t.cwd);if(n.length===0)s.push($n(t));else for(let o of n)s.push({agentId:l,cells:{global:qe("global",l,true,t,o),project:qe("project",l,false,t,o)}});}else s.push({agentId:l,cells:{global:qe("global",l,true,t),project:qe("project",l,false,t)}});return s}function qe(e,t,s,l,n){return {scope:e,state:"absent",targetPath:join(g(t,s,l.cwd,n),l.skillId),sourceDir:l.sourceDir}}function $n(e){return {agentId:"eve",cells:{global:qe("global","eve",true,e),project:qe("project","eve",false,e)}}}async function tl(e){let t=e.cwd??process.cwd(),s=Filesystem.toUnixPath(e.sourceDir),l=e.includeEveSubagents??true;if(e.assumeYes)return {skipped:true,installed:[],reported:[]};let n=zl(e.targetAgents,{skillId:e.skillId,sourceDir:s,cwd:t,includeEveSubagents:l}),o=[];for(let u of n){let k={...u.cells.global,state:await Qt(u.cells.global.targetPath,s)},$={...u.cells.project,state:await Qt(u.cells.project.targetPath,s)};o.push({agentId:u.agentId,cells:{global:k,project:$}});}let r=Wl(o,e.defaultMode),{installed:g,reported:d}=await Hl(r,{sourceDir:s,installGlobally:e.installGlobally,cwd:t});return {skipped:false,installed:g,reported:d,matrix:o}}function At(e){return L.bgCyan(L.black(L.bold(` ${e} `)))}var Ye=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 Je(){return Ye||(Ye=await determineAgent(),Ye.isAgent&&a(Ye.agent.name),Ye)}async function Tt(){return (await Je()).isAgent}async function Qi(){let e=await Je();return e.isAgent?e.agent.name:null}function ql(e){return bn[e]??null}function sl(e,t){return t?`${e}#${t}`:e}var i="\x1B[0m",F="\x1B[1m",c="\x1B[38;5;102m",M="\x1B[38;5;145m",ke="\x1B[36m";var ot="\x1B[33m";dirname(fileURLToPath(import.meta.url));var Vl=Number(process.env.SKILLS_UPDATE_TIMEOUT??6e4);async function Xl(e,t,s){let l=null,n=new Promise((o,r)=>{l=setTimeout(()=>r(new Error(`${s} timed out after ${t}ms`)),t);});try{return await Promise.race([e,n])}finally{l&&clearTimeout(l);}}function Zl(e,t){if(!e)return [];let l=e.message.includes("timed out")?"Fetch timeout":"Source unreachable";return t.map(({name:n,entry:o})=>({name:n,reason:l,sourceUrl:o.source,sourceType:o.sourceType,ref:o.ref}))}async function Ql(e){try{return await v(e)}catch{return}}async function es(e,t,s,l){let{rm:n,readdir:o,stat:r}=await import('fs/promises'),{createHash:g}=await import('crypto'),{Filesystem:d}=await import('@easbot/utils'),{deriveSourceKey:u,getStoreDir:k,writeStoreDefinitionsBatch:$,findSkillByLocation:b}=await import('./store-3NRBE47N.mjs'),A=u(e),p=k(e),a=d.join(d.normalize(t),s),f=d.join(p,s);if(!await d.exists(a))return {ok:false};let S=async T=>{let x=[],C=async U=>{try{let z=[...await o(U,{withFileTypes:!0})].sort((O,J)=>O.name.localeCompare(J.name)),W=await Promise.all(z.map(async O=>{let J=d.join(U,O.name);try{let te=await r(J);return `${J.slice(d.normalize(T).length+1).split(/[\\/]/).join("/")}|${te.size}|${O.isDirectory()?"d":"f"}|${(te.mode&511).toString(8)}`}catch{return `${O.name}|?|?|?`}}));for(let O of W)x.push(O);for(let O of z)if(O.isDirectory()&&!await C(d.join(U,O.name)))return !1;return !0}catch{return false}};if(await C(d.normalize(T)))return x.sort(),g("sha256").update(x.join(`
|
|
4
|
-
`)).digest("hex")},v=await S(a),P=await S(f);if(v&&P&&v===P){let x=(await b(A,vn(e,s),l))?.entry.computedHash;if(x)return {ok:true,hash:x,skipped:true}}try{await n(f,{recursive:!0,force:!0}),await d.cp(a,f);}catch{return {ok:false}}let m=await Ql(f);if(!m)return {ok:false};let w=e.type==="local"?e.localPath??e.url:d.normalize(t);try{await $([{skillName:l,parsed:e,sourceKey:A,sourcePath:w,storePath:p,skillPath:s,computedHash:m}]);}catch{}return {ok:true,hash:m}}function vn(e,t){return (e.subpath??t.split("/")[0]??"default").split("/")[0]||"default"}function jt(e,t,s){return e||!t||!s?true:t!==s}function xn(e,t={}){let s={};t.cwd&&(s.cwd=t.cwd);let l=[];for(let n=0;n<e.length;n++){let o=e[n];if(o==="-g"||o==="--global")s.global=true;else if(o==="-p"||o==="--project")s.project=true;else if(o==="-y"||o==="--yes")s.yes=true;else if(o==="--all")s.all=true;else if(o==="--force")s.force=true;else if(o==="-a"||o==="--agent")for(s.agent=s.agent??[];n+1<e.length&&!e[n+1].startsWith("-");)s.agent.push(e[++n]);else o&&!o.startsWith("-")&&l.push(o);}return l.length>0&&(s.skills=l),s}function Cr(e){let t=e||process.cwd();return existsSync(join(t,"skills-lock.json"))}async function An(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 I.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 I.isCancel(t)&&(I.cancel("Cancelled"),process.exit(0)),t}function ts(e,t){if(!t||t.length===0)return true;let s=e.toLowerCase();return t.some(l=>{let n=l.toLowerCase();return n==="*"?true:n===s})}function Tn(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 In(e){let t=e.sourceUrl;if(e.sourceType==="well-known"){let s=t.indexOf("/.well-known/");s!==-1&&(t=t.slice(0,s));}return sl(t,e.ref)}function It(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 s of e){let l=In(s),n=t.get(l)||[];n.push(s),t.set(l,n);}for(let[s,l]of t){if(l.length===1){let n=l[0];console.log(` ${M}\u2022${i} ${b$2(n.name)} ${c}(${n.reason})${i}`);}else {let n=l[0].reason,o=l.map(r=>b$2(r.name)).join(", ");console.log(` ${M}\u2022${i} ${o} ${c}(${n})${i}`);}console.log(` ${c}To update: ${M}easbot skills add ${s} -g -y${i}`);}}async function ls(e){let t$1={skills:[],refreshedSkillCount:0,upToDateSkillCount:0,failedSkillCount:0},s=new Map,l=(a,f)=>{let S=`${f}::${a}`,v=s.get(S);return v||(v={skillName:a,scope:f,sharedAgents:[],copiedAgents:[],linkedAgents:[],upToDateAgents:[],deadLinkAgents:[],failed:[],ok:true,failedCount:0},s.set(S,v),t$1.skills.push(v)),v},n=e.scope??"both",o=t(e.agentFilter??[]),r$1=o.length>0?o:void 0,d=(await a$3({scope:n,cwd:e.cwd,agentFilter:r$1})).map(a=>({name:a.name,description:"",path:a.skillDir,canonicalPath:a.skillDir,scope:a.scope,agents:[...a.agents]})),u=e.skillNames??[];if(!(u.length===1&&u[0]==="*")){let a=new Set(u.map(f=>f.toLowerCase()));d=d.filter(f=>a.has(f.name.toLowerCase()));}let{readLocalLock:k}=await import('./local-lock-LG5YL33V.mjs'),{readSkillLock:$}=await import('./skill-lock-KHPVP7AD.mjs'),b=await k(),A=await $();for(let a of d){let f=a.scope==="global"?A.skills[a.name]:b.skills[a.name];if(!f?.marketId||!f.pluginId)continue;let S=await Z(f.marketId,f.pluginId,a.name);if(!S)continue;let{readStoreIndex:v}=await import('./store-3NRBE47N.mjs'),m=(await v()).markets[S.marketId];if(!m)continue;let T=`${m.storePath.replace(/\\/g,"/").replace(/\/+$/,"")}/${S.entry.skillPath}`.replace(/\\/g,"/");a.path=T,a.canonicalPath=T;}let p=new Map;for(let a of d){let f=`${a.scope}::${a.name}::${a.path}`;p.set(f,a);}for(let a of u){if(a==="*")continue;let f=a.replace(/\.+$/,""),S=u.indexOf(a),P=e.skillStorePaths?.[S]?.split(/[\\/]/).filter(Boolean).pop();if(P){for(let[m,w]of p)if(m.startsWith(`${w.scope}::`)&&m.endsWith(`::${P}`)){let T=`${w.scope}::${f}::${w.path}`;p.has(T)||p.set(T,w);break}}}if(p.size===0)return t$1;for(let[a,f]of p){let v=a.split("::")[1].replace(/\.+$/,""),P=f.path,m=l(v,f.scope),T=existsSync(P)?await z(`${P}/SKILL.md`.replace(/\\/g,"/")):void 0;if(!T){if(!await Ln(v,f.scope==="global"))continue;for(let B of f.agents)m.failed.push({agent:B,reason:"store source missing \u2014 run `easbot skills add <source>` to rebuild"}),m.failedCount++,m.ok=false;continue}let x=T;for(let C of f.agents){let B=r(C,f.scope),R=await h(x,C,{global:f.scope==="global",mode:"symlink",cwd:e.cwd});if(!R.success){m.failed.push({agent:C,reason:R.error??"install failed"}),m.failedCount++,m.ok=false;continue}R.skippedReason==="up-to-date"?m.upToDateAgents.push(C):B?m.sharedAgents.push(C):m.copiedAgents.push(C);}}for(let a of t$1.skills){let f=a.failedCount>0,S=a.sharedAgents.length+a.copiedAgents.length+a.linkedAgents.length>0,v=a.upToDateAgents.length+a.deadLinkAgents.length>0||S;f?t$1.failedSkillCount++:S?t$1.refreshedSkillCount++:v&&t$1.upToDateSkillCount++;}return t$1}async function Ln(e,t){return t?(await c$3()).skills[e]:(await t$1()).skills[e]}function ss(e){if(e.skills.length===0)return;let t=u=>{let k=u.map($=>e$1[$]?.displayName??$);return k.length<=5?k.join(", "):`${k.slice(0,5).join(", ")} +${k.length-5} more`},s=e.skills.some(u=>u.sharedAgents.length>0),l=new Set;for(let u of e.skills){for(let k of u.sharedAgents)l.add(k);for(let k of u.copiedAgents)l.add(k);for(let k of u.linkedAgents)l.add(k);for(let k of u.upToDateAgents)l.add(k);}let n=new Set;for(let u of l){let k=false;for(let $ of e.skills)if($.sharedAgents.includes(u)){k=true;break}k||n.add(u);}let o=[];s&&o.push("Universal");for(let u of n)o.push(e$1[u]?.displayName??u);let r=o.slice(1).sort(),g=o.length>0&&o[0]==="Universal"?["Universal",...r]:r;g.length>0&&console.log(`${M}Updating for: ${g.join(", ")}${i}`);let d=["global","project"];for(let u of d){let k=e.skills.filter(b=>b.scope===u);if(k.length===0)continue;console.log(`${F}${u==="global"?"Global Skills":"Project Skills"}${i}`);let $=[...k].sort((b,A)=>b.skillName.localeCompare(A.skillName));for(let b of $){let A=b$2(b.skillName);console.log(` ${c}\u2514${i} ${ke}${A}${i}`);let p=[];if(b.sharedAgents.length>0&&p.push({label:"universal",agents:b.sharedAgents}),b.copiedAgents.length>0&&p.push({label:"copied",agents:b.copiedAgents}),b.linkedAgents.length>0&&p.push({label:"symlinked",agents:b.linkedAgents}),b.upToDateAgents.length>0&&p.push({label:"up-to-date",agents:b.upToDateAgents}),p.length===0&&b.failed.length===0){console.log(` ${c}\u2514(no install targets)${i}`);continue}for(let a of p){let f=a.agents.length;console.log(` ${c}\u2514${i} (${f} agents) ${a.label}: ${t(a.agents)}`);}if(b.failed.length>0)for(let{agent:a,reason:f}of b.failed){let S=e$1[a]?.displayName??a;console.log(` ${M}\u2717 ${S}:${i} ${c}${f}${i}`);}}console.log();}}async function jn(e){let t=await t$1(),s=[];for(let[l,n]of Object.entries(t.skills))ts(l,e)&&n.sourceType!=="node_modules"&&s.push({name:l,source:n.source,entry:n});return s}async function _n(e$1={}){let t=e$1.cwd||process.cwd(),s=await c$3(),l=Object.keys(s.skills),n=0,o=0;if(l.length===0)return e$1.skills||(console.log(`${c}No global skills tracked in lock file.${i}`),console.log(`${c}Install skills with${i} ${M}easbot skills add <package> -g${i}`)),{successCount:n,failCount:o,checkedCount:0};let{listInstalledSkills:r}=await import('./installer-FB26E7JZ.mjs'),g=await r({scope:"global",agentFilter:e$1.agent,cwd:t}),d=new Set(g.map(p=>p.name)),u=[],k=[],$=[];for(let p of l){if(!ts(p,e$1.skills))continue;let a=s.skills[p];if(a){if(!a.skillPath){k.push({name:p,reason:Tn(a),sourceUrl:a.source,sourceType:a.sourceType,ref:a.ref});continue}d.has(p)&&$.push({name:p,entry:a});}}let b=new Map;for(let p of $){let a=p.entry.source,f=b.get(a)||[];f.push(p),b.set(a,f);}for(let[p,a]of b){let f=a[0].entry,S=f.source,v=f.sourceType,P=null;process.stdout.write(`\r${c}Checking skills from source: ${p}${i}\x1B[K
|
|
5
|
-
`);let m=null;try{let T=await Xl(R({type:v??"git",url:S,ref:f.ref??void 0,mode:"update"}),Vl,`update fetch ${p}`);if(P=T.tempDir,T.cloneError&&(m=T.cloneError),!m&&P){let x=await B(P),C=P.replace(/\\/g,"/").replace(/\/+$/,""),B$1=x.map(U=>{let R=U.path.replace(/\\/g,"/");return relative(C,R).split(sep).join("/")});if(x.length===0)m=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${p}`);else {let U=new Set,R=new Set(B$1),z=e(S);for(let{name:W,entry:O}of a){if(U.has(W))continue;let te=O.skillPath.split(sep).join("/").replace(/\/SKILL\.md$/,"");if(!R.has(te))continue;let X=await es(z,P,te,W);if(!X.ok){k.push({name:W,reason:"Store sync failed",sourceUrl:O.source,sourceType:O.sourceType,ref:O.ref});continue}jt(e$1.force,X.hash,X.hash)&&u.push({name:W,source:p,entry:O});}}}}catch(w){m=w instanceof Error?w:new Error(String(w));}finally{P&&v!=="local"&&!ha(P)&&await l$1(P);}m&&(console.log(` ${c}\u2717 Failed to check skills from ${p}: ${m.message}${i}`),k.push(...Zl(m,a)));}$.length>0&&process.stdout.write("\r\x1B[K");let A=$.length+k.length;if($.length===0&&k.length===0)return e$1.skills||console.log(`${c}No global skills to check.${i}`),{successCount:n,failCount:o,checkedCount:0};if($.length===0&&k.length>0)return It(k),{successCount:n,failCount:o,checkedCount:A};if(u.length===0)return console.log(`${M}\u2713 All global skills are up to date${i}`),{successCount:n,failCount:o,checkedCount:A};if(console.log(`${M}Found ${u.length} global update(s)${i}`),console.log(),u.length===0)return It(k),{successCount:n,failCount:o,checkedCount:A};try{let p=[],a=[];for(let S of u){p.push(S.name);let v=e(S.entry.source),P=N(v),w=(S.entry.skillPath??S.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");a.push(join(P,w));}let f=await ls({skillNames:p,skillStorePaths:a,scope:"global",agentFilter:e$1.agent,cwd:t});ss(f),f.failedSkillCount>0?o+=f.failedSkillCount:n+=f.skills.length;}catch(p){o+=u.length,console.log(`${c}\u2717 Failed to refresh: ${p instanceof Error?p.message:String(p)}${i}`);}if(u.length>0)try{let p=await c$3(),a=new Date().toISOString(),f=!1,S=0;for(let v of u){let P=p.skills[v.name];if(!P)continue;if(!v.entry.marketId||!v.entry.pluginId){console.log(`${c} \u26A0 ${v.name}: lock entry missing marketId/pluginId; run \`easbot skills remove ${v.name}\` then re-add${i}`);continue}let m=e(v.entry.source),w=N(m),x=(v.entry.skillPath??v.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,""),C=join(w,x),B=await Ql(C);B&&P.computedHash!==B&&(P.computedHash=B,P.updatedAt=a,f=!0,S++);}f&&(await d$2(p),console.log(`${c}\u2192 updated global lock: ${S} skill(s) refreshed, ${Object.keys(p.skills).length} total tracked${i}`));}catch(p){console.log(`${c}\u26A0 Failed to write global lock: ${p instanceof Error?p.message:String(p)}${i}`);}return It(k),{successCount:n,failCount:o,checkedCount:A}}async function Pn(e$1={}){let t=e$1.cwd||process.cwd(),s=await jn(e$1.skills),l=0,n=0,o=[];if(s.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}`)),{successCount:l,failCount:n,foundCount:0};let{listInstalledSkills:r}=await import('./installer-FB26E7JZ.mjs'),g=await r({scope:"project",agentFilter:e$1.agent,cwd:t}),d=new Set(g.map(a=>a.name)),u=s.filter(a=>d.has(a.name)),k=u.filter(a=>a.entry.skillPath),$=u.filter(a=>!a.entry.skillPath);if(k.length===0)return console.log(`${c}No project skills can be updated in place.${i}`),Yl($),{successCount:l,failCount:n,foundCount:s.length};console.log(`${M}Checking ${k.length} skill(s)...${i}`),console.log();let b=new Map;for(let a of k){let f=a.entry.source,S=b.get(f)||[];S.push(a),b.set(f,S);}let A=await t$1(),p=[];for(let[a,f]of b){let S=f[0].entry,v=S.source,P=S.ref;Object.entries(A.skills).filter(([R,z])=>z.source===a).map(([R,z])=>R);let w=null,T=[],x=new Map,C=null;try{let R$1=S.sourceType??"git",z=await Xl(R({type:R$1,url:v,ref:P,mode:"update"}),Vl,`update fetch ${a}`);if(w=z.tempDir,z.cloneError)C=z.cloneError;else {let W=await B(w);if(W.length===0)C=new Error(`Source returned 0 skills (network 404 / empty repo / cache corruption): ${a}`);else {let O=W.map(te=>{let X=relative(w,te.path);return join(X,"SKILL.md").split(sep).join("/")}),J=e(v);for(let te of W){let re=join(relative(w,te.path),"SKILL.md").split(sep).join("/").replace(/\/SKILL\.md$/,""),ae=await es(J,w,re,te.name);ae.ok&&ae.hash&&x.set(te.name,ae.hash);}}}}catch(R){C=R instanceof Error?R:new Error(String(R));}finally{w&&!ha(w)&&await l$1(w);}if(C){console.log(` ${c}\u2717 Failed to check for deleted skills from ${a}: ${C.message}${i}`);let R=f.map(z=>({name:z.name,entry:{source:z.source,sourceType:z.entry.sourceType,ref:z.entry.ref}}));p.push(...Zl(C,R));continue}let B$1=f.filter(R=>!T.includes(R.name)),U=[];for(let R of B$1){let z=A.skills[R.name],W=x.get(R.name);if(!W)continue;let O=z?.computedHash;if(!jt(e$1.force,O,W))continue;let J=e(R.entry.source),te=N(J),re=(R.entry.skillPath??R.name).split(/[\\/]/).join("/").replace(/\/SKILL\.md$/,"");U.push({name:R.name,source:R.entry.source,skillPath:re,storeRoot:te});}if(U.length!==0)try{let R=U.map(O=>O.name),z=U.map(O=>join(O.storeRoot,O.skillPath)),W=await ls({skillNames:R,skillStorePaths:z,scope:"project",agentFilter:e$1.agent,cwd:t});ss(W),W.failedSkillCount>0?n+=W.failedSkillCount:l+=W.skills.length;for(let O of U)o.push(O.name);}catch(R){n+=U.length,console.log(` ${c}\u2717 Failed to refresh: ${R instanceof Error?R.message:String(R)}${i}`);}}if(Yl($),It(p),l>0&&o.length>0)try{let a=await t$1(),f=new Date().toISOString(),S=!1,v=0;for(let P of o){let m=a.skills[P];if(!m)continue;let T=(await Z(m.marketId,m.pluginId,P))?.entry.computedHash;T&&m.computedHash!==T&&(m.computedHash=T,m.updatedAt=f,S=!0,v++);}if(S){let{writeLocalLock:P}=await import('./local-lock-LG5YL33V.mjs');await P(a),console.log(`${c}\u2192 updated project lock: ${v} skill(s) refreshed, ${Object.keys(a.skills).length} total tracked${i}`);}}catch(a){console.log(`${c}\u26A0 Failed to write project lock: ${a instanceof Error?a.message:String(a)}${i}`);}return {successCount:l,failCount:n,foundCount:s.length}}function Yl(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 s=sl(t.entry.source,t.entry.ref);console.log(` ${M}\u2022${i} ${b$2(t.name)}`),console.log(` ${c}To refresh: ${M}easbot skills add ${s} -y${i}`);}}}async function ns(e=[],t={}){let s=xn(e,t);s.all===true&&(s.yes=true,(!s.skills||s.skills.length===0)&&(s.skills=["*"]));let l=await An(s);s.skills?console.log(`${M}Updating ${s.skills.join(", ")}...${i}`):console.log(`${M}Checking for skill updates...${i}`),console.log();let n=0,o=0,r=0;if(l==="global"||l==="both"){l==="both"&&!s.skills&&console.log(`${F}Global Skills${i}`);let{successCount:g,failCount:d,checkedCount:u}=await _n(s);n+=g,o+=d,r+=u,l==="both"&&!s.skills&&console.log();}if(l==="project"||l==="both"){l==="both"&&!s.skills&&console.log(`${F}Project Skills${i}`);let{successCount:g,failCount:d,foundCount:u}=await Pn(s);n+=g,o+=d,r+=u;}s.skills&&r===0&&console.log(`${c}No installed skills found matching: ${s.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:l,skillCount:String(n+o),successCount:String(n),failCount:String(o)}),console.log();}var os={version:"0.3.12"};var cs="eve agent";function On(e,t){return e.startsWith("git@")||e.startsWith("ssh://")?e:t}function ps(e){b(e);}async function En(e,t,s,l){let{agent:n,subagent:o}=t,{installMode:r,installGlobally:g}=l,k=await h(e,n,{global:g,mode:r,eveSubagent:o});return {skill:C(e),agent:it(t),pluginName:e.pluginName,...k}}var Dn=(()=>{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 is(e){switch(e){case "critical":return L.red(L.bold("Critical Risk"));case "high":return L.red("High Risk");case "medium":return L.yellow("Med Risk");case "low":return L.green("Low Risk");case "safe":return L.green("Safe");default:return L.dim("--")}}function Un(e){if(!e)return L.dim("--");let t=e.alerts??0;return t>0?L.red(`${t} alert${t!==1?"s":""}`):L.green("0 alerts")}function Ze(e,t){let s=a$4(e),l=Math.max(0,t-s.length);return e+" ".repeat(l)}function Fn(e,t,s){if(!e)return [];if(!t.some(g=>{let d=e[g.slug];return d&&Object.keys(d).length>0}))return [];let n=Math.min(Math.max(...t.map(g=>g.displayName.length)),36),o=[],r=Ze("",n+2)+Ze(L.dim("Gen"),18)+Ze(L.dim("Socket"),18)+L.dim("Snyk");o.push(r);for(let g of t){let d=e[g.slug],u=g.displayName.length>n?g.displayName.slice(0,n-1)+"\u2026":g.displayName,k=d?.ath?is(d.ath.risk):L.dim("--"),$=d?.socket?Un(d.socket):L.dim("--"),b=d?.snyk?is(d.snyk.risk):L.dim("--");o.push(Ze(L.cyan(u),n+2)+Ze(k,18)+Ze($,18)+b);}return o.push(""),o.push(`${L.dim("Details:")} ${L.dim(`https://skills.sh/${s}`)}`),o}function il(e,t){let s=homedir();return e===s||e.startsWith(s+sep)?"~"+e.slice(s.length):e===t||e.startsWith(t+sep)?"."+e.slice(t.length):e}function $e(e,t=5){if(e.length<=t)return e.join(", ");let s=e.slice(0,t),l=e.length-t;return `${s.join(", ")} +${l} more`}function Mn(e){let t=e.map(l=>L.cyan(C(l))),s=$e(t,3);return a$4(s).length<=80?s:`${e.length} selected skills`}function Kn(e){return `Detected an eve project. Install ${Mn(e)} for your ${cs} to use?`}function Bn(e,t,s){let l=[],n=[],o=[],r$1=new Map;if(e)for(let g of e)g.mode&&r$1.set(g.agent,g.mode);for(let g of t){let d=e$1[g].displayName,u=r$1.get(d);r(g,s?"global":"project")?l.push(d):u==="symlink"?o.push(d):n.push(d);}return {universal:l,copied:n,symlinked:o}}function it(e){let t=e$1[e.agent].displayName;return e.subagent?`${t} (${e.subagent})`:t}function _t(e){return e.subagent?`${e.agent}:${e.subagent}`:e.agent}function Gn(e,t){let s=[];for(let l of e)if(l==="eve")for(let n of t)s.push({agent:l,subagent:n});else s.push({agent:l});return s}function Wn(e,t,s,l=[]){let n=[],o=e.filter($=>!$.subagent).map($=>$.agent),r$1=e.filter($=>$.subagent).map(it),g,d;if(l.length>0){let $=new Set(l);g=o.filter(b=>$.has(b)),d=o.filter(b=>!$.has(b));}else g=o.filter($=>r($,s?"global":"project")),d=o.filter($=>!r($,s?"global":"project"));let u=g.map($=>e$1[$].displayName),k=d.map($=>e$1[$].displayName);return t==="symlink"?(u.length>0&&n.push(` ${L.green("universal:")} ${$e(u)}`),k.length>0&&n.push(` ${L.dim("symlinked:")} ${$e(k)}`),r$1.length>0&&n.push(` ${L.dim("copied:")} ${$e(r$1)}`)):(u.length>0&&n.push(` ${L.green("universal:")} ${$e(u)}`),k.length>0&&n.push(` ${L.dim("copied:")} ${$e(k)}`),r$1.length>0&&n.push(` ${L.dim("copied (subagent):")} ${$e(r$1)}`)),n}function rs(e,t){let s=k$3(t),l=[...e];for(let n of s)l.includes(n)||l.push(n);return l}function Hn(e,t,s){let l=[],{universal:n,copied:o,symlinked:r}=Bn(e,t,s),g=o,d=e.filter(u=>u.symlinkFailed&&!u.skipped).map(u=>u.agent);return n.length>0&&l.push(` ${L.green("universal:")} ${$e(n)}`),g.length>0&&l.push(` ${L.cyan("copied:")} ${$e(g)}`),r.length>0&&l.push(` ${L.dim("symlinked:")} ${$e(r)}`),d.length>0&&l.push(` ${L.yellow("symlink-failed:")} ${$e(d)}`),l}function zn(e){return I.multiselect({...e,options:e.options,message:`${e.message} ${L.dim("(space to toggle)")}`})}async function qn(e,t){return await Xt({message:e,items:t,initialSelected:[],required:true})}async function as(e){let t=e.global===true?"global":"project",s=u=>t!=="global"||e$1[u].globalSkillsDir!==void 0,l=k$3(t).filter(s),n=l$3(t).filter(u=>u!=="eve"&&s(u)),o={title:"Universal (.agents/skills)",items:l.map(u=>({value:u,label:e$1[u].displayName}))},r=n.map(u=>({value:u,label:e$1[u].displayName,hint:e.global?e$1[u].globalSkillsDir:e$1[u].skillsDir})),d=await Xt({message:"Which agents do you want to install to?",items:r,initialSelected:[],lockedSection:o});if(Array.isArray(d)){let u=d,k=new Set(l),$=[],b=[],A=new Set;for(let p of u)A.has(p)||(A.add(p),k.has(p)?$.push(p):b.push(p));return {locked:$,selected:b}}return d}var Yn=os.version;b(Yn);async function rt(e$3,t$2={}){let s$1=e$3[0],l$1=false,n=()=>{l$1||(I.log.message(L.dim("Tip: use the --yes (-y) and --global (-g) flags to install without prompts.")),l$1=true);};if(!s$1){let{readStoreIndex:g,resolveDefaultSource:d}=await import('./store-3NRBE47N.mjs'),u=await g();s$1=await d(u);}t$2.all&&(t$2.skill=["*"],t$2.agent=["*"],t$2.yes=true);let o$1=await Je();if(o$1.isAgent&&(t$2.yes=true,!t$2.agent||t$2.agent.length===0)){let g=ql(o$1.agent.name);if(g){let d=t$2.global===true?"global":"project";t$2.agent=rs([g],d);}}console.log(),o$1.isAgent||I.intro(L.bgCyan(L.black(" skills "))),o$1.isAgent?I.log.info(At(o$1.agent.name)+" Agent detected \u2014 installing non-interactively"):!process.stdin.isTTY&&!t$2.yes&&n();let r$1=null;try{let g$1=I.spinner();g$1.start("Parsing source...");let d$2=e(s$1);g$1.stop(`Source: ${d$2.type==="local"?d$2.localPath:d$2.url}${d$2.ref?` #${L.yellow(d$2.ref)}`:""}${d$2.subpath?` @${L.cyan(d$2.subpath)}`:""}`);let u=a$1(d$2),k=(()=>{if(!u)return Promise.resolve(null);let h=b$1(u);return h?c$1(h.owner,h.repo).catch(()=>null):Promise.resolve(null)})(),$=Array.isArray(t$2?.skill)&&t$2.skill.length>0||t$2.fullDepth===!0||!!d$2.subpath;g$1.start("Loading source...");let b;try{b=await ea(d$2,{includeInternal:$,fullDepth:t$2.fullDepth});}catch(h){throw h instanceof S&&(g$1.stop(L.red("Path not found")),I.outro(L.red(`Local path does not exist: ${h.localPath}`)),process.exit(1)),h}r$1=b.storeDir,g$1.stop(b.cacheHit?"Repository loaded from cache":b.source==="blob-fetch"?"Fetched via GitHub API":b.source==="well-known-fetch"?"Well-known index fetched":b.source==="local-cp"?"Local path cached":"Repository cloned");let A=b.skills,p=d$2.subpath?A.filter(h=>h.path.includes(`/${d$2.subpath}/`)||h.path.endsWith(`/${d$2.subpath}`)):A;if(g$1.start("Discovering skills..."),p.length===0&&b.cloneError){g$1.stop(L.red("Failed to clone repository"));for(let h of b.cloneError.message.split(`
|
|
6
|
-
`))I.log.message(L.dim(h));await ue(r$1),process.exit(1);}if(p.length===0&&(g$1.stop(L.red("No skills found")),I.outro(L.red("No valid skills found. Skills require a SKILL.md with name and description.")),await ue(r$1),process.exit(1)),g$1.stop(`Found ${L.green(p.length)} skill${p.length>1?"s":""}`),t$2.list){console.log(),I.log.step(L.bold("Available Skills"));let h={},j=[];for(let _ of p)if(_.pluginName){let E=_.pluginName;h[E]||(h[E]=[]),h[E].push(_);}else j.push(_);let N=Object.keys(h).sort();for(let _ of N){let E=_.split("-").map(H=>H.charAt(0).toUpperCase()+H.slice(1)).join(" ");console.log(L.bold(E));for(let H of h[_])I.log.message(` ${L.cyan(C(H))}`),I.log.message(` ${L.dim(H.description)}`);console.log();}if(j.length>0){N.length>0&&console.log(L.bold("General"));for(let _ of j)I.log.message(` ${L.cyan(C(_))}`),I.log.message(` ${L.dim(_.description)}`);}console.log(),I.outro("Use --skill <name> to install specific skills"),await ue(r$1),process.exit(0);}let a;if(t$2.skill&&t$2.skill.length>0){let h=p.map(N=>C(N)),j=F$1(t$2.skill,h);if(j.wildcard)a=p,I.log.info(`Installing all ${p.length} skills`);else if(j.invalid.length>0){I.log.error(`No matching skills found for: ${j.invalid.join(", ")}`),I.log.info("Available skills:");for(let N of p)I.log.message(` - ${C(N)}`);await ue(r$1),process.exit(1);}else a=D(p,j.matched),a.length===0&&(I.log.error(`No matching skills found for: ${j.matched.join(", ")}`),await ue(r$1),process.exit(1)),I.log.info(`Selected ${a.length} skill${a.length!==1?"s":""}: ${a.map(N=>L.cyan(C(N))).join(", ")}`);}else if(p.length===1){a=p;let h=p[0];I.log.info(`Skill: ${L.cyan(C(h))}`),I.log.message(L.dim(h.description));}else if(t$2.yes)a=p,I.log.info(`Installing all ${p.length} skills`);else {let h=[...p].sort((_,E)=>_.pluginName&&!E.pluginName?-1:!_.pluginName&&E.pluginName?1:_.pluginName&&E.pluginName&&_.pluginName!==E.pluginName?_.pluginName.localeCompare(E.pluginName):C(_).localeCompare(C(E))),j=h.some(_=>_.pluginName),N;if(j){let _=H=>H.split("-").map(q=>q.charAt(0).toUpperCase()+q.slice(1)).join(" "),E={};for(let H of h){let q=H.pluginName?_(H.pluginName):"Other";E[q]||(E[q]=[]),E[q].push({value:H,label:C(H),hint:H.description.length>60?H.description.slice(0,57)+"...":H.description});}N=await I.groupMultiselect({message:`Select skills to install ${L.dim("(space to toggle)")}`,options:E,required:!0});}else {let _=h.map(E=>({value:E,label:C(E),hint:E.description.length>60?E.description.slice(0,57)+"...":E.description}));N=await zn({message:"Select skills to install",options:_,required:!0});}I.isCancel(N)&&(I.cancel("Installation cancelled"),await ue(r$1),process.exit(0)),a=N;}let f$1=a$1(d$2),S$1=f$1?c$2(f$1,a.map(h=>C(h))):Promise.resolve(null),v$1,P=Object.keys(e$1),m=t$2.global??!1,w$1=t$2.global!==void 0;if(t$2.agent===void 0&&!w$1&&!t$2.yes&&process.stdin.isTTY&&Object.values(e$1).some(j=>j.globalSkillsDir!==void 0)){g$1.start("Asking for installation scope...");let j=await I.select({message:"Installation scope",options:[{value:!1,label:"Project",hint:"Install in current directory (committed with your project)"},{value:!0,label:"Global",hint:"Install in home directory (available across all projects)"}]});I.isCancel(j)&&(g$1.stop("Cancelled"),I.cancel("Installation cancelled"),await ue(r$1),process.exit(0)),m=j,g$1.stop(`${m?"Global":"Project"} scope selected`);}let x=w$1?t$2.global===!0?"global":"project":m?"global":"project",C$1=[];if(t$2.agent&&t$2.agent.length>0){let h=s(t$2.agent);h.length>0&&(I.log.error(`Invalid agents: ${h.join(", ")}`),I.log.info(`Valid agents: ${P.join(", ")}`),await ue(r$1),process.exit(1)),v$1=t(t$2.agent),t$2.agent.includes("*")&&I.log.info(`Installing to all ${v$1.length} agents`);}else {g$1.start("Loading agents...");let h=await f(),j=Object.keys(e$1).length;if(g$1.stop(`${j} agents`),h.includes("eve")&&(t$2.yes||!o$1.isAgent)){let N=t$2.yes?!0:await I.confirm({message:Kn(a),initialValue:!0});if(I.isCancel(N)&&(I.cancel("Installation cancelled"),await ue(r$1),process.exit(0)),N)v$1=["eve"],I.log.info(`Installing to: ${L.cyan(cs)}`);else {let _=await as({global:x==="global"});typeof _=="symbol"&&(I.cancel("Installation cancelled"),await ue(r$1),process.exit(0)),C$1=_.locked,v$1=[..._.locked,..._.selected];}}else if(h.length===0)if(t$2.yes)v$1=P,I.log.info("Installing to all agents");else {I.log.info("Select agents to install skills to");let N=Object.entries(e$1).filter(([E])=>E!=="eve").map(([E,H])=>({value:E,label:H.displayName})),_=await qn("Which agents do you want to install to?",N);I.isCancel(_)&&(I.cancel("Installation cancelled"),await ue(r$1),process.exit(0)),v$1=_;}else if(h.length===1||t$2.yes)if(v$1=rs(h,x),h.length===1){let N=h[0];I.log.info(`Installing to: ${L.cyan(e$1[N].displayName)}`);}else I.log.info(`Installing to: ${h.map(N=>L.cyan(e$1[N].displayName)).join(", ")}`);else {let N=await as({global:x==="global"});typeof N=="symbol"&&(I.cancel("Installation cancelled"),await ue(r$1),process.exit(0)),C$1=N.locked,v$1=[...N.locked,...N.selected];}}t$2.subagent&&t$2.subagent.length>0&&!v$1.includes("eve")&&(v$1=[...v$1,"eve"]);let B=[void 0];if(v$1.includes("eve")){let h=i$2(process.cwd());if(t$2.subagent&&t$2.subagent.length>0)B=t$2.subagent.map(j=>j==="root"||j==="."?void 0:j);else if(h.length>0&&!t$2.yes){let j=[{value:"",label:"Root agent",hint:"agent/skills"},...h.map(_=>({value:_,label:_,hint:`agent/subagents/${_}/skills`}))],N=await I.multiselect({message:"Where should Eve skills be installed?",options:j,initialValues:[""],required:!0});I.isCancel(N)&&(I.cancel("Installation cancelled"),await ue(r$1),process.exit(0)),B=N.map(_=>_===""?void 0:_);}}let U=Gn(v$1,B),R=t$2.copy?"copy":"symlink";if(U.every(h=>h.agent==="eve"))R="copy";else if(t$2.copy||t$2.yes)R="copy";else {let h=await I.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"}]});I.isCancel(h)&&(I.cancel("Installation cancelled"),await ue(r$1),process.exit(0)),R=h;}let W=process.cwd(),O=[],J=m?null:await t$1(W),te=await Promise.all(a.flatMap(h=>U.map(async j=>{let N=await l(h.name,j.agent,{global:m,eveSubagent:j.subagent}),_=N.installed,E;try{E=await v(h.path);}catch{E=void 0;}let q=J?.skills[h.name]?.computedHash,Q=!jt(!1,q,E),ne=_&&N.mode==="copy"&&R==="copy"&&Q,ie=!!_;return {skillName:h.name,target:j,installed:_,installedMode:N.mode,sourceHash:E,upToDate:!!ne,overwrite:ie}}))),X=new Map,re=new Map;for(let{skillName:h,target:j,overwrite:N,upToDate:_}of te)X.has(h)||(X.set(h,new Map),re.set(h,new Map)),X.get(h).set(_t(j),N),re.get(h).set(_t(j),_);let ae={},ve=[];for(let h of a)if(h.pluginName){let j=h.pluginName;ae[j]||(ae[j]=[]),ae[j].push(h);}else ve.push(h);let tt=h=>{for(let j of h){O.length>0&&O.push("");let N=U[0];U.length>1&&(N=U.find(ne=>r(ne.agent,m?"global":"project"))??U[0]);let _=o(j.name,{global:m,agent:N.agent,eveSubagent:N.subagent}),E=il(_,W);O.push(`${L.cyan(E)}`),O.push(...Wn(U,R,m,C$1));let H=X.get(j.name),q=U.filter(Q=>!r(Q.agent,m?"global":"project")&&H?.get(_t(Q))).map(it);q.length>0&&O.push(` ${L.yellow("overwrites:")} ${$e(q)}`);}},ct=Object.keys(ae).sort();for(let h of ct){let j=h.split("-").map(N=>N.charAt(0).toUpperCase()+N.slice(1)).join(" ");O.push(""),O.push(L.bold(j)),tt(ae[h]);}ve.length>0&&(ct.length>0&&(O.push(""),O.push(L.bold("General"))),tt(ve)),console.log(),I.note(O.join(`
|
|
7
|
-
`),"Installation Summary");try{let h=await Promise.race([S$1,new Promise(j=>setTimeout(()=>j(null),Dn))]);if(h&&f$1){let j=Fn(h,a.map(N=>({slug:C(N),displayName:C(N)})),f$1);j.length>0&&I.note(j.join(`
|
|
8
|
-
`),"Security Risk Assessments");}}catch{}if(!t$2.yes){let h=await I.confirm({message:"Proceed with installation?"});(I.isCancel(h)||!h)&&(I.cancel("Installation cancelled"),await ue(r$1),process.exit(0));}g$1.start("Installing skills...");let lt=[],Dt=await Promise.all(a.map(async h=>{let j$1=new Map;for(let _ of U){let E=g(_.agent,m,W,_.subagent),H=(_.agent==="eve"||_.agent==="easbot")&&R==="symlink",q=R==="copy"||H?E:e$2(m,W),Q=d$1(h.name||basename(h.path)),ne=join(q,Q),ie=join(E,Q),K=ne,Z=j$1.get(K);Z||(Z={canonicalDir:ne,members:[]},j$1.set(K,Z)),Z.members.push({target:_,agentDir:ie});}return (await Promise.all([...j$1.values()].map(async _=>{let[E,...H]=_.members;if(!E)return [];if(re.get(h.name)?.get(_t(E.target))??!1)return _.members.map(({target:ie,agentDir:K})=>({skill:C(h),agent:it(ie),pluginName:h.pluginName,success:!0,path:K,canonicalPath:K,mode:R,skipped:!0,skippedReason:"up-to-date"}));let Q=await En(h,E.target,E.agentDir,{installMode:R,installGlobally:m,cwd:W,tempDir:r$1}),ne=await Promise.all(H.map(async({target:ie,agentDir:K})=>{let Z=R==="copy"?await j(_.canonicalDir,K,{agentType:ie.agent}):await i$1(_.canonicalDir,K,{isGlobal:m,agentType:ie.agent,cwd:W,storePath:h.path});return {skill:C(h),agent:it(ie),pluginName:h.pluginName,...Z}}));return [Q,...ne]}))).flat()}));for(let h of Dt)lt.push(...h);g$1.stop("Installation complete"),console.log();let Ae=lt.filter(h=>h.success),Ut=lt.filter(h=>!h.success),Le={};for(let h of a)if("repoPath"in h)Le[h.name]=h.repoPath;else if(r$1&&h.path===r$1)Le[h.name]="SKILL.md";else if(r$1&&h.path.startsWith(r$1+sep))Le[h.name]=`${h.path.slice(r$1.length+1).split(sep).join("/")}/SKILL.md`;else if(r$1&&h.path.startsWith(r$1)){let j=r$1.split(sep).join("/"),N=h.path.split(sep).join("/");N.startsWith(`${j}/`)&&(Le[h.name]=`${N.slice(j.length+1)}/SKILL.md`);}let Ke=a$1(d$2),kl=On(d$2.url,Ke);if(Ke&&(b$1(Ke)?k.then(j=>{j===!1&&d({event:"install",source:Ke,skills:a.map(N=>N.name).join(","),agents:v$1.join(","),...m&&{global:"1"},skillFiles:JSON.stringify(Le)});}):d({event:"install",source:Ke,skills:a.map(j=>j.name).join(","),agents:v$1.join(","),...m&&{global:"1"},skillFiles:JSON.stringify(Le)})),Ae.length>0&&m){let h=new Set(Ae.map(j=>j.skill));for(let j of a){if(!h.has(C(j)))continue;let{derivePluginSlug:N,findSkillByLocation:_,readStoreIndex:E}=await import('./store-3NRBE47N.mjs'),H=M$1(d$2),q;{let Z=(await E()).markets[H],de=Z?.plugins&&Object.keys(Z.plugins).find(be=>Z.plugins[be]?.skills[j.name]);de?q=de.slice(H.length+1):q=N(d$2,void 0,j.pluginName);}let Q,ne;{let K=await _(H,`${H}:${q}`,j.name);Q=K?.entry.computedHash,ne=K?.entry.skillPath;}if(ne===void 0){let K=d$2.type==="local"?d$2.localPath??d$2.url:d$2.url;if(j.path.startsWith(K))ne=Filesystem.relative(K,j.path).replace(/^\/+/,"");else {let Z=Le[j.name];Z&&(ne=Filesystem.toUnixPath(Filesystem.dirname(Z)));}}Q===void 0&&(Q=await v(j.path));let ie=`${H}:${q}`;await i$3(j.name,{source:kl||Ke||d$2.url,sourceType:d$2.type,ref:d$2.ref,...ne&&{skillPath:ne},computedHash:Q,marketId:H,pluginId:ie});}}if(Ae.length>0&&!m){let h=new Set(Ae.map(_=>_.skill)),j=v$1.includes("eve")?B.map(_=>_??""):void 0,N=j&&(j.length>1||j.some(_=>_!==""));for(let _ of a)if(h.has(C(_)))try{let{derivePluginSlug:E,findSkillByLocation:H,readStoreIndex:q}=await import('./store-3NRBE47N.mjs'),Q=M$1(d$2),ne=a.find(be=>C(be)===_.name),ie;{let Te=(await q()).markets[Q],me=Te?.plugins&&Object.keys(Te.plugins).find(je=>Te.plugins[je]?.skills[_.name]);me?ie=me.slice(Q.length+1):ie=E(d$2,void 0,ne?.pluginName);}let K,Z;{let be=await H(Q,`${Q}:${ie}`,_.name);K=be?.entry.computedHash,Z=be?.entry.skillPath??Le[_.name];}K===void 0&&(K=await v(_.path));let de=`${Q}:${ie}`;await w(_.name,{source:kl||d$2.url,ref:d$2.ref,sourceType:d$2.type,...Z&&{skillPath:Z},computedHash:K,marketId:Q,pluginId:de,...N&&{subagents:j}},W);}catch{}}if(Ae.length>0){let h=new Map,j={},N=[];for(let K of Ae){let Z=h.get(K.skill)||[];if(Z.push(K),h.set(K.skill,Z),Z.length===1)if(K.pluginName){let de=K.pluginName;j[de]||(j[de]=[]),j[de].push(K);}else N.push(K);}let _=h.size,E=Ae.filter(K=>K.mode==="symlink"&&K.symlinkFailed),H=E.map(K=>K.agent),q=[],Q=K=>{for(let Z of K){let de=h.get(Z.skill)||[],be=de[0];if(q.push(`${L.green("\u2713")} ${Z.skill}`),be.canonicalPath){let me=il(be.canonicalPath,W);q.push(` ${L.dim("source:")} ${me}`);}let Te=new Map;for(let me of de){if(me.symlinkFailed||me.skipped||be.canonicalPath&&me.path===be.canonicalPath)continue;let je=me.path;Te.has(je)?Te.get(je)!=="symlink"&&me.mode==="symlink"&&Te.set(je,"symlink"):Te.set(je,me.mode);}for(let[me,je]of Te){let Js=il(me,W),Vs=je==="symlink"?L.cyan("(link)"):L.dim("(copied)");q.push(` ${L.dim("target:")} ${Js} ${Vs}`);}q.push(...Hn(de,v$1,m));}},ne=Object.keys(j).sort();for(let K of ne){let Z=K.split("-").map(de=>de.charAt(0).toUpperCase()+de.slice(1)).join(" ");q.push(""),q.push(L.bold(Z)),Q(j[K]);}N.length>0&&(ne.length>0&&(q.push(""),q.push(L.bold("General"))),Q(N));let ie=L.green(`Installed ${_} skill${_!==1?"s":""}`);I.note(q.join(`
|
|
9
|
-
`),ie),E.length>0&&(I.log.warn(L.yellow(`Symlinks failed for: ${$e(H)}`)),I.log.message(L.dim(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(Ut.length>0){console.log(),I.log.error(L.red(`Failed to install ${Ut.length}`));for(let h of Ut)I.log.message(` ${L.red("\u2717")} ${h.skill} \u2192 ${h.agent}: ${L.dim(h.error)}`);}console.log(),I.outro(L.green("Done!")+L.dim(" Review skills before use; they run with full agent permissions.")),await Jn(t$2,v$1);}catch(g){if(g instanceof g$1){I.log.error(L.red("Failed to clone repository"));for(let d of g.message.split(`
|
|
10
|
-
`))I.log.message(L.dim(d));}else I.log.error(g instanceof Error?g.message:"Unknown error occurred");process.stdin.isTTY||n(),I.outro(L.red("Installation failed")),process.exit(1);}finally{await ue(r$1);}}async function ue(e){if(e){if(ha(e))return;try{await l$1(e);}catch{}}}async function Jn(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("findSkillsPrompt");return}console.log(),I.log.message(L.dim("One-time prompt - you won't be asked again if you dismiss."));let n$1=await I.confirm({message:`Install the ${L.cyan("eas-skill-find")} skill? It helps your agent discover and suggest skills.`});if(I.isCancel(n$1)){await p("findSkillsPrompt");return}if(n$1){await p("findSkillsPrompt");let o=t?.filter(r=>r!=="replit");if(!o||o.length===0)return;console.log(),I.log.step("Installing eas-skill-find skill...");try{await rt(["houjallen/agent-skills@skills/builtin/eas-skill-find"],{global:!0,yes:!0,agent:o});let r=join(e$2(!0),"eas-skill-find"),g=await tl({skillId:"eas-skill-find",sourceDir:r,targetAgents:o,installGlobally:!0,defaultMode:"symlink",assumeYes:e?.yes===!0});g.reported.length>0&&I.log.warn(`${g.reported.length} cell(s) reported divergent/orphan (not auto-fixed). Run 'easbot skills repair' to fix.`);}catch{I.log.warn("Failed to install eas-skill-find. You can try again with:"),I.log.message(L.dim(" easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find -g -y --all"));}}else await p("findSkillsPrompt"),I.log.message(L.dim("You can install it later with: easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find"));}catch{}}function Pt(e){let t={},s=[];for(let l=0;l<e.length;l++){let n=e[l];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==="-a"||n==="--agent"){t.agent=t.agent||[],l++;let o=e[l];for(;l<e.length&&o&&!o.startsWith("-");)t.agent.push(o),l++,o=e[l];l--;}else if(n==="-s"||n==="--skill"){t.skill=t.skill||[],l++;let o=e[l];for(;l<e.length&&o&&!o.startsWith("-");)t.skill.push(o),l++,o=e[l];l--;}else if(n==="--full-depth")t.fullDepth=true;else if(n==="--copy")t.copy=true;else if(n==="--subagent"){t.subagent=t.subagent||[],l++;let o=e[l];for(;l<e.length&&o&&!o.startsWith("-");)t.subagent.push(o),l++,o=e[l];l--;}else n&&!n.startsWith("-")&&s.push(n);}return {source:s,options:t}}var us={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 Xn=us.languages,Zn=Xn.filter(e=>e.supported).map(e=>e.value),Fe={defaultLocale:"zh-CN",locales:Zn},at={},Ct=(e,t)=>{let s=at[e]||{translation:{}};return at[e]={translation:{...s.translation,...t.translation}},at[e]},Rt=(e=Fe.defaultLocale)=>(at[e]||Ct(e,{translation:{}}),{locale:e,resources:at[e]||{translation:{}}});var Qn={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"}},ds=Qn;var eo={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"}},gs=eo;var to=()=>{Rt("zh-CN"),Rt("en-US"),Ct("zh-CN",ds),Ct("en-US",gs);};to();var al=new Map,cl=new Map,lo=e=>{if(cl.has(e))return cl.get(e);let t=/{{\s*(\w+)\s*}}/g,s=[],l;for(;(l=t.exec(e))!==null;){let r=l[1];r&&!s.includes(r)&&s.push(r);}let n=new RegExp("{{\\s*("+s.join("|")+")\\s*}}","g"),o={keys:s,regex:n};return cl.set(e,o),o},fs=(e,t)=>{if(!e||typeof e!="string")return "";if(!t||Object.keys(t).length===0)return e;let{regex:s,keys:l}=lo(e);return l.length===0||!l.some(o=>o in t)?e:e.replace(s,(o,r)=>{let g=t[r];return g==null?"":String(g)})},so=e=>{if(e&&Fe.locales.includes(e))return e;let t=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(t){let s=t.replace(/_/g,"-");if(Fe.locales.includes(s))return s;let l=s.split("-")[0];if(l==="zh")return "zh-CN";if(l==="en")return "en-US"}return Fe.defaultLocale},ms=e=>{if(!al.has(e)){let{resources:t}=Rt(e);al.set(e,t);}return al.get(e)},no=(e,t={})=>{let s=so(t.locale),n=ms(s)?.translation[e];if(n&&typeof n=="string"){let o=fs(n,t.vars);return o!=null?String(o):String(e)}if(s!==Fe.defaultLocale){let r=ms(Fe.defaultLocale)?.translation[e];if(r&&typeof r=="string"){let g=fs(r,t.vars);return g!=null?String(g):String(e)}}return String(t.fallback??e)},y=no;function io(e){let t=e[0]??"list",s=e.slice(1);return {subcommand:t,restArgs:s}}async function $s(e,t={}){let{subcommand:s,restArgs:l}=io(e),n=ro(l,t);switch(s){case "list":return ao(hs(l),n);case "clean":return po(n);case "update":return fo(hs(l),n);case "remove":return ho(l,n);case "--help":case "-h":return ks(),0;default:return console.log(L.yellow(y("cli.store.unknown_subcommand",{vars:{sub:s},fallback:`Unknown store subcommand: ${s}`}))),ks(),1}}async function ys(e){if(!existsSync(e))return;let t=readdirSync(e,{withFileTypes:true});for(let s of t){if(s.name==="index.json")continue;let l=Filesystem.join(e,s.name);await rm(l,{recursive:true,force:true}).catch(()=>{});}}function hs(e){for(let t of e)if(t&&!t.startsWith("-"))return t}function ro(e,t){let s={...t};for(let l=0;l<e.length;l++){let n=e[l];n!==void 0&&(n==="--force"?s.force=true:n==="--yes"||n==="-y"?s.yes=true:n==="--json"&&(s.json=true));}return s}async function ao(e,t={}){let s=await T(),l=await X(),n=e?l.filter(u=>u.skillName.toLowerCase().includes(e.toLowerCase())):l;if(n.length===0)return t.json?(console.log(JSON.stringify([],null,2)),0):(e?I.outro(L.dim(`No store skills matching "${e}".`)):I.outro(L.dim("No store sources. Run `skills add <source>` first.")),0);if(t.json){let u=new Map(Object.values(s.markets).map($=>[$.id,$])),k=n.map($=>{let b=u.get($.marketId);return {skillName:$.skillName,marketId:$.marketId,pluginId:$.pluginId,sourceKey:$.marketId,type:b?.type??null,url:b?.url??null,storePath:b?.storePath??null,cachePath:b?.cachePath??null,entry:$.entry}});return console.log(JSON.stringify(k,null,2)),0}let o=new Map(Object.values(s.markets).map(u=>[u.id,u]));console.log(),console.log(L.bold(L.cyan("Store skills"))),console.log();let r=new Map;for(let u of n){r.has(u.marketId)||r.set(u.marketId,new Map);let k=r.get(u.marketId);k.has(u.pluginId)||k.set(u.pluginId,[]),k.get(u.pluginId).push(u);}let g=Array.from(new Set(n.map(u=>u.marketId))),d=0;for(let u of g){let k=o.get(u),$=u.slice(0,8),b=k?.storePath??Filesystem.join(K(),u),A=k?.type??"unknown",p=k?.url??"(local)";console.log(`${L.bold($)} ${L.dim("("+A+")")} ${p} ${L.dim("store="+$)} ${L.dim(b)} ${L.dim("cache="+(k?.cachePath??"(n/a)"))}`);let a=r.get(u),f=Array.from(a.keys()).sort();for(let S of f){let v=a.get(S),P=S.split(":").slice(1).join(":")||S;console.log(` ${L.dim("\u2514")} ${L.cyan(P)} ${L.dim("("+v.length+" skill"+(v.length>1?"s":"")+")")}`);let m=[...v].sort((w,T)=>w.skillName.localeCompare(T.skillName));for(let w of m)console.log(` ${co(w.skillName)}`),d++;}console.log();}return console.log(),console.log(L.dim(`Total: ${d} skill(s)${e?` matching "${e}"`:""}. Use \`skills store clean [--force]\` to reset store, \`skills store update [keyword]\` to refresh from source.`)),console.log(),0}function co(e){return e.replace(/[\x00-\x1f\x7f]/g,"").trim()}async function po(e={}){return e.force?go(e):uo(e)}async function uo(e){await T();let s=await X(),l=Array.from(new Set(s.map(g=>g.marketId))),n=s.length;if(!e.yes&&!e.json&&process.stdin.isTTY){n>0&&I.log.warn(L.yellow(`This will reset store: ${l.length} source(s) / ${n} skill(s). Cache is preserved; next \`skills add <source>\` will reuse cache if present.`));let g=await I.confirm({message:"Reset store (delete store contents + clear index.json)?"});if(I.isCancel(g)||!g)return I.cancel("Cancelled."),1}let o=K();await ys(o);let r=Filesystem.join(o,"index.json");if(existsSync(r)){let{Filesystem:g}=await import('@easbot/utils');await g.writeJson(r,{version:6,markets:{}});}if(existsSync(o)&&await rm(Filesystem.normalize(o),{recursive:true,force:true}).catch(()=>{}),d({event:"store_clean"}),e.json)console.log(JSON.stringify({cleaned:true,path:o,affectedSources:l.length,affectedSkills:n,cacheCleared:false}));else {let g=n>0?` (${n} skill(s) reset)`:"";I.outro(L.green(`\u2713 Reset store: ${o}${g} (cache preserved)`));}return 0}async function go(e){let t=await T(),s=await X(),l=Array.from(new Set(s.map(A=>A.marketId))),n=s.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,p=A>0?L.yellow(` ${A} local source(s) cache = user directory; will be SKIPPED (never removed by force).`):"";I.log.warn(L.yellow(`This will reset store AND clear cache: ${l.length} source(s) / ${n} skill(s).${p}`));let a=await I.confirm({message:"Reset store + clear cache (local sources protected)?"});if(I.isCancel(a)||!a)return I.cancel("Cancelled."),1}let g=K(),d$1=Filesystem.normalize(O()),u=Filesystem.normalize(g);for(let A of o){let p=Filesystem.normalize(A);if(p.startsWith(u+"/")||p===u)throw new Error(`[INVARIANT 0048-yyy] localPath falls inside storeRoot (suspected configuration error): ${p}
|
|
11
|
-
This is a program bug: a local source must be the user's original directory and must not live inside storeRoot.`);if(p.startsWith(d$1+"/")||p===d$1)throw new Error(`[INVARIANT 0048-yyy] localPath falls inside cacheRoot (suspected configuration error): ${p}
|
|
12
|
-
This is a program bug: a local source must not live inside cacheRoot.`)}await ys(g);let k=Filesystem.join(g,"index.json");if(existsSync(k)){let{Filesystem:A}=await import('@easbot/utils');await A.writeJson(k,{version:6,markets:{}});}let $=O(),b=false;if(existsSync($)&&r.size>0?(await ka(),b=true):existsSync($)&&(await ka(),b=true),existsSync(g)&&await rm(Filesystem.normalize(g),{recursive:true,force:true}).catch(()=>{}),d({event:"store_clean_force"}),e.json)console.log(JSON.stringify({cleaned:true,path:g,cachePath:$,affectedSources:l.length,affectedSkills:n,cacheCleared:b,localSourcesSkipped:o.size}));else {let A=o.size>0?L.dim(` (${o.size} local source(s) cache preserved)`):"";I.outro(L.green(`\u2713 Reset store + cleared cache${A}`));}return 0}async function fo(e,t={}){let s=await T(),l=await X();if(l.length===0)return t.json?(console.log(JSON.stringify({updated:0,reason:"no store sources"})),0):(I.outro(L.dim("No store sources to update.")),0);let n=new Set;if(e){let d=e.toLowerCase();for(let u of l)u.skillName.toLowerCase().includes(d)&&n.add(u.marketId);if(n.size===0)return t.json?(console.log(JSON.stringify({updated:0,reason:`no skills matching "${e}"`})),0):(I.outro(L.dim(`No store skills matching "${e}".`)),0)}else for(let d of l)n.add(d.marketId);let o=0,r=0,g=[];for(let d of n){let u=await mo(d,s,{...t});u.ok?(o++,g.push({sourceKey:d,skills:u.skills})):(r++,g.push({sourceKey:d,skills:[],cloneError:u.error}));}return d({event:"store_update",keyword:e??"",sourceCount:String(o+r),successCount:String(o),failCount:String(r)}),t.json?console.log(JSON.stringify({updated:o,failed:r,total:n.size,keyword:e??null,results:g})):(r>0&&I.log.warn(L.yellow(`${r} source(s) failed to refresh (clone errors); see above.`)),I.outro(L.green(`\u2713 Refreshed ${o}/${n.size} store source(s)${e?` matching "${e}"`:""}`))),r>0?2:0}async function mo(e$1,t,s){let l=t.markets[e$1];if(!l)return {ok:false,error:`source key not found: ${e$1}`};let n=e(l.url);if(l.subpath&&(n.subpath=l.subpath),l.ref&&(n.ref=l.ref),false);let o=await ea(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 s=e[0];if(!s)return t.json?(console.log(JSON.stringify({removed:false,reason:"source key required"})),1):(I.log.error(L.red("Usage: skills store remove <source-key> [--force]")),1);let l=await T(),n=(await X()).filter(u=>u.marketId===s);if(n.length===0)return t.json?(console.log(JSON.stringify({removed:false,reason:`source key not found: ${s}`})),1):(I.log.error(L.red(`Source key not found: ${s}`)),I.outro(L.dim("Run `skills store list` to see available sources.")),1);let o=l.markets[s],r=Filesystem.join(K(),s),g=o.type==="local";if(!t.yes&&!t.json&&process.stdin.isTTY){let u=g?" [local source: user directory protected]":"",k=t.force&&!g?" (+ cache)":"",$=await I.confirm({message:`Remove store source ${s.slice(0,8)}\u2026 (${n.length} skill(s))${u}${k}?`});if(I.isCancel($)||!$)return I.cancel("Cancelled."),1}existsSync(r)&&await rm(r,{recursive:true,force:true}),!g&&t.force&&await ja({type:o.type,url:o.url,subpath:o.subpath,ref:o.ref});let d$1=await T();if(d$1.markets[s]){delete d$1.markets[s];let{Filesystem:u}=await import('@easbot/utils');await u.writeJson(Filesystem.join(K(),"index.json"),d$1);}if(d({event:t.force?"store_remove_force":"store_remove",source:s,sourceType:o.type,removedSkills:n.map(u=>u.skillName).join(",")}),t.json)console.log(JSON.stringify({removed:true,sourceKey:s,sourceType:o.type,isLocal:g,cacheCleared:!g&&t.force===true,skills:n.map(u=>u.skillName)}));else {let u=`\u2713 Removed store source ${s.slice(0,8)}\u2026 (${n.length} skill(s))`;g?u+=L.dim(" [local: user directory preserved]"):t.force?u+=L.dim(" (+ cache cleared)"):u+=L.dim(" (cache preserved; use --force to clear)"),I.outro(L.green(u));}return 0}function ks(){let e=(t,s,l)=>y(`cli.help.store.${t}`,{fallback:s,vars:l});console.log(`
|
|
13
|
-
${L.bold(L.cyan("skills store"))} - ${e("desc","Ops subcommands (store / cache management, store-centric)")}
|
|
14
|
-
|
|
15
|
-
${L.bold(e("usage_title","Usage:"))}
|
|
16
|
-
skills store list [keyword] ${e("list_desc","List store skills (optional name filter)")}
|
|
17
|
-
skills store clean ${e("clean_desc","Reset store: delete store dirs + clear index.ts (cache preserved)")}
|
|
18
|
-
skills store clean --force ${e("clean_force_desc","Same + clear cache (local source cache protected)")}
|
|
19
|
-
skills store update [keyword] ${e("update_desc","Refresh store from source (no agent distribution touched)")}
|
|
20
|
-
skills store remove <key> ${e("remove_desc","Remove store source: delete store + index entries")}
|
|
21
|
-
skills store remove <key> --force ${e("remove_force_desc","Extra clear cache (remote sources; local source ignored)")}
|
|
22
|
-
skills store --help ${e("help_desc","This help")}
|
|
23
|
-
|
|
24
|
-
${L.bold(e("concepts_title","Concepts:"))}
|
|
25
|
-
- store = \`<storeRoot>/<sourceKey>/\` ${e("concept_store","normalized source dir (write once, reuse)")}
|
|
26
|
-
- cache = \`<cacheRoot>/<owner>/<repo>/\` ${e("concept_cache","download/materialize cache (remote only; local = user dir)")}
|
|
27
|
-
- index = \`<storeRoot>/index.json\` ${e("concept_index","store defs index (key = skillName)")}
|
|
28
|
-
|
|
29
|
-
${L.bold(e("local_protection_title","Local source protection (hard rule):"))}
|
|
30
|
-
- ${e("local_clean","`store clean --force` skips local source cache (user directory never deleted)")}
|
|
31
|
-
- ${e("local_remove_force","`store remove --force` for local source is same as default (cache skipped)")}
|
|
32
|
-
- ${e("local_remove","`store remove` for local source deletes store + index only, never user directory")}
|
|
33
|
-
|
|
34
|
-
${L.bold(e("options_title","Options:"))}
|
|
35
|
-
-y, --yes ${e("opt_yes","Skip confirmation prompts")}
|
|
36
|
-
--force ${e("opt_force","`clean` / `remove`: extra clear cache (local source ignored)")}
|
|
37
|
-
--json ${e("opt_json","Output as JSON (machine-readable)")}
|
|
38
|
-
|
|
39
|
-
${L.bold(e("examples_title","Examples:"))}
|
|
40
|
-
${L.dim("$")} skills store list
|
|
41
|
-
${L.dim("$")} skills store list eas-skill-find
|
|
42
|
-
${L.dim("$")} skills store list --json
|
|
43
|
-
${L.dim("$")} skills store clean
|
|
44
|
-
${L.dim("$")} skills store clean --force
|
|
45
|
-
${L.dim("$")} skills store update
|
|
46
|
-
${L.dim("$")} skills store update eas-skill-find
|
|
47
|
-
${L.dim("$")} skills store remove a1b2c3d4e5f67890
|
|
48
|
-
${L.dim("$")} skills store remove a1b2c3d4e5f67890 --force
|
|
49
|
-
${L.dim("$")} skills store clean -y --json
|
|
50
|
-
`);}var Ot=Log.create({service:"skills-find"}),bo=process.env.SKILLS_API_URL||"https://skills.sh";function Ss(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 So=/^[a-z0-9](?:[a-z0-9-]{0,38})$/i;function wo(e){let t=[],s={},l=[];for(let n=0;n<e.length;n++){let o=e[n];if(!o)continue;if(o==="--json"){s.json=true;continue}if(o==="--local"){s.local=true;continue}if(o==="--path"&&n+1<e.length){s.path=e[n+1],n++;continue}if(o.startsWith("--path=")){s.path=o.slice(7);continue}let r;if(o==="--owner"){let d=e[n+1];if(!d||d.startsWith("-")){l.push("--owner requires a GitHub owner");continue}r=d,n++;}else if(o.startsWith("--owner=")){if(r=o.slice(8),!r){l.push("--owner requires a GitHub owner");continue}}else {t.push(o);continue}let g=r.trim().toLowerCase();if(!So.test(g)){l.push("--owner must be a valid GitHub owner");continue}s.owner=g;}return {query:t.join(" "),options:s,errors:l}}async function ws(e,t){try{let s=new URLSearchParams({q:e,limit:"10"});t&&s.set("owner",t);let l=`${bo}/api/search?${s.toString()}`,n=await fetch(l);return n.ok?(await n.json()).skills.map(r=>({name:b$2(r.name),slug:b$2(r.id),source:b$2(r.source||""),installs:r.installs})).sort((r,g)=>(g.installs||0)-(r.installs||0)):[]}catch(s){return console.warn(`${c}[find] skills.sh search API failed: ${s instanceof Error?s.message:String(s)}${i}`),[]}}async function vo(e){let t=await X(),s=e?.toLowerCase().trim()??"",l=await T(),n=[];for(let o of t){if(s&&!o.skillName.toLowerCase().includes(s))continue;let r=l.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 s=[];try{for await(let o of Grep.files({cwd:e,glob:["**/SKILL.md"]}))s.push(o);}catch{return []}let l=t?.toLowerCase().trim()??"",n=[];for(let o of s){let r=Ao(e,o),g=await z(r);if(!g)continue;let d=g.name;if(l&&!d.toLowerCase().includes(l))continue;let u=dirname(r);n.push({skillName:d,sourceKey:"",pluginId:"",type:"scan",url:"",storePath:u});}return n.sort((o,r)=>o.skillName.localeCompare(r.skillName)),n}function Ao(e,t){let s=process.platform==="win32"?"\\":"/",l=t.replaceAll("/",s);return e.endsWith("/")||e.endsWith("\\")?e+l:e+s+l}var To="\x1B[?25l",Io="\x1B[?25h",Lo="\x1B[J",jo=e=>`\x1B[${e}A`,_o=e=>`\x1B[${e}G`;async function Po(e="",t){let s=[],l=0,n=e,o=false,r=null,g=0;process.stdin.isTTY&&process.stdin.setRawMode(true),xt.emitKeypressEvents(process.stdin),process.stdin.resume(),process.stdout.write(To);function d(){g>0&&process.stdout.write(jo(g)+_o(1)),process.stdout.write(Lo);let k=[],$=`${F}_${i}`;if(k.push(`${M}Search skills:${i} ${n}${$}`),k.push(""),!n||n.length<2)k.push(`${c}Start typing to search (min 2 chars)${i}`);else if(s.length===0&&o)k.push(`${c}Searching...${i}`);else if(s.length===0)k.push(`${c}No skills found${i}`);else {let A=s.slice(0,8);for(let p=0;p<A.length;p++){let a=A[p],f=p===l,S=f?`${F}>${i}`:" ",v=f?`${F}${a.name}${i}`:`${M}${a.name}${i}`,P=a.source?` ${c}${a.source}${i}`:"",m=Ss(a.installs),w=m?` ${ke}${m}${i}`:"",T=o&&p===0?` ${c}...${i}`:"";k.push(` ${S} ${v}${P}${w}${T}`);}}k.push(""),k.push(`${c}up/down navigate | enter select | esc cancel${i}`);for(let b of k)process.stdout.write(b+`
|
|
51
|
-
`);g=k.length;}function u(k){if(r&&(clearTimeout(r),r=null),o=false,!k||k.length<2){s=[],l=0,d();return}o=true,d();let $=Math.max(150,350-k.length*50);r=setTimeout(async()=>{try{s=await ws(k,t),l=0;}catch{s=[];}finally{o=false,r=null,d();}},$);}return e&&u(e),d(),new Promise(k=>{function $(){process.stdin.removeListener("keypress",b),process.stdin.isTTY&&process.stdin.setRawMode(false),process.stdout.write(Io),process.stdin.pause();}function b(A,p){if(p){if(p.name==="escape"||p.ctrl&&p.name==="c"){$(),k(null);return}if(p.name==="return"){$(),k(s[l]||null);return}if(p.name==="up"){l=Math.max(0,l-1),d();return}if(p.name==="down"){l=Math.min(Math.max(0,s.length-1),l+1),d();return}if(p.name==="backspace"){n.length>0&&(n=n.slice(0,-1),u(n));return}if(p.sequence&&!p.ctrl&&!p.meta&&p.sequence.length===1){let a=p.sequence;a>=" "&&a<="~"&&(n+=a,u(n));}}}process.stdin.on("keypress",b);})}function Co(e){let t=e.lastIndexOf("@"),l=(t>0?e.slice(0,t):e).match(/^([^/]+)\/([^/]+)$/);return l?{owner:l[1],repo:l[2]}:null}async function Ro(e,t){return await c$1(e,t)===false}async function No(e,t,s={}){let l=typeof s.path=="string"&&s.path.length>0,n=l?s.path:K(),o,r;if(l?(o=await xo(n,e||void 0),r="scan"):(o=await vo(e||void 0),r="index"),d({event:"find",query:e,resultCount:String(o.length),mode:"local"}),t)return console.log(JSON.stringify({ok:true,data:o,meta:{count:o.length,query:e||null,mode:r,rootDir:l?n:null}},null,2)),0;if(o.length===0){let A=e?` matching "${e}"`:"",p=l?` under "${n}"`:" in store";return console.log(`${c}No skills found${A}${p}.${i}`),0}let g=r==="scan"?` (scanned ${n})`:"";if(console.log(`${F}Local skills${e?` matching "${e}"`:""}${g}${i} (${o.length})`),console.log(),r==="scan"){let A=[...o].sort((a,f)=>a.skillName.localeCompare(f.skillName)),p={};for(let a of A){let f=p[a.skillName]??[];f.push(a),p[a.skillName]=f;}for(let a of Object.keys(p).sort()){let f=p[a];console.log(`${ke}${a}${i}`);for(let S of f)console.log(` ${c}\u2514${i} ${S.storePath}`);}return console.log(),console.log(`${c}Run \`skills add <source>\` to install a discovered skill.${i}`),console.log(),0}let d$1=await T(),u=new Map(Object.values(d$1.markets).map(A=>[A.id,A])),k=new Map;for(let A of o){k.has(A.sourceKey)||k.set(A.sourceKey,new Map);let p=k.get(A.sourceKey);p.has(A.pluginId)||p.set(A.pluginId,[]),p.get(A.pluginId).push(A);}let $=Array.from(new Set(o.map(A=>A.sourceKey))),b=0;for(let A of $){let p=u.get(A),a=A.slice(0,8),f=p?.storePath??"",S=p?.type??"unknown",v=p?.url??"(local)";console.log(`${F}${a}${i} ${c}(${S})${i} ${v} ${c}store=${a}${i} ${c}${f}${i}`);let P=k.get(A),m=Array.from(P.keys()).sort();for(let w of m){let T=P.get(w),x=w.includes(":")&&w.split(":").slice(1).join(":")||w;console.log(` ${c}\u2514${i} ${c}plugin:${i} ${ke}${x}${i} ${c}(${T.length} skill${T.length>1?"s":""})${i}`);let C=[...T].sort((B,U)=>B.skillName.localeCompare(U.skillName));for(let B of C)console.log(` ${B.skillName}`),b++;}console.log();}return console.log(),console.log(`${c}Total: ${b} skill(s). Use \`skills store clean [--force]\` to reset store, \`skills store update [keyword]\` to refresh from source.${i}`),console.log(),0}async function vs(e){let{query:t,options:s,errors:l}=wo(e),n=s.owner,o=!process.stdin.isTTY;Ot.debug("runFind enter",{args:e,query:t,owner:n,errors:l,isNonInteractive:o,stdinTTY:process.stdin.isTTY});let r=`${c}Tip: if running in a coding agent, follow these steps:${i}
|
|
52
|
-
${c} 1) easbot skills find [query] [--owner <owner>]${i}
|
|
53
|
-
${c} 2) easbot skills add <owner/repo@skill>${i}`;if(l.length>0){for(let p of l)console.error(p);return console.error("Usage: easbot skills find <query> [--owner <owner>]"),1}if(s.local)return No(t,s.json??false,s);if(t){Ot.debug("runFind enter query branch",{query:t,owner:n,json:s.json});let p=await ws(t,n);if(Ot.debug("runFind searchSkillsAPI returned",{count:p.length}),d({event:"find",query:t,resultCount:String(p.length)}),s.json)return console.log(JSON.stringify({ok:true,data:p.map(a=>({name:a.name,slug:a.slug,source:a.source,installs:a.installs,url:`https://skills.sh/${a.slug}`})),meta:{count:p.length,query:t,owner:n??null,truncated:p.length>6}},null,2)),0;if(p.length===0){let a=n?` from owner "${n}"`:"";return console.log(`${c}No skills found for "${t}"${a}${i}`),0}console.log(`${c}Install with${i} easbot skills add <owner/repo@skill>`),console.log();for(let a of p.slice(0,6)){let f=a.source||a.slug,S=Ss(a.installs);console.log(`${M}${f}@${a.name}${i}${S?` ${ke}${S}${i}`:""}`),console.log(`${c}\u2514 https://skills.sh/${a.slug}${i}`),console.log();}return 0}if(o||await Tt())return console.log(r),console.log(),console.log(`${c}Usage: easbot skills find <query> [--owner <owner>]${i}`),0;let g=await Po("",n);if(d({event:"find",query:"",resultCount:g?"1":"0",interactive:"1"}),!g)return console.log(`${c}Search cancelled${i}`),console.log(),0;let d$1=g.source||g.slug,u=g.name;console.log(),console.log(`${M}Installing ${F}${u}${i} from ${c}${d$1}${i}...`),console.log();let{source:k,options:$}=Pt([d$1,"--skill",u]),b=0;try{await rt(k,$);}catch(p){b=1,Ot.error("runAdd failed during find\u2192install",{err:p});}console.log();let A=Co(d$1);return A&&await Ro(A.owner,A.repo)?console.log(`${c}View the skill at${i} ${M}https://skills.sh/${g.slug}${i}`):console.log(`${c}Discover more skills at${i} ${M}https://skills.sh${i}`),console.log(),b}function pl(e,t){let s=homedir();return e.startsWith(s)?e.replace(s,"~"):e.startsWith(t)?"."+e.slice(t.length):e}function ul(e,t=5){if(e.length<=t)return e.join(", ");let s=e.slice(0,t),l=e.length-t;return `${s.join(", ")} +${l} more`}function Eo(e){let t={};for(let s=0;s<e.length;s++){let l=e[s];if(l==="-g"||l==="--global")t.global=true;else if(l==="-p"||l==="--project")t.project=true;else if(l==="--json")t.json=true;else if(l==="--all")t.all=true;else if(l==="-y"||l==="--yes")t.yes=true;else if(l==="-a"||l==="--agent")for(t.agent=t.agent||[];s+1<e.length&&!e[s+1].startsWith("-");)t.agent.push(e[++s]);}return t}function Do(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":(e.all===true,"both")}async function xs(e,t$1={}){let s$2=Eo(e),l=t$1.cwd??process.cwd();s$2.all===true&&(!s$2.agent||s$2.agent.length===0)&&(s$2.agent=["*"]);let n=Do(s$2),o;if(s$2.agent&&s$2.agent.length>0){let f=s(s$2.agent);if(f.length>0){let S=Object.keys(e$1);console.log(`${ot}Invalid agents: ${f.join(", ")}${i}`),console.log(`${c}Valid agents: ${S.join(", ")}${i}`),process.exit(1);}o=t(s$2.agent);}let r=await s$1({scope:n,agentFilter:o,cwd:l}),g=s$2.json?await X():[],d=s$2.json?await T():{markets:{}};if(s$2.json){let f=new Map;for(let P of g)f.has(P.skillName)||f.set(P.skillName,P);let S=new Map(Object.values(d.markets).map(P=>[P.id,P])),v=r.map(P=>{let m=f.get(P.name),w=m?S.get(m.marketId):void 0,T=w?.storePath&&m?`${w.storePath}/${m.entry.skillPath}`:void 0;return {name:P.name,path:T??P.canonicalPath,canonicalPath:P.canonicalPath,scope:P.scope,agents:P.agents.map(x=>e$1[x].displayName),...m&&{marketId:m.marketId,pluginId:m.pluginId,sourceKey:m.marketId},...m?.entry.computedHash&&{computedHash:m.entry.computedHash},...w?.addedAt&&{addedAt:w.addedAt},...w?.storePath&&{storePath:w.storePath},...w?.localPath&&{sourcePath:w.localPath},...m?.entry.skillPath&&{skillPath:m.entry.skillPath},...w?.type&&{sourceType:w.type},...w?.url&&{sourceUrl:w.url}}});console.log(JSON.stringify({ok:true,data:v,meta:{count:v.length,scope:n,agentFilter:o?[...o]:null}},null,2));return}let u=await l$2(),k=n==="both"?"All":n==="global"?"Global":"Project";if(r.length===0){if(s$2.json){console.log(JSON.stringify({ok:true,data:[],meta:{count:0,scope:n,agentFilter:o?[...o]:null}},null,2));return}console.log(`${c}No skills found.${i}`);return}console.log(`${F}${k} Skills${i}`),console.log();let b=(f,S)=>{let v=f.name.localeCompare(S.name);return v!==0?v:f.canonicalPath.localeCompare(S.canonicalPath)},A=[...r].sort(b),p={};for(let f of A){let S=p[f.name]??[];S.push(f),p[f.name]=S;}let a=Object.keys(p).sort();for(let f of a){let S=p[f],v=u[f],P=v?.pluginId?.includes(":")?v.pluginId.split(":",2)[1]:void 0,m=P?` ${c}(${P})${i}`:"",w=S.length>1?` ${c}(${S.length} paths)${i}`:"";if(S.length===1){let T=S[0],x=pl(T.canonicalPath,l),C=T.agents.map(U=>e$1[U].displayName),B=T.agents.length>0?ul(C):`${ot}not linked${i}`;console.log(`${ke}${b$2(T.name)}${i}${m} ${c}${x}${i} ${c}Agents:${i} ${B}`);}else {console.log(`${ke}${b$2(f)}${i}${m}${w}`);for(let T of S){let x=pl(T.canonicalPath,l),C=T.agents.map(U=>e$1[U].displayName),B=T.agents.length>0?ul(C):`${ot}not linked${i}`;console.log(` ${c}\u2514${i} ${x} ${c}Agents:${i} ${B}`);}}console.log();}}async function Is(e,t$1){let s$1=await Je(),l=t$1.yes||s$1.isAgent;if(s$1.isAgent&&I.log.info(At(s$1.agent.name)+" Agent detected \u2014 removing non-interactively"),t$1.global===void 0&&!l&&process.stdin.isTTY&&!s$1.isAgent){let m=await I.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)"}]});I.isCancel(m)&&(I.cancel("Removal cancelled"),process.exit(0)),t$1.global=m;}let n=t$1.global??false,o$1=process.cwd(),r=I.spinner();r.start("Scanning for installed skills...");let{scanInstalledSkillDirs:g}=await import('./scan-QEVID2TF.mjs'),d$2;if(t$1.agent&&t$1.agent.length>0){let m=t(t$1.agent),w=s(t$1.agent);w.length>0&&(console.log(`Invalid agents: ${w.join(", ")}`),console.log(`Valid agents: ${Object.keys(e$1).join(", ")}`),process.exit(1)),d$2=m;}let u=await g({scope:n?"global":"project",cwd:o$1,agentFilter:d$2}),k=new Set;for(let m of u)k.add(m.name);let $=Array.from(k).sort();if(r.stop(`Found ${$.length} unique installed skill(s)`),$.length===0){console.log("No skills found to remove.");return}if(t$1.skill&&t$1.skill.length>0&&t$1.all!==true){let m=E(t$1.skill,$);m.length>0&&(process.stdout.write(`Invalid skills: ${m.join(", ")}
|
|
54
|
-
`),process.stdout.write(`Installed skills: ${$.join(", ")||"(none)"}
|
|
55
|
-
`),process.exit(1));}let b=[];if(t$1.all)b=$;else if(e.length>0||t$1.skill&&t$1.skill.length>0){let m=[...e];if(t$1.skill&&t$1.skill.length>0){let w=F$1(t$1.skill,$);if(w.wildcard)b=$;else for(let T of w.matched)m.push(T);}if(b.length===0){let w=new Set;b=[];for(let T of m){let x=$.find(C=>C.toLowerCase()===T.toLowerCase());x&&!w.has(x)&&(w.add(x),b.push(x));}}if(b.length===0){console.log(`No matching skills found for: ${m.join(", ")}`);return}}else {let m=$.map(T=>({value:T,label:T})),w=await I.multiselect({message:`Select skills to remove ${L.dim("(space to toggle)")}`,options:m,required:true});I.isCancel(w)&&(I.cancel("Removal cancelled"),process.exit(0)),b=w;}let A=new Map;for(let m of u){let w=A.get(m.name);w||(w=new Set,A.set(m.name,w));for(let T of m.agents)w.add(T);}let p=new Set;for(let m of b){let w=A.get(m);if(w)for(let T of w)p.add(T);}let a=Array.from(p);if(a.length===0){console.log("No installed agents match the filter for the selected skill(s).");return}if(!t$1.yes){let m=n?"Global (use --project to switch)":"Project (use --global to switch)",w=a.map(C=>e$1[C]?.displayName??C),T=C=>C.length<=5?C.join(", "):`${C.slice(0,5).join(", ")} +${C.length-5} more`;console.log(),I.log.warn(L.yellow(`About to remove ${b.length} skill(s) from ${a.length} agent(s):`)),console.log(),console.log(` ${L.dim("Scope:")} ${m}`),console.log(` ${L.dim("Agents ("+a.length+"):")}`),console.log(` ${L.red("\u2022")} ${T(w)}`),console.log(` ${L.dim("Skills ("+b.length+"):")}`);for(let C of b)console.log(` ${L.red("\u2022")} ${C}`);console.log(),console.log(L.dim(" Each skill will be uninstalled from every targeted agent.")),console.log();let x=await I.confirm({message:"Continue? (y/N)"});(I.isCancel(x)||!x)&&(I.cancel("Removal cancelled"),process.exit(0));}r.start("Removing skills...");let f$2=[];for(let m$1 of b)try{let w=o(m$1,{global:n,cwd:o$1});for(let O of a){let J=e$1[O],te=m(m$1,O,{global:n,cwd:o$1}),X=new Set([te]),re=d$1(m$1);if(n&&J.globalSkillsDir)X.add(join(J.globalSkillsDir,re));else if(X.add(join(o$1,J.skillsDir,re)),O==="eve")for(let ae of i$2(o$1))X.add(join(f$1(ae,o$1),re));for(let ae of X)if(ae!==w)try{await lstat(ae).catch(()=>null)&&await rm(ae,{recursive:!0,force:!0});}catch(ve){I.log.warn(`Could not remove skill from ${J.displayName}: ${ve instanceof Error?ve.message:String(ve)}`);}}let x$1=(await f()).filter(O=>!a.includes(O)),C=!1;for(let O of x$1){let J=m(m$1,O,{global:n,cwd:o$1});if(await lstat(J).catch(()=>null)){C=!0;break}}C||await rm(w,{recursive:!0,force:!0});let B=n?await k$1(m$1):null,U=await Uo(m$1),R=U?(await T()).markets[U.marketId]:void 0,z=R?.url??B?.source??"local",W=R?.type??B?.sourceType??"local";n?await j$1(m$1):await x(m$1,o$1),f$2.push({skill:m$1,success:!0,source:z,sourceType:W,...U?.marketId&&{sourceKey:U.marketId},...R?.storePath&&{storePath:R.storePath}});}catch(w){f$2.push({skill:m$1,success:false,error:w instanceof Error?w.message:String(w)});}r.stop("Removal process complete");let S=f$2.filter(m=>m.success),v=f$2.filter(m=>!m.success);if(S.length>0){let m=new Map;for(let w of S){let T=w.source||"local",x=m.get(T)||{skills:[]};x.skills.push(w.skill),x.sourceType=w.sourceType,m.set(T,x);}for(let[w,T]of m)d({event:"remove",source:w,skills:T.skills.join(","),agents:a.join(","),...n&&{global:"1"},sourceType:T.sourceType});}let P=n?"Global Skills":"Project Skills";console.log(),console.log(` ${L.dim(L.bold(P))}`);for(let m of S)console.log(` ${L.green("\u2713")} ${m.skill}`);if(S.length>0&&(console.log(),I.log.success(L.green(`Successfully removed ${S.length} skill(s)`))),v.length>0){console.log(),I.log.error(L.red(`Failed to remove ${v.length} skill(s)`));for(let m of v)I.log.message(` ${L.red("\u2717")} ${m.skill}: ${m.error}`);}console.log(),I.outro(L.green("Done!"));}async function Uo(e){return (await Y(e))[0]}function Ls(e){let t={},s=[];for(let l=0;l<e.length;l++){let n=e[l];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==="-a"||n==="--agent"){t.agent=t.agent||[],l++;let o=e[l];for(;l<e.length&&o&&!o.startsWith("-");)t.agent.push(o),l++,o=e[l];l--;}else if(n==="-s"||n==="--skill"){t.skill=t.skill||[],l++;let o=e[l];for(;l<e.length&&o&&!o.startsWith("-");)t.skill.push(o),l++,o=e[l];l--;}else n&&!n.startsWith("-")&&s.push(n);}return {skills:s,options:t}}function Go(e){let t={};for(let s=0;s<e.length;s++){let l=e[s];if(l==="-g"||l==="--global")t.global=true;else if(l==="-p"||l==="--project")t.project=true;else if(l==="-y"||l==="--yes")t.yes=true;else if(l==="--all")t.all=true;else if(l==="-a"||l==="--agent")for(t.agent=t.agent??[];s+1<e.length&&!e[s+1].startsWith("-");)t.agent.push(e[++s]);}return t}function Wo(e){return e.global&&e.project?"both":e.global?"global":e.project?"project":("both")}function Ho(e,t,s){let l=e$1[e];if(t){if(l.globalSkillsDir!==void 0)return l.globalSkillsDir;let n=a$2("os").homedir();return Filesystem.join(n,l.skillsDir)}return Filesystem.join(s,l.skillsDir)}async function js(e,t={}){let s=t.cwd??process.cwd(),l=Go(e),n=Wo(l),o=l.agent??["*"],r=o.includes("*")?null:new Set(o),g=n==="both"?["project","global"]:[n],d=[];for(let p of g){let a=l$3(p);for(let f of a){if(f==="eve"||r&&!r.has(f))continue;let S=p==="global";try{let v=Ho(f,S,s);d.push({agent:f,isGlobal:S,baseDir:v});}catch{}}}let u=[];for(let p of d){let a;try{a=readdirSync(p.baseDir);}catch{continue}for(let f of a){if(f.startsWith("."))continue;let S=Filesystem.join(p.baseDir,f),v;try{v=lstatSync(S);}catch{continue}if(!v.isSymbolicLink())continue;let P;try{P=realpathSync(S);}catch{P="<unreadable>";}P==="<unreadable>"&&u.push({agent:p.agent,isGlobal:p.isGlobal,baseDir:p.baseDir,name:f,target:P});}}if(u.length===0){console.log(`${M}Doctor check: no dangling symlinks found across ${d.length} baseDir(s).${i}
|
|
56
|
-
`);return}console.log(`${F}${ke}Doctor check: ${u.length} dangling symlink(s) found${i}
|
|
57
|
-
`);for(let p of u){let a=p.isGlobal?"global":"project";console.log(` ${M}${p.name}${i} ${c}(${p.agent} \xB7 ${a})${i}`),console.log(` ${c}${p.baseDir}${i}`),console.log(` ${c}\u2192 ${p.target}${i}`);}if(console.log(),l.yes!==true&&!process.stdin.isTTY){console.log(`${c}Skipping cleanup (non-TTY environment; re-run with --yes to clean, or use a TTY).${i}
|
|
58
|
-
`);return}if(!await(await import('@clack/prompts')).confirm({message:`Unlink these ${u.length} dangling symlink(s)?`,initialValue:true})){console.log(`${c}Skipped cleanup.${i}
|
|
59
|
-
`);return}let b=0,A=0;for(let p of u){let a=Filesystem.join(p.baseDir,p.name);try{unlinkSync(a);let f=p.isGlobal?"global":"project";console.log(` ${M}\u2713 unlinked ${p.name}${i} ${c}(${p.agent} \xB7 ${f})${i}`),b++;}catch(f){let S=f instanceof Error?f.message:String(f);console.log(` ${c}\u2717 failed ${p.name}: ${S}${i}`),A++;}}console.log(),console.log(`${M}Doctor cleanup: ${b} unlinked, ${A} failed.${i}
|
|
60
|
-
`);}var ei=new Set(["metadata.json"]),ti=new Set([".git","__pycache__","__pypackages__"]),fl={"claude-code":{command:"claude",args:[]},codex:{command:"codex",args:[]}},Ds=Object.keys(fl);function Us(e){let t=[],s={},l=[];for(let n=0;n<e.length;n++){let o=e[n];if(o)if(o==="--help"||o==="-h")s.help=true;else if(o==="--full-depth")s.fullDepth=true;else if(o==="--dangerously-accept-openclaw-risks")s.dangerouslyAcceptOpenclawRisks=true;else if(o==="--skill"||o==="-s"){let r=e[n+1];!r||r.startsWith("-")?l.push(`${o} requires a skill name`):s.skill?(l.push("Only one --skill value can be provided"),n++):(s.skill=r,n++);}else if(o==="--agent"||o==="-a"){s.agent=s.agent||[],n++;let r=e[n],g=s.agent.length;for(;n<e.length&&r&&!r.startsWith("-");)s.agent.push(r),n++,r=e[n];s.agent.length===g&&l.push(`${o} requires an agent name`),n--;}else o.startsWith("-")?l.push(`Unknown option: ${o}`):t.push(o);}return l.push(...ai(s.agent)),{source:t,options:s,errors:l}}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>
|
|
61
|
-
${e.skillMd}
|
|
62
|
-
</SKILL.md>`];return e.hasSupportingFiles&&e.supportDir&&t.push(`Supporting files for this skill were downloaded to:
|
|
63
|
-
${e.supportDir}
|
|
64
|
-
|
|
65
|
-
When the SKILL.md references relative paths, read them from that directory.`),t.join(`
|
|
66
|
-
|
|
67
|
-
`)+`
|
|
68
|
-
`}async function si(e){let t=await mkdtemp(join(tmpdir(),"skills-use-")),s=join(t,d$1(e.directoryName||e.name));if(!ml(t,s))throw new Error("Invalid skill name: potential path traversal detected");await mkdir(s,{recursive:true}),e.kind==="blob"?await ci(s,e.files):e.kind==="well-known"?await pi(s,e.files):await Ws(e.path,s);let l=e.rawContent??await readFile(join(s,"SKILL.md"),"utf-8"),n=await Hs(s,s);return {tempRoot:t,skillDir:s,skillMd:l,hasSupportingFiles:n}}async function Fs(e$1,t={},s=[]){let l=null;try{if(t.help){console.log(Rs());return}s.length>0&&Ie(s.join(`
|
|
69
|
-
`)),e$1.length===0&&Ie(`Missing required argument: source
|
|
70
|
-
|
|
71
|
-
${Rs()}`),e$1.length>1&&Ie(`Expected one source, received ${e$1.length}: ${e$1.join(", ")}`);let n=t.agent?.[0];n&&!fl[n]&&Ie(Bs(n));let o=e$1[0],r=e(o);a$1(r)?.split("/")[0]?.toLowerCase()==="openclaw"&&!t.dangerouslyAcceptOpenclawRisks&&Ie(["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(`
|
|
72
|
-
`));let u=t.skill,k=!!(u||t.fullDepth||r.subpath),$;if(r.type==="well-known"){let p=await n$1.fetchAllSkills(r.url);$=ri(p,u,o);}else {let p,a=null;if(r.type==="local")existsSync(r.localPath)||Ie(`Local path does not exist: ${r.localPath}`),p=await B(r.localPath,r.subpath,{includeInternal:k,fullDepth:t.fullDepth});else if(r.type==="github"&&!t.fullDepth){let S=a$1(r),v=S?.split("/")[0]?.toLowerCase();S&&v&&x$1.includes(v)&&(a=await D$1(S,{subpath:r.subpath,ref:r.ref,getToken:g$2,includeInternal:k})),a?p=a.skills:(l=await k$2(r.url,r.ref),p=await B(l,r.subpath,{includeInternal:k,fullDepth:t.fullDepth}));}else l=await k$2(r.url,r.ref),p=await B(l,r.subpath,{includeInternal:k,fullDepth:t.fullDepth});let f=ii(p,u,o);a&&ui(f)?$={kind:"blob",name:f.name,directoryName:f.name,rawContent:f.rawContent??di(f.files),files:f.files}:$={kind:"disk",name:f.name,directoryName:f.name,rawContent:f.rawContent,path:f.path};}let b=await si($);await Ns(l),l=null;let A=li({skillMd:b.skillMd,supportDir:b.skillDir,hasSupportingFiles:b.hasSupportingFiles});if(n){let p=await ni(n,A);p!==0&&process.exit(p);return}process.stdout.write(A);}catch(n){await Ns(l),n instanceof g$1&&Ie(n.message),n instanceof ye&&Ie(n.message),Ie(n instanceof Error?n.message:"Unknown error");}}async function ni(e,t,s=oi){let l=fl[e];if(!l)throw new ye(Bs(e));return new Promise((n,o)=>{let r=s(l.command,[...l.args,t],{stdio:"inherit"}),g=false;r.on("error",d=>{if(!g){if(g=true,d.code==="ENOENT"){o(new ye(`Could not launch ${e$1[e].displayName}: command not found: ${l.command}`));return}o(d);}}),r.on("close",d=>{g||(g=true,n(d??1));});})}function oi(e,t){return spawn(e,t,{stdio:"inherit"})}function Rs(){return `Usage: skills use <source>[@<skill>] [options]
|
|
73
|
-
|
|
74
|
-
Generate a prompt for using one skill without installing it.
|
|
75
|
-
|
|
76
|
-
Options:
|
|
77
|
-
-s, --skill <skill> Select the skill to use
|
|
78
|
-
-a, --agent <agent> Start one supported agent interactively (${Ds.join(", ")})
|
|
79
|
-
--full-depth Search nested directories like skills add --full-depth
|
|
80
|
-
--dangerously-accept-openclaw-risks
|
|
81
|
-
Allow unverified OpenClaw community skills
|
|
82
|
-
-h, --help Show this help message
|
|
83
|
-
|
|
84
|
-
Examples:
|
|
85
|
-
skills use houjallen/agent-skills@web-design-guidelines | claude
|
|
86
|
-
skills use houjallen/agent-skills --skill web-design-guidelines --agent claude-code
|
|
87
|
-
skills use houjallen/agent-skills@web-design-guidelines --agent codex`}function ii(e,t,s){if(e.length===0)throw new ye("No valid skills found. Skills require a SKILL.md with name and description.");if(!t){if(e.length===1)return e[0];throw new ye(Ms(s,e.map(C)))}let l=D(e,[t]);if(l.length===0)throw new ye(Ks(t,e.map(C)));if(l.length>1)throw new ye(`Skill selector "${t}" matched multiple skills.`);return l[0]}function ri(e,t,s){if(e.length===0)throw new ye("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 l;if(t){if(l=e.filter(o=>o.installName.toLowerCase()===t.toLowerCase()||o.name.toLowerCase()===t.toLowerCase()),l.length===0)throw new ye(Ks(t,e.map(o=>o.installName)));if(l.length>1)throw new ye(`Skill selector "${t}" matched multiple skills.`)}else {if(e.length!==1)throw new ye(Ms(s,e.map(o=>o.installName)));l=e;}let n=l[0];return {kind:"well-known",name:n.name,directoryName:n.installName,rawContent:n.content,files:n.files}}function Ms(e,t){return ["This source contains multiple skills. Specify exactly one skill:",...t.map(s=>` - ${s}`),"",`Examples:
|
|
88
|
-
skills use ${e}@${t[0]??"<skill>"}
|
|
89
|
-
skills use ${e} --skill ${t[0]??"<skill>"}`].join(`
|
|
90
|
-
`)}function Ks(e,t){return [`No matching skill found for: ${e}`,"Available skills:",...t.map(s=>` - ${s}`)].join(`
|
|
91
|
-
`)}function ai(e){if(!e||e.length===0)return [];let t=[];e.includes("*")&&t.push("skills use --agent does not support '*'; specify exactly one agent."),e.length>1&&t.push("skills use --agent accepts exactly one agent.");let s$1=s(e);if(s$1.length>0){let l=Object.keys(e$1);t.push(`Invalid agents: ${s$1.join(", ")}
|
|
92
|
-
Valid agents: ${l.join(", ")}`);}return t}function Bs(e){return [`Running ${e$1[e].displayName} is not supported yet.`,`Supported agents for skills use --agent: ${Ds.join(", ")}`].join(`
|
|
93
|
-
`)}async function ci(e,t){for(let s of t)await Gs(e,s.path,s.contents);}async function pi(e,t){for(let[s,l]of t)await Gs(e,s,l);}async function Gs(e,t,s){let l=join(e,t);ml(e,l)&&(await mkdir(dirname(l),{recursive:true}),typeof s=="string"?await writeFile(l,s,"utf-8"):await writeFile(l,s));}async function Ws(e,t){await mkdir(t,{recursive:true});let s=await readdir(e,{withFileTypes:true});await Promise.all(s.filter(l=>!gi(l.name,l.isDirectory())).map(async l=>{let n=join(e,l.name),o=join(t,l.name);if(ml(t,o)){if(l.isDirectory()){await Ws(n,o);return}try{await cp(n,o,{dereference:!0,recursive:!0});}catch(r){if(r instanceof Error&&"code"in r&&r.code==="ENOENT"&&l.isSymbolicLink()){console.error(`Skipping broken symlink: ${n}`);return}throw r}}}));}async function Hs(e,t){let s=await readdir(t,{withFileTypes:true});for(let l of s){let n=join(t,l.name),o=relative(e,n).split(sep).join("/");if(l.isDirectory()){if(await Hs(e,n))return true}else if(o.toLowerCase()!=="skill.md")return true}return false}function ui(e){return Array.isArray(e.files)}function di(e){return e.find(s=>s.path.toLowerCase()==="skill.md")?.contents??""}function gi(e,t){return ei.has(e)||t&&ti.has(e)}function ml(e,t){let s=normalize(resolve(e)),l=normalize(resolve(t));return l.startsWith(s+sep)||l===s}async function Ns(e){e&&await l$1(e).catch(()=>{});}function Ie(e){console.error(e),process.exit(1);}var ye=class extends Error{};var mi={"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 ki(e){return mi[e]()}var $i=/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;function qs(e,t){let s=formatLocalISO(new Date,false).slice(0,10),l={skill_name:t,skill_title:hi(t),version:"1.0.0",date:s};return ki(e).replace($i,(o,r)=>Object.hasOwn(l,r)?l[r]:o)}function xi(e){return e&&ps(e),e??"0.0.0"}function et(e){return resolveLocaleLang(e?.locale)}function Ai(e){let t=et(e);console.log(),console.log(`${c}${y("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}${y("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}${y("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}${y("cli.example.remove_interactive",{locale:t,fallback:"Remove installed skills"})}${i}`),console.log(` ${c}$${i} ${M}easbot-skills list${i} ${c}${y("cli.example.list_project",{locale:t,fallback:"List installed skills"})}${i}`),console.log(` ${c}$${i} ${M}easbot-skills find ${c}[query]${i} ${c}${y("cli.example.find_interactive",{locale:t,fallback:"Search for skills"})}${i}`),console.log(),console.log(` ${c}$${i} ${M}easbot-skills update${i} ${c}${y("cli.example.update_global",{locale:t,fallback:"Update installed skills"})}${i}`),console.log(),console.log(` ${c}$${i} ${M}easbot-skills doctor${i} ${c}${y("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}${y("cli.example.init",{locale:t,fallback:"Create a new skill"})}${i}`),console.log(` ${c}$${i} ${M}easbot-skills store ${c}<sub>${i} ${c}${y("cli.example.store",{locale:t,fallback:"Manage store / cache sources"})}${i}`),console.log(),console.log(`${c}${y("cli.banner.try_hint",{locale:t,fallback:"try:"})}${i} easbot-skills add houjallen/agent-skills`),console.log(),console.log(`${c}${y("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}`),console.log();}function Zc(e){let t=et(e),s=(l,n)=>c+y(l,{locale:t,fallback:n})+i;console.log(`
|
|
94
|
-
${F}${y("cli.help.usage",{locale:t,fallback:"Usage: skills <command> [options]"})}${i}
|
|
95
|
-
|
|
96
|
-
${F}${y("cli.help.section.manage",{locale:t,fallback:"Manage Skills"})}${i}:
|
|
97
|
-
add <source> Add a skill package (alias: a).
|
|
98
|
-
<source> accepts 4 forms:
|
|
99
|
-
<owner>/<repo> e.g. houjallen/agent-skills
|
|
100
|
-
GitHub URL e.g. https://github.com/houjallen/agent-skills
|
|
101
|
-
local path e.g. ./skills/foo or /abs/path/to/skills
|
|
102
|
-
.well-known URL served from /.well-known/agent-skills/index.json
|
|
103
|
-
use <package>@<skill>
|
|
104
|
-
Generate a prompt for using one skill without installing it
|
|
105
|
-
remove [skills] Remove installed skills
|
|
106
|
-
list, ls List installed skills
|
|
107
|
-
find [query] Search for skills interactively
|
|
108
|
-
doctor, dr Check & cleanup broken links (scope: -g/-p, default both)
|
|
109
|
-
|
|
110
|
-
${F}${y("cli.help.section.updates",{locale:t,fallback:"Updates"})}${i}:
|
|
111
|
-
update [skills...] Update skills to latest versions (alias: upgrade)
|
|
112
|
-
|
|
113
|
-
${F}${y("cli.help.section.maintenance",{locale:t,fallback:"Maintenance (Operations)"})}${i}:
|
|
114
|
-
store <subcommand> Manage store sources (store + cache + index):
|
|
115
|
-
list [keyword] List store skills (optional name filter)
|
|
116
|
-
clean [--force] Reset store (--force also clears cache)
|
|
117
|
-
update [keyword] Refresh store from source
|
|
118
|
-
remove <key> [--force] Drop store source (--force also clears cache)
|
|
119
|
-
|
|
120
|
-
${F}${y("cli.help.section.update_options",{locale:t,fallback:"Update Options"})}${i}:
|
|
121
|
-
-g, --global ${y("cli.help.update.flag.global",{locale:t,fallback:"Update global skills only"})}
|
|
122
|
-
-p, --project ${y("cli.help.update.flag.project",{locale:t,fallback:"Update project skills only"})}
|
|
123
|
-
-y, --yes ${y("cli.help.update.flag.yes",{locale:t,fallback:"Skip scope prompt (defaults to both project + global)"})}
|
|
124
|
-
--all ${y("cli.help.update.flag.all",{locale:t,fallback:"Shorthand for --skill '*' -y (update all installed skills)"})}
|
|
125
|
-
--force ${y("cli.help.update.flag.force",{locale:t,fallback:"Skip SKILL.md hash check; reinstall every selected skill"})}
|
|
126
|
-
|
|
127
|
-
${F}${y("cli.help.section.project",{locale:t,fallback:"Project"})}${i}:
|
|
128
|
-
init [name] Initialize a skill (creates <name>/SKILL.md or ./SKILL.md)
|
|
129
|
-
store <subcommand> Manage store sources (store + cache + index; --force clears cache)
|
|
130
|
-
|
|
131
|
-
${F}${y("cli.help.section.add_options",{locale:t,fallback:"Add Options"})}${i}:
|
|
132
|
-
-g, --global ${y("cli.help.add.flag.global",{locale:t,fallback:"Install skill globally (user-level) instead of project-level"})}
|
|
133
|
-
-a, --agent <agents> ${y("cli.help.add.flag.agent",{locale:t,fallback:"Specify agents to install to (use '*' for all agents)"})}
|
|
134
|
-
-s, --skill <skills> ${y("cli.help.add.flag.skill",{locale:t,fallback:"Specify skill names to install (use '*' for all skills)"})}
|
|
135
|
-
-l, --list ${y("cli.help.add.flag.list",{locale:t,fallback:"List available skills in the repository without installing"})}
|
|
136
|
-
-y, --yes ${y("cli.help.add.flag.yes",{locale:t,fallback:"Skip confirmation prompts"})}
|
|
137
|
-
--copy ${y("cli.help.add.flag.copy",{locale:t,fallback:"Copy files instead of symlinking to agent directories"})}
|
|
138
|
-
--subagent <names> ${y("cli.help.add.flag.subagent",{locale:t,fallback:"Install to Eve subagents (use 'root' for the root agent)"})}
|
|
139
|
-
--all ${y("cli.help.add.flag.all",{locale:t,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
|
|
140
|
-
--full-depth ${y("cli.help.add.flag.full_depth",{locale:t,fallback:"Search all subdirectories even when a root SKILL.md exists"})}
|
|
141
|
-
|
|
142
|
-
${F}${y("cli.help.section.use_options",{locale:t,fallback:"Use Options"})}${i}:
|
|
143
|
-
-s, --skill <skill> ${y("cli.help.use.flag.skill",{locale:t,fallback:"Specify the skill to use"})}
|
|
144
|
-
-a, --agent <agent> ${y("cli.help.use.flag.agent",{locale:t,fallback:"Start one supported agent interactively"})}
|
|
145
|
-
--full-depth ${y("cli.help.use.flag.full_depth",{locale:t,fallback:"Search all subdirectories even when a root SKILL.md exists"})}
|
|
146
|
-
--dangerously-accept-openclaw-risks
|
|
147
|
-
${y("cli.help.use.flag.openclaw_risks",{locale:t,fallback:"Allow unverified OpenClaw community skills"})}
|
|
148
|
-
|
|
149
|
-
${F}${y("cli.help.section.remove_options",{locale:t,fallback:"Remove Options"})}${i}:
|
|
150
|
-
-g, --global ${y("cli.help.remove.flag.global",{locale:t,fallback:"Remove from global scope"})}
|
|
151
|
-
-a, --agent <agents> ${y("cli.help.remove.flag.agent",{locale:t,fallback:"Remove from specific agents (use '*' for all agents)"})}
|
|
152
|
-
-s, --skill <skills> ${y("cli.help.remove.flag.skill",{locale:t,fallback:"Specify skills to remove (use '*' for all skills)"})}
|
|
153
|
-
-y, --yes ${y("cli.help.remove.flag.yes",{locale:t,fallback:"Skip confirmation prompts"})}
|
|
154
|
-
--all ${y("cli.help.remove.flag.all",{locale:t,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
|
|
155
|
-
|
|
156
|
-
${F}${y("cli.help.section.doctor_options",{locale:t,fallback:"Doctor Options"})}${i}:
|
|
157
|
-
-g, --global ${y("cli.help.doctor.flag.global",{locale:t,fallback:"Check global scope only"})}
|
|
158
|
-
-p, --project ${y("cli.help.doctor.flag.project",{locale:t,fallback:"Check project scope only"})}
|
|
159
|
-
-a, --agent <agents> ${y("cli.help.doctor.flag.agent",{locale:t,fallback:"Check specific agents (use '*' for all)"})}
|
|
160
|
-
-y, --yes ${y("cli.help.doctor.flag.yes",{locale:t,fallback:"Skip confirm; remove broken links directly"})}
|
|
161
|
-
--all ${y("cli.help.doctor.flag.all",{locale:t,fallback:"Shorthand for --agent *"})}
|
|
162
|
-
|
|
163
|
-
${F}${y("cli.help.section.list_options",{locale:t,fallback:"List Options"})}${i}:
|
|
164
|
-
-g, --global ${y("cli.help.list.flag.global",{locale:t,fallback:"List global skills (default: project)"})}
|
|
165
|
-
-p, --project ${y("cli.help.list.flag.project",{locale:t,fallback:"List project skills only"})}
|
|
166
|
-
-a, --agent <agents> ${y("cli.help.list.flag.agent",{locale:t,fallback:"Filter by specific agents (use '*' for all agents)"})}
|
|
167
|
-
--json ${y("cli.help.list.flag.json",{locale:t,fallback:"Output as JSON (machine-readable, no ANSI codes)"})}
|
|
168
|
-
--all ${y("cli.help.list.flag.all",{locale:t,fallback:"Shorthand for --agent *"})}
|
|
169
|
-
|
|
170
|
-
${F}${y("cli.help.section.find_options",{locale:t,fallback:"Find Options"})}${i}:
|
|
171
|
-
--owner <owner> ${y("cli.help.find.flag.owner",{locale:t,fallback:"Search only repositories from a GitHub owner"})}
|
|
172
|
-
--json Output as JSON (machine-readable, no ANSI codes)
|
|
173
|
-
|
|
174
|
-
${F}${y("cli.help.section.options",{locale:t,fallback:"Options"})}${i}:
|
|
175
|
-
--help, -h Show this help message
|
|
176
|
-
--version, -v Show version number
|
|
177
|
-
|
|
178
|
-
${F}Examples:${i}
|
|
179
|
-
${c}$${i} easbot-skills add houjallen/agent-skills ${s("cli.example.add","Add a skill package")}
|
|
180
|
-
${c}$${i} easbot-skills use houjallen/agent-skills@houjallen | claude ${s("cli.example.use","Use a skill one-shot")}
|
|
181
|
-
${c}$${i} easbot-skills use houjallen/agent-skills --skill houjallen --agent claude ${s("cli.example.use_with_agent","Specify skill + agent")}
|
|
182
|
-
${c}$${i} easbot-skills add houjallen/agent-skills -g ${s("cli.example.add_global","Install globally")}
|
|
183
|
-
${c}$${i} easbot-skills add houjallen/agent-skills --agent claude-code cursor ${s("cli.example.add_multi_agent","Install to multiple agents")}
|
|
184
|
-
${c}$${i} easbot-skills add houjallen/agent-skills --skill pr-review commit ${s("cli.example.add_multi_skill","Install multiple skills")}
|
|
185
|
-
${c}$${i} easbot-skills remove ${c}# ${s("cli.example.remove_interactive","Interactive remove")}${i}
|
|
186
|
-
${c}$${i} easbot-skills remove web-design ${c}# ${s("cli.example.remove_by_name","Remove by name")}${i}
|
|
187
|
-
${c}$${i} easbot-skills rm --global frontend-design
|
|
188
|
-
${c}$${i} easbot-skills list ${c}# ${s("cli.example.list_project","List project skills")}${i}
|
|
189
|
-
${c}$${i} easbot-skills ls -g ${c}# ${s("cli.example.list_global","List global skills")}${i}
|
|
190
|
-
${c}$${i} easbot-skills ls -a claude-code ${c}# ${s("cli.example.list_filter_agent","Filter by agent")}${i}
|
|
191
|
-
${c}$${i} easbot-skills ls --json ${c}# ${s("cli.example.list_json","JSON output")}${i}
|
|
192
|
-
${c}$${i} easbot-skills find ${c}# ${s("cli.example.find_interactive","Interactive search")}${i}
|
|
193
|
-
${c}$${i} easbot-skills find typescript ${c}# ${s("cli.example.find_keyword","Search by keyword")}${i}
|
|
194
|
-
${c}$${i} easbot-skills find react --owner houjallen ${c}# ${s("cli.example.find_owner","Search within an owner")}${i}
|
|
195
|
-
${c}$${i} easbot-skills update
|
|
196
|
-
${c}$${i} easbot-skills update my-skill ${c}# ${s("cli.example.update_one","Update a single skill")}${i}
|
|
197
|
-
${c}$${i} easbot-skills update -g ${c}# ${s("cli.example.update_global","Update global skills only")}${i}
|
|
198
|
-
${c}$${i} easbot-skills init my-skill ${c}# ${s("cli.example.init","Create a new skill")}${i}
|
|
199
|
-
${c}$${i} easbot-skills store list ${c}# ${s("cli.example.store_list","List store skills")}${i}
|
|
200
|
-
${c}$${i} easbot-skills store clean --force ${c}# ${s("cli.example.store_clean_force","Reset store + clear cache")}${i}
|
|
201
|
-
${c}$${i} easbot-skills doctor ${c}# ${s("cli.example.doctor","Check & cleanup dangling symlinks (interactive)")}${i}
|
|
202
|
-
${c}$${i} easbot-skills doctor -a easbot -y ${c}# ${s("cli.example.doctor_agent_yes","Check one agent + auto-cleanup")}${i}
|
|
203
|
-
|
|
204
|
-
${c}${y("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}
|
|
205
|
-
`);}function Ti(e){let t=et(e);console.log(`
|
|
206
|
-
${F}${y("cli.help.doctor.usage",{locale:t,fallback:"Usage: easbot skills doctor [options]"})}${i}
|
|
207
|
-
|
|
208
|
-
${F}Description:${i}
|
|
209
|
-
${y("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."})}
|
|
210
|
-
|
|
211
|
-
${F}Scope (tri-state, same as list / update):${i}
|
|
212
|
-
-g, --global ${y("cli.help.doctor.flag.global",{locale:t,fallback:"Check global scope only"})}
|
|
213
|
-
-p, --project ${y("cli.help.doctor.flag.project",{locale:t,fallback:"Check project scope only"})}
|
|
214
|
-
${c}(default: both \u2014 scan project + global)${i}
|
|
215
|
-
|
|
216
|
-
${F}Filter:${i}
|
|
217
|
-
-a, --agent <agents> ${y("cli.help.doctor.flag.agent",{locale:t,fallback:"Target agents (repeatable; use * for all)"})}
|
|
218
|
-
--all ${y("cli.help.doctor.flag.all",{locale:t,fallback:"Shorthand for --agent *"})}
|
|
219
|
-
|
|
220
|
-
${F}Cleanup:${i}
|
|
221
|
-
-y, --yes ${y("cli.help.doctor.flag.yes",{locale:t,fallback:"Skip confirm; unlink dangling symlinks directly"})}
|
|
222
|
-
${c}(TTY: confirm prompt; non-TTY: report only)${i}
|
|
223
|
-
|
|
224
|
-
${F}Examples:${i}
|
|
225
|
-
${c}$${i} easbot-skills doctor ${c}# ${y("cli.example.doctor",{locale:t,fallback:"Interactive check + cleanup"})}${i}
|
|
226
|
-
${c}$${i} easbot-skills doctor -a easbot -y ${c}# ${y("cli.example.doctor_agent_yes",{locale:t,fallback:"Check one agent + auto-cleanup"})}${i}
|
|
227
|
-
${c}$${i} easbot-skills dr -g ${c}# ${y("cli.example.doctor_global",{locale:t,fallback:"Check global scope only"})}${i}
|
|
228
|
-
`);}function Ii(e){let t=et(e);console.log(`
|
|
229
|
-
${F}${y("cli.help.remove.usage",{locale:t,fallback:"Usage: easbot skills remove [skills...] [options]"})}${i}
|
|
230
|
-
|
|
231
|
-
${F}Description:${i}
|
|
232
|
-
${y("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."})}
|
|
233
|
-
|
|
234
|
-
${F}Arguments:${i}
|
|
235
|
-
${y("cli.help.remove.arguments",{locale:t,fallback:"skills Optional skill names to remove (space-separated)"})}
|
|
236
|
-
|
|
237
|
-
${F}Options:${i}
|
|
238
|
-
-g, --global ${y("cli.help.remove.flag.global",{locale:t,fallback:"Remove from global scope (~/) instead of project scope"})}
|
|
239
|
-
-a, --agent ${y("cli.help.remove.flag.agent",{locale:t,fallback:"Remove from specific agents (use '*' for all agents)"})}
|
|
240
|
-
-s, --skill ${y("cli.help.remove.flag.skill",{locale:t,fallback:"Specify skills to remove (use '*' for all skills)"})}
|
|
241
|
-
-y, --yes ${y("cli.help.remove.flag.yes",{locale:t,fallback:"Skip confirmation prompts"})}
|
|
242
|
-
--all ${y("cli.help.remove.flag.all",{locale:t,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
|
|
243
|
-
|
|
244
|
-
${F}Examples:${i}
|
|
245
|
-
${c}$${i} easbot-skills remove ${c}# ${y("cli.example.remove_interactive",{locale:t,fallback:"Interactive remove"})}${i}
|
|
246
|
-
${c}$${i} easbot-skills remove my-skill ${c}# ${y("cli.example.remove_by_name",{locale:t,fallback:"Remove by name"})}${i}
|
|
247
|
-
${c}$${i} easbot-skills remove skill1 skill2 -y ${c}# ${y("cli.example.remove_all",{locale:t,fallback:"Remove multiple skills"})}${i}
|
|
248
|
-
${c}$${i} easbot-skills remove --global my-skill ${c}# ${y("cli.example.remove_global",{locale:t,fallback:"Remove from global scope"})}${i}
|
|
249
|
-
${c}$${i} easbot-skills rm --agent claude-code my-skill ${c}# ${y("cli.example.remove_by_agent",{locale:t,fallback:"Remove from specific agent"})}${i}
|
|
250
|
-
${c}$${i} easbot-skills remove --all ${c}# ${y("cli.example.remove_all",{locale:t,fallback:"Remove all skills"})}${i}
|
|
251
|
-
${c}$${i} easbot-skills remove --skill '*' -a cursor ${c}# ${y("cli.example.remove_agent_all",{locale:t,fallback:"Remove all skills from one agent"})}${i}
|
|
252
|
-
|
|
253
|
-
${c}${y("cli.banner.discover",{locale:t,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${i}
|
|
254
|
-
`);}function hl(){console.log();}function Li(e,t){let s=et(t),l=t?.cwd??p$1()??process.cwd(),n=e[0]||basename(l),o=e[0]!==void 0,r=o?join(l,n):l,g=join(r,"SKILL.md"),d=o?`${n}/SKILL.md`:"SKILL.md";if(existsSync(g))return console.log(`${M}${y("cli.init.exists",{locale:s,vars:{path:d},fallback:`Skill already exists at ${d}`})}${i}`),0;o&&mkdirSync(r,{recursive:true});let u=qs(s,n);return writeFileSync(g,u),console.log(`${M}${y("cli.init.created",{locale:s,vars:{name:n},fallback:`Initialized skill: ${n}`})}${i}`),console.log(),console.log(`${c}${y("cli.init.created_label",{locale:s,fallback:"Created"})}${i}:`),console.log(` ${d}`),console.log(),console.log(`${c}${y("cli.init.next.title",{locale:s,fallback:"Next steps"})}${i}:`),console.log(` 1. ${y("cli.init.next.edit",{locale:s,vars:{path:d},fallback:`Edit ${d} to define your skill instructions`})}`),console.log(` 2. ${y("cli.init.next.frontmatter",{locale:s,fallback:"Update the name and description in the frontmatter"})}`),console.log(),console.log(`${c}${y("cli.init.publish.title",{locale:s,fallback:"Publishing"})}${i}:`),console.log(` ${c}GitHub:${i} ${y("cli.init.publish.github",{locale:s,vars:{cmd:"easbot skills"},fallback:"Push to a repo, then easbot skills add <owner>/<repo>"})}`),console.log(` ${c}URL:${i} ${y("cli.init.publish.url",{locale:s,vars:{cmd:"easbot skills",path:d},fallback:"Host the file, then easbot skills add https://example.com/"+d})}`),console.log(),console.log(`${c}${y("cli.init.browse_hint",{locale:s,vars:{url:"https://skills.sh/"},fallback:"Browse existing skills for inspiration at https://skills.sh/"})}${i}`),console.log(),0}async function Qc(e,t){xi(t?.version);let s=t?.inAgent??await Tt();if(e.length===0)return s||Ai(t),{code:0,handled:false};let l=e[0],n=e.slice(1);switch(l){case "find":case "search":case "f":case "s":return s||hl(),console.log(),{code:await vs(n),handled:true,command:l};case "init":return s||hl(),console.log(),{code:Li(n,t),handled:true,command:l};case "a":case "add":{s||hl();let{source:o,options:r}=Pt(n);return await rt(o,r),{code:0,handled:true,command:l}}case "use":{let{source:o,options:r,errors:g}=Us(n);return await Fs(o,r,g),{code:0,handled:true,command:l}}case "remove":case "rm":case "r":{if(n.includes("--help")||n.includes("-h"))return Ii(t),{code:0,handled:true,command:l};let{skills:o,options:r}=Ls(n);return await Is(o,r),{code:0,handled:true,command:l}}case "list":case "ls":return await xs(n,{cwd:t?.cwd}),{code:0,handled:true,command:l};case "doctor":case "dr":return n.includes("--help")||n.includes("-h")?(Ti(t),{code:0,handled:true,command:l}):(await js(n,t?.cwd?{cwd:t.cwd}:void 0),{code:0,handled:true,command:l});case "check":case "update":case "upgrade":return await ns(n,{cwd:t?.cwd}),{code:0,handled:true,command:l};case "store":return {code:await $s(n),handled:true,command:l};default:{let o=et(t);return console.log(y("cli.unknown_command",{locale:o,vars:{command:l??""},fallback:`Unknown command: ${l}`})),console.log(y("cli.help_hint",{locale:o,vars:{cmd:"skills"},fallback:"Run skills --help for usage."})),{code:1,handled:true,command:l}}}}
|
|
255
|
-
export{Eo as A,xs as B,Is as C,Ls as D,js as E,Us as F,li as G,si as H,Fs as I,ni as J,Ai as K,Zc as L,Qc as M,Qt as a,Wl as b,Hl as c,zl as d,tl as e,Je as f,Tt as g,Qi as h,ql as i,xn as j,Cr as k,An as l,ts as m,ns as n,ps as o,rt as p,Pt as q,io as r,$s as s,ao as t,po as u,fo as v,ho as w,wo as x,ws as y,vs as z};
|