@easbot/skills 0.3.11 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +166 -59
- package/README.md +172 -62
- package/dist/chunks/blob-DOVEGVIE.cjs +1 -0
- package/dist/chunks/blob-JSMTOYEN.mjs +1 -0
- package/dist/chunks/chunk-2VZUPTI7.cjs +1 -0
- package/dist/chunks/chunk-2YVJ7YP6.mjs +22 -0
- package/dist/chunks/chunk-4R6NKPNW.mjs +3 -0
- package/dist/chunks/chunk-676OG55M.mjs +5 -0
- package/dist/chunks/chunk-6PJ3YQA7.mjs +2 -0
- package/dist/chunks/chunk-72DXY4B7.mjs +1 -0
- package/dist/chunks/chunk-CFMOYU7R.mjs +2 -0
- package/dist/chunks/chunk-GR2NJUJ6.mjs +255 -0
- package/dist/chunks/chunk-JFEBB5CL.cjs +22 -0
- package/dist/chunks/chunk-KV7EP6AW.cjs +255 -0
- package/dist/chunks/chunk-OWG6N2K6.cjs +5 -0
- package/dist/chunks/chunk-RWSBKHQ2.cjs +3 -0
- package/dist/chunks/chunk-RWZ4LFSN.mjs +1 -0
- package/dist/chunks/chunk-S6YNGR7S.cjs +2 -0
- package/dist/chunks/chunk-TCFGU43L.cjs +2 -0
- package/dist/chunks/chunk-VRHWDHQV.cjs +1 -0
- package/dist/chunks/chunk-WQGSYA5D.mjs +1 -0
- package/dist/chunks/chunk-XGUPIAAF.cjs +1 -0
- package/dist/chunks/cli-handler-RAJ42VDN.mjs +1 -0
- package/dist/chunks/cli-handler-YAJ5J5VA.cjs +1 -0
- package/dist/chunks/installer-FB26E7JZ.mjs +1 -0
- package/dist/chunks/installer-GOQTCUJ4.cjs +1 -0
- package/dist/chunks/interfaces-S47ZGORM.mjs +1 -0
- package/dist/chunks/interfaces-UIS44Q7A.cjs +1 -0
- package/dist/chunks/local-lock-4AA55ORE.cjs +1 -0
- package/dist/chunks/local-lock-LG5YL33V.mjs +1 -0
- package/dist/chunks/scan-QEVID2TF.mjs +1 -0
- package/dist/chunks/scan-XWU3FCE3.cjs +1 -0
- package/dist/chunks/skill-lock-KHPVP7AD.mjs +1 -0
- package/dist/chunks/skill-lock-LET33FVT.cjs +1 -0
- package/dist/chunks/store-3NRBE47N.mjs +1 -0
- package/dist/chunks/store-EHYH46YY.cjs +1 -0
- package/dist/chunks/telemetry-7T6MUW5A.mjs +1 -0
- package/dist/chunks/telemetry-LCGTSJDM.cjs +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +242 -127
- package/dist/index.d.ts +242 -127
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunks/blob-LYSE5I24.mjs +0 -1
- package/dist/chunks/blob-NYUAIVUS.cjs +0 -1
- package/dist/chunks/chunk-4IO7TNWC.mjs +0 -223
- package/dist/chunks/chunk-IWCI7DET.mjs +0 -6
- package/dist/chunks/chunk-KJPMAUXZ.cjs +0 -1
- package/dist/chunks/chunk-L6KE3VIY.mjs +0 -2
- package/dist/chunks/chunk-PGDLW2JN.cjs +0 -2
- package/dist/chunks/chunk-S76WRD5J.cjs +0 -6
- package/dist/chunks/chunk-WQJKBJSM.cjs +0 -223
- package/dist/chunks/chunk-Y2X6FBMZ.mjs +0 -1
- package/dist/chunks/scan-47YPOLJX.mjs +0 -1
- package/dist/chunks/scan-5G765ZEF.cjs +0 -1
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkPGDLW2JN_cjs=require('./chunk-PGDLW2JN.cjs'),chunkS76WRD5J_cjs=require('./chunk-S76WRD5J.cjs'),chunkKJPMAUXZ_cjs=require('./chunk-KJPMAUXZ.cjs'),path=require('path'),ti=require('simple-git'),promises=require('fs/promises'),os=require('os'),child_process=require('child_process'),util=require('util'),crypto=require('crypto'),zlib=require('zlib'),fs$1=require('fs'),utils=require('@easbot/utils'),detectAgent=require('@vercel/detect-agent'),S=require('picocolors'),x=require('@clack/prompts'),Qt=require('readline'),stream=require('stream'),url=require('url');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var ti__default=/*#__PURE__*/_interopDefault(ti);var S__default=/*#__PURE__*/_interopDefault(S);var x__namespace=/*#__PURE__*/_interopNamespace(x);var Qt__namespace=/*#__PURE__*/_interopNamespace(Qt);function Le(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 bn(t){let e=t.match(/^([^/]+)\/([^/]+)$/);return e?{owner:e[1],repo:e[2]}:null}async function Ht(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 Kt(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 Jl(t){return path.isAbsolute(t)||t.startsWith("./")||t.startsWith("../")||t==="."||t===".."||/^[a-zA-Z]:[/\\]/.test(t)}var Xl={"coinbase/agentWallet":"coinbase/agentic-wallet-skills"};function yn(t){try{return decodeURIComponent(t)}catch{return t}}function Zl(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 Ql(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(!Zl(n))return {inputWithoutFragment:t};let l=s.indexOf("@");if(l===-1)return {inputWithoutFragment:n,ref:yn(s)};let i=s.slice(0,l),o=s.slice(l+1);return {inputWithoutFragment:n,ref:i?yn(i):void 0,subpath:o?yn(o):void 0}}function cs(t,e,n){return e?`${t}#${e}${n?`@${n}`:""}`:t}function st(t){if(Jl(t)){let f=path.resolve(t);return {type:"local",url:f,localPath:f}}let{inputWithoutFragment:e,ref:n,subpath:s}=Ql(t);t=e;let l=Xl[t];l&&(t=l);let i=t.match(/^github:(.+)$/);if(i)return st(cs(i[1],n,s));let o=t.match(/^gitlab:(.+)$/);if(o)return st(cs(`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&&Kt(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&&Kt(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=Kt(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&&Kt(g))}}return ei(t)?{type:"well-known",url:t}:{type:"git",url:t,...n?{ref:n}:{},...s?{subpath:s}:{}}}function ei(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 gs=3e5,$n=(()=>{let t=process.env.SKILLS_CLONE_TIMEOUT;if(!t)return gs;let e=Number.parseInt(t,10);return Number.isFinite(e)&&e>0?e:gs})(),ds=util.promisify(child_process.execFile),Ie=class extends Error{constructor(n,s,l=false,i=false){super(n);chunkKJPMAUXZ_cjs.a(this,"url");chunkKJPMAUXZ_cjs.a(this,"isTimeout");chunkKJPMAUXZ_cjs.a(this,"isAuthError");this.name="GitCloneError",this.url=s,this.isTimeout=l,this.isAuthError=i;}};function ai(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 ci(t){try{let e=new URL(t);return e.protocol==="https:"&&e.hostname==="github.com"}catch{return false}}function ks(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 ui(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")||ks(t)}function fs(t){let e={...process.env,GIT_TERMINAL_PROMPT:"0",GIT_LFS_SKIP_SMUDGE:"1",...t};return ti__default.default({timeout:{block:$n},config:["filter.lfs.required=false"]}).env(e)}async function ms(t){try{await promises.rm(t,{recursive:!0,force:!0});}catch{}await promises.mkdir(t,{recursive:true});}async function pi(t,e,n){let s=t.slug;try{let{stdout:i,stderr:o}=await ds("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 ds("gh",["repo","clone",s,e,"--",...n?["--depth=1","--branch",n]:["--depth=1"]],{timeout:$n,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),true}function gi(t,e,n){return e&&ks(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 kt(t,e){let n=await promises.mkdtemp(path.join(os.tmpdir(),"skills-")),s=e?["--depth","1","--branch",e]:["--depth","1"],l=ai(t);try{return await fs().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=ui(o);if(a){try{await promises.rm(n,{recursive:!0,force:!0});}catch{}let p=Math.round($n/1e3);throw new Ie(`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&&ci(t)){try{if(await ms(n),await pi(l,n,e))return n}catch{}try{return await ms(n),await fs({GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND??"ssh -o BatchMode=yes"}).clone(l.sshUrl,n,s),n}catch{}}try{await promises.rm(n,{recursive:!0,force:!0});}catch{}if(r)throw new Ie(gi(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 Ie(`Failed to clone ${t}: ${o}${d}`,t,false,false)}}async function He(t){let e=path.normalize(path.resolve(t)),n=path.normalize(path.resolve(os.tmpdir()));if(!e.startsWith(n+path.sep)&&e!==n)throw new Error("Attempted to clean up directory outside of temp directory");await promises.rm(t,{recursive:true,force:true});}var ys="https://schemas.agentskills.io/discovery/0.2.0/schema.json",hi=50*1024*1024,ki=1e3,wn=class{constructor(){chunkKJPMAUXZ_cjs.a(this,"id","well-known");chunkKJPMAUXZ_cjs.a(this,"displayName","Well-Known Skills");chunkKJPMAUXZ_cjs.a(this,"WELL_KNOWN_PATHS",[".well-known/agent-skills",".well-known/skills"]);chunkKJPMAUXZ_cjs.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===ys){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:ys,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}=chunkKJPMAUXZ_cjs.v(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}=chunkKJPMAUXZ_cjs.v(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}=chunkKJPMAUXZ_cjs.v(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:chunkKJPMAUXZ_cjs.d(e.name),description:chunkKJPMAUXZ_cjs.d(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:${crypto.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>hi)throw new Error("Archive exceeds maximum unpacked size");if(e.size>=ki)throw new Error("Archive contains too many files");e.set(i,s);}extractTarGz(e){let n=zlib.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),q=n.readUInt16LE(w+28),Q=w+30+C+q,O=n.subarray(Q,Q+b),Y;if(y===0)Y=O;else if(y===8)Y=zlib.inflateRawSync(O);else throw new Error(`Unsupported zip compression method: ${y}`);if(Y.byteLength!==h)throw new Error("Zip entry size mismatch");this.addArchiveFile(o,_,new Uint8Array(Y),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}},Bt=new wn;function z(t){return utils.Filesystem.normalize(t)}async function Sn(t){let e=utils.Filesystem.join(t,"SKILL.md");try{let n=await promises.readFile(z(e));return crypto.createHash("sha256").update(n).digest("hex")}catch{return}}function wi({scope:t}){let e=t==="project"?chunkKJPMAUXZ_cjs.t():chunkKJPMAUXZ_cjs.q(),n=utils.Filesystem.join(e,t==="project"?".easbot":"easbot","skills");return utils.Filesystem.normalize(n)}function Ue(){return utils.Filesystem.join(chunkKJPMAUXZ_cjs.q(),"skills","store")}function $t(){return utils.Filesystem.join(Ue(),"index.json")}function yt(t){let n=[t.type,t.url,t.subpath??"",t.ref??""].join("|");return crypto.createHash("sha256").update(n).digest("hex")}function Ln(t){let e=yt(t);return utils.Filesystem.join(Ue(),e)}function ze(){return utils.Filesystem.join(chunkKJPMAUXZ_cjs.s(),"skills","cache")}function ws(t){if(t.type==="well-known")return Si(t.url);let e=Le(t);if(e)return utils.Filesystem.join(ze(),e);let n=t.url.replace(/^https?:\/\//,"").replace(/^git@[^:]+:/,"").replace(/\.git$/,"").replace(/[/:]/g,"-");return utils.Filesystem.join(ze(),n)}function Si(t){let n=new URL(t).origin,s=crypto.createHash("sha256").update(n).digest("hex").slice(0,16);return utils.Filesystem.join(ze(),`wellknown-${s}`)}async function wt(t){t.skillNames??[];if(t.type==="local")return vi(t);let n=t.mode??"install",{cacheDir:s,source:l}=await xi(t,n);return Ai(s,l,t)}var bt=class extends Error{constructor(n){super(`Local source path does not exist: ${n}`);chunkKJPMAUXZ_cjs.a(this,"localPath",n);this.name="LocalPathNotFoundError";}};async function vi(t,e){let n=t.localPath??t.url;if(!fs$1.existsSync(n))throw new bt(n);let s=Ln(t);yt(t);if(fs$1.existsSync(s))return {storeDir:s,cacheHit:true,source:"local-cp"};await utils.Filesystem.mkdir(z(utils.Filesystem.dirname(s)),{recursive:true});try{await promises.cp(z(n),z(s),{recursive:!0});}catch{await utils.Filesystem.mkdir(z(s),{recursive:true}).catch(()=>{});}return {storeDir:s,cacheHit:false,source:"local-cp"}}async function xi(t,e){let n=t.ref??"HEAD",s=ws(t);if(t.type==="well-known")return fs$1.existsSync(s)?{cacheDir:s,source:"cache-pull"}:(await utils.Filesystem.mkdir(z(s),{recursive:true}),await Li(t.url,s),{cacheDir:s,source:"well-known-fetch"});if(fs$1.existsSync(s))try{let l=ti__default.default(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 utils.Filesystem.mkdir(z(utils.Filesystem.dirname(s)),{recursive:!0});let l=await kt(t.url,n),i=await promises.readdir(z(l));if(i.length!==1)throw new Error(`Expected single repo dir in ${l}, got ${i.length}`);return await promises.cp(z(utils.Filesystem.join(l,i[0])),z(s),{recursive:!0}),{cacheDir:s,source:"cache-clone"}}catch{return await utils.Filesystem.mkdir(z(s),{recursive:true}).catch(()=>{}),{cacheDir:s,source:"cache-pull"}}}async function Ai(t,e,n,s){let l=Ln(n);if(fs$1.existsSync(l))return {storeDir:l,cacheHit:true,source:e};await utils.Filesystem.mkdir(z(utils.Filesystem.dirname(l)),{recursive:true});try{await promises.cp(z(t),z(l),{recursive:!0});}catch{await utils.Filesystem.mkdir(z(l),{recursive:true}).catch(()=>{});}return {storeDir:l,cacheHit:false,source:e}}async function Re(){let t=z($t());try{let e=await utils.Filesystem.readText(t);return JSON.parse(e)}catch{return {}}}async function vn(t){if(t.length===0)return;let e=await Re(),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 utils.Filesystem.writeJson(z($t()),e);}async function qt(t){let e=await Re();return t in e?(delete e[t],await utils.Filesystem.writeJson(z($t()),e),true):false}async function Li(t,e){let n;try{n=await Bt.fetchAllSkills(t);}catch{return}if(n.length!==0)for(let s of n)try{await Ti(s,e);}catch{}}async function Ti(t,e){let n=utils.Filesystem.join(e,t.installName),s=utils.Filesystem.normalize(n),l=utils.Filesystem.normalize(e);if(!s.startsWith(`${l}/`)&&s!==l)throw new Error(`Unsafe skill dir: ${t.installName}`);await promises.mkdir(z(n),{recursive:true});for(let[i,o]of t.files){let a=utils.Filesystem.join(n,i),r=utils.Filesystem.normalize(a);if(!r.startsWith(`${s}/`)&&r!==s||i.includes("\0"))continue;let d=path.dirname(z(a));d!==z(n)&&await promises.mkdir(d,{recursive:true}),await promises.writeFile(z(a),typeof o=="string"?o:Buffer.from(o));}}async function qa(t){return (await wt({type:"git",url:t.url,ref:t.ref})).storeDir}async function Ss(t,e={}){let n=Ln(t);if(fs$1.existsSync(n)){let a=await chunkS76WRD5J_cjs.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:yt(t),sourcePath:n,storePath:n,computedHash:await Sn(p.path)})));await vn(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=Le(t),r=a?.split("/")[0]?.toLowerCase(),d=!!a&&Object.hasOwn(chunkPGDLW2JN_cjs.a,a.toLowerCase());if(a&&r&&(d||chunkPGDLW2JN_cjs.b.includes(r))){let p=await chunkPGDLW2JN_cjs.h(a,{subpath:t.subpath,ref:t.ref,includeInternal:e.includeInternal});if(p&&p.skills.length>0){await Ii(p.skills,n);let y=p.skills.map(h=>({name:h.name,description:h.description,path:utils.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:yt(t),sourcePath:n,storePath:n,computedHash:await Sn(utils.Filesystem.join(n,h.name))})));return await vn(b),l=p.skills,{storeDir:n,cacheHit:false,source:"blob-fetch",skills:y,blobSkills:l}}}}let i=await wt(t),o=await chunkS76WRD5J_cjs.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:yt(t),sourcePath:i.storeDir,storePath:i.storeDir,computedHash:await Sn(r.path)})));await vn(a);}return {storeDir:i.storeDir,cacheHit:i.cacheHit,source:i.source,skills:o,blobSkills:[]}}async function Ii(t,e){for(let n of t){let s=utils.Filesystem.join(e,n.name),l=utils.Filesystem.normalize(s),i=utils.Filesystem.normalize(e);if(!(!l.startsWith(`${i}/`)&&l!==i))try{await promises.mkdir(z(s),{recursive:!0});for(let o of n.files){let a=utils.Filesystem.join(s,o.path),r=utils.Filesystem.normalize(a);if(!r.startsWith(`${l}/`)&&r!==l||o.path.includes("\0"))continue;let d=path.dirname(z(a));d!==z(s)&&await promises.mkdir(d,{recursive:!0}),await promises.writeFile(z(a),o.contents,"utf-8");}}catch{}}}function St(t){try{let e=utils.Filesystem.normalize(t);for(let n of [ze(),Ue()]){let s=utils.Filesystem.normalize(n);if(e===s||e.startsWith(`${s}/`))return !0}return !1}catch{return false}}async function Ya({cachePath:t,skillName:e,scope:n}){let s=utils.Filesystem.join(wi({scope:n}),e);return fs$1.existsSync(s)&&await promises.rm(z(s),{recursive:true,force:true}),await promises.cp(z(t),z(s),{recursive:true}),s}async function vs(t){let e=ws(t);fs$1.existsSync(e)&&await promises.rm(z(e),{recursive:true,force:true});}async function xs(){let t=ze();fs$1.existsSync(t)&&await promises.rm(z(t),{recursive:true,force:true});}async function Ps(t){let e=crypto.createHash("sha256");try{let n=await promises.readFile(path.join(t,"SKILL.md"),"utf-8");e.update("SKILL.md"),e.update(n);}catch{e.update("EMPTY");}return e.digest("hex")}async function Tn(t,e){let n;try{n=await promises.lstat(t);}catch{return "absent"}if(n.isSymbolicLink())try{let a=utils.Filesystem.toUnixPath(await promises.realpath(t)),r=utils.Filesystem.toUnixPath(await promises.realpath(e));return a===r?"symlinked":"orphan"}catch{return "orphan"}let s=path.join(t,"SKILL.md");try{await promises.access(s);}catch{return "absent"}if(!await chunkS76WRD5J_cjs.h(s))return "divergent";let i=await Ps(t),o=await Ps(e);return i===o?"copied":"divergent"}function As(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 Ls(t,e){let n=[],s=[];for(let l of t)if(l.kind!=="skip"){if(l.kind==="report"){s.push(l);continue}try{await promises.mkdir(path.dirname(l.targetPath),{recursive:!0});let i;l.mode==="symlink"?i=await chunkS76WRD5J_cjs.w(e.sourceDir,l.targetPath,{isGlobal:e.installGlobally&&l.scope==="global",agentType:l.agentId,cwd:e.cwd}):i=await chunkS76WRD5J_cjs.x(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 Ts(t,e){let n=[];for(let s of t)if(s==="eve"&&e.includeEveSubagents!==false){let l=chunkKJPMAUXZ_cjs.B(e.cwd);if(l.length===0)n.push(Ni(e));else for(let i of l)n.push({agentId:s,cells:{global:lt("global",s,true,e,i),project:lt("project",s,false,e,i)}});}else n.push({agentId:s,cells:{global:lt("global",s,true,e),project:lt("project",s,false,e)}});return n}function lt(t,e,n,s,l){return {scope:t,state:"absent",targetPath:path.join(chunkS76WRD5J_cjs.u(e,n,s.cwd,l),s.skillId),sourceDir:s.sourceDir}}function Ni(t){return {agentId:"eve",cells:{global:lt("global","eve",true,t),project:lt("project","eve",false,t)}}}async function In(t){let e=t.cwd??process.cwd(),n=utils.Filesystem.toUnixPath(t.sourceDir),s=t.includeEveSubagents??true;if(t.assumeYes)return {skipped:true,installed:[],reported:[]};let l=Ts(t.targetAgents,{skillId:t.skillId,sourceDir:n,cwd:e,includeEveSubagents:s}),i=[];for(let d of l){let p={...d.cells.global,state:await Tn(d.cells.global.targetPath,n)},y={...d.cells.project,state:await Tn(d.cells.project.targetPath,n)};i.push({agentId:d.agentId,cells:{global:p,project:y}});}let o=As(i,t.defaultMode),{installed:a,reported:r}=await Ls(o,{sourceDir:n,installGlobally:t.installGlobally,cwd:e});return {skipped:false,installed:a,reported:r,matrix:i}}var Ui="https://add-skill.vercel.sh/t",Oi="https://add-skill.vercel.sh/audit",Cn=null,En=null;function Rs(t){En=t;}function Di(){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 Fi(){return !process.env.DISABLE_TELEMETRY&&!process.env.DO_NOT_TRACK}function jn(t){Cn=t;}async function Cs(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(`${Oi}?${s.toString()}`,{signal:l.signal});return clearTimeout(i),o.ok?await o.json():null}catch{return null}}var _n=[];function se(t){if(Fi())try{let e=new URLSearchParams;Cn&&e.set("v",Cn),Di()&&e.set("ci","1"),En&&e.set("agent",En);for(let[s,l]of Object.entries(t))l!=null&&e.set(s,String(l));let n=fetch(`${Ui}?${e.toString()}`).catch(()=>{}).then(()=>{});_n.push(n);}catch{}}async function gc(t=5e3){if(_n.length===0)return;let e=new Promise(n=>setTimeout(n,t));await Promise.race([Promise.all(_n),e]);}var it=null,Wi={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 Oe(){return it||(it=await detectAgent.determineAgent(),it.isAgent&&Rs(it.agent.name),it)}async function Yt(){return (await Oe()).isAgent}async function kc(){let t=await Oe();return t.isAgent?t.agent.name:null}function Jt(t){return Wi[t]??null}var Yi=".agents",Un=".skill-lock.json",Es=3;function _s(){let t=chunkKJPMAUXZ_cjs.p(),e=chunkKJPMAUXZ_cjs.o(),n=process.env.XDG_STATE_HOME;return n?path.join(n,"skills",Un):t?path.join(t,"skills",Un):path.join(e||os.homedir(),Yi,Un)}async function ke(){let t=_s();try{let e=await promises.readFile(t,"utf-8"),n=JSON.parse(e);return typeof n.version!="number"||!n.skills||n.version<Es?On():n}catch{return On()}}async function Xt(t){let e=_s();await promises.mkdir(path.dirname(e),{recursive:true});let n=JSON.stringify(t,null,2);await promises.writeFile(e,n,"utf-8");}function Tc(t){return crypto.createHash("sha256").update(t,"utf-8").digest("hex")}var Dn=false;function Ic(){Dn=false;}function Zt(){if(process.env.GITHUB_TOKEN)return process.env.GITHUB_TOKEN;if(process.env.GH_TOKEN)return process.env.GH_TOKEN;Dn||(process.stderr.write(`${S__default.default.yellow("\u2502")} ${S__default.default.yellow("GitHub rate limit reached")} \u2014 using your ${S__default.default.cyan("gh")} login to continue.
|
|
20
|
-
${S__default.default.yellow("\u2502")} ${S__default.default.dim(`Tip: set ${S__default.default.cyan("GITHUB_TOKEN")} to avoid this prompt, or use ${S__default.default.cyan("--full-depth")} to clone instead.
|
|
21
|
-
`)}`),Dn=true);try{let t=child_process.execSync("gh auth token",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(t)return t}catch{}return null}async function Pc(t,e,n,s){let{fetchRepoTree:l,getSkillFolderHashFromTree:i}=await import('./blob-NYUAIVUS.cjs'),o=await l(t,s,n??void 0);return o?i(o,e):null}async function js(t,e){let n=await ke(),s=new Date().toISOString(),l=n.skills[t];n.skills[t]={...e,installedAt:l?.installedAt??s,updatedAt:s},await Xt(n);}async function Ns(t){let e=await ke();return t in e.skills?(delete e.skills[t],await Xt(e),true):false}async function Us(t){return (await ke()).skills[t]??null}async function Os(){return (await ke()).skills}async function Rc(){let t=await ke(),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 On(){return {version:Es,skills:{},dismissed:{}}}async function Ds(t){return (await ke()).dismissed?.[t]===true}async function vt(t){let e=await ke();e.dismissed||(e.dismissed={}),e.dismissed[t]=true,await Xt(e);}async function Fn(){return (await ke()).lastSelectedAgents}async function Mn(t){let e=await ke();e.lastSelectedAgents=t,await Xt(e);}var Zi=new stream.Writable({write(t,e,n){n();}}),Qi=S__default.default.green("\u25C6"),eo=S__default.default.red("\u25A0"),to=S__default.default.green("\u25C7"),no=S__default.default.green("\u25CF"),so=S__default.default.dim("\u25CB");S__default.default.green("\u2713");var lo=S__default.default.green("\u2022"),le=S__default.default.dim("\u2502"),ot=S__default.default.dim("\u2500"),io=Symbol("cancel");function oo(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 ro(t,e){let n=util.stripVTControlCharacters(t),s=Math.max(1,e),l=oo(n);return Math.max(1,Math.ceil(l/s))}function ao(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+ro(l,n),0)}async function rt(t){let{message:e,items:n,maxVisible:s=8,initialSelected:l=[],required:i=false,lockedSection:o}=t;return new Promise(a=>{let r=Qt__namespace.createInterface({input:process.stdin,output:Zi,terminal:false});process.stdin.isTTY&&process.stdin.setRawMode(true),Qt__namespace.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(),q=A==="active"?Qi:A==="cancel"?eo:to;if(L.push(`${q} ${S__default.default.bold(e)}`),A==="active"){if(o&&o.items.length>0){L.push(`${le}`);let Z=`${S__default.default.bold(o.title)} ${S__default.default.dim("\u2500\u2500 always included")}`;L.push(`${le} ${ot}${ot} ${Z} ${ot.repeat(12)}`);for(let je of o.items)L.push(`${le} ${lo} ${S__default.default.bold(je.label)}`);o.hiddenCount&&o.hiddenCount>0&&L.push(`${le} ${S__default.default.dim(`...and ${o.hiddenCount} more`)}`),L.push(`${le}`),L.push(`${le} ${ot}${ot} ${S__default.default.bold("Additional agents")} ${ot.repeat(29)}`);}let Q=`${le} ${S__default.default.dim("Search:")} ${d}${S__default.default.inverse(" ")}`;L.push(Q),L.push(`${le} ${S__default.default.dim("\u2191\u2193 move, space select, enter confirm")}`),L.push(`${le}`);let O=Math.max(0,Math.min(p-Math.floor(s/2),C.length-s)),Y=Math.min(C.length,O+s),re=C.slice(O,Y);if(C.length===0)L.push(`${le} ${S__default.default.dim("No matches found")}`);else {for(let fe=0;fe<re.length;fe++){let Fe=re[fe],Te=O+fe,dt=y.has(Fe.value),ye=Te===p,be=dt?no:so,Rt=ye?S__default.default.underline(Fe.label):Fe.label,m=Fe.hint?S__default.default.dim(` (${Fe.hint})`):"",P=ye?S__default.default.cyan("\u276F"):" ";L.push(`${le} ${P} ${be} ${Rt}${m}`);}let Z=O,je=C.length-Y;if(Z>0||je>0){let fe=[];Z>0&&fe.push(`\u2191 ${Z} more`),je>0&&fe.push(`\u2193 ${je} more`),L.push(`${le} ${S__default.default.dim(fe.join(" "))}`);}}L.push(`${le}`);let ae=o?o.items.map(Z=>({value:Z.value,label:Z.label})):[],me=new Set(ae.map(Z=>Z.value)),ie=ae.map(Z=>Z.label);for(let Z of n)!y.has(Z.value)||me.has(Z.value)||(me.add(Z.value),ie.push(Z.label));if(ie.length===0)L.push(`${le} ${S__default.default.dim("Selected: (none)")}`);else {let Z=ie.length<=3?ie.join(", "):`${ie.slice(0,3).join(", ")} +${ie.length-3} more`;L.push(`${le} ${S__default.default.green("Selected:")} ${Z}`);}L.push(`${S__default.default.dim("\u2514")}`);}else if(A==="submit"){let Q=[...o?o.items.map(O=>O.label):[],...n.filter(O=>y.has(O.value)).map(O=>O.label)];L.push(`${le} ${S__default.default.dim(Q.join(", "))}`);}else A==="cancel"&&L.push(`${le} ${S__default.default.strikethrough(S__default.default.dim("Cancelled"))}`);process.stdout.write(L.join(`
|
|
22
|
-
`)+`
|
|
23
|
-
`),b=ao(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(io);},_=(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 q=C[p];q&&(y.has(q.value)?y.delete(q.value):y.add(q.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 ct(t){return S__default.default.bgCyan(S__default.default.black(S__default.default.bold(` ${t} `)))}function Fs(){return S__default.default.bgRed(S__default.default.white(S__default.default.bold(" ERROR ")))}var Ms={version:"0.3.11"};var Bs=t=>typeof t=="symbol",Gs="eve agent";function mo(t,e){return t.startsWith("git@")||t.startsWith("ssh://")?t:e}function Vs(t){jn(t);}async function ho(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 chunkS76WRD5J_cjs.D({installName:b.name,files:b.files},l,{global:a,mode:o,eveSubagent:i});}else d&&t.path===d&&t.rawContent?y=await chunkS76WRD5J_cjs.D({installName:t.name,files:[{path:"SKILL.md",contents:t.rawContent}]},l,{global:a,mode:o}):y=await chunkS76WRD5J_cjs.v(t,l,{global:a,mode:o,eveSubagent:i});return {skill:chunkS76WRD5J_cjs.k(t),agent:xt(e),pluginName:t.pluginName,...y}}var ko=(()=>{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 Ws(t){switch(t){case "critical":return S__default.default.red(S__default.default.bold("Critical Risk"));case "high":return S__default.default.red("High Risk");case "medium":return S__default.default.yellow("Med Risk");case "low":return S__default.default.green("Low Risk");case "safe":return S__default.default.green("Safe");default:return S__default.default.dim("--")}}function yo(t){if(!t)return S__default.default.dim("--");let e=t.alerts??0;return e>0?S__default.default.red(`${e} alert${e!==1?"s":""}`):S__default.default.green("0 alerts")}function ut(t,e){let n=chunkKJPMAUXZ_cjs.c(t),s=Math.max(0,e-n.length);return t+" ".repeat(s)}function bo(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=ut("",l+2)+ut(S__default.default.dim("Gen"),18)+ut(S__default.default.dim("Socket"),18)+S__default.default.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?Ws(r.ath.risk):S__default.default.dim("--"),y=r?.socket?yo(r.socket):S__default.default.dim("--"),b=r?.snyk?Ws(r.snyk.risk):S__default.default.dim("--");i.push(ut(S__default.default.cyan(d),l+2)+ut(p,18)+ut(y,18)+b);}return i.push(""),i.push(`${S__default.default.dim("Details:")} ${S__default.default.dim(`https://skills.sh/${n}`)}`),i}function Wn(t,e){let n=os.homedir();return t===n||t.startsWith(n+path.sep)?"~"+t.slice(n.length):t===e||t.startsWith(e+path.sep)?"."+t.slice(e.length):t}function $o(t){let e=crypto.createHash("sha256");return e.update("SKILL.md"),e.update(t),e.digest("hex")}function pe(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 wo(t){let e=t.map(s=>S__default.default.cyan(chunkS76WRD5J_cjs.k(s))),n=pe(e,3);return chunkKJPMAUXZ_cjs.c(n).length<=80?n:`${t.length} selected skills`}function So(t){return `Detected an eve project. Install ${wo(t)} for your ${Gs} to use?`}function qs(t){let e=[],n=[];for(let s of t)chunkKJPMAUXZ_cjs.K(s)?e.push(chunkKJPMAUXZ_cjs.x[s].displayName):n.push(chunkKJPMAUXZ_cjs.x[s].displayName);return {universal:e,symlinked:n}}function xt(t){let e=chunkKJPMAUXZ_cjs.x[t.agent].displayName;return t.subagent?`${e} (${t.subagent})`:e}function Ks(t){return t.subagent?`${t.agent}:${t.subagent}`:t.agent}function vo(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 xo(t,e){let n=[],s=t.filter(a=>!a.subagent).map(a=>a.agent),l=t.filter(a=>a.subagent).map(xt),{universal:i,symlinked:o}=qs(s);if(e==="symlink")i.length>0&&n.push(` ${S__default.default.green("universal:")} ${pe(i)}`),o.length>0&&n.push(` ${S__default.default.dim("symlinked:")} ${pe(o)}`),l.length>0&&n.push(` ${S__default.default.dim("copied:")} ${pe(l)}`);else {i.length>0&&n.push(` ${S__default.default.green("universal:")} ${pe(i)}`);let a=t.filter(r=>!r.subagent&&!chunkKJPMAUXZ_cjs.K(r.agent)).map(xt);a.length>0&&n.push(` ${S__default.default.dim("copied:")} ${pe(a)}`),l.length>0&&n.push(` ${S__default.default.dim("copied (subagent):")} ${pe(l)}`);}return n}function Hs(t){let e=chunkKJPMAUXZ_cjs.D(),n=[...t];for(let s of e)n.includes(s)||n.push(s);return n}function Ao(t,e){let n=[],{universal:s}=qs(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__default.default.green("universal:")} ${pe(s)}`),i.length>0&&n.push(` ${S__default.default.cyan("copied:")} ${pe(i)}`),o.length>0&&n.push(` ${S__default.default.dim("symlinked:")} ${pe(o)}`),a.length>0&&n.push(` ${S__default.default.yellow("symlink-failed:")} ${pe(a)}`),n}function Lo(t){return x__namespace.multiselect({...t,options:t.options,message:`${t.message} ${S__default.default.dim("(space to toggle)")}`})}async function To(t,e){let n;try{n=await Fn();}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 rt({message:t,items:e,initialSelected:o,required:true});if(!Bs(a))try{await Mn(a);}catch{}return a}async function zs(t){let e=p=>!t.global||chunkKJPMAUXZ_cjs.x[p].globalSkillsDir,n=chunkKJPMAUXZ_cjs.D().filter(e),s=chunkKJPMAUXZ_cjs.D().filter(e),l=chunkKJPMAUXZ_cjs.E().filter(p=>p!=="eve"&&e(p)),i={title:"Universal (.agents/skills)",items:s.map(p=>({value:p,label:chunkKJPMAUXZ_cjs.x[p].displayName})),hiddenCount:n.length-s.length},o=l.map(p=>({value:p,label:chunkKJPMAUXZ_cjs.x[p].displayName,hint:t.global?chunkKJPMAUXZ_cjs.x[p].globalSkillsDir:chunkKJPMAUXZ_cjs.x[p].skillsDir})),a;try{a=await Fn();}catch{}let r=a?a.filter(p=>l.includes(p)&&!n.includes(p)):[],d=await rt({message:"Which agents do you want to install to?",items:o,initialSelected:r,lockedSection:i});if(!Bs(d))try{await Mn(d);}catch{}return d}var Io=Ms.version;jn(Io);async function Ge(t,e={}){let n=t[0],s=false,l=()=>{s||(x__namespace.log.message(S__default.default.dim("Tip: use the --yes (-y) and --global (-g) flags to install without prompts.")),s=true);};n||(console.log(),console.log(Fs()+" "+S__default.default.red("Missing required argument: source")),console.log(),console.log(S__default.default.dim(" Usage:")),console.log(` ${S__default.default.cyan("easbot skills add")} ${S__default.default.yellow("<source>")} ${S__default.default.dim("[options]")}`),console.log(),console.log(S__default.default.dim(" Example:")),console.log(` ${S__default.default.cyan("easbot skills add")} ${S__default.default.yellow("houjallen/agent-skills")}`),console.log(),process.exit(1)),e.all&&(e.skill=["*"],e.agent=["*"],e.yes=true);let i=await Oe();if(i.isAgent&&(e.yes=true,!e.agent||e.agent.length===0)){let a=Jt(i.agent.name);a&&(e.agent=Hs([a]));}console.log(),i.isAgent||x__namespace.intro(S__default.default.bgCyan(S__default.default.black(" skills "))),i.isAgent?x__namespace.log.info(ct(i.agent.name)+" Agent detected \u2014 installing non-interactively"):process.stdin.isTTY||l();let o=null;try{let a=x__namespace.spinner();a.start("Parsing source...");let r=st(n);a.stop(`Source: ${r.type==="local"?r.localPath:r.url}${r.ref?` #${S__default.default.yellow(r.ref)}`:""}${r.subpath?` @${S__default.default.cyan(r.subpath)}`:""}`);let d=Le(r),p=(()=>{if(!d)return Promise.resolve(null);let m=bn(d);return m?Ht(m.owner,m.repo).catch(()=>null):Promise.resolve(null)})(),y=Array.isArray(e?.skill)&&e.skill.length>0||e.fullDepth===!0||!!r.subpath;a.start("Loading source...");let b;try{b=await Ss(r,{includeInternal:y,fullDepth:e.fullDepth});}catch(m){throw m instanceof bt&&(a.stop(S__default.default.red("Path not found")),x__namespace.outro(S__default.default.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=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__default.default.red("No skills found")),x__namespace.outro(S__default.default.red("No valid skills found. Skills require a SKILL.md with name and description.")),await oe(o),process.exit(1)),a.stop(`Found ${S__default.default.green(h.length)} skill${h.length>1?"s":""}`),e.list){console.log(),x__namespace.log.step(S__default.default.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__default.default.bold(E));for(let D of m[T])x__namespace.log.message(` ${S__default.default.cyan(chunkS76WRD5J_cjs.k(D))}`),x__namespace.log.message(` ${S__default.default.dim(D.description)}`);console.log();}if(P.length>0){R.length>0&&console.log(S__default.default.bold("General"));for(let T of P)x__namespace.log.message(` ${S__default.default.cyan(chunkS76WRD5J_cjs.k(T))}`),x__namespace.log.message(` ${S__default.default.dim(T.description)}`);}console.log(),x__namespace.outro("Use --skill <name> to install specific skills"),await oe(o),process.exit(0);}let f;if(e.skill&&e.skill.length>0){let m=h.map(R=>chunkS76WRD5J_cjs.k(R)),P=chunkS76WRD5J_cjs.n(e.skill,m);if(P.wildcard)f=h,x__namespace.log.info(`Installing all ${h.length} skills`);else if(P.invalid.length>0){x__namespace.log.error(`No matching skills found for: ${P.invalid.join(", ")}`),x__namespace.log.info("Available skills:");for(let R of h)x__namespace.log.message(` - ${chunkS76WRD5J_cjs.k(R)}`);await oe(o),process.exit(1);}else f=chunkS76WRD5J_cjs.l(h,P.matched),f.length===0&&(x__namespace.log.error(`No matching skills found for: ${P.matched.join(", ")}`),await oe(o),process.exit(1)),x__namespace.log.info(`Selected ${f.length} skill${f.length!==1?"s":""}: ${f.map(R=>S__default.default.cyan(chunkS76WRD5J_cjs.k(R))).join(", ")}`);}else if(h.length===1){f=h;let m=h[0];x__namespace.log.info(`Skill: ${S__default.default.cyan(chunkS76WRD5J_cjs.k(m))}`),x__namespace.log.message(S__default.default.dim(m.description));}else if(e.yes)f=h,x__namespace.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):chunkS76WRD5J_cjs.k(T).localeCompare(chunkS76WRD5J_cjs.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:chunkS76WRD5J_cjs.k(D),hint:D.description.length>60?D.description.slice(0,57)+"...":D.description});}R=await x__namespace.groupMultiselect({message:`Select skills to install ${S__default.default.dim("(space to toggle)")}`,options:E,required:!0});}else {let T=m.map(E=>({value:E,label:chunkS76WRD5J_cjs.k(E),hint:E.description.length>60?E.description.slice(0,57)+"...":E.description}));R=await Lo({message:"Select skills to install",options:T,required:!0});}x__namespace.isCancel(R)&&(x__namespace.cancel("Installation cancelled"),await oe(o),process.exit(0)),f=R;}let $=Le(r),g=$?Cs($,f.map(m=>chunkS76WRD5J_cjs.k(m))):Promise.resolve(null),w,I=Object.keys(chunkKJPMAUXZ_cjs.x);if(e.agent&&e.agent.length>0){let m=chunkKJPMAUXZ_cjs.L(e.agent);m.length>0&&(x__namespace.log.error(`Invalid agents: ${m.join(", ")}`),x__namespace.log.info(`Valid agents: ${I.join(", ")}`),await oe(o),process.exit(1)),w=chunkKJPMAUXZ_cjs.M(e.agent),e.agent.includes("*")&&x__namespace.log.info(`Installing to all ${w.length} agents`);}else {a.start("Loading agents...");let m=await chunkKJPMAUXZ_cjs.y(),P=Object.keys(chunkKJPMAUXZ_cjs.x).length;if(a.stop(`${P} agents`),m.includes("eve")&&(e.yes||!i.isAgent)){let R=e.yes?!0:await x__namespace.confirm({message:So(f),initialValue:!0});if(x__namespace.isCancel(R)&&(x__namespace.cancel("Installation cancelled"),await oe(o),process.exit(0)),R)w=["eve"],x__namespace.log.info(`Installing to: ${S__default.default.cyan(Gs)}`);else {let T=await zs({global:e.global});x__namespace.isCancel(T)&&(x__namespace.cancel("Installation cancelled"),await oe(o),process.exit(0)),w=T;}}else if(m.length===0)if(e.yes)w=I,x__namespace.log.info("Installing to all agents");else {x__namespace.log.info("Select agents to install skills to");let R=Object.entries(chunkKJPMAUXZ_cjs.x).filter(([E])=>E!=="eve").map(([E,D])=>({value:E,label:D.displayName})),T=await To("Which agents do you want to install to?",R);x__namespace.isCancel(T)&&(x__namespace.cancel("Installation cancelled"),await oe(o),process.exit(0)),w=T;}else if(m.length===1||e.yes)if(w=Hs(m),m.length===1){let R=m[0];x__namespace.log.info(`Installing to: ${S__default.default.cyan(chunkKJPMAUXZ_cjs.x[R].displayName)}`);}else x__namespace.log.info(`Installing to: ${m.map(R=>S__default.default.cyan(chunkKJPMAUXZ_cjs.x[R].displayName)).join(", ")}`);else {let R=await zs({global:e.global});x__namespace.isCancel(R)&&(x__namespace.cancel("Installation cancelled"),await oe(o),process.exit(0)),w=R;}}e.subagent&&e.subagent.length>0&&!w.includes("eve")&&(w=[...w,"eve"]);let W=[void 0];if(w.includes("eve")){let m=chunkKJPMAUXZ_cjs.B(process.cwd());if(e.subagent&&e.subagent.length>0)W=e.subagent.map(P=>P==="root"||P==="."?void 0:P);else if(m.length>0&&!e.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__namespace.multiselect({message:"Where should Eve skills be installed?",options:P,initialValues:[""],required:!0});x__namespace.isCancel(R)&&(x__namespace.cancel("Installation cancelled"),await oe(o),process.exit(0)),W=R.map(T=>T===""?void 0:T);}}let _=vo(w,W),A=e.global??!1,L=w.some(m=>chunkKJPMAUXZ_cjs.x[m].globalSkillsDir!==void 0);if(e.global===void 0&&!e.yes&&L){let m=await x__namespace.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__namespace.isCancel(m)&&(x__namespace.cancel("Installation cancelled"),await oe(o),process.exit(0)),A=m;}let C=e.copy?"copy":"symlink",q=_.every(m=>m.agent==="eve"),Q=new Set(_.map(m=>m.subagent?`eve:subagent:${m.subagent}`:chunkKJPMAUXZ_cjs.x[m.agent].skillsDir));if(!e.copy&&!e.yes&&Q.size>1&&!q){let m=await x__namespace.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__namespace.isCancel(m)&&(x__namespace.cancel("Installation cancelled"),await oe(o),process.exit(0)),C=m;}else (Q.size<=1||q)&&(C="copy");let O=process.cwd(),Y=[],re=await Promise.all(f.flatMap(m=>_.map(async P=>({skillName:m.name,target:P,installed:await chunkS76WRD5J_cjs.y(m.name,P.agent,{global:A,eveSubagent:P.subagent})})))),ae=new Map;for(let{skillName:m,target:P,installed:R}of re)ae.has(m)||ae.set(m,new Map),ae.get(m).set(Ks(P),R);let me={},ie=[];for(let m of f)if(m.pluginName){let P=m.pluginName;me[P]||(me[P]=[]),me[P].push(m);}else ie.push(m);let Z=m=>{for(let P of m){Y.length>0&&Y.push("");let R=_[0];_.length>1&&(R=_.find($e=>chunkKJPMAUXZ_cjs.K($e.agent))??_[0]);let T=chunkS76WRD5J_cjs.A(P.name,{global:A,agent:R.agent,eveSubagent:R.subagent}),E=Wn(T,O);Y.push(`${S__default.default.cyan(E)}`),Y.push(...xo(_,C));let D=ae.get(P.name),F=_.filter(ce=>!chunkKJPMAUXZ_cjs.K(ce.agent)&&D?.get(Ks(ce))).map(xt);F.length>0&&Y.push(` ${S__default.default.yellow("overwrites:")} ${pe(F)}`);}},je=Object.keys(me).sort();for(let m of je){let P=m.split("-").map(R=>R.charAt(0).toUpperCase()+R.slice(1)).join(" ");Y.push(""),Y.push(S__default.default.bold(P)),Z(me[m]);}ie.length>0&&(je.length>0&&(Y.push(""),Y.push(S__default.default.bold("General"))),Z(ie)),console.log(),x__namespace.note(Y.join(`
|
|
24
|
-
`),"Installation Summary");try{let m=await Promise.race([g,new Promise(P=>setTimeout(()=>P(null),ko))]);if(m&&$){let P=bo(m,f.map(R=>({slug:chunkS76WRD5J_cjs.k(R),displayName:chunkS76WRD5J_cjs.k(R)})),$);P.length>0&&x__namespace.note(P.join(`
|
|
25
|
-
`),"Security Risk Assessments");}}catch{}if(!e.yes){let m=await x__namespace.confirm({message:"Proceed with installation?"});(x__namespace.isCancel(m)||!m)&&(x__namespace.cancel("Installation cancelled"),await oe(o),process.exit(0));}a.start("Installing skills...");let fe=[],Fe=await Promise.all(f.map(async m=>{let P=new Map;for(let T of _){let D=(T.agent==="eve"||T.agent==="easbot")&&C==="symlink"?chunkS76WRD5J_cjs.u(T.agent,A,O,T.subagent):chunkS76WRD5J_cjs.s(A,O),F=chunkS76WRD5J_cjs.r(m.name||path.basename(m.path)),ce=path.join(D,F),$e=chunkS76WRD5J_cjs.u(T.agent,A,O,T.subagent),Je=path.join($e,F),ee=ce,ue=P.get(ee);ue||(ue={canonicalDir:ce,members:[]},P.set(ee,ue)),ue.members.push({target:T,agentDir:Je});}return (await Promise.all([...P.values()].map(async T=>{let[E,...D]=T.members;if(!E)return [];let F=await ho(m,E.target,E.agentDir,{installMode:C,installGlobally:A,cwd:O,tempDir:o,blobResult:k}),ce=await Promise.all(D.map(async({target:$e,agentDir:Je})=>{let ee=C==="copy"?await chunkS76WRD5J_cjs.x(T.canonicalDir,Je,{agentType:$e.agent}):await chunkS76WRD5J_cjs.w(T.canonicalDir,Je,{isGlobal:A,agentType:$e.agent,cwd:O});return {skill:chunkS76WRD5J_cjs.k(m),agent:xt($e),pluginName:m.pluginName,...ee}}));return [F,...ce]}))).flat()}));for(let m of Fe)fe.push(...m);a.stop("Installation complete"),console.log();let Te=fe.filter(m=>m.success),dt=fe.filter(m=>!m.success),ye={};for(let m of f)k&&"repoPath"in m?ye[m.name]=m.repoPath:o&&m.path===o?ye[m.name]="SKILL.md":o&&m.path.startsWith(o+path.sep)&&(ye[m.name]=`${m.path.slice(o.length+1).split(path.sep).join("/")}/SKILL.md`);let be=Le(r),Rt=mo(r.url,be);if(be&&(bn(be)?p.then(P=>{P===!1&&se({event:"install",source:be,skills:f.map(R=>R.name).join(","),agents:w.join(","),...A&&{global:"1"},skillFiles:JSON.stringify(ye)});}):se({event:"install",source:be,skills:f.map(P=>P.name).join(","),agents:w.join(","),...A&&{global:"1"},skillFiles:JSON.stringify(ye)})),Te.length>0&&A&&be){let m=new Set(Te.map(R=>R.skill)),P;r.type==="github"&&!k&&(P=await chunkPGDLW2JN_cjs.e(be,r.ref,Zt));for(let R of f){let T=chunkS76WRD5J_cjs.k(R);if(m.has(T))try{let E="",D=ye[R.name];if(k&&D){let F=chunkPGDLW2JN_cjs.f(k.tree,D);F&&(E=F);}else if(r.type==="github"&&D&&P){let F=chunkPGDLW2JN_cjs.f(P,D);F&&(E=F);}else if(D&&o){let F=path.join(o,path.dirname(D)),ce=await chunkS76WRD5J_cjs.d(F);ce&&(E=ce);}await js(R.name,{source:Rt||be,sourceType:r.type,sourceUrl:r.url,ref:r.ref,skillPath:D,skillFolderHash:E,pluginName:R.pluginName});}catch{}}}if(Te.length>0&&!A){let m=new Set(Te.map(T=>T.skill)),P=w.includes("eve")?W.map(T=>T??""):void 0,R=P&&(P.length>1||P.some(T=>T!==""));for(let T of f){let E=chunkS76WRD5J_cjs.k(T);if(m.has(E))try{let D=k&&"snapshotHash"in T?T.snapshotHash:o&&T.path===o&&T.rawContent?$o(T.rawContent):await chunkS76WRD5J_cjs.d(T.path),F=ye[T.name];await chunkS76WRD5J_cjs.e(T.name,{source:Rt||r.url,ref:r.ref,sourceType:r.type,...F&&{skillPath:F},computedHash:D,...R&&{subagents:P}},O);}catch{}}}if(Te.length>0){let m=new Map,P={},R=[];for(let ee of Te){let ue=m.get(ee.skill)||[];if(ue.push(ee),m.set(ee.skill,ue),ue.length===1)if(ee.pluginName){let we=ee.pluginName;P[we]||(P[we]=[]),P[we].push(ee);}else R.push(ee);}let T=m.size,E=Te.filter(ee=>ee.mode==="symlink"&&ee.symlinkFailed),D=E.map(ee=>ee.agent),F=[],ce=ee=>{for(let ue of ee){let we=m.get(ue.skill)||[],Ct=we[0];if(F.push(`${S__default.default.green("\u2713")} ${ue.skill}`),Ct.canonicalPath){let Se=Wn(Ct.canonicalPath,O);F.push(` ${S__default.default.dim("source:")} ${Se}`);}let ft=new Map;for(let Se of we){if(Se.symlinkFailed||Se.skipped||Ct.canonicalPath&&Se.path===Ct.canonicalPath)continue;let Xe=Se.path;ft.has(Xe)?ft.get(Xe)!=="symlink"&&Se.mode==="symlink"&&ft.set(Xe,"symlink"):ft.set(Xe,Se.mode);}for(let[Se,Xe]of ft){let Gl=Wn(Se,O),Vl=Xe==="symlink"?S__default.default.cyan("(link)"):S__default.default.dim("(copied)");F.push(` ${S__default.default.dim("target:")} ${Gl} ${Vl}`);}F.push(...Ao(we,w));}},$e=Object.keys(P).sort();for(let ee of $e){let ue=ee.split("-").map(we=>we.charAt(0).toUpperCase()+we.slice(1)).join(" ");F.push(""),F.push(S__default.default.bold(ue)),ce(P[ee]);}R.length>0&&($e.length>0&&(F.push(""),F.push(S__default.default.bold("General"))),ce(R));let Je=S__default.default.green(`Installed ${T} skill${T!==1?"s":""}`);x__namespace.note(F.join(`
|
|
26
|
-
`),Je),E.length>0&&(x__namespace.log.warn(S__default.default.yellow(`Symlinks failed for: ${pe(D)}`)),x__namespace.log.message(S__default.default.dim(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(dt.length>0){console.log(),x__namespace.log.error(S__default.default.red(`Failed to install ${dt.length}`));for(let m of dt)x__namespace.log.message(` ${S__default.default.red("\u2717")} ${m.skill} \u2192 ${m.agent}: ${S__default.default.dim(m.error)}`);}console.log(),x__namespace.outro(S__default.default.green("Done!")+S__default.default.dim(" Review skills before use; they run with full agent permissions.")),await Po(e,w);}catch(a){if(a instanceof Ie){x__namespace.log.error(S__default.default.red("Failed to clone repository"));for(let r of a.message.split(`
|
|
27
|
-
`))x__namespace.log.message(S__default.default.dim(r));}else x__namespace.log.error(a instanceof Error?a.message:"Unknown error occurred");process.stdin.isTTY||l(),x__namespace.outro(S__default.default.red("Installation failed")),process.exit(1);}finally{await oe(o);}}async function oe(t){if(t){if(St(t))return;try{await He(t);}catch{}}}async function Po(t,e){if(process.stdin.isTTY&&!t?.yes)try{if(await Ds("findSkillsPrompt"))return;if(await chunkS76WRD5J_cjs.y("eas-skill-find","claude-code",{global:!0})){await vt("findSkillsPrompt");return}console.log(),x__namespace.log.message(S__default.default.dim("One-time prompt - you won't be asked again if you dismiss."));let l=await x__namespace.confirm({message:`Install the ${S__default.default.cyan("eas-skill-find")} skill? It helps your agent discover and suggest skills.`});if(x__namespace.isCancel(l)){await vt("findSkillsPrompt");return}if(l){await vt("findSkillsPrompt");let i=e?.filter(o=>o!=="replit");if(!i||i.length===0)return;console.log(),x__namespace.log.step("Installing eas-skill-find skill...");try{await Ge(["houjallen/agent-skills@skills/builtin/eas-skill-find"],{global:!0,yes:!0,agent:i});let o=path.join(chunkS76WRD5J_cjs.s(!0),"eas-skill-find"),a=await In({skillId:"eas-skill-find",sourceDir:o,targetAgents:i,installGlobally:!0,defaultMode:"symlink",assumeYes:t?.yes===!0});a.reported.length>0&&x__namespace.log.warn(`${a.reported.length} cell(s) reported divergent/orphan (not auto-fixed). Run 'easbot skills repair' to fix.`);}catch{x__namespace.log.warn("Failed to install eas-skill-find. You can try again with:"),x__namespace.log.message(S__default.default.dim(" easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find -g -y --all"));}}else await vt("findSkillsPrompt"),x__namespace.log.message(S__default.default.dim("You can install it later with: easbot skills add houjallen/agent-skills@skills/builtin/eas-skill-find"));}catch{}}function nn(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",At="\x1B[36m";var Kn="\x1B[33m";var sn=utils.Log.create({service:"skills-find"}),jo=process.env.SKILLS_API_URL||"https://skills.sh";function Js(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 No=/^[a-z0-9](?:[a-z0-9-]{0,38})$/i;function Uo(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(!No.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 Xs(t,e){try{let n=new URLSearchParams({q:t,limit:"10"});e&&n.set("owner",e);let s=`${jo}/api/search?${n.toString()}`,l=await fetch(s);return l.ok?(await l.json()).skills.map(o=>({name:chunkKJPMAUXZ_cjs.d(o.name),slug:chunkKJPMAUXZ_cjs.d(o.id),source:chunkKJPMAUXZ_cjs.d(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 Oo(t){let e=$t(),n={};try{let i=fs$1.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(Do(i,o));return l.sort((i,o)=>i.skillName.localeCompare(o.skillName)),l}function Do(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 Fo(t,e){let n=[];try{for await(let i of utils.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=Mo(t,i),a=await chunkS76WRD5J_cjs.h(o);if(!a)continue;let r=a.name;if(s&&!r.toLowerCase().includes(s))continue;let d=path.dirname(o);l.push({skillName:r,sourceKey:"",type:"scan",url:"",storePath:d});}return l.sort((i,o)=>i.skillName.localeCompare(o.skillName)),l}function Mo(t,e){let n=process.platform==="win32"?"\\":"/",s=e.replaceAll("/",n);return t.endsWith("/")||t.endsWith("\\")?t+s:t+n+s}var Wo="\x1B[?25l",Ko="\x1B[?25h",Ho="\x1B[J",zo=t=>`\x1B[${t}A`,Bo=t=>`\x1B[${t}G`;async function Go(t="",e){let n=[],s=0,l=t,i=false,o=null,a=0;process.stdin.isTTY&&process.stdin.setRawMode(true),Qt__namespace.emitKeypressEvents(process.stdin),process.stdin.resume(),process.stdout.write(Wo);function r(){a>0&&process.stdout.write(zo(a)+Bo(1)),process.stdout.write(Ho);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=Js(f.installs),_=W?` ${At}${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 Xs(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(Ko),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 Vo(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 qo(t,e){return await Ht(t,e)===false}async function Yo(t,e,n={}){let s=typeof n.path=="string"&&n.path.length>0,l=s?n.path:Ue(),i,o;if(s?(i=await Fo(l,t||void 0),o="scan"):(i=Oo(t||void 0),o="index"),se({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 Zs(t){let{query:e,options:n,errors:s}=Uo(t),l=n.owner,i=!process.stdin.isTTY;sn.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 Yo(e,n.json??false,n);if(e){sn.debug("runFind enter query branch",{query:e,owner:l,json:n.json});let k=await Xs(e,l);if(sn.debug("runFind searchSkillsAPI returned",{count:k.length}),se({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=Js(f.installs);console.log(`${U}${$}@${f.name}${c}${g?` ${At}${g}${c}`:""}`),console.log(`${u}\u2514 https://skills.sh/${f.slug}${c}`),console.log();}return 0}if(i||await Yt())return console.log(o),console.log(),console.log(`${u}Usage: easbot skills find <query> [--owner <owner>]${c}`),0;let a=await Go("",l);if(se({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}=nn([r,"--skill",d]),b=0;try{await Ge(p,y);}catch(k){b=1,sn.error("runAdd failed during find\u2192install",{err:k});}console.log();let h=Vo(r);return h&&await qo(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 el=t=>typeof t=="symbol";function tl(t,e){let n=os.homedir();return t===n||t.startsWith(n+path.sep)?"~"+t.slice(n.length):t===e||t.startsWith(e+path.sep)?"."+t.slice(e.length):t}async function Xo(t){let e=path.join(t,"node_modules"),n=[],s;try{s=await promises.readdir(e);}catch{return n}let l=async(i,o)=>{let a=await chunkS76WRD5J_cjs.h(path.join(i,"SKILL.md"));if(a){n.push({...a,packageName:o});return}let r=[i,path.join(i,"skills"),path.join(i,".agents","skills")];for(let d of r)try{let p=await promises.readdir(d);for(let y of p){let b=path.join(d,y);try{if(!(await promises.stat(b)).isDirectory())continue}catch{continue}let h=await chunkS76WRD5J_cjs.h(path.join(b,"SKILL.md"));h&&n.push({...h,packageName:o});}}catch{}};return await Promise.all(s.map(async i=>{if(i.startsWith("."))return;let o=path.join(e,i);try{if(!(await promises.stat(o)).isDirectory())return}catch{return}if(i.startsWith("@"))try{let a=await promises.readdir(o);await Promise.all(a.map(async r=>{let d=path.join(o,r);try{if(!(await promises.stat(d)).isDirectory())return}catch{return}await l(d,`${i}/${r}`);}));}catch{}else await l(o,i);})),n}async function ln(t,e={}){let n=process.cwd(),s=await Oe();if(s.isAgent&&(e.yes=true,!e.agent||e.agent.length===0)){let g=Jt(s.agent.name);if(g){let w=[g];for(let I of chunkKJPMAUXZ_cjs.D())w.includes(I)||w.push(I);e.agent=w;}}console.log(),s.isAgent||x__namespace.intro(S__default.default.bgCyan(S__default.default.black(" skills experimental_sync "))),s.isAgent&&x__namespace.log.info(ct(s.agent.name)+" Agent detected \u2014 installing non-interactively");let l=x__namespace.spinner();l.start("Scanning node_modules for skills...");let i=await Xo(n);if(i.length===0){l.stop(S__default.default.yellow("No skills found")),x__namespace.outro(S__default.default.dim("No SKILL.md files found in node_modules."));return}l.stop(`Found ${S__default.default.green(String(i.length))} skill${i.length>1?"s":""} in node_modules`);for(let g of i)x__namespace.log.info(`${S__default.default.cyan(g.name)} ${S__default.default.dim(`from ${g.packageName}`)}`),g.description&&x__namespace.log.message(S__default.default.dim(` ${g.description}`));let o=await chunkS76WRD5J_cjs.b(n),a=[],r=[];if(e.force)a.push(...i),x__namespace.log.info(S__default.default.dim("Force mode: reinstalling all skills"));else {for(let g of i){let w=o.skills[g.name];if(w&&await chunkS76WRD5J_cjs.d(g.path)===w.computedHash){r.push(g.name);continue}a.push(g);}if(r.length>0&&x__namespace.log.info(S__default.default.dim(`${r.length} skill${r.length!==1?"s":""} already up to date`)),a.length===0){console.log(),x__namespace.outro(S__default.default.green("All skills are up to date."));return}}x__namespace.log.info(`${a.length} skill${a.length!==1?"s":""} to install/update`);let d,p=chunkKJPMAUXZ_cjs.D(),y=chunkKJPMAUXZ_cjs.D();if(e.agent&&e.agent.length>0){let g=chunkKJPMAUXZ_cjs.L(e.agent);if(g.length>0){let w=Object.keys(chunkKJPMAUXZ_cjs.x);x__namespace.log.error(`Invalid agents: ${g.join(", ")}`),x__namespace.log.info(`Valid agents: ${w.join(", ")}`),process.exit(1);}d=chunkKJPMAUXZ_cjs.M(e.agent),e.agent.includes("*")&&x__namespace.log.info(`Installing to all ${d.length} agents`);}else {l.start("Loading agents...");let g=await chunkKJPMAUXZ_cjs.y(),w=Object.keys(chunkKJPMAUXZ_cjs.x).length;if(l.stop(`${w} agents`),g.length===0)if(e.yes)d=p,x__namespace.log.info("Installing to universal agents");else {let W=chunkKJPMAUXZ_cjs.E().map(A=>({value:A,label:chunkKJPMAUXZ_cjs.x[A].displayName,hint:chunkKJPMAUXZ_cjs.x[A].skillsDir})),_=await rt({message:"Which agents do you want to install to?",items:W,initialSelected:[],lockedSection:{title:"Universal (.agents/skills)",items:y.map(A=>({value:A,label:chunkKJPMAUXZ_cjs.x[A].displayName})),hiddenCount:p.length-y.length}});el(_)&&(x__namespace.cancel("Sync cancelled"),process.exit(0)),d=_;}else if(g.length===1||e.yes){d=[...g];for(let I of p)d.includes(I)||d.push(I);}else {let W=chunkKJPMAUXZ_cjs.E().filter(A=>g.includes(A)).map(A=>({value:A,label:chunkKJPMAUXZ_cjs.x[A].displayName,hint:chunkKJPMAUXZ_cjs.x[A].skillsDir})),_=await rt({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:chunkKJPMAUXZ_cjs.x[A].displayName})),hiddenCount:p.length-y.length}});el(_)&&(x__namespace.cancel("Sync cancelled"),process.exit(0)),d=_;}}let b=[];for(let g of a){let w=chunkS76WRD5J_cjs.A(g.name,{global:false}),I=tl(w,n);b.push(`${S__default.default.cyan(g.name)} ${S__default.default.dim(`\u2190 ${g.packageName}`)}`),b.push(` ${S__default.default.dim(I)}`);}if(console.log(),x__namespace.note(b.join(`
|
|
31
|
-
`),"Sync Summary"),!e.yes){let g=await x__namespace.confirm({message:"Proceed with sync?"});(x__namespace.isCancel(g)||!g)&&(x__namespace.cancel("Sync cancelled"),process.exit(0));}l.start("Syncing skills...");let h=[];for(let g of a)for(let w of d){let I=await chunkS76WRD5J_cjs.v(g,w,{global:false,cwd:n,mode:"symlink"});h.push({skill:g.name,packageName:g.packageName,agent:chunkKJPMAUXZ_cjs.x[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 chunkS76WRD5J_cjs.d(g.path);await chunkS76WRD5J_cjs.e(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(q=>q.name===_)?.packageName;if(L.canonicalPath){let q=tl(L.canonicalPath,n);w.push(`${S__default.default.green("\u2713")} ${_} ${S__default.default.dim(`\u2190 ${C}`)}`),w.push(` ${S__default.default.dim(q)}`);}else w.push(`${S__default.default.green("\u2713")} ${_} ${S__default.default.dim(`\u2190 ${C}`)}`);}let I=g.size,W=S__default.default.green(`Synced ${I} skill${I!==1?"s":""}`);x__namespace.note(w.join(`
|
|
32
|
-
`),W);}if(f.length>0){console.log(),x__namespace.log.error(S__default.default.red(`Failed to install ${f.length}`));for(let g of f)x__namespace.log.message(` ${S__default.default.red("\u2717")} ${g.skill} \u2192 ${g.agent}: ${S__default.default.dim(g.error)}`);}se({event:"experimental_sync",skillCount:String(a.length),successCount:String($.size),agents:d.join(",")}),console.log(),x__namespace.outro(S__default.default.green("Done!")+S__default.default.dim(" Review skills before use; they run with full agent permissions."));}function on(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 nl(t){let e=process.cwd(),n=await chunkS76WRD5J_cjs.b(e),s=Object.entries(n.skills);if(s.length===0){x__namespace.log.warn("No project skills found in skills-lock.json"),x__namespace.log.info(`Add project-level skills with ${S__default.default.cyan("easbot skills add <package>")} (without ${S__default.default.cyan("-g")})`);return}let l=chunkKJPMAUXZ_cjs.D(),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__namespace.log.info(`Restoring ${S__default.default.cyan(String(a))} skill${a!==1?"s":""} from skills-lock.json into ${S__default.default.dim(".agents/skills/")}`);for(let[r,{skills:d}]of o)try{await Ge([r],{skill:d,agent:l,yes:!0});}catch(p){x__namespace.log.error(`Failed to install from ${S__default.default.cyan(r)}: ${p instanceof Error?p.message:"Unknown error"}`);}if(i.length>0){x__namespace.log.info(`${S__default.default.cyan(String(i.length))} skill${i.length!==1?"s":""} from node_modules`);try{let{options:r}=on(t);await ln(t,{...r,yes:!0,agent:l});}catch(r){x__namespace.log.error(`Failed to sync node_modules skills: ${r instanceof Error?r.message:"Unknown error"}`);}}}function rn(t,e){let n=os.homedir();return t.startsWith(n)?t.replace(n,"~"):t.startsWith(e)?"."+t.slice(e.length):t}function Qo(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 er(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 tr(t){return t.global&&t.project?"both":t.global?"global":t.project?"project":(t.all===true,"both")}async function sl(t){let e=er(t);e.all===true&&(!e.agent||e.agent.length===0)&&(e.agent=["*"]);let n=tr(e),s;if(e.agent&&e.agent.length>0){let b=chunkKJPMAUXZ_cjs.L(e.agent);if(b.length>0){let h=Object.keys(chunkKJPMAUXZ_cjs.x);console.log(`${Kn}Invalid agents: ${b.join(", ")}${c}`),console.log(`${u}Valid agents: ${h.join(", ")}${c}`),process.exit(1);}s=chunkKJPMAUXZ_cjs.M(e.agent);}let l=await chunkS76WRD5J_cjs.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=>chunkKJPMAUXZ_cjs.x[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 Os(),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=rn(b.canonicalPath,o),w=b.agents.map(A=>chunkKJPMAUXZ_cjs.x[A].displayName),I=b.agents.length>0?Qo(w):`${Kn}not linked${c}`,W=chunkKJPMAUXZ_cjs.d(b.name).padEnd(k),_=g.padEnd(f);console.log(`${$}${At}${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=chunkKJPMAUXZ_cjs.d(w.name).length,W=rn(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 $=chunkKJPMAUXZ_cjs.d(f.name).length,g=rn(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=chunkKJPMAUXZ_cjs.d(k.name).length,$=rn(k.canonicalPath,o).length;f>b&&(b=f),$>h&&(h=$);}for(let k of l)r(k,false,b,h);console.log();}}async function an(t,e){let n=await Oe(),s=e.yes||n.isAgent;if(n.isAgent&&x__namespace.log.info(ct(n.agent.name)+" Agent detected \u2014 removing non-interactively"),e.global===void 0&&!s&&process.stdin.isTTY&&!n.isAgent){let $=await x__namespace.select({message:"Removal scope (use --global to switch)",options:[{value:false,label:"Project",hint:"Remove from current directory (committed with your project)"},{value:true,label:"Global",hint:"Remove from home directory (available across all projects)"}]});x__namespace.isCancel($)&&(x__namespace.cancel("Removal cancelled"),process.exit(0)),e.global=$;}let l=e.global??false,i=process.cwd(),o=x__namespace.spinner();o.start("Scanning for installed skills...");let{scanInstalledSkillDirs:a}=await import('./scan-5G765ZEF.cjs'),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__namespace.outro(S__default.default.yellow("No skills found to remove."));return}if(e.agent&&e.agent.length>0){let $=chunkKJPMAUXZ_cjs.L(e.agent);if($.length>0){let g=Object.keys(chunkKJPMAUXZ_cjs.x);x__namespace.log.error(`Invalid agents: ${$.join(", ")}`),x__namespace.log.info(`Valid agents: ${g.join(", ")}`),process.exit(1);}}if(e.skill&&e.skill.length>0&&e.all!==true){let $=chunkS76WRD5J_cjs.m(e.skill,p);$.length>0&&(x__namespace.log.error(`Invalid skills: ${$.join(", ")}`),x__namespace.log.info(`Installed skills: ${p.join(", ")||"(none)"}`),process.exit(1));}let y=[];if(e.all)y=p;else if(t.length>0||e.skill&&e.skill.length>0){let $=[...t];if(e.skill&&e.skill.length>0){let g=chunkS76WRD5J_cjs.n(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__namespace.log.error(`No matching skills found for: ${$.join(", ")}`);return}}else {let $=p.map(w=>({value:w,label:w})),g=await x__namespace.multiselect({message:`Select skills to remove ${S__default.default.dim("(space to toggle)")}`,options:$,required:true});x__namespace.isCancel(g)&&(x__namespace.cancel("Removal cancelled"),process.exit(0)),y=g;}let b;if(e.agent&&e.agent.length>0?b=chunkKJPMAUXZ_cjs.M(e.agent):(b=Object.keys(chunkKJPMAUXZ_cjs.x),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=>chunkKJPMAUXZ_cjs.x[I]?.displayName??I);console.log(),x__namespace.log.warn(S__default.default.yellow(`About to remove ${y.length} skill(s) from ${b.length} agent(s):`)),console.log(),console.log(` ${S__default.default.dim("Scope:")} ${$}`),console.log(` ${S__default.default.dim("Agents ("+b.length+"):")}`);for(let I of g)console.log(` ${S__default.default.red("\u2022")} ${I}`);console.log(` ${S__default.default.dim("Skills ("+y.length+"):")}`);for(let I of y)console.log(` ${S__default.default.red("\u2022")} ${I}`);console.log(),console.log(S__default.default.dim(" Each skill will be uninstalled from every targeted agent.")),console.log();let w=await x__namespace.confirm({message:"Continue? (y/N)"});(x__namespace.isCancel(w)||!w)&&(x__namespace.cancel("Removal cancelled"),process.exit(0));}o.start("Removing skills...");let h=[];for(let $ of y)try{let g=chunkS76WRD5J_cjs.A($,{global:l,cwd:i});for(let C of b){let q=chunkKJPMAUXZ_cjs.x[C],Q=chunkS76WRD5J_cjs.z($,C,{global:l,cwd:i}),O=new Set([Q]),Y=chunkS76WRD5J_cjs.r($);if(l&&q.globalSkillsDir)O.add(path.join(q.globalSkillsDir,Y));else if(O.add(path.join(i,q.skillsDir,Y)),C==="eve")for(let re of chunkKJPMAUXZ_cjs.B(i))O.add(path.join(chunkS76WRD5J_cjs.t(re,i),Y));for(let re of O)if(re!==g)try{await promises.lstat(re).catch(()=>null)&&await promises.rm(re,{recursive:!0,force:!0});}catch(ae){x__namespace.log.warn(`Could not remove skill from ${q.displayName}: ${ae instanceof Error?ae.message:String(ae)}`);}}let I=(await chunkKJPMAUXZ_cjs.y()).filter(C=>!b.includes(C)),W=!1;for(let C of I){let q=chunkS76WRD5J_cjs.z($,C,{global:l,cwd:i});if(await promises.lstat(q).catch(()=>null)){W=!0;break}}W||await promises.rm(g,{recursive:!0,force:!0});let _=l?await Us($):null,A=_?.source||"local",L=_?.sourceType||"local";l&&await Ns($),await qt($),h.push({skill:$,success:!0,source:A,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 $)se({event:"remove",source:g,skills:w.skills.join(","),agents:b.join(","),...l&&{global:"1"},sourceType:w.sourceType});}if(k.length>0&&x__namespace.log.success(S__default.default.green(`Successfully removed ${k.length} skill(s)`)),f.length>0){x__namespace.log.error(S__default.default.red(`Failed to remove ${f.length} skill(s)`));for(let $ of f)x__namespace.log.message(` ${S__default.default.red("\u2717")} ${$.skill}: ${$.error}`);}console.log(),x__namespace.outro(S__default.default.green("Done!"));}function ol(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 gt(t,e){return e?`${t}#${e}`:t}function nr(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 sr(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 rl(t,e,n){if(!sr(t))return gt(t,n);let s=nr(e),l=s?`${t}/${s}`:t;return n?`${l}#${n}`:l}function al(t){return t.skillPath?rl(t.source,t.skillPath,t.ref):gt(t.sourceUrl,t.ref)}function cl(t){return t.skillPath?rl(t.source,t.skillPath,t.ref):gt(t.source,t.ref)}var pr=path.dirname(url.fileURLToPath(chunkKJPMAUXZ_cjs.b));async function gl(t){let e=utils.Filesystem.join(t,"SKILL.md");try{let n=await promises.readFile(e);return crypto.createHash("sha256").update(n).digest("hex")}catch{return}}function dl(t,e,n){return t||!e||!n?true:e!==n}function qn(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 fl(t){let e=path.join(pr,"..","cli.mjs");if(!fs$1.existsSync(e))return {code:2,stderr:`CLI entrypoint not found at ${e}`};let n=[process.execPath,e,...t],s;try{s=utils.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:qn(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 gr(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 jp(t){let e=t||process.cwd(),n=path.join(e,"skills-lock.json");if(fs$1.existsSync(n))return true;let s=path.join(e,".agents","skills");try{let l=fs$1.readdirSync(s,{withFileTypes:!0});for(let i of l)if(i.isDirectory()){let o=path.join(s,i.name,"SKILL.md");if(fs$1.existsSync(o))return !0}}catch{}return false}async function dr(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__namespace.select({message:"Update scope",options:[{value:"project",label:"Project",hint:"Update skills in current directory (committed with your project)"},{value:"global",label:"Global",hint:"Update skills in home directory (available across all projects)"},{value:"both",label:"Both",hint:"Update all skills (project + global)"}]});return x__namespace.isCancel(e)&&(x__namespace.cancel("Cancelled"),process.exit(0)),e}function ml(t,e){if(!e||e.length===0)return true;let n=t.toLowerCase();return e.some(s=>s.toLowerCase()===n)}function fr(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 mr(t){let e=t.sourceUrl;if(t.sourceType==="well-known"){let n=e.indexOf("/.well-known/");n!==-1&&(e=e.slice(0,n));}return gt(e,t.ref)}function ul(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=mr(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} ${chunkKJPMAUXZ_cjs.d(l.name)} ${u}(${l.reason})${c}`);}else {let l=s[0].reason,i=s.map(o=>chunkKJPMAUXZ_cjs.d(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 hr(t){let e=await chunkS76WRD5J_cjs.b(),n=[];for(let[s,l]of Object.entries(e.skills))ml(s,t)&&(l.sourceType==="node_modules"||l.sourceType==="local"||n.push({name:s,source:l.source,entry:l}));return n}async function hl(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__namespace.confirm({message:"Would you like to remove the local copies of these deleted skills?"});if(r&&!x__namespace.isCancel(r))for(let d of o)console.log(`${u}Removing${c} ${d}...`),await an([d],{yes:true,global:s});}}return o}async function kr(t={}){let e=await ke(),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(!ml(y,t.skills))continue;let b=e.skills[y];if(b){if(!b.skillPath){o.push({name:y,reason:fr(b),sourceUrl:b.sourceUrl,sourceType:b.sourceType,ref:b.ref});continue}a.push({name:y,entry:b});}}let r=await Re(),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 wt({type:h.sourceType??"git",url:k,ref:h.ref??void 0,mode:"update"})).storeDir;let g=await chunkS76WRD5J_cjs.j(f),w=g.map(A=>path.join(path.relative(f,A.path),"SKILL.md").split(path.sep).join("/")),I=Object.entries(e.skills).filter(([A,L])=>L.source===y).map(([A,L])=>A),W=await hl(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 q=r[A]?.computedHash,Q=g.find(Y=>path.join(path.relative(f,Y.path),"SKILL.md").split(path.sep).join("/")===C)?.path,O=Q?await gl(Q):void 0;dl(t.force,q,O)&&i.push({name:A,source:y,entry:L});}}catch{console.log(` ${u}\u2717 Failed to check skills from ${y}${c}`);}finally{f&&!St(f)&&await He(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 ul(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=chunkKJPMAUXZ_cjs.d(y.name);console.log(`${U}Updating ${b}...${c}`);let h=al(y.entry),k=await fl(["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=qn(k.stderr);if(f)for(let $ of f.split(`
|
|
35
|
-
`))console.log(` ${u}${$}${c}`);}}return ul(o),{successCount:s,failCount:l,checkedCount:p}}async function yr(t={}){let e=await hr(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}`),pl(i),{successCount:n,failCount:s,foundCount:e.length};let o=process.cwd(),a=[],r=false;for(let[h,k]of Object.entries(chunkKJPMAUXZ_cjs.x))if(chunkKJPMAUXZ_cjs.K(h))!r&&fs$1.existsSync(path.join(o,".agents"))&&(r=true);else {let f=k.skillsDir.split("/")[0];fs$1.existsSync(path.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 chunkS76WRD5J_cjs.b(),b=await Re();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 wt({type:f.sourceType??"git",url:$,ref:g,mode:"update"})).storeDir;let C=await chunkS76WRD5J_cjs.j(I),q=C.map(Q=>{let O=path.relative(I,Q.path);return path.join(O,"SKILL.md").split(path.sep).join("/")});await Promise.all(C.map(async Q=>{let O=await gl(Q.path);_.set(Q.name,O);})),W=await hl(h,w,y.skills,!1,t,q);}catch{console.log(`${u}\u2717 Failed to check for deleted skills from ${h}${c}`);}finally{I&&!St(I)&&await He(I);}let A=k.filter(L=>!W.includes(L.name));for(let L of A){let C=chunkKJPMAUXZ_cjs.d(L.name),q=y.skills[L.name]?.computedHash??b[L.name]?.computedHash,Q=_.get(L.name);if(!dl(t.force,q,Q)){console.log(`${u} ${C} is up to date${c}`);continue}console.log(`${U}Updating ${C}...${c}`);let O=cl(L.entry),Y=L.entry.subagents,re=Y&&Y.length>0?Y.map(ie=>ie===""?"root":ie):[],ae=["add",O,"--skill",L.name,...re.length>0?["--subagent",...re]:[],"-y"],me=await fl(ae);if(me.code===0)n++,console.log(` ${U}\u2713${c} Updated ${C}`);else {s++,console.log(` ${u}\u2717 Failed to update ${C}${c}`);let ie=qn(me.stderr);if(ie)for(let Z of ie.split(`
|
|
36
|
-
`))console.log(` ${u}${Z}${c}`);}}}return pl(i),{successCount:n,failCount:s,foundCount:e.length}}function pl(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=gt(e.entry.source,e.entry.ref);console.log(` ${U}\u2022${c} ${chunkKJPMAUXZ_cjs.d(e.name)}`),console.log(` ${u}To refresh: ${U}easbot skills add ${n} -y${c}`);}}}async function kl(t=[]){let e=gr(t);e.all===true&&(e.yes=true,(!e.skills||e.skills.length===0)&&(e.skills=["*"]));let n=await dr(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 kr(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 yr(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}`),se({event:"update",scope:n,skillCount:String(s+l),successCount:String(s),failCount:String(l)}),console.log();}var Tr=new Set(["metadata.json"]),Ir=new Set([".git","__pycache__","__pypackages__"]),Jn={"claude-code":{command:"claude",args:[]},codex:{command:"codex",args:[]}},Al=Object.keys(Jn);function Ll(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(...Nr(n.agent)),{source:e,options:n,errors:s}}function Pr(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 Rr(t){let e=await promises.mkdtemp(path.join(os.tmpdir(),"skills-use-")),n=path.join(e,chunkS76WRD5J_cjs.r(t.directoryName||t.name));if(!Xn(e,n))throw new Error("Invalid skill name: potential path traversal detected");await promises.mkdir(n,{recursive:true}),t.kind==="blob"?await Ur(n,t.files):t.kind==="well-known"?await Or(n,t.files):await El(t.path,n);let s=t.rawContent??await promises.readFile(path.join(n,"SKILL.md"),"utf-8"),l=await _l(n,n);return {tempRoot:e,skillDir:n,skillMd:s,hasSupportingFiles:l}}async function Tl(t,e={},n=[]){let s=null;try{if(e.help){console.log(wl());return}n.length>0&&_e(n.join(`
|
|
45
|
-
`)),t.length===0&&_e(`Missing required argument: source
|
|
46
|
-
|
|
47
|
-
${wl()}`),t.length>1&&_e(`Expected one source, received ${t.length}: ${t.join(", ")}`);let l=e.agent?.[0];l&&!Jn[l]&&_e(Rl(l));let i=t[0],o=st(i);Le(o)?.split("/")[0]?.toLowerCase()==="openclaw"&&!e.dangerouslyAcceptOpenclawRisks&&_e(["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 Bt.fetchAllSkills(o.url);y=jr(k,d,i);}else {let k,f=null;if(o.type==="local")fs$1.existsSync(o.localPath)||_e(`Local path does not exist: ${o.localPath}`),k=await chunkS76WRD5J_cjs.j(o.localPath,o.subpath,{includeInternal:p,fullDepth:e.fullDepth});else if(o.type==="github"&&!e.fullDepth){let g=Le(o),w=g?.split("/")[0]?.toLowerCase();g&&w&&chunkPGDLW2JN_cjs.b.includes(w)&&(f=await chunkPGDLW2JN_cjs.h(g,{subpath:o.subpath,ref:o.ref,getToken:Zt,includeInternal:p})),f?k=f.skills:(s=await kt(o.url,o.ref),k=await chunkS76WRD5J_cjs.j(s,o.subpath,{includeInternal:p,fullDepth:e.fullDepth}));}else s=await kt(o.url,o.ref),k=await chunkS76WRD5J_cjs.j(s,o.subpath,{includeInternal:p,fullDepth:e.fullDepth});let $=_r(k,d,i);f&&Dr($)?y={kind:"blob",name:$.name,directoryName:$.name,rawContent:$.rawContent??Fr($.files),files:$.files}:y={kind:"disk",name:$.name,directoryName:$.name,rawContent:$.rawContent,path:$.path};}let b=await Rr(y);await Sl(s),s=null;let h=Pr({skillMd:b.skillMd,supportDir:b.skillDir,hasSupportingFiles:b.hasSupportingFiles});if(l){let k=await Cr(l,h);k!==0&&process.exit(k);return}process.stdout.write(h);}catch(l){await Sl(s),l instanceof Ie&&_e(l.message),l instanceof de&&_e(l.message),_e(l instanceof Error?l.message:"Unknown error");}}async function Cr(t,e,n=Er){let s=Jn[t];if(!s)throw new de(Rl(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 de(`Could not launch ${chunkKJPMAUXZ_cjs.x[t].displayName}: command not found: ${s.command}`));return}i(r);}}),o.on("close",r=>{a||(a=true,l(r??1));});})}function Er(t,e){return child_process.spawn(t,e,{stdio:"inherit"})}function wl(){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 (${Al.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 _r(t,e,n){if(t.length===0)throw new de("No valid skills found. Skills require a SKILL.md with name and description.");if(!e){if(t.length===1)return t[0];throw new de(Il(n,t.map(chunkS76WRD5J_cjs.k)))}let s=chunkS76WRD5J_cjs.l(t,[e]);if(s.length===0)throw new de(Pl(e,t.map(chunkS76WRD5J_cjs.k)));if(s.length>1)throw new de(`Skill selector "${e}" matched multiple skills.`);return s[0]}function jr(t,e,n){if(t.length===0)throw new de("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 de(Pl(e,t.map(i=>i.installName)));if(s.length>1)throw new de(`Skill selector "${e}" matched multiple skills.`)}else {if(t.length!==1)throw new de(Il(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 Il(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 Pl(t,e){return [`No matching skill found for: ${t}`,"Available skills:",...e.map(n=>` - ${n}`)].join(`
|
|
67
|
-
`)}function Nr(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=chunkKJPMAUXZ_cjs.L(t);if(n.length>0){let s=Object.keys(chunkKJPMAUXZ_cjs.x);e.push(`Invalid agents: ${n.join(", ")}
|
|
68
|
-
Valid agents: ${s.join(", ")}`);}return e}function Rl(t){return [`Running ${chunkKJPMAUXZ_cjs.x[t].displayName} is not supported yet.`,`Supported agents for skills use --agent: ${Al.join(", ")}`].join(`
|
|
69
|
-
`)}async function Ur(t,e){for(let n of e)await Cl(t,n.path,n.contents);}async function Or(t,e){for(let[n,s]of e)await Cl(t,n,s);}async function Cl(t,e,n){let s=path.join(t,e);Xn(t,s)&&(await promises.mkdir(path.dirname(s),{recursive:true}),typeof n=="string"?await promises.writeFile(s,n,"utf-8"):await promises.writeFile(s,n));}async function El(t,e){await promises.mkdir(e,{recursive:true});let n=await promises.readdir(t,{withFileTypes:true});await Promise.all(n.filter(s=>!Mr(s.name,s.isDirectory())).map(async s=>{let l=path.join(t,s.name),i=path.join(e,s.name);if(Xn(e,i)){if(s.isDirectory()){await El(l,i);return}try{await promises.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 _l(t,e){let n=await promises.readdir(e,{withFileTypes:true});for(let s of n){let l=path.join(e,s.name),i=path.relative(t,l).split(path.sep).join("/");if(s.isDirectory()){if(await _l(t,l))return true}else if(i.toLowerCase()!=="skill.md")return true}return false}function Dr(t){return Array.isArray(t.files)}function Fr(t){return t.find(n=>n.path.toLowerCase()==="skill.md")?.contents??""}function Mr(t,e){return Tr.has(t)||e&&Ir.has(t)}function Xn(t,e){let n=path.normalize(path.resolve(t)),s=path.normalize(path.resolve(e));return s.startsWith(n+path.sep)||s===n}async function Sl(t){t&&await He(t).catch(()=>{});}function _e(t){console.error(t),process.exit(1);}var de=class extends Error{};function Wr(t){let e=t[0]??"list",n=t.slice(1);return {subcommand:e,restArgs:n}}async function Ol(t,e={}){let{subcommand:n,restArgs:s}=Wr(t),l=Kr(s,e);switch(n){case "list":return Hr(l);case "clean":return zr(l);case "remove":return Vr(s,l);case "--help":case "-h":return jl(),0;default:return console.log(S__default.default.yellow(`Unknown cache subcommand: ${n}`)),jl(),1}}function Kr(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 Hr(t={}){let e=await Re();if(Object.keys(e).length===0)return t.json?(console.log("[]"),0):(x__namespace.outro(S__default.default.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:utils.Filesystem.join(Ue(),l)}));if(t.json)return console.log(JSON.stringify(s,null,2)),0;console.log(),console.log(S__default.default.bold(S__default.default.cyan("Store sources"))),console.log(),console.log(`${S__default.default.dim("SOURCE KEY")} ${S__default.default.dim("TYPE")} ${S__default.default.dim("URL")} ${S__default.default.dim("SUBPATH")} ${S__default.default.dim("REF")} ${S__default.default.dim("SCOPE")} ${S__default.default.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__default.default.dim("Use `skills cache clean --source <key>` to clean cache, or `skills cache remove <key>` to remove store source.")),console.log(),0}async function zr(t={}){return t.source?Gr(t.source,t):Br(t)}async function Br(t){let e=ze();if(!fs$1.existsSync(e))return t.json?(console.log(JSON.stringify({cleaned:false,reason:"cache root does not exist"})),0):(x__namespace.outro(S__default.default.dim("Cache is already empty.")),0);if(!t.yes&&!t.json&&process.stdin.isTTY){let n=await x__namespace.confirm({message:`Remove all cache contents under ${e}?`});if(x__namespace.isCancel(n)||!n)return x__namespace.cancel("Cancelled."),1}return await xs(),se({event:"cache_clean_all"}),t.json?console.log(JSON.stringify({cleaned:true,path:e})):x__namespace.outro(S__default.default.green(`\u2713 Cleaned cache: ${e}`)),0}async function Gr(t,e){let n=await Re(),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__namespace.log.error(S__default.default.red(`Source key not found: ${t}`)),x__namespace.outro(S__default.default.dim("Run `skills cache list` to see available sources.")),1);let l=s.sourcePath;if(!fs$1.existsSync(l))return e.json?(console.log(JSON.stringify({cleaned:false,reason:"cache dir not present"})),0):(x__namespace.outro(S__default.default.dim(`Cache already absent for ${t.slice(0,8)}\u2026`)),0);if(!e.yes&&!e.json&&process.stdin.isTTY){let i=await x__namespace.confirm({message:`Remove cache for ${t.slice(0,8)}\u2026 (${l})?`});if(x__namespace.isCancel(i)||!i)return x__namespace.cancel("Cancelled."),1}return await promises.rm(l,{recursive:true,force:true}),se({event:"cache_clean_source",source:t}),e.json?console.log(JSON.stringify({cleaned:true,path:l,sourceKey:t})):x__namespace.outro(S__default.default.green(`\u2713 Cleaned cache: ${l}`)),0}async function Vr(t,e={}){let n=t[0];if(!n)return e.json?(console.log(JSON.stringify({removed:false,reason:"source key required"})),1):(x__namespace.log.error(S__default.default.red("Usage: skills cache remove <source-key>")),1);let s=await Re(),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__namespace.log.error(S__default.default.red(`Source key not found: ${n}`)),x__namespace.outro(S__default.default.dim("Run `skills cache list` to see available sources.")),1);let i=l[0][1],o=utils.Filesystem.join(Ue(),n);if(!e.yes&&!e.json&&process.stdin.isTTY){let a=await x__namespace.confirm({message:`Remove store source ${n.slice(0,8)}\u2026 (${l.length} skill(s))?`});if(x__namespace.isCancel(a)||!a)return x__namespace.cancel("Cancelled."),1}fs$1.existsSync(o)&&await promises.rm(o,{recursive:true,force:true}),await vs({type:i.type,url:i.url,subpath:i.subpath,ref:i.ref});for(let[a]of l)await qt(a);return se({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__namespace.outro(S__default.default.green(`\u2713 Removed source ${n.slice(0,8)}\u2026 (${l.length} skill(s))`)),0}function jl(){console.log(`
|
|
70
|
-
${S__default.default.bold(S__default.default.cyan("skills cache"))} - \u8FD0\u7EF4\u5B50\u547D\u4EE4\u65CF\uFF08\u7BA1\u7406 store / cache \u76EE\u5F55\uFF09
|
|
71
|
-
|
|
72
|
-
${S__default.default.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__default.default.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__default.default.bold("Examples:")}
|
|
84
|
-
${S__default.default.dim("$")} skills cache list
|
|
85
|
-
${S__default.default.dim("$")} skills cache clean --source a1b2c3d4e5f67890
|
|
86
|
-
${S__default.default.dim("$")} skills cache remove a1b2c3d4e5f67890
|
|
87
|
-
${S__default.default.dim("$")} skills cache clean -y --json
|
|
88
|
-
`);}var Dl={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 Yr=Dl.languages,Jr=Yr.filter(t=>t.supported).map(t=>t.value),Ye={defaultLocale:"zh-CN",locales:Jr},Tt={},cn=(t,e)=>{let n=Tt[t]||{translation:{}};return Tt[t]={translation:{...n.translation,...e.translation}},Tt[t]},un=(t=Ye.defaultLocale)=>(Tt[t]||cn(t,{translation:{}}),{locale:t,resources:Tt[t]||{translation:{}}});var Xr={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"}},Fl=Xr;var Zr={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"}},Ml=Zr;var Qr=()=>{un("zh-CN"),un("en-US"),cn("zh-CN",Fl),cn("en-US",Ml);};Qr();var Qn=new Map;var es=new Map;var ea=t=>{if(es.has(t))return es.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 es.set(t,i),i},Wl=(t,e)=>{if(!t||typeof t!="string")return "";if(!e||Object.keys(e).length===0)return t;let{regex:n,keys:s}=ea(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)})},ta=t=>{if(t&&Ye.locales.includes(t))return t;let e=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(e){let n=e.replace(/_/g,"-");if(Ye.locales.includes(n))return n;let s=n.split("-")[0];if(s==="zh")return "zh-CN";if(s==="en")return "en-US"}return Ye.defaultLocale},Kl=t=>{if(!Qn.has(t)){let{resources:e}=un(t);Qn.set(t,e);}return Qn.get(t)},na=(t,e={})=>{let n=ta(e.locale),l=Kl(n)?.translation[t];if(l&&typeof l=="string"){let i=Wl(l,e.vars);return i!=null?String(i):String(t)}if(n!==Ye.defaultLocale){let o=Kl(Ye.defaultLocale)?.translation[t];if(o&&typeof o=="string"){let a=Wl(o,e.vars);return a!=null?String(a):String(t)}}return String(e.fallback??t)},v=na;var la={"zh-CN":utils.loadTextFile("./template/skill-template-zh-CN.txt",chunkKJPMAUXZ_cjs.b),"en-US":utils.loadTextFile("./template/skill-template-en-US.txt",chunkKJPMAUXZ_cjs.b)};function ia(t){return t.split(/[-_\s]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function oa(t){return la[t]()}var ra=/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;function zl(t,e){let n=utils.formatLocalISO(new Date,false).slice(0,10),s={skill_name:e,skill_title:ia(e),version:"1.0.0",date:n};return oa(t).replace(ra,(i,o)=>Object.hasOwn(s,o)?s[o]:i)}function da(t){return t&&Vs(t),t??"0.0.0"}function Pt(t){return utils.resolveLocaleLang(t?.locale)}function fa(t){let e=Pt(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 Hg(t){let e=Pt(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 ma(t){let e=Pt(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 It(){console.log();}function ha(t,e){let n=Pt(e),s=e?.cwd??chunkKJPMAUXZ_cjs.t()??process.cwd(),l=t[0]||path.basename(s),i=t[0]!==void 0,o=i?path.join(s,l):s,a=path.join(o,"SKILL.md"),r=i?`${l}/SKILL.md`:"SKILL.md";if(fs$1.existsSync(a))return console.log(`${U}${v("cli.init.exists",{locale:n,vars:{path:r},fallback:`Skill already exists at ${r}`})}${c}`),0;i&&fs$1.mkdirSync(o,{recursive:true});let d=zl(n,l);return fs$1.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 zg(t,e){da(e?.version);let s=e?.inAgent??await Yt();if(t.length===0)return s||fa(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||It(),console.log(),{code:await Zs(i),handled:true,command:l};case "init":return s||It(),console.log(),{code:ha(i,e),handled:true,command:l};case "experimental_install":return s||It(),await nl(i),{code:0,handled:true,command:l};case "a":case "add":{s||It();let{source:o,options:a}=nn(i);return await Ge(o,a),{code:0,handled:true,command:l}}case "use":{let{source:o,options:a,errors:r}=Ll(i);return await Tl(o,a,r),{code:0,handled:true,command:l}}case "remove":case "rm":case "r":{if(i.includes("--help")||i.includes("-h"))return ma(e),{code:0,handled:true,command:l};let{skills:o,options:a}=ol(i);return await an(o,a),{code:0,handled:true,command:l}}case "experimental_sync":{s||It();let{options:o}=on(i);return await ln(i,o),{code:0,handled:true,command:l}}case "list":case "ls":return await sl(i),{code:0,handled:true,command:l};case "check":case "update":case "upgrade":return await kl(i),{code:0,handled:true,command:l};case "cache":return {code:await Ol(i),handled:true,command:l};default:{let o=Pt(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
|
-
exports.$=Ge;exports.A=In;exports.B=Rs;exports.C=jn;exports.D=Cs;exports.E=se;exports.F=gc;exports.G=Oe;exports.H=Yt;exports.I=kc;exports.J=Jt;exports.K=_s;exports.L=ke;exports.M=Xt;exports.N=Tc;exports.O=Ic;exports.P=Zt;exports.Q=Pc;exports.R=js;exports.S=Ns;exports.T=Us;exports.U=Os;exports.V=Rc;exports.W=Ds;exports.X=vt;exports.Y=Fn;exports.Z=Mn;exports._=Vs;exports.a=Le;exports.aa=nn;exports.b=bn;exports.ba=Uo;exports.c=Ht;exports.ca=Xs;exports.d=Kt;exports.da=Zs;exports.e=st;exports.ea=ln;exports.f=gs;exports.fa=on;exports.g=Ie;exports.ga=nl;exports.h=ai;exports.ha=er;exports.i=ci;exports.ia=sl;exports.j=ks;exports.ja=an;exports.k=kt;exports.ka=ol;exports.l=He;exports.la=gr;exports.m=wn;exports.ma=jp;exports.n=Bt;exports.na=dr;exports.o=wi;exports.oa=ml;exports.p=ze;exports.pa=kl;exports.q=ws;exports.qa=Ll;exports.r=wt;exports.ra=Pr;exports.s=qa;exports.sa=Rr;exports.t=Ya;exports.ta=Tl;exports.u=vs;exports.ua=Cr;exports.v=xs;exports.va=fa;exports.w=Tn;exports.wa=Hg;exports.x=As;exports.xa=zg;exports.y=Ls;exports.z=Ts;
|