anyt-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+ import{$ as e,A as t,B as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as d,M as f,N as ee,O as p,P as m,Q as te,R as ne,S as re,T as ie,U as ae,V as oe,W as se,X as ce,Y as le,Z as ue,a as de,at as fe,c as pe,ct as me,d as he,et as ge,f as _e,g as ve,h as ye,i as be,it as xe,j as Se,k as Ce,l as we,lt as Te,m as Ee,n as De,nt as Oe,o as ke,ot as Ae,p as je,q as Me,r as Ne,rt as Pe,s as h,st as Fe,t as g,tt as Ie,u as Le,w as Re,z as ze}from"./api-client-AcwLRhZ3.js";import{C as Be,_,a as Ve,b as v,g as y,h as He,m as Ue,n as We,p as Ge,s as b,u as x,v as Ke,w as S,x as qe}from"./config-D5S7I3VP.js";import{$ as Je,F as Ye,H as C,I as Xe,J as w,K as Ze,L as Qe,M as T,N as $e,P as et,Q as tt,R as nt,V as E,W as rt,X as D,_ as it,a as at,ct as ot,g as st,h as ct,it as lt,j as ut,m as O,n as k,nt as dt,o as ft,ot as pt,p as A,r as j,rt as mt,s as ht,st as gt,t as _t,ut as vt,v as yt,z as bt}from"./symlinks-BoGYQyAH.js";import{t as xt}from"./add-DxcDPvGU.js";import{t as St}from"./install-D2YOi6ip.js";import{createReadStream as Ct,readFileSync as wt,statSync as Tt,writeFileSync as Et}from"node:fs";import{basename as M,dirname as Dt,join as N,relative as Ot,resolve as kt}from"node:path";import{URL as P,fileURLToPath as At}from"node:url";import{Command as jt}from"commander";import{access as Mt,mkdir as Nt,readFile as F,readdir as Pt,rm as Ft,stat as I,writeFile as L}from"node:fs/promises";import{homedir as It}from"node:os";import{createHash as R,randomBytes as Lt}from"node:crypto";import*as z from"semver";import Rt from"semver";import{createInterface as B}from"node:readline";import zt from"node:http";import Bt from"open";import{exec as Vt,execSync as V}from"node:child_process";import{promisify as Ht}from"node:util";async function Ut(e){await i();let n=g(await t({page:e.page,limit:e.limit,search:e.search,sort:e.sort,order:e.order}));if((n.status!==200||!n.data)&&(console.error(`Error: ${n.error??`HTTP ${n.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(n.data,null,2));return}let r=n.data,a=r.users??[];if(a.length===0){console.log(`No users.`);return}console.log(`\n${`Email`.padEnd(36)} ${`Username`.padEnd(20)} ${`Role`.padEnd(10)} ${`Created`.padEnd(12)} ID`),console.log(`-`.repeat(110));for(let e of a){let t=e.createdAt?new Date(e.createdAt).toLocaleDateString():`-`;console.log(`${(e.email??`-`).slice(0,34).padEnd(36)} ${(e.username??`-`).slice(0,18).padEnd(20)} ${(e.role??`user`).padEnd(10)} ${t.padEnd(12)} ${e.id}`)}console.log(`\n${a.length} of ${r.total??a.length} user(s)`)}async function Wt(e){await i();let t=g(await Ce());if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;console.log(`
3
+ Admin stats`),console.log(`------------`);for(let[e,t]of Object.entries(n))console.log(`${e.padEnd(28)} ${String(t)}`)}async function Gt(e,t){await i();let n=g(await Se(e,{role:t.role}));n.status!==200&&(console.error(`Error: ${n.error??`HTTP ${n.status}`}`),process.exit(1)),console.log(`Updated user ${e} role to "${t.role}"`)}function Kt(e){let t=e.command(`admin`).description(`Admin-only operations (requires admin role)`),n=t.command(`users`).description(`Manage users`);n.command(`list`).description(`List users (paged)`).option(`--page <n>`,`Page number (1-indexed)`,Number.parseInt).option(`--limit <n>`,`Page size (1-100)`,Number.parseInt).option(`--search <text>`,`Filter by email/name/username`).option(`--sort <field>`,`Sort field: name | email | createdAt | role`).option(`--order <direction>`,`Sort direction: asc | desc`).option(`--json`,`Output as JSON`).action(async e=>{await Ut({page:e.page,limit:e.limit,search:e.search,sort:e.sort,order:e.order,json:e.json})}),n.command(`role <id>`).description(`Update a user's role (e.g. user, admin)`).requiredOption(`--role <role>`,`New role`).action(async(e,t)=>{await Gt(e,{role:t.role})}),t.command(`stats`).description(`Show admin statistics (users, sessions, …)`).option(`--json`,`Output as JSON`).action(async e=>{await Wt({json:e.json})})}async function qt(e){await i();let t=g(await l());if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;if(n.length===0){console.log(`No agents yet. Create one with: anyt agents create --name <name>`);return}console.log(`\n${`Name`.padEnd(28)} ${`Visibility`.padEnd(12)} ${`Owner`.padEnd(10)} ${`Updated`.padEnd(12)} ID`),console.log(`-`.repeat(96));for(let e of n){let t=e.updatedAt?new Date(e.updatedAt).toLocaleDateString():`-`;console.log(`${(e.name??`(unnamed)`).slice(0,26).padEnd(28)} ${(e.visibility??`-`).padEnd(12)} ${(e.ownerKind??`-`).padEnd(10)} ${t.padEnd(12)} ${e.id}`)}console.log(`\n${n.length} agent(s)`)}async function Jt(e,t){await i();let n=g(await oe(e));(n.status!==200||!n.data)&&(console.error(`Error: ${n.error??`HTTP ${n.status}`}`),process.exit(1)),console.log(JSON.stringify(n.data,null,2))}async function Yt(e){await i();let t=g(await ee({name:e.name,description:e.description,basePrompt:e.basePrompt??``,visibility:e.visibility}));(t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Created agent "${t.data.name}" (${t.data.id})`)}async function Xt(e,t){await i();let n=g(await ge(e,{name:t.name,description:t.description,basePrompt:t.basePrompt,visibility:t.visibility}));n.status!==200&&(console.error(`Error: ${n.error??`HTTP ${n.status}`}`),process.exit(1)),console.log(`Updated agent ${e}`)}async function Zt(e){await i();let t=g(await d(e));t.status!==200&&t.status!==204&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Deleted agent ${e}`)}function Qt(e){let t=e.command(`agents`).description(`Manage agents`);t.command(`list`).description(`List your agents`).option(`--json`,`Output as JSON`).action(async e=>{await qt({json:e.json})}),t.command(`get <id>`).description(`Get an agent by ID`).option(`--json`,`Output as JSON`).action(async(e,t)=>{await Jt(e,{json:t.json})}),t.command(`create`).description(`Create a new agent`).requiredOption(`--name <name>`,`Agent name`).option(`-d, --description <text>`,`Agent description`).option(`-p, --base-prompt <text>`,`Agent base/system prompt`).option(`--visibility <visibility>`,`Visibility: private | public`).action(async e=>{await Yt({name:e.name,description:e.description,basePrompt:e.basePrompt,visibility:e.visibility})}),t.command(`update <id>`).description(`Update an agent`).option(`--name <name>`,`New name`).option(`-d, --description <text>`,`New description`).option(`-p, --base-prompt <text>`,`New base prompt`).option(`--visibility <visibility>`,`New visibility`).action(async(e,t)=>{await Xt(e,{name:t.name,description:t.description,basePrompt:t.basePrompt,visibility:t.visibility})}),t.command(`delete <id>`).description(`Delete an agent`).action(async e=>{await Zt(e)})}async function $t(e){await i();let t=await be();if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;if(n.length===0){console.log(`No API keys found. Create one with: anyt api-keys create <name>`);return}console.log(`\n${`Name`.padEnd(28)} ${`Prefix`.padEnd(14)} ${`Created`.padEnd(12)} ${`Expires`.padEnd(12)} ID`),console.log(`-`.repeat(96));for(let e of n){let t=e.createdAt?new Date(e.createdAt).toLocaleDateString():`-`,n=e.expiresAt?new Date(e.expiresAt).toLocaleDateString():`never`;console.log(`${e.name.slice(0,26).padEnd(28)} ${(e.prefix??`-`).padEnd(14)} ${t.padEnd(12)} ${n.padEnd(12)} ${e.id}`)}console.log(`\n${n.length} key(s)`)}async function en(e,t){await i();let n=t.permissions?t.permissions.split(`,`).map(e=>e.trim()).filter(Boolean):void 0,r=await De({name:e,expiresAt:t.expiresAt,permissions:n});if((r.status!==200||!r.data)&&(console.error(`Error: ${r.error??`HTTP ${r.status}`}`),process.exit(1)),t.json){console.log(JSON.stringify(r.data,null,2));return}let a=r.data;console.log(`Created API key "${a.name}" (${a.id})`),console.log(`\nKey: ${a.key}`),console.log(`
4
+ Store this securely — it will not be shown again.`)}async function tn(e,t){await i();let n=await de({id:e,name:t.name});n.status!==200&&(console.error(`Error: ${n.error??`HTTP ${n.status}`}`),process.exit(1)),console.log(`Renamed key ${e} to "${t.name}"`)}async function nn(e){await i();let t=await Ne({id:e});t.status!==200&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Deleted API key ${e}`)}function rn(e){let t=e.command(`api-keys`).description(`Manage anyt.io API keys`);t.command(`list`).description(`List your API keys`).option(`--json`,`Output as JSON`).action(async e=>{await $t({json:e.json})}),t.command(`create <name>`).description(`Create a new API key`).option(`--expires-at <iso>`,`ISO-8601 expiration timestamp`).option(`--permissions <perms>`,`Comma-separated permissions (default: full access)`).option(`--json`,`Output as JSON`).action(async(e,t)=>{await en(e,{expiresAt:t.expiresAt,permissions:t.permissions,json:t.json})}),t.command(`update <id>`).description(`Rename an API key`).requiredOption(`--name <name>`,`New name for the key`).action(async(e,t)=>{await tn(e,{name:t.name})}),t.command(`delete <id>`).description(`Delete an API key`).action(async e=>{await nn(e)})}async function an(e){await i();let t=g(await Pe({sessionId:e.sessionId,kind:e.kind,limit:e.limit}));if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;if(n.length===0){console.log(`No artifacts.`);return}console.log(`\n${`Title`.padEnd(36)} ${`Kind`.padEnd(14)} ${`Session`.padEnd(36)} ID`),console.log(`-`.repeat(120));for(let e of n)console.log(`${(e.title??`(untitled)`).slice(0,34).padEnd(36)} ${(e.kind??`-`).padEnd(14)} ${(e.sessionId??`-`).padEnd(36)} ${e.id}`);console.log(`\n${n.length} artifact(s)`)}async function on(e){await i();let t=g(await Oe({id:e}));(t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(JSON.stringify(t.data,null,2))}async function sn(e,t){await i();let n=g(await xe({id:e}));(n.status!==200||!n.data)&&(console.error(`Error: ${n.error??`HTTP ${n.status}`}`),process.exit(1));let r=JSON.stringify(n.data,null,2);if(t.output){let{writeFile:e}=await import(`node:fs/promises`);await e(t.output,r,`utf-8`),console.log(`Wrote payload -> ${t.output}`)}else console.log(r)}async function cn(e){await i();let t=g(await fe({brainSessionId:e.brainSessionId,sessionTitle:e.title}));t.status!==200&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Updated session ${e.brainSessionId} title`)}function ln(e){let t=e.command(`artifacts`).description(`Manage durable artifacts produced by brain sessions`);t.command(`list`).description(`List artifacts`).option(`--session-id <id>`,`Filter by brain session ID`).option(`--kind <kind>`,`Filter by artifact kind`).option(`--limit <n>`,`Maximum results`,Number.parseInt).option(`--json`,`Output as JSON`).action(async e=>{await an({sessionId:e.sessionId,kind:e.kind,limit:e.limit,json:e.json})}),t.command(`get <id>`).description(`Get artifact metadata`).action(async e=>{await on(e)}),t.command(`payload <id>`).description(`Fetch artifact payload (JSON)`).option(`-o, --output <path>`,`Write payload to file instead of stdout`).action(async(e,t)=>{await sn(e,{output:t.output})}),t.command(`session-title`).description(`Set the title for a brain session`).requiredOption(`--brain-session-id <id>`,`Brain session ID`).option(`--title <text>`,`New title (omit to clear)`).action(async e=>{await cn({brainSessionId:e.brainSessionId,title:e.title??null})})}function un(e){return e.startsWith(`file:`)||e.startsWith(`./`)||e.startsWith(`../`)}async function dn(e,t){try{let n=await v(),r=await y();t.public&&t.private&&(console.error(`Error: Cannot specify both --public and --private`),process.exit(1)),!t.public&&!t.private&&(console.error(`Error: Must specify either --public or --private`),process.exit(1));let i=t.public?`public`:`private`,a,o;if(e){rt(e)&&(w(e)?(console.error(`Error: Cannot change visibility of GitHub packages.`),console.error(` "${e}" is hosted on GitHub, not the anyt registry.`),console.error(` Visibility can only be changed for packages published to the registry.`)):(console.error(`Error: Invalid GitHub specifier "${e}".`),console.error(` Use format: github:{owner}/{repo}[/{path}][@{ref}]`)),process.exit(1)),un(e)&&(console.error(`Error: Cannot change visibility of local packages.`),console.error(` "${e}" is a local directory, not a registry package.`),console.error(` Visibility can only be changed for packages published to the registry.`),process.exit(1));let t=D(e);t||(console.error(`Error: Invalid package specifier "${e}".`),console.error(` Use format: @user/{username}/{name} or @org/{orgname}/{name}`),console.error(``),console.error(` Examples:`),console.error(` anyt access @user/myname/my-skill --public`),console.error(` anyt access --public (uses current directory's anyt.json)`),process.exit(1)),a=t.name,o=t.owner}else{let{readFile:e}=await import(`node:fs/promises`),{join:t}=await import(`node:path`),n=null;try{let r=await e(t(process.cwd(),`anyt.json`),`utf-8`);n=JSON.parse(r)}catch{try{let r=await e(t(process.cwd(),`package.json`),`utf-8`);n=JSON.parse(r)}catch{console.error(`Error: No anyt.json or package.json found in current directory`),console.error(`Either run this command in a package directory or specify a package name`),process.exit(1)}}n?.name||(console.error(`Error: Package manifest is missing 'name' field`),process.exit(1)),a=n.name}o||=(await x()).username,o||(console.error(`Error: Could not determine username. Please use the full specifier: @user/{username}/{name}`),process.exit(1)),h({registryUrl:r,apiKey:n}),console.log(`Setting ${a} to ${i}...`);let s=await ke(o,a,{visibility:i});if(s.status!==200||!s.data){let e=s.error??`Failed to change visibility`;console.error(`Error: ${e}`),process.exit(1)}let c=s.data;console.log(`+ @${c.namespace??`user`}/${c.username}/${c.name} is now ${c.visibility}`),i===`public`&&(console.log(``),console.log(`Note: This action is irreversible. Public packages cannot be made private.`))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function H(e){try{return await I(e),!0}catch{return!1}}function fn(e){e?console.log(JSON.stringify({ok:!1,issues:[{name:`-`,source:`-`,severity:`error`,type:`no-lockfile`,message:`No lockfile found. Run 'anyt install' first.`}]})):console.error(`No lockfile found. Run 'anyt install' to create one.`),process.exit(1)}async function pn(e,t){let n=[];for(let{name:r,entry:i}of e){let e=r.match(/^@user\/([^/]+)\/([^/]+)$/);if(!e)continue;let[,a,o]=e,s=N(t,a,o);if(!await H(s)){n.push({name:r,source:`registry`,severity:`error`,type:`missing`,message:`Not installed on disk. Run 'anyt install' to restore.`});continue}i.deprecated&&n.push({name:r,source:`registry`,severity:`warning`,type:`deprecated`,message:`Deprecated: ${i.deprecated}`}),await H(N(s,`SKILL.md`))||n.push({name:r,source:`registry`,severity:`warning`,type:`integrity`,message:`Missing SKILL.md in installed directory. Package may be corrupted.`})}return n}async function mn(e,t){let n=[];for(let{specifier:r}of e){let e=w(r);if(!e)continue;let i=e.path?N(t,`_github`,e.owner,e.repo,e.path):N(t,`_github`,e.owner,e.repo);if(!await H(i)){n.push({name:r,source:`github`,severity:`error`,type:`missing`,message:`Not installed on disk. Run 'anyt install' to restore.`});continue}await H(N(i,`SKILL.md`))||n.push({name:r,source:`github`,severity:`warning`,type:`integrity`,message:`Missing SKILL.md in installed directory. Package may be corrupted.`})}return n}async function hn(e,t){let n=[];for(let{specifier:r,entry:i}of e){let e=i,a=N(t,`_wellknown`,e.hostname,e.name);if(!await H(a)){n.push({name:r,source:`well-known`,severity:`error`,type:`missing`,message:`Not installed on disk. Run 'anyt install' to restore.`});continue}await H(N(a,`SKILL.md`))||n.push({name:r,source:`well-known`,severity:`warning`,type:`integrity`,message:`Missing SKILL.md in installed directory. Package may be corrupted.`})}return n}function gn(e,t){let n=e.filter(e=>e.severity===`error`).length,r=e.filter(e=>e.severity===`warning`).length;if(e.length===0){console.log(`Audited ${t} package(s). No issues found.`);return}let i=e.filter(e=>e.severity===`error`),a=e.filter(e=>e.severity===`warning`);if(i.length>0){console.log(`Errors:`);for(let e of i)console.log(` [${e.type.toUpperCase()}] ${e.name} (${e.source})`),console.log(` ${e.message}`);console.log()}if(a.length>0){console.log(`Warnings:`);for(let e of a)console.log(` [${e.type.toUpperCase()}] ${e.name} (${e.source})`),console.log(` ${e.message}`);console.log()}console.log(`Audited ${t} package(s): ${n} error(s), ${r} warning(s).`)}async function _n(e){try{await st()||fn(e.json??!1);let t=b();e.json||console.log(`Auditing installed skills...
5
+ `);let n=await O(),r=await A(),i=await ct(),a=[...await pn(n,t),...await mn(r,t),...await hn(i,t)],o=n.length+r.length+i.length,s=a.filter(e=>e.severity===`error`).length;if(e.json){console.log(JSON.stringify({ok:s===0,totalPackages:o,issues:a},null,2)),s>0&&process.exit(1);return}gn(a,o),s>0&&process.exit(1)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function vn(e){try{let t=N(process.cwd(),`.anytrc`);try{await I(t),console.error(`Error: .anytrc already exists in this directory.`),process.exit(1)}catch{}let n=[`; Project-specific anyt configuration`,``];e.registry?n.push(`registry = ${e.registry}`):(n.push(`; Uncomment to use a custom registry:`),n.push(`; registry = https://custom-registry.example.com`)),n.push(``),await L(t,n.join(`
6
+ `)),console.log(`Created .anytrc`),console.log(``),console.log(`Contents:`),console.log(n.join(`
7
+ `)),console.log(`Note: .anytrc should be committed to version control.`),console.log(`API keys should NOT be stored here - use anyt login instead.`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function yn(){try{let e=await x(),t=await We(),n=Ve();console.log(`Resolved Configuration:
8
+ `),console.log(` Registry URL: ${e.registryUrl}`),console.log(` API Key: ${e.apiKey?`***`:`(not set)`}`),console.log(` Username: ${e.username||`(not set)`}`),console.log(``),console.log(`Config Locations:`),console.log(` User config: ${n}`),console.log(` Project config: ${t?`.anytrc`:`(none)`}`),console.log(``),console.log(`Environment Variables:`),console.log(` ANYT_REGISTRY_URL: ${process.env.ANYT_REGISTRY_URL||`(not set)`}`),console.log(` ANYT_API_KEY: ${process.env.ANYT_API_KEY?`***`:`(not set)`}`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function bn(e,t,n){try{let i=await v(),a=await y(),o=D(e);o||(console.error(`Error: Invalid skill specifier "${e}". Use format: @user/{username}/{name}@{version} or @org/{orgname}/{name}@{version}`),process.exit(1));let{owner:s,name:c,versionRange:l}=o,u=E({namespace:o.namespace,owner:s,name:c});if(l||(console.error(`Error: Version is required for deprecation. Use format: @user/{username}/{name}@{version}`),process.exit(1)),h({registryUrl:a,apiKey:i}),n.undo){console.log(`Removing deprecation from ${u}@${l}...`);let e=await r(s,c,l);e.status!==200&&(console.error(`Error: ${e.error||`Failed to remove deprecation`}`),process.exit(1)),console.log(`Removed deprecation from ${u}@${l}`)}else{t||(console.error(`Error: Deprecation message is required. Usage: anyt deprecate <specifier> <message>`),process.exit(1)),console.log(`Deprecating ${u}@${l}...`);let e=await he(s,c,l,t);e.status!==200&&(console.error(`Error: ${e.error||`Failed to deprecate version`}`),process.exit(1)),console.log(`Deprecated ${u}@${l}`),console.log(`Message: ${t}`),console.log(``),console.log(`Users installing this version will see a deprecation warning.`),console.log(`The package is still available for download.`)}}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}function U(e,t,n){return new Promise(r=>{let i=n?` (${n})`:``;e.question(`${t}${i} `,e=>{r(e.trim()||n)})})}async function xn(){try{let e=await F(N(process.cwd(),`package.json`),`utf-8`),t=JSON.parse(e);return{name:t.name,version:t.version,description:t.description,author:typeof t.author==`string`?t.author:t.author?.name,license:t.license}}catch{return null}}async function Sn(){try{let{exec:e}=await import(`node:child_process`),{promisify:t}=await import(`node:util`),n=t(e),[r,i]=await Promise.all([n(`git config user.name`).catch(()=>({stdout:``})),n(`git config user.email`).catch(()=>({stdout:``}))]),a=r.stdout.trim(),o=i.stdout.trim();return a&&o?`${a} <${o}>`:a||null}catch{return null}}function Cn(e){return e.replace(/^@[^/]+\//,``).toLowerCase().replace(/[^a-z0-9_-]/g,`-`).replace(/^-+|-+$/g,``).replace(/-+/g,`-`)}function wn(e){return/^[a-z][a-z0-9_-]*$/.test(e)}function Tn(e){return/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/.test(e)}async function En(e,t){let n=await Sn();return{name:Cn(e.name||t?.name||M(process.cwd())),version:t?.version||`0.1.0`,description:e.description||t?.description||``,author:e.author||t?.author||n||``,license:t?.license||`MIT`,main:`SKILL.md`,capabilities:``}}function Dn(e,t,n,r,i,a,o){return{$schema:dt,name:e,version:t,description:n||void 0,author:r||void 0,license:i,type:`skill`,capabilities:o,main:a,requirements:{anyt:`>=0.1.0`},files:[...mt],dependencies:{},private:!1}}async function On(e){console.log(`This utility will walk you through creating an anyt.json file.`),console.log(`It only covers the most common items, and tries to guess sensible defaults.`),console.log(``),console.log("See `anyt init --help` for definitive documentation on these fields"),console.log(`and exactly what they do.`),console.log(``),console.log(`Press ^C at any time to quit.`);let t=B({input:process.stdin,output:process.stdout});try{let n=await U(t,`skill name:`,e.name);for(;!wn(n);)console.log(` Name must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, and underscores.`),n=await U(t,`skill name:`,Cn(n));let r=await U(t,`version:`,e.version);for(;!Tn(r);)console.log(` Version must be valid semver (e.g., 1.0.0)`),r=await U(t,`version:`,`0.1.0`);let i=await U(t,`description:`,e.description),a=await U(t,`entry point:`,e.main),o=await U(t,`capabilities (comma-separated):`,e.capabilities),s=await U(t,`author:`,e.author),c=await U(t,`license:`,e.license);t.close();let l=o?o.split(`,`).map(e=>e.trim()).filter(Boolean):[];return Dn(n,r,i,s,c,a,l)}catch(e){throw t.close(),e instanceof Error&&e.message.includes(`readline was closed`)&&(console.log(`
9
+ Aborted.`),process.exit(0)),e}}async function kn(){let e=B({input:process.stdin,output:process.stdout}),t=await U(e,`Is this OK?`,`yes`);return e.close(),t.toLowerCase()===`yes`||t.toLowerCase()===`y`}async function An(e){try{let t=N(process.cwd(),`anyt.json`),n=!1;try{await I(t),n=!0}catch{}n&&!e.force&&(console.error(`Error: anyt.json already exists in this directory.`),console.error(`Use --force to overwrite.`),process.exit(1));let r=await xn(),i=await En(e,r),a=e.yes?Dn(i.name,i.version,i.description,i.author,i.license,i.main,[]):await On(i);a.description||=void 0,a.author||=void 0,a.capabilities?.length===0&&(a.capabilities=void 0);let o=JSON.stringify(a,null,2);console.log(``),console.log(`About to write to ${t}:`),console.log(``),console.log(o),console.log(``),!e.yes&&!await kn()&&(console.log(`Aborted.`),process.exit(0)),await L(t,`${o}\n`);try{await I(N(process.cwd(),`SKILL.md`))}catch{console.log(`Note: Create a SKILL.md file with your skill's prompt content.`)}r&&(console.log(`Note: Values were derived from existing package.json.`),console.log(` anyt.json is for publishing to anyt registry.`),console.log(` package.json can still be used for npm dependencies.`))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function jn(e){try{if(e.global){let{setGlobalMode:e}=await import(`./config-BBDgQnzq.js`);e(!0)}let t=await T(),n=t?.agents,r;if(e.agent?r=Qe(e.agent):t||e.yes?r=Qe(void 0):(console.log(`No anyt.json found. Let's set up your project.
10
+ `),r=await nt()),r.length===1&&r[0]===`none`){console.log(`Skipping symlink creation (--agent none)`);return}let i=[],a=await O();for(let{name:e}of a){let t=D(e);if(!t){console.warn(`Warning: Invalid skill name in lockfile: ${e}`);continue}let n=t.subname??t.name,r=t.namespace===`github`&&t.subname?`${t.name}/${t.subname}`:t.name;i.push({name:n,sourcePath:at(t.namespace,t.owner,r)})}let o=await A();for(let{specifier:e}of o){let t=w(e);if(!t){console.warn(`Warning: Invalid GitHub specifier in lockfile: ${e}`);continue}let n=C(t);i.push({name:n,sourcePath:k(t.owner,t.repo,t.path)})}if(i.length===0){console.log(`No skills found in lockfile. Nothing to link.`);return}console.log(`Creating symlinks for ${i.length} skill(s) to agent(s): ${r.join(`, `)}...`);let s=e.global??!1;await _t(i,{agents:r,projectRoot:s?(await import(`node:os`)).homedir():process.cwd(),agentConfigs:n,global:s}),console.log(`Symlinks created successfully.`),console.log(`
11
+ Linked skills:`);for(let e of i)console.log(` ${e.name} -> ${e.sourcePath}`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function W(e){try{return await Mt(e),`installed`}catch{return`missing`}}async function Mn(e,t){let n=[];for(let{name:r,entry:i}of e){let e=D(r);if(!e)continue;let a=e.subname??e.name,o=e.namespace===`github`&&e.subname?`${e.name}/${e.subname}`:e.name,s=at(e.namespace,e.owner,o),c=await W(N(t.projectRoot,s)),l=await j(a,t.availableAgents,t.projectRoot,t.agentConfigs);n.push({name:a,fullName:r,version:i.version,source:`registry`,sourcePath:s,status:c,linkedAgents:l})}return n}async function Nn(e,t){let n=[];for(let{specifier:r,entry:i}of e){let e=w(r);if(!e)continue;let a=i,o=C(e),s=k(e.owner,e.repo,e.path),c=await W(N(t.projectRoot,s)),l=await j(o,t.availableAgents,t.projectRoot,t.agentConfigs);n.push({name:o,fullName:r,version:a.gitCommit.slice(0,7),source:`github`,sourcePath:s,status:c,linkedAgents:l,gitRef:a.gitRef,gitCommit:a.gitCommit})}return n}async function Pn(e,t){let n=[];for(let{specifier:r,entry:i}of e){let e=i,a=e.name,o=ft(e.hostname,a),s=await W(N(t.projectRoot,o)),c=await j(a,t.availableAgents,t.projectRoot,t.agentConfigs);n.push({name:a,fullName:r,version:`well-known`,source:`well-known`,sourcePath:o,status:s,linkedAgents:c,hostname:e.hostname})}return n}function Fn(e,t){console.log(`Installed skills:
12
+ `);for(let n of e){if(n.source===`registry`)console.log(` ${n.fullName}@${n.version} (registry)`);else if(n.source===`well-known`)console.log(` ${n.name} (well-known: ${n.hostname})`);else{let e=n.gitRef?`${n.gitRef}@${n.gitCommit?.slice(0,7)}`:n.version;console.log(` ${n.fullName} (${e})`)}if(n.status===`missing`&&console.log(` Status: MISSING (run 'anyt install' to restore)`),n.linkedAgents.length>0)for(let e of n.linkedAgents){let r=bt(e,t);r&&console.log(` -> ${r.skillsDir}/${n.name}`)}}let n=e.filter(e=>e.source===`registry`).length,r=e.filter(e=>e.source===`github`).length,i=e.filter(e=>e.source===`well-known`).length,a=[];n>0&&a.push(`${n} registry`),r>0&&a.push(`${r} github`),i>0&&a.push(`${i} well-known`),console.log(`\nTotal: ${e.length} skill(s) (${a.join(`, `)})`)}async function In(e){try{if(e.global){let{setGlobalMode:e}=await import(`./config-BBDgQnzq.js`);e(!0)}let t=await O(),n=await A(),r=await ct(),i=(await T())?.agents,a={availableAgents:Xe(i),agentConfigs:i,projectRoot:process.cwd()},o=[...await Mn(t,a),...await Nn(n,a),...await Pn(r,a)];if(o.length===0){console.log(`No skills installed.`);return}if(e.json){console.log(JSON.stringify(o,null,2));return}Fn(o,i)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}const Ln=`https://anyt.io`;function Rn(e){if(process.env.ANYT_WEB_URL)return process.env.ANYT_WEB_URL.replace(/\/$/,``);try{let t=new P(e),n=t.host;return n.startsWith(`registry.`)&&(n=n.slice(9)),`${t.protocol}//${n}`}catch{return Ln}}function zn(e){try{let t=new P(e),n=t.host;return n.startsWith(`registry.`)&&(n=n.slice(9)),`${t.protocol}//${n}`}catch{return Ln}}async function Bn(e,t){let n=`${zn(e)}/api/api-keys/cli-token-exchange`,r=await fetch(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:t})});if(!r.ok){let e=await r.text();throw Error(`Failed to exchange token: ${e}`)}return r.json()}function Vn(e){return new Promise((t,n)=>{let r,i,a,o=new Promise((e,t)=>{r=e,i=t}),s=zt.createServer((t,n)=>{let a=new P(t.url||`/`,`http://localhost`);if(a.pathname===`/callback`){let t=a.searchParams.get(`token`);if(a.searchParams.get(`state`)!==e){n.writeHead(400,{"Content-Type":`text/html`}),n.end(`
13
+ <html>
14
+ <body style="font-family: system-ui; text-align: center; padding: 40px;">
15
+ <h1 style="color: #dc2626;">Security Error</h1>
16
+ <p>State mismatch - this may be a security issue.</p>
17
+ <p>Please try running <code>anyt login</code> again.</p>
18
+ </body>
19
+ </html>
20
+ `),i(Error(`State mismatch - possible CSRF attack`));return}if(!t){n.writeHead(400,{"Content-Type":`text/html`}),n.end(`
21
+ <html>
22
+ <body style="font-family: system-ui; text-align: center; padding: 40px;">
23
+ <h1 style="color: #dc2626;">Error</h1>
24
+ <p>No token received from the server.</p>
25
+ <p>Please try running <code>anyt login</code> again.</p>
26
+ </body>
27
+ </html>
28
+ `),i(Error(`No token received`));return}n.writeHead(200,{"Content-Type":`text/html`}),n.end(`
29
+ <html>
30
+ <head>
31
+ <script>
32
+ // Try to close the window after a short delay
33
+ setTimeout(function() {
34
+ window.close();
35
+ }, 1500);
36
+ <\/script>
37
+ </head>
38
+ <body style="font-family: system-ui; text-align: center; padding: 40px;">
39
+ <h1 style="color: #16a34a;">Success!</h1>
40
+ <p>You are now logged in to anyt.</p>
41
+ <p style="color: #666; font-size: 14px;">This window will close automatically, or you can close it manually.</p>
42
+ </body>
43
+ </html>
44
+ `),r(t)}else n.writeHead(404,{"Content-Type":`text/plain`}),n.end(`Not found`)}),c=()=>{clearTimeout(a),s.close()};s.listen(0,`127.0.0.1`,()=>{let e=s.address();typeof e==`object`&&e?t({port:e.port,tokenPromise:o,cleanup:c}):n(Error(`Failed to get server address`))}),s.on(`error`,e=>{n(e)}),a=setTimeout(()=>{i(Error(`Login timed out - please try again`)),s.close()},300*1e3)})}async function Hn(){let e=await y(),t=Rn(e),n=Lt(32).toString(`base64url`);console.log(`Starting browser-based login...`);let{port:r,tokenPromise:i,cleanup:a}=await Vn(n),o=`${t}/cli/login?port=${r}&state=${encodeURIComponent(n)}`;console.log(`Opening browser to authenticate...`),console.log(`If the browser doesn't open, visit: ${o}`);try{await Bt(o)}catch{console.log(`Could not open browser automatically.`),console.log(`Please visit: ${o}`)}console.log(`Waiting for authentication...`);let s=await i;a(),console.log(`Received token, exchanging for API key...`);let{apiKey:c,username:l}=await Bn(e,s);await qe(c,l,e),console.log(`Logged in as ${l}`),console.log(`Registry: ${e}`)}async function Un(e){console.log(`Verifying API key...`);let t=await y(),n=await p(t,e);n||(console.error(`Error: Invalid API key or not authenticated`),process.exit(1)),await qe(e,n.username,t),console.log(`Logged in as ${n.username}`),console.log(`Registry: ${t}`)}async function Wn(e){try{e.apiKey?await Un(e.apiKey):await Hn()}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function Gn(){try{if(!await Ke()){console.log(`Not logged in.`);return}await Ge(),console.log(`Logged out successfully.`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function G(e,t={}){let n=await x(),r=await v(),i=n.registryUrl.replace(/\/api\/skills\/?$/,``),a={"Content-Type":`application/json`,...t.headers};return r&&(a.Authorization=`Bearer ${r}`),fetch(`${i}${e}`,{...t,headers:a})}async function Kn(e,t){let n=wt(kt(e),`utf-8`),r={name:M(e).replace(/\.anyt\.md$|\.anyt$|\.md$/,``),content:n,description:t.description,visibility:t.visibility||`private`},i=await G(t.org?`/api/notebooks/org/${t.org}`:`/api/notebooks`,{method:`POST`,body:JSON.stringify(r)});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.message||`Upload failed (${i.status})`)}let a=await i.json();console.log(`Uploaded: ${a.name} (${a.id})${t.org?` to org ${t.org}`:``}`)}async function qn(e){let t=await G(e.org?`/api/notebooks/org/${e.org}`:`/api/notebooks/-/mine`);if(!t.ok)throw Error(`Failed to list notebooks (${t.status})`);let n=await t.json();if(n.length===0){console.log(`No notebooks found`);return}console.log(`\n${`Name`.padEnd(30)} ${`Cells`.padEnd(8)} ${`Visibility`.padEnd(12)} ${`Updated`.padEnd(12)} ID`),console.log(`-`.repeat(90));for(let e of n){let t=new Date(e.updatedAt).toLocaleDateString();console.log(`${e.name.slice(0,28).padEnd(30)} ${String(e.cellCount).padEnd(8)} ${e.visibility.padEnd(12)} ${t.padEnd(12)} ${e.id}`)}console.log(`\n${n.length} notebook(s)`)}async function Jn(e,t){let n=await G(`/api/notebooks/${e}`);if(!n.ok)throw Error(`Notebook not found (${n.status})`);let r=await n.json(),i=t||`${r.slug}.anyt.md`;Et(i,r.content,`utf-8`),console.log(`Downloaded: ${r.name} -> ${i}`)}async function Yn(e){let t=await G(`/api/notebooks/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Failed to delete notebook (${t.status})`);console.log(`Notebook ${e} deleted`)}function Xn(e,t){let n=t.filter(e=>z.valid(e)).sort((e,t)=>z.rcompare(e,t));return!e||e===`latest`?n[0]??null:z.maxSatisfying(n,e)}function K(e,t){return z.compare(e,t)}function Zn(e){let t=e.filter(e=>z.valid(e));return t.length===0?null:t.sort((e,t)=>z.rcompare(e,t))[0]}async function Qn(e,t){let n={};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(e,{headers:n});if(!r.ok){let e=await r.text();throw Error(`Request failed (${r.status}): ${e}`)}return r}async function $n(e,t,n){let r={"Content-Type":`application/json`};n&&(r.Authorization=`Bearer ${n}`);let i=await fetch(e,{method:`POST`,headers:r,body:JSON.stringify(t)});if(!i.ok){let e=await i.text();throw Error(`Request failed (${i.status}): ${e}`)}return i}function er(e){return e.replace(/\/api\/skills\/?$/,``).replace(/\/$/,``)}function tr(e,t){return{name:e,current:`local`,wanted:null,latest:null,type:`local`,isOutdated:!1,wantedBehindLatest:!1}}function nr(e,t,n,r){let i=n.map(e=>e.version),a=r||`*`,o=Xn(a,i),s=Zn(i),c=n.find(e=>e.version===t.version)?.deprecationMessage??void 0,l=o!==null&&K(t.version,o)<0||s!==null&&K(t.version,s)<0,u=o!==null&&s!==null&&K(o,s)<0;return{name:e,current:t.version,wanted:o,latest:s,type:`registry`,isOutdated:l,wantedBehindLatest:u,versionRange:a,deprecated:c}}async function rr(e,t,n){let{lockfile:r,manifest:i,includeUpToDate:a=!1,includeLocal:o=!1,packages:s}=e,c=[],l=r.packages||r.skills||{},u=i?.dependencies||{},d=Object.entries(l).filter(([e])=>!s||s.includes(e)),f=await Promise.all(d.map(([e,n])=>t(e,n,u[e])));c.push(...f);let ee=r.githubPackages||{},p=Object.entries(ee).filter(([e])=>!s||s.includes(e)),m=await Promise.all(p.map(([e,t])=>n(e,t)));if(c.push(...m),o){let e=r.localPackages||{},t=Object.entries(e).filter(([e])=>!s||s.includes(e));for(let[e,n]of t)c.push(tr(e,n))}return a?c:c.filter(e=>e.isOutdated)}function ir(e){let{registryUrl:t,apiKey:n,githubToken:r}=e,i=er(t);async function a(e,t){return await(await $n(`${i}/v1/skill.listVersions`,{username:e,name:t},n)).json()}async function o(e,t,r){return await(await $n(`${i}/v1/skill.github.listVersions`,{owner:e,repo:t,name:r},n)).json()}async function s(e,t,n){let r=e.match(/^@(?:user|org)\/([^/]+)\/([^/]+)$/),i=e.match(/^@github\/([^/]+)\/([^/]+)\/([^/]+)$/);if(!r&&!i)throw Error(`Invalid registry specifier: ${e}`);let s=!!i,c=r?r[1]:``,l=r?r[2]:``;try{return nr(e,t,s&&i?await o(i[1],i[2],i[3]):await a(c,l),n)}catch{return{name:e,current:t.version,wanted:null,latest:null,type:`registry`,isOutdated:!1,wantedBehindLatest:!1,versionRange:n}}}async function c(e,t,n){try{return(await(await Qn(`https://api.github.com/repos/${e}/${t}/commits/${n}`,r)).json()).sha}catch{return null}}async function l(e,t){let n=e.match(/^github:([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)/);if(!n)throw Error(`Invalid GitHub specifier: ${e}`);let[,r,i]=n,a=t.gitRef||`HEAD`,o=await c(r,i,a),s=t.gitCommit.slice(0,7),l=o?.slice(0,7)??null;return{name:e,current:s,wanted:l,latest:l,type:`github`,isOutdated:o!==null&&t.gitCommit!==o,wantedBehindLatest:!1,versionRange:a}}async function u(e){return rr(e,s,l)}return{checkOutdated:u,checkRegistryPackage:s,checkGitHubPackage:l,checkLocalPackage:tr,fetchRegistryVersions:a}}async function ar(e,t){return ir(e).checkOutdated(t)}async function or(e,t){try{let n=await st();if(!n){console.log(`No skills installed.`);return}if(!(Object.keys(n.packages??n.skills??{}).length>0||Object.keys(n.githubPackages??{}).length>0||Object.keys(n.localPackages??{}).length>0)){console.log(`No skills installed.`);return}let r=await x(),i=r.registryUrl,a=_(r,i),o=process.env.GITHUB_TOKEN,s=await T();console.log(`Checking for outdated packages...
45
+ `);let c=await ar({registryUrl:i,apiKey:a,githubToken:o},{lockfile:n,manifest:s??void 0,includeUpToDate:t.all,packages:e.length>0?e:void 0});if(c.length===0){console.log(`All skills are up to date.`);return}t.json?console.log(JSON.stringify(c,null,2)):sr(c);let l=c.filter(e=>e.deprecated);if(l.length>0){console.log(``);for(let e of l)console.log(`\x1b[33m⚠ ${e.name}: ${e.deprecated}\x1b[0m`)}c.some(e=>e.isOutdated)&&(process.exitCode=1)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}function sr(e){let t=[`Package`,`Current`,`Wanted`,`Latest`,`Type`],n=e.map(e=>[e.name,e.current,e.wanted??`—`,e.latest??`—`,e.type]),r=t.map((e,t)=>Math.max(e.length,...n.map(e=>e[t].length))),i=t.map((e,t)=>e.padEnd(r[t])).join(` `);console.log(i),console.log(r.map(e=>`─`.repeat(e)).join(`──`));for(let e of n){let t=e.map((e,t)=>e.padEnd(r[t])).join(` `);console.log(t)}}function cr(e){return new Promise(t=>{let n=B({input:process.stdin,output:process.stdout});n.question(`${e} (y/N) `,e=>{n.close();let r=e.trim().toLowerCase();t(r===`y`||r===`yes`)})})}async function lr(){let e=process.cwd(),t=N(e,`anyt.json`);try{let e=await F(t,`utf-8`);return{type:`anyt.json`,manifest:JSON.parse(e),path:t}}catch{}let n=N(e,`package.json`);try{let e=await F(n,`utf-8`),t=JSON.parse(e);return{type:`package.json`,manifest:{name:t.name,version:t.version,description:t.description,author:typeof t.author==`string`?t.author:t.author?.name,license:t.license,files:t.files,dependencies:t.dependencies},path:n}}catch{throw Error(`No anyt.json or package.json found in current directory`)}}function q(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}kB`:`${(e/(1024*1024)).toFixed(1)}MB`}async function ur(e,t,n){let r=[];try{let i=await Pt(e,{withFileTypes:!0});for(let a of i){let i=N(e,a.name),o=Ot(t,i);if(!pt.includes(a.name)){if(n?.ig){let e=a.isDirectory()?`${o}/`:o;if(n.ig.ignores(e))continue}if(a.isDirectory()){let e=await ur(i,t,n);r.push(...e)}else{let e=await I(i);r.push({path:o,size:e.size})}}}}catch{}return r}const J=Ht(Vt);async function dr(e){e===`public`&&(console.log(``),console.log(`⚠️ Warning: You are about to publish this skill as PUBLIC.`),console.log(` Once a skill is public, it CANNOT be made private again.`),console.log(` This action is irreversible.`),console.log(``),await cr(`Do you want to continue?`)||(console.log(`Publish cancelled.`),process.exit(0)),console.log(``))}async function fr(e){let t=await lr(),n=t.manifest;t.type===`package.json`&&(console.log(`anyt warn Using package.json instead of anyt.json`),console.log(`anyt warn Run 'anyt init' to create a dedicated anyt.json manifest`),console.log(``));let r=lt(n);r.valid||(console.error(`Error: ${r.error}`),process.exit(1));try{await I(N(process.cwd(),`SKILL.md`))}catch{console.error(`Error: SKILL.md is required. Create a SKILL.md file with your skill's documentation before publishing.`),process.exit(1)}await dr(e.access);let i=n.name.split(`/`),a={name:i[i.length-1],version:n.version,description:n.description,files:n.files,dependencies:n.dependencies};if(e.bump){let t=(await import(`semver`)).default.inc(a.version,e.bump);t||(console.error(`Error: Failed to bump version from ${a.version}`),process.exit(1)),a.version=t,console.log(`Bumped version to ${t}`)}return{detection:t,packageJson:a}}async function pr(e,t,n,r){for(let r of e)try{await J(`rsync -a ${n} "${r}" "${t}/package/" 2>/dev/null || true`)}catch{}if(r.type===`anyt.json`){await J(`cp anyt.json "${t}/package/"`);try{await I(N(process.cwd(),`package.json`)),await J(`cp package.json "${t}/package/" 2>/dev/null || true`)}catch{}}else await J(`cp package.json "${t}/package/"`)}async function mr(e,t,n){let r=await ot();r.source&&console.log(`anyt notice Using ${r.source} for ignore patterns`);let i=gt(r.patterns),a=`${e.name.replace(/[@/]/g,`-`).replace(/^-+/,``)}-${e.version}.tgz`;await J(`rm -rf "${n}" && mkdir -p "${n}"`),await J(`mkdir -p "${n}/package"`),await pr(e.files||[...mt],n,i,t);let o=N(n,`package`),s=await ur(o,o,r),c=s.reduce((e,t)=>e+t.size,0),l=N(n,a);await J(`tar -czf "${l}" -C "${n}" ${i} package`);let u=await F(l);return{tarballBuffer:u,tarballBase64:u.toString(`base64`),tarballSize:u.length,shasum:R(`sha1`).update(u).digest(`hex`),integrity:`sha512-${R(`sha512`).update(u).digest(`base64`)}`,contents:s,unpackedSize:c,tarballName:a}}function hr(e){let t=10*1024*1024;e<=t||(console.error(``),console.error(`Error: Package size ${q(e)} exceeds the maximum allowed size of ${q(t)}.`),console.error(``),console.error(`To reduce the package size:`),console.error(` - Add a "files" field in your manifest to include only necessary files`),console.error(` - Add patterns to .anytignore to exclude large files`),console.error(` - Remove build artifacts, tests, and documentation from the package`),process.exit(1))}function gr(e,t){console.log(``),console.log(`anyt notice`),console.log(`anyt notice 📦 ${e.name}@${e.version}`),console.log(`anyt notice === Tarball Contents ===`);let n=[...t.contents].sort((e,t)=>t.size-e.size);for(let e of n)console.log(`anyt notice ${q(e.size).padStart(8)} ${e.path}`);console.log(`anyt notice === Tarball Details ===`),console.log(`anyt notice name: ${e.name}`),console.log(`anyt notice version: ${e.version}`),console.log(`anyt notice filename: ${t.tarballName}`),console.log(`anyt notice package size: ${q(t.tarballSize)}`),console.log(`anyt notice unpacked size: ${q(t.unpackedSize)}`),console.log(`anyt notice shasum: ${t.shasum}`),console.log(`anyt notice integrity: ${t.integrity.substring(0,50)}...`),console.log(`anyt notice total files: ${t.contents.length}`),console.log(`anyt notice`)}async function _r(e,t,n){if(e.access!==`private`&&e.access!==`team`)return n.tarballBase64;let r=await import(`./config-BBDgQnzq.js`).then(e=>e.resolveConfig()),i=e.org?`org`:`user`,a=e.org??r.username;a||(console.error(`Error: Cannot determine package owner. Run 'anyt login' first.`),process.exit(1));let o=He(i,a),s=await Ue(o);if(!s)return console.log(`anyt warn No encryption key found for scope "${o}". Publishing without encryption.`),console.log(`anyt warn To encrypt, run: anyt config set-encryption-key ${o} <your-passphrase>`),n.tarballBase64;console.log(`anyt notice Encrypting package (scope: ${o})`);let{encrypted:c,metadata:l}=vt(n.tarballBuffer,s,o);return t.encryption=l,console.log(`anyt notice Package encrypted with client-side encryption`),c.toString(`base64`)}async function vr(e,t,n){let r=e.access===`team`?`private`:e.access;return e.org?Re(e.org,{manifest:t,tarballBase64:n,visibility:r}):ie({manifest:t,tarballBase64:n,visibility:r})}function yr(e,t){let n=S({status:e.status,data:e.data},`Publish failed`);throw(n.includes(`must be greater than`)||n.includes(`already exists`))&&(console.error(`anyt error code E403`),console.error(`anyt error 403 403 Forbidden - You cannot publish over the previously published versions: ${t}.`)),Error(n)}function br(e,t,n){let r=e.skill,i=r.visibility,a=i===`public`?`🌐`:i===`team`?`👥`:`🔒`,o=t.org?`org`:r.namespace??`user`,s=t.org??r.username;console.log(`+ @${o}/${s}/${e.skill.name}@${e.version.version}`),console.log(`Checksum: ${e.version.checksum}`),console.log(`Visibility: ${a} ${i}${n.encryption?` (encrypted)`:``}`),i===`public`&&console.log(`Note: Public packages cannot be made private. This is irreversible.`)}async function xr(e){try{let t=await v(),n=await y(),{detection:r,packageJson:i}=await fr(e),a=N(process.cwd(),`.anyt-publish`);try{let o=await mr(i,r,a);hr(o.tarballSize),gr(i,o),await cr(`Publish ${i.name}@${i.version} to ${n}?`)||(console.log(`Publish cancelled.`),process.exit(0)),console.log(``);let s=await _r(e,i,o);console.log(`anyt notice Publishing to ${n} with tag latest`),h({registryUrl:n,apiKey:t});let c=await vr(e,i,s);c.status!==200&&yr(c,i.version),br(c.data,e,i)}finally{await J(`rm -rf "${a}"`).catch(()=>{})}}catch(e){e instanceof Error?console.error(`Error: ${e.message}`):console.error(`Error: ${String(e)}`),process.exit(1)}}async function Sr(e){try{let t=(await T())?.agents,n=Xe(t);rt(e)?await wr(e,n,t):Ze(e)?await Cr(e,n,t):await Tr(e,n,t)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function Cr(e,t,n){let r=D(e);r||(console.error(`Error: Invalid skill specifier: ${e}`),process.exit(1));let{namespace:i,owner:a,name:o,subname:s}=r,c=i===`github`&&s?`@github/${a}/${o}/${s}`:`@${i}/${a}/${o}`;console.log(`Removing ${c}...`);let l=await it(c),u=await $e(c);!l&&!u&&(console.error(`Error: ${c} not found in lockfile or anyt.json`),process.exit(1)),await ht(s??o,{agents:t,projectRoot:process.cwd(),agentConfigs:n});let d=b(),f;f=i===`github`&&s?N(d,`_github-registry`,a,o,s):i===`org`?N(d,`_org`,a,o):N(d,a,o);try{await Ft(f,{recursive:!0,force:!0})}catch{}console.log(`Removed ${c}`)}async function wr(e,t,n){let r=w(e);r||(console.error(`Error: Invalid GitHub specifier: ${e}`),process.exit(1));let i=r.path?`github:${r.owner}/${r.repo}/${r.path}`:`github:${r.owner}/${r.repo}`;console.log(`Removing ${i}...`);let a=await yt(i),o=await et(i);!a&&!o&&(console.error(`Error: ${i} not found in lockfile or anyt.json`),process.exit(1)),await ht(C(r),{agents:t,projectRoot:process.cwd(),agentConfigs:n});let s=N(b(),`..`,k(r.owner,r.repo,r.path));try{await Ft(s,{recursive:!0,force:!0})}catch{}console.log(`Removed ${i}`)}async function Tr(e,t,n){let r=(await O()).find(t=>{let n=D(t.name);return n?(n.subname??n.name)===e:!1});if(r){await Cr(r.name,t,n);return}let i=(await A()).find(t=>{let n=w(t.specifier);return n?C(n)===e:!1});if(i){await wr(i.specifier,t,n);return}console.error(`Error: Skill "${e}" not found in lockfile`),process.exit(1)}async function Er(e,t){try{let n=await x(),r=_(n,n.registryUrl);h({registryUrl:n.registryUrl,apiKey:r});let i=t.limit??20,a=t.sort??`downloads`;t.json||console.log(e?`Searching for "${e}"...\n`:`Browsing skills...
46
+ `);let o=await Te({search:e,sort:a,limit:i,page:1});o.status!==200&&(console.error(`Error: Failed to search skills`),process.exit(1));let{skills:s,total:c}=o.data;if(s.length===0){console.log(e?`No skills found matching "${e}".`:`No skills published yet.`);return}if(t.json){console.log(JSON.stringify(s,null,2));return}for(let e of s){let t=`@${e.namespace??`user`}/${e.username}/${e.name}`,n=e.description?` - ${e.description.slice(0,80)}${e.description.length>80?`...`:``}`:``,r=e.totalDownloads>0?` (${Dr(e.totalDownloads)} downloads)`:``;console.log(` ${t}${r}`),n&&console.log(` ${n.trim()}`)}let l=Math.min(s.length,i);if(console.log(c>l?`\nShowing ${l} of ${c} results.`:`\n${c} skill(s) found.`),s.length>0){let e=s[0];console.log(`\nInstall with: anyt add @${e.namespace??`user`}/${e.username}/${e.name}`)}}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}function Dr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Y(e){let t=e.match(/^@(user|org)\/([^/]+)\/([^/]+)$/);return t?{ownerType:t[1],ownerName:t[2],listName:t[3]}:null}function X(e){try{let t=JSON.parse(e);if(typeof t.message==`string`)return t.message;if(typeof t.error==`string`)return t.error;if(typeof t.error?.message==`string`)return t.error.message}catch{}return e}async function Z(){return(await x()).registryUrl.replace(/\/api\/skills\/?$/,``)}async function Q(){return{"Content-Type":`application/json`,Authorization:`Bearer ${await v()}`}}async function Or(){let e=await x(),t=_(e,e.registryUrl),n={"Content-Type":`application/json`};return t&&(n.Authorization=`Bearer ${t}`),n}async function kr(e,t,n){let r=n.match(/^@(user|org|github)\/(.+)$/),i,a;if(r){a=r[1];let e=r[2].split(`/`);i=e[e.length-1]}else i=n;let o=new URLSearchParams({search:i,limit:`5`});a&&o.set(`namespace`,a);let s=await fetch(`${e}/api/skills/-/explore?${o}`,{headers:t});if(!s.ok)return null;let c=await s.json();if(!c.skills||c.skills.length===0)return null;if(r){let e=r[2].split(`/`),t=e[e.length-1],n=e.length>=2?e[e.length-2]:void 0,i=c.skills.find(e=>e.name===t&&(!n||e.username===n)&&(!a||e.namespace===a));if(i)return i.id}return c.skills[0].id}async function Ar(e){let t=await Z(),n=await x();e.org&&(console.error(`Error: @org skill lists are not yet supported on v1.`),process.exit(1)),n.username||(console.error("Error: Not logged in. Run `anyt login` first."),process.exit(1));let r=await Or(),i=await fetch(`${t}/v1/skillList.list`,{method:`POST`,headers:{...r,"Content-Type":`application/json`},body:JSON.stringify({username:n.username})});if(!i.ok){let e=await i.text();console.error(`Error: Failed to list skill lists (${i.status}): ${X(e)}`),process.exit(1)}let a=await i.json();if(e.json){console.log(JSON.stringify(a,null,2));return}if(a.length===0){console.log(`No skill lists found.`);return}let o=e.org?`@org/${e.org}`:`@user/${n.username}`;console.log(`\nSkill lists for ${o}:\n`),console.log(`${`Name`.padEnd(35)} ${`Skills`.padEnd(8)} ${`Visibility`.padEnd(12)} Description`),console.log(`-`.repeat(90));for(let e of a){let t=e.description?e.description.slice(0,30):``;console.log(`${e.name.slice(0,33).padEnd(35)} ${String(e.itemCount).padEnd(8)} ${e.visibility.padEnd(12)} ${t}`)}console.log(`\n${a.length} list(s)`)}async function jr(e,t){let n=await Z(),r=await Q(),i=await x(),a=t.visibility||`private`;a!==`public`&&a!==`private`&&(console.error(`Error: --visibility must be "public" or "private"`),process.exit(1)),t.org&&(console.error(`Error: @org skill lists are not yet supported on v1.`),process.exit(1)),i.username||(console.error("Error: Not logged in. Run `anyt login` first."),process.exit(1));let o={username:i.username,name:e,visibility:a};t.description&&(o.description=t.description);let s=await fetch(`${n}/v1/skillList.create`,{method:`POST`,headers:{...r,"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok){let e=await s.text();console.error(`Error: Failed to create list (${s.status}): ${X(e)}`),process.exit(1)}let c=await s.json(),l=t.org?`@org/${t.org}`:`@user/${i.username}`;console.log(`Created list: ${l}/${c.name} (${c.visibility})`),console.log(`\nInstall command: anyt skill-list install ${l}/${c.name}`)}async function Mr(e,t){let n=Y(e);n||(console.error(`Error: Invalid list specifier. Use @user/<username>/<list-name> or @org/<orgname>/<list-name>`),process.exit(1));let r=await x();h({registryUrl:r.registryUrl,apiKey:_(r,r.registryUrl)});let i=await ve(n.ownerType,n.ownerName,n.listName);if(i.status!==200||!i.data){let t=i.status===404?`List "${e}" not found or is private.`:i.error||`Failed to fetch list`;console.error(`Error: ${t}`),process.exit(1)}let a=i.data;if(t.json){console.log(JSON.stringify(a,null,2));return}if(console.log(`\n${a.name}`),a.description&&console.log(` ${a.description}`),console.log(` Visibility: ${a.visibility}`),console.log(` Owner: @${a.ownerType}/${a.ownerName}`),console.log(` Skills: ${a.items.length}`),a.items.length>0){console.log(``);for(let e of a.items){let t=`@${e.namespace===`org`?`org`:`user`}/${e.ownerName}/${e.skillName}`,n=e.pinnedVersion?`@${e.pinnedVersion}`:``;console.log(` - ${t}${n}`)}}console.log(`\nInstall all: anyt skill-list install ${e}`)}async function Nr(e){let t=Y(e);t||(console.error(`Error: Invalid list specifier. Use @user/<username>/<list-name> or @org/<orgname>/<list-name>`),process.exit(1)),t.ownerType===`org`&&(console.error(`Error: @org skill lists are not yet supported on v1.`),process.exit(1));let n=await Z(),r=await Q(),i=await fetch(`${n}/v1/skillList.delete`,{method:`POST`,headers:{...r,"Content-Type":`application/json`},body:JSON.stringify({username:t.ownerName,listName:t.listName})});if(!i.ok){let t=await i.text();i.status===404?console.error(`Error: List "${e}" not found.`):console.error(`Error: Failed to delete list (${i.status}): ${X(t)}`),process.exit(1)}console.log(`Deleted list: ${e}`)}async function Pr(e,t){let n=Y(e);n||(console.error(`Error: Invalid list specifier. Use @user/<username>/<list-name> or @org/<orgname>/<list-name>`),process.exit(1)),!t.description&&!t.visibility&&(console.error(`Error: Provide at least one of --description or --visibility`),process.exit(1)),t.visibility&&t.visibility!==`public`&&t.visibility!==`private`&&(console.error(`Error: --visibility must be "public" or "private"`),process.exit(1)),n.ownerType===`org`&&(console.error(`Error: @org skill lists are not yet supported on v1.`),process.exit(1));let r=await Z(),i=await Q(),a={username:n.ownerName,listName:n.listName};t.description!==void 0&&(a.description=t.description),t.visibility&&(a.visibility=t.visibility);let o=await fetch(`${r}/v1/skillList.update`,{method:`POST`,headers:{...i,"Content-Type":`application/json`},body:JSON.stringify(a)});if(!o.ok){let e=await o.text();console.error(`Error: Failed to update list (${o.status}): ${X(e)}`),process.exit(1)}console.log(`Updated list: ${e}`)}async function Fr(e,t,n){let r=Y(e);r||(console.error(`Error: Invalid list specifier. Use @user/<username>/<list-name> or @org/<orgname>/<list-name>`),process.exit(1));let i=await Z(),a=await Q(),o=await x();h({registryUrl:o.registryUrl,apiKey:_(o,o.registryUrl)}),r.ownerType===`org`&&(console.error(`Error: @org skill lists are not yet supported on v1.`),process.exit(1));for(let e of t){let t=await kr(i,a,e);if(!t){console.error(`Error: Skill "${e}" not found.`);continue}let o={username:r.ownerName,listName:r.listName,skillId:t};n.note&&(o.note=n.note);let s=await fetch(`${i}/v1/skillList.addItem`,{method:`POST`,headers:{...a,"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok){let t=await s.text();s.status===409?console.log(`Already in list: ${e}`):console.error(`Error: Failed to add "${e}" (${s.status}): ${X(t)}`);continue}console.log(`Added: ${e}`)}}async function Ir(e,t){let n=Y(e);n||(console.error(`Error: Invalid list specifier. Use @user/<username>/<list-name> or @org/<orgname>/<list-name>`),process.exit(1));let r=await x();h({registryUrl:r.registryUrl,apiKey:_(r,r.registryUrl)});let i=await ve(n.ownerType,n.ownerName,n.listName);(i.status!==200||!i.data)&&(console.error(`Error: List "${e}" not found.`),process.exit(1));let a=i.data.items.find(e=>`@${e.namespace===`org`?`org`:`user`}/${e.ownerName}/${e.skillName}`===t||e.skillName===t||`${e.ownerName}/${e.skillName}`===t);a||(console.error(`Error: Skill "${t}" not found in list "${e}".`),process.exit(1)),n.ownerType===`org`&&(console.error(`Error: @org skill lists are not yet supported on v1.`),process.exit(1));let o=await Z(),s=await Q(),c=await fetch(`${o}/v1/skillList.removeItem`,{method:`POST`,headers:{...s,"Content-Type":`application/json`},body:JSON.stringify({username:n.ownerName,listName:n.listName,itemId:a.id})});if(!c.ok){let e=await c.text();console.error(`Error: Failed to remove skill (${c.status}): ${X(e)}`),process.exit(1)}console.log(`Removed: ${t} from ${e}`)}async function Lr(e,t){let{install:n}=await import(`./install-NbMXwySO.js`);await n([],{list:e,agent:t.agent,yes:t.yes,global:t.global,dir:t.dir})}async function Rr(e,t){try{let n=await v(),r=await y(),i=D(e);i||(console.error(`Error: Invalid skill specifier "${e}". Use format: @user/{username}/{name}[@{version}] or @org/{orgname}/{name}[@{version}]`),process.exit(1));let{owner:a,name:o,versionRange:s}=i,c=E({namespace:i.namespace,owner:a,name:o});h({registryUrl:r,apiKey:n});let l=i.namespace===`org`;if(s){l&&(console.error(`Error: Deleting a specific version of an org skill is not supported. Use the full skill specifier without a version to delete the entire skill.`),process.exit(1)),console.log(`Unpublishing ${e}...`),t.force||(console.error(`Warning: This action is irreversible. Use --force to confirm.`),process.exit(1));let n=await Le(a,o,s);if(n.status!==200){let e=S(n,`Failed to unpublish. Version may not exist.`);console.error(`Error: ${e}`),process.exit(1)}console.log(`Unpublished ${c}@${s}`)}else{console.log(`Unpublishing all versions of ${c}...`),t.force||(console.error(`Warning: This will delete ALL versions. Use --force to confirm.`),process.exit(1));let e=l?await pe(a,o):await we(a,o);if(e.status!==200){let t=S(e,`Failed to unpublish. Skill may not exist.`);console.error(`Error: ${t}`),process.exit(1)}console.log(`Unpublished ${c} (all versions)`)}}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function zr(e){try{let t=await x(),n=t.registryUrl,r=_(t,n),i=await O();if(i.length===0){console.log(`No skills installed.`);return}h({registryUrl:n,apiKey:r});let a=[];console.log(`Checking for updates...
47
+ `);for(let{name:e,entry:t}of i){let n=D(e);if(n)try{let r=await re(n.owner,n.name);if(r.status!==200||!r.data){let t=S(r,`Failed to fetch versions`);console.warn(` Warning: ${e}: ${t}`);continue}let i=r.data;if(i.length===0)continue;let o=Je(`*`,i.map(e=>e.version));o&&o!==t.version&&a.push({name:e,current:t.version,latest:o})}catch{console.warn(` Warning: Could not check updates for ${e}`)}}if(a.length===0){console.log(`All skills are up to date.`);return}console.log(`Updates available:
48
+ `);for(let{name:e,current:t,latest:n}of a)console.log(` ${e}: ${t} -> ${n}`);if(e.dryRun){console.log(`
49
+ Dry run - no changes made.`);return}console.log(`
50
+ Updating...
51
+ `);for(let{name:e,latest:t}of a)D(e)&&await xt([`${e}@${t}`],{});console.log(`
52
+ All skills updated.`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function Br(){let e=`anyt-cli`;try{let t=Vr();console.log(`Checking for updates...
53
+ `);let n=Hr(e);if(n||(console.error(`Error: Could not fetch latest version from registry.`),process.exit(1)),z.valid(t)&&z.valid(n)&&!z.gt(n,t)){console.log(`Already on the latest version: ${t}`);return}console.log(` Current version: ${t}`),console.log(` Latest version: ${n}\n`);let r=Ur(),i=Wr(r,e,n);console.log(`Upgrading via ${r}...\n`),console.log(` $ ${i}\n`),V(i,{stdio:`inherit`}),console.log(`\nSuccessfully upgraded to ${n}`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}function Vr(){try{return V(`anyt --version`,{encoding:`utf-8`,stdio:[`pipe`,`pipe`,`pipe`]}).trim()}catch{return`unknown`}}function Hr(e){try{return V(`npm view ${e} version`,{encoding:`utf-8`,stdio:[`pipe`,`pipe`,`pipe`]}).trim()||null}catch{return null}}function Ur(){try{if(V(`pnpm list -g --depth=0 2>/dev/null`,{encoding:`utf-8`,stdio:[`pipe`,`pipe`,`pipe`]}).includes(`anyt-cli`))return`pnpm`}catch{}try{if(V(`bun pm ls -g 2>/dev/null`,{encoding:`utf-8`,stdio:[`pipe`,`pipe`,`pipe`]}).includes(`anyt-cli`))return`bun`}catch{}try{if(V(`yarn global list 2>/dev/null`,{encoding:`utf-8`,stdio:[`pipe`,`pipe`,`pipe`]}).includes(`anyt-cli`))return`yarn`}catch{}return`npm`}function Wr(e,t,n){switch(e){case`pnpm`:return`pnpm add -g ${t}@${n}`;case`yarn`:return`yarn global add ${t}@${n}`;case`bun`:return`bun add -g ${t}@${n}`;case`npm`:return`npm install -g ${t}@${n}`}}async function Gr(e,t={}){try{let n=await T();n||(console.error(`Error: No anyt.json found in current directory.`),console.error(`Run 'anyt init' to create one.`),process.exit(1)),n.version||(console.error(`Error: anyt.json does not have a version field.`),console.error(`Add a version field (e.g., "version": "0.1.0") to your anyt.json.`),process.exit(1)),Rt.valid(n.version)||(console.error(`Error: Current version "${n.version}" is not valid semver.`),console.error(`Fix the version in anyt.json to be valid semver (e.g., "1.0.0").`),process.exit(1));let r=Rt.inc(n.version,e);if(r||(console.error(`Error: Failed to bump version from ${n.version}`),process.exit(1)),t.dryRun){console.log(`Would bump version: ${n.version} → ${r}`);return}n.version=r,await Ye(n),console.log(`v${r}`),console.log(`Updated ${ut()}`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}async function Kr(){try{let e=await x(),t=await v(),n=await y(),r=await p(n,t);r?(console.log(`Username: ${r.username}`),console.log(`User ID: ${r.userId}`),console.log(`Registry: ${n}`)):e.username?(console.log(`Username: ${e.username} (cached)`),console.log(`Registry: ${n}`)):(console.error(`Could not determine current user.`),process.exit(1))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;console.error(`Error: ${t}`),process.exit(1)}}function qr(e){let t=e.command(`auth`).description(`Authenticate with the anyt.io API`);t.command(`login`).description(`Log in via browser or with an API key`).option(`--api-key <key>`,`API key for direct authentication (skips browser)`).action(async e=>{await Wn({apiKey:e.apiKey})}),t.command(`logout`).description(`Log out and clear stored credentials`).action(async()=>{await Gn()}),t.command(`whoami`).description(`Show current user information`).action(async()=>{await Kr()})}async function Jr(e){await i();let t=g(await u());if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;console.log(`
54
+ Subscription`),console.log(`-------------`),n.tier&&console.log(`Tier: ${n.tier}`),n.status&&console.log(`Status: ${n.status}`),n.currentPeriodEnd&&console.log(`Current period end: ${new Date(n.currentPeriodEnd).toLocaleString()}`),n.cancelAtPeriodEnd!==void 0&&console.log(`Cancel at period end: ${n.cancelAtPeriodEnd?`yes`:`no`}`)}async function Yr(e){await i();let t=g(await m({tier:e.tier,interval:`month`}));(t.status!==200||!t.data?.url)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Checkout URL: ${t.data.url}`),console.log(`
55
+ Open this in your browser to complete payment.`)}async function Xr(){await i();let e=g(await c({}));(e.status!==200||!e.data?.url)&&(console.error(`Error: ${e.error??`HTTP ${e.status}`}`),process.exit(1)),console.log(`Portal URL: ${e.data.url}`),console.log(`
56
+ Open this in your browser to manage your subscription.`)}function Zr(e){let t=e.command(`billing`).description(`Manage subscription and billing`);t.command(`subscription`).description(`Show current subscription details`).option(`--json`,`Output as JSON`).action(async e=>{await Jr({json:e.json})}),t.command(`checkout`).description(`Create a Stripe checkout session for a new subscription`).requiredOption(`--tier <tier>`,`Subscription tier (e.g. pro)`).action(async e=>{await Yr({tier:e.tier})}),t.command(`portal`).description(`Create a Stripe customer portal session`).action(async()=>{await Xr()})}function Qr(e){let t=e.command(`config`).description(`Manage anyt configuration`);t.command(`show`).description(`Show resolved configuration`).action(async()=>{await yn()}),t.command(`init`).description(`Create a .anytrc file in the current directory`).option(`--registry <url>`,`Registry URL override`).action(async e=>{await vn({registry:e.registry})}),t.command(`set-encryption-key <scope> <passphrase>`).description(`Set encryption key for a scope (e.g., anyt config set-encryption-key @user/alice my-secret)`).action(async(e,t)=>{let{setEncryptionKey:n}=await import(`./config-BBDgQnzq.js`);await n(e,t),console.log(`Encryption key set for scope "${e}"`)}),t.command(`remove-encryption-key <scope>`).description(`Remove encryption key for a scope`).action(async e=>{let{removeEncryptionKey:t}=await import(`./config-BBDgQnzq.js`);await t(e),console.log(`Encryption key removed for scope "${e}"`)}),t.command(`get-encryption-key <scope>`).description(`Check if an encryption key is set for a scope`).action(async e=>{let{getEncryptionKey:t}=await import(`./config-BBDgQnzq.js`),n=await t(e);if(n){let t=`${n.substring(0,4)}***`;console.log(`Encryption key for "${e}": ${t} (set)`)}else console.log(`No encryption key set for "${e}"`)})}async function $r(t){await i();let n=g(await e({name:t.name,email:t.email,message:t.message}));n.status!==200&&n.status!==201&&(console.error(`Error: ${n.error??`HTTP ${n.status}`}`),process.exit(1)),console.log(`Contact message submitted.`)}async function ei(e){await i();let t=g(await le({page:e.page,limit:e.limit,unreadOnly:e.unreadOnly?`true`:void 0}));if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data,r=n.messages??[];if(r.length===0){console.log(`No messages.`);return}console.log(`\n${``.padEnd(2)} ${`From`.padEnd(28)} ${`Email`.padEnd(28)} ${`Created`.padEnd(12)} ID`),console.log(`-`.repeat(110));for(let e of r){let t=e.isRead?` `:`•`,n=e.createdAt?new Date(e.createdAt).toLocaleDateString():`-`;console.log(`${t.padEnd(2)} ${e.name.slice(0,26).padEnd(28)} ${e.email.slice(0,26).padEnd(28)} ${n.padEnd(12)} ${e.id}`)}console.log(`\n${r.length} of ${n.total??r.length} message(s) (• = unread)`)}async function ti(e){await i();let t=g(await te(e));t.status!==200&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Marked message ${e} as read`)}async function ni(e){await i();let t=g(await ne(e));t.status!==200&&t.status!==204&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Deleted message ${e}`)}function ri(e){let t=e.command(`contact`).description(`Submit + (admin) review contact-form messages`);t.command(`submit`).description(`Submit a contact message (public — no auth required)`).requiredOption(`--name <name>`,`Your name`).requiredOption(`--email <email>`,`Your email`).requiredOption(`--message <text>`,`Message body`).action(async e=>{await $r({name:e.name,email:e.email,message:e.message})});let n=t.command(`messages`).description(`Admin-only message review`);n.command(`list`).description(`List submitted contact messages`).option(`--page <n>`,`Page number (1-indexed)`,Number.parseInt).option(`--limit <n>`,`Page size (1-100)`,Number.parseInt).option(`--unread-only`,`Show only unread messages`).option(`--json`,`Output as JSON`).action(async e=>{await ei({page:e.page,limit:e.limit,unreadOnly:e.unreadOnly,json:e.json})}),n.command(`mark-read <id>`).description(`Mark a message as read`).action(async e=>{await ti(e)}),n.command(`delete <id>`).description(`Delete a message`).action(async e=>{await ni(e)})}async function ii(e){await i();let t=g(await s());if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;console.log(`
57
+ Credit balance`),console.log(`--------------`),n.total!==void 0&&console.log(`Total: ${n.total}`),n.monthly!==void 0&&console.log(`Monthly: ${n.monthly}`),n.purchased!==void 0&&console.log(`Purchased: ${n.purchased}`),n.promotional!==void 0&&console.log(`Promotional: ${n.promotional}`)}async function ai(e){await i();let t=g(await ae(e.limit?{limit:e.limit}:void 0));if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data.entries??t.data;if(!Array.isArray(n)||n.length===0){console.log(`No credit history yet.`);return}console.log(JSON.stringify(n,null,2))}async function oi(e){await i();let t=g(await se());(t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(JSON.stringify(t.data,null,2))}function si(e){let t=e.command(`credit`).description(`View credit balance, history, and usage`);t.command(`balance`).description(`Show current credit balance`).option(`--json`,`Output as JSON`).action(async e=>{await ii({json:e.json})}),t.command(`history`).description(`Show credit ledger history`).option(`--limit <n>`,`Maximum entries to return`,Number.parseInt).option(`--json`,`Output as JSON`).action(async e=>{await ai({limit:e.limit,json:e.json})}),t.command(`usage`).description(`Show credit usage breakdown`).option(`--json`,`Output as JSON`).action(async e=>{await oi({json:e.json})})}async function ci(e){await i();let t=g(await ue());if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;if(n.length===0){console.log(`No folders.`);return}console.log(`\n${`Name`.padEnd(28)} ${`Parent`.padEnd(36)} ID`),console.log(`-`.repeat(96));for(let e of n)console.log(`${e.name.slice(0,26).padEnd(28)} ${(e.parentId??`-`).padEnd(36)} ${e.id}`);console.log(`\n${n.length} folder(s)`)}async function li(e){await i();let t=g(await a({name:e.name,parentId:e.parentId}));(t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Created folder "${t.data.name}" (${t.data.id})`)}async function ui(e){await i();let t=g(await Ie({id:e.id,name:e.name,parentId:e.parentId}));t.status!==200&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Updated folder ${e.id}`)}async function di(e){await i();let t=g(await n({id:e}));t.status!==200&&t.status!==204&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Deleted folder ${e}`)}async function fi(e){await i();let t=g(await ce(e.folderId?{folderId:e.folderId}:void 0));if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;if(n.length===0){console.log(`No files.`);return}console.log(`\n${`Name`.padEnd(32)} ${`Size`.padEnd(12)} ${`Type`.padEnd(20)} ${`Status`.padEnd(10)} ID`),console.log(`-`.repeat(110));for(let e of n){let t=e.sizeBytes===void 0?`-`:`${(e.sizeBytes/1024).toFixed(1)} KB`;console.log(`${e.name.slice(0,30).padEnd(32)} ${t.padEnd(12)} ${(e.contentType??`-`).slice(0,18).padEnd(20)} ${(e.status??`-`).padEnd(10)} ${e.id}`)}console.log(`\n${n.length} file(s)`)}async function pi(e){await i();let t=g(await ze({id:e}));t.status!==200&&t.status!==204&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Deleted file ${e}`)}async function mi(e,t){await i();let n=kt(e),r=Tt(n),a=M(n),o=t.contentType??`application/octet-stream`,s=g(await Me({name:a,size:r.size,mimeType:o,folderId:t.folderId}));(s.status!==200||!s.data)&&(console.error(`Error initializing upload: ${s.error??`HTTP ${s.status}`}`),process.exit(1)),console.log(`Uploading ${a} (${(r.size/1024).toFixed(1)} KB)...`);let c=await fetch(s.data.uploadUrl,{method:`PUT`,headers:{"Content-Type":o,"Content-Length":String(r.size)},body:Ct(n),duplex:`half`});c.ok||(console.error(`Error: storage PUT failed (HTTP ${c.status})`),process.exit(1));let l=g(await f({fileId:s.data.fileId}));l.status!==200&&(console.error(`Error confirming upload: ${l.error??`HTTP ${l.status}`}`),process.exit(1)),console.log(`Uploaded ${a} (id: ${s.data.fileId})`)}async function hi(e,t){await i();let n=g(await o(e));(n.status!==200||!n.data)&&(console.error(`Error: ${n.error??`HTTP ${n.status}`}`),process.exit(1));let r=await fetch(n.data.downloadUrl);r.ok||(console.error(`Error: storage GET failed (HTTP ${r.status})`),process.exit(1));let a=Buffer.from(await r.arrayBuffer()),s=t.output??n.data.name??e;await L(s,a),console.log(`Downloaded -> ${s}`)}async function gi(e){await i();let t=await v(),n=(await y()).replace(/\/api\/skills\/?$/,``),r=await fetch(`${n}/api/drive/storage`,{headers:{Authorization:`Bearer ${t}`}});r.ok||(console.error(`Error: HTTP ${r.status}`),process.exit(1));let a=await r.json();if(e.json){console.log(JSON.stringify(a,null,2));return}let o=a.usedBytes??0,s=a.quotaBytes??0;console.log(`
58
+ Drive storage`),console.log(`--------------`),console.log(`Used: ${(o/1024/1024).toFixed(2)} MB`),console.log(`Quota: ${(s/1024/1024).toFixed(2)} MB`),s>0&&console.log(`(${(o/s*100).toFixed(1)}% used)`)}function _i(e){let t=e.command(`drive`).description(`Manage AI Drive folders, files, and storage`),n=t.command(`folders`).description(`Manage drive folders`);n.command(`list`).description(`List folders`).option(`--json`,`Output as JSON`).action(async e=>{await ci({json:e.json})}),n.command(`create`).description(`Create a folder`).requiredOption(`--name <name>`,`Folder name`).option(`--parent-id <id>`,`Parent folder ID`).action(async e=>{await li({name:e.name,parentId:e.parentId})}),n.command(`update <id>`).description(`Update a folder`).option(`--name <name>`,`New name`).option(`--parent-id <id>`,`New parent ID`).action(async(e,t)=>{await ui({id:e,name:t.name,parentId:t.parentId})}),n.command(`delete <id>`).description(`Delete a folder`).action(async e=>{await di(e)});let r=t.command(`files`).description(`Manage drive files`);r.command(`list`).description(`List files`).option(`--folder-id <id>`,`Filter by folder`).option(`--json`,`Output as JSON`).action(async e=>{await fi({folderId:e.folderId,json:e.json})}),r.command(`delete <id>`).description(`Delete a file`).action(async e=>{await pi(e)}),t.command(`upload <file>`).description(`Upload a file to drive`).option(`--folder-id <id>`,`Destination folder`).option(`--content-type <type>`,`MIME type`,`application/octet-stream`).action(async(e,t)=>{await mi(e,{folderId:t.folderId,contentType:t.contentType})}),t.command(`download <fileId>`).description(`Download a file by ID`).option(`-o, --output <path>`,`Output path (default: original filename)`).action(async(e,t)=>{await hi(e,{output:t.output})}),t.command(`storage`).description(`Show storage usage and quota`).option(`--json`,`Output as JSON`).action(async e=>{await gi({json:e.json})})}async function vi(e){await i();let t=await Ee();if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;if(n.length===0){console.log(`No favorites yet. Add one with: anyt favorites add <skillId>`);return}console.log(`\n${`Skill`.padEnd(48)} ID`),console.log(`-`.repeat(96));for(let e of n){let t=e.ownerName?`@${e.ownerName}`:``,n=`${e.namespace??`?`}${t}/${e.name??`?`}`;console.log(`${n.slice(0,46).padEnd(48)} ${e.skillId}`)}console.log(`\n${n.length} favorite(s)`)}async function yi(e){await i();let t=await _e(e);t.status!==200&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Favorited ${e}`)}async function bi(e){await i();let t=await ye(e);t.status!==200&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(`Removed ${e} from favorites`)}async function xi(e){await i();let t=await je({skillIds:e.skillIds});if((t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),e.json){console.log(JSON.stringify(t.data,null,2));return}let n=t.data;for(let[e,t]of Object.entries(n))console.log(`${t?`★`:` `} ${e}`)}function Si(e){let t=e.command(`favorites`).description(`Manage favorited skills`);t.command(`list`).description(`List your favorite skills`).option(`--json`,`Output as JSON`).action(async e=>{await vi({json:e.json})}),t.command(`add <skillId>`).description(`Add a skill to favorites`).action(async e=>{await yi(e)}),t.command(`remove <skillId>`).description(`Remove a skill from favorites`).action(async e=>{await bi(e)}),t.command(`batch-check <skillIds...>`).description(`Check whether each skillId is favorited`).option(`--json`,`Output as JSON`).action(async(e,t)=>{await xi({skillIds:e,json:t.json})})}async function Ci(e){await i();let t=g(await Fe({brainSessionId:e.brainSessionId,brainTurnId:e.brainTurnId,skillId:e.skillId??null,prompt:e.prompt,size:e.size,quality:e.quality,n:e.n,format:e.format,background:e.background}));(t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(JSON.stringify(t.data,null,2))}async function wi(e){await i();let t=g(await Ae({brainSessionId:e.brainSessionId,brainTurnId:e.brainTurnId,skillId:e.skillId??null,prompt:e.prompt,imageArtifactIds:e.imageArtifactIds,maskArtifactId:e.maskArtifactId,size:e.size,quality:e.quality}));(t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(JSON.stringify(t.data,null,2))}async function Ti(e){await i();let t=g(await me({id:e}));(t.status!==200||!t.data)&&(console.error(`Error: ${t.error??`HTTP ${t.status}`}`),process.exit(1)),console.log(JSON.stringify(t.data,null,2))}function Ei(e){let t=e.command(`image`).description(`Generate or edit images via OpenAI`);t.command(`generate`).description(`Generate an image from a prompt`).requiredOption(`--prompt <text>`,`Image prompt`).requiredOption(`--brain-session-id <id>`,`Brain session ID`).requiredOption(`--brain-turn-id <id>`,`Brain turn ID`).option(`--skill-id <id>`,`Originating skill ID`).option(`--size <size>`,`Image dimensions, e.g. "1024x1024"`).option(`--quality <quality>`,`Quality: low | medium | high | hd | standard`).option(`-n, --count <n>`,`Number of images (1-4)`,Number.parseInt).option(`--format <format>`,`Output format`).option(`--background <background>`,`Background style`).action(async e=>{await Ci({prompt:e.prompt,brainSessionId:e.brainSessionId,brainTurnId:e.brainTurnId,skillId:e.skillId,size:e.size,quality:e.quality,n:e.count,format:e.format,background:e.background})}),t.command(`edit`).description(`Edit one or more images using a prompt`).requiredOption(`--prompt <text>`,`Edit prompt`).requiredOption(`--brain-session-id <id>`,`Brain session ID`).requiredOption(`--brain-turn-id <id>`,`Brain turn ID`).requiredOption(`--image-artifact-ids <ids>`,`Comma-separated artifact IDs of source images (1-8)`).option(`--mask-artifact-id <id>`,`Mask artifact ID`).option(`--skill-id <id>`,`Originating skill ID`).option(`--size <size>`,`Image dimensions`).option(`--quality <quality>`,`Quality`).action(async e=>{let t=String(e.imageArtifactIds).split(`,`).map(e=>e.trim()).filter(Boolean);await wi({prompt:e.prompt,brainSessionId:e.brainSessionId,brainTurnId:e.brainTurnId,imageArtifactIds:t,maskArtifactId:e.maskArtifactId,skillId:e.skillId,size:e.size,quality:e.quality})})}function Di(e){e.command(`job`).description(`Inspect media generation jobs`).command(`get <id>`).description(`Get the status of a media generation job`).action(async e=>{await Ti(e)})}function Oi(e){let t=e.command(`media`).description(`Generate and edit media (images, jobs)`);Ei(t),Di(t)}function ki(e){let t=e.command(`notebook`).description(`Manage AnyT notebooks`);t.command(`upload <file>`).description(`Upload a .anyt notebook`).option(`--org <orgname>`,`Upload to an organization`).option(`--visibility <visibility>`,`Visibility: private, team, or public`,`private`).option(`--description <description>`,`Notebook description`).action(async(e,t)=>{await Kn(e,t)}),t.command(`list`).description(`List notebooks`).option(`--org <orgname>`,`List organization notebooks`).action(async e=>{await qn(e)}),t.command(`download <id>`).description(`Download a notebook by ID`).option(`-o, --output <path>`,`Output file path`).action(async(e,t)=>{await Jn(e,t.output)}),t.command(`delete <id>`).description(`Delete a notebook by ID`).action(async e=>{await Yn(e)})}function Ai(e){let t=e.command(`skill-lists`).description(`Manage skill lists (collections of skills)`);t.command(`list`).description(`List your skill lists`).option(`--org <orgname>`,`List organization skill lists`).option(`--json`,`Output as JSON`).action(async e=>{await Ar({org:e.org,json:e.json})}),t.command(`create <name>`).description(`Create a new skill list`).option(`-d, --description <description>`,`List description`).option(`--visibility <visibility>`,`Visibility: private or public`,`private`).option(`--org <orgname>`,`Create under an organization`).action(async(e,t)=>{await jr(e,{description:t.description,visibility:t.visibility,org:t.org})}),t.command(`show <specifier>`).description(`Show skill list details (e.g. @user/alice/my-tools)`).option(`--json`,`Output as JSON`).action(async(e,t)=>{await Mr(e,{json:t.json})}),t.command(`delete <specifier>`).description(`Delete a skill list`).action(async e=>{await Nr(e)}),t.command(`update <specifier>`).description(`Update skill list metadata`).option(`-d, --description <description>`,`New description`).option(`--visibility <visibility>`,`New visibility: private or public`).action(async(e,t)=>{await Pr(e,{description:t.description,visibility:t.visibility})}),t.command(`add-skill <specifier> <skills...>`).description(`Add skills to a list (e.g. anyt skill-lists add-skill @user/me/my-list @user/alice/tool)`).option(`--note <note>`,`Note for the added skill`).action(async(e,t,n)=>{await Fr(e,t,{note:n.note})}),t.command(`remove-skill <specifier> <skill>`).description(`Remove a skill from a list`).action(async(e,t)=>{await Ir(e,t)}),t.command(`install <specifier>`).description(`Install all skills from a list (e.g. anyt skill-lists install @user/alice/my-tools)`).option(`--agent <agents>`,`Comma-separated agents for symlinks (default: all agents, use "none" to skip)`).option(`--dir <path>`,`Install skills to a specific directory`).option(`-g, --global`,`Install to user home directory instead of project`).option(`-y, --yes`,`Skip agent selection prompt and use defaults`).action(async(e,t)=>{await Lr(e,{agent:t.agent,yes:t.yes,global:t.global,dir:t.dir})})}function ji(e){e.command(`init`).description(`Create a new anyt.json manifest in the current directory`).option(`-n, --name <name>`,`Skill name`).option(`-d, --description <desc>`,`Skill description`).option(`-a, --author <author>`,`Author name`).option(`-y, --yes`,`Skip prompts and use defaults`).option(`-f, --force`,`Overwrite existing anyt.json`).action(async e=>{await An({name:e.name,description:e.description,author:e.author,yes:e.yes,force:e.force})})}function Mi(e){e.command(`add <specifiers...>`).description(`Add skills from registry, GitHub, local paths, or well-known URLs`).option(`--save`,`Save to lockfile (default)`).option(`--agent <agents>`,`Comma-separated agents for symlinks (default: all agents, use "none" to skip)`).option(`-g, --global`,`Install to user home directory instead of project`).option(`-y, --yes`,`Skip agent selection prompt and use defaults`).action(async(e,t)=>{await xt(e,{save:t.save??!0,agent:t.agent,yes:t.yes,global:t.global})})}function Ni(e){e.command(`remove <name>`).alias(`rm`).description(`Remove an installed skill`).action(async e=>{await Sr(e)})}function Pi(e){e.command(`list`).alias(`ls`).description(`List installed skills`).option(`--json`,`Output as JSON`).option(`-g, --global`,`List globally installed skills`).action(async e=>{await In({json:e.json,global:e.global})})}function Fi(e){e.command(`install [specifiers...]`).alias(`i`).description(`Install skills from lockfile, or add and install specific packages`).option(`--frozen-lockfile`,`Fail if lockfile is missing or outdated`).option(`--dir <path>`,`Install skills to a specific directory`).option(`--agent <agents>`,`Comma-separated agents for symlinks (default: all agents, use "none" to skip)`).option(`--list <specifier>`,`Install all skills from a skill list (e.g. @user/username/list-name)`).option(`-g, --global`,`Install to user home directory instead of project`).option(`-y, --yes`,`Skip agent selection prompt and use defaults`).action(async(e,t)=>{await St(e,{frozenLockfile:t.frozenLockfile,dir:t.dir,agent:t.agent,list:t.list,yes:t.yes,global:t.global})})}function Ii(e){e.command(`link`).description(`Recreate agent symlinks without reinstalling`).option(`--agent <agents>`,`Comma-separated agents for symlinks (default: all agents, use "none" to skip)`).option(`-g, --global`,`Recreate global agent symlinks`).option(`-y, --yes`,`Skip agent selection prompt and use defaults`).action(async e=>{await jn({agent:e.agent,yes:e.yes,global:e.global})})}function Li(e){e.command(`update`).description(`Update all skills to latest compatible versions`).option(`--dry-run`,`Show what would be updated without making changes`).action(async e=>{await zr({dryRun:e.dryRun})})}function Ri(e){e.command(`search [query]`).alias(`find`).description(`Search and discover skills from the registry`).option(`-s, --sort <sort>`,`Sort by: downloads, recent, name (default: downloads)`).option(`-l, --limit <n>`,`Maximum results (default: 20)`,Number.parseInt).option(`--json`,`Output as JSON`).action(async(e,t)=>{await Er(e,{sort:t.sort,limit:t.limit,json:t.json})})}function zi(e){e.command(`audit`).description(`Verify integrity of installed skills and check for issues`).option(`--json`,`Output as JSON`).action(async e=>{await _n({json:e.json})})}function Bi(e){e.command(`outdated [packages...]`).description(`Check for outdated skills`).option(`--json`,`Output as JSON`).option(`--all`,`Include up-to-date packages`).action(async(e,t)=>{await or(e,{json:t.json,all:t.all})})}function Vi(e){e.command(`version <bump>`).description(`Bump package version (major, minor, patch)`).option(`--dry-run`,`Show what would be changed without writing`).action(async(e,t)=>{[`major`,`minor`,`patch`].includes(e)||(console.error(`Error: Invalid version bump "${e}".`),console.error(`Must be one of: major, minor, patch`),process.exit(1)),await Gr(e,{dryRun:t.dryRun})})}function Hi(e){e.command(`publish`).description(`Publish current directory as a skill`).option(`--bump <level>`,`Bump version (major, minor, patch)`).option(`--tag <tag>`,`Tag for the release`).option(`--org <orgname>`,`Publish under an organization namespace`).requiredOption(`--access <level>`,`Set package visibility (public, private, or team)`).action(async e=>{let t=e.access;t!==`public`&&t!==`private`&&t!==`team`&&(console.error(`Error: --access must be "public", "private", or "team"`),process.exit(1)),t===`team`&&!e.org&&(console.error(`Error: --access team requires --org <orgname>`),process.exit(1)),await xr({bump:e.bump,tag:e.tag,access:t,org:e.org})})}function Ui(e){e.command(`unpublish <specifier>`).description(`Remove a published skill version (only within 72 hours of publishing)`).option(`--force`,`Confirm destructive action`).action(async(e,t)=>{await Rr(e,{force:t.force})})}function Wi(e){e.command(`access [specifier]`).description(`Change package visibility (public/private)`).option(`--public`,`Make the package public (irreversible)`).option(`--private`,`Make the package private (only for private packages)`).action(async(e,t)=>{await dn(e,{public:t.public,private:t.private})})}function Gi(e){e.command(`deprecate <specifier> [message]`).description(`Mark a skill version as deprecated (alternative to unpublish after 72 hours)`).option(`--undo`,`Remove deprecation status`).action(async(e,t,n)=>{await bn(e,t,{undo:n.undo})})}function Ki(e){let t=e.command(`skills`).description(`Manage prompt skills (init, add, install, publish, search, ...)`);ji(t),Mi(t),Ni(t),Pi(t),Fi(t),Ii(t),Li(t),Ri(t),zi(t),Bi(t),Vi(t),Hi(t),Ui(t),Wi(t),Gi(t)}const qi=N(It(),`.anyt`),Ji=N(qi,`update-check.json`);async function Yi(e){if(!process.env.ANYT_NO_UPDATE_CHECK)try{let t=await Xi();if(t&&Date.now()-t.lastCheck<864e5){tt(t.latestVersion,e)&&$i(e,t.latestVersion);return}Qi(e)}catch{}}async function Xi(){try{let e=await F(Ji,`utf-8`);return JSON.parse(e)}catch{return null}}async function Zi(e){await Nt(qi,{recursive:!0}),await L(Ji,JSON.stringify(e))}function Qi(e){try{let t=V(`npm view anyt-cli version`,{encoding:`utf-8`,timeout:5e3,stdio:[`pipe`,`pipe`,`pipe`]}).trim();if(!t)return;Zi({lastCheck:Date.now(),latestVersion:t}).catch(()=>{}),tt(t,e)&&$i(e,t)}catch{}}function $i(e,t){console.warn(`\n Update available: ${e} → ${t}
59
+ Run \`anyt upgrade\` to update
60
+ `)}const ea=Dt(At(import.meta.url)),ta=JSON.parse(wt(N(ea,`..`,`package.json`),`utf-8`)).version,$=new jt;$.name(`anyt`).description(`Unified CLI for the anyt.io v1 API`).version(ta),$.command(`upgrade`).description(`Upgrade anyt to the latest version`).action(async()=>{await Br()}),qr($),Qr($),Ki($),Ai($),ki($),rn($),si($),Zr($),_i($),Qt($),ln($),Si($),Oi($),Kt($),ri($);try{await $.parseAsync(),$.args[0]!==`upgrade`&&await Yi(ta)}catch(e){if(e instanceof Be)console.error(`Error: ${e.message}`),process.exitCode=e.exitCode;else throw e}export{};
@@ -0,0 +1,3 @@
1
+ import{S as e,s as t,y as n}from"./api-client-AcwLRhZ3.js";import{T as r,_ as i,c as a,i as o,m as s,s as c,u as l,w as u}from"./config-D5S7I3VP.js";import{$ as d,A as f,C as p,H as m,J as h,L as g,M as _,R as v,S as y,X as b,a as x,at as S,b as C,c as w,et as T,g as E,k as D,lt as O,n as k,t as A,u as j,w as M,x as N,y as P}from"./symlinks-BoGYQyAH.js";import{join as F}from"node:path";import{mkdir as I,readFile as L,rm as R,writeFile as z}from"node:fs/promises";import{homedir as B}from"node:os";import{createHash as V}from"node:crypto";function H(e,t){let n=t.match(/^sha256-(.+)$/);if(!n)throw Error(`Invalid integrity format: ${t}`);let r=n[1];return F(e,`sha256-${Buffer.from(r,`base64`).toString(`hex`)}.tgz`)}async function U(e,t){try{let n=H(e,t),r=await L(n);return`sha256-${V(`sha256`).update(r).digest(`base64`)}`===t?r:(await R(n,{force:!0}),null)}catch{return null}}async function W(e,t,n){try{await I(e,{recursive:!0}),await z(H(e,t),n)}catch{}}async function G(e,t,n,r,i,a){let o=Object.keys(e).length;console.log(`\nInstalling ${o} registry skill(s)...\n`);let s=T(e).filter(t=>e[t]).map(t=>[t,e[t]]);for(let[e,o]of s)await K(e,o,t,n,r,i,a)}async function K(e,t,n,r,i,a,o){let s=b(e);if(!s){console.warn(`Warning: Invalid skill name in lockfile: ${e}`);return}let{namespace:c,owner:l,name:u,subname:d}=s;console.log(`Installing ${e}@${t.version}...`);let f,p=!1,m=await U(i,t.integrity);if(m)f=m,p=!0;else{let n=await q(e,t,r,o);if(!n)return;f=n,await W(i,t.integrity,f)}if(t.encryption){let n=await J(e,f,t.encryption);if(!n)return;f=n}let h=d??u,g=Y(c,l,u,d,h,a);await X(g,f),console.log(` Installed to ${g}${p?` (from cache)`:``}`);let _=c===`github`&&d?`${u}/${d}`:u;n.push({name:h,sourcePath:x(c,l,_)})}async function q(e,t,n,r){let i=t.resolved.includes(`.r2.cloudflarestorage.com`)||t.resolved.includes(`X-Amz-Signature`),a={};!i&&n&&(a.Authorization=`Bearer ${n}`);let o=await fetch(t.resolved,{headers:a,redirect:`follow`});if(!o.ok)return o.status===401?console.error(n?` Error: Access denied to ${e}. You may not have permission to access this private package.`:` Error: ${e} requires authentication. Run 'anyt login' first.`):console.error(` Error: Failed to download ${e} (${o.status})`),null;let s=Buffer.from(await o.arrayBuffer());return`sha256-${V(`sha256`).update(s).digest(`base64`)}`===t.integrity?s:(console.error(` Error: Checksum verification failed for ${e}`),r&&process.exit(1),null)}async function J(e,t,n){let r=n.scope,i=await s(r);if(!i)return console.error(` Error: Package ${e} is encrypted. Set the key: anyt config set-encryption-key ${r} <passphrase>`),null;try{return O(t,i,n)}catch{return console.error(` Error: Failed to decrypt ${e}. Wrong encryption key for scope "${r}".`),null}}function Y(e,t,n,r,i,a){return e===`org`?F(a,`_org`,t,i):e===`github`&&r?F(a,`_github-registry`,t,n,r):F(a,t,i)}async function X(e,t){await R(e,{recursive:!0,force:!0}),await I(e,{recursive:!0});let n=F(e,`.temp.tgz`);await z(n,t);let{exec:r}=await import(`node:child_process`),{promisify:i}=await import(`node:util`),a=i(r);try{await a(`tar -xzf "${n}" -C "${e}" --strip-components=1`)}finally{await R(n,{force:!0})}}async function Z(e,t,n,r,i){let a=Object.keys(e).length;console.log(`\nInstalling ${a} GitHub skill(s)...\n`);for(let[a,o]of Object.entries(e))await Q(a,o,t,n,r,i)}async function Q(e,t,n,r,i,a){let o=h(e);if(!o){console.warn(`Warning: Invalid GitHub specifier in lockfile: ${e}`);return}console.log(`Installing ${e} (${t.gitRef}@${t.gitCommit.slice(0,7)})...`);let s,c=!1,l=await U(r,t.integrity);if(l)s=l,c=!0;else try{let n=await y({...o,ref:t.gitCommit});if(s=n.buffer,n.integrity!==t.integrity){console.error(` Error: Checksum verification failed for ${e}`),a&&process.exit(1);return}await W(r,t.integrity,s)}catch(t){$(e,t);return}try{let e=await p(o,s,i);console.log(` Installed to ${e}${c?` (from cache)`:``}`);let t=m(o);n.push({name:t,sourcePath:k(o.owner,o.repo,o.path)})}catch(t){let n=t instanceof Error?t.message:String(t);console.error(` Error extracting ${e}: ${n}`)}}function $(e,t){if(t instanceof N)console.error(` Error: ${t.message}`);else if(t instanceof C)console.error(` Error: ${t.message}`);else if(t instanceof P)console.error(` Error: ${t.message}`);else{let n=t instanceof Error?t.message:String(t);console.error(` Error downloading ${e}: ${n}`)}}async function ee(e,n){if(e.length!==0){if(n.frozenLockfile){console.error(`Error: Dependencies in anyt.json are not in lockfile. Cannot install with --frozen-lockfile`),console.error(`Missing dependencies:`);for(let t of e)console.error(` - ${t.fullName}@${t.versionRange}`);process.exit(1)}console.log(`Resolving ${e.length} new dependency(ies)...\n`),t({registryUrl:n.registryUrl,apiKey:n.apiKey});for(let{fullName:t,versionRange:r}of e)await te(t,r,n)}}async function te(t,r,i){let a=b(t);if(!a){console.error(`Error: Invalid dependency specifier: ${t}`);return}let{owner:o,name:s}=a;console.log(`Resolving ${t}@${r}...`);let c=await e(o,s);if(c.status!==200||!c.data){let e=u(c,`Skill ${t} not found`);console.error(`Error: ${e}`);return}let l=c.data;if(l.length===0){console.error(`Error: Skill ${t} not found`);return}let f=l.map(e=>e.version),p=d(r||`*`,f);if(!p){console.error(`Error: No version matching "${r}" for ${t}`);return}let m=await n(o,s,p);if(m.status!==200||!m.data){let e=u(m,`Version ${p} not found`);console.error(`Error: ${e}`);return}let h=m.data,g=h.downloadUrl.includes(`.r2.cloudflarestorage.com`)||h.downloadUrl.includes(`X-Amz-Signature`),_={};!g&&i.apiKey&&(_.Authorization=`Bearer ${i.apiKey}`);let v=await fetch(h.downloadUrl,{headers:_,redirect:`follow`});if(!v.ok){console.error(`Error: Failed to download tarball for ${t} (${v.status})`);return}let y=Buffer.from(await v.arrayBuffer()),x=S(y),C={version:p,resolved:h.downloadUrl,integrity:x};h.manifest?.encryption&&(C.encryption=h.manifest.encryption),await j(t,C),await W(i.cacheDir,x,y),console.log(` Resolved ${t}@${p}`)}async function ne(e,t){if(e.length!==0){if(t.frozenLockfile){console.error(`Error: GitHub dependencies in anyt.json are not in lockfile. Cannot install with --frozen-lockfile`),console.error(`Missing GitHub dependencies:`);for(let t of e)console.error(` - ${t.specifier}@${t.ref}`);process.exit(1)}console.log(`\nResolving ${e.length} GitHub dependency(ies)...\n`);for(let{specifier:n,ref:r}of e)await re(n,r,t)}}async function re(e,t,n){let r=h(e);if(!r){console.error(`Error: Invalid GitHub specifier: ${e}`);return}r.ref=r.ref||t,console.log(`Resolving ${M(r)}...`);try{let i=await y(r);await p(r,i.buffer,n.skillsDir),await w(e,{version:i.commit.slice(0,7),resolved:`https://github.com/${r.owner}/${r.repo}`,integrity:i.integrity,gitCommit:i.commit,gitRef:t||`HEAD`}),await W(n.cacheDir,i.integrity,i.buffer),console.log(` Resolved ${e} (${t}@${i.commit.slice(0,7)})`)}catch(t){if(t instanceof N)console.error(`Error: ${t.message}`);else if(t instanceof C)console.error(`Error: ${t.message}`);else if(t instanceof P)console.error(`Error: ${t.message}`);else{let n=t instanceof Error?t.message:String(t);console.error(`Error resolving ${e}: ${n}`)}}}async function ie(e,t){if(t.global){let{setGlobalMode:e}=await import(`./config-BBDgQnzq.js`);e(!0)}if(t.list){let n=await ae(t.list);if(n.length===0){console.log(`No skills in the list to install.`);return}let r=[...e,...n],{add:i}=await import(`./add-CUTmwUhU.js`);await i(r,{save:!0,agent:t.agent,yes:t.yes,global:t.global});return}if(e.length>0){let{add:n}=await import(`./add-CUTmwUhU.js`);await n(e,{save:!0,agent:t.agent,yes:t.yes,global:t.global});return}await oe(t)}async function ae(e){let n=e.match(/^@(user|org)\/([^/]+)\/([^/]+)$/);n||r(`Invalid list specifier "${e}". Use format: @user/{username}/{list-name} or @org/{orgname}/{list-name}`);let[,a,o,s]=n,c=await l();t({registryUrl:c.registryUrl,apiKey:i(c,c.registryUrl)}),console.log(`Fetching skill list @${a}/${o}/${s}...\n`);let{fetchSkillList:u}=await import(`./api-client-Csx9R9k6.js`),d=await u(a,o,s);(d.status!==200||!d.data)&&r(d.status===404?`List "@${a}/${o}/${s}" not found or is private.`:d.error||`Failed to fetch list`);let f=d.data;console.log(`List: ${f.name}${f.description?` — ${f.description}`:``}`),console.log(`Skills: ${f.items.length}\n`);let p=[];for(let e of f.items){let t=`@${e.namespace===`org`?`org`:`user`}/${e.ownerName}/${e.skillName}`;e.pinnedVersion&&(t+=`@${e.pinnedVersion}`),p.push(t)}return p}async function oe(e){try{let t=await l(),n=t.registryUrl,r=i(t,n),s=e.dir||c(),u=o(),d=await E(),p=await D(),m=await f(),h=d?.packages??d?.skills??{},y=d?.githubPackages??{},b=[],x=[];for(let[e,t]of Object.entries(p))h[e]||x.push({fullName:e,versionRange:t});let S={registryUrl:n,apiKey:r,cacheDir:u,skillsDir:s,frozenLockfile:e.frozenLockfile};x.length>0&&(await ee(x,S),d=await E());let C=[];for(let[e,t]of Object.entries(m))y[e]||C.push({specifier:e,ref:t});C.length>0&&(await ne(C,S),d=await E());let w=await _(),T=w?.agents,O;e.agent?O=g(e.agent):w||e.yes?O=g(void 0):(console.log(`
2
+ No anyt.json found. Let's set up your project.
3
+ `),O=await v(),console.log());let k=d?.packages??d?.skills??{},j=Object.keys(k).length;j>0&&await G(k,b,r,u,s,e.frozenLockfile);let M=d?.githubPackages??{},N=Object.keys(M).length;if(N>0&&await Z(M,b,u,s,e.frozenLockfile),b.length>0&&O[0]!==`none`){let e=a();console.log(`\nCreating symlinks for agent(s): ${O.join(`, `)}${e?` (global)`:``}...`),await A(b,{agents:O,projectRoot:e?B():process.cwd(),agentConfigs:T,global:e}),console.log(` Symlinks created.`)}let P=j+N;console.log(P===0?`No skills to install.`:`\nAll ${P} skill(s) installed.`)}catch(e){r(e instanceof Error?e.message:`Unknown error`)}}export{ie as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./install-D2YOi6ip.js";export{e as install};
@@ -0,0 +1,5 @@
1
+ import{S as e,_ as t,b as n,s as r,v as i,x as a,y as o}from"./api-client-AcwLRhZ3.js";import{c as s,g as c,o as l}from"./config-D5S7I3VP.js";import{dirname as u,join as d,relative as f}from"node:path";import{cp as ee,lstat as p,mkdir as m,readFile as h,readdir as g,readlink as te,rm as _,symlink as v,writeFile as y}from"node:fs/promises";import{homedir as ne}from"node:os";import{createCipheriv as re,createDecipheriv as ie,createHash as ae,randomBytes as b,scryptSync as oe}from"node:crypto";import se from"ignore";import*as x from"semver";import{checkbox as ce}from"@inquirer/prompts";const S=`aes-256-gcm`;function C(e,t){return oe(e,t,32,{N:16384,r:8,p:1})}function le(e,t,n){let r=b(32),i=b(16),a=re(S,C(t,r),i,{authTagLength:16}),o=Buffer.concat([a.update(e),a.final()]),s=a.getAuthTag();return{encrypted:o,metadata:{algorithm:S,kdf:`scrypt`,salt:r.toString(`hex`),iv:i.toString(`hex`),authTag:s.toString(`hex`),scope:n}}}function ue(e,t,n){let r=Buffer.from(n.salt,`hex`),i=Buffer.from(n.iv,`hex`),a=Buffer.from(n.authTag,`hex`),o=ie(S,C(t,r),i,{authTagLength:16});return o.setAuthTag(a),Buffer.concat([o.update(e),o.final()])}const w=[`node_modules`,`.git`,`.anyt-publish`];async function de(e=process.cwd()){let t=se();t.add(w);let n=d(e,`.anytignore`);try{let e=T(await h(n,`utf-8`));return t.add(e),{ig:t,source:`.anytignore`,patterns:e}}catch{}let r=d(e,`.gitignore`);try{let e=T(await h(r,`utf-8`));return t.add(e),{ig:t,source:`.gitignore`,patterns:e}}catch{}return{ig:t,source:null,patterns:[]}}function fe(e){return[...new Set([...w,...e])].map(e=>`--exclude='${e}'`).join(` `)}function T(e){return e.split(`
2
+ `).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`#`))}function E(e){return`sha256-${ae(`sha256`).update(e).digest(`base64`)}`}const pe=[`SKILL.md`,`runtime`,`scripts`,`data`],me=`https://anyt.io/schema/v1/anyt.json`;function he(e){if(!e.name)return{valid:!1,error:`Manifest must have a 'name' field`};if(!e.version)return{valid:!1,error:`Manifest must have a 'version' field`};let t=e.name.split(`/`),n=t[t.length-1];return/^[a-z][a-z0-9_-]*$/.test(n)?/^\d+\.\d+\.\d+/.test(e.version)?{valid:!0}:{valid:!1,error:`Version must be a valid semantic version (e.g., 1.0.0)`}:{valid:!1,error:`Name must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, and underscores`}}const ge=/^@(user|org|github)\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9._-]+)(?:\/([a-z][a-z0-9-]*))?(?:@(.+))?$/;function D(e){let t=e.match(ge);if(!t)return null;let n=t[1],r=t[2],i=t[3],a=t[4],o=t[5];return!r||!i||n===`github`&&!a||n!==`github`&&a?null:{namespace:n,owner:r,name:i,subname:a||void 0,versionRange:o||void 0}}async function O(t){if(t.namespace===`github`&&t.subname){let e=await n(t.owner,t.name,t.subname);return e.status===200?e.data:void 0}if(t.namespace===`org`){let e=await a(t.owner,t.name);return e.status===200?e.data:void 0}let r=await e(t.owner,t.name);return r.status===200?r.data:void 0}async function k(e,n){if(e.namespace===`github`&&e.subname){let r=await t(e.owner,e.name,e.subname,n);return r.status===200&&r.data?r.data:null}if(e.namespace===`org`){let t=await i(e.owner,e.name,n);return t.status===200&&t.data?t.data:null}let r=await o(e.owner,e.name,n);return r.status===200&&r.data?r.data:null}function _e(e){let t=new Map,n=new Map;for(let r of e.nodes.keys())t.set(r,0),n.set(r,[]);for(let[r,i]of e.nodes.entries())for(let a of Object.keys(i.dependencies))e.nodes.has(a)&&(t.set(r,(t.get(r)??0)+1),n.has(a)||n.set(a,[]),n.get(a)?.push(r));let r=[];for(let[e,n]of t.entries())n===0&&r.push(e);let i=[];for(;r.length>0;){let e=r.shift();if(!e)continue;i.push(e);let a=n.get(e)??[];for(let e of a){let n=(t.get(e)??1)-1;t.set(e,n),n===0&&!i.includes(e)&&r.push(e)}}return i}function A(e){let t=new Set,n=[];function r(i){if(t.has(i))return;t.add(i);let a=e[i];if(a?.dependencies)for(let e of Object.keys(a.dependencies))r(e);n.push(i)}for(let t of Object.keys(e))r(t);return n}function j(e){return e.map(e=>{switch(e.type){case`circular_dependency`:return`Circular dependency: ${e.path?.join(` -> `)??e.package}`;case`max_depth_exceeded`:return`Max depth exceeded at: ${e.path?.join(` -> `)??e.package}`;case`no_satisfying_version`:return e.message;case`package_not_found`:return`Package not found: ${e.package}`;case`fetch_error`:return e.message;default:return e.message}})}function M(e){return e.map(e=>{let t=e.ranges.map(e=>`${e.dependent} needs ${e.range}`).join(`, `);return`No version of ${e.package} satisfies: ${t}`})}function N(e,t=[]){if(e.length>0){console.error(`
3
+ Resolution errors:`);for(let t of j(e))console.error(` - ${t}`)}if(t.length>0){console.error(`
4
+ Version conflicts:`);for(let e of M(t))console.error(` - ${e}`)}}function P(e,t){let n=t.filter(e=>x.valid(e)).sort((e,t)=>x.rcompare(e,t));return!e||e===`latest`||e===`*`?n[0]??null:x.maxSatisfying(n,e)}function F(e,t){return x.gt(e,t)}function I(e,t){let n=t.filter(e=>x.valid(e)).sort((e,t)=>x.rcompare(e,t));if(n.length===0)return null;let r=e.map(e=>!e||e===`latest`||e===`*`?`*`:e);for(let e of n)if(r.every(t=>x.satisfies(e,t)))return e;return null}function ve(e,t,n,r,i,a){let o=r.manifest;return{name:e,version:t,versionRange:n,downloadUrl:r.downloadUrl,integrity:`sha256-${Buffer.from(r.checksum,`hex`).toString(`base64`)}`,depth:i,dependencies:o?.dependencies??{},dependents:[a],isDirect:i===0,deprecated:r.deprecationMessage??void 0}}async function ye(e,t){let n={nodes:new Map,roots:Object.keys(e),errors:[],conflicts:[]};r({registryUrl:t.registryUrl,apiKey:t.apiKey});let i=new Map,a=[];for(let[t,n]of Object.entries(e))a.push({name:t,versionRange:n,depth:0,dependent:`root`,path:[]});await be(a,i,new Set,n,t),await xe(i,n);let o=_e(n);return{success:n.errors.length===0&&n.conflicts.length===0,graph:n,installOrder:o}}async function be(e,t,n,r,i){for(;e.length>0;){let a=e.shift();if(!a)continue;let{name:o,versionRange:s,depth:c,dependent:l,path:u}=a;if(c>i.maxDepth){r.errors.push({type:`max_depth_exceeded`,package:o,message:`Maximum dependency depth (${i.maxDepth}) exceeded at: ${[...u,o].join(` -> `)}`,path:[...u,o]});continue}if(u.includes(o)){r.errors.push({type:`circular_dependency`,package:o,message:`Circular dependency detected: ${[...u,o].join(` -> `)}`,path:[...u,o]});continue}if(t.has(o)||t.set(o,[]),t.get(o)?.push({range:s,dependent:l,depth:c}),n.has(o))continue;n.add(o);let d=D(o);if(!d){r.errors.push({type:`package_not_found`,package:o,message:`Invalid package name format: ${o}`});continue}try{let t=await O(d);if(!t){r.errors.push({type:`package_not_found`,package:o,message:`Package ${o} not found in registry`});continue}if(t.length===0){r.errors.push({type:`package_not_found`,package:o,message:`Package ${o} has no versions`});continue}let n=t.map(e=>e.version),i=I([s],n);if(!i){r.errors.push({type:`no_satisfying_version`,package:o,message:`No version of ${o} satisfies: ${s}`});continue}let a=await k(d,i);if(!a){r.errors.push({type:`fetch_error`,package:o,message:`Failed to fetch ${o}@${i}`});continue}let f=ve(o,i,s,a,c,l);r.nodes.set(o,f);for(let[t,n]of Object.entries(f.dependencies))e.push({name:t,versionRange:n,depth:c+1,dependent:o,path:[...u,o]})}catch(e){let t=e instanceof Error?e.message:`Unknown error`;r.errors.push({type:`fetch_error`,package:o,message:`Error fetching ${o}: ${t}`})}}}async function xe(e,t){for(let[n,r]of e.entries()){let e=t.nodes.get(n);if(!e)continue;e.dependents=[...new Set(r.map(e=>e.dependent))];let i=r.map(e=>e.range),a=D(n);if(a)try{let o=await O(a);if(!o)continue;let s=o.map(e=>e.version),c=I(i,s);if(!c){t.conflicts.push({package:n,ranges:r.map(e=>({dependent:e.dependent,range:e.range})),availableVersions:s}),t.errors.push({type:`no_satisfying_version`,package:n,message:`No version of ${n} satisfies all requirements: ${i.join(`, `)}`});continue}if(c!==e.version){let t=await k(a,c);t&&(e.version=c,e.downloadUrl=t.downloadUrl,e.integrity=`sha256-${Buffer.from(t.checksum,`hex`).toString(`base64`)}`,e.deprecated=t.deprecationMessage??void 0,e.dependencies=t.manifest?.dependencies??{})}}catch{}}}const Se=/^@(user|org|github)\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9._-]+)(?:\/([a-z][a-z0-9-]*))?(?:@(.+))?$/;function Ce(e){let t=e.match(Se);if(!t)return null;let n=t[1],r=t[2],i=t[3],a=t[4],o=t[5];return!r||!i||n===`github`&&!a||n!==`github`&&a?null:{namespace:n,owner:r,name:i,subname:a||void 0,versionRange:o||void 0}}function we(e){let t=`@${e.namespace}/${e.owner}/${e.name}`;return e.subname&&(t+=`/${e.subname}`),e.versionRange&&(t+=`@${e.versionRange}`),t}function Te(e){return e.startsWith(`@user/`)||e.startsWith(`@org/`)||e.startsWith(`@github/`)}const Ee=/^github:([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)(\/[^@]+)?(?:@(.+))?$/;function De(e){let t=e.match(Ee);if(!t)return null;let[,n,r,i,a]=t;return!n||!r?null:{owner:n,repo:r,path:i?i.slice(1):void 0,ref:a||void 0}}function Oe(e){let t=`github:${e.owner}/${e.repo}`;return e.path&&(t+=`/${e.path}`),e.ref&&(t+=`@${e.ref}`),t}function ke(e){if(e.path){let t=e.path.split(`/`).filter(Boolean),n=t[t.length-1];if(n)return n}return e.repo}function Ae(e){return e.startsWith(`github:`)}const je=/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)(?:\/(.+))?$/,Me=/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?\/?$/,L=/^([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)(?:\/(.+))?$/;function Ne(e){return/^https?:\/\/github\.com\/[^/]+\/[^/]+/.test(e)}function Pe(e){let t=e.match(je);if(t){let[,e,n,r,i]=t;return!e||!n||!r?null:{owner:e,repo:n,ref:r,path:i||void 0}}let n=e.match(Me);if(n){let[,e,t]=n;return!e||!t?null:{owner:e,repo:t}}return null}function Fe(e){return e.includes(`:`)||e.startsWith(`.`)||e.startsWith(`/`)||e.startsWith(`@`)?!1:L.test(e)}function Ie(e){if(e.includes(`:`)||e.startsWith(`.`)||e.startsWith(`/`)||e.startsWith(`@`))return null;let t=e.match(L);if(!t)return null;let[,n,r,i]=t;return!n||!r?null:{owner:n,repo:r,path:i||void 0}}const R={adal:{displayName:`AdaL`,skillsDir:`.adal/skills`,globalSkillsDir:`.adal/skills`},amp:{displayName:`Amp`,skillsDir:`.agents/skills`,globalSkillsDir:`.config/agents/skills`},antigravity:{displayName:`Antigravity`,skillsDir:`.agent/skills`,globalSkillsDir:`.gemini/antigravity/skills`},augment:{displayName:`Augment`,skillsDir:`.augment/skills`,globalSkillsDir:`.augment/skills`},"claude-code":{displayName:`Claude Code`,skillsDir:`.claude/skills`,globalSkillsDir:`.claude/skills`},cline:{displayName:`Cline`,skillsDir:`.agents/skills`,globalSkillsDir:`.agents/skills`},codebuddy:{displayName:`CodeBuddy`,skillsDir:`.codebuddy/skills`,globalSkillsDir:`.codebuddy/skills`},codex:{displayName:`Codex`,skillsDir:`.agents/skills`,globalSkillsDir:`.codex/skills`},"command-code":{displayName:`Command Code`,skillsDir:`.commandcode/skills`,globalSkillsDir:`.commandcode/skills`},continue:{displayName:`Continue`,skillsDir:`.continue/skills`,globalSkillsDir:`.continue/skills`},cortex:{displayName:`Cortex Code`,skillsDir:`.cortex/skills`,globalSkillsDir:`.snowflake/cortex/skills`},crush:{displayName:`Crush`,skillsDir:`.crush/skills`,globalSkillsDir:`.config/crush/skills`},cursor:{displayName:`Cursor`,skillsDir:`.agents/skills`,globalSkillsDir:`.cursor/skills`},droid:{displayName:`Droid`,skillsDir:`.factory/skills`,globalSkillsDir:`.factory/skills`},"gemini-cli":{displayName:`Gemini CLI`,skillsDir:`.agents/skills`,globalSkillsDir:`.gemini/skills`},"github-copilot":{displayName:`GitHub Copilot`,skillsDir:`.agents/skills`,globalSkillsDir:`.copilot/skills`},goose:{displayName:`Goose`,skillsDir:`.goose/skills`,globalSkillsDir:`.config/goose/skills`},"iflow-cli":{displayName:`iFlow CLI`,skillsDir:`.iflow/skills`,globalSkillsDir:`.iflow/skills`},junie:{displayName:`Junie`,skillsDir:`.junie/skills`,globalSkillsDir:`.junie/skills`},kilo:{displayName:`Kilo Code`,skillsDir:`.kilocode/skills`,globalSkillsDir:`.kilocode/skills`},"kimi-cli":{displayName:`Kimi Code CLI`,skillsDir:`.agents/skills`,globalSkillsDir:`.config/agents/skills`},"kiro-cli":{displayName:`Kiro CLI`,skillsDir:`.kiro/skills`,globalSkillsDir:`.kiro/skills`},kode:{displayName:`Kode`,skillsDir:`.kode/skills`,globalSkillsDir:`.kode/skills`},mcpjam:{displayName:`MCPJam`,skillsDir:`.mcpjam/skills`,globalSkillsDir:`.mcpjam/skills`},"mistral-vibe":{displayName:`Mistral Vibe`,skillsDir:`.vibe/skills`,globalSkillsDir:`.vibe/skills`},mux:{displayName:`Mux`,skillsDir:`.mux/skills`,globalSkillsDir:`.mux/skills`},neovate:{displayName:`Neovate`,skillsDir:`.neovate/skills`,globalSkillsDir:`.neovate/skills`},openclaw:{displayName:`OpenClaw`,skillsDir:`skills`,globalSkillsDir:`.openclaw/skills`},opencode:{displayName:`OpenCode`,skillsDir:`.agents/skills`,globalSkillsDir:`.config/opencode/skills`},openhands:{displayName:`OpenHands`,skillsDir:`.openhands/skills`,globalSkillsDir:`.openhands/skills`},pi:{displayName:`Pi`,skillsDir:`.pi/skills`,globalSkillsDir:`.pi/agent/skills`},pochi:{displayName:`Pochi`,skillsDir:`.pochi/skills`,globalSkillsDir:`.pochi/skills`},qoder:{displayName:`Qoder`,skillsDir:`.qoder/skills`,globalSkillsDir:`.qoder/skills`},"qwen-code":{displayName:`Qwen Code`,skillsDir:`.qwen/skills`,globalSkillsDir:`.qwen/skills`},replit:{displayName:`Replit`,skillsDir:`.agents/skills`,globalSkillsDir:`.config/agents/skills`},roo:{displayName:`Roo Code`,skillsDir:`.roo/skills`,globalSkillsDir:`.roo/skills`},trae:{displayName:`Trae`,skillsDir:`.trae/skills`,globalSkillsDir:`.trae/skills`},"trae-cn":{displayName:`Trae CN`,skillsDir:`.trae/skills`,globalSkillsDir:`.trae-cn/skills`},universal:{displayName:`Universal`,skillsDir:`.agents/skills`,globalSkillsDir:`.config/agents/skills`},windsurf:{displayName:`Windsurf`,skillsDir:`.windsurf/skills`,globalSkillsDir:`.codeium/windsurf/skills`},zencoder:{displayName:`Zencoder`,skillsDir:`.zencoder/skills`,globalSkillsDir:`.zencoder/skills`}},Le=Object.fromEntries(Object.entries(R).map(([e,t])=>[e,{skillsDir:t.skillsDir}])),z=Object.keys(R).sort();function B(e,t,n){if(!n&&t?.[e])return t[e];if(e in R){let t=R[e];return{skillsDir:n?t.globalSkillsDir:t.skillsDir}}return null}function Re(e){return e?e===`none`?[`none`]:e.split(`,`).map(e=>e.trim()).filter(Boolean):[...z]}function ze(e){let t=Object.keys(Le),n=e?Object.keys(e):[];return[...new Set([...t,...n])]}async function Be(){let e=await ce({message:`Select agents to install skills to`,choices:z.map(e=>({name:`${R[e].displayName} (${R[e].skillsDir})`,value:e,checked:!0}))});return e.length===0?[`none`]:e}function V(){return s()?d(ne(),`.anyt`,`anyt.json`):d(process.cwd(),`anyt.json`)}async function H(){try{let e=await h(V(),`utf-8`);return JSON.parse(e)}catch{return null}}async function U(e){let t=JSON.stringify(e,null,2);await y(V(),`${t}\n`)}async function Ve(){return{dependencies:{}}}async function W(){let e=await H();return e||(e=await Ve(),await U(e)),e}async function He(e,t){let n=await W();n.dependencies||={},n.dependencies[e]=t,await U(n)}async function Ue(e){let t=await H();return t?.dependencies?.[e]?(delete t.dependencies[e],await U(t),!0):!1}async function We(){return(await H())?.dependencies??{}}async function Ge(){return(await H())?.githubDependencies??{}}async function Ke(e,t){let n=await W();n.githubDependencies||={},n.githubDependencies[e]=t,await U(n)}async function qe(e){let t=await H();return t?.githubDependencies?.[e]?(delete t.githubDependencies[e],await U(t),!0):!1}async function Je(e,t=`*`){let n=await W();n.localDependencies||={},n.localDependencies[e]=t,await U(n)}async function Ye(e,t){let n=await W();n.wellKnownDependencies||={};let r=n.wellKnownDependencies[e];if(Array.isArray(r)){let i=[...new Set([...r,...t])];n.wellKnownDependencies[e]=i}else n.wellKnownDependencies[e]=t;await U(n)}var G=class extends Error{constructor(){super(`GitHub API rate limit exceeded. Set GITHUB_TOKEN environment variable for higher limits.`),this.name=`GitHubRateLimitError`}},K=class extends Error{constructor(e){let t=e.path?`/${e.path}`:``,n=e.ref?`@${e.ref}`:``;super(`GitHub repository not found: ${e.owner}/${e.repo}${t}${n}`),this.name=`GitHubNotFoundError`}},q=class extends Error{constructor(e,t){let n=t?.length?`\nAvailable paths in repository root:\n ${t.join(`
5
+ `)}`:``;super(`Path "${e.path}" not found in ${e.owner}/${e.repo}${n}`),this.name=`GitHubPathNotFoundError`}};function J(){let e={Accept:`application/vnd.github+json`,"X-GitHub-Api-Version":`2022-11-28`,"User-Agent":`anyt-cli`},t=process.env.GITHUB_TOKEN;return t&&(e.Authorization=`Bearer ${t}`),e}async function Xe(e,t,n){let r=J(),i=n;if(!i||i===`latest`){let n=`https://api.github.com/repos/${e}/${t}`,a=await fetch(n,{headers:r});if(a.status===404)throw new K({owner:e,repo:t});if(a.status===403&&a.headers.get(`x-ratelimit-remaining`)===`0`)throw new G;if(!a.ok)throw Error(`GitHub API error: ${a.status}`);i=(await a.json()).default_branch}let a=`https://api.github.com/repos/${e}/${t}/commits/${i}`,o=await fetch(a,{headers:r});if(o.status===404)throw new K({owner:e,repo:t,ref:n});if(o.status===403&&o.headers.get(`x-ratelimit-remaining`)===`0`)throw new G;if(!o.ok)throw Error(`GitHub API error: ${o.status}`);return(await o.json()).sha}async function Ze(e){let t=J(),n=await Xe(e.owner,e.repo,e.ref),r=`https://api.github.com/repos/${e.owner}/${e.repo}/tarball/${n}`,i=await fetch(r,{headers:t,redirect:`follow`});if(i.status===404)throw new K(e);if(i.status===403&&i.headers.get(`x-ratelimit-remaining`)===`0`)throw new G;if(!i.ok)throw Error(`Failed to download GitHub tarball: ${i.status}`);let a=Buffer.from(await i.arrayBuffer());return{buffer:a,commit:n,integrity:E(a)}}async function Qe(e,t,n){let r=e.path?d(n,`_github`,e.owner,e.repo,e.path):d(n,`_github`,e.owner,e.repo),i=d(n,`_github`,`.temp`,`${Date.now()}`);await m(i,{recursive:!0});let a=d(i,`archive.tgz`);try{await y(a,t);let{exec:n}=await import(`node:child_process`),{promisify:o}=await import(`node:util`);await o(n)(`tar -xzf "${a}" -C "${i}"`);let s=(await g(i)).find(e=>e!==`archive.tgz`&&!e.startsWith(`.`));if(!s)throw Error(`Failed to find extracted directory in tarball`);let c=d(i,s),l=e.path?d(c,e.path):c;if(e.path&&!await p(l).catch(()=>null)){let t=await g(c),n=[];for(let e of t)(await p(d(c,e)).catch(()=>null))?.isDirectory()&&!e.startsWith(`.`)&&n.push(e);throw new q(e,n)}return await _(r,{recursive:!0,force:!0}),await m(r,{recursive:!0}),await ee(l,r,{recursive:!0}),e.path?`.anyt/skills/_github/${e.owner}/${e.repo}/${e.path}`:`.anyt/skills/_github/${e.owner}/${e.repo}`}finally{await _(i,{recursive:!0,force:!0})}}function $e(e,t){let n=`github:${e.owner}/${e.repo}`;if(e.path&&(n+=`/${e.path}`),e.ref||t){let r=e.ref||`HEAD`,i=t?t.slice(0,7):``;n+=` (${r}${i?`@${i}`:``})`}return n}async function Y(){let e=l();try{let t=await h(e,`utf-8`),n=JSON.parse(t);return n.lockfileVersion===1&&n.skills&&!n.packages?{...n,lockfileVersion:2,packages:n.skills}:n}catch{return null}}async function X(e){let t=l();await m(u(t),{recursive:!0});let n=e.packages??e.skills??{},r={$schema:`https://anyt.io/schema/v1/anyt-lock.json`,lockfileVersion:Object.values(n).some(e=>e.dependencies&&Object.keys(e.dependencies).length>0)?4:3,registryUrl:e.registryUrl,packages:n};e.githubPackages&&Object.keys(e.githubPackages).length>0&&(r.githubPackages=e.githubPackages),e.localPackages&&Object.keys(e.localPackages).length>0&&(r.localPackages=e.localPackages),e.wellKnownPackages&&Object.keys(e.wellKnownPackages).length>0&&(r.wellKnownPackages=e.wellKnownPackages),await y(t,`${JSON.stringify(r,null,2)}\n`)}async function Z(){return{lockfileVersion:4,registryUrl:await c(),packages:{}}}function Q(e){return e.packages??e.skills??{}}async function et(e,t){let n=await Y();n||=await Z();let r=Q(n);r[e]=t,n.packages=r,await X(n)}async function tt(e,t,n){let r=await Y();r||=await Z();let i=Q(r),a={...t};n&&Object.keys(n).length>0&&(a.dependencies=n),i[e]=a,r.packages=i,await X(r)}async function nt(e){let t=await Y();if(!t)return!1;let n=Q(t);return n[e]?(delete n[e],t.packages=n,await X(t),!0):!1}async function rt(){let e=await Y();if(!e)return[];let t=Q(e);return Object.entries(t).map(([e,t])=>({name:e,entry:t}))}async function it(e,t){let n=await Y();n||=await Z(),n.githubPackages||={},n.githubPackages[e]=t,await X(n)}async function $(e){let t=await Y();return t?.githubPackages?.[e]?(delete t.githubPackages[e],await X(t),!0):!1}async function at(){let e=await Y();return e?.githubPackages?Object.entries(e.githubPackages).map(([e,t])=>({specifier:e,entry:t})):[]}async function ot(e,t){let n=await Y();n||=await Z(),n.localPackages||={},n.localPackages[e]=t,await X(n)}async function st(e,t){let n=await Y();n||=await Z(),n.wellKnownPackages||={},n.wellKnownPackages[e]=t,await X(n)}async function ct(){let e=await Y();return e?.wellKnownPackages?Object.entries(e.wellKnownPackages).map(([e,t])=>({specifier:e,entry:t})):[]}async function lt(e,t){let{agents:n,projectRoot:r,agentConfigs:i}=t;if(!(n.length===1&&n[0]===`none`))for(let a of n){let n=B(a,i,t.global);if(!n){console.warn(`Warning: Unknown agent "${a}", skipping symlinks`);continue}let o=d(r,n.skillsDir);await m(o,{recursive:!0});for(let t of e){let e=d(o,t.name),n=d(r,t.sourcePath);await ut(e,f(u(e),n),t.name)}}}async function ut(e,t,n){try{let r=await p(e).catch(()=>null);if(r)if(r.isSymbolicLink()){if(await te(e)===t)return;await _(e)}else{console.warn(`Warning: File exists at symlink path for "${n}", skipping: ${e}`);return}await v(t,e)}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Warning: Failed to create symlink for "${n}": ${t}`)}}async function dt(e,t){let{agents:n,projectRoot:r,agentConfigs:i}=t;if(!(n.length===1&&n[0]===`none`))for(let t of n){let n=B(t,i);if(!n)continue;let a=d(r,n.skillsDir,e);try{(await p(a).catch(()=>null))?.isSymbolicLink()&&await _(a)}catch{}}}function ft(e,t,n){if(n!==void 0){let r=e,i=t;return r===`org`?`.anyt/skills/_org/${i}/${n}`:r===`github`?`.anyt/skills/_github-registry/${i}/${n}`:`.anyt/skills/${i}/${n}`}return`.anyt/skills/${e}/${t}`}function pt(e,t,n){return n?`.anyt/skills/_github/${e}/${t}/${n}`:`.anyt/skills/_github/${e}/${t}`}function mt(e){return`.anyt/skills/_local/${e}`}function ht(e,t){return`.anyt/skills/_wellknown/${e}/${t}`}async function gt(e,t,n,r){let i=[];for(let a of t){let t=B(a,r);if(!t)continue;let o=d(n,t.skillsDir,e);try{(await p(o)).isSymbolicLink()&&i.push(a)}catch{}}return i}export{P as $,Ge as A,Oe as B,Qe as C,Je as D,Ke as E,U as F,Ne as G,ke as H,ze as I,De as J,Te as K,Re as L,H as M,Ue as N,Ye as O,qe as P,F as Q,Be as R,Ze as S,He as T,Fe as U,we as V,Ae as W,Ce as X,Pe as Y,ye as Z,nt as _,ft as a,E as at,q as b,it as c,de as ct,tt as d,A as et,st as f,Y as g,ct as h,mt as i,he as it,V as j,We as k,ot as l,ue as lt,rt as m,pt as n,me as nt,ht as o,w as ot,at as p,Ie as q,gt as r,pe as rt,dt as s,fe as st,lt as t,N as tt,et as u,le as ut,$ as v,$e as w,G as x,K as y,B as z};
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "anyt-cli",
3
+ "version": "0.1.0",
4
+ "description": "anyt CLI — unified client for the anyt.io v1 API (skills, drive, api-keys, billing, agents, …)",
5
+ "author": "anyt.io",
6
+ "license": "Artistic-2.0",
7
+ "keywords": [
8
+ "anyt",
9
+ "cli",
10
+ "skill",
11
+ "package-manager",
12
+ "ai",
13
+ "claude",
14
+ "claude-code",
15
+ "coding-agent"
16
+ ],
17
+ "type": "module",
18
+ "exports": {
19
+ ".": "./dist/index.js"
20
+ },
21
+ "bin": {
22
+ "anyt": "./bin/anyt.js"
23
+ },
24
+ "files": [
25
+ "bin",
26
+ "dist",
27
+ "README.md",
28
+ "CHANGELOG.md",
29
+ "CLI_GUIDE.md",
30
+ "LICENSE"
31
+ ],
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "dependencies": {
36
+ "@inquirer/prompts": "^8.4.2",
37
+ "commander": "^14.0.3",
38
+ "ignore": "^7.0.5",
39
+ "ini": "^6.0.0",
40
+ "open": "^11.0.0",
41
+ "semver": "^7.7.4"
42
+ },
43
+ "devDependencies": {
44
+ "@biomejs/biome": "2.4.14",
45
+ "@types/ini": "^4.1.1",
46
+ "@types/node": "^25.6.2",
47
+ "@types/semver": "^7.7.1",
48
+ "tsdown": "^0.22.0",
49
+ "tsx": "^4.21.0",
50
+ "typescript": "^6.0.3",
51
+ "vitest": "^4.1.5",
52
+ "@anytio/errors": "0.0.0",
53
+ "@anytio/skill-registry": "0.0.1",
54
+ "@anytio/skill-types": "0.0.1",
55
+ "@anytio/typescript-config": "0.0.0"
56
+ },
57
+ "engines": {
58
+ "node": ">=20.0.0"
59
+ },
60
+ "scripts": {
61
+ "dev": "tsx --tsconfig tsconfig.json src/index.ts",
62
+ "build": "tsdown",
63
+ "start": "node dist/index.js",
64
+ "link:local": "pnpm build && ln -sf $(pwd)/bin/anyt.js $(pnpm bin --global)/anyt-local && echo 'Linked anyt-local → local build'",
65
+ "unlink:local": "rm -f $(pnpm bin --global)/anyt-local && echo 'Removed anyt-local'",
66
+ "typecheck": "tsc --noEmit",
67
+ "lint": "biome lint src",
68
+ "check": "biome check src",
69
+ "format": "biome format ./src --write",
70
+ "test": "vitest run",
71
+ "test:watch": "vitest",
72
+ "test:e2e": "vitest run --config vitest.e2e.config.ts",
73
+ "test:e2e:watch": "vitest --config vitest.e2e.config.ts"
74
+ }
75
+ }