openskillmd 0.3.1 → 0.3.3

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,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{f as ju}from"./chunk-ONVELHE6.js";import{c as ee}from"./chunk-OVTYCRA4.js";import{chmod as O$,mkdir as D$,readFile as wf,writeFile as Z$}from"fs/promises";import{homedir as jf}from"os";import{join as Pd}from"path";var W={};ee(W,{$brand:()=>xn,$input:()=>Mo,$output:()=>Vo,NEVER:()=>bn,TimePrecision:()=>Wo,ZodAny:()=>Ac,ZodArray:()=>Fc,ZodBase64:()=>cn,ZodBase64URL:()=>un,ZodBigInt:()=>et,ZodBigIntFormat:()=>dn,ZodBoolean:()=>Qe,ZodCIDRv4:()=>on,ZodCIDRv6:()=>an,ZodCUID:()=>Yr,ZodCUID2:()=>Hr,ZodCatch:()=>su,ZodCodec:()=>Dt,ZodCustom:()=>Zt,ZodCustomStringFormat:()=>Ye,ZodDate:()=>wt,ZodDefault:()=>nu,ZodDiscriminatedUnion:()=>Vc,ZodE164:()=>sn,ZodEmail:()=>Wr,ZodEmoji:()=>qr,ZodEnum:()=>qe,ZodError:()=>mf,ZodExactOptional:()=>eu,ZodFile:()=>Hc,ZodFirstPartyTypeKind:()=>xu,ZodFunction:()=>_u,ZodGUID:()=>xt,ZodIPv4:()=>rn,ZodIPv6:()=>nn,ZodISODate:()=>Jr,ZodISODateTime:()=>Fr,ZodISODuration:()=>Mr,ZodISOTime:()=>Vr,ZodIntersection:()=>Mc,ZodIssueCode:()=>ff,ZodJWT:()=>ln,ZodKSUID:()=>tn,ZodLazy:()=>vu,ZodLiteral:()=>Yc,ZodMAC:()=>Uc,ZodMap:()=>qc,ZodNaN:()=>du,ZodNanoID:()=>Xr,ZodNever:()=>Rc,ZodNonOptional:()=>$n,ZodNull:()=>Tc,ZodNullable:()=>ru,ZodNumber:()=>He,ZodNumberFormat:()=>ke,ZodObject:()=>Pt,ZodOptional:()=>vn,ZodPipe:()=>Ot,ZodPrefault:()=>ou,ZodPreprocess:()=>mu,ZodPromise:()=>hu,ZodReadonly:()=>pu,ZodRealError:()=>J,ZodRecord:()=>We,ZodSet:()=>Xc,ZodString:()=>Xe,ZodStringFormat:()=>w,ZodSuccess:()=>uu,ZodSymbol:()=>Zc,ZodTemplateLiteral:()=>gu,ZodTransform:()=>Qc,ZodTuple:()=>Gc,ZodType:()=>k,ZodULID:()=>Qr,ZodURL:()=>It,ZodUUID:()=>Q,ZodUndefined:()=>Nc,ZodUnion:()=>Ut,ZodUnknown:()=>Lc,ZodVoid:()=>Cc,ZodXID:()=>en,ZodXor:()=>Jc,_ZodString:()=>Br,_default:()=>iu,_function:()=>vd,any:()=>Bl,array:()=>jt,base64:()=>Ul,base64url:()=>Ol,bigint:()=>Jl,boolean:()=>Dc,catch:()=>lu,check:()=>$d,cidrv4:()=>jl,cidrv6:()=>Pl,clone:()=>T,codec:()=>md,coerce:()=>ku,config:()=>U,core:()=>ne,cuid:()=>yl,cuid2:()=>bl,custom:()=>hd,date:()=>ql,decode:()=>kc,decodeAsync:()=>Sc,describe:()=>_d,discriminatedUnion:()=>td,e164:()=>Dl,email:()=>ll,emoji:()=>hl,encode:()=>xc,encodeAsync:()=>zc,endsWith:()=>Le,enum:()=>fn,exactOptional:()=>tu,file:()=>ud,flattenError:()=>ut,float32:()=>Ll,float64:()=>Rl,formatError:()=>st,fromJSONSchema:()=>Id,function:()=>vd,getErrorMap:()=>vf,globalRegistry:()=>Z,gt:()=>Y,gte:()=>A,guid:()=>dl,hash:()=>Al,hex:()=>El,hostname:()=>Tl,httpUrl:()=>$l,includes:()=>Ee,instanceof:()=>bd,int:()=>Kr,int32:()=>Cl,int64:()=>Vl,intersection:()=>Kc,invertCodec:()=>pd,ipv4:()=>Sl,ipv6:()=>wl,iso:()=>Be,json:()=>kd,jwt:()=>Zl,keyof:()=>Xl,ksuid:()=>zl,lazy:()=>$u,length:()=>be,literal:()=>cd,locales:()=>$t,looseObject:()=>Ql,looseRecord:()=>nd,lowercase:()=>Ne,lt:()=>X,lte:()=>M,mac:()=>Il,map:()=>id,maxLength:()=>ye,maxSize:()=>le,meta:()=>yd,mime:()=>Re,minLength:()=>re,minSize:()=>H,multipleOf:()=>se,nan:()=>dd,nanoid:()=>_l,nativeEnum:()=>ad,negative:()=>Or,never:()=>mn,nonnegative:()=>Zr,nonoptional:()=>cu,nonpositive:()=>Dr,normalize:()=>Ce,null:()=>Ec,nullable:()=>zt,nullish:()=>sd,number:()=>Oc,object:()=>Yl,optional:()=>kt,overwrite:()=>B,parse:()=>hc,parseAsync:()=>_c,partialRecord:()=>rd,pipe:()=>Gr,positive:()=>Ur,prefault:()=>au,preprocess:()=>zd,prettifyError:()=>Tn,promise:()=>gd,property:()=>Nr,readonly:()=>fu,record:()=>Wc,refine:()=>yu,regex:()=>Ze,regexes:()=>V,registry:()=>sr,safeDecode:()=>wc,safeDecodeAsync:()=>Pc,safeEncode:()=>Ic,safeEncodeAsync:()=>jc,safeParse:()=>yc,safeParseAsync:()=>bc,set:()=>od,setErrorMap:()=>gf,size:()=>_e,slugify:()=>Me,startsWith:()=>Ae,strictObject:()=>Hl,string:()=>bt,stringFormat:()=>Nl,stringbool:()=>xd,success:()=>ld,superRefine:()=>bu,symbol:()=>Kl,templateLiteral:()=>fd,toJSONSchema:()=>Lr,toLowerCase:()=>Je,toUpperCase:()=>Ve,transform:()=>gn,treeifyError:()=>Nn,trim:()=>Fe,tuple:()=>Bc,uint32:()=>Fl,uint64:()=>Ml,ulid:()=>xl,undefined:()=>Gl,union:()=>pn,unknown:()=>xe,uppercase:()=>Te,url:()=>vl,util:()=>v,uuid:()=>ml,uuidv4:()=>pl,uuidv6:()=>fl,uuidv7:()=>gl,void:()=>Wl,xid:()=>kl,xor:()=>ed});var ne={};ee(ne,{$ZodAny:()=>lo,$ZodArray:()=>vo,$ZodAsyncError:()=>G,$ZodBase64:()=>eo,$ZodBase64URL:()=>to,$ZodBigInt:()=>tr,$ZodBigIntFormat:()=>ao,$ZodBoolean:()=>pt,$ZodCIDRv4:()=>Yi,$ZodCIDRv6:()=>Hi,$ZodCUID:()=>Ri,$ZodCUID2:()=>Ci,$ZodCatch:()=>No,$ZodCheck:()=>j,$ZodCheckBigIntFormat:()=>gi,$ZodCheckEndsWith:()=>wi,$ZodCheckGreaterThan:()=>qt,$ZodCheckIncludes:()=>Si,$ZodCheckLengthEquals:()=>bi,$ZodCheckLessThan:()=>Wt,$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:()=>Ii,$ZodCheckStringFormat:()=>Oe,$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:()=>Io,$ZodFunction:()=>Ro,$ZodGUID:()=>Zi,$ZodIPv4:()=>Wi,$ZodIPv6:()=>qi,$ZodISODate:()=>Ki,$ZodISODateTime:()=>Mi,$ZodISODuration:()=>Bi,$ZodISOTime:()=>Gi,$ZodIntersection:()=>yo,$ZodJWT:()=>no,$ZodKSUID:()=>Vi,$ZodLazy:()=>Fo,$ZodLiteral:()=>So,$ZodMAC:()=>Xi,$ZodMap:()=>xo,$ZodNaN:()=>To,$ZodNanoID:()=>Li,$ZodNever:()=>po,$ZodNonOptional:()=>Do,$ZodNull:()=>so,$ZodNullable:()=>Po,$ZodNumber:()=>er,$ZodNumberFormat:()=>oo,$ZodObject:()=>os,$ZodObjectJIT:()=>$o,$ZodOptional:()=>nr,$ZodPipe:()=>ir,$ZodPrefault:()=>Oo,$ZodPreprocess:()=>Eo,$ZodPromise:()=>Co,$ZodReadonly:()=>Ao,$ZodRealError:()=>F,$ZodRecord:()=>bo,$ZodRegistry:()=>ur,$ZodSet:()=>ko,$ZodString:()=>he,$ZodStringFormat:()=>I,$ZodSuccess:()=>Zo,$ZodSymbol:()=>co,$ZodTemplateLiteral:()=>Lo,$ZodTransform:()=>wo,$ZodTuple:()=>rr,$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:()=>cl,JSONSchemaGenerator:()=>Rr,NEVER:()=>bn,TimePrecision:()=>Wo,_any:()=>ga,_array:()=>xa,_base64:()=>Ir,_base64url:()=>wr,_bigint:()=>ua,_boolean:()=>aa,_catch:()=>nf,_check:()=>al,_cidrv4:()=>zr,_cidrv6:()=>Sr,_coercedBigint:()=>sa,_coercedBoolean:()=>ca,_coercedDate:()=>ya,_coercedNumber:()=>ea,_coercedString:()=>Go,_cuid:()=>$r,_cuid2:()=>hr,_custom:()=>za,_date:()=>_a,_decode:()=>Rt,_decodeAsync:()=>Ft,_default:()=>ef,_discriminatedUnion:()=>Jp,_e164:()=>jr,_email:()=>lr,_emoji:()=>gr,_encode:()=>Lt,_encodeAsync:()=>Ct,_endsWith:()=>Le,_enum:()=>Wp,_file:()=>ka,_float32:()=>ra,_float64:()=>na,_gt:()=>Y,_gte:()=>A,_guid:()=>ht,_includes:()=>Ee,_int:()=>ta,_int32:()=>ia,_int64:()=>la,_intersection:()=>Vp,_ipv4:()=>xr,_ipv6:()=>kr,_isoDate:()=>Xo,_isoDateTime:()=>qo,_isoDuration:()=>Ho,_isoTime:()=>Yo,_jwt:()=>Pr,_ksuid:()=>br,_lazy:()=>uf,_length:()=>be,_literal:()=>Xp,_lowercase:()=>Ne,_lt:()=>X,_lte:()=>M,_mac:()=>Bo,_map:()=>Gp,_max:()=>M,_maxLength:()=>ye,_maxSize:()=>le,_mime:()=>Re,_min:()=>A,_minLength:()=>re,_minSize:()=>H,_multipleOf:()=>se,_nan:()=>ba,_nanoid:()=>vr,_nativeEnum:()=>qp,_negative:()=>Or,_never:()=>$a,_nonnegative:()=>Zr,_nonoptional:()=>tf,_nonpositive:()=>Dr,_normalize:()=>Ce,_null:()=>fa,_nullable:()=>Qp,_number:()=>Qo,_optional:()=>Hp,_overwrite:()=>B,_parse:()=>we,_parseAsync:()=>je,_pipe:()=>of,_positive:()=>Ur,_promise:()=>sf,_property:()=>Nr,_readonly:()=>af,_record:()=>Kp,_refine:()=>Sa,_regex:()=>Ze,_safeDecode:()=>Vt,_safeDecodeAsync:()=>Kt,_safeEncode:()=>Jt,_safeEncodeAsync:()=>Mt,_safeParse:()=>Pe,_safeParseAsync:()=>Ue,_set:()=>Bp,_size:()=>_e,_slugify:()=>Me,_startsWith:()=>Ae,_string:()=>Ko,_stringFormat:()=>Ke,_stringbool:()=>Pa,_success:()=>rf,_superRefine:()=>Ia,_symbol:()=>ma,_templateLiteral:()=>cf,_toLowerCase:()=>Je,_toUpperCase:()=>Ve,_transform:()=>Yp,_trim:()=>Fe,_tuple:()=>Mp,_uint32:()=>oa,_uint64:()=>da,_ulid:()=>_r,_undefined:()=>pa,_union:()=>Cp,_unknown:()=>va,_uppercase:()=>Te,_url:()=>_t,_uuid:()=>dr,_uuidv4:()=>mr,_uuidv6:()=>pr,_uuidv7:()=>fr,_void:()=>ha,_xid:()=>yr,_xor:()=>Fp,clone:()=>T,config:()=>U,createStandardJSONSchemaMethod:()=>Ge,createToJSONSchemaMethod:()=>Ua,decode:()=>um,decodeAsync:()=>lm,describe:()=>wa,encode:()=>cm,encodeAsync:()=>sm,extractDefs:()=>me,finalize:()=>pe,flattenError:()=>ut,formatError:()=>st,globalConfig:()=>ge,globalRegistry:()=>Z,initializeContext:()=>de,isValidBase64:()=>Qi,isValidBase64URL:()=>ts,isValidJWT:()=>rs,locales:()=>$t,meta:()=>ja,parse:()=>Et,parseAsync:()=>At,prettifyError:()=>Tn,process:()=>S,regexes:()=>V,registry:()=>sr,safeDecode:()=>mm,safeDecodeAsync:()=>fm,safeEncode:()=>dm,safeEncodeAsync:()=>pm,safeParse:()=>En,safeParseAsync:()=>An,toDotPath:()=>Nu,toJSONSchema:()=>Lr,treeifyError:()=>Nn,util:()=>v,version:()=>Oi});var Pu,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"),G=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"}};(Pu=globalThis).__zod_globalConfig??(Pu.__zod_globalConfig={});var ge=globalThis.__zod_globalConfig;function U(t){return t&&Object.assign(ge,t),ge}var v={};ee(v,{BIGINT_FORMAT_RANGES:()=>Dn,Class:()=>zn,NUMBER_FORMAT_RANGES:()=>On,aborted:()=>ue,allowsEval:()=>wn,assert:()=>Rd,assertEqual:()=>Td,assertIs:()=>Ad,assertNever:()=>Ld,assertNotEqual:()=>Ed,assignProp:()=>ae,base64ToUint8Array:()=>Ou,base64urlToUint8Array:()=>rm,cached:()=>Se,captureStackTrace:()=>Tt,cleanEnum:()=>tm,cleanRegex:()=>nt,clone:()=>T,cloneDef:()=>Fd,createTransparentProxy:()=>Bd,defineLazy:()=>z,esc:()=>Nt,escapeRegex:()=>K,explicitlyAborted:()=>Zn,extend:()=>Xd,finalizeIssue:()=>E,floatSafeRemainder:()=>Sn,getElementAtPath:()=>Jd,getEnumValues:()=>rt,getLengthableOrigin:()=>at,getParsedType:()=>Gd,getSizableOrigin:()=>ot,hexToUint8Array:()=>im,isObject:()=>ve,isPlainObject:()=>ce,issue:()=>Ie,joinValues:()=>m,jsonStringifyReplacer:()=>ze,merge:()=>Hd,mergeDefs:()=>te,normalizeParams:()=>h,nullish:()=>oe,numKeys:()=>Kd,objectClone:()=>Cd,omit:()=>qd,optionalKeys:()=>Un,parsedType:()=>g,partial:()=>Qd,pick:()=>Wd,prefixIssues:()=>C,primitiveTypes:()=>Pn,promiseAllObject:()=>Vd,propertyKeyTypes:()=>it,randomString:()=>Md,required:()=>em,safeExtend:()=>Yd,shallowClone:()=>jn,slugify:()=>In,stringifyPrimitive:()=>f,uint8ArrayToBase64:()=>Du,uint8ArrayToBase64url:()=>nm,uint8ArrayToHex:()=>om,unwrapMessage:()=>tt});function Td(t){return t}function Ed(t){return t}function Ad(t){}function Ld(t){throw new Error("Unexpected value in exhaustive check")}function Rd(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 ze(t,r){return typeof r=="bigint"?r.toString():r}function Se(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 Sn(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 Uu=Symbol("evaluating");function z(t,r,i){let o;Object.defineProperty(t,r,{get(){if(o!==Uu)return o===void 0&&(o=Uu,o=i()),o},set(e){Object.defineProperty(t,r,{value:e})},configurable:!0})}function Cd(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 Fd(t){return te(t._zod.def)}function Jd(t,r){return r?r.reduce((i,o)=>i?.[o],t):t}function Vd(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 Md(t=10){let r="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<t;o++)i+=r[Math.floor(Math.random()*r.length)];return i}function Nt(t){return JSON.stringify(t)}function In(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Tt="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ve(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var wn=Se(()=>{if(ge.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(ve(t)===!1)return!1;let r=t.constructor;if(r===void 0||typeof r!="function")return!0;let i=r.prototype;return!(ve(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 Kd(t){let r=0;for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&r++;return r}var Gd=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 K(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 Bd(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]},Dn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Wd(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 qd(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 Xd(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 Yd(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 Hd(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 Qd(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 em(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 Zn(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 tm(t){return Object.entries(t).filter(([r,i])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Ou(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 Du(t){let r="";for(let i=0;i<t.length;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function rm(t){let r=t.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-r.length%4)%4);return Ou(r+i)}function nm(t){return Du(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function im(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 om(t){return Array.from(t).map(r=>r.toString(16).padStart(2,"0")).join("")}var zn=class{constructor(...r){}};var Zu=(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,ze,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},ct=l("$ZodError",Zu),F=l("$ZodError",Zu,{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 Nu(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 ${Nu(o.path)}`);return r.join(`
3
+ import{f as ju}from"./chunk-AZ56ID7P.js";import{c as ee}from"./chunk-GTRQVB2J.js";import{chmod as O$,mkdir as D$,readFile as wf,writeFile as Z$}from"fs/promises";import{homedir as jf}from"os";import{join as Pd}from"path";var W={};ee(W,{$brand:()=>xn,$input:()=>Mo,$output:()=>Vo,NEVER:()=>bn,TimePrecision:()=>Wo,ZodAny:()=>Ac,ZodArray:()=>Fc,ZodBase64:()=>cn,ZodBase64URL:()=>un,ZodBigInt:()=>et,ZodBigIntFormat:()=>dn,ZodBoolean:()=>Qe,ZodCIDRv4:()=>on,ZodCIDRv6:()=>an,ZodCUID:()=>Yr,ZodCUID2:()=>Hr,ZodCatch:()=>su,ZodCodec:()=>Dt,ZodCustom:()=>Zt,ZodCustomStringFormat:()=>Ye,ZodDate:()=>wt,ZodDefault:()=>nu,ZodDiscriminatedUnion:()=>Vc,ZodE164:()=>sn,ZodEmail:()=>Wr,ZodEmoji:()=>qr,ZodEnum:()=>qe,ZodError:()=>mf,ZodExactOptional:()=>eu,ZodFile:()=>Hc,ZodFirstPartyTypeKind:()=>xu,ZodFunction:()=>_u,ZodGUID:()=>xt,ZodIPv4:()=>rn,ZodIPv6:()=>nn,ZodISODate:()=>Jr,ZodISODateTime:()=>Fr,ZodISODuration:()=>Mr,ZodISOTime:()=>Vr,ZodIntersection:()=>Mc,ZodIssueCode:()=>ff,ZodJWT:()=>ln,ZodKSUID:()=>tn,ZodLazy:()=>vu,ZodLiteral:()=>Yc,ZodMAC:()=>Uc,ZodMap:()=>qc,ZodNaN:()=>du,ZodNanoID:()=>Xr,ZodNever:()=>Rc,ZodNonOptional:()=>$n,ZodNull:()=>Tc,ZodNullable:()=>ru,ZodNumber:()=>He,ZodNumberFormat:()=>ke,ZodObject:()=>Pt,ZodOptional:()=>vn,ZodPipe:()=>Ot,ZodPrefault:()=>ou,ZodPreprocess:()=>mu,ZodPromise:()=>hu,ZodReadonly:()=>pu,ZodRealError:()=>J,ZodRecord:()=>We,ZodSet:()=>Xc,ZodString:()=>Xe,ZodStringFormat:()=>w,ZodSuccess:()=>uu,ZodSymbol:()=>Zc,ZodTemplateLiteral:()=>gu,ZodTransform:()=>Qc,ZodTuple:()=>Gc,ZodType:()=>k,ZodULID:()=>Qr,ZodURL:()=>It,ZodUUID:()=>Q,ZodUndefined:()=>Nc,ZodUnion:()=>Ut,ZodUnknown:()=>Lc,ZodVoid:()=>Cc,ZodXID:()=>en,ZodXor:()=>Jc,_ZodString:()=>Br,_default:()=>iu,_function:()=>vd,any:()=>Bl,array:()=>jt,base64:()=>Ul,base64url:()=>Ol,bigint:()=>Jl,boolean:()=>Dc,catch:()=>lu,check:()=>$d,cidrv4:()=>jl,cidrv6:()=>Pl,clone:()=>T,codec:()=>md,coerce:()=>ku,config:()=>U,core:()=>ne,cuid:()=>yl,cuid2:()=>bl,custom:()=>hd,date:()=>ql,decode:()=>kc,decodeAsync:()=>Sc,describe:()=>_d,discriminatedUnion:()=>td,e164:()=>Dl,email:()=>ll,emoji:()=>hl,encode:()=>xc,encodeAsync:()=>zc,endsWith:()=>Le,enum:()=>fn,exactOptional:()=>tu,file:()=>ud,flattenError:()=>ut,float32:()=>Ll,float64:()=>Rl,formatError:()=>st,fromJSONSchema:()=>Id,function:()=>vd,getErrorMap:()=>vf,globalRegistry:()=>Z,gt:()=>Y,gte:()=>A,guid:()=>dl,hash:()=>Al,hex:()=>El,hostname:()=>Tl,httpUrl:()=>$l,includes:()=>Ee,instanceof:()=>bd,int:()=>Kr,int32:()=>Cl,int64:()=>Vl,intersection:()=>Kc,invertCodec:()=>pd,ipv4:()=>Sl,ipv6:()=>wl,iso:()=>Be,json:()=>kd,jwt:()=>Zl,keyof:()=>Xl,ksuid:()=>zl,lazy:()=>$u,length:()=>be,literal:()=>cd,locales:()=>$t,looseObject:()=>Ql,looseRecord:()=>nd,lowercase:()=>Ne,lt:()=>X,lte:()=>M,mac:()=>Il,map:()=>id,maxLength:()=>ye,maxSize:()=>le,meta:()=>yd,mime:()=>Re,minLength:()=>re,minSize:()=>H,multipleOf:()=>se,nan:()=>dd,nanoid:()=>_l,nativeEnum:()=>ad,negative:()=>Or,never:()=>mn,nonnegative:()=>Zr,nonoptional:()=>cu,nonpositive:()=>Dr,normalize:()=>Ce,null:()=>Ec,nullable:()=>zt,nullish:()=>sd,number:()=>Oc,object:()=>Yl,optional:()=>kt,overwrite:()=>B,parse:()=>hc,parseAsync:()=>_c,partialRecord:()=>rd,pipe:()=>Gr,positive:()=>Ur,prefault:()=>au,preprocess:()=>zd,prettifyError:()=>Tn,promise:()=>gd,property:()=>Nr,readonly:()=>fu,record:()=>Wc,refine:()=>yu,regex:()=>Ze,regexes:()=>V,registry:()=>sr,safeDecode:()=>wc,safeDecodeAsync:()=>Pc,safeEncode:()=>Ic,safeEncodeAsync:()=>jc,safeParse:()=>yc,safeParseAsync:()=>bc,set:()=>od,setErrorMap:()=>gf,size:()=>_e,slugify:()=>Me,startsWith:()=>Ae,strictObject:()=>Hl,string:()=>bt,stringFormat:()=>Nl,stringbool:()=>xd,success:()=>ld,superRefine:()=>bu,symbol:()=>Kl,templateLiteral:()=>fd,toJSONSchema:()=>Lr,toLowerCase:()=>Je,toUpperCase:()=>Ve,transform:()=>gn,treeifyError:()=>Nn,trim:()=>Fe,tuple:()=>Bc,uint32:()=>Fl,uint64:()=>Ml,ulid:()=>xl,undefined:()=>Gl,union:()=>pn,unknown:()=>xe,uppercase:()=>Te,url:()=>vl,util:()=>v,uuid:()=>ml,uuidv4:()=>pl,uuidv6:()=>fl,uuidv7:()=>gl,void:()=>Wl,xid:()=>kl,xor:()=>ed});var ne={};ee(ne,{$ZodAny:()=>lo,$ZodArray:()=>vo,$ZodAsyncError:()=>G,$ZodBase64:()=>eo,$ZodBase64URL:()=>to,$ZodBigInt:()=>tr,$ZodBigIntFormat:()=>ao,$ZodBoolean:()=>pt,$ZodCIDRv4:()=>Yi,$ZodCIDRv6:()=>Hi,$ZodCUID:()=>Ri,$ZodCUID2:()=>Ci,$ZodCatch:()=>No,$ZodCheck:()=>j,$ZodCheckBigIntFormat:()=>gi,$ZodCheckEndsWith:()=>wi,$ZodCheckGreaterThan:()=>qt,$ZodCheckIncludes:()=>Si,$ZodCheckLengthEquals:()=>bi,$ZodCheckLessThan:()=>Wt,$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:()=>Ii,$ZodCheckStringFormat:()=>Oe,$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:()=>Io,$ZodFunction:()=>Ro,$ZodGUID:()=>Zi,$ZodIPv4:()=>Wi,$ZodIPv6:()=>qi,$ZodISODate:()=>Ki,$ZodISODateTime:()=>Mi,$ZodISODuration:()=>Bi,$ZodISOTime:()=>Gi,$ZodIntersection:()=>yo,$ZodJWT:()=>no,$ZodKSUID:()=>Vi,$ZodLazy:()=>Fo,$ZodLiteral:()=>So,$ZodMAC:()=>Xi,$ZodMap:()=>xo,$ZodNaN:()=>To,$ZodNanoID:()=>Li,$ZodNever:()=>po,$ZodNonOptional:()=>Do,$ZodNull:()=>so,$ZodNullable:()=>Po,$ZodNumber:()=>er,$ZodNumberFormat:()=>oo,$ZodObject:()=>os,$ZodObjectJIT:()=>$o,$ZodOptional:()=>nr,$ZodPipe:()=>ir,$ZodPrefault:()=>Oo,$ZodPreprocess:()=>Eo,$ZodPromise:()=>Co,$ZodReadonly:()=>Ao,$ZodRealError:()=>F,$ZodRecord:()=>bo,$ZodRegistry:()=>ur,$ZodSet:()=>ko,$ZodString:()=>he,$ZodStringFormat:()=>I,$ZodSuccess:()=>Zo,$ZodSymbol:()=>co,$ZodTemplateLiteral:()=>Lo,$ZodTransform:()=>wo,$ZodTuple:()=>rr,$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:()=>cl,JSONSchemaGenerator:()=>Rr,NEVER:()=>bn,TimePrecision:()=>Wo,_any:()=>ga,_array:()=>xa,_base64:()=>Ir,_base64url:()=>wr,_bigint:()=>ua,_boolean:()=>aa,_catch:()=>nf,_check:()=>al,_cidrv4:()=>zr,_cidrv6:()=>Sr,_coercedBigint:()=>sa,_coercedBoolean:()=>ca,_coercedDate:()=>ya,_coercedNumber:()=>ea,_coercedString:()=>Go,_cuid:()=>$r,_cuid2:()=>hr,_custom:()=>za,_date:()=>_a,_decode:()=>Rt,_decodeAsync:()=>Ft,_default:()=>ef,_discriminatedUnion:()=>Jp,_e164:()=>jr,_email:()=>lr,_emoji:()=>gr,_encode:()=>Lt,_encodeAsync:()=>Ct,_endsWith:()=>Le,_enum:()=>Wp,_file:()=>ka,_float32:()=>ra,_float64:()=>na,_gt:()=>Y,_gte:()=>A,_guid:()=>ht,_includes:()=>Ee,_int:()=>ta,_int32:()=>ia,_int64:()=>la,_intersection:()=>Vp,_ipv4:()=>xr,_ipv6:()=>kr,_isoDate:()=>Xo,_isoDateTime:()=>qo,_isoDuration:()=>Ho,_isoTime:()=>Yo,_jwt:()=>Pr,_ksuid:()=>br,_lazy:()=>uf,_length:()=>be,_literal:()=>Xp,_lowercase:()=>Ne,_lt:()=>X,_lte:()=>M,_mac:()=>Bo,_map:()=>Gp,_max:()=>M,_maxLength:()=>ye,_maxSize:()=>le,_mime:()=>Re,_min:()=>A,_minLength:()=>re,_minSize:()=>H,_multipleOf:()=>se,_nan:()=>ba,_nanoid:()=>vr,_nativeEnum:()=>qp,_negative:()=>Or,_never:()=>$a,_nonnegative:()=>Zr,_nonoptional:()=>tf,_nonpositive:()=>Dr,_normalize:()=>Ce,_null:()=>fa,_nullable:()=>Qp,_number:()=>Qo,_optional:()=>Hp,_overwrite:()=>B,_parse:()=>we,_parseAsync:()=>je,_pipe:()=>of,_positive:()=>Ur,_promise:()=>sf,_property:()=>Nr,_readonly:()=>af,_record:()=>Kp,_refine:()=>Sa,_regex:()=>Ze,_safeDecode:()=>Vt,_safeDecodeAsync:()=>Kt,_safeEncode:()=>Jt,_safeEncodeAsync:()=>Mt,_safeParse:()=>Pe,_safeParseAsync:()=>Ue,_set:()=>Bp,_size:()=>_e,_slugify:()=>Me,_startsWith:()=>Ae,_string:()=>Ko,_stringFormat:()=>Ke,_stringbool:()=>Pa,_success:()=>rf,_superRefine:()=>Ia,_symbol:()=>ma,_templateLiteral:()=>cf,_toLowerCase:()=>Je,_toUpperCase:()=>Ve,_transform:()=>Yp,_trim:()=>Fe,_tuple:()=>Mp,_uint32:()=>oa,_uint64:()=>da,_ulid:()=>_r,_undefined:()=>pa,_union:()=>Cp,_unknown:()=>va,_uppercase:()=>Te,_url:()=>_t,_uuid:()=>dr,_uuidv4:()=>mr,_uuidv6:()=>pr,_uuidv7:()=>fr,_void:()=>ha,_xid:()=>yr,_xor:()=>Fp,clone:()=>T,config:()=>U,createStandardJSONSchemaMethod:()=>Ge,createToJSONSchemaMethod:()=>Ua,decode:()=>um,decodeAsync:()=>lm,describe:()=>wa,encode:()=>cm,encodeAsync:()=>sm,extractDefs:()=>me,finalize:()=>pe,flattenError:()=>ut,formatError:()=>st,globalConfig:()=>ge,globalRegistry:()=>Z,initializeContext:()=>de,isValidBase64:()=>Qi,isValidBase64URL:()=>ts,isValidJWT:()=>rs,locales:()=>$t,meta:()=>ja,parse:()=>Et,parseAsync:()=>At,prettifyError:()=>Tn,process:()=>S,regexes:()=>V,registry:()=>sr,safeDecode:()=>mm,safeDecodeAsync:()=>fm,safeEncode:()=>dm,safeEncodeAsync:()=>pm,safeParse:()=>En,safeParseAsync:()=>An,toDotPath:()=>Nu,toJSONSchema:()=>Lr,treeifyError:()=>Nn,util:()=>v,version:()=>Oi});var Pu,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"),G=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"}};(Pu=globalThis).__zod_globalConfig??(Pu.__zod_globalConfig={});var ge=globalThis.__zod_globalConfig;function U(t){return t&&Object.assign(ge,t),ge}var v={};ee(v,{BIGINT_FORMAT_RANGES:()=>Dn,Class:()=>zn,NUMBER_FORMAT_RANGES:()=>On,aborted:()=>ue,allowsEval:()=>wn,assert:()=>Rd,assertEqual:()=>Td,assertIs:()=>Ad,assertNever:()=>Ld,assertNotEqual:()=>Ed,assignProp:()=>ae,base64ToUint8Array:()=>Ou,base64urlToUint8Array:()=>rm,cached:()=>Se,captureStackTrace:()=>Tt,cleanEnum:()=>tm,cleanRegex:()=>nt,clone:()=>T,cloneDef:()=>Fd,createTransparentProxy:()=>Bd,defineLazy:()=>z,esc:()=>Nt,escapeRegex:()=>K,explicitlyAborted:()=>Zn,extend:()=>Xd,finalizeIssue:()=>E,floatSafeRemainder:()=>Sn,getElementAtPath:()=>Jd,getEnumValues:()=>rt,getLengthableOrigin:()=>at,getParsedType:()=>Gd,getSizableOrigin:()=>ot,hexToUint8Array:()=>im,isObject:()=>ve,isPlainObject:()=>ce,issue:()=>Ie,joinValues:()=>m,jsonStringifyReplacer:()=>ze,merge:()=>Hd,mergeDefs:()=>te,normalizeParams:()=>h,nullish:()=>oe,numKeys:()=>Kd,objectClone:()=>Cd,omit:()=>qd,optionalKeys:()=>Un,parsedType:()=>g,partial:()=>Qd,pick:()=>Wd,prefixIssues:()=>C,primitiveTypes:()=>Pn,promiseAllObject:()=>Vd,propertyKeyTypes:()=>it,randomString:()=>Md,required:()=>em,safeExtend:()=>Yd,shallowClone:()=>jn,slugify:()=>In,stringifyPrimitive:()=>f,uint8ArrayToBase64:()=>Du,uint8ArrayToBase64url:()=>nm,uint8ArrayToHex:()=>om,unwrapMessage:()=>tt});function Td(t){return t}function Ed(t){return t}function Ad(t){}function Ld(t){throw new Error("Unexpected value in exhaustive check")}function Rd(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 ze(t,r){return typeof r=="bigint"?r.toString():r}function Se(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 Sn(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 Uu=Symbol("evaluating");function z(t,r,i){let o;Object.defineProperty(t,r,{get(){if(o!==Uu)return o===void 0&&(o=Uu,o=i()),o},set(e){Object.defineProperty(t,r,{value:e})},configurable:!0})}function Cd(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 Fd(t){return te(t._zod.def)}function Jd(t,r){return r?r.reduce((i,o)=>i?.[o],t):t}function Vd(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 Md(t=10){let r="abcdefghijklmnopqrstuvwxyz",i="";for(let o=0;o<t;o++)i+=r[Math.floor(Math.random()*r.length)];return i}function Nt(t){return JSON.stringify(t)}function In(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Tt="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ve(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var wn=Se(()=>{if(ge.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(ve(t)===!1)return!1;let r=t.constructor;if(r===void 0||typeof r!="function")return!0;let i=r.prototype;return!(ve(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 Kd(t){let r=0;for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&r++;return r}var Gd=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 K(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 Bd(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]},Dn={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Wd(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 qd(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 Xd(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 Yd(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 Hd(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 Qd(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 em(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 Zn(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 tm(t){return Object.entries(t).filter(([r,i])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function Ou(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 Du(t){let r="";for(let i=0;i<t.length;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function rm(t){let r=t.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-r.length%4)%4);return Ou(r+i)}function nm(t){return Du(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function im(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 om(t){return Array.from(t).map(r=>r.toString(16).padStart(2,"0")).join("")}var zn=class{constructor(...r){}};var Zu=(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,ze,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},ct=l("$ZodError",Zu),F=l("$ZodError",Zu,{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 Nu(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 ${Nu(o.path)}`);return r.join(`
4
4
  `)}var we=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 G;if(a.issues.length){let c=new(e?.Err??t)(a.issues.map(s=>E(s,n,U())));throw Tt(c,e?.callee),c}return a.value},Et=we(F),je=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 Tt(c,e?.callee),c}return a.value},At=je(F),Pe=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 G;return n.issues.length?{success:!1,error:new(t??ct)(n.issues.map(a=>E(a,e,U())))}:{success:!0,data:n.value}},En=Pe(F),Ue=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=Ue(F),Lt=t=>(r,i,o)=>{let e=o?{...o,direction:"backward"}:{direction:"backward"};return we(t)(r,i,e)},cm=Lt(F),Rt=t=>(r,i,o)=>we(t)(r,i,o),um=Rt(F),Ct=t=>async(r,i,o)=>{let e=o?{...o,direction:"backward"}:{direction:"backward"};return je(t)(r,i,e)},sm=Ct(F),Ft=t=>async(r,i,o)=>je(t)(r,i,o),lm=Ft(F),Jt=t=>(r,i,o)=>{let e=o?{...o,direction:"backward"}:{direction:"backward"};return Pe(t)(r,i,e)},dm=Jt(F),Vt=t=>(r,i,o)=>Pe(t)(r,i,o),mm=Vt(F),Mt=t=>async(r,i,o)=>{let e=o?{...o,direction:"backward"}:{direction:"backward"};return Ue(t)(r,i,e)},pm=Mt(F),Kt=t=>async(r,i,o)=>Ue(t)(r,i,o),fm=Kt(F);var V={};ee(V,{base64:()=>Qn,base64url:()=>Gt,bigint:()=>ai,boolean:()=>ui,browserEmail:()=>xm,cidrv4:()=>Yn,cidrv6:()=>Hn,cuid:()=>Ln,cuid2:()=>Rn,date:()=>ri,datetime:()=>ii,domain:()=>Sm,duration:()=>Mn,e164:()=>ti,email:()=>Gn,emoji:()=>Bn,extendedDuration:()=>gm,guid:()=>Kn,hex:()=>Im,hostname:()=>zm,html5Email:()=>_m,httpProtocol:()=>ei,idnEmail:()=>bm,integer:()=>ci,ipv4:()=>Wn,ipv6:()=>qn,ksuid:()=>Jn,lowercase:()=>di,mac:()=>Xn,md5_base64:()=>jm,md5_base64url:()=>Pm,md5_hex:()=>wm,nanoid:()=>Vn,null:()=>si,number:()=>Bt,rfc5322Email:()=>ym,sha1_base64:()=>Om,sha1_base64url:()=>Dm,sha1_hex:()=>Um,sha256_base64:()=>Nm,sha256_base64url:()=>Tm,sha256_hex:()=>Zm,sha384_base64:()=>Am,sha384_base64url:()=>Lm,sha384_hex:()=>Em,sha512_base64:()=>Cm,sha512_base64url:()=>Fm,sha512_hex:()=>Rm,string:()=>oi,time:()=>ni,ulid:()=>Cn,undefined:()=>li,unicodeEmail:()=>Tu,uppercase:()=>mi,uuid:()=>$e,uuid4:()=>vm,uuid6:()=>$m,uuid7:()=>hm,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)?)?)$/,gm=/^[-+]?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})$/,$e=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)$/,vm=$e(4),$m=$e(6),hm=$e(7),Gn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_m=/^[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])?)*$/,ym=/^(([^<>()\[\]\\.,;:\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,}))$/,Tu=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,bm=Tu,xm=/^[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])?)*$/,km="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Bn(){return new RegExp(km,"u")}var Wn=/^(?:(?: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])$/,qn=/^(([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}|:))$/,Xn=t=>{let r=K(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}=))?$/,Gt=/^[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])?)*\.?$/,Sm=/^([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}$/,Eu="(?:(?:\\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(`^${Eu}$`);function Au(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(`^${Au(t)}$`)}function ii(t){let r=Au({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(`^${Eu}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]*$/,Im=/^[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 wm=/^[0-9a-fA-F]{32}$/,jm=lt(22,"=="),Pm=dt(22),Um=/^[0-9a-fA-F]{40}$/,Om=lt(27,"="),Dm=dt(27),Zm=/^[0-9a-fA-F]{64}$/,Nm=lt(43,"="),Tm=dt(43),Em=/^[0-9a-fA-F]{96}$/,Am=lt(64,""),Lm=dt(64),Rm=/^[0-9a-fA-F]{128}$/,Cm=lt(86,"=="),Fm=dt(86);var j=l("$ZodCheck",(t,r)=>{var i;t._zod??(t._zod={}),t._zod.def=r,(i=t._zod).onattach??(i.onattach=[])}),Ru={number:"number",bigint:"bigint",object:"date"},Wt=l("$ZodCheckLessThan",(t,r)=>{j.init(t,r);let i=Ru[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=Ru[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):Sn(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]=Dn[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})}}),Oe=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)=>{Oe.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),Oe.init(t,r)}),zi=l("$ZodCheckUpperCase",(t,r)=>{r.pattern??(r.pattern=mi),Oe.init(t,r)}),Si=l("$ZodCheckIncludes",(t,r)=>{j.init(t,r);let i=K(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})}}),Ii=l("$ZodCheckStartsWith",(t,r)=>{j.init(t,r);let i=new RegExp(`^${K(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(`.*${K(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 Lu(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=>Lu(e,i,r.property));Lu(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(Zn(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 G;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 G;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 G;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}))}),he=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}}),I=l("$ZodStringFormat",(t,r)=>{Oe.init(t,r),he.init(t,r)}),Zi=l("$ZodGUID",(t,r)=>{r.pattern??(r.pattern=Kn),I.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=$e(o))}else r.pattern??(r.pattern=$e());I.init(t,r)}),Ti=l("$ZodEmail",(t,r)=>{r.pattern??(r.pattern=Gn),I.init(t,r)}),Ei=l("$ZodURL",(t,r)=>{I.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=Bn()),I.init(t,r)}),Li=l("$ZodNanoID",(t,r)=>{r.pattern??(r.pattern=Vn),I.init(t,r)}),Ri=l("$ZodCUID",(t,r)=>{r.pattern??(r.pattern=Ln),I.init(t,r)}),Ci=l("$ZodCUID2",(t,r)=>{r.pattern??(r.pattern=Rn),I.init(t,r)}),Fi=l("$ZodULID",(t,r)=>{r.pattern??(r.pattern=Cn),I.init(t,r)}),Ji=l("$ZodXID",(t,r)=>{r.pattern??(r.pattern=Fn),I.init(t,r)}),Vi=l("$ZodKSUID",(t,r)=>{r.pattern??(r.pattern=Jn),I.init(t,r)}),Mi=l("$ZodISODateTime",(t,r)=>{r.pattern??(r.pattern=ii(r)),I.init(t,r)}),Ki=l("$ZodISODate",(t,r)=>{r.pattern??(r.pattern=ri),I.init(t,r)}),Gi=l("$ZodISOTime",(t,r)=>{r.pattern??(r.pattern=ni(r)),I.init(t,r)}),Bi=l("$ZodISODuration",(t,r)=>{r.pattern??(r.pattern=Mn),I.init(t,r)}),Wi=l("$ZodIPv4",(t,r)=>{r.pattern??(r.pattern=Wn),I.init(t,r),t._zod.bag.format="ipv4"}),qi=l("$ZodIPv6",(t,r)=>{r.pattern??(r.pattern=qn),I.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})}}}),Xi=l("$ZodMAC",(t,r)=>{r.pattern??(r.pattern=Xn(r.delimiter)),I.init(t,r),t._zod.bag.format="mac"}),Yi=l("$ZodCIDRv4",(t,r)=>{r.pattern??(r.pattern=Yn),I.init(t,r)}),Hi=l("$ZodCIDRv6",(t,r)=>{r.pattern??(r.pattern=Hn),I.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),I.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 ts(t){if(!Gt.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=Gt),I.init(t,r),t._zod.bag.contentEncoding="base64url",t._zod.check=i=>{ts(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),I.init(t,r)});function rs(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)=>{I.init(t,r),t._zod.check=i=>{rs(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)=>{I.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})}}),er=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),er.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}}),tr=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),tr.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 Fu(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=>Fu(u,i,a))):Fu(s,i,a)}return n.length?Promise.all(n).then(()=>i):i}});function Qt(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 ns(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 is(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=>Qt(b,i,_,r,d,p))):Qt($,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 os=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=Se(()=>ns(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=ve,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=>Qt(yn,c,_,u,b,R))):Qt(O,c,_,u,b,R)}return n?is(d,u,c,s,o.value,t):d.length?Promise.all(d).then(()=>c):c}}),$o=l("$ZodObjectJIT",(t,r)=>{os.init(t,r);let i=t._zod.parse,o=Se(()=>ns(r)),e=_=>{let $=new mt(["shape","payload","ctx"]),b=o.value,R=q=>{let P=Nt(q);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};$.write("const input = payload.value;");let O=Object.create(null),yn=0;for(let q of b.keys)O[q]=`key_${yn++}`;$.write("const newResult = {};");for(let q of b.keys){let P=O[q],D=Nt(q),Iu=_[q],wu=Iu?._zod?.optin==="optional",Nd=Iu?._zod?.optout==="optional";$.write(`const ${P} = ${R(q)};`),wu&&Nd?$.write(`
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
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 O,b as g,d as lt,f as R,k as U,m as B}from"./chunk-OVTYCRA4.js";var C=g(x=>{"use strict";var b=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}},y=class extends b{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};x.CommanderError=b;x.InvalidArgumentError=y});var A=g(S=>{"use strict";var{InvalidArgumentError:ut}=C(),E=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 ut(`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 ht(l){let t=l.name()+(l.variadic===!0?"...":"");return l.required?"<"+t+">":"["+t+"]"}S.Argument=E;S.humanReadableArgName=ht});var k=g($=>{"use strict";var{humanReadableArgName:ct}=A(),v=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=>ct(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))}`,""],a=e.commandDescription(t);a.length>0&&(r=r.concat([e.boxWrap(e.styleCommandDescription(a),n),""]));let o=e.visibleArguments(t).map(c=>s(e.styleArgumentTerm(e.argumentTerm(c)),e.styleArgumentDescription(e.argumentDescription(c))));o.length>0&&(r=r.concat([e.styleTitle("Arguments:"),...o,""]));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
- `)}displayWidth(t){return G(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 a=t.padEnd(e+t.length-n.displayWidth(t)),o=2,u=(this.helpWidth??80)-e-o-2,c;return u<this.minWidthToWrap||n.preformatted(i)?c=i:c=n.boxWrap(i,u).replace(/\n/g,`
5
- `+" ".repeat(e+o)),r+a+" ".repeat(o)+c.replace(/\n/g,`
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 a=r.match(n);if(a===null){s.push("");return}let o=[a.shift()],h=this.displayWidth(o[0]);a.forEach(u=>{let c=this.displayWidth(u);if(h+c<=e){o.push(u),h+=c;return}s.push(o.join(""));let p=u.trimStart();o=[p],h=this.displayWidth(p)}),s.push(o.join(""))}),s.join(`
7
- `)}};function G(l){let t=/\x1b\[\d*(;\d*)*m/g;return l.replace(t,"")}$.Help=v;$.stripColor=G});var P=g(T=>{"use strict";var{InvalidArgumentError:mt}=C(),V=class{constructor(t,e){this.flags=t,this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let i=pt(t);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let e=t;return typeof t=="string"&&(e={[t]:!0}),this.implied=Object.assign(this.implied||{},e),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,e){return e===this.defaultValue||!Array.isArray(e)?[t]:e.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(e,i)=>{if(!this.argChoices.includes(e))throw new mt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,i):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?J(this.name().replace(/^no-/,"")):J(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},H=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(t,e){let i=e.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:!1;return e.negate===(s===t)}};function J(l){return l.split("-").reduce((t,e)=>t+e[0].toUpperCase()+e.slice(1))}function pt(l){let t,e,i=/^-[^-]$/,n=/^--[^-]/,s=l.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(t=s.shift()),n.test(s[0])&&(e=s.shift()),!t&&i.test(s[0])&&(t=s.shift()),!t&&n.test(s[0])&&(t=e,e=s.shift()),s[0].startsWith("-")){let r=s[0],a=`option creation failed due to '${r}' in option flags '${l}'`;throw/^-[^-][^-]/.test(r)?new Error(`${a}
3
+ import{a as C,b as _,d as mt,f,g as G,k as E,l as A,n as J,p as K}from"./chunk-GTRQVB2J.js";var b=_(v=>{"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}},S=class extends y{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};v.CommanderError=y;v.InvalidArgumentError=S});var w=_(k=>{"use strict";var{InvalidArgumentError:pt}=b(),$=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 pt(`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 dt(o){let t=o.name()+(o.variadic===!0?"...":"");return o.required?"<"+t+">":"["+t+"]"}k.Argument=$;k.humanReadableArgName=dt});var T=_(V=>{"use strict";var{humanReadableArgName:ft}=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=>ft(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
+ `)}displayWidth(t){return Y(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
+ `+" ".repeat(e+a)),r+l+" ".repeat(a)+c.replace(/\n/g,`
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(`
7
+ `)}};function Y(o){let t=/\x1b\[\d*(;\d*)*m/g;return o.replace(t,"")}V.Help=H;V.stripColor=Y});var F=_(W=>{"use strict";var{InvalidArgumentError:gt}=b(),P=class{constructor(t,e){this.flags=t,this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let i=_t(t);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let e=t;return typeof t=="string"&&(e={[t]:!0}),this.implied=Object.assign(this.implied||{},e),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,e){return e===this.defaultValue||!Array.isArray(e)?[t]:e.concat(t)}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}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?z(this.name().replace(/^no-/,"")):z(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},D=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(t,e){let i=e.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:!1;return e.negate===(s===t)}};function z(o){return o.split("-").reduce((t,e)=>t+e[0].toUpperCase()+e.slice(1))}function _t(o){let t,e,i=/^-[^-]$/,n=/^--[^-]/,s=o.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(t=s.shift()),n.test(s[0])&&(e=s.shift()),!t&&i.test(s[0])&&(t=s.shift()),!t&&n.test(s[0])&&(t=e,e=s.shift()),s[0].startsWith("-")){let r=s[0],l=`option creation failed due to '${r}' in option flags '${o}'`;throw/^-[^-][^-]/.test(r)?new Error(`${l}
8
8
  - a short flag is a single dash and a single character
9
9
  - either use a single dash and a single character (for a short flag)
10
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(r)?new Error(`${a}
11
- - too many short flags`):n.test(r)?new Error(`${a}
12
- - too many long flags`):new Error(`${a}
13
- - unrecognised flag format`)}if(t===void 0&&e===void 0)throw new Error(`option creation failed due to no flags found in '${l}'.`);return{shortFlag:t,longFlag:e}}T.Option=V;T.DualOptions=H});var Y=g(K=>{"use strict";function dt(l,t){if(Math.abs(l.length-t.length)>3)return Math.max(l.length,t.length);let e=[];for(let i=0;i<=l.length;i++)e[i]=[i];for(let i=0;i<=t.length;i++)e[0][i]=i;for(let i=1;i<=t.length;i++)for(let n=1;n<=l.length;n++){let s=1;l[n-1]===t[i-1]?s=0:s=1,e[n][i]=Math.min(e[n-1][i]+1,e[n][i-1]+1,e[n-1][i-1]+s),n>1&&i>1&&l[n-1]===t[i-2]&&l[n-2]===t[i-1]&&(e[n][i]=Math.min(e[n][i],e[n-2][i-2]+1))}return e[l.length][t.length]}function ft(l,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let e=l.startsWith("--");e&&(l=l.slice(2),t=t.map(r=>r.slice(2)));let i=[],n=3,s=.4;return t.forEach(r=>{if(r.length<=1)return;let a=dt(l,r),o=Math.max(l.length,r.length);(o-a)/o>s&&(a<n?(n=a,i=[r]):a===n&&i.push(r))}),i.sort((r,a)=>r.localeCompare(a)),e&&(i=i.map(r=>`--${r}`)),i.length>1?`
10
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(r)?new Error(`${l}
11
+ - too many short flags`):n.test(r)?new Error(`${l}
12
+ - too many long flags`):new Error(`${l}
13
+ - unrecognised flag format`)}if(t===void 0&&e===void 0)throw new Error(`option creation failed due to no flags found in '${o}'.`);return{shortFlag:t,longFlag:e}}W.Option=P;W.DualOptions=D});var X=_(Q=>{"use strict";function Ot(o,t){if(Math.abs(o.length-t.length)>3)return Math.max(o.length,t.length);let e=[];for(let i=0;i<=o.length;i++)e[i]=[i];for(let i=0;i<=t.length;i++)e[0][i]=i;for(let i=1;i<=t.length;i++)for(let n=1;n<=o.length;n++){let s=1;o[n-1]===t[i-1]?s=0:s=1,e[n][i]=Math.min(e[n-1][i]+1,e[n][i-1]+1,e[n-1][i-1]+s),n>1&&i>1&&o[n-1]===t[i-2]&&o[n-2]===t[i-1]&&(e[n][i]=Math.min(e[n][i],e[n-2][i-2]+1))}return e[o.length][t.length]}function Ct(o,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let e=o.startsWith("--");e&&(o=o.slice(2),t=t.map(r=>r.slice(2)));let i=[],n=3,s=.4;return t.forEach(r=>{if(r.length<=1)return;let l=Ot(o,r),a=Math.max(o.length,r.length);(a-l)/a>s&&(l<n?(n=l,i=[r]):l===n&&i.push(r))}),i.sort((r,l)=>r.localeCompare(l)),e&&(i=i.map(r=>`--${r}`)),i.length>1?`
14
14
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
15
- (Did you mean ${i[0]}?)`:""}K.suggestSimilar=ft});var Z=g(N=>{"use strict";var gt=O("events").EventEmitter,W=O("child_process"),f=O("path"),w=O("fs"),m=O("process"),{Argument:_t,humanReadableArgName:Ot}=A(),{CommanderError:D}=C(),{Help:Ct,stripColor:bt}=k(),{Option:z,DualOptions:At}=P(),{suggestSimilar:Q}=Y(),F=class l extends gt{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>m.stdout.write(e),writeErr:e=>m.stderr.write(e),outputError:(e,i)=>i(e),getOutHelpWidth:()=>m.stdout.isTTY?m.stdout.columns:void 0,getErrHelpWidth:()=>m.stderr.isTTY?m.stderr.columns:void 0,getOutHasColors:()=>I()??(m.stdout.isTTY&&m.stdout.hasColors?.()),getErrHasColors:()=>I()??(m.stderr.isTTY&&m.stderr.hasColors?.()),stripColor:e=>bt(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let e=this;e;e=e.parent)t.push(e);return t}command(t,e,i){let n=e,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,r,a]=t.match(/([^ ]+) *(.*)/),o=this.createCommand(r);return n&&(o.description(n),o._executableHandler=!0),s.isDefault&&(this._defaultCommandName=o._name),o._hidden=!!(s.noHelp||s.hidden),o._executableFile=s.executableFile||null,a&&o.arguments(a),this._registerCommand(o),o.parent=this,o.copyInheritedSettings(this),n?this:o}createCommand(t){return new l(t)}createHelp(){return Object.assign(new Ct,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
16
- - specify the name in Command constructor or using .name()`);return e=e||{},e.isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,e){return new _t(t,e)}argument(t,e,i,n){let s=this.createArgument(t,e);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(t){let e=this.registeredArguments.slice(-1)[0];if(e&&e.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,e){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,i,n]=t.match(/([^ ]+) *(.*)/),s=e??"display help for command",r=this.createCommand(i);return r.helpOption(!1),n&&r.arguments(n),s&&r.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=r,this}addHelpCommand(t,e){return typeof t!="object"?(this.helpCommand(t,e),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,e){let i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
17
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=e=>{if(e.code!=="commander.executeSubCommandAsync")throw e},this}_exit(t,e,i){this._exitCallback&&this._exitCallback(new D(t,e,i)),m.exit(t)}action(t){let e=i=>{let n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=e,this}createOption(t,e){return new z(t,e)}_callParseArg(t,e,i,n){try{return t.parseArg(e,i)}catch(s){if(s.code==="commander.invalidArgument"){let r=`${n} ${s.message}`;this.error(r,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let e=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(e){let i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
18
- - already used by option '${e.flags}'`)}this.options.push(t)}_registerCommand(t){let e=n=>[n.name()].concat(n.aliases()),i=e(t).find(n=>this._findCommand(n));if(i){let n=e(this._findCommand(i)).join("|"),s=e(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let e=t.name(),i=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let n=(s,r,a)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let o=this.getOptionValue(i);s!==null&&t.parseArg?s=this._callParseArg(t,s,o,r):s!==null&&t.variadic&&(s=t._concatValue(s,o)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(i,s,a)};return this.on("option:"+e,s=>{let r=`error: option '${t.flags}' argument '${s}' is invalid.`;n(s,r,"cli")}),t.envVar&&this.on("optionEnv:"+e,s=>{let r=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;n(s,r,"env")}),this}_optionEx(t,e,i,n,s){if(typeof e=="object"&&e instanceof z)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let r=this.createOption(e,i);if(r.makeOptionMandatory(!!t.mandatory),typeof n=="function")r.default(s).argParser(n);else if(n instanceof RegExp){let a=n;n=(o,h)=>{let u=a.exec(o);return u?u[0]:h},r.default(s).argParser(n)}else r.default(n);return this.addOption(r)}option(t,e,i,n){return this._optionEx({},t,e,i,n)}requiredOption(t,e,i,n){return this._optionEx({mandatory:!0},t,e,i,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,e){return this.setOptionValueWithSource(t,e,void 0)}setOptionValueWithSource(t,e,i){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let e;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(t)!==void 0&&(e=i.getOptionValueSource(t))}),e}_prepareUserArgs(t,e){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(e=e||{},t===void 0&&e.from===void 0){m.versions?.electron&&(e.from="electron");let n=m.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(e.from="eval")}t===void 0&&(t=m.argv),this.rawArgs=t.slice();let i;switch(e.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":m.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,e){this._prepareForParse();let i=this._prepareUserArgs(t,e);return this._parseCommand([],i),this}async parseAsync(t,e){this._prepareForParse();let i=this._prepareUserArgs(t,e);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
19
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,e,i){if(w.existsSync(t))return;let n=e?`searched for local subcommand relative to directory '${e}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${t}' does not exist
15
+ (Did you mean ${i[0]}?)`:""}Q.suggestSimilar=Ct});var it=_(M=>{"use strict";var bt=C("events").EventEmitter,I=C("child_process"),g=C("path"),x=C("fs"),m=C("process"),{Argument:At,humanReadableArgName:yt}=w(),{CommanderError:N}=b(),{Help:wt,stripColor:xt}=T(),{Option:Z,DualOptions:Et}=F(),{suggestSimilar:tt}=X(),q=class o extends bt{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>m.stdout.write(e),writeErr:e=>m.stderr.write(e),outputError:(e,i)=>i(e),getOutHelpWidth:()=>m.stdout.isTTY?m.stdout.columns:void 0,getErrHelpWidth:()=>m.stderr.isTTY?m.stderr.columns:void 0,getOutHasColors:()=>j()??(m.stdout.isTTY&&m.stdout.hasColors?.()),getErrHasColors:()=>j()??(m.stderr.isTTY&&m.stderr.hasColors?.()),stripColor:e=>xt(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let e=this;e;e=e.parent)t.push(e);return t}command(t,e,i){let n=e,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,r,l]=t.match(/([^ ]+) *(.*)/),a=this.createCommand(r);return n&&(a.description(n),a._executableHandler=!0),s.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(s.noHelp||s.hidden),a._executableFile=s.executableFile||null,l&&a.arguments(l),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),n?this:a}createCommand(t){return new o(t)}createHelp(){return Object.assign(new wt,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
16
+ - specify the name in Command constructor or using .name()`);return e=e||{},e.isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,e){return new At(t,e)}argument(t,e,i,n){let s=this.createArgument(t,e);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(t){let e=this.registeredArguments.slice(-1)[0];if(e&&e.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,e){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,i,n]=t.match(/([^ ]+) *(.*)/),s=e??"display help for command",r=this.createCommand(i);return r.helpOption(!1),n&&r.arguments(n),s&&r.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=r,this}addHelpCommand(t,e){return typeof t!="object"?(this.helpCommand(t,e),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,e){let i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
17
+ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=e=>{if(e.code!=="commander.executeSubCommandAsync")throw e},this}_exit(t,e,i){this._exitCallback&&this._exitCallback(new N(t,e,i)),m.exit(t)}action(t){let e=i=>{let n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=e,this}createOption(t,e){return new Z(t,e)}_callParseArg(t,e,i,n){try{return t.parseArg(e,i)}catch(s){if(s.code==="commander.invalidArgument"){let r=`${n} ${s.message}`;this.error(r,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let e=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(e){let i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
18
+ - already used by option '${e.flags}'`)}this.options.push(t)}_registerCommand(t){let e=n=>[n.name()].concat(n.aliases()),i=e(t).find(n=>this._findCommand(n));if(i){let n=e(this._findCommand(i)).join("|"),s=e(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let e=t.name(),i=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let n=(s,r,l)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let a=this.getOptionValue(i);s!==null&&t.parseArg?s=this._callParseArg(t,s,a,r):s!==null&&t.variadic&&(s=t._concatValue(s,a)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(i,s,l)};return this.on("option:"+e,s=>{let r=`error: option '${t.flags}' argument '${s}' is invalid.`;n(s,r,"cli")}),t.envVar&&this.on("optionEnv:"+e,s=>{let r=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;n(s,r,"env")}),this}_optionEx(t,e,i,n,s){if(typeof e=="object"&&e instanceof Z)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let r=this.createOption(e,i);if(r.makeOptionMandatory(!!t.mandatory),typeof n=="function")r.default(s).argParser(n);else if(n instanceof RegExp){let l=n;n=(a,h)=>{let u=l.exec(a);return u?u[0]:h},r.default(s).argParser(n)}else r.default(n);return this.addOption(r)}option(t,e,i,n){return this._optionEx({},t,e,i,n)}requiredOption(t,e,i,n){return this._optionEx({mandatory:!0},t,e,i,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,e){return this.setOptionValueWithSource(t,e,void 0)}setOptionValueWithSource(t,e,i){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let e;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(t)!==void 0&&(e=i.getOptionValueSource(t))}),e}_prepareUserArgs(t,e){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(e=e||{},t===void 0&&e.from===void 0){m.versions?.electron&&(e.from="electron");let n=m.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(e.from="eval")}t===void 0&&(t=m.argv),this.rawArgs=t.slice();let i;switch(e.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":m.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,e){this._prepareForParse();let i=this._prepareUserArgs(t,e);return this._parseCommand([],i),this}async parseAsync(t,e){this._prepareForParse();let i=this._prepareUserArgs(t,e);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
19
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,e,i){if(x.existsSync(t))return;let n=e?`searched for local subcommand relative to directory '${e}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${t}' does not exist
20
20
  - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
21
21
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
22
- - ${n}`;throw new Error(s)}_executeSubCommand(t,e){e=e.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(u,c){let p=f.resolve(u,c);if(w.existsSync(p))return p;if(n.includes(f.extname(c)))return;let L=n.find(at=>w.existsSync(`${p}${at}`));if(L)return`${p}${L}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=w.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=f.resolve(f.dirname(u),a)}if(a){let u=s(a,r);if(!u&&!t._executableFile&&this._scriptPath){let c=f.basename(this._scriptPath,f.extname(this._scriptPath));c!==this._name&&(u=s(a,`${c}-${t._name}`))}r=u||r}i=n.includes(f.extname(r));let o;m.platform!=="win32"?i?(e.unshift(r),e=X(m.execArgv).concat(e),o=W.spawn(m.argv[0],e,{stdio:"inherit"})):o=W.spawn(r,e,{stdio:"inherit"}):(this._checkForMissingExecutable(r,a,t._name),e.unshift(r),e=X(m.execArgv).concat(e),o=W.spawn(m.execPath,e,{stdio:"inherit"})),o.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{m.on(c,()=>{o.killed===!1&&o.exitCode===null&&o.kill(c)})});let h=this._exitCallback;o.on("close",u=>{u=u??1,h?h(new D(u,"commander.executeSubCommandAsync","(close)")):m.exit(u)}),o.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(r,a,t._name);else if(u.code==="EACCES")throw new Error(`'${r}' not executable`);if(!h)m.exit(1);else{let c=new D(1,"commander.executeSubCommandAsync","(error)");c.nestedError=u,h(c)}}),this.runningCommand=o}_dispatchSubcommand(t,e,i){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,e.concat(i));else return n._parseCommand(e,i)}),s}_dispatchHelpCommand(t){t||this.help();let e=this._findCommand(t);return e&&!e._executableHandler&&e.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,e)=>{t.required&&this.args[e]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(i,n,s)=>{let r=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;r=this._callParseArg(i,n,s,a)}return r};this._checkNumberOfArguments();let e=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((r,a)=>t(i,a,r),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=t(i,s,i.defaultValue))),e[n]=s}),this.processedArgs=e}_chainOrCall(t,e){return t&&t.then&&typeof t.then=="function"?t.then(()=>e()):e()}_chainOrCallHooks(t,e){let i=t,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[e]!==void 0).forEach(s=>{s._lifeCycleHooks[e].forEach(r=>{n.push({hookedCommand:s,callback:r})})}),e==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,e,i){let n=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(this,e))}),n}_parseCommand(t,e){let i=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),e=i.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(e),this._dispatchSubcommand(this._defaultCommandName,t,e);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let r;return r=this._chainOrCallHooks(r,"preAction"),r=this._chainOrCall(r,()=>this._actionHandler(this.processedArgs)),this.parent&&(r=this._chainOrCall(r,()=>{this.parent.emit(s,t,e)})),r=this._chainOrCallHooks(r,"postAction"),r}if(this.parent&&this.parent.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,t,e);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e);this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(e=>e._name===t||e._aliases.includes(t))}_findOption(t){return this.options.find(e=>e.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(e=>{e.mandatory&&t.getOptionValue(e.attributeName())===void 0&&t.missingMandatoryOptionValue(e)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=t.find(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let e=[],i=[],n=e,s=t.slice();function r(o){return o.length>1&&o[0]==="-"}let a=null;for(;s.length;){let o=s.shift();if(o==="--"){n===i&&n.push(o),n.push(...s);break}if(a&&!r(o)){this.emit(`option:${a.name()}`,o);continue}if(a=null,r(o)){let h=this._findOption(o);if(h){if(h.required){let u=s.shift();u===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,u)}else if(h.optional){let u=null;s.length>0&&!r(s[0])&&(u=s.shift()),this.emit(`option:${h.name()}`,u)}else this.emit(`option:${h.name()}`);a=h.variadic?h:null;continue}}if(o.length>2&&o[0]==="-"&&o[1]!=="-"){let h=this._findOption(`-${o[1]}`);if(h){h.required||h.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${h.name()}`,o.slice(2)):(this.emit(`option:${h.name()}`),s.unshift(`-${o.slice(2)}`));continue}}if(/^--[^=]+=/.test(o)){let h=o.indexOf("="),u=this._findOption(o.slice(0,h));if(u&&(u.required||u.optional)){this.emit(`option:${u.name()}`,o.slice(h+1));continue}}if(r(o)&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&e.length===0&&i.length===0){if(this._findCommand(o)){e.push(o),s.length>0&&i.push(...s);break}else if(this._getHelpCommand()&&o===this._getHelpCommand().name()){e.push(o),s.length>0&&e.push(...s);break}else if(this._defaultCommandName){i.push(o),s.length>0&&i.push(...s);break}}if(this._passThroughOptions){n.push(o),s.length>0&&n.push(...s);break}n.push(o)}return{operands:e,unknown:i}}opts(){if(this._storeOptionsAsProperties){let t={},e=this.options.length;for(let i=0;i<e;i++){let n=this.options[i].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,e)=>Object.assign(t,e.opts()),{})}error(t,e){this._outputConfiguration.outputError(`${t}
22
+ - ${n}`;throw new Error(s)}_executeSubCommand(t,e){e=e.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(u,c){let p=g.resolve(u,c);if(x.existsSync(p))return p;if(n.includes(g.extname(c)))return;let B=n.find(ct=>x.existsSync(`${p}${ct}`));if(B)return`${p}${B}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=t._executableFile||`${this._name}-${t._name}`,l=this._executableDir||"";if(this._scriptPath){let u;try{u=x.realpathSync(this._scriptPath)}catch{u=this._scriptPath}l=g.resolve(g.dirname(u),l)}if(l){let u=s(l,r);if(!u&&!t._executableFile&&this._scriptPath){let c=g.basename(this._scriptPath,g.extname(this._scriptPath));c!==this._name&&(u=s(l,`${c}-${t._name}`))}r=u||r}i=n.includes(g.extname(r));let a;m.platform!=="win32"?i?(e.unshift(r),e=et(m.execArgv).concat(e),a=I.spawn(m.argv[0],e,{stdio:"inherit"})):a=I.spawn(r,e,{stdio:"inherit"}):(this._checkForMissingExecutable(r,l,t._name),e.unshift(r),e=et(m.execArgv).concat(e),a=I.spawn(m.execPath,e,{stdio:"inherit"})),a.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{m.on(c,()=>{a.killed===!1&&a.exitCode===null&&a.kill(c)})});let h=this._exitCallback;a.on("close",u=>{u=u??1,h?h(new N(u,"commander.executeSubCommandAsync","(close)")):m.exit(u)}),a.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(r,l,t._name);else if(u.code==="EACCES")throw new Error(`'${r}' not executable`);if(!h)m.exit(1);else{let c=new N(1,"commander.executeSubCommandAsync","(error)");c.nestedError=u,h(c)}}),this.runningCommand=a}_dispatchSubcommand(t,e,i){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,e.concat(i));else return n._parseCommand(e,i)}),s}_dispatchHelpCommand(t){t||this.help();let e=this._findCommand(t);return e&&!e._executableHandler&&e.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,e)=>{t.required&&this.args[e]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(i,n,s)=>{let r=n;if(n!==null&&i.parseArg){let l=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;r=this._callParseArg(i,n,s,l)}return r};this._checkNumberOfArguments();let e=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((r,l)=>t(i,l,r),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=t(i,s,i.defaultValue))),e[n]=s}),this.processedArgs=e}_chainOrCall(t,e){return t&&t.then&&typeof t.then=="function"?t.then(()=>e()):e()}_chainOrCallHooks(t,e){let i=t,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[e]!==void 0).forEach(s=>{s._lifeCycleHooks[e].forEach(r=>{n.push({hookedCommand:s,callback:r})})}),e==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,e,i){let n=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(this,e))}),n}_parseCommand(t,e){let i=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),e=i.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(e),this._dispatchSubcommand(this._defaultCommandName,t,e);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let r;return r=this._chainOrCallHooks(r,"preAction"),r=this._chainOrCall(r,()=>this._actionHandler(this.processedArgs)),this.parent&&(r=this._chainOrCall(r,()=>{this.parent.emit(s,t,e)})),r=this._chainOrCallHooks(r,"postAction"),r}if(this.parent&&this.parent.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,t,e);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e);this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(e=>e._name===t||e._aliases.includes(t))}_findOption(t){return this.options.find(e=>e.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(e=>{e.mandatory&&t.getOptionValue(e.attributeName())===void 0&&t.missingMandatoryOptionValue(e)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=t.find(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let e=[],i=[],n=e,s=t.slice();function r(a){return a.length>1&&a[0]==="-"}let l=null;for(;s.length;){let a=s.shift();if(a==="--"){n===i&&n.push(a),n.push(...s);break}if(l&&!r(a)){this.emit(`option:${l.name()}`,a);continue}if(l=null,r(a)){let h=this._findOption(a);if(h){if(h.required){let u=s.shift();u===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,u)}else if(h.optional){let u=null;s.length>0&&!r(s[0])&&(u=s.shift()),this.emit(`option:${h.name()}`,u)}else this.emit(`option:${h.name()}`);l=h.variadic?h:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let h=this._findOption(`-${a[1]}`);if(h){h.required||h.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${h.name()}`,a.slice(2)):(this.emit(`option:${h.name()}`),s.unshift(`-${a.slice(2)}`));continue}}if(/^--[^=]+=/.test(a)){let h=a.indexOf("="),u=this._findOption(a.slice(0,h));if(u&&(u.required||u.optional)){this.emit(`option:${u.name()}`,a.slice(h+1));continue}}if(r(a)&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&e.length===0&&i.length===0){if(this._findCommand(a)){e.push(a),s.length>0&&i.push(...s);break}else if(this._getHelpCommand()&&a===this._getHelpCommand().name()){e.push(a),s.length>0&&e.push(...s);break}else if(this._defaultCommandName){i.push(a),s.length>0&&i.push(...s);break}}if(this._passThroughOptions){n.push(a),s.length>0&&n.push(...s);break}n.push(a)}return{operands:e,unknown:i}}opts(){if(this._storeOptionsAsProperties){let t={},e=this.options.length;for(let i=0;i<e;i++){let n=this.options[i].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,e)=>Object.assign(t,e.opts()),{})}error(t,e){this._outputConfiguration.outputError(`${t}
23
23
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
24
24
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
25
- `),this.outputHelp({error:!0}));let i=e||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in m.env){let e=t.attributeName();(this.getOptionValue(e)===void 0||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,m.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new At(this.options),e=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&e(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!e(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(t){let e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){let e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){let i=r=>{let a=r.attributeName(),o=this.getOptionValue(a),h=this.options.find(c=>c.negate&&a===c.attributeName()),u=this.options.find(c=>!c.negate&&a===c.attributeName());return h&&(h.presetArg===void 0&&o===!1||h.presetArg!==void 0&&o===h.presetArg)?h:u||r},n=r=>{let a=i(r),o=a.attributeName();return this.getOptionValueSource(o)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(t)} cannot be used with ${n(e)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let r=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(r),s=s.parent}while(s&&!s._enablePositionalOptions);e=Q(t,n)}let i=`error: unknown option '${t}'${e}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let e=this.registeredArguments.length,i=e===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${i} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],e="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),e=Q(t,n)}let i=`error: unknown command '${t}'${e}`;this.error(i,{code:"commander.unknownCommand"})}version(t,e,i){if(t===void 0)return this._version;this._version=t,e=e||"-V, --version",i=i||"output the version number";let n=this.createOption(e,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
26
- `),this._exit(0,"commander.version",t)}),this}description(t,e){return t===void 0&&e===void 0?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let e=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),t===e._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return e._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(e=>this.alias(e)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(i=>Ot(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=f.basename(t,f.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let e=this.createHelp(),i=this._getOutputContext(t);e.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=e.formatHelp(this,e);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let e=!!t.error,i,n,s;return e?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:e,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:s}}outputHelp(t){let e;typeof t=="function"&&(e=t,t=void 0);let i=this._getOutputContext(t),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(r=>r.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(e&&(s=e(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(r=>r.emit("afterAllHelp",n))}helpOption(t,e){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",e=e??"display help for command",this._helpOption=this.createOption(t,e),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let e=Number(m.exitCode??0);e===0&&t&&typeof t!="function"&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
25
+ `),this.outputHelp({error:!0}));let i=e||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in m.env){let e=t.attributeName();(this.getOptionValue(e)===void 0||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,m.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Et(this.options),e=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&e(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!e(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(t){let e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){let e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){let i=r=>{let l=r.attributeName(),a=this.getOptionValue(l),h=this.options.find(c=>c.negate&&l===c.attributeName()),u=this.options.find(c=>!c.negate&&l===c.attributeName());return h&&(h.presetArg===void 0&&a===!1||h.presetArg!==void 0&&a===h.presetArg)?h:u||r},n=r=>{let l=i(r),a=l.attributeName();return this.getOptionValueSource(a)==="env"?`environment variable '${l.envVar}'`:`option '${l.flags}'`},s=`error: ${n(t)} cannot be used with ${n(e)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let r=s.createHelp().visibleOptions(s).filter(l=>l.long).map(l=>l.long);n=n.concat(r),s=s.parent}while(s&&!s._enablePositionalOptions);e=tt(t,n)}let i=`error: unknown option '${t}'${e}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let e=this.registeredArguments.length,i=e===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${i} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],e="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),e=tt(t,n)}let i=`error: unknown command '${t}'${e}`;this.error(i,{code:"commander.unknownCommand"})}version(t,e,i){if(t===void 0)return this._version;this._version=t,e=e||"-V, --version",i=i||"output the version number";let n=this.createOption(e,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
26
+ `),this._exit(0,"commander.version",t)}),this}description(t,e){return t===void 0&&e===void 0?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let e=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),t===e._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return e._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(e=>this.alias(e)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(i=>yt(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=g.basename(t,g.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let e=this.createHelp(),i=this._getOutputContext(t);e.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=e.formatHelp(this,e);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let e=!!t.error,i,n,s;return e?(i=l=>this._outputConfiguration.writeErr(l),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=l=>this._outputConfiguration.writeOut(l),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:e,write:l=>(n||(l=this._outputConfiguration.stripColor(l)),i(l)),hasColors:n,helpWidth:s}}outputHelp(t){let e;typeof t=="function"&&(e=t,t=void 0);let i=this._getOutputContext(t),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(r=>r.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(e&&(s=e(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(r=>r.emit("afterAllHelp",n))}helpOption(t,e){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",e=e??"display help for command",this._helpOption=this.createOption(t,e),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let e=Number(m.exitCode??0);e===0&&t&&typeof t!="function"&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
27
27
  Expecting one of '${i.join("', '")}'`);let n=`${t}Help`;return this.on(n,s=>{let r;typeof e=="function"?r=e({error:s.error,command:s.command}):r=e,r&&s.write(`${r}
28
- `)}),this}_outputHelpIfRequested(t){let e=this._getHelpOption();e&&t.find(n=>e.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function X(l){return l.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 I(){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}N.Command=F;N.useColor=I});var nt=g(d=>{"use strict";var{Argument:tt}=A(),{Command:q}=Z(),{CommanderError:wt,InvalidArgumentError:et}=C(),{Help:yt}=k(),{Option:it}=P();d.program=new q;d.createCommand=l=>new q(l);d.createOption=(l,t)=>new it(l,t);d.createArgument=(l,t)=>new tt(l,t);d.Command=q;d.Option=it;d.Argument=tt;d.Help=yt;d.CommanderError=wt;d.InvalidArgumentError=et;d.InvalidOptionArgumentError=et});var st=lt(nt(),1),{program:Wt,createCommand:Dt,createArgument:Ft,createOption:It,CommanderError:Nt,InvalidArgumentError:qt,InvalidOptionArgumentError:jt,Command:rt,Argument:Mt,Option:Lt,Help:Rt}=st.default;var xt=[" \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"],Et="OpenSkill.md \u2014 the npm for AI skills";function j(){return["",...xt.map(l=>R(l)),B(" \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"),U.bold(` ${Et}`),""].join(`
29
- `)}function _(){process.stderr.write(j()+`
30
- `)}var St="0.3.1",M=class l extends rt{createCommand(t){return new l(t)}helpInformation(){return`${j()}
31
- ${super.helpInformation()}`}};function ot(){let l=new M;function t(n,s,r){l.command(n).description(s).action(async(...a)=>{_(),await(await r())(...a.slice(0,-1))})}l.name("osm").description("The CLI for OpenSkill.md \u2014 search, add, score, and explore AI agent skills").version(St),t("search <query>","Search skills and blueprints by keyword",async()=>(await import("./search-JQMXVSCW.js")).searchCommand),t("info <slug>","Show details about a skill or blueprint",async()=>(await import("./info-5GSXNJ5W.js")).infoCommand),l.command("add <source>").alias("install").description("Add a skill from a source repo (owner/repo or owner/repo@skill)").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(n,s)=>{_();let{addCommand:r}=await import("./add-77ZPOLTV.js");await r(n,s)}),t("list","Show installed skills and blueprints in this project",async()=>(await import("./list-SMKTYTII.js")).listCommand),t("score <filepath>","Score a local SKILL.md file for quality",async()=>(await import("./score-CPVOUARV.js")).scoreCommand),t("init <type>","Scaffold a new skill or blueprint (type: skill | blueprint)",async()=>(await import("./init-ZDBNGFX7.js")).initCommand),t("browse","Explore skills by category (interactive)",async()=>(await import("./browse-P7RXLMMF.js")).browseCommand),t("remove <slug>","Remove an installed skill or blueprint from the project",async()=>(await import("./remove-QKFHXT73.js")).removeCommand),l.command("router").description("Manage the OpenSkill router skill").command("install").description("Download the OpenSkill router SKILL.md into .skills/").action(async()=>{_();let{routerInstallCommand:n}=await import("./router-AVHY4U3G.js");await n()});let i=l.command("mcp").description("Explore and configure MCP servers");return i.command("setup").description("Print MCP configuration for Claude/Cursor").action(async()=>{_();let{mcpSetupCommand:n}=await import("./mcp-UHV7L4RE.js");await n()}),i.command("info <slug>").description("Show details about an MCP server").action(async n=>{_();let{mcpInfoCommand:s}=await import("./mcp-UHV7L4RE.js");await s(n)}),l.configureOutput({writeOut:n=>process.stderr.write(n),writeErr:n=>process.stderr.write(n)}),l.action(()=>{l.outputHelp()}),l}ot().parseAsync(process.argv).catch(l=>{console.error(l),process.exit(1)});
28
+ `)}),this}_outputHelpIfRequested(t){let e=this._getHelpOption();e&&t.find(n=>e.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function et(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 j(){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}M.Command=q;M.useColor=j});var ot=_(d=>{"use strict";var{Argument:nt}=w(),{Command:L}=it(),{CommanderError:St,InvalidArgumentError:st}=b(),{Help:vt}=T(),{Option:rt}=F();d.program=new L;d.createCommand=o=>new L(o);d.createOption=(o,t)=>new rt(o,t);d.createArgument=(o,t)=>new nt(o,t);d.Command=L;d.Option=rt;d.Argument=nt;d.Help=vt;d.CommanderError=St;d.InvalidArgumentError=st;d.InvalidOptionArgumentError=st});var at=mt(ot(),1),{program:Nt,createCommand:qt,createArgument:jt,createOption:Mt,CommanderError:Lt,InvalidArgumentError:Rt,InvalidOptionArgumentError:Ut,Command:lt,Argument:Bt,Option:Gt,Help:Jt}=at.default;var ut=[" \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"],$t="OpenSkill.md \u2014 the npm for AI skills";function R(){return["",...ut.map((o,t)=>K(o,t,ut.length)),J(" \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(` ${$t}`),""].join(`
29
+ `)}function O(){process.stderr.write(R()+`
30
+ `)}var kt="0.3.3",U=class o extends lt{createCommand(t){return new o(t)}helpInformation(){return`${R()}
31
+ ${super.helpInformation()}`}},Ht={styleTitle:o=>G.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 ht(){let o=new U;o.configureHelp(Ht);function t(n,s,r){o.command(n).description(s).action(async(...l)=>{O(),await(await r())(...l.slice(0,-1))})}o.name("osm").description("The CLI for OpenSkill.md \u2014 search, add, score, and explore AI agent skills").version(kt),t("search <query>","Search skills and blueprints by keyword",async()=>(await import("./search-BVWECMKC.js")).searchCommand),t("info <slug>","Show details about a skill or blueprint",async()=>(await import("./info-ZZYOW6IE.js")).infoCommand),o.command("add <source>").alias("install").description("Add a skill from a source repo (owner/repo or owner/repo@skill)").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(n,s)=>{O();let{addCommand:r}=await import("./add-BNGSCXUD.js");await r(n,s)}),t("list","Show installed skills and blueprints in this project",async()=>(await import("./list-T3BOFCW2.js")).listCommand),t("score <filepath>","Score a local SKILL.md file for quality",async()=>(await import("./score-YDX36SCU.js")).scoreCommand),t("init <type>","Scaffold a new skill or blueprint (type: skill | blueprint)",async()=>(await import("./init-DMS3SQYU.js")).initCommand),t("browse","Explore skills by category (interactive)",async()=>(await import("./browse-XONBU2UB.js")).browseCommand),t("remove <slug>","Remove an installed skill or blueprint from the project",async()=>(await import("./remove-F65O3ISJ.js")).removeCommand),o.command("router").description("Manage the OpenSkill router skill").command("install").description("Download the OpenSkill router SKILL.md into .skills/").action(async()=>{O();let{routerInstallCommand:n}=await import("./router-3DX6RBFD.js");await n()});let i=o.command("mcp").description("Explore and configure MCP servers");return i.command("setup").description("Print MCP configuration for Claude/Cursor").action(async()=>{O();let{mcpSetupCommand:n}=await import("./mcp-X5KM7U4Z.js");await n()}),i.command("info <slug>").description("Show details about an MCP server").action(async n=>{O();let{mcpInfoCommand:s}=await import("./mcp-X5KM7U4Z.js");await s(n)}),o.configureOutput({writeOut:n=>process.stderr.write(n),writeErr:n=>process.stderr.write(n)}),o.action(()=>{o.outputHelp()}),o}ht().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-IZJHFL7T.js";import{b as x,c as m,e as S,f as v}from"./chunk-5CDG6OB7.js";import"./chunk-YAZPI4SK.js";import{a as p,b as w,c as $,d as l,e as d,f}from"./chunk-ONVELHE6.js";import{f as u,j as g,k as a,l as s,n as b}from"./chunk-OVTYCRA4.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-K3MPWRF4.js";import{b as x,c as m,e as S,f as v}from"./chunk-XOST3W5Q.js";import"./chunk-YAZPI4SK.js";import{a as p,b as w,c as $,d as l,e as d,f}from"./chunk-AZ56ID7P.js";import{g as u,k as g,l as a,m as s,o as b}from"./chunk-GTRQVB2J.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 l,b as p}from"./chunk-AXKAVWKJ.js";import{a as c}from"./chunk-MWJMJUS4.js";import"./chunk-YAZPI4SK.js";import{f as g,g as d}from"./chunk-ONVELHE6.js";import{f,j as u,l as a}from"./chunk-OVTYCRA4.js";import n from"fs";import h from"path";async function R(e){if(e!=="skill"&&e!=="blueprint"){console.error(g(`Unknown type "${e}".`,`Use ${u("osm init skill")} or ${u("osm init blueprint")}`));return}e==="skill"?await y():await w()}async function y(){let e=await c.prompt([{type:"input",name:"name",message:"Skill name (slug):",validate:t=>{try{return l(t.trim()),!0}catch(o){return o instanceof Error?o.message:"Invalid slug"}}},{type:"input",name:"description",message:"Short description:",validate:t=>t.trim().length>0||"Required"},{type:"input",name:"version",message:"Version:",default:"1.0.0"}]),r=l(e.name.trim()),m=`---
3
+ import{a as l,b as p}from"./chunk-AXKAVWKJ.js";import{a as c}from"./chunk-KS57GYQM.js";import"./chunk-YAZPI4SK.js";import{f as g,g as d}from"./chunk-AZ56ID7P.js";import{g as f,k as u,m as a}from"./chunk-GTRQVB2J.js";import n from"fs";import h from"path";async function R(e){if(e!=="skill"&&e!=="blueprint"){console.error(g(`Unknown type "${e}".`,`Use ${u("osm init skill")} or ${u("osm init blueprint")}`));return}e==="skill"?await y():await w()}async function y(){let e=await c.prompt([{type:"input",name:"name",message:"Skill name (slug):",validate:t=>{try{return l(t.trim()),!0}catch(o){return o instanceof Error?o.message:"Invalid slug"}}},{type:"input",name:"description",message:"Short description:",validate:t=>t.trim().length>0||"Required"},{type:"input",name:"version",message:"Version:",default:"1.0.0"}]),r=l(e.name.trim()),m=`---
4
4
  name: ${r}
5
5
  description: ${e.description}
6
6
  version: ${e.version}
@@ -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{e as p,f as u}from"./chunk-ONVELHE6.js";import{f as l,j as a,k as c,l as d}from"./chunk-OVTYCRA4.js";import h from"fs";import n from"path";async function k(){let t=process.cwd(),i=n.join(t,".skills"),m=n.join(t,".blueprints"),r=f(i),e=f(m);if(r.length===0&&e.length===0){process.stderr.write(u("No skills or blueprints installed in this project.",`Run ${a("osm search <query>")} to find and install skills.`)+`
3
+ import{e as p,f as u}from"./chunk-AZ56ID7P.js";import{g as l,k as a,l as c,m as d}from"./chunk-GTRQVB2J.js";import h from"fs";import n from"path";async function k(){let t=process.cwd(),i=n.join(t,".skills"),m=n.join(t,".blueprints"),r=f(i),e=f(m);if(r.length===0&&e.length===0){process.stderr.write(u("No skills or blueprints installed in this project.",`Run ${a("osm search <query>")} to find and install skills.`)+`
4
4
  `);return}if(r.length>0){process.stderr.write(p(`Installed Skills (${r.length})`)+`
5
5
  `);for(let s of r){let o=n.basename(s,".md");process.stdout.write(` ${l("\u2022")} ${c(o)} ${d(`(.skills/${s})`)}
6
6
  `)}}if(e.length>0){process.stderr.write(p(`Installed Blueprints (${e.length})`)+`
@@ -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-5CDG6OB7.js";import{e as c,f as p}from"./chunk-ONVELHE6.js";import{f as n,g as a,k as l,l as e}from"./chunk-OVTYCRA4.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-XOST3W5Q.js";import{e as c,f as p}from"./chunk-AZ56ID7P.js";import{g as n,h as a,l,m as e}from"./chunk-GTRQVB2J.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};
@@ -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 p,b as m}from"./chunk-AXKAVWKJ.js";import{f as n,g as o}from"./chunk-ONVELHE6.js";import{j as d}from"./chunk-OVTYCRA4.js";import s from"fs";import t from"path";async function h(e){try{e=p(e)}catch(a){process.stderr.write(n(a instanceof Error?a.message:"Invalid slug")+`
3
+ import{a as p,b as m}from"./chunk-AXKAVWKJ.js";import{f as n,g as o}from"./chunk-AZ56ID7P.js";import{k as d}from"./chunk-GTRQVB2J.js";import s from"fs";import t from"path";async function h(e){try{e=p(e)}catch(a){process.stderr.write(n(a instanceof Error?a.message:"Invalid slug")+`
4
4
  `);return}let r=process.cwd(),l=t.join(r,".skills",`${e}.md`),c=t.join(r,".blueprints",`${e}.md`),i=!1;s.existsSync(l)&&(m(t.join(r,".skills"),`${e}.md`),s.unlinkSync(l),process.stderr.write(o(`Removed skill "${e}" from .skills/`)+`
5
5
  `),i=!0),s.existsSync(c)&&(m(t.join(r,".blueprints"),`${e}.md`),s.unlinkSync(c),process.stderr.write(o(`Removed blueprint "${e}" from .blueprints/`)+`
6
6
  `),i=!0),i||process.stderr.write(n(`"${e}" is not installed.`,`Run ${d("osm list")} to see installed skills and blueprints.`)+`
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
+ import{a}from"./chunk-K3MPWRF4.js";import{b as m}from"./chunk-XOST3W5Q.js";import"./chunk-YAZPI4SK.js";import{f as c,g as d}from"./chunk-AZ56ID7P.js";import{g as t,l,m as o,o as i}from"./chunk-GTRQVB2J.js";import u from"fs";import p from"path";async function I(){let s=a({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(d("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(c(r instanceof Error?r.message:"Unknown error"))}}export{I as routerInstallCommand};
@@ -1,4 +1,4 @@
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 l,c as m,e as d,f as u}from"./chunk-ONVELHE6.js";import{g as p,h as f}from"./chunk-OVTYCRA4.js";import g from"fs";function h(s){let t=[],e=A(s,t),o=w(s,t),r=$(s,t),a=k(s,t);return{overall:e+o+r+a,format:e,structure:o,security:r,specificity:a,suggestions:t}}function A(s,t){let e=0,o=s.split(`
3
+ import{b as l,c as m,e as d,f as u}from"./chunk-AZ56ID7P.js";import{h as p,i as f}from"./chunk-GTRQVB2J.js";import g from"fs";function h(s){let t=[],e=A(s,t),o=w(s,t),r=$(s,t),a=k(s,t);return{overall:e+o+r+a,format:e,structure:o,security:r,specificity:a,suggestions:t}}function A(s,t){let e=0,o=s.split(`
4
4
  `);if(s.startsWith("---")){let n=s.indexOf("---",3);if(n>3){let c=s.slice(3,n).trim(),v=/^name:/m.test(c),S=/^description:/m.test(c),b=/^version:/m.test(c);v?e+=3:t.push("Add a 'name' field to your YAML frontmatter"),S?e+=3:t.push("Add a 'description' field to your YAML frontmatter"),b?e+=2:t.push("Add a 'version' field to your YAML frontmatter"),e+=4}else t.push("Your YAML frontmatter is not properly closed with '---'")}else t.push("Add YAML frontmatter at the top of your SKILL.md (between --- delimiters)");let a=o.some(n=>/^# /.test(n)),i=o.some(n=>/^## /.test(n));return a?e+=4:t.push("Add a top-level heading (# Title)"),i?e+=3:t.push("Add section headings (## Section)"),/```[\s\S]*?```/.test(s)&&(e+=3),o.some(n=>/^\s*[-*]\s/.test(n)||/^\s*\d+\.\s/.test(n))&&(e+=3),Math.min(e,25)}function w(s,t){let e=0,o=[{pattern:/when to use/i,name:"When to Use",points:5},{pattern:/workflow|process|steps/i,name:"Workflow",points:5},{pattern:/rules|guidelines|constraints/i,name:"Rules/Guidelines",points:5}];for(let i of o)i.pattern.test(s)?e+=i.points:t.push(`Add a '${i.name}' section to improve structure`);let r=s.match(/^##?\s+.+$/gm)||[];r.length>=3?e+=4:r.length>=2?e+=2:t.push("Add more sections to organize your content (aim for 3+ headings)");let a=s.split(/\s+/).length;return a>=500?e+=3:a>=200?e+=2:t.push("Expand your content \u2014 aim for at least 500 words for a comprehensive skill"),/examples?/i.test(s)?e+=3:t.push("Add an 'Examples' section with concrete usage scenarios"),Math.min(e,25)}function $(s,t){let e=25,o=[{pattern:/(?:api[_-]?key|secret|password|token)\s*[:=]\s*['"][^'"]+['"]/gi,name:"hardcoded secrets",penalty:8},{pattern:/rm\s+-rf\s+\//g,name:"dangerous rm -rf / commands",penalty:8},{pattern:/eval\s*\(/g,name:"eval() usage",penalty:5},{pattern:/sudo\s+/g,name:"sudo commands",penalty:3},{pattern:/chmod\s+777/g,name:"chmod 777 permissions",penalty:5},{pattern:/curl.*\|\s*(ba)?sh/g,name:"piping curl to shell",penalty:5}];for(let r of o)r.pattern.test(s)&&(e-=r.penalty,t.push(`Security concern: contains ${r.name}`));return/environment\s*variable|env\s+var|\$\{?\w+\}?/i.test(s)&&!/hardcod/i.test(s)&&(e=Math.min(e+2,25)),/sanitiz|validat|escape|safe/i.test(s)&&(e=Math.min(e+2,25)),Math.max(e,0)}function k(s,t){let e=0,o=s.match(/```[\s\S]*?```/g)||[];return o.length>=3?e+=6:o.length>=1?e+=3:t.push("Add code examples to make your skill more actionable"),/for example|e\.g\.|such as|here's|consider this/i.test(s)?e+=4:t.push("Add concrete examples with phrases like 'For example...' or 'Here's how...'"),/\.\w{2,4}\b/.test(s)&&/file|path|directory|folder/i.test(s)&&(e+=3),/do not|don't|avoid|never|always|must|should not/i.test(s)?e+=4:t.push("Add clear do's and don'ts (use 'Always...', 'Never...', 'Avoid...')"),/output|result|returns|produces|generates/i.test(s)&&(e+=3),/edge case|corner case|error|exception|fallback|handle/i.test(s)?e+=3:t.push("Document edge cases and error handling scenarios"),s.split(/\s+/).length>=1e3&&(e+=2),Math.min(e,25)}async function D(s){if(!g.existsSync(s)){console.error(u(`File not found: ${s}`,"Provide a path to a SKILL.md file."));return}let t=g.readFileSync(s,"utf-8");if(t.trim().length===0){console.error(u("File is empty."));return}let e=h(t);console.error(d(`Score: ${s}`));let o=[{label:"Format",score:e.format,max:25},{label:"Structure",score:e.structure,max:25},{label:"Security",score:e.security,max:25},{label:"Specificity",score:e.specificity,max:25}];for(let r of o)console.error(` ${r.label.padEnd(14)} ${m(r.score,r.max)} ${l(r.score,r.max)}/${r.max}`);if(console.error(""),console.error(` ${"Overall".padEnd(14)} ${m(e.overall,100)} ${l(e.overall,100)}/100`),e.suggestions.length>0){console.error(d("Suggestions"));for(let r of e.suggestions)console.error(` ${f("\u2192")} ${r}`)}else console.error(""),console.error(p(" \u2728 Great job! No suggestions for improvement."));console.error(""),console.log(JSON.stringify(e))}export{D as scoreCommand};
@@ -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 k}from"./chunk-IZJHFL7T.js";import{d as C,e as P,f as x}from"./chunk-5CDG6OB7.js";import"./chunk-YAZPI4SK.js";import{a as w,b as v,d as $,e as d,f as h}from"./chunk-ONVELHE6.js";import{f as n,l as t,n as S}from"./chunk-OVTYCRA4.js";async function A(p){let b=k({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 k}from"./chunk-K3MPWRF4.js";import{d as C,e as P,f as x}from"./chunk-XOST3W5Q.js";import"./chunk-YAZPI4SK.js";import{a as w,b as v,d as $,e as d,f as h}from"./chunk-AZ56ID7P.js";import{g as n,m as t,o as S}from"./chunk-GTRQVB2J.js";async function A(p){let b=k({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})`)+`