@easbot/skills 0.3.13 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +432 -125
- package/README.md +427 -125
- package/dist/chunks/blob-SCUVTYVE.cjs +1 -0
- package/dist/chunks/{blob-3PZEQWTP.mjs → blob-WZAGX4RO.mjs} +1 -1
- package/dist/chunks/chunk-2E6BHPFV.cjs +265 -0
- package/dist/chunks/{chunk-ZBKGF7PA.mjs → chunk-5BDDXFOF.mjs} +1 -1
- package/dist/chunks/chunk-5RWSXDNO.cjs +3 -0
- package/dist/chunks/chunk-6NTEYECA.mjs +22 -0
- package/dist/chunks/{chunk-4D5RQDWJ.mjs → chunk-AQYRRXU5.mjs} +2 -2
- package/dist/chunks/{chunk-CY6UI6SJ.cjs → chunk-DFBKA5A6.cjs} +1 -1
- package/dist/chunks/chunk-DNE3XPCJ.cjs +2 -0
- package/dist/chunks/chunk-J6PRUXFG.mjs +265 -0
- package/dist/chunks/chunk-JCOXRETY.cjs +22 -0
- package/dist/chunks/chunk-NH4TYEPW.mjs +3 -0
- package/dist/chunks/{chunk-S6YNGR7S.cjs → chunk-Q2MOP5ZW.cjs} +2 -2
- package/dist/chunks/{chunk-5BL3KG26.cjs → chunk-UGHF4GOW.cjs} +2 -2
- package/dist/chunks/chunk-ZJS7IO5V.mjs +2 -0
- package/dist/chunks/cli-handler-3FSM4C7L.mjs +1 -0
- package/dist/chunks/cli-handler-B6H4RZEM.cjs +1 -0
- package/dist/chunks/{installer-REG45DC2.mjs → installer-NJN3PT5F.mjs} +1 -1
- package/dist/chunks/installer-YDJBZTQ7.cjs +1 -0
- package/dist/chunks/{interfaces-UIS44Q7A.cjs → interfaces-5BH4K5TM.cjs} +1 -1
- package/dist/chunks/local-lock-SPZB3AB7.cjs +1 -0
- package/dist/chunks/local-lock-ZHTDWYXF.mjs +1 -0
- package/dist/chunks/scan-6W47D2KJ.mjs +1 -0
- package/dist/chunks/scan-L6UNVP3V.cjs +1 -0
- package/dist/chunks/skill-lock-MNRZ7TIX.mjs +1 -0
- package/dist/chunks/skill-lock-VX2HGPTY.cjs +1 -0
- package/dist/chunks/store-TSS4BMBF.cjs +1 -0
- package/dist/chunks/{store-IVDLGLET.mjs → store-UJPPYDBG.mjs} +1 -1
- package/dist/chunks/telemetry-B4PS27S5.cjs +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +5 -6
- package/dist/chunks/blob-ZDEX2HRV.cjs +0 -1
- package/dist/chunks/chunk-5W7HC7BY.mjs +0 -22
- package/dist/chunks/chunk-CXH3OTTQ.cjs +0 -22
- package/dist/chunks/chunk-K2XGYOXP.mjs +0 -267
- package/dist/chunks/chunk-NKIQLESR.mjs +0 -3
- package/dist/chunks/chunk-ROCFLAYZ.mjs +0 -2
- package/dist/chunks/chunk-RVR3DSD2.cjs +0 -2
- package/dist/chunks/chunk-SXUY2J75.cjs +0 -3
- package/dist/chunks/chunk-UJWB7QQ6.cjs +0 -267
- package/dist/chunks/cli-handler-667TYY4I.cjs +0 -1
- package/dist/chunks/cli-handler-YSDUNKKZ.mjs +0 -1
- package/dist/chunks/installer-SOVGUW3M.cjs +0 -1
- package/dist/chunks/local-lock-AWD3LLEY.mjs +0 -1
- package/dist/chunks/local-lock-GIZDVF3X.cjs +0 -1
- package/dist/chunks/scan-57D2H7LP.cjs +0 -1
- package/dist/chunks/scan-WAXGJM5N.mjs +0 -1
- package/dist/chunks/skill-lock-DZMA75MY.mjs +0 -1
- package/dist/chunks/skill-lock-XTWQYBRG.cjs +0 -1
- package/dist/chunks/store-F7PGGZIO.cjs +0 -1
- package/dist/chunks/telemetry-LCGTSJDM.cjs +0 -1
- /package/dist/chunks/{chunk-VRHWDHQV.cjs → chunk-GWUDKZEH.cjs} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';var chunkISMGLHYS_cjs=require('./chunk-ISMGLHYS.cjs'),chunkXGUPIAAF_cjs=require('./chunk-XGUPIAAF.cjs'),chunkDNE3XPCJ_cjs=require('./chunk-DNE3XPCJ.cjs'),chunkE7AHWFZN_cjs=require('./chunk-E7AHWFZN.cjs'),chunkGWUDKZEH_cjs=require('./chunk-GWUDKZEH.cjs'),promises=require('fs/promises'),path=require('path'),crypto=require('crypto'),fs=require('fs'),utils=require('@easbot/utils'),pe=require('simple-git'),os=require('os'),child_process=require('child_process'),util=require('util'),zlib=require('zlib');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var pe__default=/*#__PURE__*/_interopDefault(pe);var K=6;function he(n){let t=n.indexOf(":");return t<0||t===n.length-1?null:{marketId:n.slice(0,t),pluginSlug:n.slice(t+1)}}function ge(n){let t=he(n);return t?`plugins/${t.pluginSlug}`:null}function It(n,t,e){if(!n.marketId||!n.pluginId)return null;let r=ge(n.pluginId);return r?`${t.replace(/\\/g,"/").replace(/\/+$/,"")}/${n.marketId}/${r}/${e}`:null}var At=3e5,nt=(()=>{let n=process.env.SKILLS_CLONE_TIMEOUT;if(!n)return At;let t=Number.parseInt(n,10);return Number.isFinite(t)&&t>0?t:At})(),Wt=util.promisify(child_process.execFile),L=class extends Error{constructor(e,r,s=false,i=false){super(e);chunkGWUDKZEH_cjs.b(this,"url");chunkGWUDKZEH_cjs.b(this,"isTimeout");chunkGWUDKZEH_cjs.b(this,"isAuthError");this.name="GitCloneError",this.url=r,this.isTimeout=s,this.isAuthError=i;}};function Pe(n){let t=n.match(/^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/i);if(t){let e=t[1],r=t[2];return {owner:e,repo:r,slug:`${e}/${r}`,sshUrl:`git@github.com:${e}/${r}.git`}}try{let e=new URL(n);if(e.hostname!=="github.com")return null;let r=e.pathname.match(/^\/([^/]+)\/([^/]+?)(?:\.git)?\/?$/);if(!r)return null;let s=r[1],i=r[2];return {owner:s,repo:i,slug:`${s}/${i}`,sshUrl:`git@github.com:${s}/${i}.git`}}catch{return null}}function Le(n){try{let t=new URL(n);return t.protocol==="https:"&&t.hostname==="github.com"}catch{return false}}function Dt(n){let t=n.toLowerCase();return t.includes("saml sso")||t.includes("enforced sso")||t.includes("enabled or enforced saml")||t.includes("re-authorize the oauth application")}function ve(n){return n.includes("Authentication failed")||n.includes("could not read Username")||n.includes("Permission denied")||n.includes("Repository not found")||n.includes("requested URL returned error: 403")||Dt(n)}function et(n){let t={...process.env};return delete t.GIT_ASKPASS,delete t.GIT_EDITOR,delete t.GIT_SEQUENCE_EDITOR,delete t.GIT_PAGER,delete t.GIT_SSH_COMMAND,delete t.GIT_CONFIG_GLOBAL,delete t.GIT_CONFIG_SYSTEM,delete t.PAGER,delete t.EDITOR,delete t.VISUAL,t.GIT_TERMINAL_PROMPT="0",t.GIT_LFS_SKIP_SMUDGE="1",Object.assign(t,n),pe__default.default({timeout:{block:nt},config:["filter.lfs.required=false","protocol.version=2","remote.origin.promisor=false"]}).env(t)}async function Kt(n){try{await promises.rm(n,{recursive:!0,force:!0});}catch{}await promises.mkdir(n,{recursive:true});}async function Ie(n,t,e){let r=n.slug;try{let{stdout:i,stderr:o}=await Wt("gh",["auth","status","-h","github.com"],{timeout:5e3,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),l=`${i}${o}`;/Git operations protocol:\s+ssh/i.test(l)&&(r=n.sshUrl);}catch{return false}return await Wt("gh",["repo","clone",r,t,"--",...e?["--depth=1","--branch",e]:["--depth=1"]],{timeout:nt,env:{...process.env,GIT_TERMINAL_PROMPT:"0"}}),true}function $e(n,t,e){return t&&Dt(e)?`GitHub blocked HTTPS access to ${n} 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 ${t.sshUrl}
|
|
5
|
+
- Verify access with: gh auth status -h github.com or ssh -T git@github.com`:t?`Authentication failed for ${n}.
|
|
6
|
+
- For private repos, ensure you have access
|
|
7
|
+
- Retry with SSH: easbot skills add ${t.sshUrl}
|
|
8
|
+
- Check access with: gh auth status -h github.com or ssh -T git@github.com`:`Authentication failed for ${n}.
|
|
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 Ut(n,t,e){if(e){await utils.Filesystem.mkdir(path.dirname(e),{recursive:true});let o=t?["--depth","1","--branch",t]:["--depth","1"];try{return await et().clone(n,e,o),e}catch(l){throw await promises.rm(e,{recursive:true,force:true}).catch(()=>{}),l}}let r=await promises.mkdtemp(path.join(os.tmpdir(),"skills-")),s=t?["--depth","1","--branch",t]:["--depth","1"],i=Pe(n);try{return await et().clone(n,r,s),r}catch(o){let l=o instanceof Error?o.message:String(o),a=l.includes("block timeout")||l.includes("timed out"),c=ve(l);if(a){try{await promises.rm(r,{recursive:!0,force:!0});}catch{}let f=Math.round(nt/1e3);throw new L(`Clone timed out after ${f}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)`,n,true,false)}if(c&&i&&Le(n)){try{if(await Kt(r),await Ie(i,r,t))return r}catch{}try{return await Kt(r),await et({GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND??"ssh -o BatchMode=yes"}).clone(i.sshUrl,r,s),r}catch{}}try{await promises.rm(r,{recursive:!0,force:!0});}catch{}if(c)throw new L($e(n,i,l),n,false,true);let u=l.includes("filter.smudge")?`
|
|
17
|
+
- The repo defines a smudge/clean filter that Git considers unsafe.
|
|
18
|
+
Enable it with: git config --global protocol.allowUnsafeFilter true
|
|
19
|
+
Or upgrade Git, or unset filter.<driver>.* in the source repo.`:"";throw new L(`Failed to clone ${n}: ${l}${u}`,n,false,false)}}async function In(n){let t=path.normalize(path.resolve(n)),e=path.normalize(path.resolve(os.tmpdir()));if(!t.startsWith(e+path.sep)&&t!==e)throw new Error("Attempted to clean up directory outside of temp directory");await promises.rm(n,{recursive:true,force:true});}function j(n){if(n.type==="local")return null;let t=n.url.match(/^git@[^:]+:(.+)$/);if(t){let e=t[1];return e=e.replace(/\.git$/,""),e.includes("/")?e:null}if(n.url.startsWith("ssh://"))try{let r=new URL(n.url).pathname.slice(1);return r=r.replace(/\.git$/,""),r.includes("/")?r:null}catch{return null}if(!n.url.startsWith("http://")&&!n.url.startsWith("https://"))return null;try{let r=new URL(n.url).pathname.slice(1);if(r=r.replace(/\.git$/,""),r.includes("/"))return r}catch{}return null}function Kn(n){let t=n.match(/^([^/]+)\/([^/]+)$/);return t?{owner:t[1],repo:t[2]}:null}async function Nn(n,t){try{let e=await fetch(`https://api.github.com/repos/${n}/${t}`);return e.ok?(await e.json()).private===!0:null}catch{return null}}async function Tt(n,t){try{let e=await fetch(`https://api.github.com/repos/${n}/${t}`,{headers:{Accept:"application/vnd.github+json"}});if(!e.ok)return null;let r=await e.json();return typeof r.default_branch=="string"&&r.default_branch.length>0?r.default_branch:null}catch{return null}}function O(n){let e=n.replace(/\\/g,"/").split("/");for(let r of e)if(r==="..")throw new Error(`Unsafe subpath: "${n}" contains path traversal segments. Subpaths must not contain ".." components.`);return n}function We(n){return path.isAbsolute(n)||n.startsWith("./")||n.startsWith("../")||n==="."||n===".."||/^[a-zA-Z]:[/\\]/.test(n)}var Ke={"coinbase/agentWallet":"coinbase/agentic-wallet-skills"};function rt(n){try{return decodeURIComponent(n)}catch{return n}}function Ne(n){if(n.startsWith("github:")||n.startsWith("gitlab:")||n.startsWith("git@")||/^ssh:\/\/.+\.git(?:$|[/?])/i.test(n))return true;if(n.startsWith("http://")||n.startsWith("https://"))try{let t=new URL(n),e=t.pathname;if(t.hostname==="github.com")return /^\/[^/]+\/[^/]+(?:\.git)?(?:\/tree\/[^/]+(?:\/.*)?)?\/?$/.test(e);if(t.hostname==="gitlab.com")return /^\/.+?\/[^/]+(?:\.git)?(?:\/-\/tree\/[^/]+(?:\/.*)?)?\/?$/.test(e)}catch{}return /^https?:\/\/.+\.git(?:$|[/?])/i.test(n)?true:!n.includes(":")&&!n.startsWith(".")&&!n.startsWith("/")&&/^([^/]+)\/([^/]+)(?:\/(.+)|@(.+))?$/.test(n)}function De(n){let t=n.indexOf("#");if(t<0)return {inputWithoutFragment:n};let e=n.slice(0,t),r=n.slice(t+1);if(!r)return {inputWithoutFragment:e};if(!Ne(e))return {inputWithoutFragment:n};let s=r.indexOf("@");if(s===-1)return {inputWithoutFragment:e,ref:rt(r)};let i=r.slice(0,s),o=r.slice(s+1);return {inputWithoutFragment:e,ref:i?rt(i):void 0,subpath:o?rt(o):void 0}}function Ct(n,t,e){return t?`${n}#${t}${e?`@${e}`:""}`:n}function Ft(n){if(We(n)){let k=path.resolve(n);return {type:"local",url:k,localPath:k}}let{inputWithoutFragment:t,ref:e,subpath:r}=De(n);n=t;let s=Ke[n];s&&(n=s);let i=n.match(/^github:(.+)$/);if(i)return Ft(Ct(i[1],e,r));let o=n.match(/^gitlab:(.+)$/);if(o)return Ft(Ct(`https://gitlab.com/${o[1]}`,e,r));let l=n.match(/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)\/(.+)/);if(l){let[,k,g,w,y]=l;return {type:"github",url:`https://github.com/${k}/${g}.git`,ref:w||e,subpath:y&&O(y)}}let a=n.match(/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)$/);if(a){let[,k,g,w]=a;return {type:"github",url:`https://github.com/${k}/${g}.git`,ref:w||e}}let c=n.match(/github\.com\/([^/]+)\/([^/]+)/);if(c){let[,k,g]=c,w=g.replace(/\.git$/,"");return {type:"github",url:`https://github.com/${k}/${w}.git`,...e?{ref:e}:{}}}let u=n.match(/^(https?):\/\/([^/]+)\/(.+?)\/-\/tree\/([^/]+)\/(.+)/);if(u){let[,k,g,w,y,p]=u;if(g!=="github.com"&&w)return {type:"gitlab",url:`${k}://${g}/${w.replace(/\.git$/,"")}.git`,ref:y||e,subpath:p&&O(p)}}let f=n.match(/^(https?):\/\/([^/]+)\/(.+?)\/-\/tree\/([^/]+)$/);if(f){let[,k,g,w,y]=f;if(g!=="github.com"&&w)return {type:"gitlab",url:`${k}://${g}/${w.replace(/\.git$/,"")}.git`,ref:y||e}}let h=n.match(/gitlab\.com\/(.+?)(?:\.git)?\/?$/);if(h){let k=h[1];if(k.includes("/"))return {type:"gitlab",url:`https://gitlab.com/${k}.git`,...e?{ref:e}:{}}}let x=n.match(/^([^/@]+)\/([^/@]+)@(.+)?$/);if(x&&!n.includes(":")&&!n.startsWith(".")&&!n.startsWith("/")){let k=x[1],g=x[2],w=x[3];if(!w)return {type:"github",url:`https://github.com/${k}/${g}.git`,...e?{ref:e}:{}};let y=O(w);return {type:"github",url:`https://github.com/${k}/${g}.git`,...e?{ref:e}:{},...y?{subpath:y}:{}}}let E=n.match(/^([^/@]+)\/([^/@]+)(?:\/(.+?))?\/?$/);if(E&&!n.includes(":")&&!n.startsWith(".")&&!n.startsWith("/")){let[,k,g,w]=E;return {type:"github",url:`https://github.com/${k}/${g}.git`,...e?{ref:e}:{},subpath:r??(w&&O(w))}}return Ue(n)?{type:"well-known",url:n}:{type:"git",url:n,...e?{ref:e}:{},...r?{subpath:r}:{}}}function Ue(n){if(!n.startsWith("http://")&&!n.startsWith("https://"))return false;try{let t=new URL(n);return !(["github.com","gitlab.com","raw.githubusercontent.com"].includes(t.hostname)||n.endsWith(".git"))}catch{return false}}var Mt="https://schemas.agentskills.io/discovery/0.2.0/schema.json",Me=/\/schemas\/agent-skills\/index\.v1\.json$/,_e=50*1024*1024,ze=1e3;function He(n,t){let e=n.skillPath;if(typeof e=="string"&&e.trim()!==""&&e!==null)return e.replace(/^\/+/,"").replace(/\/+$/,"");if(typeof n.sourceUrl=="string"&&n.sourceUrl)try{let s=new URL(n.sourceUrl).pathname,i=/\/\.well-known\/(?:agent-skills|skills)\/(.*?)\/SKILL\.md$/,o=s.match(i);if(o?.[1])return o[1];let l=s.match(/^(.*?)\/[^/]+\/SKILL\.md$/);if(l?.[1])return l[1]}catch{}if(typeof n.installName=="string"&&n.installName){let r=n.installName.lastIndexOf("@");if(r>=0){let s=n.installName.slice(r+1);if(s.includes("/"))return s.replace(/^\/+/,"")}}return t}var it=class{constructor(){chunkGWUDKZEH_cjs.b(this,"id","well-known");chunkGWUDKZEH_cjs.b(this,"displayName","Well-Known Skills");chunkGWUDKZEH_cjs.b(this,"WELL_KNOWN_PATHS",[".well-known/agent-skills",".well-known/skills"]);chunkGWUDKZEH_cjs.b(this,"INDEX_FILE","index.json");}match(t){if(!t.startsWith("http://")&&!t.startsWith("https://"))return {matches:false};try{let e=new URL(t);return ["github.com","gitlab.com","huggingface.co"].includes(e.hostname)?{matches:!1}:{matches:!0,sourceIdentifier:`wellknown/${e.hostname}`}}catch{return {matches:false}}}async fetchIndex(t){return (await this.fetchIndexCandidates(t))[0]??null}async fetchIndexCandidates(t){try{let e=new URL(t),r=e.pathname.replace(/\/$/,""),s=[],i=r.match(/\/\.well-known\/(agent-skills|skills)\/?$/);if(i?.[1]){let l=`.well-known/${i[1]}`;s.push({indexUrl:`${e.protocol}//${e.host}${r}/${this.INDEX_FILE}`,baseUrl:`${e.protocol}//${e.host}${r.replace(/\/\.well-known\/(?:agent-skills|skills)$/,"")}`,wellKnownPath:l});}for(let l of this.WELL_KNOWN_PATHS)s.push({indexUrl:`${e.protocol}//${e.host}${r}/${l}/${this.INDEX_FILE}`,baseUrl:`${e.protocol}//${e.host}${r}`,wellKnownPath:l}),r&&r!==""&&s.push({indexUrl:`${e.protocol}//${e.host}/${l}/${this.INDEX_FILE}`,baseUrl:`${e.protocol}//${e.host}`,wellKnownPath:l});let o=[];for(let{indexUrl:l,baseUrl:a,wellKnownPath:c}of s)try{let u=await fetch(l);if(!u.ok)continue;let f=await u.json(),h=this.normalizeIndex(f,l,c);if(!h)continue;o.push({index:h.index,entries:h.entries,resolvedBaseUrl:a,resolvedWellKnownPath:c,indexUrl:l});}catch{}return o}catch{return []}}normalizeIndex(t,e,r){if(!t||typeof t!="object")return null;let s=t;if(!Array.isArray(s.skills))return null;let i=s.$schema;if(i===Mt){let a=[],c=[];for(let u of s.skills){if(!this.isValidSkillEntryV2(u))continue;let f=new URL(u.url,e).toString();a.push({version:"0.2.0",name:u.name,description:u.description,type:u.type,artifactUrl:f,digest:u.digest,indexEntry:u}),c.push(u);}return a.length===0?null:{index:{$schema:Mt,skills:c},entries:a}}if(typeof i=="string"&&Me.test(i)){let a=[],c=[];for(let u of s.skills){if(!this.isValidSkillEntryEasbotV1(u))continue;let f=new URL(u.sourceUrl,e).toString();a.push({version:"easbot-v1",name:u.name,description:u.description,skillMdUrl:f,installName:u.installName,indexEntry:u}),c.push(u);}return a.length===0?null:{index:{$schema:i,skills:c},entries:a}}if(i!==void 0)return null;let o=[],l=[];for(let a of s.skills){if(!this.isValidSkillEntryV1(a))return null;o.push(a),l.push({version:"0.1.0",name:a.name,description:a.description,files:a.files,baseUrl:this.getLegacySkillBaseUrl(e,r),wellKnownPath:r,indexEntry:a});}return {index:{skills:o},entries:l}}getLegacySkillBaseUrl(t,e){let r=new URL(t),s=`/${e}/${this.INDEX_FILE}`;return `${r.protocol}//${r.host}${r.pathname.slice(0,-s.length)}`}isValidSkillName(t){return !(typeof t!="string"||t.length===0||t.length>64||!/^[a-z0-9-]+$/.test(t)||t.startsWith("-")||t.endsWith("-")||t.includes("--"))}isSafeLegacyFilePath(t){return !(typeof t!="string"||t.length===0||t.startsWith("/")||t.startsWith("\\")||t.includes("..")||t.includes("\0"))}isValidSkillEntryEasbotV1(t){if(!t||typeof t!="object")return false;let e=t;if(!this.isValidSkillName(e.name)||typeof e.description!="string"||!e.description||e.description.length>1024||typeof e.sourceUrl!="string"||!e.sourceUrl)return false;try{new URL(e.sourceUrl,"https://easbot.cn/.well-known/agent-skills/index.json");}catch{return false}return true}isValidSkillEntryV1(t){if(!t||typeof t!="object")return false;let e=t;if(!this.isValidSkillName(e.name)||typeof e.description!="string"||!e.description||!Array.isArray(e.files)||e.files.length===0)return false;for(let s of e.files)if(!this.isSafeLegacyFilePath(s))return false;return e.files.some(s=>typeof s=="string"&&s.toLowerCase()==="skill.md")}isValidSkillEntryV2(t){if(!t||typeof t!="object")return false;let e=t;if(!this.isValidSkillName(e.name)||typeof e.description!="string"||!e.description||e.description.length>1024||e.type!=="skill-md"&&e.type!=="archive"||typeof e.url!="string"||!e.url||typeof e.digest!="string"||!/^sha256:[a-f0-9]{64}$/.test(e.digest))return false;try{new URL(e.url,"https://example.com/.well-known/agent-skills/index.json");}catch{return false}return true}async fetchSkill(t){try{let e=new URL(t),r=await this.fetchIndexCandidates(t);for(let s of r){let{entries:i}=s,o=null,l=e.pathname.match(/\/.well-known\/(?:agent-skills|skills)\/([^/]+)\/?$/);if(l?.[1]&&l[1]!=="index.json"?o=l[1]:i.length===1&&(o=i[0].name),!o)continue;let a=i.find(u=>u.name===o);if(!a)continue;let c=await this.fetchSkillByEntry(a);if(c)return c}return null}catch{return null}}async fetchSkillByEntry(t,e,r){return typeof t=="string"?e?this.fetchLegacySkillByEntry({version:"0.1.0",name:e.name,description:e.description,files:e.files,baseUrl:t,wellKnownPath:r??this.WELL_KNOWN_PATHS[0],indexEntry:e}):null:t.version==="0.1.0"?this.fetchLegacySkillByEntry(t):t.version==="easbot-v1"?this.fetchEasbotV1SkillByEntry(t):this.fetchArtifactSkillByEntry(t)}async fetchEasbotV1SkillByEntry(t){try{let e=await fetch(t.skillMdUrl);if(!e.ok)return null;let r=await e.text(),{data:s}=chunkE7AHWFZN_cjs.a(r);if(typeof s.name!="string"||typeof s.description!="string")return null;let i=new Map;i.set("SKILL.md",r);let o=He(t.indexEntry,s.name);return this.createSkill({name:s.name,description:s.description,content:r,installName:o,sourceUrl:t.skillMdUrl,metadata:s.metadata,files:i,indexEntry:t.indexEntry})}catch{return null}}async fetchLegacySkillByEntry(t){try{let e=`${t.baseUrl.replace(/\/$/,"")}/${t.wellKnownPath}/${t.name}`,r=`${e}/SKILL.md`,s=await fetch(r);if(!s.ok)return null;let i=await s.text(),{data:o}=chunkE7AHWFZN_cjs.a(i);if(typeof o.name!="string"||typeof o.description!="string")return null;let l=new Map;l.set("SKILL.md",i);let c=t.files.filter(f=>f.toLowerCase()!=="skill.md").map(async f=>{try{let h=`${e}/${f}`,x=await fetch(h);if(x.ok){let E=await x.arrayBuffer();return {path:f,content:new Uint8Array(E)}}}catch{}return null}),u=await Promise.all(c);for(let f of u)f&&l.set(f.path,f.content);return this.createSkill({name:o.name,description:o.description,content:i,installName:t.name,sourceUrl:r,metadata:o.metadata,files:l,indexEntry:t.indexEntry})}catch{return null}}async fetchArtifactSkillByEntry(t){try{let e=await fetch(t.artifactUrl);if(!e.ok)return null;let r=e.headers.get("content-type")??"",s=new Uint8Array(await e.arrayBuffer());if(this.computeDigest(s)!==t.digest)return null;if(t.type==="skill-md"){let c=new TextDecoder().decode(s),{data:u}=chunkE7AHWFZN_cjs.a(c);if(typeof u.name!="string"||typeof u.description!="string")return null;let f=new Map;return f.set("SKILL.md",c),this.createSkill({name:u.name,description:u.description,content:c,installName:t.name,sourceUrl:t.artifactUrl,metadata:u.metadata,files:f,indexEntry:t.indexEntry})}let i=this.extractArchive(s,t.artifactUrl,r),o=i.get("SKILL.md");if(!o)return null;let l=typeof o=="string"?o:new TextDecoder().decode(o);i.set("SKILL.md",l);let{data:a}=chunkE7AHWFZN_cjs.a(l);return typeof a.name!="string"||typeof a.description!="string"?null:this.createSkill({name:a.name,description:a.description,content:l,installName:t.name,sourceUrl:t.artifactUrl,metadata:a.metadata,files:i,indexEntry:t.indexEntry})}catch{return null}}createSkill(t){return {name:chunkDNE3XPCJ_cjs.b(t.name),description:chunkDNE3XPCJ_cjs.b(t.description),content:t.content,installName:t.installName,sourceUrl:t.sourceUrl,metadata:t.metadata&&typeof t.metadata=="object"?t.metadata:void 0,files:t.files,indexEntry:t.indexEntry}}async fetchAllSkills(t){try{let e=await this.fetchIndexCandidates(t);for(let r of e){let s=r.entries.map(l=>this.fetchSkillByEntry(l)),o=(await Promise.all(s)).filter(l=>l!==null);if(o.length>0)return o}return []}catch{return []}}computeDigest(t){return `sha256:${crypto.createHash("sha256").update(t).digest("hex")}`}extractArchive(t,e,r){if(this.isZipArchive(t,e,r))return this.extractZip(t);if(this.isTarGzArchive(t,e,r))return this.extractTarGz(t);throw new Error("Unsupported archive format")}isZipArchive(t,e,r){return r.includes("application/zip")||e.toLowerCase().endsWith(".zip")||t[0]===80&&t[1]===75}isTarGzArchive(t,e,r){let s=e.toLowerCase();return r.includes("application/gzip")||r.includes("application/x-gzip")||s.endsWith(".tar.gz")||s.endsWith(".tgz")||t[0]===31&&t[1]===139}normalizeArchivePath(t){if(!t||t.includes("\0")||t.startsWith("/")||t.startsWith("\\")||/^[A-Za-z]:/.test(t)||t.includes("\\"))return null;let e=t.split("/").filter(Boolean);return e.length===0||e.some(r=>r==="."||r==="..")?null:e.join("/")}addArchiveFile(t,e,r,s){let i=this.normalizeArchivePath(e);if(!i)throw new Error(`Unsafe archive path: ${e}`);if(s.bytes+=r.byteLength,s.bytes>_e)throw new Error("Archive exceeds maximum unpacked size");if(t.size>=ze)throw new Error("Archive contains too many files");t.set(i,r);}extractTarGz(t){let e=zlib.gunzipSync(Buffer.from(t)),r=new Map,s={bytes:0},i=0;for(;i+512<=e.length;){let o=e.subarray(i,i+512);if(o.every(E=>E===0))break;let l=this.readTarString(o,0,100),a=this.readTarString(o,124,12).trim(),c=o[156],u=this.readTarString(o,345,155),f=u?`${u}/${l}`:l,h=Number.parseInt(a||"0",8);if(!Number.isFinite(h)||h<0)throw new Error("Invalid tar entry size");if(i+=512,c===50||c===49)throw new Error("Archive links are not supported");if(c===0||c===48){let E=e.subarray(i,i+h);this.addArchiveFile(r,f,new Uint8Array(E),s);}i+=Math.ceil(h/512)*512;}if(!r.has("SKILL.md"))throw new Error("Archive missing root SKILL.md");return r}readTarString(t,e,r){let s=t.subarray(e,e+r),i=s.indexOf(0);return new TextDecoder().decode(i>=0?s.subarray(0,i):s)}extractZip(t){let e=Buffer.from(t),r=this.findZipEndOfCentralDirectory(e);if(r<0)throw new Error("Invalid zip archive");let s=e.readUInt16LE(r+10),i=e.readUInt32LE(r+16),o=new Map,l={bytes:0},a=i;for(let c=0;c<s;c++){if(e.readUInt32LE(a)!==33639248)throw new Error("Invalid zip directory");let u=e.readUInt16LE(a+8),f=e.readUInt16LE(a+10),h=e.readUInt32LE(a+20),x=e.readUInt32LE(a+24),E=e.readUInt16LE(a+28),k=e.readUInt16LE(a+30),g=e.readUInt16LE(a+32),w=e.readUInt32LE(a+38),y=e.readUInt32LE(a+42),p=a+46,S=e.subarray(p,p+E),b=new TextDecoder(u&2048?"utf-8":void 0).decode(S);if(a=p+E+k+g,b.endsWith("/"))continue;if(u&1)throw new Error("Encrypted zip entries are not supported");let M=w>>>16&61440;if(M===40960||M===4096)throw new Error("Archive links are not supported");if(e.readUInt32LE(y)!==67324752)throw new Error("Invalid zip local header");let _=e.readUInt16LE(y+26),de=e.readUInt16LE(y+28),wt=y+30+_+de,yt=e.subarray(wt,wt+h),z;if(f===0)z=yt;else if(f===8)z=zlib.inflateRawSync(yt);else throw new Error(`Unsupported zip compression method: ${f}`);if(z.byteLength!==x)throw new Error("Zip entry size mismatch");this.addArchiveFile(o,b,new Uint8Array(z),l);}if(!o.has("SKILL.md"))throw new Error("Archive missing root SKILL.md");return o}findZipEndOfCentralDirectory(t){let e=Math.max(0,t.length-65535-22);for(let r=t.length-22;r>=e;r--)if(t.readUInt32LE(r)===101010256)return r;return -1}toRawUrl(t){try{let e=new URL(t);if(t.toLowerCase().endsWith("/skill.md"))return t;let r=this.WELL_KNOWN_PATHS[0],s=e.pathname.match(/\/.well-known\/(?:agent-skills|skills)\/([^/]+)\/?$/);if(s?.[1]){let o=e.pathname.replace(/\/.well-known\/(?:agent-skills|skills)\/.*$/,"");return `${e.protocol}//${e.host}${o}/${r}/${s[1]}/SKILL.md`}let i=e.pathname.replace(/\/$/,"");return `${e.protocol}//${e.host}${i}/${r}/${this.INDEX_FILE}`}catch{return t}}getSourceIdentifier(t){try{return new URL(t).hostname.replace(/^www\./,"")}catch{return "unknown"}}async hasSkillsIndex(t){return await this.fetchIndex(t)!==null}},_t=new it;function st(n,t){let e=path.normalize(path.resolve(t)),r=path.normalize(path.resolve(n));return r.startsWith(e+path.sep)||r===e}function V(n){return n.startsWith("./")}async function Ot(n){let t=new Map;try{let e=await promises.readFile(path.join(n,".claude-plugin/marketplace.json"),"utf-8"),r=JSON.parse(e),s=r.metadata?.pluginRoot;if(s===void 0||V(s))for(let o of r.plugins??[]){if(!o.name||typeof o.source!="string"&&o.source!==void 0||o.source!==void 0&&!V(o.source))continue;let l=path.join(n,s??"",o.source??"");if(st(l,n)&&o.skills&&o.skills.length>0)for(let a of o.skills){if(!V(a))continue;let c=path.join(l,a);st(c,n)&&t.set(path.resolve(c),o.name);}}}catch{}try{let e=await promises.readFile(path.join(n,".claude-plugin/plugin.json"),"utf-8"),r=JSON.parse(e);if(r.name&&r.skills&&r.skills.length>0)for(let s of r.skills){if(!V(s))continue;let i=path.join(n,s);st(i,n)&&t.set(path.resolve(i),r.name);}}catch{}return t}var Ge=["node_modules",".git","dist","build","__pycache__"];async function qe(n){let t=path.join(n,".gitignore");try{let e=await promises.readFile(t,"utf-8");return utils.Glob.parseGitignoreContent(e)}catch{return []}}function ot(n){return n.toLowerCase().replace(/[\s_]+/g,"-")}function Xe(n){return n.split(path.sep).join("/").replace(/\/+/g,"/")}function Je(){let n=process.env.INSTALL_INTERNAL_SKILLS;return n==="1"||n==="true"}async function Jt(n){try{let t=path.join(n,"SKILL.md");return (await promises.stat(t)).isFile()}catch{return false}}async function Vt(n,t){try{let e=await promises.readFile(n,"utf-8"),{data:r}=chunkE7AHWFZN_cjs.a(e);if(!r.name||!r.description||typeof r.name!="string"||typeof r.description!="string")return null;let s=r.metadata&&typeof r.metadata=="object"&&!Array.isArray(r.metadata)?r.metadata:void 0;return s?.internal===!0&&!Je()&&!t?.includeInternal?null:{name:chunkDNE3XPCJ_cjs.b(r.name),description:chunkDNE3XPCJ_cjs.b(r.description),path:path.dirname(n),rawContent:e,metadata:s}}catch{return null}}async function Zt(n,t=0,e=5){if(t>e)return [];try{let[r,s]=await Promise.all([Jt(n),promises.readdir(n,{withFileTypes:!0}).catch(()=>[])]),i=r?[n]:[],o=await Promise.all(s.filter(l=>l.isDirectory()&&!Ge.includes(l.name)).map(l=>Zt(path.join(n,l.name),t+1,e)));return [...i,...o.flat()]}catch{return []}}function Ze(n,t){let e=path.normalize(path.resolve(n)),r=path.normalize(path.resolve(path.join(n,t)));return r.startsWith(e+path.sep)||r===e}async function ct(n,t,e){let r=[],s=new Set,i=await q(n),o=new Set(Object.keys(i.skills).map(ot));if(t&&!Ze(n,t))throw new Error(`Invalid subpath: "${t}" resolves outside the repository directory. Subpath must not contain ".." segments that escape the base path.`);let l=t?path.join(n,t):n,a=await Ot(l),c=p=>{let S=path.resolve(p.path);return a.has(S)&&(p.pluginName=a.get(S)),p},u=chunkISMGLHYS_cjs.k(),f=p=>{if(o.size===0)return false;let S=Xe(path.relative(n,p.path));if(!u.some(_=>S===_||S.startsWith(`${_}/`)))return false;let kt=ot(p.name),M=ot(path.basename(p.path));return o.has(kt)||o.has(M)},h=async p=>{if(!await Jt(p))return false;let S=await Vt(path.join(p,"SKILL.md"),e);return !S||s.has(S.name)||f(S)||(S=c(S),r.push(S),s.add(S.name)),true},x=t?t.replace(/^\/+|\/+$/g,"").split("/").filter(p=>p.length>0):[],E=x.length>0?`**/${x.join("/")}/**/SKILL.md`:"**/SKILL.md",k=await utils.Glob.scan(E,{cwd:l,absolute:true,ignore:[...utils.Glob.DEFAULT_IGNORE_PATTERNS,...await qe(l)]}),g="/",w=l.split(path.sep).join(g);k.sort((p,S)=>p.split(g).length-S.split(g).length);let y=[];for(let p of k){if(y.some(b=>p.startsWith(`${b}${g}`)||p===b))continue;let S=path.dirname(p);if(await h(S)){let b=S.split(path.sep).join(g);if(b===w)continue;y.push(b);}}if(r.length===0||e?.fullDepth){let p=await Zt(l);for(let S of p){let b=await Vt(path.join(S,"SKILL.md"),e);b&&!s.has(b.name)&&!f(b)&&(b=c(b),r.push(b),s.add(b.name));}}return r}function Ye(n){return n.name||(n.path?path.basename(n.path):"")}function nr(n,t){let e=t.map(r=>r.toLowerCase());return n.filter(r=>{let s=r.name.toLowerCase(),i=Ye(r).toLowerCase();return e.some(o=>o===s||o===i)})}var Yt="*";function rr(n,t){if(!n||n.length===0)return [];let e=new Set(t),r=[];for(let s of n)if(s!==Yt){if(s.includes("/")||s.includes("**")){r.push(s);continue}Qt.test(s)?t.some(i=>utils.Wildcard.match(i,s))||r.push(s):e.has(s)||r.push(s);}return r}function ir(n,t){let e={wildcard:false,matched:[],invalid:[]};if(!n||n.length===0)return e;let r=new Set(t),s=new Set;for(let i of n){if(i===Yt){e.wildcard=true;continue}if(i.includes("/")||i.includes("**")){e.invalid.push(i);continue}if(Qt.test(i))for(let o of t)utils.Wildcard.match(o,i)&&s.add(o);else r.has(i)?s.add(i):e.invalid.push(i);}return e.matched=Array.from(s),e}var Qt=/[*?[{}]/;var ft="houjallen/agent-skills";async function Sr(n){let t=n.defaultPlugin;if(!t||typeof t.marketId!="string"||t.marketId.length===0)return ft;let e=n.markets[t.marketId];if(!e)return ft;let r=e.localPath??e.url;if(!r)return ft;let s=r;return e.subpath&&(s=`${s}@${e.subpath}`),e.ref&&(s=`${s}#${e.ref}`),s}function en(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=n;if(typeof t.marketId!="string"||t.marketId.length===0)return null;let e={marketId:t.marketId};return typeof t.pluginId=="string"&&t.pluginId.length>0&&(e.pluginId=t.pluginId),e}function m(n){return utils.Filesystem.normalize(n)}function dt(n){if(n==="general"||n==="coder"||n==="all")return n}function nn({scope:n}){let t=n==="project"?chunkXGUPIAAF_cjs.p():chunkXGUPIAAF_cjs.m(),e=utils.Filesystem.join(t,n==="project"?".easbot":"easbot","skills");return utils.Filesystem.normalize(e)}function T(){return utils.Filesystem.join(chunkXGUPIAAF_cjs.m(),"skills","store")}function se(){return utils.Filesystem.join(T(),"index.json")}function X(n){let t=`${n.type}|${n.url}|${n.ref??""}`;return crypto.createHash("sha256").update(t).digest("hex")}function oe(n){let t=X(n);return utils.Filesystem.join(T(),t)}function D(){return utils.Filesystem.join(chunkXGUPIAAF_cjs.o(),"skills","cache")}function rn(n,t,e){if(e&&e.length>0)return N(e);let r=sn(n);if(r)return r;if(t?.includes("/")){let s=t.split("/")[0];if(s)return N(s)}return "default"}function sn(n){let t=n.localPath??n.url;if(!t)return null;if(n.type==="well-known")try{let s=new URL(t),i=s.hostname.replace(/^www\./,"").replace(/\./g,"-"),o=s.pathname.replace(/^\/+/,"").split("/")[0]||"";return o&&!i.endsWith(`-${o}`)?N(`${i}-${o}`):N(i)}catch{return null}let e=t.match(/^(?:https?:\/\/[^/]+\/|git@[^:]+:)([^/]+)\/([^/]+?)(?:\.git)?\/?$/);if(e)return N(e[2]??"");let r=t.split(/[\\/]/).filter(Boolean).pop();return r?N(r.replace(/\.git$/,"")):null}function N(n){let t=n.trim().replace(/[:\\/\0]/g,"-").replace(/\.git$/,"").replace(/\s+/g,"-");return t.length>64&&(t=t.slice(0,64)),t.length>0?t:"default"}function Y(n){if(n.type==="well-known")return on(n.url);let t=j(n);if(t)return utils.Filesystem.join(D(),n.type,t);let e=crypto.createHash("sha256").update(n.url).digest("hex").slice(0,16);return utils.Filesystem.join(D(),n.type,`unknown-${e}`)}function on(n){let t,e;try{let r=new URL(n);t=r.hostname.replace(/^www\./,"");let s=r.pathname.match(/\/\.well-known\/(agent-skills|skills)/);s?.[1]?e=`.well-known/${s[1]}`:e=".well-known/agent-skills";}catch{let r=crypto.createHash("sha256").update(n).digest("hex").slice(0,16);return utils.Filesystem.join(D(),"wellknown",`unknown-${r}`)}return utils.Filesystem.join(D(),"wellknown",t,e)}async function le(n){n.skillNames??[];if(n.type==="local")return ln(n);let e=n.mode??"install",{cacheDir:r,source:s,cloneError:i}=await an(n,e);return {tempDir:r,cacheHit:false,source:s,cloneError:i}}var gt=class extends Error{constructor(e){super(`Local source path does not exist: ${e}`);chunkGWUDKZEH_cjs.b(this,"localPath",e);this.name="LocalPathNotFoundError";}};async function ln(n,t){let e=n.localPath??n.url;if(!fs.existsSync(e))throw new gt(e);let r=oe(n);return fs.existsSync(r)&&await ae(r)?{tempDir:r,cacheHit:true,source:"local-cp",cloneError:null}:{tempDir:e,cacheHit:false,source:"local-cp",cloneError:null}}async function an(n,t){let e=n.ref;if(!e){let l=j(n);if(l){let[a,c]=l.split("/");if(a&&c){let u=await Tt(a,c);u&&(e=u);}}}e||(e="HEAD");let r=Y(n);if(n.type==="well-known")return fs.existsSync(r)?{cacheDir:r,source:"cache-pull",cloneError:null}:(await utils.Filesystem.mkdir(m(r),{recursive:true}),await dn(n.url,r),{cacheDir:r,source:"well-known-fetch",cloneError:null});if(fs.existsSync(r)){if(t==="update")try{let l=await utils.git(["fetch","origin",e],{cwd:r});if(l.exitCode!==0){let c=await(typeof l.text=="function"?l.text():Promise.resolve(String(l.stderr||"")));throw new Error(`git fetch failed (exit=${l.exitCode}): ${c.slice(0,500)}`)}let a=await utils.git(["reset","--hard",`origin/${e}`],{cwd:r});if(a.exitCode!==0){let c=await(typeof a.text=="function"?a.text():Promise.resolve(String(a.stderr||"")));throw new Error(`git reset --hard failed (exit=${a.exitCode}): ${c.slice(0,500)}`)}return {cacheDir:r,source:"cache-pull",cloneError:null}}catch(l){let a=l instanceof Error?l.message:String(l),c=new L(`Failed to fetch+reset ${n.url} (ref=${e}): ${a}`,n.url,false,false);return {cacheDir:r,source:"cache-pull",cloneError:c}}try{let l=await utils.git(["checkout",e],{cwd:r});if(l.exitCode!==0){let a=await(typeof l.text=="function"?l.text():Promise.resolve(String(l.stderr||"")));throw new Error(`git checkout failed (exit=${l.exitCode}): ${a.slice(0,500)}`)}return {cacheDir:r,source:"cache-pull",cloneError:null}}catch(l){let a=l instanceof Error?l.message:String(l),c=new L(`Failed to checkout ${n.url} (ref=${e}): ${a}`,n.url,false,false);return {cacheDir:r,source:"cache-pull",cloneError:c}}}async function s(l,a,c){return Ut(l,a,c)}let i=null,o=null;try{return await utils.Filesystem.mkdir(m(utils.Filesystem.dirname(r)),{recursive:!0}),i=`${r}.clone-tmp`,await s(n.url,e,i),await promises.rename(m(i),m(r)),{cacheDir:r,source:"cache-clone",cloneError:null}}catch(l){return l instanceof L?o=l:l instanceof Error&&(o=new L(`Failed to clone ${n.url}: ${l.message}`,n.url,false,false)),await utils.Filesystem.mkdir(m(r),{recursive:true}).catch(()=>{}),{cacheDir:r,source:"cache-pull",cloneError:o}}finally{if(i)try{await promises.rm(m(i),{recursive:!0,force:!0});}catch{}}}async function A(){let n=m(se()),t;try{t=await utils.Filesystem.readText(n);}catch{return {version:6,markets:{}}}let e;try{e=JSON.parse(t);}catch{try{await promises.rename(m(n),`${m(n)}.corrupt-${Date.now()}`);}catch{}return {version:6,markets:{}}}let r=e;if(r.version!==6||!r.markets)return {version:6,markets:{}};let s={version:6,markets:r.markets};if("defaultPlugin"in r){let i=en(r.defaultPlugin);i&&(s.defaultPlugin=i);}return s}async function Q(n){await utils.Filesystem.writeJson(m(se()),n);}async function xr(){let n=await A(),t={};for(let e of Object.values(n.markets))for(let r of Object.values(e.plugins))for(let[s,i]of Object.entries(r.skills))t[s]={marketId:e.id,pluginId:r.id,pluginName:r.name,storePath:e.storePath,pluginSlug:r.id.split(":").slice(1).join(":")||r.id,url:e.url,type:e.type,localPath:e.localPath,subpath:e.subpath,ref:e.ref,addedAt:e.addedAt,skillPath:i.skillPath,computedHash:i.computedHash,sourceKey:e.id,sourcePath:e.localPath??e.storePath};return t}async function Er(n,t,e,r,s){let i=await A(),o=i.markets[n];o||(o={...s,id:n,addedAt:s.addedAt??new Date().toISOString(),plugins:{}},i.markets[n]=o);let l=o.plugins[t];l||(l={id:t,name:t.split(":").slice(1).join(":")||t,skills:{}},o.plugins[t]=l),l.skills[e]=r,await Q(i);}async function cn(){let n=await A(),t=[];for(let e of Object.values(n.markets))for(let r of Object.values(e.plugins))for(let s of Object.values(r.skills))t.push({skillName:s.name,marketId:e.id,pluginId:r.id,entry:s});return t.sort((e,r)=>{let s=e.marketId.localeCompare(r.marketId);if(s!==0)return s;let i=e.pluginId.localeCompare(r.pluginId);return i!==0?i:e.skillName.localeCompare(r.skillName)}),t}async function un(n){return (await cn()).filter(e=>e.skillName===n)}async function br(n,t,e){let s=(await A()).markets[n];if(!s)return;let i=s.plugins[t];if(!i)return;let o=i.skills[e];if(o)return {skillName:o.name,marketId:n,pluginId:t,entry:o}}async function Pr(n,t,e){let r=await A(),s=r.markets[n];if(!s)return false;let i=s.plugins[t];return !i||!(e in i.skills)?false:(delete i.skills[e],await Q(r),true)}async function fn(n){let t=await un(n);if(t.length===0)return [];let e=await A(),r=[];for(let s of t){let i=e.markets[s.marketId]?.plugins[s.pluginId];i&&n in i.skills&&(delete i.skills[n],r.push(s));}return r.length>0&&await Q(e),r}async function Lr(n,t,e,r,s,i,o){await J([{skillName:n,parsed:t,sourceKey:e,sourcePath:r,storePath:s,skillPath:i,...o&&{computedHash:o}}]);}async function J(n){if(n.length===0)return;let t=await A(),e=new Date().toISOString();for(let i of n){let o=i.sourceKey,l=rn(i.parsed,i.skillPath,i.pluginName),a=`${o}:${l}`,c=t.markets[o];if(!c){let h=i.parsed.type==="local"?i.parsed.localPath??i.parsed.url:Y(i.parsed);c={id:o,type:i.parsed.type,url:i.parsed.url,localPath:i.parsed.localPath,subpath:i.parsed.subpath,ref:i.parsed.ref,storePath:i.storePath,cachePath:h,addedAt:e,plugins:{}},t.markets[o]=c;}let u=c.plugins[a];u||(u={id:a,name:l,sourcePath:i.parsed.subpath,skills:{}},c.plugins[a]=u);let f={name:i.skillName,description:i.description??"",skillPath:i.skillPath,computedHash:i.computedHash};i.scope&&(f.scope=i.scope),i.snapshotHash&&(f.snapshotHash=i.snapshotHash),u.skills[i.skillName]=f;}let r=new Set,s=new Map;for(let i of n)r.add(i.sourceKey),i.marketSnapshotHash&&s.set(i.sourceKey,i.marketSnapshotHash);for(let i of r){let o=t.markets[i];if(!o)continue;let l=s.get(i);if(l){o.snapshotHash=l;continue}let a=[];for(let c of Object.values(o.plugins))for(let u of Object.values(c.skills))a.push({name:u.name,snapshotHash:u.snapshotHash});o.snapshotHash=chunkE7AHWFZN_cjs.d(a);}await Q(t);}async function vr(n){return (await fn(n)).length>0}async function dn(n,t){let e;try{e=await _t.fetchAllSkills(n);}catch{return}if(e.length!==0)for(let r of e)try{await hn(r,t);}catch{}}async function hn(n,t){let e=utils.Filesystem.join(t,n.installName),r=utils.Filesystem.normalize(e),s=utils.Filesystem.normalize(t);if(!r.startsWith(`${s}/`)&&r!==s)throw new Error(`Unsafe skill dir: ${n.installName}`);await promises.mkdir(m(e),{recursive:true});for(let[i,o]of n.files){let l=utils.Filesystem.join(e,i),a=utils.Filesystem.normalize(l);if(!a.startsWith(`${r}/`)&&a!==r||i.includes("\0"))continue;let c=path.dirname(m(l));c!==m(e)&&await promises.mkdir(c,{recursive:true}),await promises.writeFile(m(l),typeof o=="string"?o:Buffer.from(o));}}async function Ir(n){return (await le({type:"git",url:n.url,ref:n.ref})).tempDir}async function $r(n,t={}){let e=oe(n),r=false;if(fs.existsSync(e)&&(r=await ae(e),!r))try{await promises.rmdir(m(e));}catch{}if(r)if(t.mode==="update"){try{await promises.rm(m(e),{recursive:!0,force:!0});}catch{}r=false;}else {let c=await ct(e,void 0,{includeInternal:t.includeInternal,fullDepth:t.fullDepth});if(c.length>0){let f=await Promise.all(c.map(async h=>{let x=ht(e,h.path);return {skillName:h.name,parsed:n,sourceKey:X(n),sourcePath:e,storePath:e,skillPath:x,description:h.description,scope:dt(h.metadata?.scope),...h.pluginName&&{pluginName:h.pluginName},computedHash:await chunkE7AHWFZN_cjs.b(h.path)}}));await J(f);}let u=n.type==="local"?"local-cp":"cache-pull";return {storeDir:e,cacheHit:true,source:u,skills:c,blobSkills:[],cloneError:null}}let s=[];if(n.type==="github"&&!t.fullDepth){let c=j(n),u=c?.split("/")[0]?.toLowerCase(),f=!!c&&Object.hasOwn(chunkDNE3XPCJ_cjs.c,c.toLowerCase());if(c&&u&&(f||chunkDNE3XPCJ_cjs.d.includes(u))){let h=await chunkDNE3XPCJ_cjs.l(c,{subpath:n.subpath,ref:n.ref,includeInternal:t.includeInternal});if(h&&h.skills.length>0){await te(h.skills,e);let x=Y(n);await te(h.skills,x);let E=h.skills.map(g=>({...g,path:utils.Filesystem.join(e,g.repoSubpath??"",g.name)})),k=await Promise.all(E.map(async(g,w)=>{let y=h.skills[w],p=`${y.repoSubpath??""}${y.repoSubpath?"/":""}${y.name}`;return {skillName:g.name,parsed:n,sourceKey:X(n),sourcePath:e,storePath:e,skillPath:p,description:g.description,scope:dt(g.metadata?.scope),...g.pluginName&&{pluginName:g.pluginName},computedHash:await chunkE7AHWFZN_cjs.b(utils.Filesystem.dirname(g.path)),snapshotHash:y.snapshotHash,marketSnapshotHash:h.snapshotHash}}));return await J(k),s=h.skills,{storeDir:e,cacheHit:false,source:"blob-fetch",skills:E,blobSkills:s,cloneError:null}}}}let i=await le(n);await utils.Filesystem.mkdir(m(e),{recursive:true}).catch(()=>{});let o=await ct(i.tempDir,void 0,{includeInternal:t.includeInternal,fullDepth:t.fullDepth}),l=[],a=utils.Filesystem.normalize(e).replace(/\\/g,"/");for(let c of o){let u=ht(i.tempDir,c.path),f=utils.Filesystem.join(e,u),h=`${ht(i.tempDir,c.path)}/SKILL.md`,x=utils.Filesystem.normalize(f).replace(/\\/g,"/"),E="/",k=a.endsWith(E)?a:a+E;if(!x.startsWith(k)&&x!==a)throw new Error(`[INVARIANT 0048-yyy] cp target escapes storeRoot: target=${x} storeRoot=${a}
|
|
20
|
+
source skill path=${c.path} (parsed.type=${n.type})
|
|
21
|
+
\u4E1A\u52A1\u4EFB\u4F55\u65F6\u5019\u4E0D\u80FD\u64CD\u4F5C\u7528\u6237\u7684 local \u76EE\u5F55\u6216\u6587\u4EF6\u3002`);let g;try{await utils.Filesystem.mkdir(m(utils.Filesystem.dirname(f)),{recursive:!0}),await promises.cp(m(c.path),m(f),{recursive:!0}),g=await chunkE7AHWFZN_cjs.b(f);}catch{}c.path=f,l.push({skill:c,skillRel:u,sourceSkillPath:h,targetPath:f,computedHash:g});}if(l.length>0){let c=l.filter(u=>u.computedHash).map(u=>({skillName:u.skill.name,parsed:n,sourceKey:X(n),sourcePath:i.tempDir,storePath:e,skillPath:u.skillRel,description:u.skill.description,scope:dt(u.skill.metadata?.scope),...u.skill.pluginName&&{pluginName:u.skill.pluginName},computedHash:u.computedHash}));await J(c);}return {storeDir:e,cacheHit:i.cacheHit,source:i.source,skills:o,blobSkills:[],cloneError:i.cloneError??null}}async function te(n,t){let e=utils.Filesystem.normalize(t);for(let r of n){let s=utils.Filesystem.join(t,r.repoSubpath??"",r.name),i=utils.Filesystem.normalize(s);if(!(!i.startsWith(`${e}/`)&&i!==e))try{await promises.mkdir(m(s),{recursive:!0});for(let o of r.files){let l=utils.Filesystem.join(s,o.path),a=utils.Filesystem.normalize(l);if(!a.startsWith(`${i}/`)&&a!==i||o.path.includes("\0"))continue;let c=path.dirname(m(l));c!==m(s)&&await promises.mkdir(c,{recursive:!0}),await promises.writeFile(m(l),o.contents,"utf-8");}}catch{}}}function ht(n,t){let r=utils.Filesystem.normalize(n).replace(/\\/g,"/"),s=utils.Filesystem.normalize(t).replace(/\\/g,"/"),i=r.toLowerCase();return s.toLowerCase().startsWith(`${i}/`)?s.slice(i.length+1):""}async function ae(n){try{return (await promises.readdir(m(n))).length>0}catch{return false}}function Rr(n){try{let t=utils.Filesystem.normalize(n);for(let e of [D(),T()]){let r=utils.Filesystem.normalize(e);if(t===r||t.startsWith(`${r}/`))return !0}return !1}catch{return false}}async function Ar({cachePath:n,skillName:t,scope:e}){let r=utils.Filesystem.join(nn({scope:e}),t);return fs.existsSync(r)&&await promises.rm(m(r),{recursive:true,force:true}),await promises.cp(m(n),m(r),{recursive:true}),r}async function Wr(n){let t=Y(n);fs.existsSync(t)&&await promises.rm(m(t),{recursive:true,force:true});}async function Kr(){let n=D();fs.existsSync(n)&&await promises.rm(m(n),{recursive:true,force:true});}var kn="skills-lock.json",ce=4;function ue(n){return path.join(n||process.cwd(),kn)}function _r(n,t){return n?It(n,T(),t):null}async function q(n){let t=ue(n);try{let e=await promises.readFile(t,"utf-8"),r=JSON.parse(e);return typeof r.version!="number"||!r.skills||r.version<ce?mt():r}catch{return mt()}}async function fe(n,t){let e=ue(t),r={};for(let o of Object.keys(n.skills).sort())r[o]=n.skills[o];let s={version:n.version,skills:r},i=JSON.stringify(s,null,2)+`
|
|
22
|
+
`;await promises.writeFile(e,i,"utf-8");}async function zr(n,t,e){let r=await q(e),s=new Date().toISOString(),i=r.skills[n];r.skills[n]={...t,installedAt:i?.installedAt??s,updatedAt:s},await fe(r,e);}async function Hr(n,t){let e=await q(t);return n in e.skills?(delete e.skills[n],await fe(e,t),true):false}function mt(){return {version:ce,skills:{}}}exports.$=Lr;exports.A=ct;exports.B=Ye;exports.C=nr;exports.D=rr;exports.E=ir;exports.F=ft;exports.G=Sr;exports.H=en;exports.I=nn;exports.J=T;exports.K=se;exports.L=X;exports.M=oe;exports.N=D;exports.O=rn;exports.P=Y;exports.Q=le;exports.R=gt;exports.S=A;exports.T=Q;exports.U=xr;exports.V=Er;exports.W=cn;exports.X=un;exports.Y=br;exports.Z=Pr;exports._=fn;exports.a=j;exports.aa=J;exports.b=Kn;exports.ba=vr;exports.c=Nn;exports.ca=Ir;exports.d=O;exports.da=$r;exports.e=Ft;exports.ea=ht;exports.f=At;exports.fa=ae;exports.g=L;exports.ga=Rr;exports.h=Pe;exports.ha=Ar;exports.i=Le;exports.ia=Wr;exports.j=Dt;exports.ja=Kr;exports.k=Ut;exports.l=In;exports.m=it;exports.n=_t;exports.o=K;exports.p=It;exports.q=ce;exports.r=ue;exports.s=_r;exports.t=q;exports.u=fe;exports.v=zr;exports.w=Hr;exports.x=Je;exports.y=Vt;exports.z=Ze;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {p as p$1,J as J$1}from'./chunk-6NTEYECA.mjs';import {m}from'./chunk-RWZ4LFSN.mjs';import {readFile,mkdir,writeFile}from'fs/promises';import {join,dirname}from'path';import {createHash}from'crypto';import {execSync}from'child_process';import {isRich,theme,colorize,Symbol}from'@easbot/terminal';function e(t,r){return i=>colorize(t,r,i)}var o=isRich(),y=e(o,theme.muted),$=e(o,theme.error),K=e(o,theme.success),x=e(o,theme.warn),a=e(o,theme.info);e(o,theme.accentBright);var C=e(o,theme.heading),U=e(o,theme.heading);var j=e(o,theme.info);e(o,theme.error);var J=t=>t;var I=".skill-lock.json",S=6;function h(){return join(m(),"skills",I)}async function l(){let t=h();return await N(t)??_()}async function N(t){try{let r=await readFile(t,"utf-8"),i=JSON.parse(r);return typeof i.version!="number"||!i.skills||i.version<S?null:i}catch{return null}}async function k(t){let r=h();await mkdir(dirname(r),{recursive:true});let i=JSON.stringify(t,null,2);await writeFile(r,i,"utf-8");}function rt(t){return createHash("sha256").update(t,"utf-8").digest("hex")}var p=false;function it(){p=false;}function nt(){if(process.env.GITHUB_TOKEN)return process.env.GITHUB_TOKEN;if(process.env.GH_TOKEN)return process.env.GH_TOKEN;p||(process.stderr.write(`${Symbol.colorize(Symbol.bar.vertical,"warning")} ${x("GitHub rate limit reached")} \u2014 using your ${a("gh")} login to continue.
|
|
2
|
+
${Symbol.colorize(Symbol.bar.vertical,"warning")} ${y(`Tip: set ${a("GITHUB_TOKEN")} to avoid this prompt, or use ${a("--full-depth")} to clone instead.
|
|
3
|
+
`)}`),p=true);try{let t=execSync("gh auth token",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(t)return t}catch{}return null}async function et(t,r,i,s){let{fetchRepoTree:c,getSkillFolderHashFromTree:w}=await import('./blob-WZAGX4RO.mjs'),g=await c(t,s,i??void 0);return g?w(g,r):null}async function ot(t,r){let i=await l(),s=new Date().toISOString(),c=i.skills[t];i.skills[t]={...r,installedAt:c?.installedAt??s,updatedAt:s},await k(i);}async function st(t){let r=await l();return t in r.skills?(delete r.skills[t],await k(r),true):false}async function lt(t){return (await l()).skills[t]??null}async function ct(){return (await l()).skills}async function at(){let t=await l(),r=new Map;for(let[i,s]of Object.entries(t.skills)){let c=r.get(s.source);c?c.skills.push(i):r.set(s.source,{skills:[i],entry:s});}return r}function _(){return {version:S,skills:{},dismissed:{}}}async function ut(t){return (await l()).dismissed?.[t]===true}function pt(t,r){return t?p$1(t,J$1(),r):null}async function kt(t){let r=await l();r.dismissed||(r.dismissed={}),r.dismissed[t]=true,await k(r);}export{y as a,$ as b,K as c,x as d,a as e,C as f,U as g,j as h,J as i,S as j,h as k,l,k as m,rt as n,it as o,nt as p,et as q,ot as r,st as s,lt as t,ct as u,at as v,ut as w,pt as x,kt as y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var u="https://add-skill.vercel.sh/t",m="https://add-skill.vercel.sh/audit",a=null,o=null;function
|
|
2
|
-
exports.a=
|
|
1
|
+
'use strict';var u="https://add-skill.vercel.sh/t",m="https://add-skill.vercel.sh/audit",a=null,o=null;function d(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 f(t){a=t;}async function p(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 y(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 D(t=5e3){if(i.length===0)return;let e=new Promise(n=>setTimeout(n,t));await Promise.race([Promise.all(i),e]);}
|
|
2
|
+
exports.a=d;exports.b=f;exports.c=p;exports.d=y;exports.e=D;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict';var chunkISMGLHYS_cjs=require('./chunk-ISMGLHYS.cjs'),chunkXGUPIAAF_cjs=require('./chunk-XGUPIAAF.cjs'),chunkE7AHWFZN_cjs=require('./chunk-E7AHWFZN.cjs'),promises=require('fs/promises'),fs=require('fs'),path=require('path'),os=require('os');var V=".agents",X="skills",ve=".agents/skills";async function fe(t){try{return await chunkE7AHWFZN_cjs.b(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 fe(e);if(!i)return false;let s;if(a){let{readSkillLock:l}=await import('./skill-lock-
|
|
1
|
+
'use strict';var chunkISMGLHYS_cjs=require('./chunk-ISMGLHYS.cjs'),chunkXGUPIAAF_cjs=require('./chunk-XGUPIAAF.cjs'),chunkE7AHWFZN_cjs=require('./chunk-E7AHWFZN.cjs'),promises=require('fs/promises'),fs=require('fs'),path=require('path'),os=require('os');var V=".agents",X="skills",ve=".agents/skills";async function fe(t){try{return await chunkE7AHWFZN_cjs.b(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 fe(e);if(!i)return false;let s;if(a){let{readSkillLock:l}=await import('./skill-lock-VX2HGPTY.cjs');s=(await l()).skills[t]?.computedHash;}else {let{readLocalLock:l}=await import('./local-lock-SPZB3AB7.cjs');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=path.normalize(path.resolve(t)),r=path.normalize(path.resolve(e));return r.startsWith(a+path.sep)||r===a}function Y(t,e){return w(t,e)||w(e,t)}function N(t,e){let a=t?chunkXGUPIAAF_cjs.k()||os.homedir():e||chunkXGUPIAAF_cjs.p()||process.cwd();return path.join(a,V,X)}function te(t,e){let a=e||chunkXGUPIAAF_cjs.p()||process.cwd();return path.join(a,chunkISMGLHYS_cjs.e,P(t),"skills")}function D(t,e,a,r){if(chunkISMGLHYS_cjs.o(t,e?"global":"project"))return N(e,a);if(t==="eve"&&r)return te(r,a);let n=chunkISMGLHYS_cjs.b[t],i=chunkXGUPIAAF_cjs.k()||os.homedir(),s=e?i:a||chunkXGUPIAAF_cjs.p()||process.cwd();return e?n.globalSkillsDir===void 0?path.join(s,n.skillsDir):n.globalSkillsDir:path.join(s,n.skillsDir)}function ge(t,e){return path.resolve(path.dirname(t),e)}async function S(t){try{await promises.rm(t,{recursive:!0,force:!0});}catch{}await promises.mkdir(t,{recursive:true});}async function j(t,e){try{let a=path.resolve(t),r=path.resolve(e),[n,i]=await Promise.all([promises.realpath(a).catch(()=>a),promises.realpath(r).catch(()=>r)]);if(n===i)return !0;let s=chunkXGUPIAAF_cjs.q(t),l=chunkXGUPIAAF_cjs.q(e);if(s===l)return !0;try{if((await promises.lstat(e)).isSymbolicLink()){let d=await promises.readlink(e);if(ge(e,d)===a)return !0;await promises.rm(e);}else await promises.rm(e,{recursive:!0});}catch(k){if(k&&typeof k=="object"&&"code"in k&&k.code==="ELOOP")try{await promises.rm(e,{force:!0});}catch{}}let u=path.dirname(e);await promises.mkdir(u,{recursive:!0});let h=chunkXGUPIAAF_cjs.q(u),g=path.relative(h,t),f=os.platform()==="win32"?"junction":void 0;return await promises.symlink(f==="junction"?a:g,e,f),!0}catch{return false}}async function Re(t,e,a={}){let r=chunkISMGLHYS_cjs.b[e],n=a.global??false,i=a.cwd||process.cwd(),s=a.eveSubagent;if(n&&r.globalSkillsDir===void 0)return {success:false,path:"",mode:a.mode??"symlink",error:`${r.displayName} does not support global skill installation`};let l=t.name||path.basename(t.path),u=P(l),h=a.mode??"symlink",f=e==="eve"&&h==="symlink"?D(e,n,i,s):N(n,i),o=path.join(f,u),k=D(e,n,i,s),d=path.join(k,P(t.name||path.basename(t.path))),c=chunkXGUPIAAF_cjs.q(d),m=chunkXGUPIAAF_cjs.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})&&fs.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),{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)&&fs.existsSync(m)||(await S(m),await R(t.path,m,e)),!n&&chunkISMGLHYS_cjs.o(e,"project"))return {success:!0,path:m,canonicalPath:m,mode:"copy"};if(n&&chunkISMGLHYS_cjs.o(e,"global"))return {success:!0,path:m,canonicalPath:m,mode:"symlink"};if(!n){let z=path.join(i,chunkISMGLHYS_cjs.b[e].skillsDir.split("/")[0]);if(!fs.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})&&fs.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),{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 Me(t,e,a={}){let{isGlobal:r=false,agentType:n,cwd:i,storePath:s}=a,l=chunkXGUPIAAF_cjs.q(t),u=chunkXGUPIAAF_cjs.q(e);if(l===u)return {success:true,path:u,canonicalPath:t,mode:"copy"};if(!r&&n&&i&&!chunkISMGLHYS_cjs.o(n,"project")){let f=path.join(i,chunkISMGLHYS_cjs.b[n].skillsDir.split("/")[0]);if(!fs.existsSync(f))return {success:true,path:e,canonicalPath:t,mode:"symlink",skipped:true}}let h=s?chunkXGUPIAAF_cjs.q(s):l;return await j(h,u)?{success:true,path:e,canonicalPath:t,mode:"symlink"}:{success:true,path:e,canonicalPath:t,mode:"symlink",symlinkFailed:true}}async function je(t,e,a={}){let{agentType:r="easbot"}=a,n=chunkXGUPIAAF_cjs.q(t),i=chunkXGUPIAAF_cjs.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 he=new Set(["metadata.json"]),ke=new Set([".git","__pycache__","__pypackages__"]),we=(t,e=false)=>!!(he.has(t)||e&&ke.has(t));function L(t){let{data:e,content:a}=chunkE7AHWFZN_cjs.a(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
2
|
${n.map(s=>`${s}: ${JSON.stringify(r[s])}`).join(`
|
|
3
3
|
`)}
|
|
4
4
|
---
|
|
5
|
-
${a.replace(/^\r?\n/u,"")}`}async function R(t,e,a){await promises.mkdir(e,{recursive:true});let r=await promises.readdir(t,{withFileTypes:true});await Promise.all(r.filter(n=>!we(n.name,n.isDirectory())).map(async n=>{let i=path.join(t,n.name),s=path.join(e,n.name);if(n.isDirectory())await R(i,s,a);else try{if(a==="eve"&&n.name.toLowerCase()==="skill.md"){await promises.writeFile(s,L(await promises.readFile(i,"utf-8")));return}await promises.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 ye(t){return t.some(e=>path.basename(e.path).toLowerCase()==="skill.md")}function U(t){return `${P(t)}.md`}function be(t){let e=t.find(r=>path.basename(r.path).toLowerCase()==="skill.md");if(e)return L(e.contents);let a=t.find(r=>path.extname(r.path).toLowerCase()===".md");return a?L(a.contents):""}async function _e(t,e,a={}){return (await ne(t,e,a)).installed}async function ne(t,e,a={}){let r=chunkISMGLHYS_cjs.b[e],n=P(t);if(a.global&&r.globalSkillsDir===void 0)return {installed:false,mode:null,path:""};let i=a.global?r.globalSkillsDir:e==="eve"&&a.eveSubagent?te(a.eveSubagent,a.cwd):path.join(a.cwd||process.cwd(),r.skillsDir),s=path.join(i,n);if(!w(i,s))return {installed:false,mode:null,path:""};try{let l=await promises.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 Ue(t,e,a={}){let r=P(t),n=D(e,a.global??false,a.cwd,a.eveSubagent),i=path.join(n,r);if(!w(n,i))throw new Error("Invalid skill name: potential path traversal detected");return i}async function O(t,e){try{return await promises.access(path.join(t,"SKILL.md")),{created:!1}}catch{}return await promises.mkdir(t,{recursive:true}),await e(t),{created:true}}function Be(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=path.join(r,a);if(!w(r,n))throw new Error("Invalid skill name: potential path traversal detected");return n}async function $e(t,e,a={}){let r=chunkISMGLHYS_cjs.b[e],n=a.global??false,i=a.cwd||process.cwd(),s=a.mode??"symlink",l=a.eveSubagent;if(n&&r.globalSkillsDir===void 0)return {success:false,path:"",mode:s,error:`${r.displayName} does not support global skill installation`};let u=P(t.installName),h=e==="eve"&&s==="symlink"?D(e,n,i,l):N(n,i),g=path.join(h,u),f=D(e,n,i,l),o=path.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==="eve"?U(t.installName):"SKILL.md",m=path.join(o,c);return await promises.writeFile(m,e==="eve"?L(t.content):t.content,"utf-8"),{success:!0,path:o,mode:"copy"}}let k=e==="eve"?U(t.installName):"SKILL.md";if(await O(g,async c=>{let m=path.join(c,k);await promises.writeFile(m,e==="eve"?L(t.content):t.content,"utf-8");}),n&&chunkISMGLHYS_cjs.o(e,"global"))return {success:!0,path:g,canonicalPath:g,mode:"symlink"};if(!await j(g,o)){await S(o);let c=e==="eve"?U(t.installName):"SKILL.md",m=path.join(o,c);return await promises.writeFile(m,e==="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 ze(t,e,a={}){let r=chunkISMGLHYS_cjs.b[e],n=a.global??false,i=a.cwd||process.cwd(),s=a.mode??"symlink",l=a.eveSubagent;if(n&&r.globalSkillsDir===void 0)return {success:false,path:"",mode:s,error:`${r.displayName} does not support global skill installation`};let u=P(t.installName),h=e==="eve"&&s==="symlink"?D(e,n,i,l):N(n,i),g=path.join(h,u),f=D(e,n,i,l),o=path.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=path.join(d,c);if(!w(d,b))continue;let $=path.dirname(b);$!==d&&await promises.mkdir($,{recursive:true}),await promises.writeFile(b,e==="eve"&&path.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 O(g,k),n&&chunkISMGLHYS_cjs.o(e,"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 Ke(t,e,a={}){let r=chunkISMGLHYS_cjs.b[e],n=a.global??false,i=a.cwd||process.cwd(),s=a.mode??"symlink",l=a.eveSubagent;if(n&&r.globalSkillsDir===void 0)return {success:false,path:"",mode:s,error:`${r.displayName} does not support global skill installation`};let u=P(t.installName),h=D(e,n,i,l);if(e==="eve"&&!ye(t.files)){let d=path.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 promises.mkdir(h,{recursive:!0}),await promises.rm(d,{recursive:!0,force:!0}),await promises.writeFile(d,be(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==="eve"&&s==="symlink"?D(e,n,i,l):N(n,i),f=path.join(g,u),o=path.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=path.join(d,c.path);if(!w(d,m))continue;let b=path.dirname(m);b!==d&&await promises.mkdir(b,{recursive:true}),await promises.writeFile(m,e==="eve"&&path.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 O(f,k),n&&chunkISMGLHYS_cjs.o(e,"global"))return {success:!0,path:f,canonicalPath:f,mode:"symlink"};if(!n&&!chunkISMGLHYS_cjs.o(e,"project")){let c=path.join(i,chunkISMGLHYS_cjs.b[e].skillsDir.split("/")[0]);if(!fs.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 Ge(t={}){let e=t.cwd||process.cwd(),{scanInstalledSkillDirs:a}=await import('./scan-
|
|
5
|
+
${a.replace(/^\r?\n/u,"")}`}async function R(t,e,a){await promises.mkdir(e,{recursive:true});let r=await promises.readdir(t,{withFileTypes:true});await Promise.all(r.filter(n=>!we(n.name,n.isDirectory())).map(async n=>{let i=path.join(t,n.name),s=path.join(e,n.name);if(n.isDirectory())await R(i,s,a);else try{if(a==="eve"&&n.name.toLowerCase()==="skill.md"){await promises.writeFile(s,L(await promises.readFile(i,"utf-8")));return}await promises.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 ye(t){return t.some(e=>path.basename(e.path).toLowerCase()==="skill.md")}function U(t){return `${P(t)}.md`}function be(t){let e=t.find(r=>path.basename(r.path).toLowerCase()==="skill.md");if(e)return L(e.contents);let a=t.find(r=>path.extname(r.path).toLowerCase()===".md");return a?L(a.contents):""}async function _e(t,e,a={}){return (await ne(t,e,a)).installed}async function ne(t,e,a={}){let r=chunkISMGLHYS_cjs.b[e],n=P(t);if(a.global&&r.globalSkillsDir===void 0)return {installed:false,mode:null,path:""};let i=a.global?r.globalSkillsDir:e==="eve"&&a.eveSubagent?te(a.eveSubagent,a.cwd):path.join(a.cwd||process.cwd(),r.skillsDir),s=path.join(i,n);if(!w(i,s))return {installed:false,mode:null,path:""};try{let l=await promises.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 Ue(t,e,a={}){let r=P(t),n=D(e,a.global??false,a.cwd,a.eveSubagent),i=path.join(n,r);if(!w(n,i))throw new Error("Invalid skill name: potential path traversal detected");return i}async function O(t,e){try{return await promises.access(path.join(t,"SKILL.md")),{created:!1}}catch{}return await promises.mkdir(t,{recursive:true}),await e(t),{created:true}}function Be(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=path.join(r,a);if(!w(r,n))throw new Error("Invalid skill name: potential path traversal detected");return n}async function $e(t,e,a={}){let r=chunkISMGLHYS_cjs.b[e],n=a.global??false,i=a.cwd||process.cwd(),s=a.mode??"symlink",l=a.eveSubagent;if(n&&r.globalSkillsDir===void 0)return {success:false,path:"",mode:s,error:`${r.displayName} does not support global skill installation`};let u=P(t.installName),h=e==="eve"&&s==="symlink"?D(e,n,i,l):N(n,i),g=path.join(h,u),f=D(e,n,i,l),o=path.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==="eve"?U(t.installName):"SKILL.md",m=path.join(o,c);return await promises.writeFile(m,e==="eve"?L(t.content):t.content,"utf-8"),{success:!0,path:o,mode:"copy"}}let k=e==="eve"?U(t.installName):"SKILL.md";if(await O(g,async c=>{let m=path.join(c,k);await promises.writeFile(m,e==="eve"?L(t.content):t.content,"utf-8");}),n&&chunkISMGLHYS_cjs.o(e,"global"))return {success:!0,path:g,canonicalPath:g,mode:"symlink"};if(!await j(g,o)){await S(o);let c=e==="eve"?U(t.installName):"SKILL.md",m=path.join(o,c);return await promises.writeFile(m,e==="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 ze(t,e,a={}){let r=chunkISMGLHYS_cjs.b[e],n=a.global??false,i=a.cwd||process.cwd(),s=a.mode??"symlink",l=a.eveSubagent;if(n&&r.globalSkillsDir===void 0)return {success:false,path:"",mode:s,error:`${r.displayName} does not support global skill installation`};let u=P(t.installName),h=e==="eve"&&s==="symlink"?D(e,n,i,l):N(n,i),g=path.join(h,u),f=D(e,n,i,l),o=path.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=path.join(d,c);if(!w(d,b))continue;let $=path.dirname(b);$!==d&&await promises.mkdir($,{recursive:true}),await promises.writeFile(b,e==="eve"&&path.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 O(g,k),n&&chunkISMGLHYS_cjs.o(e,"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 Ke(t,e,a={}){let r=chunkISMGLHYS_cjs.b[e],n=a.global??false,i=a.cwd||process.cwd(),s=a.mode??"symlink",l=a.eveSubagent;if(n&&r.globalSkillsDir===void 0)return {success:false,path:"",mode:s,error:`${r.displayName} does not support global skill installation`};let u=P(t.installName),h=D(e,n,i,l);if(e==="eve"&&!ye(t.files)){let d=path.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 promises.mkdir(h,{recursive:!0}),await promises.rm(d,{recursive:!0,force:!0}),await promises.writeFile(d,be(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==="eve"&&s==="symlink"?D(e,n,i,l):N(n,i),f=path.join(g,u),o=path.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=path.join(d,c.path);if(!w(d,m))continue;let b=path.dirname(m);b!==d&&await promises.mkdir(b,{recursive:true}),await promises.writeFile(m,e==="eve"&&path.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 O(f,k),n&&chunkISMGLHYS_cjs.o(e,"global"))return {success:!0,path:f,canonicalPath:f,mode:"symlink"};if(!n&&!chunkISMGLHYS_cjs.o(e,"project")){let c=path.join(i,chunkISMGLHYS_cjs.b[e].skillsDir.split("/")[0]);if(!fs.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 Ge(t={}){let e=t.cwd||process.cwd(),{scanInstalledSkillDirs:a}=await import('./scan-L6UNVP3V.cjs'),r=t.agentFilter?null:await chunkISMGLHYS_cjs.c(),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())}exports.a=V;exports.b=X;exports.c=ve;exports.d=P;exports.e=N;exports.f=te;exports.g=D;exports.h=Re;exports.i=Me;exports.j=je;exports.k=_e;exports.l=ne;exports.m=Ue;exports.n=O;exports.o=Be;exports.p=$e;exports.q=ze;exports.r=Ke;exports.s=Ge;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a,c}from'./chunk-ZYDDQV73.mjs';var T=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g,A=/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g,D=/\x1b[P^_][\s\S]*?(?:\x1b\\)/g,$=/\x1b[\x20-\x7e]/g,B=/[\x80-\x9f]/g,H=/[\x00-\x06\x07\x08\x0b\x0c\x0d-\x1a\x1c-\x1f\x7f]/g;function F(n){return n.replace(A,"").replace(D,"").replace(T,"").replace($,"").replace(B,"").replace(H,"")}function w(n){return F(n).replace(/[\r\n]+/g," ").trim()}var M=process.env.SKILLS_DOWNLOAD_URL||"https://skills.sh",O={},J=["houjallen","vercel-labs","anthropics"],R=3e5;function W(n){return n.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}var L=false;function Q(){L=false;}async function k(n,s,t){try{let o=`https://api.github.com/repos/${n}/git/trees/${encodeURIComponent(s)}?recursive=1`,r={Accept:"application/vnd.github.v3+json","User-Agent":"skills-cli"};t&&(r.Authorization=`Bearer ${t}`);let i=await fetch(o,{headers:r,signal:AbortSignal.timeout(R)});if(i.ok){let a=await i.json();return {tree:{sha:a.sha,branch:s,tree:a.tree},rateLimited:!1}}return {tree:null,rateLimited:i.status===403&&i.headers.get("x-ratelimit-remaining")==="0"}}catch{return {tree:null,rateLimited:false}}}async function y(n,s,t){let o=s?[s]:["HEAD","main","master"];if(L&&t){let c=t();if(!c)return null;for(let a of o){let g=await k(n,a,c);if(g.tree)return g.tree}return null}let r=false;for(let c of o){let a=await k(n,c,null);if(a.tree)return a.tree;if(a.rateLimited){r=true;break}}if(!r||!t)return null;L=true;let i=t();if(!i)return null;for(let c of o){let a=await k(n,c,i);if(a.tree)return a.tree}return null}async function U(n,s,t){let o=await y(n,s,t);return o?{tree:o,snapshotHash:o.sha}:null}function v(n,s){let t=s.replace(/\\/g,"/");return t.toLowerCase().endsWith("/skill.md")?t=t.slice(0,-9):t.toLowerCase().endsWith("skill.md")&&(t=t.slice(0,-8)),t.endsWith("/")&&(t=t.slice(0,-1)),t?n.tree.find(r=>r.type==="tree"&&r.path===t)?.sha??null:n.sha}async function Y(n,s,t,o){let r=await U(n,t,o);return r?v(r.tree,s):null}function z(n,s={}){let t=new Set(["node_modules",".git","dist","build","__pycache__"]),o=s.maxDepth??5,r=s.limit??100,i=s.subpath??"",a=(i?i.endsWith("/")?i.slice(0,-1):i:"").replace(/\\/g,"/"),g=n.tree.filter(e=>e.type==="blob"&&e.path.toLowerCase().endsWith("skill.md")).map(e=>e.path);if(g.length===0)return [];let p=[],S=new Set;for(let e of g){if(a!==""&&e!==a&&e!==`${a}.SKILL.md`&&!e.startsWith(`${a}/`))continue;let l=e.split("/");l.length===0||l.length>o||l[l.length-1].toLowerCase()==="skill.md"&&(l.some(u=>t.has(u)||u===".well-known")||S.has(e)||(S.add(e),p.push(e)));}return p.length>r?(console.warn(`[blob.findSkillMdPaths] tree has ${p.length} SKILL.md > limit=${r}\uFF0C\u5DF2\u622A\u65AD\u3002\u8981\u62FF\u5168\u90E8\u4F20 \`limit: Infinity\`\u3002`),p.slice(0,r)):p}async function K(n,s,t){let o=`https://raw.githubusercontent.com/${n}/${s}/${t}`,r=3;for(let i=0;i<r;i++){try{let c=await fetch(o,{signal:AbortSignal.timeout(R)});if(c.ok)return await c.text();if(i===r-1)return null}catch{if(i===r-1)return null}await new Promise(c=>setTimeout(c,500*2**i));}return null}async function N(n,s){try{let[t,o]=n.split("/"),r=`${M}/api/download/${encodeURIComponent(t)}/${encodeURIComponent(o)}/${encodeURIComponent(s)}`,c=O[n.toLowerCase()]?.downloadUrl(s)??r,a=await fetch(c,{signal:AbortSignal.timeout(R)});return a.ok?await a.json():null}catch{return null}}async function Z(n,s={}){let t=await y(n,s.ref,s.getToken);if(!t)return null;let o=z(t,{subpath:s.subpath});if(o.length===0)return null;let r=await Promise.all(o.map(async e=>{let l=await K(n,t.branch,e);return {mdPath:e,content:l}})),i=[];for(let{mdPath:e,content:l}of r){if(!l)continue;let{data:u}=a(l);if(!u.name||!u.description||typeof u.name!="string"||typeof u.description!="string"||u.metadata?.internal===true&&!s.includeInternal)continue;let d=w(u.name),m=w(u.description);i.push({mdPath:e,name:d,description:m,content:l,slug:W(d),metadata:u.metadata});}if(i.length===0)return null;let c$1=n.toLowerCase(),a$1=await Promise.all(i.map(async e=>{let l=await N(c$1,e.slug);return {skill:e,download:l}}));if(!a$1.every(e=>e.download!==null))return null;let p=a$1.map(({skill:e,download:l})=>{let u=e.mdPath.toLowerCase(),h=u.endsWith("/skill.md")?e.mdPath.slice(0,-9):u==="skill.md"?"":e.mdPath.slice(0,-9),d=h?l.files:l.files.filter(f=>f.path.toLowerCase()==="skill.md"),m=h?h.split("/").pop():"",b=h?d.map(f=>{let x=f.path.startsWith(`${h}/`)?f.path.slice(h.length+1):f.path;return m&&x.startsWith(`${m}/`)?{path:x.slice(m.length+1),contents:f.contents}:{path:x,contents:f.contents}}):d,I=h.includes("/")?h.slice(0,h.lastIndexOf("/")):"";return {name:e.name,description:e.description,path:"",rawContent:e.content,metadata:e.metadata,files:b,snapshotHash:b.length===l.files.length?l.hash:c(b),repoPath:e.mdPath,repoSubpath:I}}),S=t.sha;return {skills:p,tree:t,subpath:s.subpath,snapshotHash:S}}
|
|
2
|
+
export{F as a,w as b,O as c,J as d,W as e,Q as f,y as g,U as h,v as i,Y as j,z as k,Z as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{M as handleSkillsCli,K as renderBanner,L as renderHelp}from'./chunk-J6PRUXFG.mjs';import'./chunk-CFMOYU7R.mjs';import'./chunk-NH4TYEPW.mjs';import'./chunk-5BDDXFOF.mjs';import'./chunk-AQYRRXU5.mjs';import'./chunk-6NTEYECA.mjs';import'./chunk-ML6B4IQL.mjs';import'./chunk-RWZ4LFSN.mjs';import'./chunk-ZJS7IO5V.mjs';import'./chunk-ZYDDQV73.mjs';import'./chunk-WQGSYA5D.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk2E6BHPFV_cjs=require('./chunk-2E6BHPFV.cjs');require('./chunk-Q2MOP5ZW.cjs'),require('./chunk-5RWSXDNO.cjs'),require('./chunk-DFBKA5A6.cjs'),require('./chunk-UGHF4GOW.cjs'),require('./chunk-JCOXRETY.cjs'),require('./chunk-ISMGLHYS.cjs'),require('./chunk-XGUPIAAF.cjs'),require('./chunk-DNE3XPCJ.cjs'),require('./chunk-E7AHWFZN.cjs'),require('./chunk-GWUDKZEH.cjs');Object.defineProperty(exports,"handleSkillsCli",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.M}});Object.defineProperty(exports,"renderBanner",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.K}});Object.defineProperty(exports,"renderHelp",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.L}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{j as copySkillDir,n as ensureCanonicalFromFiles,g as getAgentBaseDir,o as getCanonicalPath,e as getCanonicalSkillsDir,f as getEveSubagentSkillsDir,m as getInstallPath,l as getInstallStatus,r as installBlobSkillForAgent,p as installRemoteSkillForAgent,h as installSkillForAgent,q as installWellKnownSkillForAgent,k as isSkillInstalled,i as linkSkillDir,s as listInstalledSkills,d as sanitizeName}from'./chunk-
|
|
1
|
+
export{j as copySkillDir,n as ensureCanonicalFromFiles,g as getAgentBaseDir,o as getCanonicalPath,e as getCanonicalSkillsDir,f as getEveSubagentSkillsDir,m as getInstallPath,l as getInstallStatus,r as installBlobSkillForAgent,p as installRemoteSkillForAgent,h as installSkillForAgent,q as installWellKnownSkillForAgent,k as isSkillInstalled,i as linkSkillDir,s as listInstalledSkills,d as sanitizeName}from'./chunk-AQYRRXU5.mjs';import'./chunk-ML6B4IQL.mjs';import'./chunk-RWZ4LFSN.mjs';import'./chunk-ZYDDQV73.mjs';import'./chunk-WQGSYA5D.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkUGHF4GOW_cjs=require('./chunk-UGHF4GOW.cjs');require('./chunk-ISMGLHYS.cjs'),require('./chunk-XGUPIAAF.cjs'),require('./chunk-E7AHWFZN.cjs'),require('./chunk-GWUDKZEH.cjs');Object.defineProperty(exports,"copySkillDir",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.j}});Object.defineProperty(exports,"ensureCanonicalFromFiles",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.n}});Object.defineProperty(exports,"getAgentBaseDir",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.g}});Object.defineProperty(exports,"getCanonicalPath",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.o}});Object.defineProperty(exports,"getCanonicalSkillsDir",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.e}});Object.defineProperty(exports,"getEveSubagentSkillsDir",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.f}});Object.defineProperty(exports,"getInstallPath",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.m}});Object.defineProperty(exports,"getInstallStatus",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.l}});Object.defineProperty(exports,"installBlobSkillForAgent",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.r}});Object.defineProperty(exports,"installRemoteSkillForAgent",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.p}});Object.defineProperty(exports,"installSkillForAgent",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.h}});Object.defineProperty(exports,"installWellKnownSkillForAgent",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.q}});Object.defineProperty(exports,"isSkillInstalled",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.k}});Object.defineProperty(exports,"linkSkillDir",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.i}});Object.defineProperty(exports,"listInstalledSkills",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.s}});Object.defineProperty(exports,"sanitizeName",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.d}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkXGUPIAAF_cjs=require('./chunk-XGUPIAAF.cjs');require('./chunk-
|
|
1
|
+
'use strict';var chunkXGUPIAAF_cjs=require('./chunk-XGUPIAAF.cjs');require('./chunk-GWUDKZEH.cjs');Object.defineProperty(exports,"getAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.h}});Object.defineProperty(exports,"getGlobal",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.c}});Object.defineProperty(exports,"getHomeDir",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.k}});Object.defineProperty(exports,"getInstance",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.f}});Object.defineProperty(exports,"getProjectDirectory",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.p}});Object.defineProperty(exports,"getXdgCache",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.o}});Object.defineProperty(exports,"getXdgConfig",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.l}});Object.defineProperty(exports,"getXdgData",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.m}});Object.defineProperty(exports,"getXdgState",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.n}});Object.defineProperty(exports,"hasAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.i}});Object.defineProperty(exports,"requireAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.j}});Object.defineProperty(exports,"resetGlobalAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.b}});Object.defineProperty(exports,"resetInstanceAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.e}});Object.defineProperty(exports,"resolveParentSymlinksSync",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.q}});Object.defineProperty(exports,"setAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.g}});Object.defineProperty(exports,"setGlobalAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.a}});Object.defineProperty(exports,"setInstanceAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.d}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkJCOXRETY_cjs=require('./chunk-JCOXRETY.cjs');require('./chunk-ISMGLHYS.cjs'),require('./chunk-XGUPIAAF.cjs'),require('./chunk-DNE3XPCJ.cjs'),require('./chunk-E7AHWFZN.cjs'),require('./chunk-GWUDKZEH.cjs');Object.defineProperty(exports,"CURRENT_VERSION",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.q}});Object.defineProperty(exports,"addSkillToLocalLock",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.v}});Object.defineProperty(exports,"getLocalLockPath",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.r}});Object.defineProperty(exports,"readLocalLock",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.t}});Object.defineProperty(exports,"removeSkillFromLocalLock",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.w}});Object.defineProperty(exports,"storePathFromLocalLockEntry",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.s}});Object.defineProperty(exports,"writeLocalLock",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.u}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{q as CURRENT_VERSION,v as addSkillToLocalLock,r as getLocalLockPath,t as readLocalLock,w as removeSkillFromLocalLock,s as storePathFromLocalLockEntry,u as writeLocalLock}from'./chunk-6NTEYECA.mjs';import'./chunk-ML6B4IQL.mjs';import'./chunk-RWZ4LFSN.mjs';import'./chunk-ZJS7IO5V.mjs';import'./chunk-ZYDDQV73.mjs';import'./chunk-WQGSYA5D.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as scanInstalledSkillDirs,b as scanInstalledSkills}from'./chunk-5BDDXFOF.mjs';import'./chunk-AQYRRXU5.mjs';import'./chunk-6NTEYECA.mjs';import'./chunk-ML6B4IQL.mjs';import'./chunk-RWZ4LFSN.mjs';import'./chunk-ZJS7IO5V.mjs';import'./chunk-ZYDDQV73.mjs';import'./chunk-WQGSYA5D.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkDFBKA5A6_cjs=require('./chunk-DFBKA5A6.cjs');require('./chunk-UGHF4GOW.cjs'),require('./chunk-JCOXRETY.cjs'),require('./chunk-ISMGLHYS.cjs'),require('./chunk-XGUPIAAF.cjs'),require('./chunk-DNE3XPCJ.cjs'),require('./chunk-E7AHWFZN.cjs'),require('./chunk-GWUDKZEH.cjs');Object.defineProperty(exports,"scanInstalledSkillDirs",{enumerable:true,get:function(){return chunkDFBKA5A6_cjs.a}});Object.defineProperty(exports,"scanInstalledSkills",{enumerable:true,get:function(){return chunkDFBKA5A6_cjs.b}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{j as CURRENT_VERSION,r as addSkillToLock,n as computeContentHash,y as dismissPrompt,q as fetchSkillFolderHash,u as getAllLockedSkills,p as getGitHubToken,t as getSkillFromLock,k as getSkillLockPath,v as getSkillsBySource,w as isPromptDismissed,l as readSkillLock,s as removeSkillFromLock,o as resetGhAuthWarning,x as storePathFromLockEntry,m as writeSkillLock}from'./chunk-NH4TYEPW.mjs';import'./chunk-6NTEYECA.mjs';import'./chunk-ML6B4IQL.mjs';import'./chunk-RWZ4LFSN.mjs';import'./chunk-ZJS7IO5V.mjs';import'./chunk-ZYDDQV73.mjs';import'./chunk-WQGSYA5D.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk5RWSXDNO_cjs=require('./chunk-5RWSXDNO.cjs');require('./chunk-JCOXRETY.cjs'),require('./chunk-ISMGLHYS.cjs'),require('./chunk-XGUPIAAF.cjs'),require('./chunk-DNE3XPCJ.cjs'),require('./chunk-E7AHWFZN.cjs'),require('./chunk-GWUDKZEH.cjs');Object.defineProperty(exports,"CURRENT_VERSION",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.j}});Object.defineProperty(exports,"addSkillToLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.r}});Object.defineProperty(exports,"computeContentHash",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.n}});Object.defineProperty(exports,"dismissPrompt",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.y}});Object.defineProperty(exports,"fetchSkillFolderHash",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.q}});Object.defineProperty(exports,"getAllLockedSkills",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.u}});Object.defineProperty(exports,"getGitHubToken",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.p}});Object.defineProperty(exports,"getSkillFromLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.t}});Object.defineProperty(exports,"getSkillLockPath",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.k}});Object.defineProperty(exports,"getSkillsBySource",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.v}});Object.defineProperty(exports,"isPromptDismissed",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.w}});Object.defineProperty(exports,"readSkillLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.l}});Object.defineProperty(exports,"removeSkillFromLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.s}});Object.defineProperty(exports,"resetGhAuthWarning",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.o}});Object.defineProperty(exports,"storePathFromLockEntry",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.x}});Object.defineProperty(exports,"writeSkillLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.m}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkJCOXRETY_cjs=require('./chunk-JCOXRETY.cjs');require('./chunk-ISMGLHYS.cjs'),require('./chunk-XGUPIAAF.cjs'),require('./chunk-DNE3XPCJ.cjs'),require('./chunk-E7AHWFZN.cjs'),require('./chunk-GWUDKZEH.cjs');Object.defineProperty(exports,"DEFAULT_SKILL_SOURCE",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.F}});Object.defineProperty(exports,"LocalPathNotFoundError",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.R}});Object.defineProperty(exports,"STORE_INDEX_VERSION",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.o}});Object.defineProperty(exports,"acquireSourceClone",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.Q}});Object.defineProperty(exports,"cleanCache",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ja}});Object.defineProperty(exports,"cleanCachedRepo",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ia}});Object.defineProperty(exports,"derivePluginSlug",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.O}});Object.defineProperty(exports,"deriveSourceKey",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.L}});Object.defineProperty(exports,"ensureCachedSource",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ca}});Object.defineProperty(exports,"findSkillByLocation",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.Y}});Object.defineProperty(exports,"findSkillByName",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.X}});Object.defineProperty(exports,"getCacheRepoDir",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.P}});Object.defineProperty(exports,"getCacheRoot",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.N}});Object.defineProperty(exports,"getSourceDir",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.I}});Object.defineProperty(exports,"getStoreDefinitionsFile",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.K}});Object.defineProperty(exports,"getStoreDir",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.M}});Object.defineProperty(exports,"getStoreRoot",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.J}});Object.defineProperty(exports,"installFromCache",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ha}});Object.defineProperty(exports,"isCachePath",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ga}});Object.defineProperty(exports,"isDirNonEmpty",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.fa}});Object.defineProperty(exports,"listAllSkills",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.W}});Object.defineProperty(exports,"listSourceSkills",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.da}});Object.defineProperty(exports,"parseDefaultPluginConfig",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.H}});Object.defineProperty(exports,"readStoreDefinitions",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.U}});Object.defineProperty(exports,"readStoreIndex",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.S}});Object.defineProperty(exports,"removeSkillFromAllPlugins",{enumerable:true,get:function(){return chunkJCOXRETY_cjs._}});Object.defineProperty(exports,"removeSkillFromPlugin",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.Z}});Object.defineProperty(exports,"removeStoreDefinition",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ba}});Object.defineProperty(exports,"resolveDefaultSource",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.G}});Object.defineProperty(exports,"toPosixRelative",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ea}});Object.defineProperty(exports,"writeSkillToPlugin",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.V}});Object.defineProperty(exports,"writeStoreDefinition",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.$}});Object.defineProperty(exports,"writeStoreDefinitionsBatch",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.aa}});Object.defineProperty(exports,"writeStoreIndex",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.T}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{F as DEFAULT_SKILL_SOURCE,R as LocalPathNotFoundError,o as STORE_INDEX_VERSION,Q as acquireSourceClone,ja as cleanCache,ia as cleanCachedRepo,O as derivePluginSlug,L as deriveSourceKey,ca as ensureCachedSource,Y as findSkillByLocation,X as findSkillByName,P as getCacheRepoDir,N as getCacheRoot,I as getSourceDir,K as getStoreDefinitionsFile,M as getStoreDir,J as getStoreRoot,ha as installFromCache,ga as isCachePath,fa as isDirNonEmpty,W as listAllSkills,da as listSourceSkills,H as parseDefaultPluginConfig,U as readStoreDefinitions,S as readStoreIndex,_ as removeSkillFromAllPlugins,Z as removeSkillFromPlugin,ba as removeStoreDefinition,G as resolveDefaultSource,ea as toPosixRelative,V as writeSkillToPlugin,$ as writeStoreDefinition,aa as writeStoreDefinitionsBatch,T as writeStoreIndex}from'./chunk-
|
|
1
|
+
export{F as DEFAULT_SKILL_SOURCE,R as LocalPathNotFoundError,o as STORE_INDEX_VERSION,Q as acquireSourceClone,ja as cleanCache,ia as cleanCachedRepo,O as derivePluginSlug,L as deriveSourceKey,ca as ensureCachedSource,Y as findSkillByLocation,X as findSkillByName,P as getCacheRepoDir,N as getCacheRoot,I as getSourceDir,K as getStoreDefinitionsFile,M as getStoreDir,J as getStoreRoot,ha as installFromCache,ga as isCachePath,fa as isDirNonEmpty,W as listAllSkills,da as listSourceSkills,H as parseDefaultPluginConfig,U as readStoreDefinitions,S as readStoreIndex,_ as removeSkillFromAllPlugins,Z as removeSkillFromPlugin,ba as removeStoreDefinition,G as resolveDefaultSource,ea as toPosixRelative,V as writeSkillToPlugin,$ as writeStoreDefinition,aa as writeStoreDefinitionsBatch,T as writeStoreIndex}from'./chunk-6NTEYECA.mjs';import'./chunk-ML6B4IQL.mjs';import'./chunk-RWZ4LFSN.mjs';import'./chunk-ZJS7IO5V.mjs';import'./chunk-ZYDDQV73.mjs';import'./chunk-WQGSYA5D.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkQ2MOP5ZW_cjs=require('./chunk-Q2MOP5ZW.cjs');require('./chunk-GWUDKZEH.cjs');Object.defineProperty(exports,"fetchAuditData",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.c}});Object.defineProperty(exports,"flushTelemetry",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.e}});Object.defineProperty(exports,"setDetectedAgent",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.a}});Object.defineProperty(exports,"setVersion",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.b}});Object.defineProperty(exports,"track",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.d}});
|
package/dist/cli.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';var
|
|
2
|
+
'use strict';var chunkGWUDKZEH_cjs=require('./chunks/chunk-GWUDKZEH.cjs'),fs=require('fs'),path=require('path'),url=require('url');var h=path.dirname(url.fileURLToPath(chunkGWUDKZEH_cjs.c));function b(){try{let e=path.join(h,"..","package.json");return JSON.parse(fs.readFileSync(e,"utf-8")).version}catch{return "0.0.0"}}var c=new Set(["DEBUG","INFO","WARN","ERROR"]);function O(e){let t={logLevel:"INFO",printLogs:false,debug:false};for(let n=0;n<e.length;n++){let o=e[n];if(o)if(o==="--log-level"&&n+1<e.length){let s=e[n+1];if(s&&!s.startsWith("-")){let i=s.toUpperCase();c.has(i)&&(t.logLevel=i,n++);}}else if(o.startsWith("--log-level=")){let s=o.slice(12).toUpperCase();c.has(s)&&(t.logLevel=s);}else o==="--print-logs"?t.printLogs=true:o==="--debug"&&(t.debug=true);}return t}async function w(){let e=process.argv.slice(2),t=b(),{loadEnv:n}=await import('@easbot/utils');if(n(),process.env.EASBOT_LANG||(process.env.EASBOT_LANG="en-US"),e.length===0){let{renderBanner:l}=await import('./chunks/cli-handler-B6H4RZEM.cjs');l();return}if(e[0]==="--help"||e[0]==="-h"){let{renderHelp:l}=await import('./chunks/cli-handler-B6H4RZEM.cjs');l();return}if(e[0]==="--version"||e[0]==="-v"){console.log(t);return}let o=O(e),{Log:s}=await import('@easbot/utils'),{getXdgData:i,setGlobalAdapter:g,resetGlobalAdapter:d}=await import('./chunks/interfaces-5BH4K5TM.cjs'),f=path.join(i(),"log");await s.init({logDir:f,print:o.printLogs,dev:o.debug||false,level:o.logLevel});let{handleSkillsCli:L}=await import('./chunks/cli-handler-B6H4RZEM.cjs'),r=await L(e,{version:t});r.code!==0&&(process.exitCode=r.code);}w().catch(e=>{console.error(e),process.exitCode=1;}).finally(async()=>{try{let{flushTelemetry:e}=await import('./chunks/telemetry-B4PS27S5.cjs');await e();}catch{}try{let{Log:e}=await import('@easbot/utils');await e.close();}catch{}process.exit(process.exitCode??0);});
|
package/dist/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {readFileSync}from'fs';import {dirname,join}from'path';import {fileURLToPath}from'url';var m=dirname(fileURLToPath(import.meta.url));function h(){try{let e=join(m,"..","package.json");return JSON.parse(readFileSync(e,"utf-8")).version}catch{return "0.0.0"}}var a=new Set(["DEBUG","INFO","WARN","ERROR"]);function b(e){let t={logLevel:"INFO",printLogs:false,debug:false};for(let n=0;n<e.length;n++){let o=e[n];if(o)if(o==="--log-level"&&n+1<e.length){let s=e[n+1];if(s&&!s.startsWith("-")){let i=s.toUpperCase();a.has(i)&&(t.logLevel=i,n++);}}else if(o.startsWith("--log-level=")){let s=o.slice(12).toUpperCase();a.has(s)&&(t.logLevel=s);}else o==="--print-logs"?t.printLogs=true:o==="--debug"&&(t.debug=true);}return t}async function O(){let e=process.argv.slice(2),t=h(),{loadEnv:n}=await import('@easbot/utils');if(n(),process.env.EASBOT_LANG||(process.env.EASBOT_LANG="en-US"),e.length===0){let{renderBanner:l}=await import('./chunks/cli-handler-
|
|
2
|
+
import {readFileSync}from'fs';import {dirname,join}from'path';import {fileURLToPath}from'url';var m=dirname(fileURLToPath(import.meta.url));function h(){try{let e=join(m,"..","package.json");return JSON.parse(readFileSync(e,"utf-8")).version}catch{return "0.0.0"}}var a=new Set(["DEBUG","INFO","WARN","ERROR"]);function b(e){let t={logLevel:"INFO",printLogs:false,debug:false};for(let n=0;n<e.length;n++){let o=e[n];if(o)if(o==="--log-level"&&n+1<e.length){let s=e[n+1];if(s&&!s.startsWith("-")){let i=s.toUpperCase();a.has(i)&&(t.logLevel=i,n++);}}else if(o.startsWith("--log-level=")){let s=o.slice(12).toUpperCase();a.has(s)&&(t.logLevel=s);}else o==="--print-logs"?t.printLogs=true:o==="--debug"&&(t.debug=true);}return t}async function O(){let e=process.argv.slice(2),t=h(),{loadEnv:n}=await import('@easbot/utils');if(n(),process.env.EASBOT_LANG||(process.env.EASBOT_LANG="en-US"),e.length===0){let{renderBanner:l}=await import('./chunks/cli-handler-3FSM4C7L.mjs');l();return}if(e[0]==="--help"||e[0]==="-h"){let{renderHelp:l}=await import('./chunks/cli-handler-3FSM4C7L.mjs');l();return}if(e[0]==="--version"||e[0]==="-v"){console.log(t);return}let o=b(e),{Log:s}=await import('@easbot/utils'),{getXdgData:i,setGlobalAdapter:p,resetGlobalAdapter:g}=await import('./chunks/interfaces-S47ZGORM.mjs'),d=join(i(),"log");await s.init({logDir:d,print:o.printLogs,dev:o.debug||false,level:o.logLevel});let{handleSkillsCli:f}=await import('./chunks/cli-handler-3FSM4C7L.mjs'),r=await f(e,{version:t});r.code!==0&&(process.exitCode=r.code);}O().catch(e=>{console.error(e),process.exitCode=1;}).finally(async()=>{try{let{flushTelemetry:e}=await import('./chunks/telemetry-7T6MUW5A.mjs');await e();}catch{}try{let{Log:e}=await import('@easbot/utils');await e.close();}catch{}process.exit(process.exitCode??0);});
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkUJWB7QQ6_cjs=require('./chunks/chunk-UJWB7QQ6.cjs'),chunkS6YNGR7S_cjs=require('./chunks/chunk-S6YNGR7S.cjs'),chunkSXUY2J75_cjs=require('./chunks/chunk-SXUY2J75.cjs');require('./chunks/chunk-CY6UI6SJ.cjs');var chunk5BL3KG26_cjs=require('./chunks/chunk-5BL3KG26.cjs'),chunkCXH3OTTQ_cjs=require('./chunks/chunk-CXH3OTTQ.cjs'),chunkISMGLHYS_cjs=require('./chunks/chunk-ISMGLHYS.cjs'),chunkXGUPIAAF_cjs=require('./chunks/chunk-XGUPIAAF.cjs'),chunkRVR3DSD2_cjs=require('./chunks/chunk-RVR3DSD2.cjs'),chunkE7AHWFZN_cjs=require('./chunks/chunk-E7AHWFZN.cjs'),chunkVRHWDHQV_cjs=require('./chunks/chunk-VRHWDHQV.cjs'),path=require('path');var g=class{constructor(){chunkVRHWDHQV_cjs.b(this,"providers",[]);}register(o){if(this.providers.some(t=>t.id===o.id))throw new Error(`Provider with id "${o.id}" already registered`);this.providers.push(o);}findProvider(o){for(let t of this.providers)if(t.match(o).matches)return t;return null}getProviders(){return [...this.providers]}},u=new g;function at(e){u.register(e);}function ct(e){return u.findProvider(e)}function ut(){return u.getProviders()}var c=new Map;function f(e){if(c.has(e.id))throw new Error(`PluginSource with id "${e.id}" already registered`);c.set(e.id,e);}function d(){return Array.from(c.values()).map(e=>e)}function k(e){return c.get(e)??null}function P(e){return Array.from(c.values()).filter(o=>o.category===e)}async function y(){let e=d();return await Promise.all(e.map(async t=>{try{let r=await t.fetch();return {sourceId:t.id,entries:r}}catch(r){return {sourceId:t.id,error:r instanceof Error?r:new Error(String(r))}}}))}function pt(e){return {name:e.name,description:e.description,scope:"all"}}function x(e){return {id:e.id??`well-known:${new URL(e.url).hostname}`,category:"well-known",async fetch(){return (await chunkCXH3OTTQ_cjs.n.fetchAllSkills(e.url)).map(r=>({id:r.name,name:r.name,description:r.description,location:r.sourceUrl,category:"well-known",metadata:{installName:r.installName,sourceIdentifier:chunkCXH3OTTQ_cjs.n.getSourceIdentifier(e.url),sourceUrl:r.sourceUrl}}))},async load(t){let l=(await chunkCXH3OTTQ_cjs.n.fetchAllSkills(e.url)).find(n=>n.name===t.id);if(!l)throw new Error(`Skill "${t.id}" not found in well-known source ${e.url}`);return {skills:[pt(l)],version:"well-known",author:{name:new URL(e.url).hostname}}}}}async function h(e){try{let t=await(await import('fs/promises')).readFile(e,"utf-8");return JSON.parse(t)}catch{return null}}function A(e){let o=e.basePath.split(/[\\/]/).filter(Boolean).pop()??"local";return {id:e.id??`local:${o}`,category:"file",async fetch(){let r=[],l=await h(path.join(e.basePath,".claude-plugin/plugin.json"));l?.name&&r.push({id:l.name,name:l.name,description:l.description,location:e.basePath,category:"file",metadata:{skills:l.skills,manifest:"plugin.json"}});let n=await h(path.join(e.basePath,".claude-plugin/marketplace.json"));if(n?.plugins)for(let i of n.plugins)i.name&&(typeof i.source!="string"&&i.source!==void 0||r.push({id:i.name,name:i.name,description:i.description,location:i.source?path.join(e.basePath,n.metadata?.pluginRoot??"",i.source):e.basePath,category:"file",metadata:{skills:i.skills,manifest:"marketplace.json",pluginRoot:n.metadata?.pluginRoot}}));return r},async load(r){return {skills:(await chunkCXH3OTTQ_cjs.A(r.location)).map(i=>({name:i.name,description:i.description,scope:"all"})),version:"local",author:{name:o}}}}}Object.defineProperty(exports,"applyActions",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.c}});Object.defineProperty(exports,"buildMatrix",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.d}});Object.defineProperty(exports,"buildUsePrompt",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.G}});Object.defineProperty(exports,"detectAgent",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.f}});Object.defineProperty(exports,"getAgentName",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.h}});Object.defineProperty(exports,"getAgentType",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.i}});Object.defineProperty(exports,"handleSkillsCli",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.M}});Object.defineProperty(exports,"hasProjectSkills",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.k}});Object.defineProperty(exports,"initTelemetry",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.o}});Object.defineProperty(exports,"isRunningInAgent",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.g}});Object.defineProperty(exports,"launchAgentInteractively",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.J}});Object.defineProperty(exports,"matchesSkillFilter",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.m}});Object.defineProperty(exports,"materializeUseSkill",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.H}});Object.defineProperty(exports,"parseAddOptions",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.q}});Object.defineProperty(exports,"parseFindOptions",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.x}});Object.defineProperty(exports,"parseListOptions",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.A}});Object.defineProperty(exports,"parseRemoveOptions",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.D}});Object.defineProperty(exports,"parseStoreOptions",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.r}});Object.defineProperty(exports,"parseUpdateOptions",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.j}});Object.defineProperty(exports,"parseUseOptions",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.F}});Object.defineProperty(exports,"planActions",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.b}});Object.defineProperty(exports,"probeCell",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.a}});Object.defineProperty(exports,"removeCommand",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.C}});Object.defineProperty(exports,"renderBanner",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.K}});Object.defineProperty(exports,"renderHelp",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.L}});Object.defineProperty(exports,"resolveUpdateScope",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.l}});Object.defineProperty(exports,"runAdd",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.p}});Object.defineProperty(exports,"runDoctor",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.E}});Object.defineProperty(exports,"runFind",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.z}});Object.defineProperty(exports,"runList",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.B}});Object.defineProperty(exports,"runPostInstallReconcile",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.e}});Object.defineProperty(exports,"runStore",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.s}});Object.defineProperty(exports,"runStoreClean",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.u}});Object.defineProperty(exports,"runStoreList",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.t}});Object.defineProperty(exports,"runStoreRemove",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.w}});Object.defineProperty(exports,"runStoreUpdate",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.v}});Object.defineProperty(exports,"runUpdate",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.n}});Object.defineProperty(exports,"runUse",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.I}});Object.defineProperty(exports,"searchSkillsAPI",{enumerable:true,get:function(){return chunkUJWB7QQ6_cjs.y}});Object.defineProperty(exports,"fetchAuditData",{enumerable:true,get:function(){return chunkS6YNGR7S_cjs.c}});Object.defineProperty(exports,"flushTelemetry",{enumerable:true,get:function(){return chunkS6YNGR7S_cjs.e}});Object.defineProperty(exports,"setDetectedAgent",{enumerable:true,get:function(){return chunkS6YNGR7S_cjs.a}});Object.defineProperty(exports,"setVersion",{enumerable:true,get:function(){return chunkS6YNGR7S_cjs.b}});Object.defineProperty(exports,"track",{enumerable:true,get:function(){return chunkS6YNGR7S_cjs.d}});Object.defineProperty(exports,"addSkillToLock",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.i}});Object.defineProperty(exports,"computeContentHash",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.e}});Object.defineProperty(exports,"dismissPrompt",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.p}});Object.defineProperty(exports,"fetchSkillFolderHash",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.h}});Object.defineProperty(exports,"getAllLockedSkills",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.l}});Object.defineProperty(exports,"getGitHubToken",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.g}});Object.defineProperty(exports,"getSkillFromLock",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.k}});Object.defineProperty(exports,"getSkillLockPath",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.b}});Object.defineProperty(exports,"getSkillsBySource",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.m}});Object.defineProperty(exports,"isPromptDismissed",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.n}});Object.defineProperty(exports,"readSkillLock",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.c}});Object.defineProperty(exports,"removeSkillFromLock",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.j}});Object.defineProperty(exports,"resetGhAuthWarning",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.f}});Object.defineProperty(exports,"writeSkillLock",{enumerable:true,get:function(){return chunkSXUY2J75_cjs.d}});Object.defineProperty(exports,"AGENTS_DIR",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.a}});Object.defineProperty(exports,"SKILLS_SUBDIR",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.b}});Object.defineProperty(exports,"UNIVERSAL_SKILLS_DIR",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.c}});Object.defineProperty(exports,"getAgentBaseDir",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.g}});Object.defineProperty(exports,"getCanonicalPath",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.o}});Object.defineProperty(exports,"getCanonicalSkillsDir",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.e}});Object.defineProperty(exports,"getEveSubagentSkillsDir",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.f}});Object.defineProperty(exports,"getInstallPath",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.m}});Object.defineProperty(exports,"installBlobSkillForAgent",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.r}});Object.defineProperty(exports,"installRemoteSkillForAgent",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.p}});Object.defineProperty(exports,"installSkillForAgent",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.h}});Object.defineProperty(exports,"installWellKnownSkillForAgent",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.q}});Object.defineProperty(exports,"isSkillInstalled",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.k}});Object.defineProperty(exports,"listInstalledSkills",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.s}});Object.defineProperty(exports,"sanitizeName",{enumerable:true,get:function(){return chunk5BL3KG26_cjs.d}});Object.defineProperty(exports,"DEFAULT_CLONE_TIMEOUT",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.f}});Object.defineProperty(exports,"GitCloneError",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.g}});Object.defineProperty(exports,"WellKnownProvider",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.m}});Object.defineProperty(exports,"acquireSourceClone",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.Q}});Object.defineProperty(exports,"addSkillToLocalLock",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.v}});Object.defineProperty(exports,"cleanCache",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.ja}});Object.defineProperty(exports,"cleanCachedRepo",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.ia}});Object.defineProperty(exports,"cleanupTempDir",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.l}});Object.defineProperty(exports,"cloneRepo",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.k}});Object.defineProperty(exports,"discoverSkills",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.A}});Object.defineProperty(exports,"ensureCachedSource",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.ca}});Object.defineProperty(exports,"filterSkills",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.C}});Object.defineProperty(exports,"getCacheRepoDir",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.P}});Object.defineProperty(exports,"getCacheRoot",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.N}});Object.defineProperty(exports,"getLocalLockPath",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.r}});Object.defineProperty(exports,"getOwnerRepo",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.a}});Object.defineProperty(exports,"getSkillDisplayName",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.B}});Object.defineProperty(exports,"getSourceDir",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.I}});Object.defineProperty(exports,"installFromCache",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.ha}});Object.defineProperty(exports,"isGitHubHttpsCloneUrl",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.i}});Object.defineProperty(exports,"isGitHubSsoAuthError",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.j}});Object.defineProperty(exports,"isRepoPrivate",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.c}});Object.defineProperty(exports,"isSubpathSafe",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.z}});Object.defineProperty(exports,"parseGitHubRepoUrl",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.h}});Object.defineProperty(exports,"parseOwnerRepo",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.b}});Object.defineProperty(exports,"parseSkillMd",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.y}});Object.defineProperty(exports,"parseSource",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.e}});Object.defineProperty(exports,"readLocalLock",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.t}});Object.defineProperty(exports,"removeSkillFromLocalLock",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.w}});Object.defineProperty(exports,"sanitizeSubpath",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.d}});Object.defineProperty(exports,"shouldInstallInternalSkills",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.x}});Object.defineProperty(exports,"wellKnownProvider",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.n}});Object.defineProperty(exports,"writeLocalLock",{enumerable:true,get:function(){return chunkCXH3OTTQ_cjs.u}});Object.defineProperty(exports,"EVE_SUBAGENTS_DIR",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.e}});Object.defineProperty(exports,"PROJECT_SKILLS_DIR_PATTERN",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.j}});Object.defineProperty(exports,"agents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.b}});Object.defineProperty(exports,"detectInstalledAgents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.c}});Object.defineProperty(exports,"getAgentConfig",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.d}});Object.defineProperty(exports,"getAgentGlobalSkillDirs",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.l}});Object.defineProperty(exports,"getAgentProjectSkillContainerPrefixes",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.n}});Object.defineProperty(exports,"getAgentProjectSkillDirs",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.k}});Object.defineProperty(exports,"getAgentSkillDirs",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.m}});Object.defineProperty(exports,"getEveSubagents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.f}});Object.defineProperty(exports,"getNonUniversalAgents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.i}});Object.defineProperty(exports,"getOpenClawGlobalSkillsDir",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.a}});Object.defineProperty(exports,"getUniversalAgents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.h}});Object.defineProperty(exports,"isUniversalAgent",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.o}});Object.defineProperty(exports,"matchesUniversalScope",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.g}});Object.defineProperty(exports,"getAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.h}});Object.defineProperty(exports,"getGlobal",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.c}});Object.defineProperty(exports,"getHomeDir",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.k}});Object.defineProperty(exports,"getInstance",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.f}});Object.defineProperty(exports,"getProjectDirectory",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.p}});Object.defineProperty(exports,"getXdgCache",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.o}});Object.defineProperty(exports,"getXdgConfig",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.l}});Object.defineProperty(exports,"getXdgData",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.m}});Object.defineProperty(exports,"getXdgState",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.n}});Object.defineProperty(exports,"hasAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.i}});Object.defineProperty(exports,"requireAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.j}});Object.defineProperty(exports,"resetGlobalAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.b}});Object.defineProperty(exports,"resetInstanceAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.e}});Object.defineProperty(exports,"setAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.g}});Object.defineProperty(exports,"setGlobalAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.a}});Object.defineProperty(exports,"setInstanceAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.d}});Object.defineProperty(exports,"BLOB_ALLOWED_REPOS",{enumerable:true,get:function(){return chunkRVR3DSD2_cjs.c}});Object.defineProperty(exports,"fetchRepoTree",{enumerable:true,get:function(){return chunkRVR3DSD2_cjs.g}});Object.defineProperty(exports,"findSkillMdPaths",{enumerable:true,get:function(){return chunkRVR3DSD2_cjs.k}});Object.defineProperty(exports,"getSkillFolderHashFromTree",{enumerable:true,get:function(){return chunkRVR3DSD2_cjs.i}});Object.defineProperty(exports,"resetRepoTreeAuthState",{enumerable:true,get:function(){return chunkRVR3DSD2_cjs.f}});Object.defineProperty(exports,"sanitizeMetadata",{enumerable:true,get:function(){return chunkRVR3DSD2_cjs.b}});Object.defineProperty(exports,"stripTerminalEscapes",{enumerable:true,get:function(){return chunkRVR3DSD2_cjs.a}});Object.defineProperty(exports,"toSkillSlug",{enumerable:true,get:function(){return chunkRVR3DSD2_cjs.e}});Object.defineProperty(exports,"tryBlobInstall",{enumerable:true,get:function(){return chunkRVR3DSD2_cjs.l}});Object.defineProperty(exports,"computeFromDir",{enumerable:true,get:function(){return chunkE7AHWFZN_cjs.b}});Object.defineProperty(exports,"computeSnapshotHash",{enumerable:true,get:function(){return chunkE7AHWFZN_cjs.c}});Object.defineProperty(exports,"parseFrontmatter",{enumerable:true,get:function(){return chunkE7AHWFZN_cjs.a}});exports.createLocalPluginSource=A;exports.createWellKnownSource=x;exports.findProvider=ct;exports.findSource=k;exports.findSourcesByCategory=P;exports.getProviders=ut;exports.listAllEntries=y;exports.listSources=d;exports.registerProvider=at;exports.registerSource=f;exports.registry=u;
|
|
1
|
+
'use strict';var chunk2E6BHPFV_cjs=require('./chunks/chunk-2E6BHPFV.cjs'),chunkQ2MOP5ZW_cjs=require('./chunks/chunk-Q2MOP5ZW.cjs'),chunk5RWSXDNO_cjs=require('./chunks/chunk-5RWSXDNO.cjs');require('./chunks/chunk-DFBKA5A6.cjs');var chunkUGHF4GOW_cjs=require('./chunks/chunk-UGHF4GOW.cjs'),chunkJCOXRETY_cjs=require('./chunks/chunk-JCOXRETY.cjs'),chunkISMGLHYS_cjs=require('./chunks/chunk-ISMGLHYS.cjs'),chunkXGUPIAAF_cjs=require('./chunks/chunk-XGUPIAAF.cjs'),chunkDNE3XPCJ_cjs=require('./chunks/chunk-DNE3XPCJ.cjs'),chunkE7AHWFZN_cjs=require('./chunks/chunk-E7AHWFZN.cjs'),chunkGWUDKZEH_cjs=require('./chunks/chunk-GWUDKZEH.cjs'),path=require('path');var g=class{constructor(){chunkGWUDKZEH_cjs.b(this,"providers",[]);}register(o){if(this.providers.some(t=>t.id===o.id))throw new Error(`Provider with id "${o.id}" already registered`);this.providers.push(o);}findProvider(o){for(let t of this.providers)if(t.match(o).matches)return t;return null}getProviders(){return [...this.providers]}},u=new g;function at(e){u.register(e);}function ct(e){return u.findProvider(e)}function ut(){return u.getProviders()}var c=new Map;function f(e){if(c.has(e.id))throw new Error(`PluginSource with id "${e.id}" already registered`);c.set(e.id,e);}function d(){return Array.from(c.values()).map(e=>e)}function k(e){return c.get(e)??null}function P(e){return Array.from(c.values()).filter(o=>o.category===e)}async function y(){let e=d();return await Promise.all(e.map(async t=>{try{let r=await t.fetch();return {sourceId:t.id,entries:r}}catch(r){return {sourceId:t.id,error:r instanceof Error?r:new Error(String(r))}}}))}function pt(e){return {name:e.name,description:e.description,scope:"all"}}function x(e){return {id:e.id??`well-known:${new URL(e.url).hostname}`,category:"well-known",async fetch(){return (await chunkJCOXRETY_cjs.n.fetchAllSkills(e.url)).map(r=>({id:r.name,name:r.name,description:r.description,location:r.sourceUrl,category:"well-known",metadata:{installName:r.installName,sourceIdentifier:chunkJCOXRETY_cjs.n.getSourceIdentifier(e.url),sourceUrl:r.sourceUrl}}))},async load(t){let l=(await chunkJCOXRETY_cjs.n.fetchAllSkills(e.url)).find(n=>n.name===t.id);if(!l)throw new Error(`Skill "${t.id}" not found in well-known source ${e.url}`);return {skills:[pt(l)],version:"well-known",author:{name:new URL(e.url).hostname}}}}}async function h(e){try{let t=await(await import('fs/promises')).readFile(e,"utf-8");return JSON.parse(t)}catch{return null}}function A(e){let o=e.basePath.split(/[\\/]/).filter(Boolean).pop()??"local";return {id:e.id??`local:${o}`,category:"file",async fetch(){let r=[],l=await h(path.join(e.basePath,".claude-plugin/plugin.json"));l?.name&&r.push({id:l.name,name:l.name,description:l.description,location:e.basePath,category:"file",metadata:{skills:l.skills,manifest:"plugin.json"}});let n=await h(path.join(e.basePath,".claude-plugin/marketplace.json"));if(n?.plugins)for(let i of n.plugins)i.name&&(typeof i.source!="string"&&i.source!==void 0||r.push({id:i.name,name:i.name,description:i.description,location:i.source?path.join(e.basePath,n.metadata?.pluginRoot??"",i.source):e.basePath,category:"file",metadata:{skills:i.skills,manifest:"marketplace.json",pluginRoot:n.metadata?.pluginRoot}}));return r},async load(r){return {skills:(await chunkJCOXRETY_cjs.A(r.location)).map(i=>({name:i.name,description:i.description,scope:"all"})),version:"local",author:{name:o}}}}}Object.defineProperty(exports,"applyActions",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.c}});Object.defineProperty(exports,"buildMatrix",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.d}});Object.defineProperty(exports,"buildUsePrompt",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.G}});Object.defineProperty(exports,"detectAgent",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.f}});Object.defineProperty(exports,"getAgentName",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.h}});Object.defineProperty(exports,"getAgentType",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.i}});Object.defineProperty(exports,"handleSkillsCli",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.M}});Object.defineProperty(exports,"hasProjectSkills",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.k}});Object.defineProperty(exports,"initTelemetry",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.o}});Object.defineProperty(exports,"isRunningInAgent",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.g}});Object.defineProperty(exports,"launchAgentInteractively",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.J}});Object.defineProperty(exports,"matchesSkillFilter",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.m}});Object.defineProperty(exports,"materializeUseSkill",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.H}});Object.defineProperty(exports,"parseAddOptions",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.q}});Object.defineProperty(exports,"parseFindOptions",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.x}});Object.defineProperty(exports,"parseListOptions",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.A}});Object.defineProperty(exports,"parseRemoveOptions",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.D}});Object.defineProperty(exports,"parseStoreOptions",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.r}});Object.defineProperty(exports,"parseUpdateOptions",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.j}});Object.defineProperty(exports,"parseUseOptions",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.F}});Object.defineProperty(exports,"planActions",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.b}});Object.defineProperty(exports,"probeCell",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.a}});Object.defineProperty(exports,"removeCommand",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.C}});Object.defineProperty(exports,"renderBanner",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.K}});Object.defineProperty(exports,"renderHelp",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.L}});Object.defineProperty(exports,"resolveUpdateScope",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.l}});Object.defineProperty(exports,"runAdd",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.p}});Object.defineProperty(exports,"runDoctor",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.E}});Object.defineProperty(exports,"runFind",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.z}});Object.defineProperty(exports,"runList",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.B}});Object.defineProperty(exports,"runPostInstallReconcile",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.e}});Object.defineProperty(exports,"runStore",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.s}});Object.defineProperty(exports,"runStoreClean",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.u}});Object.defineProperty(exports,"runStoreList",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.t}});Object.defineProperty(exports,"runStoreRemove",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.w}});Object.defineProperty(exports,"runStoreUpdate",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.v}});Object.defineProperty(exports,"runUpdate",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.n}});Object.defineProperty(exports,"runUse",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.I}});Object.defineProperty(exports,"searchSkillsAPI",{enumerable:true,get:function(){return chunk2E6BHPFV_cjs.y}});Object.defineProperty(exports,"fetchAuditData",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.c}});Object.defineProperty(exports,"flushTelemetry",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.e}});Object.defineProperty(exports,"setDetectedAgent",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.a}});Object.defineProperty(exports,"setVersion",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.b}});Object.defineProperty(exports,"track",{enumerable:true,get:function(){return chunkQ2MOP5ZW_cjs.d}});Object.defineProperty(exports,"addSkillToLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.r}});Object.defineProperty(exports,"computeContentHash",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.n}});Object.defineProperty(exports,"dismissPrompt",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.y}});Object.defineProperty(exports,"fetchSkillFolderHash",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.q}});Object.defineProperty(exports,"getAllLockedSkills",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.u}});Object.defineProperty(exports,"getGitHubToken",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.p}});Object.defineProperty(exports,"getSkillFromLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.t}});Object.defineProperty(exports,"getSkillLockPath",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.k}});Object.defineProperty(exports,"getSkillsBySource",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.v}});Object.defineProperty(exports,"isPromptDismissed",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.w}});Object.defineProperty(exports,"readSkillLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.l}});Object.defineProperty(exports,"removeSkillFromLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.s}});Object.defineProperty(exports,"resetGhAuthWarning",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.o}});Object.defineProperty(exports,"writeSkillLock",{enumerable:true,get:function(){return chunk5RWSXDNO_cjs.m}});Object.defineProperty(exports,"AGENTS_DIR",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.a}});Object.defineProperty(exports,"SKILLS_SUBDIR",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.b}});Object.defineProperty(exports,"UNIVERSAL_SKILLS_DIR",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.c}});Object.defineProperty(exports,"getAgentBaseDir",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.g}});Object.defineProperty(exports,"getCanonicalPath",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.o}});Object.defineProperty(exports,"getCanonicalSkillsDir",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.e}});Object.defineProperty(exports,"getEveSubagentSkillsDir",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.f}});Object.defineProperty(exports,"getInstallPath",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.m}});Object.defineProperty(exports,"installBlobSkillForAgent",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.r}});Object.defineProperty(exports,"installRemoteSkillForAgent",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.p}});Object.defineProperty(exports,"installSkillForAgent",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.h}});Object.defineProperty(exports,"installWellKnownSkillForAgent",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.q}});Object.defineProperty(exports,"isSkillInstalled",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.k}});Object.defineProperty(exports,"listInstalledSkills",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.s}});Object.defineProperty(exports,"sanitizeName",{enumerable:true,get:function(){return chunkUGHF4GOW_cjs.d}});Object.defineProperty(exports,"DEFAULT_CLONE_TIMEOUT",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.f}});Object.defineProperty(exports,"GitCloneError",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.g}});Object.defineProperty(exports,"WellKnownProvider",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.m}});Object.defineProperty(exports,"acquireSourceClone",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.Q}});Object.defineProperty(exports,"addSkillToLocalLock",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.v}});Object.defineProperty(exports,"cleanCache",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ja}});Object.defineProperty(exports,"cleanCachedRepo",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ia}});Object.defineProperty(exports,"cleanupTempDir",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.l}});Object.defineProperty(exports,"cloneRepo",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.k}});Object.defineProperty(exports,"discoverSkills",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.A}});Object.defineProperty(exports,"ensureCachedSource",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ca}});Object.defineProperty(exports,"filterSkills",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.C}});Object.defineProperty(exports,"getCacheRepoDir",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.P}});Object.defineProperty(exports,"getCacheRoot",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.N}});Object.defineProperty(exports,"getLocalLockPath",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.r}});Object.defineProperty(exports,"getOwnerRepo",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.a}});Object.defineProperty(exports,"getSkillDisplayName",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.B}});Object.defineProperty(exports,"getSourceDir",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.I}});Object.defineProperty(exports,"installFromCache",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.ha}});Object.defineProperty(exports,"isGitHubHttpsCloneUrl",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.i}});Object.defineProperty(exports,"isGitHubSsoAuthError",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.j}});Object.defineProperty(exports,"isRepoPrivate",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.c}});Object.defineProperty(exports,"isSubpathSafe",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.z}});Object.defineProperty(exports,"parseGitHubRepoUrl",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.h}});Object.defineProperty(exports,"parseOwnerRepo",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.b}});Object.defineProperty(exports,"parseSkillMd",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.y}});Object.defineProperty(exports,"parseSource",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.e}});Object.defineProperty(exports,"readLocalLock",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.t}});Object.defineProperty(exports,"removeSkillFromLocalLock",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.w}});Object.defineProperty(exports,"sanitizeSubpath",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.d}});Object.defineProperty(exports,"shouldInstallInternalSkills",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.x}});Object.defineProperty(exports,"wellKnownProvider",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.n}});Object.defineProperty(exports,"writeLocalLock",{enumerable:true,get:function(){return chunkJCOXRETY_cjs.u}});Object.defineProperty(exports,"EVE_SUBAGENTS_DIR",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.e}});Object.defineProperty(exports,"PROJECT_SKILLS_DIR_PATTERN",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.j}});Object.defineProperty(exports,"agents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.b}});Object.defineProperty(exports,"detectInstalledAgents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.c}});Object.defineProperty(exports,"getAgentConfig",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.d}});Object.defineProperty(exports,"getAgentGlobalSkillDirs",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.l}});Object.defineProperty(exports,"getAgentProjectSkillContainerPrefixes",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.n}});Object.defineProperty(exports,"getAgentProjectSkillDirs",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.k}});Object.defineProperty(exports,"getAgentSkillDirs",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.m}});Object.defineProperty(exports,"getEveSubagents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.f}});Object.defineProperty(exports,"getNonUniversalAgents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.i}});Object.defineProperty(exports,"getOpenClawGlobalSkillsDir",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.a}});Object.defineProperty(exports,"getUniversalAgents",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.h}});Object.defineProperty(exports,"isUniversalAgent",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.o}});Object.defineProperty(exports,"matchesUniversalScope",{enumerable:true,get:function(){return chunkISMGLHYS_cjs.g}});Object.defineProperty(exports,"getAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.h}});Object.defineProperty(exports,"getGlobal",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.c}});Object.defineProperty(exports,"getHomeDir",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.k}});Object.defineProperty(exports,"getInstance",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.f}});Object.defineProperty(exports,"getProjectDirectory",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.p}});Object.defineProperty(exports,"getXdgCache",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.o}});Object.defineProperty(exports,"getXdgConfig",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.l}});Object.defineProperty(exports,"getXdgData",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.m}});Object.defineProperty(exports,"getXdgState",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.n}});Object.defineProperty(exports,"hasAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.i}});Object.defineProperty(exports,"requireAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.j}});Object.defineProperty(exports,"resetGlobalAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.b}});Object.defineProperty(exports,"resetInstanceAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.e}});Object.defineProperty(exports,"setAgentAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.g}});Object.defineProperty(exports,"setGlobalAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.a}});Object.defineProperty(exports,"setInstanceAdapter",{enumerable:true,get:function(){return chunkXGUPIAAF_cjs.d}});Object.defineProperty(exports,"BLOB_ALLOWED_REPOS",{enumerable:true,get:function(){return chunkDNE3XPCJ_cjs.c}});Object.defineProperty(exports,"fetchRepoTree",{enumerable:true,get:function(){return chunkDNE3XPCJ_cjs.g}});Object.defineProperty(exports,"findSkillMdPaths",{enumerable:true,get:function(){return chunkDNE3XPCJ_cjs.k}});Object.defineProperty(exports,"getSkillFolderHashFromTree",{enumerable:true,get:function(){return chunkDNE3XPCJ_cjs.i}});Object.defineProperty(exports,"resetRepoTreeAuthState",{enumerable:true,get:function(){return chunkDNE3XPCJ_cjs.f}});Object.defineProperty(exports,"sanitizeMetadata",{enumerable:true,get:function(){return chunkDNE3XPCJ_cjs.b}});Object.defineProperty(exports,"stripTerminalEscapes",{enumerable:true,get:function(){return chunkDNE3XPCJ_cjs.a}});Object.defineProperty(exports,"toSkillSlug",{enumerable:true,get:function(){return chunkDNE3XPCJ_cjs.e}});Object.defineProperty(exports,"tryBlobInstall",{enumerable:true,get:function(){return chunkDNE3XPCJ_cjs.l}});Object.defineProperty(exports,"computeFromDir",{enumerable:true,get:function(){return chunkE7AHWFZN_cjs.b}});Object.defineProperty(exports,"computeSnapshotHash",{enumerable:true,get:function(){return chunkE7AHWFZN_cjs.c}});Object.defineProperty(exports,"parseFrontmatter",{enumerable:true,get:function(){return chunkE7AHWFZN_cjs.a}});exports.createLocalPluginSource=A;exports.createWellKnownSource=x;exports.findProvider=ct;exports.findSource=k;exports.findSourcesByCategory=P;exports.getProviders=ut;exports.listAllEntries=y;exports.listSources=d;exports.registerProvider=at;exports.registerSource=f;exports.registry=u;
|
package/dist/index.d.cts
CHANGED
|
@@ -628,7 +628,7 @@ declare function parseStoreOptions(args: string[]): {
|
|
|
628
628
|
declare function runStore(args: string[], options?: StoreOptions): Promise<number>;
|
|
629
629
|
declare function runStoreList(keyword: string | undefined, options?: StoreOptions): Promise<number>;
|
|
630
630
|
declare function runStoreClean(options?: StoreOptions): Promise<number>;
|
|
631
|
-
declare function runStoreUpdate(
|
|
631
|
+
declare function runStoreUpdate(sourceKey: string | undefined, options?: StoreOptions): Promise<number>;
|
|
632
632
|
declare function runStoreRemove(restArgs: string[], options?: StoreOptions): Promise<number>;
|
|
633
633
|
|
|
634
634
|
interface UseOptions {
|
|
@@ -746,7 +746,7 @@ interface StoreCleanForceTelemetryData {
|
|
|
746
746
|
}
|
|
747
747
|
interface StoreUpdateTelemetryData {
|
|
748
748
|
event: 'store_update';
|
|
749
|
-
|
|
749
|
+
sourceKey?: string;
|
|
750
750
|
sourceCount?: string;
|
|
751
751
|
successCount?: string;
|
|
752
752
|
failCount?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -628,7 +628,7 @@ declare function parseStoreOptions(args: string[]): {
|
|
|
628
628
|
declare function runStore(args: string[], options?: StoreOptions): Promise<number>;
|
|
629
629
|
declare function runStoreList(keyword: string | undefined, options?: StoreOptions): Promise<number>;
|
|
630
630
|
declare function runStoreClean(options?: StoreOptions): Promise<number>;
|
|
631
|
-
declare function runStoreUpdate(
|
|
631
|
+
declare function runStoreUpdate(sourceKey: string | undefined, options?: StoreOptions): Promise<number>;
|
|
632
632
|
declare function runStoreRemove(restArgs: string[], options?: StoreOptions): Promise<number>;
|
|
633
633
|
|
|
634
634
|
interface UseOptions {
|
|
@@ -746,7 +746,7 @@ interface StoreCleanForceTelemetryData {
|
|
|
746
746
|
}
|
|
747
747
|
interface StoreUpdateTelemetryData {
|
|
748
748
|
event: 'store_update';
|
|
749
|
-
|
|
749
|
+
sourceKey?: string;
|
|
750
750
|
sourceCount?: string;
|
|
751
751
|
successCount?: string;
|
|
752
752
|
failCount?: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as applyActions,d as buildMatrix,G as buildUsePrompt,f as detectAgent,h as getAgentName,i as getAgentType,M as handleSkillsCli,k as hasProjectSkills,o as initTelemetry,g as isRunningInAgent,J as launchAgentInteractively,m as matchesSkillFilter,H as materializeUseSkill,q as parseAddOptions,x as parseFindOptions,A as parseListOptions,D as parseRemoveOptions,r as parseStoreOptions,j as parseUpdateOptions,F as parseUseOptions,b as planActions,a as probeCell,C as removeCommand,K as renderBanner,L as renderHelp,l as resolveUpdateScope,p as runAdd,E as runDoctor,z as runFind,B as runList,e as runPostInstallReconcile,s as runStore,u as runStoreClean,t as runStoreList,w as runStoreRemove,v as runStoreUpdate,n as runUpdate,I as runUse,y as searchSkillsAPI}from'./chunks/chunk-
|
|
1
|
+
export{c as applyActions,d as buildMatrix,G as buildUsePrompt,f as detectAgent,h as getAgentName,i as getAgentType,M as handleSkillsCli,k as hasProjectSkills,o as initTelemetry,g as isRunningInAgent,J as launchAgentInteractively,m as matchesSkillFilter,H as materializeUseSkill,q as parseAddOptions,x as parseFindOptions,A as parseListOptions,D as parseRemoveOptions,r as parseStoreOptions,j as parseUpdateOptions,F as parseUseOptions,b as planActions,a as probeCell,C as removeCommand,K as renderBanner,L as renderHelp,l as resolveUpdateScope,p as runAdd,E as runDoctor,z as runFind,B as runList,e as runPostInstallReconcile,s as runStore,u as runStoreClean,t as runStoreList,w as runStoreRemove,v as runStoreUpdate,n as runUpdate,I as runUse,y as searchSkillsAPI}from'./chunks/chunk-J6PRUXFG.mjs';export{c as fetchAuditData,e as flushTelemetry,a as setDetectedAgent,b as setVersion,d as track}from'./chunks/chunk-CFMOYU7R.mjs';export{r as addSkillToLock,n as computeContentHash,y as dismissPrompt,q as fetchSkillFolderHash,u as getAllLockedSkills,p as getGitHubToken,t as getSkillFromLock,k as getSkillLockPath,v as getSkillsBySource,w as isPromptDismissed,l as readSkillLock,s as removeSkillFromLock,o as resetGhAuthWarning,m as writeSkillLock}from'./chunks/chunk-NH4TYEPW.mjs';import'./chunks/chunk-5BDDXFOF.mjs';export{a as AGENTS_DIR,b as SKILLS_SUBDIR,c as UNIVERSAL_SKILLS_DIR,g as getAgentBaseDir,o as getCanonicalPath,e as getCanonicalSkillsDir,f as getEveSubagentSkillsDir,m as getInstallPath,r as installBlobSkillForAgent,p as installRemoteSkillForAgent,h as installSkillForAgent,q as installWellKnownSkillForAgent,k as isSkillInstalled,s as listInstalledSkills,d as sanitizeName}from'./chunks/chunk-AQYRRXU5.mjs';import {n,A as A$1}from'./chunks/chunk-6NTEYECA.mjs';export{f as DEFAULT_CLONE_TIMEOUT,g as GitCloneError,m as WellKnownProvider,Q as acquireSourceClone,v as addSkillToLocalLock,ja as cleanCache,ia as cleanCachedRepo,l as cleanupTempDir,k as cloneRepo,A as discoverSkills,ca as ensureCachedSource,C as filterSkills,P as getCacheRepoDir,N as getCacheRoot,r as getLocalLockPath,a as getOwnerRepo,B as getSkillDisplayName,I as getSourceDir,ha as installFromCache,i as isGitHubHttpsCloneUrl,j as isGitHubSsoAuthError,c as isRepoPrivate,z as isSubpathSafe,h as parseGitHubRepoUrl,b as parseOwnerRepo,y as parseSkillMd,e as parseSource,t as readLocalLock,w as removeSkillFromLocalLock,d as sanitizeSubpath,x as shouldInstallInternalSkills,n as wellKnownProvider,u as writeLocalLock}from'./chunks/chunk-6NTEYECA.mjs';export{e as EVE_SUBAGENTS_DIR,j as PROJECT_SKILLS_DIR_PATTERN,b as agents,c as detectInstalledAgents,d as getAgentConfig,l as getAgentGlobalSkillDirs,n as getAgentProjectSkillContainerPrefixes,k as getAgentProjectSkillDirs,m as getAgentSkillDirs,f as getEveSubagents,i as getNonUniversalAgents,a as getOpenClawGlobalSkillsDir,h as getUniversalAgents,o as isUniversalAgent,g as matchesUniversalScope}from'./chunks/chunk-ML6B4IQL.mjs';export{h as getAgentAdapter,c as getGlobal,k as getHomeDir,f as getInstance,p as getProjectDirectory,o as getXdgCache,l as getXdgConfig,m as getXdgData,n as getXdgState,i as hasAgentAdapter,j as requireAgentAdapter,b as resetGlobalAdapter,e as resetInstanceAdapter,g as setAgentAdapter,a as setGlobalAdapter,d as setInstanceAdapter}from'./chunks/chunk-RWZ4LFSN.mjs';export{c as BLOB_ALLOWED_REPOS,g as fetchRepoTree,k as findSkillMdPaths,i as getSkillFolderHashFromTree,f as resetRepoTreeAuthState,b as sanitizeMetadata,a as stripTerminalEscapes,e as toSkillSlug,l as tryBlobInstall}from'./chunks/chunk-ZJS7IO5V.mjs';export{b as computeFromDir,c as computeSnapshotHash,a as parseFrontmatter}from'./chunks/chunk-ZYDDQV73.mjs';import {b}from'./chunks/chunk-WQGSYA5D.mjs';import {join}from'path';var d=class{constructor(){b(this,"providers",[]);}register(o){if(this.providers.some(t=>t.id===o.id))throw new Error(`Provider with id "${o.id}" already registered`);this.providers.push(o);}findProvider(o){for(let t of this.providers)if(t.match(o).matches)return t;return null}getProviders(){return [...this.providers]}},p=new d;function ct(e){p.register(e);}function ut(e){return p.findProvider(e)}function pt(){return p.getProviders()}var u=new Map;function k(e){if(u.has(e.id))throw new Error(`PluginSource with id "${e.id}" already registered`);u.set(e.id,e);}function S(){return Array.from(u.values()).map(e=>e)}function P(e){return u.get(e)??null}function y(e){return Array.from(u.values()).filter(o=>o.category===e)}async function x(){let e=S();return await Promise.all(e.map(async t=>{try{let r=await t.fetch();return {sourceId:t.id,entries:r}}catch(r){return {sourceId:t.id,error:r instanceof Error?r:new Error(String(r))}}}))}function gt(e){return {name:e.name,description:e.description,scope:"all"}}function h(e){return {id:e.id??`well-known:${new URL(e.url).hostname}`,category:"well-known",async fetch(){return (await n.fetchAllSkills(e.url)).map(r=>({id:r.name,name:r.name,description:r.description,location:r.sourceUrl,category:"well-known",metadata:{installName:r.installName,sourceIdentifier:n.getSourceIdentifier(e.url),sourceUrl:r.sourceUrl}}))},async load(t){let l=(await n.fetchAllSkills(e.url)).find(n=>n.name===t.id);if(!l)throw new Error(`Skill "${t.id}" not found in well-known source ${e.url}`);return {skills:[gt(l)],version:"well-known",author:{name:new URL(e.url).hostname}}}}}async function A(e){try{let t=await(await import('fs/promises')).readFile(e,"utf-8");return JSON.parse(t)}catch{return null}}function w(e){let o=e.basePath.split(/[\\/]/).filter(Boolean).pop()??"local";return {id:e.id??`local:${o}`,category:"file",async fetch(){let r=[],l=await A(join(e.basePath,".claude-plugin/plugin.json"));l?.name&&r.push({id:l.name,name:l.name,description:l.description,location:e.basePath,category:"file",metadata:{skills:l.skills,manifest:"plugin.json"}});let n=await A(join(e.basePath,".claude-plugin/marketplace.json"));if(n?.plugins)for(let i of n.plugins)i.name&&(typeof i.source!="string"&&i.source!==void 0||r.push({id:i.name,name:i.name,description:i.description,location:i.source?join(e.basePath,n.metadata?.pluginRoot??"",i.source):e.basePath,category:"file",metadata:{skills:i.skills,manifest:"marketplace.json",pluginRoot:n.metadata?.pluginRoot}}));return r},async load(r){return {skills:(await A$1(r.location)).map(i=>({name:i.name,description:i.description,scope:"all"})),version:"local",author:{name:o}}}}}export{w as createLocalPluginSource,h as createWellKnownSource,ut as findProvider,P as findSource,y as findSourcesByCategory,pt as getProviders,x as listAllEntries,S as listSources,ct as registerProvider,k as registerSource,p as registry};
|