@sreetej510/pi-shipd-checks 0.1.29 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +16 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ The two finder flags are additive/combinable; `--config` must be used alone.
|
|
|
50
50
|
| `/analyze:on` | Enable the agent-callable Gap Finder tool for the current project |
|
|
51
51
|
| `/analyze:off` | Disable the agent-callable Gap Finder tool for the current project |
|
|
52
52
|
|
|
53
|
-
**Shortcut:** `Ctrl+Shift+X` cancels an in-progress `/checks` run.
|
|
53
|
+
**Shortcut:** `Ctrl+Shift+X` cancels an in-progress `/checks` run. Cancellation is propagated to active solver sessions and their spawned shell/test process trees; post-cancel verification, comparison, and artifact writing are skipped.
|
|
54
54
|
|
|
55
55
|
## Configuration
|
|
56
56
|
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
var
|
|
1
|
+
var th=Object.defineProperty;var Rt=(e,t)=>{for(var n in t)th(e,n,{get:t[n],enumerable:!0})};import{Container as rT,Key as aT,Spacer as oT,Text as vi}from"@earendil-works/pi-tui";import{randomUUID as Kf}from"node:crypto";import{copyFileSync as Wv,existsSync as zf,mkdirSync as Bf,rmSync as Hv,writeFileSync as Yv}from"node:fs";import{tmpdir as Vf}from"node:os";import{join as rt}from"node:path";import{getSettingsListTheme as Jv}from"@earendil-works/pi-coding-agent";import{Container as Xv,Key as zt,matchesKey as Bt,Spacer as Zv,Text as Wf}from"@earendil-works/pi-tui";import{createAgentSession as Oa,SessionManager as Pa}from"@earendil-works/pi-coding-agent";import{copyFileSync as ah,existsSync as no,lstatSync as oh,mkdirSync as ro,readFileSync as Ir,rmSync as Ni,symlinkSync as ih,unlinkSync as sh,writeFileSync as st}from"node:fs";import{join as he}from"node:path";import{createLocalBashOperations as mh}from"@earendil-works/pi-coding-agent";import{existsSync as Yt,mkdirSync as Ei,readFileSync as fr,writeFileSync as Si}from"node:fs";import{dirname as Ri,join as Oi}from"node:path";import{getAgentDir as Pi}from"@earendil-works/pi-coding-agent";var ft=Oi(Pi(),"checks-config.json"),dr=Oi(Pi(),"settings.json"),Ai=10,Ci=60,Ha=20,Ya=1,Mi=5,Ja=3,Xa=!0,qi=!1,nh=["off","minimal","low","medium","high","xhigh","max"];function Li(e){return e?.reasoning?nh.filter(t=>{let n=e.thinkingLevelMap?.[t];return n===null?!1:t==="xhigh"||t==="max"?n!==void 0:!0}):["off"]}function Te(){try{if(!Yt(ft))return null;let e=JSON.parse(fr(ft,"utf-8"));if(e.provider&&e.modelId&&e.thinkingLevel)return e}catch{}return null}function De(e){let t=Ri(ft);Yt(t)||Ei(t,{recursive:!0}),Si(ft,JSON.stringify(e,null,2),"utf-8")}function ji(){let e=Te()?.solverGap;return!e?.provider||!e.modelId||!e.thinkingLevel?null:{...e,timeoutMinutes:e.timeoutMinutes>0?e.timeoutMinutes:Ha,solverCount:e.solverCount>0?e.solverCount:Ja,saveArtifacts:typeof e.saveArtifacts=="boolean"?e.saveArtifacts:Xa}}function Za(){try{if(!Yt(ft))return{};let e=JSON.parse(fr(ft,"utf-8"));return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function Qa(){let e=Za().enabledProjects;return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function hr(e){let t=Za();return Array.isArray(t.enabledProjects)?t.enabledProjects.some(n=>n===e):Te()?.enableAnalyzeTool??qi}function gr(e,t){let n=new Set(Qa());t?n.add(e):n.delete(e);let r=[...n],a=Te();if(a){De({...a,enabledProjects:r});return}let i=Ri(ft);Yt(i)||Ei(i,{recursive:!0}),Si(ft,JSON.stringify({...Za(),enabledProjects:r},null,2),"utf-8")}function yr(e){return e!==void 0?hr(e):Te()?.enableAnalyzeTool??qi}function Fi(){let e=Te()?.analyzeGap;return!e?.provider||!e.modelId||!e.thinkingLevel?null:{...e}}function Di(){try{return Yt(dr)?JSON.parse(fr(dr,"utf-8")).enabledModels??[]:[]}catch{return[]}}function Gi(e){let t=e.indexOf("/");return t<=0||t===e.length-1?null:{provider:e.slice(0,t),modelId:e.slice(t+1)}}function rh(){try{if(Yt(dr))return JSON.parse(fr(dr,"utf-8"))}catch{}return{}}function xr(){let e=rh().shellPath;return e||(process.platform==="win32"?"C:\\Program Files\\Git\\bin\\bash.exe":"bash")}function eo(e){return e.replace(/\\/g,"/")}function to(e){return`'${e.replace(/'/g,"'\\''")}'`}async function br(e,t,n,r){if(r?.aborted)return{status:"error",error:"cancelled"};if((await e.exec("git",["rev-parse","HEAD"],{cwd:t,timeout:15e3,signal:r})).code!==0)return{status:"error",error:"Not a git repository, or it has no commits yet."};let i=`git archive HEAD | tar -x -C ${to(eo(n))}`,m=await e.exec(xr(),["-c",i],{cwd:t,timeout:6e4,signal:r});return m.code!==0?{status:"error",error:m.stderr?.trim()||`git archive failed (exit ${m.code})`}:{status:"ok"}}var ao=3e4,_i=4e3,ph=".pi/shipd-checks",kn="solver_gap_solutions";function uh(e){let t=new Set,n=/^diff --git "?a\/(.+?)"? "?b\/(.+?)"?$/gm;for(let r of e.matchAll(n))r[1]&&t.add(r[1]),r[2]&&t.add(r[2]);return[...t]}function Ui(e,t){return e.length>t?e.slice(e.length-t):e}async function Ki(e){let{pi:t,repoDir:n,solverDir:r,testPatchPath:a,agentPromptPath:i,cancelSignal:m}=e;if(m?.aborted)return{status:"error",solverDir:r,error:"cancelled"};let u=await br(t,n,r,m);if(u.status==="error")return{status:"error",solverDir:r,error:u.error};let l={cwd:r,timeout:ao,signal:m},f=await t.exec("git",["init"],l);if(f.code!==0)return{status:"error",solverDir:r,error:f.stderr?.trim()||"git init failed"};await t.exec("git",["config","user.email","solvergap@shipd-checks.local"],l),await t.exec("git",["config","user.name","shipd-checks solver-gap-finder"],l);let h=await t.exec("git",["add","-A"],l);if(h.code!==0)return{status:"error",solverDir:r,error:h.stderr?.trim()||"git add (baseline) failed"};let v=await t.exec("git",["commit","-m","baseline","--allow-empty"],l);if(v.code!==0)return{status:"error",solverDir:r,error:v.stderr?.trim()||"git commit (baseline) failed"};let E=he(r,".gitignore"),A=no(E)?Ir(E,"utf-8"):"";if(!A.split(/\r?\n/).some(pe=>pe.trim()==="node_modules")){let pe=A.length>0&&!A.endsWith(`
|
|
2
2
|
`)?`
|
|
3
|
-
`:"";
|
|
4
|
-
`,"utf-8")}let A=fe(n,"node_modules"),H=fe(r,"node_modules");if(Qa(A)&&!Qa(H))try{rh(A,H,process.platform==="win32"?"junction":"dir")}catch{}try{th(i,fe(r,"agent_prompt.md"))}catch{}let te=Ir(a,"utf-8"),ne=sh(te),ue=fe(r,"test.patch");ot(ue,te,"utf-8");let tt=await t.exec("git",["apply","test.patch"],u);try{ah(ue)}catch{}if(tt.code!==0)return{status:"patchFailed",solverDir:r,error:tt.stderr?.trim()||"git apply test.patch failed"};let N=await t.exec("git",["add","-A"],u);if(N.code!==0)return{status:"error",solverDir:r,error:N.stderr?.trim()||"git add (tests applied) failed"};let nt=await t.exec("git",["commit","-m","tests applied","--allow-empty"],u);if(nt.code!==0)return{status:"error",solverDir:r,error:nt.stderr?.trim()||"git commit (tests applied) failed"};let _e=await t.exec("git",["rev-parse","HEAD"],u);return _e.code!==0||!_e.stdout.trim()?{status:"error",solverDir:r,error:"Could not resolve tests-applied commit hash."}:{status:"ok",solverDir:r,testsAppliedCommit:_e.stdout.trim(),testPatchPaths:ne}}function ph(e){try{let t=Ir(e,"utf-8").match(/<testsuites\b[^>]*>/i)?.[0];if(!t)return{totalTests:null,failedTests:null};let n=m=>Number.parseInt(t.match(new RegExp(`\\b${m}="(\\d+)"`,"i"))?.[1]??"",10),r=n("tests"),a=n("failures"),i=n("errors");return{totalTests:Number.isFinite(r)?r:null,failedTests:Number.isFinite(a)?a+(Number.isFinite(i)?i:0):null}}catch{return{totalTests:null,failedTests:null}}}async function _i(e){let{pi:t,index:n,workspace:r,status:a,durationMs:i}=e,{solverDir:m,testsAppliedCommit:u,testPatchPaths:l}=r,f={cwd:m,timeout:to};await t.exec("git",["add","-A"],f);let h=[...l,"agent_prompt.md"].map(_e=>`:(exclude)${_e}`),$=await t.exec("git",["diff","--cached",u,"--",".",...h],f),E=$.code===0?$.stdout:"",A=fe(m,"test_output.xml"),H=`bash test.sh --output_path ${yr(gr(A))} new`,te=hr(),ne=await t.exec(te,["-c",`cd ${yr(gr(m))} && ${H}`],{timeout:to*10}),ue=ne.code===0,tt=mh(`${ne.stdout}
|
|
5
|
-
${ne.stderr}`.trim(),oh),{totalTests:N,failedTests:nt}=ph(A);return{index:n,status:a,passed:ue,diff:E,testOutputTail:tt,durationMs:i,totalTests:N,failedTests:nt,testOutputXmlPath:A}}function Ui(e){let{repoDir:t,runId:n,index:r,trajectory:a,solutionPatch:i,testOutputXmlPath:m,testOutputTail:u}=e,l=fe(t,ih,n,`solver_${r}`);eo(l,{recursive:!0}),ot(fe(l,"trajectory.json"),JSON.stringify(a,null,2),"utf-8"),ot(fe(l,"solution.patch"),i,"utf-8");try{let f=Ir(m,"utf-8");ot(fe(l,"test_output.xml"),f,"utf-8")}catch{ot(fe(l,"test_output.txt"),u,"utf-8")}return l}function Ki(e,t){let n=fe(e,vn);eo(n,{recursive:!0});let r=t.map(a=>{let i=fe(n,`solver_${a.index}`);return eo(i,{recursive:!0}),ot(fe(i,"solution.diff"),a.diff,"utf-8"),ot(fe(i,"test_output.txt"),a.testOutputTail,"utf-8"),{index:a.index,status:a.status,passed:a.passed}});return ot(fe(n,"manifest.json"),JSON.stringify(r,null,2),"utf-8"),n}function zi(e){let t=fe(e,"node_modules");try{nh(t).isSymbolicLink()&&Gi(t,{force:!0})}catch{}try{Gi(e,{recursive:!0,force:!0})}catch{}}var p={};St(p,{Assign:()=>uh,Clone:()=>wn,Create:()=>gg,Discard:()=>yg,Metrics:()=>De,Update:()=>xg});var De={assign:0,create:0,clone:0,discard:0,update:0};function uh(e,t){return De.assign+=1,{...e,...t}}var s={};St(s,{Entries:()=>Ah,EntriesRegExp:()=>Ph,Every:()=>Rh,EveryAll:()=>Sh,GraphemeCount:()=>kh,HasPropertyKey:()=>Oh,IsArray:()=>Tn,IsBigInt:()=>$n,IsBoolean:()=>Qi,IsClassInstance:()=>$h,IsConstructor:()=>gh,IsDeepEqual:()=>oo,IsEqual:()=>M,IsFunction:()=>es,IsGreaterEqualThan:()=>ns,IsGreaterThan:()=>Ih,IsInteger:()=>ro,IsLessEqualThan:()=>ts,IsLessThan:()=>bh,IsMaxLength:()=>wh,IsMinLength:()=>Eh,IsMultipleOf:()=>vh,IsNull:()=>$r,IsNumber:()=>Tr,IsObject:()=>kn,IsObjectNotArray:()=>yh,IsString:()=>kr,IsSymbol:()=>xh,IsUndefined:()=>ao,IsUnsafePropertyKey:()=>rs,IsValueLike:()=>Th,Keys:()=>vr,ShiftLeft:()=>wr,Symbols:()=>Ch,Values:()=>Mh});function Ot(e,t,n){return e>=t&&e<=n}function ch(e){return e===8205}function lh(e){return Ot(e,55296,56319)}function Bi(e){return Ot(e,127462,127487)}function Wi(e){return Ot(e,65024,65039)}function Hi(e){return Ot(e,768,879)||Ot(e,6832,6911)||Ot(e,7616,7679)||Ot(e,65056,65071)}function br(e){return e>65535?2:1}function Vi(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(Hi(n)||Wi(n))t+=br(n);else break}return t}function no(e,t){let n=e.codePointAt(t),r=t+br(n);for(r=Vi(e,r);r<e.length-1&&e[r]==="\u200D";){let a=e.codePointAt(r+1);r+=1+br(a),r=Vi(e,r)}return Bi(n)&&r<e.length&&Bi(e.codePointAt(r))&&(r+=br(e.codePointAt(r))),r}function Yi(e){return lh(e)||Hi(e)||Wi(e)||ch(e)}function Ji(e){let t=0,n=0;for(;n<e.length;)n=no(e,n),t++;return t}function dh(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=no(e,r),n++,n>=t)return!0;return!1}function fh(e,t){let n=0,r=0;for(;r<e.length;)if(r=no(e,r),n++,n>t)return!1;return!0}function Zi(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Yi(e.charCodeAt(n)))return dh(e,t);if(n++,n>=t)return!0}return!1}function Xi(e,t){let n=0;for(;n<e.length;){if(Yi(e.charCodeAt(n)))return fh(e,t);if(n++,n>t)return!1}return!0}function Tn(e){return Array.isArray(e)}function $n(e){return M(typeof e,"bigint")}function Qi(e){return M(typeof e,"boolean")}function gh(e){if(ao(e)||!es(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function es(e){return M(typeof e,"function")}function ro(e){return Number.isInteger(e)}function $r(e){return M(e,null)}function Tr(e){return Number.isFinite(e)}function yh(e){return kn(e)&&!Tn(e)}function kn(e){return M(typeof e,"object")&&!$r(e)}function kr(e){return M(typeof e,"string")}function xh(e){return M(typeof e,"symbol")}function ao(e){return M(e,void 0)}function M(e,t){return e===t}function Ih(e,t){return e>t}function bh(e,t){return e<t}function ts(e,t){return e<=t}function ns(e,t){return e>=t}function vh(e,t){if($n(e)||$n(t))return BigInt(e)%BigInt(t)===0n;let n=1e-10;if(!Tr(e)||ro(e)&&1/t%1===0)return!0;let r=e%t;return Math.min(Math.abs(r),Math.abs(r-t),Math.abs(r+t))<n}function $h(e){if(!kn(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return $r(t)?!1:M(typeof t.constructor,"function")&&!(M(t.constructor,globalThis.Object)||M(t.constructor.name,"Object"))}function Th(e){return $n(e)||Qi(e)||$r(e)||Tr(e)||kr(e)||ao(e)}function kh(e){return Ji(e)}function wh(e,t){return Xi(e,t)}function Eh(e,t){return Zi(e,t)}function Rh(e,t,n){for(let r=t;r<e.length;r++)if(!n(e[r],r))return!1;return!0}function Sh(e,t,n){let r=!0;for(let a=t;a<e.length;a++)n(e[a],a)||(r=!1);return r}function wr(e,t,n){return M(e.length,0)?n():t(e[0],e.slice(1))}function rs(e){return M(e,"__proto__")||M(e,"constructor")||M(e,"prototype")}function Oh(e,t){return rs(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Ph(e){return vr(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function Ah(e){return Object.entries(e)}function vr(e){return Object.getOwnPropertyNames(e)}function Ch(e){return Object.getOwnPropertySymbols(e)}function Mh(e){return Object.values(e)}function Lh(e,t){if(!kn(t))return!1;let n=vr(e);return M(n.length,vr(t).length)&&n.every(r=>oo(e[r],t[r]))}function qh(e,t){return Tn(t)&&M(e.length,t.length)&&e.every((n,r)=>oo(e[r],t[r]))}function oo(e,t){return Tn(e)?qh(e,t):kn(e)?Lh(e,t):M(e,t)}var ht={};St(ht,{IsBigInt64Array:()=>Jh,IsBigUint64Array:()=>Zh,IsBoolean:()=>Fh,IsDate:()=>Qh,IsFloat32Array:()=>Hh,IsFloat64Array:()=>Yh,IsInt16Array:()=>zh,IsInt32Array:()=>Vh,IsInt8Array:()=>_h,IsMap:()=>tg,IsNumber:()=>Dh,IsRegExp:()=>Xh,IsSet:()=>eg,IsString:()=>Gh,IsTypeArray:()=>Nh,IsUint16Array:()=>Bh,IsUint32Array:()=>Wh,IsUint8Array:()=>Uh,IsUint8ClampedArray:()=>Kh});function Fh(e){return e instanceof Boolean}function Dh(e){return e instanceof Number}function Gh(e){return e instanceof String}function Nh(e){return globalThis.ArrayBuffer.isView(e)}function _h(e){return e instanceof globalThis.Int8Array}function Uh(e){return e instanceof globalThis.Uint8Array}function Kh(e){return e instanceof globalThis.Uint8ClampedArray}function zh(e){return e instanceof globalThis.Int16Array}function Bh(e){return e instanceof globalThis.Uint16Array}function Vh(e){return e instanceof globalThis.Int32Array}function Wh(e){return e instanceof globalThis.Uint32Array}function Hh(e){return e instanceof globalThis.Float32Array}function Yh(e){return e instanceof globalThis.Float64Array}function Jh(e){return e instanceof globalThis.BigInt64Array}function Zh(e){return e instanceof globalThis.BigUint64Array}function Xh(e){return e instanceof globalThis.RegExp}function Qh(e){return e instanceof globalThis.Date}function eg(e){return e instanceof globalThis.Set}function tg(e){return e instanceof globalThis.Map}function rg(e){return s.HasPropertyKey(e,"~kind")||s.HasPropertyKey(e,"~unsafe")}function ag(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let r of Object.keys(n)){if(s.IsUnsafePropertyKey(r))continue;let a=n[r];s.HasPropertyKey(a,"value")&&Object.defineProperty(t,r,{...a,value:Pt(a.value)})}return t}function og(e){let t={};for(let n of s.Keys(e))s.IsUnsafePropertyKey(n)||(t[n]=Pt(e[n]));for(let n of s.Symbols(e))t[n]=Pt(e[n]);return t}function ig(e){return s.IsClassInstance(e)?e:rg(e)?ag(e):og(e)}function sg(e){return e.map(t=>Pt(t))}function mg(e){return e.slice()}function pg(e){return new RegExp(e.source,e.flags)}function ug(e){return new Map(Pt([...e.entries()]))}function cg(e){return new Set(Pt([...e.values()]))}function Pt(e){return ht.IsTypeArray(e)?mg(e):ht.IsRegExp(e)?pg(e):ht.IsMap(e)?ug(e):ht.IsSet(e)?cg(e):s.IsArray(e)?sg(e):s.IsObject(e)?ig(e):e}function wn(e){return De.clone+=1,Pt(e)}var At={};St(At,{Get:()=>fg,Reset:()=>lg,Set:()=>dg});var it={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function lg(){it.immutableTypes=!1,it.maxErrors=8,it.useAcceleration=!0,it.exactOptionalPropertyTypes=!1,it.enumerableKind=!1,it.correctiveParse=!1,it.unionPrioritySort=!0}function dg(e){for(let t of s.Keys(e)){let n=e[t];n!==void 0&&Object.defineProperty(it,t,{value:n})}}function fg(){return it}function hg(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function as(e,t){return{...e,...t}}function gg(e,t,n={}){De.create+=1;let r=At.Get(),a=as(t,n),i=r.enumerableKind?as(a,e):hg(a,e);return r.immutableTypes?Object.freeze(i):i}function yg(e,t){De.discard+=1;let n={},r=Object.getOwnPropertyDescriptors(wn(e)),a=new Set(t);for(let i of Object.keys(r))a.has(i)||Object.defineProperty(n,i,r[i]);return n}function xg(e,t,n){De.update+=1;let r=At.Get(),a=wn(e);for(let i of Object.keys(t))Object.defineProperty(a,i,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[i]});for(let i of Object.keys(n))Object.defineProperty(a,i,{configurable:!0,enumerable:!0,writable:!0,value:n[i]});return a}function y(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function re(e){return s.IsObject(e)}function I(e,t,n){return p.Create({"~kind":"Deferred"},{type:"deferred",action:e,parameters:t,options:n},{})}function gt(e){return y(e,"Deferred")}function Ig(e){return p.Update(e,{"~readonly":!0},{})}function En(e,t){return p.Update(Ig(e),{},t)}function os(e,t,n,r){let a=d(e,t,n);return En(a,r)}function bg(e){return p.Update(e,{"~optional":!0},{})}function Rn(e,t){return p.Update(bg(e),{},t)}function is(e,t,n,r){let a=d(e,t,n);return Rn(a,r)}function Re(e,t){return p.Create({"~kind":"Array"},{type:"array",items:e},t)}function K(e){return y(e,"Array")}function Er(e){return p.Discard(e,["~kind","type","items"])}function Ue(e,t,n={}){return p.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},n)}function oe(e){return y(e,"Constructor")}function ss(e){return p.Discard(e,["~kind","type","parameters","instanceType"])}function Ke(e,t,n={}){return p.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},n)}function ie(e){return y(e,"Function")}function ms(e){return p.Discard(e,["~kind","type","parameters","returnType"])}function st(e,t){return p.Create({"~kind":"Ref"},{$ref:e},t)}function se(e){return y(e,"Ref")}function yt(e,t){return p.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Ht(e){return y(e,"Generic")}function Yt(e){return p.Create({"~kind":"Any"},{},e)}function Z(e){return y(e,"Any")}var ps="(?!)";function F(e){return p.Create({"~kind":"Never"},{not:{}},e)}function xt(e){return y(e,"Never")}function ze(e,t={}){return I("AddOptional",[e],t)}function Ct(e,t={}){return Rn(e,t)}function us(e){return Ct(e)}function he(e){return re(e)&&s.HasPropertyKey(e,"~optional")}function cs(e){return s.Keys(e).filter(t=>!he(e[t]))}function Rr(e){return s.Keys(e)}function Sr(e){return s.Values(e)}function v(e,t={}){let n=cs(e),r=n.length>0?{required:n}:{};return p.Create({"~kind":"Object"},{type:"object",...r,properties:e},t)}function L(e){return y(e,"Object")}function ls(e){return p.Discard(e,["~kind","type","properties","required"])}function me(e){return p.Create({"~kind":"Unknown"},{},e)}function ae(e){return y(e,"Unknown")}function Be(e,t,n){let r=s.Keys(e).reduce((a,i)=>({...a,[i]:p.Update(e[i],{},{$id:i})}),{});return p.Create({"~kind":"Cyclic"},{$defs:r,$ref:t},n)}function ce(e){return y(e,"Cyclic")}function ds(e){return p.Update(e,{"~unsafe":null},{})}function Or(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"~unsafe")&&s.IsNull(e["~unsafe"])}var Ve={};St(Ve,{Match:()=>vg});function vg(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Sn(...e){let[t,n]=Ve.Match(e,{2:(r,a)=>[r,a,a],1:r=>[r,me(),me()]});return p.Create({"~kind":"Infer"},{type:"infer",name:t,extends:n},{})}function Y(e){return y(e,"Infer")}function Mt(e,t,n,r={}){return p.Create({"~kind":"Dependent"},{if:e,then:t,else:n},r)}function V(e){return y(e,"Dependent")}function fs(e){return p.Discard(e,["~kind","if","then","else"])}function hs(e){return s.IsObjectNotArray(e)}function gs(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,r)=>[...n,e[r]],[])}function ys(e){return s.IsString(e)||s.IsNumber(e)}function xs(e,t){let n=hs(e)?gs(e):e;return p.Create({"~kind":"Enum"},{enum:n},t)}function ye(e){return y(e,"Enum")}function ge(e,t={}){return p.Create({"~kind":"Intersect"},{allOf:e},t)}function O(e){return y(e,"Intersect")}function Is(e){return p.Discard(e,["~kind","allOf"])}function J(){throw new Error("Unreachable")}var bs;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(bs||(bs={}));var vk=BigInt("14695981039346656037"),[$k,Tk]=[BigInt("1099511628211"),BigInt("18446744073709551616")],kk=Array.from({length:256}).map((e,t)=>BigInt(t)),vs=new Float64Array(1),wk=new DataView(vs.buffer),Ek=new Uint8Array(vs.buffer);var Rk=new TextEncoder;var On=class{constructor(t,n){this.type=t,this.decode=n}Encode(t){let n=this.type,r=Pr(n)?m=>this.decode(n["~codec"].decode(m)):this.decode,a=Pr(n)?m=>n["~codec"].encode(t(m)):t,i={decode:r,encode:a};return p.Update(this.type,{"~codec":i},{})}},Pn=class{constructor(t){this.type=t}Decode(t){return new On(this.type,t)}};function Ar(e){return new Pn(e)}function Ts(e,t){return Ar(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function ks(e,t){return Ar(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function Pr(e){return re(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function ws(e){return Jt(e)}function Lt(e){return re(e)&&s.HasPropertyKey(e,"~immutable")}function We(e,t={}){return I("AddReadonly",[e],t)}function qt(e,t={}){return En(e,t)}function Es(e){return qt(e)}function jt(e){return re(e)&&s.HasPropertyKey(e,"~readonly")}function wg(e,t){let n=io(e)?[...e["~refine"],t]:[t];return p.Update(e,{"~refine":n},{})}function Rs(...e){let[t,n,r]=Ve.Match(e,{3:(a,i,m)=>[a,i,m],2:(a,i)=>[a,i,()=>"Refine Error"]});return wg(t,{check:n,error:r})}function Eg(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"error")&&s.IsFunction(e.check)&&s.IsFunction(e.error)}function io(e){return re(e)&&s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>Eg(t))}var Ss="-?(?:0|[1-9][0-9]*)n";function An(e){return p.Create({"~kind":"BigInt"},{type:"bigint"},e)}function He(e){return y(e,"BigInt")}function Cr(e){return p.Create({"~kind":"Boolean"},{type:"boolean"},e)}function Ae(e){return y(e,"Boolean")}function Cn(e){return p.Create({"~kind":"Identifier"},{name:e})}function Os(e){return y(e,"Identifier")}var Mr="-?(?:0|[1-9][0-9]*)";function Ft(e){return p.Create({"~kind":"Integer"},{type:"integer"},e)}function xe(e){return y(e,"Integer")}var so=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function Rg(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new so(e)})()}function P(e,t){return p.Create({"~kind":"Literal"},{type:Rg(e),const:e},t)}function Lr(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function Ps(e){return q(e)&&s.IsNumber(e.const)}function As(e){return q(e)&&s.IsString(e.const)}function q(e){return y(e,"Literal")}function Zt(e){return p.Create({"~kind":"Null"},{type:"null"},e)}function Xt(e){return y(e,"Null")}var qr="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function ke(e){return p.Create({"~kind":"Number"},{type:"number"},e)}function X(e){return y(e,"Number")}function Qt(e){return p.Create({"~kind":"Symbol"},{type:"symbol"},e)}function It(e){return y(e,"Symbol")}function Dt(...e){let[t,n,r]=Ve.Match(e,{3:(a,i,m)=>[a,i,m],2:(a,i)=>[a,i,i],1:a=>[a,me(),me()]});return p.Create({"~kind":"Parameter"},{name:t,extends:n,equals:r},{})}function Cs(e){return y(e,"Parameter")}var jr=".*";function Ce(e){return p.Create({"~kind":"String"},{type:"string"},e)}function Ie(e){return y(e,"String")}function w(e,t={}){return p.Create({"~kind":"Union"},{anyOf:e},t)}function x(e){return y(e,"Union")}function Ms(e){return p.Discard(e,["~kind","anyOf"])}function Mn(e){let t=Ls(e);return s.IsEqual(t.length,2)?t[0]:[]}function Sg(e){return!0}function qs(e){return s.ShiftLeft(e,(t,n)=>Og(t)?qs(n):!1,()=>!0)}function js(e){return s.IsEqual(e.length,0)?!1:qs(e)}function Og(e){return x(e)?js(e.anyOf):q(e)?Sg(e.const):!1}function Fr(e){return js(e)}function Dr(e){return p.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function Fs(e,t,n=[]){return s.ShiftLeft(e,(r,a)=>Fs(a,t,[...n,`${r}${t}`]),()=>n)}function Pg(e,t){return s.IsEqual(e.length,0)?[`${t}`]:Fs(e,t)}function Ds(e,t,n=[]){return s.ShiftLeft(t,(r,a)=>Ds(e,a,[...n,...Gs(e,r)]),()=>n)}function Gs(e,t){return x(t)?Ds(e,t.anyOf):q(t)?Pg(e,t.const):J()}function Ns(e,t){return s.ShiftLeft(t,(n,r)=>Ns(Gs(e,n),r),()=>e)}function Ag(e){return e.map(t=>P(t))}function Cg(e){let t=Ns([],e),n=Ag(t);return w(n)}function Mg(e){return s.IsEqual(e.length,0)?J():s.IsEqual(e.length,1)&&q(e[0])?e[0]:Cg(e)}function mo(e){let t=Mn(e);return s.IsEqual(t.length,0)?Ce():Fr(t)?Mg(t):Dr(e)}function _s(e){let t=mo(e);return Q(t)?Ce():t}function $e(e,t){let n="object",r={[e]:t};return p.Create({"~kind":"Record"},{type:n,patternProperties:r})}function Us(e){return $e(Ge,e)}function Ks(e){return v({true:e,false:e})}function ee(e,t={}){let[n,r,a]=[e,e.length,!1];return p.Create({"~kind":"Tuple"},{type:"array",additionalItems:a,items:n,minItems:r},t)}function G(e){return y(e,"Tuple")}function zs(e){return p.Discard(e,["~kind","type","items","minItems","additionalItems"])}function Lg(e){return p.Discard(e,["~readonly"])}function po(e,t){return p.Update(Lg(e),{},t)}function Bs(e,t,n,r){let a=d(e,t,n);return po(a,r)}function Vs(e,t={}){return I("RemoveReadonly",[e],t)}function Ws(e,t={}){return po(e,t)}function qg(e){return p.Discard(e,["~optional"])}function uo(e,t){return p.Update(qg(e),{},t)}function Hs(e,t,n,r){let a=d(e,t,n);return uo(a,r)}function Ys(e,t={}){return I("RemoveOptional",[e],t)}function Gr(e,t={}){return uo(e,t)}function co(e){return e.reduceRight((n,r,a)=>({[a]:r,...n}),{})}function Js(e){let t=co(e.items);return v(t)}function jg(e,t){return jt(e)?!!jt(t):!1}function Fg(e,t){return he(e)?!!he(t):!1}function Dg(e,t){let n=jg(e,t),r=Fg(e,t),a=z([e,t]),i=Ws(Gr(a));return n&&r?qt(Ct(i)):n&&!r?qt(i):!n&&r?Ct(i):i}function Gg(e,t,n){return n in e?n in t?Dg(e[n],t[n]):e[n]:n in t?t[n]:F()}function Ng(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((r,a)=>({...r,[a]:Gg(e,t,a)}),{})}function Zs(e){return L(e)?e.properties:G(e)?co(e.items):J()}function Xs(e,t){let n=Zs(e),r=Zs(t),a=Ng(n,r);return v(a)}function Qs(e,t){let n=en(e,t);return s.IsEqual(n,qn)?e:s.IsEqual(n,jn)||s.IsEqual(n,Ln)?t:F()}function em(e){return L(e)||G(e)}function _g(e,t){let n=x(e),r=x(t);return n||r}function Ug(e,t){let n=Me(e),r=Me(t),a=_g(n,r),i=em(n),m=em(r);return a?z([n,r]):i&&m?Xs(n,r):i&&!m?n:!i&&m?r:Qs(n,r)}function tm(e,t,n=[]){return s.ShiftLeft(t,(r,a)=>tm(e,a,[...n,Ug(e,r)]),()=>s.IsEqual(n.length,0)?[e]:n)}function nm(e,t,n=[]){return s.ShiftLeft(e,(r,a)=>nm(a,t,[...n,...Fn([r],t)]),()=>n)}function Fn(e,t=[]){return s.ShiftLeft(e,(n,r)=>x(n)?Fn(r,nm(n.anyOf,t)):Fn(r,tm(n,t)),()=>t)}function Kg(e,t){let n=le({},e,t);return b.IsExtendsTrueLike(n)?[]:[e]}function zg(e,t){return e.reduce((n,r)=>[...n,...Kg(r,t)],[])}function Nr(e,t){let n=Me(e),r=x(n)?n.anyOf:[n],a=zg(r,t);return we(a)}function Ne(e,t,n){let r=ge([e,t]),a=Nr(n,e);return we([r,a])}function Se(e){let t=e.map(n=>P(n));return we(t)}function z(e){let t=Fn(e),n=lo(t);return mt(n)}function Te(e){let t=_s(e);return Me(t)}function we(e){let t=lo(e);return mt(t)}function Me(e){return V(e)?Ne(e.if,e.then,e.else):ye(e)?Se(e.enum):O(e)?z(e.allOf):Q(e)?Te(e.pattern):x(e)?we(e.anyOf):e}function mt(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?F():w(e)}function rm(e,t){let n=Se(e);return bt(n,t)}function am(e,t){return $e(vt,t)}function om(e,t){let n=z(e);return bt(n,t)}function im(e,t){return s.IsString(e)||s.IsNumber(e)?v({[e]:t}):s.IsEqual(e,!1)?v({false:t}):s.IsEqual(e,!0)?v({true:t}):v({})}function sm(e,t){return $e(tn,t)}function mm(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?$e(e.pattern.toString(),t):$e(Ge,t)}function pm(e,t){let n=Mn(e);return Fr(n)?bt(Te(e),t):$e(e,t)}function Bg(e){return x(e)?Dn(e.anyOf):[e]}function Dn(e){return e.reduce((t,n)=>[...t,...Bg(n)],[])}function Vg(e){return e.some(t=>Ie(t)||X(t)||xe(t))}function Wg(e,t){return s.IsEqual(Vg(e),!0)?$e(Ge,t):void 0}function Hg(e,t){return e.reduce((n,r)=>q(r)&&(s.IsString(r.const)||s.IsNumber(r.const))?{...n,[r.const]:t}:n,{})}function Yg(e,t){let n=Hg(e,t);return v(n)}function um(e,t){let n=Dn(e),r=Wg(n,t);return re(r)?r:Yg(n,t)}function bt(e,t){return Z(e)?Us(t):Ae(e)?Ks(t):ye(e)?rm(e.enum,t):xe(e)?am(e,t):O(e)?om(e.allOf,t):q(e)?im(e.const,t):X(e)?sm(e,t):x(e)?um(e.anyOf,t):Ie(e)?mm(e,t):Q(e)?pm(e.pattern,t):v({})}function fo(e,t,n){return k([e])?p.Update(bt(e,t),{},n):_r(e,t,n)}function cm(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return fo(i,m,a)}var vt=`^${Mr}$`,tn=`^${qr}$`,Ge=`^${jr}$`;function _r(e,t,n={}){return I("Record",[e,t],n)}function Ur(e,t,n={}){return fo(e,t,n)}function lm(e,t){return $e(e,t)}function Kr(e){return s.IsEqual(e,Ge)?Ce():s.IsEqual(e,vt)?Ft():s.IsEqual(e,tn)?ke():mo(e)}function Le(e){return s.Keys(e.patternProperties)[0]}function nn(e){let t=Le(e);return Kr(t)}function be(e){return e.patternProperties[Le(e)]}function de(e){return y(e,"Record")}function Gt(e){return p.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function $t(e){return y(e,"Rest")}function zr(e){return p.Create({"~kind":"This"},{$ref:"#"},e)}function Br(e){return y(e,"This")}function rn(e){return p.Create({"~kind":"Undefined"},{type:"undefined"},e)}function an(e){return y(e,"Undefined")}function Vr(e){return p.Create({"~kind":"Void"},{type:"void"},e)}function Ye(e){return y(e,"Void")}function Zg(e,t){return s.IsEqual(e,"Array")?Re(t[0]):s.IsEqual(e,"Capitalize")?Hr(t[0]):s.IsEqual(e,"ConstructorParameters")?Qr(t[0]):s.IsEqual(e,"Evaluate")?fu(t[0]):s.IsEqual(e,"Exclude")?ea(t[0],t[1]):s.IsEqual(e,"Extract")?ta(t[0],t[1]):s.IsEqual(e,"Index")?Un(t[0],t[1]):s.IsEqual(e,"InstanceType")?na(t[0]):s.IsEqual(e,"Lowercase")?Yr(t[0]):s.IsEqual(e,"NonNullable")?ra(t[0]):s.IsEqual(e,"Omit")?aa(t[0],t[1]):s.IsEqual(e,"Parameters")?oa(t[0]):s.IsEqual(e,"Partial")?ia(t[0]):s.IsEqual(e,"Pick")?sa(t[0],t[1]):s.IsEqual(e,"Readonly")?ma(t[0]):s.IsEqual(e,"KeyOf")?Kn(t[0]):s.IsEqual(e,"Record")?_r(t[0],t[1]):s.IsEqual(e,"Required")?pa(t[0]):s.IsEqual(e,"ReturnType")?ua(t[0]):s.IsEqual(e,"Uncapitalize")?Jr(t[0]):s.IsEqual(e,"Uppercase")?Zr(t[0]):_n(st(e),t)}function Nt(){throw Error("Unreachable")}var Xg=(e,t=[])=>e.reduce((n,r)=>s.IsArray(r)&&s.IsEqual(r.length,2)?[...n,r[0]]:[...n,r],[]),pt=e=>{let[t,n]=e;return Xg([...t,...n])};function ym(e){return Dt(e[0],e[2],e[4])}function xm(e){return Dt(e[0],e[2],e[2])}function Im(e){return Dt(e[0],me(),e[2])}function bm(e){return Dt(e,me(),me())}function vm(e){return pt(e)}function $m(e){return e[1]}function Tm(e){return pt(e)}function km(e){return e[1]}function wm(e){return Zg(e[0],e[1])}function Em(e){return null}function Rm(e){return Ce()}function Sm(e){return ke()}function Om(e){return Cr()}function Pm(e){return rn()}function Am(e){return Zt()}function Cm(e){return Ft()}function Mm(e){return An()}function Lm(e){return me()}function qm(e){return Yt()}function jm(e){return v({})}function Fm(e){return F()}function Dm(e){return Qt()}function Gm(e){return Vr()}function Nm(e){return zr()}function _m(e){return P(BigInt(e))}function Um(e){return P(s.IsEqual(e,"true"))}function Km(e){return P(parseFloat(e))}function zm(e){return P(e)}function Bm(e){return e[1]}function Vm(e){return P(e)}function Wm(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function Hm(e){return e[1]}function Ym(e){return Wr(e)}function Jm(e){return s.IsEqual(e.length,6)?Mt(e[1],e[3],e[5]):Mt(e[1],e[3],me())}function Zm(e){return e.length>0}function Xm(e){return e.reduce((t,n)=>s.IsEqual(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function Qm(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function ep(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}function tp(e){return s.IsEqual(e.length,2)?e[1]:[]}function dm(e,t){return t.reduce((n,r)=>{let a=r;return s.IsEqual(a.length,1)?Un(n,a[0]):s.IsEqual(a.length,0)?Re(n):Nt()},e)}function fm(e,t){return s.IsEqual(t.length,3)?Xr(e,t[0],t[1],t[2]):e}function Qg(e,t){return s.IsArray(t)&&s.IsEqual(t.length,0)?e:ca(e,t)}function np(e){let[t,n,r,a,i]=e;return Qg(fm(t?Kn(dm(n,r)):dm(n,r),a),i)}function ho(e,t){return s.IsEqual(t.length,3)?(()=>{let[n,r,a]=t,i=ho(r,a);if(s.IsEqual(n,"&"))return O(i)?ge([e,...i.allOf]):ge([e,i]);if(s.IsEqual(n,"|"))return x(i)?w([e,...i.anyOf]):w([e,i]);Nt()})():e}function rp(e){let[t,n]=e;return ho(t,n)}function ap(e){let[t,n]=e;return ho(t,n)}function op(e){return du(e[1])}function ip(e){return e[1]}function sp(e){return yt(e[0],e[2])}function mp(e){return s.IsEqual(e.length,4)?Sn(e[1],e[3]):s.IsEqual(e.length,2)?Sn(e[1],me()):Nt()}function pp(e){return`${e}`}function up(e){return xe(e[3])?vt:X(e[3])?tn:It(e[3])?Ge:Ie(e[3])?Ge:Nt()}function cp(e){return e.length>0}function lp(e){return e.length>0}function dp(e){let[t,n,r,a,i]=e;return{[n]:t&&r?We(ze(i)):t&&!r?We(i):!t&&r?ze(i):i}}function fp(e){return pt(e)}function hp(e){return e.reduce((t,n)=>s.HasPropertyKey(n,vt)||s.HasPropertyKey(n,tn)||s.HasPropertyKey(n,Ge)?[t[0],p.Assign(t[1],n)]:[p.Assign(t[0],n),t[1]],[{},{}])}function gp(e){return hp(e[1])}function yp(e){let[t,n]=e,r=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return v(t,r)}function xp(e){return s.IsEqual(e.length,5)?We(ze(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?We(e[3]):ze(e[3]):Nt()}function Ip(e){return We(ze(e[1]))}function bp(e){return We(e[1])}function vp(e){return ze(e[0])}function $p(e){return s.IsEqual(e.length,2)?Gt(e[1]):s.IsEqual(e.length,1)?e[0]:Nt()}function Tp(e){return pt(e)}function kp(e){return ee(e[1])}function wp(e){return We(ze(e[4]))}function Ep(e){return We(e[3])}function Rp(e){return ze(e[3])}function Sp(e){return e[2]}function Op(e){return s.IsEqual(e.length,2)?Gt(e[1]):s.IsEqual(e.length,1)?e[0]:Nt()}function Pp(e){return pt(e)}function Ap(e){return Ke(e[1],e[4])}function Cp(e){return Ue(e[2],e[5])}function hm(e,t){return s.IsEqual(e,"remove")?Vs(t):s.IsEqual(e,"add")?We(t):t}function Mp(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function gm(e,t){return s.IsEqual(e,"remove")?Ys(t):s.IsEqual(e,"add")?ze(t):t}function Lp(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function qp(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function jp(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?Gn(Cn(e[3]),e[5],e[6][0],hm(e[1],gm(e[8],e[10]))):Gn(Cn(e[3]),e[5],st(e[3]),hm(e[1],gm(e[8],e[10])))}function Fp(e){return st(e)}function Dp(e){return BigInt(e)}function Gp(e){return parseFloat(e)}function Np(e){return s.IsEqual(e,"true")}function _p(e){return null}function Up(e){return{[e[0]]:e[2]}}function Kp(e){return pt(e)}function ey(e){return e.reduce((t,n)=>p.Assign(t,n),{})}function zp(e){return ey(e[1])}function Bp(e){return pt(e)}function Vp(e){return e[1]}function Wp(e){return An()}function Hp(e){return Ce()}function Yp(e){return ke()}function Jp(e){return Ft()}function Zp(e){return F()}function Xp(e){return P(e)}function Qp(e){return w(e[1])}function eu(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function tu(e){return[e[0],...e[1]]}function nu(e){return e[1]}function ru(e){return pt(e)}function au(e){return s.IsEqual(e.length,2)?e[1]:[]}function ou(e){let t=e[2],n=e[3],[r,a]=e[4],i=s.IsEqual(s.Keys(a).length,0)?{}:{patternProperties:a};return{[e[1]]:yt(t,Nn(n,r,i))}}function iu(e){let t=e[2],[n,r]=e[3],a=s.IsEqual(s.Keys(r).length,0)?{}:{patternProperties:r};return{[e[1]]:Nn(t,n,a)}}function su(e){return{[e[1]]:yt(e[2],e[4])}}function mu(e){return{[e[1]]:e[3]}}function pu(e){return null}function uu(e){return hp(pt(e))}function cu(e){return e[1]}function lu(e){let t=e[0],n=e[1];return hu(p.Assign(t,n[0]))}function zn(e){return M(e.length,2)}function R(e,t,n){return zn(e)?t(e[0],e[1]):n()}function ry(e,t){return M(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function B(e,t){for(let n=0;n<e.length;n++){let r=ry(e[n],t);if(zn(r))return r}return[]}function go(e,t){return Array.from({length:t-e+1},(n,r)=>String.fromCharCode(e+r))}var gu=[...go(97,122),...go(65,90)],yo="0",xo=go(49,57),on=[yo,...xo],yu=" ",sn=`
|
|
6
|
-
`;var Tt="_",la=".",xu="$",da="-";var Iu="//",bu="/*",oy="*/";function vu(e){let t=e.indexOf(oy);return M(t,-1)?"":e.slice(t+2)}function $u(e){let t=e.indexOf(sn);return M(t,-1)?"":e.slice(t)}function iy(e){return e.replace(/^[ \t\r\f\v]+/,"")}function fa(e){let t=iy(e);return t.startsWith(bu)?fa(vu(t.slice(2))):t.startsWith(Iu)?fa($u(t.slice(2))):t}function pe(e){let t=e.trimStart();return t.startsWith(bu)?pe(vu(t.slice(2))):t.startsWith(Iu)?pe($u(t.slice(2))):t}function ha(e,t){return R(B([e],t),(n,r)=>[n,r],()=>["",t])}function sy(e,t){return e.includes(t)}function mn(e,t,n,r=""){return R(B(e,n),(a,i)=>sy(t,a)?mn(e,t,i,r):mn(e,t,i,`${r}${a}`),()=>[r,n])}function my(e){return B(xo,e)}var py=[...on,Tt];function uy(e){return mn(py,[Tt],e)}function cy(e){return R(B([yo],e),(t,n)=>[t,n],()=>R(my(e),(t,n)=>R(uy(n),(r,a)=>[`${t}${r}`,a],()=>[]),()=>[]))}function ga(e){return cy(pe(e))}function ly(e){return ha(da,e)}function dy(e){return R(ly(e),(t,n)=>R(ga(n),(r,a)=>[`${t}${r}`,a],()=>[]),()=>[])}function Tu(e){return dy(pe(e))}function fy(e){return R(Tu(e),(t,n)=>R(B(["n"],n),(r,a)=>[`${t}`,a],()=>[]),()=>[])}function Io(e){return fy(e)}function bo(e,t){return B([e],t)}function c(e,t){return M(e,"")?["",t]:e.startsWith(sn)?bo(e,fa(t)):e.startsWith(yu)?bo(e,t):bo(e,pe(t))}var ku=[...gu,Tt,xu];function hy(e){return B(ku,e)}var gy=[...ku,...on];function wu(e,t=""){return R(B(gy,e),(n,r)=>wu(r,`${t}${n}`),()=>[t,e])}function yy(e){return R(hy(e),(t,n)=>R(wu(n),(r,a)=>[`${t}${r}`,a],()=>[]),()=>[])}function W(e){return yy(pe(e))}var xy=[...on,Tt];function Iy(e){return zn(B([la],e))}function Eu(e){return R(mn(xy,[Tt],e),(t,n)=>M(t,"")?[]:[t,n],()=>[])}function by(e){return R(B([la],e),(t,n)=>R(Eu(n),(r,a)=>[`0${t}${r}`,a],()=>[]),()=>[])}function vy(e){return R(ga(e),(t,n)=>R(B([la],n),(r,a)=>R(Eu(a),(i,m)=>[`${t}${r}${i}`,m],()=>[`${t}`,a]),()=>[`${t}`,n]),()=>[])}function $y(e){return Iy(e)?by(e):vy(e)}function Ru(e){return $y(pe(e))}function Ty(e){return ha(da,e)}function ky(e){return R(Ty(e),(t,n)=>R(Ru(n),(r,a)=>[`${t}${r}`,a],()=>[]),()=>[])}function ya(e){return ky(pe(e))}function wy(e){return M(e,"")?[]:[e.slice(0,1),e.slice(1)]}function Su(e,t){return wr(e,(n,r)=>t.startsWith(n)?!0:Su(r,t),()=>!1)}function kt(e,t,n=""){return R(wy(t),(r,a)=>Su(e,t)?[n,t]:kt(e,a,`${n}${r}`),()=>[])}function Ey(e,t,n){return R(B([e],n),(r,a)=>R(kt([t],a),(i,m)=>R(B([t],m),(u,l)=>[`${i}`,l],()=>[]),()=>[]),()=>[])}function Ry(e,t,n){return R(B([e],n),(r,a)=>R(kt([sn,t],a),(i,m)=>R(B([t],m),(u,l)=>[`${i}`,l],()=>[]),()=>[]),()=>[])}function Ou(e,t,n,r){return n?Ey(e,t,pe(r)):Ry(e,t,pe(r))}function Sy(e,t){return B(e,t)}function Oy(e,t){return Ou(e,e,!1,t)}function Py(e,t){return R(Sy(e,t),(n,r)=>Oy(n,`${n}${r}`),()=>[])}function xa(e,t){return Py(e,pe(t))}function Pu(e,t){return R(kt(e,t),(n,r)=>M(n,"")?[]:[n,r],()=>[])}var o=(e,t,n=()=>[])=>e.length===2?t(e):n(),Cy=e=>o(o(W(e),([t,n])=>o(c("extends",n),([r,a])=>o(S(a),([i,m])=>o(c("=",m),([u,l])=>o(S(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[ym(t),n]),My=e=>o(o(W(e),([t,n])=>o(c("extends",n),([r,a])=>o(S(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[xm(t),n]),Ly=e=>o(o(W(e),([t,n])=>o(c("=",n),([r,a])=>o(S(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Im(t),n]),qy=e=>o(W(e),([t,n])=>[bm(t),n]),Mu=e=>o(o(Cy(e),([t,n])=>[t,n],()=>o(My(e),([t,n])=>[t,n],()=>o(Ly(e),([t,n])=>[t,n],()=>o(qy(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Lu=(e,t=[])=>o(o(Mu(e),([n,r])=>o(c(",",r),([a,i])=>[[n,a],i])),([n,r])=>Lu(r,[...t,n]),()=>[t,e]),jy=e=>o(o(Lu(e),([t,n])=>o(o(o(Mu(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[vm(t),n]),To=e=>o(o(c("<",e),([t,n])=>o(jy(n),([r,a])=>o(c(">",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[$m(t),n]),qu=(e,t=[])=>o(o(S(e),([n,r])=>o(c(",",r),([a,i])=>[[n,a],i])),([n,r])=>qu(r,[...t,n]),()=>[t,e]),Fy=e=>o(o(qu(e),([t,n])=>o(o(o(S(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[Tm(t),n]),Dy=e=>o(o(c("<",e),([t,n])=>o(Fy(n),([r,a])=>o(c(">",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[km(t),n]),Gy=e=>o(o(W(e),([t,n])=>o(Dy(n),([r,a])=>[[t,r],a])),([t,n])=>[wm(t),n]),ju=e=>o(o(o(c(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Em(t),n]),Fu=e=>o(c("string",e),([t,n])=>[Rm(t),n]),Du=e=>o(c("number",e),([t,n])=>[Sm(t),n]),Ny=e=>o(c("boolean",e),([t,n])=>[Om(t),n]),_y=e=>o(c("undefined",e),([t,n])=>[Pm(t),n]),Uy=e=>o(c("null",e),([t,n])=>[Am(t),n]),Gu=e=>o(c("integer",e),([t,n])=>[Cm(t),n]),Ky=e=>o(c("bigint",e),([t,n])=>[Mm(t),n]),zy=e=>o(c("unknown",e),([t,n])=>[Lm(t),n]),By=e=>o(c("any",e),([t,n])=>[qm(t),n]),Vy=e=>o(c("object",e),([t,n])=>[jm(t),n]),Wy=e=>o(c("never",e),([t,n])=>[Fm(t),n]),Nu=e=>o(c("symbol",e),([t,n])=>[Dm(t),n]),Hy=e=>o(c("void",e),([t,n])=>[Gm(t),n]),Yy=e=>o(c("this",e),([t,n])=>[Nm(t),n]),Jy=e=>o(o(c("${",e),([t,n])=>o(S(n),([r,a])=>o(c("}",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Bm(t),n]),vo=e=>o(kt(["${","`"],e),([t,n])=>[Vm(t),n]),_u=e=>o(o(o(vo(e),([t,n])=>o(Jy(n),([r,a])=>o(_u(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>o(o(vo(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o(o(vo(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[Wm(t),n]),ko=e=>o(o(c("`",e),([t,n])=>o(_u(n),([r,a])=>o(c("`",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Hm(t),n]),Zy=e=>o(ko(e),([t,n])=>[Ym(t),n]),Xy=e=>o(o(o(c("if",e),([t,n])=>o(S(n),([r,a])=>o(c("then",a),([i,m])=>o(S(m),([u,l])=>o(c("else",l),([f,h])=>o(S(h),([$,E])=>[[t,r,i,u,f,$],E])))))),([t,n])=>[t,n],()=>o(o(c("if",e),([t,n])=>o(S(n),([r,a])=>o(c("then",a),([i,m])=>o(S(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[t,n],()=>[])),([t,n])=>[Jm(t),n]),Qy=e=>o(Io(e),([t,n])=>[_m(t),n]),ex=e=>o(o(c("true",e),([t,n])=>[t,n],()=>o(c("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[Um(t),n]),tx=e=>o(ya(e),([t,n])=>[Km(t),n]),nx=e=>o(xa(["'",'"'],e),([t,n])=>[zm(t),n]),rx=e=>o(o(o(c("keyof",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Zm(t),n]),Uu=(e,t=[])=>o(o(o(c("[",e),([n,r])=>o(S(r),([a,i])=>o(c("]",i),([m,u])=>[[n,a,m],u]))),([n,r])=>[n,r],()=>o(o(c("[",e),([n,r])=>o(c("]",r),([a,i])=>[[n,a],i])),([n,r])=>[n,r],()=>[])),([n,r])=>Uu(r,[...t,n]),()=>[t,e]),ax=e=>o(Uu(e),([t,n])=>[Xm(t),n]),ox=e=>o(o(o(c("extends",e),([t,n])=>o(S(n),([r,a])=>o(c("?",a),([i,m])=>o(S(m),([u,l])=>o(c(":",l),([f,h])=>o(S(h),([$,E])=>[[t,r,i,u,f,$],E])))))),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Qm(t),n]),ix=e=>o(o(o(c("(",e),([t,n])=>o(S(n),([r,a])=>o(c(")",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>o(Fu(e),([t,n])=>[t,n],()=>o(Du(e),([t,n])=>[t,n],()=>o(Ny(e),([t,n])=>[t,n],()=>o(_y(e),([t,n])=>[t,n],()=>o(Uy(e),([t,n])=>[t,n],()=>o(Gu(e),([t,n])=>[t,n],()=>o(Ky(e),([t,n])=>[t,n],()=>o(zy(e),([t,n])=>[t,n],()=>o(By(e),([t,n])=>[t,n],()=>o(Vy(e),([t,n])=>[t,n],()=>o(Wy(e),([t,n])=>[t,n],()=>o(Nu(e),([t,n])=>[t,n],()=>o(Hy(e),([t,n])=>[t,n],()=>o(Yy(e),([t,n])=>[t,n],()=>o(Qy(e),([t,n])=>[t,n],()=>o(ex(e),([t,n])=>[t,n],()=>o(tx(e),([t,n])=>[t,n],()=>o(nx(e),([t,n])=>[t,n],()=>o(Zy(e),([t,n])=>[t,n],()=>o(Xy(e),([t,n])=>[t,n],()=>o(Ix(e),([t,n])=>[t,n],()=>o(wx(e),([t,n])=>[t,n],()=>o(Ax(e),([t,n])=>[t,n],()=>o(Px(e),([t,n])=>[t,n],()=>o(qx(e),([t,n])=>[t,n],()=>o(Gy(e),([t,n])=>[t,n],()=>o(jx(e),([t,n])=>[t,n],()=>[])))))))))))))))))))))))))))),([t,n])=>[ep(t),n]),sx=e=>o(o(o(c("with",e),([t,n])=>o(ac(n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[tp(t),n]),Ku=e=>o(o(rx(e),([t,n])=>o(ix(n),([r,a])=>o(ax(a),([i,m])=>o(ox(m),([u,l])=>o(sx(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[np(t),n]),zu=e=>o(o(o(c("&",e),([t,n])=>o(Ku(n),([r,a])=>o(zu(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Bu=e=>o(o(Ku(e),([t,n])=>o(zu(n),([r,a])=>[[t,r],a])),([t,n])=>[rp(t),n]),Vu=e=>o(o(o(c("|",e),([t,n])=>o(Bu(n),([r,a])=>o(Vu(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Ia=e=>o(o(Bu(e),([t,n])=>o(Vu(n),([r,a])=>[[t,r],a])),([t,n])=>[ap(t),n]),mx=e=>o(o(c("readonly",e),([t,n])=>o(Ia(n),([r,a])=>[[t,r],a])),([t,n])=>[op(t),n]),px=e=>o(o(c("|",e),([t,n])=>o(Ia(n),([r,a])=>[[t,r],a])),([t,n])=>[ip(t),n]),ux=e=>o(o(To(e),([t,n])=>o(c("=",n),([r,a])=>o(S(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[sp(t),n]),cx=e=>o(o(o(c("infer",e),([t,n])=>o(W(n),([r,a])=>o(c("extends",a),([i,m])=>o(Ia(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[t,n],()=>o(o(c("infer",e),([t,n])=>o(W(n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>[])),([t,n])=>[mp(t),n]),S=e=>o(o(cx(e),([t,n])=>[t,n],()=>o(px(e),([t,n])=>[t,n],()=>o(mx(e),([t,n])=>[t,n],()=>o(Ia(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),lx=e=>o(ya(e),([t,n])=>[pp(t),n]),dx=e=>o(W(e),([t,n])=>[t,n]),fx=e=>o(xa(["'",'"'],e),([t,n])=>[t,n]),hx=e=>o(o(c("[",e),([t,n])=>o(W(n),([r,a])=>o(c(":",a),([i,m])=>o(o(Gu(m),([u,l])=>[u,l],()=>o(Du(m),([u,l])=>[u,l],()=>o(Fu(m),([u,l])=>[u,l],()=>o(Nu(m),([u,l])=>[u,l],()=>[])))),([u,l])=>o(c("]",l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[up(t),n]),Wu=e=>o(o(lx(e),([t,n])=>[t,n],()=>o(dx(e),([t,n])=>[t,n],()=>o(fx(e),([t,n])=>[t,n],()=>o(hx(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),gx=e=>o(o(o(c("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[cp(t),n]),yx=e=>o(o(o(c("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[lp(t),n]),Hu=e=>o(o(gx(e),([t,n])=>o(Wu(n),([r,a])=>o(yx(a),([i,m])=>o(c(":",m),([u,l])=>o(S(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[dp(t),n]),Yu=e=>o(o(o(c(",",e),([t,n])=>o(c(`
|
|
3
|
+
`:"";st(E,`${A}${pe}node_modules
|
|
4
|
+
`,"utf-8")}let F=he(n,"node_modules"),Y=he(r,"node_modules");if(no(F)&&!no(Y))try{ih(F,Y,process.platform==="win32"?"junction":"dir")}catch{}try{ah(i,he(r,"agent_prompt.md"))}catch{}let ae=Ir(a,"utf-8"),me=uh(ae),at=he(r,"test.patch");st(at,ae,"utf-8");let _=await t.exec("git",["apply","test.patch"],l);try{sh(at)}catch{}if(_.code!==0)return{status:"patchFailed",solverDir:r,error:_.stderr?.trim()||"git apply test.patch failed"};let ot=await t.exec("git",["add","-A"],l);if(ot.code!==0)return{status:"error",solverDir:r,error:ot.stderr?.trim()||"git add (tests applied) failed"};let it=await t.exec("git",["commit","-m","tests applied","--allow-empty"],l);if(it.code!==0)return{status:"error",solverDir:r,error:it.stderr?.trim()||"git commit (tests applied) failed"};let Ue=await t.exec("git",["rev-parse","HEAD"],l);return Ue.code!==0||!Ue.stdout.trim()?{status:"error",solverDir:r,error:"Could not resolve tests-applied commit hash."}:{status:"ok",solverDir:r,testsAppliedCommit:Ue.stdout.trim(),testPatchPaths:me}}function ch(e){try{let t=Ir(e,"utf-8").match(/<testsuites\b[^>]*>/i)?.[0];if(!t)return{totalTests:null,failedTests:null};let n=m=>Number.parseInt(t.match(new RegExp(`\\b${m}="(\\d+)"`,"i"))?.[1]??"",10),r=n("tests"),a=n("failures"),i=n("errors");return{totalTests:Number.isFinite(r)?r:null,failedTests:Number.isFinite(a)?a+(Number.isFinite(i)?i:0):null}}catch{return{totalTests:null,failedTests:null}}}async function zi(e){let{pi:t,index:n,workspace:r,status:a,durationMs:i,cancelSignal:m}=e,{solverDir:u,testsAppliedCommit:l,testPatchPaths:f}=r,h=he(u,"test_output.xml"),v=(pe="",Ke="cancelled")=>({index:n,status:"cancelled",passed:!1,diff:pe,testOutputTail:Ke,durationMs:i,totalTests:null,failedTests:null,testOutputXmlPath:h});if(m.aborted)return v();let E={cwd:u,timeout:ao,signal:m};if(await t.exec("git",["add","-A"],E),m.aborted)return v();let A=[...f,"agent_prompt.md"].map(pe=>`:(exclude)${pe}`),F=await t.exec("git",["diff","--cached",l,"--",".",...A],E),Y=F.code===0?F.stdout:"";if(m.aborted)return v(Y);let ae=`bash test.sh --output_path ${to(eo(h))} new`,me="",at=await mh({shellPath:xr()}).exec(ae,u,{signal:m,timeout:ao*10/1e3,onData:pe=>{me+=pe.toString()}});if(m.aborted)return v(Y,Ui(me.trim(),_i));let _=at.exitCode===0,ot=Ui(me.trim(),_i),{totalTests:it,failedTests:Ue}=ch(h);return{index:n,status:a,passed:_,diff:Y,testOutputTail:ot,durationMs:i,totalTests:it,failedTests:Ue,testOutputXmlPath:h}}function Bi(e){let{repoDir:t,runId:n,index:r,trajectory:a,solutionPatch:i,testOutputXmlPath:m,testOutputTail:u}=e,l=he(t,ph,n,`solver_${r}`);ro(l,{recursive:!0}),st(he(l,"trajectory.json"),JSON.stringify(a,null,2),"utf-8"),st(he(l,"solution.patch"),i,"utf-8");try{let f=Ir(m,"utf-8");st(he(l,"test_output.xml"),f,"utf-8")}catch{st(he(l,"test_output.txt"),u,"utf-8")}return l}function Vi(e,t){let n=he(e,kn);ro(n,{recursive:!0});let r=t.map(a=>{let i=he(n,`solver_${a.index}`);return ro(i,{recursive:!0}),st(he(i,"solution.diff"),a.diff,"utf-8"),st(he(i,"test_output.txt"),a.testOutputTail,"utf-8"),{index:a.index,status:a.status,passed:a.passed}});return st(he(n,"manifest.json"),JSON.stringify(r,null,2),"utf-8"),n}function Wi(e){let t=he(e,"node_modules");try{oh(t).isSymbolicLink()&&Ni(t,{force:!0})}catch{}try{Ni(e,{recursive:!0,force:!0})}catch{}}var p={};Rt(p,{Assign:()=>lh,Clone:()=>Rn,Create:()=>xg,Discard:()=>bg,Metrics:()=>Ge,Update:()=>Ig});var Ge={assign:0,create:0,clone:0,discard:0,update:0};function lh(e,t){return Ge.assign+=1,{...e,...t}}var s={};Rt(s,{Entries:()=>Mh,EntriesRegExp:()=>Ch,Every:()=>Oh,EveryAll:()=>Ph,GraphemeCount:()=>Eh,HasPropertyKey:()=>Ah,IsArray:()=>En,IsBigInt:()=>wn,IsBoolean:()=>ns,IsClassInstance:()=>kh,IsConstructor:()=>xh,IsDeepEqual:()=>mo,IsEqual:()=>M,IsFunction:()=>rs,IsGreaterEqualThan:()=>os,IsGreaterThan:()=>vh,IsInteger:()=>io,IsLessEqualThan:()=>as,IsLessThan:()=>Th,IsMaxLength:()=>Sh,IsMinLength:()=>Rh,IsMultipleOf:()=>$h,IsNull:()=>$r,IsNumber:()=>kr,IsObject:()=>Sn,IsObjectNotArray:()=>bh,IsString:()=>wr,IsSymbol:()=>Ih,IsUndefined:()=>so,IsUnsafePropertyKey:()=>is,IsValueLike:()=>wh,Keys:()=>Tr,ShiftLeft:()=>Er,Symbols:()=>qh,Values:()=>Lh});function Ot(e,t,n){return e>=t&&e<=n}function dh(e){return e===8205}function fh(e){return Ot(e,55296,56319)}function Hi(e){return Ot(e,127462,127487)}function Ji(e){return Ot(e,65024,65039)}function Xi(e){return Ot(e,768,879)||Ot(e,6832,6911)||Ot(e,7616,7679)||Ot(e,65056,65071)}function vr(e){return e>65535?2:1}function Yi(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(Xi(n)||Ji(n))t+=vr(n);else break}return t}function oo(e,t){let n=e.codePointAt(t),r=t+vr(n);for(r=Yi(e,r);r<e.length-1&&e[r]==="\u200D";){let a=e.codePointAt(r+1);r+=1+vr(a),r=Yi(e,r)}return Hi(n)&&r<e.length&&Hi(e.codePointAt(r))&&(r+=vr(e.codePointAt(r))),r}function Zi(e){return fh(e)||Xi(e)||Ji(e)||dh(e)}function Qi(e){let t=0,n=0;for(;n<e.length;)n=oo(e,n),t++;return t}function hh(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=oo(e,r),n++,n>=t)return!0;return!1}function gh(e,t){let n=0,r=0;for(;r<e.length;)if(r=oo(e,r),n++,n>t)return!1;return!0}function es(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Zi(e.charCodeAt(n)))return hh(e,t);if(n++,n>=t)return!0}return!1}function ts(e,t){let n=0;for(;n<e.length;){if(Zi(e.charCodeAt(n)))return gh(e,t);if(n++,n>t)return!1}return!0}function En(e){return Array.isArray(e)}function wn(e){return M(typeof e,"bigint")}function ns(e){return M(typeof e,"boolean")}function xh(e){if(so(e)||!rs(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function rs(e){return M(typeof e,"function")}function io(e){return Number.isInteger(e)}function $r(e){return M(e,null)}function kr(e){return Number.isFinite(e)}function bh(e){return Sn(e)&&!En(e)}function Sn(e){return M(typeof e,"object")&&!$r(e)}function wr(e){return M(typeof e,"string")}function Ih(e){return M(typeof e,"symbol")}function so(e){return M(e,void 0)}function M(e,t){return e===t}function vh(e,t){return e>t}function Th(e,t){return e<t}function as(e,t){return e<=t}function os(e,t){return e>=t}function $h(e,t){if(wn(e)||wn(t))return BigInt(e)%BigInt(t)===0n;let n=1e-10;if(!kr(e)||io(e)&&1/t%1===0)return!0;let r=e%t;return Math.min(Math.abs(r),Math.abs(r-t),Math.abs(r+t))<n}function kh(e){if(!Sn(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return $r(t)?!1:M(typeof t.constructor,"function")&&!(M(t.constructor,globalThis.Object)||M(t.constructor.name,"Object"))}function wh(e){return wn(e)||ns(e)||$r(e)||kr(e)||wr(e)||so(e)}function Eh(e){return Qi(e)}function Sh(e,t){return ts(e,t)}function Rh(e,t){return es(e,t)}function Oh(e,t,n){for(let r=t;r<e.length;r++)if(!n(e[r],r))return!1;return!0}function Ph(e,t,n){let r=!0;for(let a=t;a<e.length;a++)n(e[a],a)||(r=!1);return r}function Er(e,t,n){return M(e.length,0)?n():t(e[0],e.slice(1))}function is(e){return M(e,"__proto__")||M(e,"constructor")||M(e,"prototype")}function Ah(e,t){return is(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Ch(e){return Tr(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function Mh(e){return Object.entries(e)}function Tr(e){return Object.getOwnPropertyNames(e)}function qh(e){return Object.getOwnPropertySymbols(e)}function Lh(e){return Object.values(e)}function jh(e,t){if(!Sn(t))return!1;let n=Tr(e);return M(n.length,Tr(t).length)&&n.every(r=>mo(e[r],t[r]))}function Fh(e,t){return En(t)&&M(e.length,t.length)&&e.every((n,r)=>mo(e[r],t[r]))}function mo(e,t){return En(e)?Fh(e,t):Sn(e)?jh(e,t):M(e,t)}var ht={};Rt(ht,{IsBigInt64Array:()=>Zh,IsBigUint64Array:()=>Qh,IsBoolean:()=>Gh,IsDate:()=>tg,IsFloat32Array:()=>Jh,IsFloat64Array:()=>Xh,IsInt16Array:()=>Vh,IsInt32Array:()=>Hh,IsInt8Array:()=>Kh,IsMap:()=>rg,IsNumber:()=>Nh,IsRegExp:()=>eg,IsSet:()=>ng,IsString:()=>_h,IsTypeArray:()=>Uh,IsUint16Array:()=>Wh,IsUint32Array:()=>Yh,IsUint8Array:()=>zh,IsUint8ClampedArray:()=>Bh});function Gh(e){return e instanceof Boolean}function Nh(e){return e instanceof Number}function _h(e){return e instanceof String}function Uh(e){return globalThis.ArrayBuffer.isView(e)}function Kh(e){return e instanceof globalThis.Int8Array}function zh(e){return e instanceof globalThis.Uint8Array}function Bh(e){return e instanceof globalThis.Uint8ClampedArray}function Vh(e){return e instanceof globalThis.Int16Array}function Wh(e){return e instanceof globalThis.Uint16Array}function Hh(e){return e instanceof globalThis.Int32Array}function Yh(e){return e instanceof globalThis.Uint32Array}function Jh(e){return e instanceof globalThis.Float32Array}function Xh(e){return e instanceof globalThis.Float64Array}function Zh(e){return e instanceof globalThis.BigInt64Array}function Qh(e){return e instanceof globalThis.BigUint64Array}function eg(e){return e instanceof globalThis.RegExp}function tg(e){return e instanceof globalThis.Date}function ng(e){return e instanceof globalThis.Set}function rg(e){return e instanceof globalThis.Map}function og(e){return s.HasPropertyKey(e,"~kind")||s.HasPropertyKey(e,"~unsafe")}function ig(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let r of Object.keys(n)){if(s.IsUnsafePropertyKey(r))continue;let a=n[r];s.HasPropertyKey(a,"value")&&Object.defineProperty(t,r,{...a,value:Pt(a.value)})}return t}function sg(e){let t={};for(let n of s.Keys(e))s.IsUnsafePropertyKey(n)||(t[n]=Pt(e[n]));for(let n of s.Symbols(e))t[n]=Pt(e[n]);return t}function mg(e){return s.IsClassInstance(e)?e:og(e)?ig(e):sg(e)}function pg(e){return e.map(t=>Pt(t))}function ug(e){return e.slice()}function cg(e){return new RegExp(e.source,e.flags)}function lg(e){return new Map(Pt([...e.entries()]))}function dg(e){return new Set(Pt([...e.values()]))}function Pt(e){return ht.IsTypeArray(e)?ug(e):ht.IsRegExp(e)?cg(e):ht.IsMap(e)?lg(e):ht.IsSet(e)?dg(e):s.IsArray(e)?pg(e):s.IsObject(e)?mg(e):e}function Rn(e){return Ge.clone+=1,Pt(e)}var At={};Rt(At,{Get:()=>gg,Reset:()=>fg,Set:()=>hg});var mt={immutableTypes:!1,maxErrors:8,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function fg(){mt.immutableTypes=!1,mt.maxErrors=8,mt.useAcceleration=!0,mt.exactOptionalPropertyTypes=!1,mt.enumerableKind=!1,mt.correctiveParse=!1,mt.unionPrioritySort=!0}function hg(e){for(let t of s.Keys(e)){let n=e[t];n!==void 0&&Object.defineProperty(mt,t,{value:n})}}function gg(){return mt}function yg(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function ss(e,t){return{...e,...t}}function xg(e,t,n={}){Ge.create+=1;let r=At.Get(),a=ss(t,n),i=r.enumerableKind?ss(a,e):yg(a,e);return r.immutableTypes?Object.freeze(i):i}function bg(e,t){Ge.discard+=1;let n={},r=Object.getOwnPropertyDescriptors(Rn(e)),a=new Set(t);for(let i of Object.keys(r))a.has(i)||Object.defineProperty(n,i,r[i]);return n}function Ig(e,t,n){Ge.update+=1;let r=At.Get(),a=Rn(e);for(let i of Object.keys(t))Object.defineProperty(a,i,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[i]});for(let i of Object.keys(n))Object.defineProperty(a,i,{configurable:!0,enumerable:!0,writable:!0,value:n[i]});return a}function y(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function ne(e){return s.IsObject(e)}function b(e,t,n){return p.Create({"~kind":"Deferred"},{type:"deferred",action:e,parameters:t,options:n},{})}function gt(e){return y(e,"Deferred")}function vg(e){return p.Update(e,{"~readonly":!0},{})}function On(e,t){return p.Update(vg(e),{},t)}function ms(e,t,n,r){let a=d(e,t,n);return On(a,r)}function Tg(e){return p.Update(e,{"~optional":!0},{})}function Pn(e,t){return p.Update(Tg(e),{},t)}function ps(e,t,n,r){let a=d(e,t,n);return Pn(a,r)}function Re(e,t){return p.Create({"~kind":"Array"},{type:"array",items:e},t)}function z(e){return y(e,"Array")}function Sr(e){return p.Discard(e,["~kind","type","items"])}function Be(e,t,n={}){return p.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},n)}function oe(e){return y(e,"Constructor")}function us(e){return p.Discard(e,["~kind","type","parameters","instanceType"])}function Ve(e,t,n={}){return p.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},n)}function ie(e){return y(e,"Function")}function cs(e){return p.Discard(e,["~kind","type","parameters","returnType"])}function pt(e,t){return p.Create({"~kind":"Ref"},{$ref:e},t)}function se(e){return y(e,"Ref")}function yt(e,t){return p.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Jt(e){return y(e,"Generic")}function Xt(e){return p.Create({"~kind":"Any"},{},e)}function Z(e){return y(e,"Any")}var ls="(?!)";function D(e){return p.Create({"~kind":"Never"},{not:{}},e)}function xt(e){return y(e,"Never")}function We(e,t={}){return b("AddOptional",[e],t)}function Ct(e,t={}){return Pn(e,t)}function ds(e){return Ct(e)}function ge(e){return ne(e)&&s.HasPropertyKey(e,"~optional")}function fs(e){return s.Keys(e).filter(t=>!ge(e[t]))}function Rr(e){return s.Keys(e)}function Or(e){return s.Values(e)}function T(e,t={}){let n=fs(e),r=n.length>0?{required:n}:{};return p.Create({"~kind":"Object"},{type:"object",...r,properties:e},t)}function q(e){return y(e,"Object")}function hs(e){return p.Discard(e,["~kind","type","properties","required"])}function ue(e){return p.Create({"~kind":"Unknown"},{},e)}function re(e){return y(e,"Unknown")}function He(e,t,n){let r=s.Keys(e).reduce((a,i)=>({...a,[i]:p.Update(e[i],{},{$id:i})}),{});return p.Create({"~kind":"Cyclic"},{$defs:r,$ref:t},n)}function le(e){return y(e,"Cyclic")}function gs(e){return p.Update(e,{"~unsafe":null},{})}function Pr(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"~unsafe")&&s.IsNull(e["~unsafe"])}var Ye={};Rt(Ye,{Match:()=>$g});function $g(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function An(...e){let[t,n]=Ye.Match(e,{2:(r,a)=>[r,a,a],1:r=>[r,ue(),ue()]});return p.Create({"~kind":"Infer"},{type:"infer",name:t,extends:n},{})}function J(e){return y(e,"Infer")}function Mt(e,t,n,r={}){return p.Create({"~kind":"Dependent"},{if:e,then:t,else:n},r)}function W(e){return y(e,"Dependent")}function ys(e){return p.Discard(e,["~kind","if","then","else"])}function xs(e){return s.IsObjectNotArray(e)}function bs(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,r)=>[...n,e[r]],[])}function Is(e){return s.IsString(e)||s.IsNumber(e)}function vs(e,t){let n=xs(e)?bs(e):e;return p.Create({"~kind":"Enum"},{enum:n},t)}function xe(e){return y(e,"Enum")}function ye(e,t={}){return p.Create({"~kind":"Intersect"},{allOf:e},t)}function O(e){return y(e,"Intersect")}function Ts(e){return p.Discard(e,["~kind","allOf"])}function X(){throw new Error("Unreachable")}var $s;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})($s||($s={}));var wk=BigInt("14695981039346656037"),[Ek,Sk]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Rk=Array.from({length:256}).map((e,t)=>BigInt(t)),ks=new Float64Array(1),Ok=new DataView(ks.buffer),Pk=new Uint8Array(ks.buffer);var Ak=new TextEncoder;var Cn=class{constructor(t,n){this.type=t,this.decode=n}Encode(t){let n=this.type,r=Ar(n)?m=>this.decode(n["~codec"].decode(m)):this.decode,a=Ar(n)?m=>n["~codec"].encode(t(m)):t,i={decode:r,encode:a};return p.Update(this.type,{"~codec":i},{})}},Mn=class{constructor(t){this.type=t}Decode(t){return new Cn(this.type,t)}};function Cr(e){return new Mn(e)}function Es(e,t){return Cr(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function Ss(e,t){return Cr(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function Ar(e){return ne(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function Rs(e){return Zt(e)}function qt(e){return ne(e)&&s.HasPropertyKey(e,"~immutable")}function Je(e,t={}){return b("AddReadonly",[e],t)}function Lt(e,t={}){return On(e,t)}function Os(e){return Lt(e)}function jt(e){return ne(e)&&s.HasPropertyKey(e,"~readonly")}function Sg(e,t){let n=po(e)?[...e["~refine"],t]:[t];return p.Update(e,{"~refine":n},{})}function Ps(...e){let[t,n,r]=Ye.Match(e,{3:(a,i,m)=>[a,i,m],2:(a,i)=>[a,i,()=>"Refine Error"]});return Sg(t,{check:n,error:r})}function Rg(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"error")&&s.IsFunction(e.check)&&s.IsFunction(e.error)}function po(e){return ne(e)&&s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>Rg(t))}var As="-?(?:0|[1-9][0-9]*)n";function qn(e){return p.Create({"~kind":"BigInt"},{type:"bigint"},e)}function Xe(e){return y(e,"BigInt")}function Mr(e){return p.Create({"~kind":"Boolean"},{type:"boolean"},e)}function Ce(e){return y(e,"Boolean")}function Ln(e){return p.Create({"~kind":"Identifier"},{name:e})}function Cs(e){return y(e,"Identifier")}var qr="-?(?:0|[1-9][0-9]*)";function Ft(e){return p.Create({"~kind":"Integer"},{type:"integer"},e)}function be(e){return y(e,"Integer")}var uo=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function Og(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new uo(e)})()}function P(e,t){return p.Create({"~kind":"Literal"},{type:Og(e),const:e},t)}function Lr(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function Ms(e){return L(e)&&s.IsNumber(e.const)}function qs(e){return L(e)&&s.IsString(e.const)}function L(e){return y(e,"Literal")}function Qt(e){return p.Create({"~kind":"Null"},{type:"null"},e)}function en(e){return y(e,"Null")}var jr="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function we(e){return p.Create({"~kind":"Number"},{type:"number"},e)}function Q(e){return y(e,"Number")}function tn(e){return p.Create({"~kind":"Symbol"},{type:"symbol"},e)}function bt(e){return y(e,"Symbol")}function Dt(...e){let[t,n,r]=Ye.Match(e,{3:(a,i,m)=>[a,i,m],2:(a,i)=>[a,i,i],1:a=>[a,ue(),ue()]});return p.Create({"~kind":"Parameter"},{name:t,extends:n,equals:r},{})}function Ls(e){return y(e,"Parameter")}var Fr=".*";function Me(e){return p.Create({"~kind":"String"},{type:"string"},e)}function Ie(e){return y(e,"String")}function w(e,t={}){return p.Create({"~kind":"Union"},{anyOf:e},t)}function x(e){return y(e,"Union")}function js(e){return p.Discard(e,["~kind","anyOf"])}function jn(e){let t=Fs(e);return s.IsEqual(t.length,2)?t[0]:[]}function Pg(e){return!0}function Ds(e){return s.ShiftLeft(e,(t,n)=>Ag(t)?Ds(n):!1,()=>!0)}function Gs(e){return s.IsEqual(e.length,0)?!1:Ds(e)}function Ag(e){return x(e)?Gs(e.anyOf):L(e)?Pg(e.const):!1}function Dr(e){return Gs(e)}function Gr(e){return p.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function Ns(e,t,n=[]){return s.ShiftLeft(e,(r,a)=>Ns(a,t,[...n,`${r}${t}`]),()=>n)}function Cg(e,t){return s.IsEqual(e.length,0)?[`${t}`]:Ns(e,t)}function _s(e,t,n=[]){return s.ShiftLeft(t,(r,a)=>_s(e,a,[...n,...Us(e,r)]),()=>n)}function Us(e,t){return x(t)?_s(e,t.anyOf):L(t)?Cg(e,t.const):X()}function Ks(e,t){return s.ShiftLeft(t,(n,r)=>Ks(Us(e,n),r),()=>e)}function Mg(e){return e.map(t=>P(t))}function qg(e){let t=Ks([],e),n=Mg(t);return w(n)}function Lg(e){return s.IsEqual(e.length,0)?X():s.IsEqual(e.length,1)&&L(e[0])?e[0]:qg(e)}function co(e){let t=jn(e);return s.IsEqual(t.length,0)?Me():Dr(t)?Lg(t):Gr(e)}function zs(e){let t=co(e);return ee(t)?Me():t}function $e(e,t){let n="object",r={[e]:t};return p.Create({"~kind":"Record"},{type:n,patternProperties:r})}function Bs(e){return $e(Ne,e)}function Vs(e){return T({true:e,false:e})}function te(e,t={}){let[n,r,a]=[e,e.length,!1];return p.Create({"~kind":"Tuple"},{type:"array",additionalItems:a,items:n,minItems:r},t)}function N(e){return y(e,"Tuple")}function Ws(e){return p.Discard(e,["~kind","type","items","minItems","additionalItems"])}function jg(e){return p.Discard(e,["~readonly"])}function lo(e,t){return p.Update(jg(e),{},t)}function Hs(e,t,n,r){let a=d(e,t,n);return lo(a,r)}function Ys(e,t={}){return b("RemoveReadonly",[e],t)}function Js(e,t={}){return lo(e,t)}function Fg(e){return p.Discard(e,["~optional"])}function fo(e,t){return p.Update(Fg(e),{},t)}function Xs(e,t,n,r){let a=d(e,t,n);return fo(a,r)}function Zs(e,t={}){return b("RemoveOptional",[e],t)}function Nr(e,t={}){return fo(e,t)}function ho(e){return e.reduceRight((n,r,a)=>({[a]:r,...n}),{})}function Qs(e){let t=ho(e.items);return T(t)}function Dg(e,t){return jt(e)?!!jt(t):!1}function Gg(e,t){return ge(e)?!!ge(t):!1}function Ng(e,t){let n=Dg(e,t),r=Gg(e,t),a=B([e,t]),i=Js(Nr(a));return n&&r?Lt(Ct(i)):n&&!r?Lt(i):!n&&r?Ct(i):i}function _g(e,t,n){return n in e?n in t?Ng(e[n],t[n]):e[n]:n in t?t[n]:D()}function Ug(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((r,a)=>({...r,[a]:_g(e,t,a)}),{})}function em(e){return q(e)?e.properties:N(e)?ho(e.items):X()}function tm(e,t){let n=em(e),r=em(t),a=Ug(n,r);return T(a)}function nm(e,t){let n=nn(e,t);return s.IsEqual(n,Dn)?e:s.IsEqual(n,Gn)||s.IsEqual(n,Fn)?t:D()}function rm(e){return q(e)||N(e)}function Kg(e,t){let n=x(e),r=x(t);return n||r}function zg(e,t){let n=qe(e),r=qe(t),a=Kg(n,r),i=rm(n),m=rm(r);return a?B([n,r]):i&&m?tm(n,r):i&&!m?n:!i&&m?r:nm(n,r)}function am(e,t,n=[]){return s.ShiftLeft(t,(r,a)=>am(e,a,[...n,zg(e,r)]),()=>s.IsEqual(n.length,0)?[e]:n)}function om(e,t,n=[]){return s.ShiftLeft(e,(r,a)=>om(a,t,[...n,...Nn([r],t)]),()=>n)}function Nn(e,t=[]){return s.ShiftLeft(e,(n,r)=>x(n)?Nn(r,om(n.anyOf,t)):Nn(r,am(n,t)),()=>t)}function Bg(e,t){let n=de({},e,t);return I.IsExtendsTrueLike(n)?[]:[e]}function Vg(e,t){return e.reduce((n,r)=>[...n,...Bg(r,t)],[])}function _r(e,t){let n=qe(e),r=x(n)?n.anyOf:[n],a=Vg(r,t);return Ee(a)}function _e(e,t,n){let r=ye([e,t]),a=_r(n,e);return Ee([r,a])}function Oe(e){let t=e.map(n=>P(n));return Ee(t)}function B(e){let t=Nn(e),n=go(t);return ut(n)}function ke(e){let t=zs(e);return qe(t)}function Ee(e){let t=go(e);return ut(t)}function qe(e){return W(e)?_e(e.if,e.then,e.else):xe(e)?Oe(e.enum):O(e)?B(e.allOf):ee(e)?ke(e.pattern):x(e)?Ee(e.anyOf):e}function ut(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?D():w(e)}function im(e,t){let n=Oe(e);return It(n,t)}function sm(e,t){return $e(vt,t)}function mm(e,t){let n=B(e);return It(n,t)}function pm(e,t){return s.IsString(e)||s.IsNumber(e)?T({[e]:t}):s.IsEqual(e,!1)?T({false:t}):s.IsEqual(e,!0)?T({true:t}):T({})}function um(e,t){return $e(rn,t)}function cm(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?$e(e.pattern.toString(),t):$e(Ne,t)}function lm(e,t){let n=jn(e);return Dr(n)?It(ke(e),t):$e(e,t)}function Wg(e){return x(e)?_n(e.anyOf):[e]}function _n(e){return e.reduce((t,n)=>[...t,...Wg(n)],[])}function Hg(e){return e.some(t=>Ie(t)||Q(t)||be(t))}function Yg(e,t){return s.IsEqual(Hg(e),!0)?$e(Ne,t):void 0}function Jg(e,t){return e.reduce((n,r)=>L(r)&&(s.IsString(r.const)||s.IsNumber(r.const))?{...n,[r.const]:t}:n,{})}function Xg(e,t){let n=Jg(e,t);return T(n)}function dm(e,t){let n=_n(e),r=Yg(n,t);return ne(r)?r:Xg(n,t)}function It(e,t){return Z(e)?Bs(t):Ce(e)?Vs(t):xe(e)?im(e.enum,t):be(e)?sm(e,t):O(e)?mm(e.allOf,t):L(e)?pm(e.const,t):Q(e)?um(e,t):x(e)?dm(e.anyOf,t):Ie(e)?cm(e,t):ee(e)?lm(e.pattern,t):T({})}function yo(e,t,n){return k([e])?p.Update(It(e,t),{},n):Ur(e,t,n)}function fm(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return yo(i,m,a)}var vt=`^${qr}$`,rn=`^${jr}$`,Ne=`^${Fr}$`;function Ur(e,t,n={}){return b("Record",[e,t],n)}function Kr(e,t,n={}){return yo(e,t,n)}function hm(e,t){return $e(e,t)}function zr(e){return s.IsEqual(e,Ne)?Me():s.IsEqual(e,vt)?Ft():s.IsEqual(e,rn)?we():co(e)}function Le(e){return s.Keys(e.patternProperties)[0]}function an(e){let t=Le(e);return zr(t)}function ve(e){return e.patternProperties[Le(e)]}function fe(e){return y(e,"Record")}function Gt(e){return p.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Tt(e){return y(e,"Rest")}function Br(e){return p.Create({"~kind":"This"},{$ref:"#"},e)}function Vr(e){return y(e,"This")}function on(e){return p.Create({"~kind":"Undefined"},{type:"undefined"},e)}function sn(e){return y(e,"Undefined")}function Wr(e){return p.Create({"~kind":"Void"},{type:"void"},e)}function Ze(e){return y(e,"Void")}function Qg(e,t){return s.IsEqual(e,"Array")?Re(t[0]):s.IsEqual(e,"Capitalize")?Yr(t[0]):s.IsEqual(e,"ConstructorParameters")?ea(t[0]):s.IsEqual(e,"Evaluate")?yu(t[0]):s.IsEqual(e,"Exclude")?ta(t[0],t[1]):s.IsEqual(e,"Extract")?na(t[0],t[1]):s.IsEqual(e,"Index")?Bn(t[0],t[1]):s.IsEqual(e,"InstanceType")?ra(t[0]):s.IsEqual(e,"Lowercase")?Jr(t[0]):s.IsEqual(e,"NonNullable")?aa(t[0]):s.IsEqual(e,"Omit")?oa(t[0],t[1]):s.IsEqual(e,"Parameters")?ia(t[0]):s.IsEqual(e,"Partial")?sa(t[0]):s.IsEqual(e,"Pick")?ma(t[0],t[1]):s.IsEqual(e,"Readonly")?pa(t[0]):s.IsEqual(e,"KeyOf")?Vn(t[0]):s.IsEqual(e,"Record")?Ur(t[0],t[1]):s.IsEqual(e,"Required")?ua(t[0]):s.IsEqual(e,"ReturnType")?ca(t[0]):s.IsEqual(e,"Uncapitalize")?Xr(t[0]):s.IsEqual(e,"Uppercase")?Zr(t[0]):zn(pt(e),t)}function Nt(){throw Error("Unreachable")}var ey=(e,t=[])=>e.reduce((n,r)=>s.IsArray(r)&&s.IsEqual(r.length,2)?[...n,r[0]]:[...n,r],[]),ct=e=>{let[t,n]=e;return ey([...t,...n])};function Im(e){return Dt(e[0],e[2],e[4])}function vm(e){return Dt(e[0],e[2],e[2])}function Tm(e){return Dt(e[0],ue(),e[2])}function $m(e){return Dt(e,ue(),ue())}function km(e){return ct(e)}function wm(e){return e[1]}function Em(e){return ct(e)}function Sm(e){return e[1]}function Rm(e){return Qg(e[0],e[1])}function Om(e){return null}function Pm(e){return Me()}function Am(e){return we()}function Cm(e){return Mr()}function Mm(e){return on()}function qm(e){return Qt()}function Lm(e){return Ft()}function jm(e){return qn()}function Fm(e){return ue()}function Dm(e){return Xt()}function Gm(e){return T({})}function Nm(e){return D()}function _m(e){return tn()}function Um(e){return Wr()}function Km(e){return Br()}function zm(e){return P(BigInt(e))}function Bm(e){return P(s.IsEqual(e,"true"))}function Vm(e){return P(parseFloat(e))}function Wm(e){return P(e)}function Hm(e){return e[1]}function Ym(e){return P(e)}function Jm(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function Xm(e){return e[1]}function Zm(e){return Hr(e)}function Qm(e){return s.IsEqual(e.length,6)?Mt(e[1],e[3],e[5]):Mt(e[1],e[3],ue())}function ep(e){return e.length>0}function tp(e){return e.reduce((t,n)=>s.IsEqual(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function np(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function rp(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}function ap(e){return s.IsEqual(e.length,2)?e[1]:[]}function gm(e,t){return t.reduce((n,r)=>{let a=r;return s.IsEqual(a.length,1)?Bn(n,a[0]):s.IsEqual(a.length,0)?Re(n):Nt()},e)}function ym(e,t){return s.IsEqual(t.length,3)?Qr(e,t[0],t[1],t[2]):e}function ty(e,t){return s.IsArray(t)&&s.IsEqual(t.length,0)?e:la(e,t)}function op(e){let[t,n,r,a,i]=e;return ty(ym(t?Vn(gm(n,r)):gm(n,r),a),i)}function xo(e,t){return s.IsEqual(t.length,3)?(()=>{let[n,r,a]=t,i=xo(r,a);if(s.IsEqual(n,"&"))return O(i)?ye([e,...i.allOf]):ye([e,i]);if(s.IsEqual(n,"|"))return x(i)?w([e,...i.anyOf]):w([e,i]);Nt()})():e}function ip(e){let[t,n]=e;return xo(t,n)}function sp(e){let[t,n]=e;return xo(t,n)}function mp(e){return gu(e[1])}function pp(e){return e[1]}function up(e){return yt(e[0],e[2])}function cp(e){return s.IsEqual(e.length,4)?An(e[1],e[3]):s.IsEqual(e.length,2)?An(e[1],ue()):Nt()}function lp(e){return`${e}`}function dp(e){return be(e[3])?vt:Q(e[3])?rn:bt(e[3])?Ne:Ie(e[3])?Ne:Nt()}function fp(e){return e.length>0}function hp(e){return e.length>0}function gp(e){let[t,n,r,a,i]=e;return{[n]:t&&r?Je(We(i)):t&&!r?Je(i):!t&&r?We(i):i}}function yp(e){return ct(e)}function xp(e){return e.reduce((t,n)=>s.HasPropertyKey(n,vt)||s.HasPropertyKey(n,rn)||s.HasPropertyKey(n,Ne)?[t[0],p.Assign(t[1],n)]:[p.Assign(t[0],n),t[1]],[{},{}])}function bp(e){return xp(e[1])}function Ip(e){let[t,n]=e,r=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return T(t,r)}function vp(e){return s.IsEqual(e.length,5)?Je(We(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?Je(e[3]):We(e[3]):Nt()}function Tp(e){return Je(We(e[1]))}function $p(e){return Je(e[1])}function kp(e){return We(e[0])}function wp(e){return s.IsEqual(e.length,2)?Gt(e[1]):s.IsEqual(e.length,1)?e[0]:Nt()}function Ep(e){return ct(e)}function Sp(e){return te(e[1])}function Rp(e){return Je(We(e[4]))}function Op(e){return Je(e[3])}function Pp(e){return We(e[3])}function Ap(e){return e[2]}function Cp(e){return s.IsEqual(e.length,2)?Gt(e[1]):s.IsEqual(e.length,1)?e[0]:Nt()}function Mp(e){return ct(e)}function qp(e){return Ve(e[1],e[4])}function Lp(e){return Be(e[2],e[5])}function xm(e,t){return s.IsEqual(e,"remove")?Ys(t):s.IsEqual(e,"add")?Je(t):t}function jp(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function bm(e,t){return s.IsEqual(e,"remove")?Zs(t):s.IsEqual(e,"add")?We(t):t}function Fp(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function Dp(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function Gp(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?Un(Ln(e[3]),e[5],e[6][0],xm(e[1],bm(e[8],e[10]))):Un(Ln(e[3]),e[5],pt(e[3]),xm(e[1],bm(e[8],e[10])))}function Np(e){return pt(e)}function _p(e){return BigInt(e)}function Up(e){return parseFloat(e)}function Kp(e){return s.IsEqual(e,"true")}function zp(e){return null}function Bp(e){return{[e[0]]:e[2]}}function Vp(e){return ct(e)}function ny(e){return e.reduce((t,n)=>p.Assign(t,n),{})}function Wp(e){return ny(e[1])}function Hp(e){return ct(e)}function Yp(e){return e[1]}function Jp(e){return qn()}function Xp(e){return Me()}function Zp(e){return we()}function Qp(e){return Ft()}function eu(e){return D()}function tu(e){return P(e)}function nu(e){return w(e[1])}function ru(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function au(e){return[e[0],...e[1]]}function ou(e){return e[1]}function iu(e){return ct(e)}function su(e){return s.IsEqual(e.length,2)?e[1]:[]}function mu(e){let t=e[2],n=e[3],[r,a]=e[4],i=s.IsEqual(s.Keys(a).length,0)?{}:{patternProperties:a};return{[e[1]]:yt(t,Kn(n,r,i))}}function pu(e){let t=e[2],[n,r]=e[3],a=s.IsEqual(s.Keys(r).length,0)?{}:{patternProperties:r};return{[e[1]]:Kn(t,n,a)}}function uu(e){return{[e[1]]:yt(e[2],e[4])}}function cu(e){return{[e[1]]:e[3]}}function lu(e){return null}function du(e){return xp(ct(e))}function fu(e){return e[1]}function hu(e){let t=e[0],n=e[1];return xu(p.Assign(t,n[0]))}function Wn(e){return M(e.length,2)}function S(e,t,n){return Wn(e)?t(e[0],e[1]):n()}function oy(e,t){return M(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function V(e,t){for(let n=0;n<e.length;n++){let r=oy(e[n],t);if(Wn(r))return r}return[]}function bo(e,t){return Array.from({length:t-e+1},(n,r)=>String.fromCharCode(e+r))}var bu=[...bo(97,122),...bo(65,90)],Io="0",vo=bo(49,57),mn=[Io,...vo],Iu=" ",pn=`
|
|
5
|
+
`;var $t="_",da=".",vu="$",fa="-";var Tu="//",$u="/*",sy="*/";function ku(e){let t=e.indexOf(sy);return M(t,-1)?"":e.slice(t+2)}function wu(e){let t=e.indexOf(pn);return M(t,-1)?"":e.slice(t)}function my(e){return e.replace(/^[ \t\r\f\v]+/,"")}function ha(e){let t=my(e);return t.startsWith($u)?ha(ku(t.slice(2))):t.startsWith(Tu)?ha(wu(t.slice(2))):t}function ce(e){let t=e.trimStart();return t.startsWith($u)?ce(ku(t.slice(2))):t.startsWith(Tu)?ce(wu(t.slice(2))):t}function ga(e,t){return S(V([e],t),(n,r)=>[n,r],()=>["",t])}function py(e,t){return e.includes(t)}function un(e,t,n,r=""){return S(V(e,n),(a,i)=>py(t,a)?un(e,t,i,r):un(e,t,i,`${r}${a}`),()=>[r,n])}function uy(e){return V(vo,e)}var cy=[...mn,$t];function ly(e){return un(cy,[$t],e)}function dy(e){return S(V([Io],e),(t,n)=>[t,n],()=>S(uy(e),(t,n)=>S(ly(n),(r,a)=>[`${t}${r}`,a],()=>[]),()=>[]))}function ya(e){return dy(ce(e))}function fy(e){return ga(fa,e)}function hy(e){return S(fy(e),(t,n)=>S(ya(n),(r,a)=>[`${t}${r}`,a],()=>[]),()=>[])}function Eu(e){return hy(ce(e))}function gy(e){return S(Eu(e),(t,n)=>S(V(["n"],n),(r,a)=>[`${t}`,a],()=>[]),()=>[])}function To(e){return gy(e)}function $o(e,t){return V([e],t)}function c(e,t){return M(e,"")?["",t]:e.startsWith(pn)?$o(e,ha(t)):e.startsWith(Iu)?$o(e,t):$o(e,ce(t))}var Su=[...bu,$t,vu];function yy(e){return V(Su,e)}var xy=[...Su,...mn];function Ru(e,t=""){return S(V(xy,e),(n,r)=>Ru(r,`${t}${n}`),()=>[t,e])}function by(e){return S(yy(e),(t,n)=>S(Ru(n),(r,a)=>[`${t}${r}`,a],()=>[]),()=>[])}function H(e){return by(ce(e))}var Iy=[...mn,$t];function vy(e){return Wn(V([da],e))}function Ou(e){return S(un(Iy,[$t],e),(t,n)=>M(t,"")?[]:[t,n],()=>[])}function Ty(e){return S(V([da],e),(t,n)=>S(Ou(n),(r,a)=>[`0${t}${r}`,a],()=>[]),()=>[])}function $y(e){return S(ya(e),(t,n)=>S(V([da],n),(r,a)=>S(Ou(a),(i,m)=>[`${t}${r}${i}`,m],()=>[`${t}`,a]),()=>[`${t}`,n]),()=>[])}function ky(e){return vy(e)?Ty(e):$y(e)}function Pu(e){return ky(ce(e))}function wy(e){return ga(fa,e)}function Ey(e){return S(wy(e),(t,n)=>S(Pu(n),(r,a)=>[`${t}${r}`,a],()=>[]),()=>[])}function xa(e){return Ey(ce(e))}function Sy(e){return M(e,"")?[]:[e.slice(0,1),e.slice(1)]}function Au(e,t){return Er(e,(n,r)=>t.startsWith(n)?!0:Au(r,t),()=>!1)}function kt(e,t,n=""){return S(Sy(t),(r,a)=>Au(e,t)?[n,t]:kt(e,a,`${n}${r}`),()=>[])}function Ry(e,t,n){return S(V([e],n),(r,a)=>S(kt([t],a),(i,m)=>S(V([t],m),(u,l)=>[`${i}`,l],()=>[]),()=>[]),()=>[])}function Oy(e,t,n){return S(V([e],n),(r,a)=>S(kt([pn,t],a),(i,m)=>S(V([t],m),(u,l)=>[`${i}`,l],()=>[]),()=>[]),()=>[])}function Cu(e,t,n,r){return n?Ry(e,t,ce(r)):Oy(e,t,ce(r))}function Py(e,t){return V(e,t)}function Ay(e,t){return Cu(e,e,!1,t)}function Cy(e,t){return S(Py(e,t),(n,r)=>Ay(n,`${n}${r}`),()=>[])}function ba(e,t){return Cy(e,ce(t))}function Mu(e,t){return S(kt(e,t),(n,r)=>M(n,"")?[]:[n,r],()=>[])}var o=(e,t,n=()=>[])=>e.length===2?t(e):n(),qy=e=>o(o(H(e),([t,n])=>o(c("extends",n),([r,a])=>o(R(a),([i,m])=>o(c("=",m),([u,l])=>o(R(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[Im(t),n]),Ly=e=>o(o(H(e),([t,n])=>o(c("extends",n),([r,a])=>o(R(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[vm(t),n]),jy=e=>o(o(H(e),([t,n])=>o(c("=",n),([r,a])=>o(R(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Tm(t),n]),Fy=e=>o(H(e),([t,n])=>[$m(t),n]),ju=e=>o(o(qy(e),([t,n])=>[t,n],()=>o(Ly(e),([t,n])=>[t,n],()=>o(jy(e),([t,n])=>[t,n],()=>o(Fy(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Fu=(e,t=[])=>o(o(ju(e),([n,r])=>o(c(",",r),([a,i])=>[[n,a],i])),([n,r])=>Fu(r,[...t,n]),()=>[t,e]),Dy=e=>o(o(Fu(e),([t,n])=>o(o(o(ju(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[km(t),n]),Eo=e=>o(o(c("<",e),([t,n])=>o(Dy(n),([r,a])=>o(c(">",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[wm(t),n]),Du=(e,t=[])=>o(o(R(e),([n,r])=>o(c(",",r),([a,i])=>[[n,a],i])),([n,r])=>Du(r,[...t,n]),()=>[t,e]),Gy=e=>o(o(Du(e),([t,n])=>o(o(o(R(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[Em(t),n]),Ny=e=>o(o(c("<",e),([t,n])=>o(Gy(n),([r,a])=>o(c(">",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Sm(t),n]),_y=e=>o(o(H(e),([t,n])=>o(Ny(n),([r,a])=>[[t,r],a])),([t,n])=>[Rm(t),n]),Gu=e=>o(o(o(c(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Om(t),n]),Nu=e=>o(c("string",e),([t,n])=>[Pm(t),n]),_u=e=>o(c("number",e),([t,n])=>[Am(t),n]),Uy=e=>o(c("boolean",e),([t,n])=>[Cm(t),n]),Ky=e=>o(c("undefined",e),([t,n])=>[Mm(t),n]),zy=e=>o(c("null",e),([t,n])=>[qm(t),n]),Uu=e=>o(c("integer",e),([t,n])=>[Lm(t),n]),By=e=>o(c("bigint",e),([t,n])=>[jm(t),n]),Vy=e=>o(c("unknown",e),([t,n])=>[Fm(t),n]),Wy=e=>o(c("any",e),([t,n])=>[Dm(t),n]),Hy=e=>o(c("object",e),([t,n])=>[Gm(t),n]),Yy=e=>o(c("never",e),([t,n])=>[Nm(t),n]),Ku=e=>o(c("symbol",e),([t,n])=>[_m(t),n]),Jy=e=>o(c("void",e),([t,n])=>[Um(t),n]),Xy=e=>o(c("this",e),([t,n])=>[Km(t),n]),Zy=e=>o(o(c("${",e),([t,n])=>o(R(n),([r,a])=>o(c("}",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Hm(t),n]),ko=e=>o(kt(["${","`"],e),([t,n])=>[Ym(t),n]),zu=e=>o(o(o(ko(e),([t,n])=>o(Zy(n),([r,a])=>o(zu(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>o(o(ko(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o(o(ko(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[Jm(t),n]),So=e=>o(o(c("`",e),([t,n])=>o(zu(n),([r,a])=>o(c("`",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Xm(t),n]),Qy=e=>o(So(e),([t,n])=>[Zm(t),n]),ex=e=>o(o(o(c("if",e),([t,n])=>o(R(n),([r,a])=>o(c("then",a),([i,m])=>o(R(m),([u,l])=>o(c("else",l),([f,h])=>o(R(h),([v,E])=>[[t,r,i,u,f,v],E])))))),([t,n])=>[t,n],()=>o(o(c("if",e),([t,n])=>o(R(n),([r,a])=>o(c("then",a),([i,m])=>o(R(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[t,n],()=>[])),([t,n])=>[Qm(t),n]),tx=e=>o(To(e),([t,n])=>[zm(t),n]),nx=e=>o(o(c("true",e),([t,n])=>[t,n],()=>o(c("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[Bm(t),n]),rx=e=>o(xa(e),([t,n])=>[Vm(t),n]),ax=e=>o(ba(["'",'"'],e),([t,n])=>[Wm(t),n]),ox=e=>o(o(o(c("keyof",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ep(t),n]),Bu=(e,t=[])=>o(o(o(c("[",e),([n,r])=>o(R(r),([a,i])=>o(c("]",i),([m,u])=>[[n,a,m],u]))),([n,r])=>[n,r],()=>o(o(c("[",e),([n,r])=>o(c("]",r),([a,i])=>[[n,a],i])),([n,r])=>[n,r],()=>[])),([n,r])=>Bu(r,[...t,n]),()=>[t,e]),ix=e=>o(Bu(e),([t,n])=>[tp(t),n]),sx=e=>o(o(o(c("extends",e),([t,n])=>o(R(n),([r,a])=>o(c("?",a),([i,m])=>o(R(m),([u,l])=>o(c(":",l),([f,h])=>o(R(h),([v,E])=>[[t,r,i,u,f,v],E])))))),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[np(t),n]),mx=e=>o(o(o(c("(",e),([t,n])=>o(R(n),([r,a])=>o(c(")",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>o(Nu(e),([t,n])=>[t,n],()=>o(_u(e),([t,n])=>[t,n],()=>o(Uy(e),([t,n])=>[t,n],()=>o(Ky(e),([t,n])=>[t,n],()=>o(zy(e),([t,n])=>[t,n],()=>o(Uu(e),([t,n])=>[t,n],()=>o(By(e),([t,n])=>[t,n],()=>o(Vy(e),([t,n])=>[t,n],()=>o(Wy(e),([t,n])=>[t,n],()=>o(Hy(e),([t,n])=>[t,n],()=>o(Yy(e),([t,n])=>[t,n],()=>o(Ku(e),([t,n])=>[t,n],()=>o(Jy(e),([t,n])=>[t,n],()=>o(Xy(e),([t,n])=>[t,n],()=>o(tx(e),([t,n])=>[t,n],()=>o(nx(e),([t,n])=>[t,n],()=>o(rx(e),([t,n])=>[t,n],()=>o(ax(e),([t,n])=>[t,n],()=>o(Qy(e),([t,n])=>[t,n],()=>o(ex(e),([t,n])=>[t,n],()=>o(vx(e),([t,n])=>[t,n],()=>o(Sx(e),([t,n])=>[t,n],()=>o(Mx(e),([t,n])=>[t,n],()=>o(Cx(e),([t,n])=>[t,n],()=>o(Fx(e),([t,n])=>[t,n],()=>o(_y(e),([t,n])=>[t,n],()=>o(Dx(e),([t,n])=>[t,n],()=>[])))))))))))))))))))))))))))),([t,n])=>[rp(t),n]),px=e=>o(o(o(c("with",e),([t,n])=>o(sc(n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ap(t),n]),Vu=e=>o(o(ox(e),([t,n])=>o(mx(n),([r,a])=>o(ix(a),([i,m])=>o(sx(m),([u,l])=>o(px(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[op(t),n]),Wu=e=>o(o(o(c("&",e),([t,n])=>o(Vu(n),([r,a])=>o(Wu(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Hu=e=>o(o(Vu(e),([t,n])=>o(Wu(n),([r,a])=>[[t,r],a])),([t,n])=>[ip(t),n]),Yu=e=>o(o(o(c("|",e),([t,n])=>o(Hu(n),([r,a])=>o(Yu(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Ia=e=>o(o(Hu(e),([t,n])=>o(Yu(n),([r,a])=>[[t,r],a])),([t,n])=>[sp(t),n]),ux=e=>o(o(c("readonly",e),([t,n])=>o(Ia(n),([r,a])=>[[t,r],a])),([t,n])=>[mp(t),n]),cx=e=>o(o(c("|",e),([t,n])=>o(Ia(n),([r,a])=>[[t,r],a])),([t,n])=>[pp(t),n]),lx=e=>o(o(Eo(e),([t,n])=>o(c("=",n),([r,a])=>o(R(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[up(t),n]),dx=e=>o(o(o(c("infer",e),([t,n])=>o(H(n),([r,a])=>o(c("extends",a),([i,m])=>o(Ia(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[t,n],()=>o(o(c("infer",e),([t,n])=>o(H(n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>[])),([t,n])=>[cp(t),n]),R=e=>o(o(dx(e),([t,n])=>[t,n],()=>o(cx(e),([t,n])=>[t,n],()=>o(ux(e),([t,n])=>[t,n],()=>o(Ia(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),fx=e=>o(xa(e),([t,n])=>[lp(t),n]),hx=e=>o(H(e),([t,n])=>[t,n]),gx=e=>o(ba(["'",'"'],e),([t,n])=>[t,n]),yx=e=>o(o(c("[",e),([t,n])=>o(H(n),([r,a])=>o(c(":",a),([i,m])=>o(o(Uu(m),([u,l])=>[u,l],()=>o(_u(m),([u,l])=>[u,l],()=>o(Nu(m),([u,l])=>[u,l],()=>o(Ku(m),([u,l])=>[u,l],()=>[])))),([u,l])=>o(c("]",l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[dp(t),n]),Ju=e=>o(o(fx(e),([t,n])=>[t,n],()=>o(hx(e),([t,n])=>[t,n],()=>o(gx(e),([t,n])=>[t,n],()=>o(yx(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),xx=e=>o(o(o(c("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[fp(t),n]),bx=e=>o(o(o(c("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[hp(t),n]),Xu=e=>o(o(xx(e),([t,n])=>o(Ju(n),([r,a])=>o(bx(a),([i,m])=>o(c(":",m),([u,l])=>o(R(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[gp(t),n]),Zu=e=>o(o(o(c(",",e),([t,n])=>o(c(`
|
|
7
6
|
`,n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o(o(c(";",e),([t,n])=>o(c(`
|
|
8
7
|
`,n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o(o(c(",",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o(o(c(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o(o(c(`
|
|
9
|
-
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))))),([t,n])=>[t,n]),
|
|
8
|
+
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))))),([t,n])=>[t,n]),Qu=(e,t=[])=>o(o(Xu(e),([n,r])=>o(Zu(r),([a,i])=>[[n,a],i])),([n,r])=>Qu(r,[...t,n]),()=>[t,e]),Ix=e=>o(o(Qu(e),([t,n])=>o(o(o(Xu(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[yp(t),n]),Ro=e=>o(o(c("{",e),([t,n])=>o(Ix(n),([r,a])=>o(c("}",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[bp(t),n]),vx=e=>o(Ro(e),([t,n])=>[Ip(t),n]),Tx=e=>o(o(o(H(e),([t,n])=>o(c("?",n),([r,a])=>o(c(":",a),([i,m])=>o(c("readonly",m),([u,l])=>o(R(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[t,n],()=>o(o(H(e),([t,n])=>o(c(":",n),([r,a])=>o(c("readonly",a),([i,m])=>o(R(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[t,n],()=>o(o(H(e),([t,n])=>o(c("?",n),([r,a])=>o(c(":",a),([i,m])=>o(R(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[t,n],()=>o(o(H(e),([t,n])=>o(c(":",n),([r,a])=>o(R(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>[])))),([t,n])=>[vp(t),n]),$x=e=>o(o(c("readonly",e),([t,n])=>o(R(n),([r,a])=>o(c("?",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Tp(t),n]),kx=e=>o(o(c("readonly",e),([t,n])=>o(R(n),([r,a])=>[[t,r],a])),([t,n])=>[$p(t),n]),wx=e=>o(o(R(e),([t,n])=>o(c("?",n),([r,a])=>[[t,r],a])),([t,n])=>[kp(t),n]),qu=e=>o(o(Tx(e),([t,n])=>[t,n],()=>o($x(e),([t,n])=>[t,n],()=>o(kx(e),([t,n])=>[t,n],()=>o(wx(e),([t,n])=>[t,n],()=>o(R(e),([t,n])=>[t,n],()=>[]))))),([t,n])=>[t,n]),ec=e=>o(o(o(c("...",e),([t,n])=>o(qu(n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o(o(qu(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[wp(t),n]),tc=(e,t=[])=>o(o(ec(e),([n,r])=>o(c(",",r),([a,i])=>[[n,a],i])),([n,r])=>tc(r,[...t,n]),()=>[t,e]),Ex=e=>o(o(tc(e),([t,n])=>o(o(o(ec(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[Ep(t),n]),Sx=e=>o(o(c("[",e),([t,n])=>o(Ex(n),([r,a])=>o(c("]",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Sp(t),n]),Rx=e=>o(o(H(e),([t,n])=>o(c("?",n),([r,a])=>o(c(":",a),([i,m])=>o(c("readonly",m),([u,l])=>o(R(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[Rp(t),n]),Ox=e=>o(o(H(e),([t,n])=>o(c(":",n),([r,a])=>o(c("readonly",a),([i,m])=>o(R(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[Op(t),n]),Px=e=>o(o(H(e),([t,n])=>o(c("?",n),([r,a])=>o(c(":",a),([i,m])=>o(R(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[Pp(t),n]),Ax=e=>o(o(H(e),([t,n])=>o(c(":",n),([r,a])=>o(R(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Ap(t),n]),Lu=e=>o(o(Rx(e),([t,n])=>[t,n],()=>o(Ox(e),([t,n])=>[t,n],()=>o(Px(e),([t,n])=>[t,n],()=>o(Ax(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),nc=e=>o(o(o(c("...",e),([t,n])=>o(Lu(n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o(o(Lu(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[Cp(t),n]),rc=(e,t=[])=>o(o(nc(e),([n,r])=>o(c(",",r),([a,i])=>[[n,a],i])),([n,r])=>rc(r,[...t,n]),()=>[t,e]),ac=e=>o(o(rc(e),([t,n])=>o(o(o(nc(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[Mp(t),n]),Cx=e=>o(o(c("(",e),([t,n])=>o(ac(n),([r,a])=>o(c(")",a),([i,m])=>o(c("=>",m),([u,l])=>o(R(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[qp(t),n]),Mx=e=>o(o(c("new",e),([t,n])=>o(c("(",n),([r,a])=>o(ac(a),([i,m])=>o(c(")",m),([u,l])=>o(c("=>",l),([f,h])=>o(R(h),([v,E])=>[[t,r,i,u,f,v],E])))))),([t,n])=>[Lp(t),n]),qx=e=>o(o(o(c("+",e),([t,n])=>o(c("readonly",n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o(o(c("-",e),([t,n])=>o(c("readonly",n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o(o(c("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[jp(t),n]),Lx=e=>o(o(o(c("+",e),([t,n])=>o(c("?",n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o(o(c("-",e),([t,n])=>o(c("?",n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o(o(c("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[Fp(t),n]),jx=e=>o(o(o(c("as",e),([t,n])=>o(R(n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Dp(t),n]),Fx=e=>o(o(c("{",e),([t,n])=>o(qx(n),([r,a])=>o(c("[",a),([i,m])=>o(H(m),([u,l])=>o(c("in",l),([f,h])=>o(R(h),([v,E])=>o(jx(E),([A,F])=>o(c("]",F),([Y,ae])=>o(Lx(ae),([me,at])=>o(c(":",at),([_,ot])=>o(R(ot),([it,Ue])=>o(Gu(Ue),([pe,Ke])=>o(c("}",Ke),([Vt,dt])=>[[t,r,i,u,f,v,A,Y,me,_,it,pe,Vt],dt]))))))))))))),([t,n])=>[Gp(t),n]),Dx=e=>o(H(e),([t,n])=>[Np(t),n]),Gx=e=>o(To(e),([t,n])=>[_p(t),n]),Nx=e=>o(xa(e),([t,n])=>[Up(t),n]),_x=e=>o(o(c("true",e),([t,n])=>[t,n],()=>o(c("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[Kp(t),n]),Ux=e=>o(ba(['"',"'"],e),([t,n])=>[t,n]),Kx=e=>o(c("null",e),([t,n])=>[zp(t),n]),zx=e=>o(c("undefined",e),([t,n])=>[void 0,n]),oc=e=>o(o(Ju(e),([t,n])=>o(c(":",n),([r,a])=>o(Oo(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Bp(t),n]),ic=(e,t=[])=>o(o(oc(e),([n,r])=>o(Zu(r),([a,i])=>[[n,a],i])),([n,r])=>ic(r,[...t,n]),()=>[t,e]),Bx=e=>o(o(ic(e),([t,n])=>o(o(o(oc(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[Vp(t),n]),sc=e=>o(o(c("{",e),([t,n])=>o(Bx(n),([r,a])=>o(c("}",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Wp(t),n]),mc=(e,t=[])=>o(o(Oo(e),([n,r])=>o(c(",",r),([a,i])=>[[n,a],i])),([n,r])=>mc(r,[...t,n]),()=>[t,e]),Vx=e=>o(o(mc(e),([t,n])=>o(o(o(Oo(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[Hp(t),n]),Wx=e=>o(o(c("[",e),([t,n])=>o(Vx(n),([r,a])=>o(c("]",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[Yp(t),n]),Oo=e=>o(o(Gx(e),([t,n])=>[t,n],()=>o(Nx(e),([t,n])=>[t,n],()=>o(_x(e),([t,n])=>[t,n],()=>o(Ux(e),([t,n])=>[t,n],()=>o(Kx(e),([t,n])=>[t,n],()=>o(zx(e),([t,n])=>[t,n],()=>o(sc(e),([t,n])=>[t,n],()=>o(Wx(e),([t,n])=>[t,n],()=>[])))))))),([t,n])=>[t,n]),Hx=e=>o(c("-?(?:0|[1-9][0-9]*)n",e),([t,n])=>[Jp(t),n]),Yx=e=>o(c(".*",e),([t,n])=>[Xp(t),n]),Jx=e=>o(c("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",e),([t,n])=>[Zp(t),n]),Xx=e=>o(c("-?(?:0|[1-9][0-9]*)",e),([t,n])=>[Qp(t),n]),Zx=e=>o(c("(?!)",e),([t,n])=>[eu(t),n]),Qx=e=>o(Mu(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,n])=>[tu(t),n]),eb=e=>o(o(Hx(e),([t,n])=>[t,n],()=>o(Yx(e),([t,n])=>[t,n],()=>o(Jx(e),([t,n])=>[t,n],()=>o(Xx(e),([t,n])=>[t,n],()=>o(Zx(e),([t,n])=>[t,n],()=>o(tb(e),([t,n])=>[t,n],()=>o(Qx(e),([t,n])=>[t,n],()=>[]))))))),([t,n])=>[t,n]),tb=e=>o(o(c("(",e),([t,n])=>o(Po(n),([r,a])=>o(c(")",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[nu(t),n]),pc=e=>o(o(o(wo(e),([t,n])=>o(c("|",n),([r,a])=>o(pc(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[t,n],()=>o(o(wo(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[]))),([t,n])=>[ru(t),n]),wo=e=>o(o(eb(e),([t,n])=>o(Po(n),([r,a])=>[[t,r],a])),([t,n])=>[au(t),n]),Po=e=>o(o(pc(e),([t,n])=>[t,n],()=>o(wo(e),([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Fs=e=>o(o(c("^",e),([t,n])=>o(Po(n),([r,a])=>o(c("$",a),([i,m])=>[[t,r,i],m]))),([t,n])=>[ou(t),n]),uc=(e,t=[])=>o(o(R(e),([n,r])=>o(c(",",r),([a,i])=>[[n,a],i])),([n,r])=>uc(r,[...t,n]),()=>[t,e]),nb=e=>o(o(uc(e),([t,n])=>o(o(o(R(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[iu(t),n]),cc=e=>o(o(o(c("extends",e),([t,n])=>o(nb(n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[su(t),n]),rb=e=>o(o(c("interface",e),([t,n])=>o(H(n),([r,a])=>o(Eo(a),([i,m])=>o(cc(m),([u,l])=>o(Ro(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[mu(t),n]),ab=e=>o(o(c("interface",e),([t,n])=>o(H(n),([r,a])=>o(cc(a),([i,m])=>o(Ro(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[pu(t),n]),ob=e=>o(o(c("type",e),([t,n])=>o(H(n),([r,a])=>o(Eo(a),([i,m])=>o(c("=",m),([u,l])=>o(R(l),([f,h])=>[[t,r,i,u,f],h]))))),([t,n])=>[uu(t),n]),ib=e=>o(o(c("type",e),([t,n])=>o(H(n),([r,a])=>o(c("=",a),([i,m])=>o(R(m),([u,l])=>[[t,r,i,u],l])))),([t,n])=>[cu(t),n]),sb=e=>o(o(o(c("export",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[lu(t),n]),mb=e=>o(o(o(c(";",e),([t,n])=>o(c(`
|
|
10
9
|
`,n),([r,a])=>[[t,r],a])),([t,n])=>[t,n],()=>o(o(c(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>o(o(c(`
|
|
11
|
-
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]),pc=(e,t=[])=>o(o(So(e),([n,r])=>o(iI(r),([a,i])=>[[n,a],i])),([n,r])=>pc(r,[...t,n]),()=>[t,e]),sI=e=>o(o(pc(e),([t,n])=>o(o(o(So(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[uu(t),n]),So=e=>o(o(oI(e),([t,n])=>o(o(tI(n),([r,a])=>[r,a],()=>o(nI(n),([r,a])=>[r,a],()=>o(rI(n),([r,a])=>[r,a],()=>o(aI(n),([r,a])=>[r,a],()=>[])))),([r,a])=>o(ju(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[cu(t),n]),mI=e=>o(o(So(e),([t,n])=>o(sI(n),([r,a])=>[[t,r],a])),([t,n])=>[lu(t),n]),uc=e=>o(o(mI(e),([t,n])=>[t,n],()=>o(ux(e),([t,n])=>[t,n],()=>o(S(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function cc(e){let t=ko(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:J()}function uI(e){return e.join("|")}function cI(e){return e.slice(1,e.length-1)}function lI(e,t,n){return wt(t,`${n}${e}`)}function dI(e,t){return wt(e,`${t}${Ss}`)}function fI(e,t){return wt(e,`${t}${Mr}`)}function hI(e,t){return wt(e,`${t}${qr}`)}function gI(e,t){return Bn(w([P("false"),P("true")]),e,t)}function yI(e,t){return wt(e,`${t}${jr}`)}function xI(e,t,n){return wt(t,`${n}${cI(e)}`)}function II(e,t,n){let r=Vn(e,{});return Bn(r,t,n)}function bI(e,t,n){let r=Se(e);return Bn(r,t,n)}function lc(e,t,n,r=[]){return s.ShiftLeft(e,(a,i)=>lc(i,t,n,[...r,Bn(a,[],"")]),()=>wt(t,`${n}(${uI(r)})`))}function Bn(e,t,n){return ye(e)?bI(e.enum,t,n):xe(e)?fI(t,n):q(e)?lI(e.const,t,n):He(e)?dI(t,n):Ae(e)?gI(t,n):X(e)?hI(t,n):Ie(e)?yI(t,n):Q(e)?xI(e.pattern,t,n):fc(e)?II(e.parameters[0],t,n):x(e)?lc(e.anyOf,t,n):ps}function wt(e,t){return s.ShiftLeft(e,(n,r)=>Bn(n,r,t),()=>t)}function vI(e){return`^${wt(e,"")}$`}function dc(e){let t=vI(e);return Dr(t)}function Vn(e,t){return k(e)?p.Update(dc(e),{},t):Wr(e,t)}function hc(e,t,n,r){let a=Oe(e,t,n);return Vn(a,r)}function Wr(e,t={}){return I("TemplateLiteral",[e],t)}function fc(e){return re(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"TemplateLiteral")}function gc(e){return Vn(e,{})}function $I(e){let t=cc(e);return gc(t)}function yc(e,t={}){let n=s.IsString(e)?$I(e):gc(e);return p.Update(n,{},t)}function Q(e){return y(e,"TemplateLiteral")}var b={};St(b,{ExtendsFalse:()=>T,ExtendsTrue:()=>g,ExtendsUnion:()=>Oo,IsExtendsFalse:()=>TI,IsExtendsTrue:()=>Ic,IsExtendsTrueLike:()=>pn,IsExtendsUnion:()=>xc,Match:()=>U});function Oo(e){return p.Create({"~kind":"ExtendsUnion"},{inferred:e})}function xc(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function g(e){return p.Create({"~kind":"ExtendsTrue"},{inferred:e})}function Ic(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function T(){return p.Create({"~kind":"ExtendsFalse"},{})}function TI(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function pn(e){return xc(e)||Ic(e)}function U(e,t,n){return pn(e)?t(e.inferred):n()}function kI(e,t,n,r){return U(C(e,n,r),a=>g(p.Assign(p.Assign(e,a),{[t]:n})),()=>T())}function wI(e,t){return g(e)}function EI(e,t,n,r,a){return U(C(e,t,n),i=>U(C(i,t,r),m=>g(m),()=>T()),()=>U(C(e,t,a),i=>g(i),()=>T()))}function RI(e,t,n){let r=Se(n);return C(e,t,r)}function bc(e,t,n){return s.ShiftLeft(n,(r,a)=>U(C(e,t,r),i=>bc(i,t,a),()=>T()),()=>g(e))}function SI(e,t,n){let r=Te(n);return C(e,t,r)}function vc(e,t,n){return s.ShiftLeft(n,(r,a)=>U(C(e,t,r),i=>g(i),()=>vc(e,t,a)),()=>T())}function j(e,t,n){return Z(n)?wI(e,t):V(n)?EI(e,t,n.if,n.then,n.else):ye(n)?RI(e,t,n.enum):Y(n)?kI(e,n.name,t,n.extends):O(n)?bc(e,t,n.allOf):Q(n)?SI(e,t,n.pattern):x(n)?vc(e,t,n.anyOf):ae(n)?g(e):T()}function $c(e,t,n){return Y(n)?j(e,t,n):Z(n)?g(e):ae(n)?g(e):Oo(e)}function OI(e,t){let n=Lt(e),r=Lt(t);return n&&r||!n&&r?!0:!(n&&!r)}function Tc(e,t,n,r){return K(r)?OI(t,r)?C(e,n,r.items):T():j(e,t,r)}function kc(e,t,n){return He(n)?g(e):j(e,t,n)}function wc(e,t,n){return Ae(n)?g(e):j(e,t,n)}function PI(e,t,n,r,a){let i=Y(r)?t:r,m=Y(r)?r:t,u=he(t),l=he(r);return!u&&l?T():U(C(e,i,m),f=>Wn(f,n,a),()=>T())}function AI(e,t,n,r){return s.ShiftLeft(r,(a,i)=>PI(e,t,n,a,i),()=>he(t)?g(e):T())}function CI(e,t,n){return s.ShiftLeft(t,(r,a)=>AI(e,r,a,n),()=>g(e))}function Wn(e,t,n){return CI(e,t,n)}function ba(e,t,n){return Ye(n)?g(e):C(e,t,n)}function Ec(e,t,n,r){return Z(r)?g(e):ae(r)?g(e):oe(r)?U(Wn(e,t,r.parameters),a=>ba(a,n,r.instanceType),()=>T()):T()}function Rc(e,t,n,r,a){return U(C(e,t,a),()=>C(e,n,a),()=>C(e,r,a))}function Sc(e,t,n){let r=Se(t);return C(e,r,n)}function Oc(e,t,n,r){return Z(r)?g(e):ae(r)?g(e):ie(r)?U(Wn(e,t,r.parameters),a=>ba(a,n,r.returnType),()=>T()):T()}function Pc(e,t,n){return xe(n)?g(e):X(n)?g(e):j(e,t,n)}function Ac(e,t,n){let r=z(t);return C(e,r,n)}function va(e,t,n){return t===n?g(e):T()}function MI(e,t,n){return q(n)?va(e,t,n.const):He(n)?g(e):j(e,P(t),n)}function LI(e,t,n){return q(n)?va(e,t,n.const):Ae(n)?g(e):j(e,P(t),n)}function qI(e,t,n){return q(n)?va(e,t,n.const):X(n)?g(e):j(e,P(t),n)}function jI(e,t,n){return q(n)?va(e,t,n.const):Ie(n)?g(e):j(e,P(t),n)}function Cc(e,t,n){return s.IsBigInt(t.const)?MI(e,t.const,n):s.IsBoolean(t.const)?LI(e,t.const,n):s.IsNumber(t.const)?qI(e,t.const,n):s.IsString(t.const)?jI(e,t.const,n):J()}function Mc(e,t,n){return Y(n)?j(e,t,n):g(e)}function Lc(e,t,n){return Xt(n)?g(e):j(e,t,n)}function qc(e,t,n){return X(n)?g(e):j(e,t,n)}function FI(e,t,n){return he(t)?he(n)?g(e):T():g(e)}function DI(e,t,n){return Y(n)&&xt(n.extends)?T():U(C(e,t,n),r=>FI(r,t,n),()=>T())}function GI(e,t){return e.reduce((n,r)=>r in t?pn(t[r])?{...n,...t[r].inferred}:J():J(),{})}function NI(e,t,n){let r={};for(let m of s.Keys(n))r[m]=m in t?DI({},t[m],n[m]):he(n[m])?Y(n[m])?g(p.Assign(e,{[n[m].name]:n[m].extends})):g(e):T();let a=s.Values(r).every(m=>pn(m)),i=a?GI(s.Keys(r),r):{};return a?g(i):T()}function _I(e,t,n){let r=NI(e,t,n);return pn(r)?g(p.Assign(e,r.inferred)):T()}function UI(e,t,n){return _I(e,t,n)}function KI(e,t){return s.Keys(t).reduce((n,r)=>({...n,[r]:s.HasPropertyKey(e,r)?x(n[r])?w([...n[r].anyOf,t[r]]):w([e[r],t[r]]):t[r]}),e)}function jc(e,t,n,r){return s.ShiftLeft(t,(a,i)=>U(C({},e[a],n),m=>jc(e,i,n,KI(r,m)),()=>T()),()=>g(r))}function zI(e,t,n,r){let a=s.Keys(t);return jc(t,a,r,e)}function Fc(e,t,n){return de(n)?zI(e,t,Le(n),be(n)):L(n)?UI(e,t,n.properties):j(e,v(t),n)}function BI(e,t){return s.IsEqual(s.Keys(t).length,0)?g(e):T()}function VI(e,t,n,r,a){return C(e,n,a)}function Dc(e,t,n,r){return de(r)?VI(e,Kr(t),n,Kr(Le(r)),be(r)):L(r)?BI(e,r.properties):Z(r)?g(e):ae(r)?g(e):T()}function Gc(e,t,n){return Ie(n)?g(e):j(e,t,n)}function Nc(e,t,n){return It(n)?g(e):j(e,t,n)}function _c(e,t,n){let r=Te(t);return C(e,r,n)}function Po(e,t){return p.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function Hn(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"name")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"Inferrable")&&s.IsString(e.name)&&s.IsObject(e.type)}function Ao(e){return $t(e)?Y(e.items)?K(e.items.extends)?Po(e.items.name,e.items.extends.items):ae(e.items.extends)?Po(e.items.name,e.items.extends):void 0:J():void 0}function $a(e){return Y(e)?Po(e.name,e.extends):void 0}function Co(e,t,n=[]){return s.ShiftLeft(e,(r,a)=>U(C({},r,t),()=>Co(a,t,[...n,r]),()=>{}),()=>n)}function Uc(e,t,n,r){let a=Co(n,r);return s.IsArray(a)?g(p.Assign(e,{[t]:ee(a)})):T()}function Ta(e,t,n,r){let a=Co(n,r);return s.IsArray(a)?g(p.Assign(e,{[t]:w(a)})):T()}function WI(e){return[...e].reverse()}function Mo(e,t){return t?WI(e):e}function HI(e){let t=e.length>0?e[0]:void 0,n=re(t)?Ao(t):void 0;return re(n)}function YI(e,t,n,r,a,i){return U(C(e,n,a),m=>Kc(m,t,r,i),()=>T())}function JI(e,t,n,r,a){let i=Ao(r);return Hn(i)?Uc(e,i.name,Mo(n,t),i.type):s.ShiftLeft(n,(m,u)=>YI(e,t,m,u,r,a),()=>T())}function ZI(e,t,n,r){return s.ShiftLeft(r,(a,i)=>JI(e,t,n,a,i),()=>s.IsEqual(n.length,0)?g(e):T())}function Kc(e,t,n,r){return ZI(e,t,n,r)}function XI(e,t,n){let r=Et(e,_([],[]),n),a=HI(r);return Kc(e,a,Mo(t,a),Mo(r,a))}function zc(e,t,n){let r=$a(n);return Hn(r)?Ta(e,r.name,t,r.type):s.ShiftLeft(t,(a,i)=>U(C(e,a,n),m=>zc(m,i,n),()=>T()),()=>g(e))}function Bc(e,t,n){let r=Et(e,_([],[]),t);return G(n)?XI(e,r,n.items):K(n)?zc(e,r,n.items):j(e,ee(r),n)}function Vc(e,t,n){return Ye(n)?g(e):an(n)?g(e):j(e,t,n)}function Wc(e,t,n){return s.ShiftLeft(n,(r,a)=>U(C(e,t,r),i=>g(i),()=>Wc(e,t,a)),()=>T())}function Lo(e,t,n){return s.ShiftLeft(t,(r,a)=>U(Wc(e,r,n),i=>Lo(i,a,n),()=>T()),()=>g(e))}function Hc(e,t,n){let r=$a(n);return Hn(r)?Ta(e,r.name,t,r.type):x(n)?Lo(e,t,n.anyOf):Lo(e,t,[n])}function Yc(e,t,n){return Y(n)?j(e,t,n):Z(n)?g(e):ae(n)?g(e):T()}function Jc(e,t,n){return Ye(n)?g(e):j(e,t,n)}function C(e,t,n){return Z(t)?$c(e,t,n):K(t)?Tc(e,t,t.items,n):He(t)?kc(e,t,n):Ae(t)?wc(e,t,n):oe(t)?Ec(e,t.parameters,t.instanceType,n):V(t)?Rc(e,t.if,t.then,t.else,n):ye(t)?Sc(e,t.enum,n):ie(t)?Oc(e,t.parameters,t.returnType,n):xe(t)?Pc(e,t,n):O(t)?Ac(e,t.allOf,n):q(t)?Cc(e,t,n):xt(t)?Mc(e,t,n):Xt(t)?Lc(e,t,n):X(t)?qc(e,t,n):L(t)?Fc(e,t.properties,n):de(t)?Dc(e,Le(t),be(t),n):Ie(t)?Gc(e,t,n):It(t)?Nc(e,t,n):Q(t)?_c(e,t.pattern,n):G(t)?Bc(e,t.items,n):an(t)?Vc(e,t,n):x(t)?Hc(e,t.anyOf,n):ae(t)?Yc(e,t,n):Ye(t)?Jc(e,t,n):T()}function QI(e,t){return z([...e,v(t)])}function qo(e,t,n){return k(e)?p.Update(QI(e,t),{},n):Nn(e,t,n)}function Zc(e,t,n,r,a){let i=Oe(e,t,n),m=Yn(e,t,r);return qo(i,m,a)}function Nn(e,t,n={}){return I("Interface",[e,t],n)}function un(e){return re(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function Xc(e,t,n={}){return qo(e,t,n)}function eb(e,t,n){return e.includes(n)?!0:Jn([...e,n],t,t[n])}function Qc(e,t,n){let r=Sr(n);return _t(e,t,r)}function _t(e,t,n){return s.ShiftLeft(n,(r,a)=>Jn(e,t,r)?!0:_t(e,t,a),()=>!1)}function Jn(e,t,n){return se(n)?eb(e,t,n.$ref):K(n)?Jn(e,t,n.items):oe(n)?_t(e,t,[...n.parameters,n.instanceType]):ie(n)?_t(e,t,[...n.parameters,n.returnType]):un(n)?Qc(e,t,n.parameters[1]):O(n)?_t(e,t,n.allOf):L(n)?Qc(e,t,n.properties):x(n)?_t(e,t,n.anyOf):G(n)?_t(e,t,n.items):de(n)?Jn(e,t,be(n)):!1}function el(e,t,n){return Jn(e,t,n)}function tb(e,t){return t.reduce((n,r)=>el([r],e,e[r])?[...n,r]:n,[])}function tl(e){let t=Rr(e);return tb(e,t)}function nb(e,t,n){return n.includes(t)?n:t in e?Zn(e,e[t],[...n,t]):J()}function nl(e,t,n){let r=Sr(t);return cn(e,r,n)}function cn(e,t,n){return t.reduce((r,a)=>Zn(e,a,r),n)}function Zn(e,t,n){return se(t)?nb(e,t.$ref,n):K(t)?Zn(e,t.items,n):oe(t)?cn(e,[...t.parameters,t.instanceType],n):ie(t)?cn(e,[...t.parameters,t.returnType],n):un(t)?nl(e,t.parameters[1],n):O(t)?cn(e,t.allOf,n):L(t)?nl(e,t.properties,n):x(t)?cn(e,t.anyOf,n):G(t)?cn(e,t.items,n):de(t)?Zn(e,be(t),n):n}function rl(e,t,n){return Zn(e,n,[t])}function rb(e){return Yt()}function ab(e){return s.Keys(e).reduce((t,n)=>({...t,[n]:Ut(e[n])}),{})}function Xn(e){return e.reduce((t,n)=>[...t,Ut(n)],[])}function Ut(e){return se(e)?rb(e.$ref):K(e)?Re(Ut(e.items),Er(e)):oe(e)?Ue(Xn(e.parameters),Ut(e.instanceType)):ie(e)?Ke(Xn(e.parameters),Ut(e.returnType)):O(e)?ge(Xn(e.allOf)):L(e)?v(ab(e.properties)):de(e)?Ur(nn(e),Ut(be(e))):x(e)?w(Xn(e.anyOf)):G(e)?ee(Xn(e.items)):e}function ob(e,t){return t in e?Ut(e[t]):me()}function al(e){return ob(e.$defs,e.$ref)}function ib(e,t,n){let r=Oe(e,_([],[]),t),a=Yn({},_([],[]),n);return z([...r,v(a)])}function sb(e,t){return s.Keys(e).filter(r=>t.includes(r)).reduce((r,a)=>{let i=e[a],m=un(i)?ib(e,i.parameters[0],i.parameters[1]):i;return{...r,[a]:m}},{})}function ol(e,t,n){let r=rl(e,t,n),a=sb(e,r);return Be(a,t)}function il(e,t){return t in e?se(e[t])?il(e,e[t].$ref):e[t]:F()}function Je(e,t){return il(e,t)}function sl(e){return ce(e)?al(e):Or(e)?me():e}function le(e,t,n){let r=sl(t),a=sl(n);return C(e,r,a)}var Ln="equal",mb="disjoint",qn="left-inside",jn="right-inside";function en(e,t){let n=[ae(e)?b.ExtendsFalse():le({},e,t),ae(e)?b.ExtendsTrue({}):le({},t,e)];return b.IsExtendsTrueLike(n[0])&&b.IsExtendsTrueLike(n[1])?Ln:b.IsExtendsTrueLike(n[0])&&b.IsExtendsFalse(n[1])?qn:b.IsExtendsFalse(n[0])&&b.IsExtendsTrueLike(n[1])?jn:mb}function pb(e,t){return t.filter(n=>en(e,n)!==jn)}function ub(e,t){let n=t.some(r=>{let a=en(e,r);return s.IsEqual(a,qn)||s.IsEqual(a,Ln)});return s.IsEqual(n,!1)}function cb(e,t){let n=Me(e);return Z(n)?[n]:ub(n,t)?[...pb(n,t),n]:t}function lb(e){return e.reduce((t,n)=>L(n)?[...t,n]:xt(n)?t:cb(n,t),[])}function lo(e){let t=lb(e);return Dn(t)}function jo(e,t){return p.Update(Me(e),{},t)}function ml(e,t,n,r){let a=d(e,t,n);return jo(a,r)}function Qn(e,t=[]){return gt(e)&&s.IsEqual(e.action,"Conditional")?se(e.parameters[0])?Qn(e.parameters[2],Qn(e.parameters[3],[...t,e.parameters[0].$ref])):Qn(e.parameters[2],Qn(e.parameters[3],t)):gt(e)&&s.IsEqual(e.action,"Mapped")&>(e.parameters[1])&&s.IsEqual(e.parameters[1].action,"KeyOf")&&se(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function db(e,t){return e.reduce((n,r)=>[...n,t.includes(r.name)],[])}function cl(e,t,n=[]){return s.ShiftLeft(e,(r,a)=>s.ShiftLeft(t,(i,m)=>cl(a,m,[...n,[i,r]]),()=>n),()=>n)}function fb(e){return x(e)?[...e.anyOf]:[e]}function hb(e,t){return e.reduce((n,r)=>[...n,[...r,t]],[])}function pl(e,t){return t.reduce((n,r)=>[...n,...hb(e,r)],[])}function ul(e){return e.reduce((t,n)=>s.IsEqual(n[0],!0)?pl(t,fb(n[1])):pl(t,[n[1]]),[[]])}function ll(e,t,n){let r=Qn(n),a=db(e,r),i=cl(t,a);return gt(n)&&s.IsEqual(n.action,"Conditional")||gt(n)&&s.IsEqual(n.action,"Mapped")?ul(i):[t]}function gb(){return["(not-resolvable)",F()]}function yb(){return["(not-generic)",F()]}function xb(e,t,n){return[e,yt(t,n)]}function Ib(e,t,n){return t in e?dl(e,t,e[t],n):gb()}function dl(e,t,n,r){return Ht(n)?xb(t,n.parameters,n.expression):se(n)?Ib(e,n.$ref,r):yb()}function fl(e,t,n){return dl(e,"(anonymous)",t,n)}function bb(e,t,n){if(Y(t)||ln(t)||b.IsExtendsTrueLike(le({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw new Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function hl(e,t,n,r,a){let i=d(e,t,a);return bb(n,i,r),p.Assign(e,{[n]:i})}function vb(e,t,n,r,a){let i=d(e,t,n.extends),m=d(e,t,n.equals);return s.ShiftLeft(a,(u,l)=>Fo(hl(e,t,n.name,i,u),t,r,l),()=>Fo(hl(e,t,n.name,i,m),t,r,[]))}function Fo(e,t,n,r){return s.ShiftLeft(n,(a,i)=>vb(e,t,a,i,r),()=>e)}function gl(e,t,n,r){return Fo(e,t,n,r)}function $b(e){return s.IsGreaterThan(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function Tb(e,t){return s.IsEqual($b(e),t)}function kb(e,t,n,r,a,i){let m=gl(e,t,r,i),u=d(m,_([...t.callstack,n.$ref],t.visited),a);return d(m,_([],[]),u)}function wb(e,t,n,r,a,i){return i.reduce((m,u)=>[...m,kb(e,t,n,r,a,u)],[])}function Eb(e,t,n,r,a,i){let m=ll(r,i,a),u=wb(e,t,n,r,a,m);return s.IsEqual(u.length,1)?u[0]:we(u)}function ka(e,t,n,r){let a=Oe(e,t,r),i=fl(e,n,r),m=i[0],u=i[1];return Ht(u)?Tb(t,m)?_n(st(m),a):Eb(e,t,st(m),u.parameters,u.expression,a):_n(n,a)}function _n(e,t){return p.Create({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function yl(e,t){return ka({},_([],[]),e,t)}function ln(e){return y(e,"Call")}function Rb(e){return p.Discard(e,["~immutable"])}function xl(e,t){return p.Update(Rb(e),{},t)}function Il(e,t,n,r){let a=d(e,t,n);return xl(a,r)}function bl(e,t){return e(t)}function vl(e,t){return s.IsString(t)?P(bl(e,t)):P(t)}function $l(e,t){let n=Te(t);return ut(e,n)}function Tl(e,t){let n=t.map(r=>ut(e,r));return w(n)}function ut(e,t){return q(t)?vl(e,t.const):Q(t)?$l(e,t.pattern):x(t)?Tl(e,t.anyOf):t}function Hr(e,t={}){return I("Capitalize",[e],t)}function kl(e,t={}){return Do(e,t)}function Yr(e,t={}){return I("Lowercase",[e],t)}function wl(e,t={}){return Go(e,t)}function Jr(e,t={}){return I("Uncapitalize",[e],t)}function El(e,t={}){return No(e,t)}function Zr(e,t={}){return I("Uppercase",[e],t)}function Rl(e,t={}){return _o(e,t)}var Sb=e=>e[0].toUpperCase()+e.slice(1),Ob=e=>e.toLowerCase(),Pb=e=>e[0].toLowerCase()+e.slice(1),Ab=e=>e.toUpperCase();function Do(e,t){return k([e])?p.Update(ut(Sb,e),{},t):Hr(e,t)}function Go(e,t){return k([e])?p.Update(ut(Ob,e),{},t):Yr(e,t)}function No(e,t){return k([e])?p.Update(ut(Pb,e),{},t):Jr(e,t)}function _o(e,t){return k([e])?p.Update(ut(Ab,e),{},t):Zr(e,t)}function Sl(e,t,n,r){let a=d(e,t,n);return Do(a,r)}function Ol(e,t,n,r){let a=d(e,t,n);return Go(a,r)}function Pl(e,t,n,r){let a=d(e,t,n);return No(a,r)}function Al(e,t,n,r){let a=d(e,t,n);return _o(a,r)}function Xr(e,t,n,r,a={}){return I("Conditional",[e,t,n,r],a)}function Cl(e,t,n,r,a={}){return Uo({},_([],[]),e,t,n,r,a)}function Cb(e,t,n,r,a,i){let m=le(e,n,r);return b.IsExtendsUnion(m)?w([d(m.inferred,t,a),d(e,t,i)]):b.IsExtendsTrue(m)?d(m.inferred,t,a):d(e,t,i)}function Uo(e,t,n,r,a,i,m){return k([n,r])?p.Update(Cb(e,t,n,r,a,i),{},m):Xr(n,r,a,i,m)}function Ml(e,t,n,r,a,i,m){let u=d(e,t,n),l=d(e,t,r);return Uo(e,t,u,l,a,i,m)}function Qr(e,t={}){return I("ConstructorParameters",[e],t)}function Ll(e,t={}){return Ko(e,t)}function Mb(e){let t=oe(e)?e.parameters:[],n=Et({},_([],[]),t);return ee(n)}function Ko(e,t){return k([e])?p.Update(Mb(e),{},t):Qr(e,t)}function ql(e,t,n,r){let a=d(e,t,n);return Ko(a,r)}function ea(e,t,n={}){return I("Exclude",[e,t],n)}function jl(e,t,n={}){return er(e,t,n)}function er(e,t,n){return k([e,t])?p.Update(Nr(e,t),{},n):ea(e,t,n)}function Fl(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return er(i,m,a)}function ta(e,t,n={}){return I("Extract",[e,t],n)}function Dl(e,t,n={}){return zo(e,t,n)}function Lb(e,t){let n=le({},e,t);return b.IsExtendsTrueLike(n)?[e]:[]}function qb(e,t){return e.reduce((n,r)=>[...n,...Lb(r,t)],[])}function Gl(e,t){let n=Me(e),r=x(n)?n.anyOf:[n],a=qb(r,t);return we(a)}function zo(e,t,n){return k([e,t])?p.Update(Gl(e,t),{},n):ta(e,t,n)}function Nl(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return zo(i,m,a)}function jb(e){return e.reduce((t,n)=>Lr(n)?[...t,P(n)]:t,[])}function dn(e){let t=jb(e);return w(t)}function Un(e,t,n={}){return I("Index",[e,t],n)}function _l(e,t,n={}){let r=s.IsArray(t)?dn(t):t;return Bo(e,r,n)}function Ul(e,t){let n=Je(e,t);return Pe(n)}function Kl(e,t,n){let r=Ne(e,t,n);return Pe(r)}function Fb(e,t){let n=s.Keys(e).filter(h=>!s.HasPropertyKey(t,h)),r=s.Keys(t).filter(h=>!s.HasPropertyKey(e,h)),a=s.Keys(e).filter(h=>s.HasPropertyKey(t,h)),i=n.reduce((h,$)=>({...h,[$]:e[$]}),{}),m=r.reduce((h,$)=>({...h,[$]:t[$]}),{}),u=a.reduce((h,$)=>({...h,[$]:z([e[$],t[$]])}),{}),l=p.Assign(i,m);return p.Assign(l,u)}function zl(e){return e.reduce((t,n)=>Fb(t,Pe(n)),{})}function Bl(e){let t=Js(ee(e));return Pe(t)}function Db(e,t){return s.Keys(e).filter(a=>a in t).reduce((a,i)=>({...a,[i]:we([e[i],t[i]])}),{})}function Vl(e,t){return s.ShiftLeft(e,(n,r)=>Vl(r,Db(t,Pe(n))),()=>t)}function Wl(e){return s.ShiftLeft(e,(t,n)=>Vl(n,Pe(t)),()=>J())}function Pe(e){return ce(e)?Ul(e.$defs,e.$ref):V(e)?Kl(e.if,e.then,e.else):O(e)?zl(e.allOf):x(e)?Wl(e.anyOf):G(e)?Bl(e.items):L(e)?e.properties:{}}function fn(e){let t=Pe(e);return v(t)}var Gb=new RegExp("^(?:0|[1-9][0-9]*)$");function hn(e){let t=`${e}`;return Gb.test(t)?parseInt(t):e}function Nb(e){return P(hn(e))}function Hl(e){return e.map(t=>Yl(t))}function Yl(e){return O(e)?ge(Hl(e.allOf)):x(e)?w(Hl(e.anyOf)):q(e)?Nb(e.const):e}function Jl(e,t){let n=Yl(t),r=le({},n,ke());return b.IsExtendsTrueLike(r)?e:q(t)&&s.IsEqual(t.const,"length")?ke():F()}function Zl(e,t){let n=Je(e,t);return Ee(n)}function Xl(e,t,n){let r=Ne(e,t,n);return Ee(r)}function Ql(e){let t=Se(e);return Ee(t)}function ed(e){let t=z(e);return Ee(t)}function td(e){return[`${e}`]}function nd(e){let t=Te(e);return Ee(t)}function rd(e){return e.reduce((t,n)=>[...t,...Ee(n)],[])}function Ee(e){return ce(e)?Zl(e.$defs,e.$ref):V(e)?Xl(e.if,e.then,e.else):ye(e)?Ql(e.enum):O(e)?ed(e.allOf):q(e)?td(e.const):Q(e)?nd(e.pattern):x(e)?rd(e.anyOf):[]}function gn(e){return Ee(e)}function tr(e,t){return t.map(n=>nr(e,n))}function nr(e,t){return K(t)?Re(nr(e,t.items)):oe(t)?Ue(tr(e,t.parameters),nr(e,t.instanceType)):ie(t)?Ke(tr(e,t.parameters),nr(e,t.returnType)):G(t)?ee(tr(e,t.items)):x(t)?w(tr(e,t.anyOf)):O(t)?ge(tr(e,t.allOf)):Br(t)?v(e):t}function ad(e,t){return nr(e,t)}function _b(e,t){let n=t in e?e[t]:F();return ad(e,n)}function od(e,t){return t.reduce((n,r)=>[...n,_b(e,r)],[])}function Ub(e,t){let n=gn(t),r=od(e,n);return we(r)}var Kb=new RegExp(vt);function zb(e){return e.filter(n=>Kb.test(n))}function Bb(e){let t=Rr(e),n=zb(t),r=od(e,n);return we(r)}function id(e,t){return X(t)?Bb(e):Ub(e,t)}function Vb(e){return P(hn(e))}function sd(e){return e.map(t=>Vo(t))}function Vo(e){return O(e)?ge(sd(e.allOf)):x(e)?w(sd(e.anyOf)):q(e)?Vb(e.const):e}function Wb(e,t){return e.reduceRight((n,r,a)=>{let i=le({},P(a),t);return b.IsExtendsTrueLike(i)?[r,...n]:n},[])}function Hb(e,t){let n=Vo(t),r=Wb(e,n);return mt(r)}function Yb(e){return mt(e)}function md(e,t){return q(t)&&s.IsEqual(t.const,"length")?P(e.length):X(t)||xe(t)?Yb(e):Hb(e,t)}function pd(e,t){return K(e)?Jl(e.items,t):L(e)?id(e.properties,t):G(e)?md(e.items,t):F()}function Jb(e){return ce(e)||V(e)||O(e)||x(e)?fn(e):e}function Bo(e,t,n){return k([e,t])?p.Update(pd(Jb(e),t),{},n):Un(e,t,n)}function ud(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return Bo(i,m,a)}function na(e,t={}){return I("InstanceType",[e],t)}function cd(e,t={}){return Wo(e,t)}function Zb(e){return oe(e)?e.instanceType:F()}function Wo(e,t){return k([e])?p.Update(Zb(e),{},t):na(e,t)}function ld(e,t,n,r={}){let a=d(e,t,n);return Wo(a,r)}function Kn(e,t={}){return I("KeyOf",[e],t)}function dd(e,t={}){return Ho(e,t)}function fd(){return w([ke(),Ce(),Qt()])}function hd(e){return ke()}function Xb(e){return e.reduce((n,r)=>Lr(r)?[...n,P(hn(r))]:J(),[])}function gd(e){let t=s.Keys(e),n=Xb(t);return mt(n)}function yd(e){return nn(e)}function xd(e){let t=e.map((n,r)=>P(r));return mt(t)}function Id(e){return Z(e)?fd():K(e)?hd(e.items):L(e)?gd(e.properties):de(e)?yd(e):G(e)?xd(e.items):F()}function Qb(e){return ce(e)||V(e)||O(e)||x(e)?fn(e):e}function Ho(e,t){return k([e])?p.Update(Id(Qb(e)),{},t):Kn(e,t)}function bd(e,t,n,r){let a=d(e,t,n);return Ho(a,r)}function Gn(e,t,n,r,a={}){return I("Mapped",[e,t,n,r],a)}function vd(e,t,n,r,a={}){return Yo({},_([],[]),e,t,n,r,a)}function ev(e){let t=Te(e);return wa(t)}function tv(e){return e.reduce((t,n)=>[...t,...wa(n)],[])}function nv(e){let t=Se(e);return wa(t)}function rv(e){return s.IsNumber(e)?[P(`${e}`)]:[P(e)]}function wa(e){return ye(e)?nv(e.enum):q(e)?rv(e.const):Q(e)?ev(e.pattern):x(e)?tv(e.anyOf):[e]}function $d(e){return wa(e)}function av(e){return Q(e)?Te(e.pattern):e}function ov(e,t,n,r,a,i){let m=p.Assign(e,{[n.name]:r}),u=d(m,t,a),l=av(u),f=d(m,t,i);return Ps(l)||As(l)?{[l.const]:f}:{}}function iv(e,t,n,r,a,i){return r.reduce((m,u)=>[...m,ov(e,t,n,u,a,i)],[])}function sv(e){return e.reduce((t,n)=>[...t,v(n)],[])}function Td(e,t,n,r,a,i){let m=$d(r),u=iv(e,t,n,m,a,i),l=sv(u);return z(l)}function Yo(e,t,n,r,a,i,m){return k([r])?p.Update(Td(e,t,n,r,a,i),{},m):Gn(n,r,a,i,m)}function kd(e,t,n,r,a,i,m){let u=d(e,t,r);return Yo(e,t,n,u,a,i,m)}function mv(e,t,n){let r=p.Assign(e,t);return s.Keys(t).filter(i=>n.includes(i)).reduce((i,m)=>({...i,[m]:ol(r,m,t[m])}),{})}function pv(e,t,n){let r=p.Assign(e,t);return s.Keys(t).filter(i=>!n.includes(i)).reduce((i,m)=>({...i,[m]:d(r,_([],[]),t[m])}),{})}function uv(e,t,n){let r=tl(t),a=mv(e,t,r),i=pv(e,t,r),m={...a,...i};return p.Update(m,{},n)}function Ea(e,t,n,r){return uv(e,n,r)}function ra(e,t={}){return I("NonNullable",[e],t)}function wd(e,t={}){return Jo(e,t)}function cv(e){let t=w([Zt(),rn()]);return er(e,t,{})}function Jo(e,t){return k([e])?p.Update(cv(e),{},t):ra(e,t)}function Ed(e,t,n,r){let a=d(e,t,n);return Jo(a,r)}function aa(e,t,n={}){return I("Omit",[e,t],n)}function Rd(e,t,n={}){let r=s.IsArray(t)?dn(t):t;return Zo(e,r,n)}function Ra(e){let t=fn(e);return L(t)?t.properties:J()}function lv(e,t){return s.Keys(e).reduce((r,a)=>t.includes(a)?r:{...r,[a]:e[a]},{})}function Sd(e,t){let n=Ra(e),r=gn(t),a=lv(n,r);return v(a)}function Zo(e,t,n){return k([e,t])?p.Update(Sd(e,t),{},n):aa(e,t,n)}function Od(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return Zo(i,m,a)}function oa(e,t={}){return I("Parameters",[e],t)}function Pd(e,t={}){return Xo(e,t)}function dv(e){let t=ie(e)?e.parameters:[],n=Et({},_([],[]),t);return ee(n)}function Xo(e,t){return k([e])?p.Update(dv(e),{},t):oa(e,t)}function Ad(e,t,n,r){let a=d(e,t,n);return Xo(a,r)}function ia(e,t={}){return I("Partial",[e],t)}function Cd(e,t={}){return Qo(e,t)}function Md(e,t){let n=Je(e,t),r=Ze(n);return Be(p.Assign(e,{[t]:r}),t)}function Ld(e,t,n){let r=Ne(e,t,n);return Ze(r)}function qd(e){let t=z(e);return Ze(t)}function jd(e){let t=e.map(n=>Ze(n));return w(t)}function Fd(e){let t=s.Keys(e).reduce((r,a)=>({...r,[a]:Ct(e[a])}),{});return v(t)}function Ze(e){return ce(e)?Md(e.$defs,e.$ref):V(e)?Ld(e.if,e.then,e.else):O(e)?qd(e.allOf):x(e)?jd(e.anyOf):L(e)?Fd(e.properties):v({})}function Qo(e,t){return k([e])?p.Update(Ze(e),{},t):ia(e,t)}function Dd(e,t,n,r){let a=d(e,t,n);return Qo(a,r)}function sa(e,t,n={}){return I("Pick",[e,t],n)}function Gd(e,t,n={}){let r=s.IsArray(t)?dn(t):t;return ei(e,r,n)}function fv(e,t){return s.Keys(e).reduce((r,a)=>t.includes(a)?p.Assign(r,{[a]:e[a]}):r,{})}function Nd(e,t){let n=Ra(e),r=gn(t),a=fv(n,r);return v(a)}function ei(e,t,n){return k([e,t])?p.Update(Nd(e,t),{},n):sa(e,t,n)}function _d(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return ei(i,m,a)}function ma(e,t={}){return I("ReadonlyObject",[e],t)}function ti(e,t={}){return ni(e,t)}var Ud=ti;function Kd(e){return Jt(Re(e))}function zd(e,t){let n=Je(e,t),r=Xe(n);return Be(p.Assign(e,{[t]:r}),t)}function Bd(e,t,n){let r=Ne(e,t,n);return Xe(r)}function Vd(e){let t=z(e);return Xe(t)}function Wd(e){let t=s.Keys(e).reduce((r,a)=>({...r,[a]:qt(e[a])}),{});return v(t)}function Hd(e){return Jt(ee(e))}function Yd(e){let t=e.map(n=>Xe(n));return w(t)}function Xe(e){return K(e)?Kd(e.items):ce(e)?zd(e.$defs,e.$ref):V(e)?Bd(e.if,e.then,e.else):O(e)?Vd(e.allOf):L(e)?Wd(e.properties):G(e)?Hd(e.items):x(e)?Yd(e.anyOf):e}function ni(e,t){return k([e])?p.Update(Xe(e),{},t):ma(e)}function Jd(e,t,n,r){let a=d(e,t,n);return ni(a,r)}function Zd(e,t,n,r){return t.visited.includes(r)?n:r in e?d(e,_(t.callstack,[...t.visited,r]),e[r]):n}function Xd(e,t){let n=Je(e,t),r=Qe(n);return Be(p.Assign(e,{[t]:r}),t)}function Qd(e,t,n){let r=Ne(e,t,n);return Qe(r)}function ef(e){let t=z(e);return Qe(t)}function tf(e){let t=e.map(n=>Qe(n));return w(t)}function nf(e){let t=s.Keys(e).reduce((r,a)=>({...r,[a]:Gr(e[a])}),{});return v(t)}function Qe(e){return ce(e)?Xd(e.$defs,e.$ref):V(e)?Qd(e.if,e.then,e.else):O(e)?ef(e.allOf):x(e)?tf(e.anyOf):L(e)?nf(e.properties):v({})}function pa(e,t={}){return I("Required",[e],t)}function rf(e,t={}){return ri(e,t)}function ri(e,t){return k([e])?p.Update(Qe(e),{},t):pa(e,t)}function af(e,t,n,r){let a=d(e,t,n);return ri(a,r)}function ua(e,t={}){return I("ReturnType",[e],t)}function of(e,t={}){return ai(e,t)}function hv(e){return ie(e)?e.returnType:F()}function ai(e,t){return k([e])?p.Update(hv(e),{},t):ua(e,t)}function sf(e,t,n,r={}){let a=d(e,t,n);return ai(a,r)}function ca(e,t){return I("With",[e,t],{})}function mf(e,t){return oi(e,t)}function oi(e,t){return k([e])?p.Update(e,{},t):ca(e,t)}function pf(e,t,n,r){let a=d(e,t,n);return oi(a,r)}function gv(e){return $t(e)?G(e.items)?ii(e.items.items):Y(e.items)?[e]:se(e.items)?[e]:[F()]:[e]}function ii(e){return e.reduce((n,r)=>[...n,...gv(r)],[])}function _(e,t){return{callstack:e,visited:t}}function k(e){return s.ShiftLeft(e,(t,n)=>se(t)?!1:k(n),()=>!0)}function Yn(e,t,n){return s.Keys(n).reduce((r,a)=>({...r,[a]:d(e,t,n[a])}),{})}function Et(e,t,n){let r=Oe(e,t,n);return ii(r)}function Oe(e,t,n){return n.map(r=>d(e,t,r))}function yv(e,t){let n=he(e)?Rn(t,{}):t,r=jt(e)?En(n,{}):n;return Lt(e)?rr(r,{}):r}function xv(e,t,n,r,a){return s.IsEqual(n,"AddImmutable")?uf(e,t,r[0],a):s.IsEqual(n,"RemoveImmutable")?Il(e,t,r[0],a):s.IsEqual(n,"AddReadonly")?os(e,t,r[0],a):s.IsEqual(n,"RemoveReadonly")?Bs(e,t,r[0],a):s.IsEqual(n,"AddOptional")?is(e,t,r[0],a):s.IsEqual(n,"RemoveOptional")?Hs(e,t,r[0],a):s.IsEqual(n,"Capitalize")?Sl(e,t,r[0],a):s.IsEqual(n,"Conditional")?Ml(e,t,r[0],r[1],r[2],r[3],a):s.IsEqual(n,"ConstructorParameters")?ql(e,t,r[0],a):s.IsEqual(n,"Evaluate")?ml(e,t,r[0],a):s.IsEqual(n,"Exclude")?Fl(e,t,r[0],r[1],a):s.IsEqual(n,"Extract")?Nl(e,t,r[0],r[1],a):s.IsEqual(n,"Index")?ud(e,t,r[0],r[1],a):s.IsEqual(n,"InstanceType")?ld(e,t,r[0],a):s.IsEqual(n,"Interface")?Zc(e,t,r[0],r[1],a):s.IsEqual(n,"KeyOf")?bd(e,t,r[0],a):s.IsEqual(n,"Lowercase")?Ol(e,t,r[0],a):s.IsEqual(n,"Mapped")?kd(e,t,r[0],r[1],r[2],r[3],a):s.IsEqual(n,"Module")?Ea(e,t,r[0],a):s.IsEqual(n,"NonNullable")?Ed(e,t,r[0],a):s.IsEqual(n,"Pick")?_d(e,t,r[0],r[1],a):s.IsEqual(n,"Parameters")?Ad(e,t,r[0],a):s.IsEqual(n,"Partial")?Dd(e,t,r[0],a):s.IsEqual(n,"Omit")?Od(e,t,r[0],r[1],a):s.IsEqual(n,"ReadonlyObject")?Jd(e,t,r[0],a):s.IsEqual(n,"Record")?cm(e,t,r[0],r[1],a):s.IsEqual(n,"Required")?af(e,t,r[0],a):s.IsEqual(n,"ReturnType")?sf(e,t,r[0],a):s.IsEqual(n,"TemplateLiteral")?hc(e,t,r[0],a):s.IsEqual(n,"Uncapitalize")?Pl(e,t,r[0],a):s.IsEqual(n,"Uppercase")?Al(e,t,r[0],a):s.IsEqual(n,"With")?pf(e,t,r[0],r[1]):I(n,r,a)}function Iv(e,t,n){let r=se(n)?Zd(e,t,n,n.$ref):K(n)?Re(d(e,t,n.items),Er(n)):ln(n)?ka(e,t,n.target,n.arguments):oe(n)?Ue(Oe(e,t,n.parameters),d(e,t,n.instanceType),ss(n)):ie(n)?Ke(Oe(e,t,n.parameters),d(e,t,n.returnType),ms(n)):V(n)?Mt(d(e,t,n.if),d(e,t,n.then),d(e,t,n.else),fs(n)):O(n)?ge(Oe(e,t,n.allOf),Is(n)):L(n)?v(Yn(e,t,n.properties),ls(n)):de(n)?lm(Le(n),d(e,t,be(n))):$t(n)?Gt(d(e,t,n.items)):G(n)?ee(Et(e,t,n.items),zs(n)):x(n)?w(Oe(e,t,n.anyOf),Ms(n)):n;return yv(n,r)}function d(e,t,n){return gt(n)?xv(e,t,n.action,n.parameters,n.options):Iv(e,t,n)}function si(e,t){return d(e,_([],[]),t)}function bv(e){return p.Update(e,{"~immutable":!0},{})}function rr(e,t){return p.Update(bv(e),{},t)}function uf(e,t,n,r){let a=d(e,t,n);return rr(a,r)}function du(e,t={}){return I("AddImmutable",[e],t)}function Jt(e,t={}){return rr(e,t)}function fu(e,t={}){return I("Evaluate",[e],t)}function cf(e,t={}){return jo(e,t)}function hu(e,t={}){return I("Module",[e],t)}function lf(e,t={}){return Ea({},_([],[]),e,t)}function df(...e){let[t,n,r]=Ve.Match(e,{2:(m,u)=>s.IsString(m)?[{},m,u]:[m,u,{}],3:(m,u,l)=>[m,u,l],1:m=>[{},m,{}]}),a=uc(n),i=s.IsArray(a)&&s.IsEqual(a.length,2)?d(t,_([],[]),a[0]):F();return p.Update(i,{},r)}var D={};St(D,{Any:()=>Yt,Array:()=>Re,BigInt:()=>An,Boolean:()=>Cr,Call:()=>yl,Capitalize:()=>kl,Codec:()=>Ar,Conditional:()=>Cl,Constructor:()=>Ue,ConstructorParameters:()=>Ll,Cyclic:()=>Be,Decode:()=>Ts,DecodeBuilder:()=>Pn,Dependent:()=>Mt,Encode:()=>ks,EncodeBuilder:()=>On,Enum:()=>xs,Evaluate:()=>cf,Exclude:()=>jl,Extends:()=>le,ExtendsResult:()=>b,Extract:()=>Dl,Function:()=>Ke,Generic:()=>yt,Identifier:()=>Cn,Immutable:()=>ws,Index:()=>_l,Infer:()=>Sn,InstanceType:()=>cd,Instantiate:()=>si,Integer:()=>Ft,Interface:()=>Xc,Intersect:()=>ge,IsAny:()=>Z,IsArray:()=>K,IsBigInt:()=>He,IsBoolean:()=>Ae,IsCall:()=>ln,IsCodec:()=>Pr,IsConstructor:()=>oe,IsCyclic:()=>ce,IsDependent:()=>V,IsEnum:()=>ye,IsEnumValue:()=>ys,IsFunction:()=>ie,IsGeneric:()=>Ht,IsIdentifier:()=>Os,IsImmutable:()=>Lt,IsInfer:()=>Y,IsInteger:()=>xe,IsIntersect:()=>O,IsKind:()=>y,IsLiteral:()=>q,IsNever:()=>xt,IsNull:()=>Xt,IsNumber:()=>X,IsObject:()=>L,IsOptional:()=>he,IsParameter:()=>Cs,IsReadonly:()=>jt,IsRecord:()=>de,IsRef:()=>se,IsRefine:()=>io,IsRest:()=>$t,IsSchema:()=>re,IsString:()=>Ie,IsSymbol:()=>It,IsTemplateLiteral:()=>Q,IsThis:()=>Br,IsTuple:()=>G,IsUndefined:()=>an,IsUnion:()=>x,IsUnknown:()=>ae,IsUnsafe:()=>Or,IsVoid:()=>Ye,KeyOf:()=>dd,Literal:()=>P,Lowercase:()=>wl,Mapped:()=>vd,Module:()=>lf,Never:()=>F,NonNullable:()=>wd,Null:()=>Zt,Number:()=>ke,Object:()=>v,Omit:()=>Rd,Optional:()=>us,Parameter:()=>Dt,Parameters:()=>Pd,Partial:()=>Cd,Pick:()=>Gd,Readonly:()=>Es,ReadonlyObject:()=>ti,ReadonlyType:()=>Ud,Record:()=>Ur,RecordKey:()=>nn,RecordPattern:()=>Le,RecordValue:()=>be,Ref:()=>st,Refine:()=>Rs,Required:()=>rf,Rest:()=>Gt,ReturnType:()=>of,Script:()=>df,String:()=>Ce,Symbol:()=>Qt,TemplateLiteral:()=>yc,This:()=>zr,Tuple:()=>ee,Uncapitalize:()=>El,Undefined:()=>rn,Union:()=>w,Unknown:()=>me,Unsafe:()=>ds,Uppercase:()=>Rl,Void:()=>Vr,With:()=>mf});var ar="submit_test_gap_candidates",or="submit_filtered_test_gaps",ir="submit_solver_gaps",a8=D.Object({verdict:D.Union([D.Literal("PASS"),D.Literal("FAIL")],{description:"FAIL only for a genuine blocking issue (clear rubric violation, agent-fault-worthy gap, unfair/undiscoverable test requirement, or a real determinism/regression risk). Optional, minor, or stylistic points are NOT grounds for FAIL \u2014 put those in `notes` instead and use PASS."}),summary:D.String({description:"One short sentence summarizing the verdict."}),reasons:D.Array(D.String(),{description:"Specific BLOCKING justifications only, citing rubric item IDs and concrete evidence from the files you read. Required (non-empty) when verdict is FAIL. Use an empty array when verdict is PASS."}),notes:D.Array(D.String(),{description:"Non-blocking, optional/minor observations or suggested improvements \u2014 the kind of feedback a real reviewer leaves as 'Minor/optional' without failing the task. Include these regardless of verdict; use an empty array if you truly have none."})});var vv=D.Object({statement:D.String({description:"One sentence from agent_prompt.md, copied verbatim."}),gaps:D.Array(D.Object({description:D.String({description:"A fair, publicly observable missing behavioral test."}),risk:D.String({description:"Why an incorrect implementation could pass the current tests despite this missing behavior."})}),{description:"All candidate positive and negative gaps for this sentence; there is no maximum or target count, so include every distinct evidence-backed gap and relevant edge case rather than stopping at 10; use an empty array only when exhaustive analysis finds none."})});function ff(e){return{name:ar,label:"Submit Candidate Test Gaps",description:"Submit one candidate-gap list for one prompt sentence. Call this after each sentence so the orchestrator can track the todo list; empty lists are required when that sentence has no gaps.",parameters:vv,async execute(t,n){let r=e.statements??[];return r.push({statement:n.statement,gaps:n.gaps??[]}),e.statements=r,{content:[{type:"text",text:`Recorded ${n.gaps?.length??0} candidate gap(s)`}],details:void 0}}}}var $v=D.Object({gaps:D.Array(D.Object({description:D.String({description:"The confirmed, real, fair test gap (may be reworded for clarity). Keep POSITIVE:/NEGATIVE: prefix when applicable."}),justification:D.String({description:"Why this is genuinely grounded in agent_prompt.md or the repo, fair to test per the fairness methodology, and a real (non-duplicate) coverage hole in test.patch \u2014 for negative gaps, cite the prompt's prohibition/constraint and why no existing test catches the forbidden outcome."})}),{description:"The filtered, final list of confirmed test gaps. Use an empty array if none of the candidates survive strict scrutiny."})});function hf(e){return{name:or,label:"Submit Filtered Test Gaps",description:"Submit your final, strictly filtered list of confirmed test gaps. This is the ONLY way to report your result \u2014 call it exactly once, as your last action, after you have independently verified each candidate.",parameters:$v,async execute(t,n){let r=n.gaps??[];return e.gaps=r,{content:[{type:"text",text:`Confirmed ${r.length} gap(s) after filtering`}],details:void 0}}}}var Tv=D.Object({gaps:D.Array(D.Object({description:D.String({description:"The specific behavioral gap: a way one or more solver's diff differs materially from what agent_prompt.md/solution.patch require, despite that solver passing `./test.sh new`."}),justification:D.String({description:"Why this is a genuine requirement from agent_prompt.md or solution.patch (cite the specific requirement/line) that the solver's diff misses, contradicts, or diverges from \u2014 and why the current tests fail to catch that divergence."}),evidence:D.String({description:"Which solver(s) (by index) exhibit this, and the specific part of their diff that grounds the gap."})}),{description:"Concrete, diff-grounded behavioral gaps \u2014 cases where a passing solver's materially different approach reveals that `test.sh new` under-specifies a real requirement. Use an empty array if the solvers converged on equivalent behavior; do not manufacture gaps just to report something."})});function gf(e){return{name:ir,label:"Submit Solver Gaps",description:"Submit your final list of behavioral gaps found by comparing the solver diffs against the real solution.patch. This is the ONLY way to report your result \u2014 call it exactly once, as your last action, after you have finished comparing every solver.",parameters:Tv,async execute(t,n){let r=n.gaps??[];return e.gaps=r,{content:[{type:"text",text:`Recorded ${r.length} solver gap(s)`}],details:void 0}}}}function kv(e){return[e,"You are working inside the actual repository (this is your current directory) in read-only mode. You have access to read/grep/find/ls tools only \u2014 you cannot execute code or edit files.","Read `agent_prompt.md` for the task requirements and inspect the repository's existing source/code files with read/grep/find/ls. Base the analysis on the prompt and the observable behavior supported by those code files."]}var wv=["Thoroughness \u2014 your job is high recall on genuine gaps only:","- There is no target count or cap: do not stop at 10 (or any other arbitrary number). For each prompt sentence, enumerate as many distinct uncovered required behaviors and edge cases as the files justify, then continue until an additional sweep finds no new genuine gap.","- Find every gap you can justify with concrete evidence. Do not stop after the first obvious ones \u2014 keep reading until you have systematically covered the prompt and relevant repository code.","- After your first pass, run at least one deliberate second sweep (re-read `agent_prompt.md` and grep/read the relevant code files) before submitting \u2014 but if that sweep still finds nothing, submit an empty list.","- Do not self-censor or merge distinct genuine gaps into one \u2014 the validator will prune. Never invent or pad the list to seem thorough; an empty array is correct when exhaustive analysis truly finds none.","- Hunt subtle gaps too: behaviors that may be missed under other valid inputs, repository conventions, interaction effects, ordering/timing, and branches in the relevant source code that need behavioral coverage.","- Include a candidate only when you can cite specific grounding and a concrete false-pass risk \u2014 not to meet a quota."],yf=["Fairness rules \u2014 apply these to every proposed gap and every proposed assertion:","- Ground every candidate in a specific sentence or requirement in `agent_prompt.md`, or in an existing public contract that is clear and directly relevant in the repository. Record the observable behavior and the plausible incorrect implementation that could pass without this check. Do not create requirements from intuition, taste, general best practice, or a desire for more coverage.","- Treat `agent_prompt.md` as the task contract. Existing source can clarify how an already-public API behaves and can make an established convention discoverable, but a neighboring helper, default, example, or implementation choice does not automatically become a requirement for a new behavior. If repository evidence is absent, mixed, or contradictory, leave the detail open rather than choosing one interpretation.","- A fair check must be expressible through a user-visible result, a caller-visible side effect, a named public API, or another documented/public contract. Do not require private state, private helpers, internal classes, file placement, module boundaries, call order, a particular algorithm, or a particular direct platform/API call when another repo-valid route produces the required outcome.","- A newly invented function, class, property, export, constructor, method name, argument shape, import path, or registry/config key is not a fair requirement merely because it would be a convenient way to test the feature. Require a new API only when `agent_prompt.md` names it, or when the API already exists publicly and the task explicitly relies on it.","- For UI behavior, assert the user-facing control, label, visible state, accessible action, or resulting effect when that is the contract. Do not require a particular DOM hierarchy, tag, CSS class, selector, test/data attribute, ARIA attribute, hidden-shim text, focus order, keyboard traversal, or control implementation unless the prompt or an established public UI contract explicitly requires it.","- Test semantics rather than source representation. Do not pin quote style, whitespace, line breaks, token adjacency, identifier spelling, generated-source wording, code length, AST node shape, type-text spelling, serialization style, or a particular equivalent syntax when the resulting behavior is the same. Normalize, parse, compile, or observe the result when that is necessary to compare equivalent forms.","- For structured results, assert the fields, values, relationships, ordering, and preservation that the contract actually requires. Allow additional valid fields and metadata unless the prompt explicitly forbids them. Do not compare a whole object, list, mapping, or serialized document to a minimal reference-shaped object when only a subset of its contents is contractual.","- Do not infer a concrete value from relational wording. Terms such as current, latest, selected, next, matching, appropriate, or stable require the stated relationship or effect, not an arbitrary numeric or serialized value. Pin a concrete value only when the prompt or a clear existing public contract determines it.","- Do not infer an exact ordering, grouping, cardinality, count, or error-counting model from incidental map order, loop order, a convenient fixture, or one implementation. Require ordering or counts only when the contract makes them observable; otherwise assert membership, relationships, preservation, and the required effect without choosing a granularity the prompt leaves open.","- Do not invent an input-domain policy for unspecified cases. Do not require acceptance or rejection of a particular malformed, nullish, Unicode, unusually large, boolean-like, platform-specific, symlink, missing-parent, or other boundary value unless the prompt or an established public contract settles that case. A sensible API policy is not automatically the specified policy.","- For failures, assert the failure or user-visible error behavior required by the contract. Do not require a specific exception class, message wording, punctuation, embedded input value, capitalization, basename, validation phase, or eager-versus-deferred timing unless it is explicitly promised or publicly established. If the contract only says an operation fails clearly, accept equivalent clear failures.","- Respect asynchronous and lazy contracts. If the prompt promises an eventual effect, do not require a callback to return a promise, immediate settlement, a particular debounce interval, construction-time validation, or one exact observation point. Trigger the public operation and observe or wait for the promised result at a fair boundary.","- Do not select an outcome for an underspecified mode boundary. Dry-run, preview, no-op, conflict, rollback, cache, preflight, and post-context-change behavior may have multiple valid outcomes unless the prompt chooses one. Test the guarantees that are stated, such as non-mutation or reporting, without adding a rejection, write, refresh, or validation policy that was not stated.","- Do not convert an incidental side effect into a requirement. For a no-op or reuse case, test the required content, state, preservation, or absence of duplicate effects; do not additionally require an empty file, directory, cache entry, history item, or other artifact to exist or not exist unless that artifact is part of the contract.","- For logs and status messages, check that the required operation or failure is reported when reporting is contractual. Do not demand arbitrary English words, formatting, punctuation, path spelling, message fragments, or exact output layout when the prompt only requires that the operation be communicated.","- A fair behavioral test must not depend on a hidden harness's mock shape, a source-level monkeypatch landing at one import binding, an incomplete module mock, reassigned exported state, a particular failure-injection primitive, or a synthetic fixture that violates real repository invariants. A reasonable implementation must be able to use the repository's valid public exports and state model without being rejected by the setup.","- Distinguish the semantic goal from the assertion form. If a candidate contains a fair behavioral core plus an unsupported value, representation, timing, API, or harness assumption, keep or rewrite the fair core and remove only the unsupported co-assertion. Do not discard a real gap merely because the first proposed assertion was too specific.","- Edge-case coverage is valuable only when the edge case is required or discoverable. Do not report 'more negative tests would be nice' or every conceivable malformed input. Keep a candidate only when it is distinct, publicly testable, concretely grounded, and could let a materially incorrect implementation pass.","- When uncertain, re-read the exact prompt sentence and the closest public source analogues. If two competent implementations can satisfy the contract while differing on the proposed assertion, the assertion is not fair; return the semantic relationship instead or drop the candidate. An empty result is correct when no candidate survives this standard."],xf=yf,Ev=yf;function If(e,t){let n=[...kv("You are an exhaustive behavioral test-gap finder. Review the task prompt sentence by sentence, finding both missing required-behavior (positive) and missing forbidden/wrong-behavior (negative) tests."),"","First split `agent_prompt.md` into its meaningful sentences using periods (`.`) as the sentence boundary. Create an explicit TODO checklist of every resulting requirement sentence. Work through it one item at a time; do not finish until every item is checked off.","","Before analyzing each sentence, use read/grep/find/ls to inspect the relevant source files and their closest analogues. Use that code context to understand the public contracts, conventions, branches, guards, early returns, state transitions, side effects, boundary handling, and negative/prohibited outcomes required by the sentence. Report every distinct, prompt-required behavioral edge case or prohibition that a plausible implementation could miss. Include positive and negative gaps together for that sentence. There is no maximum number of gaps: keep enumerating distinct missing behaviors for this sentence, including boundary, empty, repeated, interacting, and other relevant edge cases; do not treat 10 as sufficient.","",...wv,"",...xf,"","Test-coverage checklist for calibration:",e];return n.push("","Fairness: keep only behavior that a user, caller, or existing public contract can observe. Do not require private helpers, internal state, implementation structure, call order, selectors, or incidental strings unless the task explicitly makes them public requirements."),n.push("","For every candidate, state the missing fair behavioral test, the relevant source behavior or branch that led you to investigate it, and why a plausible incorrect implementation could evade that test. The prompt sentence is the required specification: do not report incidental implementation details it does not require. Do not propose the exact test implementation.",`After completing EACH TODO sentence, call \`${ar}\` with that exact sentence and its gap array (including an empty array when none exist). You may and must call the tool multiple times: once per sentence. Only finish after every TODO item has been submitted.`),n.join(`
|
|
12
|
-
`)}function
|
|
13
|
-
`)}function
|
|
14
|
-
`)}function
|
|
15
|
-
`)}var
|
|
10
|
+
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]),lc=(e,t=[])=>o(o(Ao(e),([n,r])=>o(mb(r),([a,i])=>[[n,a],i])),([n,r])=>lc(r,[...t,n]),()=>[t,e]),pb=e=>o(o(lc(e),([t,n])=>o(o(o(Ao(n),([r,a])=>[[r],a]),([r,a])=>[r,a],()=>o([[],n],([r,a])=>[r,a],()=>[])),([r,a])=>[[t,r],a])),([t,n])=>[du(t),n]),Ao=e=>o(o(sb(e),([t,n])=>o(o(rb(n),([r,a])=>[r,a],()=>o(ab(n),([r,a])=>[r,a],()=>o(ob(n),([r,a])=>[r,a],()=>o(ib(n),([r,a])=>[r,a],()=>[])))),([r,a])=>o(Gu(a),([i,m])=>[[t,r,i],m]))),([t,n])=>[fu(t),n]),ub=e=>o(o(Ao(e),([t,n])=>o(pb(n),([r,a])=>[[t,r],a])),([t,n])=>[hu(t),n]),dc=e=>o(o(ub(e),([t,n])=>[t,n],()=>o(lx(e),([t,n])=>[t,n],()=>o(R(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function fc(e){let t=So(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:X()}function lb(e){return e.join("|")}function db(e){return e.slice(1,e.length-1)}function fb(e,t,n){return wt(t,`${n}${e}`)}function hb(e,t){return wt(e,`${t}${As}`)}function gb(e,t){return wt(e,`${t}${qr}`)}function yb(e,t){return wt(e,`${t}${jr}`)}function xb(e,t){return Hn(w([P("false"),P("true")]),e,t)}function bb(e,t){return wt(e,`${t}${Fr}`)}function Ib(e,t,n){return wt(t,`${n}${db(e)}`)}function vb(e,t,n){let r=Yn(e,{});return Hn(r,t,n)}function Tb(e,t,n){let r=Oe(e);return Hn(r,t,n)}function hc(e,t,n,r=[]){return s.ShiftLeft(e,(a,i)=>hc(i,t,n,[...r,Hn(a,[],"")]),()=>wt(t,`${n}(${lb(r)})`))}function Hn(e,t,n){return xe(e)?Tb(e.enum,t,n):be(e)?gb(t,n):L(e)?fb(e.const,t,n):Xe(e)?hb(t,n):Ce(e)?xb(t,n):Q(e)?yb(t,n):Ie(e)?bb(t,n):ee(e)?Ib(e.pattern,t,n):yc(e)?vb(e.parameters[0],t,n):x(e)?hc(e.anyOf,t,n):ls}function wt(e,t){return s.ShiftLeft(e,(n,r)=>Hn(n,r,t),()=>t)}function $b(e){return`^${wt(e,"")}$`}function gc(e){let t=$b(e);return Gr(t)}function Yn(e,t){return k(e)?p.Update(gc(e),{},t):Hr(e,t)}function xc(e,t,n,r){let a=Pe(e,t,n);return Yn(a,r)}function Hr(e,t={}){return b("TemplateLiteral",[e],t)}function yc(e){return ne(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"TemplateLiteral")}function bc(e){return Yn(e,{})}function kb(e){let t=fc(e);return bc(t)}function Ic(e,t={}){let n=s.IsString(e)?kb(e):bc(e);return p.Update(n,{},t)}function ee(e){return y(e,"TemplateLiteral")}var I={};Rt(I,{ExtendsFalse:()=>$,ExtendsTrue:()=>g,ExtendsUnion:()=>Co,IsExtendsFalse:()=>wb,IsExtendsTrue:()=>Tc,IsExtendsTrueLike:()=>cn,IsExtendsUnion:()=>vc,Match:()=>K});function Co(e){return p.Create({"~kind":"ExtendsUnion"},{inferred:e})}function vc(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function g(e){return p.Create({"~kind":"ExtendsTrue"},{inferred:e})}function Tc(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function $(){return p.Create({"~kind":"ExtendsFalse"},{})}function wb(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function cn(e){return vc(e)||Tc(e)}function K(e,t,n){return cn(e)?t(e.inferred):n()}function Eb(e,t,n,r){return K(C(e,n,r),a=>g(p.Assign(p.Assign(e,a),{[t]:n})),()=>$())}function Sb(e,t){return g(e)}function Rb(e,t,n,r,a){return K(C(e,t,n),i=>K(C(i,t,r),m=>g(m),()=>$()),()=>K(C(e,t,a),i=>g(i),()=>$()))}function Ob(e,t,n){let r=Oe(n);return C(e,t,r)}function $c(e,t,n){return s.ShiftLeft(n,(r,a)=>K(C(e,t,r),i=>$c(i,t,a),()=>$()),()=>g(e))}function Pb(e,t,n){let r=ke(n);return C(e,t,r)}function kc(e,t,n){return s.ShiftLeft(n,(r,a)=>K(C(e,t,r),i=>g(i),()=>kc(e,t,a)),()=>$())}function j(e,t,n){return Z(n)?Sb(e,t):W(n)?Rb(e,t,n.if,n.then,n.else):xe(n)?Ob(e,t,n.enum):J(n)?Eb(e,n.name,t,n.extends):O(n)?$c(e,t,n.allOf):ee(n)?Pb(e,t,n.pattern):x(n)?kc(e,t,n.anyOf):re(n)?g(e):$()}function wc(e,t,n){return J(n)?j(e,t,n):Z(n)?g(e):re(n)?g(e):Co(e)}function Ab(e,t){let n=qt(e),r=qt(t);return n&&r||!n&&r?!0:!(n&&!r)}function Ec(e,t,n,r){return z(r)?Ab(t,r)?C(e,n,r.items):$():j(e,t,r)}function Sc(e,t,n){return Xe(n)?g(e):j(e,t,n)}function Rc(e,t,n){return Ce(n)?g(e):j(e,t,n)}function Cb(e,t,n,r,a){let i=J(r)?t:r,m=J(r)?r:t,u=ge(t),l=ge(r);return!u&&l?$():K(C(e,i,m),f=>Jn(f,n,a),()=>$())}function Mb(e,t,n,r){return s.ShiftLeft(r,(a,i)=>Cb(e,t,n,a,i),()=>ge(t)?g(e):$())}function qb(e,t,n){return s.ShiftLeft(t,(r,a)=>Mb(e,r,a,n),()=>g(e))}function Jn(e,t,n){return qb(e,t,n)}function va(e,t,n){return Ze(n)?g(e):C(e,t,n)}function Oc(e,t,n,r){return Z(r)?g(e):re(r)?g(e):oe(r)?K(Jn(e,t,r.parameters),a=>va(a,n,r.instanceType),()=>$()):$()}function Pc(e,t,n,r,a){return K(C(e,t,a),()=>C(e,n,a),()=>C(e,r,a))}function Ac(e,t,n){let r=Oe(t);return C(e,r,n)}function Cc(e,t,n,r){return Z(r)?g(e):re(r)?g(e):ie(r)?K(Jn(e,t,r.parameters),a=>va(a,n,r.returnType),()=>$()):$()}function Mc(e,t,n){return be(n)?g(e):Q(n)?g(e):j(e,t,n)}function qc(e,t,n){let r=B(t);return C(e,r,n)}function Ta(e,t,n){return t===n?g(e):$()}function Lb(e,t,n){return L(n)?Ta(e,t,n.const):Xe(n)?g(e):j(e,P(t),n)}function jb(e,t,n){return L(n)?Ta(e,t,n.const):Ce(n)?g(e):j(e,P(t),n)}function Fb(e,t,n){return L(n)?Ta(e,t,n.const):Q(n)?g(e):j(e,P(t),n)}function Db(e,t,n){return L(n)?Ta(e,t,n.const):Ie(n)?g(e):j(e,P(t),n)}function Lc(e,t,n){return s.IsBigInt(t.const)?Lb(e,t.const,n):s.IsBoolean(t.const)?jb(e,t.const,n):s.IsNumber(t.const)?Fb(e,t.const,n):s.IsString(t.const)?Db(e,t.const,n):X()}function jc(e,t,n){return J(n)?j(e,t,n):g(e)}function Fc(e,t,n){return en(n)?g(e):j(e,t,n)}function Dc(e,t,n){return Q(n)?g(e):j(e,t,n)}function Gb(e,t,n){return ge(t)?ge(n)?g(e):$():g(e)}function Nb(e,t,n){return J(n)&&xt(n.extends)?$():K(C(e,t,n),r=>Gb(r,t,n),()=>$())}function _b(e,t){return e.reduce((n,r)=>r in t?cn(t[r])?{...n,...t[r].inferred}:X():X(),{})}function Ub(e,t,n){let r={};for(let m of s.Keys(n))r[m]=m in t?Nb({},t[m],n[m]):ge(n[m])?J(n[m])?g(p.Assign(e,{[n[m].name]:n[m].extends})):g(e):$();let a=s.Values(r).every(m=>cn(m)),i=a?_b(s.Keys(r),r):{};return a?g(i):$()}function Kb(e,t,n){let r=Ub(e,t,n);return cn(r)?g(p.Assign(e,r.inferred)):$()}function zb(e,t,n){return Kb(e,t,n)}function Bb(e,t){return s.Keys(t).reduce((n,r)=>({...n,[r]:s.HasPropertyKey(e,r)?x(n[r])?w([...n[r].anyOf,t[r]]):w([e[r],t[r]]):t[r]}),e)}function Gc(e,t,n,r){return s.ShiftLeft(t,(a,i)=>K(C({},e[a],n),m=>Gc(e,i,n,Bb(r,m)),()=>$()),()=>g(r))}function Vb(e,t,n,r){let a=s.Keys(t);return Gc(t,a,r,e)}function Nc(e,t,n){return fe(n)?Vb(e,t,Le(n),ve(n)):q(n)?zb(e,t,n.properties):j(e,T(t),n)}function Wb(e,t){return s.IsEqual(s.Keys(t).length,0)?g(e):$()}function Hb(e,t,n,r,a){return C(e,n,a)}function _c(e,t,n,r){return fe(r)?Hb(e,zr(t),n,zr(Le(r)),ve(r)):q(r)?Wb(e,r.properties):Z(r)?g(e):re(r)?g(e):$()}function Uc(e,t,n){return Ie(n)?g(e):j(e,t,n)}function Kc(e,t,n){return bt(n)?g(e):j(e,t,n)}function zc(e,t,n){let r=ke(t);return C(e,r,n)}function Mo(e,t){return p.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function Xn(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"name")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"Inferrable")&&s.IsString(e.name)&&s.IsObject(e.type)}function qo(e){return Tt(e)?J(e.items)?z(e.items.extends)?Mo(e.items.name,e.items.extends.items):re(e.items.extends)?Mo(e.items.name,e.items.extends):void 0:X():void 0}function $a(e){return J(e)?Mo(e.name,e.extends):void 0}function Lo(e,t,n=[]){return s.ShiftLeft(e,(r,a)=>K(C({},r,t),()=>Lo(a,t,[...n,r]),()=>{}),()=>n)}function Bc(e,t,n,r){let a=Lo(n,r);return s.IsArray(a)?g(p.Assign(e,{[t]:te(a)})):$()}function ka(e,t,n,r){let a=Lo(n,r);return s.IsArray(a)?g(p.Assign(e,{[t]:w(a)})):$()}function Yb(e){return[...e].reverse()}function jo(e,t){return t?Yb(e):e}function Jb(e){let t=e.length>0?e[0]:void 0,n=ne(t)?qo(t):void 0;return ne(n)}function Xb(e,t,n,r,a,i){return K(C(e,n,a),m=>Vc(m,t,r,i),()=>$())}function Zb(e,t,n,r,a){let i=qo(r);return Xn(i)?Bc(e,i.name,jo(n,t),i.type):s.ShiftLeft(n,(m,u)=>Xb(e,t,m,u,r,a),()=>$())}function Qb(e,t,n,r){return s.ShiftLeft(r,(a,i)=>Zb(e,t,n,a,i),()=>s.IsEqual(n.length,0)?g(e):$())}function Vc(e,t,n,r){return Qb(e,t,n,r)}function eI(e,t,n){let r=Et(e,U([],[]),n),a=Jb(r);return Vc(e,a,jo(t,a),jo(r,a))}function Wc(e,t,n){let r=$a(n);return Xn(r)?ka(e,r.name,t,r.type):s.ShiftLeft(t,(a,i)=>K(C(e,a,n),m=>Wc(m,i,n),()=>$()),()=>g(e))}function Hc(e,t,n){let r=Et(e,U([],[]),t);return N(n)?eI(e,r,n.items):z(n)?Wc(e,r,n.items):j(e,te(r),n)}function Yc(e,t,n){return Ze(n)?g(e):sn(n)?g(e):j(e,t,n)}function Jc(e,t,n){return s.ShiftLeft(n,(r,a)=>K(C(e,t,r),i=>g(i),()=>Jc(e,t,a)),()=>$())}function Fo(e,t,n){return s.ShiftLeft(t,(r,a)=>K(Jc(e,r,n),i=>Fo(i,a,n),()=>$()),()=>g(e))}function Xc(e,t,n){let r=$a(n);return Xn(r)?ka(e,r.name,t,r.type):x(n)?Fo(e,t,n.anyOf):Fo(e,t,[n])}function Zc(e,t,n){return J(n)?j(e,t,n):Z(n)?g(e):re(n)?g(e):$()}function Qc(e,t,n){return Ze(n)?g(e):j(e,t,n)}function C(e,t,n){return Z(t)?wc(e,t,n):z(t)?Ec(e,t,t.items,n):Xe(t)?Sc(e,t,n):Ce(t)?Rc(e,t,n):oe(t)?Oc(e,t.parameters,t.instanceType,n):W(t)?Pc(e,t.if,t.then,t.else,n):xe(t)?Ac(e,t.enum,n):ie(t)?Cc(e,t.parameters,t.returnType,n):be(t)?Mc(e,t,n):O(t)?qc(e,t.allOf,n):L(t)?Lc(e,t,n):xt(t)?jc(e,t,n):en(t)?Fc(e,t,n):Q(t)?Dc(e,t,n):q(t)?Nc(e,t.properties,n):fe(t)?_c(e,Le(t),ve(t),n):Ie(t)?Uc(e,t,n):bt(t)?Kc(e,t,n):ee(t)?zc(e,t.pattern,n):N(t)?Hc(e,t.items,n):sn(t)?Yc(e,t,n):x(t)?Xc(e,t.anyOf,n):re(t)?Zc(e,t,n):Ze(t)?Qc(e,t,n):$()}function tI(e,t){return B([...e,T(t)])}function Do(e,t,n){return k(e)?p.Update(tI(e,t),{},n):Kn(e,t,n)}function el(e,t,n,r,a){let i=Pe(e,t,n),m=Zn(e,t,r);return Do(i,m,a)}function Kn(e,t,n={}){return b("Interface",[e,t],n)}function ln(e){return ne(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function tl(e,t,n={}){return Do(e,t,n)}function nI(e,t,n){return e.includes(n)?!0:Qn([...e,n],t,t[n])}function nl(e,t,n){let r=Or(n);return _t(e,t,r)}function _t(e,t,n){return s.ShiftLeft(n,(r,a)=>Qn(e,t,r)?!0:_t(e,t,a),()=>!1)}function Qn(e,t,n){return se(n)?nI(e,t,n.$ref):z(n)?Qn(e,t,n.items):oe(n)?_t(e,t,[...n.parameters,n.instanceType]):ie(n)?_t(e,t,[...n.parameters,n.returnType]):ln(n)?nl(e,t,n.parameters[1]):O(n)?_t(e,t,n.allOf):q(n)?nl(e,t,n.properties):x(n)?_t(e,t,n.anyOf):N(n)?_t(e,t,n.items):fe(n)?Qn(e,t,ve(n)):!1}function rl(e,t,n){return Qn(e,t,n)}function rI(e,t){return t.reduce((n,r)=>rl([r],e,e[r])?[...n,r]:n,[])}function al(e){let t=Rr(e);return rI(e,t)}function aI(e,t,n){return n.includes(t)?n:t in e?er(e,e[t],[...n,t]):X()}function ol(e,t,n){let r=Or(t);return dn(e,r,n)}function dn(e,t,n){return t.reduce((r,a)=>er(e,a,r),n)}function er(e,t,n){return se(t)?aI(e,t.$ref,n):z(t)?er(e,t.items,n):oe(t)?dn(e,[...t.parameters,t.instanceType],n):ie(t)?dn(e,[...t.parameters,t.returnType],n):ln(t)?ol(e,t.parameters[1],n):O(t)?dn(e,t.allOf,n):q(t)?ol(e,t.properties,n):x(t)?dn(e,t.anyOf,n):N(t)?dn(e,t.items,n):fe(t)?er(e,ve(t),n):n}function il(e,t,n){return er(e,n,[t])}function oI(e){return Xt()}function iI(e){return s.Keys(e).reduce((t,n)=>({...t,[n]:Ut(e[n])}),{})}function tr(e){return e.reduce((t,n)=>[...t,Ut(n)],[])}function Ut(e){return se(e)?oI(e.$ref):z(e)?Re(Ut(e.items),Sr(e)):oe(e)?Be(tr(e.parameters),Ut(e.instanceType)):ie(e)?Ve(tr(e.parameters),Ut(e.returnType)):O(e)?ye(tr(e.allOf)):q(e)?T(iI(e.properties)):fe(e)?Kr(an(e),Ut(ve(e))):x(e)?w(tr(e.anyOf)):N(e)?te(tr(e.items)):e}function sI(e,t){return t in e?Ut(e[t]):ue()}function sl(e){return sI(e.$defs,e.$ref)}function mI(e,t,n){let r=Pe(e,U([],[]),t),a=Zn({},U([],[]),n);return B([...r,T(a)])}function pI(e,t){return s.Keys(e).filter(r=>t.includes(r)).reduce((r,a)=>{let i=e[a],m=ln(i)?mI(e,i.parameters[0],i.parameters[1]):i;return{...r,[a]:m}},{})}function ml(e,t,n){let r=il(e,t,n),a=pI(e,r);return He(a,t)}function pl(e,t){return t in e?se(e[t])?pl(e,e[t].$ref):e[t]:D()}function Qe(e,t){return pl(e,t)}function ul(e){return le(e)?sl(e):Pr(e)?ue():e}function de(e,t,n){let r=ul(t),a=ul(n);return C(e,r,a)}var Fn="equal",uI="disjoint",Dn="left-inside",Gn="right-inside";function nn(e,t){let n=[re(e)?I.ExtendsFalse():de({},e,t),re(e)?I.ExtendsTrue({}):de({},t,e)];return I.IsExtendsTrueLike(n[0])&&I.IsExtendsTrueLike(n[1])?Fn:I.IsExtendsTrueLike(n[0])&&I.IsExtendsFalse(n[1])?Dn:I.IsExtendsFalse(n[0])&&I.IsExtendsTrueLike(n[1])?Gn:uI}function cI(e,t){return t.filter(n=>nn(e,n)!==Gn)}function lI(e,t){let n=t.some(r=>{let a=nn(e,r);return s.IsEqual(a,Dn)||s.IsEqual(a,Fn)});return s.IsEqual(n,!1)}function dI(e,t){let n=qe(e);return Z(n)?[n]:lI(n,t)?[...cI(n,t),n]:t}function fI(e){return e.reduce((t,n)=>q(n)?[...t,n]:xt(n)?t:dI(n,t),[])}function go(e){let t=fI(e);return _n(t)}function Go(e,t){return p.Update(qe(e),{},t)}function cl(e,t,n,r){let a=d(e,t,n);return Go(a,r)}function nr(e,t=[]){return gt(e)&&s.IsEqual(e.action,"Conditional")?se(e.parameters[0])?nr(e.parameters[2],nr(e.parameters[3],[...t,e.parameters[0].$ref])):nr(e.parameters[2],nr(e.parameters[3],t)):gt(e)&&s.IsEqual(e.action,"Mapped")&>(e.parameters[1])&&s.IsEqual(e.parameters[1].action,"KeyOf")&&se(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function hI(e,t){return e.reduce((n,r)=>[...n,t.includes(r.name)],[])}function fl(e,t,n=[]){return s.ShiftLeft(e,(r,a)=>s.ShiftLeft(t,(i,m)=>fl(a,m,[...n,[i,r]]),()=>n),()=>n)}function gI(e){return x(e)?[...e.anyOf]:[e]}function yI(e,t){return e.reduce((n,r)=>[...n,[...r,t]],[])}function ll(e,t){return t.reduce((n,r)=>[...n,...yI(e,r)],[])}function dl(e){return e.reduce((t,n)=>s.IsEqual(n[0],!0)?ll(t,gI(n[1])):ll(t,[n[1]]),[[]])}function hl(e,t,n){let r=nr(n),a=hI(e,r),i=fl(t,a);return gt(n)&&s.IsEqual(n.action,"Conditional")||gt(n)&&s.IsEqual(n.action,"Mapped")?dl(i):[t]}function xI(){return["(not-resolvable)",D()]}function bI(){return["(not-generic)",D()]}function II(e,t,n){return[e,yt(t,n)]}function vI(e,t,n){return t in e?gl(e,t,e[t],n):xI()}function gl(e,t,n,r){return Jt(n)?II(t,n.parameters,n.expression):se(n)?vI(e,n.$ref,r):bI()}function yl(e,t,n){return gl(e,"(anonymous)",t,n)}function TI(e,t,n){if(J(t)||fn(t)||I.IsExtendsTrueLike(de({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw new Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function xl(e,t,n,r,a){let i=d(e,t,a);return TI(n,i,r),p.Assign(e,{[n]:i})}function $I(e,t,n,r,a){let i=d(e,t,n.extends),m=d(e,t,n.equals);return s.ShiftLeft(a,(u,l)=>No(xl(e,t,n.name,i,u),t,r,l),()=>No(xl(e,t,n.name,i,m),t,r,[]))}function No(e,t,n,r){return s.ShiftLeft(n,(a,i)=>$I(e,t,a,i,r),()=>e)}function bl(e,t,n,r){return No(e,t,n,r)}function kI(e){return s.IsGreaterThan(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function wI(e,t){return s.IsEqual(kI(e),t)}function EI(e,t,n,r,a,i){let m=bl(e,t,r,i),u=d(m,U([...t.callstack,n.$ref],t.visited),a);return d(m,U([],[]),u)}function SI(e,t,n,r,a,i){return i.reduce((m,u)=>[...m,EI(e,t,n,r,a,u)],[])}function RI(e,t,n,r,a,i){let m=hl(r,i,a),u=SI(e,t,n,r,a,m);return s.IsEqual(u.length,1)?u[0]:Ee(u)}function wa(e,t,n,r){let a=Pe(e,t,r),i=yl(e,n,r),m=i[0],u=i[1];return Jt(u)?wI(t,m)?zn(pt(m),a):RI(e,t,pt(m),u.parameters,u.expression,a):zn(n,a)}function zn(e,t){return p.Create({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function Il(e,t){return wa({},U([],[]),e,t)}function fn(e){return y(e,"Call")}function OI(e){return p.Discard(e,["~immutable"])}function vl(e,t){return p.Update(OI(e),{},t)}function Tl(e,t,n,r){let a=d(e,t,n);return vl(a,r)}function $l(e,t){return e(t)}function kl(e,t){return s.IsString(t)?P($l(e,t)):P(t)}function wl(e,t){let n=ke(t);return lt(e,n)}function El(e,t){let n=t.map(r=>lt(e,r));return w(n)}function lt(e,t){return L(t)?kl(e,t.const):ee(t)?wl(e,t.pattern):x(t)?El(e,t.anyOf):t}function Yr(e,t={}){return b("Capitalize",[e],t)}function Sl(e,t={}){return _o(e,t)}function Jr(e,t={}){return b("Lowercase",[e],t)}function Rl(e,t={}){return Uo(e,t)}function Xr(e,t={}){return b("Uncapitalize",[e],t)}function Ol(e,t={}){return Ko(e,t)}function Zr(e,t={}){return b("Uppercase",[e],t)}function Pl(e,t={}){return zo(e,t)}var PI=e=>e[0].toUpperCase()+e.slice(1),AI=e=>e.toLowerCase(),CI=e=>e[0].toLowerCase()+e.slice(1),MI=e=>e.toUpperCase();function _o(e,t){return k([e])?p.Update(lt(PI,e),{},t):Yr(e,t)}function Uo(e,t){return k([e])?p.Update(lt(AI,e),{},t):Jr(e,t)}function Ko(e,t){return k([e])?p.Update(lt(CI,e),{},t):Xr(e,t)}function zo(e,t){return k([e])?p.Update(lt(MI,e),{},t):Zr(e,t)}function Al(e,t,n,r){let a=d(e,t,n);return _o(a,r)}function Cl(e,t,n,r){let a=d(e,t,n);return Uo(a,r)}function Ml(e,t,n,r){let a=d(e,t,n);return Ko(a,r)}function ql(e,t,n,r){let a=d(e,t,n);return zo(a,r)}function Qr(e,t,n,r,a={}){return b("Conditional",[e,t,n,r],a)}function Ll(e,t,n,r,a={}){return Bo({},U([],[]),e,t,n,r,a)}function qI(e,t,n,r,a,i){let m=de(e,n,r);return I.IsExtendsUnion(m)?w([d(m.inferred,t,a),d(e,t,i)]):I.IsExtendsTrue(m)?d(m.inferred,t,a):d(e,t,i)}function Bo(e,t,n,r,a,i,m){return k([n,r])?p.Update(qI(e,t,n,r,a,i),{},m):Qr(n,r,a,i,m)}function jl(e,t,n,r,a,i,m){let u=d(e,t,n),l=d(e,t,r);return Bo(e,t,u,l,a,i,m)}function ea(e,t={}){return b("ConstructorParameters",[e],t)}function Fl(e,t={}){return Vo(e,t)}function LI(e){let t=oe(e)?e.parameters:[],n=Et({},U([],[]),t);return te(n)}function Vo(e,t){return k([e])?p.Update(LI(e),{},t):ea(e,t)}function Dl(e,t,n,r){let a=d(e,t,n);return Vo(a,r)}function ta(e,t,n={}){return b("Exclude",[e,t],n)}function Gl(e,t,n={}){return rr(e,t,n)}function rr(e,t,n){return k([e,t])?p.Update(_r(e,t),{},n):ta(e,t,n)}function Nl(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return rr(i,m,a)}function na(e,t,n={}){return b("Extract",[e,t],n)}function _l(e,t,n={}){return Wo(e,t,n)}function jI(e,t){let n=de({},e,t);return I.IsExtendsTrueLike(n)?[e]:[]}function FI(e,t){return e.reduce((n,r)=>[...n,...jI(r,t)],[])}function Ul(e,t){let n=qe(e),r=x(n)?n.anyOf:[n],a=FI(r,t);return Ee(a)}function Wo(e,t,n){return k([e,t])?p.Update(Ul(e,t),{},n):na(e,t,n)}function Kl(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return Wo(i,m,a)}function DI(e){return e.reduce((t,n)=>Lr(n)?[...t,P(n)]:t,[])}function hn(e){let t=DI(e);return w(t)}function Bn(e,t,n={}){return b("Index",[e,t],n)}function zl(e,t,n={}){let r=s.IsArray(t)?hn(t):t;return Ho(e,r,n)}function Bl(e,t){let n=Qe(e,t);return Ae(n)}function Vl(e,t,n){let r=_e(e,t,n);return Ae(r)}function GI(e,t){let n=s.Keys(e).filter(h=>!s.HasPropertyKey(t,h)),r=s.Keys(t).filter(h=>!s.HasPropertyKey(e,h)),a=s.Keys(e).filter(h=>s.HasPropertyKey(t,h)),i=n.reduce((h,v)=>({...h,[v]:e[v]}),{}),m=r.reduce((h,v)=>({...h,[v]:t[v]}),{}),u=a.reduce((h,v)=>({...h,[v]:B([e[v],t[v]])}),{}),l=p.Assign(i,m);return p.Assign(l,u)}function Wl(e){return e.reduce((t,n)=>GI(t,Ae(n)),{})}function Hl(e){let t=Qs(te(e));return Ae(t)}function NI(e,t){return s.Keys(e).filter(a=>a in t).reduce((a,i)=>({...a,[i]:Ee([e[i],t[i]])}),{})}function Yl(e,t){return s.ShiftLeft(e,(n,r)=>Yl(r,NI(t,Ae(n))),()=>t)}function Jl(e){return s.ShiftLeft(e,(t,n)=>Yl(n,Ae(t)),()=>X())}function Ae(e){return le(e)?Bl(e.$defs,e.$ref):W(e)?Vl(e.if,e.then,e.else):O(e)?Wl(e.allOf):x(e)?Jl(e.anyOf):N(e)?Hl(e.items):q(e)?e.properties:{}}function gn(e){let t=Ae(e);return T(t)}var _I=new RegExp("^(?:0|[1-9][0-9]*)$");function yn(e){let t=`${e}`;return _I.test(t)?parseInt(t):e}function UI(e){return P(yn(e))}function Xl(e){return e.map(t=>Zl(t))}function Zl(e){return O(e)?ye(Xl(e.allOf)):x(e)?w(Xl(e.anyOf)):L(e)?UI(e.const):e}function Ql(e,t){let n=Zl(t),r=de({},n,we());return I.IsExtendsTrueLike(r)?e:L(t)&&s.IsEqual(t.const,"length")?we():D()}function ed(e,t){let n=Qe(e,t);return Se(n)}function td(e,t,n){let r=_e(e,t,n);return Se(r)}function nd(e){let t=Oe(e);return Se(t)}function rd(e){let t=B(e);return Se(t)}function ad(e){return[`${e}`]}function od(e){let t=ke(e);return Se(t)}function id(e){return e.reduce((t,n)=>[...t,...Se(n)],[])}function Se(e){return le(e)?ed(e.$defs,e.$ref):W(e)?td(e.if,e.then,e.else):xe(e)?nd(e.enum):O(e)?rd(e.allOf):L(e)?ad(e.const):ee(e)?od(e.pattern):x(e)?id(e.anyOf):[]}function xn(e){return Se(e)}function ar(e,t){return t.map(n=>or(e,n))}function or(e,t){return z(t)?Re(or(e,t.items)):oe(t)?Be(ar(e,t.parameters),or(e,t.instanceType)):ie(t)?Ve(ar(e,t.parameters),or(e,t.returnType)):N(t)?te(ar(e,t.items)):x(t)?w(ar(e,t.anyOf)):O(t)?ye(ar(e,t.allOf)):Vr(t)?T(e):t}function sd(e,t){return or(e,t)}function KI(e,t){let n=t in e?e[t]:D();return sd(e,n)}function md(e,t){return t.reduce((n,r)=>[...n,KI(e,r)],[])}function zI(e,t){let n=xn(t),r=md(e,n);return Ee(r)}var BI=new RegExp(vt);function VI(e){return e.filter(n=>BI.test(n))}function WI(e){let t=Rr(e),n=VI(t),r=md(e,n);return Ee(r)}function pd(e,t){return Q(t)?WI(e):zI(e,t)}function HI(e){return P(yn(e))}function ud(e){return e.map(t=>Yo(t))}function Yo(e){return O(e)?ye(ud(e.allOf)):x(e)?w(ud(e.anyOf)):L(e)?HI(e.const):e}function YI(e,t){return e.reduceRight((n,r,a)=>{let i=de({},P(a),t);return I.IsExtendsTrueLike(i)?[r,...n]:n},[])}function JI(e,t){let n=Yo(t),r=YI(e,n);return ut(r)}function XI(e){return ut(e)}function cd(e,t){return L(t)&&s.IsEqual(t.const,"length")?P(e.length):Q(t)||be(t)?XI(e):JI(e,t)}function ld(e,t){return z(e)?Ql(e.items,t):q(e)?pd(e.properties,t):N(e)?cd(e.items,t):D()}function ZI(e){return le(e)||W(e)||O(e)||x(e)?gn(e):e}function Ho(e,t,n){return k([e,t])?p.Update(ld(ZI(e),t),{},n):Bn(e,t,n)}function dd(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return Ho(i,m,a)}function ra(e,t={}){return b("InstanceType",[e],t)}function fd(e,t={}){return Jo(e,t)}function QI(e){return oe(e)?e.instanceType:D()}function Jo(e,t){return k([e])?p.Update(QI(e),{},t):ra(e,t)}function hd(e,t,n,r={}){let a=d(e,t,n);return Jo(a,r)}function Vn(e,t={}){return b("KeyOf",[e],t)}function gd(e,t={}){return Xo(e,t)}function yd(){return w([we(),Me(),tn()])}function xd(e){return we()}function ev(e){return e.reduce((n,r)=>Lr(r)?[...n,P(yn(r))]:X(),[])}function bd(e){let t=s.Keys(e),n=ev(t);return ut(n)}function Id(e){return an(e)}function vd(e){let t=e.map((n,r)=>P(r));return ut(t)}function Td(e){return Z(e)?yd():z(e)?xd(e.items):q(e)?bd(e.properties):fe(e)?Id(e):N(e)?vd(e.items):D()}function tv(e){return le(e)||W(e)||O(e)||x(e)?gn(e):e}function Xo(e,t){return k([e])?p.Update(Td(tv(e)),{},t):Vn(e,t)}function $d(e,t,n,r){let a=d(e,t,n);return Xo(a,r)}function Un(e,t,n,r,a={}){return b("Mapped",[e,t,n,r],a)}function kd(e,t,n,r,a={}){return Zo({},U([],[]),e,t,n,r,a)}function nv(e){let t=ke(e);return Ea(t)}function rv(e){return e.reduce((t,n)=>[...t,...Ea(n)],[])}function av(e){let t=Oe(e);return Ea(t)}function ov(e){return s.IsNumber(e)?[P(`${e}`)]:[P(e)]}function Ea(e){return xe(e)?av(e.enum):L(e)?ov(e.const):ee(e)?nv(e.pattern):x(e)?rv(e.anyOf):[e]}function wd(e){return Ea(e)}function iv(e){return ee(e)?ke(e.pattern):e}function sv(e,t,n,r,a,i){let m=p.Assign(e,{[n.name]:r}),u=d(m,t,a),l=iv(u),f=d(m,t,i);return Ms(l)||qs(l)?{[l.const]:f}:{}}function mv(e,t,n,r,a,i){return r.reduce((m,u)=>[...m,sv(e,t,n,u,a,i)],[])}function pv(e){return e.reduce((t,n)=>[...t,T(n)],[])}function Ed(e,t,n,r,a,i){let m=wd(r),u=mv(e,t,n,m,a,i),l=pv(u);return B(l)}function Zo(e,t,n,r,a,i,m){return k([r])?p.Update(Ed(e,t,n,r,a,i),{},m):Un(n,r,a,i,m)}function Sd(e,t,n,r,a,i,m){let u=d(e,t,r);return Zo(e,t,n,u,a,i,m)}function uv(e,t,n){let r=p.Assign(e,t);return s.Keys(t).filter(i=>n.includes(i)).reduce((i,m)=>({...i,[m]:ml(r,m,t[m])}),{})}function cv(e,t,n){let r=p.Assign(e,t);return s.Keys(t).filter(i=>!n.includes(i)).reduce((i,m)=>({...i,[m]:d(r,U([],[]),t[m])}),{})}function lv(e,t,n){let r=al(t),a=uv(e,t,r),i=cv(e,t,r),m={...a,...i};return p.Update(m,{},n)}function Sa(e,t,n,r){return lv(e,n,r)}function aa(e,t={}){return b("NonNullable",[e],t)}function Rd(e,t={}){return Qo(e,t)}function dv(e){let t=w([Qt(),on()]);return rr(e,t,{})}function Qo(e,t){return k([e])?p.Update(dv(e),{},t):aa(e,t)}function Od(e,t,n,r){let a=d(e,t,n);return Qo(a,r)}function oa(e,t,n={}){return b("Omit",[e,t],n)}function Pd(e,t,n={}){let r=s.IsArray(t)?hn(t):t;return ei(e,r,n)}function Ra(e){let t=gn(e);return q(t)?t.properties:X()}function fv(e,t){return s.Keys(e).reduce((r,a)=>t.includes(a)?r:{...r,[a]:e[a]},{})}function Ad(e,t){let n=Ra(e),r=xn(t),a=fv(n,r);return T(a)}function ei(e,t,n){return k([e,t])?p.Update(Ad(e,t),{},n):oa(e,t,n)}function Cd(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return ei(i,m,a)}function ia(e,t={}){return b("Parameters",[e],t)}function Md(e,t={}){return ti(e,t)}function hv(e){let t=ie(e)?e.parameters:[],n=Et({},U([],[]),t);return te(n)}function ti(e,t){return k([e])?p.Update(hv(e),{},t):ia(e,t)}function qd(e,t,n,r){let a=d(e,t,n);return ti(a,r)}function sa(e,t={}){return b("Partial",[e],t)}function Ld(e,t={}){return ni(e,t)}function jd(e,t){let n=Qe(e,t),r=et(n);return He(p.Assign(e,{[t]:r}),t)}function Fd(e,t,n){let r=_e(e,t,n);return et(r)}function Dd(e){let t=B(e);return et(t)}function Gd(e){let t=e.map(n=>et(n));return w(t)}function Nd(e){let t=s.Keys(e).reduce((r,a)=>({...r,[a]:Ct(e[a])}),{});return T(t)}function et(e){return le(e)?jd(e.$defs,e.$ref):W(e)?Fd(e.if,e.then,e.else):O(e)?Dd(e.allOf):x(e)?Gd(e.anyOf):q(e)?Nd(e.properties):T({})}function ni(e,t){return k([e])?p.Update(et(e),{},t):sa(e,t)}function _d(e,t,n,r){let a=d(e,t,n);return ni(a,r)}function ma(e,t,n={}){return b("Pick",[e,t],n)}function Ud(e,t,n={}){let r=s.IsArray(t)?hn(t):t;return ri(e,r,n)}function gv(e,t){return s.Keys(e).reduce((r,a)=>t.includes(a)?p.Assign(r,{[a]:e[a]}):r,{})}function Kd(e,t){let n=Ra(e),r=xn(t),a=gv(n,r);return T(a)}function ri(e,t,n){return k([e,t])?p.Update(Kd(e,t),{},n):ma(e,t,n)}function zd(e,t,n,r,a){let i=d(e,t,n),m=d(e,t,r);return ri(i,m,a)}function pa(e,t={}){return b("ReadonlyObject",[e],t)}function ai(e,t={}){return oi(e,t)}var Bd=ai;function Vd(e){return Zt(Re(e))}function Wd(e,t){let n=Qe(e,t),r=tt(n);return He(p.Assign(e,{[t]:r}),t)}function Hd(e,t,n){let r=_e(e,t,n);return tt(r)}function Yd(e){let t=B(e);return tt(t)}function Jd(e){let t=s.Keys(e).reduce((r,a)=>({...r,[a]:Lt(e[a])}),{});return T(t)}function Xd(e){return Zt(te(e))}function Zd(e){let t=e.map(n=>tt(n));return w(t)}function tt(e){return z(e)?Vd(e.items):le(e)?Wd(e.$defs,e.$ref):W(e)?Hd(e.if,e.then,e.else):O(e)?Yd(e.allOf):q(e)?Jd(e.properties):N(e)?Xd(e.items):x(e)?Zd(e.anyOf):e}function oi(e,t){return k([e])?p.Update(tt(e),{},t):pa(e)}function Qd(e,t,n,r){let a=d(e,t,n);return oi(a,r)}function ef(e,t,n,r){return t.visited.includes(r)?n:r in e?d(e,U(t.callstack,[...t.visited,r]),e[r]):n}function tf(e,t){let n=Qe(e,t),r=nt(n);return He(p.Assign(e,{[t]:r}),t)}function nf(e,t,n){let r=_e(e,t,n);return nt(r)}function rf(e){let t=B(e);return nt(t)}function af(e){let t=e.map(n=>nt(n));return w(t)}function of(e){let t=s.Keys(e).reduce((r,a)=>({...r,[a]:Nr(e[a])}),{});return T(t)}function nt(e){return le(e)?tf(e.$defs,e.$ref):W(e)?nf(e.if,e.then,e.else):O(e)?rf(e.allOf):x(e)?af(e.anyOf):q(e)?of(e.properties):T({})}function ua(e,t={}){return b("Required",[e],t)}function sf(e,t={}){return ii(e,t)}function ii(e,t){return k([e])?p.Update(nt(e),{},t):ua(e,t)}function mf(e,t,n,r){let a=d(e,t,n);return ii(a,r)}function ca(e,t={}){return b("ReturnType",[e],t)}function pf(e,t={}){return si(e,t)}function yv(e){return ie(e)?e.returnType:D()}function si(e,t){return k([e])?p.Update(yv(e),{},t):ca(e,t)}function uf(e,t,n,r={}){let a=d(e,t,n);return si(a,r)}function la(e,t){return b("With",[e,t],{})}function cf(e,t){return mi(e,t)}function mi(e,t){return k([e])?p.Update(e,{},t):la(e,t)}function lf(e,t,n,r){let a=d(e,t,n);return mi(a,r)}function xv(e){return Tt(e)?N(e.items)?pi(e.items.items):J(e.items)?[e]:se(e.items)?[e]:[D()]:[e]}function pi(e){return e.reduce((n,r)=>[...n,...xv(r)],[])}function U(e,t){return{callstack:e,visited:t}}function k(e){return s.ShiftLeft(e,(t,n)=>se(t)?!1:k(n),()=>!0)}function Zn(e,t,n){return s.Keys(n).reduce((r,a)=>({...r,[a]:d(e,t,n[a])}),{})}function Et(e,t,n){let r=Pe(e,t,n);return pi(r)}function Pe(e,t,n){return n.map(r=>d(e,t,r))}function bv(e,t){let n=ge(e)?Pn(t,{}):t,r=jt(e)?On(n,{}):n;return qt(e)?ir(r,{}):r}function Iv(e,t,n,r,a){return s.IsEqual(n,"AddImmutable")?df(e,t,r[0],a):s.IsEqual(n,"RemoveImmutable")?Tl(e,t,r[0],a):s.IsEqual(n,"AddReadonly")?ms(e,t,r[0],a):s.IsEqual(n,"RemoveReadonly")?Hs(e,t,r[0],a):s.IsEqual(n,"AddOptional")?ps(e,t,r[0],a):s.IsEqual(n,"RemoveOptional")?Xs(e,t,r[0],a):s.IsEqual(n,"Capitalize")?Al(e,t,r[0],a):s.IsEqual(n,"Conditional")?jl(e,t,r[0],r[1],r[2],r[3],a):s.IsEqual(n,"ConstructorParameters")?Dl(e,t,r[0],a):s.IsEqual(n,"Evaluate")?cl(e,t,r[0],a):s.IsEqual(n,"Exclude")?Nl(e,t,r[0],r[1],a):s.IsEqual(n,"Extract")?Kl(e,t,r[0],r[1],a):s.IsEqual(n,"Index")?dd(e,t,r[0],r[1],a):s.IsEqual(n,"InstanceType")?hd(e,t,r[0],a):s.IsEqual(n,"Interface")?el(e,t,r[0],r[1],a):s.IsEqual(n,"KeyOf")?$d(e,t,r[0],a):s.IsEqual(n,"Lowercase")?Cl(e,t,r[0],a):s.IsEqual(n,"Mapped")?Sd(e,t,r[0],r[1],r[2],r[3],a):s.IsEqual(n,"Module")?Sa(e,t,r[0],a):s.IsEqual(n,"NonNullable")?Od(e,t,r[0],a):s.IsEqual(n,"Pick")?zd(e,t,r[0],r[1],a):s.IsEqual(n,"Parameters")?qd(e,t,r[0],a):s.IsEqual(n,"Partial")?_d(e,t,r[0],a):s.IsEqual(n,"Omit")?Cd(e,t,r[0],r[1],a):s.IsEqual(n,"ReadonlyObject")?Qd(e,t,r[0],a):s.IsEqual(n,"Record")?fm(e,t,r[0],r[1],a):s.IsEqual(n,"Required")?mf(e,t,r[0],a):s.IsEqual(n,"ReturnType")?uf(e,t,r[0],a):s.IsEqual(n,"TemplateLiteral")?xc(e,t,r[0],a):s.IsEqual(n,"Uncapitalize")?Ml(e,t,r[0],a):s.IsEqual(n,"Uppercase")?ql(e,t,r[0],a):s.IsEqual(n,"With")?lf(e,t,r[0],r[1]):b(n,r,a)}function vv(e,t,n){let r=se(n)?ef(e,t,n,n.$ref):z(n)?Re(d(e,t,n.items),Sr(n)):fn(n)?wa(e,t,n.target,n.arguments):oe(n)?Be(Pe(e,t,n.parameters),d(e,t,n.instanceType),us(n)):ie(n)?Ve(Pe(e,t,n.parameters),d(e,t,n.returnType),cs(n)):W(n)?Mt(d(e,t,n.if),d(e,t,n.then),d(e,t,n.else),ys(n)):O(n)?ye(Pe(e,t,n.allOf),Ts(n)):q(n)?T(Zn(e,t,n.properties),hs(n)):fe(n)?hm(Le(n),d(e,t,ve(n))):Tt(n)?Gt(d(e,t,n.items)):N(n)?te(Et(e,t,n.items),Ws(n)):x(n)?w(Pe(e,t,n.anyOf),js(n)):n;return bv(n,r)}function d(e,t,n){return gt(n)?Iv(e,t,n.action,n.parameters,n.options):vv(e,t,n)}function ui(e,t){return d(e,U([],[]),t)}function Tv(e){return p.Update(e,{"~immutable":!0},{})}function ir(e,t){return p.Update(Tv(e),{},t)}function df(e,t,n,r){let a=d(e,t,n);return ir(a,r)}function gu(e,t={}){return b("AddImmutable",[e],t)}function Zt(e,t={}){return ir(e,t)}function yu(e,t={}){return b("Evaluate",[e],t)}function ff(e,t={}){return Go(e,t)}function xu(e,t={}){return b("Module",[e],t)}function hf(e,t={}){return Sa({},U([],[]),e,t)}function gf(...e){let[t,n,r]=Ye.Match(e,{2:(m,u)=>s.IsString(m)?[{},m,u]:[m,u,{}],3:(m,u,l)=>[m,u,l],1:m=>[{},m,{}]}),a=dc(n),i=s.IsArray(a)&&s.IsEqual(a.length,2)?d(t,U([],[]),a[0]):D();return p.Update(i,{},r)}var G={};Rt(G,{Any:()=>Xt,Array:()=>Re,BigInt:()=>qn,Boolean:()=>Mr,Call:()=>Il,Capitalize:()=>Sl,Codec:()=>Cr,Conditional:()=>Ll,Constructor:()=>Be,ConstructorParameters:()=>Fl,Cyclic:()=>He,Decode:()=>Es,DecodeBuilder:()=>Mn,Dependent:()=>Mt,Encode:()=>Ss,EncodeBuilder:()=>Cn,Enum:()=>vs,Evaluate:()=>ff,Exclude:()=>Gl,Extends:()=>de,ExtendsResult:()=>I,Extract:()=>_l,Function:()=>Ve,Generic:()=>yt,Identifier:()=>Ln,Immutable:()=>Rs,Index:()=>zl,Infer:()=>An,InstanceType:()=>fd,Instantiate:()=>ui,Integer:()=>Ft,Interface:()=>tl,Intersect:()=>ye,IsAny:()=>Z,IsArray:()=>z,IsBigInt:()=>Xe,IsBoolean:()=>Ce,IsCall:()=>fn,IsCodec:()=>Ar,IsConstructor:()=>oe,IsCyclic:()=>le,IsDependent:()=>W,IsEnum:()=>xe,IsEnumValue:()=>Is,IsFunction:()=>ie,IsGeneric:()=>Jt,IsIdentifier:()=>Cs,IsImmutable:()=>qt,IsInfer:()=>J,IsInteger:()=>be,IsIntersect:()=>O,IsKind:()=>y,IsLiteral:()=>L,IsNever:()=>xt,IsNull:()=>en,IsNumber:()=>Q,IsObject:()=>q,IsOptional:()=>ge,IsParameter:()=>Ls,IsReadonly:()=>jt,IsRecord:()=>fe,IsRef:()=>se,IsRefine:()=>po,IsRest:()=>Tt,IsSchema:()=>ne,IsString:()=>Ie,IsSymbol:()=>bt,IsTemplateLiteral:()=>ee,IsThis:()=>Vr,IsTuple:()=>N,IsUndefined:()=>sn,IsUnion:()=>x,IsUnknown:()=>re,IsUnsafe:()=>Pr,IsVoid:()=>Ze,KeyOf:()=>gd,Literal:()=>P,Lowercase:()=>Rl,Mapped:()=>kd,Module:()=>hf,Never:()=>D,NonNullable:()=>Rd,Null:()=>Qt,Number:()=>we,Object:()=>T,Omit:()=>Pd,Optional:()=>ds,Parameter:()=>Dt,Parameters:()=>Md,Partial:()=>Ld,Pick:()=>Ud,Readonly:()=>Os,ReadonlyObject:()=>ai,ReadonlyType:()=>Bd,Record:()=>Kr,RecordKey:()=>an,RecordPattern:()=>Le,RecordValue:()=>ve,Ref:()=>pt,Refine:()=>Ps,Required:()=>sf,Rest:()=>Gt,ReturnType:()=>pf,Script:()=>gf,String:()=>Me,Symbol:()=>tn,TemplateLiteral:()=>Ic,This:()=>Br,Tuple:()=>te,Uncapitalize:()=>Ol,Undefined:()=>on,Union:()=>w,Unknown:()=>ue,Unsafe:()=>gs,Uppercase:()=>Pl,Void:()=>Wr,With:()=>cf});var sr="submit_test_gap_candidates",mr="submit_filtered_test_gaps",pr="submit_solver_gaps",m8=G.Object({verdict:G.Union([G.Literal("PASS"),G.Literal("FAIL")],{description:"FAIL only for a genuine blocking issue (clear rubric violation, agent-fault-worthy gap, unfair/undiscoverable test requirement, or a real determinism/regression risk). Optional, minor, or stylistic points are NOT grounds for FAIL \u2014 put those in `notes` instead and use PASS."}),summary:G.String({description:"One short sentence summarizing the verdict."}),reasons:G.Array(G.String(),{description:"Specific BLOCKING justifications only, citing rubric item IDs and concrete evidence from the files you read. Required (non-empty) when verdict is FAIL. Use an empty array when verdict is PASS."}),notes:G.Array(G.String(),{description:"Non-blocking, optional/minor observations or suggested improvements \u2014 the kind of feedback a real reviewer leaves as 'Minor/optional' without failing the task. Include these regardless of verdict; use an empty array if you truly have none."})});var $v=G.Object({statement:G.String({description:"One sentence from agent_prompt.md, copied verbatim."}),gaps:G.Array(G.Object({description:G.String({description:"A fair, publicly observable missing behavioral test."}),risk:G.String({description:"Why an incorrect implementation could pass the current tests despite this missing behavior."})}),{description:"All candidate positive and negative gaps for this sentence; there is no maximum or target count, so include every distinct evidence-backed gap and relevant edge case rather than stopping at 10; use an empty array only when exhaustive analysis finds none."})});function yf(e){return{name:sr,label:"Submit Candidate Test Gaps",description:"Submit one candidate-gap list for one prompt sentence. Call this after each sentence so the orchestrator can track the todo list; empty lists are required when that sentence has no gaps.",parameters:$v,async execute(t,n){let r=e.statements??[];return r.push({statement:n.statement,gaps:n.gaps??[]}),e.statements=r,{content:[{type:"text",text:`Recorded ${n.gaps?.length??0} candidate gap(s)`}],details:void 0}}}}var kv=G.Object({gaps:G.Array(G.Object({description:G.String({description:"The confirmed, real, fair test gap (may be reworded for clarity). Keep POSITIVE:/NEGATIVE: prefix when applicable."}),justification:G.String({description:"Why this is genuinely grounded in agent_prompt.md or the repo, fair to test per the fairness methodology, and a real (non-duplicate) coverage hole in test.patch \u2014 for negative gaps, cite the prompt's prohibition/constraint and why no existing test catches the forbidden outcome."})}),{description:"The filtered, final list of confirmed test gaps. Use an empty array if none of the candidates survive strict scrutiny."})});function xf(e){return{name:mr,label:"Submit Filtered Test Gaps",description:"Submit your final, strictly filtered list of confirmed test gaps. This is the ONLY way to report your result \u2014 call it exactly once, as your last action, after you have independently verified each candidate.",parameters:kv,async execute(t,n){let r=n.gaps??[];return e.gaps=r,{content:[{type:"text",text:`Confirmed ${r.length} gap(s) after filtering`}],details:void 0}}}}var wv=G.Object({gaps:G.Array(G.Object({description:G.String({description:"The specific behavioral gap: a way one or more solver's diff differs materially from what agent_prompt.md/solution.patch require, despite that solver passing `./test.sh new`."}),justification:G.String({description:"Why this is a genuine requirement from agent_prompt.md or solution.patch (cite the specific requirement/line) that the solver's diff misses, contradicts, or diverges from \u2014 and why the current tests fail to catch that divergence."}),evidence:G.String({description:"Which solver(s) (by index) exhibit this, and the specific part of their diff that grounds the gap."})}),{description:"Concrete, diff-grounded behavioral gaps \u2014 cases where a passing solver's materially different approach reveals that `test.sh new` under-specifies a real requirement. Use an empty array if the solvers converged on equivalent behavior; do not manufacture gaps just to report something."})});function bf(e){return{name:pr,label:"Submit Solver Gaps",description:"Submit your final list of behavioral gaps found by comparing the solver diffs against the real solution.patch. This is the ONLY way to report your result \u2014 call it exactly once, as your last action, after you have finished comparing every solver.",parameters:wv,async execute(t,n){let r=n.gaps??[];return e.gaps=r,{content:[{type:"text",text:`Recorded ${r.length} solver gap(s)`}],details:void 0}}}}function Ev(e){return[e,"You are working inside the actual repository (this is your current directory) in read-only mode. You have access to read/grep/find/ls tools only \u2014 you cannot execute code or edit files.","Read `agent_prompt.md` for the task requirements and inspect the repository's existing source/code files with read/grep/find/ls. Base the analysis on the prompt and the observable behavior supported by those code files."]}var Sv=["Thoroughness \u2014 your job is high recall on genuine gaps only:","- There is no target count or cap: do not stop at 10 (or any other arbitrary number). For each prompt sentence, enumerate as many distinct uncovered required behaviors and edge cases as the files justify, then continue until an additional sweep finds no new genuine gap.","- Find every gap you can justify with concrete evidence. Do not stop after the first obvious ones \u2014 keep reading until you have systematically covered the prompt and relevant repository code.","- After your first pass, run at least one deliberate second sweep (re-read `agent_prompt.md` and grep/read the relevant code files) before submitting \u2014 but if that sweep still finds nothing, submit an empty list.","- Do not self-censor or merge distinct genuine gaps into one \u2014 the validator will prune. Never invent or pad the list to seem thorough; an empty array is correct when exhaustive analysis truly finds none.","- Hunt subtle gaps too: behaviors that may be missed under other valid inputs, repository conventions, interaction effects, ordering/timing, and branches in the relevant source code that need behavioral coverage.","- Include a candidate only when you can cite specific grounding and a concrete false-pass risk \u2014 not to meet a quota."],If=["Fairness rules \u2014 apply these to every proposed gap and every proposed assertion:","- Ground every candidate in a specific sentence or requirement in `agent_prompt.md`, or in an existing public contract that is clear and directly relevant in the repository. Record the observable behavior and the plausible incorrect implementation that could pass without this check. Do not create requirements from intuition, taste, general best practice, or a desire for more coverage.","- Treat `agent_prompt.md` as the task contract. Existing source can clarify how an already-public API behaves and can make an established convention discoverable, but a neighboring helper, default, example, or implementation choice does not automatically become a requirement for a new behavior. If repository evidence is absent, mixed, or contradictory, leave the detail open rather than choosing one interpretation.","- A fair check must be expressible through a user-visible result, a caller-visible side effect, a named public API, or another documented/public contract. Do not require private state, private helpers, internal classes, file placement, module boundaries, call order, a particular algorithm, or a particular direct platform/API call when another repo-valid route produces the required outcome.","- A newly invented function, class, property, export, constructor, method name, argument shape, import path, or registry/config key is not a fair requirement merely because it would be a convenient way to test the feature. Require a new API only when `agent_prompt.md` names it, or when the API already exists publicly and the task explicitly relies on it.","- For UI behavior, assert the user-facing control, label, visible state, accessible action, or resulting effect when that is the contract. Do not require a particular DOM hierarchy, tag, CSS class, selector, test/data attribute, ARIA attribute, hidden-shim text, focus order, keyboard traversal, or control implementation unless the prompt or an established public UI contract explicitly requires it.","- Test semantics rather than source representation. Do not pin quote style, whitespace, line breaks, token adjacency, identifier spelling, generated-source wording, code length, AST node shape, type-text spelling, serialization style, or a particular equivalent syntax when the resulting behavior is the same. Normalize, parse, compile, or observe the result when that is necessary to compare equivalent forms.","- For structured results, assert the fields, values, relationships, ordering, and preservation that the contract actually requires. Allow additional valid fields and metadata unless the prompt explicitly forbids them. Do not compare a whole object, list, mapping, or serialized document to a minimal reference-shaped object when only a subset of its contents is contractual. For unspecified unknown fields, do not assume either permissive or strict validation: acceptance is fair only when extras are expressly allowed or established, and rejection is fair only when unknown fields are expressly forbidden or established at that schema level.","- Treat configuration schemas as contracts, not guesses. Field type, collection shape, omitted-field defaults, unknown-key policy, extension-based dispatch, coercion, and cross-field constraints are independently specified decisions. Do not require a string-only name, a particular list shape, a filename-driven parser, a boolean-only flag, a valid range relationship, or rejection of an extra key unless the prompt or a public schema settles it.","- Make aggregation semantics explicit before requiring exact counts. A count may be per input, field, item, target, rule, match, category, finding, log record, or operation; multiple units may overlap or be mutually exclusive. For repair or mutation output, also distinguish findings measured before the change from findings remaining after the change. If the contract does not choose the unit, test presence, effect, or a stated relationship rather than an exact number.","- Do not resolve interactions between separately described rules by intuition. Optional-path handling versus target-level checks, validation versus evaluation, duplicate detection across collections, cache reuse versus a new input, and consensus among agreeing versus dissenting values each need an explicit precedence or scope. A test must not silently choose skip-all versus continue, majority versus unanimity, per-collection versus global deduplication, or disjoint versus overlapping diagnostic categories.","- Do not infer a concrete value from relational wording. Terms such as current, latest, selected, next, matching, appropriate, or stable require the stated relationship or effect, not an arbitrary numeric or serialized value. Pin a concrete value only when the prompt or a clear existing public contract determines it.","- Do not infer an exact ordering, grouping, cardinality, count, or error-counting model from incidental map order, loop order, a convenient fixture, or one implementation. Require ordering or counts only when the contract makes them observable; otherwise assert membership, relationships, preservation, and the required effect without choosing a granularity the prompt leaves open. This includes order of newly added versus loaded values and the number or placement of repeated diagnostic terms.","- Preserve scope qualifiers. A requirement for aware values, naive values, all-day values, one mode, one target state, or one lifecycle phase does not automatically apply to every representation or phase. Do not transfer a rule from one subtype to another, or require a changed wall time, timezone, normalization, or side effect outside the scope in which the prompt states it.","- Do not invent an input-domain policy for unspecified cases. Do not require acceptance or rejection of a particular malformed, nullish, Unicode, unusually large, boolean-like, platform-specific, symlink, missing-parent, or other boundary value unless the prompt or an established public contract settles that case. A sensible API policy is not automatically the specified policy.","- For failures, assert the failure or user-visible error behavior required by the contract. Do not require a specific exception class, message wording, punctuation, embedded input value, capitalization, basename, validation phase, or eager-versus-deferred timing unless it is explicitly promised or publicly established. If the contract only says an operation fails clearly, accept equivalent clear failures. When the prompt expressly permits more than one failure phase or handling path\u2014such as load-time rejection or evaluation-time violation\u2014accept every permitted path; do not force one merely because it is easier to assert.","- Do not assume an expression or embedded language has unlisted builtins, operators, container types, mutability, mapping shapes, or context bindings. Test only the language surface and binding representation that the prompt or an existing public evaluator contract names. A useful operation such as length, indexing, mutation, or a helper call is not implicitly available in a restricted environment.","- Respect asynchronous and lazy contracts. If the prompt promises an eventual effect, do not require a callback to return a promise, immediate settlement, a particular debounce interval, construction-time validation, or one exact observation point. Trigger the public operation and observe or wait for the promised result at a fair boundary.","- Do not select an outcome for an underspecified mode boundary. Dry-run, preview, no-op, conflict, rollback, cache, preflight, and post-context-change behavior may have multiple valid outcomes unless the prompt chooses one. Test the guarantees that are stated, such as non-mutation or reporting, without adding a rejection, write, refresh, or validation policy that was not stated.","- Do not convert an incidental side effect into a requirement. For a no-op or reuse case, test the required content, state, preservation, or absence of duplicate effects; do not additionally require an empty file, directory, cache entry, history item, or other artifact to exist or not exist unless that artifact is part of the contract.","- For logs and status messages, check that the required operation or failure is reported when reporting is contractual. Do not demand arbitrary English words, formatting, punctuation, path spelling, message fragments, or exact output layout when the prompt only requires that the operation be communicated.","- A fair behavioral test must not depend on a hidden harness's mock shape, a source-level monkeypatch landing at one import binding, an incomplete module mock, reassigned exported state, a particular failure-injection primitive, or a synthetic fixture that violates real repository invariants. Patch or fake a dependency at a public lookup boundary that supports the repository's valid import styles, rather than assuming whether code imports a module or a symbol. A reasonable implementation must be able to use the repository's valid public exports and state model without being rejected by the setup.","- Test doubles must preserve the public interface and lifecycle needed to reach the assertion. A double for a collaborator must implement existing extension points, return valid shapes, and provide newly required public capabilities or isolate them through an explicit seam. Do not make a detached constructor, unmounted widget, partial collection, missing pane service, or fake cache stand in for an active production flow unless that detached behavior is itself contractual.","- Separate fairness from test strength. A test can be fairly scoped yet too weak if it observes a color anywhere instead of on the required target, checks a generic message without associating it with the operation, or verifies a destination representation without preserving the required identity/instant/relationship. Do not call such a test unfair for being permissive; treat it as insufficient coverage and require a precise public observation.","- Distinguish the semantic goal from the assertion form. If a candidate contains a fair behavioral core plus an unsupported value, representation, timing, API, or harness assumption, keep or rewrite the fair core and remove only the unsupported co-assertion. Do not discard a real gap merely because the first proposed assertion was too specific.","- Do not turn a harness safety limit into a product requirement. A test-level subprocess timeout, signal alarm, poll interval, viewport size, or platform-specific signal is only fair when the task or public performance contract specifies it. Use a separate generous anti-hang guard for malformed or pathological evaluation, and assert the required bounded/failure outcome without choosing an arbitrary wall-clock budget.","- A failed setup and a failed behavioral assertion are different evidence. If a shared fixture crashes before the feature is observed, or an observer renders the wrong viewport/widget after locating a valid result, the test is broken rather than proof of an implementation gap. If the fixture reaches the public behavior but rejects a valid alternative representation or integration path, it is a contract/test mismatch. Do not treat either as a fair behavioral requirement.","- Edge-case coverage is valuable only when the edge case is required or discoverable. Do not report 'more negative tests would be nice' or every conceivable malformed input. Keep a candidate only when it is distinct, publicly testable, concretely grounded, and could let a materially incorrect implementation pass.","- When uncertain, re-read the exact prompt sentence and the closest public source analogues. If two competent implementations can satisfy the contract while differing on the proposed assertion, the assertion is not fair; return the semantic relationship instead or drop the candidate. An empty result is correct when no candidate survives this standard."],vf=If,Rv=If;function Tf(e,t){let n=[...Ev("You are an exhaustive behavioral test-gap finder. Review the task prompt sentence by sentence, finding both missing required-behavior (positive) and missing forbidden/wrong-behavior (negative) tests."),"","First split `agent_prompt.md` into its meaningful sentences using periods (`.`) as the sentence boundary. Create an explicit TODO checklist of every resulting requirement sentence. Work through it one item at a time; do not finish until every item is checked off.","","Before analyzing each sentence, use read/grep/find/ls to inspect the relevant source files and their closest analogues. Use that code context to understand the public contracts, conventions, branches, guards, early returns, state transitions, side effects, boundary handling, and negative/prohibited outcomes required by the sentence. Report every distinct, prompt-required behavioral edge case or prohibition that a plausible implementation could miss. Include positive and negative gaps together for that sentence. There is no maximum number of gaps: keep enumerating distinct missing behaviors for this sentence, including boundary, empty, repeated, interacting, and other relevant edge cases; do not treat 10 as sufficient.","",...Sv,"",...vf,"","Test-coverage checklist for calibration:",e];return n.push("","Fairness: keep only behavior that a user, caller, or existing public contract can observe. Do not require private helpers, internal state, implementation structure, call order, selectors, or incidental strings unless the task explicitly makes them public requirements."),n.push("","For every candidate, state the missing fair behavioral test, the relevant source behavior or branch that led you to investigate it, and why a plausible incorrect implementation could evade that test. The prompt sentence is the required specification: do not report incidental implementation details it does not require. Do not propose the exact test implementation.",`After completing EACH TODO sentence, call \`${sr}\` with that exact sentence and its gap array (including an empty array when none exist). You may and must call the tool multiple times: once per sentence. Only finish after every TODO item has been submitted.`),n.join(`
|
|
11
|
+
`)}function $f(e,t,n){let r=["You are a strict, skeptical fairness auditor for a coding-agent benchmark task.","You are working inside a throwaway, read-only copy of a git repository (this is your current directory). You have access to read/grep/find/ls tools only \u2014 you cannot execute code or edit files.","Two specialized research agents reviewed `agent_prompt.md` and the repository's source/code files sentence by sentence, proposing both positive (missing required-behavior) and negative (missing forbidden/wrong-behavior) gaps. It submitted the following per-sentence candidate report:","",JSON.stringify(e,null,2),"","Your job is to independently re-verify the files yourself and FILTER this list down to only candidates that are ALL of the following:","1. Genuinely grounded \u2014 actually required by a specific statement in `agent_prompt.md`, or unambiguous from clearly visible, existing repo behavior. Drop anything speculative, nice-to-have, or invented beyond what the prompt actually asks for.","2. Fair to test \u2014 verifying it would not require undiscoverable private internals, an invented/unnamed API, or exact incidental implementation structure. Judge this precisely against the fairness guidance below.","3. A real, distinct behavioral gap \u2014 drop near-duplicate candidates and keep only the clearest phrasing of each distinct gap. Retain a candidate only when the source code and prompt provide concrete grounding for a behavior that deserves an explicit public-outcome check.","4. Behaviorally testable through a public contract \u2014 drop candidates that would require an internal helper, private state, implementation structure, call order, DOM class/attribute/data hook, selector, or exact string literal. The sole exceptions are details explicitly named in `agent_prompt.md` or already established as a public contract in the existing repository.","","Be strict: when genuinely unsure whether a candidate holds up, drop it rather than keep it. It is fine \u2014 expected, even \u2014 to return an empty list if none of the candidates survive scrutiny.","","Checklist for the tests focus area, for calibration:",t];return r.push("","Fairness: keep only behavior that a user, caller, or existing public contract can observe. Do not require private helpers, internal state, implementation structure, call order, selectors, or incidental strings unless the task explicitly makes them public requirements.","",...Rv),r.push("","For every gap you keep, give a short justification citing where in `agent_prompt.md` or the repo it is grounded. Preserve POSITIVE:/NEGATIVE: prefix when applicable.",`When you are done, call the \`${mr}\` tool exactly once with your final filtered list (which may be empty). That tool call is your only way to report a result.`),r.join(`
|
|
12
|
+
`)}function kf(){return["You are a adversarial tester. Your goal is to find the most minimal, shortcut implementation that makes all new tests pass \u2014 not a full, correct solution. This is intentional: we want to discover whether the test suite lets through an implementation that barely satisfies the assertions without properly implementing the prompt's required behavior.","`agent_prompt.md` in the repo root describes the intended task. Tests for it already exist and are currently failing.","","Goal: make ALL of the new tests pass with the least amount of real logic possible.","1. Run `bash test.sh new` to see the failures and what the tests expect. Read the failing tests carefully \u2014 they are the only spec you need to satisfy.","2. Understand exactly what each test assertion checks. Ask, 'what is the minimum thing I can do \u2014 a stub, a hardcoded return, a mockish pass-through, a trivial branch \u2014 to satisfy this test?', not 'what does agent_prompt.md intend?'. Skim `agent_prompt.md` only enough to understand what the test file names and assertions refer to, then rely on the test errors to drive what to implement.","3. Prefer the most minimal implementation possible:"," - Hardcode a return value if the test expects one."," - Add only the code paths a test actually exercises; leave anything untested unimplemented."," - Mock the minimum number of dependencies (or none) that the test error forces you to touch."," - Use the most direct, trivial, shortcut approach \u2014 do not build abstractions, do not handle unobserved edge cases, do not add defensive code.","4. Before declaring success, also run `bash test.sh base` to confirm your changes cause no regressions. The shortcut must not break existing tests \u2014 that would be a false positive from a different angle.","5. Re-run `bash test.sh new` and iterate until both the new tests and the base tests pass, or you're confident you cannot pass more without adding real logic.","","Rules:","- Do NOT modify the test files or `test.sh`. Only change application/library code.","- You have shell access \u2014 install any dependencies you need.","- The prompt is not your spec: the tests are. Implement exactly what the tests demand, nothing more. If you can satisfy a test with a hardcoded return, do it."].join(`
|
|
13
|
+
`)}function Ov(e){let t=e.status==="ok"?e.passed?"PASSED all new tests":"did NOT pass all new tests":`did not complete normally (status: ${e.status})`;return`- Solver ${e.index} \u2014 ${t} \u2014 solution.diff / test_output.txt in \`${kn}/solver_${e.index}/\``}function wf(e,t,n){let r=["You are a strict, skeptical behavioral-gap auditor for a coding-agent benchmark task.","You are working inside a throwaway, read-only copy of a git repository (this is your current directory). You have access to read/grep/find/ls tools only \u2014 you cannot execute code, apply patches, or edit files.","The repo root contains `agent_prompt.md` (the real task description), `solution.patch` (a unified diff of the real golden/reference solution), and `test.patch` (a unified diff adding the hidden tests).","",`Separately, several coding agents ('solvers') were each given the same \`agent_prompt.md\` plus the failing tests from \`test.patch\` \u2014 but never \`solution.patch\` \u2014 and asked to implement the task TDD-style, iterating with real shell access until the tests passed or they gave up. Each solver's diff and full \`test.sh new\` output \u2014 captured and verified independently by the harness, not self-reported \u2014 is saved under \`${kn}/solver_<index>/\` (\`solution.diff\`, \`test_output.txt\`), with a \`${kn}/manifest.json\` summary. Use read/grep/find/ls to open exactly what you need. Status summary:`,"",...e.map(Ov),"","Your job: compare the reference `solution.patch` with each solver's `solution.diff` to find concrete BEHAVIORAL GAPS. Keep only a difference where: (a) `agent_prompt.md` explicitly requires the behavior, (b) the solver passed the relevant tests (even if it failed elsewhere), (c) the reference and solver produce observably different behavior for a real edge case or scenario, and (d) a fair public-facing test could distinguish them. The reference solution is evidence for scenarios to inspect, never a specification by itself.","","How to work:","1. Read `agent_prompt.md` sentence by sentence and note every distinct requirement, constraint, and prohibition.","2. Read `solution.patch` to see how the reference solution satisfies those requirements.","3. For each solver, read its `solution.diff` and compare it against the reference behavior. Look specifically for a solver shortcut, missed constraint, edge case, or side effect that the PROMPT requires, where the solver still passes because the tests do not observe the behavioral difference.","4. A solver that did not pass the full suite may still provide evidence for a completed, relevant part of its diff, but only when its test output shows the failure is unrelated to that behavior (or shows the relevant tests already passed). Do not treat its failing behavior as a gap, and do not infer gaps from a hypothetical wrong implementation.","5. Treat multiple solvers converging on the same divergent-but-passing shortcut as stronger evidence of a real gap, not proof it's acceptable \u2014 the tests are what's under scrutiny, not majority solver behavior.","",...vf,"- Every gap must be evidenced by an actual, cited solver diff and a contrasting reference behavior. For a solver that failed the full suite, also cite its test output showing that the relevant behavior already passed or is unrelated to the failure. Cite the prompt sentence that makes the behavioral difference required; do not report a gap that is purely theoretical or based only on the reference implementation.","- It is fine, and expected, to submit an empty list if the solvers that passed all converged on behavior equivalent to the reference solution with no material gaps.","- Do not self-censor for volume, but do not pad the list either \u2014 only include what you can concretely justify with cited evidence.","","For reference, here is the checklist for the tests focus area (use it to calibrate what good coverage looks like, not as a list of gaps to report verbatim):",t];return n&&r.push("","Fairness methodology (context on what a fair, in-scope requirement looks like):",n),r.push("",`When you are done, call the \`${pr}\` tool exactly once with your final list (which may be empty). That tool call is your only way to report a result.`),r.join(`
|
|
14
|
+
`)}var Pv=900*1e3,ci=["read","grep","find","ls"];function Aa(e){return e==="off"?void 0:e}async function Ca(e,t,n=Pv){return t.aborted?"cancelled":new Promise((r,a)=>{let i=!1,m,u=()=>{m!==void 0&&clearTimeout(m),t.removeEventListener("abort",f)},l=h=>{i||(i=!0,u(),r(h))},f=()=>l("cancelled");m=setTimeout(()=>l("timedOut"),n),t.addEventListener("abort",f,{once:!0}),e().then(()=>l("done"),h=>{i||(i=!0,u(),a(h))})})}async function Ma(e){if(e){try{e.isIdle||await e.abort()}catch{}e.dispose()}}async function qa(e){let t={},n=e.model,r;try{({session:r}=await Oa({cwd:e.tempDir,model:n,thinkingLevel:Aa(e.thinkingLevel),tools:[...ci,sr],customTools:[yf(t)],sessionManager:Pa.inMemory()}));let a=await Ca(async()=>{await r?.prompt(Tf(e.testRubric,e.fairnessRules))},e.cancelSignal);if(a!=="done")return await r.abort(),{status:a,gaps:[]}}catch{return{status:"error",gaps:[]}}finally{await Ma(r)}return t.statements?{status:"ok",gaps:t.statements}:{status:"noSubmission",gaps:[]}}var Av=["read","grep","find","ls","write","edit","bash"];async function Ef(e){let t=e.model,n=Pa.inMemory(),r;try{({session:r}=await Oa({cwd:e.solverDir,model:t,thinkingLevel:Aa(e.thinkingLevel),tools:[...Av],sessionManager:n}));let a=await Ca(async()=>{await r?.prompt(kf())},e.cancelSignal,e.timeoutMinutes*60*1e3);return a!=="done"&&await r.abort(),{outcome:a,trajectory:n.getEntries()}}catch{return{outcome:"error",trajectory:[]}}finally{await Ma(r)}}async function Sf(e){let t={},n=e.model,r;try{({session:r}=await Oa({cwd:e.tempDir,model:n,thinkingLevel:Aa(e.thinkingLevel),tools:[...ci,pr],customTools:[bf(t)],sessionManager:Pa.inMemory()}));let a=await Ca(async()=>{await r?.prompt(wf(e.solverResults,e.testRubric,e.fairnessRules))},e.cancelSignal);if(a!=="done")return await r.abort(),{status:a,gaps:[]}}catch{return{status:"error",gaps:[]}}finally{await Ma(r)}return t.gaps?{status:"ok",gaps:t.gaps}:{status:"noSubmission",gaps:[]}}async function La(e){let t={},n=e.model,r;try{({session:r}=await Oa({cwd:e.tempDir,model:n,thinkingLevel:Aa(e.thinkingLevel),tools:[...ci,mr],customTools:[xf(t)],sessionManager:Pa.inMemory()}));let a=await Ca(async()=>{await r?.prompt($f(e.statementReports,e.testRubric,e.fairnessRules))},e.cancelSignal);if(a!=="done")return await r.abort(),{status:a,gaps:[]}}catch{return{status:"error",gaps:[]}}finally{await Ma(r)}return t.gaps?{status:"ok",gaps:t.gaps}:{status:"noSubmission",gaps:[]}}var St="checks_progress";function ur(e,t,n,r){let a=n>0?Math.min(1,t/n):0,i=Math.round(24*a),m="\u2588".repeat(i)+"\u2591".repeat(Math.max(0,24-i)),u=r?` pass:${r.passed} fail:${r.failed}`:"";return[`checks: ${e} [${m}] ${t}/${n}${u}`]}import{existsSync as Cv,readFileSync as Mv}from"node:fs";var li=["agent_prompt.md","solution.patch","test.patch"];function di(e=new Date){let t=(i,m=2)=>String(i).padStart(m,"0"),n=-e.getTimezoneOffset(),r=n>=0?"+":"-",a=Math.abs(n);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}.${t(e.getMilliseconds(),3)}${r}${t(Math.floor(a/60))}:${t(a%60)}`}function Rf(e){try{if(!Cv(e))return{};let t=JSON.parse(Mv(e,"utf-8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Of(e){let t={...e.existingReport,timestamp:di(),model:`${e.config.provider}/${e.config.modelId}`,thinkingLevel:e.config.thinkingLevel};return delete t.overall,delete t.reports,e.runGapFinder&&(t.testGaps=e.testGaps,e.gapAnalysisIncomplete?t.testGapAnalysisNote=`Gap analysis did not fully complete (sentence finder: ${e.gapFinderStatus}, review: ${e.gapFilterStatus}); testGaps may be incomplete.`:delete t.testGapAnalysisNote),e.runSolverGapFinder&&(t.solverRunSummary=e.solverResults.map(n=>({index:n.index,status:n.status,passed:n.passed,durationMs:n.durationMs,totalTests:n.totalTests,failedTests:n.failedTests,artifactsDir:n.artifactsDir})),t.solverGaps=e.solverGaps,e.solverGapAnalysisIncomplete?t.solverGapAnalysisNote=`Solver-gap analysis did not fully complete (comparison reviewer: ${e.solverComparisonStatus}); solverGaps may be incomplete.`:delete t.solverGapAnalysisNote),t}function Pf(e){let t=Math.round(e/1e3);return t>=60?`${Math.floor(t/60)}m ${t%60}s`:`${t}s`}function Af(e){let t=Array.isArray(e.merged.testGaps)?e.merged.testGaps.length:0,n=e.runSolverGapFinder&&Array.isArray(e.merged.solverRunSummary)?e.merged.solverRunSummary.map(i=>({...i,durationMs:i.durationMs??0})):[],r=Array.isArray(e.merged.solverGaps)?e.merged.solverGaps.length:0,a=[];return e.runGapFinder&&a.push(t>0?`${t} test gap(s) found`:"no test gaps found"),e.runSolverGapFinder&&a.push(`${n.filter(i=>i.passed).length}/${n.length} solvers passed, ${r} gap(s) found`),{content:`Gap finders: ${a.join(" | ")}`,details:{gapsCount:t,showGaps:e.runGapFinder,showSolverGaps:e.runSolverGapFinder,solverDetails:n,solverGapsCount:r}}}var Cf=`## The problem description (aka the task)\r
|
|
16
15
|
P1: Aligns with the repo's philosophy\r
|
|
17
16
|
P2: Self-contained \u2014 solvable from the repo and description alone\r
|
|
18
17
|
P3: Clear, concise, and unambiguous \u2014 describes what to build or fix and don't leave points for guessing\r
|
|
@@ -39,7 +38,7 @@ That's the golden solution \u2014 the proof that your task is solvable and that
|
|
|
39
38
|
S1: The solution should meet all the requirements. (If it's missing a requirement and it manages to pass your tests, you're in a bad position \u{1F620}.)\r
|
|
40
39
|
S2: No regressions and follow existing code patterns. Don't break existing working code by mistake (we'll still run the repo's existing tests).\r
|
|
41
40
|
S3: No irrelevant changes to the code \u2014 if something is unrelated to your task, keep it as it is.\r
|
|
42
|
-
S4: No AI slop (weird comments, unexplained defensive code, new coding patterns, etc).`,
|
|
41
|
+
S4: No AI slop (weird comments, unexplained defensive code, new coding patterns, etc).`,qv=`# Agent Evaluation Guidelines\r
|
|
43
42
|
\r
|
|
44
43
|
This file describes how to align a task prompt, reference solution, and tests for fair coding-agent evaluation. It is generic and can be reused across repositories and tasks.\r
|
|
45
44
|
\r
|
|
@@ -324,9 +323,9 @@ Keep changes separated when possible:\r
|
|
|
324
323
|
- Avoid unrelated dependency or lockfile changes.\r
|
|
325
324
|
- Regenerate patches after every prompt/test/solution change.\r
|
|
326
325
|
\r
|
|
327
|
-
---`;function
|
|
328
|
-
`).trim(),
|
|
329
|
-
`)):["(no output)"];if(!n.expanded){let
|
|
326
|
+
---`;function ja(){return(Cf.split(/\r?\n(?=## )/g).find(t=>/^## The tests/i.test(t.trim()))??Cf).trim()}function Fa(){return qv.trim()}var Da=!1,bn;function Ga(){return Da}function Mf(){return Da=!0,bn=new AbortController,bn}function qf(){Da=!1,bn=void 0}function Lf(){return!Da||!bn||bn.signal.aborted?!1:(bn.abort(),!0)}import{existsSync as Lv}from"node:fs";import{join as jv}from"node:path";import{keyHint as Fv}from"@earendil-works/pi-coding-agent";import{Text as Dv,wrapTextWithAnsi as Gv}from"@earendil-works/pi-tui";var cr="analyze_test_gaps",jf=6;function Ff(e){e.registerTool({name:cr,label:"Gap Finder",description:"Only call this when the user explicitly asks for gap analysis or asks you to run Gap Finder. Run a sequential, sentence-by-sentence behavioral test-gap analysis on the current task and its repository source files: a read-only finder agent iterates through every sentence in agent_prompt.md and proposes missing positive/negative behavioral tests per sentence, then a read-only fairness reviewer filters out unfair or internally-observable candidates (skipped when the finder found nothing). Returns the confirmed gaps as the tool result (details.testGaps). Never writes or modifies files. For an explicitly requested iterative workflow, the caller should apply the returned gaps as tests and invoke this tool again sequentially.",promptSnippet:"When asked, analyze the task's hidden tests for behavioral coverage gaps",promptGuidelines:["Call analyze_test_gaps only when the user explicitly asks you to find/analyze test gaps or run Gap Finder; do not call it proactively or for unrelated work.","Run one analysis at a time and wait for it to finish; never issue multiple analyze_test_gaps calls in parallel.","If the user asks for repeated or iterative gap finding, after each result apply the confirmed gaps as tests, then run analyze_test_gaps again sequentially; repeat until a pass finds no new fair gaps, or the gaps are non-trivial or the user says to stop. The tool is read-only, so the caller performs the test changes."],parameters:G.Object({}),renderCall(t,n,r){let a=r.state;r.executionStarted&&a.startedAt===void 0&&(a.startedAt=Date.now(),a.endedAt=void 0);let i=r.lastComponent??new Dv("",0,0);return i.setText(""),i},renderResult(t,n,r,a){let i=a.state;i.startedAt!==void 0&&n.isPartial&&!i.interval&&(i.interval=setInterval(()=>a.invalidate(),1e3)),(!n.isPartial||a.isError)&&(i.endedAt??=Date.now(),i.interval&&(clearInterval(i.interval),i.interval=void 0));let m=n.isPartial?"Elapsed":"Took",u=i.endedAt??Date.now(),l=i.startedAt!==void 0?Uv(u-i.startedAt):"\u2014",f=t.details,h=Array.isArray(f?.testGaps)?f.testGaps.length:void 0,v=[`${m} ${l}`];h!==void 0&&v.push(`${h} gap${h===1?"":"s"}`);let E=r.fg("toolTitle",r.bold("Gap Finder"))+r.fg("muted",` ${v.join(" \xB7 ")}`),F=(t.content??[]).map(me=>me.type==="text"?me.text:"").join(`
|
|
327
|
+
`).trim(),Y=F?Nv(F.split(`
|
|
328
|
+
`)):["(no output)"];if(!n.expanded){let me=Math.max(0,Y.length-jf);Y=Y.slice(0,jf),me>0&&Y.push(`... (${me} more lines, ${Fv("app.tools.expand","to expand")})`)}let ae=a.lastComponent instanceof Na?a.lastComponent:new Na;return ae.setContent(E,Y,r),ae},async execute(t,n,r,a,i){if(!yr(i.cwd))throw new Error("analyze_test_gaps is disabled for this project. Enable it with /analyze:on.");let m=jv(i.cwd,"agent_prompt.md");if(!Lv(m))throw new Error("Missing required file in project root: agent_prompt.md");let u=Fi()??Te(),l=u,f=l?i.modelRegistry.find(l.provider,l.modelId):i.model;if(!f||l&&!i.modelRegistry.hasConfiguredAuth(f))throw new Error("No model configured/authenticated for analyze_test_gaps. Set one via /checks --config (Analyze Tool section).");let h=u?.thinkingLevel??"off",v=new AbortController;r&&(r.aborted?v.abort():r.addEventListener("abort",()=>v.abort(),{once:!0}));let E={tempDir:i.cwd,model:f,thinkingLevel:h,testRubric:ja(),fairnessRules:Fa(),cancelSignal:v.signal};a?.({content:[{type:"text",text:"Finding behavioral test gaps sentence by sentence..."}],details:{}});let A=await qa(E);if(v.signal.aborted)throw new Error("Cancelled by user.");if(A.status!=="ok")throw new Error(`Gap finder did not complete (status: ${A.status}).`);let F=A.gaps.reduce((ae,me)=>ae+me.gaps.length,0),Y=[];if(F>0){a?.({content:[{type:"text",text:`Validating ${F} candidate gap(s)...`}],details:{}});let ae=await La({...E,statementReports:A.gaps});if(v.signal.aborted)throw new Error("Cancelled by user.");if(ae.status!=="ok")throw new Error(`Gap review did not complete (status: ${ae.status}).`);Y=ae.gaps}return{content:[{type:"text",text:Kv(Y)}],details:{testGaps:Y}}}})}function Nv(e){let t=[],n=!1;for(let r of e)/^\s*\d+\.\s+/.test(r)?(n=!1,t.push(r)):/^\s*Justification:/i.test(r)?n=!0:n||t.push(r);return t}var Na=class{header="";styledLines=[];theme;cachedWidth=-1;cachedLines=[];setContent(t,n,r){this.header=t,this.styledLines=n.map(a=>_v(a,r)),this.theme=r,this.cachedWidth=-1}invalidate(){this.cachedWidth=-1}render(t){if(this.cachedWidth!==t){let n=this.theme,r=[];this.header&&r.push(this.header,"");for(let a of this.styledLines)n?r.push(...Gv(a,t)):r.push(a);this.cachedLines=r,this.cachedWidth=t}return this.cachedLines}};function _v(e,t){let n=e.match(/^(\d+)\.\s+(.*)$/);return n?`${t.fg("accent",`${n[1]}.`)} ${t.fg("muted",n[2]??"")}`:t.fg("toolOutput",e)}function Uv(e){return`${Math.floor(e/1e3)}s`}function Kv(e){return e.length===0?"Gap analysis complete: no confirmed behavioral test gaps were found.":["Below are the gaps found by another agent. If they are fair under our prompt, we need to add tests to fix the gap. If not fair, do not mind those \u2014 only add tests for gaps that are absolutely fair.","",...e.map((n,r)=>`${r+1}. ${n.description}
|
|
330
329
|
Justification: ${n.justification}`)].join(`
|
|
331
|
-
`)}var
|
|
332
|
-
`),"info");return}let a=[...new Set(r.split(/\s+/).filter(Boolean))],i=new Set(
|
|
330
|
+
`)}var _a=!1,Df=!1,Kt=!1;function fi(e){return e.getActiveTools().map(n=>typeof n=="string"?n:n.name)}function hi(){return _a}function zv(e){return fi(e).includes(cr)}function Ua(e){return hi()!==zv(e)}function Bv(e){Df||(Ff(e),Df=!0)}function Vv(e,t){let n=fi(e);if(t){if(n.length===0){Kt=!0;return}let r=new Set(n);r.add(cr),r.size!==n.length&&e.setActiveTools([...r])}else{let r=n.filter(a=>a!==cr);r.length!==n.length&&e.setActiveTools(r)}Kt=Ua(e)}function In(e){let t=hi();t&&Bv(e),Vv(e,t)}function gi(e,t){_a=hr(t),Kt=!0,Gf(e)}function Gf(e,t=0){let n=hi(),r=fi(e);if(n&&r.length===0&&t<8){queueMicrotask(()=>Gf(e,t+1));return}In(e)}function Nf(e){for(let t of[0,50,150,400])setTimeout(()=>{(Kt||Ua(e))&&In(e)},t)}function _f(){return Kt}function yi(e,t,n){_a=n,gr(t,n),Kt=!0,In(e)}function Uf(e,t){_a=hr(t),Kt=!0,In(e)}var Qv="Ctrl+Shift+X";function eT(e,t){return{index:e,status:"cancelled",passed:!1,diff:"",testOutputTail:"cancelled",durationMs:t,totalTests:null,failedTests:null}}var bi=[{value:"--gap-finder",label:"--gap-finder",description:"Find and validate behavioral test-coverage gaps"},{value:"--solver-gap-finder",label:"--solver-gap-finder",description:"Use TDD solver attempts to find behavioral gaps"},{value:"--config",label:"--config",description:"Configure gap-finder models"}];function tT(e){let t=e.trimStart(),n=/\s$/.test(t),r=t.trimEnd().split(/\s+/).filter(Boolean),a=n?"":r.at(-1)??"",i=new Set(n?r:r.slice(0,-1)),m=n?t:t.slice(0,t.length-a.length),u=i.has("--config"),l=[...i].some(h=>h!=="--config"),f=bi.filter(h=>!i.has(h.value)&&!u&&!(l&&h.value==="--config")&&h.value.startsWith(a));return f.length?f.map(h=>({...h,value:`${m}${h.value}`})):null}async function xi(e,t,n){let r=Di();if(r.length===0)return e.ui.notify("No enabledModels configured in settings.json.","error"),null;let a=e.modelRegistry.getAll(),i=r.map(f=>{let h=Gi(f);if(!h)return null;let v=a.find(F=>F.provider===h.provider&&F.id===h.modelId),E=t?.provider===h.provider&&t?.modelId===h.modelId,A=v?`${v.name} (${f})`:f;return{ref:f,parsed:h,display:E?`${A} [current]`:A,isCurrent:E}}).filter(f=>f!==null);if(i.length===0)return e.ui.notify("Could not resolve any enabledModels entries.","error"),null;let m=[...i].sort((f,h)=>f.isCurrent===h.isCurrent?0:f.isCurrent?-1:1),u=await e.ui.select(n,m.map(f=>f.display));if(!u)return null;let l=i.find(f=>f.display===u);return l?{provider:l.parsed.provider,modelId:l.parsed.modelId}:null}function vn(e,t,n){let r=e.modelRegistry.getAll().find(a=>a.provider===t&&a.id===n);return Li(r)}var Ka={provider:"",modelId:"",thinkingLevel:"off",timeoutMinutes:Ha,solverCount:Ja,saveArtifacts:Xa},za={provider:"",modelId:"",thinkingLevel:"off"};function Hf(e,t,n,r){let a=t?vn(e,t.provider,t.modelId):["off"],i=n.provider?vn(e,n.provider,n.modelId):["off"],m=r.provider?vn(e,r.provider,r.modelId):["off"];return[{id:"reviewer-model",section:"Reviewer",label:"Model",value:t?`${t.provider}/${t.modelId}`:"not set",kind:"model"},{id:"reviewer-thinking",section:"Reviewer",label:"Thinking level",value:t?.thinkingLevel??"off",kind:"cycle",values:a},{id:"solvergap-model",section:"Solver",label:"Model",value:n.provider?`${n.provider}/${n.modelId}`:"not set",kind:"model"},{id:"solvergap-thinking",section:"Solver",label:"Thinking level",value:n.thinkingLevel,kind:"cycle",values:i},{id:"solvergap-timeout",section:"Solver",label:"Timeout",value:`${n.timeoutMinutes} min`,kind:"cycle",values:[10,20,30,40,50,Ci].filter((u,l,f)=>u>=Ai&&f.indexOf(u)===l).map(u=>`${u} min`)},{id:"solvergap-solver-count",section:"Solver",label:"Parallel agents",value:String(n.solverCount),kind:"cycle",values:Array.from({length:Mi-Ya+1},(u,l)=>`${Ya+l}`)},{id:"solvergap-save-artifacts",section:"Solver",label:"Save artifacts",value:n.saveArtifacts?"on":"off",kind:"cycle",values:["on","off"]},{id:"analyze-enabled",section:"Analyze Tool",label:"Enabled here",value:yr(e.cwd)?"on":"off",kind:"cycle",values:["on","off"]},{id:"analyze-model",section:"Analyze Tool",label:"Model",value:r.provider?`${r.provider}/${r.modelId}`:"not set",kind:"model"},{id:"analyze-thinking",section:"Analyze Tool",label:"Thinking level",value:r.thinkingLevel,kind:"cycle",values:m}]}var Ii=class{constructor(t,n,r,a,i,m){this.ctx=t;this.settingsListTheme=n;this.theme=r;this.onCycleSaved=a;this.onActivateModel=i;this.onExit=m;this.rows=Hf(t,Te(),Te()?.solverGap??Ka,Te()?.analyzeGap??za)}selectedIndex=0;rows;refresh(){let t=Te();this.rows=Hf(this.ctx,t,t?.solverGap??Ka,t?.analyzeGap??za),this.selectedIndex=Math.min(this.selectedIndex,this.rows.length-1)}invalidate(){}render(t){let n=[],r=Math.min(30,Math.max(...this.rows.map(i=>i.label.length))),a;for(let i=0;i<this.rows.length;i++){let m=this.rows[i];if(!m)continue;m.section!==a&&(a!==void 0&&n.push(""),n.push(this.theme.bold(this.theme.fg("accent",m.section))),a=m.section);let u=i===this.selectedIndex,l=u?this.settingsListTheme.cursor:" ",f=m.label+" ".repeat(Math.max(0,r-m.label.length)),h=this.settingsListTheme.label(f,u),v=this.settingsListTheme.value(m.value,u);n.push(`${l}${h} ${v}`)}return n}handleInput(t){if(Bt(t,zt.ctrl("s"))||Bt(t,zt.escape)||Bt(t,zt.ctrl("c"))){this.onExit();return}if(Bt(t,zt.up)){this.selectedIndex=this.selectedIndex===0?this.rows.length-1:this.selectedIndex-1;return}if(Bt(t,zt.down)){this.selectedIndex=this.selectedIndex===this.rows.length-1?0:this.selectedIndex+1;return}if(Bt(t,zt.enter)||Bt(t,zt.return)||t===" "){let n=this.rows[this.selectedIndex];if(!n)return;if(n.kind==="model"){this.onActivateModel(n.id);return}if(!n.values||n.values.length===0)return;let r=Te();if(!r){this.ctx.ui.notify("Set the reviewer model first \u2014 it's required before solver-gap-finder settings.","warning");return}let a=r.solverGap??Ka,i=r.analyzeGap??za,m=n.values.indexOf(n.value),u=n.values[(m+1)%n.values.length];if(u===void 0)return;n.id==="reviewer-thinking"?De({...r,thinkingLevel:u,solverGap:a,analyzeGap:i}):n.id==="solvergap-thinking"?De({...r,solverGap:{...a,thinkingLevel:u}}):n.id==="solvergap-timeout"?De({...r,solverGap:{...a,timeoutMinutes:Number.parseInt(u,10)}}):n.id==="solvergap-solver-count"?De({...r,solverGap:{...a,solverCount:Number.parseInt(u,10)}}):n.id==="solvergap-save-artifacts"?De({...r,solverGap:{...a,saveArtifacts:u==="on"}}):n.id==="analyze-enabled"?gr(this.ctx.cwd,u==="on"):n.id==="analyze-thinking"&&De({...r,analyzeGap:{...i,thinkingLevel:u}}),this.refresh(),this.onCycleSaved()}}};async function nT(e,t){if(t.mode!=="tui"){t.ui.notify("/checks --config requires interactive mode","error");return}let n=0;for(;;){let r=await t.ui.custom((u,l,f,h)=>{let v=new Ii(t,Jv(),l,()=>{Uf(e,t.cwd),u.requestRender()},A=>h(A),()=>h(void 0));v.selectedIndex=n;let E=new Xv;return E.addChild(new Wf(l.bold(l.fg("accent","Checks settings")))),E.addChild({render:A=>v.render(A),invalidate:()=>v.invalidate()}),E.addChild(new Zv(1)),E.addChild(new Wf(l.fg("dim","\u2191\u2193 navigate enter select ctrl+s save & exit esc cancel"))),{render(A){return E.render(A)},invalidate(){E.invalidate()},handleInput(A){v.handleInput(A),n=v.selectedIndex,u.requestRender()}}});if(!r)return;let a=Te(),i=a?.solverGap??Ka,m=a?.analyzeGap??za;if(r==="reviewer-model"){let u=await xi(t,a,"Select reviewer model");if(!u)continue;let l=vn(t,u.provider,u.modelId),f=l.includes(a?.thinkingLevel??"off")?a?.thinkingLevel??"off":l[0]??"off";De({...u,thinkingLevel:f,solverGap:i,analyzeGap:m,enabledProjects:a?.enabledProjects??Qa(),enableAnalyzeTool:a?.enableAnalyzeTool}),t.ui.notify(`Reviewer model saved: ${u.provider}/${u.modelId}`,"info");continue}if(r==="solvergap-model"){if(!a){t.ui.notify("Set the reviewer model first \u2014 it's required before solver-gap-finder settings.","warning");continue}let u=await xi(t,i.provider?i:null,"Select solver model");if(!u)continue;let l=vn(t,u.provider,u.modelId),f=l.includes(i.thinkingLevel)?i.thinkingLevel:l[0]??"off";De({...a,solverGap:{...i,...u,thinkingLevel:f}}),t.ui.notify(`Solver model saved: ${u.provider}/${u.modelId}`,"info");continue}if(r==="analyze-model"){if(!a){t.ui.notify("Set the reviewer model first \u2014 it's required before analyze-tool settings.","warning");continue}let u=await xi(t,m.provider?m:null,"Select analyze tool model");if(!u)continue;let l=vn(t,u.provider,u.modelId),f=l.includes(m.thinkingLevel)?m.thinkingLevel:l[0]??"off";De({...a,analyzeGap:{...m,...u,thinkingLevel:f}}),t.ui.notify(`Analyze tool model saved: ${u.provider}/${u.modelId}`,"info")}}}function Yf(e){e.registerCommand("checks",{description:"Find behavioral gaps in test coverage. Requires an option \u2014 see /checks.",getArgumentCompletions:tT,handler:async(t,n)=>{let r=t.trim();if(!r){n.ui.notify(bi.map(_=>`${_.value} \u2014 ${_.description}`).join(`
|
|
331
|
+
`),"info");return}let a=[...new Set(r.split(/\s+/).filter(Boolean))],i=new Set(bi.map(_=>_.value)),m=a.filter(_=>!i.has(_));if(m.length){n.ui.notify(`Unknown option(s): ${m.join(", ")}. Run /checks with no arguments to see options.`,"warning");return}if(a.includes("--config")){a.length>1?n.ui.notify("--config cannot be combined with other options.","warning"):await nT(e,n);return}let u=a.includes("--gap-finder"),l=a.includes("--solver-gap-finder");if(!u&&!l)return;if(Ga()){n.ui.notify("A checks run is already in progress.","warning");return}let f=Te();if(!f){n.ui.notify("No gap-finder model configured. Run /checks --config first.","error");return}let h=n.modelRegistry.find(f.provider,f.modelId);if(!h||!n.modelRegistry.hasConfiguredAuth(h)){n.ui.notify("Configured behavioral gap-finder model is unavailable or unauthenticated. Run /checks --config.","error");return}let v=li.filter(_=>!zf(rt(n.cwd,_)));if(v.length){n.ui.notify(`Missing required file(s): ${v.join(", ")}`,"error");return}let E=null,A;if(l){if(E=ji(),!E||!zf(rt(n.cwd,"test.sh"))){n.ui.notify("Configure solver gap finder and provide test.sh before running it.","error");return}if(A=n.modelRegistry.find(E.provider,E.modelId),!A||!n.modelRegistry.hasConfiguredAuth(A)){n.ui.notify("Configured solver gap-finder model is unavailable or unauthenticated.","error");return}}let F=Mf(),Y=E?.solverCount??0,ae=(u?2:0)+(l?Y+1:0);n.ui.setWidget(St,ur("preparing clean snapshot",0,ae)),n.ui.notify(`gap finders (${a.join(" ")}) started. Press ${Qv} to cancel.`,"info");let me,at=[];try{let _=rt(Vf(),`checks-${Kf()}`);Bf(_,{recursive:!0}),me=_;let ot=await br(e,n.cwd,_,F.signal);if(ot.status==="error"){n.ui.notify(`checks: ${ot.error}`,"error");return}if(F.signal.aborted)return;for(let je of li)Wv(rt(n.cwd,je),rt(_,je));let it=ja(),Ue=Fa(),pe=0,Ke={status:"ok",gaps:[]},Vt={status:"ok",gaps:[]};if(u){let je={tempDir:_,model:h,thinkingLevel:f.thinkingLevel,testRubric:it,fairnessRules:Ue,cancelSignal:F.signal};if(n.ui.setWidget(St,ur("finding sentence-by-sentence test gaps",pe,ae)),Ke=await qa(je),pe+=1,n.ui.setWidget(St,ur("reviewing test gaps",pe,ae)),Ke.gaps.reduce((Ba,Va)=>Ba+Va.gaps.length,0)>0&&(Vt=await La({...je,statementReports:Ke.gaps})),pe+=1,F.signal.aborted){n.ui.notify("checks: cancelled.","warning");return}}let dt=[],lr={status:"ok",gaps:[]};if(l&&E){if(F.signal.aborted){n.ui.notify("checks: cancelled.","warning");return}let je=[],Tn=ze=>{je.push(ze),pe+=1,n.ui.setWidget(St,ur("solver gap finder: solving",pe,ae,{passed:je.filter(Fe=>Fe.passed).length,failed:je.filter(Fe=>!Fe.passed).length}))},Ba=await Promise.all(Array.from({length:Y},async(ze,Fe)=>{let Wt=rt(Vf(),`checks-solvergap-${Kf()}`);return Bf(Wt,{recursive:!0}),at.push(Wt),{index:Fe+1,setup:await Ki({pi:e,repoDir:n.cwd,solverDir:Wt,testPatchPath:rt(n.cwd,"test.patch"),agentPromptPath:rt(n.cwd,"agent_prompt.md"),cancelSignal:F.signal})}})),Va=di().replace(/[:.]/g,"-");if(dt=await Promise.all(Ba.map(async({index:ze,setup:Fe})=>{if(Fe.status!=="ok"){let $n={index:ze,status:Fe.status,passed:!1,diff:"",testOutputTail:Fe.error,durationMs:0,totalTests:null,failedTests:null};return Tn($n),$n}let Wt=Date.now(),{outcome:Wa,trajectory:Zf}=await Ef({pi:e,solverDir:Fe.solverDir,model:A,thinkingLevel:E.thinkingLevel,timeoutMinutes:E.timeoutMinutes,cancelSignal:F.signal});if(F.signal.aborted||Wa==="cancelled"){let $n=eT(ze,Date.now()-Wt);return Tn($n),$n}let{testOutputXmlPath:Qf,...Ht}=await zi({pi:e,index:ze,workspace:Fe,status:Wa==="done"?"ok":Wa,durationMs:Date.now()-Wt,cancelSignal:F.signal});if(F.signal.aborted||Ht.status==="cancelled")return Tn(Ht),Ht;let eh=E.saveArtifacts?Bi({repoDir:n.cwd,runId:Va,index:ze,trajectory:Zf,solutionPatch:Ht.diff,testOutputXmlPath:Qf,testOutputTail:Ht.testOutputTail}):void 0,wi={...Ht,artifactsDir:eh};return Tn(wi),wi})),F.signal.aborted){n.ui.notify("checks: cancelled.","warning");return}if(dt.some(ze=>ze.status!=="patchFailed"&&ze.status!=="error")&&(Vi(_,dt),lr=await Sf({tempDir:_,model:h,thinkingLevel:f.thinkingLevel,solverResults:dt,testRubric:it,fairnessRules:Ue,cancelSignal:F.signal})),pe+=1,F.signal.aborted){n.ui.notify("checks: cancelled.","warning");return}}let Xf=u&&(Ke.status!=="ok"||Ke.gaps.length>0&&Vt.status!=="ok"),Ti=Of({existingReport:Rf(rt(n.cwd,"shipd_report.json")),config:f,runGapFinder:u,testGaps:Vt.gaps,gapAnalysisIncomplete:Xf,gapFinderStatus:Ke.status,gapFilterStatus:Vt.status,runSolverGapFinder:l,solverResults:dt,solverGaps:lr.gaps,solverGapAnalysisIncomplete:l&&(dt.some(je=>je.status==="error")||lr.status!=="ok"),solverComparisonStatus:lr.status}),$i=Af({merged:Ti,runGapFinder:u,runSolverGapFinder:l});e.sendMessage({customType:"shipd_checks_report",content:$i.content,display:!0,details:$i.details});let ki=rt(n.cwd,"shipd_report.json");Yv(ki,JSON.stringify(Ti,null,2),"utf-8"),n.ui.notify(`checks: wrote details to ${ki}`,"info")}catch(_){n.ui.notify(`checks failed: ${_ instanceof Error?_.message:String(_)}`,"error")}finally{n.ui.setWidget(St,void 0),me&&Hv(me,{recursive:!0,force:!0});for(let _ of at)Wi(_);qf()}}})}var Jf=aT.ctrlShift("x");function iT(e){e.registerCommand("analyze:on",{description:"Enable the Gap Finder tool for this project folder",handler:async(t,n)=>{yi(e,n.cwd,!0),n.ui.notify("Gap Finder tool ON in this project","info")}}),e.registerCommand("analyze:off",{description:"Disable the Gap Finder tool for this project folder",handler:async(t,n)=>{yi(e,n.cwd,!1),n.ui.notify("Gap Finder tool OFF in this project","info")}}),e.registerMessageRenderer("shipd_checks_report",(t,n,r)=>{let a=t.details??{},i=new rT;i.addChild(new vi(r.bold(r.fg("accent","Checks")),0,0));let m=!1,u=l=>{i.addChild(new vi(l,0,0)),m=!0};if(a.showGaps){let l=a.gapsCount??0;u(l>0?r.fg("warning",` \u26A0 ${l} test gap(s) found`):r.fg("success"," \u2713 no test gaps found"))}if(a.showSolverGaps){let l=a.solverDetails??[],f=l.filter(A=>A.passed).length,h=a.solverGapsCount??0;i.addChild(new oT(1)),u(r.bold(r.fg("accent","Solver gap finder")));for(let A of l){let F=A.passed?r.fg("success","\u2713"):r.fg("error","\u2717"),Y=A.passed?"passed":A.status==="ok"?"failed tests":A.status;u(` ${F} Solver ${A.index}: ${Y} (${Pf(A.durationMs)})`)}let v=f===l.length&&l.length>0?r.fg("success",`${f}/${l.length} solvers passed`):r.fg("warning",`${f}/${l.length} solvers passed`),E=h>0?r.fg("warning",`${h} behavioral gap(s) found`):r.fg("success","no behavioral gaps found");u(` ${v}, ${E}`)}return m||i.addChild(new vi(r.fg("dim"," nothing to report"),0,0)),i}),e.registerShortcut(Jf,{description:"Cancel an in-progress /checks run",handler:t=>{Ga()&&Lf()&&(t.ui.setWidget(St,[`checks: cancelling (${Jf})...`]),t.ui.notify("checks: cancelling...","warning"))}}),sT(e),Yf(e)}function sT(e){e.on("session_start",(t,n)=>{gi(e,n.cwd),(t.reason==="resume"||t.reason==="reload"||t.reason==="startup")&&Nf(e)}),e.on("session_tree",async(t,n)=>{gi(e,n.cwd)}),e.on("before_agent_start",()=>{!_f()&&!Ua(e)||In(e)})}export{iT as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sreetej510/pi-shipd-checks",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Pi extension that runs a strict, multi-agent fairness review of a benchmark task's agent_prompt.md, test.patch, and solution.patch, plus behavioral test-gap analysis, via /checks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|