@openskillmd/osm 0.6.0 → 0.6.1

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.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as y}from"./chunk-N5U3SVLG.js";import{c as b,e as w,l as S}from"./chunk-QRUOUQVA.js";import{g as h}from"./chunk-C7AXVR6L.js";import"./chunk-YAZPI4SK.js";import{l as d,n as k,u as g,w as p}from"./chunk-4WV7FA5L.js";import{spawn as v}from"child_process";import{createRequire as j}from"module";var A=j(import.meta.url);function R(r){return r.replace(/^.*[█╔╗╚╝═║].*\r?\n?/gm,"").replace(/^.*open agent skills ecosystem.*\r?\n?/gm,"")}function L(r){return!r||typeof r!="string"||r.length===0||r.length>500?{ok:!1,code:2,message:"Source is required, e.g. owner/repo or owner/repo@skill"}:/[/@:.]/.test(r)?{ok:!0}:{ok:!1,code:"needs-resolution",slug:r}}async function O(r){let e;try{e=await w(r)}catch(t){return t instanceof b&&t.statusCode===404?{ok:!1,message:`No skill named "${r}" in the registry.`,suggestion:"Run `osm search <query>` to find it, or pass owner/repo directly."}:{ok:!1,message:`Couldn't reach the registry to resolve "${r}".`,suggestion:"Check your connection (and OPENSKILL_API_URL, if set), or pass owner/repo directly."}}let s=e.name||null;if(e.githubOwner&&e.githubRepo){let t=`${e.githubOwner}/${e.githubRepo}`;return{ok:!0,source:t,skillName:s,note:s?`resolved ${r} \u2192 ${t} (skill: ${s})`:`resolved ${r} \u2192 ${t}`}}return e.sourceUrl&&/^https?:\/\//.test(e.sourceUrl)?{ok:!0,source:e.sourceUrl,skillName:s,note:s?`resolved ${r} \u2192 ${e.sourceUrl} (skill: ${s})`:`resolved ${r} \u2192 ${e.sourceUrl}`}:{ok:!1,message:`"${r}" lives only in the OpenSkill registry \u2014 it has no GitHub source to install from yet.`,suggestion:`Run \`osm info ${r}\` to inspect it.`}}function I(r){return r.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function E(r,e={},s=null){let t=["add",r,"-y"];if(s){t.push("--skill",s);let n=I(s);n&&n!==s.toLowerCase()&&t.push("--skill",n)}for(let n of e.agent??[])t.push("-a",n);return e.global&&t.push("-g"),e.copy&&t.push("--copy"),t}function P(r,e,s,t,n=null){return s===0?{ok:!0,source:r,resolvedFrom:n,agent:e.agent??null,scope:e.global?"user":"project"}:{ok:!1,source:r,resolvedFrom:n,error:{code:`INSTALL_EXIT_${s}`,message:t.trim()||"install failed"}}}async function D(r,e={}){let s=r,t=null,n=null,i=L(r);if(!i.ok){i.code!=="needs-resolution"&&(console.error(g(i.message,i.suggestion)),process.exit(i.code));try{let u=await S(i.slug),{pluginInstallCommand:x}=await import("./plugin-QO3E3AOC.js");await x(i.slug,{agent:e.agent,global:e.global,json:e.json},u);return}catch{}let l=e.json?null:y({text:`Resolving "${i.slug}" in the registry...`,spinner:k,color:!1}).start(),o=await O(i.slug);l?.stop(),o.ok||(e.json?p({ok:!1,source:r,resolvedFrom:null,error:{code:"SLUG_RESOLUTION_FAILED",message:o.message}}):console.error(g(o.message,o.suggestion)),process.exit(2)),e.json||console.error(d(` \u2192 ${o.note}`)),s=o.source,t=i.slug,n=o.skillName}let f;try{f=A.resolve("skills/bin/cli.mjs")}catch{console.error(g("The installer backend is missing.","Reinstall @openskillmd/osm to restore its dependencies.")),process.exit(3)}let $=E(s,e,n);e.json||(console.error(d(" \u2192 fetching skill files\u2026")),console.error(""));let a=v(process.execPath,[f,...$],{stdio:["inherit","pipe","pipe"],env:{...process.env,DISABLE_TELEMETRY:"1"}}),m="";a.stdout&&a.stdout.on("data",l=>{let o=R(l.toString("utf-8"));o&&!e.json&&process.stdout.write(o)}),a.stderr&&a.stderr.on("data",l=>{let o=l.toString("utf-8");if(e.json)m+=o;else{let u=R(o);u&&process.stderr.write(u)}});let c=await new Promise(l=>{a.once("exit",o=>l(o??1)),a.once("error",()=>l(3))});e.json&&p(P(s,e,c,m,t)),t&&await h(t,{success:c===0}),process.exit(c)}export{D as addCommand,P as buildJsonResult,E as buildSkillsArgs,O as resolveSlug,R as stripSkillsBanner,I as toSkillSlug,L as validateSource};
3
+ import{a as y}from"./chunk-N5U3SVLG.js";import{c as b,e as w,l as S}from"./chunk-C4S3KDSI.js";import{g as h}from"./chunk-VRPJTK2B.js";import"./chunk-YAZPI4SK.js";import{l as d,n as k,u as g,w as p}from"./chunk-4WV7FA5L.js";import{spawn as v}from"child_process";import{createRequire as j}from"module";var A=j(import.meta.url);function R(r){return r.replace(/^.*[█╔╗╚╝═║].*\r?\n?/gm,"").replace(/^.*open agent skills ecosystem.*\r?\n?/gm,"")}function L(r){return!r||typeof r!="string"||r.length===0||r.length>500?{ok:!1,code:2,message:"Source is required, e.g. owner/repo or owner/repo@skill"}:/[/@:.]/.test(r)?{ok:!0}:{ok:!1,code:"needs-resolution",slug:r}}async function O(r){let e;try{e=await w(r)}catch(t){return t instanceof b&&t.statusCode===404?{ok:!1,message:`No skill named "${r}" in the registry.`,suggestion:"Run `osm search <query>` to find it, or pass owner/repo directly."}:{ok:!1,message:`Couldn't reach the registry to resolve "${r}".`,suggestion:"Check your connection (and OPENSKILL_API_URL, if set), or pass owner/repo directly."}}let s=e.name||null;if(e.githubOwner&&e.githubRepo){let t=`${e.githubOwner}/${e.githubRepo}`;return{ok:!0,source:t,skillName:s,note:s?`resolved ${r} \u2192 ${t} (skill: ${s})`:`resolved ${r} \u2192 ${t}`}}return e.sourceUrl&&/^https?:\/\//.test(e.sourceUrl)?{ok:!0,source:e.sourceUrl,skillName:s,note:s?`resolved ${r} \u2192 ${e.sourceUrl} (skill: ${s})`:`resolved ${r} \u2192 ${e.sourceUrl}`}:{ok:!1,message:`"${r}" lives only in the OpenSkill registry \u2014 it has no GitHub source to install from yet.`,suggestion:`Run \`osm info ${r}\` to inspect it.`}}function I(r){return r.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function E(r,e={},s=null){let t=["add",r,"-y"];if(s){t.push("--skill",s);let n=I(s);n&&n!==s.toLowerCase()&&t.push("--skill",n)}for(let n of e.agent??[])t.push("-a",n);return e.global&&t.push("-g"),e.copy&&t.push("--copy"),t}function P(r,e,s,t,n=null){return s===0?{ok:!0,source:r,resolvedFrom:n,agent:e.agent??null,scope:e.global?"user":"project"}:{ok:!1,source:r,resolvedFrom:n,error:{code:`INSTALL_EXIT_${s}`,message:t.trim()||"install failed"}}}async function D(r,e={}){let s=r,t=null,n=null,i=L(r);if(!i.ok){i.code!=="needs-resolution"&&(console.error(g(i.message,i.suggestion)),process.exit(i.code));try{let u=await S(i.slug),{pluginInstallCommand:x}=await import("./plugin-F3YZSTVP.js");await x(i.slug,{agent:e.agent,global:e.global,json:e.json},u);return}catch{}let l=e.json?null:y({text:`Resolving "${i.slug}" in the registry...`,spinner:k,color:!1}).start(),o=await O(i.slug);l?.stop(),o.ok||(e.json?p({ok:!1,source:r,resolvedFrom:null,error:{code:"SLUG_RESOLUTION_FAILED",message:o.message}}):console.error(g(o.message,o.suggestion)),process.exit(2)),e.json||console.error(d(` \u2192 ${o.note}`)),s=o.source,t=i.slug,n=o.skillName}let f;try{f=A.resolve("skills/bin/cli.mjs")}catch{console.error(g("The installer backend is missing.","Reinstall @openskillmd/osm to restore its dependencies.")),process.exit(3)}let $=E(s,e,n);e.json||(console.error(d(" \u2192 fetching skill files\u2026")),console.error(""));let a=v(process.execPath,[f,...$],{stdio:["inherit","pipe","pipe"],env:{...process.env,DISABLE_TELEMETRY:"1"}}),m="";a.stdout&&a.stdout.on("data",l=>{let o=R(l.toString("utf-8"));o&&!e.json&&process.stdout.write(o)}),a.stderr&&a.stderr.on("data",l=>{let o=l.toString("utf-8");if(e.json)m+=o;else{let u=R(o);u&&process.stderr.write(u)}});let c=await new Promise(l=>{a.once("exit",o=>l(o??1)),a.once("error",()=>l(3))});e.json&&p(P(s,e,c,m,t)),t&&await h(t,{success:c===0}),process.exit(c)}export{D as addCommand,P as buildJsonResult,E as buildSkillsArgs,O as resolveSlug,R as stripSkillsBanner,I as toSkillSlug,L as validateSource};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as d}from"./chunk-N5U3SVLG.js";import{g as C,h as v,i as y,j as S}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import{a as g}from"./chunk-2CMBJDSX.js";import"./chunk-YAZPI4SK.js";import{g as n,k as w,l as s,n as u,p as f,q as h,s as $,t as l,u as m}from"./chunk-4WV7FA5L.js";var p="__exit__";async function _(){try{let{mode:t}=await g.prompt([{type:"list",name:"mode",message:n("What would you like to explore?"),choices:[{name:"\u{1F4DA} Collections (curated sets of skills & blueprints)",value:"collections"},{name:"\u{1F50C} MCP servers",value:"mcp"},{name:s("\u2190 Exit"),value:p}]}]);if(t===p)return;if(t==="mcp"){await k();return}await x()}catch(t){process.stderr.write(m(t instanceof Error?t.message:"Unknown error")+`
3
+ import{a as d}from"./chunk-N5U3SVLG.js";import{g as C,h as v,i as y,j as S}from"./chunk-C4S3KDSI.js";import"./chunk-VRPJTK2B.js";import{a as g}from"./chunk-2CMBJDSX.js";import"./chunk-YAZPI4SK.js";import{g as n,k as w,l as s,n as u,p as f,q as h,s as $,t as l,u as m}from"./chunk-4WV7FA5L.js";var p="__exit__";async function _(){try{let{mode:t}=await g.prompt([{type:"list",name:"mode",message:n("What would you like to explore?"),choices:[{name:"\u{1F4DA} Collections (curated sets of skills & blueprints)",value:"collections"},{name:"\u{1F50C} MCP servers",value:"mcp"},{name:s("\u2190 Exit"),value:p}]}]);if(t===p)return;if(t==="mcp"){await k();return}await x()}catch(t){process.stderr.write(m(t instanceof Error?t.message:"Unknown error")+`
4
4
  `)}}async function x(){let t=d({text:"Loading collections...",spinner:u,color:!1}).start(),i=await C({limit:50});if(t.stop(),i.length===0){process.stderr.write(m("No collections found.")+`
5
5
  `);return}let c=i.map(r=>({name:`${r.icon||"\u{1F4E6}"} ${r.name} ${s(`(${r.itemCount} items)`)}`,value:r.slug}));c.push({name:s("\u2190 Exit"),value:p});let{slug:o}=await g.prompt([{type:"list",name:"slug",message:n("Choose a collection to explore:"),choices:c,pageSize:15}]);if(o===p)return;let e=d({text:"Loading collection...",spinner:u,color:!1}).start(),a=await v(o);e.stop(),M(a)}function M(t){process.stderr.write(l(`${t.icon||"\u{1F4E6}"} ${t.name}`)+`
6
6
  `),t.description&&process.stderr.write(` ${w(t.description)}
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{b as u,c as a,e as c}from"./chunk-C7AXVR6L.js";var s;async function o(){if(s)return s;let e=await u();return s=a(e),s}async function p(){return o()}async function b(){return(await o()).replace(/\/api\/?$/,"")}var l=class extends Error{statusCode;constructor(t,r){super(r),this.name="ApiError",this.statusCode=t}};async function n(e){let r=`${await o()}${e}`,i=await fetch(r,{headers:await c()});if(!i.ok)throw new l(i.status,`API returned ${i.status} for ${e}`);return i.json()}async function f(e){return n(`/search?q=${encodeURIComponent(e)}`)}async function d(e){return n(`/skills/${encodeURIComponent(e)}`)}async function S(e){return n(`/blueprints/${encodeURIComponent(e)}`)}async function y(e){let t=new URLSearchParams;return e?.search&&t.set("search",e.search),t.set("limit",String(e?.limit??50)),(await n(`/collections?${t.toString()}`)).data}async function h(e){return n(`/collections/${encodeURIComponent(e)}`)}async function C(e){let t=new URLSearchParams;return e?.search&&t.set("search",e.search),e?.category&&t.set("category",e.category),t.set("limit",String(e?.limit??50)),t.set("sort","stars"),t.set("order","desc"),n(`/mcp-servers?${t.toString()}`)}async function P(){return n("/mcp-servers/categories")}async function v(e){return n(`/mcp-servers/${encodeURIComponent(e)}`)}async function x(e){return n(`/plugins/${encodeURIComponent(e)}`)}export{p as a,b,l as c,f as d,d as e,S as f,y as g,h,C as i,P as j,v as k,x as l};
3
+ import{b as u,c as a,e as c}from"./chunk-VRPJTK2B.js";var s;async function o(){if(s)return s;let e=await u();return s=a(e),s}async function p(){return o()}async function b(){return(await o()).replace(/\/api\/?$/,"")}var l=class extends Error{statusCode;constructor(t,r){super(r),this.name="ApiError",this.statusCode=t}};async function n(e){let r=`${await o()}${e}`,i=await fetch(r,{headers:await c()});if(!i.ok)throw new l(i.status,`API returned ${i.status} for ${e}`);return i.json()}async function f(e){return n(`/search?q=${encodeURIComponent(e)}`)}async function d(e){return n(`/skills/${encodeURIComponent(e)}`)}async function S(e){return n(`/blueprints/${encodeURIComponent(e)}`)}async function y(e){let t=new URLSearchParams;return e?.search&&t.set("search",e.search),t.set("limit",String(e?.limit??50)),(await n(`/collections?${t.toString()}`)).data}async function h(e){return n(`/collections/${encodeURIComponent(e)}`)}async function C(e){let t=new URLSearchParams;return e?.search&&t.set("search",e.search),e?.category&&t.set("category",e.category),t.set("limit",String(e?.limit??50)),t.set("sort","stars"),t.set("order","desc"),n(`/mcp-servers?${t.toString()}`)}async function P(){return n("/mcp-servers/categories")}async function v(e){return n(`/mcp-servers/${encodeURIComponent(e)}`)}async function x(e){return n(`/plugins/${encodeURIComponent(e)}`)}export{p as a,b,l as c,f as d,d as e,S as f,y as g,h,C as i,P as j,v as k,x as l};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{c as ee,u as Uu}from"./chunk-4WV7FA5L.js";var Ou="0.6.0";import{randomUUID as Tf}from"crypto";import{chmod as Ef,mkdir as Af,readFile as Zd,writeFile as Lf}from"fs/promises";import{homedir as Rf}from"os";import{join as Dd}from"path";var V={};ee(V,{$brand:()=>xn,$input:()=>Mo,$output:()=>Vo,NEVER:()=>bn,TimePrecision:()=>Bo,ZodAny:()=>Ac,ZodArray:()=>Fc,ZodBase64:()=>un,ZodBase64URL:()=>sn,ZodBigInt:()=>Qe,ZodBigIntFormat:()=>mn,ZodBoolean:()=>He,ZodCIDRv4:()=>an,ZodCIDRv6:()=>cn,ZodCUID:()=>Hr,ZodCUID2:()=>Qr,ZodCatch:()=>su,ZodCodec:()=>Zt,ZodCustom:()=>Dt,ZodCustomStringFormat:()=>qe,ZodDate:()=>wt,ZodDefault:()=>nu,ZodDiscriminatedUnion:()=>Vc,ZodE164:()=>ln,ZodEmail:()=>Xr,ZodEmoji:()=>qr,ZodEnum:()=>Be,ZodError:()=>yf,ZodExactOptional:()=>eu,ZodFile:()=>Hc,ZodFirstPartyTypeKind:()=>xu,ZodFunction:()=>_u,ZodGUID:()=>xt,ZodIPv4:()=>nn,ZodIPv6:()=>on,ZodISODate:()=>Vr,ZodISODateTime:()=>Jr,ZodISODuration:()=>Kr,ZodISOTime:()=>Mr,ZodIntersection:()=>Mc,ZodIssueCode:()=>xf,ZodJWT:()=>dn,ZodKSUID:()=>rn,ZodLazy:()=>vu,ZodLiteral:()=>Yc,ZodMAC:()=>Uc,ZodMap:()=>Xc,ZodNaN:()=>du,ZodNanoID:()=>Yr,ZodNever:()=>Rc,ZodNonOptional:()=>hn,ZodNull:()=>Tc,ZodNullable:()=>ru,ZodNumber:()=>Ye,ZodNumberFormat:()=>xe,ZodObject:()=>Pt,ZodOptional:()=>$n,ZodPipe:()=>Ot,ZodPrefault:()=>ou,ZodPreprocess:()=>mu,ZodPromise:()=>hu,ZodReadonly:()=>pu,ZodRealError:()=>J,ZodRecord:()=>We,ZodSet:()=>qc,ZodString:()=>Xe,ZodStringFormat:()=>w,ZodSuccess:()=>uu,ZodSymbol:()=>Dc,ZodTemplateLiteral:()=>gu,ZodTransform:()=>Qc,ZodTuple:()=>Gc,ZodType:()=>k,ZodULID:()=>en,ZodURL:()=>St,ZodUUID:()=>Q,ZodUndefined:()=>Nc,ZodUnion:()=>Ut,ZodUnknown:()=>Lc,ZodVoid:()=>Cc,ZodXID:()=>tn,ZodXor:()=>Jc,_ZodString:()=>Br,_default:()=>iu,_function:()=>_d,any:()=>ql,array:()=>jt,base64:()=>Dl,base64url:()=>Nl,bigint:()=>Kl,boolean:()=>Zc,catch:()=>lu,check:()=>yd,cidrv4:()=>Ol,cidrv6:()=>Zl,clone:()=>T,codec:()=>gd,coerce:()=>ku,config:()=>U,core:()=>ne,cuid:()=>kl,cuid2:()=>zl,custom:()=>bd,date:()=>Hl,decode:()=>kc,decodeAsync:()=>Ic,describe:()=>xd,discriminatedUnion:()=>id,e164:()=>Tl,email:()=>pl,emoji:()=>bl,encode:()=>xc,encodeAsync:()=>zc,endsWith:()=>Ae,enum:()=>gn,exactOptional:()=>tu,file:()=>dd,flattenError:()=>ut,float32:()=>Fl,float64:()=>Jl,formatError:()=>st,fromJSONSchema:()=>Pd,function:()=>_d,getErrorMap:()=>zf,globalRegistry:()=>D,gt:()=>Y,gte:()=>A,guid:()=>fl,hash:()=>Cl,hex:()=>Rl,hostname:()=>Ll,httpUrl:()=>yl,includes:()=>Te,instanceof:()=>zd,int:()=>Gr,int32:()=>Vl,int64:()=>Gl,intersection:()=>Kc,invertCodec:()=>vd,ipv4:()=>jl,ipv6:()=>Ul,iso:()=>Ge,json:()=>Sd,jwt:()=>El,keyof:()=>Ql,ksuid:()=>wl,lazy:()=>$u,length:()=>ye,literal:()=>ld,locales:()=>$t,looseObject:()=>rd,looseRecord:()=>ad,lowercase:()=>De,lt:()=>q,lte:()=>K,mac:()=>Pl,map:()=>cd,maxLength:()=>_e,maxSize:()=>le,meta:()=>kd,mime:()=>Le,minLength:()=>re,minSize:()=>H,multipleOf:()=>se,nan:()=>fd,nanoid:()=>xl,nativeEnum:()=>sd,negative:()=>Zr,never:()=>pn,nonnegative:()=>Nr,nonoptional:()=>cu,nonpositive:()=>Dr,normalize:()=>Re,null:()=>Ec,nullable:()=>zt,nullish:()=>md,number:()=>Oc,object:()=>ed,optional:()=>kt,overwrite:()=>B,parse:()=>hc,parseAsync:()=>_c,partialRecord:()=>od,pipe:()=>Wr,positive:()=>Or,prefault:()=>au,preprocess:()=>wd,prettifyError:()=>Tn,promise:()=>hd,property:()=>Tr,readonly:()=>fu,record:()=>Bc,refine:()=>yu,regex:()=>Ze,regexes:()=>M,registry:()=>lr,safeDecode:()=>wc,safeDecodeAsync:()=>Pc,safeEncode:()=>Sc,safeEncodeAsync:()=>jc,safeParse:()=>yc,safeParseAsync:()=>bc,set:()=>ud,setErrorMap:()=>kf,size:()=>he,slugify:()=>Ve,startsWith:()=>Ee,strictObject:()=>td,string:()=>bt,stringFormat:()=>Al,stringbool:()=>Id,success:()=>pd,superRefine:()=>bu,symbol:()=>Bl,templateLiteral:()=>$d,toJSONSchema:()=>Rr,toLowerCase:()=>Fe,toUpperCase:()=>Je,transform:()=>vn,treeifyError:()=>Nn,trim:()=>Ce,tuple:()=>Wc,uint32:()=>Ml,uint64:()=>Wl,ulid:()=>Il,undefined:()=>Xl,union:()=>fn,unknown:()=>be,uppercase:()=>Ne,url:()=>_l,util:()=>v,uuid:()=>gl,uuidv4:()=>vl,uuidv6:()=>$l,uuidv7:()=>hl,void:()=>Yl,xid:()=>Sl,xor:()=>nd});var ne={};ee(ne,{$ZodAny:()=>lo,$ZodArray:()=>vo,$ZodAsyncError:()=>W,$ZodBase64:()=>eo,$ZodBase64URL:()=>to,$ZodBigInt:()=>rr,$ZodBigIntFormat:()=>ao,$ZodBoolean:()=>pt,$ZodCIDRv4:()=>Yi,$ZodCIDRv6:()=>Hi,$ZodCUID:()=>Ri,$ZodCUID2:()=>Ci,$ZodCatch:()=>No,$ZodCheck:()=>j,$ZodCheckBigIntFormat:()=>gi,$ZodCheckEndsWith:()=>wi,$ZodCheckGreaterThan:()=>qt,$ZodCheckIncludes:()=>Ii,$ZodCheckLengthEquals:()=>bi,$ZodCheckLessThan:()=>Xt,$ZodCheckLowerCase:()=>ki,$ZodCheckMaxLength:()=>_i,$ZodCheckMaxSize:()=>vi,$ZodCheckMimeType:()=>Pi,$ZodCheckMinLength:()=>yi,$ZodCheckMinSize:()=>$i,$ZodCheckMultipleOf:()=>pi,$ZodCheckNumberFormat:()=>fi,$ZodCheckOverwrite:()=>Ui,$ZodCheckProperty:()=>ji,$ZodCheckRegex:()=>xi,$ZodCheckSizeEquals:()=>hi,$ZodCheckStartsWith:()=>Si,$ZodCheckStringFormat:()=>Ue,$ZodCheckUpperCase:()=>zi,$ZodCodec:()=>gt,$ZodCustom:()=>Jo,$ZodCustomStringFormat:()=>io,$ZodDate:()=>go,$ZodDefault:()=>Uo,$ZodDiscriminatedUnion:()=>_o,$ZodE164:()=>ro,$ZodEmail:()=>Ti,$ZodEmoji:()=>Ai,$ZodEncodeError:()=>ie,$ZodEnum:()=>zo,$ZodError:()=>ct,$ZodExactOptional:()=>jo,$ZodFile:()=>So,$ZodFunction:()=>Ro,$ZodGUID:()=>Di,$ZodIPv4:()=>Bi,$ZodIPv6:()=>Xi,$ZodISODate:()=>Ki,$ZodISODateTime:()=>Mi,$ZodISODuration:()=>Wi,$ZodISOTime:()=>Gi,$ZodIntersection:()=>yo,$ZodJWT:()=>no,$ZodKSUID:()=>Vi,$ZodLazy:()=>Fo,$ZodLiteral:()=>Io,$ZodMAC:()=>qi,$ZodMap:()=>xo,$ZodNaN:()=>To,$ZodNanoID:()=>Li,$ZodNever:()=>po,$ZodNonOptional:()=>Zo,$ZodNull:()=>so,$ZodNullable:()=>Po,$ZodNumber:()=>tr,$ZodNumberFormat:()=>oo,$ZodObject:()=>us,$ZodObjectJIT:()=>$o,$ZodOptional:()=>ir,$ZodPipe:()=>or,$ZodPrefault:()=>Oo,$ZodPreprocess:()=>Eo,$ZodPromise:()=>Co,$ZodReadonly:()=>Ao,$ZodRealError:()=>F,$ZodRecord:()=>bo,$ZodRegistry:()=>sr,$ZodSet:()=>ko,$ZodString:()=>$e,$ZodStringFormat:()=>S,$ZodSuccess:()=>Do,$ZodSymbol:()=>co,$ZodTemplateLiteral:()=>Lo,$ZodTransform:()=>wo,$ZodTuple:()=>nr,$ZodType:()=>x,$ZodULID:()=>Fi,$ZodURL:()=>Ei,$ZodUUID:()=>Ni,$ZodUndefined:()=>uo,$ZodUnion:()=>ft,$ZodUnknown:()=>mo,$ZodVoid:()=>fo,$ZodXID:()=>Ji,$ZodXor:()=>ho,$brand:()=>xn,$constructor:()=>l,$input:()=>Mo,$output:()=>Vo,Doc:()=>mt,JSONSchema:()=>ll,JSONSchemaGenerator:()=>Cr,NEVER:()=>bn,TimePrecision:()=>Bo,_any:()=>ga,_array:()=>xa,_base64:()=>wr,_base64url:()=>jr,_bigint:()=>ua,_boolean:()=>aa,_catch:()=>mf,_check:()=>sl,_cidrv4:()=>Ir,_cidrv6:()=>Sr,_coercedBigint:()=>sa,_coercedBoolean:()=>ca,_coercedDate:()=>ya,_coercedNumber:()=>ea,_coercedString:()=>Go,_cuid:()=>hr,_cuid2:()=>_r,_custom:()=>za,_date:()=>_a,_decode:()=>Ct,_decodeAsync:()=>Jt,_default:()=>sf,_discriminatedUnion:()=>qp,_e164:()=>Pr,_email:()=>dr,_emoji:()=>vr,_encode:()=>Rt,_encodeAsync:()=>Ft,_endsWith:()=>Ae,_enum:()=>rf,_file:()=>ka,_float32:()=>ra,_float64:()=>na,_gt:()=>Y,_gte:()=>A,_guid:()=>ht,_includes:()=>Te,_int:()=>ta,_int32:()=>ia,_int64:()=>la,_intersection:()=>Yp,_ipv4:()=>kr,_ipv6:()=>zr,_isoDate:()=>qo,_isoDateTime:()=>Xo,_isoDuration:()=>Ho,_isoTime:()=>Yo,_jwt:()=>Ur,_ksuid:()=>xr,_lazy:()=>vf,_length:()=>ye,_literal:()=>of,_lowercase:()=>De,_lt:()=>q,_lte:()=>K,_mac:()=>Wo,_map:()=>ef,_max:()=>K,_maxLength:()=>_e,_maxSize:()=>le,_mime:()=>Le,_min:()=>A,_minLength:()=>re,_minSize:()=>H,_multipleOf:()=>se,_nan:()=>ba,_nanoid:()=>$r,_nativeEnum:()=>nf,_negative:()=>Zr,_never:()=>$a,_nonnegative:()=>Nr,_nonoptional:()=>lf,_nonpositive:()=>Dr,_normalize:()=>Re,_null:()=>fa,_nullable:()=>uf,_number:()=>Qo,_optional:()=>cf,_overwrite:()=>B,_parse:()=>Se,_parseAsync:()=>we,_pipe:()=>pf,_positive:()=>Or,_promise:()=>$f,_property:()=>Tr,_readonly:()=>ff,_record:()=>Qp,_refine:()=>Ia,_regex:()=>Ze,_safeDecode:()=>Mt,_safeDecodeAsync:()=>Gt,_safeEncode:()=>Vt,_safeEncodeAsync:()=>Kt,_safeParse:()=>je,_safeParseAsync:()=>Pe,_set:()=>tf,_size:()=>he,_slugify:()=>Ve,_startsWith:()=>Ee,_string:()=>Ko,_stringFormat:()=>Me,_stringbool:()=>Pa,_success:()=>df,_superRefine:()=>Sa,_symbol:()=>ma,_templateLiteral:()=>gf,_toLowerCase:()=>Fe,_toUpperCase:()=>Je,_transform:()=>af,_trim:()=>Ce,_tuple:()=>Hp,_uint32:()=>oa,_uint64:()=>da,_ulid:()=>yr,_undefined:()=>pa,_union:()=>Bp,_unknown:()=>va,_uppercase:()=>Ne,_url:()=>_t,_uuid:()=>mr,_uuidv4:()=>pr,_uuidv6:()=>fr,_uuidv7:()=>gr,_void:()=>ha,_xid:()=>br,_xor:()=>Xp,clone:()=>T,config:()=>U,createStandardJSONSchemaMethod:()=>Ke,createToJSONSchemaMethod:()=>Ua,decode:()=>vm,decodeAsync:()=>hm,describe:()=>wa,encode:()=>gm,encodeAsync:()=>$m,extractDefs:()=>me,finalize:()=>pe,flattenError:()=>ut,formatError:()=>st,globalConfig:()=>fe,globalRegistry:()=>D,initializeContext:()=>de,isValidBase64:()=>Qi,isValidBase64URL:()=>is,isValidJWT:()=>os,locales:()=>$t,meta:()=>ja,parse:()=>At,parseAsync:()=>Lt,prettifyError:()=>Tn,process:()=>I,regexes:()=>M,registry:()=>lr,safeDecode:()=>ym,safeDecodeAsync:()=>xm,safeEncode:()=>_m,safeEncodeAsync:()=>bm,safeParse:()=>En,safeParseAsync:()=>An,toDotPath:()=>Au,toJSONSchema:()=>Rr,treeifyError:()=>Nn,util:()=>v,version:()=>Oi});var Zu,bn=Object.freeze({status:"aborted"});function l(t,r,i){function o(c,s){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:s,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(t))return;c._zod.traits.add(t),r(c,s);let u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let _=d[p];_ in c||(c[_]=u[_].bind(c))}}let e=i?.Parent??Object;class n extends e{}Object.defineProperty(n,"name",{value:t});function a(c){var s;let u=i?.Parent?new n:this;o(u,c),(s=u._zod).deferred??(s.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>i?.Parent&&c instanceof i.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}var xn=Symbol("zod_brand"),W=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ie=class extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}};(Zu=globalThis).__zod_globalConfig??(Zu.__zod_globalConfig={});var fe=globalThis.__zod_globalConfig;function U(t){return t&&Object.assign(fe,t),fe}var v={};ee(v,{BIGINT_FORMAT_RANGES:()=>Zn,Class:()=>zn,NUMBER_FORMAT_RANGES:()=>On,aborted:()=>ue,allowsEval:()=>wn,assert:()=>Wd,assertEqual:()=>Vd,assertIs:()=>Kd,assertNever:()=>Gd,assertNotEqual:()=>Md,assignProp:()=>ae,base64ToUint8Array:()=>Nu,base64urlToUint8Array:()=>lm,cached:()=>ze,captureStackTrace:()=>Et,cleanEnum:()=>sm,cleanRegex:()=>nt,clone:()=>T,cloneDef:()=>Xd,createTransparentProxy:()=>tm,defineLazy:()=>z,esc:()=>Tt,escapeRegex:()=>G,explicitlyAborted:()=>Dn,extend:()=>im,finalizeIssue:()=>E,floatSafeRemainder:()=>In,getElementAtPath:()=>qd,getEnumValues:()=>rt,getLengthableOrigin:()=>at,getParsedType:()=>em,getSizableOrigin:()=>ot,hexToUint8Array:()=>mm,isObject:()=>ge,isPlainObject:()=>ce,issue:()=>Ie,joinValues:()=>m,jsonStringifyReplacer:()=>ke,merge:()=>am,mergeDefs:()=>te,normalizeParams:()=>h,nullish:()=>oe,numKeys:()=>Qd,objectClone:()=>Bd,omit:()=>nm,optionalKeys:()=>Un,parsedType:()=>g,partial:()=>cm,pick:()=>rm,prefixIssues:()=>C,primitiveTypes:()=>Pn,promiseAllObject:()=>Yd,propertyKeyTypes:()=>it,randomString:()=>Hd,required:()=>um,safeExtend:()=>om,shallowClone:()=>jn,slugify:()=>Sn,stringifyPrimitive:()=>f,uint8ArrayToBase64:()=>Tu,uint8ArrayToBase64url:()=>dm,uint8ArrayToHex:()=>pm,unwrapMessage:()=>tt});function Vd(t){return t}function Md(t){return t}function Kd(t){}function Gd(t){throw new Error("Unexpected value in exhaustive check")}function Wd(t){}function rt(t){let r=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,e])=>r.indexOf(+o)===-1).map(([o,e])=>e)}function m(t,r="|"){return t.map(i=>f(i)).join(r)}function ke(t,r){return typeof r=="bigint"?r.toString():r}function ze(t){return{get value(){{let i=t();return Object.defineProperty(this,"value",{value:i}),i}throw new Error("cached value already set")}}}function oe(t){return t==null}function nt(t){let r=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;return t.slice(r,i)}function In(t,r){let i=t/r,o=Math.round(i),e=Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o)<e?0:i-o}var Du=Symbol("evaluating");function z(t,r,i){let o;Object.defineProperty(t,r,{get(){if(o!==Du)return o===void 0&&(o=Du,o=i()),o},set(e){Object.defineProperty(t,r,{value:e})},configurable:!0})}function Bd(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function ae(t,r,i){Object.defineProperty(t,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}function te(...t){let r={};for(let i of t){let o=Object.getOwnPropertyDescriptors(i);Object.assign(r,o)}return Object.defineProperties({},r)}function Xd(t){return te(t._zod.def)}function qd(t,r){return r?r.reduce((i,o)=>i?.[o],t):t}function Yd(t){let r=Object.keys(t),i=r.map(o=>t[o]);return Promise.all(i).then(o=>{let e={};for(let n=0;n<r.length;n++)e[r[n]]=o[n];return e})}function Hd(t=10){let r="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<t;o++)i+=r[Math.floor(Math.random()*r.length)];return i}function Tt(t){return JSON.stringify(t)}function Sn(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Et="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ge(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var wn=ze(()=>{if(fe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function ce(t){if(ge(t)===!1)return!1;let r=t.constructor;if(r===void 0||typeof r!="function")return!0;let i=r.prototype;return!(ge(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function jn(t){return ce(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Qd(t){let r=0;for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&r++;return r}var em=t=>{let r=typeof t;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},it=new Set(["string","number","symbol"]),Pn=new Set(["string","number","bigint","boolean","symbol","undefined"]);function G(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T(t,r,i){let o=new t._zod.constr(r??t._zod.def);return(!r||i?.parent)&&(o._zod.parent=t),o}function h(t){let r=t;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function tm(t){let r;return new Proxy({},{get(i,o,e){return r??(r=t()),Reflect.get(r,o,e)},set(i,o,e,n){return r??(r=t()),Reflect.set(r,o,e,n)},has(i,o){return r??(r=t()),Reflect.has(r,o)},deleteProperty(i,o){return r??(r=t()),Reflect.deleteProperty(r,o)},ownKeys(i){return r??(r=t()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(i,o){return r??(r=t()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(i,o,e){return r??(r=t()),Reflect.defineProperty(r,o,e)}})}function f(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Un(t){return Object.keys(t).filter(r=>t[r]._zod.optin==="optional"&&t[r]._zod.optout==="optional")}var On={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Zn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rm(t,r){let i=t._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let n=te(t._zod.def,{get shape(){let a={};for(let c in r){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(a[c]=i.shape[c])}return ae(this,"shape",a),a},checks:[]});return T(t,n)}function nm(t,r){let i=t._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let n=te(t._zod.def,{get shape(){let a={...t._zod.def.shape};for(let c in r){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&delete a[c]}return ae(this,"shape",a),a},checks:[]});return T(t,n)}function im(t,r){if(!ce(r))throw new Error("Invalid input to extend: expected a plain object");let i=t._zod.def.checks;if(i&&i.length>0){let n=t._zod.def.shape;for(let a in r)if(Object.getOwnPropertyDescriptor(n,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let e=te(t._zod.def,{get shape(){let n={...t._zod.def.shape,...r};return ae(this,"shape",n),n}});return T(t,e)}function om(t,r){if(!ce(r))throw new Error("Invalid input to safeExtend: expected a plain object");let i=te(t._zod.def,{get shape(){let o={...t._zod.def.shape,...r};return ae(this,"shape",o),o}});return T(t,i)}function am(t,r){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let i=te(t._zod.def,{get shape(){let o={...t._zod.def.shape,...r._zod.def.shape};return ae(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return T(t,i)}function cm(t,r,i){let e=r._zod.def.checks;if(e&&e.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=te(r._zod.def,{get shape(){let c=r._zod.def.shape,s={...c};if(i)for(let u in i){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);i[u]&&(s[u]=t?new t({type:"optional",innerType:c[u]}):c[u])}else for(let u in c)s[u]=t?new t({type:"optional",innerType:c[u]}):c[u];return ae(this,"shape",s),s},checks:[]});return T(r,a)}function um(t,r,i){let o=te(r._zod.def,{get shape(){let e=r._zod.def.shape,n={...e};if(i)for(let a in i){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);i[a]&&(n[a]=new t({type:"nonoptional",innerType:e[a]}))}else for(let a in e)n[a]=new t({type:"nonoptional",innerType:e[a]});return ae(this,"shape",n),n}});return T(r,o)}function ue(t,r=0){if(t.aborted===!0)return!0;for(let i=r;i<t.issues.length;i++)if(t.issues[i]?.continue!==!0)return!0;return!1}function Dn(t,r=0){if(t.aborted===!0)return!0;for(let i=r;i<t.issues.length;i++)if(t.issues[i]?.continue===!1)return!0;return!1}function C(t,r){return r.map(i=>{var o;return(o=i).path??(o.path=[]),i.path.unshift(t),i})}function tt(t){return typeof t=="string"?t:t?.message}function E(t,r,i){let o=t.message?t.message:tt(t.inst?._zod.def?.error?.(t))??tt(r?.error?.(t))??tt(i.customError?.(t))??tt(i.localeError?.(t))??"Invalid input",{inst:e,continue:n,input:a,...c}=t;return c.path??(c.path=[]),c.message=o,r?.reportInput&&(c.input=a),c}function ot(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function at(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function g(t){let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let i=t;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return r}function Ie(...t){let[r,i,o]=t;return typeof r=="string"?{message:r,code:"custom",input:i,inst:o}:{...r}}function sm(t){return Object.entries(t).filter(([r,i])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Nu(t){let r=atob(t),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i}function Tu(t){let r="";for(let i=0;i<t.length;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function lm(t){let r=t.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-r.length%4)%4);return Nu(r+i)}function dm(t){return Tu(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mm(t){let r=t.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)i[o/2]=Number.parseInt(r.slice(o,o+2),16);return i}function pm(t){return Array.from(t).map(r=>r.toString(16).padStart(2,"0")).join("")}var zn=class{constructor(...r){}};var Eu=(t,r)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:r,enumerable:!1}),t.message=JSON.stringify(r,ke,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},ct=l("$ZodError",Eu),F=l("$ZodError",Eu,{Parent:Error});function ut(t,r=i=>i.message){let i={},o=[];for(let e of t.issues)e.path.length>0?(i[e.path[0]]=i[e.path[0]]||[],i[e.path[0]].push(r(e))):o.push(r(e));return{formErrors:o,fieldErrors:i}}function st(t,r=i=>i.message){let i={_errors:[]},o=(e,n=[])=>{for(let a of e.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>o({issues:c},[...n,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...n,...a.path]);else{let c=[...n,...a.path];if(c.length===0)i._errors.push(r(a));else{let s=i,u=0;for(;u<c.length;){let d=c[u];u===c.length-1?(s[d]=s[d]||{_errors:[]},s[d]._errors.push(r(a))):s[d]=s[d]||{_errors:[]},s=s[d],u++}}}};return o(t),i}function Nn(t,r=i=>i.message){let i={errors:[]},o=(e,n=[])=>{var a,c;for(let s of e.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>o({issues:u},[...n,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...n,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...n,...s.path]);else{let u=[...n,...s.path];if(u.length===0){i.errors.push(r(s));continue}let d=i,p=0;for(;p<u.length;){let _=u[p],$=p===u.length-1;typeof _=="string"?(d.properties??(d.properties={}),(a=d.properties)[_]??(a[_]={errors:[]}),d=d.properties[_]):(d.items??(d.items=[]),(c=d.items)[_]??(c[_]={errors:[]}),d=d.items[_]),$&&d.errors.push(r(s)),p++}}};return o(t),i}function Au(t){let r=[],i=t.map(o=>typeof o=="object"?o.key:o);for(let o of i)typeof o=="number"?r.push(`[${o}]`):typeof o=="symbol"?r.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?r.push(`[${JSON.stringify(o)}]`):(r.length&&r.push("."),r.push(o));return r.join("")}function Tn(t){let r=[],i=[...t.issues].sort((o,e)=>(o.path??[]).length-(e.path??[]).length);for(let o of i)r.push(`\u2716 ${o.message}`),o.path?.length&&r.push(` \u2192 at ${Au(o.path)}`);return r.join(`
3
+ import{c as ee,u as Uu}from"./chunk-4WV7FA5L.js";var Ou="0.6.1";import{randomUUID as Tf}from"crypto";import{chmod as Ef,mkdir as Af,readFile as Zd,writeFile as Lf}from"fs/promises";import{homedir as Rf}from"os";import{join as Dd}from"path";var V={};ee(V,{$brand:()=>xn,$input:()=>Mo,$output:()=>Vo,NEVER:()=>bn,TimePrecision:()=>Bo,ZodAny:()=>Ac,ZodArray:()=>Fc,ZodBase64:()=>un,ZodBase64URL:()=>sn,ZodBigInt:()=>Qe,ZodBigIntFormat:()=>mn,ZodBoolean:()=>He,ZodCIDRv4:()=>an,ZodCIDRv6:()=>cn,ZodCUID:()=>Hr,ZodCUID2:()=>Qr,ZodCatch:()=>su,ZodCodec:()=>Zt,ZodCustom:()=>Dt,ZodCustomStringFormat:()=>qe,ZodDate:()=>wt,ZodDefault:()=>nu,ZodDiscriminatedUnion:()=>Vc,ZodE164:()=>ln,ZodEmail:()=>Xr,ZodEmoji:()=>qr,ZodEnum:()=>Be,ZodError:()=>yf,ZodExactOptional:()=>eu,ZodFile:()=>Hc,ZodFirstPartyTypeKind:()=>xu,ZodFunction:()=>_u,ZodGUID:()=>xt,ZodIPv4:()=>nn,ZodIPv6:()=>on,ZodISODate:()=>Vr,ZodISODateTime:()=>Jr,ZodISODuration:()=>Kr,ZodISOTime:()=>Mr,ZodIntersection:()=>Mc,ZodIssueCode:()=>xf,ZodJWT:()=>dn,ZodKSUID:()=>rn,ZodLazy:()=>vu,ZodLiteral:()=>Yc,ZodMAC:()=>Uc,ZodMap:()=>Xc,ZodNaN:()=>du,ZodNanoID:()=>Yr,ZodNever:()=>Rc,ZodNonOptional:()=>hn,ZodNull:()=>Tc,ZodNullable:()=>ru,ZodNumber:()=>Ye,ZodNumberFormat:()=>xe,ZodObject:()=>Pt,ZodOptional:()=>$n,ZodPipe:()=>Ot,ZodPrefault:()=>ou,ZodPreprocess:()=>mu,ZodPromise:()=>hu,ZodReadonly:()=>pu,ZodRealError:()=>J,ZodRecord:()=>We,ZodSet:()=>qc,ZodString:()=>Xe,ZodStringFormat:()=>w,ZodSuccess:()=>uu,ZodSymbol:()=>Dc,ZodTemplateLiteral:()=>gu,ZodTransform:()=>Qc,ZodTuple:()=>Gc,ZodType:()=>k,ZodULID:()=>en,ZodURL:()=>St,ZodUUID:()=>Q,ZodUndefined:()=>Nc,ZodUnion:()=>Ut,ZodUnknown:()=>Lc,ZodVoid:()=>Cc,ZodXID:()=>tn,ZodXor:()=>Jc,_ZodString:()=>Br,_default:()=>iu,_function:()=>_d,any:()=>ql,array:()=>jt,base64:()=>Dl,base64url:()=>Nl,bigint:()=>Kl,boolean:()=>Zc,catch:()=>lu,check:()=>yd,cidrv4:()=>Ol,cidrv6:()=>Zl,clone:()=>T,codec:()=>gd,coerce:()=>ku,config:()=>U,core:()=>ne,cuid:()=>kl,cuid2:()=>zl,custom:()=>bd,date:()=>Hl,decode:()=>kc,decodeAsync:()=>Ic,describe:()=>xd,discriminatedUnion:()=>id,e164:()=>Tl,email:()=>pl,emoji:()=>bl,encode:()=>xc,encodeAsync:()=>zc,endsWith:()=>Ae,enum:()=>gn,exactOptional:()=>tu,file:()=>dd,flattenError:()=>ut,float32:()=>Fl,float64:()=>Jl,formatError:()=>st,fromJSONSchema:()=>Pd,function:()=>_d,getErrorMap:()=>zf,globalRegistry:()=>D,gt:()=>Y,gte:()=>A,guid:()=>fl,hash:()=>Cl,hex:()=>Rl,hostname:()=>Ll,httpUrl:()=>yl,includes:()=>Te,instanceof:()=>zd,int:()=>Gr,int32:()=>Vl,int64:()=>Gl,intersection:()=>Kc,invertCodec:()=>vd,ipv4:()=>jl,ipv6:()=>Ul,iso:()=>Ge,json:()=>Sd,jwt:()=>El,keyof:()=>Ql,ksuid:()=>wl,lazy:()=>$u,length:()=>ye,literal:()=>ld,locales:()=>$t,looseObject:()=>rd,looseRecord:()=>ad,lowercase:()=>De,lt:()=>q,lte:()=>K,mac:()=>Pl,map:()=>cd,maxLength:()=>_e,maxSize:()=>le,meta:()=>kd,mime:()=>Le,minLength:()=>re,minSize:()=>H,multipleOf:()=>se,nan:()=>fd,nanoid:()=>xl,nativeEnum:()=>sd,negative:()=>Zr,never:()=>pn,nonnegative:()=>Nr,nonoptional:()=>cu,nonpositive:()=>Dr,normalize:()=>Re,null:()=>Ec,nullable:()=>zt,nullish:()=>md,number:()=>Oc,object:()=>ed,optional:()=>kt,overwrite:()=>B,parse:()=>hc,parseAsync:()=>_c,partialRecord:()=>od,pipe:()=>Wr,positive:()=>Or,prefault:()=>au,preprocess:()=>wd,prettifyError:()=>Tn,promise:()=>hd,property:()=>Tr,readonly:()=>fu,record:()=>Bc,refine:()=>yu,regex:()=>Ze,regexes:()=>M,registry:()=>lr,safeDecode:()=>wc,safeDecodeAsync:()=>Pc,safeEncode:()=>Sc,safeEncodeAsync:()=>jc,safeParse:()=>yc,safeParseAsync:()=>bc,set:()=>ud,setErrorMap:()=>kf,size:()=>he,slugify:()=>Ve,startsWith:()=>Ee,strictObject:()=>td,string:()=>bt,stringFormat:()=>Al,stringbool:()=>Id,success:()=>pd,superRefine:()=>bu,symbol:()=>Bl,templateLiteral:()=>$d,toJSONSchema:()=>Rr,toLowerCase:()=>Fe,toUpperCase:()=>Je,transform:()=>vn,treeifyError:()=>Nn,trim:()=>Ce,tuple:()=>Wc,uint32:()=>Ml,uint64:()=>Wl,ulid:()=>Il,undefined:()=>Xl,union:()=>fn,unknown:()=>be,uppercase:()=>Ne,url:()=>_l,util:()=>v,uuid:()=>gl,uuidv4:()=>vl,uuidv6:()=>$l,uuidv7:()=>hl,void:()=>Yl,xid:()=>Sl,xor:()=>nd});var ne={};ee(ne,{$ZodAny:()=>lo,$ZodArray:()=>vo,$ZodAsyncError:()=>W,$ZodBase64:()=>eo,$ZodBase64URL:()=>to,$ZodBigInt:()=>rr,$ZodBigIntFormat:()=>ao,$ZodBoolean:()=>pt,$ZodCIDRv4:()=>Yi,$ZodCIDRv6:()=>Hi,$ZodCUID:()=>Ri,$ZodCUID2:()=>Ci,$ZodCatch:()=>No,$ZodCheck:()=>j,$ZodCheckBigIntFormat:()=>gi,$ZodCheckEndsWith:()=>wi,$ZodCheckGreaterThan:()=>qt,$ZodCheckIncludes:()=>Ii,$ZodCheckLengthEquals:()=>bi,$ZodCheckLessThan:()=>Xt,$ZodCheckLowerCase:()=>ki,$ZodCheckMaxLength:()=>_i,$ZodCheckMaxSize:()=>vi,$ZodCheckMimeType:()=>Pi,$ZodCheckMinLength:()=>yi,$ZodCheckMinSize:()=>$i,$ZodCheckMultipleOf:()=>pi,$ZodCheckNumberFormat:()=>fi,$ZodCheckOverwrite:()=>Ui,$ZodCheckProperty:()=>ji,$ZodCheckRegex:()=>xi,$ZodCheckSizeEquals:()=>hi,$ZodCheckStartsWith:()=>Si,$ZodCheckStringFormat:()=>Ue,$ZodCheckUpperCase:()=>zi,$ZodCodec:()=>gt,$ZodCustom:()=>Jo,$ZodCustomStringFormat:()=>io,$ZodDate:()=>go,$ZodDefault:()=>Uo,$ZodDiscriminatedUnion:()=>_o,$ZodE164:()=>ro,$ZodEmail:()=>Ti,$ZodEmoji:()=>Ai,$ZodEncodeError:()=>ie,$ZodEnum:()=>zo,$ZodError:()=>ct,$ZodExactOptional:()=>jo,$ZodFile:()=>So,$ZodFunction:()=>Ro,$ZodGUID:()=>Di,$ZodIPv4:()=>Bi,$ZodIPv6:()=>Xi,$ZodISODate:()=>Ki,$ZodISODateTime:()=>Mi,$ZodISODuration:()=>Wi,$ZodISOTime:()=>Gi,$ZodIntersection:()=>yo,$ZodJWT:()=>no,$ZodKSUID:()=>Vi,$ZodLazy:()=>Fo,$ZodLiteral:()=>Io,$ZodMAC:()=>qi,$ZodMap:()=>xo,$ZodNaN:()=>To,$ZodNanoID:()=>Li,$ZodNever:()=>po,$ZodNonOptional:()=>Zo,$ZodNull:()=>so,$ZodNullable:()=>Po,$ZodNumber:()=>tr,$ZodNumberFormat:()=>oo,$ZodObject:()=>us,$ZodObjectJIT:()=>$o,$ZodOptional:()=>ir,$ZodPipe:()=>or,$ZodPrefault:()=>Oo,$ZodPreprocess:()=>Eo,$ZodPromise:()=>Co,$ZodReadonly:()=>Ao,$ZodRealError:()=>F,$ZodRecord:()=>bo,$ZodRegistry:()=>sr,$ZodSet:()=>ko,$ZodString:()=>$e,$ZodStringFormat:()=>S,$ZodSuccess:()=>Do,$ZodSymbol:()=>co,$ZodTemplateLiteral:()=>Lo,$ZodTransform:()=>wo,$ZodTuple:()=>nr,$ZodType:()=>x,$ZodULID:()=>Fi,$ZodURL:()=>Ei,$ZodUUID:()=>Ni,$ZodUndefined:()=>uo,$ZodUnion:()=>ft,$ZodUnknown:()=>mo,$ZodVoid:()=>fo,$ZodXID:()=>Ji,$ZodXor:()=>ho,$brand:()=>xn,$constructor:()=>l,$input:()=>Mo,$output:()=>Vo,Doc:()=>mt,JSONSchema:()=>ll,JSONSchemaGenerator:()=>Cr,NEVER:()=>bn,TimePrecision:()=>Bo,_any:()=>ga,_array:()=>xa,_base64:()=>wr,_base64url:()=>jr,_bigint:()=>ua,_boolean:()=>aa,_catch:()=>mf,_check:()=>sl,_cidrv4:()=>Ir,_cidrv6:()=>Sr,_coercedBigint:()=>sa,_coercedBoolean:()=>ca,_coercedDate:()=>ya,_coercedNumber:()=>ea,_coercedString:()=>Go,_cuid:()=>hr,_cuid2:()=>_r,_custom:()=>za,_date:()=>_a,_decode:()=>Ct,_decodeAsync:()=>Jt,_default:()=>sf,_discriminatedUnion:()=>qp,_e164:()=>Pr,_email:()=>dr,_emoji:()=>vr,_encode:()=>Rt,_encodeAsync:()=>Ft,_endsWith:()=>Ae,_enum:()=>rf,_file:()=>ka,_float32:()=>ra,_float64:()=>na,_gt:()=>Y,_gte:()=>A,_guid:()=>ht,_includes:()=>Te,_int:()=>ta,_int32:()=>ia,_int64:()=>la,_intersection:()=>Yp,_ipv4:()=>kr,_ipv6:()=>zr,_isoDate:()=>qo,_isoDateTime:()=>Xo,_isoDuration:()=>Ho,_isoTime:()=>Yo,_jwt:()=>Ur,_ksuid:()=>xr,_lazy:()=>vf,_length:()=>ye,_literal:()=>of,_lowercase:()=>De,_lt:()=>q,_lte:()=>K,_mac:()=>Wo,_map:()=>ef,_max:()=>K,_maxLength:()=>_e,_maxSize:()=>le,_mime:()=>Le,_min:()=>A,_minLength:()=>re,_minSize:()=>H,_multipleOf:()=>se,_nan:()=>ba,_nanoid:()=>$r,_nativeEnum:()=>nf,_negative:()=>Zr,_never:()=>$a,_nonnegative:()=>Nr,_nonoptional:()=>lf,_nonpositive:()=>Dr,_normalize:()=>Re,_null:()=>fa,_nullable:()=>uf,_number:()=>Qo,_optional:()=>cf,_overwrite:()=>B,_parse:()=>Se,_parseAsync:()=>we,_pipe:()=>pf,_positive:()=>Or,_promise:()=>$f,_property:()=>Tr,_readonly:()=>ff,_record:()=>Qp,_refine:()=>Ia,_regex:()=>Ze,_safeDecode:()=>Mt,_safeDecodeAsync:()=>Gt,_safeEncode:()=>Vt,_safeEncodeAsync:()=>Kt,_safeParse:()=>je,_safeParseAsync:()=>Pe,_set:()=>tf,_size:()=>he,_slugify:()=>Ve,_startsWith:()=>Ee,_string:()=>Ko,_stringFormat:()=>Me,_stringbool:()=>Pa,_success:()=>df,_superRefine:()=>Sa,_symbol:()=>ma,_templateLiteral:()=>gf,_toLowerCase:()=>Fe,_toUpperCase:()=>Je,_transform:()=>af,_trim:()=>Ce,_tuple:()=>Hp,_uint32:()=>oa,_uint64:()=>da,_ulid:()=>yr,_undefined:()=>pa,_union:()=>Bp,_unknown:()=>va,_uppercase:()=>Ne,_url:()=>_t,_uuid:()=>mr,_uuidv4:()=>pr,_uuidv6:()=>fr,_uuidv7:()=>gr,_void:()=>ha,_xid:()=>br,_xor:()=>Xp,clone:()=>T,config:()=>U,createStandardJSONSchemaMethod:()=>Ke,createToJSONSchemaMethod:()=>Ua,decode:()=>vm,decodeAsync:()=>hm,describe:()=>wa,encode:()=>gm,encodeAsync:()=>$m,extractDefs:()=>me,finalize:()=>pe,flattenError:()=>ut,formatError:()=>st,globalConfig:()=>fe,globalRegistry:()=>D,initializeContext:()=>de,isValidBase64:()=>Qi,isValidBase64URL:()=>is,isValidJWT:()=>os,locales:()=>$t,meta:()=>ja,parse:()=>At,parseAsync:()=>Lt,prettifyError:()=>Tn,process:()=>I,regexes:()=>M,registry:()=>lr,safeDecode:()=>ym,safeDecodeAsync:()=>xm,safeEncode:()=>_m,safeEncodeAsync:()=>bm,safeParse:()=>En,safeParseAsync:()=>An,toDotPath:()=>Au,toJSONSchema:()=>Rr,treeifyError:()=>Nn,util:()=>v,version:()=>Oi});var Zu,bn=Object.freeze({status:"aborted"});function l(t,r,i){function o(c,s){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:s,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(t))return;c._zod.traits.add(t),r(c,s);let u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let _=d[p];_ in c||(c[_]=u[_].bind(c))}}let e=i?.Parent??Object;class n extends e{}Object.defineProperty(n,"name",{value:t});function a(c){var s;let u=i?.Parent?new n:this;o(u,c),(s=u._zod).deferred??(s.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>i?.Parent&&c instanceof i.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}var xn=Symbol("zod_brand"),W=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ie=class extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}};(Zu=globalThis).__zod_globalConfig??(Zu.__zod_globalConfig={});var fe=globalThis.__zod_globalConfig;function U(t){return t&&Object.assign(fe,t),fe}var v={};ee(v,{BIGINT_FORMAT_RANGES:()=>Zn,Class:()=>zn,NUMBER_FORMAT_RANGES:()=>On,aborted:()=>ue,allowsEval:()=>wn,assert:()=>Wd,assertEqual:()=>Vd,assertIs:()=>Kd,assertNever:()=>Gd,assertNotEqual:()=>Md,assignProp:()=>ae,base64ToUint8Array:()=>Nu,base64urlToUint8Array:()=>lm,cached:()=>ze,captureStackTrace:()=>Et,cleanEnum:()=>sm,cleanRegex:()=>nt,clone:()=>T,cloneDef:()=>Xd,createTransparentProxy:()=>tm,defineLazy:()=>z,esc:()=>Tt,escapeRegex:()=>G,explicitlyAborted:()=>Dn,extend:()=>im,finalizeIssue:()=>E,floatSafeRemainder:()=>In,getElementAtPath:()=>qd,getEnumValues:()=>rt,getLengthableOrigin:()=>at,getParsedType:()=>em,getSizableOrigin:()=>ot,hexToUint8Array:()=>mm,isObject:()=>ge,isPlainObject:()=>ce,issue:()=>Ie,joinValues:()=>m,jsonStringifyReplacer:()=>ke,merge:()=>am,mergeDefs:()=>te,normalizeParams:()=>h,nullish:()=>oe,numKeys:()=>Qd,objectClone:()=>Bd,omit:()=>nm,optionalKeys:()=>Un,parsedType:()=>g,partial:()=>cm,pick:()=>rm,prefixIssues:()=>C,primitiveTypes:()=>Pn,promiseAllObject:()=>Yd,propertyKeyTypes:()=>it,randomString:()=>Hd,required:()=>um,safeExtend:()=>om,shallowClone:()=>jn,slugify:()=>Sn,stringifyPrimitive:()=>f,uint8ArrayToBase64:()=>Tu,uint8ArrayToBase64url:()=>dm,uint8ArrayToHex:()=>pm,unwrapMessage:()=>tt});function Vd(t){return t}function Md(t){return t}function Kd(t){}function Gd(t){throw new Error("Unexpected value in exhaustive check")}function Wd(t){}function rt(t){let r=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,e])=>r.indexOf(+o)===-1).map(([o,e])=>e)}function m(t,r="|"){return t.map(i=>f(i)).join(r)}function ke(t,r){return typeof r=="bigint"?r.toString():r}function ze(t){return{get value(){{let i=t();return Object.defineProperty(this,"value",{value:i}),i}throw new Error("cached value already set")}}}function oe(t){return t==null}function nt(t){let r=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;return t.slice(r,i)}function In(t,r){let i=t/r,o=Math.round(i),e=Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o)<e?0:i-o}var Du=Symbol("evaluating");function z(t,r,i){let o;Object.defineProperty(t,r,{get(){if(o!==Du)return o===void 0&&(o=Du,o=i()),o},set(e){Object.defineProperty(t,r,{value:e})},configurable:!0})}function Bd(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function ae(t,r,i){Object.defineProperty(t,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}function te(...t){let r={};for(let i of t){let o=Object.getOwnPropertyDescriptors(i);Object.assign(r,o)}return Object.defineProperties({},r)}function Xd(t){return te(t._zod.def)}function qd(t,r){return r?r.reduce((i,o)=>i?.[o],t):t}function Yd(t){let r=Object.keys(t),i=r.map(o=>t[o]);return Promise.all(i).then(o=>{let e={};for(let n=0;n<r.length;n++)e[r[n]]=o[n];return e})}function Hd(t=10){let r="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<t;o++)i+=r[Math.floor(Math.random()*r.length)];return i}function Tt(t){return JSON.stringify(t)}function Sn(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Et="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ge(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var wn=ze(()=>{if(fe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function ce(t){if(ge(t)===!1)return!1;let r=t.constructor;if(r===void 0||typeof r!="function")return!0;let i=r.prototype;return!(ge(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function jn(t){return ce(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Qd(t){let r=0;for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&r++;return r}var em=t=>{let r=typeof t;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${r}`)}},it=new Set(["string","number","symbol"]),Pn=new Set(["string","number","bigint","boolean","symbol","undefined"]);function G(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T(t,r,i){let o=new t._zod.constr(r??t._zod.def);return(!r||i?.parent)&&(o._zod.parent=t),o}function h(t){let r=t;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function tm(t){let r;return new Proxy({},{get(i,o,e){return r??(r=t()),Reflect.get(r,o,e)},set(i,o,e,n){return r??(r=t()),Reflect.set(r,o,e,n)},has(i,o){return r??(r=t()),Reflect.has(r,o)},deleteProperty(i,o){return r??(r=t()),Reflect.deleteProperty(r,o)},ownKeys(i){return r??(r=t()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(i,o){return r??(r=t()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(i,o,e){return r??(r=t()),Reflect.defineProperty(r,o,e)}})}function f(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Un(t){return Object.keys(t).filter(r=>t[r]._zod.optin==="optional"&&t[r]._zod.optout==="optional")}var On={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Zn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rm(t,r){let i=t._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let n=te(t._zod.def,{get shape(){let a={};for(let c in r){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(a[c]=i.shape[c])}return ae(this,"shape",a),a},checks:[]});return T(t,n)}function nm(t,r){let i=t._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let n=te(t._zod.def,{get shape(){let a={...t._zod.def.shape};for(let c in r){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&delete a[c]}return ae(this,"shape",a),a},checks:[]});return T(t,n)}function im(t,r){if(!ce(r))throw new Error("Invalid input to extend: expected a plain object");let i=t._zod.def.checks;if(i&&i.length>0){let n=t._zod.def.shape;for(let a in r)if(Object.getOwnPropertyDescriptor(n,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let e=te(t._zod.def,{get shape(){let n={...t._zod.def.shape,...r};return ae(this,"shape",n),n}});return T(t,e)}function om(t,r){if(!ce(r))throw new Error("Invalid input to safeExtend: expected a plain object");let i=te(t._zod.def,{get shape(){let o={...t._zod.def.shape,...r};return ae(this,"shape",o),o}});return T(t,i)}function am(t,r){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let i=te(t._zod.def,{get shape(){let o={...t._zod.def.shape,...r._zod.def.shape};return ae(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return T(t,i)}function cm(t,r,i){let e=r._zod.def.checks;if(e&&e.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=te(r._zod.def,{get shape(){let c=r._zod.def.shape,s={...c};if(i)for(let u in i){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);i[u]&&(s[u]=t?new t({type:"optional",innerType:c[u]}):c[u])}else for(let u in c)s[u]=t?new t({type:"optional",innerType:c[u]}):c[u];return ae(this,"shape",s),s},checks:[]});return T(r,a)}function um(t,r,i){let o=te(r._zod.def,{get shape(){let e=r._zod.def.shape,n={...e};if(i)for(let a in i){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);i[a]&&(n[a]=new t({type:"nonoptional",innerType:e[a]}))}else for(let a in e)n[a]=new t({type:"nonoptional",innerType:e[a]});return ae(this,"shape",n),n}});return T(r,o)}function ue(t,r=0){if(t.aborted===!0)return!0;for(let i=r;i<t.issues.length;i++)if(t.issues[i]?.continue!==!0)return!0;return!1}function Dn(t,r=0){if(t.aborted===!0)return!0;for(let i=r;i<t.issues.length;i++)if(t.issues[i]?.continue===!1)return!0;return!1}function C(t,r){return r.map(i=>{var o;return(o=i).path??(o.path=[]),i.path.unshift(t),i})}function tt(t){return typeof t=="string"?t:t?.message}function E(t,r,i){let o=t.message?t.message:tt(t.inst?._zod.def?.error?.(t))??tt(r?.error?.(t))??tt(i.customError?.(t))??tt(i.localeError?.(t))??"Invalid input",{inst:e,continue:n,input:a,...c}=t;return c.path??(c.path=[]),c.message=o,r?.reportInput&&(c.input=a),c}function ot(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function at(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function g(t){let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let i=t;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return r}function Ie(...t){let[r,i,o]=t;return typeof r=="string"?{message:r,code:"custom",input:i,inst:o}:{...r}}function sm(t){return Object.entries(t).filter(([r,i])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Nu(t){let r=atob(t),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i}function Tu(t){let r="";for(let i=0;i<t.length;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function lm(t){let r=t.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-r.length%4)%4);return Nu(r+i)}function dm(t){return Tu(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mm(t){let r=t.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");let i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)i[o/2]=Number.parseInt(r.slice(o,o+2),16);return i}function pm(t){return Array.from(t).map(r=>r.toString(16).padStart(2,"0")).join("")}var zn=class{constructor(...r){}};var Eu=(t,r)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:r,enumerable:!1}),t.message=JSON.stringify(r,ke,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},ct=l("$ZodError",Eu),F=l("$ZodError",Eu,{Parent:Error});function ut(t,r=i=>i.message){let i={},o=[];for(let e of t.issues)e.path.length>0?(i[e.path[0]]=i[e.path[0]]||[],i[e.path[0]].push(r(e))):o.push(r(e));return{formErrors:o,fieldErrors:i}}function st(t,r=i=>i.message){let i={_errors:[]},o=(e,n=[])=>{for(let a of e.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>o({issues:c},[...n,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...n,...a.path]);else{let c=[...n,...a.path];if(c.length===0)i._errors.push(r(a));else{let s=i,u=0;for(;u<c.length;){let d=c[u];u===c.length-1?(s[d]=s[d]||{_errors:[]},s[d]._errors.push(r(a))):s[d]=s[d]||{_errors:[]},s=s[d],u++}}}};return o(t),i}function Nn(t,r=i=>i.message){let i={errors:[]},o=(e,n=[])=>{var a,c;for(let s of e.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>o({issues:u},[...n,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...n,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...n,...s.path]);else{let u=[...n,...s.path];if(u.length===0){i.errors.push(r(s));continue}let d=i,p=0;for(;p<u.length;){let _=u[p],$=p===u.length-1;typeof _=="string"?(d.properties??(d.properties={}),(a=d.properties)[_]??(a[_]={errors:[]}),d=d.properties[_]):(d.items??(d.items=[]),(c=d.items)[_]??(c[_]={errors:[]}),d=d.items[_]),$&&d.errors.push(r(s)),p++}}};return o(t),i}function Au(t){let r=[],i=t.map(o=>typeof o=="object"?o.key:o);for(let o of i)typeof o=="number"?r.push(`[${o}]`):typeof o=="symbol"?r.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?r.push(`[${JSON.stringify(o)}]`):(r.length&&r.push("."),r.push(o));return r.join("")}function Tn(t){let r=[],i=[...t.issues].sort((o,e)=>(o.path??[]).length-(e.path??[]).length);for(let o of i)r.push(`\u2716 ${o.message}`),o.path?.length&&r.push(` \u2192 at ${Au(o.path)}`);return r.join(`
4
4
  `)}var Se=t=>(r,i,o,e)=>{let n=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:i,issues:[]},n);if(a instanceof Promise)throw new W;if(a.issues.length){let c=new(e?.Err??t)(a.issues.map(s=>E(s,n,U())));throw Et(c,e?.callee),c}return a.value},At=Se(F),we=t=>async(r,i,o,e)=>{let n=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:i,issues:[]},n);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(e?.Err??t)(a.issues.map(s=>E(s,n,U())));throw Et(c,e?.callee),c}return a.value},Lt=we(F),je=t=>(r,i,o)=>{let e=o?{...o,async:!1}:{async:!1},n=r._zod.run({value:i,issues:[]},e);if(n instanceof Promise)throw new W;return n.issues.length?{success:!1,error:new(t??ct)(n.issues.map(a=>E(a,e,U())))}:{success:!0,data:n.value}},En=je(F),Pe=t=>async(r,i,o)=>{let e=o?{...o,async:!0}:{async:!0},n=r._zod.run({value:i,issues:[]},e);return n instanceof Promise&&(n=await n),n.issues.length?{success:!1,error:new t(n.issues.map(a=>E(a,e,U())))}:{success:!0,data:n.value}},An=Pe(F),Rt=t=>(r,i,o)=>{let e=o?{...o,direction:"backward"}:{direction:"backward"};return Se(t)(r,i,e)},gm=Rt(F),Ct=t=>(r,i,o)=>Se(t)(r,i,o),vm=Ct(F),Ft=t=>async(r,i,o)=>{let e=o?{...o,direction:"backward"}:{direction:"backward"};return we(t)(r,i,e)},$m=Ft(F),Jt=t=>async(r,i,o)=>we(t)(r,i,o),hm=Jt(F),Vt=t=>(r,i,o)=>{let e=o?{...o,direction:"backward"}:{direction:"backward"};return je(t)(r,i,e)},_m=Vt(F),Mt=t=>(r,i,o)=>je(t)(r,i,o),ym=Mt(F),Kt=t=>async(r,i,o)=>{let e=o?{...o,direction:"backward"}:{direction:"backward"};return Pe(t)(r,i,e)},bm=Kt(F),Gt=t=>async(r,i,o)=>Pe(t)(r,i,o),xm=Gt(F);var M={};ee(M,{base64:()=>Qn,base64url:()=>Wt,bigint:()=>ai,boolean:()=>ui,browserEmail:()=>Um,cidrv4:()=>Yn,cidrv6:()=>Hn,cuid:()=>Ln,cuid2:()=>Rn,date:()=>ri,datetime:()=>ii,domain:()=>Dm,duration:()=>Mn,e164:()=>ti,email:()=>Gn,emoji:()=>Wn,extendedDuration:()=>km,guid:()=>Kn,hex:()=>Nm,hostname:()=>Zm,html5Email:()=>wm,httpProtocol:()=>ei,idnEmail:()=>Pm,integer:()=>ci,ipv4:()=>Bn,ipv6:()=>Xn,ksuid:()=>Jn,lowercase:()=>di,mac:()=>qn,md5_base64:()=>Em,md5_base64url:()=>Am,md5_hex:()=>Tm,nanoid:()=>Vn,null:()=>si,number:()=>Bt,rfc5322Email:()=>jm,sha1_base64:()=>Rm,sha1_base64url:()=>Cm,sha1_hex:()=>Lm,sha256_base64:()=>Jm,sha256_base64url:()=>Vm,sha256_hex:()=>Fm,sha384_base64:()=>Km,sha384_base64url:()=>Gm,sha384_hex:()=>Mm,sha512_base64:()=>Bm,sha512_base64url:()=>Xm,sha512_hex:()=>Wm,string:()=>oi,time:()=>ni,ulid:()=>Cn,undefined:()=>li,unicodeEmail:()=>Lu,uppercase:()=>mi,uuid:()=>ve,uuid4:()=>zm,uuid6:()=>Im,uuid7:()=>Sm,xid:()=>Fn});var Ln=/^[cC][0-9a-z]{6,}$/,Rn=/^[0-9a-z]+$/,Cn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fn=/^[0-9a-vA-V]{20}$/,Jn=/^[A-Za-z0-9]{27}$/,Vn=/^[a-zA-Z0-9_-]{21}$/,Mn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,km=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Kn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ve=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,zm=ve(4),Im=ve(6),Sm=ve(7),Gn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,wm=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,jm=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Lu=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Pm=Lu,Um=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Om="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Wn(){return new RegExp(Om,"u")}var Bn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Xn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,qn=t=>{let r=G(t??":");return new RegExp(`^(?:[0-9A-F]{2}${r}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${r}){5}[0-9a-f]{2}$`)},Yn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Hn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wt=/^[A-Za-z0-9_-]*$/,Zm=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Dm=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ei=/^https?$/,ti=/^\+[1-9]\d{6,14}$/,Ru="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ri=new RegExp(`^${Ru}$`);function Cu(t){let r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${r}`:t.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${t.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ni(t){return new RegExp(`^${Cu(t)}$`)}function ii(t){let r=Cu({precision:t.precision}),i=["Z"];t.local&&i.push(""),t.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${r}(?:${i.join("|")})`;return new RegExp(`^${Ru}T(?:${o})$`)}var oi=t=>{let r=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},ai=/^-?\d+n?$/,ci=/^-?\d+$/,Bt=/^-?\d+(?:\.\d+)?$/,ui=/^(?:true|false)$/i,si=/^null$/i;var li=/^undefined$/i;var di=/^[^A-Z]*$/,mi=/^[^a-z]*$/,Nm=/^[0-9a-fA-F]*$/;function lt(t,r){return new RegExp(`^[A-Za-z0-9+/]{${t}}${r}$`)}function dt(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var Tm=/^[0-9a-fA-F]{32}$/,Em=lt(22,"=="),Am=dt(22),Lm=/^[0-9a-fA-F]{40}$/,Rm=lt(27,"="),Cm=dt(27),Fm=/^[0-9a-fA-F]{64}$/,Jm=lt(43,"="),Vm=dt(43),Mm=/^[0-9a-fA-F]{96}$/,Km=lt(64,""),Gm=dt(64),Wm=/^[0-9a-fA-F]{128}$/,Bm=lt(86,"=="),Xm=dt(86);var j=l("$ZodCheck",(t,r)=>{var i;t._zod??(t._zod={}),t._zod.def=r,(i=t._zod).onattach??(i.onattach=[])}),Ju={number:"number",bigint:"bigint",object:"date"},Xt=l("$ZodCheckLessThan",(t,r)=>{j.init(t,r);let i=Ju[typeof r.value];t._zod.onattach.push(o=>{let e=o._zod.bag,n=(r.inclusive?e.maximum:e.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<n&&(r.inclusive?e.maximum=r.value:e.exclusiveMaximum=r.value)}),t._zod.check=o=>{(r.inclusive?o.value<=r.value:o.value<r.value)||o.issues.push({origin:i,code:"too_big",maximum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),qt=l("$ZodCheckGreaterThan",(t,r)=>{j.init(t,r);let i=Ju[typeof r.value];t._zod.onattach.push(o=>{let e=o._zod.bag,n=(r.inclusive?e.minimum:e.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>n&&(r.inclusive?e.minimum=r.value:e.exclusiveMinimum=r.value)}),t._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:i,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),pi=l("$ZodCheckMultipleOf",(t,r)=>{j.init(t,r),t._zod.onattach.push(i=>{var o;(o=i._zod.bag).multipleOf??(o.multipleOf=r.value)}),t._zod.check=i=>{if(typeof i.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%r.value===BigInt(0):In(i.value,r.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:r.value,input:i.value,inst:t,continue:!r.abort})}}),fi=l("$ZodCheckNumberFormat",(t,r)=>{j.init(t,r),r.format=r.format||"float64";let i=r.format?.includes("int"),o=i?"int":"number",[e,n]=On[r.format];t._zod.onattach.push(a=>{let c=a._zod.bag;c.format=r.format,c.minimum=e,c.maximum=n,i&&(c.pattern=ci)}),t._zod.check=a=>{let c=a.value;if(i){if(!Number.isInteger(c)){a.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!r.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!r.abort});return}}c<e&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:e,inclusive:!0,inst:t,continue:!r.abort}),c>n&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:n,inclusive:!0,inst:t,continue:!r.abort})}}),gi=l("$ZodCheckBigIntFormat",(t,r)=>{j.init(t,r);let[i,o]=Zn[r.format];t._zod.onattach.push(e=>{let n=e._zod.bag;n.format=r.format,n.minimum=i,n.maximum=o}),t._zod.check=e=>{let n=e.value;n<i&&e.issues.push({origin:"bigint",input:n,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!r.abort}),n>o&&e.issues.push({origin:"bigint",input:n,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!r.abort})}}),vi=l("$ZodCheckMaxSize",(t,r)=>{var i;j.init(t,r),(i=t._zod.def).when??(i.when=o=>{let e=o.value;return!oe(e)&&e.size!==void 0}),t._zod.onattach.push(o=>{let e=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<e&&(o._zod.bag.maximum=r.maximum)}),t._zod.check=o=>{let e=o.value;e.size<=r.maximum||o.issues.push({origin:ot(e),code:"too_big",maximum:r.maximum,inclusive:!0,input:e,inst:t,continue:!r.abort})}}),$i=l("$ZodCheckMinSize",(t,r)=>{var i;j.init(t,r),(i=t._zod.def).when??(i.when=o=>{let e=o.value;return!oe(e)&&e.size!==void 0}),t._zod.onattach.push(o=>{let e=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>e&&(o._zod.bag.minimum=r.minimum)}),t._zod.check=o=>{let e=o.value;e.size>=r.minimum||o.issues.push({origin:ot(e),code:"too_small",minimum:r.minimum,inclusive:!0,input:e,inst:t,continue:!r.abort})}}),hi=l("$ZodCheckSizeEquals",(t,r)=>{var i;j.init(t,r),(i=t._zod.def).when??(i.when=o=>{let e=o.value;return!oe(e)&&e.size!==void 0}),t._zod.onattach.push(o=>{let e=o._zod.bag;e.minimum=r.size,e.maximum=r.size,e.size=r.size}),t._zod.check=o=>{let e=o.value,n=e.size;if(n===r.size)return;let a=n>r.size;o.issues.push({origin:ot(e),...a?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!r.abort})}}),_i=l("$ZodCheckMaxLength",(t,r)=>{var i;j.init(t,r),(i=t._zod.def).when??(i.when=o=>{let e=o.value;return!oe(e)&&e.length!==void 0}),t._zod.onattach.push(o=>{let e=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<e&&(o._zod.bag.maximum=r.maximum)}),t._zod.check=o=>{let e=o.value;if(e.length<=r.maximum)return;let a=at(e);o.issues.push({origin:a,code:"too_big",maximum:r.maximum,inclusive:!0,input:e,inst:t,continue:!r.abort})}}),yi=l("$ZodCheckMinLength",(t,r)=>{var i;j.init(t,r),(i=t._zod.def).when??(i.when=o=>{let e=o.value;return!oe(e)&&e.length!==void 0}),t._zod.onattach.push(o=>{let e=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>e&&(o._zod.bag.minimum=r.minimum)}),t._zod.check=o=>{let e=o.value;if(e.length>=r.minimum)return;let a=at(e);o.issues.push({origin:a,code:"too_small",minimum:r.minimum,inclusive:!0,input:e,inst:t,continue:!r.abort})}}),bi=l("$ZodCheckLengthEquals",(t,r)=>{var i;j.init(t,r),(i=t._zod.def).when??(i.when=o=>{let e=o.value;return!oe(e)&&e.length!==void 0}),t._zod.onattach.push(o=>{let e=o._zod.bag;e.minimum=r.length,e.maximum=r.length,e.length=r.length}),t._zod.check=o=>{let e=o.value,n=e.length;if(n===r.length)return;let a=at(e),c=n>r.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!r.abort})}}),Ue=l("$ZodCheckStringFormat",(t,r)=>{var i,o;j.init(t,r),t._zod.onattach.push(e=>{let n=e._zod.bag;n.format=r.format,r.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(r.pattern))}),r.pattern?(i=t._zod).check??(i.check=e=>{r.pattern.lastIndex=0,!r.pattern.test(e.value)&&e.issues.push({origin:"string",code:"invalid_format",format:r.format,input:e.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:t,continue:!r.abort})}):(o=t._zod).check??(o.check=()=>{})}),xi=l("$ZodCheckRegex",(t,r)=>{Ue.init(t,r),t._zod.check=i=>{r.pattern.lastIndex=0,!r.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:r.pattern.toString(),inst:t,continue:!r.abort})}}),ki=l("$ZodCheckLowerCase",(t,r)=>{r.pattern??(r.pattern=di),Ue.init(t,r)}),zi=l("$ZodCheckUpperCase",(t,r)=>{r.pattern??(r.pattern=mi),Ue.init(t,r)}),Ii=l("$ZodCheckIncludes",(t,r)=>{j.init(t,r);let i=G(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${i}`:i);r.pattern=o,t._zod.onattach.push(e=>{let n=e._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),t._zod.check=e=>{e.value.includes(r.includes,r.position)||e.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:e.value,inst:t,continue:!r.abort})}}),Si=l("$ZodCheckStartsWith",(t,r)=>{j.init(t,r);let i=new RegExp(`^${G(r.prefix)}.*`);r.pattern??(r.pattern=i),t._zod.onattach.push(o=>{let e=o._zod.bag;e.patterns??(e.patterns=new Set),e.patterns.add(i)}),t._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:t,continue:!r.abort})}}),wi=l("$ZodCheckEndsWith",(t,r)=>{j.init(t,r);let i=new RegExp(`.*${G(r.suffix)}$`);r.pattern??(r.pattern=i),t._zod.onattach.push(o=>{let e=o._zod.bag;e.patterns??(e.patterns=new Set),e.patterns.add(i)}),t._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:t,continue:!r.abort})}});function Fu(t,r,i){t.issues.length&&r.issues.push(...C(i,t.issues))}var ji=l("$ZodCheckProperty",(t,r)=>{j.init(t,r),t._zod.check=i=>{let o=r.schema._zod.run({value:i.value[r.property],issues:[]},{});if(o instanceof Promise)return o.then(e=>Fu(e,i,r.property));Fu(o,i,r.property)}}),Pi=l("$ZodCheckMimeType",(t,r)=>{j.init(t,r);let i=new Set(r.mime);t._zod.onattach.push(o=>{o._zod.bag.mime=r.mime}),t._zod.check=o=>{i.has(o.value.type)||o.issues.push({code:"invalid_value",values:r.mime,input:o.value.type,inst:t,continue:!r.abort})}}),Ui=l("$ZodCheckOverwrite",(t,r)=>{j.init(t,r),t._zod.check=i=>{i.value=r.tx(i.value)}});var mt=class{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let o=r.split(`
5
5
  `).filter(a=>a),e=Math.min(...o.map(a=>a.length-a.trimStart().length)),n=o.map(a=>a.slice(e)).map(a=>" ".repeat(this.indent*2)+a);for(let a of n)this.content.push(a)}compile(){let r=Function,i=this?.args,e=[...(this?.content??[""]).map(n=>` ${n}`)];return new r(...i,e.join(`
6
6
  `))}};var Oi={major:4,minor:4,patch:3};var x=l("$ZodType",(t,r)=>{var i;t??(t={}),t._zod.def=r,t._zod.bag=t._zod.bag||{},t._zod.version=Oi;let o=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(let e of o)for(let n of e._zod.onattach)n(t);if(o.length===0)(i=t._zod).deferred??(i.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let e=(a,c,s)=>{let u=ue(a),d;for(let p of c){if(p._zod.def.when){if(Dn(a)||!p._zod.def.when(a))continue}else if(u)continue;let _=a.issues.length,$=p._zod.check(a);if($ instanceof Promise&&s?.async===!1)throw new W;if(d||$ instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await $,a.issues.length!==_&&(u||(u=ue(a,_)))});else{if(a.issues.length===_)continue;u||(u=ue(a,_))}}return d?d.then(()=>a):a},n=(a,c,s)=>{if(ue(a))return a.aborted=!0,a;let u=e(c,o,s);if(u instanceof Promise){if(s.async===!1)throw new W;return u.then(d=>t._zod.parse(d,s))}return t._zod.parse(u,s)};t._zod.run=(a,c)=>{if(c.skipChecks)return t._zod.parse(a,c);if(c.direction==="backward"){let u=t._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>n(d,a,c)):n(u,a,c)}let s=t._zod.parse(a,c);if(s instanceof Promise){if(c.async===!1)throw new W;return s.then(u=>e(u,o,c))}return e(s,o,c)}}z(t,"~standard",()=>({validate:e=>{try{let n=En(t,e);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return An(t,e).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),$e=l("$ZodString",(t,r)=>{x.init(t,r),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??oi(t._zod.bag),t._zod.parse=(i,o)=>{if(r.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:t}),i}}),S=l("$ZodStringFormat",(t,r)=>{Ue.init(t,r),$e.init(t,r)}),Di=l("$ZodGUID",(t,r)=>{r.pattern??(r.pattern=Kn),S.init(t,r)}),Ni=l("$ZodUUID",(t,r)=>{if(r.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=ve(o))}else r.pattern??(r.pattern=ve());S.init(t,r)}),Ti=l("$ZodEmail",(t,r)=>{r.pattern??(r.pattern=Gn),S.init(t,r)}),Ei=l("$ZodURL",(t,r)=>{S.init(t,r),t._zod.check=i=>{try{let o=i.value.trim();if(!r.normalize&&r.protocol?.source===ei.source&&!/^https?:\/\//i.test(o)){i.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:i.value,inst:t,continue:!r.abort});return}let e=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(e.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:i.value,inst:t,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:i.value,inst:t,continue:!r.abort})),r.normalize?i.value=e.href:i.value=o;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:t,continue:!r.abort})}}}),Ai=l("$ZodEmoji",(t,r)=>{r.pattern??(r.pattern=Wn()),S.init(t,r)}),Li=l("$ZodNanoID",(t,r)=>{r.pattern??(r.pattern=Vn),S.init(t,r)}),Ri=l("$ZodCUID",(t,r)=>{r.pattern??(r.pattern=Ln),S.init(t,r)}),Ci=l("$ZodCUID2",(t,r)=>{r.pattern??(r.pattern=Rn),S.init(t,r)}),Fi=l("$ZodULID",(t,r)=>{r.pattern??(r.pattern=Cn),S.init(t,r)}),Ji=l("$ZodXID",(t,r)=>{r.pattern??(r.pattern=Fn),S.init(t,r)}),Vi=l("$ZodKSUID",(t,r)=>{r.pattern??(r.pattern=Jn),S.init(t,r)}),Mi=l("$ZodISODateTime",(t,r)=>{r.pattern??(r.pattern=ii(r)),S.init(t,r)}),Ki=l("$ZodISODate",(t,r)=>{r.pattern??(r.pattern=ri),S.init(t,r)}),Gi=l("$ZodISOTime",(t,r)=>{r.pattern??(r.pattern=ni(r)),S.init(t,r)}),Wi=l("$ZodISODuration",(t,r)=>{r.pattern??(r.pattern=Mn),S.init(t,r)}),Bi=l("$ZodIPv4",(t,r)=>{r.pattern??(r.pattern=Bn),S.init(t,r),t._zod.bag.format="ipv4"}),Xi=l("$ZodIPv6",(t,r)=>{r.pattern??(r.pattern=Xn),S.init(t,r),t._zod.bag.format="ipv6",t._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:t,continue:!r.abort})}}}),qi=l("$ZodMAC",(t,r)=>{r.pattern??(r.pattern=qn(r.delimiter)),S.init(t,r),t._zod.bag.format="mac"}),Yi=l("$ZodCIDRv4",(t,r)=>{r.pattern??(r.pattern=Yn),S.init(t,r)}),Hi=l("$ZodCIDRv6",(t,r)=>{r.pattern??(r.pattern=Hn),S.init(t,r),t._zod.check=i=>{let o=i.value.split("/");try{if(o.length!==2)throw new Error;let[e,n]=o;if(!n)throw new Error;let a=Number(n);if(`${a}`!==n)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${e}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:t,continue:!r.abort})}}});function Qi(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var eo=l("$ZodBase64",(t,r)=>{r.pattern??(r.pattern=Qn),S.init(t,r),t._zod.bag.contentEncoding="base64",t._zod.check=i=>{Qi(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:t,continue:!r.abort})}});function is(t){if(!Wt.test(t))return!1;let r=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),i=r.padEnd(Math.ceil(r.length/4)*4,"=");return Qi(i)}var to=l("$ZodBase64URL",(t,r)=>{r.pattern??(r.pattern=Wt),S.init(t,r),t._zod.bag.contentEncoding="base64url",t._zod.check=i=>{is(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:t,continue:!r.abort})}}),ro=l("$ZodE164",(t,r)=>{r.pattern??(r.pattern=ti),S.init(t,r)});function os(t,r=null){try{let i=t.split(".");if(i.length!==3)return!1;let[o]=i;if(!o)return!1;let e=JSON.parse(atob(o));return!("typ"in e&&e?.typ!=="JWT"||!e.alg||r&&(!("alg"in e)||e.alg!==r))}catch{return!1}}var no=l("$ZodJWT",(t,r)=>{S.init(t,r),t._zod.check=i=>{os(i.value,r.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:t,continue:!r.abort})}}),io=l("$ZodCustomStringFormat",(t,r)=>{S.init(t,r),t._zod.check=i=>{r.fn(i.value)||i.issues.push({code:"invalid_format",format:r.format,input:i.value,inst:t,continue:!r.abort})}}),tr=l("$ZodNumber",(t,r)=>{x.init(t,r),t._zod.pattern=t._zod.bag.pattern??Bt,t._zod.parse=(i,o)=>{if(r.coerce)try{i.value=Number(i.value)}catch{}let e=i.value;if(typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e))return i;let n=typeof e=="number"?Number.isNaN(e)?"NaN":Number.isFinite(e)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:e,inst:t,...n?{received:n}:{}}),i}}),oo=l("$ZodNumberFormat",(t,r)=>{fi.init(t,r),tr.init(t,r)}),pt=l("$ZodBoolean",(t,r)=>{x.init(t,r),t._zod.pattern=ui,t._zod.parse=(i,o)=>{if(r.coerce)try{i.value=!!i.value}catch{}let e=i.value;return typeof e=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:e,inst:t}),i}}),rr=l("$ZodBigInt",(t,r)=>{x.init(t,r),t._zod.pattern=ai,t._zod.parse=(i,o)=>{if(r.coerce)try{i.value=BigInt(i.value)}catch{}return typeof i.value=="bigint"||i.issues.push({expected:"bigint",code:"invalid_type",input:i.value,inst:t}),i}}),ao=l("$ZodBigIntFormat",(t,r)=>{gi.init(t,r),rr.init(t,r)}),co=l("$ZodSymbol",(t,r)=>{x.init(t,r),t._zod.parse=(i,o)=>{let e=i.value;return typeof e=="symbol"||i.issues.push({expected:"symbol",code:"invalid_type",input:e,inst:t}),i}}),uo=l("$ZodUndefined",(t,r)=>{x.init(t,r),t._zod.pattern=li,t._zod.values=new Set([void 0]),t._zod.parse=(i,o)=>{let e=i.value;return typeof e>"u"||i.issues.push({expected:"undefined",code:"invalid_type",input:e,inst:t}),i}}),so=l("$ZodNull",(t,r)=>{x.init(t,r),t._zod.pattern=si,t._zod.values=new Set([null]),t._zod.parse=(i,o)=>{let e=i.value;return e===null||i.issues.push({expected:"null",code:"invalid_type",input:e,inst:t}),i}}),lo=l("$ZodAny",(t,r)=>{x.init(t,r),t._zod.parse=i=>i}),mo=l("$ZodUnknown",(t,r)=>{x.init(t,r),t._zod.parse=i=>i}),po=l("$ZodNever",(t,r)=>{x.init(t,r),t._zod.parse=(i,o)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:t}),i)}),fo=l("$ZodVoid",(t,r)=>{x.init(t,r),t._zod.parse=(i,o)=>{let e=i.value;return typeof e>"u"||i.issues.push({expected:"void",code:"invalid_type",input:e,inst:t}),i}}),go=l("$ZodDate",(t,r)=>{x.init(t,r),t._zod.parse=(i,o)=>{if(r.coerce)try{i.value=new Date(i.value)}catch{}let e=i.value,n=e instanceof Date;return n&&!Number.isNaN(e.getTime())||i.issues.push({expected:"date",code:"invalid_type",input:e,...n?{received:"Invalid Date"}:{},inst:t}),i}});function Mu(t,r,i){t.issues.length&&r.issues.push(...C(i,t.issues)),r.value[i]=t.value}var vo=l("$ZodArray",(t,r)=>{x.init(t,r),t._zod.parse=(i,o)=>{let e=i.value;if(!Array.isArray(e))return i.issues.push({expected:"array",code:"invalid_type",input:e,inst:t}),i;i.value=Array(e.length);let n=[];for(let a=0;a<e.length;a++){let c=e[a],s=r.element._zod.run({value:c,issues:[]},o);s instanceof Promise?n.push(s.then(u=>Mu(u,i,a))):Mu(s,i,a)}return n.length?Promise.all(n).then(()=>i):i}});function er(t,r,i,o,e,n){let a=i in o;if(t.issues.length){if(e&&n&&!a)return;r.issues.push(...C(i,t.issues))}if(!a&&!e){t.issues.length||r.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}t.value===void 0?a&&(r.value[i]=void 0):r.value[i]=t.value}function as(t){let r=Object.keys(t.shape);for(let o of r)if(!t.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let i=Un(t.shape);return{...t,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(i)}}function cs(t,r,i,o,e,n){let a=[],c=e.keySet,s=e.catchall._zod,u=s.def.type,d=s.optin==="optional",p=s.optout==="optional";for(let _ in r){if(_==="__proto__"||c.has(_))continue;if(u==="never"){a.push(_);continue}let $=s.run({value:r[_],issues:[]},o);$ instanceof Promise?t.push($.then(b=>er(b,i,_,r,d,p))):er($,i,_,r,d,p)}return a.length&&i.issues.push({code:"unrecognized_keys",keys:a,input:r,inst:n}),t.length?Promise.all(t).then(()=>i):i}var us=l("$ZodObject",(t,r)=>{if(x.init(t,r),!Object.getOwnPropertyDescriptor(r,"shape")?.get){let c=r.shape;Object.defineProperty(r,"shape",{get:()=>{let s={...c};return Object.defineProperty(r,"shape",{value:s}),s}})}let o=ze(()=>as(r));z(t._zod,"propValues",()=>{let c=r.shape,s={};for(let u in c){let d=c[u]._zod;if(d.values){s[u]??(s[u]=new Set);for(let p of d.values)s[u].add(p)}}return s});let e=ge,n=r.catchall,a;t._zod.parse=(c,s)=>{a??(a=o.value);let u=c.value;if(!e(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),c;c.value={};let d=[],p=a.shape;for(let _ of a.keys){let $=p[_],b=$._zod.optin==="optional",R=$._zod.optout==="optional",O=$._zod.run({value:u[_],issues:[]},s);O instanceof Promise?d.push(O.then(yn=>er(yn,c,_,u,b,R))):er(O,c,_,u,b,R)}return n?cs(d,u,c,s,o.value,t):d.length?Promise.all(d).then(()=>c):c}}),$o=l("$ZodObjectJIT",(t,r)=>{us.init(t,r);let i=t._zod.parse,o=ze(()=>as(r)),e=_=>{let $=new mt(["shape","payload","ctx"]),b=o.value,R=X=>{let P=Tt(X);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};$.write("const input = payload.value;");let O=Object.create(null),yn=0;for(let X of b.keys)O[X]=`key_${yn++}`;$.write("const newResult = {};");for(let X of b.keys){let P=O[X],Z=Tt(X),ju=_[X],Pu=ju?._zod?.optin==="optional",Jd=ju?._zod?.optout==="optional";$.write(`const ${P} = ${R(X)};`),Pu&&Jd?$.write(`
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as S,d as z,f as Q}from"./chunk-C7AXVR6L.js";import{a as C,b as O,d as ft,f,g as J,j as E,k as A,m as K,o as Y}from"./chunk-4WV7FA5L.js";var b=O($=>{"use strict";var y=class extends Error{constructor(t,e,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}},v=class extends y{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};$.CommanderError=y;$.InvalidArgumentError=v});var w=O(V=>{"use strict";var{InvalidArgumentError:gt}=b(),k=class{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,e){return e===this.defaultValue||!Array.isArray(e)?[t]:e.concat(t)}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(e,i)=>{if(!this.argChoices.includes(e))throw new gt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,i):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function _t(o){let t=o.name()+(o.variadic===!0?"...":"");return o.required?"<"+t+">":"["+t+"]"}V.Argument=k;V.humanReadableArgName=_t});var P=O(T=>{"use strict";var{humanReadableArgName:Ot}=w(),H=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let e=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&e.push(i),this.sortSubcommands&&e.sort((n,s)=>n.name().localeCompare(s.name())),e}compareOptions(t,e){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(e))}visibleOptions(t){let e=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),s=i.long&&t._findOption(i.long);!n&&!s?e.push(i):i.long&&!s?e.push(t.createOption(i.long,i.description)):i.short&&!n&&e.push(t.createOption(i.short,i.description))}return this.sortOptions&&e.sort(this.compareOptions),e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let e=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);e.push(...n)}return this.sortOptions&&e.sort(this.compareOptions),e}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(e=>{e.description=e.description||t._argsDescription[e.name()]||""}),t.registeredArguments.find(e=>e.description)?t.registeredArguments:[]}subcommandTerm(t){let e=t.registeredArguments.map(i=>Ot(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(e.styleSubcommandTerm(e.subcommandTerm(n)))),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(e.styleOptionTerm(e.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,e){return e.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(e.styleOptionTerm(e.optionTerm(n)))),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(e.styleArgumentTerm(e.argumentTerm(n)))),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let e=[];return t.argChoices&&e.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&e.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&e.push(`env: ${t.envVar}`),e.length>0?`${t.description} (${e.join(", ")})`:t.description}argumentDescription(t){let e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){let i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatHelp(t,e){let i=e.padWidth(t,e),n=e.helpWidth??80;function s(c,p){return e.formatItem(c,i,p,e)}let r=[`${e.styleTitle("Usage:")} ${e.styleUsage(e.commandUsage(t))}`,""],l=e.commandDescription(t);l.length>0&&(r=r.concat([e.boxWrap(e.styleCommandDescription(l),n),""]));let a=e.visibleArguments(t).map(c=>s(e.styleArgumentTerm(e.argumentTerm(c)),e.styleArgumentDescription(e.argumentDescription(c))));a.length>0&&(r=r.concat([e.styleTitle("Arguments:"),...a,""]));let h=e.visibleOptions(t).map(c=>s(e.styleOptionTerm(e.optionTerm(c)),e.styleOptionDescription(e.optionDescription(c))));if(h.length>0&&(r=r.concat([e.styleTitle("Options:"),...h,""])),e.showGlobalOptions){let c=e.visibleGlobalOptions(t).map(p=>s(e.styleOptionTerm(e.optionTerm(p)),e.styleOptionDescription(e.optionDescription(p))));c.length>0&&(r=r.concat([e.styleTitle("Global Options:"),...c,""]))}let u=e.visibleCommands(t).map(c=>s(e.styleSubcommandTerm(e.subcommandTerm(c)),e.styleSubcommandDescription(e.subcommandDescription(c))));return u.length>0&&(r=r.concat([e.styleTitle("Commands:"),...u,""])),r.join(`
3
+ import{a as S,d as z,f as Q}from"./chunk-VRPJTK2B.js";import{a as C,b as O,d as ft,f,g as J,j as E,k as A,m as K,o as Y}from"./chunk-4WV7FA5L.js";var b=O($=>{"use strict";var y=class extends Error{constructor(t,e,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}},v=class extends y{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};$.CommanderError=y;$.InvalidArgumentError=v});var w=O(V=>{"use strict";var{InvalidArgumentError:gt}=b(),k=class{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,e){return e===this.defaultValue||!Array.isArray(e)?[t]:e.concat(t)}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(e,i)=>{if(!this.argChoices.includes(e))throw new gt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,i):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function _t(o){let t=o.name()+(o.variadic===!0?"...":"");return o.required?"<"+t+">":"["+t+"]"}V.Argument=k;V.humanReadableArgName=_t});var P=O(T=>{"use strict";var{humanReadableArgName:Ot}=w(),H=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let e=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&e.push(i),this.sortSubcommands&&e.sort((n,s)=>n.name().localeCompare(s.name())),e}compareOptions(t,e){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(e))}visibleOptions(t){let e=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),s=i.long&&t._findOption(i.long);!n&&!s?e.push(i):i.long&&!s?e.push(t.createOption(i.long,i.description)):i.short&&!n&&e.push(t.createOption(i.short,i.description))}return this.sortOptions&&e.sort(this.compareOptions),e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let e=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);e.push(...n)}return this.sortOptions&&e.sort(this.compareOptions),e}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(e=>{e.description=e.description||t._argsDescription[e.name()]||""}),t.registeredArguments.find(e=>e.description)?t.registeredArguments:[]}subcommandTerm(t){let e=t.registeredArguments.map(i=>Ot(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(e.styleSubcommandTerm(e.subcommandTerm(n)))),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(e.styleOptionTerm(e.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,e){return e.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(e.styleOptionTerm(e.optionTerm(n)))),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(e.styleArgumentTerm(e.argumentTerm(n)))),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let e=[];return t.argChoices&&e.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&e.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&e.push(`env: ${t.envVar}`),e.length>0?`${t.description} (${e.join(", ")})`:t.description}argumentDescription(t){let e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){let i=`(${e.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatHelp(t,e){let i=e.padWidth(t,e),n=e.helpWidth??80;function s(c,p){return e.formatItem(c,i,p,e)}let r=[`${e.styleTitle("Usage:")} ${e.styleUsage(e.commandUsage(t))}`,""],l=e.commandDescription(t);l.length>0&&(r=r.concat([e.boxWrap(e.styleCommandDescription(l),n),""]));let a=e.visibleArguments(t).map(c=>s(e.styleArgumentTerm(e.argumentTerm(c)),e.styleArgumentDescription(e.argumentDescription(c))));a.length>0&&(r=r.concat([e.styleTitle("Arguments:"),...a,""]));let h=e.visibleOptions(t).map(c=>s(e.styleOptionTerm(e.optionTerm(c)),e.styleOptionDescription(e.optionDescription(c))));if(h.length>0&&(r=r.concat([e.styleTitle("Options:"),...h,""])),e.showGlobalOptions){let c=e.visibleGlobalOptions(t).map(p=>s(e.styleOptionTerm(e.optionTerm(p)),e.styleOptionDescription(e.optionDescription(p))));c.length>0&&(r=r.concat([e.styleTitle("Global Options:"),...c,""]))}let u=e.visibleCommands(t).map(c=>s(e.styleSubcommandTerm(e.subcommandTerm(c)),e.styleSubcommandDescription(e.subcommandDescription(c))));return u.length>0&&(r=r.concat([e.styleTitle("Commands:"),...u,""])),r.join(`
4
4
  `)}displayWidth(t){return X(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(e=>e==="[options]"?this.styleOptionText(e):e==="[command]"?this.styleSubcommandText(e):e[0]==="["||e[0]==="<"?this.styleArgumentText(e):this.styleCommandText(e)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(e=>e==="[options]"?this.styleOptionText(e):e[0]==="["||e[0]==="<"?this.styleArgumentText(e):this.styleSubcommandText(e)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestGlobalOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,e,i,n){let r=" ".repeat(2);if(!i)return r+t;let l=t.padEnd(e+t.length-n.displayWidth(t)),a=2,u=(this.helpWidth??80)-e-a-2,c;return u<this.minWidthToWrap||n.preformatted(i)?c=i:c=n.boxWrap(i,u).replace(/\n/g,`
5
5
  `+" ".repeat(e+a)),r+l+" ".repeat(a)+c.replace(/\n/g,`
6
6
  ${r}`)}boxWrap(t,e){if(e<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return i.forEach(r=>{let l=r.match(n);if(l===null){s.push("");return}let a=[l.shift()],h=this.displayWidth(a[0]);l.forEach(u=>{let c=this.displayWidth(u);if(h+c<=e){a.push(u),h+=c;return}s.push(a.join(""));let p=u.trimStart();a=[p],h=this.displayWidth(p)}),s.push(a.join(""))}),s.join(`
@@ -28,4 +28,4 @@ Expecting one of '${i.join("', '")}'`);let n=`${t}Help`;return this.on(n,s=>{let
28
28
  `)}),this}_outputHelpIfRequested(t){let e=this._getHelpOption();e&&t.find(n=>e.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function st(o){return o.map(t=>{if(!t.startsWith("--inspect"))return t;let e,i="127.0.0.1",n="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?e=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(e=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(e=s[1],i=s[3],n=s[4]),e&&n!=="0"?`${e}=${i}:${parseInt(n)+1}`:t})}function M(){if(m.env.NO_COLOR||m.env.FORCE_COLOR==="0"||m.env.FORCE_COLOR==="false")return!1;if(m.env.FORCE_COLOR||m.env.CLICOLOR_FORCE!==void 0)return!0}L.Command=j;L.useColor=M});var ut=O(d=>{"use strict";var{Argument:ot}=w(),{Command:R}=rt(),{CommanderError:kt,InvalidArgumentError:at}=b(),{Help:Vt}=P(),{Option:lt}=F();d.program=new R;d.createCommand=o=>new R(o);d.createOption=(o,t)=>new lt(o,t);d.createArgument=(o,t)=>new ot(o,t);d.Command=R;d.Option=lt;d.Argument=ot;d.Help=Vt;d.CommanderError=kt;d.InvalidArgumentError=at;d.InvalidOptionArgumentError=at});var ht=ft(ut(),1),{program:jt,createCommand:Mt,createArgument:Lt,createOption:Rt,CommanderError:Ut,InvalidArgumentError:Bt,InvalidOptionArgumentError:Gt,Command:ct,Argument:Jt,Option:Kt,Help:Yt}=ht.default;var mt=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D"],Ht="OpenSkill.md \u2014 the npm for AI skills";function U(){return["",...mt.map((o,t)=>Y(o,t,mt.length)),K(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),A.bold(` ${Ht}`),""].join(`
29
29
  `)}function _(){process.stderr.write(U()+`
30
30
  `)}var B=class o extends ct{createCommand(t){return new o(t)}helpInformation(){return`${U()}
31
- ${super.helpInformation()}`}},Tt={styleTitle:o=>J.bold(o),styleUsage:o=>f.lavender(o),styleCommandText:o=>A(o),styleCommandDescription:o=>f.subtext1(o),styleDescriptionText:o=>f.subtext1(o),styleSubcommandTerm:o=>E(o),styleSubcommandDescription:o=>f.subtext1(o),styleOptionTerm:o=>f.peach(o),styleOptionDescription:o=>f.subtext1(o),styleArgumentTerm:o=>f.green(o),styleArgumentDescription:o=>f.subtext1(o),styleSubcommandText:o=>E(o),styleOptionText:o=>f.peach(o),styleArgumentText:o=>f.green(o)};function pt(){let o=new B;o.configureHelp(Tt);function t(s,r,l){o.command(s).description(r).action(async(...a)=>{_(),await(await l())(...a.slice(0,-1))})}o.name("osm").description("The CLI for OpenSkill.md \u2014 search, add, score, and explore AI agent skills").version(S),o.hook("preAction",async(s,r)=>{z(r.name()),await Q()}),t("search <query>","Search skills and blueprints by keyword",async()=>(await import("./search-MHTMOWSL.js")).searchCommand),t("info <slug>","Show details about a skill or blueprint",async()=>(await import("./info-I4AOYDGS.js")).infoCommand),o.command("add <source>").alias("install").description("Add a skill (owner/repo or owner/repo@skill) \u2014 or a plugin by slug (auto-detected; runs the native plugin install)").option("-a, --agent <agent...>","Target coding agent(s) \u2014 may repeat. If omitted, auto-detects installed agents.").option("-g, --global","Add at user scope (~/) instead of project").option("--copy","Copy files instead of symlinking to agent directories").option("--json","Emit a single-line JSON result on stdout (machine-readable)").action(async(s,r)=>{_();let{addCommand:l}=await import("./add-SOJJXZ4Q.js");await l(s,r)}),t("list","Show installed skills and blueprints in this project",async()=>(await import("./list-KG5CDNP4.js")).listCommand),t("score <filepath>","Score a local SKILL.md file for quality",async()=>(await import("./score-DZEYYP3T.js")).scoreCommand),t("init <type>","Scaffold a new skill or blueprint (type: skill | blueprint)",async()=>(await import("./init-7IVYEUFF.js")).initCommand),t("browse","Explore skills by category (interactive)",async()=>(await import("./browse-34X4SI5L.js")).browseCommand),t("remove <slug>","Remove an installed skill or blueprint from the project",async()=>(await import("./remove-7J2YQKJT.js")).removeCommand),o.command("router").description("Manage the OpenSkill router skill").command("install").description("Download the OpenSkill router SKILL.md into .skills/").action(async()=>{_();let{routerInstallCommand:s}=await import("./router-HJKC2WD4.js");await s()});let i=o.command("mcp").description("Explore and configure MCP servers");i.command("setup").description("Print MCP configuration for Claude/Cursor").action(async()=>{_();let{mcpSetupCommand:s}=await import("./mcp-I3PAMK56.js");await s()}),i.command("info <slug>").description("Show details about an MCP server").action(async s=>{_();let{mcpInfoCommand:r}=await import("./mcp-I3PAMK56.js");await r(s)});let n=o.command("plugin").description("Install and inspect plugins (Claude Code / Codex bundles)");return n.command("install <slug>").alias("add").description("Install a plugin \u2014 runs the native marketplace\u2192install two-step for you").option("-a, --agent <agent...>","Target runtime(s): claude-code | codex. If omitted, every runtime the plugin supports.").option("-g, --global","Install at user scope (~/.claude) instead of project").option("--json","Emit a single-line JSON result on stdout").action(async(s,r)=>{_();let{pluginInstallCommand:l}=await import("./plugin-QO3E3AOC.js");await l(s,r)}),n.command("info <slug>").description("Show details about a plugin").action(async s=>{_();let{pluginInfoCommand:r}=await import("./plugin-QO3E3AOC.js");await r(s)}),o.configureOutput({writeOut:s=>process.stderr.write(s),writeErr:s=>process.stderr.write(s)}),o.action(()=>{o.outputHelp()}),o}pt().parseAsync(process.argv).catch(o=>{console.error(o),process.exit(1)});
31
+ ${super.helpInformation()}`}},Tt={styleTitle:o=>J.bold(o),styleUsage:o=>f.lavender(o),styleCommandText:o=>A(o),styleCommandDescription:o=>f.subtext1(o),styleDescriptionText:o=>f.subtext1(o),styleSubcommandTerm:o=>E(o),styleSubcommandDescription:o=>f.subtext1(o),styleOptionTerm:o=>f.peach(o),styleOptionDescription:o=>f.subtext1(o),styleArgumentTerm:o=>f.green(o),styleArgumentDescription:o=>f.subtext1(o),styleSubcommandText:o=>E(o),styleOptionText:o=>f.peach(o),styleArgumentText:o=>f.green(o)};function pt(){let o=new B;o.configureHelp(Tt);function t(s,r,l){o.command(s).description(r).action(async(...a)=>{_(),await(await l())(...a.slice(0,-1))})}o.name("osm").description("The CLI for OpenSkill.md \u2014 search, add, score, and explore AI agent skills").version(S),o.hook("preAction",async(s,r)=>{z(r.name()),await Q()}),t("search <query>","Search skills and blueprints by keyword",async()=>(await import("./search-HKMHSE3E.js")).searchCommand),t("info <slug>","Show details about a skill or blueprint",async()=>(await import("./info-3K7S2I3S.js")).infoCommand),o.command("add <source>").alias("install").description("Add a skill (owner/repo or owner/repo@skill) \u2014 or a plugin by slug (auto-detected; runs the native plugin install)").option("-a, --agent <agent...>","Target coding agent(s) \u2014 may repeat. If omitted, auto-detects installed agents.").option("-g, --global","Add at user scope (~/) instead of project").option("--copy","Copy files instead of symlinking to agent directories").option("--json","Emit a single-line JSON result on stdout (machine-readable)").action(async(s,r)=>{_();let{addCommand:l}=await import("./add-SLI6RQWN.js");await l(s,r)}),t("list","Show installed skills and blueprints in this project",async()=>(await import("./list-KG5CDNP4.js")).listCommand),t("score <filepath>","Score a local SKILL.md file for quality",async()=>(await import("./score-DZEYYP3T.js")).scoreCommand),t("init <type>","Scaffold a new skill or blueprint (type: skill | blueprint)",async()=>(await import("./init-7IVYEUFF.js")).initCommand),t("browse","Explore skills by category (interactive)",async()=>(await import("./browse-TH2KBK3J.js")).browseCommand),t("remove <slug>","Remove an installed skill or blueprint from the project",async()=>(await import("./remove-7J2YQKJT.js")).removeCommand),o.command("router").description("Manage the OpenSkill router skill").command("install").description("Download the OpenSkill router SKILL.md into .skills/").action(async()=>{_();let{routerInstallCommand:s}=await import("./router-OL6DZN5S.js");await s()});let i=o.command("mcp").description("Explore and configure MCP servers");i.command("setup").description("Print MCP configuration for Claude/Cursor").action(async()=>{_();let{mcpSetupCommand:s}=await import("./mcp-D7VVPYZA.js");await s()}),i.command("info <slug>").description("Show details about an MCP server").action(async s=>{_();let{mcpInfoCommand:r}=await import("./mcp-D7VVPYZA.js");await r(s)});let n=o.command("plugin").description("Install and inspect plugins (Claude Code / Codex bundles)");return n.command("install <slug>").alias("add").description("Install a plugin \u2014 runs the native marketplace\u2192install two-step for you").option("-a, --agent <agent...>","Target runtime(s): claude-code | codex. If omitted, every runtime the plugin supports.").option("-g, --global","Install at user scope (~/.claude) instead of project").option("--json","Emit a single-line JSON result on stdout").action(async(s,r)=>{_();let{pluginInstallCommand:l}=await import("./plugin-F3YZSTVP.js");await l(s,r)}),n.command("info <slug>").description("Show details about a plugin").action(async s=>{_();let{pluginInfoCommand:r}=await import("./plugin-F3YZSTVP.js");await r(s)}),o.configureOutput({writeOut:s=>process.stderr.write(s),writeErr:s=>process.stderr.write(s)}),o.action(()=>{o.outputHelp()}),o}pt().parseAsync(process.argv).catch(o=>{console.error(o),process.exit(1)});
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as y}from"./chunk-N5U3SVLG.js";import{b as x,c as m,e as S,f as v}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import"./chunk-YAZPI4SK.js";import{g as u,j as g,k as a,l as s,n as b,p,q as w,r as $,s as l,t as d,u as f}from"./chunk-4WV7FA5L.js";async function F(e){let o=y({text:`Fetching info for "${e}"...`,spinner:b,color:!1}).start();try{let r=await S(e);o.stop(),U(r);return}catch(r){if(!(r instanceof m&&r.statusCode===404)){o.fail("Failed to fetch info"),process.stderr.write(f(r instanceof Error?r.message:"Unknown error")+`
3
+ import{a as y}from"./chunk-N5U3SVLG.js";import{b as x,c as m,e as S,f as v}from"./chunk-C4S3KDSI.js";import"./chunk-VRPJTK2B.js";import"./chunk-YAZPI4SK.js";import{g as u,j as g,k as a,l as s,n as b,p,q as w,r as $,s as l,t as d,u as f}from"./chunk-4WV7FA5L.js";async function F(e){let o=y({text:`Fetching info for "${e}"...`,spinner:b,color:!1}).start();try{let r=await S(e);o.stop(),U(r);return}catch(r){if(!(r instanceof m&&r.statusCode===404)){o.fail("Failed to fetch info"),process.stderr.write(f(r instanceof Error?r.message:"Unknown error")+`
4
4
  `);return}}try{let r=await v(e);o.stop(),await O(r);return}catch(r){o.stop(),r instanceof m&&r.statusCode===404?process.stderr.write(f(`"${e}" not found.`,`Try ${g("osm search <query>")} to find it.`)+`
5
5
  `):process.stderr.write(f(r instanceof Error?r.message:"Unknown error")+`
6
6
  `)}}function U(e){process.stdout.write(`
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as u,b as d,c as f,k as m}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import{g as n,h as a,k as l,l as e,t as c,u as p}from"./chunk-4WV7FA5L.js";async function h(){let o={mcpServers:{openskill:{url:`${await u()}/mcp/sse`}}};console.error(c("MCP Server Configuration")),console.error(e(` Add this to your Claude Desktop or Cursor MCP config:
3
+ import{a as u,b as d,c as f,k as m}from"./chunk-C4S3KDSI.js";import"./chunk-VRPJTK2B.js";import{g as n,h as a,k as l,l as e,t as c,u as p}from"./chunk-4WV7FA5L.js";async function h(){let o={mcpServers:{openskill:{url:`${await u()}/mcp/sse`}}};console.error(c("MCP Server Configuration")),console.error(e(` Add this to your Claude Desktop or Cursor MCP config:
4
4
  `)),console.log(JSON.stringify(o,null,2)),console.error(""),console.error(n.bold(" For Claude Desktop:")),console.error(e(" Add to ~/Library/Application Support/Claude/claude_desktop_config.json")),console.error(""),console.error(n.bold(" For Cursor:")),console.error(e(" Add to .cursor/mcp.json in your project root")),console.error(""),console.error(e(" The OpenSkill MCP server gives your AI agent access to the full")),console.error(e(" skill and blueprint registry via tool calls.")),console.error("")}async function b(t){console.error(c(`MCP Server: ${t}`));let o;try{o=await m(t)}catch(r){if(r instanceof f&&r.statusCode===404){let i=await d();process.stderr.write(p(`MCP server "${t}" not found.`,`Browse available servers at ${i}/mcp-servers`)+`
5
5
  `);return}process.stderr.write(p(r instanceof Error?r.message:"Unknown error")+`
6
6
  `);return}console.error(""),console.error(n.bold(` ${o.displayName||o.name}`)),o.description&&console.error(e(` ${o.description}`)),console.error(""),o.mcpEndpointUrl&&(console.error(a.bold(" Endpoint URL:")),console.error(a(` ${o.mcpEndpointUrl}`)),console.error(""));let s=[];if(o.transportType){let r=o.transportType==="sse"||o.transportType==="streamable-http";s.push(["Transport",r?"Remote (SSE)":"Local install (stdio)"])}o.authType&&s.push(["Auth",o.authType==="none"?"None required":o.authType]),o.verified&&s.push(["Verified","Yes"]),o.status&&s.push(["Status",o.status]),o.stargazerCount!=null&&s.push(["Stars",String(o.stargazerCount)]),o.toolCount&&s.push(["Tools",String(o.toolCount)]),o.primaryLanguage&&s.push(["Language",o.primaryLanguage]),o.category&&s.push(["Category",o.category]);for(let[r,i]of s)console.error(` ${e(`${r}:`)} ${l(i)}`);if(console.error(""),o.installCommand&&(console.error(n.bold(" Install:")),console.error(l(` ${o.installCommand}`)),console.error("")),o.toolNames&&o.toolNames.length>0){console.error(n.bold(" Tools:"));for(let r of o.toolNames.slice(0,20))console.error(e(` - ${r}`));o.toolNames.length>20&&console.error(e(` ... and ${o.toolNames.length-20} more`)),console.error("")}if(o.mcpEndpointUrl){console.error(n.bold(" Config JSON (Claude Desktop / Cursor):"));let r={mcpServers:{[o.slug]:{url:o.mcpEndpointUrl}}};console.log(JSON.stringify(r,null,2)),console.error("")}else o.githubUrl&&(console.error(n.bold(" GitHub:")),console.error(l(` ${o.githubUrl}`)),console.error(""))}export{b as mcpInfoCommand,h as mcpSetupCommand};
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
+ import{b as $,c as C,l as k}from"./chunk-C4S3KDSI.js";import"./chunk-VRPJTK2B.js";import{g as f,h as S,k as R,l as u,t as x,u as d,w as P}from"./chunk-4WV7FA5L.js";import{spawn as W}from"child_process";import{existsSync as v}from"fs";import{delimiter as O,join as U}from"path";var p={"claude-code":{cli:"claude",label:"Claude Code",autoInstall:!0},codex:{cli:"codex",label:"Codex",autoInstall:!0}},_=new Set(Object.keys(p));function A(n){return _.has(n)}function E(n,e=process.env,r=process.platform){let o=(e.PATH||"").split(O).filter(Boolean),i=r==="win32"?["",".exe",".cmd",".bat"]:[""];for(let s of o)for(let l of i)if(v(U(s,n+l)))return!0;return!1}function T(n){let e=n.trim().toLowerCase();return e==="claude-code"||e==="claude"||e==="claudecode"?"claude-code":e==="codex"?"codex":null}function L(n,e){let r=n.runtimes.filter(A),o=new Set(r);if(e&&e.length>0){let i=[],s=[];for(let l of e){let a=T(l);a&&o.has(a)?i.includes(a)||i.push(a):s.push(l)}return{targets:i,unsupported:s}}return{targets:r,unsupported:[]}}function M(n){return n?"user":"project"}function j(n,e){return n.marketplaces.find(r=>r.runtime===e)??n.marketplaces[0]??null}function F(n,e,r){return[["plugin","marketplace","add",e.source],["plugin","install",`${n}@${e.name}`,"--scope",r]]}function K(n){return/^(https?:\/\/|git@|\.\/|\/)/.test(n)||n.endsWith(".git")?n:`https://github.com/${n}.git`}var z=new Set(["openai-curated"]);function B(n){return z.has(n)}function H(n,e){let r=["plugin","add",`${n}@${e.name}`];return B(e.name)?[r]:[["plugin","marketplace","add",K(e.source)],r]}function y(n,e,r,o){return n==="codex"?H(e,r):F(e,r,o)}function G(n,e,r){return new Promise(o=>{let i=W(n,e,{stdio:r?"ignore":"inherit"});i.once("exit",s=>o(s??1)),i.once("error",()=>o(127))})}async function re(n,e={},r){let o;try{o=r??await k(n)}catch(t){if(t instanceof C&&t.statusCode===404){let g=await $();e.json?P({ok:!1,slug:n,error:{code:"PLUGIN_NOT_FOUND",message:`Plugin "${n}" not found.`}}):process.stderr.write(d(`Plugin "${n}" not found in the registry.`,`Browse plugins at ${g}/plugins`)+`
4
+ `),process.exit(2)}e.json?P({ok:!1,slug:n,error:{code:"PLUGIN_LOOKUP_FAILED",message:t instanceof Error?t.message:"Unknown error"}}):process.stderr.write(d(`Couldn't reach the registry to resolve "${n}".`,"Check your connection (and OPENSKILL_API_URL, if set).")+`
5
+ `),process.exit(1)}let i=o.displayName||o.name,{targets:s,unsupported:l}=L(o,e.agent),a=M(!!e.global);e.json||(console.error(x(`Install plugin: ${i}`)),o.description&&console.error(u(` ${o.description}`)),console.error(""),l.length>0&&console.error(u(` Note: ${l.join(", ")} \u2014 not supported by this plugin (supports: ${o.runtimes.join(", ")||"none"}).`)));let N=s.length>0?s:o.runtimes.filter(t=>t in p),h=[],c=[],m=[];for(let t of s){let g=p[t],I=j(o,t);if(!I){c.push(t);continue}if(E(g.cli)){if(!e.json){let b=t==="codex"?"global":`${a} scope`;console.error(f.bold(` \u2192 Installing for ${g.label} (${b})\u2026`)),console.error("")}let D=y(t,o.name,I,a),w=!0;for(let b of D)if(await G(g.cli,b,!!e.json)!==0){w=!1;break}w?h.push(t):c.push(t)}else m.push({runtime:t,reason:"cli-not-found"})}if(s.length===0)for(let t of N)m.push({runtime:t,reason:"cli-not-found"});!e.json&&m.length>0&&J(o,m,a),e.json||(console.error(""),h.length>0&&(console.error(S.bold(` \u2713 Installed for ${h.map(t=>p[t].label).join(", ")}.`)),console.error(u(" Run /reload-plugins in Claude Code to activate it."))),c.length>0&&console.error(d(`Install failed for ${c.map(t=>p[t].label).join(", ")}.`))),e.json&&P({ok:c.length===0,slug:o.slug,installed:h,manual:m.map(t=>t.runtime),failed:c}),process.exit(c.length>0?1:0)}function J(n,e,r){for(let{runtime:o}of e){let i=p[o],s=j(n,o);if(s){console.error(""),console.error(f.bold(` ${i.label} CLI ("${i.cli}") not found on PATH. Install it, then run:`));for(let l of y(o,n.name,s,r))console.error(R(` ${i.cli} ${l.join(" ")}`))}}}async function te(n){console.error(x(`Plugin: ${n}`));let e;try{e=await k(n)}catch(o){if(o instanceof C&&o.statusCode===404){let i=await $();process.stderr.write(d(`Plugin "${n}" not found.`,`Browse plugins at ${i}/plugins`)+`
6
+ `);return}process.stderr.write(d(o instanceof Error?o.message:"Unknown error")+`
7
+ `);return}console.error(""),console.error(f.bold(` ${e.displayName||e.name}`)),e.description&&console.error(u(` ${e.description}`)),console.error("");let r=[];e.runtimes.length&&r.push(["Runtimes",e.runtimes.join(", ")]),e.category&&r.push(["Category",e.category]),e.stargazerCount!=null&&r.push(["Stars",String(e.stargazerCount)]),e.primaryLanguage&&r.push(["Language",e.primaryLanguage]),e.license&&r.push(["License",e.license]),e.source&&r.push(["Source",e.source]);for(let[o,i]of r)console.error(` ${u(`${o}:`)} ${R(i)}`);if(console.error(""),console.error(f.bold(" Install:")),console.error(R(` osm add ${e.slug}`)),e.marketplaces.length){console.error(""),console.error(f.bold(" Listed in marketplaces:"));for(let o of e.marketplaces)console.error(u(` - ${o.name} (${o.source}) \xB7 ${o.runtime}`))}console.error("")}export{te as pluginInfoCommand,re as pluginInstallCommand};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as d}from"./chunk-N5U3SVLG.js";import{b as m}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import"./chunk-YAZPI4SK.js";import{g as t,k as l,l as o,n as i,u as a,v as c}from"./chunk-4WV7FA5L.js";import u from"fs";import p from"path";async function I(){let s=d({text:"Downloading OpenSkill router...",spinner:i,color:!1}).start();try{let r=await m(),e=await fetch(`${r}/skills/router/SKILL.md`);if(!e.ok)throw new Error(`Failed to download router SKILL.md (HTTP ${e.status})`);let f=await e.text(),n=p.join(process.cwd(),".skills");u.mkdirSync(n,{recursive:!0});let h=p.join(n,"openskill-router.md");u.writeFileSync(h,f,"utf-8"),s.stop(),console.error(c("Installed OpenSkill router to .skills/openskill-router.md")),console.error(""),console.error(t.bold(" What is the router?")),console.error(o(" The router skill teaches your AI agent how to discover and install")),console.error(o(" skills on-demand from the OpenSkill registry.")),console.error(""),console.error(t.bold(" How to use:")),console.error(l(' Point your agent at the file: "Read .skills/openskill-router.md"')),console.error(o(" The agent will then automatically search for relevant skills as needed.")),console.error("")}catch(r){s.fail("Failed to install router"),console.error(a(r instanceof Error?r.message:"Unknown error"))}}export{I as routerInstallCommand};
3
+ import{a as d}from"./chunk-N5U3SVLG.js";import{b as m}from"./chunk-C4S3KDSI.js";import"./chunk-VRPJTK2B.js";import"./chunk-YAZPI4SK.js";import{g as t,k as l,l as o,n as i,u as a,v as c}from"./chunk-4WV7FA5L.js";import u from"fs";import p from"path";async function I(){let s=d({text:"Downloading OpenSkill router...",spinner:i,color:!1}).start();try{let r=await m(),e=await fetch(`${r}/skills/router/SKILL.md`);if(!e.ok)throw new Error(`Failed to download router SKILL.md (HTTP ${e.status})`);let f=await e.text(),n=p.join(process.cwd(),".skills");u.mkdirSync(n,{recursive:!0});let h=p.join(n,"openskill-router.md");u.writeFileSync(h,f,"utf-8"),s.stop(),console.error(c("Installed OpenSkill router to .skills/openskill-router.md")),console.error(""),console.error(t.bold(" What is the router?")),console.error(o(" The router skill teaches your AI agent how to discover and install")),console.error(o(" skills on-demand from the OpenSkill registry.")),console.error(""),console.error(t.bold(" How to use:")),console.error(l(' Point your agent at the file: "Read .skills/openskill-router.md"')),console.error(o(" The agent will then automatically search for relevant skills as needed.")),console.error("")}catch(r){s.fail("Failed to install router"),console.error(a(r instanceof Error?r.message:"Unknown error"))}}export{I as routerInstallCommand};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as v}from"./chunk-N5U3SVLG.js";import{d as C,e as P,f as x}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import"./chunk-YAZPI4SK.js";import{g as n,l as t,n as S,p as w,q as k,s as $,t as d,u as h}from"./chunk-4WV7FA5L.js";async function A(p){let b=v({text:`Searching for "${p}"...`,spinner:S,color:!1}).start();try{let s=await C(p);b.stop();let a=s.mcpServers??[];if(s.skills.length+s.blueprints.length+a.length===0){process.stderr.write(h(`No results found for "${p}".`)+`
3
+ import{a as v}from"./chunk-N5U3SVLG.js";import{d as C,e as P,f as x}from"./chunk-C4S3KDSI.js";import"./chunk-VRPJTK2B.js";import"./chunk-YAZPI4SK.js";import{g as n,l as t,n as S,p as w,q as k,s as $,t as d,u as h}from"./chunk-4WV7FA5L.js";async function A(p){let b=v({text:`Searching for "${p}"...`,spinner:S,color:!1}).start();try{let s=await C(p);b.stop();let a=s.mcpServers??[];if(s.skills.length+s.blueprints.length+a.length===0){process.stderr.write(h(`No results found for "${p}".`)+`
4
4
  `),process.stderr.write(t(` \u2192 Try broader search terms or run ${n("osm browse")} to explore categories.
5
5
  `)+`
6
6
  `);return}if(s.skills.length>0){process.stderr.write(d(`Skills (${s.skills.length})`)+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openskillmd/osm",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "The OpenSkill CLI (osm) — search, add, score, and explore AI agent skills from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{b as x,c as k,l as j}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import{g as f,h as S,k as R,l as u,t as $,u as m,w as P}from"./chunk-4WV7FA5L.js";import{spawn as H}from"child_process";import{existsSync as v}from"fs";import{delimiter as D,join as O}from"path";var p={"claude-code":{cli:"claude",label:"Claude Code",autoInstall:!0},codex:{cli:"codex",label:"Codex",autoInstall:!0}},_=new Set(Object.keys(p));function T(n){return _.has(n)}function E(n,e=process.env,r=process.platform){let o=(e.PATH||"").split(D).filter(Boolean),i=r==="win32"?["",".exe",".cmd",".bat"]:[""];for(let s of o)for(let l of i)if(v(O(s,n+l)))return!0;return!1}function A(n){let e=n.trim().toLowerCase();return e==="claude-code"||e==="claude"||e==="claudecode"?"claude-code":e==="codex"?"codex":null}function L(n,e){let r=n.runtimes.filter(T),o=new Set(r);if(e&&e.length>0){let i=[],s=[];for(let l of e){let a=A(l);a&&o.has(a)?i.includes(a)||i.push(a):s.push(l)}return{targets:i,unsupported:s}}return{targets:r,unsupported:[]}}function N(n){return n?"user":"project"}function C(n,e){return n.marketplaces.find(r=>r.runtime===e)??n.marketplaces[0]??null}function F(n,e,r){return[["plugin","marketplace","add",e.source],["plugin","install",`${n}@${e.name}`,"--scope",r]]}function z(n){return/^(https?:\/\/|git@|\.\/|\/)/.test(n)||n.endsWith(".git")?n:`https://github.com/${n}.git`}function B(n,e){return[["plugin","marketplace","add",z(e.source)],["plugin","add",`${n}@${e.name}`]]}function y(n,e,r,o){return n==="codex"?B(e,r):F(e,r,o)}function K(n,e,r){return new Promise(o=>{let i=H(n,e,{stdio:r?"ignore":"inherit"});i.once("exit",s=>o(s??1)),i.once("error",()=>o(127))})}async function ne(n,e={},r){let o;try{o=r??await j(n)}catch(t){if(t instanceof k&&t.statusCode===404){let g=await x();e.json?P({ok:!1,slug:n,error:{code:"PLUGIN_NOT_FOUND",message:`Plugin "${n}" not found.`}}):process.stderr.write(m(`Plugin "${n}" not found in the registry.`,`Browse plugins at ${g}/plugins`)+`
4
- `),process.exit(2)}e.json?P({ok:!1,slug:n,error:{code:"PLUGIN_LOOKUP_FAILED",message:t instanceof Error?t.message:"Unknown error"}}):process.stderr.write(m(`Couldn't reach the registry to resolve "${n}".`,"Check your connection (and OPENSKILL_API_URL, if set).")+`
5
- `),process.exit(1)}let i=o.displayName||o.name,{targets:s,unsupported:l}=L(o,e.agent),a=N(!!e.global);e.json||(console.error($(`Install plugin: ${i}`)),o.description&&console.error(u(` ${o.description}`)),console.error(""),l.length>0&&console.error(u(` Note: ${l.join(", ")} \u2014 not supported by this plugin (supports: ${o.runtimes.join(", ")||"none"}).`)));let M=s.length>0?s:o.runtimes.filter(t=>t in p),h=[],c=[],d=[];for(let t of s){let g=p[t],I=C(o,t);if(!I){c.push(t);continue}if(E(g.cli)){if(!e.json){let b=t==="codex"?"global":`${a} scope`;console.error(f.bold(` \u2192 Installing for ${g.label} (${b})\u2026`)),console.error("")}let U=y(t,o.name,I,a),w=!0;for(let b of U)if(await K(g.cli,b,!!e.json)!==0){w=!1;break}w?h.push(t):c.push(t)}else d.push({runtime:t,reason:"cli-not-found"})}if(s.length===0)for(let t of M)d.push({runtime:t,reason:"cli-not-found"});!e.json&&d.length>0&&W(o,d,a),e.json||(console.error(""),h.length>0&&(console.error(S.bold(` \u2713 Installed for ${h.map(t=>p[t].label).join(", ")}.`)),console.error(u(" Run /reload-plugins in Claude Code to activate it."))),c.length>0&&console.error(m(`Install failed for ${c.map(t=>p[t].label).join(", ")}.`))),e.json&&P({ok:c.length===0,slug:o.slug,installed:h,manual:d.map(t=>t.runtime),failed:c}),process.exit(c.length>0?1:0)}function W(n,e,r){for(let{runtime:o}of e){let i=p[o],s=C(n,o);if(s){console.error(""),console.error(f.bold(` ${i.label} CLI ("${i.cli}") not found on PATH. Install it, then run:`));for(let l of y(o,n.name,s,r))console.error(R(` ${i.cli} ${l.join(" ")}`))}}}async function oe(n){console.error($(`Plugin: ${n}`));let e;try{e=await j(n)}catch(o){if(o instanceof k&&o.statusCode===404){let i=await x();process.stderr.write(m(`Plugin "${n}" not found.`,`Browse plugins at ${i}/plugins`)+`
6
- `);return}process.stderr.write(m(o instanceof Error?o.message:"Unknown error")+`
7
- `);return}console.error(""),console.error(f.bold(` ${e.displayName||e.name}`)),e.description&&console.error(u(` ${e.description}`)),console.error("");let r=[];e.runtimes.length&&r.push(["Runtimes",e.runtimes.join(", ")]),e.category&&r.push(["Category",e.category]),e.stargazerCount!=null&&r.push(["Stars",String(e.stargazerCount)]),e.primaryLanguage&&r.push(["Language",e.primaryLanguage]),e.license&&r.push(["License",e.license]),e.source&&r.push(["Source",e.source]);for(let[o,i]of r)console.error(` ${u(`${o}:`)} ${R(i)}`);if(console.error(""),console.error(f.bold(" Install:")),console.error(R(` osm add ${e.slug}`)),e.marketplaces.length){console.error(""),console.error(f.bold(" Listed in marketplaces:"));for(let o of e.marketplaces)console.error(u(` - ${o.name} (${o.source}) \xB7 ${o.runtime}`))}console.error("")}export{oe as pluginInfoCommand,ne as pluginInstallCommand};