@easbot/skills 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/txt/template/skill-template-en-US.txt +50 -0
- package/dist/assets/txt/template/skill-template-zh-CN.txt +50 -0
- package/dist/chunks/blob-LYSE5I24.mjs +1 -0
- package/dist/chunks/blob-NYUAIVUS.cjs +1 -0
- package/dist/chunks/chunk-4IO7TNWC.mjs +223 -0
- package/dist/chunks/chunk-IWCI7DET.mjs +6 -0
- package/dist/chunks/chunk-KJPMAUXZ.cjs +1 -0
- package/dist/chunks/chunk-L6KE3VIY.mjs +2 -0
- package/dist/chunks/chunk-PGDLW2JN.cjs +2 -0
- package/dist/chunks/chunk-S76WRD5J.cjs +6 -0
- package/dist/chunks/chunk-WQJKBJSM.cjs +223 -0
- package/dist/chunks/chunk-Y2X6FBMZ.mjs +1 -0
- package/dist/chunks/scan-47YPOLJX.mjs +1 -0
- package/dist/chunks/scan-5G765ZEF.cjs +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +140 -14
- package/dist/index.d.ts +140 -14
- package/dist/index.mjs +1 -1
- package/package.json +4 -5
- package/dist/chunks/blob-3ZTTX2CZ.mjs +0 -1
- package/dist/chunks/blob-UAS6F4BG.cjs +0 -1
- package/dist/chunks/chunk-645XWVJB.mjs +0 -208
- package/dist/chunks/chunk-DLDPJGDD.cjs +0 -208
- package/dist/chunks/chunk-XDSGBJHO.cjs +0 -2
- package/dist/chunks/chunk-ZEMGS5WR.mjs +0 -2
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkXDSGBJHO_cjs=require('./chunk-XDSGBJHO.cjs'),path=require('path'),Ti=require('simple-git'),promises=require('fs/promises'),os$1=require('os'),child_process=require('child_process'),util=require('util'),crypto=require('crypto'),xdgBasedir=require('xdg-basedir'),fs$1=require('fs'),detectAgent=require('@vercel/detect-agent'),zlib=require('zlib'),k=require('picocolors'),y=require('@clack/prompts'),gs=require('readline'),stream=require('stream'),utils=require('@easbot/utils'),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 k__default=/*#__PURE__*/_interopDefault(k);var y__namespace=/*#__PURE__*/_interopNamespace(y);var gs__namespace=/*#__PURE__*/_interopNamespace(gs);function Je(t){if(t.type==="local")return null;let e=t.url.match(/^git@[^:]+:(.+)$/);if(e){let s=e[1];return s=s.replace(/\.git$/,""),s.includes("/")?s:null}if(t.url.startsWith("ssh://"))try{let n=new URL(t.url).pathname.slice(1);return n=n.replace(/\.git$/,""),n.includes("/")?n:null}catch{return null}if(!t.url.startsWith("http://")&&!t.url.startsWith("https://"))return null;try{let n=new URL(t.url).pathname.slice(1);if(n=n.replace(/\.git$/,""),n.includes("/"))return n}catch{}return null}function Jt(t){let e=t.match(/^([^/]+)\/([^/]+)$/);return e?{owner:e[1],repo:e[2]}:null}async function Nt(t,e){try{let s=await fetch(`https://api.github.com/repos/${t}/${e}`);return s.ok?(await s.json()).private===!0:null}catch{return null}}function Ls(t){let s=t.replace(/\\/g,"/").split("/");for(let n of s)if(n==="..")throw new Error(`Unsafe subpath: "${t}" contains path traversal segments. Subpaths must not contain ".." components.`);return t}function xi(t){return path.isAbsolute(t)||t.startsWith("./")||t.startsWith("../")||t==="."||t===".."||/^[a-zA-Z]:[/\\]/.test(t)}var Ai={"coinbase/agentWallet":"coinbase/agentic-wallet-skills"};function Ps(t){try{return decodeURIComponent(t)}catch{return t}}function Ii(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),s=e.pathname;if(e.hostname==="github.com")return /^\/[^/]+\/[^/]+(?:\.git)?(?:\/tree\/[^/]+(?:\/.*)?)?\/?$/.test(s);if(e.hostname==="gitlab.com")return /^\/.+?\/[^/]+(?:\.git)?(?:\/-\/tree\/[^/]+(?:\/.*)?)?\/?$/.test(s)}catch{}return /^https?:\/\/.+\.git(?:$|[/?])/i.test(t)?true:!t.includes(":")&&!t.startsWith(".")&&!t.startsWith("/")&&/^([^/]+)\/([^/]+)(?:\/(.+)|@(.+))?$/.test(t)}function Li(t){let e=t.indexOf("#");if(e<0)return {inputWithoutFragment:t};let s=t.slice(0,e),n=t.slice(e+1);if(!n||!Ii(s))return {inputWithoutFragment:t};let l=n.indexOf("@");if(l===-1)return {inputWithoutFragment:s,ref:Ps(n)};let o=n.slice(0,l),i=n.slice(l+1);return {inputWithoutFragment:s,ref:o?Ps(o):void 0,skillFilter:i?Ps(i):void 0}}function wn(t,e,s){return e?`${t}#${e}${s?`@${s}`:""}`:t}function dt(t){if(xi(t)){let f=path.resolve(t);return {type:"local",url:f,localPath:f}}let{inputWithoutFragment:e,ref:s,skillFilter:n}=Li(t);t=e;let l=Ai[t];l&&(t=l);let o=t.match(/^github:(.+)$/);if(o)return dt(wn(o[1],s,n));let i=t.match(/^gitlab:(.+)$/);if(i)return dt(wn(`https://gitlab.com/${i[1]}`,s,n));let a=t.match(/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)\/(.+)/);if(a){let[,f,x,A,S]=a;return {type:"github",url:`https://github.com/${f}/${x}.git`,ref:A||s,subpath:S&&Ls(S)}}let r=t.match(/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)$/);if(r){let[,f,x,A]=r;return {type:"github",url:`https://github.com/${f}/${x}.git`,ref:A||s}}let h=t.match(/github\.com\/([^/]+)\/([^/]+)/);if(h){let[,f,x]=h,A=x.replace(/\.git$/,"");return {type:"github",url:`https://github.com/${f}/${A}.git`,...s?{ref:s}:{}}}let u=t.match(/^(https?):\/\/([^/]+)\/(.+?)\/-\/tree\/([^/]+)\/(.+)/);if(u){let[,f,x,A,S,E]=u;if(x!=="github.com"&&A)return {type:"gitlab",url:`${f}://${x}/${A.replace(/\.git$/,"")}.git`,ref:S||s,subpath:E&&Ls(E)}}let m=t.match(/^(https?):\/\/([^/]+)\/(.+?)\/-\/tree\/([^/]+)$/);if(m){let[,f,x,A,S]=m;if(x!=="github.com"&&A)return {type:"gitlab",url:`${f}://${x}/${A.replace(/\.git$/,"")}.git`,ref:S||s}}let d=t.match(/gitlab\.com\/(.+?)(?:\.git)?\/?$/);if(d){let f=d[1];if(f.includes("/"))return {type:"gitlab",url:`https://gitlab.com/${f}.git`,...s?{ref:s}:{}}}let p=t.match(/^([^/]+)\/([^/@]+)@(.+)$/);if(p&&!t.includes(":")&&!t.startsWith(".")&&!t.startsWith("/")){let[,f,x,A]=p;return {type:"github",url:`https://github.com/${f}/${x}.git`,...s?{ref:s}:{},skillFilter:n||A}}let c=t.match(/^([^/]+)\/([^/]+)(?:\/(.+?))?\/?$/);if(c&&!t.includes(":")&&!t.startsWith(".")&&!t.startsWith("/")){let[,f,x,A]=c;return {type:"github",url:`https://github.com/${f}/${x}.git`,...s?{ref:s}:{},subpath:A&&Ls(A),...n?{skillFilter:n}:{}}}return Pi(t)?{type:"well-known",url:t}:{type:"git",url:t,...s?{ref:s}:{}}}function Pi(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 vn=3e5,Ts=(()=>{let t=process.env.SKILLS_CLONE_TIMEOUT;if(!t)return vn;let e=Number.parseInt(t,10);return Number.isFinite(e)&&e>0?e:vn})(),xn=util.promisify(child_process.execFile),We=class extends Error{constructor(s,n,l=false,o=false){super(s);chunkXDSGBJHO_cjs.a(this,"url");chunkXDSGBJHO_cjs.a(this,"isTimeout");chunkXDSGBJHO_cjs.a(this,"isAuthError");this.name="GitCloneError",this.url=n,this.isTimeout=l,this.isAuthError=o;}};function Ui(t){let e=t.match(/^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/i);if(e){let s=e[1],n=e[2];return {owner:s,repo:n,slug:`${s}/${n}`,sshUrl:`git@github.com:${s}/${n}.git`}}try{let s=new URL(t);if(s.hostname!=="github.com")return null;let n=s.pathname.match(/^\/([^/]+)\/([^/]+?)(?:\.git)?\/?$/);if(!n)return null;let l=n[1],o=n[2];return {owner:l,repo:o,slug:`${l}/${o}`,sshUrl:`git@github.com:${l}/${o}.git`}}catch{return null}}function ji(t){try{let e=new URL(t);return e.protocol==="https:"&&e.hostname==="github.com"}catch{return false}}function Pn(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 Oi(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")||Pn(t)}function An(t){let e={...process.env,GIT_TERMINAL_PROMPT:"0",GIT_LFS_SKIP_SMUDGE:"1",...t};return Ti__default.default({timeout:{block:Ts},config:["filter.lfs.required=false","filter.lfs.smudge=","filter.lfs.clean=","filter.lfs.process="]}).env(e)}async function In(t){try{await promises.rm(t,{recursive:!0,force:!0});}catch{}await promises.mkdir(t,{recursive:true});}async function Fi(t,e,s){let n=t.slug;try{let{stdout:o,stderr:i}=await xn("gh",["auth","status","-h","github.com"],{timeout:5e3,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),a=`${o}${i}`;/Git operations protocol:\s+ssh/i.test(a)&&(n=t.sshUrl);}catch{return false}return await xn("gh",["repo","clone",n,e,"--",...s?["--depth=1","--branch",s]:["--depth=1"]],{timeout:Ts,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),true}function Mi(t,e,s){return e&&Pn(s)?`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 Ke(t,e){let s=await promises.mkdtemp(path.join(os$1.tmpdir(),"skills-")),n=e?["--depth","1","--branch",e]:["--depth","1"],l=Ui(t);try{return await An().clone(t,s,n),s}catch(o){let i=o instanceof Error?o.message:String(o),a=i.includes("block timeout")||i.includes("timed out"),r=Oi(i);if(a){try{await promises.rm(s,{recursive:!0,force:!0});}catch{}let h=Math.round(Ts/1e3);throw new We(`Clone timed out after ${h}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&&ji(t)){try{if(await In(s),await Fi(l,s,e))return s}catch{}try{return await In(s),await An({GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND??"ssh -o BatchMode=yes"}).clone(l.sshUrl,s,n),s}catch{}}try{await promises.rm(s,{recursive:!0,force:!0});}catch{}throw r?new We(Mi(t,l,i),t,false,true):new We(`Failed to clone ${t}: ${i}`,t,false,false)}}async function tt(t){let e=path.normalize(path.resolve(t)),s=path.normalize(path.resolve(os$1.tmpdir()));if(!e.startsWith(s+path.sep)&&e!==s)throw new Error("Attempted to clean up directory outside of temp directory");await promises.rm(t,{recursive:true,force:true});}var Gi="skills-lock.json",Nn=1;function En(t){return path.join(t||process.cwd(),Gi)}async function Ie(t){let e=En(t);try{let s=await promises.readFile(e,"utf-8"),n=JSON.parse(s);return typeof n.version!="number"||!n.skills||n.version<Nn?Ds():n}catch{return Ds()}}async function Cn(t,e){let s=En(e),n={};for(let i of Object.keys(t.skills).sort())n[i]=t.skills[i];let l={version:t.version,skills:n},o=JSON.stringify(l,null,2)+`
|
|
17
|
-
`;await promises.writeFile(s,o,"utf-8");}async function ze(t){let e=[];await Rn(t,t,e),e.sort((n,l)=>n.relativePath.localeCompare(l.relativePath));let s=crypto.createHash("sha256");for(let n of e)s.update(n.relativePath),s.update(n.content);return s.digest("hex")}async function Rn(t,e,s){let n=await promises.readdir(e,{withFileTypes:true});await Promise.all(n.map(async l=>{let o=path.join(e,l.name);if(l.isDirectory()){if(l.name===".git"||l.name==="node_modules")return;await Rn(t,o,s);}else if(l.isFile()){let i=await promises.readFile(o),a=path.relative(t,o).split("\\").join("/");s.push({relativePath:a,content:i});}}));}async function Et(t,e,s){let n=await Ie(s);n.skills[t]=e,await Cn(n,s);}async function lc(t,e){let s=await Ie(e);return t in s.skills?(delete s.skills[t],await Cn(s,e),true):false}function Ds(){return {version:Nn,skills:{}}}function Ct(t,e){let s=path.normalize(path.resolve(e)),n=path.normalize(path.resolve(t));return n.startsWith(s+path.sep)||n===s}function st(t){return t.startsWith("./")}async function Un(t){let e=[],s=(n,l)=>{if(Ct(n,t)){if(l&&l.length>0)for(let o of l){if(!st(o))continue;let i=path.dirname(path.join(n,o));Ct(i,t)&&e.push(i);}e.push(path.join(n,"skills"));}};try{let n=await promises.readFile(path.join(t,".claude-plugin/marketplace.json"),"utf-8"),l=JSON.parse(n),o=l.metadata?.pluginRoot;if(o===void 0||st(o))for(let a of l.plugins??[]){if(typeof a.source!="string"&&a.source!==void 0||a.source!==void 0&&!st(a.source))continue;let r=path.join(t,o??"",a.source??"");s(r,a.skills);}}catch{}try{let n=await promises.readFile(path.join(t,".claude-plugin/plugin.json"),"utf-8"),l=JSON.parse(n);s(t,l.skills);}catch{}return e}async function jn(t){let e=new Map;try{let s=await promises.readFile(path.join(t,".claude-plugin/marketplace.json"),"utf-8"),n=JSON.parse(s),l=n.metadata?.pluginRoot;if(l===void 0||st(l))for(let i of n.plugins??[]){if(!i.name||typeof i.source!="string"&&i.source!==void 0||i.source!==void 0&&!st(i.source))continue;let a=path.join(t,l??"",i.source??"");if(Ct(a,t)&&i.skills&&i.skills.length>0)for(let r of i.skills){if(!st(r))continue;let h=path.join(a,r);Ct(h,t)&&e.set(path.resolve(h),i.name);}}}catch{}try{let s=await promises.readFile(path.join(t,".claude-plugin/plugin.json"),"utf-8"),n=JSON.parse(s);if(n.name&&n.skills&&n.skills.length>0)for(let l of n.skills){if(!st(l))continue;let o=path.join(t,l);Ct(o,t)&&e.set(path.resolve(o),n.name);}}catch{}return e}var Rs=["node_modules",".git","dist","build","__pycache__"],Fn=[".agents/skills",".claude/skills",".cline/skills",".codebuddy/skills",".codex/skills",".commandcode/skills",".continue/skills",".github/skills",".goose/skills",".iflow/skills",".junie/skills",".kilocode/skills",".kiro/skills",".mux/skills",".neovate/skills",".opencode/skills",".openhands/skills",".pi/skills",".qoder/skills",".roo/skills",".trae/skills",".windsurf/skills",".zencoder/skills"];function Ns(t){return t.toLowerCase().replace(/[\s_]+/g,"-")}function Zi(t){return t.split(path.sep).join("/").replace(/\/+/g,"/")}function Qi(){let t=process.env.INSTALL_INTERNAL_SKILLS;return t==="1"||t==="true"}async function _s(t){try{let e=path.join(t,"SKILL.md");return (await promises.stat(e)).isFile()}catch{return false}}async function He(t,e){try{let s=await promises.readFile(t,"utf-8"),{data:n}=chunkXDSGBJHO_cjs.e(s);if(!n.name||!n.description||typeof n.name!="string"||typeof n.description!="string")return null;let l=n.metadata&&typeof n.metadata=="object"&&!Array.isArray(n.metadata)?n.metadata:void 0;return l?.internal===!0&&!Qi()&&!e?.includeInternal?null:{name:chunkXDSGBJHO_cjs.d(n.name),description:chunkXDSGBJHO_cjs.d(n.description),path:path.dirname(t),rawContent:s,metadata:l}}catch{return null}}async function Kn(t,e=0,s=5){if(e>s)return [];try{let[n,l]=await Promise.all([_s(t),promises.readdir(t,{withFileTypes:!0}).catch(()=>[])]),o=n?[t]:[],i=await Promise.all(l.filter(a=>a.isDirectory()&&!Rs.includes(a.name)).map(a=>Kn(path.join(t,a.name),e+1,s)));return [...o,...i.flat()]}catch{return []}}function eo(t,e){let s=path.normalize(path.resolve(t)),n=path.normalize(path.resolve(path.join(t,e)));return n.startsWith(s+path.sep)||n===s}async function Le(t,e,s){let n=[],l=new Set,o=await Ie(t),i=new Set(Object.keys(o.skills).map(Ns));if(e&&!eo(t,e))throw new Error(`Invalid subpath: "${e}" resolves outside the repository directory. Subpath must not contain ".." segments that escape the base path.`);let a=e?path.join(t,e):t,r=await jn(a),h=c=>{let f=path.resolve(c.path);return r.has(f)&&(c.pluginName=r.get(f)),c},u=c=>{if(i.size===0)return false;let f=Zi(path.relative(t,c.path));if(!Fn.some(E=>f===E||f.startsWith(`${E}/`)))return false;let A=Ns(c.name),S=Ns(path.basename(c.path));return i.has(A)||i.has(S)};if(await _s(a)){let c=await He(path.join(a,"SKILL.md"),s);if(c&&!u(c)&&(c=h(c),n.push(c),l.add(c.name),!s?.fullDepth))return n}let m=[a,path.join(a,"skills"),path.join(a,"skills/.curated"),path.join(a,"skills/.experimental"),path.join(a,"skills/.system"),...Fn.map(c=>path.join(a,c))],d=new Set(m.slice(1));m.push(...await Un(a));let p=async c=>{if(!await _s(c))return false;let f=await He(path.join(c,"SKILL.md"),s);return !f||l.has(f.name)||u(f)||(f=h(f),n.push(f),l.add(f.name)),true};for(let c of m){let f=d.has(c);try{let x=await promises.readdir(c,{withFileTypes:!0});for(let A of x){if(!A.isDirectory())continue;let S=path.join(c,A.name);if(!(await p(S)||!f)&&!Rs.includes(A.name))try{let T=await promises.readdir(S,{withFileTypes:!0});for(let O of T)!O.isDirectory()||Rs.includes(O.name)||await p(path.join(S,O.name));}catch{}}}catch{}}if(n.length===0||s?.fullDepth){let c=await Kn(a);for(let f of c){let x=await He(path.join(f,"SKILL.md"),s);x&&!l.has(x.name)&&!u(x)&&(x=h(x),n.push(x),l.add(x.name));}}return n}function ne(t){return t.name||path.basename(t.path)}function Qt(t,e){let s=e.map(n=>n.toLowerCase());return t.filter(n=>{let l=n.name.toLowerCase(),o=ne(n).toLowerCase();return s.some(i=>i===l||i===o)})}var Rt=null,_t=null,Ut=null;function Sc(t){Rt=t;}function vc(){Rt=null;}function jt(){if(Rt)return Rt;let t=os$1.homedir();return {Path:{home:t,data:process.env.EASBOT_DATA_PATH?.trim()||path.join(xdgBasedir.xdgData??path.join(t,".local","share"),"easbot"),config:process.env.EASBOT_CONFIG_PATH?.trim()||path.join(xdgBasedir.xdgConfig??path.join(t,".config"),"easbot"),state:process.env.EASBOT_STATE_PATH?.trim()||path.join(xdgBasedir.xdgState??path.join(xdgBasedir.xdgData??path.join(t,".local","share"),"easbot"),"state"),cache:process.env.EASBOT_CACHE_PATH?.trim()||path.join(xdgBasedir.xdgCache??path.join(t,".cache"),"easbot"),log:process.env.EASBOT_LOG_PATH?.trim()||path.join(xdgBasedir.xdgState??path.join(xdgBasedir.xdgData??path.join(t,".local","share"),"easbot"),"log"),bin:process.env.EASBOT_BIN_PATH?.trim()||path.join(t,".local","bin")}}}function xc(t){_t=t;}function Ac(){_t=null;}function to(){if(_t)return _t;let t=process.cwd();return {directory:t,worktree:t}}function Ic(t){Ut=t,t&&(Rt=t.global,_t=t.instance);}function Lc(){return Ut}function Pc(){return Ut!==null}function Tc(){if(!Ut)throw new Error("Skills agent adapter not set. Call setAgentAdapter() before using skills commands that depend on subAgentRunner.");return Ut}function _e(){return jt().Path.home||os$1.homedir()}function Ot(){let t=jt().Path.config;return t||(xdgBasedir.xdgConfig??path.join(_e(),".config"))}function so(){let t=jt().Path.data;return t||(xdgBasedir.xdgData??path.join(_e(),".local","share"))}function Dc(){let t=jt().Path.state;return t||(xdgBasedir.xdgState??path.join(so(),"state"))}function Nc(){let t=jt().Path.cache;return t||(xdgBasedir.xdgCache??path.join(_e(),".cache"))}function gt(){return to().directory||process.cwd()}var b=_e(),Pe=Ot()||xdgBasedir.xdgConfig||path.join(b,".config"),Bn=process.env.CODEX_HOME?.trim()||path.join(b,".codex"),Vn=process.env.CLAUDE_CONFIG_DIR?.trim()||path.join(b,".claude"),qn=process.env.VIBE_HOME?.trim()||path.join(b,".vibe"),Jn=process.env.HERMES_HOME?.trim()||path.join(b,".hermes"),Xn=process.env.AUTOHAND_HOME?.trim()||path.join(b,".autohand"),Yn=process.env.APPDATA?.trim(),Zn=process.env.FLATPAK_XDG_CONFIG_HOME?.trim();function oo(t,e){try{let s=JSON.parse(fs$1.readFileSync(t,"utf-8"));return !!(s.dependencies?.[e]||s.devDependencies?.[e])}catch{return false}}function ro(t=b,e=fs$1.existsSync){return e(path.join(t,".openclaw"))?path.join(t,".openclaw/skills"):e(path.join(t,".clawdbot"))?path.join(t,".clawdbot/skills"):e(path.join(t,".moltbot"))?path.join(t,".moltbot/skills"):path.join(t,".openclaw/skills")}var D={easbot:{name:"easbot",displayName:"EASBot",skillsDir:".easbot/skills",get globalSkillsDir(){return path.join(Ot(),"skills")},detectInstalled:async()=>true,showInUniversalList:false,showInUniversalPrompt:true},"aider-desk":{name:"aider-desk",displayName:"AiderDesk",skillsDir:".aider-desk/skills",globalSkillsDir:path.join(b,".aider-desk/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".aider-desk"))},amp:{name:"amp",displayName:"Amp",skillsDir:".agents/skills",globalSkillsDir:path.join(Pe,"agents/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(Pe,"amp"))},antigravity:{name:"antigravity",displayName:"Antigravity",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".gemini/antigravity/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".gemini/antigravity"))},"antigravity-cli":{name:"antigravity-cli",displayName:"Antigravity CLI",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".gemini/antigravity-cli/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".gemini/antigravity-cli"))},astrbot:{name:"astrbot",displayName:"AstrBot",skillsDir:"data/skills",globalSkillsDir:path.join(b,".astrbot/data/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(process.cwd(),"data/skills"))||fs$1.existsSync(path.join(b,".astrbot"))},"autohand-code":{name:"autohand-code",displayName:"Autohand Code CLI",skillsDir:".autohand/skills",globalSkillsDir:path.join(Xn,"skills"),detectInstalled:async()=>fs$1.existsSync(Xn)},augment:{name:"augment",displayName:"Augment",skillsDir:".augment/skills",globalSkillsDir:path.join(b,".augment/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".augment"))},bob:{name:"bob",displayName:"IBM Bob",skillsDir:".bob/skills",globalSkillsDir:path.join(b,".bob/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".bob"))},"claude-code":{name:"claude-code",displayName:"Claude Code",skillsDir:".claude/skills",globalSkillsDir:path.join(Vn,"skills"),detectInstalled:async()=>fs$1.existsSync(Vn)},openclaw:{name:"openclaw",displayName:"OpenClaw",skillsDir:"skills",globalSkillsDir:ro(),detectInstalled:async()=>fs$1.existsSync(path.join(b,".openclaw"))||fs$1.existsSync(path.join(b,".clawdbot"))||fs$1.existsSync(path.join(b,".moltbot"))},cline:{name:"cline",displayName:"Cline",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".agents","skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".cline"))},"codearts-agent":{name:"codearts-agent",displayName:"CodeArts Agent",skillsDir:".codeartsdoer/skills",globalSkillsDir:path.join(b,".codeartsdoer/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".codeartsdoer"))},codebuddy:{name:"codebuddy",displayName:"CodeBuddy",skillsDir:".codebuddy/skills",globalSkillsDir:path.join(b,".codebuddy/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(process.cwd(),".codebuddy"))||fs$1.existsSync(path.join(b,".codebuddy"))},codemaker:{name:"codemaker",displayName:"Codemaker",skillsDir:".codemaker/skills",globalSkillsDir:path.join(b,".codemaker/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".codemaker"))},codestudio:{name:"codestudio",displayName:"Code Studio",skillsDir:".codestudio/skills",globalSkillsDir:path.join(b,".codestudio/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".codestudio"))},codex:{name:"codex",displayName:"Codex",skillsDir:".agents/skills",globalSkillsDir:path.join(Bn,"skills"),detectInstalled:async()=>fs$1.existsSync(Bn)||fs$1.existsSync("/etc/codex")},"command-code":{name:"command-code",displayName:"Command Code",skillsDir:".commandcode/skills",globalSkillsDir:path.join(b,".commandcode/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".commandcode"))},continue:{name:"continue",displayName:"Continue",skillsDir:".continue/skills",globalSkillsDir:path.join(b,".continue/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(process.cwd(),".continue"))||fs$1.existsSync(path.join(b,".continue"))},cortex:{name:"cortex",displayName:"Cortex Code",skillsDir:".cortex/skills",globalSkillsDir:path.join(b,".snowflake/cortex/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".snowflake/cortex"))},crush:{name:"crush",displayName:"Crush",skillsDir:".crush/skills",globalSkillsDir:path.join(b,".config/crush/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".config/crush"))},cursor:{name:"cursor",displayName:"Cursor",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".cursor/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".cursor"))},deepagents:{name:"deepagents",displayName:"Deep Agents",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".deepagents/agent/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".deepagents"))},devin:{name:"devin",displayName:"Devin for Terminal",skillsDir:".devin/skills",globalSkillsDir:path.join(Pe,"devin/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(Pe,"devin"))},dexto:{name:"dexto",displayName:"Dexto",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".agents/skills"),showInUniversalPrompt:false,detectInstalled:async()=>fs$1.existsSync(path.join(b,".dexto"))},droid:{name:"droid",displayName:"Droid",skillsDir:".factory/skills",globalSkillsDir:path.join(b,".factory/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".factory"))},eve:{name:"eve",displayName:"Eve",skillsDir:"agent/skills",globalSkillsDir:void 0,detectInstalled:async()=>{let t=process.cwd();return fs$1.existsSync(path.join(t,"agent"))&&oo(path.join(t,"package.json"),"eve")}},firebender:{name:"firebender",displayName:"Firebender",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".firebender/skills"),showInUniversalPrompt:false,detectInstalled:async()=>fs$1.existsSync(path.join(b,".firebender"))},forgecode:{name:"forgecode",displayName:"ForgeCode",skillsDir:".forge/skills",globalSkillsDir:path.join(b,".forge/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".forge"))},"gemini-cli":{name:"gemini-cli",displayName:"Gemini CLI",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".gemini/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".gemini"))},"github-copilot":{name:"github-copilot",displayName:"GitHub Copilot",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".copilot/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".copilot"))},goose:{name:"goose",displayName:"Goose",skillsDir:".goose/skills",globalSkillsDir:path.join(Pe,"goose/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(Pe,"goose"))},"hermes-agent":{name:"hermes-agent",displayName:"Hermes Agent",skillsDir:".hermes/skills",globalSkillsDir:path.join(Jn,"skills"),detectInstalled:async()=>fs$1.existsSync(Jn)},"inference-sh":{name:"inference-sh",displayName:"inference.sh",skillsDir:".inferencesh/skills",globalSkillsDir:path.join(b,".inferencesh/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".inferencesh"))},jazz:{name:"jazz",displayName:"Jazz",skillsDir:".jazz/skills",globalSkillsDir:path.join(b,".jazz/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".jazz"))||fs$1.existsSync(path.join(process.cwd(),".jazz"))},junie:{name:"junie",displayName:"Junie",skillsDir:".junie/skills",globalSkillsDir:path.join(b,".junie/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".junie"))},"iflow-cli":{name:"iflow-cli",displayName:"iFlow CLI",skillsDir:".iflow/skills",globalSkillsDir:path.join(b,".iflow/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".iflow"))},kilo:{name:"kilo",displayName:"Kilo Code",skillsDir:".kilocode/skills",globalSkillsDir:path.join(b,".kilocode/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".kilocode"))},"kimi-code-cli":{name:"kimi-code-cli",displayName:"Kimi Code CLI",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".agents/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".kimi-code"))||fs$1.existsSync(path.join(b,".kimi"))},"kiro-cli":{name:"kiro-cli",displayName:"Kiro CLI",skillsDir:".kiro/skills",globalSkillsDir:path.join(b,".kiro/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".kiro"))},kode:{name:"kode",displayName:"Kode",skillsDir:".kode/skills",globalSkillsDir:path.join(b,".kode/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".kode"))},lingma:{name:"lingma",displayName:"Lingma",skillsDir:".lingma/skills",globalSkillsDir:path.join(b,".lingma/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".lingma"))},loaf:{name:"loaf",displayName:"Loaf",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".agents/skills"),showInUniversalPrompt:false,detectInstalled:async()=>fs$1.existsSync(path.join(b,".loaf"))},mcpjam:{name:"mcpjam",displayName:"MCPJam",skillsDir:".mcpjam/skills",globalSkillsDir:path.join(b,".mcpjam/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".mcpjam"))},"mistral-vibe":{name:"mistral-vibe",displayName:"Mistral Vibe",skillsDir:".vibe/skills",globalSkillsDir:path.join(qn,"skills"),detectInstalled:async()=>fs$1.existsSync(qn)},moxby:{name:"moxby",displayName:"Moxby",skillsDir:".moxby/skills",globalSkillsDir:path.join(b,".moxby/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".moxby"))},mux:{name:"mux",displayName:"Mux",skillsDir:".mux/skills",globalSkillsDir:path.join(b,".mux/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".mux"))},opencode:{name:"opencode",displayName:"OpenCode",skillsDir:".agents/skills",globalSkillsDir:path.join(Pe,"opencode/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(Pe,"opencode"))},openhands:{name:"openhands",displayName:"OpenHands",skillsDir:".openhands/skills",globalSkillsDir:path.join(b,".openhands/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".openhands"))},ona:{name:"ona",displayName:"Ona",skillsDir:".ona/skills",globalSkillsDir:path.join(b,".ona/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".ona"))},pi:{name:"pi",displayName:"Pi",skillsDir:".pi/skills",globalSkillsDir:path.join(b,".pi/agent/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".pi/agent"))},qoder:{name:"qoder",displayName:"Qoder",skillsDir:".qoder/skills",globalSkillsDir:path.join(b,".qoder/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".qoder"))},"qoder-cn":{name:"qoder-cn",displayName:"Qoder CN",skillsDir:".qoder/skills",globalSkillsDir:path.join(b,".qoder-cn/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".qoder-cn"))},"qwen-code":{name:"qwen-code",displayName:"Qwen Code",skillsDir:".qwen/skills",globalSkillsDir:path.join(b,".qwen/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".qwen"))},replit:{name:"replit",displayName:"Replit",skillsDir:".agents/skills",globalSkillsDir:path.join(Pe,"agents/skills"),showInUniversalList:false,detectInstalled:async()=>fs$1.existsSync(path.join(process.cwd(),".replit"))},reasonix:{name:"reasonix",displayName:"Reasonix",skillsDir:".reasonix/skills",globalSkillsDir:path.join(b,".reasonix/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".reasonix"))},rovodev:{name:"rovodev",displayName:"Rovo Dev",skillsDir:".rovodev/skills",globalSkillsDir:path.join(b,".rovodev/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".rovodev"))},roo:{name:"roo",displayName:"Roo Code",skillsDir:".roo/skills",globalSkillsDir:path.join(b,".roo/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".roo"))},"tabnine-cli":{name:"tabnine-cli",displayName:"Tabnine CLI",skillsDir:".tabnine/agent/skills",globalSkillsDir:path.join(b,".tabnine/agent/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".tabnine"))},terramind:{name:"terramind",displayName:"Terramind",skillsDir:".terramind/skills",globalSkillsDir:path.join(b,".terramind/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".terramind"))},tinycloud:{name:"tinycloud",displayName:"Tinycloud",skillsDir:".tinycloud/skills",globalSkillsDir:path.join(b,".tinycloud/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".tinycloud"))},trae:{name:"trae",displayName:"Trae",skillsDir:".trae/skills",globalSkillsDir:path.join(b,".trae/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".trae"))},"trae-cn":{name:"trae-cn",displayName:"Trae CN",skillsDir:".trae/skills",globalSkillsDir:path.join(b,".trae-cn/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".trae-cn"))},warp:{name:"warp",displayName:"Warp",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".agents/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".warp"))},windsurf:{name:"windsurf",displayName:"Windsurf",skillsDir:".windsurf/skills",globalSkillsDir:path.join(b,".codeium/windsurf/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".codeium/windsurf"))},zed:{name:"zed",displayName:"Zed",skillsDir:".agents/skills",globalSkillsDir:path.join(b,".agents/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(Pe,"zed"))||!!Yn&&fs$1.existsSync(path.join(Yn,"Zed"))||!!Zn&&fs$1.existsSync(path.join(Zn,"zed"))},zencoder:{name:"zencoder",displayName:"Zencoder",skillsDir:".zencoder/skills",globalSkillsDir:path.join(b,".zencoder/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".zencoder"))},zenflow:{name:"zenflow",displayName:"Zenflow",skillsDir:".zencoder/skills",globalSkillsDir:path.join(b,".zencoder/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".zencoder"))},neovate:{name:"neovate",displayName:"Neovate",skillsDir:".neovate/skills",globalSkillsDir:path.join(b,".neovate/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".neovate"))},pochi:{name:"pochi",displayName:"Pochi",skillsDir:".pochi/skills",globalSkillsDir:path.join(b,".pochi/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".pochi"))},promptscript:{name:"promptscript",displayName:"PromptScript",skillsDir:".agents/skills",globalSkillsDir:void 0,showInUniversalPrompt:false,detectInstalled:async()=>fs$1.existsSync(path.join(process.cwd(),".promptscript"))||fs$1.existsSync(path.join(process.cwd(),"promptscript.yaml"))},adal:{name:"adal",displayName:"AdaL",skillsDir:".adal/skills",globalSkillsDir:path.join(b,".adal/skills"),detectInstalled:async()=>fs$1.existsSync(path.join(b,".adal"))},universal:{name:"universal",displayName:"Universal",skillsDir:".agents/skills",globalSkillsDir:path.join(Pe,"agents/skills"),showInUniversalList:false,detectInstalled:async()=>false}};async function Ge(){return (await Promise.all(Object.entries(D).map(async([e,s])=>({type:e,installed:await s.detectInstalled()})))).filter(e=>e.installed).map(e=>e.type)}function Oc(t){return D[t]}var js=path.join("agent","subagents");function nt(t=process.cwd()){let e=path.join(t,js);if(!fs$1.existsSync(e))return [];try{return fs$1.readdirSync(e,{withFileTypes:!0}).filter(s=>s.isDirectory()).map(s=>s.name).sort()}catch{return []}}function Xe(){return Object.entries(D).filter(([t,e])=>e.skillsDir===".agents/skills"&&e.showInUniversalList!==false).map(([t])=>t)}function ts(){return Object.entries(D).filter(([t,e])=>e.skillsDir===".agents/skills"&&e.showInUniversalList!==false&&e.showInUniversalPrompt!==false).map(([t])=>t)}function Ft(){return Object.entries(D).filter(([t,e])=>e.skillsDir!==".agents/skills").map(([t])=>t)}function we(t){return D[t].skillsDir===".agents/skills"}var Qn=".agents",el="skills",Wc=".agents/skills";function fe(t){return t.toLowerCase().replace(/[^a-z0-9._]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").substring(0,255)||"unnamed-skill"}function le(t,e){let s=path.normalize(path.resolve(t)),n=path.normalize(path.resolve(e));return n.startsWith(s+path.sep)||n===s}function sl(t,e){return le(t,e)||le(e,t)}async function nl(t,e){if(t.isDirectory())return true;if(!t.isSymbolicLink())return false;try{return (await promises.stat(e)).isDirectory()}catch{return false}}function Ue(t,e){let s=t?_e()||os$1.homedir():e||gt()||process.cwd();return path.join(s,Qn,el)}function ht(t,e){let s=e||gt()||process.cwd();return path.join(s,js,fe(t),"skills")}function Te(t,e,s,n){if(we(t))return Ue(e,s);if(t==="eve"&&n)return ht(n,s);let l=D[t],o=_e()||os$1.homedir(),i=e?o:s||gt()||process.cwd();return e?l.globalSkillsDir===void 0?path.join(i,l.skillsDir):l.globalSkillsDir:path.join(i,l.skillsDir)}function yo(t,e){return path.resolve(path.dirname(t),e)}async function $e(t){try{await promises.rm(t,{recursive:!0,force:!0});}catch{}await promises.mkdir(t,{recursive:true});}async function Os(t){let e=path.resolve(t),s=path.dirname(e),n=path.basename(e);try{let l=await promises.realpath(s);return path.join(l,n)}catch{return e}}async function ls(t,e){try{let s=path.resolve(t),n=path.resolve(e),[l,o]=await Promise.all([promises.realpath(s).catch(()=>s),promises.realpath(n).catch(()=>n)]);if(l===o)return !0;let i=await Os(t),a=await Os(e);if(i===a)return !0;try{if((await promises.lstat(e)).isSymbolicLink()){let c=await promises.readlink(e);if(yo(e,c)===s)return !0;await promises.rm(e);}else await promises.rm(e,{recursive:!0});}catch(p){if(p&&typeof p=="object"&&"code"in p&&p.code==="ELOOP")try{await promises.rm(e,{force:!0});}catch{}}let r=path.dirname(e);await promises.mkdir(r,{recursive:!0});let h=await Os(r),u=path.relative(h,t),m=os$1.platform()==="win32"?"junction":void 0;return await promises.symlink(m==="junction"?s:u,e,m),!0}catch{return false}}async function is(t,e,s={}){let n=D[e],l=s.global??false,o=s.cwd||process.cwd(),i=s.eveSubagent;if(l&&n.globalSkillsDir===void 0)return {success:false,path:"",mode:s.mode??"symlink",error:`${n.displayName} does not support global skill installation`};let a=t.name||path.basename(t.path),r=fe(a),h=s.mode??"symlink",u=e==="eve"&&h==="symlink"?Te(e,l,o,i):Ue(l,o),m=path.join(u,r),d=Te(e,l,o,i),p=path.join(d,r);if(!le(u,m))return {success:false,path:p,mode:h,error:"Invalid skill name: potential path traversal detected"};if(!le(d,p))return {success:false,path:p,mode:h,error:"Invalid skill name: potential path traversal detected"};try{if(sl(t.path,p))return {success:!0,path:p,mode:h,skipped:!0};if(h==="copy")return await $e(p),await ss(t.path,p,e),{success:!0,path:p,mode:"copy"};if(sl(t.path,m))return {success:!0,path:m,canonicalPath:m,mode:"symlink",skipped:!0};if(await $e(m),await ss(t.path,m,e),l&&we(e))return {success:!0,path:m,canonicalPath:m,mode:"symlink"};if(!l&&!we(e)){let f=path.join(o,D[e].skillsDir.split("/")[0]);if(!fs$1.existsSync(f))return {success:!0,path:m,canonicalPath:m,mode:"symlink",skipped:!0}}return await ls(m,p)?{success:!0,path:p,canonicalPath:m,mode:"symlink"}:(await $e(p),await ss(t.path,p,e),{success:!0,path:p,canonicalPath:m,mode:"symlink",symlinkFailed:!0})}catch(c){return {success:false,path:p,mode:h,error:c instanceof Error?c.message:"Unknown error"}}}var bo=new Set(["metadata.json"]),wo=new Set([".git","__pycache__","__pypackages__"]),$o=(t,e=false)=>!!(bo.has(t)||e&&wo.has(t));function Ye(t){let{data:e,content:s}=chunkXDSGBJHO_cjs.e(t),n={};if(typeof e.description=="string"&&(n.description=e.description),typeof e.license=="string"&&(n.license=e.license),e.metadata&&typeof e.metadata=="object"&&!Array.isArray(e.metadata)){let i=Object.fromEntries(Object.entries(e.metadata).filter(a=>typeof a[1]=="string"));Object.keys(i).length>0&&(n.metadata=i);}let l=Object.keys(n);return l.length===0?s.replace(/^\r?\n/u,""):`---
|
|
18
|
-
${l.map(i=>`${i}: ${JSON.stringify(n[i])}`).join(`
|
|
19
|
-
`)}
|
|
20
|
-
---
|
|
21
|
-
${s.replace(/^\r?\n/u,"")}`}async function ss(t,e,s){await promises.mkdir(e,{recursive:true});let n=await promises.readdir(t,{withFileTypes:true});await Promise.all(n.filter(l=>!$o(l.name,l.isDirectory())).map(async l=>{let o=path.join(t,l.name),i=path.join(e,l.name);if(l.isDirectory())await ss(o,i,s);else try{if(s==="eve"&&l.name.toLowerCase()==="skill.md"){await promises.writeFile(i,Ye(await promises.readFile(o,"utf-8")));return}await promises.cp(o,i,{dereference:!0,recursive:!0});}catch(a){if(a instanceof Error&&"code"in a&&a.code==="ENOENT"&&l.isSymbolicLink())console.warn(`Skipping broken symlink: ${o}`);else throw a}}));}function So(t){return t.some(e=>path.basename(e.path).toLowerCase()==="skill.md")}function ns(t){return `${fe(t)}.md`}function vo(t){let e=t.find(n=>path.basename(n.path).toLowerCase()==="skill.md");if(e)return Ye(e.contents);let s=t.find(n=>path.extname(n.path).toLowerCase()===".md");return s?Ye(s.contents):""}async function os(t,e,s={}){let n=D[e],l=fe(t);if(s.global&&n.globalSkillsDir===void 0)return false;let o=s.global?n.globalSkillsDir:e==="eve"&&s.eveSubagent?ht(s.eveSubagent,s.cwd):path.join(s.cwd||process.cwd(),n.skillsDir),i=path.join(o,l);if(!le(o,i))return false;try{return await promises.access(i),!0}catch{return false}}function zs(t,e,s={}){D[e];s.cwd||process.cwd();let o=fe(t),i=Te(e,s.global??false,s.cwd,s.eveSubagent),a=path.join(i,o);if(!le(i,a))throw new Error("Invalid skill name: potential path traversal detected");return a}function Ze(t,e={}){let s=fe(t),n=e.agent==="eve"?Te("eve",e.global??false,e.cwd,e.eveSubagent):Ue(e.global??false,e.cwd),l=path.join(n,s);if(!le(n,l))throw new Error("Invalid skill name: potential path traversal detected");return l}async function Qc(t,e,s={}){let n=D[e],l=s.global??false,o=s.cwd||process.cwd(),i=s.mode??"symlink",a=s.eveSubagent;if(l&&n.globalSkillsDir===void 0)return {success:false,path:"",mode:i,error:`${n.displayName} does not support global skill installation`};let r=fe(t.installName),h=e==="eve"&&i==="symlink"?Te(e,l,o,a):Ue(l,o),u=path.join(h,r),m=Te(e,l,o,a),d=path.join(m,r);if(!le(h,u))return {success:false,path:d,mode:i,error:"Invalid skill name: potential path traversal detected"};if(!le(m,d))return {success:false,path:d,mode:i,error:"Invalid skill name: potential path traversal detected"};try{if(i==="copy"){await $e(d);let x=e==="eve"?ns(t.installName):"SKILL.md",A=path.join(d,x);return await promises.writeFile(A,e==="eve"?Ye(t.content):t.content,"utf-8"),{success:!0,path:d,mode:"copy"}}await $e(u);let p=e==="eve"?ns(t.installName):"SKILL.md",c=path.join(u,p);if(await promises.writeFile(c,e==="eve"?Ye(t.content):t.content,"utf-8"),l&&we(e))return {success:!0,path:u,canonicalPath:u,mode:"symlink"};if(!await ls(u,d)){await $e(d);let x=e==="eve"?ns(t.installName):"SKILL.md",A=path.join(d,x);return await promises.writeFile(A,e==="eve"?Ye(t.content):t.content,"utf-8"),{success:!0,path:d,canonicalPath:u,mode:"symlink",symlinkFailed:!0}}return {success:!0,path:d,canonicalPath:u,mode:"symlink"}}catch(p){return {success:false,path:d,mode:i,error:p instanceof Error?p.message:"Unknown error"}}}async function ol(t,e,s={}){let n=D[e],l=s.global??false,o=s.cwd||process.cwd(),i=s.mode??"symlink",a=s.eveSubagent;if(l&&n.globalSkillsDir===void 0)return {success:false,path:"",mode:i,error:`${n.displayName} does not support global skill installation`};let r=fe(t.installName),h=e==="eve"&&i==="symlink"?Te(e,l,o,a):Ue(l,o),u=path.join(h,r),m=Te(e,l,o,a),d=path.join(m,r);if(!le(h,u))return {success:false,path:d,mode:i,error:"Invalid skill name: potential path traversal detected"};if(!le(m,d))return {success:false,path:d,mode:i,error:"Invalid skill name: potential path traversal detected"};async function p(c){for(let[f,x]of t.files){let A=path.join(c,f);if(!le(c,A))continue;let S=path.dirname(A);S!==c&&await promises.mkdir(S,{recursive:true}),await promises.writeFile(A,e==="eve"&&path.basename(f).toLowerCase()==="skill.md"&&typeof x=="string"?Ye(x):x);}}try{return i==="copy"?(await $e(d),await p(d),{success:!0,path:d,mode:"copy"}):(await $e(u),await p(u),l&&we(e)?{success:!0,path:u,canonicalPath:u,mode:"symlink"}:await ls(u,d)?{success:!0,path:d,canonicalPath:u,mode:"symlink"}:(await $e(d),await p(d),{success:!0,path:d,canonicalPath:u,mode:"symlink",symlinkFailed:!0}))}catch(c){return {success:false,path:d,mode:i,error:c instanceof Error?c.message:"Unknown error"}}}async function Hs(t,e,s={}){let n=D[e],l=s.global??false,o=s.cwd||process.cwd(),i=s.mode??"symlink",a=s.eveSubagent;if(l&&n.globalSkillsDir===void 0)return {success:false,path:"",mode:i,error:`${n.displayName} does not support global skill installation`};let r=fe(t.installName),h=Te(e,l,o,a);if(e==="eve"&&!So(t.files)){let c=path.join(h,ns(t.installName));if(!le(h,c))return {success:false,path:c,mode:i,error:"Invalid skill name: potential path traversal detected"};try{return await promises.mkdir(h,{recursive:!0}),await promises.rm(c,{recursive:!0,force:!0}),await promises.writeFile(c,vo(t.files),"utf-8"),{success:!0,path:c,mode:"copy"}}catch(f){return {success:false,path:c,mode:i,error:f instanceof Error?f.message:"Unknown error"}}}let u=e==="eve"&&i==="symlink"?Te(e,l,o,a):Ue(l,o),m=path.join(u,r),d=path.join(h,r);if(!le(u,m))return {success:false,path:d,mode:i,error:"Invalid skill name: potential path traversal detected"};if(!le(h,d))return {success:false,path:d,mode:i,error:"Invalid skill name: potential path traversal detected"};async function p(c){for(let f of t.files){let x=path.join(c,f.path);if(!le(c,x))continue;let A=path.dirname(x);A!==c&&await promises.mkdir(A,{recursive:true}),await promises.writeFile(x,e==="eve"&&path.basename(f.path).toLowerCase()==="skill.md"?Ye(f.contents):f.contents,"utf-8");}}try{if(i==="copy")return await $e(d),await p(d),{success:!0,path:d,mode:"copy"};if(await $e(m),await p(m),l&&we(e))return {success:!0,path:m,canonicalPath:m,mode:"symlink"};if(!l&&!we(e)){let f=path.join(o,D[e].skillsDir.split("/")[0]);if(!fs$1.existsSync(f))return {success:!0,path:m,canonicalPath:m,mode:"symlink",skipped:!0}}return await ls(m,d)?{success:!0,path:d,canonicalPath:m,mode:"symlink"}:(await $e(d),await p(d),{success:!0,path:d,canonicalPath:m,mode:"symlink",symlinkFailed:!0})}catch(c){return {success:false,path:d,mode:i,error:c instanceof Error?c.message:"Unknown error"}}}async function rl(t={}){let e=t.cwd||process.cwd(),s=new Map,n=[],l=await Ge(),o=t.agentFilter,i=o?l.filter(r=>o.includes(r)):l,a=[];t.global===void 0?a.push({global:false},{global:true}):a.push({global:t.global});for(let{global:r}of a){n.push({global:r,path:Ue(r,e)});for(let u of i){let m=D[u];if(r&&m.globalSkillsDir===void 0)continue;let d=r?m.globalSkillsDir:path.join(e,m.skillsDir);if(n.some(p=>p.path===d&&p.global===r)||n.push({global:r,path:d,agentType:u}),u==="eve"&&!r)for(let p of nt(e)){let c=ht(p,e);n.some(f=>f.path===c&&f.global===r)||n.push({global:r,path:c,agentType:u});}}let h=Object.keys(D);for(let u of h){if(i.includes(u))continue;let m=D[u];if(r&&m.globalSkillsDir===void 0)continue;let d=r?m.globalSkillsDir:path.join(e,m.skillsDir);n.some(p=>p.path===d&&p.global===r)||fs$1.existsSync(d)&&n.push({global:r,path:d,agentType:u});}}for(let r of n)try{let h=await promises.readdir(r.path,{withFileTypes:!0});for(let u of h){let m=path.join(r.path,u.name);if(!await nl(u,m))continue;let d=path.join(m,"SKILL.md");try{await promises.stat(d);}catch{continue}let p=await He(d);if(!p)continue;let c=r.global?"global":"project",f=`${c}:${p.name}`;if(r.agentType){if(s.has(f)){let S=s.get(f);S.agents.includes(r.agentType)||S.agents.push(r.agentType);}else s.set(f,{name:p.name,description:p.description,path:m,canonicalPath:m,scope:c,agents:[r.agentType]});continue}let x=fe(p.name),A=[];for(let S of i){let E=D[S];if(r.global&&E.globalSkillsDir===void 0)continue;let T=Te(S,r.global,e),O=!1,C=Array.from(new Set([u.name,x,p.name.toLowerCase().replace(/\s+/g,"-").replace(/[/\\:\0]/g,"")]));for(let I of C){let w=path.join(T,I);if(le(T,w))try{await promises.access(w),O=!0;break}catch{}}if(!O)try{let I=await promises.readdir(T,{withFileTypes:!0});for(let w of I){let N=path.join(T,w.name);if(await nl(w,N)&&le(T,N))try{let U=path.join(N,"SKILL.md");await promises.stat(U);let M=await He(U);if(M&&M.name===p.name){O=!0;break}}catch{}}}catch{}O&&A.push(S);}if(s.has(f)){let S=s.get(f);for(let E of A)S.agents.includes(E)||S.agents.push(E);}else s.set(f,{name:p.name,description:p.description,path:m,canonicalPath:m,scope:c,agents:A});}}catch{}return Array.from(s.values())}var xo="https://add-skill.vercel.sh/t",Ao="https://add-skill.vercel.sh/audit",Gs=null,Bs=null;function al(t){Bs=t;}function Io(){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 Lo(){return !process.env.DISABLE_TELEMETRY&&!process.env.DO_NOT_TRACK}function qs(t){Gs=t;}async function cl(t,e,s=3e3){if(e.length===0)return null;try{let n=new URLSearchParams({source:t,skills:e.join(",")}),l=new AbortController,o=setTimeout(()=>l.abort(),s),i=await fetch(`${Ao}?${n.toString()}`,{signal:l.signal});return clearTimeout(o),i.ok?await i.json():null}catch{return null}}var Vs=[];function ye(t){if(Lo())try{let e=new URLSearchParams;Gs&&e.set("v",Gs),Io()&&e.set("ci","1"),Bs&&e.set("agent",Bs);for(let[n,l]of Object.entries(t))l!=null&&e.set(n,String(l));let s=fetch(`${xo}?${e.toString()}`).catch(()=>{}).then(()=>{});Vs.push(s);}catch{}}async function su(t=5e3){if(Vs.length===0)return;let e=new Promise(s=>setTimeout(s,t));await Promise.race([Promise.all(Vs),e]);}var kt=null,To={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 Qe(){return kt||(kt=await detectAgent.determineAgent(),kt.isAgent&&al(kt.agent.name),kt)}async function rs(){return (await Qe()).isAgent}async function ru(){let t=await Qe();return t.isAgent?t.agent.name:null}function as(t){return To[t]??null}var Js=class{constructor(){chunkXDSGBJHO_cjs.a(this,"providers",[]);}register(e){if(this.providers.some(s=>s.id===e.id))throw new Error(`Provider with id "${e.id}" already registered`);this.providers.push(e);}findProvider(e){for(let s of this.providers)if(s.match(e).matches)return s;return null}getProviders(){return [...this.providers]}},cs=new Js;function Do(t){cs.register(t);}function No(t){return cs.findProvider(t)}function Eo(){return cs.getProviders()}var ul="https://schemas.agentskills.io/discovery/0.2.0/schema.json",Uo=50*1024*1024,jo=1e3,us=class{constructor(){chunkXDSGBJHO_cjs.a(this,"id","well-known");chunkXDSGBJHO_cjs.a(this,"displayName","Well-Known Skills");chunkXDSGBJHO_cjs.a(this,"WELL_KNOWN_PATHS",[".well-known/agent-skills",".well-known/skills"]);chunkXDSGBJHO_cjs.a(this,"INDEX_FILE","index.json");}match(e){if(!e.startsWith("http://")&&!e.startsWith("https://"))return {matches:false};try{let s=new URL(e);return ["github.com","gitlab.com","huggingface.co"].includes(s.hostname)?{matches:!1}:{matches:!0,sourceIdentifier:`wellknown/${s.hostname}`}}catch{return {matches:false}}}async fetchIndex(e){return (await this.fetchIndexCandidates(e))[0]??null}async fetchIndexCandidates(e){try{let s=new URL(e),n=s.pathname.replace(/\/$/,""),l=[];for(let i of this.WELL_KNOWN_PATHS)l.push({indexUrl:`${s.protocol}//${s.host}${n}/${i}/${this.INDEX_FILE}`,baseUrl:`${s.protocol}//${s.host}${n}`,wellKnownPath:i}),n&&n!==""&&l.push({indexUrl:`${s.protocol}//${s.host}/${i}/${this.INDEX_FILE}`,baseUrl:`${s.protocol}//${s.host}`,wellKnownPath:i});let o=[];for(let{indexUrl:i,baseUrl:a,wellKnownPath:r}of l)try{let h=await fetch(i);if(!h.ok)continue;let u=await h.json(),m=this.normalizeIndex(u,i,r);if(!m)continue;o.push({index:m.index,entries:m.entries,resolvedBaseUrl:a,resolvedWellKnownPath:r,indexUrl:i});}catch{}return o}catch{return []}}normalizeIndex(e,s,n){if(!e||typeof e!="object")return null;let l=e;if(!Array.isArray(l.skills))return null;let o=l.$schema;if(o===ul){let r=[],h=[];for(let u of l.skills){if(!this.isValidSkillEntryV2(u))continue;let m=new URL(u.url,s).toString();r.push({version:"0.2.0",name:u.name,description:u.description,type:u.type,artifactUrl:m,digest:u.digest,indexEntry:u}),h.push(u);}return r.length===0?null:{index:{$schema:ul,skills:h},entries:r}}if(o!==void 0)return null;let i=[],a=[];for(let r of l.skills){if(!this.isValidSkillEntryV1(r))return null;i.push(r),a.push({version:"0.1.0",name:r.name,description:r.description,files:r.files,baseUrl:this.getLegacySkillBaseUrl(s,n),wellKnownPath:n,indexEntry:r});}return {index:{skills:i},entries:a}}getLegacySkillBaseUrl(e,s){let n=new URL(e),l=`/${s}/${this.INDEX_FILE}`;return `${n.protocol}//${n.host}${n.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 s=e;if(!this.isValidSkillName(s.name)||typeof s.description!="string"||!s.description||!Array.isArray(s.files)||s.files.length===0)return false;for(let l of s.files)if(!this.isSafeLegacyFilePath(l))return false;return s.files.some(l=>typeof l=="string"&&l.toLowerCase()==="skill.md")}isValidSkillEntryV2(e){if(!e||typeof e!="object")return false;let s=e;if(!this.isValidSkillName(s.name)||typeof s.description!="string"||!s.description||s.description.length>1024||s.type!=="skill-md"&&s.type!=="archive"||typeof s.url!="string"||!s.url||typeof s.digest!="string"||!/^sha256:[a-f0-9]{64}$/.test(s.digest))return false;try{new URL(s.url,"https://example.com/.well-known/agent-skills/index.json");}catch{return false}return true}async fetchSkill(e){try{let s=new URL(e),n=await this.fetchIndexCandidates(e);for(let l of n){let{entries:o}=l,i=null,a=s.pathname.match(/\/.well-known\/(?:agent-skills|skills)\/([^/]+)\/?$/);if(a?.[1]&&a[1]!=="index.json"?i=a[1]:o.length===1&&(i=o[0].name),!i)continue;let r=o.find(u=>u.name===i);if(!r)continue;let h=await this.fetchSkillByEntry(r);if(h)return h}return null}catch{return null}}async fetchSkillByEntry(e,s,n){return typeof e=="string"?s?this.fetchLegacySkillByEntry({version:"0.1.0",name:s.name,description:s.description,files:s.files,baseUrl:e,wellKnownPath:n??this.WELL_KNOWN_PATHS[0],indexEntry:s}):null:e.version==="0.1.0"?this.fetchLegacySkillByEntry(e):this.fetchArtifactSkillByEntry(e)}async fetchLegacySkillByEntry(e){try{let s=`${e.baseUrl.replace(/\/$/,"")}/${e.wellKnownPath}/${e.name}`,n=`${s}/SKILL.md`,l=await fetch(n);if(!l.ok)return null;let o=await l.text(),{data:i}=chunkXDSGBJHO_cjs.e(o);if(typeof i.name!="string"||typeof i.description!="string")return null;let a=new Map;a.set("SKILL.md",o);let h=e.files.filter(m=>m.toLowerCase()!=="skill.md").map(async m=>{try{let d=`${s}/${m}`,p=await fetch(d);if(p.ok){let c=await p.arrayBuffer();return {path:m,content:new Uint8Array(c)}}}catch{}return null}),u=await Promise.all(h);for(let m of u)m&&a.set(m.path,m.content);return this.createSkill({name:i.name,description:i.description,content:o,installName:e.name,sourceUrl:n,metadata:i.metadata,files:a,indexEntry:e.indexEntry})}catch{return null}}async fetchArtifactSkillByEntry(e){try{let s=await fetch(e.artifactUrl);if(!s.ok)return null;let n=s.headers.get("content-type")??"",l=new Uint8Array(await s.arrayBuffer());if(this.computeDigest(l)!==e.digest)return null;if(e.type==="skill-md"){let h=new TextDecoder().decode(l),{data:u}=chunkXDSGBJHO_cjs.e(h);if(typeof u.name!="string"||typeof u.description!="string")return null;let m=new Map;return m.set("SKILL.md",h),this.createSkill({name:u.name,description:u.description,content:h,installName:e.name,sourceUrl:e.artifactUrl,metadata:u.metadata,files:m,indexEntry:e.indexEntry})}let o=this.extractArchive(l,e.artifactUrl,n),i=o.get("SKILL.md");if(!i)return null;let a=typeof i=="string"?i:new TextDecoder().decode(i);o.set("SKILL.md",a);let{data:r}=chunkXDSGBJHO_cjs.e(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:o,indexEntry:e.indexEntry})}catch{return null}}createSkill(e){return {name:chunkXDSGBJHO_cjs.d(e.name),description:chunkXDSGBJHO_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 s=await this.fetchIndexCandidates(e);for(let n of s){let l=n.entries.map(a=>this.fetchSkillByEntry(a)),i=(await Promise.all(l)).filter(a=>a!==null);if(i.length>0)return i}return []}catch{return []}}computeDigest(e){return `sha256:${crypto.createHash("sha256").update(e).digest("hex")}`}extractArchive(e,s,n){if(this.isZipArchive(e,s,n))return this.extractZip(e);if(this.isTarGzArchive(e,s,n))return this.extractTarGz(e);throw new Error("Unsupported archive format")}isZipArchive(e,s,n){return n.includes("application/zip")||s.toLowerCase().endsWith(".zip")||e[0]===80&&e[1]===75}isTarGzArchive(e,s,n){let l=s.toLowerCase();return n.includes("application/gzip")||n.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 s=e.split("/").filter(Boolean);return s.length===0||s.some(n=>n==="."||n==="..")?null:s.join("/")}addArchiveFile(e,s,n,l){let o=this.normalizeArchivePath(s);if(!o)throw new Error(`Unsafe archive path: ${s}`);if(l.bytes+=n.byteLength,l.bytes>Uo)throw new Error("Archive exceeds maximum unpacked size");if(e.size>=jo)throw new Error("Archive contains too many files");e.set(o,n);}extractTarGz(e){let s=zlib.gunzipSync(Buffer.from(e)),n=new Map,l={bytes:0},o=0;for(;o+512<=s.length;){let i=s.subarray(o,o+512);if(i.every(c=>c===0))break;let a=this.readTarString(i,0,100),r=this.readTarString(i,124,12).trim(),h=i[156],u=this.readTarString(i,345,155),m=u?`${u}/${a}`:a,d=Number.parseInt(r||"0",8);if(!Number.isFinite(d)||d<0)throw new Error("Invalid tar entry size");if(o+=512,h===50||h===49)throw new Error("Archive links are not supported");if(h===0||h===48){let c=s.subarray(o,o+d);this.addArchiveFile(n,m,new Uint8Array(c),l);}o+=Math.ceil(d/512)*512;}if(!n.has("SKILL.md"))throw new Error("Archive missing root SKILL.md");return n}readTarString(e,s,n){let l=e.subarray(s,s+n),o=l.indexOf(0);return new TextDecoder().decode(o>=0?l.subarray(0,o):l)}extractZip(e){let s=Buffer.from(e),n=this.findZipEndOfCentralDirectory(s);if(n<0)throw new Error("Invalid zip archive");let l=s.readUInt16LE(n+10),o=s.readUInt32LE(n+16),i=new Map,a={bytes:0},r=o;for(let h=0;h<l;h++){if(s.readUInt32LE(r)!==33639248)throw new Error("Invalid zip directory");let u=s.readUInt16LE(r+8),m=s.readUInt16LE(r+10),d=s.readUInt32LE(r+20),p=s.readUInt32LE(r+24),c=s.readUInt16LE(r+28),f=s.readUInt16LE(r+30),x=s.readUInt16LE(r+32),A=s.readUInt32LE(r+38),S=s.readUInt32LE(r+42),E=r+46,T=s.subarray(E,E+c),O=new TextDecoder(u&2048?"utf-8":void 0).decode(T);if(r=E+c+f+x,O.endsWith("/"))continue;if(u&1)throw new Error("Encrypted zip entries are not supported");let I=A>>>16&61440;if(I===40960||I===4096)throw new Error("Archive links are not supported");if(s.readUInt32LE(S)!==67324752)throw new Error("Invalid zip local header");let w=s.readUInt16LE(S+26),N=s.readUInt16LE(S+28),U=S+30+w+N,M=s.subarray(U,U+d),G;if(m===0)G=M;else if(m===8)G=zlib.inflateRawSync(M);else throw new Error(`Unsupported zip compression method: ${m}`);if(G.byteLength!==p)throw new Error("Zip entry size mismatch");this.addArchiveFile(i,O,new Uint8Array(G),a);}if(!i.has("SKILL.md"))throw new Error("Archive missing root SKILL.md");return i}findZipEndOfCentralDirectory(e){let s=Math.max(0,e.length-65535-22);for(let n=e.length-22;n>=s;n--)if(e.readUInt32LE(n)===101010256)return n;return -1}toRawUrl(e){try{let s=new URL(e);if(e.toLowerCase().endsWith("/skill.md"))return e;let n=this.WELL_KNOWN_PATHS[0],l=s.pathname.match(/\/.well-known\/(?:agent-skills|skills)\/([^/]+)\/?$/);if(l?.[1]){let i=s.pathname.replace(/\/.well-known\/(?:agent-skills|skills)\/.*$/,"");return `${s.protocol}//${s.host}${i}/${n}/${l[1]}/SKILL.md`}let o=s.pathname.replace(/\/$/,"");return `${s.protocol}//${s.host}${o}/${n}/${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}},yt=new us;var Go=".agents",Ys=".skill-lock.json",dl=3;function gl(){let t=Ot(),e=_e(),s=process.env.XDG_STATE_HOME;return s?path.join(s,"skills",Ys):t?path.join(t,"skills",Ys):path.join(e||os$1.homedir(),Go,Ys)}async function De(){let t=gl();try{let e=await promises.readFile(t,"utf-8"),s=JSON.parse(e);return typeof s.version!="number"||!s.skills||s.version<dl?Zs():s}catch{return Zs()}}async function ds(t){let e=gl();await promises.mkdir(path.dirname(e),{recursive:true});let s=JSON.stringify(t,null,2);await promises.writeFile(e,s,"utf-8");}function Lu(t){return crypto.createHash("sha256").update(t,"utf-8").digest("hex")}var Qs=false;function Pu(){Qs=false;}function ot(){if(process.env.GITHUB_TOKEN)return process.env.GITHUB_TOKEN;if(process.env.GH_TOKEN)return process.env.GH_TOKEN;Qs||(process.stderr.write(`${k__default.default.yellow("\u2502")} ${k__default.default.yellow("GitHub rate limit reached")} \u2014 using your ${k__default.default.cyan("gh")} login to continue.
|
|
22
|
-
${k__default.default.yellow("\u2502")} ${k__default.default.dim(`Tip: set ${k__default.default.cyan("GITHUB_TOKEN")} to avoid this prompt, or use ${k__default.default.cyan("--full-depth")} to clone instead.
|
|
23
|
-
`)}`),Qs=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 Tu(t,e,s,n){let{fetchRepoTree:l,getSkillFolderHashFromTree:o}=await import('./blob-UAS6F4BG.cjs'),i=await l(t,n,s??void 0);return i?o(i,e):null}async function en(t,e){let s=await De(),n=new Date().toISOString(),l=s.skills[t];s.skills[t]={...e,installedAt:l?.installedAt??n,updatedAt:n},await ds(s);}async function pl(t){let e=await De();return t in e.skills?(delete e.skills[t],await ds(e),true):false}async function ml(t){return (await De()).skills[t]??null}async function fl(){return (await De()).skills}async function Du(){let t=await De(),e=new Map;for(let[s,n]of Object.entries(t.skills)){let l=e.get(n.source);l?l.skills.push(s):e.set(n.source,{skills:[s],entry:n});}return e}function Zs(){return {version:dl,skills:{},dismissed:{}}}async function hl(t){return (await De()).dismissed?.[t]===true}async function Kt(t){let e=await De();e.dismissed||(e.dismissed={}),e.dismissed[t]=true,await ds(e);}async function tn(){return (await De()).lastSelectedAgents}async function sn(t){let e=await De();e.lastSelectedAgents=t,await ds(e);}var qo=new stream.Writable({write(t,e,s){s();}}),Jo=k__default.default.green("\u25C6"),Xo=k__default.default.red("\u25A0"),Yo=k__default.default.green("\u25C7"),Zo=k__default.default.green("\u25CF"),Qo=k__default.default.dim("\u25CB");k__default.default.green("\u2713");var er=k__default.default.green("\u2022"),ce=k__default.default.dim("\u2502"),bt=k__default.default.dim("\u2500"),tr=Symbol("cancel");function sr(t){let e=0;for(let s of t){let n=s.codePointAt(0);if(n===0)continue;let l=n>=4352&&n<=4447||n>=8986&&n<=8987||n>=9001&&n<=9002||n>=9193&&n<=9196||n===9200||n===9203||n>=9725&&n<=9726||n>=9748&&n<=9749||n>=9800&&n<=9811||n>=9855&&n<=9855||n>=9875&&n<=9875||n>=9889&&n<=9889||n>=9898&&n<=9899||n>=9917&&n<=9918||n>=9924&&n<=9925||n>=9934&&n<=9934||n>=9940&&n<=9940||n>=9962&&n<=9962||n>=9970&&n<=9971||n>=9973&&n<=9973||n>=9978&&n<=9978||n>=9981&&n<=9981||n>=9989&&n<=9989||n>=9994&&n<=9995||n>=10024&&n<=10024||n>=10060&&n<=10060||n>=10062&&n<=10062||n>=10067&&n<=10069||n>=10071&&n<=10071||n>=10133&&n<=10135||n>=10160&&n<=10160||n>=10175&&n<=10175||n>=11035&&n<=11036||n>=11088&&n<=11088||n>=11093&&n<=11093||n>=11904&&n<=42191&&n!==12351||n>=43360&&n<=43388||n>=44032&&n<=55203||n>=63744&&n<=64255||n>=65040&&n<=65049||n>=65072&&n<=65135||n>=65280&&n<=65376||n>=65504&&n<=65510||n>=126976&&n<=129535;e+=l?2:1;}return e}function nr(t,e){let s=util.stripVTControlCharacters(t),n=Math.max(1,e),l=sr(s);return Math.max(1,Math.ceil(l/n))}function lr(t,e){let s=e!==void 0&&e>0?e:process.stdout.columns&&process.stdout.columns>0?process.stdout.columns:80;return t.reduce((n,l)=>n+nr(l,s),0)}async function wt(t){let{message:e,items:s,maxVisible:n=8,initialSelected:l=[],required:o=false,lockedSection:i}=t;return new Promise(a=>{let r=gs__namespace.createInterface({input:process.stdin,output:qo,terminal:false});process.stdin.isTTY&&process.stdin.setRawMode(true),gs__namespace.emitKeypressEvents(process.stdin,r);let h="",u=0,m=new Set(l),d=0,p=i?i.items.map(C=>C.value):[],c=(C,I)=>{if(!I)return true;let w=I.toLowerCase();return C.label.toLowerCase().includes(w)||String(C.value).toLowerCase().includes(w)},f=()=>s.filter(C=>c(C,h)),x=()=>{if(d>0){process.stdout.write(`\x1B[${d}A`);for(let C=0;C<d;C++)process.stdout.write("\x1B[2K\x1B[1B");process.stdout.write(`\x1B[${d}A`);}},A=(C="active")=>{x();let I=[],w=f(),N=C==="active"?Jo:C==="cancel"?Xo:Yo;if(I.push(`${N} ${k__default.default.bold(e)}`),C==="active"){if(i&&i.items.length>0){I.push(`${ce}`);let ee=`${k__default.default.bold(i.title)} ${k__default.default.dim("\u2500\u2500 always included")}`;I.push(`${ce} ${bt}${bt} ${ee} ${bt.repeat(12)}`);for(let be of i.items)I.push(`${ce} ${er} ${k__default.default.bold(be.label)}`);i.hiddenCount&&i.hiddenCount>0&&I.push(`${ce} ${k__default.default.dim(`...and ${i.hiddenCount} more`)}`),I.push(`${ce}`),I.push(`${ce} ${bt}${bt} ${k__default.default.bold("Additional agents")} ${bt.repeat(29)}`);}let U=`${ce} ${k__default.default.dim("Search:")} ${h}${k__default.default.inverse(" ")}`;I.push(U),I.push(`${ce} ${k__default.default.dim("\u2191\u2193 move, space select, enter confirm")}`),I.push(`${ce}`);let M=Math.max(0,Math.min(u-Math.floor(n/2),w.length-n)),G=Math.min(w.length,M+n),de=w.slice(M,G);if(w.length===0)I.push(`${ce} ${k__default.default.dim("No matches found")}`);else {for(let ge=0;ge<de.length;ge++){let xe=de[ge],Fe=M+ge,Pt=m.has(xe.value),Ne=Fe===u,Ee=Pt?Zo:Qo,Bt=Ne?k__default.default.underline(xe.label):xe.label,$=xe.hint?k__default.default.dim(` (${xe.hint})`):"",_=Ne?k__default.default.cyan("\u276F"):" ";I.push(`${ce} ${_} ${Ee} ${Bt}${$}`);}let ee=M,be=w.length-G;if(ee>0||be>0){let ge=[];ee>0&&ge.push(`\u2191 ${ee} more`),be>0&&ge.push(`\u2193 ${be} more`),I.push(`${ce} ${k__default.default.dim(ge.join(" "))}`);}}I.push(`${ce}`);let te=[...i?i.items.map(ee=>ee.label):[],...s.filter(ee=>m.has(ee.value)).map(ee=>ee.label)];if(te.length===0)I.push(`${ce} ${k__default.default.dim("Selected: (none)")}`);else {let ee=te.length<=3?te.join(", "):`${te.slice(0,3).join(", ")} +${te.length-3} more`;I.push(`${ce} ${k__default.default.green("Selected:")} ${ee}`);}I.push(`${k__default.default.dim("\u2514")}`);}else if(C==="submit"){let U=[...i?i.items.map(M=>M.label):[],...s.filter(M=>m.has(M.value)).map(M=>M.label)];I.push(`${ce} ${k__default.default.dim(U.join(", "))}`);}else C==="cancel"&&I.push(`${ce} ${k__default.default.strikethrough(k__default.default.dim("Cancelled"))}`);process.stdout.write(I.join(`
|
|
24
|
-
`)+`
|
|
25
|
-
`),d=lr(I,process.stdout.columns);},S=()=>{process.stdin.removeListener("keypress",O),process.stdin.isTTY&&process.stdin.setRawMode(false),r.close();},E=()=>{o&&m.size===0&&p.length===0||(A("submit"),S(),a([...p,...Array.from(m)]));},T=()=>{A("cancel"),S(),a(tr);},O=(C,I)=>{if(!I)return;let w=f();if(I.name==="return"){E();return}if(I.name==="escape"||I.ctrl&&I.name==="c"){T();return}if(I.name==="up"){u=Math.max(0,u-1),A();return}if(I.name==="down"){u=Math.min(w.length-1,u+1),A();return}if(I.name==="space"){let N=w[u];N&&(m.has(N.value)?m.delete(N.value):m.add(N.value)),A();return}if(I.name==="backspace"){h=h.slice(0,-1),u=0,A();return}if(I.sequence&&!I.ctrl&&!I.meta&&I.sequence.length===1){h+=I.sequence,u=0,A();return}};process.stdin.on("keypress",O),A();})}var kl={version:"0.3.10"};var wl=t=>typeof t=="symbol",$l="eve agent";async function dr(t){let e=Jt(t);return e?Nt(e.owner,e.repo):false}function gr(t,e){return t.startsWith("git@")||t.startsWith("ssh://")?t:e}function Sl(t){qs(t);}function yl(t){switch(t){case "critical":return k__default.default.red(k__default.default.bold("Critical Risk"));case "high":return k__default.default.red("High Risk");case "medium":return k__default.default.yellow("Med Risk");case "low":return k__default.default.green("Low Risk");case "safe":return k__default.default.green("Safe");default:return k__default.default.dim("--")}}function pr(t){if(!t)return k__default.default.dim("--");let e=t.alerts??0;return e>0?k__default.default.red(`${e} alert${e!==1?"s":""}`):k__default.default.green("0 alerts")}function $t(t,e){let s=chunkXDSGBJHO_cjs.c(t),n=Math.max(0,e-s.length);return t+" ".repeat(n)}function mr(t,e,s){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),o=[],i=$t("",l+2)+$t(k__default.default.dim("Gen"),18)+$t(k__default.default.dim("Socket"),18)+k__default.default.dim("Snyk");o.push(i);for(let a of e){let r=t[a.slug],h=a.displayName.length>l?a.displayName.slice(0,l-1)+"\u2026":a.displayName,u=r?.ath?yl(r.ath.risk):k__default.default.dim("--"),m=r?.socket?pr(r.socket):k__default.default.dim("--"),d=r?.snyk?yl(r.snyk.risk):k__default.default.dim("--");o.push($t(k__default.default.cyan(h),l+2)+$t(u,18)+$t(m,18)+d);}return o.push(""),o.push(`${k__default.default.dim("Details:")} ${k__default.default.dim(`https://skills.sh/${s}`)}`),o}function St(t,e){let s=os$1.homedir();return t===s||t.startsWith(s+path.sep)?"~"+t.slice(s.length):t===e||t.startsWith(e+path.sep)?"."+t.slice(e.length):t}function fr(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 s=t.slice(0,e),n=t.length-e;return `${s.join(", ")} +${n} more`}function hr(t){let e=t.map(n=>k__default.default.cyan(ne(n))),s=pe(e,3);return chunkXDSGBJHO_cjs.c(s).length<=80?s:`${t.length} selected skills`}function kr(t){return `Detected an eve project. Install ${hr(t)} for your ${$l} to use?`}function on(t){let e=[],s=[];for(let n of t)we(n)?e.push(D[n].displayName):s.push(D[n].displayName);return {universal:e,symlinked:s}}function yr(t,e){let s=[],{universal:n,symlinked:l}=on(t);if(e==="symlink")n.length>0&&s.push(` ${k__default.default.green("universal:")} ${pe(n)}`),l.length>0&&s.push(` ${k__default.default.dim("symlink \u2192")} ${pe(l)}`);else {let o=t.map(i=>D[i].displayName);s.push(` ${k__default.default.dim("copy \u2192")} ${pe(o)}`);}return s}function ms(t){let e=D[t.agent].displayName;return t.subagent?`${e} (${t.subagent})`:e}function bl(t){return t.subagent?`${t.agent}:${t.subagent}`:t.agent}function br(t,e){let s=[];for(let n of t)if(n==="eve")for(let l of e)s.push({agent:n,subagent:l});else s.push({agent:n});return s}function wr(t,e){let s=[],n=t.filter(a=>!a.subagent).map(a=>a.agent),l=t.filter(a=>a.subagent).map(ms),{universal:o,symlinked:i}=on(n);if(e==="symlink")o.length>0&&s.push(` ${k__default.default.green("universal:")} ${pe(o)}`),i.length>0&&s.push(` ${k__default.default.dim("symlink \u2192")} ${pe(i)}`),l.length>0&&s.push(` ${k__default.default.dim("copy \u2192")} ${pe(l)}`);else {let a=t.map(ms);s.push(` ${k__default.default.dim("copy \u2192")} ${pe(a)}`);}return s}function nn(t){let e=Xe(),s=[...t];for(let n of e)s.includes(n)||s.push(n);return s}function vl(t,e){let s=[],{universal:n}=on(e),o=t.filter(a=>!a.symlinkFailed&&!a.skipped&&!n.includes(a.agent)).map(a=>a.agent),i=t.filter(a=>a.symlinkFailed&&!a.skipped).map(a=>a.agent);return n.length>0&&s.push(` ${k__default.default.green("universal:")} ${pe(n)}`),o.length>0&&s.push(` ${k__default.default.dim("symlinked:")} ${pe(o)}`),i.length>0&&s.push(` ${k__default.default.yellow("copied:")} ${pe(i)}`),s}function xl(t){return y__namespace.multiselect({...t,options:t.options,message:`${t.message} ${k__default.default.dim("(space to toggle)")}`})}async function Al(t,e){let s;try{s=await tn();}catch{}let n=e.map(r=>r.value),o=["claude-code","opencode","codex"].filter(r=>n.includes(r)),i=[];s&&s.length>0&&(i=s.filter(r=>n.includes(r))),i.length===0&&(i=o);let a=await wt({message:t,items:e,initialSelected:i,required:true});if(!wl(a))try{await sn(a);}catch{}return a}async function ln(t){let e=u=>!t.global||D[u].globalSkillsDir,s=Xe().filter(e),n=ts().filter(e),l=Ft().filter(u=>u!=="eve"&&e(u)),o={title:"Universal (.agents/skills)",items:n.map(u=>({value:u,label:D[u].displayName})),hiddenCount:s.length-n.length},i=l.map(u=>({value:u,label:D[u].displayName,hint:t.global?D[u].globalSkillsDir:D[u].skillsDir})),a;try{a=await tn();}catch{}let r=a?a.filter(u=>l.includes(u)&&!s.includes(u)):[],h=await wt({message:"Which agents do you want to install to?",items:i,initialSelected:r,lockedSection:o});if(!wl(h))try{await sn(h);}catch{}return h}var $r=kl.version;qs($r);async function Sr(t,e,s,n){n.start("Discovering skills from well-known endpoint...");let l=await yt.fetchAllSkills(e);l.length===0&&(n.stop(k__default.default.red("No skills found")),y__namespace.outro(k__default.default.red("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.")),process.exit(1)),n.stop(`Found ${k__default.default.green(l.length)} skill${l.length>1?"s":""}`);for(let w of l)y__namespace.log.info(`Skill: ${k__default.default.cyan(w.installName)}`),y__namespace.log.message(k__default.default.dim(w.description)),w.files.size>1&&y__namespace.log.message(k__default.default.dim(` Files: ${Array.from(w.files.keys()).join(", ")}`));if(s.list){console.log(),y__namespace.log.step(k__default.default.bold("Available Skills"));for(let w of l)y__namespace.log.message(` ${k__default.default.cyan(w.installName)}`),y__namespace.log.message(` ${k__default.default.dim(w.description)}`),w.files.size>1&&y__namespace.log.message(` ${k__default.default.dim(`Files: ${w.files.size}`)}`);console.log(),y__namespace.outro("Run without --list to install"),process.exit(0);}let o;if(s.skill?.includes("*"))o=l,y__namespace.log.info(`Installing all ${l.length} skills`);else if(s.skill&&s.skill.length>0){if(o=l.filter(w=>s.skill.some(N=>w.installName.toLowerCase()===N.toLowerCase()||w.name.toLowerCase()===N.toLowerCase())),o.length===0){y__namespace.log.error(`No matching skills found for: ${s.skill.join(", ")}`),y__namespace.log.info("Available skills:");for(let w of l)y__namespace.log.message(` - ${w.installName}`);process.exit(1);}}else if(l.length===1){o=l;let w=l[0];y__namespace.log.info(`Skill: ${k__default.default.cyan(w.installName)}`);}else if(s.yes)o=l,y__namespace.log.info(`Installing all ${l.length} skills`);else {let w=l.map(U=>({value:U,label:U.installName,hint:U.description.length>60?U.description.slice(0,57)+"...":U.description})),N=await xl({message:"Select skills to install",options:w,required:true});y__namespace.isCancel(N)&&(y__namespace.cancel("Installation cancelled"),process.exit(0)),o=N;}let i,a=Object.keys(D);if(s.agent?.includes("*"))i=a,y__namespace.log.info(`Installing to all ${i.length} agents`);else if(s.agent&&s.agent.length>0){let w=s.agent.filter(N=>!a.includes(N));w.length>0&&(y__namespace.log.error(`Invalid agents: ${w.join(", ")}`),y__namespace.log.info(`Valid agents: ${a.join(", ")}`),process.exit(1)),i=s.agent;}else {n.start("Loading agents...");let w=await Ge(),N=Object.keys(D).length;if(n.stop(`${N} agents`),w.length===0)if(s.yes)i=a,y__namespace.log.info("Installing to all agents");else {y__namespace.log.info("Select agents to install skills to");let U=Object.entries(D).map(([G,de])=>({value:G,label:de.displayName})),M=await Al("Which agents do you want to install to?",U);y__namespace.isCancel(M)&&(y__namespace.cancel("Installation cancelled"),process.exit(0)),i=M;}else if(w.length===1||s.yes)if(i=nn(w),w.length===1){let U=w[0];y__namespace.log.info(`Installing to: ${k__default.default.cyan(D[U].displayName)}`);}else y__namespace.log.info(`Installing to: ${w.map(U=>k__default.default.cyan(D[U].displayName)).join(", ")}`);else {let U=await ln({global:s.global});y__namespace.isCancel(U)&&(y__namespace.cancel("Installation cancelled"),process.exit(0)),i=U;}}let r=s.global??false,h=i.some(w=>D[w].globalSkillsDir!==void 0);if(s.global===void 0&&!s.yes&&h){let w=await y__namespace.select({message:"Installation scope",options:[{value:false,label:"Project",hint:"Install in current directory (committed with your project)"},{value:true,label:"Global",hint:"Install in home directory (available across all projects)"}]});y__namespace.isCancel(w)&&(y__namespace.cancel("Installation cancelled"),process.exit(0)),r=w;}let u=s.copy?"copy":"symlink",m=new Set(i.map(w=>D[w].skillsDir));if(!s.copy&&!s.yes&&m.size>1){let w=await y__namespace.select({message:"Installation method",options:[{value:"symlink",label:"Symlink (Recommended)",hint:"Single source of truth, easy updates"},{value:"copy",label:"Copy to all agents",hint:"Independent copies for each agent"}]});y__namespace.isCancel(w)&&(y__namespace.cancel("Installation cancelled"),process.exit(0)),u=w;}else m.size<=1&&(u="copy");let d=process.cwd(),p=[];i.map(w=>D[w].displayName);let f=await Promise.all(o.flatMap(w=>i.map(async N=>({skillName:w.installName,agent:N,installed:await os(w.installName,N,{global:r})})))),x=new Map;for(let{skillName:w,agent:N,installed:U}of f)x.has(w)||x.set(w,new Map),x.get(w).set(N,U);for(let w of o){p.length>0&&p.push("");let N=Ze(w.installName,{global:r}),U=St(N,d);p.push(`${k__default.default.cyan(U)}`),p.push(...yr(i,u)),w.files.size>1&&p.push(` ${k__default.default.dim("files:")} ${w.files.size}`);let M=x.get(w.installName),G=i.filter(de=>M?.get(de)).map(de=>D[de].displayName);G.length>0&&p.push(` ${k__default.default.yellow("overwrites:")} ${pe(G)}`);}if(console.log(),y__namespace.note(p.join(`
|
|
26
|
-
`),"Installation Summary"),!s.yes){let w=await y__namespace.confirm({message:"Proceed with installation?"});(y__namespace.isCancel(w)||!w)&&(y__namespace.cancel("Installation cancelled"),process.exit(0));}let A=yt.getSourceIdentifier(e),S=dr(A).catch(()=>null);n.start("Installing skills...");let E=[];for(let w of o)for(let N of i){let U=await ol(w,N,{global:r,mode:u});E.push({skill:w.installName,agent:D[N].displayName,...U});}n.stop("Installation complete"),console.log();let T=E.filter(w=>w.success),O=E.filter(w=>!w.success),C={};for(let w of o)C[w.installName]=w.sourceUrl;if(await S!==true&&ye({event:"install",source:A,skills:o.map(w=>w.installName).join(","),agents:i.join(","),...r&&{global:"1"},skillFiles:JSON.stringify(C),sourceType:"well-known"}),T.length>0&&r){let w=new Set(T.map(N=>N.skill));for(let N of o)if(w.has(N.installName))try{await en(N.installName,{source:A,sourceType:"well-known",sourceUrl:N.sourceUrl,skillFolderHash:""});}catch{}}if(T.length>0&&!r){let w=new Set(T.map(N=>N.skill));for(let N of o)if(w.has(N.installName))try{let U=T.find(G=>G.skill===N.installName),M=U?.canonicalPath||U?.path;if(M){let G=await ze(M);await Et(N.installName,{source:A,sourceType:"well-known",computedHash:G},d);}}catch{}}if(T.length>0){let w=new Map;for(let te of T){let ee=w.get(te.skill)||[];ee.push(te),w.set(te.skill,ee);}let N=w.size,U=T.filter(te=>te.mode==="symlink"&&te.symlinkFailed),M=U.map(te=>te.agent),G=[];for(let[te,ee]of w){let be=ee[0];if(be.mode==="copy"){G.push(`${k__default.default.green("\u2713")} ${te} ${k__default.default.dim("(copied)")}`);for(let ge of ee){let xe=St(ge.path,d);G.push(` ${k__default.default.dim("\u2192")} ${xe}`);}}else {if(be.canonicalPath){let ge=St(be.canonicalPath,d);G.push(`${k__default.default.green("\u2713")} ${ge}`);}else G.push(`${k__default.default.green("\u2713")} ${te}`);G.push(...vl(ee,i));}}let de=k__default.default.green(`Installed ${N} skill${N!==1?"s":""}`);y__namespace.note(G.join(`
|
|
27
|
-
`),de),U.length>0&&(y__namespace.log.warn(k__default.default.yellow(`Symlinks failed for: ${pe(M)}`)),y__namespace.log.message(k__default.default.dim(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(O.length>0){console.log(),y__namespace.log.error(k__default.default.red(`Failed to install ${O.length}`));for(let w of O)y__namespace.log.message(` ${k__default.default.red("\u2717")} ${w.skill} \u2192 ${w.agent}: ${k__default.default.dim(w.error)}`);}console.log(),y__namespace.outro(k__default.default.green("Done!")+k__default.default.dim(" Review skills before use; they run with full agent permissions.")),await Il(s,i);}async function rt(t,e={}){let s=t[0],n=false,l=()=>{n||(y__namespace.log.message(k__default.default.dim("Tip: use the --yes (-y) and --global (-g) flags to install without prompts.")),n=true);};s||(console.log(),console.log(k__default.default.bgRed(k__default.default.white(k__default.default.bold(" ERROR ")))+" "+k__default.default.red("Missing required argument: source")),console.log(),console.log(k__default.default.dim(" Usage:")),console.log(` ${k__default.default.cyan("easbot skills add")} ${k__default.default.yellow("<source>")} ${k__default.default.dim("[options]")}`),console.log(),console.log(k__default.default.dim(" Example:")),console.log(` ${k__default.default.cyan("easbot skills add")} ${k__default.default.yellow("houjallen/agent-skills")}`),console.log(),process.exit(1)),e.all&&(e.skill=["*"],e.agent=["*"],e.yes=true);let o=await Qe();if(o.isAgent&&(e.yes=true,!e.agent||e.agent.length===0)){let a=as(o.agent.name);a&&(e.agent=nn([a]));}console.log(),o.isAgent||y__namespace.intro(k__default.default.bgCyan(k__default.default.black(" skills "))),o.isAgent?y__namespace.log.info(k__default.default.bgCyan(k__default.default.black(k__default.default.bold(` ${o.agent.name} `)))+" Agent detected \u2014 installing non-interactively"):process.stdin.isTTY||l();let i=null;try{let a=y__namespace.spinner();a.start("Parsing source...");let r=dt(s);a.stop(`Source: ${r.type==="local"?r.localPath:r.url}${r.ref?` @ ${k__default.default.yellow(r.ref)}`:""}${r.subpath?` (${r.subpath})`:""}${r.skillFilter?` ${k__default.default.dim("@")}${k__default.default.cyan(r.skillFilter)}`:""}`);let h=Je(r),u=(()=>{if(!h)return Promise.resolve(null);let $=Jt(h);return $?Nt($.owner,$.repo).catch(()=>null):Promise.resolve(null)})();if(r.type==="well-known"){await Sr(s,r.url,e,a);return}r.skillFilter&&(e.skill=e.skill||[],e.skill.includes(r.skillFilter)||e.skill.push(r.skillFilter));let m=!!(e.skill&&e.skill.length>0),d,p=null;if(r.type==="local")a.start("Validating local path..."),fs$1.existsSync(r.localPath)||(a.stop(k__default.default.red("Path not found")),y__namespace.outro(k__default.default.red(`Local path does not exist: ${r.localPath}`)),process.exit(1)),a.stop("Local path validated"),a.start("Discovering skills..."),d=await Le(r.localPath,r.subpath,{includeInternal:m,fullDepth:e.fullDepth});else if(r.type==="github"&&!e.fullDepth){let $=["vercel","houjallen","heygen-com"],_=Je(r),j=_?.split("/")[0]?.toLowerCase(),R=!!_&&Object.hasOwn(chunkXDSGBJHO_cjs.f,_.toLowerCase());_&&j&&(R||$.includes(j))&&(a.start("Fetching skills..."),p=await chunkXDSGBJHO_cjs.l(_,{subpath:r.subpath,skillFilter:r.skillFilter,ref:r.ref,getToken:ot,includeInternal:m}),p||a.stop(k__default.default.dim("Falling back to clone..."))),p?(d=p.skills,a.stop(`Found ${k__default.default.green(d.length)} skill${d.length>1?"s":""}`)):(a.start("Cloning repository..."),i=await Ke(r.url,r.ref),a.stop("Repository cloned"),a.start("Discovering skills..."),d=await Le(i,r.subpath,{includeInternal:m,fullDepth:e.fullDepth}));}else a.start("Cloning repository..."),i=await Ke(r.url,r.ref),a.stop("Repository cloned"),a.start("Discovering skills..."),d=await Le(i,r.subpath,{includeInternal:m,fullDepth:e.fullDepth});if(d.length===0&&(a.stop(k__default.default.red("No skills found")),y__namespace.outro(k__default.default.red("No valid skills found. Skills require a SKILL.md with name and description.")),await he(i),process.exit(1)),p||a.stop(`Found ${k__default.default.green(d.length)} skill${d.length>1?"s":""}`),e.list){console.log(),y__namespace.log.step(k__default.default.bold("Available Skills"));let $={},_=[];for(let R of d)if(R.pluginName){let K=R.pluginName;$[K]||($[K]=[]),$[K].push(R);}else _.push(R);let j=Object.keys($).sort();for(let R of j){let K=R.split("-").map(z=>z.charAt(0).toUpperCase()+z.slice(1)).join(" ");console.log(k__default.default.bold(K));for(let z of $[R])y__namespace.log.message(` ${k__default.default.cyan(ne(z))}`),y__namespace.log.message(` ${k__default.default.dim(z.description)}`);console.log();}if(_.length>0){j.length>0&&console.log(k__default.default.bold("General"));for(let R of _)y__namespace.log.message(` ${k__default.default.cyan(ne(R))}`),y__namespace.log.message(` ${k__default.default.dim(R.description)}`);}console.log(),y__namespace.outro("Use --skill <name> to install specific skills"),await he(i),process.exit(0);}let c;if(e.skill?.includes("*"))c=d,y__namespace.log.info(`Installing all ${d.length} skills`);else if(e.skill&&e.skill.length>0){if(c=Qt(d,e.skill),c.length===0){y__namespace.log.error(`No matching skills found for: ${e.skill.join(", ")}`),y__namespace.log.info("Available skills:");for(let $ of d)y__namespace.log.message(` - ${ne($)}`);await he(i),process.exit(1);}y__namespace.log.info(`Selected ${c.length} skill${c.length!==1?"s":""}: ${c.map($=>k__default.default.cyan(ne($))).join(", ")}`);}else if(d.length===1){c=d;let $=d[0];y__namespace.log.info(`Skill: ${k__default.default.cyan(ne($))}`),y__namespace.log.message(k__default.default.dim($.description));}else if(e.yes)c=d,y__namespace.log.info(`Installing all ${d.length} skills`);else {let $=[...d].sort((R,K)=>R.pluginName&&!K.pluginName?-1:!R.pluginName&&K.pluginName?1:R.pluginName&&K.pluginName&&R.pluginName!==K.pluginName?R.pluginName.localeCompare(K.pluginName):ne(R).localeCompare(ne(K))),_=$.some(R=>R.pluginName),j;if(_){let R=z=>z.split("-").map(q=>q.charAt(0).toUpperCase()+q.slice(1)).join(" "),K={};for(let z of $){let q=z.pluginName?R(z.pluginName):"Other";K[q]||(K[q]=[]),K[q].push({value:z,label:ne(z),hint:z.description.length>60?z.description.slice(0,57)+"...":z.description});}j=await y__namespace.groupMultiselect({message:`Select skills to install ${k__default.default.dim("(space to toggle)")}`,options:K,required:!0});}else {let R=$.map(K=>({value:K,label:ne(K),hint:K.description.length>60?K.description.slice(0,57)+"...":K.description}));j=await xl({message:"Select skills to install",options:R,required:!0});}y__namespace.isCancel(j)&&(y__namespace.cancel("Installation cancelled"),await he(i),process.exit(0)),c=j;}let f=Je(r),x=f?cl(f,c.map($=>ne($))):Promise.resolve(null),A,S=Object.keys(D);if(e.agent?.includes("*"))A=S,y__namespace.log.info(`Installing to all ${A.length} agents`);else if(e.agent&&e.agent.length>0){let $=e.agent.filter(_=>!S.includes(_));$.length>0&&(y__namespace.log.error(`Invalid agents: ${$.join(", ")}`),y__namespace.log.info(`Valid agents: ${S.join(", ")}`),await he(i),process.exit(1)),A=e.agent;}else {a.start("Loading agents...");let $=await Ge(),_=Object.keys(D).length;if(a.stop(`${_} agents`),$.includes("eve")&&(e.yes||!o.isAgent)){let j=e.yes?!0:await y__namespace.confirm({message:kr(c),initialValue:!0});if(y__namespace.isCancel(j)&&(y__namespace.cancel("Installation cancelled"),await he(i),process.exit(0)),j)A=["eve"],y__namespace.log.info(`Installing to: ${k__default.default.cyan($l)}`);else {let R=await ln({global:e.global});y__namespace.isCancel(R)&&(y__namespace.cancel("Installation cancelled"),await he(i),process.exit(0)),A=R;}}else if($.length===0)if(e.yes)A=S,y__namespace.log.info("Installing to all agents");else {y__namespace.log.info("Select agents to install skills to");let j=Object.entries(D).filter(([K])=>K!=="eve").map(([K,z])=>({value:K,label:z.displayName})),R=await Al("Which agents do you want to install to?",j);y__namespace.isCancel(R)&&(y__namespace.cancel("Installation cancelled"),await he(i),process.exit(0)),A=R;}else if($.length===1||e.yes)if(A=nn($),$.length===1){let j=$[0];y__namespace.log.info(`Installing to: ${k__default.default.cyan(D[j].displayName)}`);}else y__namespace.log.info(`Installing to: ${$.map(j=>k__default.default.cyan(D[j].displayName)).join(", ")}`);else {let j=await ln({global:e.global});y__namespace.isCancel(j)&&(y__namespace.cancel("Installation cancelled"),await he(i),process.exit(0)),A=j;}}e.subagent&&e.subagent.length>0&&!A.includes("eve")&&(A=[...A,"eve"]);let E=[void 0];if(A.includes("eve")){let $=nt(process.cwd());if(e.subagent&&e.subagent.length>0)E=e.subagent.map(_=>_==="root"||_==="."?void 0:_);else if($.length>0&&!e.yes){let _=[{value:"",label:"Root agent",hint:"agent/skills"},...$.map(R=>({value:R,label:R,hint:`agent/subagents/${R}/skills`}))],j=await y__namespace.multiselect({message:"Where should Eve skills be installed?",options:_,initialValues:[""],required:!0});y__namespace.isCancel(j)&&(y__namespace.cancel("Installation cancelled"),await he(i),process.exit(0)),E=j.map(R=>R===""?void 0:R);}}let T=br(A,E),O=e.global??!1,C=A.some($=>D[$].globalSkillsDir!==void 0);if(e.global===void 0&&!e.yes&&C){let $=await y__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)"}]});y__namespace.isCancel($)&&(y__namespace.cancel("Installation cancelled"),await he(i),process.exit(0)),O=$;}let I=e.copy?"copy":"symlink",w=T.every($=>$.agent==="eve"),N=new Set(T.map($=>$.subagent?`eve:subagent:${$.subagent}`:D[$.agent].skillsDir));if(!e.copy&&!e.yes&&N.size>1&&!w){let $=await y__namespace.select({message:"Installation method",options:[{value:"symlink",label:"Symlink (Recommended)",hint:"Single source of truth, easy updates"},{value:"copy",label:"Copy to all agents",hint:"Independent copies for each agent"}]});y__namespace.isCancel($)&&(y__namespace.cancel("Installation cancelled"),await he(i),process.exit(0)),I=$;}else (N.size<=1||w)&&(I="copy");let U=process.cwd(),M=[],G=await Promise.all(c.flatMap($=>T.map(async _=>({skillName:$.name,target:_,installed:await os($.name,_.agent,{global:O,eveSubagent:_.subagent})})))),de=new Map;for(let{skillName:$,target:_,installed:j}of G)de.has($)||de.set($,new Map),de.get($).set(bl(_),j);let te={},ee=[];for(let $ of c)if($.pluginName){let _=$.pluginName;te[_]||(te[_]=[]),te[_].push($);}else ee.push($);let be=$=>{for(let _ of $){M.length>0&&M.push("");let j=T.length===1?Ze(_.name,{global:O,agent:T[0].agent,eveSubagent:T[0].subagent}):Ze(_.name,{global:O}),R=St(j,U);M.push(`${k__default.default.cyan(R)}`),M.push(...wr(T,I));let K=de.get(_.name),z=T.filter(q=>K?.get(bl(q))).map(ms);z.length>0&&M.push(` ${k__default.default.yellow("overwrites:")} ${pe(z)}`);}},ge=Object.keys(te).sort();for(let $ of ge){let _=$.split("-").map(j=>j.charAt(0).toUpperCase()+j.slice(1)).join(" ");M.push(""),M.push(k__default.default.bold(_)),be(te[$]);}ee.length>0&&(ge.length>0&&(M.push(""),M.push(k__default.default.bold("General"))),be(ee)),console.log(),y__namespace.note(M.join(`
|
|
28
|
-
`),"Installation Summary");try{let $=await x;if($&&f){let _=mr($,c.map(j=>({slug:ne(j),displayName:ne(j)})),f);_.length>0&&y__namespace.note(_.join(`
|
|
29
|
-
`),"Security Risk Assessments");}}catch{}if(!e.yes){let $=await y__namespace.confirm({message:"Proceed with installation?"});(y__namespace.isCancel($)||!$)&&(y__namespace.cancel("Installation cancelled"),await he(i),process.exit(0));}a.start("Installing skills...");let xe=[];for(let $ of c)for(let _ of T){let{agent:j,subagent:R}=_,K;if(p&&"files"in $){let z=$;K=await Hs({installName:z.name,files:z.files},j,{global:O,mode:I,eveSubagent:R});}else i&&$.path===i&&$.rawContent?K=await Hs({installName:$.name,files:[{path:"SKILL.md",contents:$.rawContent}]},j,{global:O,mode:I}):K=await is($,j,{global:O,mode:I,eveSubagent:R});xe.push({skill:ne($),agent:ms(_),pluginName:$.pluginName,...K});}a.stop("Installation complete"),console.log();let Fe=xe.filter($=>$.success),Pt=xe.filter($=>!$.success),Ne={};for(let $ of c)p&&"repoPath"in $?Ne[$.name]=$.repoPath:i&&$.path===i?Ne[$.name]="SKILL.md":i&&$.path.startsWith(i+path.sep)&&(Ne[$.name]=`${$.path.slice(i.length+1).split(path.sep).join("/")}/SKILL.md`);let Ee=Je(r),Bt=gr(r.url,Ee);if(Ee&&(Jt(Ee)?await u===!1&&ye({event:"install",source:Ee,skills:c.map(j=>j.name).join(","),agents:A.join(","),...O&&{global:"1"},skillFiles:JSON.stringify(Ne)}):ye({event:"install",source:Ee,skills:c.map(_=>_.name).join(","),agents:A.join(","),...O&&{global:"1"},skillFiles:JSON.stringify(Ne)})),Fe.length>0&&O&&Ee){let $=new Set(Fe.map(j=>j.skill)),_;r.type==="github"&&!p&&(_=await chunkXDSGBJHO_cjs.i(Ee,r.ref,ot));for(let j of c){let R=ne(j);if($.has(R))try{let K="",z=Ne[j.name];if(p&&z){let q=chunkXDSGBJHO_cjs.j(p.tree,z);q&&(K=q);}else if(r.type==="github"&&z&&_){let q=chunkXDSGBJHO_cjs.j(_,z);q&&(K=q);}else if(z&&i){let q=path.join(i,path.dirname(z)),Tt=await ze(q);Tt&&(K=Tt);}await en(j.name,{source:Bt||Ee,sourceType:r.type,sourceUrl:r.url,ref:r.ref,skillPath:z,skillFolderHash:K,pluginName:j.pluginName});}catch{}}}if(Fe.length>0&&!O){let $=new Set(Fe.map(R=>R.skill)),_=A.includes("eve")?E.map(R=>R??""):void 0,j=_&&(_.length>1||_.some(R=>R!==""));for(let R of c){let K=ne(R);if($.has(K))try{let z=p&&"snapshotHash"in R?R.snapshotHash:i&&R.path===i&&R.rawContent?fr(R.rawContent):await ze(R.path),q=Ne[R.name];await Et(R.name,{source:Bt||r.url,ref:r.ref,sourceType:r.type,...q&&{skillPath:q},computedHash:z,...j&&{subagents:_}},U);}catch{}}}if(Fe.length>0){let $=new Map,_={},j=[];for(let re of Fe){let Me=$.get(re.skill)||[];if(Me.push(re),$.set(re.skill,Me),Me.length===1)if(re.pluginName){let Ce=re.pluginName;_[Ce]||(_[Ce]=[]),_[Ce].push(re);}else j.push(re);}let R=$.size,K=Fe.filter(re=>re.mode==="symlink"&&re.symlinkFailed),z=K.map(re=>re.agent),q=[],Tt=re=>{for(let Me of re){let Ce=$.get(Me.skill)||[],xs=Ce[0];if(xs.mode==="copy"){q.push(`${k__default.default.green("\u2713")} ${Me.skill} ${k__default.default.dim("(copied)")}`);for(let As of Ce){let $i=St(As.path,U);q.push(` ${k__default.default.dim("\u2192")} ${$i}`);}}else {if(xs.canonicalPath){let As=St(xs.canonicalPath,U);q.push(`${k__default.default.green("\u2713")} ${As}`);}else q.push(`${k__default.default.green("\u2713")} ${Me.skill}`);q.push(...vl(Ce,A));}}},kn=Object.keys(_).sort();for(let re of kn){let Me=re.split("-").map(Ce=>Ce.charAt(0).toUpperCase()+Ce.slice(1)).join(" ");q.push(""),q.push(k__default.default.bold(Me)),Tt(_[re]);}j.length>0&&(kn.length>0&&(q.push(""),q.push(k__default.default.bold("General"))),Tt(j));let wi=k__default.default.green(`Installed ${R} skill${R!==1?"s":""}`);y__namespace.note(q.join(`
|
|
30
|
-
`),wi),K.length>0&&(y__namespace.log.warn(k__default.default.yellow(`Symlinks failed for: ${pe(z)}`)),y__namespace.log.message(k__default.default.dim(" Files were copied instead. On Windows, enable Developer Mode for symlink support.")));}if(Pt.length>0){console.log(),y__namespace.log.error(k__default.default.red(`Failed to install ${Pt.length}`));for(let $ of Pt)y__namespace.log.message(` ${k__default.default.red("\u2717")} ${$.skill} \u2192 ${$.agent}: ${k__default.default.dim($.error)}`);}console.log(),y__namespace.outro(k__default.default.green("Done!")+k__default.default.dim(" Review skills before use; they run with full agent permissions.")),await Il(e,A);}catch(a){if(a instanceof We){y__namespace.log.error(k__default.default.red("Failed to clone repository"));for(let r of a.message.split(`
|
|
31
|
-
`))y__namespace.log.message(k__default.default.dim(r));}else y__namespace.log.error(a instanceof Error?a.message:"Unknown error occurred");l(),y__namespace.outro(k__default.default.red("Installation failed")),process.exit(1);}finally{await he(i);}}async function he(t){if(t)try{await tt(t);}catch{}}async function Il(t,e){if(process.stdin.isTTY&&!t?.yes)try{if(await hl("findSkillsPrompt"))return;if(await os("find-skills","claude-code",{global:!0})){await Kt("findSkillsPrompt");return}console.log(),y__namespace.log.message(k__default.default.dim("One-time prompt - you won't be asked again if you dismiss."));let l=await y__namespace.confirm({message:`Install the ${k__default.default.cyan("find-skills")} skill? It helps your agent discover and suggest skills.`});if(y__namespace.isCancel(l)){await Kt("findSkillsPrompt");return}if(l){await Kt("findSkillsPrompt");let o=e?.filter(i=>i!=="replit");if(!o||o.length===0)return;console.log(),y__namespace.log.step("Installing find-skills skill...");try{await rt(["houjallen/skills"],{skill:["find-skills"],global:!0,yes:!0,agent:o});}catch{y__namespace.log.warn("Failed to install find-skills. You can try again with:"),y__namespace.log.message(k__default.default.dim(" easbot skills add houjallen/skills@find-skills -g -y --all"));}}else await Kt("findSkillsPrompt"),y__namespace.log.message(k__default.default.dim("You can install it later with: easbot skills add houjallen/skills@find-skills"));}catch{}}function fs(t){let e={},s=[];for(let n=0;n<t.length;n++){let l=t[n];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||[],n++;let o=t[n];for(;n<t.length&&o&&!o.startsWith("-");)e.agent.push(o),n++,o=t[n];n--;}else if(l==="-s"||l==="--skill"){e.skill=e.skill||[],n++;let o=t[n];for(;n<t.length&&o&&!o.startsWith("-");)e.skill.push(o),n++,o=t[n];n--;}else if(l==="--full-depth")e.fullDepth=true;else if(l==="--copy")e.copy=true;else if(l==="--subagent"){e.subagent=e.subagent||[],n++;let o=t[n];for(;n<t.length&&o&&!o.startsWith("-");)e.subagent.push(o),n++,o=t[n];n--;}else l&&!l.startsWith("-")&&s.push(l);}return {source:s,options:e}}var rn=utils.Log.create({service:"skills-find"}),X="\x1B[0m",hs="\x1B[1m",ue="\x1B[38;5;102m",vt="\x1B[38;5;145m",Pl="\x1B[36m";var xr=process.env.SKILLS_API_URL||"https://skills.sh";function Tl(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 Ar=/^[a-z0-9](?:[a-z0-9-]{0,38})$/i;function Ir(t){let e=[],s={},n=[];for(let l=0;l<t.length;l++){let o=t[l];if(!o)continue;let i;if(o==="--owner"){let r=t[l+1];if(!r||r.startsWith("-")){n.push("--owner requires a GitHub owner");continue}i=r,l++;}else if(o.startsWith("--owner=")){if(i=o.slice(8),!i){n.push("--owner requires a GitHub owner");continue}}else {e.push(o);continue}let a=i.trim().toLowerCase();if(!Ar.test(a)){n.push("--owner must be a valid GitHub owner");continue}s.owner=a;}return {query:e.join(" "),options:s,errors:n}}async function Dl(t,e){try{let s=new URLSearchParams({q:t,limit:"10"});e&&s.set("owner",e);let n=`${xr}/api/search?${s.toString()}`,l=await fetch(n);return l.ok?(await l.json()).skills.map(i=>({name:chunkXDSGBJHO_cjs.d(i.name),slug:chunkXDSGBJHO_cjs.d(i.id),source:chunkXDSGBJHO_cjs.d(i.source||""),installs:i.installs})).sort((i,a)=>(a.installs||0)-(i.installs||0)):[]}catch{return []}}var Lr="\x1B[?25l",Pr="\x1B[?25h",Tr="\x1B[J",Dr=t=>`\x1B[${t}A`,Nr=t=>`\x1B[${t}G`;async function Er(t="",e){let s=[],n=0,l=t,o=false,i=null,a=0;process.stdin.isTTY&&process.stdin.setRawMode(true),gs__namespace.emitKeypressEvents(process.stdin),process.stdin.resume(),process.stdout.write(Lr);function r(){a>0&&process.stdout.write(Dr(a)+Nr(1)),process.stdout.write(Tr);let u=[],m=`${hs}_${X}`;if(u.push(`${vt}Search skills:${X} ${l}${m}`),u.push(""),!l||l.length<2)u.push(`${ue}Start typing to search (min 2 chars)${X}`);else if(s.length===0&&o)u.push(`${ue}Searching...${X}`);else if(s.length===0)u.push(`${ue}No skills found${X}`);else {let p=s.slice(0,8);for(let c=0;c<p.length;c++){let f=p[c],x=c===n,A=x?`${hs}>${X}`:" ",S=x?`${hs}${f.name}${X}`:`${vt}${f.name}${X}`,E=f.source?` ${ue}${f.source}${X}`:"",T=Tl(f.installs),O=T?` ${Pl}${T}${X}`:"",C=o&&c===0?` ${ue}...${X}`:"";u.push(` ${A} ${S}${E}${O}${C}`);}}u.push(""),u.push(`${ue}up/down navigate | enter select | esc cancel${X}`);for(let d of u)process.stdout.write(d+`
|
|
32
|
-
`);a=u.length;}function h(u){if(i&&(clearTimeout(i),i=null),o=false,!u||u.length<2){s=[],n=0,r();return}o=true,r();let m=Math.max(150,350-u.length*50);i=setTimeout(async()=>{try{s=await Dl(u,e),n=0;}catch{s=[];}finally{o=false,i=null,r();}},m);}return t&&h(t),r(),new Promise(u=>{function m(){process.stdin.removeListener("keypress",d),process.stdin.isTTY&&process.stdin.setRawMode(false),process.stdout.write(Pr),process.stdin.pause();}function d(p,c){if(c){if(c.name==="escape"||c.ctrl&&c.name==="c"){m(),u(null);return}if(c.name==="return"){m(),u(s[n]||null);return}if(c.name==="up"){n=Math.max(0,n-1),r();return}if(c.name==="down"){n=Math.min(Math.max(0,s.length-1),n+1),r();return}if(c.name==="backspace"){l.length>0&&(l=l.slice(0,-1),h(l));return}if(c.sequence&&!c.ctrl&&!c.meta&&c.sequence.length===1){let f=c.sequence;f>=" "&&f<="~"&&(l+=f,h(l));}}}process.stdin.on("keypress",d);})}function Cr(t){let e=t.lastIndexOf("@"),n=(e>0?t.slice(0,e):t).match(/^([^/]+)\/([^/]+)$/);return n?{owner:n[1],repo:n[2]}:null}async function Rr(t,e){return await Nt(t,e)===false}async function Nl(t){let{query:e,options:s,errors:n}=Ir(t),l=s.owner,o=!process.stdin.isTTY;rn.debug("runFind enter",{args:t,query:e,owner:l,errors:n,isNonInteractive:o,stdinTTY:process.stdin.isTTY});let i=`${ue}Tip: if running in a coding agent, follow these steps:${X}
|
|
33
|
-
${ue} 1) easbot skills find [query] [--owner <owner>]${X}
|
|
34
|
-
${ue} 2) easbot skills add <owner/repo@skill>${X}`;if(n.length>0){for(let p of n)console.error(p);console.error("Usage: easbot skills find <query> [--owner <owner>]");return}if(e){rn.debug("runFind enter query branch",{query:e,owner:l});let p=await Dl(e,l);if(rn.debug("runFind searchSkillsAPI returned",{count:p.length}),ye({event:"find",query:e,resultCount:String(p.length)}),p.length===0){let c=l?` from owner "${l}"`:"";console.log(`${ue}No skills found for "${e}"${c}${X}`);return}console.log(`${ue}Install with${X} easbot skills add <owner/repo@skill>`),console.log();for(let c of p.slice(0,6)){let f=c.source||c.slug,x=Tl(c.installs);console.log(`${vt}${f}@${c.name}${X}${x?` ${Pl}${x}${X}`:""}`),console.log(`${ue}\u2514 https://skills.sh/${c.slug}${X}`),console.log();}return}if(o||await rs()){console.log(i),console.log(),console.log(`${ue}Usage: easbot skills find <query> [--owner <owner>]${X}`);return}let a=await Er("",l);if(ye({event:"find",query:"",resultCount:a?"1":"0",interactive:"1"}),!a){console.log(`${ue}Search cancelled${X}`),console.log();return}let r=a.source||a.slug,h=a.name;console.log(),console.log(`${vt}Installing ${hs}${h}${X} from ${ue}${r}${X}...`),console.log();let{source:u,options:m}=fs([r,"--skill",h]);await rt(u,m),console.log();let d=Cr(r);d&&await Rr(d.owner,d.repo)?console.log(`${ue}View the skill at${X} ${vt}https://skills.sh/${a.slug}${X}`):console.log(`${ue}Discover more skills at${X} ${vt}https://skills.sh${X}`),console.log();}var Cl=t=>typeof t=="symbol";function Rl(t,e){let s=os$1.homedir();return t===s||t.startsWith(s+path.sep)?"~"+t.slice(s.length):t===e||t.startsWith(e+path.sep)?"."+t.slice(e.length):t}async function Ur(t){let e=path.join(t,"node_modules"),s=[],n;try{n=await promises.readdir(e);}catch{return s}let l=async(o,i)=>{let a=await He(path.join(o,"SKILL.md"));if(a){s.push({...a,packageName:i});return}let r=[o,path.join(o,"skills"),path.join(o,".agents","skills")];for(let h of r)try{let u=await promises.readdir(h);for(let m of u){let d=path.join(h,m);try{if(!(await promises.stat(d)).isDirectory())continue}catch{continue}let p=await He(path.join(d,"SKILL.md"));p&&s.push({...p,packageName:i});}}catch{}};return await Promise.all(n.map(async o=>{if(o.startsWith("."))return;let i=path.join(e,o);try{if(!(await promises.stat(i)).isDirectory())return}catch{return}if(o.startsWith("@"))try{let a=await promises.readdir(i);await Promise.all(a.map(async r=>{let h=path.join(i,r);try{if(!(await promises.stat(h)).isDirectory())return}catch{return}await l(h,`${o}/${r}`);}));}catch{}else await l(i,o);})),s}async function ks(t,e={}){let s=process.cwd(),n=await Qe();if(n.isAgent&&(e.yes=true,!e.agent||e.agent.length===0)){let S=as(n.agent.name);if(S){let E=[S];for(let T of Xe())E.includes(T)||E.push(T);e.agent=E;}}console.log(),n.isAgent||y__namespace.intro(k__default.default.bgCyan(k__default.default.black(" skills experimental_sync "))),n.isAgent&&y__namespace.log.info(k__default.default.bgCyan(k__default.default.black(k__default.default.bold(` ${n.agent.name} `)))+" Agent detected \u2014 installing non-interactively");let l=y__namespace.spinner();l.start("Scanning node_modules for skills...");let o=await Ur(s);if(o.length===0){l.stop(k__default.default.yellow("No skills found")),y__namespace.outro(k__default.default.dim("No SKILL.md files found in node_modules."));return}l.stop(`Found ${k__default.default.green(String(o.length))} skill${o.length>1?"s":""} in node_modules`);for(let S of o)y__namespace.log.info(`${k__default.default.cyan(S.name)} ${k__default.default.dim(`from ${S.packageName}`)}`),S.description&&y__namespace.log.message(k__default.default.dim(` ${S.description}`));let i=await Ie(s),a=[],r=[];if(e.force)a.push(...o),y__namespace.log.info(k__default.default.dim("Force mode: reinstalling all skills"));else {for(let S of o){let E=i.skills[S.name];if(E&&await ze(S.path)===E.computedHash){r.push(S.name);continue}a.push(S);}if(r.length>0&&y__namespace.log.info(k__default.default.dim(`${r.length} skill${r.length!==1?"s":""} already up to date`)),a.length===0){console.log(),y__namespace.outro(k__default.default.green("All skills are up to date."));return}}y__namespace.log.info(`${a.length} skill${a.length!==1?"s":""} to install/update`);let h,u=Object.keys(D),m=Xe(),d=ts();if(e.agent?.includes("*"))h=u,y__namespace.log.info(`Installing to all ${h.length} agents`);else if(e.agent&&e.agent.length>0){let S=e.agent.filter(E=>!u.includes(E));S.length>0&&(y__namespace.log.error(`Invalid agents: ${S.join(", ")}`),y__namespace.log.info(`Valid agents: ${u.join(", ")}`),process.exit(1)),h=e.agent;}else {l.start("Loading agents...");let S=await Ge(),E=Object.keys(D).length;if(l.stop(`${E} agents`),S.length===0)if(e.yes)h=m,y__namespace.log.info("Installing to universal agents");else {let O=Ft().map(I=>({value:I,label:D[I].displayName,hint:D[I].skillsDir})),C=await wt({message:"Which agents do you want to install to?",items:O,initialSelected:[],lockedSection:{title:"Universal (.agents/skills)",items:d.map(I=>({value:I,label:D[I].displayName})),hiddenCount:m.length-d.length}});Cl(C)&&(y__namespace.cancel("Sync cancelled"),process.exit(0)),h=C;}else if(S.length===1||e.yes){h=[...S];for(let T of m)h.includes(T)||h.push(T);}else {let O=Ft().filter(I=>S.includes(I)).map(I=>({value:I,label:D[I].displayName,hint:D[I].skillsDir})),C=await wt({message:"Which agents do you want to install to?",items:O,initialSelected:S.filter(I=>!m.includes(I)),lockedSection:{title:"Universal (.agents/skills)",items:d.map(I=>({value:I,label:D[I].displayName})),hiddenCount:m.length-d.length}});Cl(C)&&(y__namespace.cancel("Sync cancelled"),process.exit(0)),h=C;}}let p=[];for(let S of a){let E=Ze(S.name,{global:false}),T=Rl(E,s);p.push(`${k__default.default.cyan(S.name)} ${k__default.default.dim(`\u2190 ${S.packageName}`)}`),p.push(` ${k__default.default.dim(T)}`);}if(console.log(),y__namespace.note(p.join(`
|
|
35
|
-
`),"Sync Summary"),!e.yes){let S=await y__namespace.confirm({message:"Proceed with sync?"});(y__namespace.isCancel(S)||!S)&&(y__namespace.cancel("Sync cancelled"),process.exit(0));}l.start("Syncing skills...");let c=[];for(let S of a)for(let E of h){let T=await is(S,E,{global:false,cwd:s,mode:"symlink"});c.push({skill:S.name,packageName:S.packageName,agent:D[E].displayName,success:T.success,path:T.path,canonicalPath:T.canonicalPath,error:T.error});}l.stop("Sync complete");let f=c.filter(S=>S.success),x=c.filter(S=>!S.success),A=new Set(f.map(S=>S.skill));for(let S of a)if(A.has(S.name))try{let E=await ze(S.path);await Et(S.name,{source:S.packageName,sourceType:"node_modules",computedHash:E},s);}catch{}if(console.log(),f.length>0){let S=new Map;for(let C of f){let I=S.get(C.skill)||[];I.push(C),S.set(C.skill,I);}let E=[];for(let[C,I]of S){let w=I[0],N=a.find(U=>U.name===C)?.packageName;if(w.canonicalPath){let U=Rl(w.canonicalPath,s);E.push(`${k__default.default.green("\u2713")} ${C} ${k__default.default.dim(`\u2190 ${N}`)}`),E.push(` ${k__default.default.dim(U)}`);}else E.push(`${k__default.default.green("\u2713")} ${C} ${k__default.default.dim(`\u2190 ${N}`)}`);}let T=S.size,O=k__default.default.green(`Synced ${T} skill${T!==1?"s":""}`);y__namespace.note(E.join(`
|
|
36
|
-
`),O);}if(x.length>0){console.log(),y__namespace.log.error(k__default.default.red(`Failed to install ${x.length}`));for(let S of x)y__namespace.log.message(` ${k__default.default.red("\u2717")} ${S.skill} \u2192 ${S.agent}: ${k__default.default.dim(S.error)}`);}ye({event:"experimental_sync",skillCount:String(a.length),successCount:String(A.size),agents:h.join(",")}),console.log(),y__namespace.outro(k__default.default.green("Done!")+k__default.default.dim(" Review skills before use; they run with full agent permissions."));}function ys(t){let e={};for(let s=0;s<t.length;s++){let n=t[s];if(n==="-y"||n==="--yes")e.yes=true;else if(n==="-f"||n==="--force")e.force=true;else if(n==="-a"||n==="--agent"){e.agent=e.agent||[],s++;let l=t[s];for(;s<t.length&&l&&!l.startsWith("-");)e.agent.push(l),s++,l=t[s];s--;}}return {options:e}}async function _l(t){let e=process.cwd(),s=await Ie(e),n=Object.entries(s.skills);if(n.length===0){y__namespace.log.warn("No project skills found in skills-lock.json"),y__namespace.log.info(`Add project-level skills with ${k__default.default.cyan("easbot skills add <package>")} (without ${k__default.default.cyan("-g")})`);return}let l=Xe(),o=[],i=new Map;for(let[r,h]of n){if(h.sourceType==="node_modules"){o.push(r);continue}let u=h.ref?`${h.source}#${h.ref}`:h.source,m=i.get(u);m?m.skills.push(r):i.set(u,{sourceType:h.sourceType,skills:[r]});}let a=n.length-o.length;a>0&&y__namespace.log.info(`Restoring ${k__default.default.cyan(String(a))} skill${a!==1?"s":""} from skills-lock.json into ${k__default.default.dim(".agents/skills/")}`);for(let[r,{skills:h}]of i)try{await rt([r],{skill:h,agent:l,yes:!0});}catch(u){y__namespace.log.error(`Failed to install from ${k__default.default.cyan(r)}: ${u instanceof Error?u.message:"Unknown error"}`);}if(o.length>0){y__namespace.log.info(`${k__default.default.cyan(String(o.length))} skill${o.length!==1?"s":""} from node_modules`);try{let{options:r}=ys(t);await ks(t,{...r,yes:!0,agent:l});}catch(r){y__namespace.log.error(`Failed to sync node_modules skills: ${r instanceof Error?r.message:"Unknown error"}`);}}}var Se="\x1B[0m",un="\x1B[1m",At="\x1B[38;5;102m";var Or="\x1B[36m",Ul="\x1B[33m";function bs(t,e){let s=os$1.homedir();return t.startsWith(s)?t.replace(s,"~"):t.startsWith(e)?"."+t.slice(e.length):t}function Fr(t,e=5){if(t.length<=e)return t.join(", ");let s=t.slice(0,e),n=t.length-e;return `${s.join(", ")} +${n} more`}function Mr(t){let e={};for(let s=0;s<t.length;s++){let n=t[s];if(n==="-g"||n==="--global")e.global=true;else if(n==="--json")e.json=true;else if(n==="-a"||n==="--agent")for(e.agent=e.agent||[];s+1<t.length&&!t[s+1].startsWith("-");)e.agent.push(t[++s]);}return e}async function jl(t){let e=Mr(t),s=e.global===true,n;if(e.agent&&e.agent.length>0){let d=Object.keys(D),p=e.agent.filter(c=>!d.includes(c));p.length>0&&(console.log(`${Ul}Invalid agents: ${p.join(", ")}${Se}`),console.log(`${At}Valid agents: ${d.join(", ")}${Se}`),process.exit(1)),n=e.agent;}let l=await rl({global:s,agentFilter:n});if(e.json){let d=l.map(p=>({name:p.name,path:p.canonicalPath,scope:p.scope,agents:p.agents.map(c=>D[c].displayName)}));console.log(JSON.stringify(d,null,2));return}let o=await fl(),i=process.cwd(),a=s?"Global":"Project";if(l.length===0){if(e.json){console.log("[]");return}console.log(`${At}No ${a.toLowerCase()} skills found.${Se}`),console.log(s?`${At}Try listing project skills without -g${Se}`:`${At}Try listing global skills with -g${Se}`);return}function r(d,p=false,c=0,f=0){let x=p?" ":"",A=bs(d.canonicalPath,i),S=d.agents.map(C=>D[C].displayName),E=d.agents.length>0?Fr(S):`${Ul}not linked${Se}`,T=chunkXDSGBJHO_cjs.d(d.name).padEnd(c),O=A.padEnd(f);console.log(`${x}${Or}${T}${Se} ${At}${O}${Se} ${At}Agents:${Se} ${E}`);}console.log(`${un}${a} Skills${Se}`),console.log();let h={},u=[];for(let d of l){let p=o[d.name];if(p?.pluginName){let c=p.pluginName;h[c]||(h[c]=[]),h[c].push(d);}else u.push(d);}if(Object.keys(h).length>0){let d=Object.keys(h).sort();for(let p of d){let c=p.split("-").map(x=>x.charAt(0).toUpperCase()+x.slice(1)).join(" ");console.log(`${un}${c}${Se}`);let f=h[p];if(f){let x=0,A=0;for(let S of f){let E=chunkXDSGBJHO_cjs.d(S.name).length,T=bs(S.canonicalPath,i).length;E>x&&(x=E),T>A&&(A=T);}for(let S of f)r(S,true,x,A);}console.log();}if(u.length>0){console.log(`${un}General${Se}`);let p=0,c=0;for(let f of u){let x=chunkXDSGBJHO_cjs.d(f.name).length,A=bs(f.canonicalPath,i).length;x>p&&(p=x),A>c&&(c=A);}for(let f of u)r(f,true,p,c);console.log();}}else {let d=0,p=0;for(let c of l){let f=chunkXDSGBJHO_cjs.d(c.name).length,x=bs(c.canonicalPath,i).length;f>d&&(d=f),x>p&&(p=x);}for(let c of l)r(c,false,d,p);console.log();}}async function $s(t,e){let s=await Qe();s.isAgent&&(e.yes=true,y__namespace.log.info(k__default.default.bgCyan(k__default.default.black(k__default.default.bold(` ${s.agent.name} `)))+" Agent detected \u2014 removing non-interactively"));let n=e.global??false,l=process.cwd(),o=y__namespace.spinner();o.start("Scanning for installed skills...");let i=new Set,a=async c=>{try{let f=await promises.readdir(c,{withFileTypes:!0});for(let x of f)x.isDirectory()&&i.add(x.name);}catch(f){f instanceof Error&&f.code!=="ENOENT"&&y__namespace.log.warn(`Could not scan directory ${c}: ${f.message}`);}};if(n){await a(Ue(true,l));for(let c of Object.values(D))c.globalSkillsDir!==void 0&&await a(c.globalSkillsDir);}else {await a(Ue(false,l));for(let c of Object.values(D))await a(path.join(l,c.skillsDir));for(let c of nt(l))await a(ht(c,l));}let r=Array.from(i).sort();if(o.stop(`Found ${r.length} unique installed skill(s)`),r.length===0){y__namespace.outro(k__default.default.yellow("No skills found to remove."));return}if(e.agent&&e.agent.length>0){let c=Object.keys(D),f=e.agent.filter(x=>!c.includes(x));f.length>0&&(y__namespace.log.error(`Invalid agents: ${f.join(", ")}`),y__namespace.log.info(`Valid agents: ${c.join(", ")}`),process.exit(1));}let h=[];if(e.all)h=r;else if(t.length>0){if(h=r.filter(c=>t.some(f=>f.toLowerCase()===c.toLowerCase())),h.length===0){y__namespace.log.error(`No matching skills found for: ${t.join(", ")}`);return}}else {let c=r.map(x=>({value:x,label:x})),f=await y__namespace.multiselect({message:`Select skills to remove ${k__default.default.dim("(space to toggle)")}`,options:c,required:true});y__namespace.isCancel(f)&&(y__namespace.cancel("Removal cancelled"),process.exit(0)),h=f;}let u;if(e.agent&&e.agent.length>0?u=e.agent:(u=Object.keys(D),o.stop(`Targeting ${u.length} potential agent(s)`)),!e.yes){console.log(),y__namespace.log.info("Skills to remove:");for(let f of h)y__namespace.log.message(` ${k__default.default.red("\u2022")} ${f}`);console.log();let c=await y__namespace.confirm({message:`Are you sure you want to uninstall ${h.length} skill(s)?`});(y__namespace.isCancel(c)||!c)&&(y__namespace.cancel("Removal cancelled"),process.exit(0));}o.start("Removing skills...");let m=[];for(let c of h)try{let f=Ze(c,{global:n,cwd:l});for(let C of u){let I=D[C],w=zs(c,C,{global:n,cwd:l}),N=new Set([w]),U=fe(c);if(n&&I.globalSkillsDir)N.add(path.join(I.globalSkillsDir,U));else if(N.add(path.join(l,I.skillsDir,U)),C==="eve")for(let M of nt(l))N.add(path.join(ht(M,l),U));for(let M of N)if(M!==f)try{await promises.lstat(M).catch(()=>null)&&await promises.rm(M,{recursive:!0,force:!0});}catch(G){y__namespace.log.warn(`Could not remove skill from ${I.displayName}: ${G instanceof Error?G.message:String(G)}`);}}let A=(await Ge()).filter(C=>!u.includes(C)),S=!1;for(let C of A){let I=zs(c,C,{global:n,cwd:l});if(await promises.lstat(I).catch(()=>null)){S=!0;break}}S||await promises.rm(f,{recursive:!0,force:!0});let E=n?await ml(c):null,T=E?.source||"local",O=E?.sourceType||"local";n&&await pl(c),m.push({skill:c,success:!0,source:T,sourceType:O});}catch(f){m.push({skill:c,success:false,error:f instanceof Error?f.message:String(f)});}o.stop("Removal process complete");let d=m.filter(c=>c.success),p=m.filter(c=>!c.success);if(d.length>0){let c=new Map;for(let f of d){let x=f.source||"local",A=c.get(x)||{skills:[]};A.skills.push(f.skill),A.sourceType=f.sourceType,c.set(x,A);}for(let[f,x]of c)ye({event:"remove",source:f,skills:x.skills.join(","),agents:u.join(","),...n&&{global:"1"},sourceType:x.sourceType});}if(d.length>0&&y__namespace.log.success(k__default.default.green(`Successfully removed ${d.length} skill(s)`)),p.length>0){y__namespace.log.error(k__default.default.red(`Failed to remove ${p.length} skill(s)`));for(let c of p)y__namespace.log.message(` ${k__default.default.red("\u2717")} ${c.skill}: ${c.error}`);}console.log(),y__namespace.outro(k__default.default.green("Done!"));}function Ml(t){let e={},s=[];for(let n=0;n<t.length;n++){let l=t[n];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||[],n++;let o=t[n];for(;n<t.length&&o&&!o.startsWith("-");)e.agent.push(o),n++,o=t[n];n--;}else l&&!l.startsWith("-")&&s.push(l);}return {skills:s,options:e}}function It(t,e){return e?`${t}#${e}`:t}function Kr(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 zr(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 Hr(t,e,s){if(!zr(t))return It(t,s);let n=Kr(e),l=n?`${t}/${n}`:t;return s?`${l}#${s}`:l}function Wl(t){return t.skillPath?Hr(t.source,t.skillPath,t.ref):It(t.sourceUrl,t.ref)}var Jl=path.dirname(url.fileURLToPath(chunkXDSGBJHO_cjs.b)),W="\x1B[0m",Kl="\x1B[1m",Q="\x1B[38;5;102m",ie="\x1B[38;5;145m";function Vr(t){let e={},s=[];for(let n of t)n==="-g"||n==="--global"?e.global=true:n==="-p"||n==="--project"?e.project=true:n==="-y"||n==="--yes"?e.yes=true:n.startsWith("-")||s.push(n);return s.length>0&&(e.skills=s),e}function qr(t){let e=t||process.cwd(),s=path.join(e,"skills-lock.json");if(fs$1.existsSync(s))return true;let n=path.join(e,".agents","skills");try{let l=fs$1.readdirSync(n,{withFileTypes:!0});for(let o of l)if(o.isDirectory()){let i=path.join(n,o.name,"SKILL.md");if(fs$1.existsSync(i))return !0}}catch{}return false}async function Jr(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 qr()?"project":"global";let e=await y__namespace.select({message:"Update scope",options:[{value:"project",label:"Project",hint:"Update skills in current directory"},{value:"global",label:"Global",hint:"Update skills in home directory"},{value:"both",label:"Both",hint:"Update all skills"}]});return y__namespace.isCancel(e)&&(y__namespace.cancel("Cancelled"),process.exit(0)),e}function Xl(t,e){if(!e||e.length===0)return true;let s=t.toLowerCase();return e.some(n=>n.toLowerCase()===s)}function Xr(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 Yr(t){let e=t.sourceUrl;if(t.sourceType==="well-known"){let s=e.indexOf("/.well-known/");s!==-1&&(e=e.slice(0,s));}return It(e,t.ref)}function zl(t){if(t.length===0)return;console.log(),console.log(`${Q}${t.length} skill(s) cannot be checked automatically:${W}`);let e=new Map;for(let s of t){let n=Yr(s),l=e.get(n)||[];l.push(s),e.set(n,l);}for(let[s,n]of e){if(n.length===1){let l=n[0];console.log(` ${ie}\u2022${W} ${chunkXDSGBJHO_cjs.d(l.name)} ${Q}(${l.reason})${W}`);}else {let l=n[0].reason,o=n.map(i=>chunkXDSGBJHO_cjs.d(i.name)).join(", ");console.log(` ${ie}\u2022${W} ${o} ${Q}(${l})${W}`);}console.log(` ${Q}To update: ${ie}easbot skills add ${s} -g -y${W}`);}}async function Zr(t){let e=await Ie(),s=[];for(let[n,l]of Object.entries(e.skills))Xl(n,t)&&(l.sourceType==="node_modules"||l.sourceType==="local"||s.push({name:n,source:l.source,entry:l}));return s}async function dn(t,e,s,n,l,o){let i=e.filter(a=>{let r=s[a];return r?.skillPath?!o.includes(r.skillPath):false});if(i.length>0){console.log(),console.log(`${Q}Warning:${W} The following skills from ${Q}${t}${W} appear to have been deleted upstream:`);for(let r of i)console.log(` ${Q}\u2022${W} ${r}`);if(l.yes||!process.stdin.isTTY)console.log(`${Q}Skipping deletion in non-interactive mode.${W}`);else {let r=await y__namespace.confirm({message:"Would you like to remove the local copies of these deleted skills?"});if(r&&!y__namespace.isCancel(r))for(let h of i)console.log(`${Q}Removing${W} ${h}...`),await $s([h],{yes:true,global:n});}}return i}async function Qr(t={}){let e=await De(),s=Object.keys(e.skills),n=0,l=0;if(s.length===0)return t.skills||(console.log(`${Q}No global skills tracked in lock file.${W}`),console.log(`${Q}Install skills with${W} ${ie}easbot skills add <package> -g${W}`)),{successCount:n,failCount:l,checkedCount:0};let o=[],i=[],a=[];for(let u of s){if(!Xl(u,t.skills))continue;let m=e.skills[u];if(m){if(!m.skillFolderHash||!m.skillPath){i.push({name:u,reason:Xr(m),sourceUrl:m.sourceUrl,sourceType:m.sourceType,ref:m.ref});continue}a.push({name:u,entry:m});}}let r=new Map;for(let u of a){let m=u.entry.source,d=r.get(m)||[];d.push(u),r.set(m,d);}for(let[u,m]of r){let d=m[0].entry,p=d.sourceUrl||d.source,c=null;process.stdout.write(`\r${Q}Checking skills from source: ${u}${W}\x1B[K
|
|
37
|
-
`);try{if(d.sourceType==="github"){let T=await chunkXDSGBJHO_cjs.i(u,d.ref,ot);if(!T){console.log(` ${Q}\u2717 Failed to fetch tree for ${u}${W}`);continue}let O=chunkXDSGBJHO_cjs.k(T),C=Object.entries(e.skills).filter(([N,U])=>U.source===u).map(([N,U])=>N),I=await dn(u,C,e.skills,!0,t,O),w=new Set(I);for(let{name:N,entry:U}of m){if(w.has(N))continue;let M=chunkXDSGBJHO_cjs.j(T,U.skillPath);M&&M!==U.skillFolderHash&&o.push({name:N,source:u,entry:U});}continue}c=await Ke(p,d.ref);let x=(await Le(c)).map(T=>path.join(path.relative(c,T.path),"SKILL.md").split(path.sep).join("/")),A=Object.entries(e.skills).filter(([T,O])=>O.source===u).map(([T,O])=>T),S=await dn(u,A,e.skills,!0,t,x),E=new Set(S);for(let{name:T,entry:O}of m){if(E.has(T))continue;let C=O.skillPath;if(!x.includes(C))continue;let I=await ze(path.join(c,path.dirname(C)));I&&I!==O.skillFolderHash&&o.push({name:T,source:u,entry:O});}}catch{console.log(` ${Q}\u2717 Failed to check skills from ${u}${W}`);}finally{c&&await tt(c);}}a.length>0&&process.stdout.write("\r\x1B[K");let h=a.length+i.length;if(a.length===0&&i.length===0)return t.skills||console.log(`${Q}No global skills to check.${W}`),{successCount:n,failCount:l,checkedCount:0};if(a.length===0&&i.length>0)return zl(i),{successCount:n,failCount:l,checkedCount:h};if(o.length===0)return console.log(`${ie}\u2713 All global skills are up to date${W}`),{successCount:n,failCount:l,checkedCount:h};console.log(`${ie}Found ${o.length} global update(s)${W}`),console.log();for(let u of o){let m=chunkXDSGBJHO_cjs.d(u.name);console.log(`${ie}Updating ${m}...${W}`);let d=Wl(u.entry),p=path.join(Jl,"..","bin","cli.mjs");if(!fs$1.existsSync(p)){l++,console.log(` ${Q}\u2717 Failed to update ${m}: CLI entrypoint not found at ${p}${W}`);continue}child_process.spawnSync(process.execPath,[p,"add",d,"-g","-y"],{stdio:["inherit","pipe","pipe"],encoding:"utf-8",shell:process.platform==="win32"}).status===0?(n++,console.log(` ${ie}\u2713${W} Updated ${m}`)):(l++,console.log(` ${Q}\u2717 Failed to update ${m}${W}`));}return zl(i),{successCount:n,failCount:l,checkedCount:h}}async function ea(t={}){let e=await Zr(t.skills),s=0,n=0;if(e.length===0)return t.skills||(console.log(`${Q}No project skills to update.${W}`),console.log(`${Q}Install project skills with${W} ${ie}easbot skills add <package>${W}`)),{successCount:s,failCount:n,foundCount:0};let l=e.filter(p=>p.entry.skillPath),o=e.filter(p=>!p.entry.skillPath);if(l.length===0)return console.log(`${Q}No project skills can be updated in place.${W}`),Hl(o),{successCount:s,failCount:n,foundCount:e.length};let i=process.cwd(),a=[],r=false;for(let[p,c]of Object.entries(D))if(we(p))!r&&fs$1.existsSync(path.join(i,".agents"))&&(r=true);else {let f=c.skillsDir.split("/")[0];fs$1.existsSync(path.join(i,f))&&a.push(c.displayName);}let h=[];r&&h.push("Universal"),h.push(...a),h.length>0&&console.log(`${ie}Updating for: ${h.join(", ")}${W}`),console.log(`${ie}Refreshing ${l.length} skill(s)...${W}`),console.log();let u=new Map;for(let p of l){let c=p.entry.source,f=u.get(c)||[];f.push(p),u.set(c,f);}let m=await Ie(),d=path.join(Jl,"..","bin","cli.mjs");if(!fs$1.existsSync(d))return console.log(`${Q}\u2717 CLI entrypoint not found at ${d}${W}`),{successCount:s,failCount:l.length,foundCount:e.length};for(let[p,c]of u){let f=c[0].entry,x=f.source,A=f.ref,S=Object.entries(m.skills).filter(([C,I])=>I.source===p).map(([C,I])=>C),E=null,T=[];try{E=await Ke(x,A);let I=(await Le(E)).map(w=>{let N=path.relative(E,w.path);return path.join(N,"SKILL.md").split(path.sep).join("/")});T=await dn(p,S,m.skills,!1,t,I);}catch{console.log(`${Q}\u2717 Failed to check for deleted skills from ${p}${W}`);}finally{E&&await tt(E);}let O=c.filter(C=>!T.includes(C.name));for(let C of O){let I=chunkXDSGBJHO_cjs.d(C.name);console.log(`${ie}Updating ${I}...${W}`);let w=It(C.entry.source,C.entry.ref),N=C.entry.subagents,U=N&&N.length>0?["--subagent",...N.map(G=>G===""?"root":G)]:[];child_process.spawnSync(process.execPath,[d,"add",w,"--skill",C.name,...U,"-y"],{stdio:["inherit","pipe","pipe"],encoding:"utf-8",shell:process.platform==="win32"}).status===0?(s++,console.log(` ${ie}\u2713${W} Updated ${I}`)):(n++,console.log(` ${Q}\u2717 Failed to update ${I}${W}`));}}return Hl(o),{successCount:s,failCount:n,foundCount:e.length}}function Hl(t){if(t.length!==0){console.log(),console.log(`${Q}${t.length} project skill(s) cannot be updated automatically (installed before skillPath tracking):${W}`);for(let e of t){let s=It(e.entry.source,e.entry.ref);console.log(` ${ie}\u2022${W} ${chunkXDSGBJHO_cjs.d(e.name)}`),console.log(` ${Q}To refresh: ${ie}easbot skills add ${s} -y${W}`);}}}async function Yl(t=[]){let e=Vr(t),s=await Jr(e);e.skills?console.log(`${ie}Updating ${e.skills.join(", ")}...${W}`):console.log(`${ie}Checking for skill updates...${W}`),console.log();let n=0,l=0,o=0;if(s==="global"||s==="both"){s==="both"&&!e.skills&&console.log(`${Kl}Global Skills${W}`);let{successCount:i,failCount:a,checkedCount:r}=await Qr(e);n+=i,l+=a,o+=r,s==="both"&&!e.skills&&console.log();}if(s==="project"||s==="both"){s==="both"&&!e.skills&&console.log(`${Kl}Project Skills${W}`);let{successCount:i,failCount:a,foundCount:r}=await ea(e);n+=i,l+=a,o+=r;}e.skills&&o===0&&console.log(`${Q}No installed skills found matching: ${e.skills.join(", ")}${W}`),console.log(),n>0&&console.log(`${ie}\u2713 Updated ${n} skill(s)${W}`),l>0&&console.log(`${Q}Failed to update ${l} skill(s)${W}`),ye({event:"update",scope:s,skillCount:String(n+l),successCount:String(n),failCount:String(l)}),console.log();}var ca=["vercel","houjallen","heygen-com"],ua=new Set(["metadata.json"]),da=new Set([".git","__pycache__","__pypackages__"]),pn={"claude-code":{command:"claude",args:[]},codex:{command:"codex",args:[]}},ii=Object.keys(pn);function oi(t){let e=[],s={},n=[];for(let l=0;l<t.length;l++){let o=t[l];if(o)if(o==="--help"||o==="-h")s.help=true;else if(o==="--full-depth")s.fullDepth=true;else if(o==="--dangerously-accept-openclaw-risks")s.dangerouslyAcceptOpenclawRisks=true;else if(o==="--skill"||o==="-s"){let i=t[l+1];!i||i.startsWith("-")?n.push(`${o} requires a skill name`):s.skill?(n.push("Only one --skill value can be provided"),l++):(s.skill=i,l++);}else if(o==="--agent"||o==="-a"){s.agent=s.agent||[],l++;let i=t[l],a=s.agent.length;for(;l<t.length&&i&&!i.startsWith("-");)s.agent.push(i),l++,i=t[l];s.agent.length===a&&n.push(`${o} requires an agent name`),l--;}else o.startsWith("-")?n.push(`Unknown option: ${o}`):e.push(o);}return n.push(...ba(s.agent)),{source:e,options:s,errors:n}}function ga(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>
|
|
38
|
-
${t.skillMd}
|
|
39
|
-
</SKILL.md>`];return t.hasSupportingFiles&&t.supportDir&&e.push(`Supporting files for this skill were downloaded to:
|
|
40
|
-
${t.supportDir}
|
|
41
|
-
|
|
42
|
-
When the SKILL.md references relative paths, read them from that directory.`),e.join(`
|
|
43
|
-
|
|
44
|
-
`)+`
|
|
45
|
-
`}async function pa(t){let e=await promises.mkdtemp(path.join(os$1.tmpdir(),"skills-use-")),s=path.join(e,fe(t.directoryName||t.name));if(!mn(e,s))throw new Error("Invalid skill name: potential path traversal detected");await promises.mkdir(s,{recursive:true}),t.kind==="blob"?await wa(s,t.files):t.kind==="well-known"?await $a(s,t.files):await gi(t.path,s);let n=t.rawContent??await promises.readFile(path.join(s,"SKILL.md"),"utf-8"),l=await pi(s,s);return {tempRoot:e,skillDir:s,skillMd:n,hasSupportingFiles:l}}async function ri(t,e={},s=[]){let n=null;try{if(e.help){console.log(ti());return}s.length>0&&Ve(s.join(`
|
|
46
|
-
`)),t.length===0&&Ve(`Missing required argument: source
|
|
47
|
-
|
|
48
|
-
${ti()}`),t.length>1&&Ve(`Expected one source, received ${t.length}: ${t.join(", ")}`);let l=e.agent?.[0];l&&!pn[l]&&Ve(ui(l));let o=t[0],i=dt(o);Je(i)?.split("/")[0]?.toLowerCase()==="openclaw"&&!e.dangerouslyAcceptOpenclawRisks&&Ve(["OpenClaw skills are unverified community submissions.","Skills run with full agent permissions and could be malicious.",`If you understand the risks, re-run with: skills use ${o} --dangerously-accept-openclaw-risks`].join(`
|
|
49
|
-
`));let h=ha(i.skillFilter,e.skill),u=h!==void 0,m;if(i.type==="well-known"){let c=await yt.fetchAllSkills(i.url);m=ya(c,h,o);}else {let c,f=null;if(i.type==="local")fs$1.existsSync(i.localPath)||Ve(`Local path does not exist: ${i.localPath}`),c=await Le(i.localPath,i.subpath,{includeInternal:u,fullDepth:e.fullDepth});else if(i.type==="github"&&!e.fullDepth){let A=Je(i),S=A?.split("/")[0]?.toLowerCase();A&&S&&ca.includes(S)&&(f=await chunkXDSGBJHO_cjs.l(A,{subpath:i.subpath,skillFilter:h,ref:i.ref,getToken:ot,includeInternal:u})),f?c=f.skills:(n=await Ke(i.url,i.ref),c=await Le(n,i.subpath,{includeInternal:u,fullDepth:e.fullDepth}));}else n=await Ke(i.url,i.ref),c=await Le(n,i.subpath,{includeInternal:u,fullDepth:e.fullDepth});let x=ka(c,h,o);f&&Sa(x)?m={kind:"blob",name:x.name,directoryName:x.name,rawContent:x.rawContent??va(x.files),files:x.files}:m={kind:"disk",name:x.name,directoryName:x.name,rawContent:x.rawContent,path:x.path};}let d=await pa(m);await si(n),n=null;let p=ga({skillMd:d.skillMd,supportDir:d.skillDir,hasSupportingFiles:d.hasSupportingFiles});if(l){let c=await ma(l,p);c!==0&&process.exit(c);return}process.stdout.write(p);}catch(l){await si(n),l instanceof We&&Ve(l.message),l instanceof ke&&Ve(l.message),Ve(l instanceof Error?l.message:"Unknown error");}}async function ma(t,e,s=fa){let n=pn[t];if(!n)throw new ke(ui(t));return new Promise((l,o)=>{let i=s(n.command,[...n.args,e],{stdio:"inherit"}),a=false;i.on("error",r=>{if(!a){if(a=true,r.code==="ENOENT"){o(new ke(`Could not launch ${D[t].displayName}: command not found: ${n.command}`));return}o(r);}}),i.on("close",r=>{a||(a=true,l(r??1));});})}function fa(t,e){return child_process.spawn(t,e,{stdio:"inherit"})}function ti(){return `Usage: skills use <source>[@<skill>] [options]
|
|
50
|
-
|
|
51
|
-
Generate a prompt for using one skill without installing it.
|
|
52
|
-
|
|
53
|
-
Options:
|
|
54
|
-
-s, --skill <skill> Select the skill to use
|
|
55
|
-
-a, --agent <agent> Start one supported agent interactively (${ii.join(", ")})
|
|
56
|
-
--full-depth Search nested directories like skills add --full-depth
|
|
57
|
-
--dangerously-accept-openclaw-risks
|
|
58
|
-
Allow unverified OpenClaw community skills
|
|
59
|
-
-h, --help Show this help message
|
|
60
|
-
|
|
61
|
-
Examples:
|
|
62
|
-
skills use houjallen/agent-skills@web-design-guidelines | claude
|
|
63
|
-
skills use houjallen/agent-skills --skill web-design-guidelines --agent claude-code
|
|
64
|
-
skills use houjallen/agent-skills@web-design-guidelines --agent codex`}function ha(t,e){if(t&&e){if(t.toLowerCase()!==e.toLowerCase())throw new ke(`Conflicting skill selectors: source selects "${t}" but --skill selects "${e}". Provide one selector.`);return e}return e??t}function ka(t,e,s){if(t.length===0)throw new ke("No valid skills found. Skills require a SKILL.md with name and description.");if(!e){if(t.length===1)return t[0];throw new ke(ai(s,t.map(ne)))}let n=Qt(t,[e]);if(n.length===0)throw new ke(ci(e,t.map(ne)));if(n.length>1)throw new ke(`Skill selector "${e}" matched multiple skills.`);return n[0]}function ya(t,e,s){if(t.length===0)throw new ke("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 n;if(e){if(n=t.filter(o=>o.installName.toLowerCase()===e.toLowerCase()||o.name.toLowerCase()===e.toLowerCase()),n.length===0)throw new ke(ci(e,t.map(o=>o.installName)));if(n.length>1)throw new ke(`Skill selector "${e}" matched multiple skills.`)}else {if(t.length!==1)throw new ke(ai(s,t.map(o=>o.installName)));n=t;}let l=n[0];return {kind:"well-known",name:l.name,directoryName:l.installName,rawContent:l.content,files:l.files}}function ai(t,e){return ["This source contains multiple skills. Specify exactly one skill:",...e.map(s=>` - ${s}`),"",`Examples:
|
|
65
|
-
skills use ${t}@${e[0]??"<skill>"}
|
|
66
|
-
skills use ${t} --skill ${e[0]??"<skill>"}`].join(`
|
|
67
|
-
`)}function ci(t,e){return [`No matching skill found for: ${t}`,"Available skills:",...e.map(s=>` - ${s}`)].join(`
|
|
68
|
-
`)}function ba(t){if(!t||t.length===0)return [];let e=[],s=Object.keys(D),n=t.filter(l=>l!=="*"&&!s.includes(l));return 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."),n.length>0&&e.push(`Invalid agents: ${n.join(", ")}
|
|
69
|
-
Valid agents: ${s.join(", ")}`),e}function ui(t){return [`Running ${D[t].displayName} is not supported yet.`,`Supported agents for skills use --agent: ${ii.join(", ")}`].join(`
|
|
70
|
-
`)}async function wa(t,e){for(let s of e)await di(t,s.path,s.contents);}async function $a(t,e){for(let[s,n]of e)await di(t,s,n);}async function di(t,e,s){let n=path.join(t,e);mn(t,n)&&(await promises.mkdir(path.dirname(n),{recursive:true}),typeof s=="string"?await promises.writeFile(n,s,"utf-8"):await promises.writeFile(n,s));}async function gi(t,e){await promises.mkdir(e,{recursive:true});let s=await promises.readdir(t,{withFileTypes:true});await Promise.all(s.filter(n=>!xa(n.name,n.isDirectory())).map(async n=>{let l=path.join(t,n.name),o=path.join(e,n.name);if(mn(e,o)){if(n.isDirectory()){await gi(l,o);return}try{await promises.cp(l,o,{dereference:!0,recursive:!0});}catch(i){if(i instanceof Error&&"code"in i&&i.code==="ENOENT"&&n.isSymbolicLink()){console.error(`Skipping broken symlink: ${l}`);return}throw i}}}));}async function pi(t,e){let s=await promises.readdir(e,{withFileTypes:true});for(let n of s){let l=path.join(e,n.name),o=path.relative(t,l).split(path.sep).join("/");if(n.isDirectory()){if(await pi(t,l))return true}else if(o.toLowerCase()!=="skill.md")return true}return false}function Sa(t){return Array.isArray(t.files)}function va(t){return t.find(s=>s.path.toLowerCase()==="skill.md")?.contents??""}function xa(t,e){return ua.has(t)||e&&da.has(t)}function mn(t,e){let s=path.normalize(path.resolve(t)),n=path.normalize(path.resolve(e));return n.startsWith(s+path.sep)||n===s}async function si(t){t&&await tt(t).catch(()=>{});}function Ve(t){console.error(t),process.exit(1);}var ke=class extends Error{};var mi={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 Ia=mi.languages,La=Ia.filter(t=>t.supported).map(t=>t.value),ut={defaultLocale:"zh-CN",locales:La},zt={},Ss=(t,e)=>{let s=zt[t]||{translation:{}};return zt[t]={translation:{...s.translation,...e.translation}},zt[t]},vs=(t=ut.defaultLocale)=>(zt[t]||Ss(t,{translation:{}}),{locale:t,resources:zt[t]||{translation:{}}});var Pa={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.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"}},fi=Pa;var Ta={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.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"}},hi=Ta;var Da=()=>{vs("zh-CN"),vs("en-US"),Ss("zh-CN",fi),Ss("en-US",hi);};Da();var fn=new Map;var hn=new Map;var Na=t=>{if(hn.has(t))return hn.get(t);let e=/{{\s*(\w+)\s*}}/g,s=[],n;for(;(n=e.exec(t))!==null;){let i=n[1];i&&!s.includes(i)&&s.push(i);}let l=new RegExp("{{\\s*("+s.join("|")+")\\s*}}","g"),o={keys:s,regex:l};return hn.set(t,o),o},ki=(t,e)=>{if(!t||typeof t!="string")return "";if(!e||Object.keys(e).length===0)return t;let{regex:s,keys:n}=Na(t);return n.length===0||!n.some(o=>o in e)?t:t.replace(s,(o,i)=>{let a=e[i];return a==null?"":String(a)})},Ea=t=>{if(t&&ut.locales.includes(t))return t;let e=process.env.EASBOT_LANG?.trim()||process.env.LANG?.trim();if(e){let s=e.replace(/_/g,"-");if(ut.locales.includes(s))return s;let n=s.split("-")[0];if(n==="zh")return "zh-CN";if(n==="en")return "en-US"}return ut.defaultLocale},yi=t=>{if(!fn.has(t)){let{resources:e}=vs(t);fn.set(t,e);}return fn.get(t)},Ca=(t,e={})=>{let s=Ea(e.locale),l=yi(s)?.translation[t];if(l&&typeof l=="string"){let o=ki(l,e.vars);return o!=null?String(o):String(t)}if(s!==ut.defaultLocale){let i=yi(ut.defaultLocale)?.translation[t];if(i&&typeof i=="string"){let a=ki(i,e.vars);return a!=null?String(a):String(t)}}return String(e.fallback??t)},F=Ca;var v="\x1B[0m",oe="\x1B[1m",L="\x1B[38;5;102m",ve="\x1B[38;5;145m";function Fa(t){return t&&Sl(t),t??"0.0.0"}function Gt(t){return utils.resolveLocaleLang(t?.locale)}function Ma(t){let e=Gt(t);console.log(),console.log(`${L}${F("cli.banner.tagline",{locale:e,fallback:"easbot-skills \u2014 agent skills ecosystem"})}${v}`),console.log(),console.log(` ${L}$${v} ${ve}easbot-skills add ${L}<package>${v} ${L}${F("cli.banner.cmd.add",{locale:e,vars:{cmd:"",dim:"",reset:""},fallback:"Add a new skill"})}${v}`),console.log(` ${L}$${v} ${ve}easbot-skills use ${L}<package>@<skill>${v} ${L}${F("cli.banner.cmd.use",{locale:e,vars:{cmd:"",dim:"",reset:""},fallback:"Use a skill without installing"})}${v}`),console.log(` ${L}$${v} ${ve}easbot-skills remove${v} ${L}${F("cli.example.remove_interactive",{locale:e,fallback:"Remove installed skills"})}${v}`),console.log(` ${L}$${v} ${ve}easbot-skills list${v} ${L}${F("cli.example.list_project",{locale:e,fallback:"List installed skills"})}${v}`),console.log(` ${L}$${v} ${ve}easbot-skills find ${L}[query]${v} ${L}${F("cli.example.find_interactive",{locale:e,fallback:"Search for skills"})}${v}`),console.log(),console.log(` ${L}$${v} ${ve}easbot-skills update${v} ${L}${F("cli.example.update_global",{locale:e,fallback:"Update installed skills"})}${v}`),console.log(),console.log(` ${L}$${v} ${ve}easbot-skills experimental_install${v} ${L}${F("cli.example.install",{locale:e,fallback:"Restore from skills-lock.json"})}${v}`),console.log(` ${L}$${v} ${ve}easbot-skills init ${L}[name]${v} ${L}${F("cli.example.init",{locale:e,fallback:"Create a new skill"})}${v}`),console.log(` ${L}$${v} ${ve}easbot-skills experimental_sync${v} ${L}${F("cli.example.sync",{locale:e,fallback:"Sync skills from node_modules"})}${v}`),console.log(),console.log(`${L}${F("cli.banner.try_hint",{locale:e,fallback:"try:"})}${v} easbot-skills add houjallen/agent-skills`),console.log(),console.log(`${L}${F("cli.banner.discover",{locale:e,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${v}`),console.log();}function gp(t){let e=Gt(t),s=(n,l)=>L+F(n,{locale:e,fallback:l})+v;console.log(`
|
|
71
|
-
${oe}${F("cli.help.usage",{locale:e,fallback:"Usage: skills <command> [options]"})}${v}
|
|
72
|
-
|
|
73
|
-
${oe}${F("cli.help.section.manage",{locale:e,fallback:"Manage Skills"})}${v}:
|
|
74
|
-
add <package> Add a skill package (alias: a)
|
|
75
|
-
e.g. houjallen/agent-skills
|
|
76
|
-
https://github.com/houjallen/agent-skills
|
|
77
|
-
use <package>@<skill>
|
|
78
|
-
Generate a prompt for using one skill without installing it
|
|
79
|
-
remove [skills] Remove installed skills
|
|
80
|
-
list, ls List installed skills
|
|
81
|
-
find [query] Search for skills interactively
|
|
82
|
-
|
|
83
|
-
${oe}${F("cli.help.section.find_options",{locale:e,fallback:"Find Options"})}${v}:
|
|
84
|
-
--owner <owner> Search only repositories from a GitHub owner
|
|
85
|
-
|
|
86
|
-
${oe}${F("cli.help.section.updates",{locale:e,fallback:"Updates"})}${v}:
|
|
87
|
-
update [skills...] Update skills to latest versions (alias: upgrade)
|
|
88
|
-
|
|
89
|
-
${oe}${F("cli.help.section.update_options",{locale:e,fallback:"Update Options"})}${v}:
|
|
90
|
-
-g, --global Update global skills only
|
|
91
|
-
-p, --project Update project skills only
|
|
92
|
-
-y, --yes Skip scope prompt (auto-detect: project if in a project, else global)
|
|
93
|
-
|
|
94
|
-
${oe}${F("cli.help.section.project",{locale:e,fallback:"Project"})}${v}:
|
|
95
|
-
experimental_install Restore skills from skills-lock.json
|
|
96
|
-
init [name] Initialize a skill (creates <name>/SKILL.md or ./SKILL.md)
|
|
97
|
-
experimental_sync Sync skills from node_modules into agent directories
|
|
98
|
-
|
|
99
|
-
${oe}${F("cli.help.section.add_options",{locale:e,fallback:"Add Options"})}${v}:
|
|
100
|
-
-g, --global Install skill globally (user-level) instead of project-level
|
|
101
|
-
-a, --agent <agents> Specify agents to install to (use '*' for all agents)
|
|
102
|
-
-s, --skill <skills> Specify skill names to install (use '*' for all skills)
|
|
103
|
-
-l, --list List available skills in the repository without installing
|
|
104
|
-
-y, --yes Skip confirmation prompts
|
|
105
|
-
--copy Copy files instead of symlinking to agent directories
|
|
106
|
-
--subagent <names> Install to Eve subagents (use 'root' for the root agent)
|
|
107
|
-
--all Shorthand for --skill '*' --agent '*' -y
|
|
108
|
-
--full-depth Search all subdirectories even when a root SKILL.md exists
|
|
109
|
-
|
|
110
|
-
${oe}${F("cli.help.section.use_options",{locale:e,fallback:"Use Options"})}${v}:
|
|
111
|
-
-s, --skill <skill> Specify the skill to use
|
|
112
|
-
-a, --agent <agent> Start one supported agent interactively
|
|
113
|
-
--full-depth Search all subdirectories even when a root SKILL.md exists
|
|
114
|
-
--dangerously-accept-openclaw-risks
|
|
115
|
-
Allow unverified OpenClaw community skills
|
|
116
|
-
|
|
117
|
-
${oe}${F("cli.help.section.remove_options",{locale:e,fallback:"Remove Options"})}${v}:
|
|
118
|
-
-g, --global Remove from global scope
|
|
119
|
-
-a, --agent <agents> Remove from specific agents (use '*' for all agents)
|
|
120
|
-
-s, --skill <skills> Specify skills to remove (use '*' for all skills)
|
|
121
|
-
-y, --yes Skip confirmation prompts
|
|
122
|
-
--all Shorthand for --skill '*' --agent '*' -y
|
|
123
|
-
|
|
124
|
-
${oe}${F("cli.help.section.sync_options",{locale:e,fallback:"Experimental Sync Options"})}${v}:
|
|
125
|
-
-a, --agent <agents> Specify agents to install to (use '*' for all agents)
|
|
126
|
-
-y, --yes Skip confirmation prompts
|
|
127
|
-
|
|
128
|
-
${oe}${F("cli.help.section.list_options",{locale:e,fallback:"List Options"})}${v}:
|
|
129
|
-
-g, --global List global skills (default: project)
|
|
130
|
-
-a, --agent <agents> Filter by specific agents
|
|
131
|
-
--json Output as JSON (machine-readable, no ANSI codes)
|
|
132
|
-
|
|
133
|
-
${oe}${F("cli.help.section.options",{locale:e,fallback:"Options"})}${v}:
|
|
134
|
-
--help, -h Show this help message
|
|
135
|
-
--version, -v Show version number
|
|
136
|
-
|
|
137
|
-
${oe}Examples:${v}
|
|
138
|
-
${L}$${v} easbot-skills add houjallen/agent-skills ${s("cli.example.add","Add a skill package")}
|
|
139
|
-
${L}$${v} easbot-skills use houjallen/agent-skills@houjallen | claude ${s("cli.example.use","Use a skill one-shot")}
|
|
140
|
-
${L}$${v} easbot-skills use houjallen/agent-skills --skill houjallen --agent claude ${s("cli.example.use_with_agent","Specify skill + agent")}
|
|
141
|
-
${L}$${v} easbot-skills add houjallen/agent-skills -g ${s("cli.example.add_global","Install globally")}
|
|
142
|
-
${L}$${v} easbot-skills add houjallen/agent-skills --agent claude-code cursor ${s("cli.example.add_multi_agent","Install to multiple agents")}
|
|
143
|
-
${L}$${v} easbot-skills add houjallen/agent-skills --skill pr-review commit ${s("cli.example.add_multi_skill","Install multiple skills")}
|
|
144
|
-
${L}$${v} easbot-skills remove ${L}# ${s("cli.example.remove_interactive","Interactive remove")}${v}
|
|
145
|
-
${L}$${v} easbot-skills remove web-design ${L}# ${s("cli.example.remove_by_name","Remove by name")}${v}
|
|
146
|
-
${L}$${v} easbot-skills rm --global frontend-design
|
|
147
|
-
${L}$${v} easbot-skills list ${L}# ${s("cli.example.list_project","List project skills")}${v}
|
|
148
|
-
${L}$${v} easbot-skills ls -g ${L}# ${s("cli.example.list_global","List global skills")}${v}
|
|
149
|
-
${L}$${v} easbot-skills ls -a claude-code ${L}# ${s("cli.example.list_filter_agent","Filter by agent")}${v}
|
|
150
|
-
${L}$${v} easbot-skills ls --json ${L}# ${s("cli.example.list_json","JSON output")}${v}
|
|
151
|
-
${L}$${v} easbot-skills find ${L}# ${s("cli.example.find_interactive","Interactive search")}${v}
|
|
152
|
-
${L}$${v} easbot-skills find typescript ${L}# ${s("cli.example.find_keyword","Search by keyword")}${v}
|
|
153
|
-
${L}$${v} easbot-skills find react --owner houjallen ${L}# ${s("cli.example.find_owner","Search within an owner")}${v}
|
|
154
|
-
${L}$${v} easbot-skills update
|
|
155
|
-
${L}$${v} easbot-skills update my-skill ${L}# ${s("cli.example.update_one","Update a single skill")}${v}
|
|
156
|
-
${L}$${v} easbot-skills update -g ${L}# ${s("cli.example.update_global","Update global skills only")}${v}
|
|
157
|
-
${L}$${v} easbot-skills experimental_install ${L}# ${s("cli.example.install","Restore from lockfile")}${v}
|
|
158
|
-
${L}$${v} easbot-skills init my-skill ${L}# ${s("cli.example.init","Create a new skill")}${v}
|
|
159
|
-
${L}$${v} easbot-skills experimental_sync ${L}# ${s("cli.example.sync","Sync from node_modules")}${v}
|
|
160
|
-
${L}$${v} easbot-skills experimental_sync -y ${L}# ${s("cli.example.sync_no_prompt","Sync without prompts")}${v}
|
|
161
|
-
|
|
162
|
-
${L}${F("cli.banner.discover",{locale:e,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${v}
|
|
163
|
-
`);}function Wa(t){let e=Gt(t);console.log(`
|
|
164
|
-
${oe}${F("cli.help.remove.usage",{locale:e,fallback:"Usage: easbot skills remove [skills...] [options]"})}${v}
|
|
165
|
-
|
|
166
|
-
${oe}Description:${v}
|
|
167
|
-
${F("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."})}
|
|
168
|
-
|
|
169
|
-
${oe}Arguments:${v}
|
|
170
|
-
${F("cli.help.remove.arguments",{locale:e,fallback:"skills Optional skill names to remove (space-separated)"})}
|
|
171
|
-
|
|
172
|
-
${oe}Options:${v}
|
|
173
|
-
-g, --global Remove from global scope (~/) instead of project scope
|
|
174
|
-
-a, --agent Remove from specific agents (use '*' for all agents)
|
|
175
|
-
-s, --skill Specify skills to remove (use '*' for all skills)
|
|
176
|
-
-y, --yes Skip confirmation prompts
|
|
177
|
-
--all Shorthand for --skill '*' --agent '*' -y
|
|
178
|
-
|
|
179
|
-
${oe}Examples:${v}
|
|
180
|
-
${L}$${v} easbot-skills remove ${L}# ${F("cli.example.remove_interactive",{locale:e,fallback:"Interactive remove"})}${v}
|
|
181
|
-
${L}$${v} easbot-skills remove my-skill ${L}# ${F("cli.example.remove_by_name",{locale:e,fallback:"Remove by name"})}${v}
|
|
182
|
-
${L}$${v} easbot-skills remove skill1 skill2 -y ${L}# ${F("cli.example.remove_all",{locale:e,fallback:"Remove multiple skills"})}${v}
|
|
183
|
-
${L}$${v} easbot-skills remove --global my-skill ${L}# ${F("cli.example.remove_global",{locale:e,fallback:"Remove from global scope"})}${v}
|
|
184
|
-
${L}$${v} easbot-skills rm --agent claude-code my-skill ${L}# ${F("cli.example.remove_by_agent",{locale:e,fallback:"Remove from specific agent"})}${v}
|
|
185
|
-
${L}$${v} easbot-skills remove --all ${L}# ${F("cli.example.remove_all",{locale:e,fallback:"Remove all skills"})}${v}
|
|
186
|
-
${L}$${v} easbot-skills remove --skill '*' -a cursor ${L}# ${F("cli.example.remove_agent_all",{locale:e,fallback:"Remove all skills from one agent"})}${v}
|
|
187
|
-
|
|
188
|
-
${L}${F("cli.banner.discover",{locale:e,vars:{url:"https://skills.sh/"},fallback:"Discover more skills at https://skills.sh/"})}${v}
|
|
189
|
-
`);}function Ht(){console.log();}function Ka(t,e){let s=Gt(e),n=e?.cwd??gt()??process.cwd(),l=t[0]||path.basename(n),o=t[0]!==void 0,i=o?path.join(n,l):n,a=path.join(i,"SKILL.md"),r=o?`${l}/SKILL.md`:"SKILL.md";if(fs$1.existsSync(a))return console.log(`${ve}${F("cli.init.exists",{locale:s,vars:{path:r},fallback:`Skill already exists at ${r}`})}${v}`),0;o&&fs$1.mkdirSync(i,{recursive:true});let h=`---
|
|
190
|
-
name: ${l}
|
|
191
|
-
description: A brief description of what this skill does
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
# ${l}
|
|
195
|
-
|
|
196
|
-
Instructions for the agent to follow when this skill is activated.
|
|
197
|
-
|
|
198
|
-
## When to use
|
|
199
|
-
|
|
200
|
-
Describe when this skill should be used.
|
|
201
|
-
|
|
202
|
-
## Instructions
|
|
203
|
-
|
|
204
|
-
1. First step
|
|
205
|
-
2. Second step
|
|
206
|
-
3. Additional steps as needed
|
|
207
|
-
`;return fs$1.writeFileSync(a,h),console.log(`${ve}${F("cli.init.created",{locale:s,vars:{name:l},fallback:`Initialized skill: ${l}`})}${v}`),console.log(),console.log(`${L}${F("cli.init.created_label",{locale:s,fallback:"Created"})}${v}:`),console.log(` ${r}`),console.log(),console.log(`${L}${F("cli.init.next.title",{locale:s,fallback:"Next steps"})}${v}:`),console.log(` 1. ${F("cli.init.next.edit",{locale:s,vars:{path:r},fallback:`Edit ${r} to define your skill instructions`})}`),console.log(` 2. ${F("cli.init.next.frontmatter",{locale:s,fallback:"Update the name and description in the frontmatter"})}`),console.log(),console.log(`${L}${F("cli.init.publish.title",{locale:s,fallback:"Publishing"})}${v}:`),console.log(` ${L}GitHub:${v} ${F("cli.init.publish.github",{locale:s,vars:{cmd:"easbot skills"},fallback:"Push to a repo, then easbot skills add <owner>/<repo>"})}`),console.log(` ${L}URL:${v} ${F("cli.init.publish.url",{locale:s,vars:{cmd:"easbot skills",path:r},fallback:"Host the file, then easbot skills add https://example.com/"+r})}`),console.log(),console.log(`${L}${F("cli.init.browse_hint",{locale:s,vars:{url:"https://skills.sh/"},fallback:"Browse existing skills for inspiration at https://skills.sh/"})}${v}`),console.log(),0}async function pp(t,e){Fa(e?.version);let n=e?.inAgent??await rs();if(t.length===0)return n||Ma(e),{code:0,handled:false};let l=t[0],o=t.slice(1);switch(l){case "find":case "search":case "f":case "s":return n||Ht(),console.log(),await Nl(o),{code:0,handled:true,command:l};case "init":return n||Ht(),console.log(),{code:Ka(o,e),handled:true,command:l};case "experimental_install":return n||Ht(),await _l(o),{code:0,handled:true,command:l};case "i":case "install":case "a":case "add":{n||Ht();let{source:i,options:a}=fs(o);return await rt(i,a),{code:0,handled:true,command:l}}case "use":{let{source:i,options:a,errors:r}=oi(o);return await ri(i,a,r),{code:0,handled:true,command:l}}case "remove":case "rm":case "r":{if(o.includes("--help")||o.includes("-h"))return Wa(e),{code:0,handled:true,command:l};let{skills:i,options:a}=Ml(o);return await $s(i,a),{code:0,handled:true,command:l}}case "experimental_sync":{n||Ht();let{options:i}=ys(o);return await ks(o,i),{code:0,handled:true,command:l}}case "list":case "ls":return await jl(o),{code:0,handled:true,command:l};case "check":case "update":case "upgrade":return await Yl(o),{code:0,handled:true,command:l};default:{let i=Gt(e);return console.log(F("cli.unknown_command",{locale:i,vars:{command:l??""},fallback:`Unknown command: ${l}`})),console.log(F("cli.help_hint",{locale:i,vars:{cmd:"skills"},fallback:"Run skills --help for usage."})),{code:1,handled:true,command:l}}}}
|
|
208
|
-
exports.$=fe;exports.$a=$s;exports.A=jt;exports.Aa=gl;exports.B=xc;exports.Ba=De;exports.C=Ac;exports.Ca=ds;exports.D=to;exports.Da=Lu;exports.E=Ic;exports.Ea=Pu;exports.F=Lc;exports.Fa=ot;exports.G=Pc;exports.Ga=Tu;exports.H=Tc;exports.Ha=en;exports.I=_e;exports.Ia=pl;exports.J=Ot;exports.Ja=ml;exports.K=so;exports.Ka=fl;exports.L=Dc;exports.La=Du;exports.M=Nc;exports.Ma=hl;exports.N=gt;exports.Na=Kt;exports.O=ro;exports.Oa=tn;exports.P=D;exports.Pa=sn;exports.Q=Ge;exports.Qa=Sl;exports.R=Oc;exports.Ra=rt;exports.S=js;exports.Sa=fs;exports.T=nt;exports.Ta=Ir;exports.U=Xe;exports.Ua=Dl;exports.V=ts;exports.Va=Nl;exports.W=Ft;exports.Wa=ks;exports.X=we;exports.Xa=ys;exports.Y=Qn;exports.Ya=_l;exports.Z=el;exports.Za=Mr;exports._=Wc;exports._a=jl;exports.a=Je;exports.aa=Ue;exports.ab=Ml;exports.b=Jt;exports.ba=ht;exports.bb=Vr;exports.c=Nt;exports.ca=Te;exports.cb=qr;exports.d=Ls;exports.da=is;exports.db=Jr;exports.e=dt;exports.ea=os;exports.eb=Xl;exports.f=vn;exports.fa=zs;exports.fb=Yl;exports.g=We;exports.ga=Ze;exports.gb=oi;exports.h=Ui;exports.ha=Qc;exports.hb=ga;exports.i=ji;exports.ia=ol;exports.ib=pa;exports.j=Pn;exports.ja=Hs;exports.jb=ri;exports.k=Ke;exports.ka=rl;exports.kb=ma;exports.l=tt;exports.la=al;exports.lb=Ma;exports.m=En;exports.ma=qs;exports.mb=gp;exports.n=Ie;exports.na=cl;exports.nb=pp;exports.o=Cn;exports.oa=ye;exports.p=ze;exports.pa=su;exports.q=Et;exports.qa=Qe;exports.r=lc;exports.ra=rs;exports.s=Qi;exports.sa=ru;exports.t=He;exports.ta=as;exports.u=eo;exports.ua=cs;exports.v=Le;exports.va=Do;exports.w=ne;exports.wa=No;exports.x=Qt;exports.xa=Eo;exports.y=Sc;exports.ya=us;exports.z=vc;exports.za=yt;
|