@easbot/skills 0.3.10 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.en.md +166 -59
  2. package/README.md +172 -62
  3. package/dist/assets/txt/template/skill-template-en-US.txt +50 -0
  4. package/dist/assets/txt/template/skill-template-zh-CN.txt +50 -0
  5. package/dist/chunks/blob-DOVEGVIE.cjs +1 -0
  6. package/dist/chunks/blob-JSMTOYEN.mjs +1 -0
  7. package/dist/chunks/chunk-2VZUPTI7.cjs +1 -0
  8. package/dist/chunks/chunk-2YVJ7YP6.mjs +22 -0
  9. package/dist/chunks/chunk-4R6NKPNW.mjs +3 -0
  10. package/dist/chunks/chunk-676OG55M.mjs +5 -0
  11. package/dist/chunks/chunk-6PJ3YQA7.mjs +2 -0
  12. package/dist/chunks/chunk-72DXY4B7.mjs +1 -0
  13. package/dist/chunks/chunk-CFMOYU7R.mjs +2 -0
  14. package/dist/chunks/chunk-GR2NJUJ6.mjs +255 -0
  15. package/dist/chunks/chunk-JFEBB5CL.cjs +22 -0
  16. package/dist/chunks/chunk-KV7EP6AW.cjs +255 -0
  17. package/dist/chunks/chunk-OWG6N2K6.cjs +5 -0
  18. package/dist/chunks/chunk-RWSBKHQ2.cjs +3 -0
  19. package/dist/chunks/chunk-RWZ4LFSN.mjs +1 -0
  20. package/dist/chunks/chunk-S6YNGR7S.cjs +2 -0
  21. package/dist/chunks/chunk-TCFGU43L.cjs +2 -0
  22. package/dist/chunks/chunk-VRHWDHQV.cjs +1 -0
  23. package/dist/chunks/chunk-WQGSYA5D.mjs +1 -0
  24. package/dist/chunks/chunk-XGUPIAAF.cjs +1 -0
  25. package/dist/chunks/cli-handler-RAJ42VDN.mjs +1 -0
  26. package/dist/chunks/cli-handler-YAJ5J5VA.cjs +1 -0
  27. package/dist/chunks/installer-FB26E7JZ.mjs +1 -0
  28. package/dist/chunks/installer-GOQTCUJ4.cjs +1 -0
  29. package/dist/chunks/interfaces-S47ZGORM.mjs +1 -0
  30. package/dist/chunks/interfaces-UIS44Q7A.cjs +1 -0
  31. package/dist/chunks/local-lock-4AA55ORE.cjs +1 -0
  32. package/dist/chunks/local-lock-LG5YL33V.mjs +1 -0
  33. package/dist/chunks/scan-QEVID2TF.mjs +1 -0
  34. package/dist/chunks/scan-XWU3FCE3.cjs +1 -0
  35. package/dist/chunks/skill-lock-KHPVP7AD.mjs +1 -0
  36. package/dist/chunks/skill-lock-LET33FVT.cjs +1 -0
  37. package/dist/chunks/store-3NRBE47N.mjs +1 -0
  38. package/dist/chunks/store-EHYH46YY.cjs +1 -0
  39. package/dist/chunks/telemetry-7T6MUW5A.mjs +1 -0
  40. package/dist/chunks/telemetry-LCGTSJDM.cjs +1 -0
  41. package/dist/cli.cjs +1 -1
  42. package/dist/cli.mjs +1 -1
  43. package/dist/index.cjs +1 -1
  44. package/dist/index.d.cts +347 -106
  45. package/dist/index.d.ts +347 -106
  46. package/dist/index.mjs +1 -1
  47. package/package.json +4 -5
  48. package/dist/chunks/blob-3ZTTX2CZ.mjs +0 -1
  49. package/dist/chunks/blob-UAS6F4BG.cjs +0 -1
  50. package/dist/chunks/chunk-645XWVJB.mjs +0 -208
  51. package/dist/chunks/chunk-DLDPJGDD.cjs +0 -208
  52. package/dist/chunks/chunk-XDSGBJHO.cjs +0 -2
  53. package/dist/chunks/chunk-ZEMGS5WR.mjs +0 -2
