@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
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a,c}from'./chunk-ZYDDQV73.mjs';var C=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g,I=/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g,E=/\x1b[P^_][\s\S]*?(?:\x1b\\)/g,T=/\x1b[\x20-\x7e]/g,D=/[\x80-\x9f]/g,A=/[\x00-\x06\x07\x08\x0b\x0c\x0d-\x1a\x1c-\x1f\x7f]/g;function B(n){return n.replace(I,"").replace(E,"").replace(C,"").replace(T,"").replace(D,"").replace(A,"")}function b(n){return B(n).replace(/[\r\n]+/g," ").trim()}var H=process.env.SKILLS_DOWNLOAD_URL||"https://skills.sh",$={},V=["houjallen","vercel-labs","anthropics"],L=1e4;function M(n){return n.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}var w=false;function X(){w=false;}async function x(n,r,t){try{let a=`https://api.github.com/repos/${n}/git/trees/${encodeURIComponent(r)}?recursive=1`,s={Accept:"application/vnd.github.v3+json","User-Agent":"skills-cli"};t&&(s.Authorization=`Bearer ${t}`);let l=await fetch(a,{headers:s,signal:AbortSignal.timeout(L)});if(l.ok){let i=await l.json();return {tree:{sha:i.sha,branch:r,tree:i.tree},rateLimited:!1}}return {tree:null,rateLimited:l.status===403&&l.headers.get("x-ratelimit-remaining")==="0"}}catch{return {tree:null,rateLimited:false}}}async function P(n,r,t){let a=r?[r]:["HEAD","main","master"];if(w&&t){let u=t();if(!u)return null;for(let i of a){let p=await x(n,i,u);if(p.tree)return p.tree}return null}let s=false;for(let u of a){let i=await x(n,u,null);if(i.tree)return i.tree;if(i.rateLimited){s=true;break}}if(!s||!t)return null;w=true;let l=t();if(!l)return null;for(let u of a){let i=await x(n,u,l);if(i.tree)return i.tree}return null}async function O(n,r,t){let a=await P(n,r,t);return a?{tree:a,snapshotHash:a.sha}:null}function F(n,r){let t=r.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(s=>s.type==="tree"&&s.path===t)?.sha??null:n.sha}async function q(n,r,t,a){let s=await O(n,t,a);return s?F(s.tree,r):null}function W(n,r={}){let t=new Set(["node_modules",".git","dist","build","__pycache__"]),a=r.maxDepth??5,s=r.limit??100,l=r.subpath??"",i=(l?l.endsWith("/")?l.slice(0,-1):l:"").replace(/\\/g,"/"),p=n.tree.filter(e=>e.type==="blob"&&e.path.toLowerCase().endsWith("skill.md")).map(e=>e.path);if(p.length===0)return [];let h=[],S=new Set;for(let e of p){if(i!==""&&e!==i&&e!==`${i}.SKILL.md`&&!e.startsWith(`${i}/`))continue;let o=e.split("/");o.length<1||o.length>a||o[o.length-1].toLowerCase()==="skill.md"&&(o.some(c=>t.has(c)||c===".well-known")||S.has(e)||(S.add(e),h.push(e)));}return h.length>s?(console.warn(`[blob.findSkillMdPaths] tree has ${h.length} SKILL.md > limit=${s}\uFF0C\u5DF2\u622A\u65AD\u3002\u8981\u62FF\u5168\u90E8\u4F20 \`limit: Infinity\`\u3002`),h.slice(0,s)):h}async function U(n,r,t){try{let a=`https://raw.githubusercontent.com/${n}/${r}/${t}`,s=await fetch(a,{signal:AbortSignal.timeout(L)});return s.ok?await s.text():null}catch{return null}}async function v(n,r){try{let[t,a]=n.split("/"),s=`${H}/api/download/${encodeURIComponent(t)}/${encodeURIComponent(a)}/${encodeURIComponent(r)}`,u=$[n.toLowerCase()]?.downloadUrl(r)??s,i=await fetch(u,{signal:AbortSignal.timeout(L)});return i.ok?await i.json():null}catch{return null}}async function J(n,r={}){let t=await P(n,r.ref,r.getToken);if(!t)return null;let a$1=W(t,{subpath:r.subpath});if(a$1.length===0)return null;let s=await Promise.all(a$1.map(async e=>{let o=await U(n,t.branch,e);return {mdPath:e,content:o}})),l=[];for(let{mdPath:e,content:o}of s){if(!o)continue;let{data:c}=a(o);if(!c.name||!c.description||typeof c.name!="string"||typeof c.description!="string"||c.metadata?.internal===true&&!r.includeInternal)continue;let d=b(c.name),m=b(c.description);l.push({mdPath:e,name:d,description:m,content:o,slug:M(d),metadata:c.metadata});}if(l.length===0)return null;let u=n.toLowerCase(),i=await Promise.all(l.map(async e=>{let o=await v(u,e.slug);return {skill:e,download:o}}));if(!i.every(e=>e.download!==null))return null;let h=i.map(({skill:e,download:o})=>{let c$1=e.mdPath.toLowerCase(),g=c$1.endsWith("/skill.md")?e.mdPath.slice(0,-9):c$1==="skill.md"?"":e.mdPath.slice(0,-9),d=g?o.files:o.files.filter(f=>f.path.toLowerCase()==="skill.md"),m=g?d.map(f=>({path:f.path.startsWith(`${g}/`)?f.path.slice(g.length+1):f.path,contents:f.contents})):d;return {name:e.name,description:e.description,path:"",rawContent:e.content,metadata:e.metadata,files:m,snapshotHash:m.length===o.files.length?o.hash:c(m),repoPath:e.mdPath,repoSubpath:r.subpath}}),S=t.sha;return {skills:h,tree:t,subpath:r.subpath,snapshotHash:S}}
|
|
2
|
-
export{B as a,b,$ as c,V as d,M as e,X as f,P as g,O as h,F as i,q as j,W as k,J as l};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkE7AHWFZN_cjs=require('./chunk-E7AHWFZN.cjs');var _=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/g,C=/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g,I=/\x1b[P^_][\s\S]*?(?:\x1b\\)/g,E=/\x1b[\x20-\x7e]/g,T=/[\x80-\x9f]/g,D=/[\x00-\x06\x07\x08\x0b\x0c\x0d-\x1a\x1c-\x1f\x7f]/g;function A(n){return n.replace(C,"").replace(I,"").replace(_,"").replace(E,"").replace(T,"").replace(D,"")}function b(n){return A(n).replace(/[\r\n]+/g," ").trim()}var B=process.env.SKILLS_DOWNLOAD_URL||"https://skills.sh",H={},G=["houjallen","vercel-labs","anthropics"],L=1e4;function $(n){return n.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}var w=false;function V(){w=false;}async function x(n,r,t){try{let a=`https://api.github.com/repos/${n}/git/trees/${encodeURIComponent(r)}?recursive=1`,s={Accept:"application/vnd.github.v3+json","User-Agent":"skills-cli"};t&&(s.Authorization=`Bearer ${t}`);let l=await fetch(a,{headers:s,signal:AbortSignal.timeout(L)});if(l.ok){let i=await l.json();return {tree:{sha:i.sha,branch:r,tree:i.tree},rateLimited:!1}}return {tree:null,rateLimited:l.status===403&&l.headers.get("x-ratelimit-remaining")==="0"}}catch{return {tree:null,rateLimited:false}}}async function P(n,r,t){let a=r?[r]:["HEAD","main","master"];if(w&&t){let u=t();if(!u)return null;for(let i of a){let p=await x(n,i,u);if(p.tree)return p.tree}return null}let s=false;for(let u of a){let i=await x(n,u,null);if(i.tree)return i.tree;if(i.rateLimited){s=true;break}}if(!s||!t)return null;w=true;let l=t();if(!l)return null;for(let u of a){let i=await x(n,u,l);if(i.tree)return i.tree}return null}async function M(n,r,t){let a=await P(n,r,t);return a?{tree:a,snapshotHash:a.sha}:null}function O(n,r){let t=r.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(s=>s.type==="tree"&&s.path===t)?.sha??null:n.sha}async function X(n,r,t,a){let s=await M(n,t,a);return s?O(s.tree,r):null}function F(n,r={}){let t=new Set(["node_modules",".git","dist","build","__pycache__"]),a=r.maxDepth??5,s=r.limit??100,l=r.subpath??"",i=(l?l.endsWith("/")?l.slice(0,-1):l:"").replace(/\\/g,"/"),p=n.tree.filter(e=>e.type==="blob"&&e.path.toLowerCase().endsWith("skill.md")).map(e=>e.path);if(p.length===0)return [];let h=[],S=new Set;for(let e of p){if(i!==""&&e!==i&&e!==`${i}.SKILL.md`&&!e.startsWith(`${i}/`))continue;let o=e.split("/");o.length<1||o.length>a||o[o.length-1].toLowerCase()==="skill.md"&&(o.some(c=>t.has(c)||c===".well-known")||S.has(e)||(S.add(e),h.push(e)));}return h.length>s?(console.warn(`[blob.findSkillMdPaths] tree has ${h.length} SKILL.md > limit=${s}\uFF0C\u5DF2\u622A\u65AD\u3002\u8981\u62FF\u5168\u90E8\u4F20 \`limit: Infinity\`\u3002`),h.slice(0,s)):h}async function W(n,r,t){try{let a=`https://raw.githubusercontent.com/${n}/${r}/${t}`,s=await fetch(a,{signal:AbortSignal.timeout(L)});return s.ok?await s.text():null}catch{return null}}async function U(n,r){try{let[t,a]=n.split("/"),s=`${B}/api/download/${encodeURIComponent(t)}/${encodeURIComponent(a)}/${encodeURIComponent(r)}`,u=H[n.toLowerCase()]?.downloadUrl(r)??s,i=await fetch(u,{signal:AbortSignal.timeout(L)});return i.ok?await i.json():null}catch{return null}}async function q(n,r={}){let t=await P(n,r.ref,r.getToken);if(!t)return null;let a=F(t,{subpath:r.subpath});if(a.length===0)return null;let s=await Promise.all(a.map(async e=>{let o=await W(n,t.branch,e);return {mdPath:e,content:o}})),l=[];for(let{mdPath:e,content:o}of s){if(!o)continue;let{data:c}=chunkE7AHWFZN_cjs.a(o);if(!c.name||!c.description||typeof c.name!="string"||typeof c.description!="string"||c.metadata?.internal===true&&!r.includeInternal)continue;let d=b(c.name),m=b(c.description);l.push({mdPath:e,name:d,description:m,content:o,slug:$(d),metadata:c.metadata});}if(l.length===0)return null;let u=n.toLowerCase(),i=await Promise.all(l.map(async e=>{let o=await U(u,e.slug);return {skill:e,download:o}}));if(!i.every(e=>e.download!==null))return null;let h=i.map(({skill:e,download:o})=>{let c=e.mdPath.toLowerCase(),g=c.endsWith("/skill.md")?e.mdPath.slice(0,-9):c==="skill.md"?"":e.mdPath.slice(0,-9),d=g?o.files:o.files.filter(f=>f.path.toLowerCase()==="skill.md"),m=g?d.map(f=>({path:f.path.startsWith(`${g}/`)?f.path.slice(g.length+1):f.path,contents:f.contents})):d;return {name:e.name,description:e.description,path:"",rawContent:e.content,metadata:e.metadata,files:m,snapshotHash:m.length===o.files.length?o.hash:chunkE7AHWFZN_cjs.c(m),repoPath:e.mdPath,repoSubpath:r.subpath}}),S=t.sha;return {skills:h,tree:t,subpath:r.subpath,snapshotHash:S}}
|
|
2
|
-
exports.a=A;exports.b=b;exports.c=H;exports.d=G;exports.e=$;exports.f=V;exports.g=P;exports.h=M;exports.i=O;exports.j=X;exports.k=F;exports.l=q;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkCXH3OTTQ_cjs=require('./chunk-CXH3OTTQ.cjs'),chunkXGUPIAAF_cjs=require('./chunk-XGUPIAAF.cjs'),promises=require('fs/promises'),path=require('path'),crypto=require('crypto'),child_process=require('child_process'),n=require('picocolors');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var n__default=/*#__PURE__*/_interopDefault(n);var x=".skill-lock.json",d=6;function m(){return path.join(chunkXGUPIAAF_cjs.m(),"skills",x)}async function o(){let t=m();return await E(t)??F()}async function E(t){try{let i=await promises.readFile(t,"utf-8"),e=JSON.parse(i);return typeof e.version!="number"||!e.skills||e.version<d?null:e}catch{return null}}async function c(t){let i=m();await promises.mkdir(path.dirname(i),{recursive:true});let e=JSON.stringify(t,null,2);await promises.writeFile(i,e,"utf-8");}function R(t){return crypto.createHash("sha256").update(t,"utf-8").digest("hex")}var l=false;function _(){l=false;}function D(){if(process.env.GITHUB_TOKEN)return process.env.GITHUB_TOKEN;if(process.env.GH_TOKEN)return process.env.GH_TOKEN;l||(process.stderr.write(`${n__default.default.yellow("\u2502")} ${n__default.default.yellow("GitHub rate limit reached")} \u2014 using your ${n__default.default.cyan("gh")} login to continue.
|
|
2
|
-
${n__default.default.yellow("\u2502")} ${n__default.default.dim(`Tip: set ${n__default.default.cyan("GITHUB_TOKEN")} to avoid this prompt, or use ${n__default.default.cyan("--full-depth")} to clone instead.
|
|
3
|
-
`)}`),l=true);try{let t=child_process.execSync("gh auth token",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(t)return t}catch{}return null}async function $(t,i,e,r){let{fetchRepoTree:s,getSkillFolderHashFromTree:f}=await import('./blob-ZDEX2HRV.cjs'),a=await s(t,r,e??void 0);return a?f(a,i):null}async function K(t,i){let e=await o(),r=new Date().toISOString(),s=e.skills[t];e.skills[t]={...i,installedAt:s?.installedAt??r,updatedAt:r},await c(e);}async function B(t){let i=await o();return t in i.skills?(delete i.skills[t],await c(i),true):false}async function U(t){return (await o()).skills[t]??null}async function j(){return (await o()).skills}async function C(){let t=await o(),i=new Map;for(let[e,r]of Object.entries(t.skills)){let s=i.get(r.source);s?s.skills.push(e):i.set(r.source,{skills:[e],entry:r});}return i}function F(){return {version:d,skills:{},dismissed:{}}}async function J(t){return (await o()).dismissed?.[t]===true}function M(t,i){return t?chunkCXH3OTTQ_cjs.p(t,chunkCXH3OTTQ_cjs.J(),i):null}async function W(t){let i=await o();i.dismissed||(i.dismissed={}),i.dismissed[t]=true,await c(i);}exports.a=d;exports.b=m;exports.c=o;exports.d=c;exports.e=R;exports.f=_;exports.g=D;exports.h=$;exports.i=K;exports.j=B;exports.k=U;exports.l=j;exports.m=C;exports.n=J;exports.o=M;exports.p=W;
|