useakit 0.2.0-dev.46 → 0.2.0-dev.48

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.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # useakit
2
2
 
3
- Install your [agent kit](https://agent-kit.fausanchez.com) skills into Claude Code, Codex, Cursor and Gemini CLI.
3
+ Install your [agent kit](https://useagentkit.dev) skills into Claude Code, Codex, Cursor and Gemini CLI.
4
4
 
5
5
  ```sh
6
6
  npx useakit init
@@ -21,7 +21,7 @@ a-kit list # your skills and kits, their context cost, and where t
21
21
  a-kit try release "Cut a release for v2" # Claude with the skill and without it
22
22
  ```
23
23
 
24
- Public skills are in the [gallery](https://agent-kit.fausanchez.com/s). `npx useakit add <org>/<skill>` installs one without an account, at its current version (public skills have no channels); `a-kit update` keeps it current. They're kept under `public` in `agent-kit.lock.json`.
24
+ Public skills are in the [gallery](https://useagentkit.dev/s). `npx useakit add <org>/<skill>` installs one without an account, at its current version (public skills have no channels); `a-kit update` keeps it current. They're kept under `public` in `agent-kit.lock.json`.
25
25
 
26
26
  `a-kit try` sends the prompt to Claude twice, with the skill and without it, on your organization's Claude API key, and prints both answers with their tokens and cost. `--model` and `--skill-version` pick what to run; the prompt can also come in on stdin. Only the organization's admins can run it, since it spends the key.
27
27
 
package/dist/index.mjs CHANGED
@@ -74,7 +74,7 @@ ${o}${e}
74
74
  ${i}`:``}`}default:return`${r}${t?`${n(`cyan`,P)} `:``}${a}
75
75
  ${t?n(`cyan`,ft):``}
76
76
  `}}}).prompt(),zt=[`stable`,`beta`],Bt=[`latest`,...zt],Vt=e=>zt.includes(e),Ht=e=>Bt.includes(e);function Ut(e,t,n){if(n===`latest`)return{version:t,fellBack:!1};let r=e[n];return r===null?{version:t,fellBack:!0}:{version:r,fellBack:!1}}var Wt=`0.2.0`;const Gt=[{id:`claude-code`,name:`Claude Code`,projectDir:`.claude/skills`,globalDir:`.claude/skills`,marker:`.claude`},{id:`codex`,name:`Codex`,projectDir:`.agents/skills`,globalDir:`.agents/skills`,marker:`.codex`},{id:`cursor`,name:`Cursor`,projectDir:`.agents/skills`,globalDir:`.cursor/skills`,marker:`.cursor`},{id:`gemini-cli`,name:`Gemini CLI`,projectDir:`.agents/skills`,globalDir:`.gemini/skills`,marker:`.gemini`}],Kt=e=>e===`global`?b():process.cwd();function qt(e=b()){return Gt.filter(t=>l(m(e,t.marker)))}function Jt(e){return Gt.find(t=>t.id===e)}function Yt(e,t,n=Kt(t)){let r=e.map(e=>_(n,t===`global`?e.globalDir:e.projectDir));return[...new Set(r)]}const Xt={maxNameLength:100,maxPromptBytes:20480,maxChecks:20,maxHiddenFiles:20,maxHiddenBytes:1048576,maxSetupLength:4096,maxCheckTextLength:10240,minTrials:1,maxTrials:5,maxAttemptsPerRun:50,maxModelsPerRun:4,maxFinalTextBytes:20480,maxJudgedDiffBytes:102400,maxCheckOutputBytes:8192,maxSandboxesPerOrganization:5};function Zt(e){return e===null||e===0?`—`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(e<1?3:2)}`}Xt.maxPromptBytes;function Qt(e){return e<1e3?String(e):e<1e6?`${en(e/1e3)}k`:`${en(e/1e6)}M`}const $t=e=>`${Qt(e.inputTokens+e.outputTokens)} tok · ${Zt(e.costUsd)}`,en=e=>e>=100?Math.round(e):Number(e.toFixed(1));function tn(e){switch(e){case`refusal`:return`Claude declined to answer this.`;case`max_tokens`:return`The answer was cut off at the token limit.`;case`tool_use`:return`Stopped after too many skill loads in one turn.`;default:return null}}function nn(e){let t=e.split(`
