@skyramp/testbot-core 0.13.0-v3.365 → 0.13.0-v3.366
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 +162 -162
- package/dist/post.js +2 -2
- package/dist/runner-client.cjs +2 -2
- package/package.json +1 -1
package/dist/runner-client.cjs
CHANGED
|
@@ -53,7 +53,7 @@ ${u}`,this.dataLineCount++;return}if(Hf(t,r,$5)){N5(t,s)&&(this.setEventFieldSiz
|
|
|
53
53
|
`),`
|
|
54
54
|
`,t)}o(vM,"boundedFailureText");function Co(e){return Gl(nee(e),[]).trim()}o(Co,"commandFailureText");var ree=/^(.*?:\s*)?Command failed: (?:git|gh)\b.*$/;function Vl(e,t=sg){let[n="",...i]=e.split(`
|
|
55
55
|
`).map(a=>a.trim()).filter(Boolean),r=i.length?ree.exec(n):null,s=r?[`${r[1]??""}${i[0]}`,...i.slice(1)]:[n,...i];return CM(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 iee(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(iee,"hookSummary");function bM(e){if(!/\bhook\b|husky|pre-commit|lint-staged/i.test(e))return;let t=iee(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"],see=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"]),pv=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"&&pv.has(r)||(i[r]=s);Object.assign(i,t??{});for(let r of Object.keys(i))(see.has(r)||r.startsWith("INPUT_"))&&delete i[r];return i}o(Xt,"untrustedChildEnv");var d={};Cr(d,{BRAND:()=>$ee,DIRTY:()=>vo,EMPTY_PATH:()=>uee,INVALID:()=>me,NEVER:()=>gte,OK:()=>en,ParseStatus:()=>Mt,Schema:()=>De,ZodAny:()=>ys,ZodArray:()=>Di,ZodBigInt:()=>wo,ZodBoolean:()=>Bo,ZodBranded:()=>Jl,ZodCatch:()=>Uo,ZodDate:()=>ko,ZodDefault:()=>No,ZodDiscriminatedUnion:()=>cg,ZodEffects:()=>dr,ZodEnum:()=>Do,ZodError:()=>Qn,ZodFirstPartyTypeKind:()=>ve,ZodFunction:()=>lg,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:()=>ur,ZodParsedType:()=>te,ZodPipeline:()=>Hl,ZodPromise:()=>Es,ZodReadonly:()=>Fo,ZodRecord:()=>ug,ZodSchema:()=>De,ZodSet:()=>Ic,ZodString:()=>ms,ZodSymbol:()=>mc,ZodTransformer:()=>dr,ZodTuple:()=>Xr,ZodType:()=>De,ZodUndefined:()=>So,ZodUnion:()=>Ro,ZodUnknown:()=>Ti,ZodVoid:()=>yc,addIssueToContext:()=>Z,any:()=>Lee,array:()=>Vee,bigint:()=>Nee,boolean:()=>_M,coerce:()=>fte,custom:()=>$M,date:()=>Uee,datetimeRegex:()=>RM,defaultErrorMap:()=>xi,discriminatedUnion:()=>Hee,effect:()=>ote,enum:()=>rte,function:()=>ete,getErrorMap:()=>fc,getParsedType:()=>Kr,instanceof:()=>Dee,intersection:()=>Yee,isAborted:()=>og,isAsync:()=>gc,isDirty:()=>ag,isValid:()=>hs,late:()=>Tee,lazy:()=>tte,literal:()=>nte,makeIssue:()=>ql,map:()=>Kee,nan:()=>_ee,nativeEnum:()=>ite,never:()=>jee,null:()=>Mee,nullable:()=>cte,number:()=>DM,object:()=>zee,objectUtil:()=>fv,oboolean:()=>pte,onumber:()=>Ate,optional:()=>ate,ostring:()=>dte,pipeline:()=>lte,preprocess:()=>ute,promise:()=>ste,quotelessJson:()=>oee,record:()=>Zee,set:()=>Xee,setErrorMap:()=>cee,strictObject:()=>qee,string:()=>TM,symbol:()=>Fee,transformer:()=>ote,tuple:()=>Wee,undefined:()=>Pee,union:()=>Jee,unknown:()=>Oee,util:()=>Me,void:()=>Gee});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 fv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(fv||(fv={}));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"]),oee=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 aee=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=aee;var wM=xi;function cee(e){wM=e}o(cee,"setErrorMap");function fc(){return wM}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"),uee=[];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"),og=o(e=>e.status==="aborted","isAborted"),ag=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 lr=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}},BM=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 BM(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 BM(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 dr({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 ur.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 dr({...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}},lee=/^c[^\s-]{8,}$/i,dee=/^[0-9a-z]+$/,Aee=/^[0-9A-HJKMNP-TV-Z]{26}$/i,pee=/^[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,fee=/^[a-z0-9_-]{21}$/i,gee=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hee=/^[-+]?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)?)??$/,mee=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yee="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",gv,Eee=/^(?:(?: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])$/,Iee=/^(?:(?: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])$/,Cee=/^(([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]))$/,vee=/^(([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])$/,bee=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wee=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,SM="((\\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])))",Bee=new RegExp(`^${SM}$`);function QM(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(QM,"timeRegexSource");function kee(e){return new RegExp(`^${QM(e)}$`)}o(kee,"timeRegex");function RM(e){let t=`${SM}T${QM(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(RM,"datetimeRegex");function See(e,t){return!!((t==="v4"||!t)&&Eee.test(e)||(t==="v6"||!t)&&Cee.test(e))}o(See,"isValidIP");function Qee(e,t){if(!gee.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(Qee,"isValidJWT");function Ree(e,t){return!!((t==="v4"||!t)&&Iee.test(e)||(t==="v6"||!t)&&vee.test(e))}o(Ree,"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")mee.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")gv||(gv=new RegExp(yee,"u")),gv.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")pee.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")fee.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")lee.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")dee.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")Aee.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"?RM(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"?Bee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?kee(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"?hee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"duration",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?See(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"?Qee(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"?Ree(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"?bee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"base64",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?wee.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 xee(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(xee,"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"?xee(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 lr(n,a,n.path,c)))).then(a=>Mt.mergeArray(i,a));let s=[...n.data].map((a,c)=>r.type._parseSync(new lr(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]=ur.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 ur?ur.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 lr(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 lr(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 ur;)s=s._def.innerType;n[i]=s}return new e({...this._def,shape:o(()=>n,"shape")})}keyof(){return xM(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 dr?$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 ur?[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"),cg=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 hv(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=hv(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=hv(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(hv,"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(og(s)||og(a))return me;let c=hv(s.value,a.value);return c.valid?((ag(s)||ag(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 lr(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 ug=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 lr(i,c,i.path,c)),value:a._parse(new lr(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 lr(i,c,i.path,[l,"key"])),value:s._parse(new lr(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 lr(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 lg=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 xM(e,t){return new Do({values:e,typeName:ve.ZodEnum,...Re(t)})}o(xM,"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=xM;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 dr=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)}};dr.create=(e,t,n)=>new dr({schema:e,typeName:ve.ZodEffects,effect:t,...Re(n)});dr.createWithPreprocess=(e,t,n)=>new dr({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...Re(n)});var ur=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}};ur.create=(e,t)=>new ur({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 kM(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}o(kM,"cleanParams");function $M(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=kM(t,i),u=c.fatal??n??!0;r.addIssue({code:"custom",...c,fatal:u})}});if(!s){let a=kM(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}}):ys.create()}o($M,"custom");var Tee={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 Dee=o((e,t={message:`Input not instance of ${e.name}`})=>$M(n=>n instanceof e,t),"instanceOfType"),TM=ms.create,DM=bo.create,_ee=Cc.create,Nee=wo.create,_M=Bo.create,Uee=ko.create,Fee=mc.create,Pee=So.create,Mee=Qo.create,Lee=ys.create,Oee=Ti.create,jee=$r.create,Gee=yc.create,Vee=Di.create,zee=Rn.create,qee=Rn.strictCreate,Jee=Ro.create,Hee=cg.create,Yee=xo.create,Wee=Xr.create,Zee=ug.create,Kee=Ec.create,Xee=Ic.create,ete=lg.create,tte=$o.create,nte=To.create,rte=Do.create,ite=_o.create,ste=Es.create,ote=dr.create,ate=ur.create,cte=ei.create,ute=dr.createWithPreprocess,lte=Hl.create,dte=o(()=>TM().optional(),"ostring"),Ate=o(()=>DM().optional(),"onumber"),pte=o(()=>_M().optional(),"oboolean"),fte={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 gte=me;var ti=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(ti||{}),Tr=d.string().trim().min(1),hte=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")}),mv=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"),mte=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")}),NM=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:hte.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(ti).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:mv.optional(),credentialsRefused:d.array(mte).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 oL=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||{}),Ar=d.string().trim().min(1),Yl=d.array(d.string().url().max(2048).regex(/^https?:\/\//i)).max(50),UM=d.object({case:Ar.describe("a covers id \u2014 the recommend case this test realizes"),status:d.nativeEnum(pr),runtimeTargets:Yl.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()}),FM=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(UM).optional().describe("ONE ENTRY PER CASE the file covers; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one)")}),PM=d.object({from:d.string().optional().describe("staged path \u2014 required for placements"),file:Ar.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:Ar.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:Ar.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:Ar.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:FM,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:[]}),MM=(n=>(n.Junit="junit",n.Converter="converter",n))(MM||{}),yte=Ar.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),Ete=d.object({results:Ar.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:d.nativeEnum(MM),run:Ar.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:d.array(Ar).min(1).describe("the items[].file paths this run covered"),cases:d.array(d.object({test:Ar.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:Ar.describe("the covers id it realizes"),file:yte})).describe("map each reported test name to the case it covers")}),Ite=d.object({suites:d.array(Ete).min(1)}),yv=d.object({schemaVersion:d.literal(1),items:d.array(PM),runnerResults:Ite.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:Ar.describe("one paragraph")});Ac();lv();function LM(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}o(LM,"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 Ev=o(e=>`${e.source}:${e.site??""}:${e.key}`,"requirementItemId");var Wl=/^pasted-[0-9a-f]{16}$/,Cs=/^file-[0-9a-f]{16}$/,Zl=(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))(Zl||{}),Kl=o(e=>e.trim().toUpperCase(),"normalKey"),OM=o((e,t)=>{let n=e.trim();return Wl.test(n.toLowerCase())?"Pasted text":Cs.test(n.toLowerCase())?t?.get(Kl(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()},"itemName");var dg=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(dg||{}),_i=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(_i||{}),vc=(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))(vc||{}),vs=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(vs||{}),Xl=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(Xl||{}),ed=(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))(ed||{});var Ag=(n=>(n.Probe="probe",n.Agent="agent",n))(Ag||{}),pg=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(pg||{}),fg=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(fg||{});var Iv=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(Iv||{}),Cv=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(Cv||{});var gg=300,yt=d.string().trim().min(1),Cte=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"}),vte=/^[A-Za-z_][A-Za-z0-9_]*$/,ni=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,bc=(a=>(a.VersionEndpoint="version_endpoint",a.DeployWorkflow="deploy_workflow",a.KubernetesLabels="kubernetes_labels",a.Command="command",a.Api="api",a.NotTracked="not_tracked",a))(bc||{}),ri="shared",bte=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"),wc=d.object({address:bte,readyWhen:yt.nullable(),credentials:d.array(d.string().regex(ni)).max(50),revisionSources:d.array(d.object({method:d.nativeEnum(bc),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(),vv={steps:d.array(Cte).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(vte)).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")},bv=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(),...vv,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')}),wte=d.object({name:d.string().regex(ni).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(gg).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')}),Bte=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")}),kte=d.object({framework:yt,file:yt.describe("the test file run, relative to its repository root"),result:d.enum(["pass","fail","error"])}),Ste=d.object({input:yt.describe("the part of the user's SUT input, as given"),reason:yt}),iCe=d.object({schemaVersion:d.literal(1),status:d.nativeEnum(Cv).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(bv),suites:d.array(kte).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(Ste).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(Bte).describe("required (non-empty) when status is blocked"),inputs:d.array(wte).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:wc.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 wv=64*1024,Bv=512*1024,jM=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var GM=Se(require("path"));var Lt=d.string().trim().min(1),hg=Lt,kv=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(kv||{}),Sv=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],VM=d.object({schemaVersion:d.literal(1),type:d.nativeEnum(kv).optional(),repository:hg.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:wc.optional(),components:d.array(d.object({name:Lt,repository:Lt.describe(`owner/repo, or "${ri}" for a customer-deployed component no repository builds`),healthy:d.boolean(),url:d.string().min(1).nullable(),...vv,credentials:d.array(d.string().regex(ni)).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===ri&&!n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"repository"],message:`only a customer_deployed component is ${ri}`})}),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)=>{Sv.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!==ri&&!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 dCe=["clean","recipe-drift"];function td(e){let t=GM.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}o(td,"isRuntimePlanFile");var Lo=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(Lo||{}),vg=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(vg||{}),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||{}),Qte=["sut_setup"],Rte=["sut_setup","schedule","revision_read"],xte=["sut_setup"],xv=(t=>(t.PullRequest="pull_request",t))(xv||{}),$v=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))($v||{}),zM=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var wg=(r=>(r.None="none",r.Delivered="delivered",r.Partial="partial",r.Failed="failed",r))(wg||{}),id=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(id||{}),aL=(n=>(n.Running="running",n.Ended="ended",n))(aL||{}),sd=(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))(sd||{}),cL=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(cL||{}),Tv=(n=>(n.Started="started",n.Finished="finished",n))(Tv||{}),uL=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(uL||{});var lL=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(lL||{});var dL=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(dL||{}),Dv=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(Dv||{}),Qv=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(Qv||{});var _v=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(_v||{}),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}$/),Ig=d.object({id:tn,revision:fr}).strict(),Bg={provider:d.literal("github"),providerAccountId:fr,providerRepositoryId:fr},kg={provider:d.literal("azure-devops"),providerAccountId:tn,providerRepositoryId:tn},_r=d.discriminatedUnion("provider",[d.object(Bg).strict(),d.object(kg).strict()]),Nv=d.discriminatedUnion("provider",[d.object(Bg).passthrough(),d.object(kg).passthrough()]),si=o(e=>`${e.provider}:${e.providerRepositoryId}`,"sourceKey"),qM={namespace:d.string().min(1),name:d.string().min(1)},AL=d.discriminatedUnion("provider",[d.object({...Bg,...qM}).strict(),d.object({...kg,...qM}).strict()]),JM=d.object({ref:d.string().min(1),revision:Dr}).strict(),$te=d.object({kind:d.nativeEnum($v),number:fr.optional(),ref:d.string().min(1),revision:Dr,reason:d.nativeEnum(vg)}).strict(),Tte=d.object({repository:AL,revision:Dr,ref:d.string().nullable(),reason:d.nativeEnum(vg),change:d.object({kind:d.nativeEnum(xv),number:fr,base:JM.optional()}).strict().nullable(),compareWith:JM.optional(),merge:d.array($te).min(2).optional()}).strict();function Dte(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(!zM.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=zM.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(Dte,"mergedSourceIssue");function _te(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(_te,"baselineSourcesIssue");var pL=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,fL=/^[1-9][0-9]{0,18}$/,HM=new RegExp(`${pL.source}|${fL.source}`),YM=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,Nte=d.union([d.object({source:d.literal("jira"),site:d.string().regex(YM),key:d.string().regex(pL),updated:d.string().datetime(),contentHash:dn}).strict(),d.object({source:d.literal("confluence"),site:d.string().regex(YM),key:d.string().regex(fL),version:d.number().int().positive(),contentHash:dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Wl),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(Zl)}).strict()]),WM=d.union([d.literal("jira"),d.literal("confluence")]),Ute=d.object({schemaVersion:d.literal(1),items:d.array(d.union([d.object({source:WM,site:d.string(),key:d.string().regex(HM),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:WM,site:d.string(),key:d.string().regex(HM),state:d.literal("not_read"),reason:d.nativeEnum(Po)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Wl),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(Wl),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(Zl)}).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(),Fte=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(),Pte=d.object({schemaVersion:d.literal(1),runId:tn,skyrampOrgId:tn,target:Ig,policy:Ig.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(Fte).optional(),sources:d.array(d.object({repository:_r,revision:Dr}).strict()).optional()}).strict().optional(),sources:d.array(Tte).min(1).max(1e3),execution:d.object({provider:d.nativeEnum(Lo),repository:AL,workflowPath:d.string(),ref:d.string()}).strict(),credentials:d.array(d.object({name:d.string(),purpose:d.nativeEnum(Iv),required:d.boolean()}).strict()),requirements:d.array(Nte).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=Ev({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=Qte.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=_te(e);s&&t.addIssue({code:d.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),Rte.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=Dte(u);A&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,...A.path],message:A.message})})});var Uv=(n=>(n.Person="person",n.Policy="policy",n))(Uv||{}),Mte=d.object({kind:d.nativeEnum(Uv),name:d.string().min(1).max(256)}).strict(),Lte=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(),Ote=d.object({schemaVersion:d.literal(1),attempt:d.object({id:tn,number:d.number().int().positive(),deadlineAt:d.string().datetime()}).strict(),manifest:Pte,manifestHash:dn,entitlements:d.array(d.string()).optional(),runToken:d.string().min(1).optional(),requestedBy:Mte.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:Lte.optional()}).strict(),ZM={providerRunAttempt:d.number().int().positive(),workflowRef:d.string().min(1)},jte=d.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),Gte=d.object({schemaVersion:d.literal(1),runId:tn,execution:d.discriminatedUnion("provider",[d.object({...ZM,provider:d.literal("github"),repository:d.object(Bg).strict(),providerRunId:fr}).strict(),d.object({...ZM,provider:d.literal("azure-devops"),repository:d.object(kg).strict(),providerRunId:jte}).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(),KM=d.object({repository:_r,number:fr,commitSha:Dr.optional()}).strict(),mg=d.array(d.object({repository:_r,reason:d.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),Vte=d.discriminatedUnion("status",[d.object({status:d.literal("none"),noTests:mg}).strict(),d.object({status:d.literal("delivered"),noTests:mg,pullRequests:d.array(KM).min(1)}).strict(),d.object({status:d.literal("partial"),noTests:mg,pullRequests:d.array(KM).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:mg}).strict()]),Sg=1024*1024,gL=16*1024*1024,yg=o(e=>d.array(d.object({[e]:d.string()}).strict()).optional(),"texts"),zte=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:yg("description"),newTestsCreated:yg("description"),testResults:yg("details"),caveats:yg("text")}).strict(),qte=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(vc))}).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"})}),Eg=500,hL=2048,mL=1e3,Jte=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,XM=o(e=>e.length>0&&e.length<=64&&e===e.trim()&&!Jte.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),"isAzureName"),yL=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)&&XM(n)&&XM(i)},"isResultRepository"),Hte=d.object({testResults:d.array(d.object({resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:d.string().refine(yL,"Invalid"),testType:d.string(),runtimeTargets:Yl.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(Xl),family:d.nativeEnum(ed).optional()}).strict().optional(),origin:d.nativeEnum(dg).optional()}).strict()),validation:qte,changes:d.array(d.object({id:d.string().min(1).max(512),text:d.string().max(16384),source:d.string().max(hL),testedBy:d.array(d.string().min(1).max(1024)).max(Eg),writtenBy:d.array(d.string().min(1).max(1024)).max(Eg),maintainedBy:d.array(d.string().min(1).max(1024)).max(Eg)}).strict()).max(mL).optional(),traceVersion:d.literal(1),display:zte.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)})}),eL=o(e=>e.replace(/[%:#]/g,t=>encodeURIComponent(t)),"encodeIdPart");function Fv(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}:${eL(a)}`;return i?`${c}#${eL(i)}`:c}o(Fv,"testResultId");var Qg=(i=>(i.BranchPushed="branch_pushed",i.PullRequestOpened="pull_request_opened",i.PullRequestEdited="pull_request_edited",i))(Qg||{}),EL=50,tL=d.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),IL=d.discriminatedUnion("kind",[d.object({kind:d.literal("branch_pushed"),repository:_r,branch:tL,commit:Dr}).strict(),d.object({kind:d.enum(["pull_request_opened","pull_request_edited"]),repository:_r,number:fr,branch:tL}).strict()]),CL=d.object({schemaVersion:d.literal(1),run:d.object({runId:tn,attemptNumber:d.number().int().positive(),manifestHash:dn}).strict(),target:Ig,policy:Ig,provenance:d.object({sources:d.array(d.object({repository:_r,revision:Dr}).strict()),firstQualification:d.literal(!0).optional()}).strict(),delivery:d.object({generatedTests:Vte}).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:Hte,githubWrites:d.array(IL).max(EL).optional()}).strict(),Pv=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(Pv||{}),Mv=200,Yte=d.object({cause:d.nativeEnum(Pv),credential:d.string().regex(ni).optional(),reason:d.string().trim().min(1).max(Mv).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"}),Wte=d.object({name:d.string().regex(ni),purpose:d.enum(["sut_access","other"]),required:d.boolean(),how:d.string().trim().min(1).max(gg)}).strict(),CCe=CL.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:VM,check:Yte.optional(),inputs:d.array(Wte).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)=>{td(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),jM.test(s.content)&&n(["files",a,"content"],"is not text");let c=Buffer.byteLength(s.content,"utf8");r+=c,c>wv&&n(["files",a,"content"],`larger than ${wv} bytes`)}),r>Bv&&n(["files"],`recipe text over ${Bv} bytes in total`)}),vCe=d.object({components:d.array(d.object({name:d.string().min(1),repository:d.string().refine(yL,"Invalid"),observedRevision:d.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:d.nativeEnum(Ag),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 vL(e){return e.trigger.kind==="schedule"||e.trigger.kind==="manual"&&e.sources.every(t=>t.reason==="BASELINE")}o(vL,"readsDeployedState");var Zte=d.object({schemaVersion:d.literal(1),stage:d.nativeEnum(cL),event:d.nativeEnum(Tv),status:d.nativeEnum(uL).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),Rg=100,Kte=5e3,Mo=2e3,nL=100,bL=/^[A-Za-z0-9_-]{1,64}$/,Xte=20,ene=200,tne=100,nne=100,rne=200,rL="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",ine=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${rL}/${rL})$`),sne=500,one=50,ane=10,cne=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,wL=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Zn=o(e=>d.string().max(e).refine(t=>t.trim().length>0&&!wL.test(t),"blank, or not text"),"setupText"),ii={sequence:d.number().int().min(1).max(Kte),at:d.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},BL=d.object({...ii,kind:d.literal("reply"),to:d.string().uuid(),outcome:d.nativeEnum(dL),accepted:d.boolean(),text:Zn(Mo),note:d.object({source:d.enum(["target","environment"]),quote:Zn(Mo)}).strict().optional(),kept:Zn(Mo).optional()}).strict();function kL(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(kL,"checkReply");var une=d.discriminatedUnion("kind",[d.object({...ii,kind:d.literal("log"),phase:d.nativeEnum(Dv),text:Zn(Mo)}).strict(),d.object({...ii,kind:d.literal("component"),name:Zn(nL),repository:Zn(rne).refine(e=>ine.test(e)||e===ri,"not owner/name"),file:Zn(sne).nullable(),status:d.nativeEnum(_v),version:Zn(nne).optional()}).strict(),BL,d.object({...ii,kind:d.literal("question"),id:d.string().regex(bL),type:d.nativeEnum(lL),text:Zn(Mo),component:Zn(nL).nullable(),choices:d.array(Zn(ene)).max(Xte),placeholder:Zn(tne).optional()}).strict(),d.object({...ii,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(Rg)}).strict(),d.object({...ii,kind:d.literal("credentials"),names:d.array(d.string().regex(ni)).min(1).max(one),logins:d.array(d.object({key:d.string().regex(cne),usernameVariable:d.string().regex(ni),passwordVariable:d.string().regex(ni)}).strict()).min(1).max(ane).optional()}).strict()]).superRefine((e,t)=>{if(kL(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=>LM(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"}))}),lne=d.object({schemaVersion:d.literal(1),events:d.array(une).max(Rg)}).strict(),dne=d.discriminatedUnion("kind",[d.object({...ii,kind:d.literal("log"),stage:d.nativeEnum(Qv),text:Zn(Mo)}).strict(),BL,d.object({...ii,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(Rg)}).strict(),d.object({...ii,kind:d.literal("stage"),stage:d.nativeEnum(Qv),event:d.nativeEnum(Tv)}).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=>!wL.test(e),"not text")}).strict()]).superRefine(kL),Ane=d.object({schemaVersion:d.literal(1),events:d.array(dne).max(Rg)}).strict(),iL={id:d.string().uuid(),text:d.string(),by:d.string().nullable(),at:d.string(),replied:d.literal(!0).optional()},SL=d.discriminatedUnion("kind",[d.object({...iL,kind:d.literal("instruction"),question:d.null()}),d.object({...iL,kind:d.literal("answer"),question:d.string().regex(bL)})]),QL=d.string().regex(/^[A-Za-z0-9+/]{43}=$/),pne=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()}),fne=d.object({schemaVersion:d.literal(1),leftOut:d.array(d.string()),messages:d.array(SL).optional(),stop:d.object({key:QL}).optional(),notes:pne.optional()}),gne=d.object({schemaVersion:d.literal(1),messages:d.array(SL).optional()});var hne=500*1024*1024,RL=d.object({id:fr,name:d.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:fr,expiresAt:d.string().datetime()}).strict(),mne=d.object({schemaVersion:d.literal(1),artifact:RL,sessionId:tn,contentHash:dn,bytes:d.number().int().min(1).max(hne)}).strict(),yne=d.object({schemaVersion:d.literal(1),checkpoint:d.object({artifact:RL,repository:d.object({namespace:d.string().min(1),name:d.string().min(1)}).strict(),sessionId:tn,contentHash:dn,key:QL}).strict().nullable()}).strict(),Ene=200,Bc=100,xL=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(xL||{}),Ine=d.object({kind:d.nativeEnum(xL),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(_v)}).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(Dv),text:d.string()}).strict()).max(Ene),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(),Cne=d.object({schemaVersion:d.literal(1),context:Ine.nullable()}).strict(),vne=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=wc.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=>td(e)&&!Sv.includes(e),"not a file of a customer_deployed plan"),content:d.string()}).strict()).optional()}).strict(),wne=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(td,"not a recipe file path"),content:d.string()}).strict()).min(1),repository:hg.optional(),recipeRepository:hg.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(aL),ending:d.nativeEnum(id).nullable(),cause:d.nativeEnum(sd).nullable(),deadlineAt:d.string().datetime()}).strict();function TL(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(TL,"attemptClosure");var DL=50,bCe=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(DL)}).strict();function Rv(e){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(e))return`[${e.map(Rv).join(",")}]`;if(e!==null&&typeof e=="object"){let n=e;return`{${Object.keys(n).sort().map(i=>`${JSON.stringify(i)}:${Rv(n[i])}`).join(",")}}`}let t=JSON.stringify(e);if(t===void 0)throw new TypeError("Canonical JSON requires JSON values");return t}o(Rv,"canonicalJson");function _L(e){return(0,oL.createHash)("sha256").update(Rv(e),"utf8").digest("hex")}o(_L,"manifestHash");var nd=o(e=>({provider:e.provider,providerAccountId:e.providerAccountId,providerRepositoryId:e.providerRepositoryId}),"toSourceRef");function Lv(e,t,{statedPins:n=!0}={}){return Gte.parse({schemaVersion:1,runId:e,execution:t.execution(),requester:!0,writeCheck:!0,claudeCodePin:!0,deployedPins:!0,...n?{statedPins:!0}:{},...t.runSettingsFromApp?{runSettings:!0}:{}})}o(Lv,"handshakeRequest");function NL(e){let t=Ote.parse(e);if(_L(t.manifest)!==t.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return t}o(NL,"parseHandshakeResponse");function Bne(e){let t=o(i=>i.map(r=>({repository:nd(r.repository),number:r.number,...r.commitSha===void 0?{}:{commitSha:r.commitSha}})),"pullRequests"),n=e.noTests?{noTests:e.noTests.map(i=>({repository:nd(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:nd(i.repository),message:i.message}))}:{...e,...n}}o(Bne,"toDelivery");function kne(e){return e.issues.map(t=>`${t.path.map((i,r)=>typeof i=="number"?`[${i}]`:r===0?i:`.${i}`).join("")}: ${t.message}`).join("; ")}o(kne,"describeIssues");function UL(e){let{manifest:t}=e;if(xte.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=CL.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e.attemptNumber,manifestHash:_L(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:nd(i.repository),revision:i.revision})),...e.firstQualification?{firstQualification:!0}:{}},delivery:{generatedTests:Bne(e.generatedTests)},producer:e.producer,report:e.report,...e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:nd(i.repository)}))}:{}});if(!n.success)throw new Error(`The report upload is invalid: ${kne(n.error)}`);return Sne(n.data,t,e.checkedOut),n.data}o(UL,"buildReportUpload");function Sne(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(Sne,"assertEvidenceFromSnapshot");function FL(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&&sL(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict}:{schemaVersion:1,reason:"no_report",cause:sL({...e,mergeConflict:void 0})}}o(FL,"attemptEndFor");function sL(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(sL,"noReportCause");var xCe=["clean","recipe-drift"];var bs=Se(require("path"));var _Ce={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var Ov=o(e=>new Map((e??[]).flatMap(t=>t.file?[[Kl(t.key),t.file.name]]:[])),"itemNames"),Rne=10*1024*1024,xne=o(e=>e?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","needsExtraction"),ML=o((e,t)=>bs.join(bs.dirname(e),`${bs.basename(e,bs.extname(e))}${t}`),"besideFile"),$ne=o(e=>ML(e,".extracted.txt"),"extractedTextPath");var Tne=o(e=>ML(e,".quotes.txt"),"confirmedQuotesPath");function LL(e){return xne(e.file)?$ne(e.path):e.file?.mediaType==="application/pdf"?Tne(e.path):e.path}o(LL,"itemTextPath");var Ni=d.string().trim().min(1),Ui=72,Dne=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.")}),jv=d.object({schemaVersion:d.literal(1),lint:d.array(Dne).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(iee,"hookSummary");function bM(e){if(!/\bhook\b|husky|pre-commit|lint-staged/i.test(e))return;let t=iee(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"],see=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"]),pv=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"&&pv.has(r)||(i[r]=s);Object.assign(i,t??{});for(let r of Object.keys(i))(see.has(r)||r.startsWith("INPUT_"))&&delete i[r];return i}o(Xt,"untrustedChildEnv");var d={};Cr(d,{BRAND:()=>$ee,DIRTY:()=>vo,EMPTY_PATH:()=>uee,INVALID:()=>me,NEVER:()=>gte,OK:()=>en,ParseStatus:()=>Mt,Schema:()=>De,ZodAny:()=>ys,ZodArray:()=>Di,ZodBigInt:()=>wo,ZodBoolean:()=>Bo,ZodBranded:()=>Jl,ZodCatch:()=>Uo,ZodDate:()=>ko,ZodDefault:()=>No,ZodDiscriminatedUnion:()=>cg,ZodEffects:()=>dr,ZodEnum:()=>Do,ZodError:()=>Qn,ZodFirstPartyTypeKind:()=>ve,ZodFunction:()=>lg,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:()=>ur,ZodParsedType:()=>te,ZodPipeline:()=>Hl,ZodPromise:()=>Es,ZodReadonly:()=>Fo,ZodRecord:()=>ug,ZodSchema:()=>De,ZodSet:()=>Ic,ZodString:()=>ms,ZodSymbol:()=>mc,ZodTransformer:()=>dr,ZodTuple:()=>Xr,ZodType:()=>De,ZodUndefined:()=>So,ZodUnion:()=>Ro,ZodUnknown:()=>Ti,ZodVoid:()=>yc,addIssueToContext:()=>Z,any:()=>Lee,array:()=>Vee,bigint:()=>Nee,boolean:()=>_M,coerce:()=>fte,custom:()=>$M,date:()=>Uee,datetimeRegex:()=>RM,defaultErrorMap:()=>xi,discriminatedUnion:()=>Hee,effect:()=>ote,enum:()=>rte,function:()=>ete,getErrorMap:()=>fc,getParsedType:()=>Kr,instanceof:()=>Dee,intersection:()=>Yee,isAborted:()=>og,isAsync:()=>gc,isDirty:()=>ag,isValid:()=>hs,late:()=>Tee,lazy:()=>tte,literal:()=>nte,makeIssue:()=>ql,map:()=>Kee,nan:()=>_ee,nativeEnum:()=>ite,never:()=>jee,null:()=>Mee,nullable:()=>cte,number:()=>DM,object:()=>zee,objectUtil:()=>fv,oboolean:()=>pte,onumber:()=>Ate,optional:()=>ate,ostring:()=>dte,pipeline:()=>lte,preprocess:()=>ute,promise:()=>ste,quotelessJson:()=>oee,record:()=>Zee,set:()=>Xee,setErrorMap:()=>cee,strictObject:()=>qee,string:()=>TM,symbol:()=>Fee,transformer:()=>ote,tuple:()=>Wee,undefined:()=>Pee,union:()=>Jee,unknown:()=>Oee,util:()=>Me,void:()=>Gee});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 fv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(fv||(fv={}));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"]),oee=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 aee=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=aee;var wM=xi;function cee(e){wM=e}o(cee,"setErrorMap");function fc(){return wM}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"),uee=[];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"),og=o(e=>e.status==="aborted","isAborted"),ag=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 lr=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}},BM=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 BM(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 BM(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 dr({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 ur.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 dr({...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}},lee=/^c[^\s-]{8,}$/i,dee=/^[0-9a-z]+$/,Aee=/^[0-9A-HJKMNP-TV-Z]{26}$/i,pee=/^[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,fee=/^[a-z0-9_-]{21}$/i,gee=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hee=/^[-+]?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)?)??$/,mee=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yee="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",gv,Eee=/^(?:(?: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])$/,Iee=/^(?:(?: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])$/,Cee=/^(([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]))$/,vee=/^(([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])$/,bee=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wee=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,SM="((\\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])))",Bee=new RegExp(`^${SM}$`);function QM(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(QM,"timeRegexSource");function kee(e){return new RegExp(`^${QM(e)}$`)}o(kee,"timeRegex");function RM(e){let t=`${SM}T${QM(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(RM,"datetimeRegex");function See(e,t){return!!((t==="v4"||!t)&&Eee.test(e)||(t==="v6"||!t)&&Cee.test(e))}o(See,"isValidIP");function Qee(e,t){if(!gee.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(Qee,"isValidJWT");function Ree(e,t){return!!((t==="v4"||!t)&&Iee.test(e)||(t==="v6"||!t)&&vee.test(e))}o(Ree,"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")mee.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")gv||(gv=new RegExp(yee,"u")),gv.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")pee.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")fee.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")lee.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")dee.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")Aee.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"?RM(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"?Bee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{code:j.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?kee(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"?hee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"duration",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?See(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"?Qee(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"?Ree(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"?bee.test(t.data)||(r=this._getOrReturnCtx(t,r),Z(r,{validation:"base64",code:j.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?wee.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 xee(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(xee,"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"?xee(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 lr(n,a,n.path,c)))).then(a=>Mt.mergeArray(i,a));let s=[...n.data].map((a,c)=>r.type._parseSync(new lr(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]=ur.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 ur?ur.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 lr(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 lr(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 ur;)s=s._def.innerType;n[i]=s}return new e({...this._def,shape:o(()=>n,"shape")})}keyof(){return xM(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 dr?$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 ur?[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"),cg=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 hv(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=hv(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=hv(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(hv,"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(og(s)||og(a))return me;let c=hv(s.value,a.value);return c.valid?((ag(s)||ag(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 lr(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 ug=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 lr(i,c,i.path,c)),value:a._parse(new lr(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 lr(i,c,i.path,[l,"key"])),value:s._parse(new lr(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 lr(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 lg=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 xM(e,t){return new Do({values:e,typeName:ve.ZodEnum,...Re(t)})}o(xM,"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=xM;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 dr=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)}};dr.create=(e,t,n)=>new dr({schema:e,typeName:ve.ZodEffects,effect:t,...Re(n)});dr.createWithPreprocess=(e,t,n)=>new dr({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...Re(n)});var ur=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}};ur.create=(e,t)=>new ur({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 kM(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}o(kM,"cleanParams");function $M(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=kM(t,i),u=c.fatal??n??!0;r.addIssue({code:"custom",...c,fatal:u})}});if(!s){let a=kM(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}}):ys.create()}o($M,"custom");var Tee={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 Dee=o((e,t={message:`Input not instance of ${e.name}`})=>$M(n=>n instanceof e,t),"instanceOfType"),TM=ms.create,DM=bo.create,_ee=Cc.create,Nee=wo.create,_M=Bo.create,Uee=ko.create,Fee=mc.create,Pee=So.create,Mee=Qo.create,Lee=ys.create,Oee=Ti.create,jee=$r.create,Gee=yc.create,Vee=Di.create,zee=Rn.create,qee=Rn.strictCreate,Jee=Ro.create,Hee=cg.create,Yee=xo.create,Wee=Xr.create,Zee=ug.create,Kee=Ec.create,Xee=Ic.create,ete=lg.create,tte=$o.create,nte=To.create,rte=Do.create,ite=_o.create,ste=Es.create,ote=dr.create,ate=ur.create,cte=ei.create,ute=dr.createWithPreprocess,lte=Hl.create,dte=o(()=>TM().optional(),"ostring"),Ate=o(()=>DM().optional(),"onumber"),pte=o(()=>_M().optional(),"oboolean"),fte={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 gte=me;var ti=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(ti||{}),Tr=d.string().trim().min(1),hte=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")}),mv=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"),mte=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")}),NM=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:hte.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(ti).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:mv.optional(),credentialsRefused:d.array(mte).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 oL=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||{}),Ar=d.string().trim().min(1),Yl=d.array(d.string().url().max(2048).regex(/^https?:\/\//i)).max(50),UM=d.object({case:Ar.describe("a covers id \u2014 the recommend case this test realizes"),status:d.nativeEnum(pr),runtimeTargets:Yl.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()}),FM=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(UM).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")}),PM=d.object({from:d.string().optional().describe("staged path \u2014 required for placements"),file:Ar.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:Ar.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:Ar.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:Ar.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:FM,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:[]}),MM=(n=>(n.Junit="junit",n.Converter="converter",n))(MM||{}),yte=Ar.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),Ete=d.object({results:Ar.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:d.nativeEnum(MM),run:Ar.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:d.array(Ar).min(1).describe("the items[].file paths this run covered"),cases:d.array(d.object({test:Ar.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:Ar.describe("the covers id it realizes"),file:yte})).describe("map each reported test name to the case it covers")}),Ite=d.object({suites:d.array(Ete).min(1)}),yv=d.object({schemaVersion:d.literal(1),items:d.array(PM),runnerResults:Ite.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:Ar.describe("one paragraph")});Ac();lv();function LM(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}o(LM,"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 Ev=o(e=>`${e.source}:${e.site??""}:${e.key}`,"requirementItemId");var Wl=/^pasted-[0-9a-f]{16}$/,Cs=/^file-[0-9a-f]{16}$/,Zl=(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))(Zl||{}),Kl=o(e=>e.trim().toUpperCase(),"normalKey"),OM=o((e,t)=>{let n=e.trim();return Wl.test(n.toLowerCase())?"Pasted text":Cs.test(n.toLowerCase())?t?.get(Kl(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()},"itemName");var dg=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(dg||{}),_i=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(_i||{}),vc=(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))(vc||{}),vs=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(vs||{}),Xl=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(Xl||{}),ed=(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))(ed||{});var Ag=(n=>(n.Probe="probe",n.Agent="agent",n))(Ag||{}),pg=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(pg||{}),fg=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(fg||{});var Iv=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(Iv||{}),Cv=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(Cv||{});var gg=300,yt=d.string().trim().min(1),Cte=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"}),vte=/^[A-Za-z_][A-Za-z0-9_]*$/,ni=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,bc=(a=>(a.VersionEndpoint="version_endpoint",a.DeployWorkflow="deploy_workflow",a.KubernetesLabels="kubernetes_labels",a.Command="command",a.Api="api",a.NotTracked="not_tracked",a))(bc||{}),ri="shared",bte=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"),wc=d.object({address:bte,readyWhen:yt.nullable(),credentials:d.array(d.string().regex(ni)).max(50),revisionSources:d.array(d.object({method:d.nativeEnum(bc),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(),vv={steps:d.array(Cte).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(vte)).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")},bv=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(),...vv,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')}),wte=d.object({name:d.string().regex(ni).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(gg).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')}),Bte=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")}),kte=d.object({framework:yt,file:yt.describe("the test file run, relative to its repository root"),result:d.enum(["pass","fail","error"])}),Ste=d.object({input:yt.describe("the part of the user's SUT input, as given"),reason:yt}),iCe=d.object({schemaVersion:d.literal(1),status:d.nativeEnum(Cv).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(bv),suites:d.array(kte).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(Ste).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(Bte).describe("required (non-empty) when status is blocked"),inputs:d.array(wte).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:wc.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 wv=64*1024,Bv=512*1024,jM=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var GM=Se(require("path"));var Lt=d.string().trim().min(1),hg=Lt,kv=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(kv||{}),Sv=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],VM=d.object({schemaVersion:d.literal(1),type:d.nativeEnum(kv).optional(),repository:hg.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:wc.optional(),components:d.array(d.object({name:Lt,repository:Lt.describe(`owner/repo, or "${ri}" for a customer-deployed component no repository builds`),healthy:d.boolean(),url:d.string().min(1).nullable(),...vv,credentials:d.array(d.string().regex(ni)).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===ri&&!n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"repository"],message:`only a customer_deployed component is ${ri}`})}),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)=>{Sv.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!==ri&&!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 dCe=["clean","recipe-drift"];function td(e){let t=GM.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}o(td,"isRuntimePlanFile");var Lo=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(Lo||{}),vg=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(vg||{}),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||{}),Qte=["sut_setup"],Rte=["sut_setup","schedule","revision_read"],xte=["sut_setup"],xv=(t=>(t.PullRequest="pull_request",t))(xv||{}),$v=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))($v||{}),zM=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var wg=(r=>(r.None="none",r.Delivered="delivered",r.Partial="partial",r.Failed="failed",r))(wg||{}),id=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(id||{}),aL=(n=>(n.Running="running",n.Ended="ended",n))(aL||{}),sd=(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))(sd||{}),cL=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(cL||{}),Tv=(n=>(n.Started="started",n.Finished="finished",n))(Tv||{}),uL=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(uL||{});var lL=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(lL||{});var dL=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(dL||{}),Dv=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(Dv||{}),Qv=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(Qv||{});var _v=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(_v||{}),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}$/),Ig=d.object({id:tn,revision:fr}).strict(),Bg={provider:d.literal("github"),providerAccountId:fr,providerRepositoryId:fr},kg={provider:d.literal("azure-devops"),providerAccountId:tn,providerRepositoryId:tn},_r=d.discriminatedUnion("provider",[d.object(Bg).strict(),d.object(kg).strict()]),Nv=d.discriminatedUnion("provider",[d.object(Bg).passthrough(),d.object(kg).passthrough()]),si=o(e=>`${e.provider}:${e.providerRepositoryId}`,"sourceKey"),qM={namespace:d.string().min(1),name:d.string().min(1)},AL=d.discriminatedUnion("provider",[d.object({...Bg,...qM}).strict(),d.object({...kg,...qM}).strict()]),JM=d.object({ref:d.string().min(1),revision:Dr}).strict(),$te=d.object({kind:d.nativeEnum($v),number:fr.optional(),ref:d.string().min(1),revision:Dr,reason:d.nativeEnum(vg)}).strict(),Tte=d.object({repository:AL,revision:Dr,ref:d.string().nullable(),reason:d.nativeEnum(vg),change:d.object({kind:d.nativeEnum(xv),number:fr,base:JM.optional()}).strict().nullable(),compareWith:JM.optional(),merge:d.array($te).min(2).optional()}).strict();function Dte(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(!zM.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=zM.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(Dte,"mergedSourceIssue");function _te(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(_te,"baselineSourcesIssue");var pL=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,fL=/^[1-9][0-9]{0,18}$/,HM=new RegExp(`${pL.source}|${fL.source}`),YM=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,Nte=d.union([d.object({source:d.literal("jira"),site:d.string().regex(YM),key:d.string().regex(pL),updated:d.string().datetime(),contentHash:dn}).strict(),d.object({source:d.literal("confluence"),site:d.string().regex(YM),key:d.string().regex(fL),version:d.number().int().positive(),contentHash:dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Wl),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(Zl)}).strict()]),WM=d.union([d.literal("jira"),d.literal("confluence")]),Ute=d.object({schemaVersion:d.literal(1),items:d.array(d.union([d.object({source:WM,site:d.string(),key:d.string().regex(HM),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:WM,site:d.string(),key:d.string().regex(HM),state:d.literal("not_read"),reason:d.nativeEnum(Po)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(Wl),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(Wl),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(Zl)}).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(),Fte=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(),Pte=d.object({schemaVersion:d.literal(1),runId:tn,skyrampOrgId:tn,target:Ig,policy:Ig.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(Fte).optional(),sources:d.array(d.object({repository:_r,revision:Dr}).strict()).optional()}).strict().optional(),sources:d.array(Tte).min(1).max(1e3),execution:d.object({provider:d.nativeEnum(Lo),repository:AL,workflowPath:d.string(),ref:d.string()}).strict(),credentials:d.array(d.object({name:d.string(),purpose:d.nativeEnum(Iv),required:d.boolean()}).strict()),requirements:d.array(Nte).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=Ev({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=Qte.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=_te(e);s&&t.addIssue({code:d.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),Rte.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=Dte(u);A&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,...A.path],message:A.message})})});var Uv=(n=>(n.Person="person",n.Policy="policy",n))(Uv||{}),Mte=d.object({kind:d.nativeEnum(Uv),name:d.string().min(1).max(256)}).strict(),Lte=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(),Ote=d.object({schemaVersion:d.literal(1),attempt:d.object({id:tn,number:d.number().int().positive(),deadlineAt:d.string().datetime()}).strict(),manifest:Pte,manifestHash:dn,entitlements:d.array(d.string()).optional(),runToken:d.string().min(1).optional(),requestedBy:Mte.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:Lte.optional()}).strict(),ZM={providerRunAttempt:d.number().int().positive(),workflowRef:d.string().min(1)},jte=d.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),Gte=d.object({schemaVersion:d.literal(1),runId:tn,execution:d.discriminatedUnion("provider",[d.object({...ZM,provider:d.literal("github"),repository:d.object(Bg).strict(),providerRunId:fr}).strict(),d.object({...ZM,provider:d.literal("azure-devops"),repository:d.object(kg).strict(),providerRunId:jte}).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(),KM=d.object({repository:_r,number:fr,commitSha:Dr.optional()}).strict(),mg=d.array(d.object({repository:_r,reason:d.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),Vte=d.discriminatedUnion("status",[d.object({status:d.literal("none"),noTests:mg}).strict(),d.object({status:d.literal("delivered"),noTests:mg,pullRequests:d.array(KM).min(1)}).strict(),d.object({status:d.literal("partial"),noTests:mg,pullRequests:d.array(KM).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:mg}).strict()]),Sg=1024*1024,gL=16*1024*1024,yg=o(e=>d.array(d.object({[e]:d.string()}).strict()).optional(),"texts"),zte=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:yg("description"),newTestsCreated:yg("description"),testResults:yg("details"),caveats:yg("text")}).strict(),qte=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(vc))}).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"})}),Eg=500,hL=2048,mL=1e3,Jte=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,XM=o(e=>e.length>0&&e.length<=64&&e===e.trim()&&!Jte.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),"isAzureName"),yL=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)&&XM(n)&&XM(i)},"isResultRepository"),Hte=d.object({testResults:d.array(d.object({resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:d.string().refine(yL,"Invalid"),testType:d.string(),runtimeTargets:Yl.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(Xl),family:d.nativeEnum(ed).optional()}).strict().optional(),origin:d.nativeEnum(dg).optional()}).strict()),validation:qte,changes:d.array(d.object({id:d.string().min(1).max(512),text:d.string().max(16384),source:d.string().max(hL),testedBy:d.array(d.string().min(1).max(1024)).max(Eg),writtenBy:d.array(d.string().min(1).max(1024)).max(Eg),maintainedBy:d.array(d.string().min(1).max(1024)).max(Eg)}).strict()).max(mL).optional(),traceVersion:d.literal(1),display:zte.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)})}),eL=o(e=>e.replace(/[%:#]/g,t=>encodeURIComponent(t)),"encodeIdPart");function Fv(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}:${eL(a)}`;return i?`${c}#${eL(i)}`:c}o(Fv,"testResultId");var Qg=(i=>(i.BranchPushed="branch_pushed",i.PullRequestOpened="pull_request_opened",i.PullRequestEdited="pull_request_edited",i))(Qg||{}),EL=50,tL=d.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),IL=d.discriminatedUnion("kind",[d.object({kind:d.literal("branch_pushed"),repository:_r,branch:tL,commit:Dr}).strict(),d.object({kind:d.enum(["pull_request_opened","pull_request_edited"]),repository:_r,number:fr,branch:tL}).strict()]),CL=d.object({schemaVersion:d.literal(1),run:d.object({runId:tn,attemptNumber:d.number().int().positive(),manifestHash:dn}).strict(),target:Ig,policy:Ig,provenance:d.object({sources:d.array(d.object({repository:_r,revision:Dr}).strict()),firstQualification:d.literal(!0).optional()}).strict(),delivery:d.object({generatedTests:Vte}).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:Hte,githubWrites:d.array(IL).max(EL).optional()}).strict(),Pv=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(Pv||{}),Mv=200,Yte=d.object({cause:d.nativeEnum(Pv),credential:d.string().regex(ni).optional(),reason:d.string().trim().min(1).max(Mv).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"}),Wte=d.object({name:d.string().regex(ni),purpose:d.enum(["sut_access","other"]),required:d.boolean(),how:d.string().trim().min(1).max(gg)}).strict(),CCe=CL.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:VM,check:Yte.optional(),inputs:d.array(Wte).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)=>{td(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),jM.test(s.content)&&n(["files",a,"content"],"is not text");let c=Buffer.byteLength(s.content,"utf8");r+=c,c>wv&&n(["files",a,"content"],`larger than ${wv} bytes`)}),r>Bv&&n(["files"],`recipe text over ${Bv} bytes in total`)}),vCe=d.object({components:d.array(d.object({name:d.string().min(1),repository:d.string().refine(yL,"Invalid"),observedRevision:d.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:d.nativeEnum(Ag),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 vL(e){return e.trigger.kind==="schedule"||e.trigger.kind==="manual"&&e.sources.every(t=>t.reason==="BASELINE")}o(vL,"readsDeployedState");var Zte=d.object({schemaVersion:d.literal(1),stage:d.nativeEnum(cL),event:d.nativeEnum(Tv),status:d.nativeEnum(uL).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),Rg=100,Kte=5e3,Mo=2e3,nL=100,bL=/^[A-Za-z0-9_-]{1,64}$/,Xte=20,ene=200,tne=100,nne=100,rne=200,rL="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",ine=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${rL}/${rL})$`),sne=500,one=50,ane=10,cne=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,wL=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Zn=o(e=>d.string().max(e).refine(t=>t.trim().length>0&&!wL.test(t),"blank, or not text"),"setupText"),ii={sequence:d.number().int().min(1).max(Kte),at:d.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},BL=d.object({...ii,kind:d.literal("reply"),to:d.string().uuid(),outcome:d.nativeEnum(dL),accepted:d.boolean(),text:Zn(Mo),note:d.object({source:d.enum(["target","environment"]),quote:Zn(Mo)}).strict().optional(),kept:Zn(Mo).optional()}).strict();function kL(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(kL,"checkReply");var une=d.discriminatedUnion("kind",[d.object({...ii,kind:d.literal("log"),phase:d.nativeEnum(Dv),text:Zn(Mo)}).strict(),d.object({...ii,kind:d.literal("component"),name:Zn(nL),repository:Zn(rne).refine(e=>ine.test(e)||e===ri,"not owner/name"),file:Zn(sne).nullable(),status:d.nativeEnum(_v),version:Zn(nne).optional()}).strict(),BL,d.object({...ii,kind:d.literal("question"),id:d.string().regex(bL),type:d.nativeEnum(lL),text:Zn(Mo),component:Zn(nL).nullable(),choices:d.array(Zn(ene)).max(Xte),placeholder:Zn(tne).optional()}).strict(),d.object({...ii,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(Rg)}).strict(),d.object({...ii,kind:d.literal("credentials"),names:d.array(d.string().regex(ni)).min(1).max(one),logins:d.array(d.object({key:d.string().regex(cne),usernameVariable:d.string().regex(ni),passwordVariable:d.string().regex(ni)}).strict()).min(1).max(ane).optional()}).strict()]).superRefine((e,t)=>{if(kL(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=>LM(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"}))}),lne=d.object({schemaVersion:d.literal(1),events:d.array(une).max(Rg)}).strict(),dne=d.discriminatedUnion("kind",[d.object({...ii,kind:d.literal("log"),stage:d.nativeEnum(Qv),text:Zn(Mo)}).strict(),BL,d.object({...ii,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(Rg)}).strict(),d.object({...ii,kind:d.literal("stage"),stage:d.nativeEnum(Qv),event:d.nativeEnum(Tv)}).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=>!wL.test(e),"not text")}).strict()]).superRefine(kL),Ane=d.object({schemaVersion:d.literal(1),events:d.array(dne).max(Rg)}).strict(),iL={id:d.string().uuid(),text:d.string(),by:d.string().nullable(),at:d.string(),replied:d.literal(!0).optional()},SL=d.discriminatedUnion("kind",[d.object({...iL,kind:d.literal("instruction"),question:d.null()}),d.object({...iL,kind:d.literal("answer"),question:d.string().regex(bL)})]),QL=d.string().regex(/^[A-Za-z0-9+/]{43}=$/),pne=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()}),fne=d.object({schemaVersion:d.literal(1),leftOut:d.array(d.string()),messages:d.array(SL).optional(),stop:d.object({key:QL}).optional(),notes:pne.optional()}),gne=d.object({schemaVersion:d.literal(1),messages:d.array(SL).optional()});var hne=500*1024*1024,RL=d.object({id:fr,name:d.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:fr,expiresAt:d.string().datetime()}).strict(),mne=d.object({schemaVersion:d.literal(1),artifact:RL,sessionId:tn,contentHash:dn,bytes:d.number().int().min(1).max(hne)}).strict(),yne=d.object({schemaVersion:d.literal(1),checkpoint:d.object({artifact:RL,repository:d.object({namespace:d.string().min(1),name:d.string().min(1)}).strict(),sessionId:tn,contentHash:dn,key:QL}).strict().nullable()}).strict(),Ene=200,Bc=100,xL=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(xL||{}),Ine=d.object({kind:d.nativeEnum(xL),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(_v)}).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(Dv),text:d.string()}).strict()).max(Ene),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(),Cne=d.object({schemaVersion:d.literal(1),context:Ine.nullable()}).strict(),vne=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=wc.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=>td(e)&&!Sv.includes(e),"not a file of a customer_deployed plan"),content:d.string()}).strict()).optional()}).strict(),wne=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(td,"not a recipe file path"),content:d.string()}).strict()).min(1),repository:hg.optional(),recipeRepository:hg.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(aL),ending:d.nativeEnum(id).nullable(),cause:d.nativeEnum(sd).nullable(),deadlineAt:d.string().datetime()}).strict();function TL(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(TL,"attemptClosure");var DL=50,bCe=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(DL)}).strict();function Rv(e){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(e))return`[${e.map(Rv).join(",")}]`;if(e!==null&&typeof e=="object"){let n=e;return`{${Object.keys(n).sort().map(i=>`${JSON.stringify(i)}:${Rv(n[i])}`).join(",")}}`}let t=JSON.stringify(e);if(t===void 0)throw new TypeError("Canonical JSON requires JSON values");return t}o(Rv,"canonicalJson");function _L(e){return(0,oL.createHash)("sha256").update(Rv(e),"utf8").digest("hex")}o(_L,"manifestHash");var nd=o(e=>({provider:e.provider,providerAccountId:e.providerAccountId,providerRepositoryId:e.providerRepositoryId}),"toSourceRef");function Lv(e,t,{statedPins:n=!0}={}){return Gte.parse({schemaVersion:1,runId:e,execution:t.execution(),requester:!0,writeCheck:!0,claudeCodePin:!0,deployedPins:!0,...n?{statedPins:!0}:{},...t.runSettingsFromApp?{runSettings:!0}:{}})}o(Lv,"handshakeRequest");function NL(e){let t=Ote.parse(e);if(_L(t.manifest)!==t.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return t}o(NL,"parseHandshakeResponse");function Bne(e){let t=o(i=>i.map(r=>({repository:nd(r.repository),number:r.number,...r.commitSha===void 0?{}:{commitSha:r.commitSha}})),"pullRequests"),n=e.noTests?{noTests:e.noTests.map(i=>({repository:nd(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:nd(i.repository),message:i.message}))}:{...e,...n}}o(Bne,"toDelivery");function kne(e){return e.issues.map(t=>`${t.path.map((i,r)=>typeof i=="number"?`[${i}]`:r===0?i:`.${i}`).join("")}: ${t.message}`).join("; ")}o(kne,"describeIssues");function UL(e){let{manifest:t}=e;if(xte.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=CL.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e.attemptNumber,manifestHash:_L(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:nd(i.repository),revision:i.revision})),...e.firstQualification?{firstQualification:!0}:{}},delivery:{generatedTests:Bne(e.generatedTests)},producer:e.producer,report:e.report,...e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:nd(i.repository)}))}:{}});if(!n.success)throw new Error(`The report upload is invalid: ${kne(n.error)}`);return Sne(n.data,t,e.checkedOut),n.data}o(UL,"buildReportUpload");function Sne(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(Sne,"assertEvidenceFromSnapshot");function FL(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&&sL(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict}:{schemaVersion:1,reason:"no_report",cause:sL({...e,mergeConflict:void 0})}}o(FL,"attemptEndFor");function sL(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(sL,"noReportCause");var xCe=["clean","recipe-drift"];var bs=Se(require("path"));var _Ce={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var Ov=o(e=>new Map((e??[]).flatMap(t=>t.file?[[Kl(t.key),t.file.name]]:[])),"itemNames"),Rne=10*1024*1024,xne=o(e=>e?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","needsExtraction"),ML=o((e,t)=>bs.join(bs.dirname(e),`${bs.basename(e,bs.extname(e))}${t}`),"besideFile"),$ne=o(e=>ML(e,".extracted.txt"),"extractedTextPath");var Tne=o(e=>ML(e,".quotes.txt"),"confirmedQuotesPath");function LL(e){return xne(e.file)?$ne(e.path):e.file?.mediaType==="application/pdf"?Tne(e.path):e.path}o(LL,"itemTextPath");var Ni=d.string().trim().min(1),Ui=72,Dne=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.")}),jv=d.object({schemaVersion:d.literal(1),lint:d.array(Dne).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 od(e){return(e?.blockers??[]).slice(0,3).join("; ")}o(od,"leadBlockers");var Sc=o(e=>e.slice(0,12),"shortCommit");var _ne=["generate-unit","native-run"],GCe=["preflight","plan","write",..._ne,"report","deliver"];var Gv=(i=>(i.Unit="unit",i.Integration="integration",i.E2e="e2e",i))(Gv||{}),Nne=Object.values(Gv);var OL=require("child_process");var ad=Se(require("path"));var ws="Skyramp Testbot",Oo="test-bot@skyramp.dev";var Une=o((e,t)=>(0,OL.execFileSync)("git",t,{cwd:e,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim(),"git");function jL(e){let t="";try{t=Une(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/${ad.basename(ad.resolve(e)).replace(/[^A-Za-z0-9._-]/g,"-")||"repo"}`}o(jL,"repositorySlug");var eve=new Set(Object.values(vs));var tve=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 Vv=new Map;function Pne(e){return e.repositorySlug?e.repositorySlug:(Vv.has(e.repositoryPath)||Vv.set(e.repositoryPath,jL(e.repositoryPath)),Vv.get(e.repositoryPath))}o(Pne,"workingSlug");function xn(e){return[{slug:Pne(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 xg(e,t){return t?.trim()?e.find(n=>Qc(n.slug,t.trim())):e[0]}o(xg,"findSource");function Fi(e,t){return xg(xn(e),t)}o(Fi,"resolveSource");var Mne=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:Mne(e,t)}}o(Rc,"writableSource");var cd=Se(require("fs")),ud=Se(require("path"));var Lne=8;function Ot(e,t,n={}){let i=t.slice(0,Lne),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(cd.existsSync(e))try{return JSON.parse(cd.readFileSync(e,"utf-8"))}catch{return}}o(jo,"readJsonFile");function Ve(e,t){return jo(ud.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 ld(e){return e.replace(/\s+/g," ").trim()}o(ld,"normalizeCode");var dd=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:()=>ib,$input:()=>Uk,$output:()=>Nk,INVALID:()=>fn,NEVER:()=>rb,TimePrecision:()=>Hk,ZodAny:()=>NQ,ZodArray:()=>MQ,ZodBase64:()=>bm,ZodBase64URL:()=>wm,ZodBigInt:()=>pu,ZodBigIntFormat:()=>Sm,ZodBoolean:()=>Au,ZodCIDRv4:()=>Cm,ZodCIDRv6:()=>vm,ZodCUID:()=>fm,ZodCUID2:()=>gm,ZodCatch:()=>oR,ZodCodec:()=>uA,ZodCompileAsyncError:()=>Ur,ZodCompileUnsupportedError:()=>Ue,ZodCreditCard:()=>SQ,ZodCustom:()=>lA,ZodCustomStringFormat:()=>sa,ZodDate:()=>rA,ZodDefault:()=>eR,ZodDiscriminatedUnion:()=>OQ,ZodE164:()=>Bm,ZodEmail:()=>lm,ZodEmoji:()=>Am,ZodEnum:()=>uu,ZodError:()=>sae,ZodExactOptional:()=>$m,ZodFile:()=>WQ,ZodFirstPartyTypeKind:()=>IR,ZodFunction:()=>hR,ZodGUID:()=>dm,ZodIBAN:()=>QQ,ZodIPv4:()=>Em,ZodIPv6:()=>Im,ZodISODate:()=>Ns,ZodISODateTime:()=>_s,ZodISODuration:()=>Fs,ZodISOTime:()=>Us,ZodInstanceOf:()=>ER,ZodIntersection:()=>jQ,ZodIssueCode:()=>cae,ZodJWT:()=>km,ZodKSUID:()=>ym,ZodLazy:()=>pR,ZodLiteral:()=>YQ,ZodMAC:()=>kQ,ZodMap:()=>JQ,ZodNaN:()=>cR,ZodNanoID:()=>pm,ZodNever:()=>FQ,ZodNonOptional:()=>Tm,ZodNull:()=>DQ,ZodNullable:()=>XQ,ZodNumber:()=>du,ZodNumberFormat:()=>oa,ZodObject:()=>sA,ZodOptional:()=>aA,ZodPipe:()=>cA,ZodPrefault:()=>nR,ZodPreprocess:()=>uR,ZodPromise:()=>gR,ZodReadonly:()=>lR,ZodRealError:()=>Un,ZodRecord:()=>cu,ZodSet:()=>HQ,ZodString:()=>lu,ZodStringFormat:()=>Ke,ZodSuccess:()=>sR,ZodSymbol:()=>$Q,ZodTemplateLiteral:()=>AR,ZodTransform:()=>ZQ,ZodTuple:()=>VQ,ZodType:()=>xe,ZodULID:()=>hm,ZodURL:()=>nA,ZodUUID:()=>ui,ZodUndefined:()=>TQ,ZodUnion:()=>oA,ZodUnknown:()=>UQ,ZodVoid:()=>PQ,ZodXID:()=>mm,ZodXor:()=>LQ,_ZodString:()=>um,_default:()=>tR,_function:()=>hj,any:()=>J1,array:()=>iA,base64:()=>S1,base64url:()=>Q1,bigint:()=>j1,boolean:()=>xQ,catch:()=>aR,check:()=>mj,cidrv4:()=>B1,cidrv6:()=>k1,clone:()=>He,codec:()=>Aj,coerce:()=>vR,compile:()=>Lk,config:()=>It,core:()=>ji,creditCard:()=>x1,cuid:()=>m1,cuid2:()=>y1,currencyCode:()=>U1,custom:()=>yj,date:()=>Y1,decode:()=>EQ,decodeAsync:()=>CQ,deepPartial:()=>$j,describe:()=>Ej,discriminatedUnion:()=>tj,e164:()=>R1,email:()=>a1,emoji:()=>g1,encode:()=>yQ,encodeAsync:()=>IQ,endsWith:()=>Zc,enum:()=>Rm,exactOptional:()=>KQ,file:()=>cj,flattenError:()=>vd,float32:()=>P1,float64:()=>M1,formatError:()=>bd,fromJSONSchema:()=>Rj,function:()=>hj,getDiscriminatedOption:()=>rB,getErrorMap:()=>lae,globalRegistry:()=>Gt,gt:()=>ai,gte:()=>Xn,guid:()=>c1,hash:()=>F1,hex:()=>N1,hostname:()=>_1,httpUrl:()=>f1,iban:()=>$1,includes:()=>Yc,input:()=>Dj,instanceof:()=>Cj,int:()=>am,int32:()=>L1,int64:()=>G1,intersection:()=>GQ,invertCodec:()=>pj,ipv4:()=>v1,ipv6:()=>w1,iso:()=>dA,json:()=>bj,jwt:()=>T1,keyof:()=>W1,ksuid:()=>C1,lazy:()=>fR,length:()=>ea,literal:()=>aj,locales:()=>qd,looseObject:()=>X1,looseRecord:()=>rj,lowercase:()=>Jc,lt:()=>oi,lte:()=>Kn,mac:()=>b1,map:()=>ij,maxLength:()=>Xo,maxSize:()=>xs,memoizer:()=>Od,meta:()=>Ij,mime:()=>Xc,minLength:()=>Oi,minSize:()=>ci,multipleOf:()=>Rs,nan:()=>dj,nanoid:()=>h1,nativeEnum:()=>oj,negative:()=>Wh,never:()=>Qm,nonnegative:()=>Kh,nonoptional:()=>iR,nonpositive:()=>Zh,normalize:()=>eu,null:()=>_Q,nullable:()=>tA,nullish:()=>uj,number:()=>RQ,object:()=>Z1,optional:()=>ra,output:()=>_j,overwrite:()=>Fr,parse:()=>fQ,parseAsync:()=>gQ,partialRecord:()=>nj,pipe:()=>cm,positive:()=>Yh,prefault:()=>rR,preprocess:()=>wj,prettifyError:()=>ub,promise:()=>gj,properties:()=>Kc,property:()=>Xh,readonly:()=>dR,record:()=>qQ,refine:()=>mR,regex:()=>qc,regexes:()=>mr,registry:()=>wh,safeDecode:()=>bQ,safeDecodeAsync:()=>BQ,safeEncode:()=>vQ,safeEncodeAsync:()=>wQ,safeParse:()=>hQ,safeParseAsync:()=>mQ,set:()=>sj,setErrorMap:()=>uae,size:()=>Ko,slugify:()=>iu,startsWith:()=>Wc,strictObject:()=>K1,string:()=>eA,stringFormat:()=>D1,stringbool:()=>vj,success:()=>lj,superRefine:()=>yR,symbol:()=>z1,templateLiteral:()=>fj,toJSONSchema:()=>rm,toLowerCase:()=>nu,toUpperCase:()=>ru,toZod:()=>Ad,transform:()=>xm,treeifyError:()=>cb,trim:()=>tu,tuple:()=>zQ,uint32:()=>O1,uint64:()=>V1,ulid:()=>E1,undefined:()=>q1,union:()=>fu,unknown:()=>na,uppercase:()=>Hc,url:()=>p1,util:()=>x,uuid:()=>u1,uuidv4:()=>l1,uuidv6:()=>d1,uuidv7:()=>A1,validate:()=>wd,validateAsync:()=>Bd,void:()=>H1,withParser:()=>Bh,xid:()=>I1,xor:()=>ej});var ji={};Cr(ji,{$ZodAny:()=>Hw,$ZodArray:()=>eB,$ZodAsyncError:()=>_n,$ZodBase64:()=>Uw,$ZodBase64URL:()=>Fw,$ZodBigInt:()=>ph,$ZodBigIntFormat:()=>Vw,$ZodBoolean:()=>Nd,$ZodCIDRv4:()=>_w,$ZodCIDRv6:()=>Nw,$ZodCUID:()=>vw,$ZodCUID2:()=>bw,$ZodCatch:()=>EB,$ZodCheck:()=>it,$ZodCheckBigIntFormat:()=>Yb,$ZodCheckEndsWith:()=>aw,$ZodCheckGreaterThan:()=>Zg,$ZodCheckIncludes:()=>sw,$ZodCheckLengthEquals:()=>tw,$ZodCheckLessThan:()=>Wg,$ZodCheckLowerCase:()=>rw,$ZodCheckMaxLength:()=>Xb,$ZodCheckMaxSize:()=>Wb,$ZodCheckMimeType:()=>lw,$ZodCheckMinLength:()=>ew,$ZodCheckMinSize:()=>Zb,$ZodCheckMultipleOf:()=>Jb,$ZodCheckNumberFormat:()=>Hb,$ZodCheckOverwrite:()=>dw,$ZodCheckProperties:()=>uw,$ZodCheckProperty:()=>cw,$ZodCheckRegex:()=>nw,$ZodCheckSizeEquals:()=>Kb,$ZodCheckStartsWith:()=>ow,$ZodCheckStringFormat:()=>Oc,$ZodCheckUpperCase:()=>iw,$ZodCodec:()=>Fd,$ZodCreditCard:()=>Mw,$ZodCustom:()=>kB,$ZodCustomStringFormat:()=>jw,$ZodCyclicError:()=>Ih,$ZodDate:()=>Kw,$ZodDefault:()=>gB,$ZodDiscriminatedUnion:()=>iB,$ZodE164:()=>Pw,$ZodEmail:()=>hw,$ZodEmoji:()=>Iw,$ZodEncodeError:()=>Ss,$ZodEnum:()=>uB,$ZodError:()=>ab,$ZodExactOptional:()=>pB,$ZodFile:()=>dB,$ZodFunction:()=>wB,$ZodGUID:()=>fw,$ZodIBAN:()=>Lw,$ZodIPv4:()=>$w,$ZodIPv6:()=>Tw,$ZodISODate:()=>Qw,$ZodISODateTime:()=>Sw,$ZodISODuration:()=>xw,$ZodISOTime:()=>Rw,$ZodIntersection:()=>sB,$ZodJWT:()=>Ow,$ZodKSUID:()=>kw,$ZodLazy:()=>Pd,$ZodLiteral:()=>lB,$ZodMAC:()=>Dw,$ZodMap:()=>aB,$ZodNaN:()=>IB,$ZodNanoID:()=>Cw,$ZodNever:()=>Ww,$ZodNonOptional:()=>mB,$ZodNull:()=>Jw,$ZodNullable:()=>fB,$ZodNumber:()=>Ah,$ZodNumberFormat:()=>Gw,$ZodObject:()=>bO,$ZodObjectJIT:()=>tB,$ZodOptional:()=>gh,$ZodPipe:()=>hh,$ZodPrefault:()=>hB,$ZodPreprocess:()=>CB,$ZodPromise:()=>BB,$ZodReadonly:()=>vB,$ZodRealError:()=>Nn,$ZodRecord:()=>oB,$ZodRegistry:()=>bh,$ZodSet:()=>cB,$ZodString:()=>Ho,$ZodStringFormat:()=>Ye,$ZodSuccess:()=>yB,$ZodSymbol:()=>zw,$ZodTemplateLiteral:()=>bB,$ZodTransform:()=>AB,$ZodTuple:()=>fh,$ZodType:()=>Be,$ZodULID:()=>ww,$ZodURL:()=>Ew,$ZodUUID:()=>gw,$ZodUndefined:()=>qw,$ZodUnion:()=>Ud,$ZodUnknown:()=>Yw,$ZodVoid:()=>Zw,$ZodXID:()=>Bw,$ZodXor:()=>nB,$brand:()=>ib,$constructor:()=>b,$input:()=>Uk,$output:()=>Nk,Doc:()=>Jo,INVALID:()=>fn,JSONSchema:()=>i1,JSONSchemaGenerator:()=>im,NEVER:()=>rb,TimePrecision:()=>Hk,URL_BAD_FORMAT:()=>mw,URL_UNPARSEABLE:()=>xd,ZodCompileAsyncError:()=>Ur,ZodCompileUnsupportedError:()=>Ue,_any:()=>dS,_array:()=>yS,_base64:()=>zh,_base64url:()=>qh,_bigint:()=>iS,_boolean:()=>nS,_catch:()=>Joe,_check:()=>jO,_cidrv4:()=>Gh,_cidrv6:()=>Vh,_coercedBigint:()=>sS,_coercedBoolean:()=>rS,_coercedDate:()=>hS,_coercedNumber:()=>Wk,_coercedString:()=>Vk,_creditCard:()=>qk,_cuid:()=>Uh,_cuid2:()=>Fh,_custom:()=>IS,_date:()=>gS,_decode:()=>Mg,_decodeAsync:()=>Og,_default:()=>Voe,_discriminatedUnion:()=>Toe,_e164:()=>Jh,_email:()=>Qh,_emoji:()=>_h,_encode:()=>Pg,_encodeAsync:()=>Lg,_endsWith:()=>Zc,_enum:()=>Poe,_file:()=>ES,_float32:()=>Kk,_float64:()=>Xk,_gt:()=>ai,_gte:()=>Xn,_guid:()=>Rh,_iban:()=>Jk,_includes:()=>Yc,_int:()=>Zk,_int32:()=>eS,_int64:()=>oS,_intersection:()=>Doe,_ipv4:()=>Oh,_ipv6:()=>jh,_isoDate:()=>Yd,_isoDateTime:()=>Hd,_isoDuration:()=>Zd,_isoTime:()=>Wd,_jwt:()=>Hh,_ksuid:()=>Lh,_lazy:()=>Zoe,_length:()=>ea,_literal:()=>Loe,_lowercase:()=>Jc,_lt:()=>oi,_lte:()=>Kn,_mac:()=>zk,_map:()=>Uoe,_max:()=>Kn,_maxLength:()=>Xo,_maxSize:()=>xs,_mime:()=>Xc,_min:()=>Xn,_minLength:()=>Oi,_minSize:()=>ci,_multipleOf:()=>Rs,_nan:()=>mS,_nanoid:()=>Nh,_nativeEnum:()=>Moe,_negative:()=>Wh,_never:()=>pS,_nonnegative:()=>Kh,_nonoptional:()=>zoe,_nonpositive:()=>Zh,_normalize:()=>eu,_null:()=>lS,_nullable:()=>Goe,_number:()=>Yk,_optional:()=>joe,_overwrite:()=>Fr,_parse:()=>Fc,_parseAsync:()=>Pc,_pipe:()=>Hoe,_positive:()=>Yh,_promise:()=>Koe,_properties:()=>Kc,_property:()=>Xh,_readonly:()=>Yoe,_record:()=>Noe,_refine:()=>CS,_regex:()=>qc,_safeDecode:()=>Gg,_safeDecodeAsync:()=>zg,_safeEncode:()=>jg,_safeEncodeAsync:()=>Vg,_safeParse:()=>Mc,_safeParseAsync:()=>Lc,_set:()=>Foe,_size:()=>Ko,_slugify:()=>iu,_startsWith:()=>Wc,_string:()=>Gk,_stringFormat:()=>ta,_stringbool:()=>BS,_success:()=>qoe,_superRefine:()=>vS,_symbol:()=>cS,_templateLiteral:()=>Woe,_toLowerCase:()=>nu,_toUpperCase:()=>ru,_transform:()=>Ooe,_trim:()=>tu,_tuple:()=>_oe,_uint32:()=>tS,_uint64:()=>aS,_ulid:()=>Ph,_undefined:()=>uS,_union:()=>xoe,_unknown:()=>AS,_uppercase:()=>Hc,_url:()=>Jd,_uuid:()=>xh,_uuidv4:()=>$h,_uuidv6:()=>Th,_uuidv7:()=>Dh,_void:()=>fS,_xid:()=>Mh,_xor:()=>$oe,base64Charset:()=>ah,base64urlCharset:()=>_d,canParseURL:()=>yw,clone:()=>He,compile:()=>Lk,compileFn:()=>kh,config:()=>It,createStandardJSONSchemaMethod:()=>su,createToJSONSchemaMethod:()=>SS,decode:()=>$re,decodeAsync:()=>Dre,describe:()=>bS,encode:()=>xre,encodeAsync:()=>Tre,extractDefs:()=>Ts,finalize:()=>Ds,flattenError:()=>vd,formatError:()=>bd,getDiscriminatedOption:()=>rB,globalConfig:()=>Ut,globalRegistry:()=>Gt,handleUnrepresentable:()=>Rt,initializeContext:()=>$s,isBackEdge:()=>vh,isRecursiveSchema:()=>Ch,isValidBase64:()=>Dd,isValidBase64URL:()=>ch,isValidCIDRv6:()=>oh,isValidCreditCard:()=>uh,isValidIBAN:()=>lh,isValidIPv6:()=>Td,isValidJWT:()=>dh,locales:()=>qd,memoizer:()=>Od,mergeValues:()=>jc,meta:()=>wS,parse:()=>Ug,parseAsync:()=>Fg,parseURLObject:()=>IO,prettifyError:()=>ub,process:()=>We,processSchema:()=>We,regexes:()=>mr,registry:()=>wh,safeDecode:()=>Nre,safeDecodeAsync:()=>Fre,safeEncode:()=>_re,safeEncodeAsync:()=>Ure,safeParse:()=>Bre,safeParseAsync:()=>kre,standardProps:()=>nh,stripTabAndNewline:()=>$d,toDotPath:()=>XL,toJSONSchema:()=>rm,toZod:()=>Ad,treeifyError:()=>cb,urlHostnameOk:()=>ih,urlProtocolOk:()=>sh,util:()=>x,validate:()=>wd,validateAsync:()=>Bd,validateURL:()=>rh,version:()=>Aw,withParser:()=>Bh});var x={};Cr(x,{BIGINT_FORMAT_RANGES:()=>md,CONSTANT_CATCH:()=>_g,Class:()=>Jv,NUMBER_FORMAT_RANGES:()=>hd,aborted:()=>pn,allowsEval:()=>Wv,assert:()=>zne,assertEqual:()=>One,assertIs:()=>Gne,assertNever:()=>Vne,assertNotEqual:()=>jne,assignProp:()=>jt,attachSchema:()=>yd,base64ToUint8Array:()=>JL,base64urlToUint8Array:()=>lre,cached:()=>Dc,captureStackTrace:()=>Tg,cleanEnum:()=>ure,cleanRegex:()=>Mi,clone:()=>He,cloneDef:()=>Hne,codePointLength:()=>zo,constantCatch:()=>tb,createTransparentProxy:()=>ere,defineLazy:()=>Hv,defineLazyInternal:()=>Te,derived:()=>fre,esc:()=>An,escapeRegex:()=>hr,explicitlyAborted:()=>Xv,extend:()=>rre,finalizeIssue:()=>Dn,floatSafeRemainder:()=>pd,getElementAtPath:()=>Yne,getEnumValues:()=>$c,getLengthableOrigin:()=>Id,getParsedType:()=>Xne,getSizableOrigin:()=>Ed,hexToUint8Array:()=>Are,hide:()=>Cd,installLazyProp:()=>yre,isObject:()=>Vo,isPlainObject:()=>gr,issue:()=>Uc,joinValues:()=>w,jsonStringifyReplacer:()=>Tc,members:()=>eb,merge:()=>sre,mergeDefs:()=>Nr,normalizeParams:()=>z,nullish:()=>$g,numKeys:()=>Kne,objectClone:()=>qne,omit:()=>nre,optionalKeys:()=>Kv,own:()=>ks,parsedType:()=>T,partial:()=>ore,pick:()=>tre,prefixIssues:()=>Tn,primitiveTypes:()=>Zv,promiseAllObject:()=>Wne,propertyKeyTypes:()=>gd,randomString:()=>Zne,rawShape:()=>_c,required:()=>are,safeExtend:()=>ire,shallowClone:()=>fd,sizeCaps:()=>Nc,slugify:()=>Yv,stringifyPrimitive:()=>$,toZod:()=>Ad,uint8ArrayToBase64:()=>HL,uint8ArrayToBase64url:()=>dre,uint8ArrayToHex:()=>pre,unwrapMessage:()=>xc});function One(e){return e}o(One,"assertEqual");function jne(e){return e}o(jne,"assertNotEqual");function Ad(){return e=>e}o(Ad,"toZod");function Gne(e){}o(Gne,"assertIs");function Vne(e){throw new Error("Unexpected value in exhaustive check")}o(Vne,"assertNever");function zne(e){}o(zne,"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 qv=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 qv(e)}o(Dc,"cached");function $g(e){return e==null}o($g,"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 pd(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(pd,"floatSafeRemainder");var GL=Symbol("evaluating");function Hv(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==GL)return i===void 0&&(i=GL,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}o(Hv,"defineLazy");function qne(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}o(qne,"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 VL(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return jt(this,t,i),i},enumerable:!0,configurable:!0})}o(VL,"deferProp");function zL(e,t,n){t in e?jt(e,t,n):e[t]=n}o(zL,"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?VL(e,s,()=>{let c=t._zod.def.shape[s];return i?i(c,s):c}):zL(e,s,i?i(a.value,s):a.value))}}o(Go,"mirrorShape");function Jne(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?VL(e,n,()=>t[n]):zL(e,n,i.value))}}o(Jne,"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 Hne(e){return Nr(e._zod.def)}o(Hne,"cloneDef");function Yne(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}o(Yne,"getElementAtPath");function Wne(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(Wne,"promiseAllObject");function Zne(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}o(Zne,"randomString");function An(e){return JSON.stringify(e)}o(An,"esc");function Yv(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}o(Yv,"slugify");var Tg="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Vo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Vo,"isObject");var Wv=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 fd(e){return gr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}o(fd,"shallowClone");function Kne(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}o(Kne,"numKeys");var Xne=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"),gd=new Set(["string","number","symbol"]),Zv=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 ere(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(ere,"createTransparentProxy");function $(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}o($,"stringifyPrimitive");function Kv(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}o(Kv,"optionalKeys");var hd={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]},md={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function tre(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,Dg(e,t)),He(e,Nr(n,{shape:s,checks:[]}))}o(tre,"pick");function Dg(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(Dg,"maskedKeys");function nre(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(Dg(e,t)),a={};return Go(a,e,Reflect.ownKeys(Pi(e)).filter(c=>!s.has(c))),He(e,Nr(n,{shape:a,checks:[]}))}o(nre,"omit");function rre(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:qL(e,t)}))}o(rre,"extend");function qL(e,t){let n={};return Go(n,e,Reflect.ownKeys(Pi(e))),Jne(n,t),n}o(qL,"extended");function ire(e,t){if(!gr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return He(e,Nr(e._zod.def,{shape:qL(e,t)}))}o(ire,"safeExtend");function sre(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(sre,"merge");function ore(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(Dg(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(ore,"partial");function are(e,t,n){let i=n?new Set(Dg(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(are,"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 Xv(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(Xv,"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 yd(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}o(yd,"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 Ed(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}o(Ed,"getSizableOrigin");var cre=/[\uD800-\uDBFF]/;function zo(e){let t=e.length;if(!cre.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 Id(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Id,"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 ure(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}o(ure,"cleanEnum");function JL(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(JL,"base64ToUint8Array");function HL(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}o(HL,"uint8ArrayToBase64");function lre(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return JL(t+n)}o(lre,"base64urlToUint8Array");function dre(e){return HL(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}o(dre,"uint8ArrayToBase64url");function Are(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(Are,"hexToUint8Array");function pre(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}o(pre,"uint8ArrayToHex");var Jv=class{static{o(this,"Class")}constructor(...t){}};function eb(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):gre(e,n,i.value)}}o(eb,"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 Cd(e,t,n){return ks(e,t,n,!1)}o(Cd,"hide");function fre(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(fre,"derived");function gre(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(gre,"defineBound");function hre(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}o(hre,"claim");var zv,Bs=!1,mre={configurable:!0,get(){Bs=!0}};function Te(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&zv!==e._zod){zv=void 0;return}zv=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,mre);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 yre(e,t,n,i){let r=hre(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(yre,"installLazyProp");var _g="~constantCatch";function tb(e){let t=o(()=>e,"fn");return t[_g]=!0,t}o(tb,"constantCatch");var YL,rb=Object.freeze({status:"aborted"}),nb={value:void 0,enumerable:!1},WL="captureStackTrace"in Error?Error:null;function Ere(e){let t=WL;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return WL=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}o(Ere,"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{nb.value=new s(h);try{Object.defineProperty(g,"_zod",nb)}finally{nb.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),eb(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?Ere(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 ib=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"}};(YL=globalThis).__zod_globalConfig??(YL.__zod_globalConfig={});var Ut=globalThis.__zod_globalConfig;function It(e){return e&&Object.assign(Ut,e),Ut}o(It,"config");function Ire(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Tc,2)),e.message}o(Ire,"_getMessage");function Cre(e){this._zod.message=e}o(Cre,"_setMessage");var vre={get:Ire,set:Cre,enumerable:!0,configurable:!0},ob={value:void 0,enumerable:!1},ZL=new WeakSet([Object.prototype,Error.prototype]),KL=o((e,t)=>{e.name="$ZodError",ob.value=t,Object.defineProperty(e,"issues",ob),ob.value=void 0,Object.defineProperty(e,"message",vre);let n=Object.getPrototypeOf(e);ZL.has(n)||(ZL.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"),ab=b("$ZodError",KL),Nn=b("$ZodError",KL,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 vd(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(vd,"flattenError");function bd(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(bd,"formatError");function cb(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(cb,"treeifyError");function XL(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(XL,"toDotPath");function ub(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 ${XL(i.path)}`);return t.join(`
|
|
58
58
|
`)}o(ub,"prettifyError");function Ng(e,t){return{callee:t?.callee??e,Err:t?.Err}}o(Ng,"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 Tg(u,s?.callee??t),u}return c.value},"fn");return t},"_parse"),Ug=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 Tg(u,s?.callee??t),u}return c.value},"fn");return t},"_parseAsync"),Fg=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?eO(e,s.issues,r):{success:!0,data:s.value}},"_safeParse"),Bre=Mc(Nn);function eO(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(eO,"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?eO(e,s.issues,r):{success:!0,data:s.value}},"_safeParseAsync"),kre=Lc(Nn),Sre=Symbol.for("zod.compile.invalid"),Qre=Symbol.for("zod.compile.fallback"),wd=o(((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==Sre)return!0;if(i.definite===!0&&n===void 0)return!1}return Rre(e,t,n)}),"validate");function Rre(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,s;if(r?(i[Qre]=!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(Rre,"validateFallback");var Bd=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"),Pg=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,Ng(n,a))},"fn");return n},"_encode"),xre=Pg(Nn),Mg=o(e=>{let t=Fc(e),n=o((i,r,s,a)=>t(i,r,s,Ng(n,a)),"fn");return n},"_decode"),$re=Mg(Nn),Lg=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,Ng(n,a))},"fn");return n},"_encodeAsync"),Tre=Lg(Nn),Og=o(e=>{let t=Pc(e),n=o(async(i,r,s,a)=>await t(i,r,s,Ng(n,a)),"fn");return n},"_decodeAsync"),Dre=Og(Nn),jg=o(e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Mc(e)(t,n,r)},"_safeEncode"),_re=jg(Nn),Gg=o(e=>(t,n,i)=>Mc(e)(t,n,i),"_safeDecode"),Nre=Gg(Nn),Vg=o(e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Lc(e)(t,n,r)},"_safeEncodeAsync"),Ure=Vg(Nn),zg=o(e=>async(t,n,i)=>Lc(e)(t,n,i),"_safeDecodeAsync"),Fre=zg(Nn);var mr={};Cr(mr,{anyString:()=>Ub,base64:()=>Sb,base64url:()=>Qb,bigint:()=>Pb,boolean:()=>Mb,browserEmail:()=>zre,cidrv4:()=>Bb,cidrv6:()=>kb,creditCard:()=>qg,cuid:()=>db,cuid2:()=>Ab,currencyCode:()=>Tb,date:()=>Db,datetime:()=>Nb,domain:()=>xb,duration:()=>yb,e164:()=>$b,email:()=>Ib,emoji:()=>Cb,extendedDuration:()=>Pre,guid:()=>Eb,hex:()=>Vb,hostname:()=>Rb,html5Email:()=>jre,httpProtocol:()=>kd,iban:()=>Jg,idnEmail:()=>Vre,integer:()=>Sd,ipv4:()=>vb,ipv6:()=>bb,ksuid:()=>gb,lowercase:()=>jb,mac:()=>wb,md5_base64:()=>Yre,md5_base64url:()=>Wre,md5_hex:()=>Hre,nanoid:()=>hb,nanoidOfLength:()=>mb,null:()=>Lb,number:()=>Li,rfc5322Email:()=>Gre,sha1_base64:()=>Kre,sha1_base64url:()=>Xre,sha1_hex:()=>Zre,sha256_base64:()=>tie,sha256_base64url:()=>nie,sha256_hex:()=>eie,sha384_base64:()=>iie,sha384_base64url:()=>sie,sha384_hex:()=>rie,sha512_base64:()=>aie,sha512_base64url:()=>cie,sha512_hex:()=>oie,string:()=>Fb,time:()=>_b,ulid:()=>pb,undefined:()=>Ob,unicodeEmail:()=>tO,uppercase:()=>Gb,uuid:()=>qo,uuid4:()=>Mre,uuid6:()=>Lre,uuid7:()=>Ore,xid:()=>fb});var db=/^[cC][0-9a-z]{6,}$/,Ab=/^[0-9a-z]+$/,pb=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,fb=/^[0-9a-vA-V]{20}$/,gb=/^[A-Za-z0-9]{27}$/,hb=/^[a-zA-Z0-9_-]{21}$/;function mb(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}o(mb,"nanoidOfLength");var yb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Pre=/^[-+]?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)?)??$/,Eb=/^([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"),Mre=qo(4),Lre=qo(6),Ore=qo(7),Ib=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,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])?)*$/,Gre=/^(([^<>()\[\]\\.,;:\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,}))$/,tO=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Vre=tO,zre=/^[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])?)*$/,qre="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Cb(){return new RegExp(qre,"u")}o(Cb,"emoji");var vb=/^(?:(?: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}|:))$/,wb=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"),Bb=/^((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])$/,kb=/^(([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])$/,Sb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qb=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Rb=/^(?=.{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])?)*\.?$/,xb=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,kd=/^https?$/,$b=/^\+[1-9]\d{6,14}$/,qg=/^\d(?:[ -]?\d){11,18}$/,Tb=/^(?: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)$/,Jg=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,nO="(?:(?:\\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 Jre(e){return new RegExp(`^${e}$`)}o(Jre,"anchor");var Db=Jre(nO);function lb(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(lb,"timeSource");function _b(e){return new RegExp(`^${lb(e)}$`)}o(_b,"time");function Nb(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${lb({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${lb({precision:e.precision})}`:n;return new RegExp(`^${nO}T(?:${i})$`)}o(Nb,"datetime");var Ub=/^[\s\S]{0,}$/,Fb=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Pb=/^-?\d+n?$/,Sd=/^-?\d+$/,Li=/^-?\d+(?:\.\d+)?$/,Mb=/^(?:true|false)$/i,Lb=/^null$/i;var Ob=/^undefined$/i;var jb=/^[^A-Z]*$/,Gb=/^[^a-z]*$/,Vb=/^[0-9a-fA-F]*$/;function Qd(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}o(Qd,"fixedBase64");function Rd(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}o(Rd,"fixedBase64url");var Hre=/^[0-9a-fA-F]{32}$/,Yre=Qd(22,"=="),Wre=Rd(22),Zre=/^[0-9a-fA-F]{40}$/,Kre=Qd(27,"="),Xre=Rd(27),eie=/^[0-9a-fA-F]{64}$/,tie=Qd(43,"="),nie=Rd(43),rie=/^[0-9a-fA-F]{96}$/,iie=Qd(64,""),sie=Rd(64),oie=/^[0-9a-fA-F]{128}$/,aie=Qd(86,"=="),cie=Rd(86);var it=b("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),zb=o(e=>{let t=e.value;return!$g(t)&&t.size!==void 0},"_whenHasSize"),qb=o(e=>{let t=e.value;return!$g(t)&&t.length!==void 0},"_whenHasLength"),Hg={number:"number",bigint:"bigint",object:"date"},Wg=b("$ZodCheckLessThan",(e,t)=>{it.init(e,t);let n=Hg[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:Hg[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})}}),Zg=b("$ZodCheckGreaterThan",(e,t)=>{it.init(e,t);let n=Hg[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:Hg[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})}}),Jb=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):pd(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})}}),Hb=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]=hd[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})}}),Yb=b("$ZodCheckBigIntFormat",(e,t)=>{it.init(e,t);let[n,i]=md[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})}}),Wb=b("$ZodCheckMaxSize",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=zb),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Ed(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zb=b("$ZodCheckMinSize",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=zb),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Ed(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Kb=b("$ZodCheckSizeEquals",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=zb),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:Ed(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})}}),Xb=b("$ZodCheckMaxLength",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=qb),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=Id(r);i.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ew=b("$ZodCheckMinLength",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=qb),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=Id(r);i.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),tw=b("$ZodCheckLengthEquals",(e,t)=>{var n;it.init(e,t),(n=e._zod.def).when??(n.when=qb),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=Id(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=()=>{})}),nw=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})}}),rw=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jb),Oc.init(e,t)}),iw=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Gb),Oc.init(e,t)}),sw=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})}}),ow=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})}}),aw=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 Yg(e,t,n){e.issues.length&&t.issues.push(...Tn(n,e.issues))}o(Yg,"handleCheckPropertyResult");var cw=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=>Yg(r,n,t.property));Yg(i,n,t.property)}}),uw=b("$ZodCheckProperties",(e,t)=>{it.init(e,t),Cd(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=>Yg(l,i,a)))):Yg(u,i,a)}if(s)return Promise.all(s).then(()=>{})}}),lw=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})}}),dw=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(", ")}) {
|
|
@@ -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 ${Qx(t)}`}}o(Sx,"scriptedCommand");function Qx(e){return`'${e.split("'").join("'\\''")}'`}o(Qx,"shQuote");function Rx(e){return xx(e)&&BR(e).length===0&&SR(e.inputs?.sharedEnvironment).length===0}o(Rx,"sutIsHealthy");function xx(e){let t=Nde(e);if(!t&&e.state.stages.deploy?.status!=="passed")return!1;let n=Ve(e,"deploy.json");return n?_de(n):!t}o(xx,"sutCameUp");function _de(e){return e?.outcome==="clean"||e?.outcome==="recipe-drift"}o(_de,"deployCameUp");function Nde(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(Nde,"broughtUpByPlan");var b0e=10*6e4;var ny=(r=>(r.RestApi="rest-api",r.Frontend="frontend",r.FullStack="full-stack",r.Other="other",r))(ny||{}),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||{}),Dx=(i=>(i.Skyramp="skyramp",i.External="external",i.Unknown="unknown",i))(Dx||{}),_x=(r=>(r.Cascade="cascade",r.Restrict="restrict",r.Orphan="orphan",r.Unknown="unknown",r))(_x||{}),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"),Vz=o(e=>Xe.refine(t=>t.length<=400,t=>({message:`is ${t.length} characters, over the 400 cap \u2014 ${e}`})),"cap400"),QA=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'),Tx=d.object({method:Xe,path:Xe,service:d.string().optional(),evidence:Iu,repository:QA}),Lde=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.")}),Ode=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:QA,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)")}),jde=d.object({id:Xe.describe("short-slug"),file:Xe,line:d.number().optional(),claim:Vz("shorten it to the one sentence that states the defect, and move the supporting detail into `evidence`"),severity:d.nativeEnum(la),evidence:Vz("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:QA,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")}),Gde=d.object({name:Xe,language:d.string().optional(),framework:d.string().optional(),evidence:Iu,repository:QA}),Vde=d.object({dir:Xe,framework:d.string().optional(),kind:d.nativeEnum(Dx),evidence:Iu,repository:QA}),zde=d.object({from:Xe,to:Xe,onDelete:d.nativeEnum(_x),evidence:Iu}),qde=d.object({entity:Xe,field:Xe,values:d.array(d.string()),evidence:Iu}),Jde=d.object({entities:d.array(d.object({name:Xe,evidence:Iu})),references:d.array(zde).describe("INBOUND references \u2014 what still points at an entity when it is deleted"),stateFields:d.array(qde)}),Nx=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(ny),primaryLanguage:Xe,languages:d.array(d.string()),frameworks:d.array(d.string())}),services:d.array(Gde),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(Tx),modified:d.array(Tx),removed:d.array(Tx)}),existingTests:d.object({locations:d.array(Vde)}),entityMap:Jde,requirements:d.array(Lde).describe("from a spec (attached or linked) and/or the PR description; empty when neither states a testable obligation"),behaviors:d.array(Ode),findings:d.array(jde),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 Zde=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")}),RA=(n=>(n.InProcess="in-process",n.Browser="browser",n))(RA||{}),zz=(i=>(i.Spec="spec",i.PrDescription="pr-description",i.Inferred="inferred",i))(zz||{}),qz=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(Zde).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(RA).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(zz).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")}),ry=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 F0e=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 P0e=["stale_test","open_question"],M0e=["low","medium","high","critical"];var Jz=String.raw`(?:\[[^\]]*\]|\([^)]*\))`,Kde=String.raw`(?:["'\u201c\u2018\x60]|\*{1,2})?[^\s:"'\u201c\u201d\u2018\u2019\x60*()[\],]+(?:["'\u201d\u2019\x60]|\*{1,2})?`,Hz=String.raw`(?:${Jz}|${Kde}(?:\s*${Jz})?)`,Yz=String.raw`(?:\s*:|\s+[\u2014\u2013-])`,G0e=new RegExp(String.raw`^\s*(?:${Hz}(?:,\s*${Hz})*(?::L?\d+(?:[-\u2013]\d+)?${Yz}?|${Yz})|\[[^\]\s]+\]|\([^)\s]+\))\s+`);var xA=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(xA||{}),qi=d.string().trim().min(1),Xde=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")}),Ux=d.object({kind:d.nativeEnum(pg).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(fg).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")}),eAe=d.object({file:qi.describe("staged path under .skyramp/staged/"),source:d.nativeEnum(xA),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(Xde).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:d.array(Ux).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")}),Fx=d.object({schemaVersion:d.literal(1),tests:d.array(eAe),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")),Xz=require("child_process");var sn="{junit}",iy=(r=>(r.Junit="junit",r.Trx="trx",r.GoTestJson="go-test-json",r.JestJson="jest-json",r))(iy||{}),Px=(t=>(t.Minitest="minitest",t))(Px||{}),Wz=d.string().trim().min(1),Cu=d.object({cwd:Wz.describe('repo-relative directory the command starts in ("." for the root)'),argv:d.array(Wz).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(iy).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(Px).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)",Z0e=`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||{}),Mx=(n=>(n.Repository="repository",n.Testbot="testbot",n))(Mx||{}),Lx=(i=>(i.Identified="identified",i.Passed="passed",i.Failed="failed",i))(Lx||{}),Fn=d.string().trim().min(1),tAe=d.string().regex(/^[a-z0-9][a-z0-9-]*$/,"must be a short lowercase slug").describe("short-slug");var nAe=d.object({id:tAe,source:d.nativeEnum(Mx),kind:d.nativeEnum(vs),outcome:d.nativeEnum(Lx),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`)}),rAe=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')}),Ox=(i=>(i.Browser="browser",i.RunningApp="running-app",i.Outside="outside",i))(Ox||{}),iAe=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(Ox).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)")}),sAe=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")}),oAe=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)")}),$A=d.object({schemaVersion:d.literal(1),decision:d.nativeEnum(Ls),evidence:d.array(nAe).describe("evidence this session found or produced; CI results are the ci-<n> items and are not restated here"),plan:d.array(rAe).describe("how each changed behavior's evidence is obtained"),gaps:d.array(iAe),outOfScope:d.array(oAe).optional().describe("behaviors analyze found that this change neither changes nor states"),blocked:sAe.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 TA(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(TA,"readRecommend");function lAe(e){return mn(Fx,e).errors}o(lAe,"validateGenerateOutput");function dAe(e,t=[]){let{value:n,error:i}=$t(e,t);if(i)return{errors:[i]};let r=lAe(n);return r.length>0?{errors:r}:{generate:n,errors:[]}}o(dAe,"parseGenerateText");function sy(e,t=[]){return dAe(e.stdout,t)}o(sy,"parseGenerateFromSession");function AAe(e){return e.generate.filter(t=>t.type!=="ui").map(t=>t.id)}o(AAe,"backendCases");function e2(e){return e.generate.filter(t=>t.type==="ui").map(t=>t.id)}o(e2,"uiCases");var oy={backend:{stage:"generate",cases:AAe,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:Nj,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:e2,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:Uj,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."}},TTe=$n("generate-schema",(e,t)=>sy(t,e.secretValues));function pAe(e){let t=oy[e];return{name:`${t.stage}-coverage`,verify(n,i){let{generate:r,errors:s}=sy(i,n.secretValues);if(!r)return Ot(this.name,s);let a=TA(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(e2(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(pAe,"generateCoverageGateFor");function fAe(e){let t=oy[e];return{name:`${t.stage}-intent`,verify(n,i){let{generate:r,errors:s}=sy(i,n.secretValues);if(!r)return Ot(this.name,s);let a=TA(n);if(!a)return Ot(this.name,[t.noRecommendIntent]);let{asserted:c,errors:u,badFiles:l}=CAe(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(fAe,"generateIntentGateFor");function gAe(e){let t=oy[e];return n=>{if(!n.inputs.skyrampMcp?.command||e==="backend"&&!Rx(n))return;let i=bu.join(n.outputsDir,`${t.stage}-stream.ndjson`);if(!(!Os.existsSync(i)||t.usedCodegen(i)))return Fj(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(gAe,"codegenRetryHintFor");var DTe=pAe("backend"),_Te=fAe("backend"),NTe=gAe("backend");var Zz=o(e=>e.replace(/\s+/g,""),"squeeze");var jx={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"]])jx[e]=jx[t];function hAe(e,t){if(e.includes(ld(t))||Zz(e).includes(Zz(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(ld(i)))?!0:IAe(e,t)}o(hAe,"evidenceFound");var mAe=/\bassert\w*\b|\bexpect\s*\(|\.should\b|\brequire\s*\(/i,yAe=12,EAe=/,\s*\(\s*#|,\s*f?["'`]|\s+#\s|\s+\/\/|\s*\((?:line|lines|at line)\b|\s*,\s*$/i;function IAe(e,t){let n=t.split(/\s*;\s*|\s*\.\.\.\s*|\r?\n/),i=0;for(let r of n){let s=mAe.exec(r);if(!s)continue;let a=r.slice(s.index),c=EAe.exec(a);if(c&&(a=a.slice(0,c.index)),a=ld(a).replace(/[,\s]+$/,""),a.length<yAe||!e.includes(a))return!1;i++}return i>0}o(IAe,"annotatedAssertionFound");function CAe(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=ld(Os.readFileSync(a,"utf-8"));for(let u of s.assertions??[]){if(!hAe(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(CAe,"verifiedAssertions");var vAe=/\.(spec|test)\.[cm]?[jt]sx?$/i;function t2(e){let t;try{t=(0,Xz.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)||dd.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(t2,"testLitter");function bAe(e){let t=oy[e],n=e==="ui";return{name:`${t.stage}-no-litter`,verify(i){let r=t2(i.inputs.repositoryPath);if(r===void 0)return{name:this.name,passed:!0};let s=r.filter(a=>vAe.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 UTe=bAe("backend");var kAe="write-stale-updates",SAe={[kAe]:"stale test updates"};var DA=Se(require("fs")),Aa=Se(require("path"));function s2(e){return mn(yv,e).errors}o(s2,"validateAdaptOutput");function xAe(e,t=[]){let{value:n,error:i}=$t(e,t);if(i)return{errors:[i]};let r=s2(n);return r.length>0?{errors:r}:{adapt:n,errors:[]}}o(xAe,"parseAdaptText");var $Ae="adapt-scratch",r2=`${$Ae}/adapt-result.json`;function o2(e,t){let n=Aa.join(e.outputsDir,r2),i;try{i=DA.readFileSync(n,"utf-8")}catch{i=void 0}if(i!==void 0&&(e.secretValues??[]).some(a=>i.includes(a)))return{errors:[`${r2} contains a secret value (token / credential) \u2014 never write it anywhere`]};let r=xAe(t.stdout,e.secretValues);if(r.adapt)return r;let s=i!==void 0?jo(n):void 0;return s!==void 0&&s2(s).length===0?{adapt:s,errors:[]}:r}o(o2,"parseAdaptFromSession");var ADe=$n("adapt-schema",o2);var a2=require("child_process");function Gx(e){return TAe(e)??[]}o(Gx,"statusEntries");function TAe(e){let t;try{t=(0,a2.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(TAe,"readStatusEntries");var vDe=2*1024*1024;var ay=d.string().trim().min(1),DAe=d.object({cwd:ay.describe(`directory the command starts in, relative to the test's checkout ("." for its root)`),argv:d.array(ay).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")}),_Ae=d.object({file:ay.describe("a file of the test's checkout, relative to its root"),line:ay.describe("a line of that file, quoted exactly from where its command starts to its end")}),c2=d.object({collected:d.boolean().describe("whether the repo's CI runs this test as it is"),steps:d.array(_Ae).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:DAe.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),LAe=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"),OAe=d.preprocess(LAe,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)")})),l2=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`}),jAe=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(l2).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(OAe)}),d2=(r=>(r.ServerError="server-error",r.DataLost="data-lost",r.FinalState="final-state",r.DerivedValues="derived-values",r))(d2||{}),GAe=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(d2).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)")}),VAe=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(l2).optional().describe("when sources of the same rank disagree on it: each of them")}),zAe=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")}),qAe=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")}),u2=d.array(bv).optional(),JAe=d.object({components:d.preprocess(e=>u2.safeParse(e).success?e:void 0,u2).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(ti).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"),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:mv.optional()}),s_e=d.object({schemaVersion:d.literal(1),requirements:d.array(jAe),findings:d.array(GAe),cases:d.array(zAe).describe("a second test for a clause, and one case per finding that fails on this branch"),questions:d.array(VAe).optional().describe("behaviours the change leaves unsettled; no case asserts any of them"),maintenance:d.array(qAe),journeys:d.array(qz).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:$A.optional().describe("the validation triage decision, made before the app is started; its behaviorIds are clause ids"),app:JAe.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 _A=(n=>(n.Backend="backend",n.Ui="ui",n))(_A||{});var js=(r=>(r.Added="added",r.Updated="updated",r.Deleted="deleted",r.Unchanged="unchanged",r))(js||{}),HAe=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(_A),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:Yl.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"),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")}),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")})).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(Ux).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:c2.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`)}),YAe=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"),WAe=d.preprocess(YAe,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")})),o_e=d.object({schemaVersion:d.literal(1),tests:d.array(HAe),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(ry).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(WAe).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 a_e={added:"place",updated:"update",deleted:"delete",unchanged:"verify"};var p2=(i=>(i.Requirement="requirement",i.PrDescription="pr_description",i.Code="code",i))(p2||{}),qt=d.string().trim().min(1),ZAe=d.object({expectation:qt.max(300).describe("the behavior this assertion pins, in words"),source:d.nativeEnum(p2),expected:qt.max(200).describe("the exact value or outcome asserted, as the test asserts it")}),KAe=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(ZAe).min(1)}),NA=(n=>(n.Updated="updated",n.Deleted="deleted",n))(NA||{}),A2=300,XAe=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(NA),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,A2):e,qt.max(A2)).describe("what the change deliberately altered that made the test wrong")}),Vx=d.object({schemaVersion:d.literal(1),tests:d.array(KAe),maintained:d.array(XAe).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(ry).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 UA="generate-unit.json";function tpe(e){let{value:t,error:n}=$t(e);if(n)return{errors:[n]};let{value:i,errors:r}=mn(Vx,t);return r.length?{errors:r}:{output:i,errors:[]}}o(tpe,"parseGenerateUnitText");function npe(e){return tpe(e.stdout)}o(npe,"parseGenerateUnitFromSession");var Z_e=$n("generate-unit-schema",(e,t)=>npe(t));var cy=String.raw`(?:node:)?(?:http|https|http2|net|tls|dgram)`,K_e=[[/\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+["']${cy}["']|\bimport\s+["']${cy}["']|require\(\s*["']${cy}["']\s*\)|\bimport\(\s*["']${cy}["']\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 ENe=new Set(["targeted_unit","existing_evidence_sufficient"]);var lpe="triage.json";var SUe=new Set(["existing_evidence","unaffected","existing_unit","new_unit","runtime"]),QUe={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 dpe(e){let{value:t,error:n}=$t(e);if(n)return{errors:[n]};let{value:i,errors:r}=mn($A,t);return r.length?{errors:r}:{triage:i,errors:[]}}o(dpe,"parseTriageText");function Ape(e){return dpe(e.stdout)}o(Ape,"parseTriageFromSession");var RUe=$n("triage-schema",(e,t)=>Ape(t));function ppe(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(ppe,"triageDecider");function qx(e){if(ppe(e)?.status==="passed")return jo(E2.join(e.outputsDir,lpe))}o(qx,"readTriage");function Jx(e){return Jj(kR(e.inputs,Ve(e,`${hA}.json`),qx(e)?.sutRequired))}o(Jx,"revisionBlockReason");var xUe=new Set(["deploy","recommend","generate","generate-ui","adapt","generate-unit","native-run","finalize","deliver"]);var Pr=Se(require("fs")),Vs=Se(require("path")),Aq=Se(require("crypto")),pq=require("child_process");var Hx=require("child_process"),Bu=Se(require("fs")),I2=Se(require("os")),dy=Se(require("path"));var fpe={onPath:o(e=>(0,Hx.spawnSync)("sh",["-c",`command -v ${e}`],{stdio:"ignore"}).status===0,"onPath"),run:o((e,t)=>(0,Hx.spawnSync)(e[0],e.slice(1),{cwd:t,stdio:"ignore",timeout:6e4}).status??1,"run")},ly={cleanup:o(()=>{},"cleanup")},gpe=new Set(["pnpm","yarn"]);function C2(e,t=I2.tmpdir(),n=fpe){if(process.platform==="win32")return ly;try{let i=vx(e);if(!gpe.has(i)||n.onPath(i)||!n.onPath("corepack"))return ly;Bu.mkdirSync(t,{recursive:!0});let r=Bu.mkdtempSync(dy.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(),ly):{dir:r,cleanup:s}}catch{return ly}}o(C2,"packageManagerShims");function v2(e,t=process.env){return e.dir?{...t,PATH:[e.dir,t.PATH].filter(Boolean).join(dy.delimiter)}:t}o(v2,"withShims");var OA=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 tFe=5*6e4,nFe=12*6e4,rFe=2*6e4;var lFe=["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(t2,"testLitter");function bAe(e){let t=oy[e],n=e==="ui";return{name:`${t.stage}-no-litter`,verify(i){let r=t2(i.inputs.repositoryPath);if(r===void 0)return{name:this.name,passed:!0};let s=r.filter(a=>vAe.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 UTe=bAe("backend");var kAe="write-stale-updates",SAe={[kAe]:"stale test updates"};var DA=Se(require("fs")),Aa=Se(require("path"));function s2(e){return mn(yv,e).errors}o(s2,"validateAdaptOutput");function xAe(e,t=[]){let{value:n,error:i}=$t(e,t);if(i)return{errors:[i]};let r=s2(n);return r.length>0?{errors:r}:{adapt:n,errors:[]}}o(xAe,"parseAdaptText");var $Ae="adapt-scratch",r2=`${$Ae}/adapt-result.json`;function o2(e,t){let n=Aa.join(e.outputsDir,r2),i;try{i=DA.readFileSync(n,"utf-8")}catch{i=void 0}if(i!==void 0&&(e.secretValues??[]).some(a=>i.includes(a)))return{errors:[`${r2} contains a secret value (token / credential) \u2014 never write it anywhere`]};let r=xAe(t.stdout,e.secretValues);if(r.adapt)return r;let s=i!==void 0?jo(n):void 0;return s!==void 0&&s2(s).length===0?{adapt:s,errors:[]}:r}o(o2,"parseAdaptFromSession");var ADe=$n("adapt-schema",o2);var a2=require("child_process");function Gx(e){return TAe(e)??[]}o(Gx,"statusEntries");function TAe(e){let t;try{t=(0,a2.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(TAe,"readStatusEntries");var vDe=2*1024*1024;var ay=d.string().trim().min(1),DAe=d.object({cwd:ay.describe(`directory the command starts in, relative to the test's checkout ("." for its root)`),argv:d.array(ay).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")}),_Ae=d.object({file:ay.describe("a file of the test's checkout, relative to its root"),line:ay.describe("a line of that file, quoted exactly from where its command starts to its end")}),c2=d.object({collected:d.boolean().describe("whether the repo's CI runs this test as it is"),steps:d.array(_Ae).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:DAe.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),LAe=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"),OAe=d.preprocess(LAe,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)")})),l2=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`}),jAe=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(l2).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(OAe)}),d2=(r=>(r.ServerError="server-error",r.DataLost="data-lost",r.FinalState="final-state",r.DerivedValues="derived-values",r))(d2||{}),GAe=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(d2).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)")}),VAe=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(l2).optional().describe("when sources of the same rank disagree on it: each of them")}),zAe=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")}),qAe=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")}),u2=d.array(bv).optional(),JAe=d.object({components:d.preprocess(e=>u2.safeParse(e).success?e:void 0,u2).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(ti).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"),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:mv.optional()}),s_e=d.object({schemaVersion:d.literal(1),requirements:d.array(jAe),findings:d.array(GAe),cases:d.array(zAe).describe("a second test for a clause, and one case per finding that fails on this branch"),questions:d.array(VAe).optional().describe("behaviours the change leaves unsettled; no case asserts any of them"),maintenance:d.array(qAe),journeys:d.array(qz).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:$A.optional().describe("the validation triage decision, made before the app is started; its behaviorIds are clause ids"),app:JAe.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 _A=(n=>(n.Backend="backend",n.Ui="ui",n))(_A||{});var js=(r=>(r.Added="added",r.Updated="updated",r.Deleted="deleted",r.Unchanged="unchanged",r))(js||{}),HAe=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(_A),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:Yl.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"),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")})).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(Ux).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:c2.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`)}),YAe=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"),WAe=d.preprocess(YAe,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")})),o_e=d.object({schemaVersion:d.literal(1),tests:d.array(HAe),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(ry).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(WAe).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 a_e={added:"place",updated:"update",deleted:"delete",unchanged:"verify"};var p2=(i=>(i.Requirement="requirement",i.PrDescription="pr_description",i.Code="code",i))(p2||{}),qt=d.string().trim().min(1),ZAe=d.object({expectation:qt.max(300).describe("the behavior this assertion pins, in words"),source:d.nativeEnum(p2),expected:qt.max(200).describe("the exact value or outcome asserted, as the test asserts it")}),KAe=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(ZAe).min(1)}),NA=(n=>(n.Updated="updated",n.Deleted="deleted",n))(NA||{}),A2=300,XAe=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(NA),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,A2):e,qt.max(A2)).describe("what the change deliberately altered that made the test wrong")}),Vx=d.object({schemaVersion:d.literal(1),tests:d.array(KAe),maintained:d.array(XAe).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(ry).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 UA="generate-unit.json";function tpe(e){let{value:t,error:n}=$t(e);if(n)return{errors:[n]};let{value:i,errors:r}=mn(Vx,t);return r.length?{errors:r}:{output:i,errors:[]}}o(tpe,"parseGenerateUnitText");function npe(e){return tpe(e.stdout)}o(npe,"parseGenerateUnitFromSession");var Z_e=$n("generate-unit-schema",(e,t)=>npe(t));var cy=String.raw`(?:node:)?(?:http|https|http2|net|tls|dgram)`,K_e=[[/\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+["']${cy}["']|\bimport\s+["']${cy}["']|require\(\s*["']${cy}["']\s*\)|\bimport\(\s*["']${cy}["']\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 ENe=new Set(["targeted_unit","existing_evidence_sufficient"]);var lpe="triage.json";var SUe=new Set(["existing_evidence","unaffected","existing_unit","new_unit","runtime"]),QUe={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 dpe(e){let{value:t,error:n}=$t(e);if(n)return{errors:[n]};let{value:i,errors:r}=mn($A,t);return r.length?{errors:r}:{triage:i,errors:[]}}o(dpe,"parseTriageText");function Ape(e){return dpe(e.stdout)}o(Ape,"parseTriageFromSession");var RUe=$n("triage-schema",(e,t)=>Ape(t));function ppe(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(ppe,"triageDecider");function qx(e){if(ppe(e)?.status==="passed")return jo(E2.join(e.outputsDir,lpe))}o(qx,"readTriage");function Jx(e){return Jj(kR(e.inputs,Ve(e,`${hA}.json`),qx(e)?.sutRequired))}o(Jx,"revisionBlockReason");var xUe=new Set(["deploy","recommend","generate","generate-ui","adapt","generate-unit","native-run","finalize","deliver"]);var Pr=Se(require("fs")),Vs=Se(require("path")),Aq=Se(require("crypto")),pq=require("child_process");var Hx=require("child_process"),Bu=Se(require("fs")),I2=Se(require("os")),dy=Se(require("path"));var fpe={onPath:o(e=>(0,Hx.spawnSync)("sh",["-c",`command -v ${e}`],{stdio:"ignore"}).status===0,"onPath"),run:o((e,t)=>(0,Hx.spawnSync)(e[0],e.slice(1),{cwd:t,stdio:"ignore",timeout:6e4}).status??1,"run")},ly={cleanup:o(()=>{},"cleanup")},gpe=new Set(["pnpm","yarn"]);function C2(e,t=I2.tmpdir(),n=fpe){if(process.platform==="win32")return ly;try{let i=vx(e);if(!gpe.has(i)||n.onPath(i)||!n.onPath("corepack"))return ly;Bu.mkdirSync(t,{recursive:!0});let r=Bu.mkdtempSync(dy.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(),ly):{dir:r,cleanup:s}}catch{return ly}}o(C2,"packageManagerShims");function v2(e,t=process.env){return e.dir?{...t,PATH:[e.dir,t.PATH].filter(Boolean).join(dy.delimiter)}:t}o(v2,"withShims");var OA=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 tFe=5*6e4,nFe=12*6e4,rFe=2*6e4;var lFe=["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 vFe=[...pv,"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 Ay=Se(Ix());var ZFe={jest:"jest",vitest:"vitest"};var TPe=new Set(["jest","vitest","npm-test","playwright"]);var qPe=5*6e4;var FA=Se(require("path"));var mMe={python:"pytest",typescript:"playwright",javascript:"playwright"},yMe={pytest:"pytest",playwright:"playwright"};function Epe(e){return mn(jv,e).errors}o(Epe,"validateFinalizeOutput");function Ipe(e,t=[]){let{value:n,error:i}=$t(e,t);if(i)return{errors:[i]};let r=Epe(n);return r.length>0?{errors:r}:{finalize:n,errors:[]}}o(Ipe,"parseFinalizeText");var Cpe="finalize-scratch";function vpe(e,t){let n=Ipe(e.stdout,t?.secretValues);if(!n.finalize||!t?.outputsDir)return n;let i=o((r,s)=>r.trim()&&Sx(r.trim(),FA.join(t.outputsDir,Cpe,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(vpe,"parseFinalizeFromSession");var uLe=$n("finalize-schema",(e,t)=>vpe(t,e));function bpe(e){return mn(Nx,e).errors}o(bpe,"validateAnalysisOutput");function k2(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(k2,"parseAnalysisText");function wpe(e,t=[]){return k2(e.stdout,t)}o(wpe,"parseAnalysisFromSession");var DLe=$n("analysis-schema",(e,t)=>wpe(t,e.secretValues));var e1e=ig.rows.notRun(!0);var PA="kept, not ";var MA="(declined the planned ";function Yx(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(Yx,"assertionParts");var S2=new Set(["update","regenerate","delete"]);var t1e={update:"updated",regenerate:"regenerated",delete:"deleted",verify:"verified",none:"touched"};var Q2=d.string().trim().min(1),Wx=d.object({schemaVersion:d.literal(1).optional(),businessCaseAnalysis:Q2.describe("1-2 sentences: what this change means for a user, and whether the evidence shows it working"),issuesFound:d.array(d.object({description:Q2,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 Qpe(e){return mn(Wx,e).errors}o(Qpe,"validateProseOutput");function Rpe(e,t=[]){let{value:n,error:i}=$t(e.stdout,t);if(i)return{errors:[i]};let r=Qpe(n);return r.length>0?{errors:r}:{prose:n,errors:[]}}o(Rpe,"parseProseFromSession");var g1e=$n("report-schema",(e,t)=>Rpe(t,e.secretValues));var R2="<!-- skyramp-testbot -->",x2=S2,xpe=new Set(["lint","type","config"]),$2={critical:0,high:1,medium:2,low:3},F2=new Set(["Pass","Fail"]);var Xx=o(e=>Io(ae().statusLabels,e),"statusLabel"),Zx=o(e=>Io(ae().testTypeCellLabels,e),"testTypeLabel");function Ge(e){return(e??"").replace(/\|/g,"\\|").replace(/\r?\n/g,"<br>").trim()}o(Ge,"escCell");function T2(e){return e.inferred?" (inferred)":""}o(T2,"inferredMark");function D2(e,t){return!e||!F2.has(e)?"\u2014":t?`${Xx(e)} (${Ge(P2(t))})`:Xx(e)}o(D2,"maintStatus");function P2(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(PA))return ae().staged.keptNot+t(e.slice(PA.length));let n=e.indexOf(MA);return n<0?e:e.slice(0,n)+ae().staged.declinedPlanned+t(e.slice(n+MA.length))}o(P2,"declineNote");function _2(e){return e.category!==void 0&&xpe.has(e.category.toLowerCase())}o(_2,"isTooling");function N2(e,t){return($2[(e.severity??"").toLowerCase()]??4)-($2[(t.severity??"").toLowerCase()]??4)}o(N2,"bySeverity");function U2(e){return`- ${e.severity?`**[${Io(ae().severityLabels,e.severity.toLowerCase()).toUpperCase()}]** `:""}${e.description.trim()}`}o(U2,"issueLine");function $pe(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($pe,"unitTestOf");var M2=o((e,t)=>e!==void 0&&t!==void 0&&e.replace(/^\.\//,"")===t.replace(/^\.\//,""),"samePath");function L2(e,t){return(e.testVideos??[]).find(n=>n.url&&t(n))?.url}o(L2,"videoLink");function e$(e,t){return L2(e,n=>M2(n.fileName,t.fileName)&&(!n.repository||!t.repository||n.repository.toLowerCase()===t.repository.toLowerCase()))}o(e$,"resultVideoLink");function t$(e,t){return L2(e,n=>M2(n.writtenAs??n.fileName,t))}o(t$,"journeyVideoLink");function Tpe(e,t,n){return n?e$(e,{fileName:t,repository:n}):t$(e,t)}o(Tpe,"requirementVideoLink");function Dpe(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&&Lz(c,u)),"parentOf"),s=new Map;for(let a of e.testResults){let c=$pe(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(Dpe,"resultRows");function _pe(e){return Yx(e).map(t=>t.expected===void 0?t.expectation:`${t.expectation}: ${Jt(t.expected)}`)}o(_pe,"unitAssertions");function Kx(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")}o(Kx,"nothingExecuted");function O2(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=[R2];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(Kx(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=>_pe(tt)))];for(let tt of Dt)g.push(` - ${tt}`)}g.push("")}for(let se of ee){let ye=se.testId?Jt(p(se.testId)):Zx(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=>x2.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(Zx(P.testType))} | ${Ge(P.endpoint)} | \`${Ge(P.fileName)}\` | ${Ge(P.description)} | ${D2(P.beforeStatus,P.beforeDetails)} | ${D2(P.afterStatus,P.afterDetails)} |`);y()}let C=o(P=>P.startsWith(PA)||P.includes(MA),"hasDeclineNote"),I=(e.testMaintenance??[]).filter(P=>C(P.afterDetails)&&(!x2.has(P.action)||!F2.has(P.afterStatus??"")));if(u&&I.length){h(ae().staged.declinedMaintenanceHeader);for(let P of I)g.push(`- \`${Ge(P.fileName)}\`: ${Ge(P2(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=Dpe(e),ee=P.some(G=>G.test),Y=P.some(G=>e$(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=e$(e,G),ot=Y?` ${Mn?ae().videoDownloadLink(Mn):"\u2014"} |`:"";g.push(`| ${st} | ${Ge(Zx(G.testType))} | ${Ge(G.endpoint)} |${ze} ${Ge(Xx(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)))}${T2(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?Tpe(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)))}${T2(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=>t$(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?t$(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=>!_2(Y)).sort(N2),ee=e.issuesFound.filter(_2).sort(N2);if(P.length){h(ae().staged.issuesFoundHeader);for(let Y of P)g.push(U2(Y));y()}if(ee.length){g.push(`### ${ae().configErrorsHeader}`);for(let Y of ee)g.push(U2(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"||!Kx(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(`
|