@skyramp/testbot-core 0.13.0-v3.368 → 0.13.0-v3.369
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/VERSION.json +1 -1
- package/dist/main.js +443 -443
- package/dist/post.js +3 -3
- package/dist/runner-client.cjs +3 -3
- package/package.json +1 -1
package/dist/runner-client.cjs
CHANGED
|
@@ -53,7 +53,7 @@ ${u}`,this.dataLineCount++;return}if(Yf(t,r,_5)){P5(t,s)&&(this.setEventFieldSiz
|
|
|
53
53
|
`),`
|
|
54
54
|
`,t)}o(wM,"boundedFailureText");function Co(e){return Gl(see(e),[]).trim()}o(Co,"commandFailureText");var oee=/^(.*?:\s*)?Command failed: (?:git|gh)\b.*$/;function Vl(e,t=og){let[n="",...i]=e.split(`
|
|
55
55
|
`).map(a=>a.trim()).filter(Boolean),r=i.length?oee.exec(n):null,s=r?[`${r[1]??""}${i[0]}`,...i.slice(1)]:[n,...i];return bM(s," ",t,Math.floor(t*2/3))}o(Vl,"failureReason");function zl(e){return e.replace(new RegExp("\x1B\\[[0-9;]*m","g"),"")}o(zl,"stripAnsi");function aee(e){let t=/^(yarn run v|info Visit|error Command failed|npm ERR!|husky\b|\$ )/i,n=zl(e).split(`
|
|
56
|
-
`).map(a=>a.trim()).filter(Boolean),i=n.filter(a=>!t.test(a)),r=i.length?i:n;return[...r].reverse().find(a=>/(error|warning|problem|✖|✗|✘|fail|not listed|cannot|denied)/i.test(a))??r[r.length-1]??"(no output)"}o(aee,"hookSummary");function BM(e){if(!/\bhook\b|husky|pre-commit|lint-staged/i.test(e))return;let t=aee(e),n=ae().staged.commitHook(/husky\s*[->]\s*([\w-]+)\s+(?:script|hook)\b/i.exec(zl(e))?.[1]);return/\(code 127\)|exit code 127/i.test(e)||/command not found|: not found$/i.test(t)?ae().staged.commitHookCouldNotRun(n,t):ae().staged.commitRefusedByHook(n,t)}o(BM,"hookRefusal");var Ri=["-c","core.fsmonitor=false"],cee=new Set(["GH_TOKEN","GITHUB_TOKEN","GH_ENTERPRISE_TOKEN","GITHUB_ENTERPRISE_TOKEN","ACTIONS_RUNTIME_TOKEN","ACTIONS_ID_TOKEN_REQUEST_TOKEN","ACTIONS_ID_TOKEN_REQUEST_URL","SYSTEM_ACCESSTOKEN","SYSTEM_OIDCREQUESTURI","SKYRAMP_MCP_GITHUB_TOKEN","SSH_AUTH_SOCK","GIT_SSH","GIT_SSH_COMMAND","GITHUB_STEP_SUMMARY"]),gv=new Set(["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","AWS_BEARER_TOKEN_BEDROCK","AWS_PROFILE","AWS_WEB_IDENTITY_TOKEN_FILE","AWS_ROLE_ARN","AWS_ROLE_SESSION_NAME","AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"]);function Xt(e=process.env,t,n="repo-command"){let i={};for(let[r,s]of Object.entries(e))n==="repo-command"&&gv.has(r)||(i[r]=s);Object.assign(i,t??{});for(let r of Object.keys(i))(cee.has(r)||r.startsWith("INPUT_"))&&delete i[r];return i}o(Xt,"untrustedChildEnv");var d={};Cr(d,{BRAND:()=>_ee,DIRTY:()=>vo,EMPTY_PATH:()=>Aee,INVALID:()=>me,NEVER:()=>yte,OK:()=>en,ParseStatus:()=>Mt,Schema:()=>De,ZodAny:()=>ys,ZodArray:()=>Di,ZodBigInt:()=>wo,ZodBoolean:()=>Bo,ZodBranded:()=>Jl,ZodCatch:()=>Uo,ZodDate:()=>ko,ZodDefault:()=>No,ZodDiscriminatedUnion:()=>ug,ZodEffects:()=>Ar,ZodEnum:()=>Do,ZodError:()=>Qn,ZodFirstPartyTypeKind:()=>ve,ZodFunction:()=>dg,ZodIntersection:()=>xo,ZodIssueCode:()=>j,ZodLazy:()=>$o,ZodLiteral:()=>To,ZodMap:()=>Ec,ZodNaN:()=>Cc,ZodNativeEnum:()=>_o,ZodNever:()=>$r,ZodNull:()=>Qo,ZodNullable:()=>ei,ZodNumber:()=>bo,ZodObject:()=>Rn,ZodOptional:()=>lr,ZodParsedType:()=>te,ZodPipeline:()=>Hl,ZodPromise:()=>Es,ZodReadonly:()=>Fo,ZodRecord:()=>lg,ZodSchema:()=>De,ZodSet:()=>Ic,ZodString:()=>ms,ZodSymbol:()=>mc,ZodTransformer:()=>Ar,ZodTuple:()=>Xr,ZodType:()=>De,ZodUndefined:()=>So,ZodUnion:()=>Ro,ZodUnknown:()=>Ti,ZodVoid:()=>yc,addIssueToContext:()=>Z,any:()=>Gee,array:()=>Jee,bigint:()=>Pee,boolean:()=>UM,coerce:()=>mte,custom:()=>DM,date:()=>Mee,datetimeRegex:()=>$M,defaultErrorMap:()=>xi,discriminatedUnion:()=>Zee,effect:()=>ute,enum:()=>ote,function:()=>rte,getErrorMap:()=>fc,getParsedType:()=>Kr,instanceof:()=>Uee,intersection:()=>Kee,isAborted:()=>ag,isAsync:()=>gc,isDirty:()=>cg,isValid:()=>hs,late:()=>Nee,lazy:()=>ite,literal:()=>ste,makeIssue:()=>ql,map:()=>tte,nan:()=>Fee,nativeEnum:()=>ate,never:()=>zee,null:()=>jee,nullable:()=>dte,number:()=>NM,object:()=>Hee,objectUtil:()=>hv,oboolean:()=>hte,onumber:()=>gte,optional:()=>lte,ostring:()=>fte,pipeline:()=>pte,preprocess:()=>Ate,promise:()=>cte,quotelessJson:()=>uee,record:()=>ete,set:()=>nte,setErrorMap:()=>dee,strictObject:()=>Yee,string:()=>_M,symbol:()=>Lee,transformer:()=>ute,tuple:()=>Xee,undefined:()=>Oee,union:()=>Wee,unknown:()=>Vee,util:()=>Me,void:()=>qee});var Me;(function(e){e.assertEqual=r=>{};function t(r){}o(t,"assertIs"),e.assertIs=t;function n(r){throw new Error}o(n,"assertNever"),e.assertNever=n,e.arrayToEnum=r=>{let s={};for(let a of r)s[a]=a;return s},e.getValidEnumValues=r=>{let s=e.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),a={};for(let c of s)a[c]=r[c];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(s){return r[s]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let s=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&s.push(a);return s},e.find=(r,s)=>{for(let a of r)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}o(i,"joinValues"),e.joinValues=i,e.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Me||(Me={}));var hv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(hv||(hv={}));var te=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kr=o(e=>{switch(typeof e){case"undefined":return te.undefined;case"string":return te.string;case"number":return Number.isNaN(e)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(e)?te.array:e===null?te.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?te.promise:typeof Map<"u"&&e instanceof Map?te.map:typeof Set<"u"&&e instanceof Set?te.set:typeof Date<"u"&&e instanceof Date?te.date:te.object;default:return te.unknown}},"getParsedType");var j=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),uee=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Qn=class e extends Error{static{o(this,"ZodError")}get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(s){return s.message},i={_errors:[]},r=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let c=i,u=0;for(;u<a.path.length;){let l=a.path[u],A=u===a.path.length-1;if(l==="_errors"){A&&c._errors.push(n(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||(l==="__proto__"?Object.defineProperty(c,l,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):c[l]={_errors:[]}),c=c[l],A&&c._errors.push(n(a)),u++}}},"processError");return r(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let s=r.path[0];n[s]=n[s]||[],n[s].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Qn.create=e=>new Qn(e);var lee=o((e,t)=>{let n;switch(e.code){case j.invalid_type:e.received===te.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case j.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Me.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(e.keys,", ")}`;break;case j.invalid_union:n="Invalid input";break;case j.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(e.options)}`;break;case j.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(e.options)}, received '${e.received}'`;break;case j.invalid_arguments:n="Invalid function arguments";break;case j.invalid_return_type:n="Invalid function return type";break;case j.invalid_date:n="Invalid date";break;case j.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Me.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case j.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case j.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case j.custom:n="Invalid input";break;case j.invalid_intersection_types:n="Intersection results could not be merged";break;case j.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case j.not_finite:n="Number must be finite";break;default:n=t.defaultError,Me.assertNever(e)}return{message:n}},"errorMap"),xi=lee;var kM=xi;function dee(e){kM=e}o(dee,"setErrorMap");function fc(){return kM}o(fc,"getErrorMap");var ql=o(e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,s=[...n,...r.path||[]],a={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)c=l(a,{data:t,defaultError:c}).message;return{...r,path:s,message:c}},"makeIssue"),Aee=[];function Z(e,t){let n=fc(),i=ql({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===xi?void 0:xi].filter(r=>!!r)});e.common.issues.push(i)}o(Z,"addIssueToContext");var Mt=class e{static{o(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return me;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let s=await r.key,a=await r.value;i.push({key:s,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:s,value:a}=r;if(s.status==="aborted"||a.status==="aborted")return me;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[s.value]=a.value)}return{status:t.value,value:i}}},me=Object.freeze({status:"aborted"}),vo=o(e=>({status:"dirty",value:e}),"DIRTY"),en=o(e=>({status:"valid",value:e}),"OK"),ag=o(e=>e.status==="aborted","isAborted"),cg=o(e=>e.status==="dirty","isDirty"),hs=o(e=>e.status==="valid","isValid"),gc=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");var oe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(oe||(oe={}));var dr=class{static{o(this,"ParseInputLazyPath")}constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},SM=o((e,t)=>{if(hs(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Qn(e.common.issues);return this._error=n,this._error}}},"handleResult");function Re(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:o((a,c)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},"customMap"),description:r}}o(Re,"processCreateParams");var De=class{static{o(this,"ZodType")}get description(){return this._def.description}_getType(t){return Kr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Kr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Mt,ctx:{common:t.parent.common,data:t.data,parsedType:Kr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(gc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Kr(t)},r=this._parseSync({data:t,path:i.path,parent:i});return SM(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Kr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return hs(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>hs(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Kr(t)},r=this._parse({data:t,path:i.path,parent:i}),s=await(gc(r)?r:Promise.resolve(r));return SM(i,s)}refine(t,n){let i=o(r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n,"getIssueProperties");return this._refinement((r,s)=>{let a=t(r),c=o(()=>s.addIssue({code:j.custom,...i(r)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Ar({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:o(n=>this["~validate"](n),"validate")}}optional(){return lr.create(this,this._def)}nullable(){return ei.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Di.create(this)}promise(){return Es.create(this,this._def)}or(t){return Ro.create([this,t],this._def)}and(t){return xo.create(this,t,this._def)}transform(t){return new Ar({...Re(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new No({...Re(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new Jl({typeName:ve.ZodBranded,type:this,...Re(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Uo({...Re(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Hl.create(this,t)}readonly(){return Fo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},pee=/^c[^\s-]{8,}$/i,fee=/^[0-9a-z]+$/,gee=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hee=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,mee=/^[a-z0-9_-]{21}$/i,yee=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Eee=/^[-+]?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)?)??$/,Iee=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cee="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",mv,vee=/^(?:(?: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])$/,bee=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,wee=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Bee=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kee=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,See=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,RM="((\\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])))",Qee=new RegExp(`^${RM}$`);function xM(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}o(xM,"timeRegexSource");function Ree(e){return new RegExp(`^${xM(e)}$`)}o(Ree,"timeRegex");function $M(e){let t=`${RM}T${xM(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}o($M,"datetimeRegex");function xee(e,t){return!!((t==="v4"||!t)&&vee.test(e)||(t==="v6"||!t)&&wee.test(e))}o(xee,"isValidIP");function $ee(e,t){if(!yee.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}o($ee,"isValidJWT");function Tee(e,t){return!!((t==="v4"||!t)&&bee.test(e)||(t==="v6"||!t)&&Bee.test(e))}o(Tee,"isValidCidr");var ms=class e extends De{static{o(this,"ZodString")}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==te.string){let s=this._getOrReturnCtx(t);return Z(s,{code:j.invalid_type,expected:te.string,received:s.parsedType}),me}let i=new Mt,r;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),Z(r,{code:j.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),Z(r,{code:j.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=t.data.length>s.value,c=t.data.length<s.value;(a||c)&&(r=this._getOrReturnCtx(t,r),a?Z(r,{code:j.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&Z(r,{code:j.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Iee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"email",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")mv||(mv=new RegExp(Cee,"u")),mv.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"emoji",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")hee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"uuid",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")mee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"nanoid",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")pee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"cuid",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")fee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"cuid2",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")gee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"ulid",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),Z(r,{validation:"url",code:j.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"regex",code:j.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?$M(s).test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?Qee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?Ree(s).test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?Eee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"duration",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?xee(t.data,s.version)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"ip",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?$ee(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"jwt",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?Tee(t.data,s.version)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"cidr",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?kee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"base64",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?See.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"base64url",code:j.invalid_string,message:s.message}),i.dirty()):Me.assertNever(s);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:j.invalid_string,...oe.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...oe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...oe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...oe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...oe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...oe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...oe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...oe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...oe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...oe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...oe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...oe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...oe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...oe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...oe.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...oe.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...oe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...oe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...oe.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...oe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...oe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...oe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...oe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...oe.errToObj(n)})}nonempty(t){return this.min(1,oe.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ms.create=e=>new ms({checks:[],typeName:ve.ZodString,coerce:e?.coerce??!1,...Re(e)});function Dee(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return s%a/10**r}o(Dee,"floatSafeRemainder");var bo=class e extends De{static{o(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==te.number){let s=this._getOrReturnCtx(t);return Z(s,{code:j.invalid_type,expected:te.number,received:s.parsedType}),me}let i,r=new Mt;for(let s of this._def.checks)s.kind==="int"?Me.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),Z(i,{code:j.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?Dee(t.data,s.value)!==0&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),Z(i,{code:j.not_finite,message:s.message}),r.dirty()):Me.assertNever(s);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,oe.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:oe.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:oe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:oe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:oe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:oe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:oe.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Me.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};bo.create=e=>new bo({checks:[],typeName:ve.ZodNumber,coerce:e?.coerce||!1,...Re(e)});var wo=class e extends De{static{o(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==te.bigint)return this._getInvalidInput(t);let i,r=new Mt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Me.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return Z(n,{code:j.invalid_type,expected:te.bigint,received:n.parsedType}),me}gte(t,n){return this.setLimit("min",t,!0,oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,oe.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:oe.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:oe.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};wo.create=e=>new wo({checks:[],typeName:ve.ZodBigInt,coerce:e?.coerce??!1,...Re(e)});var Bo=class extends De{static{o(this,"ZodBoolean")}_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==te.boolean){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.boolean,received:i.parsedType}),me}return en(t.data)}};Bo.create=e=>new Bo({typeName:ve.ZodBoolean,coerce:e?.coerce||!1,...Re(e)});var ko=class e extends De{static{o(this,"ZodDate")}_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==te.date){let s=this._getOrReturnCtx(t);return Z(s,{code:j.invalid_type,expected:te.date,received:s.parsedType}),me}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return Z(s,{code:j.invalid_date}),me}let i=new Mt,r;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),Z(r,{code:j.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),Z(r,{code:j.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Me.assertNever(s);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:oe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:oe.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};ko.create=e=>new ko({checks:[],coerce:e?.coerce||!1,typeName:ve.ZodDate,...Re(e)});var mc=class extends De{static{o(this,"ZodSymbol")}_parse(t){if(this._getType(t)!==te.symbol){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.symbol,received:i.parsedType}),me}return en(t.data)}};mc.create=e=>new mc({typeName:ve.ZodSymbol,...Re(e)});var So=class extends De{static{o(this,"ZodUndefined")}_parse(t){if(this._getType(t)!==te.undefined){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.undefined,received:i.parsedType}),me}return en(t.data)}};So.create=e=>new So({typeName:ve.ZodUndefined,...Re(e)});var Qo=class extends De{static{o(this,"ZodNull")}_parse(t){if(this._getType(t)!==te.null){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.null,received:i.parsedType}),me}return en(t.data)}};Qo.create=e=>new Qo({typeName:ve.ZodNull,...Re(e)});var ys=class extends De{static{o(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(t){return en(t.data)}};ys.create=e=>new ys({typeName:ve.ZodAny,...Re(e)});var Ti=class extends De{static{o(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(t){return en(t.data)}};Ti.create=e=>new Ti({typeName:ve.ZodUnknown,...Re(e)});var $r=class extends De{static{o(this,"ZodNever")}_parse(t){let n=this._getOrReturnCtx(t);return Z(n,{code:j.invalid_type,expected:te.never,received:n.parsedType}),me}};$r.create=e=>new $r({typeName:ve.ZodNever,...Re(e)});var yc=class extends De{static{o(this,"ZodVoid")}_parse(t){if(this._getType(t)!==te.undefined){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.void,received:i.parsedType}),me}return en(t.data)}};yc.create=e=>new yc({typeName:ve.ZodVoid,...Re(e)});var Di=class e extends De{static{o(this,"ZodArray")}_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==te.array)return Z(n,{code:j.invalid_type,expected:te.array,received:n.parsedType}),me;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(a||c)&&(Z(n,{code:a?j.too_big:j.too_small,minimum:c?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(Z(n,{code:j.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(Z(n,{code:j.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>r.type._parseAsync(new dr(n,a,n.path,c)))).then(a=>Mt.mergeArray(i,a));let s=[...n.data].map((a,c)=>r.type._parseSync(new dr(n,a,n.path,c)));return Mt.mergeArray(i,s)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:oe.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:oe.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:oe.toString(n)}})}nonempty(t){return this.min(1,t)}};Di.create=(e,t)=>new Di({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Re(t)});function hc(e){if(e instanceof Rn){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=lr.create(hc(i))}return new Rn({...e._def,shape:o(()=>t,"shape")})}else return e instanceof Di?new Di({...e._def,type:hc(e.element)}):e instanceof lr?lr.create(hc(e.unwrap())):e instanceof ei?ei.create(hc(e.unwrap())):e instanceof Xr?Xr.create(e.items.map(t=>hc(t))):e}o(hc,"deepPartialify");var Rn=class e extends De{static{o(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Me.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==te.object){let l=this._getOrReturnCtx(t);return Z(l,{code:j.invalid_type,expected:te.object,received:l.parsedType}),me}let{status:i,ctx:r}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof $r&&this._def.unknownKeys==="strip"))for(let l in r.data)a.includes(l)||c.push(l);let u=[];for(let l of a){let A=s[l],p=r.data[l];u.push({key:{status:"valid",value:l},value:A._parse(new dr(r,p,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof $r){let l=this._def.unknownKeys;if(l==="passthrough")for(let A of c)u.push({key:{status:"valid",value:A},value:{status:"valid",value:r.data[A]}});else if(l==="strict")c.length>0&&(Z(r,{code:j.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let A of c){let p=r.data[A];u.push({key:{status:"valid",value:A},value:l._parse(new dr(r,p,r.path,A)),alwaysSet:A in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let A of u){let p=await A.key,g=await A.value;l.push({key:p,value:g,alwaysSet:A.alwaysSet})}return l}).then(l=>Mt.mergeObjectSync(i,l)):Mt.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(t){return oe.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:o((n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:oe.errToObj(t).message??r}:{message:r}},"errorMap")}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:o(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of Me.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}omit(t){let n={};for(let i of Me.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}deepPartial(){return hc(this)}partial(t){let n={};for(let i of Me.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:o(()=>n,"shape")})}required(t){let n={};for(let i of Me.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof lr;)s=s._def.innerType;n[i]=s}return new e({...this._def,shape:o(()=>n,"shape")})}keyof(){return TM(Me.objectKeys(this.shape))}};Rn.create=(e,t)=>new Rn({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:$r.create(),typeName:ve.ZodObject,...Re(t)});Rn.strictCreate=(e,t)=>new Rn({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:$r.create(),typeName:ve.ZodObject,...Re(t)});Rn.lazycreate=(e,t)=>new Rn({shape:e,unknownKeys:"strip",catchall:$r.create(),typeName:ve.ZodObject,...Re(t)});var Ro=class extends De{static{o(this,"ZodUnion")}_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=s.map(c=>new Qn(c.ctx.common.issues));return Z(n,{code:j.invalid_union,unionErrors:a}),me}if(o(r,"handleResults"),n.common.async)return Promise.all(i.map(async s=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let s,a=[];for(let u of i){let l={...n,common:{...n.common,issues:[]},parent:null},A=u._parseSync({data:n.data,path:n.path,parent:l});if(A.status==="valid")return A;A.status==="dirty"&&!s&&(s={result:A,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let c=a.map(u=>new Qn(u));return Z(n,{code:j.invalid_union,unionErrors:c}),me}}get options(){return this._def.options}};Ro.create=(e,t)=>new Ro({options:e,typeName:ve.ZodUnion,...Re(t)});var $i=o(e=>e instanceof $o?$i(e.schema):e instanceof Ar?$i(e.innerType()):e instanceof To?[e.value]:e instanceof Do?e.options:e instanceof _o?Me.objectValues(e.enum):e instanceof No?$i(e._def.innerType):e instanceof So?[void 0]:e instanceof Qo?[null]:e instanceof lr?[void 0,...$i(e.unwrap())]:e instanceof ei?[null,...$i(e.unwrap())]:e instanceof Jl||e instanceof Fo?$i(e.unwrap()):e instanceof Uo?$i(e._def.innerType):[],"getDiscriminator"),ug=class e extends De{static{o(this,"ZodDiscriminatedUnion")}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==te.object)return Z(n,{code:j.invalid_type,expected:te.object,received:n.parsedType}),me;let i=this.discriminator,r=n.data[i],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Z(n,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),me)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let s of n){let a=$i(s.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of a){if(r.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);r.set(c,s)}}return new e({typeName:ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Re(i)})}};function yv(e,t){let n=Kr(e),i=Kr(t);if(e===t)return{valid:!0,data:e};if(n===te.object&&i===te.object){let r=Me.objectKeys(t),s=Me.objectKeys(e).filter(c=>r.indexOf(c)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(let c of s){if(c==="__proto__")continue;let u=yv(e[c],t[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===te.array&&i===te.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let s=0;s<e.length;s++){let a=e[s],c=t[s],u=yv(a,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===te.date&&i===te.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(yv,"mergeValues");var xo=class extends De{static{o(this,"ZodIntersection")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=o((s,a)=>{if(ag(s)||ag(a))return me;let c=yv(s.value,a.value);return c.valid?((cg(s)||cg(a))&&n.dirty(),{status:n.value,value:c.data}):(Z(i,{code:j.invalid_intersection_types}),me)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>r(s,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};xo.create=(e,t,n)=>new xo({left:e,right:t,typeName:ve.ZodIntersection,...Re(n)});var Xr=class e extends De{static{o(this,"ZodTuple")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==te.array)return Z(i,{code:j.invalid_type,expected:te.array,received:i.parsedType}),me;if(i.data.length<this._def.items.length)return Z(i,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),me;!this._def.rest&&i.data.length>this._def.items.length&&(Z(i,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...i.data].map((a,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new dr(i,a,i.path,c)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>Mt.mergeArray(n,a)):Mt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Xr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xr({items:e,typeName:ve.ZodTuple,rest:null,...Re(t)})};var lg=class e extends De{static{o(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==te.object)return Z(i,{code:j.invalid_type,expected:te.object,received:i.parsedType}),me;let r=[],s=this._def.keyType,a=this._def.valueType;for(let c in i.data)r.push({key:s._parse(new dr(i,c,i.path,c)),value:a._parse(new dr(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Mt.mergeObjectAsync(n,r):Mt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof De?new e({keyType:t,valueType:n,typeName:ve.ZodRecord,...Re(i)}):new e({keyType:ms.create(),valueType:t,typeName:ve.ZodRecord,...Re(n)})}},Ec=class extends De{static{o(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==te.map)return Z(i,{code:j.invalid_type,expected:te.map,received:i.parsedType}),me;let r=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([c,u],l)=>({key:r._parse(new dr(i,c,i.path,[l,"key"])),value:s._parse(new dr(i,u,i.path,[l,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of a){let l=await u.key,A=await u.value;if(l.status==="aborted"||A.status==="aborted")return me;(l.status==="dirty"||A.status==="dirty")&&n.dirty(),c.set(l.value,A.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of a){let l=u.key,A=u.value;if(l.status==="aborted"||A.status==="aborted")return me;(l.status==="dirty"||A.status==="dirty")&&n.dirty(),c.set(l.value,A.value)}return{status:n.value,value:c}}}};Ec.create=(e,t,n)=>new Ec({valueType:t,keyType:e,typeName:ve.ZodMap,...Re(n)});var Ic=class e extends De{static{o(this,"ZodSet")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==te.set)return Z(i,{code:j.invalid_type,expected:te.set,received:i.parsedType}),me;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(Z(i,{code:j.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(Z(i,{code:j.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let s=this._def.valueType;function a(u){let l=new Set;for(let A of u){if(A.status==="aborted")return me;A.status==="dirty"&&n.dirty(),l.add(A.value)}return{status:n.value,value:l}}o(a,"finalizeSet");let c=[...i.data.values()].map((u,l)=>s._parse(new dr(i,u,i.path,l)));return i.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:oe.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:oe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};Ic.create=(e,t)=>new Ic({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...Re(t)});var dg=class e extends De{static{o(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==te.function)return Z(n,{code:j.invalid_type,expected:te.function,received:n.parsedType}),me;function i(c,u){return ql({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fc(),xi].filter(l=>!!l),issueData:{code:j.invalid_arguments,argumentsError:u}})}o(i,"makeArgsIssue");function r(c,u){return ql({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fc(),xi].filter(l=>!!l),issueData:{code:j.invalid_return_type,returnTypeError:u}})}o(r,"makeReturnsIssue");let s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Es){let c=this;return en(async function(...u){let l=new Qn([]),A=await c._def.args.parseAsync(u,s).catch(h=>{throw l.addIssue(i(u,h)),l}),p=await Reflect.apply(a,this,A);return await c._def.returns._def.type.parseAsync(p,s).catch(h=>{throw l.addIssue(r(p,h)),l})})}else{let c=this;return en(function(...u){let l=c._def.args.safeParse(u,s);if(!l.success)throw new Qn([i(u,l.error)]);let A=Reflect.apply(a,this,l.data),p=c._def.returns.safeParse(A,s);if(!p.success)throw new Qn([r(A,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Xr.create(t).rest(Ti.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,i){return new e({args:t||Xr.create([]).rest(Ti.create()),returns:n||Ti.create(),typeName:ve.ZodFunction,...Re(i)})}},$o=class extends De{static{o(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};$o.create=(e,t)=>new $o({getter:e,typeName:ve.ZodLazy,...Re(t)});var To=class extends De{static{o(this,"ZodLiteral")}_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return Z(n,{received:n.data,code:j.invalid_literal,expected:this._def.value}),me}return{status:"valid",value:t.data}}get value(){return this._def.value}};To.create=(e,t)=>new To({value:e,typeName:ve.ZodLiteral,...Re(t)});function TM(e,t){return new Do({values:e,typeName:ve.ZodEnum,...Re(t)})}o(TM,"createZodEnum");var Do=class e extends De{static{o(this,"ZodEnum")}_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return Z(n,{expected:Me.joinValues(i),received:n.parsedType,code:j.invalid_type}),me}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return Z(n,{received:n.data,code:j.invalid_enum_value,options:i}),me}return en(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};Do.create=TM;var _o=class extends De{static{o(this,"ZodNativeEnum")}_parse(t){let n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==te.string&&i.parsedType!==te.number){let r=Me.objectValues(n);return Z(i,{expected:Me.joinValues(r),received:i.parsedType,code:j.invalid_type}),me}if(this._cache||(this._cache=new Set(Me.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=Me.objectValues(n);return Z(i,{received:i.data,code:j.invalid_enum_value,options:r}),me}return en(t.data)}get enum(){return this._def.values}};_o.create=(e,t)=>new _o({values:e,typeName:ve.ZodNativeEnum,...Re(t)});var Es=class extends De{static{o(this,"ZodPromise")}unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==te.promise&&n.common.async===!1)return Z(n,{code:j.invalid_type,expected:te.promise,received:n.parsedType}),me;let i=n.parsedType===te.promise?n.data:Promise.resolve(n.data);return en(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Es.create=(e,t)=>new Es({type:e,typeName:ve.ZodPromise,...Re(t)});var Ar=class extends De{static{o(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o(a=>{Z(i,a),a.fatal?n.abort():n.dirty()},"addIssue"),get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let a=r.transform(i.data,s);if(i.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return me;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?me:u.status==="dirty"?vo(u.value):n.value==="dirty"?vo(u.value):u});{if(n.value==="aborted")return me;let c=this._def.schema._parseSync({data:a,path:i.path,parent:i});return c.status==="aborted"?me:c.status==="dirty"?vo(c.value):n.value==="dirty"?vo(c.value):c}}if(r.type==="refinement"){let a=o(c=>{let u=r.refinement(c,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?me:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?me:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!hs(a))return me;let c=r.transform(a.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>hs(a)?Promise.resolve(r.transform(a.value,s)).then(c=>({status:n.value,value:c})):me);Me.assertNever(r)}};Ar.create=(e,t,n)=>new Ar({schema:e,typeName:ve.ZodEffects,effect:t,...Re(n)});Ar.createWithPreprocess=(e,t,n)=>new Ar({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...Re(n)});var lr=class extends De{static{o(this,"ZodOptional")}_parse(t){return this._getType(t)===te.undefined?en(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};lr.create=(e,t)=>new lr({innerType:e,typeName:ve.ZodOptional,...Re(t)});var ei=class extends De{static{o(this,"ZodNullable")}_parse(t){return this._getType(t)===te.null?en(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ei.create=(e,t)=>new ei({innerType:e,typeName:ve.ZodNullable,...Re(t)});var No=class extends De{static{o(this,"ZodDefault")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===te.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};No.create=(e,t)=>new No({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Re(t)});var Uo=class extends De{static{o(this,"ZodCatch")}_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return gc(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qn(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Qn(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Uo.create=(e,t)=>new Uo({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Re(t)});var Cc=class extends De{static{o(this,"ZodNaN")}_parse(t){if(this._getType(t)!==te.nan){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.nan,received:i.parsedType}),me}return{status:"valid",value:t.data}}};Cc.create=e=>new Cc({typeName:ve.ZodNaN,...Re(e)});var _ee=Symbol("zod_brand"),Jl=class extends De{static{o(this,"ZodBranded")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Hl=class e extends De{static{o(this,"ZodPipeline")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?me:s.status==="dirty"?(n.dirty(),vo(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})},"handleAsync")();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?me:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:ve.ZodPipeline})}},Fo=class extends De{static{o(this,"ZodReadonly")}_parse(t){let n=this._def.innerType._parse(t),i=o(r=>(hs(r)&&(r.value=Object.freeze(r.value)),r),"freeze");return gc(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Fo.create=(e,t)=>new Fo({innerType:e,typeName:ve.ZodReadonly,...Re(t)});function QM(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}o(QM,"cleanParams");function DM(e,t={},n){return e?ys.create().superRefine((i,r)=>{let s=e(i);if(s instanceof Promise)return s.then(a=>{if(!a){let c=QM(t,i),u=c.fatal??n??!0;r.addIssue({code:"custom",...c,fatal:u})}});if(!s){let a=QM(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}}):ys.create()}o(DM,"custom");var Nee={object:Rn.lazycreate},ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ve||(ve={}));var Uee=o((e,t={message:`Input not instance of ${e.name}`})=>DM(n=>n instanceof e,t),"instanceOfType"),_M=ms.create,NM=bo.create,Fee=Cc.create,Pee=wo.create,UM=Bo.create,Mee=ko.create,Lee=mc.create,Oee=So.create,jee=Qo.create,Gee=ys.create,Vee=Ti.create,zee=$r.create,qee=yc.create,Jee=Di.create,Hee=Rn.create,Yee=Rn.strictCreate,Wee=Ro.create,Zee=ug.create,Kee=xo.create,Xee=Xr.create,ete=lg.create,tte=Ec.create,nte=Ic.create,rte=dg.create,ite=$o.create,ste=To.create,ote=Do.create,ate=_o.create,cte=Es.create,ute=Ar.create,lte=lr.create,dte=ei.create,Ate=Ar.createWithPreprocess,pte=Hl.create,fte=o(()=>_M().optional(),"ostring"),gte=o(()=>NM().optional(),"onumber"),hte=o(()=>UM().optional(),"oboolean"),mte={string:o((e=>ms.create({...e,coerce:!0})),"string"),number:o((e=>bo.create({...e,coerce:!0})),"number"),boolean:o((e=>Bo.create({...e,coerce:!0})),"boolean"),bigint:o((e=>wo.create({...e,coerce:!0})),"bigint"),date:o((e=>ko.create({...e,coerce:!0})),"date")};var yte=me;var Ev=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(Ev||{}),Iv=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(Iv||{});var Ag=300,yt=d.string().trim().min(1),Ete=d.object({action:d.enum(["start","run","wait"]),text:yt,source:d.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:yt.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),Yl=/^[A-Za-z_][A-Za-z0-9_]*$/,ti=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,vc=(a=>(a.VersionEndpoint="version_endpoint",a.DeployWorkflow="deploy_workflow",a.KubernetesLabels="kubernetes_labels",a.Command="command",a.Api="api",a.NotTracked="not_tracked",a))(vc||{}),ni="shared",Ite=yt.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),bc=d.object({address:Ite,readyWhen:yt.nullable(),credentials:d.array(d.string().regex(ti)).max(50),revisionSources:d.array(d.object({method:d.nativeEnum(vc),detail:yt.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:d.array(yt).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),Cv={steps:d.array(Ete).max(20).optional().describe("how it starts, in order"),kind:d.enum(["web_app","service","database","external_service"]).optional(),from:d.object({file:yt,service:yt.nullable()}).strict().optional(),credentials:d.array(d.string().max(100).regex(Yl)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},vv=d.object({name:yt,repository:yt.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:d.boolean(),...Cv,deployed:yt.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),Cte=d.object({name:d.string().regex(ti).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:d.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:d.boolean().describe("false only when the SUT starts without it, with less working"),how:yt.max(Ag).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),vte=d.object({component:yt,problem:yt,evidence:yt.describe("the exact command and output that shows it"),fix:yt.describe("what the user must provide, and where")}),bte=d.object({framework:yt,file:yt.describe("the test file run, relative to its repository root"),result:d.enum(["pass","fail","error"])}),wte=d.object({input:yt.describe("the part of the user's SUT input, as given"),reason:yt}),HIe=d.object({schemaVersion:d.literal(1),status:d.nativeEnum(Iv).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:d.array(vv),suites:d.array(bte).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:d.array(yt).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:d.array(d.object({input:yt.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:yt.describe("what the recipe did with it")})).optional(),inputsNotUsed:d.array(wte).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:d.array(vte).describe("required (non-empty) when status is blocked"),inputs:d.array(Cte).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),environment:bc.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward, proxy or client certificate)")});var bv=64*1024,wv=512*1024,FM=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var ri=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(ri||{}),Tr=d.string().trim().min(1),Bte=d.object({url:d.string().optional().describe("the URL probed, if the check is an HTTP request"),command:d.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:d.record(d.string()).optional(),status:d.union([d.number(),d.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:Tr.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),Bv=d.array(d.object({component:Tr.describe("a shared component listed above"),url:Tr.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:Tr.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),kte=d.object({name:Tr.describe("the credential's environment variable name, as listed above; never its value"),component:Tr.describe("the component that refused it"),status:d.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:Tr.describe("the request or command you tested it with and what came back, never the value")}),PM=d.object({schemaVersion:d.literal(1),baseUrls:d.record(d.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:Bte.optional(),teardown:Tr.describe("command that tears the SUT down"),dependencies:d.record(d.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:d.nativeEnum(ri).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:d.array(d.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:d.object({command:Tr,output:Tr}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:d.array(d.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:d.boolean(),startedAt:Tr.describe("ISO timestamp"),revisions:Bv.optional(),missingSecrets:d.array(d.string().regex(Yl)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:d.array(kte).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:d.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var uL=require("node:crypto");var Is=(a=>(a.Place="place",a.Update="update",a.Regenerate="regenerate",a.Delete="delete",a.Verify="verify",a.None="none",a))(Is||{}),pr=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(pr||{}),Zn=d.string().trim().min(1),MM=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(MM||{}),pg=d.object({kind:d.nativeEnum(MM),reason:Zn.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),Wl=d.array(d.string().url().max(2048).regex(/^https?:\/\//i)).max(50),LM=d.object({case:Zn.describe("a covers id \u2014 the recommend case this test realizes"),status:d.nativeEnum(pr),runtimeTargets:Wl.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),fromJourney:d.boolean().optional(),testProblem:pg.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault")}),OM=d.object({exit:d.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:d.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:d.array(LM).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),jM=d.object({from:d.string().optional().describe("staged path \u2014 required for placements"),file:Zn.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:Zn.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:d.nativeEnum(Is),covers:d.array(d.string()).optional().describe("recommend ids a placed test covers"),repro:d.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:d.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:d.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:Zn.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:Zn.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:OM,assertionCount:d.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:d.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),GM=(n=>(n.Junit="junit",n.Converter="converter",n))(GM||{}),Ste=Zn.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),Qte=d.object({results:Zn.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:d.nativeEnum(GM),run:Zn.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:d.array(Zn).min(1).describe("the items[].file paths this run covered"),cases:d.array(d.object({test:Zn.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:Zn.describe("the covers id it realizes"),file:Ste})).describe("map each reported test name to the case it covers")}),Rte=d.object({suites:d.array(Qte).min(1)}),kv=d.object({schemaVersion:d.literal(1),items:d.array(jM),runnerResults:Rte.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:d.array(d.string()).describe("existing tests assessed and deliberately left untouched"),summary:Zn.describe("one paragraph")});Ac();Av();function VM(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}o(VM,"credentialKeyFromRole");var Po=(s=>(s.NotFound="not_found",s.NoAccess="no_access",s.Unavailable="unavailable",s.AccessLost="access_lost",s.CannotOpen="cannot_open",s))(Po||{});var Sv=o(e=>`${e.source}:${e.site??""}:${e.key}`,"requirementItemId");var Zl=/^pasted-[0-9a-f]{16}$/,Cs=/^file-[0-9a-f]{16}$/,Kl=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(Kl||{}),Xl=o(e=>e.trim().toUpperCase(),"normalKey"),zM=o((e,t)=>{let n=e.trim();return Zl.test(n.toLowerCase())?"Pasted text":Cs.test(n.toLowerCase())?t?.get(Xl(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()},"itemName");var fg=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(fg||{}),_i=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(_i||{}),wc=(I=>(I.RelatedChangeConflict="related_change_conflict",I.ReferenceOutsideTarget="reference_outside_target",I.SourceAccessLost="source_access_lost",I.ConfigurationIncomplete="configuration_incomplete",I.CredentialUnavailable="credential_unavailable",I.WorkflowBindingUnverified="workflow_binding_unverified",I.WorkflowRefUnprotected="workflow_ref_unprotected",I.BedrockWorkflowRequired="bedrock_workflow_required",I.DeploymentReview="deployment_review",I.SutRevisionMismatch="sut_revision_mismatch",I.IsolationUnavailable="isolation_unavailable",I.EvidenceInsufficient="evidence_insufficient",I.ConfigurationUnresolved="configuration_unresolved",I.ModelProviderDenied="model_provider_denied",I.ModelProviderUnavailable="model_provider_unavailable",I.RunnerProviderNotReady="runner_provider_not_ready",I.MergeConflict="merge_conflict",I))(wc||{}),vs=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(vs||{}),ed=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(ed||{}),td=(c=>(c.AuthToken="auth_token",c.Secret="secret",c.DataConnection="data_connection",c.AppNotStarted="app_not_started",c.Login="login",c.ExternalDependency="external_dependency",c.RecordingReplay="recording_replay",c))(td||{});var gg=(n=>(n.Probe="probe",n.Agent="agent",n))(gg||{}),hg=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(hg||{}),mg=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(mg||{});var qM=Se(require("path"));var Lt=d.string().trim().min(1),yg=Lt,Qv=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(Qv||{}),Rv=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],JM=d.object({schemaVersion:d.literal(1),type:d.nativeEnum(Qv).optional(),repository:yg.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:d.enum(["ready","blocked"]),environment:bc.optional(),components:d.array(d.object({name:Lt,repository:Lt.describe(`owner/repo, or "${ni}" for a customer-deployed component no repository builds`),healthy:d.boolean(),url:d.string().min(1).nullable(),...Cv,credentials:d.array(d.string().regex(ti)).max(50).optional(),deployed:Lt.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:d.array(d.object({framework:Lt,file:Lt,result:d.enum(["pass","fail","error"])}).strict()),inputsUsed:d.array(Lt),inputsUsedHow:d.array(d.object({input:Lt,how:Lt}).strict()).optional(),inputsNotUsed:d.array(d.object({input:Lt,reason:Lt}).strict()),blockers:d.array(d.object({component:Lt,problem:Lt,evidence:Lt,fix:Lt}).strict()),replay:d.object({outcome:Lt,durationSeconds:d.number().nonnegative().nullable()}).strict().nullable(),files:d.array(d.object({path:Lt,content:d.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,s)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:d.ZodIssueCode.custom,path:["inputsUsedHow",s,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,s)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:d.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,s)=>{r.components.forEach((a,c)=>{i.has(a)||t.addIssue({code:d.ZodIssueCode.custom,path:["environment","revisionSources",s,"components",c],message:"not one of components"})})}),e.components.forEach((r,s)=>{r.deployed!==void 0!==n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===ni&&!n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"repository"],message:`only a customer_deployed component is ${ni}`})}),n&&(e.components.forEach((r,s)=>{e.components.findIndex(a=>a.name===r.name)!==s&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:d.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,s)=>{Rv.includes(r.path)&&t.addIssue({code:d.ZodIssueCode.custom,path:["files",s,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(s=>s.components));e.components.forEach((s,a)=>{s.repository!==ni&&!r.has(s.name)&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",a,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var fCe=["clean","recipe-drift"];function nd(e){let t=qM.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}o(nd,"isRuntimePlanFile");var Lo=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(Lo||{}),wg=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(wg||{}),Bg=(a=>(a.PullRequest="pull_request",a.ReadyForReview="ready_for_review",a.Schedule="schedule",a.Manual="manual",a.SutSetup="sut_setup",a.RevisionRead="revision_read",a))(Bg||{}),xte=["sut_setup"],$te=["sut_setup","schedule","revision_read"],Tte=["sut_setup"],Tv=(t=>(t.PullRequest="pull_request",t))(Tv||{}),Dv=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(Dv||{}),HM=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var kg=(r=>(r.None="none",r.Delivered="delivered",r.Partial="partial",r.Failed="failed",r))(kg||{}),sd=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(sd||{}),lL=(n=>(n.Running="running",n.Ended="ended",n))(lL||{}),od=(p=>(p.TimedOut="timed_out",p.AgentFailed="agent_failed",p.SetupFailed="setup_failed",p.CredentialMissing="credential_missing",p.RunnerLost="runner_lost",p.CheckoutFailed="checkout_failed",p.EnvironmentUnverified="environment_unverified",p.ModelProviderDenied="model_provider_denied",p.ModelProviderUnavailable="model_provider_unavailable",p.RunnerProviderNotReady="runner_provider_not_ready",p.MergeConflict="merge_conflict",p))(od||{}),dL=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(dL||{}),_v=(n=>(n.Started="started",n.Finished="finished",n))(_v||{}),AL=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(AL||{});var pL=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(pL||{});var fL=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(fL||{}),Nv=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(Nv||{}),xv=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(xv||{});var Uv=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(Uv||{}),fr=d.string().regex(/^[1-9][0-9]{0,18}$/),Dr=d.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),kc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,tn=d.string().regex(kc),dn=d.string().regex(/^[0-9a-f]{64}$/),vg=d.object({id:tn,revision:fr}).strict(),Sg={provider:d.literal("github"),providerAccountId:fr,providerRepositoryId:fr},Qg={provider:d.literal("azure-devops"),providerAccountId:tn,providerRepositoryId:tn},_r=d.discriminatedUnion("provider",[d.object(Sg).strict(),d.object(Qg).strict()]),Fv=d.discriminatedUnion("provider",[d.object(Sg).passthrough(),d.object(Qg).passthrough()]),si=o(e=>`${e.provider}:${e.providerRepositoryId}`,"sourceKey"),YM={namespace:d.string().min(1),name:d.string().min(1)},gL=d.discriminatedUnion("provider",[d.object({...Sg,...YM}).strict(),d.object({...Qg,...YM}).strict()]),WM=d.object({ref:d.string().min(1),revision:Dr}).strict(),Dte=d.object({kind:d.nativeEnum(Dv),number:fr.optional(),ref:d.string().min(1),revision:Dr,reason:d.nativeEnum(wg)}).strict(),_te=d.object({repository:gL,revision:Dr,ref:d.string().nullable(),reason:d.nativeEnum(wg),change:d.object({kind:d.nativeEnum(Tv),number:fr,base:WM.optional()}).strict().nullable(),compareWith:WM.optional(),merge:d.array(Dte).min(2).optional()}).strict();function Nte(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[s,a]of t.entries()){if(a.kind==="pull_request"!=(a.number!==void 0))return{path:["merge",s,"number"],message:"a pull request names its number, and a branch none"};if(!HM.includes(a.reason))return{path:["merge",s,"reason"],message:`${a.reason} does not select a merged revision`};if(a.kind==="branch"&&a.reason!=="MANUAL_OVERRIDE")return{path:["merge",s,"reason"],message:"only a person chooses a branch to merge"};if(a.ref===e.ref)return{path:["merge",s,"ref"],message:"the baseline branch is what the source merges onto"};if(a.number!==void 0&&n.has(a.number)||i.has(a.ref))return{path:["merge",s],message:"names a revision the source already merges"};a.number!==void 0&&n.add(a.number),i.add(a.ref)}let r=HM.find(s=>t.some(a=>a.reason===s));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}o(Nte,"mergedSourceIssue");function Ute(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(l=>l!=null).length>1)return"a run compares with one baseline";let s=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return s?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let a=new Set(e.sources.map(l=>si(l.repository))),c=new Set(r.map(l=>si(l.repository)));return c.size===r.length&&c.size===a.size&&[...c].every(l=>a.has(l))?null:"names every source of the snapshot, once"}o(Ute,"baselineSourcesIssue");var hL=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,mL=/^[1-9][0-9]{0,18}$/,ZM=new RegExp(`${hL.source}|${mL.source}`),KM=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,Fte=d.union([d.object({source:d.literal("jira"),site:d.string().regex(KM),key:d.string().regex(hL),updated:d.string().datetime(),contentHash:dn}).strict(),d.object({source:d.literal("confluence"),site:d.string().regex(KM),key:d.string().regex(mL),version:d.number().int().positive(),contentHash:dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Zl),contentHash:dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Cs),contentHash:dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(Kl)}).strict()]),XM=d.union([d.literal("jira"),d.literal("confluence")]),Pte=d.object({schemaVersion:d.literal(1),items:d.array(d.union([d.object({source:XM,site:d.string(),key:d.string().regex(ZM),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:XM,site:d.string(),key:d.string().regex(ZM),state:d.literal("not_read"),reason:d.nativeEnum(Po)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Zl),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Zl),state:d.literal("not_read"),reason:d.nativeEnum(Po)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Cs),state:d.literal("read"),version:dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(Kl)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Cs),state:d.literal("not_read"),reason:d.nativeEnum(Po)}).strict()])),instructions:d.array(d.string()).optional()}).strict(),Mte=d.object({resultId:d.string().min(1),repository:d.string().min(1),testType:d.string().min(1),path:d.string(),finding:d.string().min(1)}).strict(),Lte=d.object({schemaVersion:d.literal(1),runId:tn,skyrampOrgId:tn,target:vg,policy:vg.nullable(),trigger:d.object({kind:d.nativeEnum(Bg),requestedAt:d.string().datetime()}).strict(),configuration:d.object({captureId:tn,revision:fr.nullable(),hash:dn}).strict(),baseline:d.object({confirmedRunId:tn.nullable(),initialBaselineId:tn.optional(),comparisonBaselineId:tn.optional(),knownFailures:d.array(Mte).optional(),sources:d.array(d.object({repository:_r,revision:Dr}).strict()).optional()}).strict().optional(),sources:d.array(_te).min(1).max(1e3),execution:d.object({provider:d.nativeEnum(Lo),repository:gL,workflowPath:d.string(),ref:d.string()}).strict(),credentials:d.array(d.object({name:d.string(),purpose:d.nativeEnum(Ev),required:d.boolean()}).strict()),requirements:d.array(Fte).min(1).optional(),instructions:d.object({contentHash:dn}).strict().optional(),deployedRevisions:d.array(d.object({repository:_r,revision:Dr}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((u,l)=>{let A="fileName"in u?"file":"pasted";u.source==="other"&&u.key!==`${A}-${u.contentHash.slice(0,16)}`&&t.addIssue({code:d.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",l,"key"]});let p=Sv({source:u.source,key:u.key});n.has(p)&&t.addIssue({code:d.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",l,"key"]}),n.add(p)});let i=e.trigger.kind,r=xte.includes(i);r!==(e.policy===null)&&t.addIssue({code:d.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:d.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let s=Ute(e);s&&t.addIssue({code:d.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),$te.includes(i)&&e.sources.forEach((u,l)=>{u.reason!=="BASELINE"&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let a=new Set(e.sources.map(u=>si(u.repository))),c=new Set;(e.deployedRevisions??[]).forEach((u,l)=>{let A=si(u.repository);a.has(A)?c.has(A)&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"repository appears twice"}):t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"names a repository outside the snapshot"}),c.add(A)}),e.sources.forEach((u,l)=>{u.compareWith&&(u.reason!=="MANUAL_OVERRIDE"||u.change)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(u.change?.base||u.compareWith||u.merge)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let A=Nte(u);A&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,...A.path],message:A.message})})});var Pv=(n=>(n.Person="person",n.Policy="policy",n))(Pv||{}),Ote=d.object({kind:d.nativeEnum(Pv),name:d.string().min(1).max(256)}).strict(),jte=d.object({mcp:d.discriminatedUnion("source",[d.object({source:d.literal("npm"),version:d.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),d.object({source:d.literal("github"),ref:d.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:d.object({region:d.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:d.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),Gte=d.object({schemaVersion:d.literal(1),attempt:d.object({id:tn,number:d.number().int().positive(),deadlineAt:d.string().datetime()}).strict(),manifest:Lte,manifestHash:dn,entitlements:d.array(d.string()).optional(),runToken:d.string().min(1).optional(),requestedBy:Ote.nullable().optional(),writeAllowed:d.boolean().optional(),claudeCodeVersion:d.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:d.array(d.object({repository:_r,revision:Dr}).strict()).optional(),statedRevisions:d.array(d.object({repository:_r,revision:Dr}).strict()).optional(),runSettings:jte.optional()}).strict(),eL={providerRunAttempt:d.number().int().positive(),workflowRef:d.string().min(1)},Vte=d.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),zte=d.object({schemaVersion:d.literal(1),runId:tn,execution:d.discriminatedUnion("provider",[d.object({...eL,provider:d.literal("github"),repository:d.object(Sg).strict(),providerRunId:fr}).strict(),d.object({...eL,provider:d.literal("azure-devops"),repository:d.object(Qg).strict(),providerRunId:Vte}).strict()]),requester:d.literal(!0).optional(),writeCheck:d.literal(!0).optional(),claudeCodePin:d.literal(!0).optional(),deployedPins:d.literal(!0).optional(),statedPins:d.literal(!0).optional(),runSettings:d.literal(!0).optional()}).strict(),tL=d.object({repository:_r,number:fr,commitSha:Dr.optional()}).strict(),Eg=d.array(d.object({repository:_r,reason:d.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),qte=d.discriminatedUnion("status",[d.object({status:d.literal("none"),noTests:Eg}).strict(),d.object({status:d.literal("delivered"),noTests:Eg,pullRequests:d.array(tL).min(1)}).strict(),d.object({status:d.literal("partial"),noTests:Eg,pullRequests:d.array(tL).min(1),failures:d.array(d.object({repository:_r,message:d.string()}).strict()).min(1)}).strict(),d.object({status:d.literal("failed"),message:d.string(),noTests:Eg}).strict()]),Rg=1024*1024,yL=16*1024*1024,Ig=o(e=>d.array(d.object({[e]:d.string()}).strict()).optional(),"texts"),Jte=d.object({language:d.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:d.string(),validation:d.object({rationale:d.string(),gaps:d.array(d.string())}).strict().optional(),changes:d.array(d.object({id:d.string(),text:d.string()}).strict()).optional(),issuesFound:Ig("description"),newTestsCreated:Ig("description"),testResults:Ig("details"),caveats:Ig("text")}).strict(),Hte=d.object({blockedPreflight:d.object({file:d.string().min(1),repository:d.string().min(1).optional(),reason:d.string().min(1).max(300),evidence:d.string().min(1).max(400)}).strict().optional(),sufficiency:d.nativeEnum(_i),rationale:d.string().min(1),gaps:d.array(d.string().min(1)),acceptedEvidence:d.array(d.object({kind:d.nativeEnum(vs),repository:d.string().min(1),revision:Dr,reference:d.string().min(1),summary:d.string().min(1)}).strict()),actionRequired:d.array(d.nativeEnum(wc))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:d.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),Cg=500,EL=2048,IL=1e3,Yte=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,nL=o(e=>e.length>0&&e.length<=64&&e===e.trim()&&!Yte.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),"isAzureName"),CL=o(e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&nL(n)&&nL(i)},"isResultRepository"),Wte=d.object({testResults:d.array(d.object({resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:d.string().refine(CL,"Invalid"),testType:d.string(),runtimeTargets:Wl.optional(),endpoint:d.string(),status:d.enum(["Pass","Fail","Skipped"]),details:d.string(),fileName:d.string().optional(),testId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:d.object({kind:d.nativeEnum(ed),family:d.nativeEnum(td).optional()}).strict().optional(),origin:d.nativeEnum(fg).optional()}).strict()),validation:Hte,changes:d.array(d.object({id:d.string().min(1).max(512),text:d.string().max(16384),source:d.string().max(EL),testedBy:d.array(d.string().min(1).max(1024)).max(Cg),writtenBy:d.array(d.string().min(1).max(1024)).max(Cg),maintainedBy:d.array(d.string().min(1).max(1024)).max(Cg)}).strict()).max(IL).optional(),traceVersion:d.literal(1),display:Jte.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let s of["issuesFound","newTestsCreated","testResults","caveats"]){let a=n?.[s];a&&a.length!==(Array.isArray(i[s])?i[s].length:0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["display",s],message:`has not one row per ${s} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((s,a)=>{let c=s.failureCause;c&&s.status==="Pass"&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"a passing result has no failure cause"}),c&&c.kind==="environment"!=(c.family!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"an environment cause names its family, and no other cause does"});let u=["testResults",a,"resultId"],l=s.resultId.slice(`${s.repository}:${s.testType}:`.length);(!s.resultId.startsWith(`${s.repository}:${s.testType}:`)||l===""||l.startsWith("/")||l.startsWith("#"))&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"is not repository:testType:path for this result"}),r.has(s.resultId)&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"stable identity repeated"}),r.add(s.resultId)})}),rL=o(e=>e.replace(/[%:#]/g,t=>encodeURIComponent(t)),"encodeIdPart");function Mv(e,t,n,i){let r=n.replace(/\\/g,"/"),s=r.split("/").filter(u=>u!==""&&u!==".");if(r.startsWith("/")||/^[A-Za-z]:/.test(r)||s.length===0||s.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${n}"`);let a=s.join("/"),c=`${e}:${t}:${rL(a)}`;return i?`${c}#${rL(i)}`:c}o(Mv,"testResultId");var xg=(i=>(i.BranchPushed="branch_pushed",i.PullRequestOpened="pull_request_opened",i.PullRequestEdited="pull_request_edited",i))(xg||{}),vL=50,iL=d.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),bL=d.discriminatedUnion("kind",[d.object({kind:d.literal("branch_pushed"),repository:_r,branch:iL,commit:Dr}).strict(),d.object({kind:d.enum(["pull_request_opened","pull_request_edited"]),repository:_r,number:fr,branch:iL}).strict()]),wL=d.object({schemaVersion:d.literal(1),run:d.object({runId:tn,attemptNumber:d.number().int().positive(),manifestHash:dn}).strict(),target:vg,policy:vg,provenance:d.object({sources:d.array(d.object({repository:_r,revision:Dr}).strict()),firstQualification:d.literal(!0).optional()}).strict(),delivery:d.object({generatedTests:qte}).strict(),producer:d.object({testbot:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:Wte,githubWrites:d.array(bL).max(vL).optional()}).strict(),Lv=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(Lv||{}),Ov=200,Zte=d.object({cause:d.nativeEnum(Lv),credential:d.string().regex(ti).optional(),reason:d.string().trim().min(1).max(Ov).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),Kte=d.object({name:d.string().regex(ti),purpose:d.enum(["sut_access","other"]),required:d.boolean(),how:d.string().trim().min(1).max(Ag)}).strict(),wCe=wL.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:JM,check:Zte.optional(),inputs:d.array(Kte).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=o((s,a)=>t.addIssue({code:d.ZodIssueCode.custom,path:["recipe",...s],message:a}),"issue");e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((s,a)=>{nd(s.path)||n(["files",a,"path"],"is not .skyramp/workspace.yml or a file under .skyramp/sut/"),i.has(s.path)&&n(["files",a,"path"],"file repeated"),i.add(s.path),FM.test(s.content)&&n(["files",a,"content"],"is not text");let c=Buffer.byteLength(s.content,"utf8");r+=c,c>bv&&n(["files",a,"content"],`larger than ${bv} bytes`)}),r>wv&&n(["files"],`recipe text over ${wv} bytes in total`)}),BCe=d.object({components:d.array(d.object({name:d.string().min(1),repository:d.string().refine(CL,"Invalid"),observedRevision:d.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:d.nativeEnum(gg),evidence:d.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();function BL(e){return e.trigger.kind==="schedule"||e.trigger.kind==="manual"&&e.sources.every(t=>t.reason==="BASELINE")}o(BL,"readsDeployedState");var Xte=d.object({schemaVersion:d.literal(1),stage:d.nativeEnum(dL),event:d.nativeEnum(_v),status:d.nativeEnum(AL).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),$g=100,ene=5e3,Mo=2e3,sL=100,kL=/^[A-Za-z0-9_-]{1,64}$/,tne=20,nne=200,rne=100,ine=100,sne=200,oL="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",one=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${oL}/${oL})$`),ane=500,cne=50,une=10,lne=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,SL=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Kn=o(e=>d.string().max(e).refine(t=>t.trim().length>0&&!SL.test(t),"blank, or not text"),"setupText"),ii={sequence:d.number().int().min(1).max(ene),at:d.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},QL=d.object({...ii,kind:d.literal("reply"),to:d.string().uuid(),outcome:d.nativeEnum(fL),accepted:d.boolean(),text:Kn(Mo),note:d.object({source:d.enum(["target","environment"]),quote:Kn(Mo)}).strict().optional(),kept:Kn(Mo).optional()}).strict();function RL(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:d.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}o(RL,"checkReply");var dne=d.discriminatedUnion("kind",[d.object({...ii,kind:d.literal("log"),phase:d.nativeEnum(Nv),text:Kn(Mo)}).strict(),d.object({...ii,kind:d.literal("component"),name:Kn(sL),repository:Kn(sne).refine(e=>one.test(e)||e===ni,"not owner/name"),file:Kn(ane).nullable(),status:d.nativeEnum(Uv),version:Kn(ine).optional()}).strict(),QL,d.object({...ii,kind:d.literal("question"),id:d.string().regex(kL),type:d.nativeEnum(pL),text:Kn(Mo),component:Kn(sL).nullable(),choices:d.array(Kn(nne)).max(tne),placeholder:Kn(rne).optional()}).strict(),d.object({...ii,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max($g)}).strict(),d.object({...ii,kind:d.literal("credentials"),names:d.array(d.string().regex(ti)).min(1).max(cne),logins:d.array(d.object({key:d.string().regex(lne),usernameVariable:d.string().regex(ti),passwordVariable:d.string().regex(ti)}).strict()).min(1).max(une).optional()}).strict()]).superRefine((e,t)=>{if(RL(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>VM(i.key));new Set(n).size!==n.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let s of["usernameVariable","passwordVariable"])e.names.includes(i[s])||t.addIssue({code:d.ZodIssueCode.custom,path:["logins",r,s],message:"not one of the names"})})}e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),Ane=d.object({schemaVersion:d.literal(1),events:d.array(dne).max($g)}).strict(),pne=d.discriminatedUnion("kind",[d.object({...ii,kind:d.literal("log"),stage:d.nativeEnum(xv),text:Kn(Mo)}).strict(),QL,d.object({...ii,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max($g)}).strict(),d.object({...ii,kind:d.literal("stage"),stage:d.nativeEnum(xv),event:d.nativeEnum(_v)}).strict(),d.object({...ii,kind:d.literal("test"),resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:d.enum(["Pass","Fail","Skipped"]),details:d.string().max(Mo).refine(e=>!SL.test(e),"not text")}).strict()]).superRefine(RL),fne=d.object({schemaVersion:d.literal(1),events:d.array(pne).max($g)}).strict(),aL={id:d.string().uuid(),text:d.string(),by:d.string().nullable(),at:d.string(),replied:d.literal(!0).optional()},xL=d.discriminatedUnion("kind",[d.object({...aL,kind:d.literal("instruction"),question:d.null()}),d.object({...aL,kind:d.literal("answer"),question:d.string().regex(kL)})]),$L=d.string().regex(/^[A-Za-z0-9+/]{43}=$/),gne=d.object({id:d.string().uuid(),revision:d.string(),by:d.string().nullable(),at:d.string(),target:d.string(),own:d.object({source:d.enum(["policy","test_environment"]),text:d.string()}).nullable()}),hne=d.object({schemaVersion:d.literal(1),leftOut:d.array(d.string()),messages:d.array(xL).optional(),stop:d.object({key:$L}).optional(),notes:gne.optional()}),mne=d.object({schemaVersion:d.literal(1),messages:d.array(xL).optional()});var yne=500*1024*1024,TL=d.object({id:fr,name:d.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:fr,expiresAt:d.string().datetime()}).strict(),Ene=d.object({schemaVersion:d.literal(1),artifact:TL,sessionId:tn,contentHash:dn,bytes:d.number().int().min(1).max(yne)}).strict(),Ine=d.object({schemaVersion:d.literal(1),checkpoint:d.object({artifact:TL,repository:d.object({namespace:d.string().min(1),name:d.string().min(1)}).strict(),sessionId:tn,contentHash:dn,key:$L}).strict().nullable()}).strict(),Cne=200,Bc=100,DL=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(DL||{}),vne=d.object({kind:d.nativeEnum(DL),setup:d.object({runId:tn,endedAt:d.string().nullable(),outcome:d.string().nullable()}).strict(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1),status:d.nativeEnum(Uv)}).strict()).max(Bc),credentials:d.array(d.string().min(1)).max(Bc),answers:d.array(d.object({question:d.string(),answer:d.string().nullable()}).strict()).max(Bc),instructions:d.array(d.object({text:d.string(),reply:d.string().nullable()}).strict()).max(Bc),log:d.array(d.object({phase:d.nativeEnum(Nv),text:d.string()}).strict()).max(Cne),recipe:d.object({files:d.array(d.object({path:d.string().min(1),content:d.string()}).strict()).max(Bc),blockers:d.array(d.object({component:d.string(),problem:d.string(),evidence:d.string(),fix:d.string()}).strict()).max(Bc)}).strict().optional()}).strict(),bne=d.object({schemaVersion:d.literal(1),context:vne.nullable()}).strict(),wne=d.object({schemaVersion:d.literal(1),configuration:d.object({captureId:tn,revision:fr.nullable(),hash:dn}).strict(),capture:d.object({schemaVersion:d.literal(1),settings:d.object({target:d.object({environment:d.unknown()}).passthrough(),timeoutMinutes:d.number().int().positive(),answerWaitMinutes:d.number().int().positive().optional(),testEnvironment:d.object({name:d.string().min(1),address:d.string().min(1).optional(),readyWhen:d.string().min(1).optional()}).passthrough().optional()}).passthrough(),provenance:d.object({}).passthrough(),hash:dn}).strict()}).strict(),Bne=bc.extend({version:d.number().int().positive(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1)}).strict()),contentHash:dn.optional(),files:d.array(d.object({path:d.string().refine(e=>nd(e)&&!Rv.includes(e),"not a file of a customer_deployed plan"),content:d.string()}).strict()).optional()}).strict(),kne=d.object({schemaVersion:d.literal(1),testEnvironment:Bne.nullable().optional(),runtimePlan:d.object({version:d.number().int().positive(),contentHash:dn,files:d.array(d.object({path:d.string().refine(nd,"not a recipe file path"),content:d.string()}).strict()).min(1),repository:yg.optional(),recipeRepository:yg.optional(),recipe:d.record(d.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),_L=d.object({schemaVersion:d.literal(1),state:d.nativeEnum(lL),ending:d.nativeEnum(sd).nullable(),cause:d.nativeEnum(od).nullable(),deadlineAt:d.string().datetime()}).strict();function NL(e,t){return e.state==="ended"?e.ending==="cancelled"?"cancelled":e.cause==="runner_lost"?"expired":"ended":t.getTime()>=Date.parse(e.deadlineAt)?"expired":null}o(NL,"attemptClosure");var UL=50,kCe=d.object({repository:_r,revisions:d.array(d.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:d.array(d.string().min(1)).min(1).max(UL)}).strict();function $v(e){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(e))return`[${e.map($v).join(",")}]`;if(e!==null&&typeof e=="object"){let n=e;return`{${Object.keys(n).sort().map(i=>`${JSON.stringify(i)}:${$v(n[i])}`).join(",")}}`}let t=JSON.stringify(e);if(t===void 0)throw new TypeError("Canonical JSON requires JSON values");return t}o($v,"canonicalJson");function FL(e){return(0,uL.createHash)("sha256").update($v(e),"utf8").digest("hex")}o(FL,"manifestHash");var rd=o(e=>({provider:e.provider,providerAccountId:e.providerAccountId,providerRepositoryId:e.providerRepositoryId}),"toSourceRef");function jv(e,t,{statedPins:n=!0}={}){return zte.parse({schemaVersion:1,runId:e,execution:t.execution(),requester:!0,writeCheck:!0,claudeCodePin:!0,deployedPins:!0,...n?{statedPins:!0}:{},...t.runSettingsFromApp?{runSettings:!0}:{}})}o(jv,"handshakeRequest");function PL(e){let t=Gte.parse(e);if(FL(t.manifest)!==t.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return t}o(PL,"parseHandshakeResponse");function Sne(e){let t=o(i=>i.map(r=>({repository:rd(r.repository),number:r.number,...r.commitSha===void 0?{}:{commitSha:r.commitSha}})),"pullRequests"),n=e.noTests?{noTests:e.noTests.map(i=>({repository:rd(i.repository),reason:i.reason}))}:{};return e.status==="delivered"?{status:e.status,...n,pullRequests:t(e.pullRequests)}:e.status==="partial"?{status:e.status,...n,pullRequests:t(e.pullRequests),failures:e.failures.map(i=>({repository:rd(i.repository),message:i.message}))}:{...e,...n}}o(Sne,"toDelivery");function Qne(e){return e.issues.map(t=>`${t.path.map((i,r)=>typeof i=="number"?`[${i}]`:r===0?i:`.${i}`).join("")}: ${t.message}`).join("; ")}o(Qne,"describeIssues");function ML(e){let{manifest:t}=e;if(Tte.includes(t.trigger.kind))throw new Error(`The report upload is invalid: a ${t.trigger.kind} run uploads its SUT recipe, never a report`);if(t.trigger.kind==="revision_read")throw new Error("The report upload is invalid: a revision_read run uploads what each component runs, never a report");if(e.firstQualification&&!t.baseline?.sources)throw new Error("The report upload is invalid: only a run whose manifest names baseline sources can be a first qualification");let n=wL.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e.attemptNumber,manifestHash:FL(t)},target:{id:t.target.id,revision:t.target.revision},policy:t.policy&&{id:t.policy.id,revision:t.policy.revision},provenance:{sources:e.checkedOut.map(i=>({repository:rd(i.repository),revision:i.revision})),...e.firstQualification?{firstQualification:!0}:{}},delivery:{generatedTests:Sne(e.generatedTests)},producer:e.producer,report:e.report,...e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:rd(i.repository)}))}:{}});if(!n.success)throw new Error(`The report upload is invalid: ${Qne(n.error)}`);return Rne(n.data,t,e.checkedOut),n.data}o(ML,"buildReportUpload");function Rne(e,t,n){let i=o(s=>n.find(a=>si(a.repository)===si(s.repository))?.revision??s.revision,"revisionOf"),r=new Map(t.sources.map(s=>[`${s.repository.namespace}/${s.repository.name}`.toLowerCase(),i(s)]));e.report.validation.acceptedEvidence.forEach((s,a)=>{let c=`report.validation.acceptedEvidence[${a}]`,u=r.get(s.repository.toLowerCase());if(!u)throw new Error(`${c}.repository: ${s.repository} is outside the run's snapshot`);if(s.revision!==u)throw new Error(`${c}.revision: evidence is not from the checked-out revision ${u}`)})}o(Rne,"assertEvidenceFromSnapshot");function LL(e){return e.reportUploaded?{schemaVersion:1,reason:"report_uploaded",cause:null}:e.recipeUploaded?{schemaVersion:1,reason:"recipe_uploaded",cause:null}:e.revisionsUploaded?{schemaVersion:1,reason:"revisions_uploaded",cause:null}:e.cancelled?{schemaVersion:1,reason:"cancelled",cause:null}:e.mergeConflict&&cL(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict}:{schemaVersion:1,reason:"no_report",cause:cL({...e,mergeConflict:void 0})}}o(LL,"attemptEndFor");function cL(e){return e.runnerProviderNotReady?"runner_provider_not_ready":e.credentialMissing?"credential_missing":e.mergeConflict?"merge_conflict":e.checkoutFailed?"checkout_failed":e.environmentUnverified?"environment_unverified":e.setupFailed?"setup_failed":e.timedOut?"timed_out":e.modelProviderDenied?"model_provider_denied":e.modelProviderUnavailable?"model_provider_unavailable":"agent_failed"}o(cL,"noReportCause");var DCe=["clean","recipe-drift"];var bs=Se(require("path"));var FCe={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var Gv=o(e=>new Map((e??[]).flatMap(t=>t.file?[[Xl(t.key),t.file.name]]:[])),"itemNames"),$ne=10*1024*1024,Tne=o(e=>e?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","needsExtraction"),jL=o((e,t)=>bs.join(bs.dirname(e),`${bs.basename(e,bs.extname(e))}${t}`),"besideFile"),Dne=o(e=>jL(e,".extracted.txt"),"extractedTextPath");var _ne=o(e=>jL(e,".quotes.txt"),"confirmedQuotesPath");function GL(e){return Tne(e.file)?Dne(e.path):e.file?.mediaType==="application/pdf"?_ne(e.path):e.path}o(GL,"itemTextPath");var Ni=d.string().trim().min(1),Ui=72,Nne=d.object({repository:Ni.optional().describe("owner/repo of the checkout this lint ran in, when the run has several; omit for the working checkout"),tool:d.string(),command:d.string().describe("the exact command you ran, scoped to the changed files"),clean:d.boolean(),fixed:d.array(d.string()).optional().describe("files you fixed"),uncovered:d.array(d.string()).describe("changed/new files this linter's own config does not match (wrong extension, wrong directory) \u2014 so `clean` never examined them, even though CI may still execute them. Empty array, not omitted, when every changed/new file IS covered.")}),Vv=d.object({schemaVersion:d.literal(1),lint:d.array(Nne).min(1).describe("one entry per checkout this run wrote tests in, each run from that checkout"),fileConventions:d.object({ok:d.boolean(),notes:d.string().optional()}),ciReadiness:d.object({covered:d.boolean().describe("will the repo's CI run these tests?"),notes:d.string().optional()}),dependencies:d.object({added:d.array(d.object({package:d.string(),manifest:d.string(),repository:Ni.optional().describe("owner/repo of the manifest's checkout; omit for the working checkout"),reason:Ni.optional().describe("why the test must run inside the application's own test environment, so its manifest had to change \u2014 required for every entry")})).describe("every package added to an APPLICATION manifest (an exception, surfaced in the report); never the Testbot test package's own")}),support:d.array(d.object({file:Ni,repository:Ni.optional().describe("owner/repo of the file's checkout; omit for the working checkout")})).optional().describe("the files the tests need besides themselves (helper modules, page objects, fixtures, snapshots), delivered with them"),commit:d.object({message:Ni.refine(e=>e.split(`
|
|
56
|
+
`).map(a=>a.trim()).filter(Boolean),i=n.filter(a=>!t.test(a)),r=i.length?i:n;return[...r].reverse().find(a=>/(error|warning|problem|✖|✗|✘|fail|not listed|cannot|denied)/i.test(a))??r[r.length-1]??"(no output)"}o(aee,"hookSummary");function BM(e){if(!/\bhook\b|husky|pre-commit|lint-staged/i.test(e))return;let t=aee(e),n=ae().staged.commitHook(/husky\s*[->]\s*([\w-]+)\s+(?:script|hook)\b/i.exec(zl(e))?.[1]);return/\(code 127\)|exit code 127/i.test(e)||/command not found|: not found$/i.test(t)?ae().staged.commitHookCouldNotRun(n,t):ae().staged.commitRefusedByHook(n,t)}o(BM,"hookRefusal");var Ri=["-c","core.fsmonitor=false"],cee=new Set(["GH_TOKEN","GITHUB_TOKEN","GH_ENTERPRISE_TOKEN","GITHUB_ENTERPRISE_TOKEN","ACTIONS_RUNTIME_TOKEN","ACTIONS_ID_TOKEN_REQUEST_TOKEN","ACTIONS_ID_TOKEN_REQUEST_URL","SYSTEM_ACCESSTOKEN","SYSTEM_OIDCREQUESTURI","SKYRAMP_MCP_GITHUB_TOKEN","SSH_AUTH_SOCK","GIT_SSH","GIT_SSH_COMMAND","GITHUB_STEP_SUMMARY"]),gv=new Set(["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","AWS_BEARER_TOKEN_BEDROCK","AWS_PROFILE","AWS_WEB_IDENTITY_TOKEN_FILE","AWS_ROLE_ARN","AWS_ROLE_SESSION_NAME","AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"]);function Xt(e=process.env,t,n="repo-command"){let i={};for(let[r,s]of Object.entries(e))n==="repo-command"&&gv.has(r)||(i[r]=s);Object.assign(i,t??{});for(let r of Object.keys(i))(cee.has(r)||r.startsWith("INPUT_"))&&delete i[r];return i}o(Xt,"untrustedChildEnv");var d={};Cr(d,{BRAND:()=>_ee,DIRTY:()=>vo,EMPTY_PATH:()=>Aee,INVALID:()=>me,NEVER:()=>yte,OK:()=>en,ParseStatus:()=>Mt,Schema:()=>De,ZodAny:()=>ys,ZodArray:()=>Di,ZodBigInt:()=>wo,ZodBoolean:()=>Bo,ZodBranded:()=>Jl,ZodCatch:()=>Uo,ZodDate:()=>ko,ZodDefault:()=>No,ZodDiscriminatedUnion:()=>ug,ZodEffects:()=>Ar,ZodEnum:()=>Do,ZodError:()=>Qn,ZodFirstPartyTypeKind:()=>ve,ZodFunction:()=>dg,ZodIntersection:()=>xo,ZodIssueCode:()=>j,ZodLazy:()=>$o,ZodLiteral:()=>To,ZodMap:()=>Ec,ZodNaN:()=>Cc,ZodNativeEnum:()=>_o,ZodNever:()=>$r,ZodNull:()=>Qo,ZodNullable:()=>ei,ZodNumber:()=>bo,ZodObject:()=>Rn,ZodOptional:()=>lr,ZodParsedType:()=>te,ZodPipeline:()=>Hl,ZodPromise:()=>Es,ZodReadonly:()=>Fo,ZodRecord:()=>lg,ZodSchema:()=>De,ZodSet:()=>Ic,ZodString:()=>ms,ZodSymbol:()=>mc,ZodTransformer:()=>Ar,ZodTuple:()=>Xr,ZodType:()=>De,ZodUndefined:()=>So,ZodUnion:()=>Ro,ZodUnknown:()=>Ti,ZodVoid:()=>yc,addIssueToContext:()=>Z,any:()=>Gee,array:()=>Jee,bigint:()=>Pee,boolean:()=>UM,coerce:()=>mte,custom:()=>DM,date:()=>Mee,datetimeRegex:()=>$M,defaultErrorMap:()=>xi,discriminatedUnion:()=>Zee,effect:()=>ute,enum:()=>ote,function:()=>rte,getErrorMap:()=>fc,getParsedType:()=>Kr,instanceof:()=>Uee,intersection:()=>Kee,isAborted:()=>ag,isAsync:()=>gc,isDirty:()=>cg,isValid:()=>hs,late:()=>Nee,lazy:()=>ite,literal:()=>ste,makeIssue:()=>ql,map:()=>tte,nan:()=>Fee,nativeEnum:()=>ate,never:()=>zee,null:()=>jee,nullable:()=>dte,number:()=>NM,object:()=>Hee,objectUtil:()=>hv,oboolean:()=>hte,onumber:()=>gte,optional:()=>lte,ostring:()=>fte,pipeline:()=>pte,preprocess:()=>Ate,promise:()=>cte,quotelessJson:()=>uee,record:()=>ete,set:()=>nte,setErrorMap:()=>dee,strictObject:()=>Yee,string:()=>_M,symbol:()=>Lee,transformer:()=>ute,tuple:()=>Xee,undefined:()=>Oee,union:()=>Wee,unknown:()=>Vee,util:()=>Me,void:()=>qee});var Me;(function(e){e.assertEqual=r=>{};function t(r){}o(t,"assertIs"),e.assertIs=t;function n(r){throw new Error}o(n,"assertNever"),e.assertNever=n,e.arrayToEnum=r=>{let s={};for(let a of r)s[a]=a;return s},e.getValidEnumValues=r=>{let s=e.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),a={};for(let c of s)a[c]=r[c];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(s){return r[s]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let s=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&s.push(a);return s},e.find=(r,s)=>{for(let a of r)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}o(i,"joinValues"),e.joinValues=i,e.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Me||(Me={}));var hv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(hv||(hv={}));var te=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kr=o(e=>{switch(typeof e){case"undefined":return te.undefined;case"string":return te.string;case"number":return Number.isNaN(e)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(e)?te.array:e===null?te.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?te.promise:typeof Map<"u"&&e instanceof Map?te.map:typeof Set<"u"&&e instanceof Set?te.set:typeof Date<"u"&&e instanceof Date?te.date:te.object;default:return te.unknown}},"getParsedType");var j=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),uee=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Qn=class e extends Error{static{o(this,"ZodError")}get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(s){return s.message},i={_errors:[]},r=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let c=i,u=0;for(;u<a.path.length;){let l=a.path[u],A=u===a.path.length-1;if(l==="_errors"){A&&c._errors.push(n(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||(l==="__proto__"?Object.defineProperty(c,l,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):c[l]={_errors:[]}),c=c[l],A&&c._errors.push(n(a)),u++}}},"processError");return r(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let s=r.path[0];n[s]=n[s]||[],n[s].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Qn.create=e=>new Qn(e);var lee=o((e,t)=>{let n;switch(e.code){case j.invalid_type:e.received===te.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case j.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Me.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(e.keys,", ")}`;break;case j.invalid_union:n="Invalid input";break;case j.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(e.options)}`;break;case j.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(e.options)}, received '${e.received}'`;break;case j.invalid_arguments:n="Invalid function arguments";break;case j.invalid_return_type:n="Invalid function return type";break;case j.invalid_date:n="Invalid date";break;case j.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Me.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case j.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case j.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case j.custom:n="Invalid input";break;case j.invalid_intersection_types:n="Intersection results could not be merged";break;case j.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case j.not_finite:n="Number must be finite";break;default:n=t.defaultError,Me.assertNever(e)}return{message:n}},"errorMap"),xi=lee;var kM=xi;function dee(e){kM=e}o(dee,"setErrorMap");function fc(){return kM}o(fc,"getErrorMap");var ql=o(e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,s=[...n,...r.path||[]],a={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)c=l(a,{data:t,defaultError:c}).message;return{...r,path:s,message:c}},"makeIssue"),Aee=[];function Z(e,t){let n=fc(),i=ql({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===xi?void 0:xi].filter(r=>!!r)});e.common.issues.push(i)}o(Z,"addIssueToContext");var Mt=class e{static{o(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return me;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let s=await r.key,a=await r.value;i.push({key:s,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:s,value:a}=r;if(s.status==="aborted"||a.status==="aborted")return me;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[s.value]=a.value)}return{status:t.value,value:i}}},me=Object.freeze({status:"aborted"}),vo=o(e=>({status:"dirty",value:e}),"DIRTY"),en=o(e=>({status:"valid",value:e}),"OK"),ag=o(e=>e.status==="aborted","isAborted"),cg=o(e=>e.status==="dirty","isDirty"),hs=o(e=>e.status==="valid","isValid"),gc=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");var oe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(oe||(oe={}));var dr=class{static{o(this,"ParseInputLazyPath")}constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},SM=o((e,t)=>{if(hs(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Qn(e.common.issues);return this._error=n,this._error}}},"handleResult");function Re(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:o((a,c)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},"customMap"),description:r}}o(Re,"processCreateParams");var De=class{static{o(this,"ZodType")}get description(){return this._def.description}_getType(t){return Kr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Kr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Mt,ctx:{common:t.parent.common,data:t.data,parsedType:Kr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(gc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Kr(t)},r=this._parseSync({data:t,path:i.path,parent:i});return SM(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Kr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return hs(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>hs(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Kr(t)},r=this._parse({data:t,path:i.path,parent:i}),s=await(gc(r)?r:Promise.resolve(r));return SM(i,s)}refine(t,n){let i=o(r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n,"getIssueProperties");return this._refinement((r,s)=>{let a=t(r),c=o(()=>s.addIssue({code:j.custom,...i(r)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Ar({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:o(n=>this["~validate"](n),"validate")}}optional(){return lr.create(this,this._def)}nullable(){return ei.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Di.create(this)}promise(){return Es.create(this,this._def)}or(t){return Ro.create([this,t],this._def)}and(t){return xo.create(this,t,this._def)}transform(t){return new Ar({...Re(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new No({...Re(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new Jl({typeName:ve.ZodBranded,type:this,...Re(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Uo({...Re(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Hl.create(this,t)}readonly(){return Fo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},pee=/^c[^\s-]{8,}$/i,fee=/^[0-9a-z]+$/,gee=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hee=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,mee=/^[a-z0-9_-]{21}$/i,yee=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Eee=/^[-+]?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)?)??$/,Iee=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cee="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",mv,vee=/^(?:(?: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])$/,bee=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,wee=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Bee=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kee=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,See=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,RM="((\\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])))",Qee=new RegExp(`^${RM}$`);function xM(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}o(xM,"timeRegexSource");function Ree(e){return new RegExp(`^${xM(e)}$`)}o(Ree,"timeRegex");function $M(e){let t=`${RM}T${xM(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}o($M,"datetimeRegex");function xee(e,t){return!!((t==="v4"||!t)&&vee.test(e)||(t==="v6"||!t)&&wee.test(e))}o(xee,"isValidIP");function $ee(e,t){if(!yee.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}o($ee,"isValidJWT");function Tee(e,t){return!!((t==="v4"||!t)&&bee.test(e)||(t==="v6"||!t)&&Bee.test(e))}o(Tee,"isValidCidr");var ms=class e extends De{static{o(this,"ZodString")}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==te.string){let s=this._getOrReturnCtx(t);return Z(s,{code:j.invalid_type,expected:te.string,received:s.parsedType}),me}let i=new Mt,r;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),Z(r,{code:j.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),Z(r,{code:j.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=t.data.length>s.value,c=t.data.length<s.value;(a||c)&&(r=this._getOrReturnCtx(t,r),a?Z(r,{code:j.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&Z(r,{code:j.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Iee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"email",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")mv||(mv=new RegExp(Cee,"u")),mv.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"emoji",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")hee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"uuid",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")mee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"nanoid",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")pee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"cuid",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")fee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"cuid2",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")gee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"ulid",code:j.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),Z(r,{validation:"url",code:j.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"regex",code:j.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?$M(s).test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?Qee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?Ree(s).test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?Eee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"duration",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?xee(t.data,s.version)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"ip",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?$ee(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"jwt",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?Tee(t.data,s.version)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"cidr",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?kee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"base64",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?See.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"base64url",code:j.invalid_string,message:s.message}),i.dirty()):Me.assertNever(s);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:j.invalid_string,...oe.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...oe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...oe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...oe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...oe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...oe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...oe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...oe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...oe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...oe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...oe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...oe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...oe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...oe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...oe.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...oe.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...oe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...oe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...oe.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...oe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...oe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...oe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...oe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...oe.errToObj(n)})}nonempty(t){return this.min(1,oe.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ms.create=e=>new ms({checks:[],typeName:ve.ZodString,coerce:e?.coerce??!1,...Re(e)});function Dee(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return s%a/10**r}o(Dee,"floatSafeRemainder");var bo=class e extends De{static{o(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==te.number){let s=this._getOrReturnCtx(t);return Z(s,{code:j.invalid_type,expected:te.number,received:s.parsedType}),me}let i,r=new Mt;for(let s of this._def.checks)s.kind==="int"?Me.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),Z(i,{code:j.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?Dee(t.data,s.value)!==0&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),Z(i,{code:j.not_finite,message:s.message}),r.dirty()):Me.assertNever(s);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,oe.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:oe.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:oe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:oe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:oe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:oe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:oe.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Me.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};bo.create=e=>new bo({checks:[],typeName:ve.ZodNumber,coerce:e?.coerce||!1,...Re(e)});var wo=class e extends De{static{o(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==te.bigint)return this._getInvalidInput(t);let i,r=new Mt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),Z(i,{code:j.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Me.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return Z(n,{code:j.invalid_type,expected:te.bigint,received:n.parsedType}),me}gte(t,n){return this.setLimit("min",t,!0,oe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,oe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,oe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,oe.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:oe.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:oe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:oe.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};wo.create=e=>new wo({checks:[],typeName:ve.ZodBigInt,coerce:e?.coerce??!1,...Re(e)});var Bo=class extends De{static{o(this,"ZodBoolean")}_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==te.boolean){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.boolean,received:i.parsedType}),me}return en(t.data)}};Bo.create=e=>new Bo({typeName:ve.ZodBoolean,coerce:e?.coerce||!1,...Re(e)});var ko=class e extends De{static{o(this,"ZodDate")}_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==te.date){let s=this._getOrReturnCtx(t);return Z(s,{code:j.invalid_type,expected:te.date,received:s.parsedType}),me}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return Z(s,{code:j.invalid_date}),me}let i=new Mt,r;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),Z(r,{code:j.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),Z(r,{code:j.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Me.assertNever(s);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:oe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:oe.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};ko.create=e=>new ko({checks:[],coerce:e?.coerce||!1,typeName:ve.ZodDate,...Re(e)});var mc=class extends De{static{o(this,"ZodSymbol")}_parse(t){if(this._getType(t)!==te.symbol){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.symbol,received:i.parsedType}),me}return en(t.data)}};mc.create=e=>new mc({typeName:ve.ZodSymbol,...Re(e)});var So=class extends De{static{o(this,"ZodUndefined")}_parse(t){if(this._getType(t)!==te.undefined){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.undefined,received:i.parsedType}),me}return en(t.data)}};So.create=e=>new So({typeName:ve.ZodUndefined,...Re(e)});var Qo=class extends De{static{o(this,"ZodNull")}_parse(t){if(this._getType(t)!==te.null){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.null,received:i.parsedType}),me}return en(t.data)}};Qo.create=e=>new Qo({typeName:ve.ZodNull,...Re(e)});var ys=class extends De{static{o(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(t){return en(t.data)}};ys.create=e=>new ys({typeName:ve.ZodAny,...Re(e)});var Ti=class extends De{static{o(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(t){return en(t.data)}};Ti.create=e=>new Ti({typeName:ve.ZodUnknown,...Re(e)});var $r=class extends De{static{o(this,"ZodNever")}_parse(t){let n=this._getOrReturnCtx(t);return Z(n,{code:j.invalid_type,expected:te.never,received:n.parsedType}),me}};$r.create=e=>new $r({typeName:ve.ZodNever,...Re(e)});var yc=class extends De{static{o(this,"ZodVoid")}_parse(t){if(this._getType(t)!==te.undefined){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.void,received:i.parsedType}),me}return en(t.data)}};yc.create=e=>new yc({typeName:ve.ZodVoid,...Re(e)});var Di=class e extends De{static{o(this,"ZodArray")}_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==te.array)return Z(n,{code:j.invalid_type,expected:te.array,received:n.parsedType}),me;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(a||c)&&(Z(n,{code:a?j.too_big:j.too_small,minimum:c?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(Z(n,{code:j.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(Z(n,{code:j.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>r.type._parseAsync(new dr(n,a,n.path,c)))).then(a=>Mt.mergeArray(i,a));let s=[...n.data].map((a,c)=>r.type._parseSync(new dr(n,a,n.path,c)));return Mt.mergeArray(i,s)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:oe.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:oe.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:oe.toString(n)}})}nonempty(t){return this.min(1,t)}};Di.create=(e,t)=>new Di({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Re(t)});function hc(e){if(e instanceof Rn){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=lr.create(hc(i))}return new Rn({...e._def,shape:o(()=>t,"shape")})}else return e instanceof Di?new Di({...e._def,type:hc(e.element)}):e instanceof lr?lr.create(hc(e.unwrap())):e instanceof ei?ei.create(hc(e.unwrap())):e instanceof Xr?Xr.create(e.items.map(t=>hc(t))):e}o(hc,"deepPartialify");var Rn=class e extends De{static{o(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Me.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==te.object){let l=this._getOrReturnCtx(t);return Z(l,{code:j.invalid_type,expected:te.object,received:l.parsedType}),me}let{status:i,ctx:r}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof $r&&this._def.unknownKeys==="strip"))for(let l in r.data)a.includes(l)||c.push(l);let u=[];for(let l of a){let A=s[l],p=r.data[l];u.push({key:{status:"valid",value:l},value:A._parse(new dr(r,p,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof $r){let l=this._def.unknownKeys;if(l==="passthrough")for(let A of c)u.push({key:{status:"valid",value:A},value:{status:"valid",value:r.data[A]}});else if(l==="strict")c.length>0&&(Z(r,{code:j.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let A of c){let p=r.data[A];u.push({key:{status:"valid",value:A},value:l._parse(new dr(r,p,r.path,A)),alwaysSet:A in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let A of u){let p=await A.key,g=await A.value;l.push({key:p,value:g,alwaysSet:A.alwaysSet})}return l}).then(l=>Mt.mergeObjectSync(i,l)):Mt.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(t){return oe.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:o((n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:oe.errToObj(t).message??r}:{message:r}},"errorMap")}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:o(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of Me.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}omit(t){let n={};for(let i of Me.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}deepPartial(){return hc(this)}partial(t){let n={};for(let i of Me.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:o(()=>n,"shape")})}required(t){let n={};for(let i of Me.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof lr;)s=s._def.innerType;n[i]=s}return new e({...this._def,shape:o(()=>n,"shape")})}keyof(){return TM(Me.objectKeys(this.shape))}};Rn.create=(e,t)=>new Rn({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:$r.create(),typeName:ve.ZodObject,...Re(t)});Rn.strictCreate=(e,t)=>new Rn({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:$r.create(),typeName:ve.ZodObject,...Re(t)});Rn.lazycreate=(e,t)=>new Rn({shape:e,unknownKeys:"strip",catchall:$r.create(),typeName:ve.ZodObject,...Re(t)});var Ro=class extends De{static{o(this,"ZodUnion")}_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=s.map(c=>new Qn(c.ctx.common.issues));return Z(n,{code:j.invalid_union,unionErrors:a}),me}if(o(r,"handleResults"),n.common.async)return Promise.all(i.map(async s=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let s,a=[];for(let u of i){let l={...n,common:{...n.common,issues:[]},parent:null},A=u._parseSync({data:n.data,path:n.path,parent:l});if(A.status==="valid")return A;A.status==="dirty"&&!s&&(s={result:A,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let c=a.map(u=>new Qn(u));return Z(n,{code:j.invalid_union,unionErrors:c}),me}}get options(){return this._def.options}};Ro.create=(e,t)=>new Ro({options:e,typeName:ve.ZodUnion,...Re(t)});var $i=o(e=>e instanceof $o?$i(e.schema):e instanceof Ar?$i(e.innerType()):e instanceof To?[e.value]:e instanceof Do?e.options:e instanceof _o?Me.objectValues(e.enum):e instanceof No?$i(e._def.innerType):e instanceof So?[void 0]:e instanceof Qo?[null]:e instanceof lr?[void 0,...$i(e.unwrap())]:e instanceof ei?[null,...$i(e.unwrap())]:e instanceof Jl||e instanceof Fo?$i(e.unwrap()):e instanceof Uo?$i(e._def.innerType):[],"getDiscriminator"),ug=class e extends De{static{o(this,"ZodDiscriminatedUnion")}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==te.object)return Z(n,{code:j.invalid_type,expected:te.object,received:n.parsedType}),me;let i=this.discriminator,r=n.data[i],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Z(n,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),me)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let s of n){let a=$i(s.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of a){if(r.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);r.set(c,s)}}return new e({typeName:ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Re(i)})}};function yv(e,t){let n=Kr(e),i=Kr(t);if(e===t)return{valid:!0,data:e};if(n===te.object&&i===te.object){let r=Me.objectKeys(t),s=Me.objectKeys(e).filter(c=>r.indexOf(c)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(let c of s){if(c==="__proto__")continue;let u=yv(e[c],t[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===te.array&&i===te.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let s=0;s<e.length;s++){let a=e[s],c=t[s],u=yv(a,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===te.date&&i===te.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(yv,"mergeValues");var xo=class extends De{static{o(this,"ZodIntersection")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=o((s,a)=>{if(ag(s)||ag(a))return me;let c=yv(s.value,a.value);return c.valid?((cg(s)||cg(a))&&n.dirty(),{status:n.value,value:c.data}):(Z(i,{code:j.invalid_intersection_types}),me)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>r(s,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};xo.create=(e,t,n)=>new xo({left:e,right:t,typeName:ve.ZodIntersection,...Re(n)});var Xr=class e extends De{static{o(this,"ZodTuple")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==te.array)return Z(i,{code:j.invalid_type,expected:te.array,received:i.parsedType}),me;if(i.data.length<this._def.items.length)return Z(i,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),me;!this._def.rest&&i.data.length>this._def.items.length&&(Z(i,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...i.data].map((a,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new dr(i,a,i.path,c)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>Mt.mergeArray(n,a)):Mt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Xr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xr({items:e,typeName:ve.ZodTuple,rest:null,...Re(t)})};var lg=class e extends De{static{o(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==te.object)return Z(i,{code:j.invalid_type,expected:te.object,received:i.parsedType}),me;let r=[],s=this._def.keyType,a=this._def.valueType;for(let c in i.data)r.push({key:s._parse(new dr(i,c,i.path,c)),value:a._parse(new dr(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Mt.mergeObjectAsync(n,r):Mt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof De?new e({keyType:t,valueType:n,typeName:ve.ZodRecord,...Re(i)}):new e({keyType:ms.create(),valueType:t,typeName:ve.ZodRecord,...Re(n)})}},Ec=class extends De{static{o(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==te.map)return Z(i,{code:j.invalid_type,expected:te.map,received:i.parsedType}),me;let r=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([c,u],l)=>({key:r._parse(new dr(i,c,i.path,[l,"key"])),value:s._parse(new dr(i,u,i.path,[l,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of a){let l=await u.key,A=await u.value;if(l.status==="aborted"||A.status==="aborted")return me;(l.status==="dirty"||A.status==="dirty")&&n.dirty(),c.set(l.value,A.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of a){let l=u.key,A=u.value;if(l.status==="aborted"||A.status==="aborted")return me;(l.status==="dirty"||A.status==="dirty")&&n.dirty(),c.set(l.value,A.value)}return{status:n.value,value:c}}}};Ec.create=(e,t,n)=>new Ec({valueType:t,keyType:e,typeName:ve.ZodMap,...Re(n)});var Ic=class e extends De{static{o(this,"ZodSet")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==te.set)return Z(i,{code:j.invalid_type,expected:te.set,received:i.parsedType}),me;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(Z(i,{code:j.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(Z(i,{code:j.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let s=this._def.valueType;function a(u){let l=new Set;for(let A of u){if(A.status==="aborted")return me;A.status==="dirty"&&n.dirty(),l.add(A.value)}return{status:n.value,value:l}}o(a,"finalizeSet");let c=[...i.data.values()].map((u,l)=>s._parse(new dr(i,u,i.path,l)));return i.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:oe.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:oe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};Ic.create=(e,t)=>new Ic({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...Re(t)});var dg=class e extends De{static{o(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==te.function)return Z(n,{code:j.invalid_type,expected:te.function,received:n.parsedType}),me;function i(c,u){return ql({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fc(),xi].filter(l=>!!l),issueData:{code:j.invalid_arguments,argumentsError:u}})}o(i,"makeArgsIssue");function r(c,u){return ql({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fc(),xi].filter(l=>!!l),issueData:{code:j.invalid_return_type,returnTypeError:u}})}o(r,"makeReturnsIssue");let s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Es){let c=this;return en(async function(...u){let l=new Qn([]),A=await c._def.args.parseAsync(u,s).catch(h=>{throw l.addIssue(i(u,h)),l}),p=await Reflect.apply(a,this,A);return await c._def.returns._def.type.parseAsync(p,s).catch(h=>{throw l.addIssue(r(p,h)),l})})}else{let c=this;return en(function(...u){let l=c._def.args.safeParse(u,s);if(!l.success)throw new Qn([i(u,l.error)]);let A=Reflect.apply(a,this,l.data),p=c._def.returns.safeParse(A,s);if(!p.success)throw new Qn([r(A,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Xr.create(t).rest(Ti.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,i){return new e({args:t||Xr.create([]).rest(Ti.create()),returns:n||Ti.create(),typeName:ve.ZodFunction,...Re(i)})}},$o=class extends De{static{o(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};$o.create=(e,t)=>new $o({getter:e,typeName:ve.ZodLazy,...Re(t)});var To=class extends De{static{o(this,"ZodLiteral")}_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return Z(n,{received:n.data,code:j.invalid_literal,expected:this._def.value}),me}return{status:"valid",value:t.data}}get value(){return this._def.value}};To.create=(e,t)=>new To({value:e,typeName:ve.ZodLiteral,...Re(t)});function TM(e,t){return new Do({values:e,typeName:ve.ZodEnum,...Re(t)})}o(TM,"createZodEnum");var Do=class e extends De{static{o(this,"ZodEnum")}_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return Z(n,{expected:Me.joinValues(i),received:n.parsedType,code:j.invalid_type}),me}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return Z(n,{received:n.data,code:j.invalid_enum_value,options:i}),me}return en(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};Do.create=TM;var _o=class extends De{static{o(this,"ZodNativeEnum")}_parse(t){let n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==te.string&&i.parsedType!==te.number){let r=Me.objectValues(n);return Z(i,{expected:Me.joinValues(r),received:i.parsedType,code:j.invalid_type}),me}if(this._cache||(this._cache=new Set(Me.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=Me.objectValues(n);return Z(i,{received:i.data,code:j.invalid_enum_value,options:r}),me}return en(t.data)}get enum(){return this._def.values}};_o.create=(e,t)=>new _o({values:e,typeName:ve.ZodNativeEnum,...Re(t)});var Es=class extends De{static{o(this,"ZodPromise")}unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==te.promise&&n.common.async===!1)return Z(n,{code:j.invalid_type,expected:te.promise,received:n.parsedType}),me;let i=n.parsedType===te.promise?n.data:Promise.resolve(n.data);return en(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Es.create=(e,t)=>new Es({type:e,typeName:ve.ZodPromise,...Re(t)});var Ar=class extends De{static{o(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o(a=>{Z(i,a),a.fatal?n.abort():n.dirty()},"addIssue"),get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let a=r.transform(i.data,s);if(i.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return me;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?me:u.status==="dirty"?vo(u.value):n.value==="dirty"?vo(u.value):u});{if(n.value==="aborted")return me;let c=this._def.schema._parseSync({data:a,path:i.path,parent:i});return c.status==="aborted"?me:c.status==="dirty"?vo(c.value):n.value==="dirty"?vo(c.value):c}}if(r.type==="refinement"){let a=o(c=>{let u=r.refinement(c,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?me:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?me:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!hs(a))return me;let c=r.transform(a.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>hs(a)?Promise.resolve(r.transform(a.value,s)).then(c=>({status:n.value,value:c})):me);Me.assertNever(r)}};Ar.create=(e,t,n)=>new Ar({schema:e,typeName:ve.ZodEffects,effect:t,...Re(n)});Ar.createWithPreprocess=(e,t,n)=>new Ar({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...Re(n)});var lr=class extends De{static{o(this,"ZodOptional")}_parse(t){return this._getType(t)===te.undefined?en(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};lr.create=(e,t)=>new lr({innerType:e,typeName:ve.ZodOptional,...Re(t)});var ei=class extends De{static{o(this,"ZodNullable")}_parse(t){return this._getType(t)===te.null?en(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ei.create=(e,t)=>new ei({innerType:e,typeName:ve.ZodNullable,...Re(t)});var No=class extends De{static{o(this,"ZodDefault")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===te.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};No.create=(e,t)=>new No({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Re(t)});var Uo=class extends De{static{o(this,"ZodCatch")}_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return gc(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qn(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Qn(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Uo.create=(e,t)=>new Uo({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Re(t)});var Cc=class extends De{static{o(this,"ZodNaN")}_parse(t){if(this._getType(t)!==te.nan){let i=this._getOrReturnCtx(t);return Z(i,{code:j.invalid_type,expected:te.nan,received:i.parsedType}),me}return{status:"valid",value:t.data}}};Cc.create=e=>new Cc({typeName:ve.ZodNaN,...Re(e)});var _ee=Symbol("zod_brand"),Jl=class extends De{static{o(this,"ZodBranded")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Hl=class e extends De{static{o(this,"ZodPipeline")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?me:s.status==="dirty"?(n.dirty(),vo(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})},"handleAsync")();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?me:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:ve.ZodPipeline})}},Fo=class extends De{static{o(this,"ZodReadonly")}_parse(t){let n=this._def.innerType._parse(t),i=o(r=>(hs(r)&&(r.value=Object.freeze(r.value)),r),"freeze");return gc(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Fo.create=(e,t)=>new Fo({innerType:e,typeName:ve.ZodReadonly,...Re(t)});function QM(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}o(QM,"cleanParams");function DM(e,t={},n){return e?ys.create().superRefine((i,r)=>{let s=e(i);if(s instanceof Promise)return s.then(a=>{if(!a){let c=QM(t,i),u=c.fatal??n??!0;r.addIssue({code:"custom",...c,fatal:u})}});if(!s){let a=QM(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}}):ys.create()}o(DM,"custom");var Nee={object:Rn.lazycreate},ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ve||(ve={}));var Uee=o((e,t={message:`Input not instance of ${e.name}`})=>DM(n=>n instanceof e,t),"instanceOfType"),_M=ms.create,NM=bo.create,Fee=Cc.create,Pee=wo.create,UM=Bo.create,Mee=ko.create,Lee=mc.create,Oee=So.create,jee=Qo.create,Gee=ys.create,Vee=Ti.create,zee=$r.create,qee=yc.create,Jee=Di.create,Hee=Rn.create,Yee=Rn.strictCreate,Wee=Ro.create,Zee=ug.create,Kee=xo.create,Xee=Xr.create,ete=lg.create,tte=Ec.create,nte=Ic.create,rte=dg.create,ite=$o.create,ste=To.create,ote=Do.create,ate=_o.create,cte=Es.create,ute=Ar.create,lte=lr.create,dte=ei.create,Ate=Ar.createWithPreprocess,pte=Hl.create,fte=o(()=>_M().optional(),"ostring"),gte=o(()=>NM().optional(),"onumber"),hte=o(()=>UM().optional(),"oboolean"),mte={string:o((e=>ms.create({...e,coerce:!0})),"string"),number:o((e=>bo.create({...e,coerce:!0})),"number"),boolean:o((e=>Bo.create({...e,coerce:!0})),"boolean"),bigint:o((e=>wo.create({...e,coerce:!0})),"bigint"),date:o((e=>ko.create({...e,coerce:!0})),"date")};var yte=me;var Ev=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(Ev||{}),Iv=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(Iv||{});var Ag=300,yt=d.string().trim().min(1),Ete=d.object({action:d.enum(["start","run","wait"]),text:yt,source:d.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:yt.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),Yl=/^[A-Za-z_][A-Za-z0-9_]*$/,ti=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,vc=(a=>(a.VersionEndpoint="version_endpoint",a.DeployWorkflow="deploy_workflow",a.KubernetesLabels="kubernetes_labels",a.Command="command",a.Api="api",a.NotTracked="not_tracked",a))(vc||{}),ni="shared",Ite=yt.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),bc=d.object({address:Ite,readyWhen:yt.nullable(),credentials:d.array(d.string().regex(ti)).max(50),revisionSources:d.array(d.object({method:d.nativeEnum(vc),detail:yt.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:d.array(yt).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),Cv={steps:d.array(Ete).max(20).optional().describe("how it starts, in order"),kind:d.enum(["web_app","service","database","external_service"]).optional(),from:d.object({file:yt,service:yt.nullable()}).strict().optional(),credentials:d.array(d.string().max(100).regex(Yl)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},vv=d.object({name:yt,repository:yt.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:d.boolean(),...Cv,deployed:yt.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),Cte=d.object({name:d.string().regex(ti).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:d.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:d.boolean().describe("false only when the SUT starts without it, with less working"),how:yt.max(Ag).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),vte=d.object({component:yt,problem:yt,evidence:yt.describe("the exact command and output that shows it"),fix:yt.describe("what the user must provide, and where")}),bte=d.object({framework:yt,file:yt.describe("the test file run, relative to its repository root"),result:d.enum(["pass","fail","error"])}),wte=d.object({input:yt.describe("the part of the user's SUT input, as given"),reason:yt}),HIe=d.object({schemaVersion:d.literal(1),status:d.nativeEnum(Iv).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:d.array(vv),suites:d.array(bte).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:d.array(yt).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:d.array(d.object({input:yt.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:yt.describe("what the recipe did with it")})).optional(),inputsNotUsed:d.array(wte).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:d.array(vte).describe("required (non-empty) when status is blocked"),inputs:d.array(Cte).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),environment:bc.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward, proxy or client certificate)")});var bv=64*1024,wv=512*1024,FM=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var ri=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(ri||{}),Tr=d.string().trim().min(1),Bte=d.object({url:d.string().optional().describe("the URL probed, if the check is an HTTP request"),command:d.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:d.record(d.string()).optional(),status:d.union([d.number(),d.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:Tr.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),Bv=d.array(d.object({component:Tr.describe("a shared component listed above"),url:Tr.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:Tr.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),kte=d.object({name:Tr.describe("the credential's environment variable name, as listed above; never its value"),component:Tr.describe("the component that refused it"),status:d.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:Tr.describe("the request or command you tested it with and what came back, never the value")}),PM=d.object({schemaVersion:d.literal(1),baseUrls:d.record(d.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:Bte.optional(),teardown:Tr.describe("command that tears the SUT down"),dependencies:d.record(d.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:d.nativeEnum(ri).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:d.array(d.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:d.object({command:Tr,output:Tr}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:d.array(d.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:d.boolean(),startedAt:Tr.describe("ISO timestamp"),revisions:Bv.optional(),missingSecrets:d.array(d.string().regex(Yl)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:d.array(kte).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:d.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var uL=require("node:crypto");var Is=(a=>(a.Place="place",a.Update="update",a.Regenerate="regenerate",a.Delete="delete",a.Verify="verify",a.None="none",a))(Is||{}),pr=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(pr||{}),Zn=d.string().trim().min(1),MM=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(MM||{}),pg=d.object({kind:d.nativeEnum(MM),reason:Zn.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),Wl=d.array(d.string().url().max(2048).regex(/^https?:\/\//i)).max(50),LM=d.object({case:Zn.describe("a covers id \u2014 the recommend case this test realizes"),status:d.nativeEnum(pr),runtimeTargets:Wl.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),fromJourney:d.boolean().optional(),testProblem:pg.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault")}),OM=d.object({exit:d.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:d.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:d.array(LM).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),jM=d.object({from:d.string().optional().describe("staged path \u2014 required for placements"),file:Zn.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:Zn.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:d.nativeEnum(Is),covers:d.array(d.string()).optional().describe("recommend ids a placed test covers"),repro:d.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:d.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:d.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:Zn.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:Zn.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:OM,assertionCount:d.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:d.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),staleOnBase:d.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),GM=(n=>(n.Junit="junit",n.Converter="converter",n))(GM||{}),Ste=Zn.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),Qte=d.object({results:Zn.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:d.nativeEnum(GM),run:Zn.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:d.array(Zn).min(1).describe("the items[].file paths this run covered"),cases:d.array(d.object({test:Zn.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:Zn.describe("the covers id it realizes"),file:Ste})).describe("map each reported test name to the case it covers")}),Rte=d.object({suites:d.array(Qte).min(1)}),kv=d.object({schemaVersion:d.literal(1),items:d.array(jM),runnerResults:Rte.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:d.array(d.string()).describe("existing tests assessed and deliberately left untouched"),summary:Zn.describe("one paragraph")});Ac();Av();function VM(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}o(VM,"credentialKeyFromRole");var Po=(s=>(s.NotFound="not_found",s.NoAccess="no_access",s.Unavailable="unavailable",s.AccessLost="access_lost",s.CannotOpen="cannot_open",s))(Po||{});var Sv=o(e=>`${e.source}:${e.site??""}:${e.key}`,"requirementItemId");var Zl=/^pasted-[0-9a-f]{16}$/,Cs=/^file-[0-9a-f]{16}$/,Kl=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(Kl||{}),Xl=o(e=>e.trim().toUpperCase(),"normalKey"),zM=o((e,t)=>{let n=e.trim();return Zl.test(n.toLowerCase())?"Pasted text":Cs.test(n.toLowerCase())?t?.get(Xl(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()},"itemName");var fg=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(fg||{}),_i=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(_i||{}),wc=(I=>(I.RelatedChangeConflict="related_change_conflict",I.ReferenceOutsideTarget="reference_outside_target",I.SourceAccessLost="source_access_lost",I.ConfigurationIncomplete="configuration_incomplete",I.CredentialUnavailable="credential_unavailable",I.WorkflowBindingUnverified="workflow_binding_unverified",I.WorkflowRefUnprotected="workflow_ref_unprotected",I.BedrockWorkflowRequired="bedrock_workflow_required",I.DeploymentReview="deployment_review",I.SutRevisionMismatch="sut_revision_mismatch",I.IsolationUnavailable="isolation_unavailable",I.EvidenceInsufficient="evidence_insufficient",I.ConfigurationUnresolved="configuration_unresolved",I.ModelProviderDenied="model_provider_denied",I.ModelProviderUnavailable="model_provider_unavailable",I.RunnerProviderNotReady="runner_provider_not_ready",I.MergeConflict="merge_conflict",I))(wc||{}),vs=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(vs||{}),ed=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(ed||{}),td=(c=>(c.AuthToken="auth_token",c.Secret="secret",c.DataConnection="data_connection",c.AppNotStarted="app_not_started",c.Login="login",c.ExternalDependency="external_dependency",c.RecordingReplay="recording_replay",c))(td||{});var gg=(n=>(n.Probe="probe",n.Agent="agent",n))(gg||{}),hg=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(hg||{}),mg=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(mg||{});var qM=Se(require("path"));var Lt=d.string().trim().min(1),yg=Lt,Qv=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(Qv||{}),Rv=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],JM=d.object({schemaVersion:d.literal(1),type:d.nativeEnum(Qv).optional(),repository:yg.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:d.enum(["ready","blocked"]),environment:bc.optional(),components:d.array(d.object({name:Lt,repository:Lt.describe(`owner/repo, or "${ni}" for a customer-deployed component no repository builds`),healthy:d.boolean(),url:d.string().min(1).nullable(),...Cv,credentials:d.array(d.string().regex(ti)).max(50).optional(),deployed:Lt.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:d.array(d.object({framework:Lt,file:Lt,result:d.enum(["pass","fail","error"])}).strict()),inputsUsed:d.array(Lt),inputsUsedHow:d.array(d.object({input:Lt,how:Lt}).strict()).optional(),inputsNotUsed:d.array(d.object({input:Lt,reason:Lt}).strict()),blockers:d.array(d.object({component:Lt,problem:Lt,evidence:Lt,fix:Lt}).strict()),replay:d.object({outcome:Lt,durationSeconds:d.number().nonnegative().nullable()}).strict().nullable(),files:d.array(d.object({path:Lt,content:d.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,s)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:d.ZodIssueCode.custom,path:["inputsUsedHow",s,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,s)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:d.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,s)=>{r.components.forEach((a,c)=>{i.has(a)||t.addIssue({code:d.ZodIssueCode.custom,path:["environment","revisionSources",s,"components",c],message:"not one of components"})})}),e.components.forEach((r,s)=>{r.deployed!==void 0!==n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===ni&&!n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"repository"],message:`only a customer_deployed component is ${ni}`})}),n&&(e.components.forEach((r,s)=>{e.components.findIndex(a=>a.name===r.name)!==s&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:d.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,s)=>{Rv.includes(r.path)&&t.addIssue({code:d.ZodIssueCode.custom,path:["files",s,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(s=>s.components));e.components.forEach((s,a)=>{s.repository!==ni&&!r.has(s.name)&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",a,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var fCe=["clean","recipe-drift"];function nd(e){let t=qM.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}o(nd,"isRuntimePlanFile");var Lo=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(Lo||{}),wg=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(wg||{}),Bg=(a=>(a.PullRequest="pull_request",a.ReadyForReview="ready_for_review",a.Schedule="schedule",a.Manual="manual",a.SutSetup="sut_setup",a.RevisionRead="revision_read",a))(Bg||{}),xte=["sut_setup"],$te=["sut_setup","schedule","revision_read"],Tte=["sut_setup"],Tv=(t=>(t.PullRequest="pull_request",t))(Tv||{}),Dv=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(Dv||{}),HM=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var kg=(r=>(r.None="none",r.Delivered="delivered",r.Partial="partial",r.Failed="failed",r))(kg||{}),sd=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(sd||{}),lL=(n=>(n.Running="running",n.Ended="ended",n))(lL||{}),od=(p=>(p.TimedOut="timed_out",p.AgentFailed="agent_failed",p.SetupFailed="setup_failed",p.CredentialMissing="credential_missing",p.RunnerLost="runner_lost",p.CheckoutFailed="checkout_failed",p.EnvironmentUnverified="environment_unverified",p.ModelProviderDenied="model_provider_denied",p.ModelProviderUnavailable="model_provider_unavailable",p.RunnerProviderNotReady="runner_provider_not_ready",p.MergeConflict="merge_conflict",p))(od||{}),dL=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(dL||{}),_v=(n=>(n.Started="started",n.Finished="finished",n))(_v||{}),AL=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(AL||{});var pL=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(pL||{});var fL=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(fL||{}),Nv=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(Nv||{}),xv=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(xv||{});var Uv=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(Uv||{}),fr=d.string().regex(/^[1-9][0-9]{0,18}$/),Dr=d.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),kc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,tn=d.string().regex(kc),dn=d.string().regex(/^[0-9a-f]{64}$/),vg=d.object({id:tn,revision:fr}).strict(),Sg={provider:d.literal("github"),providerAccountId:fr,providerRepositoryId:fr},Qg={provider:d.literal("azure-devops"),providerAccountId:tn,providerRepositoryId:tn},_r=d.discriminatedUnion("provider",[d.object(Sg).strict(),d.object(Qg).strict()]),Fv=d.discriminatedUnion("provider",[d.object(Sg).passthrough(),d.object(Qg).passthrough()]),si=o(e=>`${e.provider}:${e.providerRepositoryId}`,"sourceKey"),YM={namespace:d.string().min(1),name:d.string().min(1)},gL=d.discriminatedUnion("provider",[d.object({...Sg,...YM}).strict(),d.object({...Qg,...YM}).strict()]),WM=d.object({ref:d.string().min(1),revision:Dr}).strict(),Dte=d.object({kind:d.nativeEnum(Dv),number:fr.optional(),ref:d.string().min(1),revision:Dr,reason:d.nativeEnum(wg)}).strict(),_te=d.object({repository:gL,revision:Dr,ref:d.string().nullable(),reason:d.nativeEnum(wg),change:d.object({kind:d.nativeEnum(Tv),number:fr,base:WM.optional()}).strict().nullable(),compareWith:WM.optional(),merge:d.array(Dte).min(2).optional()}).strict();function Nte(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[s,a]of t.entries()){if(a.kind==="pull_request"!=(a.number!==void 0))return{path:["merge",s,"number"],message:"a pull request names its number, and a branch none"};if(!HM.includes(a.reason))return{path:["merge",s,"reason"],message:`${a.reason} does not select a merged revision`};if(a.kind==="branch"&&a.reason!=="MANUAL_OVERRIDE")return{path:["merge",s,"reason"],message:"only a person chooses a branch to merge"};if(a.ref===e.ref)return{path:["merge",s,"ref"],message:"the baseline branch is what the source merges onto"};if(a.number!==void 0&&n.has(a.number)||i.has(a.ref))return{path:["merge",s],message:"names a revision the source already merges"};a.number!==void 0&&n.add(a.number),i.add(a.ref)}let r=HM.find(s=>t.some(a=>a.reason===s));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}o(Nte,"mergedSourceIssue");function Ute(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(l=>l!=null).length>1)return"a run compares with one baseline";let s=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return s?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let a=new Set(e.sources.map(l=>si(l.repository))),c=new Set(r.map(l=>si(l.repository)));return c.size===r.length&&c.size===a.size&&[...c].every(l=>a.has(l))?null:"names every source of the snapshot, once"}o(Ute,"baselineSourcesIssue");var hL=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,mL=/^[1-9][0-9]{0,18}$/,ZM=new RegExp(`${hL.source}|${mL.source}`),KM=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,Fte=d.union([d.object({source:d.literal("jira"),site:d.string().regex(KM),key:d.string().regex(hL),updated:d.string().datetime(),contentHash:dn}).strict(),d.object({source:d.literal("confluence"),site:d.string().regex(KM),key:d.string().regex(mL),version:d.number().int().positive(),contentHash:dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Zl),contentHash:dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Cs),contentHash:dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(Kl)}).strict()]),XM=d.union([d.literal("jira"),d.literal("confluence")]),Pte=d.object({schemaVersion:d.literal(1),items:d.array(d.union([d.object({source:XM,site:d.string(),key:d.string().regex(ZM),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:XM,site:d.string(),key:d.string().regex(ZM),state:d.literal("not_read"),reason:d.nativeEnum(Po)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Zl),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Zl),state:d.literal("not_read"),reason:d.nativeEnum(Po)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Cs),state:d.literal("read"),version:dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(Kl)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Cs),state:d.literal("not_read"),reason:d.nativeEnum(Po)}).strict()])),instructions:d.array(d.string()).optional()}).strict(),Mte=d.object({resultId:d.string().min(1),repository:d.string().min(1),testType:d.string().min(1),path:d.string(),finding:d.string().min(1)}).strict(),Lte=d.object({schemaVersion:d.literal(1),runId:tn,skyrampOrgId:tn,target:vg,policy:vg.nullable(),trigger:d.object({kind:d.nativeEnum(Bg),requestedAt:d.string().datetime()}).strict(),configuration:d.object({captureId:tn,revision:fr.nullable(),hash:dn}).strict(),baseline:d.object({confirmedRunId:tn.nullable(),initialBaselineId:tn.optional(),comparisonBaselineId:tn.optional(),knownFailures:d.array(Mte).optional(),sources:d.array(d.object({repository:_r,revision:Dr}).strict()).optional()}).strict().optional(),sources:d.array(_te).min(1).max(1e3),execution:d.object({provider:d.nativeEnum(Lo),repository:gL,workflowPath:d.string(),ref:d.string()}).strict(),credentials:d.array(d.object({name:d.string(),purpose:d.nativeEnum(Ev),required:d.boolean()}).strict()),requirements:d.array(Fte).min(1).optional(),instructions:d.object({contentHash:dn}).strict().optional(),deployedRevisions:d.array(d.object({repository:_r,revision:Dr}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((u,l)=>{let A="fileName"in u?"file":"pasted";u.source==="other"&&u.key!==`${A}-${u.contentHash.slice(0,16)}`&&t.addIssue({code:d.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",l,"key"]});let p=Sv({source:u.source,key:u.key});n.has(p)&&t.addIssue({code:d.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",l,"key"]}),n.add(p)});let i=e.trigger.kind,r=xte.includes(i);r!==(e.policy===null)&&t.addIssue({code:d.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:d.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let s=Ute(e);s&&t.addIssue({code:d.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),$te.includes(i)&&e.sources.forEach((u,l)=>{u.reason!=="BASELINE"&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let a=new Set(e.sources.map(u=>si(u.repository))),c=new Set;(e.deployedRevisions??[]).forEach((u,l)=>{let A=si(u.repository);a.has(A)?c.has(A)&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"repository appears twice"}):t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"names a repository outside the snapshot"}),c.add(A)}),e.sources.forEach((u,l)=>{u.compareWith&&(u.reason!=="MANUAL_OVERRIDE"||u.change)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(u.change?.base||u.compareWith||u.merge)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let A=Nte(u);A&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,...A.path],message:A.message})})});var Pv=(n=>(n.Person="person",n.Policy="policy",n))(Pv||{}),Ote=d.object({kind:d.nativeEnum(Pv),name:d.string().min(1).max(256)}).strict(),jte=d.object({mcp:d.discriminatedUnion("source",[d.object({source:d.literal("npm"),version:d.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),d.object({source:d.literal("github"),ref:d.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:d.object({region:d.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:d.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),Gte=d.object({schemaVersion:d.literal(1),attempt:d.object({id:tn,number:d.number().int().positive(),deadlineAt:d.string().datetime()}).strict(),manifest:Lte,manifestHash:dn,entitlements:d.array(d.string()).optional(),runToken:d.string().min(1).optional(),requestedBy:Ote.nullable().optional(),writeAllowed:d.boolean().optional(),claudeCodeVersion:d.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:d.array(d.object({repository:_r,revision:Dr}).strict()).optional(),statedRevisions:d.array(d.object({repository:_r,revision:Dr}).strict()).optional(),runSettings:jte.optional()}).strict(),eL={providerRunAttempt:d.number().int().positive(),workflowRef:d.string().min(1)},Vte=d.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),zte=d.object({schemaVersion:d.literal(1),runId:tn,execution:d.discriminatedUnion("provider",[d.object({...eL,provider:d.literal("github"),repository:d.object(Sg).strict(),providerRunId:fr}).strict(),d.object({...eL,provider:d.literal("azure-devops"),repository:d.object(Qg).strict(),providerRunId:Vte}).strict()]),requester:d.literal(!0).optional(),writeCheck:d.literal(!0).optional(),claudeCodePin:d.literal(!0).optional(),deployedPins:d.literal(!0).optional(),statedPins:d.literal(!0).optional(),runSettings:d.literal(!0).optional()}).strict(),tL=d.object({repository:_r,number:fr,commitSha:Dr.optional()}).strict(),Eg=d.array(d.object({repository:_r,reason:d.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),qte=d.discriminatedUnion("status",[d.object({status:d.literal("none"),noTests:Eg}).strict(),d.object({status:d.literal("delivered"),noTests:Eg,pullRequests:d.array(tL).min(1)}).strict(),d.object({status:d.literal("partial"),noTests:Eg,pullRequests:d.array(tL).min(1),failures:d.array(d.object({repository:_r,message:d.string()}).strict()).min(1)}).strict(),d.object({status:d.literal("failed"),message:d.string(),noTests:Eg}).strict()]),Rg=1024*1024,yL=16*1024*1024,Ig=o(e=>d.array(d.object({[e]:d.string()}).strict()).optional(),"texts"),Jte=d.object({language:d.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:d.string(),validation:d.object({rationale:d.string(),gaps:d.array(d.string())}).strict().optional(),changes:d.array(d.object({id:d.string(),text:d.string()}).strict()).optional(),issuesFound:Ig("description"),newTestsCreated:Ig("description"),testResults:Ig("details"),caveats:Ig("text")}).strict(),Hte=d.object({blockedPreflight:d.object({file:d.string().min(1),repository:d.string().min(1).optional(),reason:d.string().min(1).max(300),evidence:d.string().min(1).max(400)}).strict().optional(),sufficiency:d.nativeEnum(_i),rationale:d.string().min(1),gaps:d.array(d.string().min(1)),acceptedEvidence:d.array(d.object({kind:d.nativeEnum(vs),repository:d.string().min(1),revision:Dr,reference:d.string().min(1),summary:d.string().min(1)}).strict()),actionRequired:d.array(d.nativeEnum(wc))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:d.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),Cg=500,EL=2048,IL=1e3,Yte=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,nL=o(e=>e.length>0&&e.length<=64&&e===e.trim()&&!Yte.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),"isAzureName"),CL=o(e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&nL(n)&&nL(i)},"isResultRepository"),Wte=d.object({testResults:d.array(d.object({resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:d.string().refine(CL,"Invalid"),testType:d.string(),runtimeTargets:Wl.optional(),endpoint:d.string(),status:d.enum(["Pass","Fail","Skipped"]),details:d.string(),fileName:d.string().optional(),testId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:d.object({kind:d.nativeEnum(ed),family:d.nativeEnum(td).optional()}).strict().optional(),origin:d.nativeEnum(fg).optional()}).strict()),validation:Hte,changes:d.array(d.object({id:d.string().min(1).max(512),text:d.string().max(16384),source:d.string().max(EL),testedBy:d.array(d.string().min(1).max(1024)).max(Cg),writtenBy:d.array(d.string().min(1).max(1024)).max(Cg),maintainedBy:d.array(d.string().min(1).max(1024)).max(Cg)}).strict()).max(IL).optional(),traceVersion:d.literal(1),display:Jte.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let s of["issuesFound","newTestsCreated","testResults","caveats"]){let a=n?.[s];a&&a.length!==(Array.isArray(i[s])?i[s].length:0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["display",s],message:`has not one row per ${s} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((s,a)=>{let c=s.failureCause;c&&s.status==="Pass"&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"a passing result has no failure cause"}),c&&c.kind==="environment"!=(c.family!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"an environment cause names its family, and no other cause does"});let u=["testResults",a,"resultId"],l=s.resultId.slice(`${s.repository}:${s.testType}:`.length);(!s.resultId.startsWith(`${s.repository}:${s.testType}:`)||l===""||l.startsWith("/")||l.startsWith("#"))&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"is not repository:testType:path for this result"}),r.has(s.resultId)&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"stable identity repeated"}),r.add(s.resultId)})}),rL=o(e=>e.replace(/[%:#]/g,t=>encodeURIComponent(t)),"encodeIdPart");function Mv(e,t,n,i){let r=n.replace(/\\/g,"/"),s=r.split("/").filter(u=>u!==""&&u!==".");if(r.startsWith("/")||/^[A-Za-z]:/.test(r)||s.length===0||s.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${n}"`);let a=s.join("/"),c=`${e}:${t}:${rL(a)}`;return i?`${c}#${rL(i)}`:c}o(Mv,"testResultId");var xg=(i=>(i.BranchPushed="branch_pushed",i.PullRequestOpened="pull_request_opened",i.PullRequestEdited="pull_request_edited",i))(xg||{}),vL=50,iL=d.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),bL=d.discriminatedUnion("kind",[d.object({kind:d.literal("branch_pushed"),repository:_r,branch:iL,commit:Dr}).strict(),d.object({kind:d.enum(["pull_request_opened","pull_request_edited"]),repository:_r,number:fr,branch:iL}).strict()]),wL=d.object({schemaVersion:d.literal(1),run:d.object({runId:tn,attemptNumber:d.number().int().positive(),manifestHash:dn}).strict(),target:vg,policy:vg,provenance:d.object({sources:d.array(d.object({repository:_r,revision:Dr}).strict()),firstQualification:d.literal(!0).optional()}).strict(),delivery:d.object({generatedTests:qte}).strict(),producer:d.object({testbot:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:Wte,githubWrites:d.array(bL).max(vL).optional()}).strict(),Lv=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(Lv||{}),Ov=200,Zte=d.object({cause:d.nativeEnum(Lv),credential:d.string().regex(ti).optional(),reason:d.string().trim().min(1).max(Ov).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),Kte=d.object({name:d.string().regex(ti),purpose:d.enum(["sut_access","other"]),required:d.boolean(),how:d.string().trim().min(1).max(Ag)}).strict(),wCe=wL.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:JM,check:Zte.optional(),inputs:d.array(Kte).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=o((s,a)=>t.addIssue({code:d.ZodIssueCode.custom,path:["recipe",...s],message:a}),"issue");e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((s,a)=>{nd(s.path)||n(["files",a,"path"],"is not .skyramp/workspace.yml or a file under .skyramp/sut/"),i.has(s.path)&&n(["files",a,"path"],"file repeated"),i.add(s.path),FM.test(s.content)&&n(["files",a,"content"],"is not text");let c=Buffer.byteLength(s.content,"utf8");r+=c,c>bv&&n(["files",a,"content"],`larger than ${bv} bytes`)}),r>wv&&n(["files"],`recipe text over ${wv} bytes in total`)}),BCe=d.object({components:d.array(d.object({name:d.string().min(1),repository:d.string().refine(CL,"Invalid"),observedRevision:d.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:d.nativeEnum(gg),evidence:d.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();function BL(e){return e.trigger.kind==="schedule"||e.trigger.kind==="manual"&&e.sources.every(t=>t.reason==="BASELINE")}o(BL,"readsDeployedState");var Xte=d.object({schemaVersion:d.literal(1),stage:d.nativeEnum(dL),event:d.nativeEnum(_v),status:d.nativeEnum(AL).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),$g=100,ene=5e3,Mo=2e3,sL=100,kL=/^[A-Za-z0-9_-]{1,64}$/,tne=20,nne=200,rne=100,ine=100,sne=200,oL="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",one=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${oL}/${oL})$`),ane=500,cne=50,une=10,lne=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,SL=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Kn=o(e=>d.string().max(e).refine(t=>t.trim().length>0&&!SL.test(t),"blank, or not text"),"setupText"),ii={sequence:d.number().int().min(1).max(ene),at:d.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},QL=d.object({...ii,kind:d.literal("reply"),to:d.string().uuid(),outcome:d.nativeEnum(fL),accepted:d.boolean(),text:Kn(Mo),note:d.object({source:d.enum(["target","environment"]),quote:Kn(Mo)}).strict().optional(),kept:Kn(Mo).optional()}).strict();function RL(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:d.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}o(RL,"checkReply");var dne=d.discriminatedUnion("kind",[d.object({...ii,kind:d.literal("log"),phase:d.nativeEnum(Nv),text:Kn(Mo)}).strict(),d.object({...ii,kind:d.literal("component"),name:Kn(sL),repository:Kn(sne).refine(e=>one.test(e)||e===ni,"not owner/name"),file:Kn(ane).nullable(),status:d.nativeEnum(Uv),version:Kn(ine).optional()}).strict(),QL,d.object({...ii,kind:d.literal("question"),id:d.string().regex(kL),type:d.nativeEnum(pL),text:Kn(Mo),component:Kn(sL).nullable(),choices:d.array(Kn(nne)).max(tne),placeholder:Kn(rne).optional()}).strict(),d.object({...ii,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max($g)}).strict(),d.object({...ii,kind:d.literal("credentials"),names:d.array(d.string().regex(ti)).min(1).max(cne),logins:d.array(d.object({key:d.string().regex(lne),usernameVariable:d.string().regex(ti),passwordVariable:d.string().regex(ti)}).strict()).min(1).max(une).optional()}).strict()]).superRefine((e,t)=>{if(RL(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>VM(i.key));new Set(n).size!==n.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let s of["usernameVariable","passwordVariable"])e.names.includes(i[s])||t.addIssue({code:d.ZodIssueCode.custom,path:["logins",r,s],message:"not one of the names"})})}e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),Ane=d.object({schemaVersion:d.literal(1),events:d.array(dne).max($g)}).strict(),pne=d.discriminatedUnion("kind",[d.object({...ii,kind:d.literal("log"),stage:d.nativeEnum(xv),text:Kn(Mo)}).strict(),QL,d.object({...ii,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max($g)}).strict(),d.object({...ii,kind:d.literal("stage"),stage:d.nativeEnum(xv),event:d.nativeEnum(_v)}).strict(),d.object({...ii,kind:d.literal("test"),resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:d.enum(["Pass","Fail","Skipped"]),details:d.string().max(Mo).refine(e=>!SL.test(e),"not text")}).strict()]).superRefine(RL),fne=d.object({schemaVersion:d.literal(1),events:d.array(pne).max($g)}).strict(),aL={id:d.string().uuid(),text:d.string(),by:d.string().nullable(),at:d.string(),replied:d.literal(!0).optional()},xL=d.discriminatedUnion("kind",[d.object({...aL,kind:d.literal("instruction"),question:d.null()}),d.object({...aL,kind:d.literal("answer"),question:d.string().regex(kL)})]),$L=d.string().regex(/^[A-Za-z0-9+/]{43}=$/),gne=d.object({id:d.string().uuid(),revision:d.string(),by:d.string().nullable(),at:d.string(),target:d.string(),own:d.object({source:d.enum(["policy","test_environment"]),text:d.string()}).nullable()}),hne=d.object({schemaVersion:d.literal(1),leftOut:d.array(d.string()),messages:d.array(xL).optional(),stop:d.object({key:$L}).optional(),notes:gne.optional()}),mne=d.object({schemaVersion:d.literal(1),messages:d.array(xL).optional()});var yne=500*1024*1024,TL=d.object({id:fr,name:d.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:fr,expiresAt:d.string().datetime()}).strict(),Ene=d.object({schemaVersion:d.literal(1),artifact:TL,sessionId:tn,contentHash:dn,bytes:d.number().int().min(1).max(yne)}).strict(),Ine=d.object({schemaVersion:d.literal(1),checkpoint:d.object({artifact:TL,repository:d.object({namespace:d.string().min(1),name:d.string().min(1)}).strict(),sessionId:tn,contentHash:dn,key:$L}).strict().nullable()}).strict(),Cne=200,Bc=100,DL=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(DL||{}),vne=d.object({kind:d.nativeEnum(DL),setup:d.object({runId:tn,endedAt:d.string().nullable(),outcome:d.string().nullable()}).strict(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1),status:d.nativeEnum(Uv)}).strict()).max(Bc),credentials:d.array(d.string().min(1)).max(Bc),answers:d.array(d.object({question:d.string(),answer:d.string().nullable()}).strict()).max(Bc),instructions:d.array(d.object({text:d.string(),reply:d.string().nullable()}).strict()).max(Bc),log:d.array(d.object({phase:d.nativeEnum(Nv),text:d.string()}).strict()).max(Cne),recipe:d.object({files:d.array(d.object({path:d.string().min(1),content:d.string()}).strict()).max(Bc),blockers:d.array(d.object({component:d.string(),problem:d.string(),evidence:d.string(),fix:d.string()}).strict()).max(Bc)}).strict().optional()}).strict(),bne=d.object({schemaVersion:d.literal(1),context:vne.nullable()}).strict(),wne=d.object({schemaVersion:d.literal(1),configuration:d.object({captureId:tn,revision:fr.nullable(),hash:dn}).strict(),capture:d.object({schemaVersion:d.literal(1),settings:d.object({target:d.object({environment:d.unknown()}).passthrough(),timeoutMinutes:d.number().int().positive(),answerWaitMinutes:d.number().int().positive().optional(),testEnvironment:d.object({name:d.string().min(1),address:d.string().min(1).optional(),readyWhen:d.string().min(1).optional()}).passthrough().optional()}).passthrough(),provenance:d.object({}).passthrough(),hash:dn}).strict()}).strict(),Bne=bc.extend({version:d.number().int().positive(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1)}).strict()),contentHash:dn.optional(),files:d.array(d.object({path:d.string().refine(e=>nd(e)&&!Rv.includes(e),"not a file of a customer_deployed plan"),content:d.string()}).strict()).optional()}).strict(),kne=d.object({schemaVersion:d.literal(1),testEnvironment:Bne.nullable().optional(),runtimePlan:d.object({version:d.number().int().positive(),contentHash:dn,files:d.array(d.object({path:d.string().refine(nd,"not a recipe file path"),content:d.string()}).strict()).min(1),repository:yg.optional(),recipeRepository:yg.optional(),recipe:d.record(d.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),_L=d.object({schemaVersion:d.literal(1),state:d.nativeEnum(lL),ending:d.nativeEnum(sd).nullable(),cause:d.nativeEnum(od).nullable(),deadlineAt:d.string().datetime()}).strict();function NL(e,t){return e.state==="ended"?e.ending==="cancelled"?"cancelled":e.cause==="runner_lost"?"expired":"ended":t.getTime()>=Date.parse(e.deadlineAt)?"expired":null}o(NL,"attemptClosure");var UL=50,kCe=d.object({repository:_r,revisions:d.array(d.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:d.array(d.string().min(1)).min(1).max(UL)}).strict();function $v(e){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(e))return`[${e.map($v).join(",")}]`;if(e!==null&&typeof e=="object"){let n=e;return`{${Object.keys(n).sort().map(i=>`${JSON.stringify(i)}:${$v(n[i])}`).join(",")}}`}let t=JSON.stringify(e);if(t===void 0)throw new TypeError("Canonical JSON requires JSON values");return t}o($v,"canonicalJson");function FL(e){return(0,uL.createHash)("sha256").update($v(e),"utf8").digest("hex")}o(FL,"manifestHash");var rd=o(e=>({provider:e.provider,providerAccountId:e.providerAccountId,providerRepositoryId:e.providerRepositoryId}),"toSourceRef");function jv(e,t,{statedPins:n=!0}={}){return zte.parse({schemaVersion:1,runId:e,execution:t.execution(),requester:!0,writeCheck:!0,claudeCodePin:!0,deployedPins:!0,...n?{statedPins:!0}:{},...t.runSettingsFromApp?{runSettings:!0}:{}})}o(jv,"handshakeRequest");function PL(e){let t=Gte.parse(e);if(FL(t.manifest)!==t.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return t}o(PL,"parseHandshakeResponse");function Sne(e){let t=o(i=>i.map(r=>({repository:rd(r.repository),number:r.number,...r.commitSha===void 0?{}:{commitSha:r.commitSha}})),"pullRequests"),n=e.noTests?{noTests:e.noTests.map(i=>({repository:rd(i.repository),reason:i.reason}))}:{};return e.status==="delivered"?{status:e.status,...n,pullRequests:t(e.pullRequests)}:e.status==="partial"?{status:e.status,...n,pullRequests:t(e.pullRequests),failures:e.failures.map(i=>({repository:rd(i.repository),message:i.message}))}:{...e,...n}}o(Sne,"toDelivery");function Qne(e){return e.issues.map(t=>`${t.path.map((i,r)=>typeof i=="number"?`[${i}]`:r===0?i:`.${i}`).join("")}: ${t.message}`).join("; ")}o(Qne,"describeIssues");function ML(e){let{manifest:t}=e;if(Tte.includes(t.trigger.kind))throw new Error(`The report upload is invalid: a ${t.trigger.kind} run uploads its SUT recipe, never a report`);if(t.trigger.kind==="revision_read")throw new Error("The report upload is invalid: a revision_read run uploads what each component runs, never a report");if(e.firstQualification&&!t.baseline?.sources)throw new Error("The report upload is invalid: only a run whose manifest names baseline sources can be a first qualification");let n=wL.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e.attemptNumber,manifestHash:FL(t)},target:{id:t.target.id,revision:t.target.revision},policy:t.policy&&{id:t.policy.id,revision:t.policy.revision},provenance:{sources:e.checkedOut.map(i=>({repository:rd(i.repository),revision:i.revision})),...e.firstQualification?{firstQualification:!0}:{}},delivery:{generatedTests:Sne(e.generatedTests)},producer:e.producer,report:e.report,...e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:rd(i.repository)}))}:{}});if(!n.success)throw new Error(`The report upload is invalid: ${Qne(n.error)}`);return Rne(n.data,t,e.checkedOut),n.data}o(ML,"buildReportUpload");function Rne(e,t,n){let i=o(s=>n.find(a=>si(a.repository)===si(s.repository))?.revision??s.revision,"revisionOf"),r=new Map(t.sources.map(s=>[`${s.repository.namespace}/${s.repository.name}`.toLowerCase(),i(s)]));e.report.validation.acceptedEvidence.forEach((s,a)=>{let c=`report.validation.acceptedEvidence[${a}]`,u=r.get(s.repository.toLowerCase());if(!u)throw new Error(`${c}.repository: ${s.repository} is outside the run's snapshot`);if(s.revision!==u)throw new Error(`${c}.revision: evidence is not from the checked-out revision ${u}`)})}o(Rne,"assertEvidenceFromSnapshot");function LL(e){return e.reportUploaded?{schemaVersion:1,reason:"report_uploaded",cause:null}:e.recipeUploaded?{schemaVersion:1,reason:"recipe_uploaded",cause:null}:e.revisionsUploaded?{schemaVersion:1,reason:"revisions_uploaded",cause:null}:e.cancelled?{schemaVersion:1,reason:"cancelled",cause:null}:e.mergeConflict&&cL(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict}:{schemaVersion:1,reason:"no_report",cause:cL({...e,mergeConflict:void 0})}}o(LL,"attemptEndFor");function cL(e){return e.runnerProviderNotReady?"runner_provider_not_ready":e.credentialMissing?"credential_missing":e.mergeConflict?"merge_conflict":e.checkoutFailed?"checkout_failed":e.environmentUnverified?"environment_unverified":e.setupFailed?"setup_failed":e.timedOut?"timed_out":e.modelProviderDenied?"model_provider_denied":e.modelProviderUnavailable?"model_provider_unavailable":"agent_failed"}o(cL,"noReportCause");var DCe=["clean","recipe-drift"];var bs=Se(require("path"));var FCe={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var Gv=o(e=>new Map((e??[]).flatMap(t=>t.file?[[Xl(t.key),t.file.name]]:[])),"itemNames"),$ne=10*1024*1024,Tne=o(e=>e?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","needsExtraction"),jL=o((e,t)=>bs.join(bs.dirname(e),`${bs.basename(e,bs.extname(e))}${t}`),"besideFile"),Dne=o(e=>jL(e,".extracted.txt"),"extractedTextPath");var _ne=o(e=>jL(e,".quotes.txt"),"confirmedQuotesPath");function GL(e){return Tne(e.file)?Dne(e.path):e.file?.mediaType==="application/pdf"?_ne(e.path):e.path}o(GL,"itemTextPath");var Ni=d.string().trim().min(1),Ui=72,Nne=d.object({repository:Ni.optional().describe("owner/repo of the checkout this lint ran in, when the run has several; omit for the working checkout"),tool:d.string(),command:d.string().describe("the exact command you ran, scoped to the changed files"),clean:d.boolean(),fixed:d.array(d.string()).optional().describe("files you fixed"),uncovered:d.array(d.string()).describe("changed/new files this linter's own config does not match (wrong extension, wrong directory) \u2014 so `clean` never examined them, even though CI may still execute them. Empty array, not omitted, when every changed/new file IS covered.")}),Vv=d.object({schemaVersion:d.literal(1),lint:d.array(Nne).min(1).describe("one entry per checkout this run wrote tests in, each run from that checkout"),fileConventions:d.object({ok:d.boolean(),notes:d.string().optional()}),ciReadiness:d.object({covered:d.boolean().describe("will the repo's CI run these tests?"),notes:d.string().optional()}),dependencies:d.object({added:d.array(d.object({package:d.string(),manifest:d.string(),repository:Ni.optional().describe("owner/repo of the manifest's checkout; omit for the working checkout"),reason:Ni.optional().describe("why the test must run inside the application's own test environment, so its manifest had to change \u2014 required for every entry")})).describe("every package added to an APPLICATION manifest (an exception, surfaced in the report); never the Testbot test package's own")}),support:d.array(d.object({file:Ni,repository:Ni.optional().describe("owner/repo of the file's checkout; omit for the working checkout")})).optional().describe("the files the tests need besides themselves (helper modules, page objects, fixtures, snapshots), delivered with them"),commit:d.object({message:Ni.refine(e=>e.split(`
|
|
57
57
|
`)[0].length<=Ui,{message:`subject line must be <= ${Ui} chars`})}),pr:d.object({title:Ni.max(Ui,`must be <= ${Ui} chars`),body:Ni}),ready:d.boolean().describe("a statement of fact: true only if the tests are fit to commit as they stand"),blockers:d.array(d.string()).describe("what blocks the commit \u2014 required non-empty when ready is false"),summary:Ni.describe("one paragraph")});function ad(e){return(e?.blockers??[]).slice(0,3).join("; ")}o(ad,"leadBlockers");var Sc=o(e=>e.slice(0,12),"shortCommit");var Une=["generate-unit","native-run"],qCe=["preflight","plan","write",...Une,"report","deliver"];var zv=(i=>(i.Unit="unit",i.Integration="integration",i.E2e="e2e",i))(zv||{}),Fne=Object.values(zv);var VL=require("child_process");var cd=Se(require("path"));var ws="Skyramp Testbot",Oo="test-bot@skyramp.dev";var Pne=o((e,t)=>(0,VL.execFileSync)("git",t,{cwd:e,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim(),"git");function zL(e){let t="";try{t=Pne(e,["remote","get-url","origin"])}catch{}let n=/[:/]([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(t);return n&&!t.startsWith("/")&&!t.startsWith(".")?`${n[1]}/${n[2]}`:`local/${cd.basename(cd.resolve(e)).replace(/[^A-Za-z0-9._-]/g,"-")||"repo"}`}o(zL,"repositorySlug");var rve=new Set(Object.values(vs));var ive=d.object({checks:d.array(d.object({repository:d.string().optional(),name:d.string().min(1),headSha:d.string().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/i),status:d.string().default("completed"),conclusion:d.string().nullable().optional(),url:d.string().optional(),summary:d.string().optional()}))});var qv=new Map;function Lne(e){return e.repositorySlug?e.repositorySlug:(qv.has(e.repositoryPath)||qv.set(e.repositoryPath,zL(e.repositoryPath)),qv.get(e.repositoryPath))}o(Lne,"workingSlug");function xn(e){return[{slug:Lne(e),path:e.repositoryPath,writable:!0,working:!0},...(e.relatedRepos??[]).map(t=>({slug:t.slug,path:t.path,writable:t.writable===!0,working:!1}))]}o(xn,"runSources");var Qc=o((e,t)=>e.toLowerCase()===t.toLowerCase(),"sameSlug");function Tg(e,t){return t?.trim()?e.find(n=>Qc(n.slug,t.trim())):e[0]}o(Tg,"findSource");function Fi(e,t){return Tg(xn(e),t)}o(Fi,"resolveSource");var One=o((e,t)=>`${t} is not a repository of this run (${xn(e).map(n=>n.slug).join(", ")})`,"notARepository");function Rc(e,t){let n=Fi(e,t);return n?n.writable?{source:n}:{error:`${n.slug} is read-only in this run: tests are written only to ${xn(e).filter(i=>i.writable).map(i=>i.slug).join(", ")}`}:{error:One(e,t)}}o(Rc,"writableSource");var ud=Se(require("fs")),ld=Se(require("path"));var jne=8;function Ot(e,t,n={}){let i=t.slice(0,jne),r=t.length-i.length;return{name:e,passed:!1,details:i.join("; ")+(r>0?`; \u2026and ${r} more`:""),...n.fatal?{fatal:!0}:{}}}o(Ot,"fail");function jo(e){if(ud.existsSync(e))try{return JSON.parse(ud.readFileSync(e,"utf-8"))}catch{return}}o(jo,"readJsonFile");function Ve(e,t){return jo(ld.join(e.outputsDir,t))}o(Ve,"readArtifact");function $n(e,t){return{name:e,verify(n,i){let{errors:r}=t(n,i);return r.length===0?{name:this.name,passed:!0}:Ot(this.name,r,{fatal:!0})}}}o($n,"schemaGate");function dd(e){return e.replace(/\s+/g," ").trim()}o(dd,"normalizeCode");var Ad=new RegExp("(^|/)("+["test_[^/]+\\.py","[^/]+_test\\.py","[^/]+\\.(spec|test)\\.[cm]?[jt]sx?","[^/]+\\.e2e-(spec|test)\\.[cm]?[jt]sx?","[^/]+_test\\.go","[^/]+Tests?\\.(java|kts?)","[^/]+_(test|spec)\\.rb","[^/]+\\.feature","[^/]+Tests?\\.cs","[^/]+_test\\.rs","tests/[^/]+\\.rs","[^/]+Test\\.php","[^/]+(Test|Spec|Suite)\\.scala","[^/]+Tests?\\.swift","[^/]+_test\\.exs","[^/]+_test\\.dart","[^/]+_test\\.(c|cc|cpp|cxx)","test_[^/]+\\.(c|cc|cpp|cxx)","[^/]+(Spec|Test)\\.groovy"].join("|")+")$","i");var Qt={};Cr(Qt,{$brand:()=>ob,$input:()=>Pk,$output:()=>Fk,INVALID:()=>fn,NEVER:()=>sb,TimePrecision:()=>Wk,ZodAny:()=>FQ,ZodArray:()=>OQ,ZodBase64:()=>Bm,ZodBase64URL:()=>km,ZodBigInt:()=>pu,ZodBigIntFormat:()=>Rm,ZodBoolean:()=>Au,ZodCIDRv4:()=>bm,ZodCIDRv6:()=>wm,ZodCUID:()=>hm,ZodCUID2:()=>mm,ZodCatch:()=>cR,ZodCodec:()=>lA,ZodCompileAsyncError:()=>Ur,ZodCompileUnsupportedError:()=>Ue,ZodCreditCard:()=>RQ,ZodCustom:()=>dA,ZodCustomStringFormat:()=>sa,ZodDate:()=>iA,ZodDefault:()=>nR,ZodDiscriminatedUnion:()=>GQ,ZodE164:()=>Sm,ZodEmail:()=>Am,ZodEmoji:()=>fm,ZodEnum:()=>uu,ZodError:()=>aae,ZodExactOptional:()=>Dm,ZodFile:()=>KQ,ZodFirstPartyTypeKind:()=>vR,ZodFunction:()=>yR,ZodGUID:()=>pm,ZodIBAN:()=>xQ,ZodIPv4:()=>Cm,ZodIPv6:()=>vm,ZodISODate:()=>Ns,ZodISODateTime:()=>_s,ZodISODuration:()=>Fs,ZodISOTime:()=>Us,ZodInstanceOf:()=>CR,ZodIntersection:()=>VQ,ZodIssueCode:()=>lae,ZodJWT:()=>Qm,ZodKSUID:()=>Im,ZodLazy:()=>gR,ZodLiteral:()=>ZQ,ZodMAC:()=>QQ,ZodMap:()=>YQ,ZodNaN:()=>lR,ZodNanoID:()=>gm,ZodNever:()=>MQ,ZodNonOptional:()=>_m,ZodNull:()=>NQ,ZodNullable:()=>tR,ZodNumber:()=>du,ZodNumberFormat:()=>oa,ZodObject:()=>oA,ZodOptional:()=>cA,ZodPipe:()=>uA,ZodPrefault:()=>iR,ZodPreprocess:()=>dR,ZodPromise:()=>mR,ZodReadonly:()=>AR,ZodRealError:()=>Un,ZodRecord:()=>cu,ZodSet:()=>WQ,ZodString:()=>lu,ZodStringFormat:()=>Ke,ZodSuccess:()=>aR,ZodSymbol:()=>DQ,ZodTemplateLiteral:()=>fR,ZodTransform:()=>XQ,ZodTuple:()=>qQ,ZodType:()=>xe,ZodULID:()=>ym,ZodURL:()=>rA,ZodUUID:()=>ui,ZodUndefined:()=>_Q,ZodUnion:()=>aA,ZodUnknown:()=>PQ,ZodVoid:()=>LQ,ZodXID:()=>Em,ZodXor:()=>jQ,_ZodString:()=>dm,_default:()=>rR,_function:()=>E1,any:()=>Wj,array:()=>sA,base64:()=>xj,base64url:()=>$j,bigint:()=>zj,boolean:()=>TQ,catch:()=>uR,check:()=>I1,cidrv4:()=>Qj,cidrv6:()=>Rj,clone:()=>He,codec:()=>g1,coerce:()=>wR,compile:()=>jk,config:()=>It,core:()=>ji,creditCard:()=>Dj,cuid:()=>Ij,cuid2:()=>Cj,currencyCode:()=>Mj,custom:()=>C1,date:()=>Kj,decode:()=>CQ,decodeAsync:()=>bQ,deepPartial:()=>_1,describe:()=>v1,discriminatedUnion:()=>i1,e164:()=>Tj,email:()=>lj,emoji:()=>yj,encode:()=>IQ,encodeAsync:()=>vQ,endsWith:()=>Zc,enum:()=>$m,exactOptional:()=>eR,file:()=>d1,flattenError:()=>bd,float32:()=>Oj,float64:()=>jj,formatError:()=>wd,fromJSONSchema:()=>T1,function:()=>E1,getDiscriminatedOption:()=>sB,getErrorMap:()=>Aae,globalRegistry:()=>Gt,gt:()=>ai,gte:()=>er,guid:()=>dj,hash:()=>Lj,hex:()=>Pj,hostname:()=>Fj,httpUrl:()=>mj,iban:()=>_j,includes:()=>Yc,input:()=>U1,instanceof:()=>w1,int:()=>um,int32:()=>Gj,int64:()=>qj,intersection:()=>zQ,invertCodec:()=>h1,ipv4:()=>Bj,ipv6:()=>Sj,iso:()=>AA,json:()=>k1,jwt:()=>Nj,keyof:()=>Xj,ksuid:()=>wj,lazy:()=>hR,length:()=>ea,literal:()=>l1,locales:()=>Jd,looseObject:()=>n1,looseRecord:()=>o1,lowercase:()=>Jc,lt:()=>oi,lte:()=>Xn,mac:()=>kj,map:()=>a1,maxLength:()=>Xo,maxSize:()=>xs,memoizer:()=>jd,meta:()=>b1,mime:()=>Xc,minLength:()=>Oi,minSize:()=>ci,multipleOf:()=>Rs,nan:()=>f1,nanoid:()=>Ej,nativeEnum:()=>u1,negative:()=>Kh,never:()=>xm,nonnegative:()=>em,nonoptional:()=>oR,nonpositive:()=>Xh,normalize:()=>eu,null:()=>UQ,nullable:()=>nA,nullish:()=>A1,number:()=>$Q,object:()=>e1,optional:()=>ra,output:()=>F1,overwrite:()=>Fr,parse:()=>hQ,parseAsync:()=>mQ,partialRecord:()=>s1,pipe:()=>lm,positive:()=>Zh,prefault:()=>sR,preprocess:()=>S1,prettifyError:()=>db,promise:()=>y1,properties:()=>Kc,property:()=>tm,readonly:()=>pR,record:()=>HQ,refine:()=>ER,regex:()=>qc,regexes:()=>mr,registry:()=>kh,safeDecode:()=>BQ,safeDecodeAsync:()=>SQ,safeEncode:()=>wQ,safeEncodeAsync:()=>kQ,safeParse:()=>yQ,safeParseAsync:()=>EQ,set:()=>c1,setErrorMap:()=>dae,size:()=>Ko,slugify:()=>iu,startsWith:()=>Wc,strictObject:()=>t1,string:()=>tA,stringFormat:()=>Uj,stringbool:()=>B1,success:()=>p1,superRefine:()=>IR,symbol:()=>Hj,templateLiteral:()=>m1,toJSONSchema:()=>sm,toLowerCase:()=>nu,toUpperCase:()=>ru,toZod:()=>pd,transform:()=>Tm,treeifyError:()=>lb,trim:()=>tu,tuple:()=>JQ,uint32:()=>Vj,uint64:()=>Jj,ulid:()=>vj,undefined:()=>Yj,union:()=>fu,unknown:()=>na,uppercase:()=>Hc,url:()=>hj,util:()=>x,uuid:()=>Aj,uuidv4:()=>pj,uuidv6:()=>fj,uuidv7:()=>gj,validate:()=>Bd,validateAsync:()=>kd,void:()=>Zj,withParser:()=>Sh,xid:()=>bj,xor:()=>r1});var ji={};Cr(ji,{$ZodAny:()=>Ww,$ZodArray:()=>nB,$ZodAsyncError:()=>_n,$ZodBase64:()=>Pw,$ZodBase64URL:()=>Mw,$ZodBigInt:()=>gh,$ZodBigIntFormat:()=>qw,$ZodBoolean:()=>Ud,$ZodCIDRv4:()=>Uw,$ZodCIDRv6:()=>Fw,$ZodCUID:()=>ww,$ZodCUID2:()=>Bw,$ZodCatch:()=>CB,$ZodCheck:()=>it,$ZodCheckBigIntFormat:()=>Zb,$ZodCheckEndsWith:()=>uw,$ZodCheckGreaterThan:()=>Xg,$ZodCheckIncludes:()=>aw,$ZodCheckLengthEquals:()=>rw,$ZodCheckLessThan:()=>Kg,$ZodCheckLowerCase:()=>sw,$ZodCheckMaxLength:()=>tw,$ZodCheckMaxSize:()=>Kb,$ZodCheckMimeType:()=>Aw,$ZodCheckMinLength:()=>nw,$ZodCheckMinSize:()=>Xb,$ZodCheckMultipleOf:()=>Yb,$ZodCheckNumberFormat:()=>Wb,$ZodCheckOverwrite:()=>pw,$ZodCheckProperties:()=>dw,$ZodCheckProperty:()=>lw,$ZodCheckRegex:()=>iw,$ZodCheckSizeEquals:()=>ew,$ZodCheckStartsWith:()=>cw,$ZodCheckStringFormat:()=>Oc,$ZodCheckUpperCase:()=>ow,$ZodCodec:()=>Pd,$ZodCreditCard:()=>Ow,$ZodCustom:()=>QB,$ZodCustomStringFormat:()=>Vw,$ZodCyclicError:()=>vh,$ZodDate:()=>eB,$ZodDefault:()=>mB,$ZodDiscriminatedUnion:()=>oB,$ZodE164:()=>Lw,$ZodEmail:()=>yw,$ZodEmoji:()=>vw,$ZodEncodeError:()=>Ss,$ZodEnum:()=>dB,$ZodError:()=>ub,$ZodExactOptional:()=>gB,$ZodFile:()=>pB,$ZodFunction:()=>kB,$ZodGUID:()=>hw,$ZodIBAN:()=>jw,$ZodIPv4:()=>Dw,$ZodIPv6:()=>_w,$ZodISODate:()=>xw,$ZodISODateTime:()=>Rw,$ZodISODuration:()=>Tw,$ZodISOTime:()=>$w,$ZodIntersection:()=>aB,$ZodJWT:()=>Gw,$ZodKSUID:()=>Qw,$ZodLazy:()=>Md,$ZodLiteral:()=>AB,$ZodMAC:()=>Nw,$ZodMap:()=>uB,$ZodNaN:()=>vB,$ZodNanoID:()=>bw,$ZodNever:()=>Kw,$ZodNonOptional:()=>EB,$ZodNull:()=>Yw,$ZodNullable:()=>hB,$ZodNumber:()=>fh,$ZodNumberFormat:()=>zw,$ZodObject:()=>kO,$ZodObjectJIT:()=>rB,$ZodOptional:()=>mh,$ZodPipe:()=>yh,$ZodPrefault:()=>yB,$ZodPreprocess:()=>bB,$ZodPromise:()=>SB,$ZodReadonly:()=>wB,$ZodRealError:()=>Nn,$ZodRecord:()=>cB,$ZodRegistry:()=>Bh,$ZodSet:()=>lB,$ZodString:()=>Ho,$ZodStringFormat:()=>Ye,$ZodSuccess:()=>IB,$ZodSymbol:()=>Jw,$ZodTemplateLiteral:()=>BB,$ZodTransform:()=>fB,$ZodTuple:()=>hh,$ZodType:()=>Be,$ZodULID:()=>kw,$ZodURL:()=>Cw,$ZodUUID:()=>mw,$ZodUndefined:()=>Hw,$ZodUnion:()=>Fd,$ZodUnknown:()=>Zw,$ZodVoid:()=>Xw,$ZodXID:()=>Sw,$ZodXor:()=>iB,$brand:()=>ob,$constructor:()=>b,$input:()=>Pk,$output:()=>Fk,Doc:()=>Jo,INVALID:()=>fn,JSONSchema:()=>aj,JSONSchemaGenerator:()=>om,NEVER:()=>sb,TimePrecision:()=>Wk,URL_BAD_FORMAT:()=>Ew,URL_UNPARSEABLE:()=>$d,ZodCompileAsyncError:()=>Ur,ZodCompileUnsupportedError:()=>Ue,_any:()=>pS,_array:()=>IS,_base64:()=>Jh,_base64url:()=>Hh,_bigint:()=>oS,_boolean:()=>iS,_catch:()=>Yoe,_check:()=>zO,_cidrv4:()=>zh,_cidrv6:()=>qh,_coercedBigint:()=>aS,_coercedBoolean:()=>sS,_coercedDate:()=>yS,_coercedNumber:()=>Kk,_coercedString:()=>qk,_creditCard:()=>Hk,_cuid:()=>Ph,_cuid2:()=>Mh,_custom:()=>vS,_date:()=>mS,_decode:()=>Og,_decodeAsync:()=>Gg,_default:()=>qoe,_discriminatedUnion:()=>_oe,_e164:()=>Yh,_email:()=>xh,_emoji:()=>Uh,_encode:()=>Lg,_encodeAsync:()=>jg,_endsWith:()=>Zc,_enum:()=>Loe,_file:()=>CS,_float32:()=>eS,_float64:()=>tS,_gt:()=>ai,_gte:()=>er,_guid:()=>$h,_iban:()=>Yk,_includes:()=>Yc,_int:()=>Xk,_int32:()=>nS,_int64:()=>cS,_intersection:()=>Noe,_ipv4:()=>Gh,_ipv6:()=>Vh,_isoDate:()=>Wd,_isoDateTime:()=>Yd,_isoDuration:()=>Kd,_isoTime:()=>Zd,_jwt:()=>Wh,_ksuid:()=>jh,_lazy:()=>Xoe,_length:()=>ea,_literal:()=>joe,_lowercase:()=>Jc,_lt:()=>oi,_lte:()=>Xn,_mac:()=>Jk,_map:()=>Poe,_max:()=>Xn,_maxLength:()=>Xo,_maxSize:()=>xs,_mime:()=>Xc,_min:()=>er,_minLength:()=>Oi,_minSize:()=>ci,_multipleOf:()=>Rs,_nan:()=>ES,_nanoid:()=>Fh,_nativeEnum:()=>Ooe,_negative:()=>Kh,_never:()=>gS,_nonnegative:()=>em,_nonoptional:()=>Joe,_nonpositive:()=>Xh,_normalize:()=>eu,_null:()=>AS,_nullable:()=>zoe,_number:()=>Zk,_optional:()=>Voe,_overwrite:()=>Fr,_parse:()=>Fc,_parseAsync:()=>Pc,_pipe:()=>Woe,_positive:()=>Zh,_promise:()=>eae,_properties:()=>Kc,_property:()=>tm,_readonly:()=>Zoe,_record:()=>Foe,_refine:()=>bS,_regex:()=>qc,_safeDecode:()=>zg,_safeDecodeAsync:()=>Jg,_safeEncode:()=>Vg,_safeEncodeAsync:()=>qg,_safeParse:()=>Mc,_safeParseAsync:()=>Lc,_set:()=>Moe,_size:()=>Ko,_slugify:()=>iu,_startsWith:()=>Wc,_string:()=>zk,_stringFormat:()=>ta,_stringbool:()=>SS,_success:()=>Hoe,_superRefine:()=>wS,_symbol:()=>lS,_templateLiteral:()=>Koe,_toLowerCase:()=>nu,_toUpperCase:()=>ru,_transform:()=>Goe,_trim:()=>tu,_tuple:()=>Uoe,_uint32:()=>rS,_uint64:()=>uS,_ulid:()=>Lh,_undefined:()=>dS,_union:()=>Toe,_unknown:()=>fS,_uppercase:()=>Hc,_url:()=>Hd,_uuid:()=>Th,_uuidv4:()=>Dh,_uuidv6:()=>_h,_uuidv7:()=>Nh,_void:()=>hS,_xid:()=>Oh,_xor:()=>Doe,base64Charset:()=>uh,base64urlCharset:()=>Nd,canParseURL:()=>Iw,clone:()=>He,compile:()=>jk,compileFn:()=>Qh,config:()=>It,createStandardJSONSchemaMethod:()=>su,createToJSONSchemaMethod:()=>RS,decode:()=>Dre,decodeAsync:()=>Nre,describe:()=>BS,encode:()=>Tre,encodeAsync:()=>_re,extractDefs:()=>Ts,finalize:()=>Ds,flattenError:()=>bd,formatError:()=>wd,getDiscriminatedOption:()=>sB,globalConfig:()=>Ut,globalRegistry:()=>Gt,handleUnrepresentable:()=>Rt,initializeContext:()=>$s,isBackEdge:()=>wh,isRecursiveSchema:()=>bh,isValidBase64:()=>_d,isValidBase64URL:()=>lh,isValidCIDRv6:()=>ch,isValidCreditCard:()=>dh,isValidIBAN:()=>Ah,isValidIPv6:()=>Dd,isValidJWT:()=>ph,locales:()=>Jd,memoizer:()=>jd,mergeValues:()=>jc,meta:()=>kS,parse:()=>Pg,parseAsync:()=>Mg,parseURLObject:()=>bO,prettifyError:()=>db,process:()=>We,processSchema:()=>We,regexes:()=>mr,registry:()=>kh,safeDecode:()=>Fre,safeDecodeAsync:()=>Mre,safeEncode:()=>Ure,safeEncodeAsync:()=>Pre,safeParse:()=>Sre,safeParseAsync:()=>Qre,standardProps:()=>ih,stripTabAndNewline:()=>Td,toDotPath:()=>nO,toJSONSchema:()=>sm,toZod:()=>pd,treeifyError:()=>lb,urlHostnameOk:()=>oh,urlProtocolOk:()=>ah,util:()=>x,validate:()=>Bd,validateAsync:()=>kd,validateURL:()=>sh,version:()=>fw,withParser:()=>Sh});var x={};Cr(x,{BIGINT_FORMAT_RANGES:()=>yd,CONSTANT_CATCH:()=>Ug,Class:()=>Yv,NUMBER_FORMAT_RANGES:()=>md,aborted:()=>pn,allowsEval:()=>Kv,assert:()=>Jne,assertEqual:()=>Gne,assertIs:()=>zne,assertNever:()=>qne,assertNotEqual:()=>Vne,assignProp:()=>jt,attachSchema:()=>Ed,base64ToUint8Array:()=>WL,base64urlToUint8Array:()=>Are,cached:()=>Dc,captureStackTrace:()=>_g,cleanEnum:()=>dre,cleanRegex:()=>Mi,clone:()=>He,cloneDef:()=>Wne,codePointLength:()=>zo,constantCatch:()=>rb,createTransparentProxy:()=>nre,defineLazy:()=>Wv,defineLazyInternal:()=>Te,derived:()=>hre,esc:()=>An,escapeRegex:()=>hr,explicitlyAborted:()=>tb,extend:()=>sre,finalizeIssue:()=>Dn,floatSafeRemainder:()=>fd,getElementAtPath:()=>Zne,getEnumValues:()=>$c,getLengthableOrigin:()=>Cd,getParsedType:()=>tre,getSizableOrigin:()=>Id,hexToUint8Array:()=>fre,hide:()=>vd,installLazyProp:()=>Ire,isObject:()=>Vo,isPlainObject:()=>gr,issue:()=>Uc,joinValues:()=>w,jsonStringifyReplacer:()=>Tc,members:()=>nb,merge:()=>are,mergeDefs:()=>Nr,normalizeParams:()=>z,nullish:()=>Dg,numKeys:()=>ere,objectClone:()=>Hne,omit:()=>ire,optionalKeys:()=>eb,own:()=>ks,parsedType:()=>T,partial:()=>cre,pick:()=>rre,prefixIssues:()=>Tn,primitiveTypes:()=>Xv,promiseAllObject:()=>Kne,propertyKeyTypes:()=>hd,randomString:()=>Xne,rawShape:()=>_c,required:()=>ure,safeExtend:()=>ore,shallowClone:()=>gd,sizeCaps:()=>Nc,slugify:()=>Zv,stringifyPrimitive:()=>$,toZod:()=>pd,uint8ArrayToBase64:()=>ZL,uint8ArrayToBase64url:()=>pre,uint8ArrayToHex:()=>gre,unwrapMessage:()=>xc});function Gne(e){return e}o(Gne,"assertEqual");function Vne(e){return e}o(Vne,"assertNotEqual");function pd(){return e=>e}o(pd,"toZod");function zne(e){}o(zne,"assertIs");function qne(e){throw new Error("Unexpected value in exhaustive check")}o(qne,"assertNever");function Jne(e){}o(Jne,"assert");function $c(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}o($c,"getEnumValues");function w(e,t="|"){return e.map(n=>$(n)).join(t)}o(w,"joinValues");function Tc(e,t){return typeof t=="bigint"?t.toString():t}o(Tc,"jsonStringifyReplacer");var Hv=class{static{o(this,"Cached")}constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Dc(e){return new Hv(e)}o(Dc,"cached");function Dg(e){return e==null}o(Dg,"nullish");function Mi(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}o(Mi,"cleanRegex");function fd(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}o(fd,"floatSafeRemainder");var qL=Symbol("evaluating");function Wv(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==qL)return i===void 0&&(i=qL,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}o(Wv,"defineLazy");function Hne(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}o(Hne,"objectClone");function jt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}o(jt,"assignProp");function _c(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}o(_c,"rawShape");function Pi(e){return _c(e._zod.def)??e._zod.def.shape}o(Pi,"sourceShape");function JL(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return jt(this,t,i),i},enumerable:!0,configurable:!0})}o(JL,"deferProp");function HL(e,t,n){t in e?jt(e,t,n):e[t]=n}o(HL,"putProp");function Go(e,t,n,i){let r=Pi(t);for(let s of n){let a=Object.getOwnPropertyDescriptor(r,s);a.enumerable&&(a.get?JL(e,s,()=>{let c=t._zod.def.shape[s];return i?i(c,s):c}):HL(e,s,i?i(a.value,s):a.value))}}o(Go,"mirrorShape");function Yne(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?JL(e,n,()=>t[n]):HL(e,n,i.value))}}o(Yne,"mirrorProps");function Nr(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}o(Nr,"mergeDefs");function Wne(e){return Nr(e._zod.def)}o(Wne,"cloneDef");function Zne(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}o(Zne,"getElementAtPath");function Kne(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let s=0;s<t.length;s++)r[t[s]]=i[s];return r})}o(Kne,"promiseAllObject");function Xne(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}o(Xne,"randomString");function An(e){return JSON.stringify(e)}o(An,"esc");function Zv(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}o(Zv,"slugify");var _g="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Vo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Vo,"isObject");var Kv=Dc(()=>{if(Ut.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function gr(e){if(Vo(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Vo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}o(gr,"isPlainObject");function gd(e){return gr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}o(gd,"shallowClone");function ere(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}o(ere,"numKeys");var tre=o(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),hd=new Set(["string","number","symbol"]),Xv=new Set(["string","number","bigint","boolean","symbol","undefined"]);function hr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(hr,"escapeRegex");function He(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}o(He,"clone");function z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(z,"normalizeParams");function nre(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,s){return t??(t=e()),Reflect.set(t,i,r,s)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}o(nre,"createTransparentProxy");function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}o($,"stringifyPrimitive");function eb(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}o(eb,"optionalKeys");var md={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]},yd={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rre(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Go(s,e,Ng(e,t)),He(e,Nr(n,{shape:s,checks:[]}))}o(rre,"pick");function Ng(e,t){let n=Pi(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}o(Ng,"maskedKeys");function ire(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Ng(e,t)),a={};return Go(a,e,Reflect.ownKeys(Pi(e)).filter(c=>!s.has(c))),He(e,Nr(n,{shape:a,checks:[]}))}o(ire,"omit");function sre(e,t){if(!gr(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=Pi(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return He(e,Nr(e._zod.def,{shape:YL(e,t)}))}o(sre,"extend");function YL(e,t){let n={};return Go(n,e,Reflect.ownKeys(Pi(e))),Yne(n,t),n}o(YL,"extended");function ore(e,t){if(!gr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return He(e,Nr(e._zod.def,{shape:YL(e,t)}))}o(ore,"safeExtend");function are(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Go(n,e,Reflect.ownKeys(Pi(e))),Go(n,t,Reflect.ownKeys(Pi(t)));let i=Nr(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return He(e,i)}o(are,"merge");function cre(e,t,n,i="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let c=n?new Set(Ng(t,n)):void 0,u={};return Go(u,t,Reflect.ownKeys(Pi(t)),e&&((l,A)=>c&&!c.has(A)?l:new e({type:"optional",innerType:l}))),He(t,Nr(t._zod.def,{shape:u,checks:[]}))}o(cre,"partial");function ure(e,t,n){let i=n?new Set(Ng(t,n)):void 0,r={};return Go(r,t,Reflect.ownKeys(Pi(t)),(s,a)=>i&&!i.has(a)?s:new e({type:"nonoptional",innerType:s})),He(t,Nr(t._zod.def,{shape:r}))}o(ure,"required");function pn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}o(pn,"aborted");function tb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}o(tb,"explicitlyAborted");function Tn(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}o(Tn,"prefixIssues");function xc(e){return typeof e=="string"?e:e?.message}o(xc,"unwrapMessage");function Nc(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}o(Nc,"sizeCaps");function Ed(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}o(Ed,"attachSchema");function Dn(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:xc(e.inst?._zod.def?.error?.(e))??xc(s?.(e))??xc(t?.error?.(e))??xc(n.customError?.(e))??xc(n.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=a,t?.reportInput&&(c.input=e.input),c}o(Dn,"finalizeIssue");function Id(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}o(Id,"getSizableOrigin");var lre=/[\uD800-\uDBFF]/;function zo(e){let t=e.length;if(!lre.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}o(zo,"codePointLength");function Cd(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Cd,"getLengthableOrigin");function T(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}o(T,"parsedType");function Uc(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}o(Uc,"issue");function dre(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}o(dre,"cleanEnum");function WL(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}o(WL,"base64ToUint8Array");function ZL(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}o(ZL,"uint8ArrayToBase64");function Are(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return WL(t+n)}o(Are,"base64urlToUint8Array");function pre(e){return ZL(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}o(pre,"uint8ArrayToBase64url");function fre(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}o(fre,"hexToUint8Array");function gre(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}o(gre,"uint8ArrayToHex");var Yv=class{static{o(this,"Class")}constructor(...t){}};function nb(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):mre(e,n,i.value)}}o(nb,"members");function ks(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}o(ks,"own");function vd(e,t,n){return ks(e,t,n,!1)}o(vd,"hide");function hre(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return ks(this,n,i(this))},set(r){ks(this,n,r)}})}return t}o(hre,"derived");function mre(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ks(this,t,n.bind(this))},set(i){ks(this,t,i)}})}o(mre,"defineBound");function yre(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}o(yre,"claim");var Jv,Bs=!1,Ere={configurable:!0,get(){Bs=!0}};function Te(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&Jv!==e._zod){Jv=void 0;return}Jv=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,Ere);let r=Bs;Bs=!1;try{let s=n(this);return Bs?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),Bs=Bs||r,s}catch(s){throw delete this[t],Bs=Bs||r,s}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}o(Te,"defineLazyInternal");function Ire(e,t,n,i){let r=yre(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:s})}})}o(Ire,"installLazyProp");var Ug="~constantCatch";function rb(e){let t=o(()=>e,"fn");return t[Ug]=!0,t}o(rb,"constantCatch");var KL,sb=Object.freeze({status:"aborted"}),ib={value:void 0,enumerable:!1},XL="captureStackTrace"in Error?Error:null;function Cre(e){let t=XL;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return XL=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}o(Cre,"newError");function b(e,t,n,i){let r={};function s(g){this.def=g,this.constr=p,this.traits=new Set}o(s,"Internals"),s.prototype=r;let a=n,c=a&&new WeakSet;function u(g,h){if(g._zod){if(g._zod.traits.has(e))return}else{ib.value=new s(h);try{Object.defineProperty(g,"_zod",ib)}finally{ib.value=void 0}}if(g._zod.traits.add(e),t(g,h),c){let E=Object.getPrototypeOf(g),C=g._zod.constr.prototype,I=E;for(;I&&I!==C;)I=Object.getPrototypeOf(I);let v=I??E;c.has(v)||(c.add(v),nb(v,a))}let y=p.prototype;for(let E in y)Object.prototype.hasOwnProperty.call(y,E)&&(E in g||(g[E]=y[E].bind(g)))}o(u,"init");let l=i?.Parent??Object;class A extends l{static{o(this,"Definition")}}Object.defineProperty(A,"name",{value:e});function p(g){let h=i?.Parent?Cre(A):this;u(h,g);let y=h._zod.deferred;if(y){for(let C of y)C();h._zod.deferred=void 0}let E=globalThis.__zod_globalConfig?.postProcessor;return E&&E(h),h}return o(p,"_"),Object.defineProperty(p,"init",{value:u}),Object.defineProperty(p,Symbol.hasInstance,{value:o(g=>i?.Parent&&g instanceof i.Parent?!0:g?._zod?.traits?.has(e),"value")}),Object.defineProperty(p,"name",{value:e}),p}o(b,"$constructor");var ob=Symbol("zod_brand"),_n=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ss=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(KL=globalThis).__zod_globalConfig??(KL.__zod_globalConfig={});var Ut=globalThis.__zod_globalConfig;function It(e){return e&&Object.assign(Ut,e),Ut}o(It,"config");function vre(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Tc,2)),e.message}o(vre,"_getMessage");function bre(e){this._zod.message=e}o(bre,"_setMessage");var wre={get:vre,set:bre,enumerable:!0,configurable:!0},cb={value:void 0,enumerable:!1},eO=new WeakSet([Object.prototype,Error.prototype]),tO=o((e,t)=>{e.name="$ZodError",cb.value=t,Object.defineProperty(e,"issues",cb),cb.value=void 0,Object.defineProperty(e,"message",wre);let n=Object.getPrototypeOf(e);eO.has(n)||(eO.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=o(()=>this.message,"value");return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},"initializer"),ub=b("$ZodError",tO),Nn=b("$ZodError",tO,void 0,{Parent:Error});function Bre(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}o(Bre,"node");function bd(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?Bre(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}o(bd,"flattenError");function wd(e,t=n=>n.message){let n={_errors:[]},i=o((r,s=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...s,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...s,...a.path]);else{let c=[...s,...a.path];if(c.length===0)n._errors.push(t(a));else{let u=n,l=0;for(;l<c.length;){let A=c[l],p=l===c.length-1;if(A==="_errors"){p&&u._errors.push(t(a)),l++;continue}Object.prototype.hasOwnProperty.call(u,A)||Object.defineProperty(u,A,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=u[A];p&&g._errors.push(t(a)),u=g,l++}}}},"processError");return i(e),n}o(wd,"formatError");function lb(e,t=n=>n.message){let n={errors:[]},i=o((r,s=[])=>{var a;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...s,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...s,...c.path]);else{let u=[...s,...c.path];if(u.length===0){n.errors.push(t(c));continue}let l=n,A=0;for(;A<u.length;){let p=u[A],g=A===u.length-1;typeof p=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,p)||Object.defineProperty(l.properties,p,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[p]):(l.items??(l.items=[]),(a=l.items)[p]??(a[p]={errors:[]}),l=l.items[p]),g&&l.errors.push(t(c)),A++}}},"processError");return i(e),n}o(lb,"treeifyError");function nO(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}o(nO,"toDotPath");function db(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${nO(i.path)}`);return t.join(`
|
|
58
58
|
`)}o(db,"prettifyError");function Fg(e,t){return{callee:t?.callee??e,Err:t?.Err}}o(Fg,"finalizeParams");var Fc=o(e=>{let t=o((n,i,r,s)=>{let a=r?{...r,async:!1}:{async:!1},c=n._zod.run({value:i,issues:[]},a);if(c instanceof Promise)throw new _n;if(c.issues.length){let u=new(s?.Err??e)(c.issues.map(l=>Dn(l,a,It())));throw _g(u,s?.callee??t),u}return c.value},"fn");return t},"_parse"),Pg=Fc(Nn),Pc=o(e=>{let t=o(async(n,i,r,s)=>{let a=r?{...r,async:!0}:{async:!0},c=n._zod.run({value:i,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){let u=new(s?.Err??e)(c.issues.map(l=>Dn(l,a,It())));throw _g(u,s?.callee??t),u}return c.value},"fn");return t},"_parseAsync"),Mg=Pc(Nn),Mc=o(e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new _n;return s.issues.length?rO(e,s.issues,r):{success:!0,data:s.value}},"_safeParse"),Sre=Mc(Nn);function rO(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>Dn(r,n,It()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}o(rO,"failure");var Lc=o(e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?rO(e,s.issues,r):{success:!0,data:s.value}},"_safeParseAsync"),Qre=Lc(Nn),Rre=Symbol.for("zod.compile.invalid"),xre=Symbol.for("zod.compile.fallback"),Bd=o(((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==Rre)return!0;if(i.definite===!0&&n===void 0)return!1}return $re(e,t,n)}),"validate");function $re(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,s;if(r?(i[xre]=!0,s=r({value:t,issues:[]},i)):s=e._zod.run({value:t,issues:[]},i),s instanceof Promise)throw new _n;return s.issues.length===0}o($re,"validateFallback");var kd=o(async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},"validateAsync"),Lg=o(e=>{let t=Fc(e),n=o((i,r,s,a)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(i,r,c,Fg(n,a))},"fn");return n},"_encode"),Tre=Lg(Nn),Og=o(e=>{let t=Fc(e),n=o((i,r,s,a)=>t(i,r,s,Fg(n,a)),"fn");return n},"_decode"),Dre=Og(Nn),jg=o(e=>{let t=Pc(e),n=o(async(i,r,s,a)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(i,r,c,Fg(n,a))},"fn");return n},"_encodeAsync"),_re=jg(Nn),Gg=o(e=>{let t=Pc(e),n=o(async(i,r,s,a)=>await t(i,r,s,Fg(n,a)),"fn");return n},"_decodeAsync"),Nre=Gg(Nn),Vg=o(e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Mc(e)(t,n,r)},"_safeEncode"),Ure=Vg(Nn),zg=o(e=>(t,n,i)=>Mc(e)(t,n,i),"_safeDecode"),Fre=zg(Nn),qg=o(e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Lc(e)(t,n,r)},"_safeEncodeAsync"),Pre=qg(Nn),Jg=o(e=>async(t,n,i)=>Lc(e)(t,n,i),"_safeDecodeAsync"),Mre=Jg(Nn);var mr={};Cr(mr,{anyString:()=>Pb,base64:()=>Rb,base64url:()=>xb,bigint:()=>Lb,boolean:()=>Ob,browserEmail:()=>Jre,cidrv4:()=>Sb,cidrv6:()=>Qb,creditCard:()=>Hg,cuid:()=>pb,cuid2:()=>fb,currencyCode:()=>_b,date:()=>Nb,datetime:()=>Fb,domain:()=>Tb,duration:()=>Ib,e164:()=>Db,email:()=>vb,emoji:()=>bb,extendedDuration:()=>Lre,guid:()=>Cb,hex:()=>qb,hostname:()=>$b,html5Email:()=>Vre,httpProtocol:()=>Sd,iban:()=>Yg,idnEmail:()=>qre,integer:()=>Qd,ipv4:()=>wb,ipv6:()=>Bb,ksuid:()=>mb,lowercase:()=>Vb,mac:()=>kb,md5_base64:()=>Zre,md5_base64url:()=>Kre,md5_hex:()=>Wre,nanoid:()=>yb,nanoidOfLength:()=>Eb,null:()=>jb,number:()=>Li,rfc5322Email:()=>zre,sha1_base64:()=>eie,sha1_base64url:()=>tie,sha1_hex:()=>Xre,sha256_base64:()=>rie,sha256_base64url:()=>iie,sha256_hex:()=>nie,sha384_base64:()=>oie,sha384_base64url:()=>aie,sha384_hex:()=>sie,sha512_base64:()=>uie,sha512_base64url:()=>lie,sha512_hex:()=>cie,string:()=>Mb,time:()=>Ub,ulid:()=>gb,undefined:()=>Gb,unicodeEmail:()=>iO,uppercase:()=>zb,uuid:()=>qo,uuid4:()=>Ore,uuid6:()=>jre,uuid7:()=>Gre,xid:()=>hb});var pb=/^[cC][0-9a-z]{6,}$/,fb=/^[0-9a-z]+$/,gb=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,hb=/^[0-9a-vA-V]{20}$/,mb=/^[A-Za-z0-9]{27}$/,yb=/^[a-zA-Z0-9_-]{21}$/;function Eb(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}o(Eb,"nanoidOfLength");var Ib=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Lre=/^[-+]?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)?)??$/,Cb=/^([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})$/,qo=o(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[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)$/,"uuid"),Ore=qo(4),jre=qo(6),Gre=qo(7),vb=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vre=/^[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])?)*$/,zre=/^(([^<>()\[\]\\.,;:\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,}))$/,iO=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,qre=iO,Jre=/^[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])?)*$/,Hre="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function bb(){return new RegExp(Hre,"u")}o(bb,"emoji");var wb=/^(?:(?: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])$/,Bb=/^(([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}|:))$/,kb=o(e=>{let t=hr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),Sb=/^((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])$/,Qb=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xb=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,$b=/^(?=.{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])?)*\.?$/,Tb=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Sd=/^https?$/,Db=/^\+[1-9]\d{6,14}$/,Hg=/^\d(?:[ -]?\d){11,18}$/,_b=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Yg=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,sO="(?:(?:\\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])))";function Yre(e){return new RegExp(`^${e}$`)}o(Yre,"anchor");var Nb=Yre(sO);function Ab(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}o(Ab,"timeSource");function Ub(e){return new RegExp(`^${Ab(e)}$`)}o(Ub,"time");function Fb(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${Ab({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${Ab({precision:e.precision})}`:n;return new RegExp(`^${sO}T(?:${i})$`)}o(Fb,"datetime");var Pb=/^[\s\S]{0,}$/,Mb=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Lb=/^-?\d+n?$/,Qd=/^-?\d+$/,Li=/^-?\d+(?:\.\d+)?$/,Ob=/^(?:true|false)$/i,jb=/^null$/i;var Gb=/^undefined$/i;var Vb=/^[^A-Z]*$/,zb=/^[^a-z]*$/,qb=/^[0-9a-fA-F]*$/;function Rd(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}o(Rd,"fixedBase64");function xd(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}o(xd,"fixedBase64url");var Wre=/^[0-9a-fA-F]{32}$/,Zre=Rd(22,"=="),Kre=xd(22),Xre=/^[0-9a-fA-F]{40}$/,eie=Rd(27,"="),tie=xd(27),nie=/^[0-9a-fA-F]{64}$/,rie=Rd(43,"="),iie=xd(43),sie=/^[0-9a-fA-F]{96}$/,oie=Rd(64,""),aie=xd(64),cie=/^[0-9a-fA-F]{128}$/,uie=Rd(86,"=="),lie=xd(86);var it=b("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Jb=o(e=>{let t=e.value;return!Dg(t)&&t.size!==void 0},"_whenHasSize"),Hb=o(e=>{let t=e.value;return!Dg(t)&&t.length!==void 0},"_whenHasLength"),Wg={number:"number",bigint:"bigint",object:"date"},Kg=b("$ZodCheckLessThan",(e,t)=>{it.init(e,t);let n=Wg[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:Wg[typeof i.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xg=b("$ZodCheckGreaterThan",(e,t)=>{it.init(e,t);let n=Wg[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:Wg[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yb=b("$ZodCheckMultipleOf",(e,t)=>{it.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):fd(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Wb=b("$ZodCheckNumberFormat",(e,t)=>{it.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,s]=md[t.format];e._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});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:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}c<r&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Zb=b("$ZodCheckBigIntFormat",(e,t)=>{it.init(e,t);let[n,i]=yd[t.format];e._zod.check=r=>{let s=r.value;s<n&&r.issues.push({origin:"bigint",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&r.issues.push({origin:"bigint",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Kb=b("$ZodCheckMaxSize",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=Jb),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Id(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Xb=b("$ZodCheckMinSize",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=Jb),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Id(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ew=b("$ZodCheckSizeEquals",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=Jb),e._zod.check=i=>{let r=i.value,s=r.size;if(s===t.size)return;let a=s>t.size;i.issues.push({origin:Id(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),tw=b("$ZodCheckMaxLength",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=Hb),e._zod.check=i=>{let r=i.value,s=r.length;if((typeof r=="string"&&s>t.maximum?zo(r):s)<=t.maximum)return;let c=Cd(r);i.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nw=b("$ZodCheckMinLength",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=Hb),e._zod.check=i=>{let r=i.value,s=r.length;if((typeof r=="string"&&s>=t.minimum&&s<t.minimum*2?zo(r):s)>=t.minimum)return;let c=Cd(r);i.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rw=b("$ZodCheckLengthEquals",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=Hb),e._zod.check=i=>{let r=i.value,s=r.length,a=typeof r=="string"&&s>=t.length&&s<=t.length*2?zo(r):s;if(a===t.length)return;let c=Cd(r),u=a>t.length;i.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Oc=b("$ZodCheckStringFormat",(e,t)=>{var n,i;it.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),iw=b("$ZodCheckRegex",(e,t)=>{Oc.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),sw=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Vb),Oc.init(e,t)}),ow=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zb),Oc.init(e,t)}),aw=b("$ZodCheckIncludes",(e,t)=>{it.init(e,t);let n=hr(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),cw=b("$ZodCheckStartsWith",(e,t)=>{it.init(e,t);let n=new RegExp(`^${hr(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),uw=b("$ZodCheckEndsWith",(e,t)=>{it.init(e,t);let n=new RegExp(`.*${hr(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Zg(e,t,n){e.issues.length&&t.issues.push(...Tn(n,e.issues))}o(Zg,"handleCheckPropertyResult");var lw=b("$ZodCheckProperty",(e,t)=>{it.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Zg(r,n,t.property));Zg(i,n,t.property)}}),dw=b("$ZodCheckProperties",(e,t)=>{it.init(e,t),vd(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(a=>[a,t.shape[a]]));let r=i.value,s;for(let[a,c]of n){let u=c._zod.run({value:r[a],issues:[]},{});u instanceof Promise?(s??(s=[]),s.push(u.then(l=>Zg(l,i,a)))):Zg(u,i,a)}if(s)return Promise.all(s).then(()=>{})}}),Aw=b("$ZodCheckMimeType",(e,t)=>{it.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),pw=b("$ZodCheckOverwrite",(e,t)=>{it.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var Jo=class{static{o(this,"Doc")}constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
59
59
|
`).filter(a=>a),r=Math.min(...i.map(a=>a.length-a.trimStart().length)),s=i.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of s)this.content.push(a)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
@@ -117,7 +117,7 @@ ${u}
|
|
|
117
117
|
|
|
118
118
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(t===a[0]){s(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(c.cycle){s(a);continue}c.count>1&&e.reused==="ref"&&s(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}o(Ts,"extractDefs");function YO(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let i of t){if(!i||typeof i!="object")return;YO(i);let r=Object.keys(i);if(r.length!==1||r[0]!=="type")return;let s=i.type;for(let a of Array.isArray(s)?s:[s]){if(typeof a!="string")return;n.includes(a)||n.push(a)}}delete e.anyOf,e.type=n.length===1?n[0]:n}o(YO,"compactTypeUnion");var WO=new Set(["type","properties","required","additionalProperties"]),JO=["oneOf","anyOf"];function HO(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}o(HO,"undeclaredConstraint");function QS(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let a in s)if(!WO.has(a))return null;t.push(s)}let n={},i=new Set;for(let s of t){for(let a in s.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;let c=[];for(let l of t){let A=l.properties?.[a]??HO(l);A!=null&&(c.some(p=>JSON.stringify(p)===JSON.stringify(A))||c.push(A))}let u=c.length===1?c[0]:QS(c)??{allOf:c};jt(n,a,u)}for(let a of s.required??[])i.add(a)}let r={type:"object",properties:n};if(i.size&&(r.required=[...i]),t.every(s=>s.additionalProperties===!1))r.additionalProperties=!1;else{let s=[];for(let a of t){let c=HO(a);c&&!s.some(u=>JSON.stringify(u)===JSON.stringify(c))&&s.push(c)}s.length===1?r.additionalProperties=s[0]:s.length>1&&(r.additionalProperties={allOf:s})}return r}o(QS,"foldObjects");function tae(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let r of WO)if(r in e)return;let n=t.filter(r=>JO.some(s=>Array.isArray(r[s]))),i=null;if(!n.length)i=QS(t);else{let r=n[0],s=JO.find(u=>Array.isArray(r[u]));if(Object.keys(r).length!==1)return;let a=t.filter(u=>u!==r),c=r[s].map(u=>QS([...a,u]));if(c.some(u=>!u))return;i={[s]:c}}i&&(delete e.allOf,Xd(e,i))}o(tae,"foldIntersection");function Ds(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=o(c=>{let u=e.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,A={...l},p=u.ref;if(u.ref=null,p){i(p);let h=e.seen.get(p),y=h.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(y)):Xd(l,y),Xd(l,A),c._zod.parent===p)for(let C in l)C==="$ref"||C==="allOf"||C in A||delete l[C];if(y.$ref&&h.def)for(let C in l)C==="$ref"||C==="allOf"||C in h.def&&JSON.stringify(l[C])===JSON.stringify(h.def[C])&&delete l[C]}let g=c._zod.parent;if(g&&g!==p){i(g);let h=e.seen.get(g);if(h?.schema.$ref&&(l.$ref=h.schema.$ref,h.def))for(let y in l)y==="$ref"||y==="allOf"||y in h.def&&JSON.stringify(l[y])===JSON.stringify(h.def[y])&&delete l[y]}e.override({zodSchema:c,jsonSchema:l,path:u.path??[]})},"flattenRef");if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())i(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())YO(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let l of[u.schema,u.def]){let A=l?.allOf;if(!Array.isArray(A))continue;let p=c.get(A);p?p.push(l):c.set(A,[l])}for(let u of e.intersections)for(let l of c.get(u)??[])tae(l)}}let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(c)}Xd(r,n.defId?n.schema:n.def??n.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&r.id===s&&delete r.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,jt(a,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?r.$defs=a:r.definitions=a);try{let c=JSON.parse(JSON.stringify(r));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:su(t,"input",e.processors),output:su(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}o(Ds,"finalize");function gn(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return gn(i.element,n);if(i.type==="set")return gn(i.valueType,n);if(i.type==="lazy")return gn(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return gn(i.innerType,n);if(i.type==="intersection")return gn(i.left,n)||gn(i.right,n);if(i.type==="record"||i.type==="map")return gn(i.keyType,n)||gn(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gn(i.in,n)||gn(i.out,n);if(i.type==="object"){for(let r in i.shape)if(gn(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(gn(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(gn(r,n))return!0;return!!(i.rest&&gn(i.rest,n))}return!1}o(gn,"isTransforming");var RS=o((e,t={})=>n=>{let i=$s({...n,processors:t});return We(e,i),Ts(i,e),Ds(i,e)},"createToJSONSchemaMethod"),su=o((e,t,n={})=>i=>{let{libraryOptions:r,target:s}=i??{},a=$s({...r??{},target:s,io:t,processors:n});return We(e,a),Ts(a,e),Ds(a,e)},"createStandardJSONSchemaMethod");var ou=o((e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},"narrowMin"),au=o((e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},"narrowMax"),ZO=o((e,t)=>{ou(e,"minimum",t),au(e,"maximum",t)},"narrowBoth"),tj=o((e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},"addDivisor"),nj=o((e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},"addPattern"),rj=o((e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},"intersectMime"),ij=o((e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},"setFormat"),KO=o((e,t)=>ou(e,"minimum",t.minimum),"minContributor"),XO=o((e,t)=>au(e,"maximum",t.maximum),"maxContributor"),ej=o(e=>(t,n)=>{ij(t,n.format);let[i,r]=e[n.format];ou(t,"minimum",i),au(t,"maximum",r)},"formatContributor"),nae={greater_than:o((e,t)=>ou(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),"greater_than"),less_than:o((e,t)=>au(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),"less_than"),multiple_of:o((e,t)=>tj(e,t.value),"multiple_of"),number_format:ej(md),bigint_format:ej(yd),min_length:KO,max_length:XO,length_equals:o((e,t)=>ZO(e,t.length),"length_equals"),min_size:KO,max_size:XO,size_equals:o((e,t)=>ZO(e,t.size),"size_equals"),string_format:o((e,t)=>{ij(e,t.format),t.pattern&&nj(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},"string_format"),mime_type:o((e,t)=>rj(e,t.mime),"mime_type")};function xt(e){let t={},n=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let s of i)nae[s._zod.def.check]?.(t,s._zod.def);let r=e._zod.bag;r.minimum!==void 0&&ou(t,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&ou(t,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&au(t,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&au(t,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&tj(t,r.multipleOf),r.format!==void 0&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&rj(t,r.mime);for(let s of r.patterns??[])nj(t,s);return t}o(xt,"aggregateChecks");var rae={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},iae=new Map([[uh,Rb],[Nd,xb]]),sj=o(e=>iae.get(e)??e,"exactPattern"),TS=o((e,t,n,i)=>{let r=n;r.type="string";let{minimum:s,maximum:a,format:c,patterns:u,contentEncoding:l,laxFormat:A}=xt(e);if(typeof s=="number"&&(r.minLength=s),typeof a=="number"&&(r.maxLength=a),c&&(r.format=rae[c]??c,r.format===""&&delete r.format,(c==="time"||A)&&delete r.format),l&&(r.contentEncoding=l),u&&u.size>0){let p=[...u].map(sj);p.length===1?r.pattern=p[0].source:p.length>1&&(r.allOf=[...p.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},"stringProcessor"),DS=o((e,t,n,i)=>{let r=n,{minimum:s,maximum:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l,isInt:A}=xt(e);r.type=A?"integer":"number";let p=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),g=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(p?h?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof s=="number"&&(r.minimum=s),g?h?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u:typeof a=="number"&&(r.maximum=a),c){let y=new Set;for(let I of c)Number.isFinite(I)&&I!==0?y.add(Math.abs(I)):Rt(e,t,r,i,`A multipleOf divisor of ${I} cannot be represented in JSON Schema`);let[E,...C]=y;E!==void 0&&(r.multipleOf=E),C.length&&(r.allOf=[...r.allOf??[],...C.map(I=>({multipleOf:I}))])}},"numberProcessor"),_S=o((e,t,n,i)=>{n.type="boolean"},"booleanProcessor"),NS=o((e,t,n,i)=>{Rt(e,t,n,i,"BigInt cannot be represented in JSON Schema")},"bigintProcessor"),US=o((e,t,n,i)=>{Rt(e,t,n,i,"Symbols cannot be represented in JSON Schema")},"symbolProcessor"),FS=o((e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},"nullProcessor"),PS=o((e,t,n,i)=>{Rt(e,t,n,i,"Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),MS=o((e,t,n,i)=>{Rt(e,t,n,i,"Void cannot be represented in JSON Schema")},"voidProcessor"),LS=o((e,t,n,i)=>{n.not={}},"neverProcessor"),OS=o((e,t,n,i)=>{},"anyProcessor"),jS=o((e,t,n,i)=>{},"unknownProcessor"),GS=o((e,t,n,i)=>{Rt(e,t,n,i,"Date cannot be represented in JSON Schema")},"dateProcessor"),VS=o((e,t,n,i)=>{let r=e._zod.def,s=$c(r.entries);if(s.length===0){n.not={};return}s.every(a=>typeof a=="number")&&(n.type="number"),s.every(a=>typeof a=="string")&&(n.type="string"),n.enum=s},"enumProcessor"),zS=o((e,t,n,i)=>{let r=e._zod.def;if(r.values.length===0){n.not={};return}let s=[];for(let a of r.values)if(a===void 0){if(Rt(e,t,n,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(Rt(e,t,n,i,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){let a=s[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else s.every(a=>typeof a=="number")&&(n.type="number"),s.every(a=>typeof a=="string")&&(n.type="string"),s.every(a=>typeof a=="boolean")&&(n.type="boolean"),s.every(a=>a===null)&&(n.type="null"),n.enum=s},"literalProcessor"),qS=o((e,t,n,i)=>{Rt(e,t,n,i,"NaN cannot be represented in JSON Schema")},"nanProcessor"),JS=o((e,t,n,i)=>{let r=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=s.source},"templateLiteralProcessor"),HS=o((e,t,n,i)=>{let r=n;r.type="string",r.format="binary",r.contentEncoding="binary";let{minimum:s,maximum:a,mime:c}=xt(e);s!==void 0&&(r.minLength=s),a!==void 0&&(r.maxLength=a),c&&(c.length===0?r.not={}:c.length===1?r.contentMediaType=c[0]:r.anyOf=c.map(u=>({contentMediaType:u})))},"fileProcessor"),YS=o((e,t,n,i)=>{n.type="boolean"},"successProcessor"),WS=o((e,t,n,i)=>{Rt(e,t,n,i,"Custom types cannot be represented in JSON Schema")},"customProcessor"),ZS=o((e,t,n,i)=>{Rt(e,t,n,i,"Function types cannot be represented in JSON Schema")},"functionProcessor"),KS=o((e,t,n,i)=>{Rt(e,t,n,i,"Transforms cannot be represented in JSON Schema")},"transformProcessor"),XS=o((e,t,n,i)=>{Rt(e,t,n,i,"Map cannot be represented in JSON Schema")},"mapProcessor"),eQ=o((e,t,n,i)=>{Rt(e,t,n,i,"Set cannot be represented in JSON Schema")},"setProcessor"),tQ=o((e,t,n,i)=>{let r=n,s=e._zod.def,{minimum:a,maximum:c}=xt(e);typeof a=="number"&&(r.minItems=a),typeof c=="number"&&(r.maxItems=c),r.type="array",r.items=We(s.element,t,{...i,path:[...i.path,"items"]})},"arrayProcessor");function eA(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?eA(t.out):t.type==="catch"?eA(t.innerType):e._zod.optin}o(eA,"inputOptin");var nQ=o((e,t,n,i)=>{let r=n,s=e._zod.def,a=s.shape;if(Object.getOwnPropertySymbols(a).length&&Rt(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;r.type="object",r.properties={};for(let l in a)jt(r.properties,l,We(a[l],t,{...i,path:[...i.path,"properties",l]}));let u=[];for(let l of Object.keys(a)){let A=s.shape[l];(t.io==="input"?eA(A)===void 0:A._zod.optout===void 0)&&u.push(l)}u.length>0&&(r.required=u),s.catchall?._zod.def.type==="never"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=We(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},"objectProcessor"),rm=o((e,t,n,i)=>{let r=e._zod.def,s=r.inclusive===!1,a=r.options.map((c,u)=>We(c,t,{...i,path:[...i.path,s?"oneOf":"anyOf",u]}));s?n.oneOf=a:n.anyOf=a},"unionProcessor"),rQ=o((e,t,n,i)=>{let r=e._zod.def,s=We(r.left,t,{...i,path:[...i.path,"allOf",0]}),a=We(r.right,t,{...i,path:[...i.path,"allOf",1]}),c=o(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),u=[...c(s)?s.allOf:[s],...c(a)?a.allOf:[a]];n.allOf=u,t.intersections.push(u)},"intersectionProcessor"),iQ=o((e,t,n,i)=>{let r=n,s=e._zod.def;r.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=s.items.map((E,C)=>We(E,t,{...i,path:[...i.path,a,C]})),l=s.rest?We(s.rest,t,{...i,path:[...i.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null,A=s.items.length;for(;A>0;){let E=s.items[A-1];if(!(t.io==="input"?eA(E)!==void 0:E._zod.optout==="optional"))break;A--}let p=s.items.length,g=!s.rest;t.target==="draft-2020-12"?(r.prefixItems=u,g?r.items=!1:l&&(r.items=l),A>0&&(r.minItems=A),g&&(r.maxItems=p)):t.target==="openapi-3.0"?(r.items={anyOf:u},l&&r.items.anyOf.push(l),A>0&&(r.minItems=A),g&&(r.maxItems=p)):(r.items=u,g?r.additionalItems=!1:l&&(r.additionalItems=l),A>0&&(r.minItems=A),g&&(r.maxItems=p));let{minimum:h,maximum:y}=xt(e);typeof h=="number"&&(r.minItems=h),typeof y=="number"&&(r.maxItems=y)},"tupleProcessor");function xS(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let y=e.get(t)?.def;if(!y)return t;let E=xS(e,y,n);return E===y?t:E}for(let y of["anyOf","oneOf"]){let E=t[y];if(!Array.isArray(E))continue;let C=E.map(I=>xS(e,I,n));C.some((I,v)=>I!==E[v])&&(t={...t,[y]:C})}let i=Array.isArray(t.type)?t.type:[t.type],r=!i.includes("string")&&i.some(y=>y==="number"||y==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!r&&!s?.some(y=>typeof y=="number"))return t;let{minimum:a,maximum:c,exclusiveMinimum:u,exclusiveMaximum:l,multipleOf:A,format:p,id:g,...h}=t;return h.enum?h.enum=h.enum.map(y=>typeof y=="number"?String(y):y):typeof h.const=="number"&&(h.const=String(h.const)),r&&(h.type="string",s||(h.pattern=(i.includes("number")?Li:Qd).source)),h}o(xS,"stringifyKeyNames");var $S=new WeakMap;function sae(e){let t=new Map;for(let i of e.seen.values())i.def&&!t.has(i.schema)&&t.set(i.schema,i);let n=new Map;for(let i of $S.get(e)??[]){let r=e.seen.get(i),s=(r?.def??r?.schema)?.propertyNames;if(!s||s===!0||n.has(s))continue;let a=xS(t,s,new Set);a!==s&&n.set(s,a)}if(n.size)for(let i of e.seen.values())for(let r of[i.schema,i.def]){let s=r&&n.get(r.propertyNames);s&&(r.propertyNames=s)}}o(sae,"rewriteKeyNames");var sQ=o((e,t,n,i)=>{let r=n,s=e._zod.def;r.type="object";let a=s.keyType,c=xt(a).patterns;if(s.mode==="loose"&&c&&c.size>0){let A=We(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let p of c)jt(r.patternProperties,sj(p).source,A)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){r.propertyNames=We(s.keyType,t,{...i,path:[...i.path,"propertyNames"]});let A=$S.get(t);A||(A=[],$S.set(t,A),t.deferred.push(()=>sae(t))),A.push(e)}r.additionalProperties=We(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let u=a._zod.values,l=t.io==="input"&&eA(s.valueType)!==void 0;if(u&&!s.partial&&!l){let A=[...u].filter(p=>typeof p=="string"||typeof p=="number");A.length>0&&(r.required=A.map(String))}},"recordProcessor"),oQ=o((e,t,n,i)=>{let r=e._zod.def,s=We(r.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=r.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},"nullableProcessor"),aQ=o((e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let s=t.seen.get(e);s.ref=r.innerType},"nonoptionalProcessor"),cQ=Symbol();function oj(e,t,n,i,r){let s=!1,a=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(s=!0,null));return s?(Rt(t,n,i,r,"BigInt defaults cannot be represented in JSON Schema"),cQ):JSON.parse(a)}o(oj,"serializeDefaultValue");var uQ=o((e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let s=t.seen.get(e);s.ref=r.innerType;let a=oj(r.defaultValue,e,t,n,i);a!==cQ&&(n.default=a)},"defaultProcessor"),lQ=o((e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let s=t.seen.get(e);if(s.ref=r.innerType,t.io!=="input")return;let a=oj(r.defaultValue,e,t,n,i);a!==cQ&&(n._prefault=a)},"prefaultProcessor"),dQ=o((e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let s=t.seen.get(e);s.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{Rt(e,t,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=a},"catchProcessor"),AQ=o((e,t,n,i)=>{let r=e._zod.def,s=r.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?r.out:r.in:r.out;We(a,t,i);let c=t.seen.get(e);c.ref=a},"pipeProcessor"),pQ=o((e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let s=t.seen.get(e);s.ref=r.innerType,n.readOnly=!0},"readonlyProcessor"),fQ=o((e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let s=t.seen.get(e);s.ref=r.innerType},"promiseProcessor"),im=o((e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let s=t.seen.get(e);s.ref=r.innerType},"optionalProcessor"),gQ=o((e,t,n,i)=>{let r=e._zod.innerType;We(r,t,i);let s=t.seen.get(e);s.ref=r},"lazyProcessor"),nm={string:TS,number:DS,boolean:_S,bigint:NS,symbol:US,null:FS,undefined:PS,void:MS,never:LS,any:OS,unknown:jS,date:GS,enum:VS,literal:zS,nan:qS,template_literal:JS,file:HS,success:YS,custom:WS,function:ZS,transform:KS,map:XS,set:eQ,array:tQ,object:nQ,union:rm,intersection:rQ,tuple:iQ,record:sQ,nullable:oQ,nonoptional:aQ,default:uQ,prefault:lQ,catch:dQ,pipe:AQ,readonly:pQ,promise:fQ,optional:im,lazy:gQ};function sm(e,t){if("_idmap"in e){let i=e,r=$s({...t,processors:nm}),s={};for(let u of i._idmap.entries()){let[l,A]=u;We(A,r)}let a={},c={registry:i,uri:t?.uri,defs:s};r.external=c;for(let u of i._idmap.entries()){let[l,A]=u;Ts(r,A),jt(a,l,Ds(r,A))}if(Object.keys(s).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:s}}return{schemas:a}}let n=$s({...t,processors:nm});return We(e,n),Ts(n,e),Ds(n,e)}o(sm,"toJSONSchema");var om=class{static{o(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=$s({processors:nm,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return We(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Ts(this.ctx,t);let i=Ds(this.ctx,t),{"~standard":r,...s}=i;return s}};var aj={};var gu={};Cr(gu,{ZodAny:()=>FQ,ZodArray:()=>OQ,ZodBase64:()=>Bm,ZodBase64URL:()=>km,ZodBigInt:()=>pu,ZodBigIntFormat:()=>Rm,ZodBoolean:()=>Au,ZodCIDRv4:()=>bm,ZodCIDRv6:()=>wm,ZodCUID:()=>hm,ZodCUID2:()=>mm,ZodCatch:()=>cR,ZodCodec:()=>lA,ZodCreditCard:()=>RQ,ZodCustom:()=>dA,ZodCustomStringFormat:()=>sa,ZodDate:()=>iA,ZodDefault:()=>nR,ZodDiscriminatedUnion:()=>GQ,ZodE164:()=>Sm,ZodEmail:()=>Am,ZodEmoji:()=>fm,ZodEnum:()=>uu,ZodExactOptional:()=>Dm,ZodFile:()=>KQ,ZodFunction:()=>yR,ZodGUID:()=>pm,ZodIBAN:()=>xQ,ZodIPv4:()=>Cm,ZodIPv6:()=>vm,ZodISODate:()=>Ns,ZodISODateTime:()=>_s,ZodISODuration:()=>Fs,ZodISOTime:()=>Us,ZodInstanceOf:()=>CR,ZodIntersection:()=>VQ,ZodJWT:()=>Qm,ZodKSUID:()=>Im,ZodLazy:()=>gR,ZodLiteral:()=>ZQ,ZodMAC:()=>QQ,ZodMap:()=>YQ,ZodNaN:()=>lR,ZodNanoID:()=>gm,ZodNever:()=>MQ,ZodNonOptional:()=>_m,ZodNull:()=>NQ,ZodNullable:()=>tR,ZodNumber:()=>du,ZodNumberFormat:()=>oa,ZodObject:()=>oA,ZodOptional:()=>cA,ZodPipe:()=>uA,ZodPrefault:()=>iR,ZodPreprocess:()=>dR,ZodPromise:()=>mR,ZodReadonly:()=>AR,ZodRecord:()=>cu,ZodSet:()=>WQ,ZodString:()=>lu,ZodStringFormat:()=>Ke,ZodSuccess:()=>aR,ZodSymbol:()=>DQ,ZodTemplateLiteral:()=>fR,ZodTransform:()=>XQ,ZodTuple:()=>qQ,ZodType:()=>xe,ZodULID:()=>ym,ZodURL:()=>rA,ZodUUID:()=>ui,ZodUndefined:()=>_Q,ZodUnion:()=>aA,ZodUnknown:()=>PQ,ZodVoid:()=>LQ,ZodXID:()=>Em,ZodXor:()=>jQ,_ZodString:()=>dm,_default:()=>rR,_function:()=>E1,any:()=>Wj,array:()=>sA,base64:()=>xj,base64url:()=>$j,bigint:()=>zj,boolean:()=>TQ,catch:()=>uR,check:()=>I1,cidrv4:()=>Qj,cidrv6:()=>Rj,codec:()=>g1,creditCard:()=>Dj,cuid:()=>Ij,cuid2:()=>Cj,currencyCode:()=>Mj,custom:()=>C1,date:()=>Kj,describe:()=>v1,discriminatedUnion:()=>i1,e164:()=>Tj,email:()=>lj,emoji:()=>yj,enum:()=>$m,exactOptional:()=>eR,file:()=>d1,float32:()=>Oj,float64:()=>jj,function:()=>E1,guid:()=>dj,hash:()=>Lj,hex:()=>Pj,hostname:()=>Fj,httpUrl:()=>mj,iban:()=>_j,instanceof:()=>w1,int:()=>um,int32:()=>Gj,int64:()=>qj,intersection:()=>zQ,invertCodec:()=>h1,ipv4:()=>Bj,ipv6:()=>Sj,json:()=>k1,jwt:()=>Nj,keyof:()=>Xj,ksuid:()=>wj,lazy:()=>hR,literal:()=>l1,looseObject:()=>n1,looseRecord:()=>o1,mac:()=>kj,map:()=>a1,meta:()=>b1,nan:()=>f1,nanoid:()=>Ej,nativeEnum:()=>u1,never:()=>xm,nonoptional:()=>oR,null:()=>UQ,nullable:()=>nA,nullish:()=>A1,number:()=>$Q,object:()=>e1,optional:()=>ra,partialRecord:()=>s1,pipe:()=>lm,prefault:()=>sR,preprocess:()=>S1,promise:()=>y1,readonly:()=>pR,record:()=>HQ,refine:()=>ER,set:()=>c1,strictObject:()=>t1,string:()=>tA,stringFormat:()=>Uj,stringbool:()=>B1,success:()=>p1,superRefine:()=>IR,symbol:()=>Hj,templateLiteral:()=>m1,transform:()=>Tm,tuple:()=>JQ,uint32:()=>Vj,uint64:()=>Jj,ulid:()=>vj,undefined:()=>Yj,union:()=>fu,unknown:()=>na,url:()=>hj,uuid:()=>Aj,uuidv4:()=>pj,uuidv6:()=>fj,uuidv7:()=>gj,void:()=>Zj,xid:()=>bj,xor:()=>r1});var am={};Cr(am,{endsWith:()=>Zc,gt:()=>ai,gte:()=>er,includes:()=>Yc,length:()=>ea,lowercase:()=>Jc,lt:()=>oi,lte:()=>Xn,maxLength:()=>Xo,maxSize:()=>xs,mime:()=>Xc,minLength:()=>Oi,minSize:()=>ci,multipleOf:()=>Rs,negative:()=>Kh,nonnegative:()=>em,nonpositive:()=>Xh,normalize:()=>eu,overwrite:()=>Fr,positive:()=>Zh,properties:()=>Kc,property:()=>tm,regex:()=>qc,size:()=>Ko,slugify:()=>iu,startsWith:()=>Wc,toLowerCase:()=>nu,toUpperCase:()=>ru,trim:()=>tu,uppercase:()=>Hc});var cj=new WeakSet([Object.prototype,Error.prototype]);function cm(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let i=n(this);return Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0})}})}o(cm,"_lazyMethod");var uj=o((e,t)=>{ub.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);cj.has(n)||(cj.add(n),cm(n,"format",i=>r=>wd(i,r)),cm(n,"flatten",i=>r=>bd(i,r)),cm(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,Tc,2)}),cm(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,Tc,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},"initializer"),aae=b("ZodError",uj),Un=b("ZodError",uj,void 0,{Parent:Error});var hQ=Fc(Un),mQ=Pc(Un),yQ=Mc(Un),EQ=Lc(Un),IQ=Lg(Un),CQ=Og(Un),vQ=jg(Un),bQ=Gg(Un),wQ=Vg(Un),BQ=zg(Un),kQ=qg(Un),SQ=Jg(Un);function uae(){Ut.localeError||It(Gd())}o(uae,"_ensureDefaultLocale");function ia(){Ut.memoizer||It({memoizer:jd()})}o(ia,"_ensureDefaultMemoizer");var xe=b("ZodType",(e,t)=>(uae(),Be.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(x.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return He(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(ER(e,t))},superRefine(e,t){return this.check(IR(e,t))},overwrite(e){return this.check(Fr(e))},optional(){return ra(this)},exactOptional(){return eR(this)},nullable(){return nA(this)},nullish(){return ra(nA(this))},nonoptional(e){return oR(this,e)},array(){return sA(this)},or(e){return fu([this,e])},and(e){return zQ(this,e)},transform(e){return lm(this,Tm(e))},default(e){return rR(this,e)},prefault(e){return sR(this,e)},catch(e){return uR(this,e)},pipe(e){return lm(this,e)},readonly(){return pR(this)},describe(e){let t=this.clone();return Gt.add(t,{description:e}),t},meta(...e){if(e.length===0)return Gt.get(this);let t=this.clone();return Gt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return x.hide(this,"~standard",{...ih(this),jsonSchema:{input:su(this,"input"),output:su(this,"output")}})},set"~standard"(e){x.own(this,"~standard",e)},parse:o(function e(t,n){return hQ(this,t,n,{callee:e})},"_parse"),parseAsync:o(async function e(t,n){return await mQ(this,t,n,{callee:e})},"_parseAsync"),safeParse(e,t){return yQ(this,e,t)},async safeParseAsync(e,t){return EQ(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){x.own(this,"spa",e)},validate(e,t){return Bd(this,e,t)},validateAsync(e,t){return kd(this,e,t)},encode:o(function e(t,n){return IQ(this,t,n,{callee:e})},"_encode"),decode:o(function e(t,n){return CQ(this,t,n,{callee:e})},"_decode"),encodeAsync:o(async function e(t,n){return await vQ(this,t,n,{callee:e})},"_encodeAsync"),decodeAsync:o(async function e(t,n){return await bQ(this,t,n,{callee:e})},"_decodeAsync"),safeEncode(e,t){return wQ(this,e,t)},safeDecode(e,t){return BQ(this,e,t)},async safeEncodeAsync(e,t){return kQ(this,e,t)},async safeDecodeAsync(e,t){return SQ(this,e,t)},toJSONSchema(e){return RS(this,{})(e)},get description(){return Gt.get(this)?.description},get _def(){return this._zod.def}}),dm=b("_ZodString",(e,t)=>{Ho.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>TS(e,n,i,r)},x.derived({format:o(e=>xt(e).format??null,"format"),minLength:o(e=>xt(e).minimum??null,"minLength"),maxLength:o(e=>xt(e).maximum??null,"maxLength")},{regex(...e){return this.check(qc(...e))},includes(...e){return this.check(Yc(...e))},startsWith(...e){return this.check(Wc(...e))},endsWith(...e){return this.check(Zc(...e))},min(...e){return this.check(Oi(...e))},max(...e){return this.check(Xo(...e))},length(...e){return this.check(ea(...e))},nonempty(...e){return this.check(Oi(1,...e))},lowercase(e){return this.check(Jc(e))},uppercase(e){return this.check(Hc(e))},trim(){return this.check(tu())},normalize(...e){return this.check(eu(...e))},toLowerCase(){return this.check(nu())},toUpperCase(){return this.check(ru())},slugify(){return this.check(iu())}})),lu=b("ZodString",(e,t)=>{Ho.init(e,t),dm.init(e,t)},{email(e){return this.check(xh(Am,e))},url(e){return this.check(Hd(rA,e))},jwt(e){return this.check(Wh(Qm,e))},emoji(e){return this.check(Uh(fm,e))},guid(e){return this.check($h(pm,e))},uuid(e){return this.check(Th(ui,e))},uuidv4(e){return this.check(Dh(ui,e))},uuidv6(e){return this.check(_h(ui,e))},uuidv7(e){return this.check(Nh(ui,e))},nanoid(e){return this.check(Fh(gm,e))},cuid(e){return this.check(Ph(hm,e))},cuid2(e){return this.check(Mh(mm,e))},ulid(e){return this.check(Lh(ym,e))},base64(e){return this.check(Jh(Bm,e))},base64url(e){return this.check(Hh(km,e))},xid(e){return this.check(Oh(Em,e))},ksuid(e){return this.check(jh(Im,e))},ipv4(e){return this.check(Gh(Cm,e))},ipv6(e){return this.check(Vh(vm,e))},cidrv4(e){return this.check(zh(bm,e))},cidrv6(e){return this.check(qh(wm,e))},e164(e){return this.check(Yh(Sm,e))},datetime(e){return this.check(Yd(_s,e))},date(e){return this.check(Wd(Ns,e))},time(e){return this.check(Zd(Us,e))},duration(e){return this.check(Kd(Fs,e))}});function tA(e){return zk(lu,e)}o(tA,"string");var Ke=b("ZodStringFormat",(e,t)=>{Ye.init(e,t),dm.init(e,t)}),_s=b("ZodISODateTime",(e,t)=>{Rw.init(e,t),Ke.init(e,t)}),Ns=b("ZodISODate",(e,t)=>{xw.init(e,t),Ke.init(e,t)}),Us=b("ZodISOTime",(e,t)=>{$w.init(e,t),Ke.init(e,t)}),Fs=b("ZodISODuration",(e,t)=>{Tw.init(e,t),Ke.init(e,t)}),Am=b("ZodEmail",(e,t)=>{yw.init(e,t),Ke.init(e,t)});function lj(e){return xh(Am,e)}o(lj,"email");var pm=b("ZodGUID",(e,t)=>{hw.init(e,t),Ke.init(e,t)});function dj(e){return $h(pm,e)}o(dj,"guid");var ui=b("ZodUUID",(e,t)=>{mw.init(e,t),Ke.init(e,t)});function Aj(e){return Th(ui,e)}o(Aj,"uuid");function pj(e){return Dh(ui,e)}o(pj,"uuidv4");function fj(e){return _h(ui,e)}o(fj,"uuidv6");function gj(e){return Nh(ui,e)}o(gj,"uuidv7");var rA=b("ZodURL",(e,t)=>{Cw.init(e,t),Ke.init(e,t)});function hj(e){return Hd(rA,e)}o(hj,"url");function mj(e){return Hd(rA,{protocol:Sd,hostname:Tb,...x.normalizeParams(e)})}o(mj,"httpUrl");var fm=b("ZodEmoji",(e,t)=>{vw.init(e,t),Ke.init(e,t)});function yj(e){return Uh(fm,e)}o(yj,"emoji");var gm=b("ZodNanoID",(e,t)=>{bw.init(e,t),Ke.init(e,t)});function Ej(e){return Fh(gm,e)}o(Ej,"nanoid");var hm=b("ZodCUID",(e,t)=>{ww.init(e,t),Ke.init(e,t)});function Ij(e){return Ph(hm,e)}o(Ij,"cuid");var mm=b("ZodCUID2",(e,t)=>{Bw.init(e,t),Ke.init(e,t)});function Cj(e){return Mh(mm,e)}o(Cj,"cuid2");var ym=b("ZodULID",(e,t)=>{kw.init(e,t),Ke.init(e,t)});function vj(e){return Lh(ym,e)}o(vj,"ulid");var Em=b("ZodXID",(e,t)=>{Sw.init(e,t),Ke.init(e,t)});function bj(e){return Oh(Em,e)}o(bj,"xid");var Im=b("ZodKSUID",(e,t)=>{Qw.init(e,t),Ke.init(e,t)});function wj(e){return jh(Im,e)}o(wj,"ksuid");var Cm=b("ZodIPv4",(e,t)=>{Dw.init(e,t),Ke.init(e,t)});function Bj(e){return Gh(Cm,e)}o(Bj,"ipv4");var QQ=b("ZodMAC",(e,t)=>{Nw.init(e,t),Ke.init(e,t)});function kj(e){return Jk(QQ,e)}o(kj,"mac");var vm=b("ZodIPv6",(e,t)=>{_w.init(e,t),Ke.init(e,t)});function Sj(e){return Vh(vm,e)}o(Sj,"ipv6");var bm=b("ZodCIDRv4",(e,t)=>{Uw.init(e,t),Ke.init(e,t)});function Qj(e){return zh(bm,e)}o(Qj,"cidrv4");var wm=b("ZodCIDRv6",(e,t)=>{Fw.init(e,t),Ke.init(e,t)});function Rj(e){return qh(wm,e)}o(Rj,"cidrv6");var Bm=b("ZodBase64",(e,t)=>{Pw.init(e,t),Ke.init(e,t)});function xj(e){return Jh(Bm,e)}o(xj,"base64");var km=b("ZodBase64URL",(e,t)=>{Mw.init(e,t),Ke.init(e,t)});function $j(e){return Hh(km,e)}o($j,"base64url");var Sm=b("ZodE164",(e,t)=>{Lw.init(e,t),Ke.init(e,t)});function Tj(e){return Yh(Sm,e)}o(Tj,"e164");var RQ=b("ZodCreditCard",(e,t)=>{Ow.init(e,t),Ke.init(e,t)});function Dj(e){return Hk(RQ,e)}o(Dj,"creditCard");var xQ=b("ZodIBAN",(e,t)=>{jw.init(e,t),Ke.init(e,t)});function _j(e){return Yk(xQ,e)}o(_j,"iban");var Qm=b("ZodJWT",(e,t)=>{Gw.init(e,t),Ke.init(e,t)});function Nj(e){return Wh(Qm,e)}o(Nj,"jwt");var sa=b("ZodCustomStringFormat",(e,t)=>{Vw.init(e,t),Ke.init(e,t)});function Uj(e,t,n={}){return ta(sa,e,t,n)}o(Uj,"stringFormat");function Fj(e){return ta(sa,"hostname",$b,e)}o(Fj,"hostname");function Pj(e){return ta(sa,"hex",qb,e)}o(Pj,"hex");function Mj(e){return ta(sa,"currency_code",_b,e)}o(Mj,"currencyCode");function Lj(e,t){let n=t?.enc??"hex",i=`${e}_${n}`,r=mr[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return ta(sa,i,r,t)}o(Lj,"hash");var du=b("ZodNumber",(e,t)=>{fh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>DS(e,n,i,r),e.isFinite=!0},x.derived({minValue:o(e=>{let{minimum:t,exclusiveMinimum:n}=xt(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},"minValue"),maxValue:o(e=>{let{maximum:t,exclusiveMaximum:n}=xt(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},"maxValue"),isInt:o(e=>{let{isInt:t,multipleOf:n}=xt(e);return!!t||!!n?.some(Number.isSafeInteger)},"isInt"),format:o(e=>xt(e).format??null,"format")},{gt(e,t){return this.check(ai(e,t))},gte(e,t){return this.check(er(e,t))},min(e,t){return this.check(er(e,t))},lt(e,t){return this.check(oi(e,t))},lte(e,t){return this.check(Xn(e,t))},max(e,t){return this.check(Xn(e,t))},int(e){return this.check(um(e))},safe(e){return this.check(um(e))},positive(e){return this.check(ai(0,e))},nonnegative(e){return this.check(er(0,e))},negative(e){return this.check(oi(0,e))},nonpositive(e){return this.check(Xn(0,e))},multipleOf(e,t){return this.check(Rs(e,t))},step(e,t){return this.check(Rs(e,t))},finite(){return this}}));function $Q(e){return Zk(du,e)}o($Q,"number");var oa=b("ZodNumberFormat",(e,t)=>{zw.init(e,t),du.init(e,t)});function um(e){return Xk(oa,e)}o(um,"int");function Oj(e){return eS(oa,e)}o(Oj,"float32");function jj(e){return tS(oa,e)}o(jj,"float64");function Gj(e){return nS(oa,e)}o(Gj,"int32");function Vj(e){return rS(oa,e)}o(Vj,"uint32");var Au=b("ZodBoolean",(e,t)=>{Ud.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_S(e,n,i,r)});function TQ(e){return iS(Au,e)}o(TQ,"boolean");var pu=b("ZodBigInt",(e,t)=>{gh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>NS(e,n,i,r)},x.derived({minValue:o(e=>xt(e).minimum??null,"minValue"),maxValue:o(e=>xt(e).maximum??null,"maxValue"),format:o(e=>xt(e).format??null,"format")},{gte(e,t){return this.check(er(e,t))},min(e,t){return this.check(er(e,t))},gt(e,t){return this.check(ai(e,t))},lt(e,t){return this.check(oi(e,t))},lte(e,t){return this.check(Xn(e,t))},max(e,t){return this.check(Xn(e,t))},positive(e){return this.check(ai(BigInt(0),e))},negative(e){return this.check(oi(BigInt(0),e))},nonpositive(e){return this.check(Xn(BigInt(0),e))},nonnegative(e){return this.check(er(BigInt(0),e))},multipleOf(e,t){return this.check(Rs(e,t))}}));function zj(e){return oS(pu,e)}o(zj,"bigint");var Rm=b("ZodBigIntFormat",(e,t)=>{qw.init(e,t),pu.init(e,t)});function qj(e){return cS(Rm,e)}o(qj,"int64");function Jj(e){return uS(Rm,e)}o(Jj,"uint64");var DQ=b("ZodSymbol",(e,t)=>{Jw.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>US(e,n,i,r)});function Hj(e){return lS(DQ,e)}o(Hj,"symbol");var _Q=b("ZodUndefined",(e,t)=>{Hw.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>PS(e,n,i,r)});function Yj(e){return dS(_Q,e)}o(Yj,"_undefined");var NQ=b("ZodNull",(e,t)=>{Yw.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>FS(e,n,i,r)});function UQ(e){return AS(NQ,e)}o(UQ,"_null");var FQ=b("ZodAny",(e,t)=>{Ww.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>OS(e,n,i,r)});function Wj(){return pS(FQ)}o(Wj,"any");var PQ=b("ZodUnknown",(e,t)=>{Zw.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>jS(e,n,i,r)});function na(){return fS(PQ)}o(na,"unknown");var MQ=b("ZodNever",(e,t)=>{Kw.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>LS(e,n,i,r)});function xm(e){return gS(MQ,e)}o(xm,"never");var LQ=b("ZodVoid",(e,t)=>{Xw.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>MS(e,n,i,r)});function Zj(e){return hS(LQ,e)}o(Zj,"_void");var iA=b("ZodDate",(e,t)=>{eB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>GS(e,n,i,r),e.min=(n,i)=>e.check(er(n,i)),e.max=(n,i)=>e.check(Xn(n,i))},x.derived({minDate:o(e=>{let{minimum:t}=xt(e);return t?new Date(t):null},"minDate"),maxDate:o(e=>{let{maximum:t}=xt(e);return t?new Date(t):null},"maxDate")},{}));function Kj(e){return mS(iA,e)}o(Kj,"date");var OQ=b("ZodArray",(e,t)=>{ia(),nB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>tQ(e,n,i,r),e.element=t.element},{min(e,t){return this.check(Oi(e,t))},nonempty(e){return this.check(Oi(1,e))},max(e,t){return this.check(Xo(e,t))},length(e,t){return this.check(ea(e,t))},unwrap(){return this.element}});function sA(e,t){return IS(OQ,e,t)}o(sA,"array");function Xj(e){let t=e._zod.def.shape;return $m(Object.keys(t))}o(Xj,"keyof");var oA=b("ZodObject",(e,t)=>{ia(),rB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>nQ(e,n,i,r),x.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return $m(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(x.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(x.mergeDefs(this._zod.def,{catchall:na()}))},loose(){return this.clone(x.mergeDefs(this._zod.def,{catchall:na()}))},strict(){return this.clone(x.mergeDefs(this._zod.def,{catchall:xm()}))},strip(){return this.clone(x.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return x.extend(this,e)},safeExtend(e){return x.safeExtend(this,e)},merge(e){return x.merge(this,e)},pick(e){return x.pick(this,e)},omit(e){return x.omit(this,e)},partial(...e){return x.partial(cA,this,e[0])},exactPartial(...e){return x.partial(Dm,this,e[0],"exactPartial")},required(...e){return x.required(_m,this,e[0])}});function e1(e,t){let n={type:"object",shape:e??{},...x.normalizeParams(t)};return new oA(n)}o(e1,"object");function t1(e,t){return new oA({type:"object",shape:e,catchall:xm(),...x.normalizeParams(t)})}o(t1,"strictObject");function n1(e,t){return new oA({type:"object",shape:e,catchall:na(),...x.normalizeParams(t)})}o(n1,"looseObject");var aA=b("ZodUnion",(e,t)=>{Fd.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>rm(e,n,i,r),e.options=t.options});function fu(e,t){return new aA({type:"union",options:e,...x.normalizeParams(t)})}o(fu,"union");var jQ=b("ZodXor",(e,t)=>{aA.init(e,t),iB.init(e,t),e._zod.processJSONSchema=(n,i,r)=>rm(e,n,i,r),e.options=t.options});function r1(e,t){return new jQ({type:"union",options:e,inclusive:!1,...x.normalizeParams(t)})}o(r1,"xor");var GQ=b("ZodDiscriminatedUnion",(e,t)=>{aA.init(e,t),oB.init(e,t)});function i1(e,t,n){return new GQ({type:"union",options:t,discriminator:e,...x.normalizeParams(n)})}o(i1,"discriminatedUnion");var VQ=b("ZodIntersection",(e,t)=>{aB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>rQ(e,n,i,r)});function zQ(e,t){return new VQ({type:"intersection",left:e,right:t})}o(zQ,"intersection");var qQ=b("ZodTuple",(e,t)=>{ia(),hh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>iQ(e,n,i,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new cA({type:"optional",innerType:t}))})}});function JQ(e,t,n){let i=t instanceof Be,r=i?n:t,s=i?t:null;return new qQ({type:"tuple",items:e,rest:s,...x.normalizeParams(r)})}o(JQ,"tuple");var cu=b("ZodRecord",(e,t)=>{ia(),cB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>sQ(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType});function HQ(e,t,n){return!t||!t._zod?new cu({type:"record",keyType:tA(),valueType:e,...x.normalizeParams(t)}):new cu({type:"record",keyType:e,valueType:t,...x.normalizeParams(n)})}o(HQ,"record");function s1(e,t,n){return new cu({type:"record",keyType:e,valueType:t,...x.normalizeParams(n),partial:!0})}o(s1,"partialRecord");function o1(e,t,n){return new cu({type:"record",keyType:e,valueType:t,mode:"loose",...x.normalizeParams(n)})}o(o1,"looseRecord");var YQ=b("ZodMap",(e,t)=>{ia(),uB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>XS(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(ci(...n)),e.nonempty=n=>e.check(ci(1,n)),e.max=(...n)=>e.check(xs(...n)),e.size=(...n)=>e.check(Ko(...n))});function a1(e,t,n){return new YQ({type:"map",keyType:e,valueType:t,...x.normalizeParams(n)})}o(a1,"map");var WQ=b("ZodSet",(e,t)=>{ia(),lB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>eQ(e,n,i,r),e.min=(...n)=>e.check(ci(...n)),e.nonempty=n=>e.check(ci(1,n)),e.max=(...n)=>e.check(xs(...n)),e.size=(...n)=>e.check(Ko(...n))});function c1(e,t){return new WQ({type:"set",valueType:e,...x.normalizeParams(t)})}o(c1,"set");var uu=b("ZodEnum",(e,t)=>{dB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(i,r,s)=>VS(e,i,r,s),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(i,r)=>{let s={};for(let a of i)if(n.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new uu({...t,checks:[],...x.normalizeParams(r),entries:s})},e.exclude=(i,r)=>{let s={...t.entries};for(let a of i)if(n.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new uu({...t,checks:[],...x.normalizeParams(r),entries:s})}});function $m(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new uu({type:"enum",entries:n,...x.normalizeParams(t)})}o($m,"_enum");function u1(e,t){return new uu({type:"enum",entries:e,...x.normalizeParams(t)})}o(u1,"nativeEnum");var ZQ=b("ZodLiteral",(e,t)=>{AB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>zS(e,n,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function l1(e,t){return new ZQ({type:"literal",values:Array.isArray(e)?e:[e],...x.normalizeParams(t)})}o(l1,"literal");var KQ=b("ZodFile",(e,t)=>{pB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>HS(e,n,i,r),e.min=(n,i)=>e.check(ci(n,i)),e.max=(n,i)=>e.check(xs(n,i)),e.mime=(n,i)=>e.check(Xc(Array.isArray(n)?n:[n],i))});function d1(e){return CS(KQ,e)}o(d1,"file");var XQ=b("ZodTransform",(e,t)=>{ia(),fB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>KS(e,n,i,r),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Ss(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(x.issue(s,n.value,t));else{let a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=n.value),a.inst??(a.inst=e),n.issues.push(x.issue(a))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(s=>(n.value=s,n)):(n.value=r,n)}});function Tm(e){return new XQ({type:"transform",transform:e})}o(Tm,"transform");var cA=b("ZodOptional",(e,t)=>{mh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>im(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function ra(e){return new cA({type:"optional",innerType:e})}o(ra,"optional");var Dm=b("ZodExactOptional",(e,t)=>{gB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>im(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function eR(e){return new Dm({type:"optional",innerType:e})}o(eR,"exactOptional");var tR=b("ZodNullable",(e,t)=>{hB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>oQ(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function nA(e){return new tR({type:"nullable",innerType:e})}o(nA,"nullable");function A1(e){return ra(nA(e))}o(A1,"nullish");var nR=b("ZodDefault",(e,t)=>{mB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>uQ(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function rR(e,t){return new nR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():x.shallowClone(t)}})}o(rR,"_default");var iR=b("ZodPrefault",(e,t)=>{yB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>lQ(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function sR(e,t){return new iR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():x.shallowClone(t)}})}o(sR,"prefault");var _m=b("ZodNonOptional",(e,t)=>{EB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>aQ(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function oR(e,t){return new _m({type:"nonoptional",innerType:e,...x.normalizeParams(t)})}o(oR,"nonoptional");var aR=b("ZodSuccess",(e,t)=>{IB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>YS(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function p1(e){return new aR({type:"success",innerType:e})}o(p1,"success");var cR=b("ZodCatch",(e,t)=>{CB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>dQ(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function uR(e,t){return new cR({type:"catch",innerType:e,catchValue:typeof t=="function"?t:x.constantCatch(t)})}o(uR,"_catch");var lR=b("ZodNaN",(e,t)=>{vB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>qS(e,n,i,r)});function f1(e){return ES(lR,e)}o(f1,"nan");var uA=b("ZodPipe",(e,t)=>{yh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>AQ(e,n,i,r),e.in=t.in,e.out=t.out});function lm(e,t){return new uA({type:"pipe",in:e,out:t})}o(lm,"pipe");var lA=b("ZodCodec",(e,t)=>{uA.init(e,t),Pd.init(e,t)});function g1(e,t,n){return new lA({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}o(g1,"codec");function h1(e){let t=e._zod.def;return new lA({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}o(h1,"invertCodec");var dR=b("ZodPreprocess",(e,t)=>{uA.init(e,t),bB.init(e,t)}),AR=b("ZodReadonly",(e,t)=>{wB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>pQ(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function pR(e){return new AR({type:"readonly",innerType:e})}o(pR,"readonly");var fR=b("ZodTemplateLiteral",(e,t)=>{BB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>JS(e,n,i,r)});function m1(e,t){return new fR({type:"template_literal",parts:e,...x.normalizeParams(t)})}o(m1,"templateLiteral");var gR=b("ZodLazy",(e,t)=>{Md.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>gQ(e,n,i,r),e.unwrap=()=>e._zod.def.getter()});function hR(e){return new gR({type:"lazy",getter:e})}o(hR,"lazy");var mR=b("ZodPromise",(e,t)=>{SB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>fQ(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function y1(e){return new mR({type:"promise",innerType:e})}o(y1,"promise");var yR=b("ZodFunction",(e,t)=>{kB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ZS(e,n,i,r)});function E1(e){return new yR({type:"function",input:Array.isArray(e?.input)?JQ(e?.input):e?.input??sA(na()),output:e?.output??na()})}o(E1,"_function");var dA=b("ZodCustom",(e,t)=>{QB.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>WS(e,n,i,r)});function I1(e){let t=new it({check:"custom"});return t._zod.check=e,t}o(I1,"check");function C1(e,t){return vS(dA,e??(()=>!0),t)}o(C1,"custom");function ER(e,t={}){return bS(dA,e,t)}o(ER,"refine");function IR(e,t){return wS(e,t)}o(IR,"superRefine");var v1=BS,b1=kS,CR=b("ZodInstanceOf",(e,t)=>{dA.init(e,t)},{properties(e,t){return this.check(Kc(e,t))}});function w1(e,t={}){let n=new CR({type:"custom",check:"custom",fn:o(i=>i instanceof e,"fn"),abort:!0,...x.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}o(w1,"_instanceof");var B1=o((...e)=>SS({Codec:lA,Boolean:Au,String:lu},...e),"stringbool");function k1(e){let t=hR(()=>fu([tA(e),$Q(),TQ(),UQ(),sA(t),HQ(tA(),t)]));return t}o(k1,"json");function S1(e,t){return new dR({type:"pipe",in:Tm(e),out:t})}o(S1,"preprocess");var lae={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function dae(e){It({customError:e})}o(dae,"setErrorMap");function Aae(){return It().customError}o(Aae,"getErrorMap");var vR;vR||(vR={});var AA={};Cr(AA,{ZodISODate:()=>Ns,ZodISODateTime:()=>_s,ZodISODuration:()=>Fs,ZodISOTime:()=>Us,date:()=>fae,datetime:()=>pae,duration:()=>hae,time:()=>gae});function pae(e){return Yd(_s,e)}o(pae,"datetime");function fae(e){return Wd(Ns,e)}o(fae,"date");function gae(e){return Zd(Us,e)}o(gae,"time");function hae(e){return Kd(Fs,e)}o(hae,"duration");var X={...gu,...am,iso:AA},mae=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function yae(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}o(yae,"detectVersion");function Q1(e,t){return e.map((n,i)=>i<t?n:n.optional())}o(Q1,"applyMinItems");function Eae(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(Eae,"decodeJSONPointerSegment");function Iae(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1]===void 0?void 0:Eae(n[1]);if(!r||!t.defs[r])throw new Error(`Reference not found: ${e}`);return t.defs[r]}throw new Error(`Reference not found: ${e}`)}o(Iae,"resolveRef");function Cae(e,t){return X.transform(i=>i).check(i=>{let r=i.value;if(typeof r!="object"||r===null||Array.isArray(r))return;let s=Object.getOwnPropertyNames(r);if(t.minProperties!==void 0&&s.length<t.minProperties&&i.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:r,inst:e,continue:!0}),t.maxProperties!==void 0&&s.length>t.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:r,inst:e,continue:!0}),t.keySchema)for(let a of s){let c=t.keySchema.safeParse(a);c.success||i.issues.push({code:"invalid_key",origin:"record",issues:c.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}o(Cae,"checkObjectGuards");function bR(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let i=String(e);return`${n[0]}${i.length}:${i}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let s=[];for(let a of e){let c=bR(a,t);if(c===null)return null;s.push(c)}return`a${s.length}:[${s.join(",")}]`}let i=Object.keys(e).sort(),r=[];for(let s of i){let a=bR(e[s],t);if(a===null)return null;r.push(`${s.length}:${s}=${a}`)}return`o${r.length}:{${r.join(",")}}`}finally{t.delete(e)}}o(bR,"canonicalKey");var vae=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),bae=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function pA(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(pA):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>vae.has(t)?pA(n):!bae.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(pA))}o(pA,"containsRef");function R1(e){return e===1?"element":"elements"}o(R1,"plural");function wae(e,t){return X.transform(i=>i).check(i=>{let r=i.value;if(Array.isArray(r)){if(t.uniqueItems===!0){let s=new Map;for(let a=0;a<r.length;a++){let c=bR(r[a],new Set);if(c===null)continue;let u=s.get(c);if(u===void 0){s.set(c,a);continue}i.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${u}`,input:r,path:[a],continue:!0})}}if(t.containsSchema){let s=t.minContains??1,a=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,c=0;for(let u of r)if(t.containsSchema.safeParse(u).success&&++c>=a)break;c<s&&i.issues.push({code:"custom",message:`Array must contain at least ${s} matching ${R1(s)}; found ${c}`,input:r,continue:!0}),t.maxContains!==void 0&&c>t.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${R1(t.maxContains)}`,input:r,continue:!0})}}}).pipe(e)}o(wae,"checkArrayGuards");function x1(e,t){if(e!==!1)return e===void 0||e===!0?X.any():hn(e,t)}o(x1,"getTupleRest");var Bae=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function $1(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return X.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return X.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let s=Iae(r,t),a=hn(s,t);return t.refs.set(r,a),t.processing.delete(r),a}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return X.null();if(r.length===0)return X.never();if(r.length===1)return X.literal(r[0]);if(r.every(a=>typeof a=="string"))return X.enum(r);let s=r.map(a=>X.literal(a));return s.length<2?s[0]:X.union([s[0],s[1],...s.slice(2)])}if(e.const!==void 0)return X.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(s=>{let a={...e,type:s};return $1(a,t)});return r.length===0?X.never():r.length===1?r[0]:X.union(r)}if(!n)return X.any();let i;switch(n){case"string":{let r=X.string();if(e.format){let s=e.format;s==="email"?r=r.check(X.email()):s==="uri"||s==="uri-reference"?r=r.check(X.url()):s==="uuid"||s==="guid"?r=r.check(X.uuid()):s==="date-time"?r=r.check(X.iso.datetime({offset:!0})):s==="date"?r=r.check(X.iso.date()):s==="time"?r=r.check(X.regex(Bae)):s==="duration"?r=r.check(X.iso.duration()):s==="hostname"?r=r.check(X.hostname()):s==="ipv4"?r=r.check(X.ipv4()):s==="ipv6"?r=r.check(X.ipv6()):s==="mac"?r=r.check(X.mac()):s==="cidr"?r=r.check(X.cidrv4()):s==="cidr-v6"?r=r.check(X.cidrv6()):s==="base64"?r=r.check(X.base64()):s==="base64url"?r=r.check(X.base64url()):s==="e164"?r=r.check(X.e164()):s==="credit_card"?r=r.check(X.creditCard()):s==="iban"?r=r.check(X.iban()):s==="jwt"?r=r.check(X.jwt()):s==="emoji"?r=r.check(X.emoji()):s==="nanoid"?r=r.check(X.nanoid()):s==="cuid"?r=r.check(X.cuid()):s==="cuid2"?r=r.check(X.cuid2()):s==="ulid"?r=r.check(X.ulid()):s==="xid"?r=r.check(X.xid()):s==="ksuid"&&(r=r.check(X.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?X.number().int():X.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),i=r;break}case"boolean":{i=X.boolean();break}case"null":{i=X.null();break}case"object":{let r={},s=e.properties||{},a=new Set(e.required||[]),c=typeof e.additionalProperties=="object"?hn(e.additionalProperties,t):void 0;for(let[p,g]of Object.entries(s)){let h=hn(g,t);jt(r,p,a.has(p)?h:h.optional())}if(e.patternProperties){let p=e.patternProperties,g=Object.keys(p),h=[];for(let E of g){let C=hn(p[E],t),I=X.string().regex(new RegExp(E));h.push(X.looseRecord(I,C))}let y=[];if(Object.keys(r).length>0&&y.push(X.object(r).passthrough()),y.push(...h),y.length===0)i=X.object({}).passthrough();else if(y.length===1)i=y[0];else{let E=X.intersection(y[0],y[1]);for(let C=2;C<y.length;C++)E=X.intersection(E,y[C]);i=E}if(e.additionalProperties===!1){let E=Object.keys(r),C=g.map(v=>new RegExp(v)),I=i;i=i.check(v=>{if(!gr(v.value))return;let D=[];for(let N of Object.keys(v.value))E.includes(N)||C.some(W=>W.test(N))||D.push(N);D.length&&v.issues.push({code:"unrecognized_keys",keys:D,input:v.value,inst:I})})}}else{let p=X.object(r);e.additionalProperties===!1?i=p.strict():c?i=p.catchall(c):i=p.passthrough()}let u=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,A=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(u||l!==void 0||A!==void 0){let p;if(u){let g=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=hn(g,t)}i=Cae(i,{keySchema:p,minProperties:l,maxProperties:A})}break}case"array":{let r=e.prefixItems,s=e.items;if(r&&Array.isArray(r)){let a=typeof e.minItems=="number"?e.minItems:0,c=r.map(p=>hn(p,t)),u=Q1(c,a),l=Array.isArray(s)?void 0:x1(s,t),A=X.tuple(u);i=l?A.rest(l):A,typeof e.minItems=="number"&&(i=i.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(X.maxLength(e.maxItems)))}else if(Array.isArray(s)){let a=typeof e.minItems=="number"?e.minItems:0,c=s.map(p=>hn(p,t)),u=Q1(c,a),l=x1(e.additionalItems,t),A=X.tuple(u);i=l?A.rest(l):A,typeof e.minItems=="number"&&(i=i.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(X.maxLength(e.maxItems)))}else if(s!==void 0){let a=hn(s,t),c=X.array(a);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),i=c}else i=X.array(X.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=wae(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?hn(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return i}o($1,"convertBaseSchema");function hn(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n=$1(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>hn(l,t)),u=X.union(c);n=i?X.intersection(n,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>hn(l,t)),u=X.xor(c);n=i?X.intersection(n,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=i?n:X.any();else{let c=i?n:hn(e.allOf[0],t),u=i?0:1;for(let l=u;l<e.allOf.length;l++)c=X.intersection(c,hn(e.allOf[l],t));n=c}e.nullable===!0&&t.version==="openapi-3.0"&&(n=X.nullable(n)),e.readOnly===!0&&(n=X.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let r={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of s)c in e&&(r[c]=e[c]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let c of a)c in e&&(r[c]=e[c]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!pA(e.propertyNames)&&(r.propertyNames=e.propertyNames);for(let c of["minProperties","maxProperties"])e[c]!==void 0&&(r[c]=e[c])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!pA(e.contains)&&(r.contains=e.contains);for(let c of["uniqueItems","minContains","maxContains"])e[c]!==void 0&&(r[c]=e[c])}for(let c of Object.keys(e))mae.has(c)||jt(r,c,e[c]);return Object.keys(r).length>0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}o(hn,"convertSchema");function T1(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=yae(n,t?.defaultTarget),r=n.$defs||n.definitions||{},s={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Gt};return hn(n,s)}o(T1,"fromJSONSchema");var D1=Symbol("z.visit/resolving");function fA(e,t){let n=typeof t=="function"?t:(a,c)=>{let u=t[a._zod.def.type];return u?u(a,c):a},i=new Map;function r(a){let c=i.get(a);if(c===D1)return new Md({type:"lazy",getter:o(()=>i.get(a),"getter")});if(c!==void 0)return c;i.set(a,D1);let u=s(a),l=n(u,u!==a);return i.set(a,l),l}o(r,"run");function s(a){let c=a._zod.def,u=c.type;switch(u){case"object":{let l=c.shape,A=Object.keys(l),p=!1,g={};for(let y of A){let E=r(l[y]);E!==l[y]&&(p=!0),g[y]=E}let h=c.catchall;return c.catchall&&(h=r(c.catchall),h!==c.catchall&&(p=!0)),p?He(a,{...c,shape:g,catchall:h}):a}case"array":{let l=r(c.element);return l===c.element?a:He(a,{...c,element:l})}case"tuple":{let l=c.items,A=!1,p=[];for(let h of l){let y=r(h);y!==h&&(A=!0),p.push(y)}let g=c.rest;return c.rest&&(g=r(c.rest),g!==c.rest&&(A=!0)),A?He(a,{...c,items:p,rest:g}):a}case"record":case"map":{let l=r(c.keyType),A=r(c.valueType);return l===c.keyType&&A===c.valueType?a:He(a,{...c,keyType:l,valueType:A})}case"set":{let l=r(c.valueType);return l===c.valueType?a:He(a,{...c,valueType:l})}case"union":{let l=c.options,A=!1,p=[];for(let g of l){let h=r(g);h!==g&&(A=!0),p.push(h)}return A?He(a,{...c,options:p}):a}case"intersection":{let l=r(c.left),A=r(c.right);return l===c.left&&A===c.right?a:He(a,{...c,left:l,right:A})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=r(c.innerType);return l===c.innerType?a:He(a,{...c,innerType:l})}case"pipe":{let l=r(c.in),A=r(c.out);return l===c.in&&A===c.out?a:He(a,{...c,in:l,out:A})}case"function":{let l=r(c.input),A=r(c.output);return l===c.input&&A===c.output?a:He(a,{...c,input:l,output:A})}case"lazy":{let l=c.getter,{_cachedInner:A,...p}=c;return He(a,{...p,getter:o(()=>r(l()),"getter")})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return o(s,"mapInner"),r(e)}o(fA,"visit");function _1(e){return fA(e,{object:o(t=>t.partial(),"object"),union:o(t=>{let n=t._zod.def;return n.discriminator===void 0?t:fu(n.options)},"union")})}o(_1,"deepPartial");function kae(e,t){if(!t?.length)return e;let n=e._zod.def;return He(e,Nr(n,{checks:[...n.checks??[],...t]}),{parent:!0})}o(kae,"withChecks");function N1(e){return kae(e.out,e.checks)}o(N1,"outSide");function Sae(e){return e.in._zod.traits.has("$ZodTransform")?N1(e):e.in}o(Sae,"inSide");function U1(e){return fA(e,{pipe:o(t=>Sae(t._zod.def),"pipe"),default:o((t,n)=>n?ra(t._zod.def.innerType):t,"default"),catch:o((t,n)=>n?t._zod.def.innerType:t,"catch")})}o(U1,"input");function F1(e){return fA(e,{pipe:o(t=>N1(t._zod.def),"pipe"),prefault:o((t,n)=>n?t._zod.def.innerType:t,"prefault")})}o(F1,"output");var wR={};Cr(wR,{bigint:()=>$ae,boolean:()=>xae,date:()=>Tae,number:()=>Rae,string:()=>Qae});function Qae(e){return qk(lu,e)}o(Qae,"string");function Rae(e){return Kk(du,e)}o(Rae,"number");function xae(e){return sS(Au,e)}o(xae,"boolean");function $ae(e){return aS(pu,e)}o($ae,"bigint");function Tae(e){return yS(iA,e)}o(Tae,"date");var aa=Se(require("fs"));function BR(e){let t=[];for(let n of _ae(e)){let i=n;i?.type==="tool_use"&&typeof i.name=="string"&&t.push(i.name)}return t}o(BR,"toolUsesFromTrace");function P1(e){return BR(e).some(t=>/^mcp__skyramp__skyramp_(contract|integration)_test_generation$/.test(t))}o(P1,"usedSkyrampCodegen");function M1(e){return BR(e).some(t=>t==="mcp__skyramp__skyramp_ui_test_generation")}o(M1,"usedSkyrampUiCodegen");function Dae(e){if(!aa.existsSync(e))return{};for(let t of aa.readFileSync(e,"utf-8").split(`
|
|
119
119
|
`)){let n=t.trim();if(n)try{let i=JSON.parse(n);if(i.type==="system"&&i.subtype==="init"&&Array.isArray(i.mcp_servers))return Object.fromEntries(i.mcp_servers.filter(r=>typeof r.name=="string").map(r=>[r.name,typeof r.status=="string"?r.status:"unknown"]))}catch{}}return{}}o(Dae,"mcpServerStatuses");function L1(e){let t=Dae(e).skyramp;return t===void 0||t==="connected"}o(L1,"skyrampConnected");function _ae(e){if(!aa.existsSync(e))return[];let t=[];for(let n of aa.readFileSync(e,"utf-8").split(`
|
|
120
|
-
`)){let i=n.trim();if(!i)continue;let r;try{r=JSON.parse(i)}catch{continue}let s=r.message?.content;Array.isArray(s)&&t.push(...s)}return t}o(_ae,"contentBlocks");var gA=(n=>(n.Full="full",n.Static="static",n))(gA||{}),Gi=(i=>(i.Contract="contract",i.Integration="integration",i.Ui="ui",i))(Gi||{}),hA=(s=>(s.OwnSurface="own_surface",s.StateReadBack="state_read_back",s.Referential="referential",s.Lifecycle="lifecycle",s.Boundaries="boundaries",s))(hA||{}),li=(r=>(r.Update="update",r.Regenerate="regenerate",r.Delete="delete",r.Verify="verify",r))(li||{}),Nm=(l=>(l.Equals="equals",l.NotEquals="not_equals",l.GreaterThan="greater_than",l.LessThan="less_than",l.Contains="contains",l.NotContains="not_contains",l.Matches="matches",l.Absent="absent",l.Present="present",l))(Nm||{});var tr=d.string().trim().min(1),Nae=d.object({subject:tr.describe('what the test READS: a response field path, the literal "status", or the on-screen text for a ui case \u2014 the FINAL read in a multi-step case'),comparator:d.nativeEnum(Nm),value:d.union([d.string(),d.number(),d.boolean(),d.null()]).optional().describe("the ONE value a broken build would not produce; OMIT for absent/present")}),Uae=d.object({test:tr.describe("existing test path, relative to its repository"),repository:tr.optional().describe("owner/repo the test lives in, when the run has several checkouts; omit for the working checkout"),action:d.nativeEnum(li),evidence:tr.describe("why \u2014 drift vs the diff, or a finding"),covers_behaviors:d.array(d.string()).optional().describe("analyze behavior ids this maintenance covers")});var Fae=d.object({surface:tr.describe("a surface from the list, copied verbatim"),axis:d.nativeEnum(hA)}),Pae=d.object({id:tr.describe("short-slug, unique across generate[]"),type:d.nativeEnum(Gi),target:tr.describe('"METHOD /path", or a business-flow name'),from_finding:d.string().optional().describe("analyze finding id this case catches"),from_behavior:d.string().optional().describe("analyze behavior id this case pins"),derived_from:Fae.optional().describe("the surface \xD7 axis this case pins when no analyze behavior or finding names it \u2014 one of the three is required"),rationale:tr.describe("why this test matters"),expected_observable:tr.describe("one sentence for a human: what a catching test asserts, and what a broken build does instead"),expected:Nae.describe("the same intent AS DATA \u2014 see the rules below"),seededPrecondition:tr.optional().describe("seeded non-initial state + how to reach it; only when a seeded-state transition applies"),verifiable:d.boolean().describe("true only when a live SUT could confirm this test (full mode)")}),Mae=d.object({covered:d.array(d.string()).optional(),abstain:d.string().optional()}).superRefine((e,t)=>{let n=Array.isArray(e.covered),i=typeof e.abstain=="string";if(n===i)return void t.addIssue({code:d.ZodIssueCode.custom,message:"must have exactly one of covered[] or abstain"});n&&e.covered.length===0&&t.addIssue({code:d.ZodIssueCode.custom,path:["covered"],message:"must list at least one id (else abstain)"}),i&&!e.abstain.trim()&&t.addIssue({code:d.ZodIssueCode.custom,path:["abstain"],message:"must give a reason"})}).describe('{ "covered": [ids] } OR { "abstain": "reason" } \u2014 exactly one'),Lae=d.object({surface:tr.describe("a surface from the list, copied verbatim"),axes:d.object(Object.fromEntries(Object.values(hA).map(e=>[e,Mae])))}),j1=d.object({schemaVersion:d.literal(1),mode:d.nativeEnum(gA),maintenance:d.array(Uae),generate:d.array(Pae),surfaces:d.array(Lae).describe("one entry per changed surface in the list \u2014 none missing, none invented"),budget:d.object({total:d.number().describe("case count"),rationale:tr}),summary:tr.describe("one paragraph")});var WSe=Qt.object({components:Qt.array(Qt.object({name:Qt.string().min(1),url:Qt.string().min(1),repository:Qt.string().min(1).optional(),expectedRevision:Qt.string().min(1).optional(),revisionUrl:Qt.string().url().optional()}).strict()).min(1),dependencies:Qt.array(Qt.object({name:Qt.string().min(1),url:Qt.string().nullable(),versionUrl:Qt.string().nullable(),notes:Qt.string().nullable()}).strict()).default([]),allowMutation:Qt.boolean().optional(),offLimits:Qt.array(Qt.string().min(1)).optional()}).strict();var Oae=".skyramp/sut/deployed-revisions.sh",kR=(n=>(n.Running="running",n.Requested="requested",n))(kR||{});var iQe=new Set(Object.values(kR));var sQe=`Fix ${Oae} so it prints the full commit each component runs, then set it up again.`;var mA="shared-environment";var vQe=64*1024;var bQe=new Set(["version_endpoint","api"]);function Um(e){return(e?.components??[]).filter(t=>!!t.repository&&!!t.expectedRevision)}o(Um,"verifiableComponents");var z1=o((e,t)=>!!e&&!!t&&e.toLowerCase()===t.toLowerCase(),"sameRepository"),Vae=o((e,t)=>e.name===t.name&&z1(e.repository,t.repository),"sameComponent");function q1(e){return Um(e).length>0||(e?.dependencies.length??0)>0}o(q1,"hasSharedSystem");function J1(e){let t=e.inputs?.sharedEnvironment;if(!q1(t))return;let n=Ve(e,`${mA}.json`);if(n)return{components:Y1(t,n.components),dependencies:n.dependencies};let i="Not checked: the run ended before it checked the shared environment.";return{components:Um(t).map(r=>H1(r,i)),dependencies:t.dependencies.map(r=>({name:r.name,url:r.url,version:null,evidence:i}))}}o(J1,"sharedSystem");var H1=o((e,t)=>({name:e.name,repository:e.repository,url:e.url,expectedRevision:e.expectedRevision,observedRevision:null,status:"unverifiable",source:e.revisionUrl||e.revisionScript?"probe":"agent",evidence:t}),"unrecordedRow");function Y1(e,t){let n=new Set(t.map(r=>r.name.toLowerCase())),i=Um(e).filter(r=>!n.has(r.name.toLowerCase()));return[...t,...i.map(r=>H1(r,"Not checked: the run recorded no read of it."))]}o(Y1,"withUnrecorded");function SR(e){return(J1(e)?.components??[]).filter(t=>t.status!=="verified")}o(SR,"unverifiedComponents");function QR(e,t,n){if(!e.appRunning||n===!1)return[];let i=Um(e.sharedEnvironment);return Y1(e.sharedEnvironment,t?.components??[]).filter(r=>r.status!=="verified"&&i.some(s=>Vae(s,r)))}o(QR,"blockingComponents");function W1(e){let t=o(n=>{let i=`${n.name} (${n.repository}) must run ${Sc(n.expectedRevision)}`;if(n.observedRevision&&n.expectedRevision&&(n.observedRevision.startsWith(n.expectedRevision)||n.expectedRevision.startsWith(n.observedRevision)))return`${i}: ${n.evidence}`;let r=n.observedRevision?`runs ${Sc(n.observedRevision)}`:"no revision could be read";return`${i}, but ${r}: ${n.evidence}`},"text");return e.length?`the Test Environment does not verifiably run each component's expected revision: ${e.map(t).join("; ")}`:void 0}o(W1,"blockReason");function RR(e){return(e?.components??[]).filter(t=>!!t.repository&&!t.expectedRevision)}o(RR,"unfrozenComponents");var _Qe={focused:"Focused",impacted_critical:"Impacted and critical",broad:"Broad"};var v2=Se(require("path"));function $t(e,t=[]){let n=e.trim();if(!n)return{error:"session produced no output"};let i=o(u=>{try{let l=JSON.parse(u);return typeof l=="object"&&l!==null&&!Array.isArray(l)?l:void 0}catch{return}},"tryParse"),r=i(n);if(r!==void 0)return{value:r};let s;if(n.startsWith("{")&&n.endsWith("}"))try{JSON.parse(n)}catch(u){s=u instanceof Error?u.message:String(u)}let a=[...n.matchAll(/```(?:json)?\s*\n([\s\S]*?)```/g)];for(let u=a.length-1;u>=0;u--){let l=i(a[u][1].trim());if(l!==void 0)return{value:l}}let c;for(let u=n.indexOf("{");u!==-1;u=n.indexOf("{",u+1)){let l=0,A=!1,p=!1;for(let g=u;g<n.length;g++){let h=n[g];if(p){p=!1;continue}if(h==="\\"){p=A;continue}if(h==='"'){A=!A;continue}if(!A){if(h==="{")l++;else if(h==="}"&&(l--,l===0)){let y=i(n.slice(u,g+1));y!==void 0&&Object.keys(y).length>0&&(c=y,u=g);break}}}}return s&&(c===void 0||Object.keys(c).length<3)?{error:`final message is not valid JSON \u2014 ${s}. Most often an unescaped double quote inside a string (e.g. in "summary" or "evidence"): escape it as \\" or use single quotes in prose`}:c!==void 0?{value:c}:s?{error:`final message is not valid JSON \u2014 ${s}. Most often an unescaped double quote inside a string (e.g. in "summary" or "evidence"): escape it as \\" or use single quotes in prose`}:{error:`no parseable JSON object found in session output \u2014 the final message was: "${qae(Qi(n,t))}"`}}o($t,"extractJsonObject");var Z1=240;function qae(e){let t=e.replace(/\s+/g," ").trim();return t.length<=Z1?t:`\u2026${t.slice(-Z1)}`}o(qae,"snippetOf");function Jae(e){return e.issues.map(t=>{let n=t.path.map(r=>typeof r=="number"?`[${r}]`:`.${r}`).join("").replace(/^\./,""),i=n||"output";if(!/^(Expected |Required$|Invalid |String must|Array must|Number must)/.test(t.message))return`${i} ${t.message}`;switch(t.code){case"invalid_type":return n?t.expected==="object"?`${i} must be an object`:t.received==="undefined"?`${i} is required`:`${i} must be ${t.expected}, got ${t.received}`:"output is not a JSON object";case"invalid_enum_value":{let r=JSON.stringify(t.received),s=t.options.find(c=>typeof c=="string"&&typeof t.received=="string"&&t.received.startsWith(c)),a=s?` \u2014 you sent ${r}; the value must be exactly ${JSON.stringify(s)}, with any qualifier moved to a field that takes free text`:` \u2014 you sent ${r}`;return`${i} must be one of: ${t.options.join(", ")}${a}`}case"invalid_literal":return`${i} must be ${JSON.stringify(t.expected)}`;case"too_small":return t.type==="string"?`${i} must be a non-empty string`:`${i} must have at least ${t.minimum} item(s)`;case"unrecognized_keys":return`${i} has unknown key(s): ${t.keys.join(", ")}`;default:return`${i}: ${t.message}`}})}o(Jae,"issuesToMessages");function mn(e,t){let n=e.safeParse(t);if(n.success)return{value:n.data,errors:[]};let i=o((s,a)=>a.reduce((c,u)=>c&&typeof c=="object"?c[u]:void 0,s),"at"),r=n.error.issues.filter(s=>s.path.length&&i(t,s.path)===null);if(r.length===n.error.issues.length)try{let s=e.safeParse(r.reduce((a,{path:c})=>K1(a,c),t));if(s.success)return{value:s.data,errors:[]}}catch{}return{errors:Jae(n.error)}}o(mn,"validateWith");function K1(e,t){if(!t.length||!e||typeof e!="object")return e;let[n,...i]=t,r=Array.isArray(e)?e.slice():{...e};return i.length?r[n]=K1(r[n],i):delete r[n],r}o(K1,"withoutAt");var zi=Se(require("path"));function Fm(e){let t=e.split(/[\\/]/)[0];return t===".skyramp"||t===".testbot"}o(Fm,"inUnshippedFolder");var eG=require("child_process");var X1=[".skyramp/sut",".skyramp/workspace.yml"];var tG=256*1024*1024,Hae=3e4;function nG(e,t,n=Hae){let i=(0,eG.spawnSync)("git",[...Ri,...t],{env:Xt(),cwd:e,encoding:"utf-8",timeout:n,maxBuffer:tG});return i.status===0?i.stdout.trimEnd():void 0}o(nG,"git");var XQe=["--",":/",...X1.map(e=>`:(exclude)${e}`)],rG="--literal-pathspecs";function $R(e,t){return!!nG(e,[rG,"status","--porcelain","--",t])}o($R,"pathChanged");function TR(e,t){return/ blob /.test(nG(e,[rG,"ls-tree","HEAD","--",t])??"")}o(TR,"fileAtHead");var SA=Se(require("fs")),ut=Se(require("path"));function Yae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(Yae,"getDefaultExportFromCjs");var rn={},Pm={},Ps={},iG;function EA(){if(iG)return Ps;iG=1;function e(a){return typeof a>"u"||a===null}o(e,"isNothing");function t(a){return typeof a=="object"&&a!==null}o(t,"isObject");function n(a){return Array.isArray(a)?a:e(a)?[]:[a]}o(n,"toArray");function i(a,c){if(c){let u=Object.keys(c);for(let l=0,A=u.length;l<A;l+=1){let p=u[l];a[p]=c[p]}}return a}o(i,"extend");function r(a,c){let u="";for(let l=0;l<c;l+=1)u+=a;return u}o(r,"repeat");function s(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return o(s,"isNegativeZero"),Ps.isNothing=e,Ps.isObject=t,Ps.toArray=n,Ps.repeat=r,Ps.isNegativeZero=s,Ps.extend=i,Ps}o(EA,"requireCommon");var DR,sG;function IA(){if(sG)return DR;sG=1;function e(n,i){let r="",s=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(r+='in "'+n.mark.name+'" '),r+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!i&&n.mark.snippet&&(r+=`
|
|
120
|
+
`)){let i=n.trim();if(!i)continue;let r;try{r=JSON.parse(i)}catch{continue}let s=r.message?.content;Array.isArray(s)&&t.push(...s)}return t}o(_ae,"contentBlocks");var gA=(n=>(n.Full="full",n.Static="static",n))(gA||{}),Gi=(i=>(i.Contract="contract",i.Integration="integration",i.Ui="ui",i))(Gi||{}),hA=(s=>(s.OwnSurface="own_surface",s.StateReadBack="state_read_back",s.Referential="referential",s.Lifecycle="lifecycle",s.Boundaries="boundaries",s))(hA||{}),li=(r=>(r.Update="update",r.Regenerate="regenerate",r.Delete="delete",r.Verify="verify",r))(li||{}),Nm=(l=>(l.Equals="equals",l.NotEquals="not_equals",l.GreaterThan="greater_than",l.LessThan="less_than",l.Contains="contains",l.NotContains="not_contains",l.Matches="matches",l.Absent="absent",l.Present="present",l))(Nm||{});var tr=d.string().trim().min(1),Nae=d.object({subject:tr.describe('what the test READS: a response field path, the literal "status", or the on-screen text for a ui case \u2014 the FINAL read in a multi-step case'),comparator:d.nativeEnum(Nm),value:d.union([d.string(),d.number(),d.boolean(),d.null()]).optional().describe("the ONE value a broken build would not produce; OMIT for absent/present")}),Uae=d.object({test:tr.describe("existing test path, relative to its repository"),repository:tr.optional().describe("owner/repo the test lives in, when the run has several checkouts; omit for the working checkout"),action:d.nativeEnum(li),evidence:tr.describe("why \u2014 drift vs the diff, or a finding"),covers_behaviors:d.array(d.string()).optional().describe("analyze behavior ids this maintenance covers"),staleOnBase:d.boolean().optional().describe("[derived] the plan found the test already wrong on the base branch: it is left as it is and re-run")});var Fae=d.object({surface:tr.describe("a surface from the list, copied verbatim"),axis:d.nativeEnum(hA)}),Pae=d.object({id:tr.describe("short-slug, unique across generate[]"),type:d.nativeEnum(Gi),target:tr.describe('"METHOD /path", or a business-flow name'),from_finding:d.string().optional().describe("analyze finding id this case catches"),from_behavior:d.string().optional().describe("analyze behavior id this case pins"),derived_from:Fae.optional().describe("the surface \xD7 axis this case pins when no analyze behavior or finding names it \u2014 one of the three is required"),rationale:tr.describe("why this test matters"),expected_observable:tr.describe("one sentence for a human: what a catching test asserts, and what a broken build does instead"),expected:Nae.describe("the same intent AS DATA \u2014 see the rules below"),seededPrecondition:tr.optional().describe("seeded non-initial state + how to reach it; only when a seeded-state transition applies"),verifiable:d.boolean().describe("true only when a live SUT could confirm this test (full mode)")}),Mae=d.object({covered:d.array(d.string()).optional(),abstain:d.string().optional()}).superRefine((e,t)=>{let n=Array.isArray(e.covered),i=typeof e.abstain=="string";if(n===i)return void t.addIssue({code:d.ZodIssueCode.custom,message:"must have exactly one of covered[] or abstain"});n&&e.covered.length===0&&t.addIssue({code:d.ZodIssueCode.custom,path:["covered"],message:"must list at least one id (else abstain)"}),i&&!e.abstain.trim()&&t.addIssue({code:d.ZodIssueCode.custom,path:["abstain"],message:"must give a reason"})}).describe('{ "covered": [ids] } OR { "abstain": "reason" } \u2014 exactly one'),Lae=d.object({surface:tr.describe("a surface from the list, copied verbatim"),axes:d.object(Object.fromEntries(Object.values(hA).map(e=>[e,Mae])))}),j1=d.object({schemaVersion:d.literal(1),mode:d.nativeEnum(gA),maintenance:d.array(Uae),generate:d.array(Pae),surfaces:d.array(Lae).describe("one entry per changed surface in the list \u2014 none missing, none invented"),budget:d.object({total:d.number().describe("case count"),rationale:tr}),summary:tr.describe("one paragraph")});var WSe=Qt.object({components:Qt.array(Qt.object({name:Qt.string().min(1),url:Qt.string().min(1),repository:Qt.string().min(1).optional(),expectedRevision:Qt.string().min(1).optional(),revisionUrl:Qt.string().url().optional()}).strict()).min(1),dependencies:Qt.array(Qt.object({name:Qt.string().min(1),url:Qt.string().nullable(),versionUrl:Qt.string().nullable(),notes:Qt.string().nullable()}).strict()).default([]),allowMutation:Qt.boolean().optional(),offLimits:Qt.array(Qt.string().min(1)).optional()}).strict();var Oae=".skyramp/sut/deployed-revisions.sh",kR=(n=>(n.Running="running",n.Requested="requested",n))(kR||{});var iQe=new Set(Object.values(kR));var sQe=`Fix ${Oae} so it prints the full commit each component runs, then set it up again.`;var mA="shared-environment";var vQe=64*1024;var bQe=new Set(["version_endpoint","api"]);function Um(e){return(e?.components??[]).filter(t=>!!t.repository&&!!t.expectedRevision)}o(Um,"verifiableComponents");var z1=o((e,t)=>!!e&&!!t&&e.toLowerCase()===t.toLowerCase(),"sameRepository"),Vae=o((e,t)=>e.name===t.name&&z1(e.repository,t.repository),"sameComponent");function q1(e){return Um(e).length>0||(e?.dependencies.length??0)>0}o(q1,"hasSharedSystem");function J1(e){let t=e.inputs?.sharedEnvironment;if(!q1(t))return;let n=Ve(e,`${mA}.json`);if(n)return{components:Y1(t,n.components),dependencies:n.dependencies};let i="Not checked: the run ended before it checked the shared environment.";return{components:Um(t).map(r=>H1(r,i)),dependencies:t.dependencies.map(r=>({name:r.name,url:r.url,version:null,evidence:i}))}}o(J1,"sharedSystem");var H1=o((e,t)=>({name:e.name,repository:e.repository,url:e.url,expectedRevision:e.expectedRevision,observedRevision:null,status:"unverifiable",source:e.revisionUrl||e.revisionScript?"probe":"agent",evidence:t}),"unrecordedRow");function Y1(e,t){let n=new Set(t.map(r=>r.name.toLowerCase())),i=Um(e).filter(r=>!n.has(r.name.toLowerCase()));return[...t,...i.map(r=>H1(r,"Not checked: the run recorded no read of it."))]}o(Y1,"withUnrecorded");function SR(e){return(J1(e)?.components??[]).filter(t=>t.status!=="verified")}o(SR,"unverifiedComponents");function QR(e,t,n){if(!e.appRunning||n===!1)return[];let i=Um(e.sharedEnvironment);return Y1(e.sharedEnvironment,t?.components??[]).filter(r=>r.status!=="verified"&&i.some(s=>Vae(s,r)))}o(QR,"blockingComponents");function W1(e){let t=o(n=>{let i=`${n.name} (${n.repository}) must run ${Sc(n.expectedRevision)}`;if(n.observedRevision&&n.expectedRevision&&(n.observedRevision.startsWith(n.expectedRevision)||n.expectedRevision.startsWith(n.observedRevision)))return`${i}: ${n.evidence}`;let r=n.observedRevision?`runs ${Sc(n.observedRevision)}`:"no revision could be read";return`${i}, but ${r}: ${n.evidence}`},"text");return e.length?`the Test Environment does not verifiably run each component's expected revision: ${e.map(t).join("; ")}`:void 0}o(W1,"blockReason");function RR(e){return(e?.components??[]).filter(t=>!!t.repository&&!t.expectedRevision)}o(RR,"unfrozenComponents");var _Qe={focused:"Focused",impacted_critical:"Impacted and critical",broad:"Broad"};var v2=Se(require("path"));function $t(e,t=[]){let n=e.trim();if(!n)return{error:"session produced no output"};let i=o(u=>{try{let l=JSON.parse(u);return typeof l=="object"&&l!==null&&!Array.isArray(l)?l:void 0}catch{return}},"tryParse"),r=i(n);if(r!==void 0)return{value:r};let s;if(n.startsWith("{")&&n.endsWith("}"))try{JSON.parse(n)}catch(u){s=u instanceof Error?u.message:String(u)}let a=[...n.matchAll(/```(?:json)?\s*\n([\s\S]*?)```/g)];for(let u=a.length-1;u>=0;u--){let l=i(a[u][1].trim());if(l!==void 0)return{value:l}}let c;for(let u=n.indexOf("{");u!==-1;u=n.indexOf("{",u+1)){let l=0,A=!1,p=!1;for(let g=u;g<n.length;g++){let h=n[g];if(p){p=!1;continue}if(h==="\\"){p=A;continue}if(h==='"'){A=!A;continue}if(!A){if(h==="{")l++;else if(h==="}"&&(l--,l===0)){let y=i(n.slice(u,g+1));y!==void 0&&Object.keys(y).length>0&&(c=y,u=g);break}}}}return s&&(c===void 0||Object.keys(c).length<3)?{error:`final message is not valid JSON \u2014 ${s}. Most often an unescaped double quote inside a string (e.g. in "summary" or "evidence"): escape it as \\" or use single quotes in prose`}:c!==void 0?{value:c}:s?{error:`final message is not valid JSON \u2014 ${s}. Most often an unescaped double quote inside a string (e.g. in "summary" or "evidence"): escape it as \\" or use single quotes in prose`}:{error:`no parseable JSON object found in session output \u2014 the final message was: "${qae(Qi(n,t))}"`}}o($t,"extractJsonObject");var Z1=240;function qae(e){let t=e.replace(/\s+/g," ").trim();return t.length<=Z1?t:`\u2026${t.slice(-Z1)}`}o(qae,"snippetOf");function Jae(e){return e.issues.map(t=>{let n=t.path.map(r=>typeof r=="number"?`[${r}]`:`.${r}`).join("").replace(/^\./,""),i=n||"output";if(!/^(Expected |Required$|Invalid |String must|Array must|Number must)/.test(t.message))return`${i} ${t.message}`;switch(t.code){case"invalid_type":return n?t.expected==="object"?`${i} must be an object`:t.received==="undefined"?`${i} is required`:`${i} must be ${t.expected}, got ${t.received}`:"output is not a JSON object";case"invalid_enum_value":{let r=JSON.stringify(t.received),s=t.options.find(c=>typeof c=="string"&&typeof t.received=="string"&&t.received.startsWith(c)),a=s?` \u2014 you sent ${r}; the value must be exactly ${JSON.stringify(s)}, with any qualifier moved to a field that takes free text`:` \u2014 you sent ${r}`;return`${i} must be one of: ${t.options.join(", ")}${a}`}case"invalid_literal":return`${i} must be ${JSON.stringify(t.expected)}`;case"too_small":return t.type==="string"?`${i} must be a non-empty string`:`${i} must have at least ${t.minimum} item(s)`;case"unrecognized_keys":return`${i} has unknown key(s): ${t.keys.join(", ")}`;default:return`${i}: ${t.message}`}})}o(Jae,"issuesToMessages");function mn(e,t){let n=e.safeParse(t);if(n.success)return{value:n.data,errors:[]};let i=o((s,a)=>a.reduce((c,u)=>c&&typeof c=="object"?c[u]:void 0,s),"at"),r=n.error.issues.filter(s=>s.path.length&&i(t,s.path)===null);if(r.length===n.error.issues.length)try{let s=e.safeParse(r.reduce((a,{path:c})=>K1(a,c),t));if(s.success)return{value:s.data,errors:[]}}catch{}return{errors:Jae(n.error)}}o(mn,"validateWith");function K1(e,t){if(!t.length||!e||typeof e!="object")return e;let[n,...i]=t,r=Array.isArray(e)?e.slice():{...e};return i.length?r[n]=K1(r[n],i):delete r[n],r}o(K1,"withoutAt");var zi=Se(require("path"));function Fm(e){let t=e.split(/[\\/]/)[0];return t===".skyramp"||t===".testbot"}o(Fm,"inUnshippedFolder");var eG=require("child_process");var X1=[".skyramp/sut",".skyramp/workspace.yml"];var tG=256*1024*1024,Hae=3e4;function nG(e,t,n=Hae){let i=(0,eG.spawnSync)("git",[...Ri,...t],{env:Xt(),cwd:e,encoding:"utf-8",timeout:n,maxBuffer:tG});return i.status===0?i.stdout.trimEnd():void 0}o(nG,"git");var XQe=["--",":/",...X1.map(e=>`:(exclude)${e}`)],rG="--literal-pathspecs";function $R(e,t){return!!nG(e,[rG,"status","--porcelain","--",t])}o($R,"pathChanged");function TR(e,t){return/ blob /.test(nG(e,[rG,"ls-tree","HEAD","--",t])??"")}o(TR,"fileAtHead");var SA=Se(require("fs")),ut=Se(require("path"));function Yae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(Yae,"getDefaultExportFromCjs");var rn={},Pm={},Ps={},iG;function EA(){if(iG)return Ps;iG=1;function e(a){return typeof a>"u"||a===null}o(e,"isNothing");function t(a){return typeof a=="object"&&a!==null}o(t,"isObject");function n(a){return Array.isArray(a)?a:e(a)?[]:[a]}o(n,"toArray");function i(a,c){if(c){let u=Object.keys(c);for(let l=0,A=u.length;l<A;l+=1){let p=u[l];a[p]=c[p]}}return a}o(i,"extend");function r(a,c){let u="";for(let l=0;l<c;l+=1)u+=a;return u}o(r,"repeat");function s(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return o(s,"isNegativeZero"),Ps.isNothing=e,Ps.isObject=t,Ps.toArray=n,Ps.repeat=r,Ps.isNegativeZero=s,Ps.extend=i,Ps}o(EA,"requireCommon");var DR,sG;function IA(){if(sG)return DR;sG=1;function e(n,i){let r="",s=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(r+='in "'+n.mark.name+'" '),r+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!i&&n.mark.snippet&&(r+=`
|
|
121
121
|
|
|
122
122
|
`+n.mark.snippet),s+" "+r):s}o(e,"formatError");function t(n,i){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=i,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return o(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=o(function(i){return this.name+": "+e(this,i)},"toString"),DR=t,DR}o(IA,"requireException");var _R,oG;function Wae(){if(oG)return _R;oG=1;let e=EA();function t(r,s,a,c,u){let l="",A="",p=Math.floor(u/2)-1;return c-s>p&&(l=" ... ",s=c-p+l.length),a-c>p&&(A=" ...",a=c+p-A.length),{str:l+r.slice(s,a).replace(/\t/g,"\u2192")+A,pos:c-s+l.length}}o(t,"getLine");function n(r,s){return e.repeat(" ",s-r.length)+r}o(n,"padStart");function i(r,s){if(s=Object.create(s||null),!r.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);let a=/\r?\n|\r|\0/g,c=[0],u=[],l,A=-1;for(;l=a.exec(r.buffer);)u.push(l.index),c.push(l.index+l[0].length),r.position<=l.index&&A<0&&(A=c.length-2);A<0&&(A=c.length-1);let p="",g=Math.min(r.line+s.linesAfter,u.length).toString().length,h=s.maxLength-(s.indent+g+3);for(let E=1;E<=s.linesBefore&&!(A-E<0);E++){let C=t(r.buffer,c[A-E],u[A-E],r.position-(c[A]-c[A-E]),h);p=e.repeat(" ",s.indent)+n((r.line-E+1).toString(),g)+" | "+C.str+`
|
|
123
123
|
`+p}let y=t(r.buffer,c[A],u[A],r.position,h);p+=e.repeat(" ",s.indent)+n((r.line+1).toString(),g)+" | "+y.str+`
|
|
@@ -155,7 +155,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
155
155
|
set -euo pipefail
|
|
156
156
|
${i}
|
|
157
157
|
`,{mode:493})}catch{return}return`bash ${xx(t)}`}}o(Rx,"scriptedCommand");function xx(e){return`'${e.split("'").join("'\\''")}'`}o(xx,"shQuote");function $x(e){return Tx(e)&&SR(e).length===0&&RR(e.inputs?.sharedEnvironment).length===0}o($x,"sutIsHealthy");function Tx(e){let t=Fde(e);if(!t&&e.state.stages.deploy?.status!=="passed")return!1;let n=Ve(e,"deploy.json");return n?Ude(n):!t}o(Tx,"sutCameUp");function Ude(e){return e?.outcome==="clean"||e?.outcome==="recipe-drift"}o(Ude,"deployCameUp");function Fde(e){let t=e.state.stages.plan,n=e.state.stages.deploy;return!(e.inputs?.pipeline?e.inputs.pipeline==="two-step":!n)||t?.status!=="passed"?!1:!n||n.updatedAt<=t.updatedAt}o(Fde,"broughtUpByPlan");var k0e=10*6e4;var iy=(r=>(r.RestApi="rest-api",r.Frontend="frontend",r.FullStack="full-stack",r.Other="other",r))(iy||{}),la=(r=>(r.Critical="critical",r.High="high",r.Medium="medium",r.Low="low",r))(la||{}),da=(i=>(i.Suspected="suspected",i.Latent="latent",i.Refuted="refuted",i))(da||{}),Nx=(i=>(i.Skyramp="skyramp",i.External="external",i.Unknown="unknown",i))(Nx||{}),Ux=(r=>(r.Cascade="cascade",r.Restrict="restrict",r.Orphan="orphan",r.Unknown="unknown",r))(Ux||{}),pi=(r=>(r.RequirementReference="requirement-reference",r.Spec="spec",r.PrDescription="pr-description",r.CouldBreak="could-break",r))(pi||{}),Xe=d.string().trim().min(1),Iu=Xe.describe("file:line"),Jz=o(e=>Xe.refine(t=>t.length<=400,t=>({message:`is ${t.length} characters, over the 400 cap \u2014 ${e}`})),"cap400"),RA=Xe.optional().describe('multi-repo only: the OTHER checkout this lives in \u2014 its "owner/repo" slug, or the directory name if the run discovered it; omit for the working checkout'),_x=d.object({method:Xe,path:Xe,service:d.string().optional(),evidence:Iu,repository:RA}),jde=d.object({id:Xe.describe("short-slug, e.g. R9"),statement:Xe.max(400,"exceeds 400 characters \u2014 state the requirement, do not paste the spec section").describe("a testable obligation, not a summary"),source:d.nativeEnum(pi).describe("spec outranks pr-description when both state it"),evidence:Xe.describe("spec: file:line or a section locator. pr-description: the quoted phrase it comes from.")}),Gde=d.object({id:Xe.describe("short-slug"),statement:Xe.max(400,"exceeds 400 characters \u2014 state the behaviour, do not paste the code").describe("what the change makes true"),surface:Xe.describe("METHOD /path, or a component/page name"),evidence:Xe.describe("file:line from the diff that introduces it"),repository:RA,satisfies:d.array(Xe).optional().describe("requirement ids (from `requirements`) this behaviour correctly implements \u2014 a requirement met only in part is ALSO named by the finding that shows the rest (conflictsWith)")}),Vde=d.object({id:Xe.describe("short-slug"),file:Xe,line:d.number().optional(),claim:Jz("shorten it to the one sentence that states the defect, and move the supporting detail into `evidence`"),severity:d.nativeEnum(la),evidence:Jz("cite the file:line and the one line that shows it, rather than reproducing the surrounding code").describe("quoted diff/code line"),status:d.nativeEnum(da),repository:RA,conflictsWith:d.array(Xe).optional().describe("requirement ids (from `requirements`) this defect contradicts or leaves unimplemented \u2014 a lower-precedence source (the diff, or the PR description) lost")}),zde=d.object({name:Xe,language:d.string().optional(),framework:d.string().optional(),evidence:Iu,repository:RA}),qde=d.object({dir:Xe,framework:d.string().optional(),kind:d.nativeEnum(Nx),evidence:Iu,repository:RA}),Jde=d.object({from:Xe,to:Xe,onDelete:d.nativeEnum(Ux),evidence:Iu}),Hde=d.object({entity:Xe,field:Xe,values:d.array(d.string()),evidence:Iu}),Yde=d.object({entities:d.array(d.object({name:Xe,evidence:Iu})),references:d.array(Jde).describe("INBOUND references \u2014 what still points at an entity when it is deleted"),stateFields:d.array(Hde)}),Fx=d.object({schemaVersion:d.literal(1),repository:d.object({path:Xe.describe("absolute repo path"),currentBranch:Xe,baseBranch:Xe}),project:d.object({type:d.nativeEnum(iy),primaryLanguage:Xe,languages:d.array(d.string()),frameworks:d.array(d.string())}),services:d.array(zde),infrastructure:d.object({containerized:d.boolean(),hasDockerCompose:d.boolean(),composeFiles:d.array(d.string()),hasCiCd:d.boolean()}),diff:d.object({changedFiles:d.array(d.string()).describe("as git reports them; a file in another checkout may carry that repo's name"),nonApplicationOnly:d.boolean(),summary:Xe.describe("\u2264400 chars")}),endpoints:d.object({new:d.array(_x),modified:d.array(_x),removed:d.array(_x)}),existingTests:d.object({locations:d.array(qde)}),entityMap:Yde,requirements:d.array(jde).describe("from a spec (attached or linked) and/or the PR description; empty when neither states a testable obligation"),behaviors:d.array(Gde),findings:d.array(Vde),unexamined:d.array(d.string()).describe("files or areas outside this change you did not open"),summary:Xe.describe("one paragraph on what this change does and its test-relevant risk")});var Xde=d.object({route:d.string().describe('the page this step happens on, e.g. "/products/:id"'),action:d.string().describe('what the user does there, through the UI, e.g. "clicks Add to cart"'),clauses:d.array(d.string()).optional().describe("the plan clause ids this step exercises"),check:d.string().optional().describe("what the user then sees that shows the step worked; the test asserts it")}),xA=(n=>(n.InProcess="in-process",n.Browser="browser",n))(xA||{}),Hz=(i=>(i.Spec="spec",i.PrDescription="pr-description",i.Inferred="inferred",i))(Hz||{}),Yz=d.object({id:d.string().describe('e.g. "J1"'),name:d.string().describe(`the flow in a user's words, e.g. "buy a product with a coupon"`),entry:d.string().describe("the route the user starts the flow on: the app's normal starting page for it, never a deep link into its middle"),steps:d.array(Xde).describe("every step, in order, from the entry page to the outcome: at least two"),outcome:d.string().describe("what the user sees at the end that shows the flow worked: every part of it"),finishes:d.string().optional().describe('the user action that completes the task, verb first, e.g. "places the order"; the journey walks on to it'),kind:d.nativeEnum(xA).optional().describe("in-process when the repo's in-process tests (components, app routes) can walk the whole flow and check it; else browser"),source:d.nativeEnum(Hz).optional().describe("spec or pr-description when one describes this flow (quote it under evidence), else inferred"),evidence:d.string().optional().describe("for spec or pr-description: its words that describe the flow"),testFile:d.string().describe("the browser test file it goes in, beside the repo's existing e2e tests")}),sy=d.object({journey:d.string().describe("the plan's journey id"),file:d.string().describe("the browser test file that walks it"),brokeAt:d.object({step:d.number().int().describe("the 1-based step whose check failed first"),expected:d.string(),actual:d.string().describe("what the app did instead, from the runner's output"),notReached:d.array(d.number().int()).optional().describe("later steps the test could not get to")}).optional().describe("only when the journey's test failed on a check: where"),test:d.string().describe("the title of the one test in that file that walks it end to end")});var L0e=Object.fromEntries([...["ts","tsx","mts","cts","js","jsx","mjs","cjs"].map(e=>[e,"node"]),...["java","kt","kts","groovy","scala"].map(e=>[e,"jvm"]),["py","python"],["go","go"]]);var O0e=["stale_test","open_question"],j0e=["low","medium","high","critical"];var Wz=String.raw`(?:\[[^\]]*\]|\([^)]*\))`,eAe=String.raw`(?:["'\u201c\u2018\x60]|\*{1,2})?[^\s:"'\u201c\u201d\u2018\u2019\x60*()[\],]+(?:["'\u201d\u2019\x60]|\*{1,2})?`,Zz=String.raw`(?:${Wz}|${eAe}(?:\s*${Wz})?)`,Kz=String.raw`(?:\s*:|\s+[\u2014\u2013-])`,q0e=new RegExp(String.raw`^\s*(?:${Zz}(?:,\s*${Zz})*(?::L?\d+(?:[-\u2013]\d+)?${Kz}?|${Kz})|\[[^\]\s]+\]|\([^)\s]+\))\s+`);var $A=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))($A||{}),qi=d.string().trim().min(1),tAe=d.object({case:qi.describe("recommend id this assertion enforces"),evidence:qi.describe("the exact assertion line from the file that checks that case's observable")}),Px=d.object({kind:d.nativeEnum(hg).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:qi.describe("the dependency, endpoint or data it affects"),mechanism:d.nativeEnum(mg).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:qi.describe("what it sets up"),worker:qi.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),cleanup:qi.optional().describe("seed: a command that removes the data when the test does not, run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that")}),nAe=d.object({file:qi.describe("staged path under .skyramp/staged/"),source:d.nativeEnum($A),language:qi,covers:d.array(d.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:d.array(tAe).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:d.array(Px).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),Mx=d.object({schemaVersion:d.literal(1),tests:d.array(nAe),deferredUi:d.array(d.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:qi.describe("one paragraph")});var Os=Se(require("fs")),bu=Se(require("path")),n2=require("child_process");var sn="{junit}",oy=(r=>(r.Junit="junit",r.Trx="trx",r.GoTestJson="go-test-json",r.JestJson="jest-json",r))(oy||{}),Lx=(t=>(t.Minitest="minitest",t))(Lx||{}),Xz=d.string().trim().min(1),Cu=d.object({cwd:Xz.describe('repo-relative directory the command starts in ("." for the root)'),argv:d.array(Xz).min(1).describe(`the command as separate arguments, run without a shell; for a junit or trx report an argument or env value holds ${sn}, where the report is written (not for Maven or Gradle, whose build writes its own)`),env:d.record(d.string(),d.string()).optional().describe("plain test or reporter settings beyond the repository's CI test job (RAILS_ENV=test, PLAYWRIGHT_JUNIT_OUTPUT_FILE={junit}); never a credential, PATH, or a tool's install path"),report:d.object({format:d.nativeEnum(oy).describe(`junit (JUnit XML to ${sn}), trx (to ${sn}), jest-json (Jest's --json or Vitest's --reporter=json, --outputFile=${sn}), or go-test-json (go test -json on the command's output)`),reporter:d.nativeEnum(Lx).optional().describe("a reporter Testbot loads for a runner that writes no report: minitest")}).optional().describe("the report the command writes; junit when omitted")});var vu="a framework other than pytest, jest, vitest and node --test (go test, rails test, mvn, dotnet test), or one the repository's test script runs through another command (ng test, nx test)",eTe=`pytest, Jest, Vitest and node --test tests run as the run already knows them, unless the repository's test script runs them through another command (ng test, nx test), which may be the only one that compiles them. A test in any other framework, or one run that way, also gives "run": the repository's own command for only those tests, from the directory the repository runs it in, as separate arguments without a shell. Its "report" says what the runner writes: junit (JUnit XML to ${sn} in the reporter's argument or env setting), trx (a TRX file to ${sn}, which every dotnet test writes with its built-in logger), jest-json (Jest's --json --outputFile=${sn}, or Vitest's --reporter=json --outputFile=${sn}: built in, no reporter package), or go-test-json (go test -json, read from the command's output). A Maven or Gradle command names no ${sn}: its build writes JUnit XML to its own report directory, which the run reads. Use a reporter the repository already has, or one of those; a reporter or converter the command fetches is the version the repository pins, or else its latest release (an older one may not build with the repository's toolchain). For minitest, which writes none, give report.reporter "minitest" and the run fills ${sn} itself. A setting the tests or reporter read goes in "env" (RAILS_ENV=test, or PLAYWRIGHT_JUNIT_OUTPUT_FILE=${sn} with playwright test --reporter=junit): the run sets it, so never wrap the command in a shell to set one. The run replaces ${sn} in argv and env with its report path, executes the command, and reads that report.`;var Ls=(r=>(r.ExistingEvidenceSufficient="existing_evidence_sufficient",r.TargetedUnit="targeted_unit",r.RuntimeRequired="runtime_required",r.BlockedPreflight="blocked_preflight",r))(Ls||{}),Ji=(s=>(s.ExistingEvidence="existing_evidence",s.Unaffected="unaffected",s.ExistingUnit="existing_unit",s.NewUnit="new_unit",s.Runtime="runtime",s))(Ji||{}),Ox=(n=>(n.Repository="repository",n.Testbot="testbot",n))(Ox||{}),jx=(i=>(i.Identified="identified",i.Passed="passed",i.Failed="failed",i))(jx||{}),Fn=d.string().trim().min(1),rAe=d.string().regex(/^[a-z0-9][a-z0-9-]*$/,"must be a short lowercase slug").describe("short-slug");var iAe=d.object({id:rAe,source:d.nativeEnum(Ox),kind:d.nativeEnum(vs),outcome:d.nativeEnum(jx),summary:Fn.max(400).describe("one line: what it shows"),tests:d.array(Fn).optional().describe("source repository: the existing tests, as repo-relative paths, optionally path::test-name"),repository:Fn.optional().describe("source repository: owner/repo the tests live in, when the run has several checkouts; omit for the working checkout"),command:Fn.optional().describe("source testbot: the exact command you ran, as you ran it"),run:Cu.optional().describe(`source repository, for tests in ${vu}: how the run executes the whole of each of these test files, all of them in one command, never narrowed to the named tests and never only listed, with the repository's own runner writing JUnit XML to {junit}. A test is credited to a file only by its name or by a report that names the file`)}),sAe=d.object({behaviorId:Fn.describe("an id from analyze's behaviors"),mechanism:d.nativeEnum(Ji),evidenceIds:d.array(Fn).default([]).describe("existing_evidence: the ci-<n> or evidence ids that establish it; existing_unit: the evidence id naming the tests to run"),covers:d.string().trim().optional().describe('new_unit / runtime: the missing evidence this obtains, e.g. "the boundary the change moved"; unaffected: why the change cannot reach it, citing path:line')}),Gx=(i=>(i.Browser="browser",i.RunningApp="running-app",i.Outside="outside",i))(Gx||{}),oAe=d.object({behaviorId:d.string().trim().optional().describe("an id from analyze's behaviors, when it is about one"),missing:Fn.max(600).describe("the evidence that is required and cannot be obtained in this run"),needs:d.nativeEnum(Gx).optional().describe("what that evidence needs: browser (only a real browser shows it), running-app (only the running app or its server shows it: its real requests, sign-in and permissions, what it saves), or outside (something the running app here could not give either: a third-party service it calls, hardware)")}),aAe=d.object({file:Fn.describe("the changed file the failure is in"),repository:Fn.optional().describe("owner/repo the file is in, when the run has several checkouts; omit for the working checkout"),reason:Fn.max(300).describe("what prerequisite the change fails"),evidence:Fn.max(400).describe("the error line, quoted")}),cAe=d.object({behaviorId:Fn.describe("an id from analyze's behaviors"),reason:Fn.max(600).describe("\u2264600 characters: why this change leaves the behavior's result as it was, citing the unchanged line that decides it (path:line)")}),TA=d.object({schemaVersion:d.literal(1),decision:d.nativeEnum(Ls),evidence:d.array(iAe).describe("evidence this session found or produced; CI results are the ci-<n> items and are not restated here"),plan:d.array(sAe).describe("how each changed behavior's evidence is obtained"),gaps:d.array(oAe),outOfScope:d.array(cAe).optional().describe("behaviors analyze found that this change neither changes nor states"),blocked:aAe.optional().describe("only for blocked_preflight"),rationale:Fn.max(1200).describe("\u22641200 characters: why this evidence is enough, or what it still lacks \u2014 the scope you chose and why")});function DA(e){let t=Ve(e,"recommend.json");if(!t||!Array.isArray(t.generate)||!Array.isArray(t.maintenance))return;let n=t;return{...n,maintenance:n.maintenance.map(({repository:i,...r})=>({...r,test:r.test.trim().replace(/^\.\//,""),...i?.trim()?{repository:i.trim()}:{}}))}}o(DA,"readRecommend");function AAe(e){return mn(Mx,e).errors}o(AAe,"validateGenerateOutput");function pAe(e,t=[]){let{value:n,error:i}=$t(e,t);if(i)return{errors:[i]};let r=AAe(n);return r.length>0?{errors:r}:{generate:n,errors:[]}}o(pAe,"parseGenerateText");function ay(e,t=[]){return pAe(e.stdout,t)}o(ay,"parseGenerateFromSession");function fAe(e){return e.generate.filter(t=>t.type!=="ui").map(t=>t.id)}o(fAe,"backendCases");function r2(e){return e.generate.filter(t=>t.type==="ui").map(t=>t.id)}o(r2,"uiCases");var cy={backend:{stage:"generate",cases:fAe,noRecommendCoverage:"recommend.json missing or malformed \u2014 cannot check coverage",noRecommendIntent:"recommend.json missing or malformed \u2014 cannot check intent",uncovered:o(e=>`recommend case "${e}" is not covered by any generated test`,"uncovered"),unknownCovered:o(e=>`test covers unknown recommend id "${e}"`,"unknownCovered"),unasserted:o(e=>`case "${e}" has no verified assertion enforcing its expected_observable`,"unasserted"),usedCodegen:P1,codegenHint:"These tests were hand-written. Skyramp codegen (skyramp_contract_test_generation / skyramp_integration_test_generation) was available but not used \u2014 it computes valid sample data and response correlations. Prefer scaffolding with it and then refining, especially for the failures above."},ui:{stage:"generate-ui",cases:r2,noRecommendCoverage:"recommend.json not found \u2014 cannot check UI coverage",noRecommendIntent:"recommend.json not found \u2014 cannot check UI intent",uncovered:o(e=>`UI case "${e}" is not covered by any generated UI test`,"uncovered"),unknownCovered:o(e=>`test covers "${e}" which is not a recommend UI case`,"unknownCovered"),unasserted:o(e=>`UI case "${e}" has no verified assertion enforcing its expected_observable`,"unasserted"),usedCodegen:M1,codegenHint:"This UI test was hand-authored. Skyramp UI codegen (skyramp_ui_test_generation) was available but not used. Prefer scaffolding with it and then refining, especially for the failures above."}},NTe=$n("generate-schema",(e,t)=>ay(t,e.secretValues));function gAe(e){let t=cy[e];return{name:`${t.stage}-coverage`,verify(n,i){let{generate:r,errors:s}=ay(i,n.secretValues);if(!r)return Ot(this.name,s);let a=DA(n);if(!a)return Ot(this.name,[t.noRecommendCoverage]);let c=new Set(r.tests.flatMap(p=>p.covers)),u=[],l=t.cases(a);for(let p of l)c.has(p)||u.push(t.uncovered(p));let A=new Set(e==="ui"?l:a.generate.map(p=>p.id));for(let p of c)A.has(p)||u.push(t.unknownCovered(p));if(e==="backend"){let p=new Set(r.deferredUi),g=new Set(r2(a));for(let h of g)!p.has(h)&&!c.has(h)&&u.push(`UI case "${h}" is neither covered nor deferred to the UI stage`);for(let h of p)g.has(h)||u.push(`deferredUi lists "${h}" which is not a UI case`)}return u.length===0?{name:this.name,passed:!0}:Ot(this.name,u)}}}o(gAe,"generateCoverageGateFor");function hAe(e){let t=cy[e];return{name:`${t.stage}-intent`,verify(n,i){let{generate:r,errors:s}=ay(i,n.secretValues);if(!r)return Ot(this.name,s);let a=DA(n);if(!a)return Ot(this.name,[t.noRecommendIntent]);let{asserted:c,errors:u,badFiles:l}=bAe(r,n.inputs.repositoryPath),A=u.length;for(let g of t.cases(a))c.has(g)||u.push(t.unasserted(g));if(u.length===0)return{name:this.name,passed:!0};let p=Ot(this.name,u);return A>0&&A===u.length&&l.size>0?{...p,droppable:[...l]}:p}}}o(hAe,"generateIntentGateFor");function mAe(e){let t=cy[e];return n=>{if(!n.inputs.skyrampMcp?.command||e==="backend"&&!$x(n))return;let i=bu.join(n.outputsDir,`${t.stage}-stream.ndjson`);if(!(!Os.existsSync(i)||t.usedCodegen(i)))return L1(i)?t.codegenHint:"Skyramp codegen tools were configured but the MCP server did not connect this session, so they were not available. Hand-authoring was the only option; this is an environment problem, not yours."}}o(mAe,"codegenRetryHintFor");var UTe=gAe("backend"),FTe=hAe("backend"),PTe=mAe("backend");var e2=o(e=>e.replace(/\s+/g,""),"squeeze");var Vx={python:[/\bassert\s*[({\w"'`]/g,/\bpytest\.raises\s*\(/g,/\bself\.assert\w*\s*\(/g],typescript:[/\bexpect\s*\(/g,/\.should\b/g,/\bassert\s*[.(]/g],go:[/\bt\.(Error|Errorf|Fatal|Fatalf|Fail|FailNow)\s*\(/g,/\b(assert|require)\.\w+\s*\(/g],java:[/\bassert\w*\s*\(/g,/\bassertThat\s*\(/g],ruby:[/\bexpect\s*[({]/g,/\bassert\w*\b/g,/\.should\b/g]};for(let[e,t]of[["javascript","typescript"],["kotlin","java"]])Vx[e]=Vx[t];function yAe(e,t){if(e.includes(dd(t))||e2(e).includes(e2(t)))return!0;let n=t.split(/\r?\n/).map(i=>i.trim()).filter(i=>i&&!/^(\/\/|#|\*|\/\*)/.test(i));return n.length>0&&n.every(i=>e.includes(dd(i)))?!0:vAe(e,t)}o(yAe,"evidenceFound");var EAe=/\bassert\w*\b|\bexpect\s*\(|\.should\b|\brequire\s*\(/i,IAe=12,CAe=/,\s*\(\s*#|,\s*f?["'`]|\s+#\s|\s+\/\/|\s*\((?:line|lines|at line)\b|\s*,\s*$/i;function vAe(e,t){let n=t.split(/\s*;\s*|\s*\.\.\.\s*|\r?\n/),i=0;for(let r of n){let s=EAe.exec(r);if(!s)continue;let a=r.slice(s.index),c=CAe.exec(a);if(c&&(a=a.slice(0,c.index)),a=dd(a).replace(/[,\s]+$/,""),a.length<IAe||!e.includes(a))return!1;i++}return i>0}o(vAe,"annotatedAssertionFound");function bAe(e,t){let n=new Set,i=[],r=new Set;for(let s of e.tests){let a=bu.resolve(t,s.file);if(!Os.existsSync(a))continue;let c=dd(Os.readFileSync(a,"utf-8"));for(let u of s.assertions??[]){if(!yAe(c,u.evidence)){i.push(`assertion evidence for "${u.case}" not found in ${s.file} \u2014 cite the real assertion line`),r.add(s.file);continue}s.covers.includes(u.case)?n.add(u.case):(i.push(`assertion cites case "${u.case}" not in that test's covers[]`),r.add(s.file))}}return{asserted:n,errors:i,badFiles:r}}o(bAe,"verifiedAssertions");var wAe=/\.(spec|test)\.[cm]?[jt]sx?$/i;function i2(e){let t;try{t=(0,n2.execFileSync)("git",[...Ri,"status","--porcelain","--untracked-files=all"],{env:Xt(),cwd:e,encoding:"utf-8",stdio:["ignore","pipe","ignore"]})}catch{return}let n=o(r=>/_scaffold/i.test(r)||Ad.test(r),"isTestLitter"),i=[];for(let r of t.split(`
|
|
158
|
-
`)){if(!r.trim()||r.length>1&&r[1]==="D")continue;let s=r.slice(3).trim(),a=s.indexOf(" -> ");if(a!==-1&&(s=s.slice(a+4).trim()),s=s.replace(/^"|"$/g,""),!s)continue;let c=s.replace(/^\.\//,"");c.startsWith(".skyramp/")||!n(c)||i.push(c)}return i}o(i2,"testLitter");function BAe(e){let t=cy[e],n=e==="ui";return{name:`${t.stage}-no-litter`,verify(i){let r=i2(i.inputs.repositoryPath);if(r===void 0)return{name:this.name,passed:!0};let s=r.filter(a=>wAe.test(a)===n);return s.length===0?{name:this.name,passed:!0}:Ot(this.name,[`${t.stage} left files outside .skyramp/ \u2014 move the staged test into .skyramp/staged/ and delete any codegen draft (e.g. *_scaffold.*): ${s.slice(0,6).join(", ")}`])}}}o(BAe,"noLitterGateFor");var MTe=BAe("backend");var QAe="write-stale-updates",RAe={[QAe]:"stale test updates"};var _A=Se(require("fs")),Aa=Se(require("path"));function c2(e){return mn(kv,e).errors}o(c2,"validateAdaptOutput");function TAe(e,t=[]){let{value:n,error:i}=$t(e,t);if(i)return{errors:[i]};let r=c2(n);return r.length>0?{errors:r}:{adapt:n,errors:[]}}o(TAe,"parseAdaptText");var DAe="adapt-scratch",o2=`${DAe}/adapt-result.json`;function u2(e,t){let n=Aa.join(e.outputsDir,o2),i;try{i=_A.readFileSync(n,"utf-8")}catch{i=void 0}if(i!==void 0&&(e.secretValues??[]).some(a=>i.includes(a)))return{errors:[`${o2} contains a secret value (token / credential) \u2014 never write it anywhere`]};let r=TAe(t.stdout,e.secretValues);if(r.adapt)return r;let s=i!==void 0?jo(n):void 0;return s!==void 0&&c2(s).length===0?{adapt:s,errors:[]}:r}o(u2,"parseAdaptFromSession");var gDe=$n("adapt-schema",u2);var l2=require("child_process");function zx(e){return _Ae(e)??[]}o(zx,"statusEntries");function _Ae(e){let t;try{t=(0,l2.execFileSync)("git",[...Ri,"status","--porcelain","-z","--untracked-files=all"],{env:Xt(),cwd:e,encoding:"utf-8",maxBuffer:16*1024*1024})}catch{return}let n=t.split("\0"),i=[];for(let r=0;r<n.length;r++){let s=n[r];if(s.length<4)continue;let a=s.slice(0,2);i.push({code:a,path:s.slice(3)}),(a[0]==="R"||a[0]==="C")&&r++}return i}o(_Ae,"readStatusEntries");var BDe=2*1024*1024;var uy=d.string().trim().min(1),NAe=d.object({cwd:uy.describe(`directory the command starts in, relative to the test's checkout ("." for its root)`),argv:d.array(uy).min(1).describe("the command as separate arguments, run without a shell"),env:d.record(d.string(),d.string()).optional().describe("plain settings the listing needs beyond the CI step's own; never a credential or PATH")}),UAe=d.object({file:uy.describe("a file of the test's checkout, relative to its root"),line:uy.describe("a line of that file, quoted exactly from where its command starts to its end")}),d2=d.object({collected:d.boolean().describe("whether the repo's CI runs this test as it is"),steps:d.array(UAe).optional().describe("when collected: the line in a CI file that starts the tests, then each line it runs on the way to the test runner"),runner:d.string().optional().describe("when collected: the test runner the last of those lines starts, by the name that line and the list command both use"),list:NAe.optional().describe("when collected: a command that lists the tests that runner collects without running them; Testbot runs it, and its output must name this file"),why:d.string().optional().describe("when not collected: why the repo's CI will not run it")});var ce=d.string().trim().min(1),jAe=o(e=>{if(!e||typeof e!="object")return e;let t=e;return typeof t.skip=="string"&&t.skip.trim()&&(t.expected===void 0||t.expected===null)?{...t,expected:"(not tested)"}:e},"skippedNeedsNoExpected"),GAe=d.preprocess(jAe,d.object({id:ce.describe(`its requirement's id plus a letter, e.g. "R1a", "AC-3a"`),clause:ce.describe("one testable part of the requirement"),expected:ce.describe("the outcome the requirement calls for \u2014 taken from the requirement, never from what the code does"),skip:d.string().optional().describe("only when no test can check this clause here: why"),type:d.nativeEnum(Gi).optional().describe("the test that checks this clause: contract / integration (the API, or code called directly in-process: a function, hook or module) or ui (a page)"),target:d.string().optional().describe('its "METHOD /path", or the page / flow'),steps:d.string().optional().describe("what that test does; its expected outcome is this clause's"),finding:d.string().optional().describe("the finding id, when this clause's test also catches that defect (the defect still gets a case of its own)"),code:d.string().optional().describe("path:line of the code that decides this clause, when there is one; in another repo of the change, that repo's directory name then its path"),stated:d.string().optional().describe("the description's or spec's own words that state this clause, copied exactly, when they do"),mutates:d.boolean().optional().describe("true when its test changes state, in the test or its setup: an API POST, PUT, PATCH or DELETE, or a UI flow that submits, creates, edits or deletes"),browserOnly:d.boolean().optional().describe("true when its behaviour happens only in a browser: real clicks or keys driving page script, client-side sorting or filtering, script-driven DOM updates, focus, drag-and-drop, navigation, rendering that depends on CSS or JavaScript"),browserHarness:d.string().optional().describe("browserOnly, off the runtime path: the path of the repo's in-process browser suite its test goes in (e.g. a Django StaticLiveServerTestCase test that drives Selenium)"),quote:d.string().optional().describe("the words of the spec, plan, ticket or PR description that state this clause, copied exactly; a file of the repository: its path:line first. Leave it out when no source states it"),inferred:d.boolean().optional().describe("leave it out: Testbot sets it when no source states this clause (contracts/clause-grounding.ts)")})),p2=d.object({spec:d.string().optional().describe("file:line of a spec in the repository"),prDescription:d.boolean().optional().describe("or true when a pull request description says otherwise"),reference:d.string().optional().describe("or the key of an item the run was given, as listed"),says:ce.describe("what it says there, in its own words, copied exactly"),criterion:d.number().int().positive().optional().describe("an item's only: leave it out; Testbot numbers it")}).refine(e=>[!!e.prDescription,!!e.spec?.trim(),!!e.reference?.trim()].filter(Boolean).length===1,{message:`names no source, or more than one: give "spec" its file:line or "reference" an item's key, or set "prDescription", one of them; list each source as its own entry`}),VAe=d.object({id:ce.describe('the label its source gives it ("AC-3", "REQ-12"; item 4 of a numbered list is "R4"), else "R1", "R2"\u2026 in order'),statement:ce,source:d.nativeEnum(pi).describe("requirement-reference (an item the run was given), spec, pr-description (also for what the change is evidently meant to do when nothing is written down), or could-break (what the change could break that no requirement mentions)"),reference:d.string().optional().describe('requirement-reference only: the key of its item as listed, e.g. "PAY-184", or a Confluence page id such as "3021"'),evidence:ce.describe("where it is stated: for requirement-reference, the item's own words, copied exactly; else file:line, a doc section, or the quoted phrase"),criterion:d.number().int().positive().optional().describe("requirement-reference only: leave it out; Testbot numbers each criterion by the item's own label (AC2, 2.), else after the item's labels"),alsoFrom:d.array(d.object({reference:ce.regex(Cs).describe("the key of another uploaded document stating the same obligation"),says:ce.describe("that document's own words, copied exactly; never infer equivalence from a shared criterion number"),criterion:d.number().int().positive().optional().describe("leave out; Testbot grounds and numbers this source separately")})).optional().describe("equivalent uploaded source criteria sharing this requirement's planned cases; retain every source with its own quote. Different conditions or boundaries need distinct requirements"),notInChange:d.string().optional().describe("requirement-reference only: when the change does not touch this criterion at all (e.g. a later step of a staged rollout), why; give it no clauses"),unchanged:d.boolean().optional().describe("true when it asks only that behaviour stay as it was (an update or refactor that must not change how something works), whatever its source"),overrules:d.array(p2).optional().describe("requirement-reference only: each lower-ranked source that says otherwise, a spec in the repository, a PR description or another item; this requirement wins, so test what it says"),clauses:d.array(GAe)}),f2=(r=>(r.ServerError="server-error",r.DataLost="data-lost",r.FinalState="final-state",r.DerivedValues="derived-values",r))(f2||{}),zAe=d.object({id:ce.describe('e.g. "F1"'),file:ce,line:d.number().optional(),claim:ce.describe("the defect, in one sentence"),severity:d.nativeEnum(la),evidence:ce.describe("the code line, or the probe request and response, that shows it"),conflictsWith:d.array(ce).optional().describe("requirement or clause ids it violates"),keeps:d.string().optional().describe("for a defect no requirement or clause states: path:line of the code beside the change that keeps the rule it breaks"),rule:d.nativeEnum(f2).optional().describe("for a defect that breaks a rule every app keeps, which nothing needs to state: which one"),existing:d.string().optional().describe("only when the base already does this, in code the change left as it was: where the base does it (its file:line); such a defect gets no case"),needsApp:d.enum(["browser","live-api"]).optional().describe("only when the running app alone can show this defect and the repo has no in-process test that can: browser (page script, what the user sees after a click or a save) or live-api (code the repo tests only against the running app's API)")}),qAe=d.object({id:ce.describe('e.g. "Q1"'),question:ce.describe("what is unsettled, as a question the PR author can answer"),readings:d.array(ce).min(2).describe("each reasonable behaviour, with what points to it (file:line, or the words that suggest it)"),about:d.string().optional().describe("the requirement or clause id it is about, when there is one"),sources:d.array(p2).optional().describe("when sources of the same rank disagree on it: each of them")}),JAe=d.object({id:ce.describe('unique, a short kebab-case name for what the case checks, e.g. "ship-twice-409"'),type:d.nativeEnum(Gi).describe("contract / integration: checks the API, or calls code directly in-process (a function, hook or module); ui: checks what a user sees or does on a page"),target:ce.describe('"METHOD /path", or the page / flow'),clause:d.string().optional().describe("the clause id this case checks"),finding:d.string().optional().describe("the finding id this case catches"),steps:ce.describe("what the test does"),expected:ce.describe("the expected outcome, from the clause"),mutates:d.boolean().optional().describe("true when its test changes state, in the test or its setup: an API POST, PUT, PATCH or DELETE, or a UI flow that submits, creates, edits or deletes")}),HAe=d.object({test:ce.describe("existing test file"),action:d.nativeEnum(li),reason:ce,mutates:d.boolean().optional().describe("true when the maintained test changes state"),clauses:d.array(ce).optional().describe("the clause ids this test checks")}),A2=d.array(vv).optional(),YAe=d.object({components:d.preprocess(e=>A2.safeParse(e).success?e:void 0,A2).describe("when saving a new or changed recipe: every app and backing service actually brought up, its source repository, and whether it is healthy"),outcome:d.nativeEnum(ri).describe("clean | recipe-drift (you had to fix the recipe) | change-broke-bringup (this PR broke start-up) | bringup-failed (the environment, not the PR)"),baseUrls:d.record(d.string()).optional().describe("service \u2192 base URL of the running app"),health:d.object({url:d.string().optional(),command:d.string().optional(),output:d.string().optional()}).optional().describe("the check that shows the app serves real data, and what it returned"),teardown:d.string().optional().describe("command that stops the app"),dependencies:d.record(d.boolean()).optional().describe("every backing service: true = really running, false = mocked"),recipeFixes:d.array(d.string()).optional().describe("what you changed in the recipe"),error:d.string().optional().describe("when it did not come up: the failing command and what it printed"),suspectFiles:d.array(d.string()).optional().describe("change-broke-bringup: the changed files to blame"),missingSecrets:d.array(d.string().regex(Yl)).optional().describe("bringup-failed only: each secret, key, token or password the app cannot start without that this run has no value for, by its environment variable name; never a value"),login:d.object({username:ce,password:d.string()}).optional().describe("the account the tests sign in as, when they sign in: each a literal value the recipe seeds, or $VARIABLE when a secret in the environment holds it"),revisions:Bv.optional()}),c_e=d.object({schemaVersion:d.literal(1),requirements:d.array(VAe),findings:d.array(zAe),cases:d.array(JAe).describe("a second test for a clause, and one case per finding that fails on this branch"),questions:d.array(qAe).optional().describe("behaviours the change leaves unsettled; no case asserts any of them"),maintenance:d.array(HAe),journeys:d.array(Yz).optional().describe("the user journeys that, together, pass through everything the change alters that a user sees or does; empty when it alters nothing a user sees"),notInJourney:d.array(d.object({clause:ce,why:ce})).optional().describe("a clause a user sees or does that no journey walks, and why: none can reach it through the UI, or it is downstream of this change and not walked here"),unplannedComponents:d.array(d.object({components:d.array(ce).min(1).describe("changed components, as the change lists them"),why:ce})).optional().describe("changed components no clause reaches, and why their change needs no test; several may share one reason"),triage:TA.optional().describe("the validation triage decision, made before the app is started; its behaviorIds are clause ids"),app:YAe.optional().describe("omit when no app was needed or none was started"),summary:ce.describe("one paragraph: what the change does and where the risk is")});var NA=(n=>(n.Backend="backend",n.Ui="ui",n))(NA||{});var js=(r=>(r.Added="added",r.Updated="updated",r.Deleted="deleted",r.Unchanged="unchanged",r))(js||{}),WAe=d.object({file:ce.describe("repo-relative path; in another repo of the change, that repo's directory name then its path"),kind:d.nativeEnum(NA),change:d.nativeEnum(js).describe("added: a file you created; updated / deleted / unchanged: an existing test"),covers:d.array(d.string()).describe("the plan case ids this file tests, each with its own result under result.cases"),defect:d.boolean().optional().describe("true when a case of it fails because the app is wrong and the test is right \u2014 kept failing on purpose"),staleBecause:d.object({requirement:ce.describe("the requirement or clause id the change deliberately alters"),line:ce.describe("path:line (or path) of the application code the change altered that makes this test's old expectation wrong")}).optional().describe("for an existing test you updated or deleted: why it is out of date"),result:d.object({exit:d.number().nullable().describe("exit code of your last run of this file; null if it could not be run"),cases:d.array(d.object({case:ce,status:d.nativeEnum(pr),runtimeTargets:Wl.optional().describe("HTTP(S) URLs this case actually exercised in its current run, from its request or browser evidence; omit for local in-process/mocked checks, never list the shared app merely because it is configured"),defect:d.boolean().optional().describe("for a failing case: true when the app is wrong and the test is right; false when the test is at fault and you could not fix it"),testProblem:pg.optional().describe("for a failing case marked defect: false: what in the test is at fault"),failure:d.string().optional().describe("for a failing case: the runner's failure for it as printed (the error and the line it was raised at), not a summary"),cause:d.string().optional().describe("for a case you keep as a defect: path:line of the application code that makes it fail"),requires:d.string().optional().describe("for a case you keep as a defect: the words of the PR description, a requirement or clause of the plan, or the code a finding's keeps names, that state what its failing check expects, quoted exactly")})).describe("one entry per covered case, from the runner's own output"),details:d.string().optional().describe("what failed and why, or why it was not run"),noCases:d.string().optional().describe("for a failed run whose runner reported none of this file's tests (it failed to compile, import or collect): why")}),assertions:d.array(d.object({case:ce,evidence:ce})).optional().describe("per covered case, the assertion line that checks its expected outcome"),functions:d.array(d.object({name:ce.describe("the test function as the runner names it within its file, without the file (test_x, TestClass::test_x, TestSuite/TestCase)"),cases:d.array(ce).describe("the plan case ids it checks"),testProblem:pg.optional().describe("for a function that fails because of the test itself, while another function keeps a case it checks as a defect: what in it is at fault")})).optional().describe("for a file you added or updated: each test function in it and the plan case ids it checks"),skyramp:d.object({draft:d.union([d.string(),d.array(d.string())]).optional().describe("the draft path the Skyramp helper returned for this test, or each path when the test was made from several drafts"),handWritten:d.string().optional().describe("why it is written by hand: the helper call you made and what it returned")}).optional().describe("only for a test of a case the Skyramp API block lists: where it came from"),context:d.array(Px).optional().describe("what the test sets up outside its own process that another test could run into: data it creates in the app, a Skyramp mock, an env override; omit when none"),isolatedRun:ce.optional().describe("for a test with a context: the command, from its checkout's root and without a shell, that runs only this file"),ci:d2.optional().describe("for a file you added or updated: whether the repo's CI will run it, and how you know"),run:Cu.optional().describe(`for a file in ${vu}, added, updated or re-run: how the run executes only this file's tests, with the repository's own runner and the report it writes (junit, trx or jest-json to ${sn}, or go-test-json); Testbot runs it before write ends and re-runs the tests with it`)}),ZAe=o(e=>{if(!e||typeof e!="object")return e;let{test:t,...n}=e;return typeof t=="string"&&t.trim()&&n.tests===void 0?{...n,tests:[t]}:e},"oneTestIsTests"),KAe=d.preprocess(ZAe,d.object({description:ce.describe("what is wrong and how to reproduce it: endpoint or page, input, what you got vs what was expected"),severity:d.nativeEnum(la).optional(),sourceFile:d.string().optional().describe("the app file at fault"),sourceLine:d.number().optional(),tests:d.array(ce).optional().describe("every test file that fails because of it: a defect several tests show is one issue"),finding:d.string().optional().describe("the plan's finding id, when it is one"),requirements:d.array(ce).optional().describe("the plan's requirement or clause ids it violates")})),u_e=d.object({schemaVersion:d.literal(1),tests:d.array(WAe),notWritten:d.array(d.object({case:ce,reason:ce,coveredBy:d.object({file:ce.describe("the test file, relative to the working checkout; prefix a related checkout as for tests[].file"),name:ce.describe("the test function as the runner names it within its file, without the file (test_x, TestClass::test_x, TestSuite/TestCase)")}).optional().describe("only for an existing test triage independently linked to this exact case: its exact runner name (including class or describe titles). Testbot must finish re-running it with every result passed. If your own test covers the case, include the case in its covers and function cases instead")})).describe("every plan case no test covers, and why"),journeys:d.array(sy).optional().describe("one entry per planned user journey: the browser test that walks it end to end"),lint:d.object({command:d.string(),clean:d.boolean()}).optional().describe("the linter/formatter you ran on your test files, if the repo has one: the exact command, with its file paths (Testbot re-runs it)"),dependenciesAdded:d.array(d.object({package:ce,manifest:ce.describe("the manifest file's path relative to its checkout (e.g. package.json, pom.xml or pyproject.toml), and nothing else; name another checkout in repository"),repository:ce.optional().describe("owner/repo of the manifest's checkout; omit for the repo under test"),reason:ce.optional().describe("why the test must run inside the application's own test environment, so its manifest had to change \u2014 required for every entry")})).optional().describe("every package you added to an APPLICATION manifest (an exception, surfaced in the report); never the Testbot test package's own"),supportFiles:d.array(ce).optional().describe("every file that is not a test you created or changed for your tests, which they need to compile or run (a helper module, page object, fixture, or a snapshot the runner wrote for them), named as you name a test; Testbot delivers only the tests you list and the files under supportFiles"),ciNotes:d.string().optional().describe("for each test whose ci says the repo's CI will not run it: the test, and the exact change the author must make for CI to run it"),commit:d.object({message:ce.describe("subject line at most 72 characters, following the repository's commit-message checks"),prTitle:ce.describe("at most 72 characters, following the repository's PR-title checks"),prBody:ce.describe("what the tests cover and what they found")}),report:d.object({summary:ce.describe("1-2 sentences for the PR author: does the change do what it says?"),issues:d.array(KAe).describe("every defect the tests found"),nextSteps:d.array(d.string()),noTests:d.array(d.object({repository:ce,reason:ce.max(4096)})).max(1e3).optional().describe("each Change Set repository where no test was added or updated: its owner/repo and why, naming the other repository when its tests went there"),notesDeviation:d.string().trim().max(4096).optional().describe("when the Target notes say where tests go and a test you added went elsewhere: where it went, and why; omit otherwise")})});var l_e={added:"place",updated:"update",deleted:"delete",unchanged:"verify"};var h2=(i=>(i.Requirement="requirement",i.PrDescription="pr_description",i.Code="code",i))(h2||{}),qt=d.string().trim().min(1),XAe=d.object({expectation:qt.max(300).describe("the behavior this assertion pins, in words"),source:d.nativeEnum(h2),expected:qt.max(200).describe("the exact value or outcome asserted, as the test asserts it")}),epe=d.object({file:qt.describe("path of the NEW test file you wrote, relative to its repository"),repository:qt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),framework:qt.describe("the framework the repository runs this file with: pytest, jest, vitest, node-test, or the name of any other"),run:Cu.optional().describe(`for ${vu}: how the run executes only the tests in names, with the repository's own runner writing JUnit XML to {junit}`),covers:d.array(qt).length(1).describe("the ONE behavior id, or defect id, from the plan that the tests in names provide evidence for; a file covering several is listed once per id"),names:d.array(qt).min(1).describe("the test functions/cases in the file that provide evidence for that behavior, as the framework names them"),assertions:d.array(XAe).min(1)}),UA=(n=>(n.Updated="updated",n.Deleted="deleted",n))(UA||{}),g2=300,tpe=d.object({file:qt.describe("path of the EXISTING test file you updated or deleted, relative to its repository"),repository:qt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),change:d.nativeEnum(UA),staleBecause:d.object({requirement:qt.describe("the requirement or clause id the change deliberately alters"),line:qt.describe("path:line (or path) of the application code the change altered that makes this test's old expectation wrong")}).optional().describe("for an existing test you updated: why it is out of date"),reason:d.preprocess(e=>typeof e=="string"?e.trim().slice(0,g2):e,qt.max(g2)).describe("what the change deliberately altered that made the test wrong")}),qx=d.object({schemaVersion:d.literal(1),tests:d.array(epe),maintained:d.array(tpe).optional().describe("existing tests the change made stale that you updated or deleted; omit when there were none"),defectsNotTested:d.array(d.object({id:qt,reason:qt.max(300)})).optional().describe("defects the plan found that no in-process test can reach, each with why; omit when every defect has a test"),journeys:d.array(sy).optional().describe("one entry per planned user journey: the in-process test that walks it end to end"),journeysNotWritten:d.array(d.object({journey:qt,missing:qt.transform(e=>e.length>300?`${e.slice(0,299)}\u2026`:e)})).optional().describe("a planned journey no in-process test can walk here, with what it needs that is missing; it is reported as not covered"),lint:d.object({command:d.string(),clean:d.boolean()}).optional().describe("the linter/formatter you ran on your test files, if the repository has one you can run; omit otherwise"),commitMessage:qt.optional().describe("the commit message for your tests: a subject line of at most 72 characters, then what they cover")});var FA="generate-unit.json";function rpe(e){let{value:t,error:n}=$t(e);if(n)return{errors:[n]};let{value:i,errors:r}=mn(qx,t);return r.length?{errors:r}:{output:i,errors:[]}}o(rpe,"parseGenerateUnitText");function ipe(e){return rpe(e.stdout)}o(ipe,"parseGenerateUnitFromSession");var eNe=$n("generate-unit-schema",(e,t)=>ipe(t));var ly=String.raw`(?:node:)?(?:http|https|http2|net|tls|dgram)`,tNe=[[/\b(localhost|127\.0\.0\.1|0\.0\.0\.0)\b/,"a local server address"],[/^\s*(import|from)\s+(requests|aiohttp|urllib3|websockets?)\b/m,"an HTTP client"],[/^\s*(?:import|from)\s+(?:urllib\.request|http\.client|http\.server|socket|ssl|ftplib|smtplib|telnetlib)\b|^\s*from\s+urllib\s+import\b[^\n]*\brequest\b|\burlopen\s*\(/m,"a standard-library network client"],[/\bfrom\s+["'](axios|node-fetch|undici|ws)["']|require\(\s*["'](axios|node-fetch|undici|ws)["']\s*\)/,"an HTTP client"],[new RegExp(String.raw`\bfrom\s+["']${ly}["']|\bimport\s+["']${ly}["']|require\(\s*["']${ly}["']\s*\)|\bimport\(\s*["']${ly}["']\s*\)`),"Node's network modules"],[/\bfetch\s*\(|\bnew\s+(XMLHttpRequest|WebSocket)\b/,"a network call (fetch, XMLHttpRequest, WebSocket)"],[/\bskyramp\b/i,"the Skyramp runtime (a runtime mock or client)"]];var vNe=new Set(["targeted_unit","existing_evidence_sufficient"]);var Ape="triage.json";var xUe=new Set(["existing_evidence","unaffected","existing_unit","new_unit","runtime"]),$Ue={existing_evidence:"existing evidence",unaffected:"showing the change cannot reach it",existing_unit:"running the existing unit tests",new_unit:"a new unit test",runtime:"tests against the running application"};function ppe(e){let{value:t,error:n}=$t(e);if(n)return{errors:[n]};let{value:i,errors:r}=mn(TA,t);return r.length?{errors:r}:{triage:i,errors:[]}}o(ppe,"parseTriageText");function fpe(e){return ppe(e.stdout)}o(fpe,"parseTriageFromSession");var TUe=$n("triage-schema",(e,t)=>fpe(t));function gpe(e){let t=e.inputs?.pipeline;return t?e.state.stages[t==="two-step"?"plan":"triage"]:e.state.stages.triage??e.state.stages.plan}o(gpe,"triageDecider");function Hx(e){if(gpe(e)?.status==="passed")return jo(v2.join(e.outputsDir,Ape))}o(Hx,"readTriage");function Yx(e){return W1(QR(e.inputs,Ve(e,`${mA}.json`),Hx(e)?.sutRequired))}o(Yx,"revisionBlockReason");var DUe=new Set(["deploy","recommend","generate","generate-ui","adapt","generate-unit","native-run","finalize","deliver"]);var Pr=Se(require("fs")),Vs=Se(require("path")),gq=Se(require("crypto")),hq=require("child_process");var Wx=require("child_process"),Bu=Se(require("fs")),b2=Se(require("os")),py=Se(require("path"));var hpe={onPath:o(e=>(0,Wx.spawnSync)("sh",["-c",`command -v ${e}`],{stdio:"ignore"}).status===0,"onPath"),run:o((e,t)=>(0,Wx.spawnSync)(e[0],e.slice(1),{cwd:t,stdio:"ignore",timeout:6e4}).status??1,"run")},Ay={cleanup:o(()=>{},"cleanup")},mpe=new Set(["pnpm","yarn"]);function w2(e,t=b2.tmpdir(),n=hpe){if(process.platform==="win32")return Ay;try{let i=wx(e);if(!mpe.has(i)||n.onPath(i)||!n.onPath("corepack"))return Ay;Bu.mkdirSync(t,{recursive:!0});let r=Bu.mkdtempSync(py.join(t,"testbot-pm-")),s=o(()=>Bu.rmSync(r,{recursive:!0,force:!0}),"cleanup");return n.run(["corepack","enable","--install-directory",r,i],e)!==0?(s(),Ay):{dir:r,cleanup:s}}catch{return Ay}}o(w2,"packageManagerShims");function B2(e,t=process.env){return e.dir?{...t,PATH:[e.dir,t.PATH].filter(Boolean).join(py.delimiter)}:t}o(B2,"withShims");var jA=require("crypto");function Jt(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(r=>r.length)),n="`".repeat(t+1),i=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${i}${e}${i}${n}`}o(Jt,"codeSpan");Ac();var iFe=5*6e4,sFe=12*6e4,oFe=2*6e4;var pFe=["class TestbotProjectBrowsers {"," onBegin(config) {",' const projects = config.projects.map((p) => ({ browserName: p.use.browserName ?? p.use.defaultBrowserType ?? "chromium", channel: p.use.channel ?? null }));',' process.stdout.write("TESTBOT_PROJECT_BROWSERS " + JSON.stringify(projects) + "\\n");'," }"," printsToStdio() { return true; }","}","module.exports = TestbotProjectBrowsers;",""].join(`
|
|
158
|
+
`)){if(!r.trim()||r.length>1&&r[1]==="D")continue;let s=r.slice(3).trim(),a=s.indexOf(" -> ");if(a!==-1&&(s=s.slice(a+4).trim()),s=s.replace(/^"|"$/g,""),!s)continue;let c=s.replace(/^\.\//,"");c.startsWith(".skyramp/")||!n(c)||i.push(c)}return i}o(i2,"testLitter");function BAe(e){let t=cy[e],n=e==="ui";return{name:`${t.stage}-no-litter`,verify(i){let r=i2(i.inputs.repositoryPath);if(r===void 0)return{name:this.name,passed:!0};let s=r.filter(a=>wAe.test(a)===n);return s.length===0?{name:this.name,passed:!0}:Ot(this.name,[`${t.stage} left files outside .skyramp/ \u2014 move the staged test into .skyramp/staged/ and delete any codegen draft (e.g. *_scaffold.*): ${s.slice(0,6).join(", ")}`])}}}o(BAe,"noLitterGateFor");var MTe=BAe("backend");var QAe="write-stale-updates",RAe={[QAe]:"stale test updates"};var _A=Se(require("fs")),Aa=Se(require("path"));function c2(e){return mn(kv,e).errors}o(c2,"validateAdaptOutput");function TAe(e,t=[]){let{value:n,error:i}=$t(e,t);if(i)return{errors:[i]};let r=c2(n);return r.length>0?{errors:r}:{adapt:n,errors:[]}}o(TAe,"parseAdaptText");var DAe="adapt-scratch",o2=`${DAe}/adapt-result.json`;function u2(e,t){let n=Aa.join(e.outputsDir,o2),i;try{i=_A.readFileSync(n,"utf-8")}catch{i=void 0}if(i!==void 0&&(e.secretValues??[]).some(a=>i.includes(a)))return{errors:[`${o2} contains a secret value (token / credential) \u2014 never write it anywhere`]};let r=TAe(t.stdout,e.secretValues);if(r.adapt)return r;let s=i!==void 0?jo(n):void 0;return s!==void 0&&c2(s).length===0?{adapt:s,errors:[]}:r}o(u2,"parseAdaptFromSession");var gDe=$n("adapt-schema",u2);var l2=require("child_process");function zx(e){return _Ae(e)??[]}o(zx,"statusEntries");function _Ae(e){let t;try{t=(0,l2.execFileSync)("git",[...Ri,"status","--porcelain","-z","--untracked-files=all"],{env:Xt(),cwd:e,encoding:"utf-8",maxBuffer:16*1024*1024})}catch{return}let n=t.split("\0"),i=[];for(let r=0;r<n.length;r++){let s=n[r];if(s.length<4)continue;let a=s.slice(0,2);i.push({code:a,path:s.slice(3)}),(a[0]==="R"||a[0]==="C")&&r++}return i}o(_Ae,"readStatusEntries");var BDe=2*1024*1024;var uy=d.string().trim().min(1),NAe=d.object({cwd:uy.describe(`directory the command starts in, relative to the test's checkout ("." for its root)`),argv:d.array(uy).min(1).describe("the command as separate arguments, run without a shell"),env:d.record(d.string(),d.string()).optional().describe("plain settings the listing needs beyond the CI step's own; never a credential or PATH")}),UAe=d.object({file:uy.describe("a file of the test's checkout, relative to its root"),line:uy.describe("a line of that file, quoted exactly from where its command starts to its end")}),d2=d.object({collected:d.boolean().describe("whether the repo's CI runs this test as it is"),steps:d.array(UAe).optional().describe("when collected: the line in a CI file that starts the tests, then each line it runs on the way to the test runner"),runner:d.string().optional().describe("when collected: the test runner the last of those lines starts, by the name that line and the list command both use"),list:NAe.optional().describe("when collected: a command that lists the tests that runner collects without running them; Testbot runs it, and its output must name this file"),why:d.string().optional().describe("when not collected: why the repo's CI will not run it")});var ce=d.string().trim().min(1),jAe=o(e=>{if(!e||typeof e!="object")return e;let t=e;return typeof t.skip=="string"&&t.skip.trim()&&(t.expected===void 0||t.expected===null)?{...t,expected:"(not tested)"}:e},"skippedNeedsNoExpected"),GAe=d.preprocess(jAe,d.object({id:ce.describe(`its requirement's id plus a letter, e.g. "R1a", "AC-3a"`),clause:ce.describe("one testable part of the requirement"),expected:ce.describe("the outcome the requirement calls for \u2014 taken from the requirement, never from what the code does"),skip:d.string().optional().describe("only when no test can check this clause here: why"),type:d.nativeEnum(Gi).optional().describe("the test that checks this clause: contract / integration (the API, or code called directly in-process: a function, hook or module) or ui (a page)"),target:d.string().optional().describe('its "METHOD /path", or the page / flow'),steps:d.string().optional().describe("what that test does; its expected outcome is this clause's"),finding:d.string().optional().describe("the finding id, when this clause's test also catches that defect (the defect still gets a case of its own)"),code:d.string().optional().describe("path:line of the code that decides this clause, when there is one; in another repo of the change, that repo's directory name then its path"),stated:d.string().optional().describe("the description's or spec's own words that state this clause, copied exactly, when they do"),mutates:d.boolean().optional().describe("true when its test changes state, in the test or its setup: an API POST, PUT, PATCH or DELETE, or a UI flow that submits, creates, edits or deletes"),browserOnly:d.boolean().optional().describe("true when its behaviour happens only in a browser: real clicks or keys driving page script, client-side sorting or filtering, script-driven DOM updates, focus, drag-and-drop, navigation, rendering that depends on CSS or JavaScript"),browserHarness:d.string().optional().describe("browserOnly, off the runtime path: the path of the repo's in-process browser suite its test goes in (e.g. a Django StaticLiveServerTestCase test that drives Selenium)"),quote:d.string().optional().describe("the words of the spec, plan, ticket or PR description that state this clause, copied exactly; a file of the repository: its path:line first. Leave it out when no source states it"),inferred:d.boolean().optional().describe("leave it out: Testbot sets it when no source states this clause (contracts/clause-grounding.ts)")})),p2=d.object({spec:d.string().optional().describe("file:line of a spec in the repository"),prDescription:d.boolean().optional().describe("or true when a pull request description says otherwise"),reference:d.string().optional().describe("or the key of an item the run was given, as listed"),says:ce.describe("what it says there, in its own words, copied exactly"),criterion:d.number().int().positive().optional().describe("an item's only: leave it out; Testbot numbers it")}).refine(e=>[!!e.prDescription,!!e.spec?.trim(),!!e.reference?.trim()].filter(Boolean).length===1,{message:`names no source, or more than one: give "spec" its file:line or "reference" an item's key, or set "prDescription", one of them; list each source as its own entry`}),VAe=d.object({id:ce.describe('the label its source gives it ("AC-3", "REQ-12"; item 4 of a numbered list is "R4"), else "R1", "R2"\u2026 in order'),statement:ce,source:d.nativeEnum(pi).describe("requirement-reference (an item the run was given), spec, pr-description (also for what the change is evidently meant to do when nothing is written down), or could-break (what the change could break that no requirement mentions)"),reference:d.string().optional().describe('requirement-reference only: the key of its item as listed, e.g. "PAY-184", or a Confluence page id such as "3021"'),evidence:ce.describe("where it is stated: for requirement-reference, the item's own words, copied exactly; else file:line, a doc section, or the quoted phrase"),criterion:d.number().int().positive().optional().describe("requirement-reference only: leave it out; Testbot numbers each criterion by the item's own label (AC2, 2.), else after the item's labels"),alsoFrom:d.array(d.object({reference:ce.regex(Cs).describe("the key of another uploaded document stating the same obligation"),says:ce.describe("that document's own words, copied exactly; never infer equivalence from a shared criterion number"),criterion:d.number().int().positive().optional().describe("leave out; Testbot grounds and numbers this source separately")})).optional().describe("equivalent uploaded source criteria sharing this requirement's planned cases; retain every source with its own quote. Different conditions or boundaries need distinct requirements"),notInChange:d.string().optional().describe("requirement-reference only: when the change does not touch this criterion at all (e.g. a later step of a staged rollout), why; give it no clauses"),unchanged:d.boolean().optional().describe("true when it asks only that behaviour stay as it was (an update or refactor that must not change how something works), whatever its source"),overrules:d.array(p2).optional().describe("requirement-reference only: each lower-ranked source that says otherwise, a spec in the repository, a PR description or another item; this requirement wins, so test what it says"),clauses:d.array(GAe)}),f2=(r=>(r.ServerError="server-error",r.DataLost="data-lost",r.FinalState="final-state",r.DerivedValues="derived-values",r))(f2||{}),zAe=d.object({id:ce.describe('e.g. "F1"'),file:ce,line:d.number().optional(),claim:ce.describe("the defect, in one sentence"),severity:d.nativeEnum(la),evidence:ce.describe("the code line, or the probe request and response, that shows it"),conflictsWith:d.array(ce).optional().describe("requirement or clause ids it violates"),keeps:d.string().optional().describe("for a defect no requirement or clause states: path:line of the code beside the change that keeps the rule it breaks"),rule:d.nativeEnum(f2).optional().describe("for a defect that breaks a rule every app keeps, which nothing needs to state: which one"),existing:d.string().optional().describe("only when the base already does this, in code the change left as it was: where the base does it (its file:line); such a defect gets no case"),needsApp:d.enum(["browser","live-api"]).optional().describe("only when the running app alone can show this defect and the repo has no in-process test that can: browser (page script, what the user sees after a click or a save) or live-api (code the repo tests only against the running app's API)")}),qAe=d.object({id:ce.describe('e.g. "Q1"'),question:ce.describe("what is unsettled, as a question the PR author can answer"),readings:d.array(ce).min(2).describe("each reasonable behaviour, with what points to it (file:line, or the words that suggest it)"),about:d.string().optional().describe("the requirement or clause id it is about, when there is one"),sources:d.array(p2).optional().describe("when sources of the same rank disagree on it: each of them")}),JAe=d.object({id:ce.describe('unique, a short kebab-case name for what the case checks, e.g. "ship-twice-409"'),type:d.nativeEnum(Gi).describe("contract / integration: checks the API, or calls code directly in-process (a function, hook or module); ui: checks what a user sees or does on a page"),target:ce.describe('"METHOD /path", or the page / flow'),clause:d.string().optional().describe("the clause id this case checks"),finding:d.string().optional().describe("the finding id this case catches"),steps:ce.describe("what the test does"),expected:ce.describe("the expected outcome, from the clause"),mutates:d.boolean().optional().describe("true when its test changes state, in the test or its setup: an API POST, PUT, PATCH or DELETE, or a UI flow that submits, creates, edits or deletes")}),HAe=d.object({test:ce.describe("existing test file"),action:d.nativeEnum(li),reason:ce,mutates:d.boolean().optional().describe("true when the maintained test changes state"),clauses:d.array(ce).optional().describe("the clause ids this test checks"),staleOnBase:d.boolean().optional().describe("true when the test's own expectation was already wrong before this change: it fails the same way on the base branch, where the app does what it should. Not one the base app's own bug fails (that is an existing defect). It is verify, never update: re-run as it is, its failure the test's own. A delete the change justifies stays a delete")}),A2=d.array(vv).optional(),YAe=d.object({components:d.preprocess(e=>A2.safeParse(e).success?e:void 0,A2).describe("when saving a new or changed recipe: every app and backing service actually brought up, its source repository, and whether it is healthy"),outcome:d.nativeEnum(ri).describe("clean | recipe-drift (you had to fix the recipe) | change-broke-bringup (this PR broke start-up) | bringup-failed (the environment, not the PR)"),baseUrls:d.record(d.string()).optional().describe("service \u2192 base URL of the running app"),health:d.object({url:d.string().optional(),command:d.string().optional(),output:d.string().optional()}).optional().describe("the check that shows the app serves real data, and what it returned"),teardown:d.string().optional().describe("command that stops the app"),dependencies:d.record(d.boolean()).optional().describe("every backing service: true = really running, false = mocked"),recipeFixes:d.array(d.string()).optional().describe("what you changed in the recipe"),error:d.string().optional().describe("when it did not come up: the failing command and what it printed"),suspectFiles:d.array(d.string()).optional().describe("change-broke-bringup: the changed files to blame"),missingSecrets:d.array(d.string().regex(Yl)).optional().describe("bringup-failed only: each secret, key, token or password the app cannot start without that this run has no value for, by its environment variable name; never a value"),login:d.object({username:ce,password:d.string()}).optional().describe("the account the tests sign in as, when they sign in: each a literal value the recipe seeds, or $VARIABLE when a secret in the environment holds it"),revisions:Bv.optional()}),c_e=d.object({schemaVersion:d.literal(1),requirements:d.array(VAe),findings:d.array(zAe),cases:d.array(JAe).describe("a second test for a clause, and one case per finding that fails on this branch"),questions:d.array(qAe).optional().describe("behaviours the change leaves unsettled; no case asserts any of them"),maintenance:d.array(HAe),journeys:d.array(Yz).optional().describe("the user journeys that, together, pass through everything the change alters that a user sees or does; empty when it alters nothing a user sees"),notInJourney:d.array(d.object({clause:ce,why:ce})).optional().describe("a clause a user sees or does that no journey walks, and why: none can reach it through the UI, or it is downstream of this change and not walked here"),unplannedComponents:d.array(d.object({components:d.array(ce).min(1).describe("changed components, as the change lists them"),why:ce})).optional().describe("changed components no clause reaches, and why their change needs no test; several may share one reason"),triage:TA.optional().describe("the validation triage decision, made before the app is started; its behaviorIds are clause ids"),app:YAe.optional().describe("omit when no app was needed or none was started"),summary:ce.describe("one paragraph: what the change does and where the risk is")});var NA=(n=>(n.Backend="backend",n.Ui="ui",n))(NA||{});var js=(r=>(r.Added="added",r.Updated="updated",r.Deleted="deleted",r.Unchanged="unchanged",r))(js||{}),WAe=d.object({file:ce.describe("repo-relative path; in another repo of the change, that repo's directory name then its path"),kind:d.nativeEnum(NA),change:d.nativeEnum(js).describe("added: a file you created; updated / deleted / unchanged: an existing test"),covers:d.array(d.string()).describe("the plan case ids this file tests, each with its own result under result.cases"),defect:d.boolean().optional().describe("true when a case of it fails because the app is wrong and the test is right \u2014 kept failing on purpose"),staleBecause:d.object({requirement:ce.describe("the requirement or clause id the change deliberately alters"),line:ce.describe("path:line (or path) of the application code the change altered that makes this test's old expectation wrong")}).optional().describe("for an existing test you updated or deleted: why it is out of date"),staleOnBase:d.boolean().optional().describe("for an existing test that fails: true when it fails the same way on the base branch because its own expectation is wrong (the app there does what it should), so this change did not make it wrong. Not when the base app's own bug fails it: that is an existing defect. Leave it as it is (unchanged): its failure is the test's own"),result:d.object({exit:d.number().nullable().describe("exit code of your last run of this file; null if it could not be run"),cases:d.array(d.object({case:ce,status:d.nativeEnum(pr),runtimeTargets:Wl.optional().describe("HTTP(S) URLs this case actually exercised in its current run, from its request or browser evidence; omit for local in-process/mocked checks, never list the shared app merely because it is configured"),defect:d.boolean().optional().describe("for a failing case: true when the app is wrong and the test is right; false when the test is at fault and you could not fix it"),testProblem:pg.optional().describe("for a failing case marked defect: false: what in the test is at fault"),failure:d.string().optional().describe("for a failing case: the runner's failure for it as printed (the error and the line it was raised at), not a summary"),cause:d.string().optional().describe("for a case you keep as a defect: path:line of the application code that makes it fail"),requires:d.string().optional().describe("for a case you keep as a defect: the words of the PR description, a requirement or clause of the plan, or the code a finding's keeps names, that state what its failing check expects, quoted exactly")})).describe("one entry per covered case, from the runner's own output"),details:d.string().optional().describe("what failed and why, or why it was not run"),noCases:d.string().optional().describe("for a failed run whose runner reported none of this file's tests (it failed to compile, import or collect): why")}),assertions:d.array(d.object({case:ce,evidence:ce})).optional().describe("per covered case, the assertion line that checks its expected outcome"),functions:d.array(d.object({name:ce.describe("the test function as the runner names it within its file, without the file (test_x, TestClass::test_x, TestSuite/TestCase)"),cases:d.array(ce).describe("the plan case ids it checks"),testProblem:pg.optional().describe("for a function that fails because of the test itself, while another function keeps a case it checks as a defect: what in it is at fault")})).optional().describe("for a file you added or updated: each test function in it and the plan case ids it checks"),skyramp:d.object({draft:d.union([d.string(),d.array(d.string())]).optional().describe("the draft path the Skyramp helper returned for this test, or each path when the test was made from several drafts"),handWritten:d.string().optional().describe("why it is written by hand: the helper call you made and what it returned")}).optional().describe("only for a test of a case the Skyramp API block lists: where it came from"),context:d.array(Px).optional().describe("what the test sets up outside its own process that another test could run into: data it creates in the app, a Skyramp mock, an env override; omit when none"),isolatedRun:ce.optional().describe("for a test with a context: the command, from its checkout's root and without a shell, that runs only this file"),ci:d2.optional().describe("for a file you added or updated: whether the repo's CI will run it, and how you know"),run:Cu.optional().describe(`for a file in ${vu}, added, updated or re-run: how the run executes only this file's tests, with the repository's own runner and the report it writes (junit, trx or jest-json to ${sn}, or go-test-json); Testbot runs it before write ends and re-runs the tests with it`)}),ZAe=o(e=>{if(!e||typeof e!="object")return e;let{test:t,...n}=e;return typeof t=="string"&&t.trim()&&n.tests===void 0?{...n,tests:[t]}:e},"oneTestIsTests"),KAe=d.preprocess(ZAe,d.object({description:ce.describe("what is wrong and how to reproduce it: endpoint or page, input, what you got vs what was expected"),severity:d.nativeEnum(la).optional(),sourceFile:d.string().optional().describe("the app file at fault"),sourceLine:d.number().optional(),tests:d.array(ce).optional().describe("every test file that fails because of it: a defect several tests show is one issue"),finding:d.string().optional().describe("the plan's finding id, when it is one"),requirements:d.array(ce).optional().describe("the plan's requirement or clause ids it violates")})),u_e=d.object({schemaVersion:d.literal(1),tests:d.array(WAe),notWritten:d.array(d.object({case:ce,reason:ce,coveredBy:d.object({file:ce.describe("the test file, relative to the working checkout; prefix a related checkout as for tests[].file"),name:ce.describe("the test function as the runner names it within its file, without the file (test_x, TestClass::test_x, TestSuite/TestCase)")}).optional().describe("only for an existing test triage independently linked to this exact case: its exact runner name (including class or describe titles). Testbot must finish re-running it with every result passed. If your own test covers the case, include the case in its covers and function cases instead")})).describe("every plan case no test covers, and why"),journeys:d.array(sy).optional().describe("one entry per planned user journey: the browser test that walks it end to end"),lint:d.object({command:d.string(),clean:d.boolean()}).optional().describe("the linter/formatter you ran on your test files, if the repo has one: the exact command, with its file paths (Testbot re-runs it)"),dependenciesAdded:d.array(d.object({package:ce,manifest:ce.describe("the manifest file's path relative to its checkout (e.g. package.json, pom.xml or pyproject.toml), and nothing else; name another checkout in repository"),repository:ce.optional().describe("owner/repo of the manifest's checkout; omit for the repo under test"),reason:ce.optional().describe("why the test must run inside the application's own test environment, so its manifest had to change \u2014 required for every entry")})).optional().describe("every package you added to an APPLICATION manifest (an exception, surfaced in the report); never the Testbot test package's own"),supportFiles:d.array(ce).optional().describe("every file that is not a test you created or changed for your tests, which they need to compile or run (a helper module, page object, fixture, or a snapshot the runner wrote for them), named as you name a test; Testbot delivers only the tests you list and the files under supportFiles"),ciNotes:d.string().optional().describe("for each test whose ci says the repo's CI will not run it: the test, and the exact change the author must make for CI to run it"),commit:d.object({message:ce.describe("subject line at most 72 characters, following the repository's commit-message checks"),prTitle:ce.describe("at most 72 characters, following the repository's PR-title checks"),prBody:ce.describe("what the tests cover and what they found")}),report:d.object({summary:ce.describe("1-2 sentences for the PR author: does the change do what it says?"),issues:d.array(KAe).describe("every defect the tests found"),nextSteps:d.array(d.string()),noTests:d.array(d.object({repository:ce,reason:ce.max(4096)})).max(1e3).optional().describe("each Change Set repository where no test was added or updated: its owner/repo and why, naming the other repository when its tests went there"),notesDeviation:d.string().trim().max(4096).optional().describe("when the Target notes say where tests go and a test you added went elsewhere: where it went, and why; omit otherwise")})});var l_e={added:"place",updated:"update",deleted:"delete",unchanged:"verify"};var h2=(i=>(i.Requirement="requirement",i.PrDescription="pr_description",i.Code="code",i))(h2||{}),qt=d.string().trim().min(1),XAe=d.object({expectation:qt.max(300).describe("the behavior this assertion pins, in words"),source:d.nativeEnum(h2),expected:qt.max(200).describe("the exact value or outcome asserted, as the test asserts it")}),epe=d.object({file:qt.describe("path of the NEW test file you wrote, relative to its repository"),repository:qt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),framework:qt.describe("the framework the repository runs this file with: pytest, jest, vitest, node-test, or the name of any other"),run:Cu.optional().describe(`for ${vu}: how the run executes only the tests in names, with the repository's own runner writing JUnit XML to {junit}`),covers:d.array(qt).length(1).describe("the ONE behavior id, or defect id, from the plan that the tests in names provide evidence for; a file covering several is listed once per id"),names:d.array(qt).min(1).describe("the test functions/cases in the file that provide evidence for that behavior, as the framework names them"),assertions:d.array(XAe).min(1)}),UA=(n=>(n.Updated="updated",n.Deleted="deleted",n))(UA||{}),g2=300,tpe=d.object({file:qt.describe("path of the EXISTING test file you updated or deleted, relative to its repository"),repository:qt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),change:d.nativeEnum(UA),staleBecause:d.object({requirement:qt.describe("the requirement or clause id the change deliberately alters"),line:qt.describe("path:line (or path) of the application code the change altered that makes this test's old expectation wrong")}).optional().describe("for an existing test you updated: why it is out of date"),reason:d.preprocess(e=>typeof e=="string"?e.trim().slice(0,g2):e,qt.max(g2)).describe("what the change deliberately altered that made the test wrong")}),qx=d.object({schemaVersion:d.literal(1),tests:d.array(epe),maintained:d.array(tpe).optional().describe("existing tests the change made stale that you updated or deleted; omit when there were none"),defectsNotTested:d.array(d.object({id:qt,reason:qt.max(300)})).optional().describe("defects the plan found that no in-process test can reach, each with why; omit when every defect has a test"),journeys:d.array(sy).optional().describe("one entry per planned user journey: the in-process test that walks it end to end"),journeysNotWritten:d.array(d.object({journey:qt,missing:qt.transform(e=>e.length>300?`${e.slice(0,299)}\u2026`:e)})).optional().describe("a planned journey no in-process test can walk here, with what it needs that is missing; it is reported as not covered"),lint:d.object({command:d.string(),clean:d.boolean()}).optional().describe("the linter/formatter you ran on your test files, if the repository has one you can run; omit otherwise"),commitMessage:qt.optional().describe("the commit message for your tests: a subject line of at most 72 characters, then what they cover")});var FA="generate-unit.json";function rpe(e){let{value:t,error:n}=$t(e);if(n)return{errors:[n]};let{value:i,errors:r}=mn(qx,t);return r.length?{errors:r}:{output:i,errors:[]}}o(rpe,"parseGenerateUnitText");function ipe(e){return rpe(e.stdout)}o(ipe,"parseGenerateUnitFromSession");var eNe=$n("generate-unit-schema",(e,t)=>ipe(t));var ly=String.raw`(?:node:)?(?:http|https|http2|net|tls|dgram)`,tNe=[[/\b(localhost|127\.0\.0\.1|0\.0\.0\.0)\b/,"a local server address"],[/^\s*(import|from)\s+(requests|aiohttp|urllib3|websockets?)\b/m,"an HTTP client"],[/^\s*(?:import|from)\s+(?:urllib\.request|http\.client|http\.server|socket|ssl|ftplib|smtplib|telnetlib)\b|^\s*from\s+urllib\s+import\b[^\n]*\brequest\b|\burlopen\s*\(/m,"a standard-library network client"],[/\bfrom\s+["'](axios|node-fetch|undici|ws)["']|require\(\s*["'](axios|node-fetch|undici|ws)["']\s*\)/,"an HTTP client"],[new RegExp(String.raw`\bfrom\s+["']${ly}["']|\bimport\s+["']${ly}["']|require\(\s*["']${ly}["']\s*\)|\bimport\(\s*["']${ly}["']\s*\)`),"Node's network modules"],[/\bfetch\s*\(|\bnew\s+(XMLHttpRequest|WebSocket)\b/,"a network call (fetch, XMLHttpRequest, WebSocket)"],[/\bskyramp\b/i,"the Skyramp runtime (a runtime mock or client)"]];var vNe=new Set(["targeted_unit","existing_evidence_sufficient"]);var Ape="triage.json";var xUe=new Set(["existing_evidence","unaffected","existing_unit","new_unit","runtime"]),$Ue={existing_evidence:"existing evidence",unaffected:"showing the change cannot reach it",existing_unit:"running the existing unit tests",new_unit:"a new unit test",runtime:"tests against the running application"};function ppe(e){let{value:t,error:n}=$t(e);if(n)return{errors:[n]};let{value:i,errors:r}=mn(TA,t);return r.length?{errors:r}:{triage:i,errors:[]}}o(ppe,"parseTriageText");function fpe(e){return ppe(e.stdout)}o(fpe,"parseTriageFromSession");var TUe=$n("triage-schema",(e,t)=>fpe(t));function gpe(e){let t=e.inputs?.pipeline;return t?e.state.stages[t==="two-step"?"plan":"triage"]:e.state.stages.triage??e.state.stages.plan}o(gpe,"triageDecider");function Hx(e){if(gpe(e)?.status==="passed")return jo(v2.join(e.outputsDir,Ape))}o(Hx,"readTriage");function Yx(e){return W1(QR(e.inputs,Ve(e,`${mA}.json`),Hx(e)?.sutRequired))}o(Yx,"revisionBlockReason");var DUe=new Set(["deploy","recommend","generate","generate-ui","adapt","generate-unit","native-run","finalize","deliver"]);var Pr=Se(require("fs")),Vs=Se(require("path")),gq=Se(require("crypto")),hq=require("child_process");var Wx=require("child_process"),Bu=Se(require("fs")),b2=Se(require("os")),py=Se(require("path"));var hpe={onPath:o(e=>(0,Wx.spawnSync)("sh",["-c",`command -v ${e}`],{stdio:"ignore"}).status===0,"onPath"),run:o((e,t)=>(0,Wx.spawnSync)(e[0],e.slice(1),{cwd:t,stdio:"ignore",timeout:6e4}).status??1,"run")},Ay={cleanup:o(()=>{},"cleanup")},mpe=new Set(["pnpm","yarn"]);function w2(e,t=b2.tmpdir(),n=hpe){if(process.platform==="win32")return Ay;try{let i=wx(e);if(!mpe.has(i)||n.onPath(i)||!n.onPath("corepack"))return Ay;Bu.mkdirSync(t,{recursive:!0});let r=Bu.mkdtempSync(py.join(t,"testbot-pm-")),s=o(()=>Bu.rmSync(r,{recursive:!0,force:!0}),"cleanup");return n.run(["corepack","enable","--install-directory",r,i],e)!==0?(s(),Ay):{dir:r,cleanup:s}}catch{return Ay}}o(w2,"packageManagerShims");function B2(e,t=process.env){return e.dir?{...t,PATH:[e.dir,t.PATH].filter(Boolean).join(py.delimiter)}:t}o(B2,"withShims");var jA=require("crypto");function Jt(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(r=>r.length)),n="`".repeat(t+1),i=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${i}${e}${i}${n}`}o(Jt,"codeSpan");Ac();var iFe=5*6e4,sFe=12*6e4,oFe=2*6e4;var pFe=["class TestbotProjectBrowsers {"," onBegin(config) {",' const projects = config.projects.map((p) => ({ browserName: p.use.browserName ?? p.use.defaultBrowserType ?? "chromium", channel: p.use.channel ?? null }));',' process.stdout.write("TESTBOT_PROJECT_BROWSERS " + JSON.stringify(projects) + "\\n");'," }"," printsToStdio() { return true; }","}","module.exports = TestbotProjectBrowsers;",""].join(`
|
|
159
159
|
`);var BFe=[...gv,"AWS_REGION","AWS_DEFAULT_REGION","AWS_ENDPOINT_URL","AWS_ENDPOINT_URL_BEDROCK_RUNTIME","AWS_ENDPOINT_URL_STS","AWS_SHARED_CREDENTIALS_FILE","AWS_CONFIG_FILE","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_VERTEX","ANTHROPIC_BASE_URL","ANTHROPIC_BEDROCK_BASE_URL"].filter((e,t,n)=>n.indexOf(e)===t);var fy=Se(vx());var ePe={jest:"jest",vitest:"vitest"};var NPe=new Set(["jest","vitest","npm-test","playwright"]);var YPe=5*6e4;var PA=Se(require("path"));var IMe={python:"pytest",typescript:"playwright",javascript:"playwright"},CMe={pytest:"pytest",playwright:"playwright"};function Cpe(e){return mn(Vv,e).errors}o(Cpe,"validateFinalizeOutput");function vpe(e,t=[]){let{value:n,error:i}=$t(e,t);if(i)return{errors:[i]};let r=Cpe(n);return r.length>0?{errors:r}:{finalize:n,errors:[]}}o(vpe,"parseFinalizeText");var bpe="finalize-scratch";function wpe(e,t){let n=vpe(e.stdout,t?.secretValues);if(!n.finalize||!t?.outputsDir)return n;let i=o((r,s)=>r.trim()&&Rx(r.trim(),PA.join(t.outputsDir,bpe,s),"finalize")||r,"script");return{...n,finalize:{...n.finalize,lint:n.finalize.lint.map((r,s)=>({...r,command:i(r.command??"",`lint-${s+1}.sh`)}))}}}o(wpe,"parseFinalizeFromSession");var ALe=$n("finalize-schema",(e,t)=>wpe(t,e));function Bpe(e){return mn(Fx,e).errors}o(Bpe,"validateAnalysisOutput");function R2(e,t=[]){let{value:n,error:i}=$t(e,t);if(i)return{errors:[i]};let r=Bpe(n);return r.length>0?{errors:r}:{analysis:n,errors:[]}}o(R2,"parseAnalysisText");function kpe(e,t=[]){return R2(e.stdout,t)}o(kpe,"parseAnalysisFromSession");var ULe=$n("analysis-schema",(e,t)=>kpe(t,e.secretValues));var rje=sg.rows.notRun(!0);var MA="kept, not ";var LA="(declined the planned ";function Zx(e){if(!e)return[];let t=[],n=0,i=0;for(let r=0;r<e.length;r++){let s=e[r];s==="("?n++:s===")"?n=Math.max(0,n-1):n===0&&s===";"&&e[r+1]===" "&&e[r-1]===")"&&(t.push(e.slice(i,r)),i=r+2)}return t.push(e.slice(i)),t.map(r=>{let s=r.trim();if(!s.endsWith(")"))return{expectation:s};let a=0;for(let c=s.length-1;c>=0;c--)if(s[c]===")")a++;else if(s[c]==="("&&--a===0){let u=s.slice(0,c).trim(),l=s.slice(c+1,-1).trim();return u&&l?{expectation:u,expected:l}:{expectation:s}}return{expectation:s}})}o(Zx,"assertionParts");var x2=new Set(["update","regenerate","delete"]);var ije={update:"updated",regenerate:"regenerated",delete:"deleted",verify:"verified",none:"touched"};var $2=d.string().trim().min(1),Kx=d.object({schemaVersion:d.literal(1).optional(),businessCaseAnalysis:$2.describe("1-2 sentences: what this change means for a user, and whether the evidence shows it working"),issuesFound:d.array(d.object({description:$2,severity:d.string().optional().describe("critical | high | medium | low"),category:d.string().optional().describe("bug | lint | type | config"),sourceFile:d.string().optional(),sourceLine:d.number().optional(),findingId:d.string().optional(),requirementIds:d.array(d.string()).optional()})).describe("every real problem this run exposed \u2014 cause, file:line, severity"),nextSteps:d.array(d.string()).describe("concrete follow-ups the author can act on; required non-empty when a disclosure is BLOCKING")});function xpe(e){return mn(Kx,e).errors}o(xpe,"validateProseOutput");function $pe(e,t=[]){let{value:n,error:i}=$t(e.stdout,t);if(i)return{errors:[i]};let r=xpe(n);return r.length>0?{errors:r}:{prose:n,errors:[]}}o($pe,"parseProseFromSession");var yje=$n("report-schema",(e,t)=>$pe(t,e.secretValues));var T2="<!-- skyramp-testbot -->",D2=x2,Tpe=new Set(["lint","type","config"]),_2={critical:0,high:1,medium:2,low:3},L2=new Set(["Pass","Fail"]);var t$=o(e=>Io(ae().statusLabels,e),"statusLabel"),Xx=o(e=>Io(ae().testTypeCellLabels,e),"testTypeLabel");function Ge(e){return(e??"").replace(/\|/g,"\\|").replace(/\r?\n/g,"<br>").trim()}o(Ge,"escCell");function N2(e){return e.inferred?" (inferred)":""}o(N2,"inferredMark");function U2(e,t){return!e||!L2.has(e)?"\u2014":t?`${t$(e)} (${Ge(O2(t))})`:t$(e)}o(U2,"maintStatus");function O2(e){let t=o(i=>{let r=i.indexOf(": ");return r<0?i:Io(ae().staged.maintenanceActions,i.slice(0,r))+i.slice(r)},"action");if(e.startsWith(MA))return ae().staged.keptNot+t(e.slice(MA.length));let n=e.indexOf(LA);return n<0?e:e.slice(0,n)+ae().staged.declinedPlanned+t(e.slice(n+LA.length))}o(O2,"declineNote");function F2(e){return e.category!==void 0&&Tpe.has(e.category.toLowerCase())}o(F2,"isTooling");function P2(e,t){return(_2[(e.severity??"").toLowerCase()]??4)-(_2[(t.severity??"").toLowerCase()]??4)}o(P2,"bySeverity");function M2(e){return`- ${e.severity?`**[${Io(ae().severityLabels,e.severity.toLowerCase()).toUpperCase()}]** `:""}${e.description.trim()}`}o(M2,"issueLine");function Dpe(e){let t=e.resultId?.split("#").slice(1).join("#");if(e.testType!=="unit"||!t)return;let n=t;try{n=decodeURIComponent(t)}catch{}let i=/^(.*?)(\[.*\])$/.exec(n);return i?{fn:i[1],kase:i[2]}:{fn:n}}o(Dpe,"unitTestOf");var j2=o((e,t)=>e!==void 0&&t!==void 0&&e.replace(/^\.\//,"")===t.replace(/^\.\//,""),"samePath");function G2(e,t){return(e.testVideos??[]).find(n=>n.url&&t(n))?.url}o(G2,"videoLink");function n$(e,t){return G2(e,n=>j2(n.fileName,t.fileName)&&(!n.repository||!t.repository||n.repository.toLowerCase()===t.repository.toLowerCase()))}o(n$,"resultVideoLink");function r$(e,t){return G2(e,n=>j2(n.writtenAs??n.fileName,t))}o(r$,"journeyVideoLink");function _pe(e,t,n){return n?n$(e,{fileName:t,repository:n}):r$(e,t)}o(_pe,"requirementVideoLink");function Npe(e){let t=[],n=new Map;for(let a of e.newTestsCreated)a.testType==="unit"&&n.set(a.fileName,[...n.get(a.fileName)??[],a.testId.split("::").slice(1).join("::")]);let i=new Map,r=o((a,c)=>(n.get(a??"")??[]).find(u=>u!==c&&Gz(c,u)),"parentOf"),s=new Map;for(let a of e.testResults){let c=Dpe(a),u=c&&!c.kase?r(a.fileName,c.fn):void 0;if(c&&u&&(c={fn:u,kase:`"${c.fn}"`}),c?.kase&&i.set(a,c.kase),!c){t.push({testId:a.testId,testType:a.testType,endpoint:a.endpoint,status:a.status,details:a.details??"",...a.fileName?{fileName:a.fileName}:{},...a.repository?{repository:a.repository}:{}});continue}let l=`${a.fileName??""}#${c.fn}`,A=s.get(l);A||(A={row:{testId:a.testId,testType:a.testType,endpoint:a.endpoint,status:a.status,details:"",test:c.fn,...a.fileName?{fileName:a.fileName}:{},...a.repository?{repository:a.repository}:{}},cases:[]},s.set(l,A),t.push(A.row)),A.cases.push(a)}for(let{row:a,cases:c}of s.values()){let u=c.filter(g=>g.status==="Fail"),l=c.filter(g=>g.status==="Pass").length,A=c.filter(g=>g.status==="Skipped").length;a.cases=c.length,a.status=u.length?"Fail":A?"Skipped":"Pass";let p=u[0];a.details=c.length===1?c[0].details??"":ae().staged.casesPassed(l,c.length,A)+(p?`; ${i.get(p)??""} ${p.details??""}`.replace(/; +/,"; ").trimEnd():"")}return t}o(Npe,"resultRows");function Upe(e){return Zx(e).map(t=>t.expected===void 0?t.expectation:`${t.expectation}: ${Jt(t.expected)}`)}o(Upe,"unitAssertions");function e$(e){return e.newTestsCreated.some(t=>t.testType!=="unit")&&e.testResults.every(t=>t.status==="Skipped")&&e.testResults.some(t=>t.failureCause?.kind==="environment"&&(t.failureCause.family==="app_not_started"||t.failureCause.family==="secret"))}o(e$,"nothingExecuted");function V2(e,t={}){let{audience:n,collapsed:i=!1,existingEvidence:r=[],requestedBy:s,sourcePullRequest:a}=t,c=n!=="testbot-pr",u=n!=="comment",l=n!=="testbot-pr",A=(e.requirements??[]).filter(P=>/^file-[a-f0-9]{16}-/i.test(P.id)).sort((P,ee)=>ee.id.length-P.id.length),p=o(P=>{let ee=A.find(Y=>P.toLowerCase().startsWith(Y.id.toLowerCase()));return ee?ee.label+P.slice(ee.id.length):P},"displayId"),g=[T2];if(a&&g.push(ae().staged.testsSourcePullRequest(Jt(a)),""),s){let P=s.name.replace(/\s+/g," ").trim().replace(/[<>[\]()*_`\\|#]/g,"\\$&").replace(/@/g,"@\u200D");g.push(s.kind==="person"?ae().staged.requestedByPerson(P):ae().staged.requestedByPolicy(P),"")}e.notTranslated&&g.push(Io(ae().staged.notTranslated,e.notTranslated),"");let h=o(P=>{i?g.push("<details>",`<summary>${P}</summary>`,""):g.push(`### ${P}`)},"sectionStart"),y=o(()=>{i&&g.push("","</details>"),g.push("")},"sectionEnd");if(c){for(let P of e.businessCaseAnalysis.trim().split(/\r?\n/))g.push(`> ${P}`);g.push("")}if(e$(e)&&g.push(ae().staged.noLiveApp(e.newTestsCreated.length),""),u&&e.newTestsCreated.length){let P=new Map;for(let se of e.newTestsCreated){if(se.testType!=="unit")continue;let ye=(se.testId.split("::").slice(1).join("::")||se.testId).replace(/\[.*\]$/,""),G=P.get(se.fileName)??{functions:new Set,endpoints:[],descriptions:new Map};se.endpoint&&!G.endpoints.includes(se.endpoint)&&G.endpoints.push(se.endpoint);let M=se.description?.trim()??"",st=G.descriptions.get(ye)??[];st.includes(M)||st.push(M),G.functions.add(ye),G.descriptions.set(ye,st),P.set(se.fileName,G)}let ee=e.newTestsCreated.filter(se=>se.testType!=="unit"),Y=ee.length+[...P.values()].reduce((se,ye)=>se+ye.functions.size,0);h(ae().testRecommendationsImplementedHeader(Y));for(let[se,{functions:ye,endpoints:G,descriptions:M}]of P){let st=ye.size;g.push(ae().staged.unitTestsInFile(`\`${se}\``,st,G.map(ot=>`\`${ot}\``).join(", ")),"");let ze=new Map;for(let[ot,Yt]of M){let Dt=Yt.join("\0"),tt=ze.get(Dt)??{fns:[],descriptions:Yt};tt.fns.push(ot),ze.set(Dt,tt)}let Mn=0;for(let{fns:ot,descriptions:Yt}of ze.values()){g.push(`${++Mn}. ${ot.map(tt=>`\`${tt}\``).join(", ")}`);let Dt=[...new Set(Yt.flatMap(tt=>Upe(tt)))];for(let tt of Dt)g.push(` - ${tt}`)}g.push("")}for(let se of ee){let ye=se.testId?Jt(p(se.testId)):Xx(se.testType),G=se.fileName?` (\`${se.fileName}\`)`:"",M=se.endpoint?`
|
|
160
160
|
\`${se.endpoint}\``:"",st=se.description?`
|
|
161
161
|
${se.description.trim()}`:"";g.push(`- ${ye}${G}${M}${st}`)}y()}let E=(e.testMaintenance??[]).filter(P=>D2.has(P.action));if(u&&E.length){h(ae().staged.testMaintenanceHeader),g.push(ae().maintenanceTableHeader),g.push("|-----------|----------|------|--------|--------|-------|");for(let P of E)g.push(`| ${Ge(Xx(P.testType))} | ${Ge(P.endpoint)} | \`${Ge(P.fileName)}\` | ${Ge(P.description)} | ${U2(P.beforeStatus,P.beforeDetails)} | ${U2(P.afterStatus,P.afterDetails)} |`);y()}let C=o(P=>P.startsWith(MA)||P.includes(LA),"hasDeclineNote"),I=(e.testMaintenance??[]).filter(P=>C(P.afterDetails)&&(!D2.has(P.action)||!L2.has(P.afterStatus??"")));if(u&&I.length){h(ae().staged.declinedMaintenanceHeader);for(let P of I)g.push(`- \`${Ge(P.fileName)}\`: ${Ge(O2(P.afterDetails))}`);y()}if(u&&r.length){h(ae().staged.existingEvidenceHeader);let P=new Map;for(let ee of r){let Y=`${ee.check}\0${ee.url??""}\0${ee.revision??""}`;P.set(Y,[...P.get(Y)??[],ee])}for(let[,[ee,...Y]]of P){let se=ee.url?`[${Jt(ee.check)}](${ee.url})`:Jt(ee.check);g.push(ae().staged.trustedCheckPassed(se,ee.revision?Jt(ee.revision.slice(0,7)):""),"");for(let ye of[ee,...Y])g.push(`- ${Jt(ye.behavior)}`);g.push("")}y()}if(u&&e.testResults.length){h(ae().staged.testResultsHeader);let P=Npe(e),ee=P.some(G=>G.test),Y=P.some(G=>n$(e,G)),se=ee?ae().staged.unitResultsTableHeader:ae().staged.resultsTableHeader;g.push(Y?`${se} ${ae().columnVideo} |`:se),g.push(`${ee?"|---------|-----------|----------|------|-------|--------|---------|":"|---------|-----------|----------|--------|---------|"}${Y?"-------|":""}`);for(let G of P){let M=G.details.replace(/(\S+\.(?:py|ts|js|spec\.\w+))/gi,"`$1`"),st=G.testId?Jt(Ge(p(G.testId))):"\u2014",ze=ee?` ${G.test?`\`${Ge(G.test)}\``:""} | ${G.cases??""} |`:"",Mn=n$(e,G),ot=Y?` ${Mn?ae().videoDownloadLink(Mn):"\u2014"} |`:"";g.push(`| ${st} | ${Ge(Xx(G.testType))} | ${Ge(G.endpoint)} |${ze} ${Ge(t$(G.status))} | ${Ge(M)} |${ot}`)}let ye=(e.testVideos??[]).find(G=>G.artifactsUrl)?.artifactsUrl;!Y&&ye&&g.push("",ae().videosArtifactFallback(ye)),y()}if(e.requirements?.length){let P=e.requirements.flatMap(G=>G.clauses),ee=o(G=>G.status==="Pass"||G.status==="Passed, test not kept","passes"),Y=P.filter(ee).length;h(ae().staged.requirementsHeader(Y,P.length));let se=o(G=>Io(ae().staged.clauseStatuses,G.status),"status"),ye=o(G=>(G.status==="Not tested"||G.status==="Passed, test not kept")&&G.notTested?`${se(G)}: ${G.notTested}`:G.findings.length?`${se(G)} \u2014 ${G.findings.join(", ")}`:se(G),"result");if(u){g.push(ae().staged.requirementsTableHeader),g.push("|-------------|--------|-------|--------|");for(let G of e.requirements)G.clauses.forEach((M,st)=>{let ze=st===0?`**${Ge(G.label)}**${G.statement?` ${Ge(G.statement)}`:""}`:"",Mn=`${Jt(Ge(p(M.id)))}${N2(M)}${M.text?` ${Ge(M.text)}`:""}`,ot=new Map;for(let tt of M.tests){let In=tt.fileName??p(tt.testId),lt=ot.get(In)??{fns:new Set};for(let Cn of tt.functions)lt.fns.add(Cn);lt.video??=tt.fileName?_pe(e,tt.fileName,tt.repository):void 0,ot.set(In,lt)}let Yt=ot.size?[...ot].map(([tt,{fns:In,video:lt}])=>`${Jt(Ge(tt))}${In.size?` \u2014 ${[...In].map(Cn=>`\`${Ge(Cn)}\``).join(", ")}`:""}${lt?` ${ae().videoDownloadLink(lt)}`:""}`).join("<br>"):"\u2014",Dt=G.source==="could-break"&&M.status==="Pass"?ae().staged.regressionGuard:"";g.push(`| ${ze} | ${Mn} | ${Yt} | ${Ge(ye(M)+Dt)} |`)})}else{g.push(ae().staged.requirementsSummaryTableHeader),g.push("|-------------|-----------------|-------------|");for(let G of e.requirements){let M=G.clauses.filter(ee).length,st=G.clauses.filter(ze=>!ee(ze)).map(ze=>`${Jt(Ge(p(ze.id)))}${N2(ze)} ${Ge(ye(ze))}`);g.push(`| **${Ge(G.label)}**${G.statement?` ${Ge(G.statement)}`:""} | ${M}/${G.clauses.length} | ${st.join("<br>")||"\u2014"} |`)}}y()}if(u&&e.changes?.length&&!e.requirements?.length){let P=e.executionCoverage,ee=P?ae().staged.coverageCaption(P.generated,P.modified,P.verified,P.executed):"";h(`${ae().staged.behaviourCoverageHeader}${ee}`),g.push(ae().staged.coverageTableHeader),g.push("|-----------|--------|-----------|----------------|");for(let Y of e.changes){let se=Y.testedBy.length?Y.testedBy.map(G=>`\`${Ge(G)}\``).join(", "):Y.writtenBy.length?ae().staged.writtenNotRun:"\u2014",ye=Y.maintainedBy.length?Y.maintainedBy.map(G=>`\`${Ge(G)}\``).join(", "):"\u2014";g.push(`| ${Ge(Y.text)} | \`${Ge(Y.source)}\` | ${se} | ${ye} |`)}y()}if(e.userJourneys?.length){let P=e.userJourneys.filter(Y=>Y.status==="Pass"&&!Y.problems.length).length;h(`\u{1F9ED} User Journeys Covered (${P}/${e.userJourneys.length} walked end to end)`);let ee=e.userJourneys.some(Y=>r$(e,Y.fileName));g.push(`| Journey | Test | Status | Notes |${ee?` ${ae().columnVideo} |`:""}`),g.push(`|---------|------|--------|-------|${ee?"-------|":""}`);for(let Y of e.userJourneys){let se=Y.fileName?`\`${Ge(Y.fileName)}\`${Y.test?` \u2014 ${Ge(Y.test)}`:""}`:"\u2014",ye=Y.source&&Y.source!=="inferred"?`; described in the ${Y.source==="spec"?"spec":"PR description"}`:"; inferred from the app",G=(Y.uncovered?`not covered: ${Y.uncovered}`:Y.problems.length?`does not walk it end to end: ${Y.problems.join("; ")}`:`from ${Y.entry}, ${Y.steps} steps`)+ye,M=ee?r$(e,Y.fileName):void 0;g.push(`| ${Ge(Y.name)} | ${se} | ${Ge(Y.status)} | ${Ge(G)} |${ee?` ${M?ae().videoDownloadLink(M):"\u2014"} |`:""}`)}y()}if(l){let P=e.issuesFound.filter(Y=>!F2(Y)).sort(P2),ee=e.issuesFound.filter(F2).sort(P2);if(P.length){h(ae().staged.issuesFoundHeader);for(let Y of P)g.push(M2(Y));y()}if(ee.length){g.push(`### ${ae().configErrorsHeader}`);for(let Y of ee)g.push(M2(Y));g.push("")}}let v=e.testPackages??[],D=e.dependencyChanges??[];if(v.length){g.push(ae().staged.testPackagesHeader,"");for(let P of v)g.push(`- ${ae().staged.testPackageLine(P.directory,P.entrypoint,Object.entries(P.dependencies??{}).map(([ee,Y])=>P.runner==="pytest"?`${ee}==${Y}`:`${ee}@${Y}`).join(", "))}`);D.length||g.push(`- ${ae().staged.appManifestsUntouched}`),g.push("")}if(D.length){g.push(ae().staged.dependencyChangesHeader,"");for(let P of D)g.push(`- ${ae().staged.dependencyChangeLine(P.package,P.repository?`${P.repository}: ${P.manifest}`:P.manifest,(P.reason??"").replace(/\s+/g," ").trim())}`);g.push("")}let N=(e.caveats??[]).filter(P=>P.kind!=="tests-not-executed"||P.subject==="written-cases"||!e$(e));if(N.length){g.push(ae().staged.caveatsHeader,"");for(let P of N)g.push(`- ${P.text}`);g.push("")}if(l&&e.nextSteps.length){g.push(ae().nextStepsHeader,"");for(let P of e.nextSteps)g.push(`- ${P.trim()}`);g.push("")}let W=g.join(`
|