77
- `),n=t.pop()??``,r=[];for(let e of t)if(e.trim()!==``)try{r.push(JSON.parse(e))}catch{r.push({type:`error`,message:`The answer came back garbled.`})}return{events:r,rest:n}}function rn(){return process.env.npm_command===`exec`||/[\\/]_npx[\\/]/.test(process.argv[1]??``)?Wt.includes(`-dev`)?`npx useakit@next`:`npx useakit`:`a-kit`}const L=e=>`\`${rn()} ${e}\``;var R=class extends Error{status;code;diagnostics;constructor(e,t,n,r=[]){super(n),this.status=e,this.code=t,this.diagnostics=r}};function z(e,t,n=fetch){async function r(r,i={}){let a;try{a=await n(`${e}${r}`,{...i,headers:{"User-Agent":`a-kit/${Wt}`,...i.body?{"Content-Type":`application/json`}:{},...t?{Authorization:`Bearer ${t}`}:{},...i.headers}})}catch{throw new R(0,`NETWORK`,`Couldn't reach ${e}.`)}if(!a.ok){let e=await a.json().catch(()=>null);throw a.status===401?new R(401,`UNAUTHORIZED`,`You're not logged in. Run ${L(`login`)}.`):new R(a.status,e?.code??`HTTP_ERROR`,e?.message??`${i.method??`GET`} ${r} failed (${a.status})`,e?.diagnostics??[])}return a}let i=async(e,t)=>await(await r(e,t)).json();return{me:()=>i(`/me`),logout:()=>r(`/auth/logout`,{method:`POST`}),startLogin:()=>i(`/auth/cli`,{method:`POST`}),pollLogin:e=>i(`/auth/cli/token`,{method:`POST`,body:JSON.stringify({deviceCode:e})}),listSkills:async()=>{let[e,t]=await Promise.all([i(`/skills`),i(`/orgs`)]),n=new Map(t.map(e=>[e.id,e]));return e.map(e=>({...e,organizationName:n.get(e.organizationId)?.name??``,organizationSlug:n.get(e.organizationId)?.slug??null,showOrganization:t.length>1}))},listKits:async()=>{let[e,t]=await Promise.all([i(`/kits`),i(`/orgs`)]),n=new Map(t.map(e=>[e.id,e.name]));return e.map(e=>({...e,organizationName:n.get(e.organizationId)??``,showOrganization:t.length>1}))},getKit:e=>i(`/kits/${e}`),listOrganizations:()=>i(`/orgs`),reportActivations:(e,t)=>i(`/activations`,{method:`POST`,body:JSON.stringify({activations:e}),signal:t}),fingerprint:(e,t)=>i(`/fingerprint`,{method:`POST`,body:JSON.stringify(e),signal:t}),sendHeartbeat:(e,t)=>i(`/machines/heartbeat`,{method:`POST`,body:JSON.stringify(e),signal:t}),search:e=>i(`/search?q=${encodeURIComponent(e)}`),getSkill:(e,t=`latest`)=>i(`/skills/${e}${t===`latest`?``:`?channel=${t}`}`),getVersion:(e,t)=>i(`/skills/${e}/versions/${t}`),getSkillHealth:e=>i(`/skills/${e}/health`),saveSkill:(e,t)=>i(`/skills/${e}`,{method:`PUT`,body:JSON.stringify(t)}),createProposal:(e,t)=>i(`/skills/${e}/proposals`,{method:`POST`,body:JSON.stringify(t)}),createSkill:(e,t)=>i(`/orgs/${e}/skills`,{method:`POST`,body:JSON.stringify(t)}),createReport:(e,t)=>i(`/orgs/${e}/reports`,{method:`POST`,body:JSON.stringify(t)}),playground:async(e,t,n)=>{let i=await r(`/skills/${e}/playground`,{method:`POST`,body:JSON.stringify(t)}),a=``,o=new TextDecoder;for await(let e of i.body??[]){let t=nn(a+o.decode(e,{stream:!0}));a=t.rest,t.events.forEach(n)}nn(`${a}${o.decode()}\n`).events.forEach(n)},getBlob:async(e,t)=>new Uint8Array(await(await r(`/skills/${e}/blobs/${t}`)).arrayBuffer()),getPublicSkill:e=>i(`/public/skills/${an(e)}`),getPublicBlob:async(e,t)=>new Uint8Array(await(await r(`/public/skills/${an(e)}/blobs/${t}`)).arrayBuffer()),countInstall:e=>r(`/public/skills/${an(e)}/installs`,{method:`POST`})}}const an=e=>e.split(`/`).map(encodeURIComponent).join(`/`),B=()=>!!(process.stdin.isTTY&&process.stdout.isTTY)&&!process.env.CI;function V(e){return Ke(e)&&(jt(`Cancelled.`),process.exit(130)),e}async function on(e,t){if(e.length>0)return e.map(e=>{let t=Jt(e);if(!t)throw Error(`Unknown agent "${e}". Use one of: ${Gt.map(e=>e.id).join(`, `)}.`);return t});let n=qt(),r=n.length>0?n:[Jt(`claude-code`)];return!t||!B()?r:V(await At({message:`Which agents should get the skills?`,options:Gt.map(e=>({value:e.id,label:e.name,hint:n.includes(e)?`detected`:void 0})),initialValues:r.map(e=>e.id),required:!0})).map(e=>Jt(e))}async function sn(e,t){return e?`global`:!t||!B()?`project`:V(await Lt({message:`Where should they go?`,options:[{value:`project`,label:`This project`,hint:process.cwd()},{value:`global`,label:`Everywhere`,hint:`your home folder`}],initialValue:`project`}))}const cn=`kit/`;function ln(e){let t=[],n=[];for(let r of e)r.startsWith(`kit/`)?n.push(r.slice(4)):t.push(r);return{skills:t,kits:n}}async function un(e,t,n){if(t.length>0)return fn(e,t,n,`skill`);if(!n||!B())throw Error(`Name the skills to add, like ${L(`add my-skill`)}.`);let r=V(await At({message:`Which skills?`,options:e.map(e=>({value:e.id,label:yn(e),hint:e.description.length>60?`${e.description.slice(0,57)}…`:e.description})),required:!0}));return e.filter(e=>r.includes(e.id))}const dn=(e,t,n)=>fn(e,t,n,`kit`);async function fn(e,t,n,r){let i=[];for(let a of t){let t=gn(e,a,r),o=t.length===1?t[0]:await _n(t,n,r);i.includes(o)||i.push(o)}return i}const pn=(e,t)=>gn(e,t,`skill`);function mn(e,t){let n=t.lastIndexOf(`/`),r=t.slice(n+1),i=n===-1?null:t.slice(0,n).trim().toLowerCase();return e.filter(e=>e.name===r&&(i===null||e.organizationName.toLowerCase()===i||e.organizationSlug!=null&&e.organizationSlug===i))}const hn=(e,t)=>mn(e,t);function gn(e,t,n){let r=t.lastIndexOf(`/`),i=t.slice(r+1),a=mn(e,t);if(a.length===0)throw Error(r===-1?`There's no ${n} named "${i}" in your agent kit. See them with ${L(`list`)}.`:`There's no ${n} named "${i}" in an organization called "${t.slice(0,r)}". See them with ${L(`list`)}.`);return a}async function _n(e,t,n){let r=e[0].name,i=n===`kit`?cn:``;if(!t||!B()){let t=e.map(e=>{let t=i+vn(e);return L(`add ${/\s/.test(t)?`"${t}"`:t}`)});throw Error(`More than one of your organizations has a ${n} named "${r}". Say which one: ${t.join(` or `)}.`)}let a=V(await Lt({message:`More than one of your organizations has ${n===`kit`?`kit/${r}`:`"${r}"`}. Which one?`,options:e.map(e=>({value:e.id,label:vn(e)}))}));return e.find(e=>e.id===a)}const vn=e=>`${e.organizationName}/${e.name}`,yn=e=>e.showOrganization?`${e.name} (${e.organizationName})`:e.name;async function bn(e,t,n){let r=()=>e.map(e=>e.name).join(`, `);if(t){let n=t.trim().toLowerCase(),i=e.find(e=>e.id===t||e.name.toLowerCase()===n);if(!i)throw Error(`--org: none of your organizations is "${t}". Yours: ${r()}.`);return i}if(e.length===0)throw Error(`You're not in an organization yet. Create one on the web.`);if(e.length===1)return e[0];if(!n||!B())throw Error(`Which organization should the new skill go to? Pass --org with one of: ${r()}.`);let i=V(await Lt({message:`Which organization should the new skill go to?`,options:e.map(e=>({value:e.id,label:e.name}))}));return e.find(e=>e.id===i)}function H(){return(process.env.AGENT_KIT_API_URL??`https://api-dev.agent-kit.fausanchez.com`??`http://localhost:8787`).replace(/\/+$/,``)}function U(){return process.env.AGENT_KIT_CONFIG_DIR?process.env.AGENT_KIT_CONFIG_DIR:process.platform===`win32`&&process.env.APPDATA?m(process.env.APPDATA,`agent-kit`):m(process.env.XDG_CONFIG_HOME??m(b(),`.config`),`agent-kit`)}const xn=()=>m(U(),`credentials.json`);async function Sn(){try{return JSON.parse(await O(xn(),`utf8`))}catch{return{}}}async function W(){return(await Sn())[H()]??null}async function Cn(e){let t=await Sn();e?t[H()]=e:delete t[H()];let n=xn();await D(p(n),{recursive:!0,mode:448}),await k(n,JSON.stringify(t,null,2)+`
77
+ `),n=t.pop()??``,r=[];for(let e of t)if(e.trim()!==``)try{r.push(JSON.parse(e))}catch{r.push({type:`error`,message:`The answer came back garbled.`})}return{events:r,rest:n}}function rn(){return process.env.npm_command===`exec`||/[\\/]_npx[\\/]/.test(process.argv[1]??``)?Wt.includes(`-dev`)?`npx useakit@next`:`npx useakit`:`a-kit`}const L=e=>`\`${rn()} ${e}\``;var R=class extends Error{status;code;diagnostics;constructor(e,t,n,r=[]){super(n),this.status=e,this.code=t,this.diagnostics=r}};function z(e,t,n=fetch){async function r(r,i={}){let a;try{a=await n(`${e}${r}`,{...i,headers:{"User-Agent":`a-kit/${Wt}`,...i.body?{"Content-Type":`application/json`}:{},...t?{Authorization:`Bearer ${t}`}:{},...i.headers}})}catch{throw new R(0,`NETWORK`,`Couldn't reach ${e}.`)}if(!a.ok){let e=await a.json().catch(()=>null);throw a.status===401?new R(401,`UNAUTHORIZED`,`You're not logged in. Run ${L(`login`)}.`):new R(a.status,e?.code??`HTTP_ERROR`,e?.message??`${i.method??`GET`} ${r} failed (${a.status})`,e?.diagnostics??[])}return a}let i=async(e,t)=>await(await r(e,t)).json();return{me:()=>i(`/me`),logout:()=>r(`/auth/logout`,{method:`POST`}),startLogin:()=>i(`/auth/cli`,{method:`POST`}),pollLogin:e=>i(`/auth/cli/token`,{method:`POST`,body:JSON.stringify({deviceCode:e})}),listSkills:async()=>{let[e,t]=await Promise.all([i(`/skills`),i(`/orgs`)]),n=new Map(t.map(e=>[e.id,e]));return e.map(e=>({...e,organizationName:n.get(e.organizationId)?.name??``,organizationSlug:n.get(e.organizationId)?.slug??null,showOrganization:t.length>1}))},listKits:async()=>{let[e,t]=await Promise.all([i(`/kits`),i(`/orgs`)]),n=new Map(t.map(e=>[e.id,e.name]));return e.map(e=>({...e,organizationName:n.get(e.organizationId)??``,showOrganization:t.length>1}))},getKit:e=>i(`/kits/${e}`),listOrganizations:()=>i(`/orgs`),reportActivations:(e,t)=>i(`/activations`,{method:`POST`,body:JSON.stringify({activations:e}),signal:t}),fingerprint:(e,t)=>i(`/fingerprint`,{method:`POST`,body:JSON.stringify(e),signal:t}),sendHeartbeat:(e,t)=>i(`/machines/heartbeat`,{method:`POST`,body:JSON.stringify(e),signal:t}),search:e=>i(`/search?q=${encodeURIComponent(e)}`),getSkill:(e,t=`latest`)=>i(`/skills/${e}${t===`latest`?``:`?channel=${t}`}`),getVersion:(e,t)=>i(`/skills/${e}/versions/${t}`),getSkillHealth:e=>i(`/skills/${e}/health`),saveSkill:(e,t)=>i(`/skills/${e}`,{method:`PUT`,body:JSON.stringify(t)}),createProposal:(e,t)=>i(`/skills/${e}/proposals`,{method:`POST`,body:JSON.stringify(t)}),createSkill:(e,t)=>i(`/orgs/${e}/skills`,{method:`POST`,body:JSON.stringify(t)}),createReport:(e,t)=>i(`/orgs/${e}/reports`,{method:`POST`,body:JSON.stringify(t)}),playground:async(e,t,n)=>{let i=await r(`/skills/${e}/playground`,{method:`POST`,body:JSON.stringify(t)}),a=``,o=new TextDecoder;for await(let e of i.body??[]){let t=nn(a+o.decode(e,{stream:!0}));a=t.rest,t.events.forEach(n)}nn(`${a}${o.decode()}\n`).events.forEach(n)},getBlob:async(e,t)=>new Uint8Array(await(await r(`/skills/${e}/blobs/${t}`)).arrayBuffer()),getPublicSkill:e=>i(`/public/skills/${an(e)}`),getPublicBlob:async(e,t)=>new Uint8Array(await(await r(`/public/skills/${an(e)}/blobs/${t}`)).arrayBuffer()),countInstall:e=>r(`/public/skills/${an(e)}/installs`,{method:`POST`})}}const an=e=>e.split(`/`).map(encodeURIComponent).join(`/`),B=()=>!!(process.stdin.isTTY&&process.stdout.isTTY)&&!process.env.CI;function V(e){return Ke(e)&&(jt(`Cancelled.`),process.exit(130)),e}async function on(e,t){if(e.length>0)return e.map(e=>{let t=Jt(e);if(!t)throw Error(`Unknown agent "${e}". Use one of: ${Gt.map(e=>e.id).join(`, `)}.`);return t});let n=qt(),r=n.length>0?n:[Jt(`claude-code`)];return!t||!B()?r:V(await At({message:`Which agents should get the skills?`,options:Gt.map(e=>({value:e.id,label:e.name,hint:n.includes(e)?`detected`:void 0})),initialValues:r.map(e=>e.id),required:!0})).map(e=>Jt(e))}async function sn(e,t){return e?`global`:!t||!B()?`project`:V(await Lt({message:`Where should they go?`,options:[{value:`project`,label:`This project`,hint:process.cwd()},{value:`global`,label:`Everywhere`,hint:`your home folder`}],initialValue:`project`}))}const cn=`kit/`;function ln(e){let t=[],n=[];for(let r of e)r.startsWith(`kit/`)?n.push(r.slice(4)):t.push(r);return{skills:t,kits:n}}async function un(e,t,n){if(t.length>0)return fn(e,t,n,`skill`);if(!n||!B())throw Error(`Name the skills to add, like ${L(`add my-skill`)}.`);let r=V(await At({message:`Which skills?`,options:e.map(e=>({value:e.id,label:yn(e),hint:e.description.length>60?`${e.description.slice(0,57)}…`:e.description})),required:!0}));return e.filter(e=>r.includes(e.id))}const dn=(e,t,n)=>fn(e,t,n,`kit`);async function fn(e,t,n,r){let i=[];for(let a of t){let t=gn(e,a,r),o=t.length===1?t[0]:await _n(t,n,r);i.includes(o)||i.push(o)}return i}const pn=(e,t)=>gn(e,t,`skill`);function mn(e,t){let n=t.lastIndexOf(`/`),r=t.slice(n+1),i=n===-1?null:t.slice(0,n).trim().toLowerCase();return e.filter(e=>e.name===r&&(i===null||e.organizationName.toLowerCase()===i||e.organizationSlug!=null&&e.organizationSlug===i))}const hn=(e,t)=>mn(e,t);function gn(e,t,n){let r=t.lastIndexOf(`/`),i=t.slice(r+1),a=mn(e,t);if(a.length===0)throw Error(r===-1?`There's no ${n} named "${i}" in your agent kit. See them with ${L(`list`)}.`:`There's no ${n} named "${i}" in an organization called "${t.slice(0,r)}". See them with ${L(`list`)}.`);return a}async function _n(e,t,n){let r=e[0].name,i=n===`kit`?cn:``;if(!t||!B()){let t=e.map(e=>{let t=i+vn(e);return L(`add ${/\s/.test(t)?`"${t}"`:t}`)});throw Error(`More than one of your organizations has a ${n} named "${r}". Say which one: ${t.join(` or `)}.`)}let a=V(await Lt({message:`More than one of your organizations has ${n===`kit`?`kit/${r}`:`"${r}"`}. Which one?`,options:e.map(e=>({value:e.id,label:vn(e)}))}));return e.find(e=>e.id===a)}const vn=e=>`${e.organizationName}/${e.name}`,yn=e=>e.showOrganization?`${e.name} (${e.organizationName})`:e.name;async function bn(e,t,n){let r=()=>e.map(e=>e.name).join(`, `);if(t){let n=t.trim().toLowerCase(),i=e.find(e=>e.id===t||e.name.toLowerCase()===n);if(!i)throw Error(`--org: none of your organizations is "${t}". Yours: ${r()}.`);return i}if(e.length===0)throw Error(`You're not in an organization yet. Create one on the web.`);if(e.length===1)return e[0];if(!n||!B())throw Error(`Which organization should the new skill go to? Pass --org with one of: ${r()}.`);let i=V(await Lt({message:`Which organization should the new skill go to?`,options:e.map(e=>({value:e.id,label:e.name}))}));return e.find(e=>e.id===i)}function H(){return(process.env.AGENT_KIT_API_URL??`https://api-dev.useagentkit.dev`??`http://localhost:8787`).replace(/\/+$/,``)}function U(){return process.env.AGENT_KIT_CONFIG_DIR?process.env.AGENT_KIT_CONFIG_DIR:process.platform===`win32`&&process.env.APPDATA?m(process.env.APPDATA,`agent-kit`):m(process.env.XDG_CONFIG_HOME??m(b(),`.config`),`agent-kit`)}const xn=()=>m(U(),`credentials.json`);async function Sn(){try{return JSON.parse(await O(xn(),`utf8`))}catch{return{}}}async function W(){return(await Sn())[H()]??null}async function Cn(e){let t=await Sn();e?t[H()]=e:delete t[H()];let n=xn();await D(p(n),{recursive:!0,mode:448}),await k(n,JSON.stringify(t,null,2)+`
78
78
  `,{mode:384}),await ee(n,384)}const wn=()=>m(U(),`settings.json`);async function Tn(){try{return JSON.parse(await O(wn(),`utf8`))}catch{return{}}}async function En(e){let t={...await Tn(),...e};await D(U(),{recursive:!0,mode:448}),await k(wn(),JSON.stringify(t,null,2)+`
79
79
  `)}function Dn(e=process.env){let t=e=>e!==void 0&&[`0`,`false`,`off`,`no`].includes(e.toLowerCase());return(e=>e!==void 0&&e!==``&&!t(e))(e.DO_NOT_TRACK)||t(e.AGENT_KIT_TELEMETRY)}function G(e){let t=g(process.cwd(),e);return t&&!t.startsWith(`..`)?t:e}const On=/* @__PURE__ */ new Set([`.DS_Store`,`Thumbs.db`,`desktop.ini`,`.git`,`.idea`,`.vscode`,`node_modules`,`__pycache__`,`4913`]);function kn(e){return e.split(`/`).some(e=>On.has(e)||/^\..*\.sw[a-p]$/.test(e)||e.endsWith(`~`)||/^#.*#$/.test(e)||e.startsWith(`.#`)||e.endsWith(`.tmp`))}const An=e=>le(`sha256`).update(e).digest(`hex`);async function jn(e){let t=await ie(e,{recursive:!0,withFileTypes:!0}),n=[];for(let r of t){if(!r.isFile())continue;let t=g(e,m(r.parentPath,r.name)).split(v).join(`/`);if(kn(t))continue;let i=new Uint8Array(await O(m(e,t)));n.push({path:t,size:i.byteLength,sha256:An(i),bytes:i})}return n.sort((e,t)=>e.path<t.path?-1:+(e.path>t.path))}function Mn(e,t){let n=new Map(t.filter(e=>!kn(e.path)).map(e=>[e.path,e.sha256])),r=new Set(e.map(e=>e.path)),i=e.filter(e=>n.get(e.path)!==e.sha256),a=[...n.keys()].filter(e=>!r.has(e));return{upserts:i,deletes:a,paths:[...i.map(e=>e.path),...a].sort()}}function Nn(e,t){let n=e=>e.filter(e=>!kn(e.path)).map(e=>`${e.path}\0${e.sha256}`).sort().join(`
80
80
  `);return n(e)===n(t)}function Pn(e){try{let t=new TextDecoder(`utf-8`,{fatal:!0}).decode(e.bytes);if(!t.includes(`\0`))return{path:e.path,content:t,encoding:`utf8`}}catch{}return{path:e.path,content:Buffer.from(e.bytes).toString(`base64`),encoding:`base64`}}async function Fn(e,t){await oe(e,{recursive:!0,force:!0});for(let n of t){let t=m(e,n.path);await D(p(t),{recursive:!0}),await k(t,n.bytes)}}function In(e){return e.length===0?`nothing`:e.length>3?`${e.length} files`:e.length===1?e[0]:`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`}function Ln(e,t){let n=e.find(e=>e.path===t);return n?new TextDecoder().decode(n.bytes):void 0}const K=`SKILL.md`,Rn={maxFiles:200,maxFileBytes:1048576,maxSkillBytes:10485760,maxPathLength:255},zn=/[\u0000-\u001f\u007f\\:]/;function Bn(e){if(e.trim()===``)return`The path is empty.`;if(e.length>Rn.maxPathLength)return`Paths can be at most ${Rn.maxPathLength} characters.`;if(e.startsWith(`/`))return`Use a relative path, without a leading /.`;if(zn.test(e))return`Paths can't contain \\, : or control characters.`;for(let t of e.split(`/`)){if(t===``)return`The path has an empty folder name (//).`;if(t===`.`||t===`..`)return`The path can't contain . or .. folders.`;if(t!==t.trim())return`Names can't start or end with a space.`}return null}function Vn(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Hn(e){return e.slice(e.lastIndexOf(`/`)+1)}function Un(e,t){let n=Vn(e)?Vn(e).split(`/`):[];for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e===`..`){if(n.length===0)return null;n.pop()}else n.push(e)}return n.join(`/`)}var q=/* @__PURE__ */ A((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),Wn=/* @__PURE__ */ A((e=>{var t=q();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),Gn=/* @__PURE__ */ A((e=>{var t=q(),n=Wn();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)t===`!!`&&n===`tag:yaml.org,2002:`||e&&!a.some(e=>e.startsWith(n))||r.push(`%TAG ${t} ${n}`);return r.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "useakit",
3
- "version": "0.2.0-dev.46",
3
+ "version": "0.2.0-dev.48",
4
4
  "description": "Install your agent kit skills into Claude Code, Codex, Cursor and Gemini CLI.",
5
5
  "keywords": [
6
6
  "agent-kit",
@@ -10,7 +10,7 @@
10
10
  "cursor",
11
11
  "gemini-cli"
12
12
  ],
13
- "homepage": "https://agent-kit.fausanchez.com",
13
+ "homepage": "https://useagentkit.dev",
14
14
  "type": "module",
15
15
  "bin": {
16
16
  "useakit": "dist/index.mjs",