@@ -0,0 +1,5 @@
1
+ import {v}from'./chunk-2YVJ7YP6.mjs';import {h,r,e,f,c}from'./chunk-6PJ3YQA7.mjs';import {k,p,q}from'./chunk-RWZ4LFSN.mjs';import {mkdir,readdir,writeFile,readFile,cp,lstat,access,rm,realpath,readlink,symlink}from'fs/promises';import {existsSync}from'fs';import {join,basename,dirname,normalize,resolve,sep,relative,extname}from'path';import {homedir,platform}from'os';var V=".agents",X="skills",Se=".agents/skills";async function ge(t){try{return await v(t)}catch{return}}async function G(t,e,a,r,n={}){if(n.expectedMode&&n.agentType){let l=await ne(t,n.agentType,{global:a,cwd:r});if(!l.installed||l.mode!==n.expectedMode)return false}let i=await ge(e);if(!i)return false;let s;if(a){let{readSkillLock:l}=await import('./skill-lock-KHPVP7AD.mjs');s=(await l()).skills[t]?.computedHash;}else {let{readLocalLock:l}=await import('./local-lock-LG5YL33V.mjs');s=(await l(r)).skills[t]?.computedHash;}return s?s===i:false}function P(t){return t.toLowerCase().replace(/[^a-z0-9._]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").substring(0,255)||"unnamed-skill"}function w(t,e){let a=normalize(resolve(t)),r=normalize(resolve(e));return r.startsWith(a+sep)||r===a}function Y(t,e){return w(t,e)||w(e,t)}function N(t,e){let a=t?k()||homedir():e||p()||process.cwd();return join(a,V,X)}function te(t,e){let a=e||p()||process.cwd();return join(a,h,P(t),"skills")}function D(t,e$1,a,r$1){if(r(t,e$1?"global":"project"))return N(e$1,a);if(t==="eve"&&r$1)return te(r$1,a);let n=e[t],i=k()||homedir(),s=e$1?i:a||p()||process.cwd();return e$1?n.globalSkillsDir===void 0?join(s,n.skillsDir):n.globalSkillsDir:join(s,n.skillsDir)}function he(t,e){return resolve(dirname(t),e)}async function S(t){try{await rm(t,{recursive:!0,force:!0});}catch{}await mkdir(t,{recursive:true});}async function j(t,e){try{let a=resolve(t),r=resolve(e),[n,i]=await Promise.all([realpath(a).catch(()=>a),realpath(r).catch(()=>r)]);if(n===i)return !0;let s=q(t),l=q(e);if(s===l)return !0;try{if((await lstat(e)).isSymbolicLink()){let d=await readlink(e);if(he(e,d)===a)return !0;await rm(e);}else await rm(e,{recursive:!0});}catch(k){if(k&&typeof k=="object"&&"code"in k&&k.code==="ELOOP")try{await rm(e,{force:!0});}catch{}}let u=dirname(e);await mkdir(u,{recursive:!0});let h=q(u),g=relative(h,t),f=platform()==="win32"?"junction":void 0;return await symlink(f==="junction"?a:g,e,f),!0}catch{return false}}async function Me(t,e$1,a={}){let r$1=e[e$1],n=a.global??false,i=a.cwd||process.cwd(),s=a.eveSubagent;if(n&&r$1.globalSkillsDir===void 0)return {success:false,path:"",mode:a.mode??"symlink",error:`${r$1.displayName} does not support global skill installation`};let l=t.name||basename(t.path),u=P(l),h=a.mode??"symlink",f=e$1==="eve"&&h==="symlink"?D(e$1,n,i,s):N(n,i),o=join(f,u),k=D(e$1,n,i,s),d=join(k,P(t.name||basename(t.path))),c=q(d),m=q(o);if(!w(f,o))return {success:false,path:d,mode:h,error:"Invalid skill name: potential path traversal detected"};if(!w(k,d))return {success:false,path:d,mode:h,error:"Invalid skill name: potential path traversal detected"};try{if(Y(t.path,c))return {success:!0,path:c,mode:h,skipped:!0};if(h==="copy")return await G(u,t.path,n,i,{expectedMode:"copy",agentType:e$1})&&existsSync(c)?{success:!0,path:c,canonicalPath:m,mode:"copy",skipped:!0,skippedReason:"up-to-date"}:(await S(c),await R(t.path,c,e$1),{success:!0,path:c,canonicalPath:m,mode:"copy"});if(Y(t.path,c))return {success:!0,path:c,canonicalPath:m,mode:"symlink",skipped:!0};if(await G(u,t.path,n,i)&&existsSync(m)||(await S(m),await R(t.path,m,e$1)),!n&&r(e$1,"project"))return {success:!0,path:m,canonicalPath:m,mode:"copy"};if(n&&r(e$1,"global"))return {success:!0,path:m,canonicalPath:m,mode:"symlink"};if(!n){let z=join(i,e[e$1].skillsDir.split("/")[0]);if(!existsSync(z))return {success:!0,path:m,canonicalPath:m,mode:"symlink",skipped:!0}}return o===d?{success:!0,path:d,canonicalPath:o,mode:"copy"}:await j(t.path,c)?{success:!0,path:c,canonicalPath:m,mode:"symlink"}:await G(u,t.path,n,i,{expectedMode:"copy",agentType:e$1})&&existsSync(c)?{success:!0,path:c,canonicalPath:m,mode:"symlink",skipped:!0,skippedReason:"up-to-date"}:(await S(c),await R(t.path,c,e$1),{success:!0,path:c,canonicalPath:m,mode:"symlink",symlinkFailed:!0})}catch(b){return {success:false,path:c,mode:h,error:b instanceof Error?b.message:"Unknown error"}}}async function je(t,e$1,a={}){let{isGlobal:r$1=false,agentType:n,cwd:i,storePath:s}=a,l=q(t),u=q(e$1);if(l===u)return {success:true,path:u,canonicalPath:t,mode:"copy"};if(!r$1&&n&&i&&!r(n,"project")){let f=join(i,e[n].skillsDir.split("/")[0]);if(!existsSync(f))return {success:true,path:e$1,canonicalPath:t,mode:"symlink",skipped:true}}let h=s?q(s):l;return await j(h,u)?{success:true,path:e$1,canonicalPath:t,mode:"symlink"}:{success:true,path:e$1,canonicalPath:t,mode:"symlink",symlinkFailed:true}}async function _e(t,e,a={}){let{agentType:r="easbot"}=a,n=q(t),i=q(e);if(n===i)return {success:true,path:i,canonicalPath:t,mode:"copy"};try{return await S(i),await R(n,i,r),{success:!0,path:i,canonicalPath:t,mode:"copy"}}catch(s){return {success:false,path:e,mode:"copy",error:s instanceof Error?s.message:"Unknown error"}}}var ke=new Set(["metadata.json"]),we=new Set([".git","__pycache__","__pypackages__"]),ye=(t,e=false)=>!!(ke.has(t)||e&&we.has(t));function L(t){let{data:e,content:a}=c(t),r={};if(typeof e.description=="string"&&(r.description=e.description),typeof e.license=="string"&&(r.license=e.license),e.metadata&&typeof e.metadata=="object"&&!Array.isArray(e.metadata)){let s=Object.fromEntries(Object.entries(e.metadata).filter(l=>typeof l[1]=="string"));Object.keys(s).length>0&&(r.metadata=s);}let n=Object.keys(r);return n.length===0?a.replace(/^\r?\n/u,""):`---
2
+ ${n.map(s=>`${s}: ${JSON.stringify(r[s])}`).join(`
3
+ `)}
4
+ ---
5
+ ${a.replace(/^\r?\n/u,"")}`}async function R(t,e,a){await mkdir(e,{recursive:true});let r=await readdir(t,{withFileTypes:true});await Promise.all(r.filter(n=>!ye(n.name,n.isDirectory())).map(async n=>{let i=join(t,n.name),s=join(e,n.name);if(n.isDirectory())await R(i,s,a);else try{if(a==="eve"&&n.name.toLowerCase()==="skill.md"){await writeFile(s,L(await readFile(i,"utf-8")));return}await cp(i,s,{dereference:!0,recursive:!0});}catch(l){if(l instanceof Error&&"code"in l&&l.code==="ENOENT"&&n.isSymbolicLink())console.warn(`Skipping broken symlink: ${i}`);else throw l}}));}function be(t){return t.some(e=>basename(e.path).toLowerCase()==="skill.md")}function U(t){return `${P(t)}.md`}function ve(t){let e=t.find(r=>basename(r.path).toLowerCase()==="skill.md");if(e)return L(e.contents);let a=t.find(r=>extname(r.path).toLowerCase()===".md");return a?L(a.contents):""}async function Ue(t,e,a={}){return (await ne(t,e,a)).installed}async function ne(t,e$1,a={}){let r=e[e$1],n=P(t);if(a.global&&r.globalSkillsDir===void 0)return {installed:false,mode:null,path:""};let i=a.global?r.globalSkillsDir:e$1==="eve"&&a.eveSubagent?te(a.eveSubagent,a.cwd):join(a.cwd||process.cwd(),r.skillsDir),s=join(i,n);if(!w(i,s))return {installed:false,mode:null,path:""};try{let l=await lstat(s);return l.isSymbolicLink()?{installed:!0,mode:"symlink",path:s}:l.isDirectory()?{installed:!0,mode:"copy",path:s}:{installed:!1,mode:null,path:s}}catch{return {installed:false,mode:null,path:s}}}function Be(t,e,a={}){let r=P(t),n=D(e,a.global??false,a.cwd,a.eveSubagent),i=join(n,r);if(!w(n,i))throw new Error("Invalid skill name: potential path traversal detected");return i}async function H(t,e){try{return await access(join(t,"SKILL.md")),{created:!1}}catch{}return await mkdir(t,{recursive:true}),await e(t),{created:true}}function $e(t,e={}){let a=P(t),r=e.agent==="eve"?D("eve",e.global??false,e.cwd,e.eveSubagent):N(e.global??false,e.cwd),n=join(r,a);if(!w(r,n))throw new Error("Invalid skill name: potential path traversal detected");return n}async function ze(t,e$1,a={}){let r$1=e[e$1],n=a.global??false,i=a.cwd||process.cwd(),s=a.mode??"symlink",l=a.eveSubagent;if(n&&r$1.globalSkillsDir===void 0)return {success:false,path:"",mode:s,error:`${r$1.displayName} does not support global skill installation`};let u=P(t.installName),h=e$1==="eve"&&s==="symlink"?D(e$1,n,i,l):N(n,i),g=join(h,u),f=D(e$1,n,i,l),o=join(f,u);if(!w(h,g))return {success:false,path:o,mode:s,error:"Invalid skill name: potential path traversal detected"};if(!w(f,o))return {success:false,path:o,mode:s,error:"Invalid skill name: potential path traversal detected"};try{if(s==="copy"){await S(o);let c=e$1==="eve"?U(t.installName):"SKILL.md",m=join(o,c);return await writeFile(m,e$1==="eve"?L(t.content):t.content,"utf-8"),{success:!0,path:o,mode:"copy"}}let k=e$1==="eve"?U(t.installName):"SKILL.md";if(await H(g,async c=>{let m=join(c,k);await writeFile(m,e$1==="eve"?L(t.content):t.content,"utf-8");}),n&&r(e$1,"global"))return {success:!0,path:g,canonicalPath:g,mode:"symlink"};if(!await j(g,o)){await S(o);let c=e$1==="eve"?U(t.installName):"SKILL.md",m=join(o,c);return await writeFile(m,e$1==="eve"?L(t.content):t.content,"utf-8"),{success:!0,path:o,canonicalPath:g,mode:"symlink",symlinkFailed:!0}}return {success:!0,path:o,canonicalPath:g,mode:"symlink"}}catch(k){return {success:false,path:o,mode:s,error:k instanceof Error?k.message:"Unknown error"}}}async function Ke(t,e$1,a={}){let r$1=e[e$1],n=a.global??false,i=a.cwd||process.cwd(),s=a.mode??"symlink",l=a.eveSubagent;if(n&&r$1.globalSkillsDir===void 0)return {success:false,path:"",mode:s,error:`${r$1.displayName} does not support global skill installation`};let u=P(t.installName),h=e$1==="eve"&&s==="symlink"?D(e$1,n,i,l):N(n,i),g=join(h,u),f=D(e$1,n,i,l),o=join(f,u);if(!w(h,g))return {success:false,path:o,mode:s,error:"Invalid skill name: potential path traversal detected"};if(!w(f,o))return {success:false,path:o,mode:s,error:"Invalid skill name: potential path traversal detected"};async function k(d){for(let[c,m]of t.files){let b=join(d,c);if(!w(d,b))continue;let $=dirname(b);$!==d&&await mkdir($,{recursive:true}),await writeFile(b,e$1==="eve"&&basename(c).toLowerCase()==="skill.md"&&typeof m=="string"?L(m):m);}}try{return s==="copy"?(await S(o),await k(o),{success:!0,path:o,mode:"copy"}):(await H(g,k),n&&r(e$1,"global")?{success:!0,path:g,canonicalPath:g,mode:"symlink"}:await j(g,o)?{success:!0,path:o,canonicalPath:g,mode:"symlink"}:(await S(o),await k(o),{success:!0,path:o,canonicalPath:g,mode:"symlink",symlinkFailed:!0}))}catch(d){return {success:false,path:o,mode:s,error:d instanceof Error?d.message:"Unknown error"}}}async function Ge(t,e$1,a={}){let r$1=e[e$1],n=a.global??false,i=a.cwd||process.cwd(),s=a.mode??"symlink",l=a.eveSubagent;if(n&&r$1.globalSkillsDir===void 0)return {success:false,path:"",mode:s,error:`${r$1.displayName} does not support global skill installation`};let u=P(t.installName),h=D(e$1,n,i,l);if(e$1==="eve"&&!be(t.files)){let d=join(h,U(t.installName));if(!w(h,d))return {success:false,path:d,mode:s,error:"Invalid skill name: potential path traversal detected"};try{return await mkdir(h,{recursive:!0}),await rm(d,{recursive:!0,force:!0}),await writeFile(d,ve(t.files),"utf-8"),{success:!0,path:d,mode:"copy"}}catch(c){return {success:false,path:d,mode:s,error:c instanceof Error?c.message:"Unknown error"}}}let g=e$1==="eve"&&s==="symlink"?D(e$1,n,i,l):N(n,i),f=join(g,u),o=join(h,u);if(!w(g,f))return {success:false,path:o,mode:s,error:"Invalid skill name: potential path traversal detected"};if(!w(h,o))return {success:false,path:o,mode:s,error:"Invalid skill name: potential path traversal detected"};async function k(d){for(let c of t.files){let m=join(d,c.path);if(!w(d,m))continue;let b=dirname(m);b!==d&&await mkdir(b,{recursive:true}),await writeFile(m,e$1==="eve"&&basename(c.path).toLowerCase()==="skill.md"?L(c.contents):c.contents,"utf-8");}}try{if(s==="copy")return await S(o),await k(o),{success:!0,path:o,mode:"copy"};if(await H(f,k),n&&r(e$1,"global"))return {success:!0,path:f,canonicalPath:f,mode:"symlink"};if(!n&&!r(e$1,"project")){let c=join(i,e[e$1].skillsDir.split("/")[0]);if(!existsSync(c))return {success:!0,path:f,canonicalPath:f,mode:"symlink",skipped:!0}}return await j(f,o)?{success:!0,path:o,canonicalPath:f,mode:"symlink"}:(await S(o),await k(o),{success:!0,path:o,canonicalPath:f,mode:"symlink",symlinkFailed:!0})}catch(d){return {success:false,path:o,mode:s,error:d instanceof Error?d.message:"Unknown error"}}}async function He(t={}){let e=t.cwd||process.cwd(),{scanInstalledSkillDirs:a}=await import('./scan-QEVID2TF.mjs'),r=t.agentFilter?null:await f(),n=t.agentFilter??r??void 0,i=await a({scope:t.scope,cwd:e,agentFilter:n}),s=u=>u.replace(/\\/g,"/").replace(/\/[^/]+\/?$/,"").replace(/\/+$/,""),l=new Map;for(let u of i){let h=s(u.skillDir),g=`${u.scope}::${h}::${u.name}`,f=l.get(g);if(f){for(let o of u.agents)f.agents.includes(o)||f.agents.push(o);continue}l.set(g,{name:u.name,description:"",path:u.skillDir,canonicalPath:u.skillDir,scope:u.scope,agents:[...u.agents]});}return Array.from(l.values())}export{V as a,X as b,Se as c,P as d,N as e,te as f,D as g,Me as h,je as i,_e as j,Ue as k,ne as l,Be as m,H as n,$e as o,ze as p,Ke as q,Ge as r,He as s};
@@ -0,0 +1,2 @@
1
+ import {l,k}from'./chunk-RWZ4LFSN.mjs';import {createHash}from'crypto';import {parse}from'yaml';import {existsSync,readdirSync,readFileSync}from'fs';import {join,resolve}from'path';import {homedir}from'os';import {xdgConfig}from'xdg-basedir';import {Wildcard}from'@easbot/utils';function T(s){let l=s.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);return l?{data:parse(l[1])??{},content:l[2]??""}:{data:{},content:s}}var Z=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g,Q=/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g,V=/\x1b[P^_][\s\S]*?(?:\x1b\\)/g,X=/\x1b[\x20-\x7e]/g,Y=/[\x80-\x9f]/g,ee=/[\x00-\x06\x07\x08\x0b\x0c\x0d-\x1a\x1c-\x1f\x7f]/g;function te(s){return s.replace(Q,"").replace(V,"").replace(Z,"").replace(X,"").replace(Y,"").replace(ee,"")}function A(s){return te(s).replace(/[\r\n]+/g," ").trim()}function t(){return k()}function y(){return xdgConfig??join(k(),".config")}function R(){return process.env.CODEX_HOME?.trim()||join(t(),".codex")}function j(){return process.env.CLAUDE_CONFIG_DIR?.trim()||join(t(),".claude")}function _(){return process.env.VIBE_HOME?.trim()||join(t(),".vibe")}function O(){return process.env.HERMES_HOME?.trim()||join(t(),".hermes")}function E(){return process.env.AUTOHAND_HOME?.trim()||join(t(),".autohand")}function z(){return process.env.APPDATA?.trim()}function H(){return process.env.FLATPAK_XDG_CONFIG_HOME?.trim()}function re(s,l){try{let r=JSON.parse(readFileSync(s,"utf-8"));return !!(r.dependencies?.[l]||r.devDependencies?.[l])}catch{return false}}function ie(s=t(),l=existsSync){return l(join(s,".openclaw"))?join(s,".openclaw/skills"):l(join(s,".clawdbot"))?join(s,".clawdbot/skills"):l(join(s,".moltbot"))?join(s,".moltbot/skills"):join(s,".openclaw/skills")}var m={easbot:{name:"easbot",displayName:"EASBot",skillsDir:".easbot/skills",get globalSkillsDir(){return join(l(),"easbot","skills")},detectInstalled:async()=>true},"aider-desk":{name:"aider-desk",displayName:"AiderDesk",skillsDir:".aider-desk/skills",get globalSkillsDir(){return join(t(),".aider-desk/skills")},detectInstalled:async()=>existsSync(join(t(),".aider-desk"))},amp:{name:"amp",displayName:"Amp",skillsDir:".agents/skills",get globalSkillsDir(){return join(y(),"agents/skills")},detectInstalled:async()=>existsSync(join(y(),"amp"))},antigravity:{name:"antigravity",displayName:"Antigravity",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".gemini/antigravity/skills")},detectInstalled:async()=>existsSync(join(t(),".gemini/antigravity"))},"antigravity-cli":{name:"antigravity-cli",displayName:"Antigravity CLI",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".gemini/antigravity-cli/skills")},detectInstalled:async()=>existsSync(join(t(),".gemini/antigravity-cli"))},astrbot:{name:"astrbot",displayName:"AstrBot",skillsDir:"data/skills",get globalSkillsDir(){return join(t(),".astrbot/data/skills")},detectInstalled:async()=>existsSync(join(process.cwd(),"data/skills"))||existsSync(join(t(),".astrbot"))},"autohand-code":{name:"autohand-code",displayName:"Autohand Code CLI",skillsDir:".autohand/skills",get globalSkillsDir(){return join(E(),"skills")},detectInstalled:async()=>existsSync(E())},augment:{name:"augment",displayName:"Augment",skillsDir:".augment/skills",get globalSkillsDir(){return join(t(),".augment/skills")},detectInstalled:async()=>existsSync(join(t(),".augment"))},bob:{name:"bob",displayName:"IBM Bob",skillsDir:".bob/skills",get globalSkillsDir(){return join(t(),".bob/skills")},detectInstalled:async()=>existsSync(join(t(),".bob"))},"claude-code":{name:"claude-code",displayName:"Claude Code",skillsDir:".claude/skills",get globalSkillsDir(){return join(j(),"skills")},detectInstalled:async()=>existsSync(j())},openclaw:{name:"openclaw",displayName:"OpenClaw",skillsDir:".openclaw/skills",get globalSkillsDir(){return ie()},detectInstalled:async()=>existsSync(join(t(),".openclaw"))||existsSync(join(t(),".clawdbot"))||existsSync(join(t(),".moltbot"))},cline:{name:"cline",displayName:"Cline",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".agents","skills")},detectInstalled:async()=>existsSync(join(t(),".cline"))},"codearts-agent":{name:"codearts-agent",displayName:"CodeArts Agent",skillsDir:".codeartsdoer/skills",get globalSkillsDir(){return join(t(),".codeartsdoer/skills")},detectInstalled:async()=>existsSync(join(t(),".codeartsdoer"))},codebuddy:{name:"codebuddy",displayName:"CodeBuddy",skillsDir:".codebuddy/skills",get globalSkillsDir(){return join(t(),".codebuddy/skills")},detectInstalled:async()=>existsSync(join(process.cwd(),".codebuddy"))||existsSync(join(t(),".codebuddy"))},codemaker:{name:"codemaker",displayName:"Codemaker",skillsDir:".codemaker/skills",get globalSkillsDir(){return join(t(),".codemaker/skills")},detectInstalled:async()=>existsSync(join(t(),".codemaker"))},codestudio:{name:"codestudio",displayName:"Code Studio",skillsDir:".codestudio/skills",get globalSkillsDir(){return join(t(),".codestudio/skills")},detectInstalled:async()=>existsSync(join(t(),".codestudio"))},codex:{name:"codex",displayName:"Codex",skillsDir:".agents/skills",get globalSkillsDir(){return join(R(),"skills")},detectInstalled:async()=>existsSync(R())||existsSync("/etc/codex")},"command-code":{name:"command-code",displayName:"Command Code",skillsDir:".commandcode/skills",get globalSkillsDir(){return join(t(),".commandcode/skills")},detectInstalled:async()=>existsSync(join(t(),".commandcode"))},continue:{name:"continue",displayName:"Continue",skillsDir:".continue/skills",get globalSkillsDir(){return join(t(),".continue/skills")},detectInstalled:async()=>existsSync(join(process.cwd(),".continue"))||existsSync(join(t(),".continue"))},cortex:{name:"cortex",displayName:"Cortex Code",skillsDir:".cortex/skills",get globalSkillsDir(){return join(t(),".snowflake/cortex/skills")},detectInstalled:async()=>existsSync(join(t(),".snowflake/cortex"))},crush:{name:"crush",displayName:"Crush",skillsDir:".crush/skills",get globalSkillsDir(){return join(t(),".config/crush/skills")},detectInstalled:async()=>existsSync(join(t(),".config/crush"))},cursor:{name:"cursor",displayName:"Cursor",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".cursor/skills")},detectInstalled:async()=>existsSync(join(t(),".cursor"))},deepagents:{name:"deepagents",displayName:"Deep Agents",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".deepagents/agent/skills")},detectInstalled:async()=>existsSync(join(t(),".deepagents"))},devin:{name:"devin",displayName:"Devin for Terminal",skillsDir:".devin/skills",get globalSkillsDir(){return join(y(),"devin/skills")},detectInstalled:async()=>existsSync(join(y(),"devin"))},dexto:{name:"dexto",displayName:"Dexto",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".agents/skills")},detectInstalled:async()=>existsSync(join(t(),".dexto"))},droid:{name:"droid",displayName:"Droid",skillsDir:".factory/skills",get globalSkillsDir(){return join(t(),".factory/skills")},detectInstalled:async()=>existsSync(join(t(),".factory"))},eve:{name:"eve",displayName:"Eve",skillsDir:"agent/skills",globalSkillsDir:void 0,detectInstalled:async()=>{let s=process.cwd();return existsSync(join(s,"agent"))&&re(join(s,"package.json"),"eve")}},firebender:{name:"firebender",displayName:"Firebender",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".firebender/skills")},detectInstalled:async()=>existsSync(join(t(),".firebender"))},forgecode:{name:"forgecode",displayName:"ForgeCode",skillsDir:".forge/skills",get globalSkillsDir(){return join(t(),".forge/skills")},detectInstalled:async()=>existsSync(join(t(),".forge"))},"gemini-cli":{name:"gemini-cli",displayName:"Gemini CLI",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".gemini/skills")},detectInstalled:async()=>existsSync(join(t(),".gemini"))},"github-copilot":{name:"github-copilot",displayName:"GitHub Copilot",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".copilot/skills")},detectInstalled:async()=>existsSync(join(t(),".copilot"))},goose:{name:"goose",displayName:"Goose",skillsDir:".goose/skills",get globalSkillsDir(){return join(y(),"goose/skills")},detectInstalled:async()=>existsSync(join(y(),"goose"))},"hermes-agent":{name:"hermes-agent",displayName:"Hermes Agent",skillsDir:".hermes/skills",get globalSkillsDir(){return join(O(),"skills")},detectInstalled:async()=>existsSync(O())},"inference-sh":{name:"inference-sh",displayName:"inference.sh",skillsDir:".inferencesh/skills",get globalSkillsDir(){return join(t(),".inferencesh/skills")},detectInstalled:async()=>existsSync(join(t(),".inferencesh"))},jazz:{name:"jazz",displayName:"Jazz",skillsDir:".jazz/skills",get globalSkillsDir(){return join(t(),".jazz/skills")},detectInstalled:async()=>existsSync(join(t(),".jazz"))||existsSync(join(process.cwd(),".jazz"))},junie:{name:"junie",displayName:"Junie",skillsDir:".junie/skills",get globalSkillsDir(){return join(t(),".junie/skills")},detectInstalled:async()=>existsSync(join(t(),".junie"))},"iflow-cli":{name:"iflow-cli",displayName:"iFlow CLI",skillsDir:".iflow/skills",get globalSkillsDir(){return join(t(),".iflow/skills")},detectInstalled:async()=>existsSync(join(t(),".iflow"))},kilo:{name:"kilo",displayName:"Kilo Code",skillsDir:".kilocode/skills",get globalSkillsDir(){return join(t(),".kilocode/skills")},detectInstalled:async()=>existsSync(join(t(),".kilocode"))},"kimi-code-cli":{name:"kimi-code-cli",displayName:"Kimi Code CLI",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".agents/skills")},detectInstalled:async()=>existsSync(join(t(),".kimi-code"))||existsSync(join(t(),".kimi"))},"kiro-cli":{name:"kiro-cli",displayName:"Kiro CLI",skillsDir:".kiro/skills",get globalSkillsDir(){return join(t(),".kiro/skills")},detectInstalled:async()=>existsSync(join(t(),".kiro"))},kode:{name:"kode",displayName:"Kode",skillsDir:".kode/skills",get globalSkillsDir(){return join(t(),".kode/skills")},detectInstalled:async()=>existsSync(join(t(),".kode"))},lingma:{name:"lingma",displayName:"Lingma",skillsDir:".lingma/skills",get globalSkillsDir(){return join(t(),".lingma/skills")},detectInstalled:async()=>existsSync(join(t(),".lingma"))},loaf:{name:"loaf",displayName:"Loaf",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".agents/skills")},detectInstalled:async()=>existsSync(join(t(),".loaf"))},mcpjam:{name:"mcpjam",displayName:"MCPJam",skillsDir:".mcpjam/skills",get globalSkillsDir(){return join(t(),".mcpjam/skills")},detectInstalled:async()=>existsSync(join(t(),".mcpjam"))},"mistral-vibe":{name:"mistral-vibe",displayName:"Mistral Vibe",skillsDir:".vibe/skills",get globalSkillsDir(){return join(_(),"skills")},detectInstalled:async()=>existsSync(_())},moxby:{name:"moxby",displayName:"Moxby",skillsDir:".moxby/skills",get globalSkillsDir(){return join(t(),".moxby/skills")},detectInstalled:async()=>existsSync(join(t(),".moxby"))},mux:{name:"mux",displayName:"Mux",skillsDir:".mux/skills",get globalSkillsDir(){return join(t(),".mux/skills")},detectInstalled:async()=>existsSync(join(t(),".mux"))},opencode:{name:"opencode",displayName:"OpenCode",skillsDir:".agents/skills",get globalSkillsDir(){return join(y(),"opencode/skills")},detectInstalled:async()=>existsSync(join(y(),"opencode"))},openhands:{name:"openhands",displayName:"OpenHands",skillsDir:".openhands/skills",get globalSkillsDir(){return join(t(),".openhands/skills")},detectInstalled:async()=>existsSync(join(t(),".openhands"))},ona:{name:"ona",displayName:"Ona",skillsDir:".ona/skills",get globalSkillsDir(){return join(t(),".ona/skills")},detectInstalled:async()=>existsSync(join(t(),".ona"))},pi:{name:"pi",displayName:"Pi",skillsDir:".pi/skills",get globalSkillsDir(){return join(t(),".pi/agent/skills")},detectInstalled:async()=>existsSync(join(t(),".pi/agent"))},qoder:{name:"qoder",displayName:"Qoder",skillsDir:".qoder/skills",get globalSkillsDir(){return join(t(),".qoder/skills")},detectInstalled:async()=>existsSync(join(t(),".qoder"))},"qoder-cn":{name:"qoder-cn",displayName:"Qoder CN",skillsDir:".qoder/skills",get globalSkillsDir(){return join(t(),".qoder-cn/skills")},detectInstalled:async()=>existsSync(join(t(),".qoder-cn"))},"qwen-code":{name:"qwen-code",displayName:"Qwen Code",skillsDir:".qwen/skills",get globalSkillsDir(){return join(t(),".qwen/skills")},detectInstalled:async()=>existsSync(join(t(),".qwen"))},replit:{name:"replit",displayName:"Replit",skillsDir:".agents/skills",get globalSkillsDir(){return join(y(),"agents/skills")},detectInstalled:async()=>existsSync(join(process.cwd(),".replit"))},reasonix:{name:"reasonix",displayName:"Reasonix",skillsDir:".reasonix/skills",get globalSkillsDir(){return join(t(),".reasonix/skills")},detectInstalled:async()=>existsSync(join(t(),".reasonix"))},rovodev:{name:"rovodev",displayName:"Rovo Dev",skillsDir:".rovodev/skills",get globalSkillsDir(){return join(t(),".rovodev/skills")},detectInstalled:async()=>existsSync(join(t(),".rovodev"))},roo:{name:"roo",displayName:"Roo Code",skillsDir:".roo/skills",get globalSkillsDir(){return join(t(),".roo/skills")},detectInstalled:async()=>existsSync(join(t(),".roo"))},"tabnine-cli":{name:"tabnine-cli",displayName:"Tabnine CLI",skillsDir:".tabnine/agent/skills",get globalSkillsDir(){return join(t(),".tabnine/agent/skills")},detectInstalled:async()=>existsSync(join(t(),".tabnine"))},terramind:{name:"terramind",displayName:"Terramind",skillsDir:".terramind/skills",get globalSkillsDir(){return join(t(),".terramind/skills")},detectInstalled:async()=>existsSync(join(t(),".terramind"))},tinycloud:{name:"tinycloud",displayName:"Tinycloud",skillsDir:".tinycloud/skills",get globalSkillsDir(){return join(t(),".tinycloud/skills")},detectInstalled:async()=>existsSync(join(t(),".tinycloud"))},trae:{name:"trae",displayName:"Trae",skillsDir:".trae/skills",get globalSkillsDir(){return join(t(),".trae/skills")},detectInstalled:async()=>existsSync(join(t(),".trae"))},"trae-cn":{name:"trae-cn",displayName:"Trae CN",skillsDir:".trae/skills",get globalSkillsDir(){return join(t(),".trae-cn/skills")},detectInstalled:async()=>existsSync(join(t(),".trae-cn"))},warp:{name:"warp",displayName:"Warp",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".agents/skills")},detectInstalled:async()=>existsSync(join(t(),".warp"))},windsurf:{name:"windsurf",displayName:"Windsurf",skillsDir:".windsurf/skills",get globalSkillsDir(){return join(t(),".codeium/windsurf/skills")},detectInstalled:async()=>existsSync(join(t(),".codeium/windsurf"))},zed:{name:"zed",displayName:"Zed",skillsDir:".agents/skills",get globalSkillsDir(){return join(t(),".agents/skills")},detectInstalled:async()=>existsSync(join(y(),"zed"))||!!z()&&existsSync(join(z(),"Zed"))||!!H()&&existsSync(join(H(),"zed"))},zencoder:{name:"zencoder",displayName:"Zencoder",skillsDir:".zencoder/skills",get globalSkillsDir(){return join(t(),".zencoder/skills")},detectInstalled:async()=>existsSync(join(t(),".zencoder"))},zenflow:{name:"zenflow",displayName:"Zenflow",skillsDir:".zencoder/skills",get globalSkillsDir(){return join(t(),".zencoder/skills")},detectInstalled:async()=>existsSync(join(t(),".zencoder"))},neovate:{name:"neovate",displayName:"Neovate",skillsDir:".neovate/skills",get globalSkillsDir(){return join(t(),".neovate/skills")},detectInstalled:async()=>existsSync(join(t(),".neovate"))},pochi:{name:"pochi",displayName:"Pochi",skillsDir:".pochi/skills",get globalSkillsDir(){return join(t(),".pochi/skills")},detectInstalled:async()=>existsSync(join(t(),".pochi"))},promptscript:{name:"promptscript",displayName:"PromptScript",skillsDir:".agents/skills",globalSkillsDir:void 0,detectInstalled:async()=>existsSync(join(process.cwd(),".promptscript"))||existsSync(join(process.cwd(),"promptscript.yaml"))},adal:{name:"adal",displayName:"AdaL",skillsDir:".adal/skills",get globalSkillsDir(){return join(t(),".adal/skills")},detectInstalled:async()=>existsSync(join(t(),".adal"))},universal:{name:"universal",displayName:"Universal",skillsDir:".agents/skills",get globalSkillsDir(){return join(y(),"agents/skills")},detectInstalled:async()=>false}};async function _e(){return (await Promise.all(Object.entries(m).map(async([l,r])=>({type:l,installed:await r.detectInstalled()})))).filter(l=>l.installed).map(l=>l.type)}function Oe(s){return m[s]}var M=join("agent","subagents");function ae(s=process.cwd()){let l=join(s,M);if(!existsSync(l))return [];try{return readdirSync(l,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>r.name).sort()}catch{return []}}function U(s,l){let r=m[s];if(l==="project")return r.skillsDir===".agents/skills";if(r.globalSkillsDir===void 0)return false;let i=resolve(k()||homedir(),".agents","skills");return resolve(r.globalSkillsDir)===i}function oe(s){return Object.entries(m).filter(([l])=>U(l,s)).map(([l])=>l)}function Ee(s){let l=new Set(oe(s));return Object.keys(m).filter(r=>!l.has(r))}var G=/^\.[^/]+\/skills$/;function $(){let s=new Set;for(let l of Object.values(m))l.skillsDir&&G.test(l.skillsDir)&&s.add(l.skillsDir);return Array.from(s).sort()}function ce(){let s=new Set;for(let l of Object.values(m))l.globalSkillsDir!==void 0&&s.add(l.globalSkillsDir);return Array.from(s).sort()}function ze(){let s=$(),l=ce(),r=Array.from(new Set([...s,...l])).sort();return {project:s,global:l,all:r}}function W(){return $().map(s=>`${s}/`)}function He(s,l){let r=m[s];return l==="global"?U(s,"global"):r.skillsDir===".agents/skills"}var q="*";function Fe(s){if(!s||s.length===0)return [];let l=Object.keys(m),r=[];for(let i of s)if(i!==q){if(i.includes("/")||i.includes("**")){r.push(i);continue}K.test(i)?l.some(a=>Wildcard.match(a,i))||r.push(i):l.includes(i)||r.push(i);}return r}function Be(s){if(!s||s.length===0)return [];let l=Object.keys(m);if(s.includes(q))return [...l];if(s.some(r=>K.test(r))){let r=new Set;for(let i of s)if(!(i.includes("/")||i.includes("**")))for(let a of l)Wildcard.match(a,i)&&r.add(a);return Array.from(r)}return Array.from(new Set(s.filter(r=>!r.includes("/")&&!r.includes("**"))))}var K=/[*?[{}]/;function de(s={}){let l=s.cwd??process.cwd(),r=s.agentFilter??Object.keys(m),i=new Set;for(let a of r){let o=m[a];if(!o.skillsDir||!G.test(o.skillsDir))continue;let u=o.skillsDir===".agents/skills"?join(l,".agents","skills"):join(l,o.skillsDir);if(a==="eve")for(let g of ae(l)){let b=join(l,M,g,"skills");i.add(h(`${b}/**/SKILL.md`));}i.add(h(`${u}/**/SKILL.md`));}return Array.from(i).sort()}function ge(s={}){let l=s.agentFilter??Object.keys(m),r=new Set;for(let i of l){let a=m[i];a.globalSkillsDir!==void 0&&r.add(h(`${a.globalSkillsDir}/**/SKILL.md`));}return Array.from(r).sort()}function Me(s={}){let l=de(s),r=ge(s),i=Array.from(new Set([...l,...r])).sort();return {project:l,global:r,all:i}}function h(s){return s.replace(/\\/g,"/")}function Ue(){let s=new Set;for(let r of Object.values(m)){if(r.globalSkillsDir===void 0)continue;let i=h(r.globalSkillsDir);i!==""&&s.add(i);}let l=h(join(k()||homedir(),".agents","skills"));return s.add(l),Array.from(s).sort()}var ke=process.env.SKILLS_DOWNLOAD_URL||"https://skills.sh",me={"zapier/connectors":{downloadUrl:s=>`https://connectors-skills.zapier.com/download/${encodeURIComponent(s)}/snapshot.json`}},Ze=["houjallen","vercel-labs","anthropics"],v=1e4;function pe(s){return s.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}var C=false;function Qe(){C=false;}async function N(s,l,r){try{let i=`https://api.github.com/repos/${s}/git/trees/${encodeURIComponent(l)}?recursive=1`,a={Accept:"application/vnd.github.v3+json","User-Agent":"skills-cli"};r&&(a.Authorization=`Bearer ${r}`);let o=await fetch(i,{headers:a,signal:AbortSignal.timeout(v)});if(o.ok){let g=await o.json();return {tree:{sha:g.sha,branch:l,tree:g.tree},rateLimited:!1}}return {tree:null,rateLimited:o.status===403&&o.headers.get("x-ratelimit-remaining")==="0"}}catch{return {tree:null,rateLimited:false}}}async function fe(s,l,r){let i=l?[l]:["HEAD","main","master"];if(C&&r){let u=r();if(!u)return null;for(let g of i){let b=await N(s,g,u);if(b.tree)return b.tree}return null}let a=false;for(let u of i){let g=await N(s,u,null);if(g.tree)return g.tree;if(g.rateLimited){a=true;break}}if(!a||!r)return null;C=true;let o=r();if(!o)return null;for(let u of i){let g=await N(s,u,o);if(g.tree)return g.tree}return null}function Ve(s,l){let r=l.replace(/\\/g,"/");return r.toLowerCase().endsWith("/skill.md")?r=r.slice(0,-9):r.toLowerCase().endsWith("skill.md")&&(r=r.slice(0,-8)),r.endsWith("/")&&(r=r.slice(0,-1)),r?s.tree.find(a=>a.type==="tree"&&a.path===r)?.sha??null:s.sha}var ye=["","skills/","skills/.curated/","skills/.experimental/","skills/.system/"];function be(){let s=W();return Array.from(new Set([...ye,...s]))}function De(s,l){let r=s.tree.filter(k=>k.type==="blob"&&k.path.toLowerCase().endsWith("skill.md")).map(k=>k.path),i=l?l.endsWith("/")?l:l+"/":"",a=i?r.filter(k=>k.startsWith(i)||k===i+"SKILL.md"):r;if(a.length===0)return [];let o=[],u=new Set,g=new Set(["node_modules",".git","dist","build","__pycache__"]),b=new Set(a.map(k=>k.toLowerCase()));for(let k of be()){let c=i+k,p=k!=="";for(let d of a){if(!d.startsWith(c))continue;let x=d.slice(c.length);if(x.toLowerCase()==="skill.md"){u.has(d)||(o.push(d),u.add(d));continue}let f=x.split("/");if(f.length===2&&f[1].toLowerCase()==="skill.md"){u.has(d)||(o.push(d),u.add(d));continue}if(p&&f.length===3&&f[2].toLowerCase()==="skill.md"&&!g.has(f[0])&&!g.has(f[1])){let D=`${c}${f[0]}/SKILL.md`.toLowerCase();!b.has(D)&&!u.has(d)&&(o.push(d),u.add(d));}}}return o.length>0?o:a.filter(k=>k.split("/").length<=6)}async function Se(s,l,r){try{let i=`https://raw.githubusercontent.com/${s}/${l}/${r}`,a=await fetch(i,{signal:AbortSignal.timeout(v)});return a.ok?await a.text():null}catch{return null}}async function he(s,l){try{let[r,i]=s.split("/"),a=`${ke}/api/download/${encodeURIComponent(r)}/${encodeURIComponent(i)}/${encodeURIComponent(l)}`,u=me[s.toLowerCase()]?.downloadUrl(l)??a,g=await fetch(u,{signal:AbortSignal.timeout(v)});return g.ok?await g.json():null}catch{return null}}function xe(s){let l=createHash("sha256");for(let r of [...s].sort((i,a)=>i.path.localeCompare(a.path)))l.update(r.path),l.update(r.contents);return l.digest("hex")}async function Xe(s,l={}){let r=await fe(s,l.ref,l.getToken);if(!r)return null;let i=De(r,l.subpath);if(i.length===0)return null;let a=await Promise.all(i.map(async c=>{let p=await Se(s,r.branch,c);return {mdPath:c,content:p}})),o=[];for(let{mdPath:c,content:p}of a){if(!p)continue;let{data:d}=T(p);if(!d.name||!d.description||typeof d.name!="string"||typeof d.description!="string"||d.metadata?.internal===true&&!l.includeInternal)continue;let f=A(d.name),D=A(d.description);o.push({mdPath:c,name:f,description:D,content:p,slug:pe(f),metadata:d.metadata});}if(o.length===0)return null;let u=s.toLowerCase(),g=await Promise.all(o.map(async c=>{let p=await he(u,c.slug);return {skill:c,download:p}}));return g.every(c=>c.download!==null)?{skills:g.map(({skill:c,download:p})=>{let d=c.mdPath.toLowerCase(),f=(d.endsWith("/skill.md")?c.mdPath.slice(0,-9):d==="skill.md"?"":c.mdPath.slice(0,-9))?p.files:p.files.filter(D=>D.path.toLowerCase()==="skill.md");return {name:c.name,description:c.description,path:"",rawContent:c.content,metadata:c.metadata,files:f,snapshotHash:f.length===p.files.length?p.hash:xe(f),repoPath:c.mdPath}}),tree:r}:null}
2
+ export{fe as A,Ve as B,De as C,Xe as D,te as a,A as b,T as c,ie as d,m as e,_e as f,Oe as g,M as h,ae as i,U as j,oe as k,Ee as l,G as m,$ as n,ce as o,ze as p,W as q,He as r,Fe as s,Be as t,Me as u,Ue as v,me as w,Ze as x,pe as y,Qe as z};
@@ -0,0 +1 @@
1
+ import {g}from'./chunk-676OG55M.mjs';import {z}from'./chunk-2YVJ7YP6.mjs';import {u,v as v$1,e}from'./chunk-6PJ3YQA7.mjs';import {Glob}from'@easbot/utils';import {stat,realpath}from'fs/promises';import {dirname,join}from'path';async function v(i={}){let o=i.cwd??process.cwd(),e$1=i.scope??"project",r=u({cwd:o,agentFilter:i.agentFilter}),s;if(e$1==="project"?s=r.project:e$1==="global"?s=r.global:s=r.all,s.length===0)return [];let a=new Set,c=[],T=await Promise.all(s.map(n=>Glob.scan(n,{cwd:o,absolute:true,ignore:Glob.DEFAULT_IGNORE_PATTERNS,follow:true})));for(let n of T)for(let l of n)a.has(l)||(a.add(l),c.push(l));let $=Object.keys(e),G="/",m=[],F=o.replace(/\\/g,"/"),M=v$1();for(let n of c){let l=dirname(n),g$1=l.replace(/\\/g,"/"),p=g$1.split(G),B=p.length>=3?`${p[p.length-3]??""}/${p[p.length-2]??""}`:"",d=await z(n);if(!d)continue;let E=g$1.startsWith(`${F}/`),I=M.some(t=>t!==""&&g$1.startsWith(`${t}/`)),f=E&&!I?"project":"global",k=[],R=e$1==="both"?f==="project":e$1==="project",C=e$1==="both"?f==="global":e$1==="global",b=t=>t.replace(/\\/g,"/"),L=b(l).replace(/\/[^/]+\/?$/,"");for(let t of $){let P=e[t],S=[];R&&P.skillsDir!==void 0&&S.push(g(t,false,o)),C&&P.globalSkillsDir!==void 0&&S.push(g(t,true,o));for(let w of S)if(b(w).replace(/\/+$/,"")===L)try{let D=join(w,d.name);if(!(await stat(D)).isDirectory())continue;await realpath(D),k.includes(t)||k.push(t);break}catch{}}m.push({name:d.name,skillDir:l,skillMdPath:n,parentDir:B,scope:f,agents:k});}return m}async function Z(i={}){let o=await v(i),e=new Set,r=[];for(let s of o){let a=`${s.scope}:${s.name}`;if(e.has(a))continue;e.add(a);let c=await z(s.skillMdPath);c&&r.push(c);}return r}export{v as a,Z as b};
@@ -0,0 +1,2 @@
1
+ var u="https://add-skill.vercel.sh/t",m="https://add-skill.vercel.sh/audit",a=null,o=null;function f(t){o=t;}function g(){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 T(){return !process.env.DISABLE_TELEMETRY&&!process.env.DO_NOT_TRACK}function p(t){a=t;}async function y(t,e,n=3e3){if(e.length===0)return null;try{let s=new URLSearchParams({source:t,skills:e.join(",")}),r=new AbortController,c=setTimeout(()=>r.abort(),n),l=await fetch(`${m}?${s.toString()}`,{signal:r.signal});return clearTimeout(c),l.ok?await l.json():null}catch{return null}}var i=[];function D(t){if(T())try{let e=new URLSearchParams;a&&e.set("v",a),g()&&e.set("ci","1"),o&&e.set("agent",o);for(let[s,r]of Object.entries(t))r!=null&&e.set(s,String(r));let n=fetch(`${u}?${e.toString()}`).catch(()=>{}).then(()=>{});i.push(n);}catch{}}async function C(t=5e3){if(i.length===0)return;let e=new Promise(n=>setTimeout(n,t));await Promise.race([Promise.all(i),e]);}
2
+ export{f as a,p as b,y as c,D as d,C as e};