@easbot/skills 0.3.9 → 0.3.11
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/dist/assets/txt/template/skill-template-en-US.txt +50 -0
- package/dist/assets/txt/template/skill-template-zh-CN.txt +50 -0
- package/dist/chunks/blob-LYSE5I24.mjs +1 -0
- package/dist/chunks/blob-NYUAIVUS.cjs +1 -0
- package/dist/chunks/chunk-4IO7TNWC.mjs +223 -0
- package/dist/chunks/chunk-IWCI7DET.mjs +6 -0
- package/dist/chunks/chunk-KJPMAUXZ.cjs +1 -0
- package/dist/chunks/chunk-L6KE3VIY.mjs +2 -0
- package/dist/chunks/chunk-PGDLW2JN.cjs +2 -0
- package/dist/chunks/chunk-S76WRD5J.cjs +6 -0
- package/dist/chunks/chunk-WQJKBJSM.cjs +223 -0
- package/dist/chunks/chunk-Y2X6FBMZ.mjs +1 -0
- package/dist/chunks/scan-47YPOLJX.mjs +1 -0
- package/dist/chunks/scan-5G765ZEF.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 +141 -15
- package/dist/index.d.ts +141 -15
- package/dist/index.mjs +1 -1
- package/package.json +4 -5
- package/dist/chunks/blob-3ZTTX2CZ.mjs +0 -1
- package/dist/chunks/blob-UAS6F4BG.cjs +0 -1
- package/dist/chunks/chunk-RGCRYSZ6.mjs +0 -208
- package/dist/chunks/chunk-X5DHWONF.cjs +0 -208
- package/dist/chunks/chunk-XDSGBJHO.cjs +0 -2
- package/dist/chunks/chunk-ZEMGS5WR.mjs +0 -2
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import {e,f,b as b$1,h as h$1,a as a$1}from'./chunk-L6KE3VIY.mjs';import {h,w,x as x$1,u as u$2,k,n as n$1,l,y,A as A$1,s as s$1,r as r$1,d,e as e$1,b,v as v$1,E,m,z,t,j,D as D$1}from'./chunk-IWCI7DET.mjs';import {a,u as u$1,c as c$1,s,p,r,A,o,n,w as w$1,K,L,x as x$2,J,C,D,b as b$2}from'./chunk-Y2X6FBMZ.mjs';import {dirname,resolve,join,normalize,sep,basename,relative,isAbsolute}from'path';import ni from'simple-git';import {mkdtemp,rm,cp,readdir,mkdir,writeFile,lstat,realpath,access,readFile,stat}from'fs/promises';import {tmpdir,homedir}from'os';import {execFile,execSync,spawn}from'child_process';import {promisify,stripVTControlCharacters}from'util';import {createHash}from'crypto';import {gunzipSync,inflateRawSync}from'zlib';import {existsSync,readdirSync,mkdirSync,writeFileSync,readFileSync}from'fs';import {Log,loadTextFile,Filesystem,resolveLocaleLang,Grep,PKG,formatLocalISO}from'@easbot/utils';import {determineAgent}from'@vercel/detect-agent';import S from'picocolors';import*as x from'@clack/prompts';import*as en from'readline';import {Writable}from'stream';import {fileURLToPath}from'url';function Te(t){if(t.type==="local")return null;let e=t.url.match(/^git@[^:]+:(.+)$/);if(e){let n=e[1];return n=n.replace(/\.git$/,""),n.includes("/")?n:null}if(t.url.startsWith("ssh://"))try{let s=new URL(t.url).pathname.slice(1);return s=s.replace(/\.git$/,""),s.includes("/")?s:null}catch{return null}if(!t.url.startsWith("http://")&&!t.url.startsWith("https://"))return null;try{let s=new URL(t.url).pathname.slice(1);if(s=s.replace(/\.git$/,""),s.includes("/"))return s}catch{}return null}function $n(t){let e=t.match(/^([^/]+)\/([^/]+)$/);return e?{owner:e[1],repo:e[2]}:null}async function zt(t,e){try{let n=await fetch(`https://api.github.com/repos/${t}/${e}`);return n.ok?(await n.json()).private===!0:null}catch{return null}}function Ht(t){let n=t.replace(/\\/g,"/").split("/");for(let s of n)if(s==="..")throw new Error(`Unsafe subpath: "${t}" contains path traversal segments. Subpaths must not contain ".." components.`);return t}function Xl(t){return isAbsolute(t)||t.startsWith("./")||t.startsWith("../")||t==="."||t===".."||/^[a-zA-Z]:[/\\]/.test(t)}var Zl={"coinbase/agentWallet":"coinbase/agentic-wallet-skills"};function bn(t){try{return decodeURIComponent(t)}catch{return t}}function Ql(t){if(t.startsWith("github:")||t.startsWith("gitlab:")||t.startsWith("git@")||/^ssh:\/\/.+\.git(?:$|[/?])/i.test(t))return true;if(t.startsWith("http://")||t.startsWith("https://"))try{let e=new URL(t),n=e.pathname;if(e.hostname==="github.com")return /^\/[^/]+\/[^/]+(?:\.git)?(?:\/tree\/[^/]+(?:\/.*)?)?\/?$/.test(n);if(e.hostname==="gitlab.com")return /^\/.+?\/[^/]+(?:\.git)?(?:\/-\/tree\/[^/]+(?:\/.*)?)?\/?$/.test(n)}catch{}return /^https?:\/\/.+\.git(?:$|[/?])/i.test(t)?true:!t.includes(":")&&!t.startsWith(".")&&!t.startsWith("/")&&/^([^/]+)\/([^/]+)(?:\/(.+)|@(.+))?$/.test(t)}function ei(t){let e=t.indexOf("#");if(e<0)return {inputWithoutFragment:t};let n=t.slice(0,e),s=t.slice(e+1);if(!s)return {inputWithoutFragment:n};if(!Ql(n))return {inputWithoutFragment:t};let l=s.indexOf("@");if(l===-1)return {inputWithoutFragment:n,ref:bn(s)};let i=s.slice(0,l),o=s.slice(l+1);return {inputWithoutFragment:n,ref:i?bn(i):void 0,subpath:o?bn(o):void 0}}function us(t,e,n){return e?`${t}#${e}${n?`@${n}`:""}`:t}function lt(t){if(Xl(t)){let f=resolve(t);return {type:"local",url:f,localPath:f}}let{inputWithoutFragment:e,ref:n,subpath:s}=ei(t);t=e;let l=Zl[t];l&&(t=l);let i=t.match(/^github:(.+)$/);if(i)return lt(us(i[1],n,s));let o=t.match(/^gitlab:(.+)$/);if(o)return lt(us(`https://gitlab.com/${o[1]}`,n,s));let a=t.match(/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)\/(.+)/);if(a){let[,f,$,g,w]=a;return {type:"github",url:`https://github.com/${f}/${$}.git`,ref:g||n,subpath:w&&Ht(w)}}let r=t.match(/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)$/);if(r){let[,f,$,g]=r;return {type:"github",url:`https://github.com/${f}/${$}.git`,ref:g||n}}let d=t.match(/github\.com\/([^/]+)\/([^/]+)/);if(d){let[,f,$]=d,g=$.replace(/\.git$/,"");return {type:"github",url:`https://github.com/${f}/${g}.git`,...n?{ref:n}:{}}}let p=t.match(/^(https?):\/\/([^/]+)\/(.+?)\/-\/tree\/([^/]+)\/(.+)/);if(p){let[,f,$,g,w,I]=p;if($!=="github.com"&&g)return {type:"gitlab",url:`${f}://${$}/${g.replace(/\.git$/,"")}.git`,ref:w||n,subpath:I&&Ht(I)}}let y=t.match(/^(https?):\/\/([^/]+)\/(.+?)\/-\/tree\/([^/]+)$/);if(y){let[,f,$,g,w]=y;if($!=="github.com"&&g)return {type:"gitlab",url:`${f}://${$}/${g.replace(/\.git$/,"")}.git`,ref:w||n}}let b=t.match(/gitlab\.com\/(.+?)(?:\.git)?\/?$/);if(b){let f=b[1];if(f.includes("/"))return {type:"gitlab",url:`https://gitlab.com/${f}.git`,...n?{ref:n}:{}}}let h=t.match(/^([^/@]+)\/([^/@]+)@(.+)?$/);if(h&&!t.includes(":")&&!t.startsWith(".")&&!t.startsWith("/")){let f=h[1],$=h[2],g=h[3];if(!g)return {type:"github",url:`https://github.com/${f}/${$}.git`,...n?{ref:n}:{}};let w=Ht(g);return {type:"github",url:`https://github.com/${f}/${$}.git`,...n?{ref:n}:{},...w?{subpath:w}:{}}}let k=t.match(/^([^/@]+)\/([^/@]+)(?:\/(.+?))?\/?$/);if(k&&!t.includes(":")&&!t.startsWith(".")&&!t.startsWith("/")){let[,f,$,g]=k;return {type:"github",url:`https://github.com/${f}/${$}.git`,...n?{ref:n}:{},subpath:s??(g&&Ht(g))}}return ti(t)?{type:"well-known",url:t}:{type:"git",url:t,...n?{ref:n}:{},...s?{subpath:s}:{}}}function ti(t){if(!t.startsWith("http://")&&!t.startsWith("https://"))return false;try{let e=new URL(t);return !(["github.com","gitlab.com","raw.githubusercontent.com"].includes(e.hostname)||t.endsWith(".git"))}catch{return false}}var ds=3e5,wn=(()=>{let t=process.env.SKILLS_CLONE_TIMEOUT;if(!t)return ds;let e=Number.parseInt(t,10);return Number.isFinite(e)&&e>0?e:ds})(),fs=promisify(execFile),Pe=class extends Error{constructor(n,s,l=false,i=false){super(n);a(this,"url");a(this,"isTimeout");a(this,"isAuthError");this.name="GitCloneError",this.url=s,this.isTimeout=l,this.isAuthError=i;}};function ci(t){let e=t.match(/^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/i);if(e){let n=e[1],s=e[2];return {owner:n,repo:s,slug:`${n}/${s}`,sshUrl:`git@github.com:${n}/${s}.git`}}try{let n=new URL(t);if(n.hostname!=="github.com")return null;let s=n.pathname.match(/^\/([^/]+)\/([^/]+?)(?:\.git)?\/?$/);if(!s)return null;let l=s[1],i=s[2];return {owner:l,repo:i,slug:`${l}/${i}`,sshUrl:`git@github.com:${l}/${i}.git`}}catch{return null}}function ui(t){try{let e=new URL(t);return e.protocol==="https:"&&e.hostname==="github.com"}catch{return false}}function ys(t){let e=t.toLowerCase();return e.includes("saml sso")||e.includes("enforced sso")||e.includes("enabled or enforced saml")||e.includes("re-authorize the oauth application")}function pi(t){return t.includes("Authentication failed")||t.includes("could not read Username")||t.includes("Permission denied")||t.includes("Repository not found")||t.includes("requested URL returned error: 403")||ys(t)}function ms(t){let e={...process.env,GIT_TERMINAL_PROMPT:"0",GIT_LFS_SKIP_SMUDGE:"1",...t};return ni({timeout:{block:wn},config:["filter.lfs.required=false"]}).env(e)}async function hs(t){try{await rm(t,{recursive:!0,force:!0});}catch{}await mkdir(t,{recursive:true});}async function gi(t,e,n){let s=t.slug;try{let{stdout:i,stderr:o}=await fs("gh",["auth","status","-h","github.com"],{timeout:5e3,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),a=`${i}${o}`;/Git operations protocol:\s+ssh/i.test(a)&&(s=t.sshUrl);}catch{return false}return await fs("gh",["repo","clone",s,e,"--",...n?["--depth=1","--branch",n]:["--depth=1"]],{timeout:wn,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),true}function di(t,e,n){return e&&ys(n)?`GitHub blocked HTTPS access to ${t} because the organization enforces SAML SSO.
|
|
2
|
+
skills tried your existing git credentials and available fallbacks, but none succeeded.
|
|
3
|
+
- Re-authorize your GitHub credentials/app for that org's SSO policy
|
|
4
|
+
- Or rerun with SSH: easbot skills add ${e.sshUrl}
|
|
5
|
+
- Verify access with: gh auth status -h github.com or ssh -T git@github.com`:e?`Authentication failed for ${t}.
|
|
6
|
+
- For private repos, ensure you have access
|
|
7
|
+
- Retry with SSH: easbot skills add ${e.sshUrl}
|
|
8
|
+
- Check access with: gh auth status -h github.com or ssh -T git@github.com`:`Authentication failed for ${t}.
|
|
9
|
+
- For private repos, ensure you have access
|
|
10
|
+
- For SSH: Check your keys with 'ssh -T git@github.com'
|
|
11
|
+
- For HTTPS: Run 'gh auth login' or configure git credentials`}async function yt(t,e){let n=await mkdtemp(join(tmpdir(),"skills-")),s=e?["--depth","1","--branch",e]:["--depth","1"],l=ci(t);try{return await ms().clone(t,n,s),n}catch(i){let o=i instanceof Error?i.message:String(i),a=o.includes("block timeout")||o.includes("timed out"),r=pi(o);if(a){try{await rm(n,{recursive:!0,force:!0});}catch{}let p=Math.round(wn/1e3);throw new Pe(`Clone timed out after ${p}s. Common causes:
|
|
12
|
+
- Large repository: raise the timeout with SKILLS_CLONE_TIMEOUT=600000 (10m)
|
|
13
|
+
- Slow network: retry, or clone manually and pass the local path to 'skills add'
|
|
14
|
+
- Private repo without credentials: ensure auth is configured
|
|
15
|
+
- For SSH: ssh-add -l (to check loaded keys)
|
|
16
|
+
- For HTTPS: gh auth status (if using GitHub CLI)`,t,true,false)}if(r&&l&&ui(t)){try{if(await hs(n),await gi(l,n,e))return n}catch{}try{return await hs(n),await ms({GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND??"ssh -o BatchMode=yes"}).clone(l.sshUrl,n,s),n}catch{}}try{await rm(n,{recursive:!0,force:!0});}catch{}if(r)throw new Pe(di(t,l,o),t,false,true);let d=o.includes("filter.smudge")?`
|
|
17
|
+
- The repo defines a smudge/clean filter that Git considers unsafe.
|
|
18
|
+
Enable it with: git config --global protocol.allowUnsafeFilter true
|
|
19
|
+
Or upgrade Git, or unset filter.<driver>.* in the source repo.`:"";throw new Pe(`Failed to clone ${t}: ${o}${d}`,t,false,false)}}async function ze(t){let e=normalize(resolve(t)),n=normalize(resolve(tmpdir()));if(!e.startsWith(n+sep)&&e!==n)throw new Error("Attempted to clean up directory outside of temp directory");await rm(t,{recursive:true,force:true});}var bs="https://schemas.agentskills.io/discovery/0.2.0/schema.json",ki=50*1024*1024,yi=1e3,Sn=class{constructor(){a(this,"id","well-known");a(this,"displayName","Well-Known Skills");a(this,"WELL_KNOWN_PATHS",[".well-known/agent-skills",".well-known/skills"]);a(this,"INDEX_FILE","index.json");}match(e){if(!e.startsWith("http://")&&!e.startsWith("https://"))return {matches:false};try{let n=new URL(e);return ["github.com","gitlab.com","huggingface.co"].includes(n.hostname)?{matches:!1}:{matches:!0,sourceIdentifier:`wellknown/${n.hostname}`}}catch{return {matches:false}}}async fetchIndex(e){return (await this.fetchIndexCandidates(e))[0]??null}async fetchIndexCandidates(e){try{let n=new URL(e),s=n.pathname.replace(/\/$/,""),l=[];for(let o of this.WELL_KNOWN_PATHS)l.push({indexUrl:`${n.protocol}//${n.host}${s}/${o}/${this.INDEX_FILE}`,baseUrl:`${n.protocol}//${n.host}${s}`,wellKnownPath:o}),s&&s!==""&&l.push({indexUrl:`${n.protocol}//${n.host}/${o}/${this.INDEX_FILE}`,baseUrl:`${n.protocol}//${n.host}`,wellKnownPath:o});let i=[];for(let{indexUrl:o,baseUrl:a,wellKnownPath:r}of l)try{let d=await fetch(o);if(!d.ok)continue;let p=await d.json(),y=this.normalizeIndex(p,o,r);if(!y)continue;i.push({index:y.index,entries:y.entries,resolvedBaseUrl:a,resolvedWellKnownPath:r,indexUrl:o});}catch{}return i}catch{return []}}normalizeIndex(e,n,s){if(!e||typeof e!="object")return null;let l=e;if(!Array.isArray(l.skills))return null;let i=l.$schema;if(i===bs){let r=[],d=[];for(let p of l.skills){if(!this.isValidSkillEntryV2(p))continue;let y=new URL(p.url,n).toString();r.push({version:"0.2.0",name:p.name,description:p.description,type:p.type,artifactUrl:y,digest:p.digest,indexEntry:p}),d.push(p);}return r.length===0?null:{index:{$schema:bs,skills:d},entries:r}}if(i!==void 0)return null;let o=[],a=[];for(let r of l.skills){if(!this.isValidSkillEntryV1(r))return null;o.push(r),a.push({version:"0.1.0",name:r.name,description:r.description,files:r.files,baseUrl:this.getLegacySkillBaseUrl(n,s),wellKnownPath:s,indexEntry:r});}return {index:{skills:o},entries:a}}getLegacySkillBaseUrl(e,n){let s=new URL(e),l=`/${n}/${this.INDEX_FILE}`;return `${s.protocol}//${s.host}${s.pathname.slice(0,-l.length)}`}isValidSkillName(e){return !(typeof e!="string"||e.length===0||e.length>64||!/^[a-z0-9-]+$/.test(e)||e.startsWith("-")||e.endsWith("-")||e.includes("--"))}isSafeLegacyFilePath(e){return !(typeof e!="string"||e.length===0||e.startsWith("/")||e.startsWith("\\")||e.includes("..")||e.includes("\0"))}isValidSkillEntryV1(e){if(!e||typeof e!="object")return false;let n=e;if(!this.isValidSkillName(n.name)||typeof n.description!="string"||!n.description||!Array.isArray(n.files)||n.files.length===0)return false;for(let l of n.files)if(!this.isSafeLegacyFilePath(l))return false;return n.files.some(l=>typeof l=="string"&&l.toLowerCase()==="skill.md")}isValidSkillEntryV2(e){if(!e||typeof e!="object")return false;let n=e;if(!this.isValidSkillName(n.name)||typeof n.description!="string"||!n.description||n.description.length>1024||n.type!=="skill-md"&&n.type!=="archive"||typeof n.url!="string"||!n.url||typeof n.digest!="string"||!/^sha256:[a-f0-9]{64}$/.test(n.digest))return false;try{new URL(n.url,"https://example.com/.well-known/agent-skills/index.json");}catch{return false}return true}async fetchSkill(e){try{let n=new URL(e),s=await this.fetchIndexCandidates(e);for(let l of s){let{entries:i}=l,o=null,a=n.pathname.match(/\/.well-known\/(?:agent-skills|skills)\/([^/]+)\/?$/);if(a?.[1]&&a[1]!=="index.json"?o=a[1]:i.length===1&&(o=i[0].name),!o)continue;let r=i.find(p=>p.name===o);if(!r)continue;let d=await this.fetchSkillByEntry(r);if(d)return d}return null}catch{return null}}async fetchSkillByEntry(e,n,s){return typeof e=="string"?n?this.fetchLegacySkillByEntry({version:"0.1.0",name:n.name,description:n.description,files:n.files,baseUrl:e,wellKnownPath:s??this.WELL_KNOWN_PATHS[0],indexEntry:n}):null:e.version==="0.1.0"?this.fetchLegacySkillByEntry(e):this.fetchArtifactSkillByEntry(e)}async fetchLegacySkillByEntry(e){try{let n=`${e.baseUrl.replace(/\/$/,"")}/${e.wellKnownPath}/${e.name}`,s=`${n}/SKILL.md`,l=await fetch(s);if(!l.ok)return null;let i=await l.text(),{data:o}=u$1(i);if(typeof o.name!="string"||typeof o.description!="string")return null;let a=new Map;a.set("SKILL.md",i);let d=e.files.filter(y=>y.toLowerCase()!=="skill.md").map(async y=>{try{let b=`${n}/${y}`,h=await fetch(b);if(h.ok){let k=await h.arrayBuffer();return {path:y,content:new Uint8Array(k)}}}catch{}return null}),p=await Promise.all(d);for(let y of p)y&&a.set(y.path,y.content);return this.createSkill({name:o.name,description:o.description,content:i,installName:e.name,sourceUrl:s,metadata:o.metadata,files:a,indexEntry:e.indexEntry})}catch{return null}}async fetchArtifactSkillByEntry(e){try{let n=await fetch(e.artifactUrl);if(!n.ok)return null;let s=n.headers.get("content-type")??"",l=new Uint8Array(await n.arrayBuffer());if(this.computeDigest(l)!==e.digest)return null;if(e.type==="skill-md"){let d=new TextDecoder().decode(l),{data:p}=u$1(d);if(typeof p.name!="string"||typeof p.description!="string")return null;let y=new Map;return y.set("SKILL.md",d),this.createSkill({name:p.name,description:p.description,content:d,installName:e.name,sourceUrl:e.artifactUrl,metadata:p.metadata,files:y,indexEntry:e.indexEntry})}let i=this.extractArchive(l,e.artifactUrl,s),o=i.get("SKILL.md");if(!o)return null;let a=typeof o=="string"?o:new TextDecoder().decode(o);i.set("SKILL.md",a);let{data:r}=u$1(a);return typeof r.name!="string"||typeof r.description!="string"?null:this.createSkill({name:r.name,description:r.description,content:a,installName:e.name,sourceUrl:e.artifactUrl,metadata:r.metadata,files:i,indexEntry:e.indexEntry})}catch{return null}}createSkill(e){return {name:c$1(e.name),description:c$1(e.description),content:e.content,installName:e.installName,sourceUrl:e.sourceUrl,metadata:e.metadata&&typeof e.metadata=="object"?e.metadata:void 0,files:e.files,indexEntry:e.indexEntry}}async fetchAllSkills(e){try{let n=await this.fetchIndexCandidates(e);for(let s of n){let l=s.entries.map(a=>this.fetchSkillByEntry(a)),o=(await Promise.all(l)).filter(a=>a!==null);if(o.length>0)return o}return []}catch{return []}}computeDigest(e){return `sha256:${createHash("sha256").update(e).digest("hex")}`}extractArchive(e,n,s){if(this.isZipArchive(e,n,s))return this.extractZip(e);if(this.isTarGzArchive(e,n,s))return this.extractTarGz(e);throw new Error("Unsupported archive format")}isZipArchive(e,n,s){return s.includes("application/zip")||n.toLowerCase().endsWith(".zip")||e[0]===80&&e[1]===75}isTarGzArchive(e,n,s){let l=n.toLowerCase();return s.includes("application/gzip")||s.includes("application/x-gzip")||l.endsWith(".tar.gz")||l.endsWith(".tgz")||e[0]===31&&e[1]===139}normalizeArchivePath(e){if(!e||e.includes("\0")||e.startsWith("/")||e.startsWith("\\")||/^[A-Za-z]:/.test(e)||e.includes("\\"))return null;let n=e.split("/").filter(Boolean);return n.length===0||n.some(s=>s==="."||s==="..")?null:n.join("/")}addArchiveFile(e,n,s,l){let i=this.normalizeArchivePath(n);if(!i)throw new Error(`Unsafe archive path: ${n}`);if(l.bytes+=s.byteLength,l.bytes>ki)throw new Error("Archive exceeds maximum unpacked size");if(e.size>=yi)throw new Error("Archive contains too many files");e.set(i,s);}extractTarGz(e){let n=gunzipSync(Buffer.from(e)),s=new Map,l={bytes:0},i=0;for(;i+512<=n.length;){let o=n.subarray(i,i+512);if(o.every(k=>k===0))break;let a=this.readTarString(o,0,100),r=this.readTarString(o,124,12).trim(),d=o[156],p=this.readTarString(o,345,155),y=p?`${p}/${a}`:a,b=Number.parseInt(r||"0",8);if(!Number.isFinite(b)||b<0)throw new Error("Invalid tar entry size");if(i+=512,d===50||d===49)throw new Error("Archive links are not supported");if(d===0||d===48){let k=n.subarray(i,i+b);this.addArchiveFile(s,y,new Uint8Array(k),l);}i+=Math.ceil(b/512)*512;}if(!s.has("SKILL.md"))throw new Error("Archive missing root SKILL.md");return s}readTarString(e,n,s){let l=e.subarray(n,n+s),i=l.indexOf(0);return new TextDecoder().decode(i>=0?l.subarray(0,i):l)}extractZip(e){let n=Buffer.from(e),s=this.findZipEndOfCentralDirectory(n);if(s<0)throw new Error("Invalid zip archive");let l=n.readUInt16LE(s+10),i=n.readUInt32LE(s+16),o=new Map,a={bytes:0},r=i;for(let d=0;d<l;d++){if(n.readUInt32LE(r)!==33639248)throw new Error("Invalid zip directory");let p=n.readUInt16LE(r+8),y=n.readUInt16LE(r+10),b=n.readUInt32LE(r+20),h=n.readUInt32LE(r+24),k=n.readUInt16LE(r+28),f=n.readUInt16LE(r+30),$=n.readUInt16LE(r+32),g=n.readUInt32LE(r+38),w=n.readUInt32LE(r+42),I=r+46,W=n.subarray(I,I+k),_=new TextDecoder(p&2048?"utf-8":void 0).decode(W);if(r=I+k+f+$,_.endsWith("/"))continue;if(p&1)throw new Error("Encrypted zip entries are not supported");let L=g>>>16&61440;if(L===40960||L===4096)throw new Error("Archive links are not supported");if(n.readUInt32LE(w)!==67324752)throw new Error("Invalid zip local header");let C=n.readUInt16LE(w+26),V=n.readUInt16LE(w+28),ee=w+30+C+V,O=n.subarray(ee,ee+b),q;if(y===0)q=O;else if(y===8)q=inflateRawSync(O);else throw new Error(`Unsupported zip compression method: ${y}`);if(q.byteLength!==h)throw new Error("Zip entry size mismatch");this.addArchiveFile(o,_,new Uint8Array(q),a);}if(!o.has("SKILL.md"))throw new Error("Archive missing root SKILL.md");return o}findZipEndOfCentralDirectory(e){let n=Math.max(0,e.length-65535-22);for(let s=e.length-22;s>=n;s--)if(e.readUInt32LE(s)===101010256)return s;return -1}toRawUrl(e){try{let n=new URL(e);if(e.toLowerCase().endsWith("/skill.md"))return e;let s=this.WELL_KNOWN_PATHS[0],l=n.pathname.match(/\/.well-known\/(?:agent-skills|skills)\/([^/]+)\/?$/);if(l?.[1]){let o=n.pathname.replace(/\/.well-known\/(?:agent-skills|skills)\/.*$/,"");return `${n.protocol}//${n.host}${o}/${s}/${l[1]}/SKILL.md`}let i=n.pathname.replace(/\/$/,"");return `${n.protocol}//${n.host}${i}/${s}/${this.INDEX_FILE}`}catch{return e}}getSourceIdentifier(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return "unknown"}}async hasSkillsIndex(e){return await this.fetchIndex(e)!==null}},Gt=new Sn;function H(t){return Filesystem.normalize(t)}async function vn(t){let e=Filesystem.join(t,"SKILL.md");try{let n=await readFile(H(e));return createHash("sha256").update(n).digest("hex")}catch{return}}function Si({scope:t}){let e=t==="project"?s():p(),n=Filesystem.join(e,t==="project"?".easbot":"easbot","skills");return Filesystem.normalize(n)}function Oe(){return Filesystem.join(p(),"skills","store")}function wt(){return Filesystem.join(Oe(),"index.json")}function bt(t){let n=[t.type,t.url,t.subpath??"",t.ref??""].join("|");return createHash("sha256").update(n).digest("hex")}function Tn(t){let e=bt(t);return Filesystem.join(Oe(),e)}function Be(){return Filesystem.join(r(),"skills","cache")}function Ss(t){if(t.type==="well-known")return vi(t.url);let e=Te(t);if(e)return Filesystem.join(Be(),e);let n=t.url.replace(/^https?:\/\//,"").replace(/^git@[^:]+:/,"").replace(/\.git$/,"").replace(/[/:]/g,"-");return Filesystem.join(Be(),n)}function vi(t){let n=new URL(t).origin,s=createHash("sha256").update(n).digest("hex").slice(0,16);return Filesystem.join(Be(),`wellknown-${s}`)}async function St(t){t.skillNames??[];if(t.type==="local")return xi(t);let n=t.mode??"install",{cacheDir:s,source:l}=await Ai(t,n);return Li(s,l,t)}var $t=class extends Error{constructor(n){super(`Local source path does not exist: ${n}`);a(this,"localPath",n);this.name="LocalPathNotFoundError";}};async function xi(t,e){let n=t.localPath??t.url;if(!existsSync(n))throw new $t(n);let s=Tn(t);bt(t);if(existsSync(s))return {storeDir:s,cacheHit:true,source:"local-cp"};await Filesystem.mkdir(H(Filesystem.dirname(s)),{recursive:true});try{await cp(H(n),H(s),{recursive:!0});}catch{await Filesystem.mkdir(H(s),{recursive:true}).catch(()=>{});}return {storeDir:s,cacheHit:false,source:"local-cp"}}async function Ai(t,e){let n=t.ref??"HEAD",s=Ss(t);if(t.type==="well-known")return existsSync(s)?{cacheDir:s,source:"cache-pull"}:(await Filesystem.mkdir(H(s),{recursive:true}),await Ti(t.url,s),{cacheDir:s,source:"well-known-fetch"});if(existsSync(s))try{let l=ni(s);return e==="update"?(await l.fetch(),await l.checkout(n),{cacheDir:s,source:"cache-pull"}):(await l.checkout(n),{cacheDir:s,source:"cache-pull"})}catch{return {cacheDir:s,source:"cache-pull"}}try{await Filesystem.mkdir(H(Filesystem.dirname(s)),{recursive:!0});let l=await yt(t.url,n),i=await readdir(H(l));if(i.length!==1)throw new Error(`Expected single repo dir in ${l}, got ${i.length}`);return await cp(H(Filesystem.join(l,i[0])),H(s),{recursive:!0}),{cacheDir:s,source:"cache-clone"}}catch{return await Filesystem.mkdir(H(s),{recursive:true}).catch(()=>{}),{cacheDir:s,source:"cache-pull"}}}async function Li(t,e,n,s){let l=Tn(n);if(existsSync(l))return {storeDir:l,cacheHit:true,source:e};await Filesystem.mkdir(H(Filesystem.dirname(l)),{recursive:true});try{await cp(H(t),H(l),{recursive:!0});}catch{await Filesystem.mkdir(H(l),{recursive:true}).catch(()=>{});}return {storeDir:l,cacheHit:false,source:e}}async function Ce(){let t=H(wt());try{let e=await Filesystem.readText(t);return JSON.parse(e)}catch{return {}}}async function xn(t){if(t.length===0)return;let e=await Ce(),n=new Date().toISOString();for(let s of t)e[s.skillName]={sourceKey:s.sourceKey,sourcePath:s.sourcePath,storePath:s.storePath,type:s.parsed.type,url:s.parsed.url,localPath:s.parsed.localPath,subpath:s.parsed.subpath,ref:s.parsed.ref,addedAt:n,...s.computedHash&&{computedHash:s.computedHash}};await Filesystem.writeJson(H(wt()),e);}async function Yt(t){let e=await Ce();return t in e?(delete e[t],await Filesystem.writeJson(H(wt()),e),true):false}async function Ti(t,e){let n;try{n=await Gt.fetchAllSkills(t);}catch{return}if(n.length!==0)for(let s of n)try{await Ii(s,e);}catch{}}async function Ii(t,e){let n=Filesystem.join(e,t.installName),s=Filesystem.normalize(n),l=Filesystem.normalize(e);if(!s.startsWith(`${l}/`)&&s!==l)throw new Error(`Unsafe skill dir: ${t.installName}`);await mkdir(H(n),{recursive:true});for(let[i,o]of t.files){let a=Filesystem.join(n,i),r=Filesystem.normalize(a);if(!r.startsWith(`${s}/`)&&r!==s||i.includes("\0"))continue;let d=dirname(H(a));d!==H(n)&&await mkdir(d,{recursive:true}),await writeFile(H(a),typeof o=="string"?o:Buffer.from(o));}}async function Ya(t){return (await St({type:"git",url:t.url,ref:t.ref})).storeDir}async function vs(t,e={}){let n=Tn(t);if(existsSync(n)){let a=await j(n,t.subpath,{includeInternal:e.includeInternal,fullDepth:e.fullDepth});if(a.length>0){let d=await Promise.all(a.map(async p=>({skillName:p.name,parsed:t,sourceKey:bt(t),sourcePath:n,storePath:n,computedHash:await vn(p.path)})));await xn(d);}let r=t.type==="local"?"local-cp":"cache-pull";return {storeDir:n,cacheHit:true,source:r,skills:a,blobSkills:[]}}let l=[];if(t.type==="github"&&!e.fullDepth){let a=Te(t),r=a?.split("/")[0]?.toLowerCase(),d=!!a&&Object.hasOwn(a$1,a.toLowerCase());if(a&&r&&(d||b$1.includes(r))){let p=await h$1(a,{subpath:t.subpath,ref:t.ref,includeInternal:e.includeInternal});if(p&&p.skills.length>0){await Pi(p.skills,n);let y=p.skills.map(h=>({name:h.name,description:h.description,path:Filesystem.join(n,h.name),rawContent:h.files.find(k=>k.path==="SKILL.md")?.contents,pluginName:h.pluginName,metadata:h.metadata})),b=await Promise.all(p.skills.map(async h=>({skillName:h.name,parsed:t,sourceKey:bt(t),sourcePath:n,storePath:n,computedHash:await vn(Filesystem.join(n,h.name))})));return await xn(b),l=p.skills,{storeDir:n,cacheHit:false,source:"blob-fetch",skills:y,blobSkills:l}}}}let i=await St(t),o=await j(i.storeDir,t.subpath,{includeInternal:e.includeInternal,fullDepth:e.fullDepth});if(o.length>0){let a=await Promise.all(o.map(async r=>({skillName:r.name,parsed:t,sourceKey:bt(t),sourcePath:i.storeDir,storePath:i.storeDir,computedHash:await vn(r.path)})));await xn(a);}return {storeDir:i.storeDir,cacheHit:i.cacheHit,source:i.source,skills:o,blobSkills:[]}}async function Pi(t,e){for(let n of t){let s=Filesystem.join(e,n.name),l=Filesystem.normalize(s),i=Filesystem.normalize(e);if(!(!l.startsWith(`${i}/`)&&l!==i))try{await mkdir(H(s),{recursive:!0});for(let o of n.files){let a=Filesystem.join(s,o.path),r=Filesystem.normalize(a);if(!r.startsWith(`${l}/`)&&r!==l||o.path.includes("\0"))continue;let d=dirname(H(a));d!==H(s)&&await mkdir(d,{recursive:!0}),await writeFile(H(a),o.contents,"utf-8");}}catch{}}}function vt(t){try{let e=Filesystem.normalize(t);for(let n of [Be(),Oe()]){let s=Filesystem.normalize(n);if(e===s||e.startsWith(`${s}/`))return !0}return !1}catch{return false}}async function Ja({cachePath:t,skillName:e,scope:n}){let s=Filesystem.join(Si({scope:n}),e);return existsSync(s)&&await rm(H(s),{recursive:true,force:true}),await cp(H(t),H(s),{recursive:true}),s}async function xs(t){let e=Ss(t);existsSync(e)&&await rm(H(e),{recursive:true,force:true});}async function As(){let t=Be();existsSync(t)&&await rm(H(t),{recursive:true,force:true});}async function Rs(t){let e=createHash("sha256");try{let n=await readFile(join(t,"SKILL.md"),"utf-8");e.update("SKILL.md"),e.update(n);}catch{e.update("EMPTY");}return e.digest("hex")}async function In(t,e){let n;try{n=await lstat(t);}catch{return "absent"}if(n.isSymbolicLink())try{let a=Filesystem.toUnixPath(await realpath(t)),r=Filesystem.toUnixPath(await realpath(e));return a===r?"symlinked":"orphan"}catch{return "orphan"}let s=join(t,"SKILL.md");try{await access(s);}catch{return "absent"}if(!await h(s))return "divergent";let i=await Rs(t),o=await Rs(e);return i===o?"copied":"divergent"}function Ls(t,e){let n=[];for(let s of t)for(let l of ["global","project"]){let i=s.cells[l];i.state==="absent"?n.push({kind:"install",agentId:s.agentId,scope:l,mode:e,targetPath:i.targetPath}):i.state==="symlinked"||i.state==="copied"?n.push({kind:"skip",agentId:s.agentId,scope:l,state:i.state}):n.push({kind:"report",agentId:s.agentId,scope:l,state:i.state});}return n}async function Ts(t,e){let n=[],s=[];for(let l of t)if(l.kind!=="skip"){if(l.kind==="report"){s.push(l);continue}try{await mkdir(dirname(l.targetPath),{recursive:!0});let i;l.mode==="symlink"?i=await w(e.sourceDir,l.targetPath,{isGlobal:e.installGlobally&&l.scope==="global",agentType:l.agentId,cwd:e.cwd}):i=await x$1(e.sourceDir,l.targetPath,{agentType:l.agentId,isGlobal:e.installGlobally&&l.scope==="global"}),i.success?(i.symlinkFailed,n.push(l)):s.push({kind:"report",agentId:l.agentId,scope:l.scope,state:"divergent"});}catch{s.push({kind:"report",agentId:l.agentId,scope:l.scope,state:"divergent"});}}return {installed:n,reported:s}}function Is(t,e){let n=[];for(let s of t)if(s==="eve"&&e.includeEveSubagents!==false){let l=A(e.cwd);if(l.length===0)n.push(Ui(e));else for(let i of l)n.push({agentId:s,cells:{global:it("global",s,true,e,i),project:it("project",s,false,e,i)}});}else n.push({agentId:s,cells:{global:it("global",s,true,e),project:it("project",s,false,e)}});return n}function it(t,e,n,s,l){return {scope:t,state:"absent",targetPath:join(u$2(e,n,s.cwd,l),s.skillId),sourceDir:s.sourceDir}}function Ui(t){return {agentId:"eve",cells:{global:it("global","eve",true,t),project:it("project","eve",false,t)}}}async function Pn(t){let e=t.cwd??process.cwd(),n=Filesystem.toUnixPath(t.sourceDir),s=t.includeEveSubagents??true;if(t.assumeYes)return {skipped:true,installed:[],reported:[]};let l=Is(t.targetAgents,{skillId:t.skillId,sourceDir:n,cwd:e,includeEveSubagents:s}),i=[];for(let d of l){let p={...d.cells.global,state:await In(d.cells.global.targetPath,n)},y={...d.cells.project,state:await In(d.cells.project.targetPath,n)};i.push({agentId:d.agentId,cells:{global:p,project:y}});}let o=Ls(i,t.defaultMode),{installed:a,reported:r}=await Ts(o,{sourceDir:n,installGlobally:t.installGlobally,cwd:e});return {skipped:false,installed:a,reported:r,matrix:i}}var Oi="https://add-skill.vercel.sh/t",Di="https://add-skill.vercel.sh/audit",En=null,_n=null;function Cs(t){_n=t;}function Fi(){return !!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.TRAVIS||process.env.BUILDKITE||process.env.JENKINS_URL||process.env.TEAMCITY_VERSION)}function Mi(){return !process.env.DISABLE_TELEMETRY&&!process.env.DO_NOT_TRACK}function Nn(t){En=t;}async function Es(t,e,n=3e3){if(e.length===0)return null;try{let s=new URLSearchParams({source:t,skills:e.join(",")}),l=new AbortController,i=setTimeout(()=>l.abort(),n),o=await fetch(`${Di}?${s.toString()}`,{signal:l.signal});return clearTimeout(i),o.ok?await o.json():null}catch{return null}}var jn=[];function le(t){if(Mi())try{let e=new URLSearchParams;En&&e.set("v",En),Fi()&&e.set("ci","1"),_n&&e.set("agent",_n);for(let[s,l]of Object.entries(t))l!=null&&e.set(s,String(l));let n=fetch(`${Oi}?${e.toString()}`).catch(()=>{}).then(()=>{});jn.push(n);}catch{}}async function dc(t=5e3){if(jn.length===0)return;let e=new Promise(n=>setTimeout(n,t));await Promise.race([Promise.all(jn),e]);}var ot=null,Ki={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 De(){return ot||(ot=await determineAgent(),ot.isAgent&&Cs(ot.agent.name),ot)}async function Jt(){return (await De()).isAgent}async function yc(){let t=await De();return t.isAgent?t.agent.name:null}function Xt(t){return Ki[t]??null}var Ji=".agents",On=".skill-lock.json",_s=3;function js(){let t=o(),e=n(),n$1=process.env.XDG_STATE_HOME;return n$1?join(n$1,"skills",On):t?join(t,"skills",On):join(e||homedir(),Ji,On)}async function ye(){let t=js();try{let e=await readFile(t,"utf-8"),n=JSON.parse(e);return typeof n.version!="number"||!n.skills||n.version<_s?Dn():n}catch{return Dn()}}async function Zt(t){let e=js();await mkdir(dirname(e),{recursive:true});let n=JSON.stringify(t,null,2);await writeFile(e,n,"utf-8");}function Ic(t){return createHash("sha256").update(t,"utf-8").digest("hex")}var Fn=false;function Pc(){Fn=false;}function Qt(){if(process.env.GITHUB_TOKEN)return process.env.GITHUB_TOKEN;if(process.env.GH_TOKEN)return process.env.GH_TOKEN;Fn||(process.stderr.write(`${S.yellow("\u2502")} ${S.yellow("GitHub rate limit reached")} \u2014 using your ${S.cyan("gh")} login to continue.
|
|
20
|
+
${S.yellow("\u2502")} ${S.dim(`Tip: set ${S.cyan("GITHUB_TOKEN")} to avoid this prompt, or use ${S.cyan("--full-depth")} to clone instead.
|
|
21
|
+
`)}`),Fn=true);try{let t=execSync("gh auth token",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(t)return t}catch{}return null}async function Rc(t,e,n,s){let{fetchRepoTree:l,getSkillFolderHashFromTree:i}=await import('./blob-LYSE5I24.mjs'),o=await l(t,s,n??void 0);return o?i(o,e):null}async function Ns(t,e){let n=await ye(),s=new Date().toISOString(),l=n.skills[t];n.skills[t]={...e,installedAt:l?.installedAt??s,updatedAt:s},await Zt(n);}async function Us(t){let e=await ye();return t in e.skills?(delete e.skills[t],await Zt(e),true):false}async function Os(t){return (await ye()).skills[t]??null}async function Ds(){return (await ye()).skills}async function Cc(){let t=await ye(),e=new Map;for(let[n,s]of Object.entries(t.skills)){let l=e.get(s.source);l?l.skills.push(n):e.set(s.source,{skills:[n],entry:s});}return e}function Dn(){return {version:_s,skills:{},dismissed:{}}}async function Fs(t){return (await ye()).dismissed?.[t]===true}async function xt(t){let e=await ye();e.dismissed||(e.dismissed={}),e.dismissed[t]=true,await Zt(e);}async function Mn(){return (await ye()).lastSelectedAgents}async function Wn(t){let e=await ye();e.lastSelectedAgents=t,await Zt(e);}var Qi=new Writable({write(t,e,n){n();}}),eo=S.green("\u25C6"),to=S.red("\u25A0"),no=S.green("\u25C7"),so=S.green("\u25CF"),lo=S.dim("\u25CB");S.green("\u2713");var io=S.green("\u2022"),ie=S.dim("\u2502"),rt=S.dim("\u2500"),oo=Symbol("cancel");function ro(t){let e=0;for(let n of t){let s=n.codePointAt(0);if(s===0)continue;let l=s>=4352&&s<=4447||s>=8986&&s<=8987||s>=9001&&s<=9002||s>=9193&&s<=9196||s===9200||s===9203||s>=9725&&s<=9726||s>=9748&&s<=9749||s>=9800&&s<=9811||s>=9855&&s<=9855||s>=9875&&s<=9875||s>=9889&&s<=9889||s>=9898&&s<=9899||s>=9917&&s<=9918||s>=9924&&s<=9925||s>=9934&&s<=9934||s>=9940&&s<=9940||s>=9962&&s<=9962||s>=9970&&s<=9971||s>=9973&&s<=9973||s>=9978&&s<=9978||s>=9981&&s<=9981||s>=9989&&s<=9989||s>=9994&&s<=9995||s>=10024&&s<=10024||s>=10060&&s<=10060||s>=10062&&s<=10062||s>=10067&&s<=10069||s>=10071&&s<=10071||s>=10133&&s<=10135||s>=10160&&s<=10160||s>=10175&&s<=10175||s>=11035&&s<=11036||s>=11088&&s<=11088||s>=11093&&s<=11093||s>=11904&&s<=42191&&s!==12351||s>=43360&&s<=43388||s>=44032&&s<=55203||s>=63744&&s<=64255||s>=65040&&s<=65049||s>=65072&&s<=65135||s>=65280&&s<=65376||s>=65504&&s<=65510||s>=126976&&s<=129535;e+=l?2:1;}return e}function ao(t,e){let n=stripVTControlCharacters(t),s=Math.max(1,e),l=ro(n);return Math.max(1,Math.ceil(l/s))}function co(t,e){let n=e!==void 0&&e>0?e:process.stdout.columns&&process.stdout.columns>0?process.stdout.columns:80;return t.reduce((s,l)=>s+ao(l,n),0)}async function at(t){let{message:e,items:n,maxVisible:s=8,initialSelected:l=[],required:i=false,lockedSection:o}=t;return new Promise(a=>{let r=en.createInterface({input:process.stdin,output:Qi,terminal:false});process.stdin.isTTY&&process.stdin.setRawMode(true),en.emitKeypressEvents(process.stdin,r);let d="",p=0,y=new Set(l),b=0,h=o?o.items.map(A=>A.value):[],k=(A,L)=>{if(!L)return true;let C=L.toLowerCase();return A.label.toLowerCase().includes(C)||String(A.value).toLowerCase().includes(C)},f=()=>n.filter(A=>k(A,d)),$=()=>{if(b>0){process.stdout.write(`\x1B[${b}A`);for(let A=0;A<b;A++)process.stdout.write("\x1B[2K\x1B[1B");process.stdout.write(`\x1B[${b}A`);}},g=(A="active")=>{$();let L=[],C=f(),V=A==="active"?eo:A==="cancel"?to:no;if(L.push(`${V} ${S.bold(e)}`),A==="active"){if(o&&o.items.length>0){L.push(`${ie}`);let Q=`${S.bold(o.title)} ${S.dim("\u2500\u2500 always included")}`;L.push(`${ie} ${rt}${rt} ${Q} ${rt.repeat(12)}`);for(let Ne of o.items)L.push(`${ie} ${io} ${S.bold(Ne.label)}`);o.hiddenCount&&o.hiddenCount>0&&L.push(`${ie} ${S.dim(`...and ${o.hiddenCount} more`)}`),L.push(`${ie}`),L.push(`${ie} ${rt}${rt} ${S.bold("Additional agents")} ${rt.repeat(29)}`);}let ee=`${ie} ${S.dim("Search:")} ${d}${S.inverse(" ")}`;L.push(ee),L.push(`${ie} ${S.dim("\u2191\u2193 move, space select, enter confirm")}`),L.push(`${ie}`);let O=Math.max(0,Math.min(p-Math.floor(s/2),C.length-s)),q=Math.min(C.length,O+s),ae=C.slice(O,q);if(C.length===0)L.push(`${ie} ${S.dim("No matches found")}`);else {for(let me=0;me<ae.length;me++){let Me=ae[me],Ie=O+me,ft=y.has(Me.value),be=Ie===p,$e=ft?so:lo,Ct=be?S.underline(Me.label):Me.label,m=Me.hint?S.dim(` (${Me.hint})`):"",P=be?S.cyan("\u276F"):" ";L.push(`${ie} ${P} ${$e} ${Ct}${m}`);}let Q=O,Ne=C.length-q;if(Q>0||Ne>0){let me=[];Q>0&&me.push(`\u2191 ${Q} more`),Ne>0&&me.push(`\u2193 ${Ne} more`),L.push(`${ie} ${S.dim(me.join(" "))}`);}}L.push(`${ie}`);let ce=o?o.items.map(Q=>({value:Q.value,label:Q.label})):[],he=new Set(ce.map(Q=>Q.value)),oe=ce.map(Q=>Q.label);for(let Q of n)!y.has(Q.value)||he.has(Q.value)||(he.add(Q.value),oe.push(Q.label));if(oe.length===0)L.push(`${ie} ${S.dim("Selected: (none)")}`);else {let Q=oe.length<=3?oe.join(", "):`${oe.slice(0,3).join(", ")} +${oe.length-3} more`;L.push(`${ie} ${S.green("Selected:")} ${Q}`);}L.push(`${S.dim("\u2514")}`);}else if(A==="submit"){let ee=[...o?o.items.map(O=>O.label):[],...n.filter(O=>y.has(O.value)).map(O=>O.label)];L.push(`${ie} ${S.dim(ee.join(", "))}`);}else A==="cancel"&&L.push(`${ie} ${S.strikethrough(S.dim("Cancelled"))}`);process.stdout.write(L.join(`
|
|
22
|
+
`)+`
|
|
23
|
+
`),b=co(L,process.stdout.columns);},w=()=>{process.stdin.removeListener("keypress",_),process.stdin.isTTY&&process.stdin.setRawMode(false),r.close();},I=()=>{if(i&&y.size===0&&h.length===0)return;g("submit"),w();let A=new Set(h),L=[...h];for(let C of y)A.has(C)||(A.add(C),L.push(C));a(L);},W=()=>{g("cancel"),w(),a(oo);},_=(A,L)=>{if(!L)return;let C=f();if(L.name==="return"){I();return}if(L.name==="escape"||L.ctrl&&L.name==="c"){W();return}if(L.name==="up"){p=Math.max(0,p-1),g();return}if(L.name==="down"){p=Math.min(C.length-1,p+1),g();return}if(L.name==="space"){let V=C[p];V&&(y.has(V.value)?y.delete(V.value):y.add(V.value)),g();return}if(L.name==="backspace"){d=d.slice(0,-1),p=0,g();return}if(L.sequence&&!L.ctrl&&!L.meta&&L.sequence.length===1){d+=L.sequence,p=0,g();return}};process.stdin.on("keypress",_),g();})}function ut(t){return S.bgCyan(S.black(S.bold(` ${t} `)))}function Ms(){return S.bgRed(S.white(S.bold(" ERROR ")))}var Ws={version:"0.3.11"};var Gs=t=>typeof t=="symbol",Vs="eve agent";function ho(t,e){return t.startsWith("git@")||t.startsWith("ssh://")?t:e}function qs(t){Nn(t);}async function ko(t,e,n,s){let{agent:l,subagent:i}=e,{installMode:o,installGlobally:a,tempDir:d,blobResult:p}=s,y;if(p&&"files"in t){let b=t;y=await D$1({installName:b.name,files:b.files},l,{global:a,mode:o,eveSubagent:i});}else d&&t.path===d&&t.rawContent?y=await D$1({installName:t.name,files:[{path:"SKILL.md",contents:t.rawContent}]},l,{global:a,mode:o}):y=await v$1(t,l,{global:a,mode:o,eveSubagent:i});return {skill:k(t),agent:At(e),pluginName:t.pluginName,...y}}var yo=(()=>{let t=process.env.SKILLS_AUDIT_DISPLAY_TIMEOUT_MS;if(!t)return 3e4;let e=Number.parseInt(t,10);return Number.isFinite(e)&&e>0?e:3e4})();function Ks(t){switch(t){case "critical":return S.red(S.bold("Critical Risk"));case "high":return S.red("High Risk");case "medium":return S.yellow("Med Risk");case "low":return S.green("Low Risk");case "safe":return S.green("Safe");default:return S.dim("--")}}function bo(t){if(!t)return S.dim("--");let e=t.alerts??0;return e>0?S.red(`${e} alert${e!==1?"s":""}`):S.green("0 alerts")}function pt(t,e){let n=b$2(t),s=Math.max(0,e-n.length);return t+" ".repeat(s)}function $o(t,e,n){if(!t)return [];if(!e.some(a=>{let r=t[a.slug];return r&&Object.keys(r).length>0}))return [];let l=Math.min(Math.max(...e.map(a=>a.displayName.length)),36),i=[],o=pt("",l+2)+pt(S.dim("Gen"),18)+pt(S.dim("Socket"),18)+S.dim("Snyk");i.push(o);for(let a of e){let r=t[a.slug],d=a.displayName.length>l?a.displayName.slice(0,l-1)+"\u2026":a.displayName,p=r?.ath?Ks(r.ath.risk):S.dim("--"),y=r?.socket?bo(r.socket):S.dim("--"),b=r?.snyk?Ks(r.snyk.risk):S.dim("--");i.push(pt(S.cyan(d),l+2)+pt(p,18)+pt(y,18)+b);}return i.push(""),i.push(`${S.dim("Details:")} ${S.dim(`https://skills.sh/${n}`)}`),i}function Kn(t,e){let n=homedir();return t===n||t.startsWith(n+sep)?"~"+t.slice(n.length):t===e||t.startsWith(e+sep)?"."+t.slice(e.length):t}function wo(t){let e=createHash("sha256");return e.update("SKILL.md"),e.update(t),e.digest("hex")}function ge(t,e=5){if(t.length<=e)return t.join(", ");let n=t.slice(0,e),s=t.length-e;return `${n.join(", ")} +${s} more`}function So(t){let e=t.map(s=>S.cyan(k(s))),n=ge(e,3);return b$2(n).length<=80?n:`${t.length} selected skills`}function vo(t){return `Detected an eve project. Install ${So(t)} for your ${Vs} to use?`}function Ys(t){let e=[],n=[];for(let s of t)J(s)?e.push(w$1[s].displayName):n.push(w$1[s].displayName);return {universal:e,symlinked:n}}function At(t){let e=w$1[t.agent].displayName;return t.subagent?`${e} (${t.subagent})`:e}function Hs(t){return t.subagent?`${t.agent}:${t.subagent}`:t.agent}function xo(t,e){let n=[];for(let s of t)if(s==="eve")for(let l of e)n.push({agent:s,subagent:l});else n.push({agent:s});return n}function Ao(t,e){let n=[],s=t.filter(a=>!a.subagent).map(a=>a.agent),l=t.filter(a=>a.subagent).map(At),{universal:i,symlinked:o}=Ys(s);if(e==="symlink")i.length>0&&n.push(` ${S.green("universal:")} ${ge(i)}`),o.length>0&&n.push(` ${S.dim("symlinked:")} ${ge(o)}`),l.length>0&&n.push(` ${S.dim("copied:")} ${ge(l)}`);else {i.length>0&&n.push(` ${S.green("universal:")} ${ge(i)}`);let a=t.filter(r=>!r.subagent&&!J(r.agent)).map(At);a.length>0&&n.push(` ${S.dim("copied:")} ${ge(a)}`),l.length>0&&n.push(` ${S.dim("copied (subagent):")} ${ge(l)}`);}return n}function zs(t){let e=C(),n=[...t];for(let s of e)n.includes(s)||n.push(s);return n}function Lo(t,e){let n=[],{universal:s}=Ys(e),i=t.filter(r=>!r.symlinkFailed&&!r.skipped&&!s.includes(r.agent)&&r.mode==="copy").map(r=>r.agent),o=t.filter(r=>!r.symlinkFailed&&!r.skipped&&!s.includes(r.agent)&&r.mode!=="copy").map(r=>r.agent),a=t.filter(r=>r.symlinkFailed&&!r.skipped).map(r=>r.agent);return s.length>0&&n.push(` ${S.green("universal:")} ${ge(s)}`),i.length>0&&n.push(` ${S.cyan("copied:")} ${ge(i)}`),o.length>0&&n.push(` ${S.dim("symlinked:")} ${ge(o)}`),a.length>0&&n.push(` ${S.yellow("symlink-failed:")} ${ge(a)}`),n}function To(t){return x.multiselect({...t,options:t.options,message:`${t.message} ${S.dim("(space to toggle)")}`})}async function Io(t,e){let n;try{n=await Mn();}catch{}let s=e.map(r=>r.value),i=["claude-code","opencode","codex"].filter(r=>s.includes(r)),o=[];n&&n.length>0&&(o=n.filter(r=>s.includes(r))),o.length===0&&(o=i);let a=await at({message:t,items:e,initialSelected:o,required:true});if(!Gs(a))try{await Wn(a);}catch{}return a}async function Bs(t){let e=p=>!t.global||w$1[p].globalSkillsDir,n=C().filter(e),s=C().filter(e),l=D().filter(p=>p!=="eve"&&e(p)),i={title:"Universal (.agents/skills)",items:s.map(p=>({value:p,label:w$1[p].displayName})),hiddenCount:n.length-s.length},o=l.map(p=>({value:p,label:w$1[p].displayName,hint:t.global?w$1[p].globalSkillsDir:w$1[p].skillsDir})),a;try{a=await Mn();}catch{}let r=a?a.filter(p=>l.includes(p)&&!n.includes(p)):[],d=await at({message:"Which agents do you want to install to?",items:o,initialSelected:r,lockedSection:i});if(!Gs(d))try{await Wn(d);}catch{}return d}var Po=Ws.version;Nn(Po);async function Ve(t,e$2={}){let n=t[0],s=false,l$1=()=>{s||(x.log.message(S.dim("Tip: use the --yes (-y) and --global (-g) flags to install without prompts.")),s=true);};n||(console.log(),console.log(Ms()+" "+S.red("Missing required argument: source")),console.log(),console.log(S.dim(" Usage:")),console.log(` ${S.cyan("easbot skills add")} ${S.yellow("<source>")} ${S.dim("[options]")}`),console.log(),console.log(S.dim(" Example:")),console.log(` ${S.cyan("easbot skills add")} ${S.yellow("houjallen/agent-skills")}`),console.log(),process.exit(1)),e$2.all&&(e$2.skill=["*"],e$2.agent=["*"],e$2.yes=true);let i=await De();if(i.isAgent&&(e$2.yes=true,!e$2.agent||e$2.agent.length===0)){let a=Xt(i.agent.name);a&&(e$2.agent=zs([a]));}console.log(),i.isAgent||x.intro(S.bgCyan(S.black(" skills "))),i.isAgent?x.log.info(ut(i.agent.name)+" Agent detected \u2014 installing non-interactively"):process.stdin.isTTY||l$1();let o=null;try{let a=x.spinner();a.start("Parsing source...");let r=lt(n);a.stop(`Source: ${r.type==="local"?r.localPath:r.url}${r.ref?` #${S.yellow(r.ref)}`:""}${r.subpath?` @${S.cyan(r.subpath)}`:""}`);let d$1=Te(r),p=(()=>{if(!d$1)return Promise.resolve(null);let m=$n(d$1);return m?zt(m.owner,m.repo).catch(()=>null):Promise.resolve(null)})(),y$1=Array.isArray(e$2?.skill)&&e$2.skill.length>0||e$2.fullDepth===!0||!!r.subpath;a.start("Loading source...");let b;try{b=await vs(r,{includeInternal:y$1,fullDepth:e$2.fullDepth});}catch(m){throw m instanceof $t&&(a.stop(S.red("Path not found")),x.outro(S.red(`Local path does not exist: ${m.localPath}`)),process.exit(1)),m}o=b.storeDir,a.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 h=b.skills,k$1=b.blobSkills.length>0?{skills:b.blobSkills,tree:{sha:"",branch:r.ref??"HEAD",tree:[]}}:null;if(a.start("Discovering skills..."),h.length===0&&(a.stop(S.red("No skills found")),x.outro(S.red("No valid skills found. Skills require a SKILL.md with name and description.")),await re(o),process.exit(1)),a.stop(`Found ${S.green(h.length)} skill${h.length>1?"s":""}`),e$2.list){console.log(),x.log.step(S.bold("Available Skills"));let m={},P=[];for(let T of h)if(T.pluginName){let E=T.pluginName;m[E]||(m[E]=[]),m[E].push(T);}else P.push(T);let R=Object.keys(m).sort();for(let T of R){let E=T.split("-").map(D=>D.charAt(0).toUpperCase()+D.slice(1)).join(" ");console.log(S.bold(E));for(let D of m[T])x.log.message(` ${S.cyan(k(D))}`),x.log.message(` ${S.dim(D.description)}`);console.log();}if(P.length>0){R.length>0&&console.log(S.bold("General"));for(let T of P)x.log.message(` ${S.cyan(k(T))}`),x.log.message(` ${S.dim(T.description)}`);}console.log(),x.outro("Use --skill <name> to install specific skills"),await re(o),process.exit(0);}let f$1;if(e$2.skill&&e$2.skill.length>0){let m=h.map(R=>k(R)),P=n$1(e$2.skill,m);if(P.wildcard)f$1=h,x.log.info(`Installing all ${h.length} skills`);else if(P.invalid.length>0){x.log.error(`No matching skills found for: ${P.invalid.join(", ")}`),x.log.info("Available skills:");for(let R of h)x.log.message(` - ${k(R)}`);await re(o),process.exit(1);}else f$1=l(h,P.matched),f$1.length===0&&(x.log.error(`No matching skills found for: ${P.matched.join(", ")}`),await re(o),process.exit(1)),x.log.info(`Selected ${f$1.length} skill${f$1.length!==1?"s":""}: ${f$1.map(R=>S.cyan(k(R))).join(", ")}`);}else if(h.length===1){f$1=h;let m=h[0];x.log.info(`Skill: ${S.cyan(k(m))}`),x.log.message(S.dim(m.description));}else if(e$2.yes)f$1=h,x.log.info(`Installing all ${h.length} skills`);else {let m=[...h].sort((T,E)=>T.pluginName&&!E.pluginName?-1:!T.pluginName&&E.pluginName?1:T.pluginName&&E.pluginName&&T.pluginName!==E.pluginName?T.pluginName.localeCompare(E.pluginName):k(T).localeCompare(k(E))),P=m.some(T=>T.pluginName),R;if(P){let T=D=>D.split("-").map(F=>F.charAt(0).toUpperCase()+F.slice(1)).join(" "),E={};for(let D of m){let F=D.pluginName?T(D.pluginName):"Other";E[F]||(E[F]=[]),E[F].push({value:D,label:k(D),hint:D.description.length>60?D.description.slice(0,57)+"...":D.description});}R=await x.groupMultiselect({message:`Select skills to install ${S.dim("(space to toggle)")}`,options:E,required:!0});}else {let T=m.map(E=>({value:E,label:k(E),hint:E.description.length>60?E.description.slice(0,57)+"...":E.description}));R=await To({message:"Select skills to install",options:T,required:!0});}x.isCancel(R)&&(x.cancel("Installation cancelled"),await re(o),process.exit(0)),f$1=R;}let $=Te(r),g=$?Es($,f$1.map(m=>k(m))):Promise.resolve(null),w$2,I=Object.keys(w$1);if(e$2.agent&&e$2.agent.length>0){let m=K(e$2.agent);m.length>0&&(x.log.error(`Invalid agents: ${m.join(", ")}`),x.log.info(`Valid agents: ${I.join(", ")}`),await re(o),process.exit(1)),w$2=L(e$2.agent),e$2.agent.includes("*")&&x.log.info(`Installing to all ${w$2.length} agents`);}else {a.start("Loading agents...");let m=await x$2(),P=Object.keys(w$1).length;if(a.stop(`${P} agents`),m.includes("eve")&&(e$2.yes||!i.isAgent)){let R=e$2.yes?!0:await x.confirm({message:vo(f$1),initialValue:!0});if(x.isCancel(R)&&(x.cancel("Installation cancelled"),await re(o),process.exit(0)),R)w$2=["eve"],x.log.info(`Installing to: ${S.cyan(Vs)}`);else {let T=await Bs({global:e$2.global});x.isCancel(T)&&(x.cancel("Installation cancelled"),await re(o),process.exit(0)),w$2=T;}}else if(m.length===0)if(e$2.yes)w$2=I,x.log.info("Installing to all agents");else {x.log.info("Select agents to install skills to");let R=Object.entries(w$1).filter(([E])=>E!=="eve").map(([E,D])=>({value:E,label:D.displayName})),T=await Io("Which agents do you want to install to?",R);x.isCancel(T)&&(x.cancel("Installation cancelled"),await re(o),process.exit(0)),w$2=T;}else if(m.length===1||e$2.yes)if(w$2=zs(m),m.length===1){let R=m[0];x.log.info(`Installing to: ${S.cyan(w$1[R].displayName)}`);}else x.log.info(`Installing to: ${m.map(R=>S.cyan(w$1[R].displayName)).join(", ")}`);else {let R=await Bs({global:e$2.global});x.isCancel(R)&&(x.cancel("Installation cancelled"),await re(o),process.exit(0)),w$2=R;}}e$2.subagent&&e$2.subagent.length>0&&!w$2.includes("eve")&&(w$2=[...w$2,"eve"]);let W=[void 0];if(w$2.includes("eve")){let m=A(process.cwd());if(e$2.subagent&&e$2.subagent.length>0)W=e$2.subagent.map(P=>P==="root"||P==="."?void 0:P);else if(m.length>0&&!e$2.yes){let P=[{value:"",label:"Root agent",hint:"agent/skills"},...m.map(T=>({value:T,label:T,hint:`agent/subagents/${T}/skills`}))],R=await x.multiselect({message:"Where should Eve skills be installed?",options:P,initialValues:[""],required:!0});x.isCancel(R)&&(x.cancel("Installation cancelled"),await re(o),process.exit(0)),W=R.map(T=>T===""?void 0:T);}}let _=xo(w$2,W),A$2=e$2.global??!1,L$1=w$2.some(m=>w$1[m].globalSkillsDir!==void 0);if(e$2.global===void 0&&!e$2.yes&&L$1){let m=await x.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)"}]});x.isCancel(m)&&(x.cancel("Installation cancelled"),await re(o),process.exit(0)),A$2=m;}let C=e$2.copy?"copy":"symlink",V=_.every(m=>m.agent==="eve"),ee=new Set(_.map(m=>m.subagent?`eve:subagent:${m.subagent}`:w$1[m.agent].skillsDir));if(!e$2.copy&&!e$2.yes&&ee.size>1&&!V){let m=await x.select({message:"Installation method",options:[{value:"symlink",label:"Share (Recommended)",hint:"Single source: 1 copy in .agents/skills + symlinks for EASBot/Eve"},{value:"copy",label:"Independent",hint:"Physical copy in each agent dir; updates must be re-run per agent"}]});x.isCancel(m)&&(x.cancel("Installation cancelled"),await re(o),process.exit(0)),C=m;}else (ee.size<=1||V)&&(C="copy");let O=process.cwd(),q=[],ae=await Promise.all(f$1.flatMap(m=>_.map(async P=>({skillName:m.name,target:P,installed:await y(m.name,P.agent,{global:A$2,eveSubagent:P.subagent})})))),ce=new Map;for(let{skillName:m,target:P,installed:R}of ae)ce.has(m)||ce.set(m,new Map),ce.get(m).set(Hs(P),R);let he={},oe=[];for(let m of f$1)if(m.pluginName){let P=m.pluginName;he[P]||(he[P]=[]),he[P].push(m);}else oe.push(m);let Q=m=>{for(let P of m){q.length>0&&q.push("");let R=_[0];_.length>1&&(R=_.find(we=>J(we.agent))??_[0]);let T=A$1(P.name,{global:A$2,agent:R.agent,eveSubagent:R.subagent}),E=Kn(T,O);q.push(`${S.cyan(E)}`),q.push(...Ao(_,C));let D=ce.get(P.name),F=_.filter(ue=>!J(ue.agent)&&D?.get(Hs(ue))).map(At);F.length>0&&q.push(` ${S.yellow("overwrites:")} ${ge(F)}`);}},Ne=Object.keys(he).sort();for(let m of Ne){let P=m.split("-").map(R=>R.charAt(0).toUpperCase()+R.slice(1)).join(" ");q.push(""),q.push(S.bold(P)),Q(he[m]);}oe.length>0&&(Ne.length>0&&(q.push(""),q.push(S.bold("General"))),Q(oe)),console.log(),x.note(q.join(`
|
|
24
|
+
`),"Installation Summary");try{let m=await Promise.race([g,new Promise(P=>setTimeout(()=>P(null),yo))]);if(m&&$){let P=$o(m,f$1.map(R=>({slug:k(R),displayName:k(R)})),$);P.length>0&&x.note(P.join(`
|
|
25
|
+
`),"Security Risk Assessments");}}catch{}if(!e$2.yes){let m=await x.confirm({message:"Proceed with installation?"});(x.isCancel(m)||!m)&&(x.cancel("Installation cancelled"),await re(o),process.exit(0));}a.start("Installing skills...");let me=[],Me=await Promise.all(f$1.map(async m=>{let P=new Map;for(let T of _){let D=(T.agent==="eve"||T.agent==="easbot")&&C==="symlink"?u$2(T.agent,A$2,O,T.subagent):s$1(A$2,O),F=r$1(m.name||basename(m.path)),ue=join(D,F),we=u$2(T.agent,A$2,O,T.subagent),Xe=join(we,F),te=ue,pe=P.get(te);pe||(pe={canonicalDir:ue,members:[]},P.set(te,pe)),pe.members.push({target:T,agentDir:Xe});}return (await Promise.all([...P.values()].map(async T=>{let[E,...D]=T.members;if(!E)return [];let F=await ko(m,E.target,E.agentDir,{installMode:C,installGlobally:A$2,cwd:O,tempDir:o,blobResult:k$1}),ue=await Promise.all(D.map(async({target:we,agentDir:Xe})=>{let te=C==="copy"?await x$1(T.canonicalDir,Xe,{agentType:we.agent}):await w(T.canonicalDir,Xe,{isGlobal:A$2,agentType:we.agent,cwd:O});return {skill:k(m),agent:At(we),pluginName:m.pluginName,...te}}));return [F,...ue]}))).flat()}));for(let m of Me)me.push(...m);a.stop("Installation complete"),console.log();let Ie=me.filter(m=>m.success),ft=me.filter(m=>!m.success),be={};for(let m of f$1)k$1&&"repoPath"in m?be[m.name]=m.repoPath:o&&m.path===o?be[m.name]="SKILL.md":o&&m.path.startsWith(o+sep)&&(be[m.name]=`${m.path.slice(o.length+1).split(sep).join("/")}/SKILL.md`);let $e=Te(r),Ct=ho(r.url,$e);if($e&&($n($e)?p.then(P=>{P===!1&&le({event:"install",source:$e,skills:f$1.map(R=>R.name).join(","),agents:w$2.join(","),...A$2&&{global:"1"},skillFiles:JSON.stringify(be)});}):le({event:"install",source:$e,skills:f$1.map(P=>P.name).join(","),agents:w$2.join(","),...A$2&&{global:"1"},skillFiles:JSON.stringify(be)})),Ie.length>0&&A$2&&$e){let m=new Set(Ie.map(R=>R.skill)),P;r.type==="github"&&!k$1&&(P=await e($e,r.ref,Qt));for(let R of f$1){let T=k(R);if(m.has(T))try{let E="",D=be[R.name];if(k$1&&D){let F=f(k$1.tree,D);F&&(E=F);}else if(r.type==="github"&&D&&P){let F=f(P,D);F&&(E=F);}else if(D&&o){let F=join(o,dirname(D)),ue=await d(F);ue&&(E=ue);}await Ns(R.name,{source:Ct||$e,sourceType:r.type,sourceUrl:r.url,ref:r.ref,skillPath:D,skillFolderHash:E,pluginName:R.pluginName});}catch{}}}if(Ie.length>0&&!A$2){let m=new Set(Ie.map(T=>T.skill)),P=w$2.includes("eve")?W.map(T=>T??""):void 0,R=P&&(P.length>1||P.some(T=>T!==""));for(let T of f$1){let E=k(T);if(m.has(E))try{let D=k$1&&"snapshotHash"in T?T.snapshotHash:o&&T.path===o&&T.rawContent?wo(T.rawContent):await d(T.path),F=be[T.name];await e$1(T.name,{source:Ct||r.url,ref:r.ref,sourceType:r.type,...F&&{skillPath:F},computedHash:D,...R&&{subagents:P}},O);}catch{}}}if(Ie.length>0){let m=new Map,P={},R=[];for(let te of Ie){let pe=m.get(te.skill)||[];if(pe.push(te),m.set(te.skill,pe),pe.length===1)if(te.pluginName){let Se=te.pluginName;P[Se]||(P[Se]=[]),P[Se].push(te);}else R.push(te);}let T=m.size,E=Ie.filter(te=>te.mode==="symlink"&&te.symlinkFailed),D=E.map(te=>te.agent),F=[],ue=te=>{for(let pe of te){let Se=m.get(pe.skill)||[],Et=Se[0];if(F.push(`${S.green("\u2713")} ${pe.skill}`),Et.canonicalPath){let ve=Kn(Et.canonicalPath,O);F.push(` ${S.dim("source:")} ${ve}`);}let mt=new Map;for(let ve of Se){if(ve.symlinkFailed||ve.skipped||Et.canonicalPath&&ve.path===Et.canonicalPath)continue;let Ze=ve.path;mt.has(Ze)?mt.get(Ze)!=="symlink"&&ve.mode==="symlink"&&mt.set(Ze,"symlink"):mt.set(Ze,ve.mode);}for(let[ve,Ze]of mt){let Vl=Kn(ve,O),ql=Ze==="symlink"?S.cyan("(link)"):S.dim("(copied)");F.push(` ${S.dim("target:")} ${Vl} ${ql}`);}F.push(...Lo(Se,w$2));}},we=Object.keys(P).sort();for(let te of we){let pe=te.split("-").map(Se=>Se.charAt(0).toUpperCase()+Se.slice(1)).join(" ");F.push(""),F.push(S.bold(pe)),ue(P[te]);}R.length>0&&(we.length>0&&(F.push(""),F.push(S.bold("General"))),ue(R));let Xe=S.green(`Installed ${T} skill${T!==1?"s":""}`);x.note(F.join(`
|
|
26
|
+
`),Xe),E.length>0&&(x.log.warn(S.yellow(`Symlinks failed for: ${ge(D)}`)),x.log.message(S.dim(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(ft.length>0){console.log(),x.log.error(S.red(`Failed to install ${ft.length}`));for(let m of ft)x.log.message(` ${S.red("\u2717")} ${m.skill} \u2192 ${m.agent}: ${S.dim(m.error)}`);}console.log(),x.outro(S.green("Done!")+S.dim(" Review skills before use; they run with full agent permissions.")),await Ro(e$2,w$2);}catch(a){if(a instanceof Pe){x.log.error(S.red("Failed to clone repository"));for(let r of a.message.split(`
|
|
27
|
+
`))x.log.message(S.dim(r));}else x.log.error(a instanceof Error?a.message:"Unknown error occurred");process.stdin.isTTY||l$1(),x.outro(S.red("Installation failed")),process.exit(1);}finally{await re(o);}}async function re(t){if(t){if(vt(t))return;try{await ze(t);}catch{}}}async function Ro(t,e){if(process.stdin.isTTY&&!t?.yes)try{if(await Fs("findSkillsPrompt"))return;if(await y("eas-skill-find","claude-code",{global:!0})){await xt("findSkillsPrompt");return}console.log(),x.log.message(S.dim("One-time prompt - you won't be asked again if you dismiss."));let l=await x.confirm({message:`Install the ${S.cyan("eas-skill-find")} skill? It helps your agent discover and suggest skills.`});if(x.isCancel(l)){await xt("findSkillsPrompt");return}if(l){await xt("findSkillsPrompt");let i=e?.filter(o=>o!=="replit");if(!i||i.length===0)return;console.log(),x.log.step("Installing eas-skill-find skill...");try{await Ve(["houjallen/agent-skills@skills/builtin/eas-skill-find"],{global:!0,yes:!0,agent:i});let o=join(s$1(!0),"eas-skill-find"),a=await Pn({skillId:"eas-skill-find",sourceDir:o,targetAgents:i,installGlobally:!0,defaultMode:"symlink",assumeYes:t?.yes===!0});a.reported.length>0&&x.log.warn(`${a.reported.length} cell(s) reported divergent/orphan (not auto-fixed). Run 'easbot skills repair' to fix.`);}catch{x.log.warn("Failed to install eas-skill-find. You can try again with:"),x.log.message(S.dim(" easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find -g -y --all"));}}else await xt("findSkillsPrompt"),x.log.message(S.dim("You can install it later with: easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find"));}catch{}}function sn(t){let e={},n=[];for(let s=0;s<t.length;s++){let l=t[s];if(l==="-g"||l==="--global")e.global=true;else if(l==="-y"||l==="--yes")e.yes=true;else if(l==="-l"||l==="--list")e.list=true;else if(l==="--all")e.all=true;else if(l==="-a"||l==="--agent"){e.agent=e.agent||[],s++;let i=t[s];for(;s<t.length&&i&&!i.startsWith("-");)e.agent.push(i),s++,i=t[s];s--;}else if(l==="-s"||l==="--skill"){e.skill=e.skill||[],s++;let i=t[s];for(;s<t.length&&i&&!i.startsWith("-");)e.skill.push(i),s++,i=t[s];s--;}else if(l==="--full-depth")e.fullDepth=true;else if(l==="--copy")e.copy=true;else if(l==="--subagent"){e.subagent=e.subagent||[],s++;let i=t[s];for(;s<t.length&&i&&!i.startsWith("-");)e.subagent.push(i),s++,i=t[s];s--;}else l&&!l.startsWith("-")&&n.push(l);}return {source:n,options:e}}var c="\x1B[0m",M="\x1B[1m",u="\x1B[38;5;102m",U="\x1B[38;5;145m",Lt="\x1B[36m";var Hn="\x1B[33m";var ln=Log.create({service:"skills-find"}),No=process.env.SKILLS_API_URL||"https://skills.sh";function Xs(t){return !t||t<=0?"":t>=1e6?`${(t/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:t>=1e3?`${(t/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${t} install${t===1?"":"s"}`}var Uo=/^[a-z0-9](?:[a-z0-9-]{0,38})$/i;function Oo(t){let e=[],n={},s=[];for(let l=0;l<t.length;l++){let i=t[l];if(!i)continue;if(i==="--json"){n.json=true;continue}if(i==="--local"){n.local=true;continue}if(i==="--path"&&l+1<t.length){n.path=t[l+1],l++;continue}if(i.startsWith("--path=")){n.path=i.slice(7);continue}let o;if(i==="--owner"){let r=t[l+1];if(!r||r.startsWith("-")){s.push("--owner requires a GitHub owner");continue}o=r,l++;}else if(i.startsWith("--owner=")){if(o=i.slice(8),!o){s.push("--owner requires a GitHub owner");continue}}else {e.push(i);continue}let a=o.trim().toLowerCase();if(!Uo.test(a)){s.push("--owner must be a valid GitHub owner");continue}n.owner=a;}return {query:e.join(" "),options:n,errors:s}}async function Zs(t,e){try{let n=new URLSearchParams({q:t,limit:"10"});e&&n.set("owner",e);let s=`${No}/api/search?${n.toString()}`,l=await fetch(s);return l.ok?(await l.json()).skills.map(o=>({name:c$1(o.name),slug:c$1(o.id),source:c$1(o.source||""),installs:o.installs})).sort((o,a)=>(a.installs||0)-(o.installs||0)):[]}catch(n){return console.warn(`${u}[find] skills.sh search API failed: ${n instanceof Error?n.message:String(n)}${c}`),[]}}function Do(t){let e=wt(),n={};try{let i=readFileSync(e,"utf-8");n=JSON.parse(i);}catch{return []}let s=t?.toLowerCase().trim()??"",l=[];for(let[i,o]of Object.entries(n))s&&!i.toLowerCase().includes(s)||l.push(Fo(i,o));return l.sort((i,o)=>i.skillName.localeCompare(o.skillName)),l}function Fo(t,e){return {skillName:t,sourceKey:e.sourceKey,type:e.type,url:e.url,storePath:e.storePath,scope:e.scope,ref:e.ref,subpath:e.subpath}}async function Mo(t,e){let n=[];try{for await(let i of Grep.files({cwd:t,glob:["**/SKILL.md"]}))n.push(i);}catch{return []}let s=e?.toLowerCase().trim()??"",l=[];for(let i of n){let o=Wo(t,i),a=await h(o);if(!a)continue;let r=a.name;if(s&&!r.toLowerCase().includes(s))continue;let d=dirname(o);l.push({skillName:r,sourceKey:"",type:"scan",url:"",storePath:d});}return l.sort((i,o)=>i.skillName.localeCompare(o.skillName)),l}function Wo(t,e){let n=process.platform==="win32"?"\\":"/",s=e.replaceAll("/",n);return t.endsWith("/")||t.endsWith("\\")?t+s:t+n+s}var Ko="\x1B[?25l",Ho="\x1B[?25h",zo="\x1B[J",Bo=t=>`\x1B[${t}A`,Go=t=>`\x1B[${t}G`;async function Vo(t="",e){let n=[],s=0,l=t,i=false,o=null,a=0;process.stdin.isTTY&&process.stdin.setRawMode(true),en.emitKeypressEvents(process.stdin),process.stdin.resume(),process.stdout.write(Ko);function r(){a>0&&process.stdout.write(Bo(a)+Go(1)),process.stdout.write(zo);let p=[],y=`${M}_${c}`;if(p.push(`${U}Search skills:${c} ${l}${y}`),p.push(""),!l||l.length<2)p.push(`${u}Start typing to search (min 2 chars)${c}`);else if(n.length===0&&i)p.push(`${u}Searching...${c}`);else if(n.length===0)p.push(`${u}No skills found${c}`);else {let h=n.slice(0,8);for(let k=0;k<h.length;k++){let f=h[k],$=k===s,g=$?`${M}>${c}`:" ",w=$?`${M}${f.name}${c}`:`${U}${f.name}${c}`,I=f.source?` ${u}${f.source}${c}`:"",W=Xs(f.installs),_=W?` ${Lt}${W}${c}`:"",A=i&&k===0?` ${u}...${c}`:"";p.push(` ${g} ${w}${I}${_}${A}`);}}p.push(""),p.push(`${u}up/down navigate | enter select | esc cancel${c}`);for(let b of p)process.stdout.write(b+`
|
|
28
|
+
`);a=p.length;}function d(p){if(o&&(clearTimeout(o),o=null),i=false,!p||p.length<2){n=[],s=0,r();return}i=true,r();let y=Math.max(150,350-p.length*50);o=setTimeout(async()=>{try{n=await Zs(p,e),s=0;}catch{n=[];}finally{i=false,o=null,r();}},y);}return t&&d(t),r(),new Promise(p=>{function y(){process.stdin.removeListener("keypress",b),process.stdin.isTTY&&process.stdin.setRawMode(false),process.stdout.write(Ho),process.stdin.pause();}function b(h,k){if(k){if(k.name==="escape"||k.ctrl&&k.name==="c"){y(),p(null);return}if(k.name==="return"){y(),p(n[s]||null);return}if(k.name==="up"){s=Math.max(0,s-1),r();return}if(k.name==="down"){s=Math.min(Math.max(0,n.length-1),s+1),r();return}if(k.name==="backspace"){l.length>0&&(l=l.slice(0,-1),d(l));return}if(k.sequence&&!k.ctrl&&!k.meta&&k.sequence.length===1){let f=k.sequence;f>=" "&&f<="~"&&(l+=f,d(l));}}}process.stdin.on("keypress",b);})}function qo(t){let e=t.lastIndexOf("@"),s=(e>0?t.slice(0,e):t).match(/^([^/]+)\/([^/]+)$/);return s?{owner:s[1],repo:s[2]}:null}async function Yo(t,e){return await zt(t,e)===false}async function Jo(t,e,n={}){let s=typeof n.path=="string"&&n.path.length>0,l=s?n.path:Oe(),i,o;if(s?(i=await Mo(l,t||void 0),o="scan"):(i=Do(t||void 0),o="index"),le({event:"find",query:t,resultCount:String(i.length),mode:"local"}),e)return console.log(JSON.stringify({ok:true,data:i,meta:{count:i.length,query:t||null,mode:o,rootDir:s?l:null}},null,2)),0;if(i.length===0){let r=t?` matching "${t}"`:"",d=s?` under "${l}"`:" in store";return console.log(`${u}No skills found${r}${d}.${c}`),0}let a=o==="scan"?` (scanned ${l})`:"";console.log(`${M}Local skills${t?` matching "${t}"`:""}${a}${c} (${i.length})`),console.log();for(let r of i){let d=r.scope?`${u}[${r.scope}]${c}`:"";console.log(o==="scan"?` ${M}${r.skillName}${c} ${d} ${u}${r.storePath}${c}`:` ${M}${r.skillName}${c} ${d} ${u}${r.type}${c} ${u}${r.url}${c}`);}return console.log(),console.log(o==="scan"?`${u}Run \`skills add <source>\` to install a discovered skill.${c}`:`${u}Run \`skills list\` to see installed skills, or \`skills cache list\` for store management.${c}`),console.log(),0}async function Qs(t){let{query:e,options:n,errors:s}=Oo(t),l=n.owner,i=!process.stdin.isTTY;ln.debug("runFind enter",{args:t,query:e,owner:l,errors:s,isNonInteractive:i,stdinTTY:process.stdin.isTTY});let o=`${u}Tip: if running in a coding agent, follow these steps:${c}
|
|
29
|
+
${u} 1) easbot skills find [query] [--owner <owner>]${c}
|
|
30
|
+
${u} 2) easbot skills add <owner/repo@skill>${c}`;if(s.length>0){for(let k of s)console.error(k);return console.error("Usage: easbot skills find <query> [--owner <owner>]"),1}if(n.local)return Jo(e,n.json??false,n);if(e){ln.debug("runFind enter query branch",{query:e,owner:l,json:n.json});let k=await Zs(e,l);if(ln.debug("runFind searchSkillsAPI returned",{count:k.length}),le({event:"find",query:e,resultCount:String(k.length)}),n.json)return console.log(JSON.stringify({ok:true,data:k.map(f=>({name:f.name,slug:f.slug,source:f.source,installs:f.installs,url:`https://skills.sh/${f.slug}`})),meta:{count:k.length,query:e,owner:l??null,truncated:k.length>6}},null,2)),0;if(k.length===0){let f=l?` from owner "${l}"`:"";return console.log(`${u}No skills found for "${e}"${f}${c}`),0}console.log(`${u}Install with${c} easbot skills add <owner/repo@skill>`),console.log();for(let f of k.slice(0,6)){let $=f.source||f.slug,g=Xs(f.installs);console.log(`${U}${$}@${f.name}${c}${g?` ${Lt}${g}${c}`:""}`),console.log(`${u}\u2514 https://skills.sh/${f.slug}${c}`),console.log();}return 0}if(i||await Jt())return console.log(o),console.log(),console.log(`${u}Usage: easbot skills find <query> [--owner <owner>]${c}`),0;let a=await Vo("",l);if(le({event:"find",query:"",resultCount:a?"1":"0",interactive:"1"}),!a)return console.log(`${u}Search cancelled${c}`),console.log(),0;let r=a.source||a.slug,d=a.name;console.log(),console.log(`${U}Installing ${M}${d}${c} from ${u}${r}${c}...`),console.log();let{source:p,options:y}=sn([r,"--skill",d]),b=0;try{await Ve(p,y);}catch(k){b=1,ln.error("runAdd failed during find\u2192install",{err:k});}console.log();let h=qo(r);return h&&await Yo(h.owner,h.repo)?console.log(`${u}View the skill at${c} ${U}https://skills.sh/${a.slug}${c}`):console.log(`${u}Discover more skills at${c} ${U}https://skills.sh${c}`),console.log(),b}var tl=t=>typeof t=="symbol";function nl(t,e){let n=homedir();return t===n||t.startsWith(n+sep)?"~"+t.slice(n.length):t===e||t.startsWith(e+sep)?"."+t.slice(e.length):t}async function Zo(t){let e=join(t,"node_modules"),n=[],s;try{s=await readdir(e);}catch{return n}let l=async(i,o)=>{let a=await h(join(i,"SKILL.md"));if(a){n.push({...a,packageName:o});return}let r=[i,join(i,"skills"),join(i,".agents","skills")];for(let d of r)try{let p=await readdir(d);for(let y of p){let b=join(d,y);try{if(!(await stat(b)).isDirectory())continue}catch{continue}let h$1=await h(join(b,"SKILL.md"));h$1&&n.push({...h$1,packageName:o});}}catch{}};return await Promise.all(s.map(async i=>{if(i.startsWith("."))return;let o=join(e,i);try{if(!(await stat(o)).isDirectory())return}catch{return}if(i.startsWith("@"))try{let a=await readdir(o);await Promise.all(a.map(async r=>{let d=join(o,r);try{if(!(await stat(d)).isDirectory())return}catch{return}await l(d,`${i}/${r}`);}));}catch{}else await l(o,i);})),n}async function on(t,e={}){let n=process.cwd(),s=await De();if(s.isAgent&&(e.yes=true,!e.agent||e.agent.length===0)){let g=Xt(s.agent.name);if(g){let w=[g];for(let I of C())w.includes(I)||w.push(I);e.agent=w;}}console.log(),s.isAgent||x.intro(S.bgCyan(S.black(" skills experimental_sync "))),s.isAgent&&x.log.info(ut(s.agent.name)+" Agent detected \u2014 installing non-interactively");let l=x.spinner();l.start("Scanning node_modules for skills...");let i=await Zo(n);if(i.length===0){l.stop(S.yellow("No skills found")),x.outro(S.dim("No SKILL.md files found in node_modules."));return}l.stop(`Found ${S.green(String(i.length))} skill${i.length>1?"s":""} in node_modules`);for(let g of i)x.log.info(`${S.cyan(g.name)} ${S.dim(`from ${g.packageName}`)}`),g.description&&x.log.message(S.dim(` ${g.description}`));let o=await b(n),a=[],r=[];if(e.force)a.push(...i),x.log.info(S.dim("Force mode: reinstalling all skills"));else {for(let g of i){let w=o.skills[g.name];if(w&&await d(g.path)===w.computedHash){r.push(g.name);continue}a.push(g);}if(r.length>0&&x.log.info(S.dim(`${r.length} skill${r.length!==1?"s":""} already up to date`)),a.length===0){console.log(),x.outro(S.green("All skills are up to date."));return}}x.log.info(`${a.length} skill${a.length!==1?"s":""} to install/update`);let d$1,p=C(),y=C();if(e.agent&&e.agent.length>0){let g=K(e.agent);if(g.length>0){let w=Object.keys(w$1);x.log.error(`Invalid agents: ${g.join(", ")}`),x.log.info(`Valid agents: ${w.join(", ")}`),process.exit(1);}d$1=L(e.agent),e.agent.includes("*")&&x.log.info(`Installing to all ${d$1.length} agents`);}else {l.start("Loading agents...");let g=await x$2(),w=Object.keys(w$1).length;if(l.stop(`${w} agents`),g.length===0)if(e.yes)d$1=p,x.log.info("Installing to universal agents");else {let W=D().map(A=>({value:A,label:w$1[A].displayName,hint:w$1[A].skillsDir})),_=await at({message:"Which agents do you want to install to?",items:W,initialSelected:[],lockedSection:{title:"Universal (.agents/skills)",items:y.map(A=>({value:A,label:w$1[A].displayName})),hiddenCount:p.length-y.length}});tl(_)&&(x.cancel("Sync cancelled"),process.exit(0)),d$1=_;}else if(g.length===1||e.yes){d$1=[...g];for(let I of p)d$1.includes(I)||d$1.push(I);}else {let W=D().filter(A=>g.includes(A)).map(A=>({value:A,label:w$1[A].displayName,hint:w$1[A].skillsDir})),_=await at({message:"Which agents do you want to install to?",items:W,initialSelected:g.filter(A=>!p.includes(A)),lockedSection:{title:"Universal (.agents/skills)",items:y.map(A=>({value:A,label:w$1[A].displayName})),hiddenCount:p.length-y.length}});tl(_)&&(x.cancel("Sync cancelled"),process.exit(0)),d$1=_;}}let b$1=[];for(let g of a){let w=A$1(g.name,{global:false}),I=nl(w,n);b$1.push(`${S.cyan(g.name)} ${S.dim(`\u2190 ${g.packageName}`)}`),b$1.push(` ${S.dim(I)}`);}if(console.log(),x.note(b$1.join(`
|
|
31
|
+
`),"Sync Summary"),!e.yes){let g=await x.confirm({message:"Proceed with sync?"});(x.isCancel(g)||!g)&&(x.cancel("Sync cancelled"),process.exit(0));}l.start("Syncing skills...");let h=[];for(let g of a)for(let w of d$1){let I=await v$1(g,w,{global:false,cwd:n,mode:"symlink"});h.push({skill:g.name,packageName:g.packageName,agent:w$1[w].displayName,success:I.success,path:I.path,canonicalPath:I.canonicalPath,error:I.error});}l.stop("Sync complete");let k=h.filter(g=>g.success),f=h.filter(g=>!g.success),$=new Set(k.map(g=>g.skill));for(let g of a)if($.has(g.name))try{let w=await d(g.path);await e$1(g.name,{source:g.packageName,sourceType:"node_modules",computedHash:w},n);}catch{}if(console.log(),k.length>0){let g=new Map;for(let _ of k){let A=g.get(_.skill)||[];A.push(_),g.set(_.skill,A);}let w=[];for(let[_,A]of g){let L=A[0],C=a.find(V=>V.name===_)?.packageName;if(L.canonicalPath){let V=nl(L.canonicalPath,n);w.push(`${S.green("\u2713")} ${_} ${S.dim(`\u2190 ${C}`)}`),w.push(` ${S.dim(V)}`);}else w.push(`${S.green("\u2713")} ${_} ${S.dim(`\u2190 ${C}`)}`);}let I=g.size,W=S.green(`Synced ${I} skill${I!==1?"s":""}`);x.note(w.join(`
|
|
32
|
+
`),W);}if(f.length>0){console.log(),x.log.error(S.red(`Failed to install ${f.length}`));for(let g of f)x.log.message(` ${S.red("\u2717")} ${g.skill} \u2192 ${g.agent}: ${S.dim(g.error)}`);}le({event:"experimental_sync",skillCount:String(a.length),successCount:String($.size),agents:d$1.join(",")}),console.log(),x.outro(S.green("Done!")+S.dim(" Review skills before use; they run with full agent permissions."));}function rn(t){let e={};for(let n=0;n<t.length;n++){let s=t[n];if(s==="-y"||s==="--yes")e.yes=true;else if(s==="-f"||s==="--force")e.force=true;else if(s==="-a"||s==="--agent"){e.agent=e.agent||[],n++;let l=t[n];for(;n<t.length&&l&&!l.startsWith("-");)e.agent.push(l),n++,l=t[n];n--;}}return {options:e}}async function sl(t){let e=process.cwd(),n=await b(e),s=Object.entries(n.skills);if(s.length===0){x.log.warn("No project skills found in skills-lock.json"),x.log.info(`Add project-level skills with ${S.cyan("easbot skills add <package>")} (without ${S.cyan("-g")})`);return}let l=C(),i=[],o=new Map;for(let[r,d]of s){if(d.sourceType==="node_modules"){i.push(r);continue}let p=d.ref?`${d.source}#${d.ref}`:d.source,y=o.get(p);y?y.skills.push(r):o.set(p,{sourceType:d.sourceType,skills:[r]});}let a=s.length-i.length;a>0&&x.log.info(`Restoring ${S.cyan(String(a))} skill${a!==1?"s":""} from skills-lock.json into ${S.dim(".agents/skills/")}`);for(let[r,{skills:d}]of o)try{await Ve([r],{skill:d,agent:l,yes:!0});}catch(p){x.log.error(`Failed to install from ${S.cyan(r)}: ${p instanceof Error?p.message:"Unknown error"}`);}if(i.length>0){x.log.info(`${S.cyan(String(i.length))} skill${i.length!==1?"s":""} from node_modules`);try{let{options:r}=rn(t);await on(t,{...r,yes:!0,agent:l});}catch(r){x.log.error(`Failed to sync node_modules skills: ${r instanceof Error?r.message:"Unknown error"}`);}}}function an(t,e){let n=homedir();return t.startsWith(n)?t.replace(n,"~"):t.startsWith(e)?"."+t.slice(e.length):t}function er(t,e=5){if(t.length<=e)return t.join(", ");let n=t.slice(0,e),s=t.length-e;return `${n.join(", ")} +${s} more`}function tr(t){let e={};for(let n=0;n<t.length;n++){let s=t[n];if(s==="-g"||s==="--global")e.global=true;else if(s==="-p"||s==="--project")e.project=true;else if(s==="--json")e.json=true;else if(s==="--all")e.all=true;else if(s==="-y"||s==="--yes")e.yes=true;else if(s==="-a"||s==="--agent")for(e.agent=e.agent||[];n+1<t.length&&!t[n+1].startsWith("-");)e.agent.push(t[++n]);}return e}function nr(t){return t.global&&t.project?"both":t.global?"global":t.project?"project":(t.all===true,"both")}async function ll(t){let e=tr(t);e.all===true&&(!e.agent||e.agent.length===0)&&(e.agent=["*"]);let n=nr(e),s;if(e.agent&&e.agent.length>0){let b=K(e.agent);if(b.length>0){let h=Object.keys(w$1);console.log(`${Hn}Invalid agents: ${b.join(", ")}${c}`),console.log(`${u}Valid agents: ${h.join(", ")}${c}`),process.exit(1);}s=L(e.agent);}let l=await E({global:n==="global"?true:n==="project"?false:void 0,agentFilter:s});if(e.json){let b=l.map(h=>({name:h.name,path:h.canonicalPath,scope:h.scope,agents:h.agents.map(k=>w$1[k].displayName)}));console.log(JSON.stringify({ok:true,data:b,meta:{count:b.length,scope:n,agentFilter:s?[...s]:null}},null,2));return}let i=await Ds(),o=process.cwd(),a=n==="both"?"All":n==="global"?"Global":"Project";if(l.length===0){if(e.json){console.log(JSON.stringify({ok:true,data:[],meta:{count:0,scope:n,agentFilter:s?[...s]:null}},null,2));return}console.log(`${u}No skills found.${c}`);return}function r(b,h=false,k=0,f=0){let $=h?" ":"",g=an(b.canonicalPath,o),w=b.agents.map(A=>w$1[A].displayName),I=b.agents.length>0?er(w):`${Hn}not linked${c}`,W=c$1(b.name).padEnd(k),_=g.padEnd(f);console.log(`${$}${Lt}${W}${c} ${u}${_}${c} ${u}Agents:${c} ${I}`);}console.log(`${M}${a} Skills${c}`),console.log();let d={},p=[];for(let b of l){let h=i[b.name];if(h?.pluginName){let k=h.pluginName;d[k]||(d[k]=[]),d[k].push(b);}else p.push(b);}if(Object.keys(d).length>0){let b=Object.keys(d).sort();for(let h of b){let k=h.split("-").map($=>$.charAt(0).toUpperCase()+$.slice(1)).join(" ");console.log(`${M}${k}${c}`);let f=d[h];if(f){let $=0,g=0;for(let w of f){let I=c$1(w.name).length,W=an(w.canonicalPath,o).length;I>$&&($=I),W>g&&(g=W);}for(let w of f)r(w,true,$,g);}console.log();}if(p.length>0){console.log(`${M}General${c}`);let h=0,k=0;for(let f of p){let $=c$1(f.name).length,g=an(f.canonicalPath,o).length;$>h&&(h=$),g>k&&(k=g);}for(let f of p)r(f,true,h,k);console.log();}}else {let b=0,h=0;for(let k of l){let f=c$1(k.name).length,$=an(k.canonicalPath,o).length;f>b&&(b=f),$>h&&(h=$);}for(let k of l)r(k,false,b,h);console.log();}}async function cn(t$1,e){let n=await De(),s=e.yes||n.isAgent;if(n.isAgent&&x.log.info(ut(n.agent.name)+" Agent detected \u2014 removing non-interactively"),e.global===void 0&&!s&&process.stdin.isTTY&&!n.isAgent){let $=await x.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)"}]});x.isCancel($)&&(x.cancel("Removal cancelled"),process.exit(0)),e.global=$;}let l=e.global??false,i=process.cwd(),o=x.spinner();o.start("Scanning for installed skills...");let{scanInstalledSkillDirs:a}=await import('./scan-47YPOLJX.mjs'),r=await a({global:l,cwd:i}),d=new Set;for(let $ of r)d.add($.name);let p=Array.from(d).sort();if(o.stop(`Found ${p.length} unique installed skill(s)`),p.length===0){x.outro(S.yellow("No skills found to remove."));return}if(e.agent&&e.agent.length>0){let $=K(e.agent);if($.length>0){let g=Object.keys(w$1);x.log.error(`Invalid agents: ${$.join(", ")}`),x.log.info(`Valid agents: ${g.join(", ")}`),process.exit(1);}}if(e.skill&&e.skill.length>0&&e.all!==true){let $=m(e.skill,p);$.length>0&&(x.log.error(`Invalid skills: ${$.join(", ")}`),x.log.info(`Installed skills: ${p.join(", ")||"(none)"}`),process.exit(1));}let y=[];if(e.all)y=p;else if(t$1.length>0||e.skill&&e.skill.length>0){let $=[...t$1];if(e.skill&&e.skill.length>0){let g=n$1(e.skill,p);if(g.wildcard)y=p;else for(let w of g.matched)$.push(w);}if(y.length===0){let g=new Set;y=[];for(let w of $){let I=p.find(W=>W.toLowerCase()===w.toLowerCase());I&&!g.has(I)&&(g.add(I),y.push(I));}}if(y.length===0){x.log.error(`No matching skills found for: ${$.join(", ")}`);return}}else {let $=p.map(w=>({value:w,label:w})),g=await x.multiselect({message:`Select skills to remove ${S.dim("(space to toggle)")}`,options:$,required:true});x.isCancel(g)&&(x.cancel("Removal cancelled"),process.exit(0)),y=g;}let b;if(e.agent&&e.agent.length>0?b=L(e.agent):(b=Object.keys(w$1),o.stop(`Targeting ${b.length} potential agent(s)`)),!e.yes){let $=l?"Global (use --project to switch)":"Project (use --global to switch)",g=b.map(I=>w$1[I]?.displayName??I);console.log(),x.log.warn(S.yellow(`About to remove ${y.length} skill(s) from ${b.length} agent(s):`)),console.log(),console.log(` ${S.dim("Scope:")} ${$}`),console.log(` ${S.dim("Agents ("+b.length+"):")}`);for(let I of g)console.log(` ${S.red("\u2022")} ${I}`);console.log(` ${S.dim("Skills ("+y.length+"):")}`);for(let I of y)console.log(` ${S.red("\u2022")} ${I}`);console.log(),console.log(S.dim(" Each skill will be uninstalled from every targeted agent.")),console.log();let w=await x.confirm({message:"Continue? (y/N)"});(x.isCancel(w)||!w)&&(x.cancel("Removal cancelled"),process.exit(0));}o.start("Removing skills...");let h=[];for(let $ of y)try{let g=A$1($,{global:l,cwd:i});for(let C of b){let V=w$1[C],ee=z($,C,{global:l,cwd:i}),O=new Set([ee]),q=r$1($);if(l&&V.globalSkillsDir)O.add(join(V.globalSkillsDir,q));else if(O.add(join(i,V.skillsDir,q)),C==="eve")for(let ae of A(i))O.add(join(t(ae,i),q));for(let ae of O)if(ae!==g)try{await lstat(ae).catch(()=>null)&&await rm(ae,{recursive:!0,force:!0});}catch(ce){x.log.warn(`Could not remove skill from ${V.displayName}: ${ce instanceof Error?ce.message:String(ce)}`);}}let I=(await x$2()).filter(C=>!b.includes(C)),W=!1;for(let C of I){let V=z($,C,{global:l,cwd:i});if(await lstat(V).catch(()=>null)){W=!0;break}}W||await rm(g,{recursive:!0,force:!0});let _=l?await Os($):null,A$2=_?.source||"local",L=_?.sourceType||"local";l&&await Us($),await Yt($),h.push({skill:$,success:!0,source:A$2,sourceType:L});}catch(g){h.push({skill:$,success:false,error:g instanceof Error?g.message:String(g)});}o.stop("Removal process complete");let k=h.filter($=>$.success),f=h.filter($=>!$.success);if(k.length>0){let $=new Map;for(let g of k){let w=g.source||"local",I=$.get(w)||{skills:[]};I.skills.push(g.skill),I.sourceType=g.sourceType,$.set(w,I);}for(let[g,w]of $)le({event:"remove",source:g,skills:w.skills.join(","),agents:b.join(","),...l&&{global:"1"},sourceType:w.sourceType});}if(k.length>0&&x.log.success(S.green(`Successfully removed ${k.length} skill(s)`)),f.length>0){x.log.error(S.red(`Failed to remove ${f.length} skill(s)`));for(let $ of f)x.log.message(` ${S.red("\u2717")} ${$.skill}: ${$.error}`);}console.log(),x.outro(S.green("Done!"));}function rl(t){let e={},n=[];for(let s=0;s<t.length;s++){let l=t[s];if(l==="-g"||l==="--global")e.global=true;else if(l==="-y"||l==="--yes")e.yes=true;else if(l==="--all")e.all=true;else if(l==="-a"||l==="--agent"){e.agent=e.agent||[],s++;let i=t[s];for(;s<t.length&&i&&!i.startsWith("-");)e.agent.push(i),s++,i=t[s];s--;}else if(l==="-s"||l==="--skill"){e.skill=e.skill||[],s++;let i=t[s];for(;s<t.length&&i&&!i.startsWith("-");)e.skill.push(i),s++,i=t[s];s--;}else l&&!l.startsWith("-")&&n.push(l);}return {skills:n,options:e}}function dt(t,e){return e?`${t}#${e}`:t}function sr(t){let e=t;return e.endsWith("/SKILL.md")?e=e.slice(0,-9):e.endsWith("SKILL.md")&&(e=e.slice(0,-8)),e.endsWith("/")&&(e=e.slice(0,-1)),e}function lr(t){if(t.startsWith("git@")||t.endsWith(".git"))return false;if(t.startsWith("http://")||t.startsWith("https://"))try{let e=new URL(t).hostname;return e==="github.com"||e==="gitlab.com"}catch{return false}return true}function al(t,e,n){if(!lr(t))return dt(t,n);let s=sr(e),l=s?`${t}/${s}`:t;return n?`${l}#${n}`:l}function cl(t){return t.skillPath?al(t.source,t.skillPath,t.ref):dt(t.sourceUrl,t.ref)}function ul(t){return t.skillPath?al(t.source,t.skillPath,t.ref):dt(t.source,t.ref)}var gr=dirname(fileURLToPath(import.meta.url));async function dl(t){let e=Filesystem.join(t,"SKILL.md");try{let n=await readFile(e);return createHash("sha256").update(n).digest("hex")}catch{return}}function fl(t,e,n){return t||!e||!n?true:e!==n}function Yn(t,e=5){let n=t.split(/\r?\n/).map(l=>l.trim()).filter(l=>l.length>0);return n.length===0?"":n.slice(-e).map(l=>l.length>200?`${l.slice(0,197)}...`:l).join(`
|
|
33
|
+
`)}async function ml(t){let e=join(gr,"..","cli.mjs");if(!existsSync(e))return {code:2,stderr:`CLI entrypoint not found at ${e}`};let n=[process.execPath,e,...t],s;try{s=PKG.spawn({cmd:n,stdin:"inherit",stdout:"inherit",stderr:"pipe",windowsHide:process.platform==="win32"});}catch(a){return {code:2,stderr:`Failed to spawn child process: ${a instanceof Error?a.message:String(a)}`}}let l=[];s.stderr&&typeof s.stderr.on=="function"&&s.stderr.on("data",a=>{l.push(typeof a=="string"?Buffer.from(a):a);});let i=null;try{i=await s.exited;}catch{return {code:2,stderr:Yn(Buffer.concat(l).toString("utf-8"))||"Child process exited abnormally"}}let o=Buffer.concat(l).toString("utf-8");return i===0?{code:0,stderr:o}:{code:1,stderr:o}}function dr(t){let e={},n=[];for(let s of t)s==="-g"||s==="--global"?e.global=true:s==="-p"||s==="--project"?e.project=true:s==="-y"||s==="--yes"?e.yes=true:s==="--all"?e.all=true:s==="--force"?e.force=true:s.startsWith("-")||n.push(s);return n.length>0&&(e.skills=n),e}function Np(t){let e=t||process.cwd(),n=join(e,"skills-lock.json");if(existsSync(n))return true;let s=join(e,".agents","skills");try{let l=readdirSync(s,{withFileTypes:!0});for(let i of l)if(i.isDirectory()){let o=join(s,i.name,"SKILL.md");if(existsSync(o))return !0}}catch{}return false}async function fr(t){if(t.skills&&t.skills.length>0)return t.global?"global":t.project?"project":"both";if(t.global&&t.project)return "both";if(t.global)return "global";if(t.project)return "project";if(t.yes||!process.stdin.isTTY)return "both";let e=await x.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 x.isCancel(e)&&(x.cancel("Cancelled"),process.exit(0)),e}function hl(t,e){if(!e||e.length===0)return true;let n=t.toLowerCase();return e.some(s=>s.toLowerCase()===n)}function mr(t){return t.sourceType==="local"?"Local path":t.sourceType==="git"?"Git URL":t.sourceType==="well-known"?"Well-known skill":t.skillFolderHash?t.skillPath?"No version tracking":"No skill path recorded":"Private or deleted repo"}function hr(t){let e=t.sourceUrl;if(t.sourceType==="well-known"){let n=e.indexOf("/.well-known/");n!==-1&&(e=e.slice(0,n));}return dt(e,t.ref)}function pl(t){if(t.length===0)return;console.log(),console.log(`${u}${t.length} skill(s) cannot be checked automatically:${c}`);let e=new Map;for(let n of t){let s=hr(n),l=e.get(s)||[];l.push(n),e.set(s,l);}for(let[n,s]of e){if(s.length===1){let l=s[0];console.log(` ${U}\u2022${c} ${c$1(l.name)} ${u}(${l.reason})${c}`);}else {let l=s[0].reason,i=s.map(o=>c$1(o.name)).join(", ");console.log(` ${U}\u2022${c} ${i} ${u}(${l})${c}`);}console.log(` ${u}To update: ${U}easbot skills add ${n} -g -y${c}`);}}async function kr(t){let e=await b(),n=[];for(let[s,l]of Object.entries(e.skills))hl(s,t)&&(l.sourceType==="node_modules"||l.sourceType==="local"||n.push({name:s,source:l.source,entry:l}));return n}async function kl(t,e,n,s,l,i){let o=e.filter(a=>{let r=n[a];return r?.skillPath?!i.includes(r.skillPath):false});if(o.length>0){console.log(),console.log(`${u}Warning:${c} The following skills from ${u}${t}${c} appear to have been deleted upstream:`);for(let r of o)console.log(` ${u}\u2022${c} ${r}`);if(l.yes||!process.stdin.isTTY)console.log(`${u}Skipping deletion in non-interactive mode.${c}`);else {let r=await x.confirm({message:"Would you like to remove the local copies of these deleted skills?"});if(r&&!x.isCancel(r))for(let d of o)console.log(`${u}Removing${c} ${d}...`),await cn([d],{yes:true,global:s});}}return o}async function yr(t={}){let e=await ye(),n=Object.keys(e.skills),s=0,l=0;if(n.length===0)return t.skills||(console.log(`${u}No global skills tracked in lock file.${c}`),console.log(`${u}Install skills with${c} ${U}easbot skills add <package> -g${c}`)),{successCount:s,failCount:l,checkedCount:0};let i=[],o=[],a=[];for(let y of n){if(!hl(y,t.skills))continue;let b=e.skills[y];if(b){if(!b.skillPath){o.push({name:y,reason:mr(b),sourceUrl:b.sourceUrl,sourceType:b.sourceType,ref:b.ref});continue}a.push({name:y,entry:b});}}let r=await Ce(),d=new Map;for(let y of a){let b=y.entry.source,h=d.get(b)||[];h.push(y),d.set(b,h);}for(let[y,b]of d){let h=b[0].entry,k=h.sourceUrl||h.source,f=null;process.stdout.write(`\r${u}Checking skills from source: ${y}${c}\x1B[K
|
|
34
|
+
`);try{f=(await St({type:h.sourceType??"git",url:k,ref:h.ref??void 0,mode:"update"})).storeDir;let g=await j(f),w=g.map(A=>join(relative(f,A.path),"SKILL.md").split(sep).join("/")),I=Object.entries(e.skills).filter(([A,L])=>L.source===y).map(([A,L])=>A),W=await kl(y,I,e.skills,!0,t,w),_=new Set(W);for(let{name:A,entry:L}of b){if(_.has(A))continue;let C=L.skillPath;if(!w.includes(C))continue;let V=r[A]?.computedHash,ee=g.find(q=>join(relative(f,q.path),"SKILL.md").split(sep).join("/")===C)?.path,O=ee?await dl(ee):void 0;fl(t.force,V,O)&&i.push({name:A,source:y,entry:L});}}catch{console.log(` ${u}\u2717 Failed to check skills from ${y}${c}`);}finally{f&&!vt(f)&&await ze(f);}}a.length>0&&process.stdout.write("\r\x1B[K");let p=a.length+o.length;if(a.length===0&&o.length===0)return t.skills||console.log(`${u}No global skills to check.${c}`),{successCount:s,failCount:l,checkedCount:0};if(a.length===0&&o.length>0)return pl(o),{successCount:s,failCount:l,checkedCount:p};if(i.length===0)return console.log(`${U}\u2713 All global skills are up to date${c}`),{successCount:s,failCount:l,checkedCount:p};console.log(`${U}Found ${i.length} global update(s)${c}`),console.log();for(let y of i){let b=c$1(y.name);console.log(`${U}Updating ${b}...${c}`);let h=cl(y.entry),k=await ml(["add",h,"-g","-y"]);if(k.code===0)s++,console.log(` ${U}\u2713${c} Updated ${b}`);else {l++,console.log(` ${u}\u2717 Failed to update ${b}${c}`);let f=Yn(k.stderr);if(f)for(let $ of f.split(`
|
|
35
|
+
`))console.log(` ${u}${$}${c}`);}}return pl(o),{successCount:s,failCount:l,checkedCount:p}}async function br(t={}){let e=await kr(t.skills),n=0,s=0;if(e.length===0)return t.skills||(console.log(`${u}No project skills to update.${c}`),console.log(`${u}Install project skills with${c} ${U}easbot skills add <package>${c}`)),{successCount:n,failCount:s,foundCount:0};let l=e.filter(h=>h.entry.skillPath),i=e.filter(h=>!h.entry.skillPath);if(l.length===0)return console.log(`${u}No project skills can be updated in place.${c}`),gl(i),{successCount:n,failCount:s,foundCount:e.length};let o=process.cwd(),a=[],r=false;for(let[h,k]of Object.entries(w$1))if(J(h))!r&&existsSync(join(o,".agents"))&&(r=true);else {let f=k.skillsDir.split("/")[0];existsSync(join(o,f))&&a.push(k.displayName);}let d=[];r&&d.push("Universal"),d.push(...a),d.length>0&&console.log(`${U}Updating for: ${d.join(", ")}${c}`),console.log(`${U}Refreshing ${l.length} skill(s)...${c}`),console.log();let p=new Map;for(let h of l){let k=h.entry.source,f=p.get(k)||[];f.push(h),p.set(k,f);}let y=await b(),b$1=await Ce();for(let[h,k]of p){let f=k[0].entry,$=f.source,g=f.ref,w=Object.entries(y.skills).filter(([L,C])=>C.source===h).map(([L,C])=>L),I=null,W=[],_=new Map;try{I=(await St({type:f.sourceType??"git",url:$,ref:g,mode:"update"})).storeDir;let C=await j(I),V=C.map(ee=>{let O=relative(I,ee.path);return join(O,"SKILL.md").split(sep).join("/")});await Promise.all(C.map(async ee=>{let O=await dl(ee.path);_.set(ee.name,O);})),W=await kl(h,w,y.skills,!1,t,V);}catch{console.log(`${u}\u2717 Failed to check for deleted skills from ${h}${c}`);}finally{I&&!vt(I)&&await ze(I);}let A=k.filter(L=>!W.includes(L.name));for(let L of A){let C=c$1(L.name),V=y.skills[L.name]?.computedHash??b$1[L.name]?.computedHash,ee=_.get(L.name);if(!fl(t.force,V,ee)){console.log(`${u} ${C} is up to date${c}`);continue}console.log(`${U}Updating ${C}...${c}`);let O=ul(L.entry),q=L.entry.subagents,ae=q&&q.length>0?q.map(oe=>oe===""?"root":oe):[],ce=["add",O,"--skill",L.name,...ae.length>0?["--subagent",...ae]:[],"-y"],he=await ml(ce);if(he.code===0)n++,console.log(` ${U}\u2713${c} Updated ${C}`);else {s++,console.log(` ${u}\u2717 Failed to update ${C}${c}`);let oe=Yn(he.stderr);if(oe)for(let Q of oe.split(`
|
|
36
|
+
`))console.log(` ${u}${Q}${c}`);}}}return gl(i),{successCount:n,failCount:s,foundCount:e.length}}function gl(t){if(t.length!==0){console.log(),console.log(`${u}${t.length} project skill(s) cannot be updated automatically (installed before skillPath tracking):${c}`);for(let e of t){let n=dt(e.entry.source,e.entry.ref);console.log(` ${U}\u2022${c} ${c$1(e.name)}`),console.log(` ${u}To refresh: ${U}easbot skills add ${n} -y${c}`);}}}async function yl(t=[]){let e=dr(t);e.all===true&&(e.yes=true,(!e.skills||e.skills.length===0)&&(e.skills=["*"]));let n=await fr(e);e.skills?console.log(`${U}Updating ${e.skills.join(", ")}...${c}`):console.log(`${U}Checking for skill updates...${c}`),console.log();let s=0,l=0,i=0;if(n==="global"||n==="both"){n==="both"&&!e.skills&&console.log(`${M}Global Skills${c}`);let{successCount:o,failCount:a,checkedCount:r}=await yr(e);s+=o,l+=a,i+=r,n==="both"&&!e.skills&&console.log();}if(n==="project"||n==="both"){n==="both"&&!e.skills&&console.log(`${M}Project Skills${c}`);let{successCount:o,failCount:a,foundCount:r}=await br(e);s+=o,l+=a,i+=r;}e.skills&&i===0&&console.log(`${u}No installed skills found matching: ${e.skills.join(", ")}${c}`),console.log(),s>0&&console.log(`${U}\u2713 Updated ${s} skill(s)${c}`),l>0&&console.log(`${u}Failed to update ${l} skill(s)${c}`),le({event:"update",scope:n,skillCount:String(s+l),successCount:String(s),failCount:String(l)}),console.log();}var Ir=new Set(["metadata.json"]),Pr=new Set([".git","__pycache__","__pypackages__"]),Xn={"claude-code":{command:"claude",args:[]},codex:{command:"codex",args:[]}},Ll=Object.keys(Xn);function Tl(t){let e=[],n={},s=[];for(let l=0;l<t.length;l++){let i=t[l];if(i)if(i==="--help"||i==="-h")n.help=true;else if(i==="--full-depth")n.fullDepth=true;else if(i==="--dangerously-accept-openclaw-risks")n.dangerouslyAcceptOpenclawRisks=true;else if(i==="--skill"||i==="-s"){let o=t[l+1];!o||o.startsWith("-")?s.push(`${i} requires a skill name`):n.skill?(s.push("Only one --skill value can be provided"),l++):(n.skill=o,l++);}else if(i==="--agent"||i==="-a"){n.agent=n.agent||[],l++;let o=t[l],a=n.agent.length;for(;l<t.length&&o&&!o.startsWith("-");)n.agent.push(o),l++,o=t[l];n.agent.length===a&&s.push(`${i} requires an agent name`),l--;}else i.startsWith("-")?s.push(`Unknown option: ${i}`):e.push(i);}return s.push(...Ur(n.agent)),{source:e,options:n,errors:s}}function Rr(t){let e=["You are being given a Skill to execute for the user's next request.","Use the following SKILL.md as your instructions:",`<SKILL.md>
|
|
37
|
+
${t.skillMd}
|
|
38
|
+
</SKILL.md>`];return t.hasSupportingFiles&&t.supportDir&&e.push(`Supporting files for this skill were downloaded to:
|
|
39
|
+
${t.supportDir}
|
|
40
|
+
|
|
41
|
+
When the SKILL.md references relative paths, read them from that directory.`),e.join(`
|
|
42
|
+
|
|
43
|
+
`)+`
|
|
44
|
+
`}async function Cr(t){let e=await mkdtemp(join(tmpdir(),"skills-use-")),n=join(e,r$1(t.directoryName||t.name));if(!Zn(e,n))throw new Error("Invalid skill name: potential path traversal detected");await mkdir(n,{recursive:true}),t.kind==="blob"?await Or(n,t.files):t.kind==="well-known"?await Dr(n,t.files):await _l(t.path,n);let s=t.rawContent??await readFile(join(n,"SKILL.md"),"utf-8"),l=await jl(n,n);return {tempRoot:e,skillDir:n,skillMd:s,hasSupportingFiles:l}}async function Il(t,e={},n=[]){let s=null;try{if(e.help){console.log(Sl());return}n.length>0&&je(n.join(`
|
|
45
|
+
`)),t.length===0&&je(`Missing required argument: source
|
|
46
|
+
|
|
47
|
+
${Sl()}`),t.length>1&&je(`Expected one source, received ${t.length}: ${t.join(", ")}`);let l=e.agent?.[0];l&&!Xn[l]&&je(Cl(l));let i=t[0],o=lt(i);Te(o)?.split("/")[0]?.toLowerCase()==="openclaw"&&!e.dangerouslyAcceptOpenclawRisks&&je(["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 ${i} --dangerously-accept-openclaw-risks`].join(`
|
|
48
|
+
`));let d=e.skill,p=!!(d||e.fullDepth||o.subpath),y;if(o.type==="well-known"){let k=await Gt.fetchAllSkills(o.url);y=Nr(k,d,i);}else {let k,f=null;if(o.type==="local")existsSync(o.localPath)||je(`Local path does not exist: ${o.localPath}`),k=await j(o.localPath,o.subpath,{includeInternal:p,fullDepth:e.fullDepth});else if(o.type==="github"&&!e.fullDepth){let g=Te(o),w=g?.split("/")[0]?.toLowerCase();g&&w&&b$1.includes(w)&&(f=await h$1(g,{subpath:o.subpath,ref:o.ref,getToken:Qt,includeInternal:p})),f?k=f.skills:(s=await yt(o.url,o.ref),k=await j(s,o.subpath,{includeInternal:p,fullDepth:e.fullDepth}));}else s=await yt(o.url,o.ref),k=await j(s,o.subpath,{includeInternal:p,fullDepth:e.fullDepth});let $=jr(k,d,i);f&&Fr($)?y={kind:"blob",name:$.name,directoryName:$.name,rawContent:$.rawContent??Mr($.files),files:$.files}:y={kind:"disk",name:$.name,directoryName:$.name,rawContent:$.rawContent,path:$.path};}let b=await Cr(y);await vl(s),s=null;let h=Rr({skillMd:b.skillMd,supportDir:b.skillDir,hasSupportingFiles:b.hasSupportingFiles});if(l){let k=await Er(l,h);k!==0&&process.exit(k);return}process.stdout.write(h);}catch(l){await vl(s),l instanceof Pe&&je(l.message),l instanceof fe&&je(l.message),je(l instanceof Error?l.message:"Unknown error");}}async function Er(t,e,n=_r){let s=Xn[t];if(!s)throw new fe(Cl(t));return new Promise((l,i)=>{let o=n(s.command,[...s.args,e],{stdio:"inherit"}),a=false;o.on("error",r=>{if(!a){if(a=true,r.code==="ENOENT"){i(new fe(`Could not launch ${w$1[t].displayName}: command not found: ${s.command}`));return}i(r);}}),o.on("close",r=>{a||(a=true,l(r??1));});})}function _r(t,e){return spawn(t,e,{stdio:"inherit"})}function Sl(){return `Usage: skills use <source>[@<skill>] [options]
|
|
49
|
+
|
|
50
|
+
Generate a prompt for using one skill without installing it.
|
|
51
|
+
|
|
52
|
+
Options:
|
|
53
|
+
-s, --skill <skill> Select the skill to use
|
|
54
|
+
-a, --agent <agent> Start one supported agent interactively (${Ll.join(", ")})
|
|
55
|
+
--full-depth Search nested directories like skills add --full-depth
|
|
56
|
+
--dangerously-accept-openclaw-risks
|
|
57
|
+
Allow unverified OpenClaw community skills
|
|
58
|
+
-h, --help Show this help message
|
|
59
|
+
|
|
60
|
+
Examples:
|
|
61
|
+
skills use houjallen/agent-skills@web-design-guidelines | claude
|
|
62
|
+
skills use houjallen/agent-skills --skill web-design-guidelines --agent claude-code
|
|
63
|
+
skills use houjallen/agent-skills@web-design-guidelines --agent codex`}function jr(t,e,n){if(t.length===0)throw new fe("No valid skills found. Skills require a SKILL.md with name and description.");if(!e){if(t.length===1)return t[0];throw new fe(Pl(n,t.map(k)))}let s=l(t,[e]);if(s.length===0)throw new fe(Rl(e,t.map(k)));if(s.length>1)throw new fe(`Skill selector "${e}" matched multiple skills.`);return s[0]}function Nr(t,e,n){if(t.length===0)throw new fe("No skills found at this URL. Make sure the server has a /.well-known/agent-skills/index.json or /.well-known/skills/index.json file.");let s;if(e){if(s=t.filter(i=>i.installName.toLowerCase()===e.toLowerCase()||i.name.toLowerCase()===e.toLowerCase()),s.length===0)throw new fe(Rl(e,t.map(i=>i.installName)));if(s.length>1)throw new fe(`Skill selector "${e}" matched multiple skills.`)}else {if(t.length!==1)throw new fe(Pl(n,t.map(i=>i.installName)));s=t;}let l=s[0];return {kind:"well-known",name:l.name,directoryName:l.installName,rawContent:l.content,files:l.files}}function Pl(t,e){return ["This source contains multiple skills. Specify exactly one skill:",...e.map(n=>` - ${n}`),"",`Examples:
|
|
64
|
+
skills use ${t}@${e[0]??"<skill>"}
|
|
65
|
+
skills use ${t} --skill ${e[0]??"<skill>"}`].join(`
|
|
66
|
+
`)}function Rl(t,e){return [`No matching skill found for: ${t}`,"Available skills:",...e.map(n=>` - ${n}`)].join(`
|
|
67
|
+
`)}function Ur(t){if(!t||t.length===0)return [];let e=[];t.includes("*")&&e.push("skills use --agent does not support '*'; specify exactly one agent."),t.length>1&&e.push("skills use --agent accepts exactly one agent.");let n=K(t);if(n.length>0){let s=Object.keys(w$1);e.push(`Invalid agents: ${n.join(", ")}
|
|
68
|
+
Valid agents: ${s.join(", ")}`);}return e}function Cl(t){return [`Running ${w$1[t].displayName} is not supported yet.`,`Supported agents for skills use --agent: ${Ll.join(", ")}`].join(`
|
|
69
|
+
`)}async function Or(t,e){for(let n of e)await El(t,n.path,n.contents);}async function Dr(t,e){for(let[n,s]of e)await El(t,n,s);}async function El(t,e,n){let s=join(t,e);Zn(t,s)&&(await mkdir(dirname(s),{recursive:true}),typeof n=="string"?await writeFile(s,n,"utf-8"):await writeFile(s,n));}async function _l(t,e){await mkdir(e,{recursive:true});let n=await readdir(t,{withFileTypes:true});await Promise.all(n.filter(s=>!Wr(s.name,s.isDirectory())).map(async s=>{let l=join(t,s.name),i=join(e,s.name);if(Zn(e,i)){if(s.isDirectory()){await _l(l,i);return}try{await cp(l,i,{dereference:!0,recursive:!0});}catch(o){if(o instanceof Error&&"code"in o&&o.code==="ENOENT"&&s.isSymbolicLink()){console.error(`Skipping broken symlink: ${l}`);return}throw o}}}));}async function jl(t,e){let n=await readdir(e,{withFileTypes:true});for(let s of n){let l=join(e,s.name),i=relative(t,l).split(sep).join("/");if(s.isDirectory()){if(await jl(t,l))return true}else if(i.toLowerCase()!=="skill.md")return true}return false}function Fr(t){return Array.isArray(t.files)}function Mr(t){return t.find(n=>n.path.toLowerCase()==="skill.md")?.contents??""}function Wr(t,e){return Ir.has(t)||e&&Pr.has(t)}function Zn(t,e){let n=normalize(resolve(t)),s=normalize(resolve(e));return s.startsWith(n+sep)||s===n}async function vl(t){t&&await ze(t).catch(()=>{});}function je(t){console.error(t),process.exit(1);}var fe=class extends Error{};function Kr(t){let e=t[0]??"list",n=t.slice(1);return {subcommand:e,restArgs:n}}async function Dl(t,e={}){let{subcommand:n,restArgs:s}=Kr(t),l=Hr(s,e);switch(n){case "list":return zr(l);case "clean":return Br(l);case "remove":return qr(s,l);case "--help":case "-h":return Nl(),0;default:return console.log(S.yellow(`Unknown cache subcommand: ${n}`)),Nl(),1}}function Hr(t,e){let n={...e};for(let s=0;s<t.length;s++){let l=t[s];l!==void 0&&(l==="--source"&&s+1<t.length?(n.source=t[s+1],s++):l.startsWith("--source=")?n.source=l.slice(9):l==="--yes"||l==="-y"?n.yes=true:l==="--json"&&(n.json=true));}return n}async function zr(t={}){let e=await Ce();if(Object.keys(e).length===0)return t.json?(console.log("[]"),0):(x.outro(S.dim("No store sources. Run `skills add <source>` first.")),0);let n=new Map;for(let[l,i]of Object.entries(e)){let o=i.sourceKey;n.has(o)||n.set(o,{type:i.type,url:i.url,subpath:i.subpath,ref:i.ref,scope:i.scope,sourcePath:i.sourcePath,skills:[]}),n.get(o).skills.push(l);}let s=Array.from(n.entries()).map(([l,i])=>({sourceKey:l,type:i.type,url:i.url,subpath:i.subpath??"",ref:i.ref??"",scope:i.scope??"project",skillsCount:i.skills.length,skillsList:i.skills.sort().join(", "),cachePath:i.sourcePath,storePath:Filesystem.join(Oe(),l)}));if(t.json)return console.log(JSON.stringify(s,null,2)),0;console.log(),console.log(S.bold(S.cyan("Store sources"))),console.log(),console.log(`${S.dim("SOURCE KEY")} ${S.dim("TYPE")} ${S.dim("URL")} ${S.dim("SUBPATH")} ${S.dim("REF")} ${S.dim("SCOPE")} ${S.dim("#SKILLS")}`);for(let l of s)console.log(`${l.sourceKey.slice(0,8)}\u2026 ${l.type} ${l.url} ${l.subpath||"\u2205"} ${l.ref||"\u2205"} ${l.scope} ${l.skillsCount}`);return console.log(),console.log(S.dim("Use `skills cache clean --source <key>` to clean cache, or `skills cache remove <key>` to remove store source.")),console.log(),0}async function Br(t={}){return t.source?Vr(t.source,t):Gr(t)}async function Gr(t){let e=Be();if(!existsSync(e))return t.json?(console.log(JSON.stringify({cleaned:false,reason:"cache root does not exist"})),0):(x.outro(S.dim("Cache is already empty.")),0);if(!t.yes&&!t.json&&process.stdin.isTTY){let n=await x.confirm({message:`Remove all cache contents under ${e}?`});if(x.isCancel(n)||!n)return x.cancel("Cancelled."),1}return await As(),le({event:"cache_clean_all"}),t.json?console.log(JSON.stringify({cleaned:true,path:e})):x.outro(S.green(`\u2713 Cleaned cache: ${e}`)),0}async function Vr(t,e){let n=await Ce(),s=Object.values(n).find(i=>i.sourceKey===t);if(!s)return e.json?(console.log(JSON.stringify({cleaned:false,reason:`source key not found: ${t}`})),1):(x.log.error(S.red(`Source key not found: ${t}`)),x.outro(S.dim("Run `skills cache list` to see available sources.")),1);let l=s.sourcePath;if(!existsSync(l))return e.json?(console.log(JSON.stringify({cleaned:false,reason:"cache dir not present"})),0):(x.outro(S.dim(`Cache already absent for ${t.slice(0,8)}\u2026`)),0);if(!e.yes&&!e.json&&process.stdin.isTTY){let i=await x.confirm({message:`Remove cache for ${t.slice(0,8)}\u2026 (${l})?`});if(x.isCancel(i)||!i)return x.cancel("Cancelled."),1}return await rm(l,{recursive:true,force:true}),le({event:"cache_clean_source",source:t}),e.json?console.log(JSON.stringify({cleaned:true,path:l,sourceKey:t})):x.outro(S.green(`\u2713 Cleaned cache: ${l}`)),0}async function qr(t,e={}){let n=t[0];if(!n)return e.json?(console.log(JSON.stringify({removed:false,reason:"source key required"})),1):(x.log.error(S.red("Usage: skills cache remove <source-key>")),1);let s=await Ce(),l=Object.entries(s).filter(([,a])=>a.sourceKey===n);if(l.length===0)return e.json?(console.log(JSON.stringify({removed:false,reason:`source key not found: ${n}`})),1):(x.log.error(S.red(`Source key not found: ${n}`)),x.outro(S.dim("Run `skills cache list` to see available sources.")),1);let i=l[0][1],o=Filesystem.join(Oe(),n);if(!e.yes&&!e.json&&process.stdin.isTTY){let a=await x.confirm({message:`Remove store source ${n.slice(0,8)}\u2026 (${l.length} skill(s))?`});if(x.isCancel(a)||!a)return x.cancel("Cancelled."),1}existsSync(o)&&await rm(o,{recursive:true,force:true}),await xs({type:i.type,url:i.url,subpath:i.subpath,ref:i.ref});for(let[a]of l)await Yt(a);return le({event:"cache_remove_source",source:n,removedSkills:l.map(([a])=>a).join(",")}),e.json?console.log(JSON.stringify({removed:true,sourceKey:n,skills:l.map(([a])=>a)})):x.outro(S.green(`\u2713 Removed source ${n.slice(0,8)}\u2026 (${l.length} skill(s))`)),0}function Nl(){console.log(`
|
|
70
|
+
${S.bold(S.cyan("skills cache"))} - \u8FD0\u7EF4\u5B50\u547D\u4EE4\u65CF\uFF08\u7BA1\u7406 store / cache \u76EE\u5F55\uFF09
|
|
71
|
+
|
|
72
|
+
${S.bold("Usage:")}
|
|
73
|
+
skills cache list \u5217\u51FA\u6240\u6709 store source
|
|
74
|
+
skills cache clean \u6E05\u7A7A\u6574\u4E2A cache \u6839
|
|
75
|
+
skills cache clean --source <key> \u6E05\u6307\u5B9A source \u7684 cache
|
|
76
|
+
skills cache remove <key> \u79FB\u9664 store source\uFF08\u5220 store + cache + defs entries\uFF09
|
|
77
|
+
skills cache --help \u672C\u5E2E\u52A9
|
|
78
|
+
|
|
79
|
+
${S.bold("Options:")}
|
|
80
|
+
-y, --yes \u8DF3\u8FC7\u786E\u8BA4\u63D0\u793A
|
|
81
|
+
--json \u8F93\u51FA JSON \u683C\u5F0F\uFF08\u673A\u5668\u53EF\u8BFB\uFF09
|
|
82
|
+
|
|
83
|
+
${S.bold("Examples:")}
|
|
84
|
+
${S.dim("$")} skills cache list
|
|
85
|
+
${S.dim("$")} skills cache clean --source a1b2c3d4e5f67890
|
|
86
|
+
${S.dim("$")} skills cache remove a1b2c3d4e5f67890
|
|
87
|
+
${S.dim("$")} skills cache clean -y --json
|
|
88
|
+
`);}var Fl={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 Jr=Fl.languages,Xr=Jr.filter(t=>t.supported).map(t=>t.value),Je={defaultLocale:"zh-CN",locales:Xr},It={},un=(t,e)=>{let n=It[t]||{translation:{}};return It[t]={translation:{...n.translation,...e.translation}},It[t]},pn=(t=Je.defaultLocale)=>(It[t]||un(t,{translation:{}}),{locale:t,resources:It[t]||{translation:{}}});var Zr={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.install":"{{cmd}} experimental_install \u4ECE skills-lock.json \u8FD8\u539F","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":"\u5B9E\u9A8C\u6027 Sync \u9009\u9879","cli.help.section.list_options":"List \u9009\u9879","cli.help.section.options":"\u901A\u7528\u9009\u9879","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.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.install":"\u4ECE\u9501\u5B9A\u6587\u4EF6\u8FD8\u539F","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.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"}},Ml=Zr;var Qr={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.install":"{{cmd}} experimental_install Restore from skills-lock.json","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":"Experimental Sync Options","cli.help.section.list_options":"List Options","cli.help.section.options":"Options","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.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.install":"Restore from lockfile","cli.example.init":"Create a new skill","cli.example.sync":"Sync from node_modules","cli.example.sync_no_prompt":"Sync without prompts","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"}},Wl=Qr;var ea=()=>{pn("zh-CN"),pn("en-US"),un("zh-CN",Ml),un("en-US",Wl);};ea();var es=new Map;var ts=new Map;var ta=t=>{if(ts.has(t))return ts.get(t);let e=/{{\s*(\w+)\s*}}/g,n=[],s;for(;(s=e.exec(t))!==null;){let o=s[1];o&&!n.includes(o)&&n.push(o);}let l=new RegExp("{{\\s*("+n.join("|")+")\\s*}}","g"),i={keys:n,regex:l};return ts.set(t,i),i},Kl=(t,e)=>{if(!t||typeof t!="string")return "";if(!e||Object.keys(e).length===0)return t;let{regex:n,keys:s}=ta(t);return s.length===0||!s.some(i=>i in e)?t:t.replace(n,(i,o)=>{let a=e[o];return a==null?"":String(a)})},na=t=>{if(t&&Je.locales.includes(t))return t;let e=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(e){let n=e.replace(/_/g,"-");if(Je.locales.includes(n))return n;let s=n.split("-")[0];if(s==="zh")return "zh-CN";if(s==="en")return "en-US"}return Je.defaultLocale},Hl=t=>{if(!es.has(t)){let{resources:e}=pn(t);es.set(t,e);}return es.get(t)},sa=(t,e={})=>{let n=na(e.locale),l=Hl(n)?.translation[t];if(l&&typeof l=="string"){let i=Kl(l,e.vars);return i!=null?String(i):String(t)}if(n!==Je.defaultLocale){let o=Hl(Je.defaultLocale)?.translation[t];if(o&&typeof o=="string"){let a=Kl(o,e.vars);return a!=null?String(a):String(t)}}return String(e.fallback??t)},v=sa;var ia={"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 oa(t){return t.split(/[-_\s]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function ra(t){return ia[t]()}var aa=/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;function Bl(t,e){let n=formatLocalISO(new Date,false).slice(0,10),s={skill_name:e,skill_title:oa(e),version:"1.0.0",date:n};return ra(t).replace(aa,(i,o)=>Object.hasOwn(s,o)?s[o]:i)}function fa(t){return t&&qs(t),t??"0.0.0"}function Rt(t){return resolveLocaleLang(t?.locale)}function ma(t){let e=Rt(t);console.log(),console.log(`${u}${v("cli.banner.tagline",{locale:e,fallback:"easbot-skills \u2014 agent skills ecosystem"})}${c}`),console.log(),console.log(` ${u}$${c} ${U}easbot-skills add ${u}<package>${c} ${u}${v("cli.banner.cmd.add",{locale:e,vars:{cmd:"",dim:"",reset:""},fallback:"Add a new skill"})}${c}`),console.log(` ${u}$${c} ${U}easbot-skills use ${u}<package>@<skill>${c} ${u}${v("cli.banner.cmd.use",{locale:e,vars:{cmd:"",dim:"",reset:""},fallback:"Use a skill without installing"})}${c}`),console.log(` ${u}$${c} ${U}easbot-skills remove${c} ${u}${v("cli.example.remove_interactive",{locale:e,fallback:"Remove installed skills"})}${c}`),console.log(` ${u}$${c} ${U}easbot-skills list${c} ${u}${v("cli.example.list_project",{locale:e,fallback:"List installed skills"})}${c}`),console.log(` ${u}$${c} ${U}easbot-skills find ${u}[query]${c} ${u}${v("cli.example.find_interactive",{locale:e,fallback:"Search for skills"})}${c}`),console.log(),console.log(` ${u}$${c} ${U}easbot-skills update${c} ${u}${v("cli.example.update_global",{locale:e,fallback:"Update installed skills"})}${c}`),console.log(),console.log(` ${u}$${c} ${U}easbot-skills experimental_install${c} ${u}${v("cli.example.install",{locale:e,fallback:"Restore from skills-lock.json"})}${c}`),console.log(` ${u}$${c} ${U}easbot-skills init ${u}[name]${c} ${u}${v("cli.example.init",{locale:e,fallback:"Create a new skill"})}${c}`),console.log(` ${u}$${c} ${U}easbot-skills experimental_sync${c} ${u}${v("cli.example.sync",{locale:e,fallback:"Sync skills from node_modules"})}${c}`),console.log(),console.log(`${u}${v("cli.banner.try_hint",{locale:e,fallback:"try:"})}${c} easbot-skills add houjallen/agent-skills`),console.log(),console.log(`${u}${v("cli.banner.discover",{locale:e,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${c}`),console.log();}function zg(t){let e=Rt(t),n=(s,l)=>u+v(s,{locale:e,fallback:l})+c;console.log(`
|
|
89
|
+
${M}${v("cli.help.usage",{locale:e,fallback:"Usage: skills <command> [options]"})}${c}
|
|
90
|
+
|
|
91
|
+
${M}${v("cli.help.section.manage",{locale:e,fallback:"Manage Skills"})}${c}:
|
|
92
|
+
add <source> Add a skill package (alias: a).
|
|
93
|
+
<source> accepts 4 forms:
|
|
94
|
+
<owner>/<repo> e.g. houjallen/agent-skills
|
|
95
|
+
GitHub URL e.g. https://github.com/houjallen/agent-skills
|
|
96
|
+
local path e.g. ./skills/foo or /abs/path/to/skills
|
|
97
|
+
.well-known URL served from /.well-known/agent-skills/index.json
|
|
98
|
+
use <package>@<skill>
|
|
99
|
+
Generate a prompt for using one skill without installing it
|
|
100
|
+
remove [skills] Remove installed skills
|
|
101
|
+
list, ls List installed skills
|
|
102
|
+
find [query] Search for skills interactively
|
|
103
|
+
|
|
104
|
+
${M}${v("cli.help.section.updates",{locale:e,fallback:"Updates"})}${c}:
|
|
105
|
+
update [skills...] Update skills to latest versions (alias: upgrade)
|
|
106
|
+
|
|
107
|
+
${M}${v("cli.help.section.maintenance",{locale:e,fallback:"Maintenance (Operations)"})}${c}:
|
|
108
|
+
cache <subcommand> Manage store / cache sources (36A):
|
|
109
|
+
list List all store sources
|
|
110
|
+
clean Clean entire cache root
|
|
111
|
+
clean --source <key> Clean cache for one source
|
|
112
|
+
remove <key> Remove store source (store + cache + defs)
|
|
113
|
+
|
|
114
|
+
${M}${v("cli.help.section.update_options",{locale:e,fallback:"Update Options"})}${c}:
|
|
115
|
+
-g, --global ${v("cli.help.update.flag.global",{locale:e,fallback:"Update global skills only"})}
|
|
116
|
+
-p, --project ${v("cli.help.update.flag.project",{locale:e,fallback:"Update project skills only"})}
|
|
117
|
+
-y, --yes ${v("cli.help.update.flag.yes",{locale:e,fallback:"Skip scope prompt (defaults to both project + global)"})}
|
|
118
|
+
--all ${v("cli.help.update.flag.all",{locale:e,fallback:"Shorthand for --skill '*' -y (update all installed skills)"})}
|
|
119
|
+
--force ${v("cli.help.update.flag.force",{locale:e,fallback:"Skip SKILL.md hash check; reinstall every selected skill"})}
|
|
120
|
+
|
|
121
|
+
${M}${v("cli.help.section.project",{locale:e,fallback:"Project"})}${c}:
|
|
122
|
+
experimental_install Restore skills from skills-lock.json
|
|
123
|
+
init [name] Initialize a skill (creates <name>/SKILL.md or ./SKILL.md)
|
|
124
|
+
experimental_sync Sync skills from node_modules into agent directories
|
|
125
|
+
|
|
126
|
+
${M}${v("cli.help.section.add_options",{locale:e,fallback:"Add Options"})}${c}:
|
|
127
|
+
-g, --global ${v("cli.help.add.flag.global",{locale:e,fallback:"Install skill globally (user-level) instead of project-level"})}
|
|
128
|
+
-a, --agent <agents> ${v("cli.help.add.flag.agent",{locale:e,fallback:"Specify agents to install to (use '*' for all agents)"})}
|
|
129
|
+
-s, --skill <skills> ${v("cli.help.add.flag.skill",{locale:e,fallback:"Specify skill names to install (use '*' for all skills)"})}
|
|
130
|
+
-l, --list ${v("cli.help.add.flag.list",{locale:e,fallback:"List available skills in the repository without installing"})}
|
|
131
|
+
-y, --yes ${v("cli.help.add.flag.yes",{locale:e,fallback:"Skip confirmation prompts"})}
|
|
132
|
+
--copy ${v("cli.help.add.flag.copy",{locale:e,fallback:"Copy files instead of symlinking to agent directories"})}
|
|
133
|
+
--subagent <names> ${v("cli.help.add.flag.subagent",{locale:e,fallback:"Install to Eve subagents (use 'root' for the root agent)"})}
|
|
134
|
+
--all ${v("cli.help.add.flag.all",{locale:e,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
|
|
135
|
+
--full-depth ${v("cli.help.add.flag.full_depth",{locale:e,fallback:"Search all subdirectories even when a root SKILL.md exists"})}
|
|
136
|
+
|
|
137
|
+
${M}${v("cli.help.section.use_options",{locale:e,fallback:"Use Options"})}${c}:
|
|
138
|
+
-s, --skill <skill> ${v("cli.help.use.flag.skill",{locale:e,fallback:"Specify the skill to use"})}
|
|
139
|
+
-a, --agent <agent> ${v("cli.help.use.flag.agent",{locale:e,fallback:"Start one supported agent interactively"})}
|
|
140
|
+
--full-depth ${v("cli.help.use.flag.full_depth",{locale:e,fallback:"Search all subdirectories even when a root SKILL.md exists"})}
|
|
141
|
+
--dangerously-accept-openclaw-risks
|
|
142
|
+
${v("cli.help.use.flag.openclaw_risks",{locale:e,fallback:"Allow unverified OpenClaw community skills"})}
|
|
143
|
+
|
|
144
|
+
${M}${v("cli.help.section.remove_options",{locale:e,fallback:"Remove Options"})}${c}:
|
|
145
|
+
-g, --global ${v("cli.help.remove.flag.global",{locale:e,fallback:"Remove from global scope"})}
|
|
146
|
+
-a, --agent <agents> ${v("cli.help.remove.flag.agent",{locale:e,fallback:"Remove from specific agents (use '*' for all agents)"})}
|
|
147
|
+
-s, --skill <skills> ${v("cli.help.remove.flag.skill",{locale:e,fallback:"Specify skills to remove (use '*' for all skills)"})}
|
|
148
|
+
-y, --yes ${v("cli.help.remove.flag.yes",{locale:e,fallback:"Skip confirmation prompts"})}
|
|
149
|
+
--all ${v("cli.help.remove.flag.all",{locale:e,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
|
|
150
|
+
|
|
151
|
+
${M}${v("cli.help.section.sync_options",{locale:e,fallback:"Experimental Sync Options"})}${c}:
|
|
152
|
+
-a, --agent <agents> ${v("cli.help.sync.flag.agent",{locale:e,fallback:"Specify agents to install to (use '*' for all agents)"})}
|
|
153
|
+
-y, --yes ${v("cli.help.sync.flag.yes",{locale:e,fallback:"Skip confirmation prompts"})}
|
|
154
|
+
|
|
155
|
+
${M}${v("cli.help.section.list_options",{locale:e,fallback:"List Options"})}${c}:
|
|
156
|
+
-g, --global ${v("cli.help.list.flag.global",{locale:e,fallback:"List global skills (default: project)"})}
|
|
157
|
+
-p, --project ${v("cli.help.list.flag.project",{locale:e,fallback:"List project skills only"})}
|
|
158
|
+
-a, --agent <agents> ${v("cli.help.list.flag.agent",{locale:e,fallback:"Filter by specific agents (use '*' for all agents)"})}
|
|
159
|
+
--json ${v("cli.help.list.flag.json",{locale:e,fallback:"Output as JSON (machine-readable, no ANSI codes)"})}
|
|
160
|
+
--all ${v("cli.help.list.flag.all",{locale:e,fallback:"Shorthand for --agent *"})}
|
|
161
|
+
|
|
162
|
+
${M}${v("cli.help.section.find_options",{locale:e,fallback:"Find Options"})}${c}:
|
|
163
|
+
--owner <owner> ${v("cli.help.find.flag.owner",{locale:e,fallback:"Search only repositories from a GitHub owner"})}
|
|
164
|
+
--json Output as JSON (machine-readable, no ANSI codes)
|
|
165
|
+
|
|
166
|
+
${M}${v("cli.help.section.options",{locale:e,fallback:"Options"})}${c}:
|
|
167
|
+
--help, -h Show this help message
|
|
168
|
+
--version, -v Show version number
|
|
169
|
+
|
|
170
|
+
${M}Examples:${c}
|
|
171
|
+
${u}$${c} easbot-skills add houjallen/agent-skills ${n("cli.example.add","Add a skill package")}
|
|
172
|
+
${u}$${c} easbot-skills use houjallen/agent-skills@houjallen | claude ${n("cli.example.use","Use a skill one-shot")}
|
|
173
|
+
${u}$${c} easbot-skills use houjallen/agent-skills --skill houjallen --agent claude ${n("cli.example.use_with_agent","Specify skill + agent")}
|
|
174
|
+
${u}$${c} easbot-skills add houjallen/agent-skills -g ${n("cli.example.add_global","Install globally")}
|
|
175
|
+
${u}$${c} easbot-skills add houjallen/agent-skills --agent claude-code cursor ${n("cli.example.add_multi_agent","Install to multiple agents")}
|
|
176
|
+
${u}$${c} easbot-skills add houjallen/agent-skills --skill pr-review commit ${n("cli.example.add_multi_skill","Install multiple skills")}
|
|
177
|
+
${u}$${c} easbot-skills remove ${u}# ${n("cli.example.remove_interactive","Interactive remove")}${c}
|
|
178
|
+
${u}$${c} easbot-skills remove web-design ${u}# ${n("cli.example.remove_by_name","Remove by name")}${c}
|
|
179
|
+
${u}$${c} easbot-skills rm --global frontend-design
|
|
180
|
+
${u}$${c} easbot-skills list ${u}# ${n("cli.example.list_project","List project skills")}${c}
|
|
181
|
+
${u}$${c} easbot-skills ls -g ${u}# ${n("cli.example.list_global","List global skills")}${c}
|
|
182
|
+
${u}$${c} easbot-skills ls -a claude-code ${u}# ${n("cli.example.list_filter_agent","Filter by agent")}${c}
|
|
183
|
+
${u}$${c} easbot-skills ls --json ${u}# ${n("cli.example.list_json","JSON output")}${c}
|
|
184
|
+
${u}$${c} easbot-skills find ${u}# ${n("cli.example.find_interactive","Interactive search")}${c}
|
|
185
|
+
${u}$${c} easbot-skills find typescript ${u}# ${n("cli.example.find_keyword","Search by keyword")}${c}
|
|
186
|
+
${u}$${c} easbot-skills find react --owner houjallen ${u}# ${n("cli.example.find_owner","Search within an owner")}${c}
|
|
187
|
+
${u}$${c} easbot-skills update
|
|
188
|
+
${u}$${c} easbot-skills update my-skill ${u}# ${n("cli.example.update_one","Update a single skill")}${c}
|
|
189
|
+
${u}$${c} easbot-skills update -g ${u}# ${n("cli.example.update_global","Update global skills only")}${c}
|
|
190
|
+
${u}$${c} easbot-skills experimental_install ${u}# ${n("cli.example.install","Restore from lockfile")}${c}
|
|
191
|
+
${u}$${c} easbot-skills init my-skill ${u}# ${n("cli.example.init","Create a new skill")}${c}
|
|
192
|
+
${u}$${c} easbot-skills experimental_sync ${u}# ${n("cli.example.sync","Sync from node_modules")}${c}
|
|
193
|
+
${u}$${c} easbot-skills experimental_sync -y ${u}# ${n("cli.example.sync_no_prompt","Sync without prompts")}${c}
|
|
194
|
+
|
|
195
|
+
${u}${v("cli.banner.discover",{locale:e,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${c}
|
|
196
|
+
`);}function ha(t){let e=Rt(t);console.log(`
|
|
197
|
+
${M}${v("cli.help.remove.usage",{locale:e,fallback:"Usage: easbot skills remove [skills...] [options]"})}${c}
|
|
198
|
+
|
|
199
|
+
${M}Description:${c}
|
|
200
|
+
${v("cli.help.remove.description",{locale:e,fallback:"Remove installed skills from agents. If no skill names are provided, an interactive selection menu will be shown."})}
|
|
201
|
+
|
|
202
|
+
${M}Arguments:${c}
|
|
203
|
+
${v("cli.help.remove.arguments",{locale:e,fallback:"skills Optional skill names to remove (space-separated)"})}
|
|
204
|
+
|
|
205
|
+
${M}Options:${c}
|
|
206
|
+
-g, --global ${v("cli.help.remove.flag.global",{locale:e,fallback:"Remove from global scope (~/) instead of project scope"})}
|
|
207
|
+
-a, --agent ${v("cli.help.remove.flag.agent",{locale:e,fallback:"Remove from specific agents (use '*' for all agents)"})}
|
|
208
|
+
-s, --skill ${v("cli.help.remove.flag.skill",{locale:e,fallback:"Specify skills to remove (use '*' for all skills)"})}
|
|
209
|
+
-y, --yes ${v("cli.help.remove.flag.yes",{locale:e,fallback:"Skip confirmation prompts"})}
|
|
210
|
+
--all ${v("cli.help.remove.flag.all",{locale:e,fallback:"Shorthand for --skill '*' --agent '*' -y"})}
|
|
211
|
+
|
|
212
|
+
${M}Examples:${c}
|
|
213
|
+
${u}$${c} easbot-skills remove ${u}# ${v("cli.example.remove_interactive",{locale:e,fallback:"Interactive remove"})}${c}
|
|
214
|
+
${u}$${c} easbot-skills remove my-skill ${u}# ${v("cli.example.remove_by_name",{locale:e,fallback:"Remove by name"})}${c}
|
|
215
|
+
${u}$${c} easbot-skills remove skill1 skill2 -y ${u}# ${v("cli.example.remove_all",{locale:e,fallback:"Remove multiple skills"})}${c}
|
|
216
|
+
${u}$${c} easbot-skills remove --global my-skill ${u}# ${v("cli.example.remove_global",{locale:e,fallback:"Remove from global scope"})}${c}
|
|
217
|
+
${u}$${c} easbot-skills rm --agent claude-code my-skill ${u}# ${v("cli.example.remove_by_agent",{locale:e,fallback:"Remove from specific agent"})}${c}
|
|
218
|
+
${u}$${c} easbot-skills remove --all ${u}# ${v("cli.example.remove_all",{locale:e,fallback:"Remove all skills"})}${c}
|
|
219
|
+
${u}$${c} easbot-skills remove --skill '*' -a cursor ${u}# ${v("cli.example.remove_agent_all",{locale:e,fallback:"Remove all skills from one agent"})}${c}
|
|
220
|
+
|
|
221
|
+
${u}${v("cli.banner.discover",{locale:e,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${c}
|
|
222
|
+
`);}function Pt(){console.log();}function ka(t,e){let n=Rt(e),s$1=e?.cwd??s()??process.cwd(),l=t[0]||basename(s$1),i=t[0]!==void 0,o=i?join(s$1,l):s$1,a=join(o,"SKILL.md"),r=i?`${l}/SKILL.md`:"SKILL.md";if(existsSync(a))return console.log(`${U}${v("cli.init.exists",{locale:n,vars:{path:r},fallback:`Skill already exists at ${r}`})}${c}`),0;i&&mkdirSync(o,{recursive:true});let d=Bl(n,l);return writeFileSync(a,d),console.log(`${U}${v("cli.init.created",{locale:n,vars:{name:l},fallback:`Initialized skill: ${l}`})}${c}`),console.log(),console.log(`${u}${v("cli.init.created_label",{locale:n,fallback:"Created"})}${c}:`),console.log(` ${r}`),console.log(),console.log(`${u}${v("cli.init.next.title",{locale:n,fallback:"Next steps"})}${c}:`),console.log(` 1. ${v("cli.init.next.edit",{locale:n,vars:{path:r},fallback:`Edit ${r} to define your skill instructions`})}`),console.log(` 2. ${v("cli.init.next.frontmatter",{locale:n,fallback:"Update the name and description in the frontmatter"})}`),console.log(),console.log(`${u}${v("cli.init.publish.title",{locale:n,fallback:"Publishing"})}${c}:`),console.log(` ${u}GitHub:${c} ${v("cli.init.publish.github",{locale:n,vars:{cmd:"easbot skills"},fallback:"Push to a repo, then easbot skills add <owner>/<repo>"})}`),console.log(` ${u}URL:${c} ${v("cli.init.publish.url",{locale:n,vars:{cmd:"easbot skills",path:r},fallback:"Host the file, then easbot skills add https://example.com/"+r})}`),console.log(),console.log(`${u}${v("cli.init.browse_hint",{locale:n,vars:{url:"https://skills.sh/"},fallback:"Browse existing skills for inspiration at https://skills.sh/"})}${c}`),console.log(),0}async function Bg(t,e){fa(e?.version);let s=e?.inAgent??await Jt();if(t.length===0)return s||ma(e),{code:0,handled:false};let l=t[0],i=t.slice(1);switch(l){case "find":case "search":case "f":case "s":return s||Pt(),console.log(),{code:await Qs(i),handled:true,command:l};case "init":return s||Pt(),console.log(),{code:ka(i,e),handled:true,command:l};case "experimental_install":return s||Pt(),await sl(i),{code:0,handled:true,command:l};case "a":case "add":{s||Pt();let{source:o,options:a}=sn(i);return await Ve(o,a),{code:0,handled:true,command:l}}case "use":{let{source:o,options:a,errors:r}=Tl(i);return await Il(o,a,r),{code:0,handled:true,command:l}}case "remove":case "rm":case "r":{if(i.includes("--help")||i.includes("-h"))return ha(e),{code:0,handled:true,command:l};let{skills:o,options:a}=rl(i);return await cn(o,a),{code:0,handled:true,command:l}}case "experimental_sync":{s||Pt();let{options:o}=rn(i);return await on(i,o),{code:0,handled:true,command:l}}case "list":case "ls":return await ll(i),{code:0,handled:true,command:l};case "check":case "update":case "upgrade":return await yl(i),{code:0,handled:true,command:l};case "cache":return {code:await Dl(i),handled:true,command:l};default:{let o=Rt(e);return console.log(v("cli.unknown_command",{locale:o,vars:{command:l??""},fallback:`Unknown command: ${l}`})),console.log(v("cli.help_hint",{locale:o,vars:{cmd:"skills"},fallback:"Run skills --help for usage."})),{code:1,handled:true,command:l}}}}
|
|
223
|
+
export{Ve as $,Pn as A,Cs as B,Nn as C,Es as D,le as E,dc as F,De as G,Jt as H,yc as I,Xt as J,js as K,ye as L,Zt as M,Ic as N,Pc as O,Qt as P,Rc as Q,Ns as R,Us as S,Os as T,Ds as U,Cc as V,Fs as W,xt as X,Mn as Y,Wn as Z,qs as _,Te as a,sn as aa,$n as b,Oo as ba,zt as c,Zs as ca,Ht as d,Qs as da,lt as e,on as ea,ds as f,rn as fa,Pe as g,sl as ga,ci as h,tr as ha,ui as i,ll as ia,ys as j,cn as ja,yt as k,rl as ka,ze as l,dr as la,Sn as m,Np as ma,Gt as n,fr as na,Si as o,hl as oa,Be as p,yl as pa,Ss as q,Tl as qa,St as r,Rr as ra,Ya as s,Cr as sa,Ja as t,Il as ta,xs as u,Er as ua,As as v,ma as va,In as w,zg as wa,Ls as x,Bg as xa,Ts as y,Is as z};
|