@herjarsa/omo-meta-governor 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +52 -50
- package/dist/index.js.map +4 -4
- package/dist/lib.js +53 -51
- package/dist/lib.js.map +4 -4
- package/dist/mcp-server.js.map +2 -2
- package/dist/metrics.d.ts +1 -1
- package/dist/plugin.d.ts +9 -0
- package/dist/skills/chore.tar.gz +0 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{createRequire as Xg}from"node:module";var qg=Object.defineProperty;var Jg=(e)=>e;function Kg(e,t){this[e]=Jg.bind(null,t)}var ye=(e,t)=>{for(var n in t)qg(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Kg.bind(t,n)})};var
|
|
2
|
-
`)n++;continue}if(s==="/"&&a==="*"){n+=2;while(n<e.length&&!(e[n]==="*"&&e[n+1]==="/"))n++;n+=2;continue}t+=s,n++}return t}function sh(e,t){let n=
|
|
3
|
-
`;return eh(e,s,"utf8"),{changed:!0,wrote:!0}}catch(s){return{changed:!1,wrote:!1,error:s instanceof Error?s.message:String(s)}}}var
|
|
1
|
+
import{createRequire as Xg}from"node:module";var qg=Object.defineProperty;var Jg=(e)=>e;function Kg(e,t){this[e]=Jg.bind(null,t)}var ye=(e,t)=>{for(var n in t)qg(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Kg.bind(t,n)})};var He=(e,t)=>()=>(e&&(t=e(e=0)),t);var tt=Xg(import.meta.url);var ah={};ye(ah,{migrateOldToNew:()=>Be,newPluginPaths:()=>ge,oldPluginPaths:()=>Ve,patchInstructionsArray:()=>sh,readOpencodeJsonc:()=>gd});import{existsSync as Ho,mkdirSync as Yg,readFileSync as Qg,writeFileSync as eh,unlinkSync as pd,copyFileSync as th}from"node:fs";import{dirname as rh,join as fe,resolve as nh}from"node:path";import{homedir as oh}from"node:os";function fd(){return nh(oh(),".config","opencode")}function Ve(e){let t=e??fd();return{log:fe(t,"meta-governor.log"),health:fe(t,"meta-governor-health.json"),selfVersionCache:fe(t,"omo-meta-governor-self-version-cache.json"),upgradeCheck:fe(t,"omo-meta-governor-upgrade-check.json"),cliAnythingUpgradeCheck:fe(t,"omo-cli-anything-upgrade-check.json")}}function ge(e){let t=e??fd(),n=fe(t,"plugins","omo-meta-governor");return{pluginDir:n,logDir:fe(n,"log"),cacheDir:fe(n,"cache"),log:fe(n,"log","meta-governor.log"),health:fe(n,"health.json"),selfVersionCache:fe(n,"cache","self-version.json"),upgradeCheck:fe(n,"cache","upgrade-check.json"),cliAnythingUpgradeCheck:fe(n,"cache","cli-anything-upgrade-check.json"),instructions:fe(n,"instructions.md"),config:fe(n,"config.json")}}function Be(e){let t=[],n=[],o=[[e.oldPaths.log,e.newPaths.log],[e.oldPaths.health,e.newPaths.health],[e.oldPaths.selfVersionCache,e.newPaths.selfVersionCache],[e.oldPaths.upgradeCheck,e.newPaths.upgradeCheck],[e.oldPaths.cliAnythingUpgradeCheck,e.newPaths.cliAnythingUpgradeCheck]];for(let[r,i]of o){if(!Ho(r)){n.push(r);continue}if(Ho(i)){try{pd(r),t.push(r)}catch{n.push(r)}continue}try{Yg(rh(i),{recursive:!0}),th(r,i),pd(r),t.push(r)}catch{n.push(r)}}return{migrated:t,skipped:n}}function gd(e){if(!Ho(e))return{exists:!1};try{let t=Qg(e,"utf8"),n=ih(t),o=JSON.parse(n);return{exists:!0,raw:t,data:o}}catch(t){return{exists:!0,error:t instanceof Error?t.message:String(t)}}}function ih(e){let t="",n=0,o=!1,r="",i=!1;while(n<e.length){let s=e[n],a=e[n+1];if(o){if(t+=s,i)i=!1;else if(s==="\\")i=!0;else if(s===r)o=!1;n++;continue}if(s==='"'||s==="'"){o=!0,r=s,t+=s,n++;continue}if(s==="/"&&a==="/"){while(n<e.length&&e[n]!==`
|
|
2
|
+
`)n++;continue}if(s==="/"&&a==="*"){n+=2;while(n<e.length&&!(e[n]==="*"&&e[n+1]==="/"))n++;n+=2;continue}t+=s,n++}return t}function sh(e,t){let n=gd(e);if(!n.exists)return{changed:!1,wrote:!1,error:"file not found"};if(n.error||!n.data)return{changed:!1,wrote:!1,error:n.error??"parse error"};let o=n.data,r=o.instructions,i;if(r===void 0)i=[t],o.instructions=i;else if(Array.isArray(r)){if(r.includes(t))return{changed:!1,wrote:!1};r.push(t),i=r}else return{changed:!1,wrote:!1,error:"instructions is not an array"};try{let s=JSON.stringify(o,null,2)+`
|
|
3
|
+
`;return eh(e,s,"utf8"),{changed:!0,wrote:!0}}catch(s){return{changed:!1,wrote:!1,error:s instanceof Error?s.message:String(s)}}}var Xt=()=>{};import{spawn as lh,spawnSync as pt}from"node:child_process";function hd(e){try{let t=pt("pgrep",["-P",String(e)],{encoding:"utf8"});for(let n of t.stdout.trim().split(/\s+/)){let o=Number(n);if(!o)continue;hd(o);try{process.kill(o,"SIGKILL")}catch{}}}catch{}}function ft(e){if(!e||e<=0)return;try{if(process.platform==="win32")pt("taskkill",["/pid",String(e),"/T","/F"],{stdio:"ignore"});else{try{process.kill(-e,"SIGKILL")}catch{}hd(e);try{process.kill(e,"SIGKILL")}catch{}}}catch{}}function ch(e){if(!e||e<=0)return!1;try{return process.kill(e,0),!0}catch(t){if(t.code==="ESRCH")return!1;return!0}}function Bo(e){if(e&&e>0)en.add(e)}function tn(e){en.delete(e)}function rn(){let e=0;for(let t of en)if(ch(t))ft(t),e++;return en.clear(),e}function nn(e,t,n){return new Promise((o)=>{let r;try{r=lh(e,t,{cwd:n.cwd,stdio:["ignore","pipe","pipe"],shell:process.platform==="win32",windowsHide:!0,env:{...process.env,OMO_MG_SPAWN:"1",...n.env}})}catch{o({stdout:"",stderr:"",code:null,timedOut:!1});return}Bo(r.pid);let i="",s="",a=!1,l=!1,c,u=(g)=>{if(l)return;if(l=!0,clearTimeout(f),c)clearTimeout(c);tn(r.pid),o(g)},f=setTimeout(()=>{a=!0,ft(r.pid),c=setTimeout(()=>{u({stdout:i,stderr:s,code:null,timedOut:!0})},2000)},n.timeoutMs);r.stdout?.on("data",(g)=>{i+=g.toString("utf8")}),r.stderr?.on("data",(g)=>{s+=g.toString("utf8")}),r.on("error",()=>{u({stdout:i,stderr:s,code:null,timedOut:a})}),r.on("close",(g)=>{if(r.exitCode===null)ft(r.pid);u({stdout:i,stderr:s,code:g,timedOut:a})})})}function ne(e,t,n){let o=Date.now(),r;try{r=pt(e,t,{cwd:n.cwd,stdio:["ignore","pipe","pipe"],shell:process.platform==="win32",windowsHide:!0,env:{...process.env,OMO_MG_SPAWN:"1",...n.env},timeout:n.timeoutMs})}catch{return{stdout:"",stderr:"",code:null,timedOut:!1}}let i=Date.now()-o,s=r.error!=null&&r.error.code==="ETIMEDOUT"||r.signal==="SIGTERM"||i>=n.timeoutMs-50;if(s&&r.pid)ft(r.pid);return{stdout:(r.stdout??"").toString("utf8"),stderr:(r.stderr??"").toString("utf8"),code:r.status,timedOut:s}}function It(){let e=0;try{if(process.platform==="win32"){for(let t of["graphify.exe","codegraph.exe"])try{pt("taskkill",["/IM",t,"/F"],{stdio:"ignore"})}catch{}try{if(pt("powershell",["-NoProfile","-Command","Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -match 'OMO_MG_WATCH|OMO_MG_SPAWN' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }"],{stdio:"ignore"}).status===0)e=1}catch{}}else{for(let t of["graphify","codegraph"])try{pt("pkill",["-x",t],{stdio:"ignore"})}catch{}try{pt("pkill",["-f","OMO_MG_WATCH|OMO_MG_SPAWN"],{stdio:"ignore"})}catch{}}}catch{}return e}function qo(){if(Vo)return!1;Vo=!0;let e=()=>{try{rn()}catch{}try{It()}catch{}};Yt.push({event:"exit",fn:e}),process.on("exit",e);let t=(o)=>{e();let r=o==="SIGINT"?130:o==="SIGTERM"?143:o==="SIGHUP"?129:1;process.exit(r)};Yt.push({event:"SIGINT",fn:t}),Yt.push({event:"SIGTERM",fn:t}),Yt.push({event:"SIGHUP",fn:t}),process.on("SIGINT",t),process.on("SIGTERM",t),process.on("SIGHUP",t);let n=()=>{e()};return Yt.push({event:"beforeExit",fn:n}),process.on("beforeExit",n),!0}function Cx(){return Vo}var en,Yt,Vo=!1;var on=He(()=>{en=new Set;Yt=[]});var an={};ye(an,{LOG_PATH:()=>be,getLogFileSize:()=>kh,getRotatedLogCount:()=>wh,logStructured:()=>_h,logToFile:()=>I});import{appendFileSync as uh,mkdirSync as dh,statSync as vd,renameSync as mh,existsSync as sn,unlinkSync as ph}from"node:fs";import{dirname as fh}from"node:path";function yd(e){let t=e;for(let n of gh)t=t.replace(n,"[REDACTED]");return t}function Jo(e,t=new WeakSet){if(typeof e==="string")return yd(e);if(Array.isArray(e)){if(t.has(e))return"[Circular]";return t.add(e),e.map((n)=>Jo(n,t))}if(e&&typeof e==="object"){if(t.has(e))return"[Circular]";t.add(e);let n={};for(let[o,r]of Object.entries(e))if(hh.test(o))n[o]="[REDACTED]";else try{n[o]=Jo(r,t)}catch{n[o]="[unserializable]"}return n}return e}function yh(){try{dh(fh(be),{recursive:!0})}catch{}}function bh(){if(!sn(be))return;try{if(vd(be).size<vh)return}catch{return}for(let e=Ko;e>=1;e--){let t=e===1?be:`${be}.${e-1}`,n=`${be}.${e}`;if(sn(t))try{if(e===Ko)ph(t);else mh(t,n)}catch{}}}function bd(e,t,n,o,r){yh(),bh();let i=yd(t),s=n!==void 0?Jo(n):void 0,a={timestamp:new Date().toISOString(),level:e,message:i,...o?{event:o}:{},...r?{sessionID:r}:{},...s!==void 0?{data:s}:{}},l;try{l=JSON.stringify(a)+`
|
|
4
4
|
`}catch{l=JSON.stringify({timestamp:a.timestamp,level:e,message:t,data:"[unserializable]"})+`
|
|
5
|
-
`}try{uh(be,l)}catch{}if(e==="error")console.error(`[meta-governor] ${t}`)}function
|
|
5
|
+
`}try{uh(be,l)}catch{}if(e==="error")console.error(`[meta-governor] ${t}`)}function I(e,t,n){bd(e,t,n)}function _h(e){bd(e.level,e.message,e.data,e.event,e.sessionID)}function kh(){try{if(sn(be))return vd(be).size}catch{}return 0}function wh(){let e=0;for(let t=1;t<=Ko;t++)if(sn(`${be}.${t}`))e=t;else break;return e}var gh,hh,be,vh=10485760,Ko=5;var gt=He(()=>{Xt();gh=[/eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/g,/sk-(?:proj-|svc-|)[a-zA-Z0-9]{20,}/g,/pk-[a-zA-Z0-9]{20,}/g,/ghp_[a-zA-Z0-9]{36,}/g,/ghs_[a-zA-Z0-9]{36,}/g,/github_pat_[a-zA-Z0-9]{22,}/g,/Bearer\s+[a-zA-Z0-9_\-]{20,}/gi,/(?:key|secret|token|password|credential|private_key)\s*[:=]\s*['"]?[a-zA-Z0-9_\-]{16,}/gi],hh=/^(?:key|secret|token|password|credential|private_key|api[_-]?key|access[_-]?token|auth[_-]?token)$/i;try{Be({oldPaths:Ve(),newPaths:ge()})}catch{}be=ge().log});var Md={};ye(Md,{checkToolAvailability:()=>ti,detectRemoteNewCommits:()=>ii,fetchCodegraphLatestVersion:()=>Rd,fetchGraphifyLatestVersion:()=>zd,getDefaultUpgradeCachePath:()=>Pd,getInstalledCodegraphVersion:()=>ni,getInstalledGraphifyVersion:()=>Cd,getSessionCount:()=>Th,hasActiveWatcher:()=>Dh,initCodegraph:()=>Sd,initGraphify:()=>Id,installCodegraph:()=>Yo,installGraphify:()=>Qo,isCacheFresh:()=>oi,isGitCommitCommand:()=>dn,isGraphifyHookInstalled:()=>Td,isNewerVersion:()=>un,logToFile:()=>cn,readUpgradeCache:()=>Od,resetInitializedProjects:()=>$h,runGraphSync:()=>er,shouldUpgrade:()=>ri,stopWatches:()=>Qt,trackSession:()=>Sh,triggerCodegraphSync:()=>Dd,triggerReindex:()=>mn,untrackSession:()=>Ih,writeUpgradeCache:()=>Ed});import{execSync as ht,spawn as _d}from"node:child_process";import{access as Fx,stat as $d}from"node:fs/promises";import{resolve as Xo,join as xh}from"node:path";async function Yo(e,t=60000,n){let o=["i","-D","@colbymchenry/codegraph"];if(n)try{return n(`npm ${o.join(" ")}`,{cwd:e,stdio:"ignore",timeout:t}),"codegraph-installed"}catch{return"codegraph-install-failed"}return ne("npm",o,{cwd:e,timeoutMs:t}).code===0?"codegraph-installed":"codegraph-install-failed"}async function Qo(e=60000,t){if(t)try{return t("pip install --upgrade graphifyy --break-system-packages --quiet",{stdio:"ignore",timeout:e}),"graphify-installed"}catch{try{return t("uv tool install --upgrade graphifyy --quiet",{stdio:"ignore",timeout:e}),"graphify-installed"}catch{return"graphify-install-failed"}}if(ne("pip",["install","--upgrade","graphifyy","--break-system-packages","--quiet"],{timeoutMs:e}).code===0)return"graphify-installed";return ne("uv",["tool","install","--upgrade","graphifyy","--quiet"],{timeoutMs:e}).code===0?"graphify-installed":"graphify-install-failed"}function $h(){ei.clear()}function Sh(e){let n=(Tt.get(e)??0)+1;return Tt.set(e,n),n}function Ih(e){let t=Tt.get(e)??0,n=Math.max(0,t-1);if(n===0)Tt.delete(e),Qt(e);else Tt.set(e,n);return n}function Th(e){return Tt.get(e)??0}async function ti(e,t=ht){let n=!1,o=!1,r=await xd(Xo(e,".codegraph","codegraph.db")),i=await xd(Xo(e,"graphify-out","graph.json")),s=(a,l)=>{if(t!==ht)return t(a,{stdio:"ignore",...l});let c=a.split(" "),u=c[0],f=c.slice(1),g=ne(u,f,{cwd:l?.cwd??e,timeoutMs:l?.timeout??1e4});if(g.code!==0)throw Error(`exit ${g.code}`)};try{s("npx --yes codegraph --version",{timeout:1e4}),n=!0}catch{try{s("node node_modules/.bin/codegraph --version",{cwd:e,timeout:5000}),n=!0}catch{}}try{s("graphify --version",{timeout:5000}),o=!0}catch{try{s("graphifyy --version",{timeout:5000}),o=!0}catch{try{s('python -c "import graphifyy"',{timeout:5000}),o=!0}catch{try{s('python3 -c "import graphifyy"',{timeout:5000}),o=!0}catch{}}}}return{codegraph:n,graphify:o,codegraphIndexExists:r,graphifyIndexExists:i}}async function Sd(e,t=60000,n=ht){try{if(n!==ht)n("npx --yes codegraph init",{cwd:e,stdio:"ignore",timeout:t});else{let o=ne("npx",["--yes","codegraph","init"],{cwd:e,timeoutMs:t});if(o.code!==0)throw Error(`exit ${o.code}`)}return!0}catch{return!1}}async function Id(e,t=120000,n=ht){let o=[{bin:"graphify",args:[".","--no-viz"]},{bin:"python",args:["-m","graphify",".","--no-viz"]},{bin:"python3",args:["-m","graphify",".","--no-viz"]}];for(let r of o)try{if(n!==ht)n(`${r.bin} ${r.args.join(" ")}`,{cwd:e,stdio:"ignore",timeout:t});else{let i=ne(r.bin,r.args,{cwd:e,timeoutMs:t});if(i.code!==0)throw Error(`exit ${i.code}`)}return!0}catch{}return!1}function wd(e,t){let n=`${e}:${t}`;if(Dt.has(n))return;try{let o;if(t==="codegraph")o=_d("node",["-e",`
|
|
6
6
|
const OMO_MG_WATCH = 1;
|
|
7
7
|
const {spawn} = require("child_process");
|
|
8
8
|
const run = () => {
|
|
@@ -18,8 +18,8 @@ import{createRequire as Xg}from"node:module";var qg=Object.defineProperty;var Jg
|
|
|
18
18
|
};
|
|
19
19
|
run();
|
|
20
20
|
setInterval(run, 30_000);
|
|
21
|
-
`],{stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});else o=
|
|
22
|
-
`)[0]??"").match(/graphifyy\s*\(?([0-9]+\.[0-9]+\.[0-9]+[^\s)]*)/);if(r)return r[1]}catch{}for(let t of["python","python3"])try{let o=
|
|
21
|
+
`],{stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});else o=_d("python3",["-m","graphify",".","--no-viz","--watch"],{cwd:e,stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});o.unref(),Dt.set(n,{process:o,tool:t}),Bo(o.pid),o.on("exit",()=>{Dt.delete(n),tn(o.pid)})}catch{}}function Qt(e){for(let[t,n]of Dt)if(!e||t.startsWith(e)){let o=n.process.pid;if(o)tn(o);if(process.platform==="win32")ft(o);else{try{n.process.kill("SIGTERM")}catch{}setTimeout(()=>{ft(o)},2000).unref()}Dt.delete(t)}}function Dh(e,t){for(let n of Dt.keys())if(n.startsWith(e)){if(!t||n.endsWith(t))return!0}return!1}async function er(e={enabled:!0,watch:!1,autoInstall:!0,installTimeoutMs:60000}){let t=[],n=e.projectDir??process.cwd();if(!e.enabled)return{attempted:!1,codes:["disabled"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:!1,graphifyIndexExists:!1},alreadyInitialized:!1};if(e.killOrphanedOnInit!==!1&&!kd){kd=!0;let r=It();cn("info","orphan sweep: killed "+r+" leftover tool processes")}if(ei.has(n)){let r=await ti(n,e.runner);return{attempted:!1,codes:r.codegraphIndexExists?["codegraph-already-exists"]:[],availability:r,alreadyInitialized:!0}}ei.add(n);let o;try{o=await ti(n,e.runner)}catch{return{attempted:!1,codes:["error"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:!1,graphifyIndexExists:!1},alreadyInitialized:!1}}if(e.autoUpgrade!==!1)try{let r=e.upgradeCachePath??Pd(),i=await Od(r),s=e.upgradeCheckTtlMs??86400000,a={codegraph:null,graphify:null},l=async(c)=>{let u=c==="codegraph"?"codegraphLatest":"graphifyLatest";if(oi(i,s)&&i?.[u])return i[u];let g=await(c==="codegraph"?Rd:zd)();return a[c]=g,g};if(o.codegraph){let c=await ni(e.runner),u=await l("codegraph");if(ri(c,u,i,s,"codegraphLatest")){if(u&&un(c,u)){if(await Yo(n,e.installTimeoutMs??60000,e.runner)==="codegraph-installed"){if(t.push("codegraph-upgraded"),await ni(e.runner)==null)t.push("codegraph-upgrade-broken")}}}}if(o.graphify){let c=await Cd(e.runner),u=await l("graphify");if(ri(c,u,i,s,"graphifyLatest")){if(u&&un(c,u)){if(await Qo(e.installTimeoutMs??60000,e.runner)==="graphify-installed")t.push("graphify-upgraded")}}if(e.checkGraphifyNeedsUpdate!==!1)try{if((e.runner?(()=>{try{return e.runner("graphify check-update "+n,{cwd:n,stdio:"ignore",timeout:1e4}),{code:0,stdout:"",stderr:""}}catch{return{code:1,stdout:"",stderr:"runner rejected"}}})():ne("graphify",["check-update",n],{cwd:n,timeoutMs:1e4})).code!==0){if(e.runner)try{e.runner("graphify update "+n+" --no-cluster",{cwd:n,stdio:"ignore",timeout:e.installTimeoutMs??60000})}catch{}else ne("graphify",["update",n,"--no-cluster"],{cwd:n,timeoutMs:e.installTimeoutMs??60000});t.push("graphify-reextract-triggered")}}catch{}}try{await Ed(r,{checkedAtMs:Date.now(),codegraphLatest:a.codegraph??i?.codegraphLatest,graphifyLatest:a.graphify??i?.graphifyLatest}),t.push("upgrade-cache-written")}catch{}}catch{t.push("upgrade-check-skipped")}if(e.autoInstall!==!1){if(!o.codegraph){let r=await Yo(n,e.installTimeoutMs??60000,e.runner);if(t.push(r),r==="codegraph-installed")o.codegraph=!0}if(!o.graphify){let r=await Qo(e.installTimeoutMs??60000,e.runner);if(t.push(r),r==="graphify-installed")o.graphify=!0}}else{if(!o.codegraph)t.push("codegraph-install-skipped");if(!o.graphify)t.push("graphify-install-skipped")}if(o.codegraph)if(!o.codegraphIndexExists){let r=await Sd(n,e.installTimeoutMs??60000);t.push(r?"codegraph-initialized":"codegraph-init-failed")}else t.push("codegraph-already-exists");else t.push("codegraph-unavailable");if(o.graphify){if(!o.graphifyIndexExists){let r=await Id(n,e.installTimeoutMs??120000);t.push(r?"graphify-initialized":"graphify-init-failed")}else t.push("graphify-already-exists");try{if(!await Td(n)){if(ne("graphify",["hook","install"],{cwd:n,timeoutMs:1e4}).code===0)t.push("graphify-hook-installed")}}catch{}}else t.push("graphify-unavailable");if(e.watch){if(o.codegraph)wd(n,"codegraph"),t.push("watch-started-codegraph");if(o.graphify)wd(n,"graphify"),t.push("watch-started-graphify")}if(e.addToGlobalGraph===!0&&o.graphify)try{await nn("graphify",["global","add",xh(n,"graphify-out")],{cwd:n,timeoutMs:1e4}),t.push("graphify-added-to-global")}catch{t.push("graphify-global-add-failed")}return{attempted:!0,codes:t,availability:o,alreadyInitialized:!1}}async function ln(e){try{return(await $d(e)).isDirectory()}catch{return!1}}async function xd(e){try{return(await $d(e)).isFile()}catch{return!1}}function dn(e){if(typeof e!=="string"||e.length===0)return!1;let t=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])git\s+commit(?:\s+-|\s|$)/.test(t)}async function mn(e,t){if(await ln(Xo(e,".codegraph")))return await Dd(e,t);return await er({enabled:!0,watch:!1,autoInstall:!1,installTimeoutMs:5000,projectDir:e,runner:t})}async function Td(e){let{access:t,readFile:n}=await import("node:fs/promises"),{resolve:o}=await import("node:path"),r=o(e,".git","hooks","post-commit");try{await t(r)}catch{return!1}try{return(await n(r,"utf-8")).includes("graphify-hook-start")}catch{return!1}}async function Dd(e,t){let{resolve:n}=await import("node:path"),o=[],r=await ln(n(e,".codegraph"));if(r){try{if(t)t("npx --yes codegraph sync -q",{cwd:e,stdio:"ignore",timeout:30000});else ne("npx",["--yes","codegraph","sync","-q"],{cwd:e,timeoutMs:30000});o.push("codegraph-already-exists"),cn("info",`codegraph sync -q completed for ${e}`)}catch(s){cn("warn",`codegraph sync failed for ${e}: ${s}`),o.push("codegraph-install-failed")}return{attempted:!0,codes:o,availability:{codegraph:!0,graphify:!1,codegraphIndexExists:r,graphifyIndexExists:await ln(n(e,"graphify-out"))},alreadyInitialized:!1}}let i=!1;try{if(t)t("npx --yes codegraph --version",{stdio:"ignore",timeout:5000});else if(ne("npx",["--yes","codegraph","--version"],{timeoutMs:5000}).code!==0)throw Error("codegraph probe failed");i=!0}catch{try{if(t)t("node node_modules/.bin/codegraph --version",{cwd:e,stdio:"ignore",timeout:5000});else if(ne("node",["node_modules/.bin/codegraph","--version"],{cwd:e,timeoutMs:5000}).code!==0)throw Error("local codegraph probe failed");i=!0}catch{}}if(!i)return{attempted:!0,codes:["codegraph-unavailable"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:r,graphifyIndexExists:await ln(n(e,"graphify-out"))},alreadyInitialized:!1};return await er({enabled:!0,watch:!1,autoInstall:!1,installTimeoutMs:5000,projectDir:e,runner:t})}function un(e,t){if(e==null&&t)return!0;if(!t)return!1;let n=e,o=t;if(!n||n===o)return!1;let r=/^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;if(!r.test(n)||!r.test(o))return!1;let i=(y)=>{let[x="",C=""]=y.split("-",2),j=x.split(".").map((Pe)=>{let Bt=Number.parseInt(Pe,10);return Number.isFinite(Bt)?Bt:0}),[K=0,W=0,ae=0]=j;return[K,W,ae,C]},[s,a,l,c]=i(n),[u,f,g,d]=i(o);if(u!==s)return u>s;if(f!==a)return f>a;if(g!==l)return g>l;if(c&&!d)return!0;if(!c&&d)return!1;return d>c}function Pd(){return ge().upgradeCheck}async function Od(e){try{let{readFile:t}=await import("node:fs/promises"),n=await t(e,"utf-8"),o=JSON.parse(n);if(typeof o?.checkedAtMs==="number")return o;return null}catch{return null}}async function Ed(e,t){let{dirname:n}=await import("node:path"),{mkdir:o,writeFile:r}=await import("node:fs/promises"),i=n(e);try{await o(i,{recursive:!0}),await r(e,JSON.stringify(t,null,2))}catch{}}function oi(e,t){if(!e)return!1;let n=Date.now()-e.checkedAtMs;return n>=0&&n<t}function ri(e,t,n,o,r="codegraphLatest"){let i=t;if(oi(n,o))i=n?.[r]??i;if(!e&&!i)return!1;if(!i)return!1;if(!e)return!0;return un(e,i)}async function Rd(){try{let t=ne("npm",["view","@colbymchenry/codegraph","version"],{timeoutMs:1e4}).stdout.trim();return t.length>0?t:null}catch{return null}}async function zd(e=ht){for(let t of["python","python3"])try{let r=(ne(t,["-m","pip","index","versions","graphifyy"],{timeoutMs:1e4}).stdout.split(`
|
|
22
|
+
`)[0]??"").match(/graphifyy\s*\(?([0-9]+\.[0-9]+\.[0-9]+[^\s)]*)/);if(r)return r[1]}catch{}for(let t of["python","python3"])try{let o=ne(t,["-c","import urllib.request, json; d=json.load(urllib.request.urlopen('https://pypi.org/pypi/graphifyy/json')); print(d['info']['version'])"],{timeoutMs:1e4}).stdout.trim();if(o.length>0)return o}catch{}return null}async function ni(e){let t=[{bin:"npx",args:["--yes","codegraph","--version"]},{bin:"node",args:["node_modules/.bin/codegraph","--version"]}];for(let{bin:n,args:o}of t)try{let r;if(e){let s=e(`${n} ${o.join(" ")}`,{stdio:"ignore",timeout:1e4});r=typeof s==="string"?s:s.toString()}else r=ne(n,o,{timeoutMs:1e4}).stdout;let i=r.match(/([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(i)return i[1]}catch{}return null}async function Cd(e){let t=(n,o)=>{if(e){let r=e(`${n} ${o.join(" ")}`,{stdio:"ignore",timeout:1e4});return typeof r==="string"?r:r.toString()}return ne(n,o,{timeoutMs:1e4}).stdout};try{let o=t("graphify",["--version"]).match(/([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(o)return o[1]}catch{}try{let o=t("python",["-m","pip","show","graphifyy"]).match(/Version:\s*([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(o)return o[1]}catch{}try{let o=t("python3",["-m","pip","show","graphifyy"]).match(/Version:\s*([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(o)return o[1]}catch{}return null}function ii(e,t,n){let o=n?(i)=>n(i,{cwd:e}).toString():void 0,r=t;try{if(!r)if(o)r=o("git rev-parse --abbrev-ref HEAD").trim();else r=ne("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,timeoutMs:5000}).stdout.trim();if(o)o(`git fetch origin ${r}`);else ne("git",["fetch","origin",r],{cwd:e,timeoutMs:30000});let i;if(o)i=o(`git rev-list --count HEAD..origin/${r}`);else i=ne("git",["rev-list","--count",`HEAD..origin/${r}`],{cwd:e,timeoutMs:1e4}).stdout;let s=Number.parseInt(i.trim(),10);return Number.isFinite(s)&&s>0?s:0}catch{return 0}}var ei,Tt,kd=!1,Dt,cn;var pn=He(()=>{Xt();on();gt();try{Be({oldPaths:Ve(),newPaths:ge()})}catch{}ei=new Set;Tt=new Map;Dt=new Map;cn=I});var rr={};ye(rr,{compareSemver:()=>ai,fetchCliHubLatestVersion:()=>si,getInstalledCliHubVersion:()=>tr,infoCli:()=>Rh,installCli:()=>zh,installCliHub:()=>li,installCliHubMetaSkill:()=>ui,isCliHubMetaSkillInstalled:()=>mi,listClis:()=>Oh,searchClis:()=>Eh,upgradeCliHub:()=>ci,upgradeCliHubMetaSkill:()=>di});import{execSync as Ph}from"node:child_process";function he(e,t,n){try{return{ok:!0,stdout:t(e,{timeoutMs:n}),stderr:"",timedOut:!1}}catch(o){let r=o,i=typeof r.stdout==="string"?r.stdout:r.stdout instanceof Buffer?r.stdout.toString("utf8"):"",s=typeof r.stderr==="string"?r.stderr:r.stderr instanceof Buffer?r.stderr.toString("utf8"):r.message??"",a=/timed out|ETIMEDOUT|timeout/i.test(s);return{ok:!1,stdout:i,stderr:s,timedOut:a}}}function tr(e=Ce){let t=he("pip show cli-anything-hub",e,1e4);if(!t.ok)t=he("pip3 show cli-anything-hub",e,1e4);if(!t.ok)t=he("python -m pip show cli-anything-hub",e,1e4);if(!t.ok)return null;let n=t.stdout.match(/^Version:\s*([\d.]+[^\s]*)/m);return n?n[1].trim():null}function si(e=Ce){let t=he("pip index versions cli-anything-hub",e,1e4);if(!t.ok)t=he("pip3 index versions cli-anything-hub",e,1e4);if(!t.ok)t=he("python -m pip index versions cli-anything-hub",e,1e4);if(!t.ok)return null;let n=t.stdout.match(/^\S+\s+\(([\d.]+[^\s,)]*)/m);return n?n[1].trim():null}function ai(e,t){if(e===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.split(/[.+-]/).map((r)=>Number.parseInt(r,10)||0),o=t.split(/[.+-]/).map((r)=>Number.parseInt(r,10)||0);for(let r=0;r<Math.max(n.length,o.length);r++){let i=n[r]??0,s=o[r]??0;if(i<s)return-1;if(i>s)return 1}return 0}function li(e=Ce,t=60000){let n=Date.now(),o=["uv tool install cli-anything-hub","uv pip install --system --break-system-packages cli-anything-hub","pip install --user cli-anything-hub","pip install cli-anything-hub"],r="";for(let i of o){let s=he(i,e,t);if(s.ok)return{ok:!0,data:null,rawOutput:s.stdout,stderr:s.stderr,durationMs:Date.now()-n,code:"cli-anything-install-succeeded"};r=s.stderr}return{ok:!1,data:null,rawOutput:null,stderr:r.slice(0,500),durationMs:Date.now()-n,code:"cli-anything-install-failed"}}function ci(e=Ce,t=60000){let n=Date.now(),o=["uv tool upgrade cli-anything-hub","uv tool install --upgrade cli-anything-hub","uv pip install --system --upgrade --break-system-packages cli-anything-hub","pip install --user --upgrade cli-anything-hub","pip install --upgrade cli-anything-hub"],r="";for(let i of o){let s=he(i,e,t);if(s.ok)return{ok:!0,data:null,rawOutput:s.stdout,stderr:s.stderr,durationMs:Date.now()-n,code:"cli-anything-upgrade-succeeded"};r=s.stderr}return{ok:!1,data:null,rawOutput:null,stderr:r.slice(0,500),durationMs:Date.now()-n,code:"cli-anything-upgrade-failed"}}function Oh(e={},t=Ce,n=30000,o="cli-hub"){let r=Date.now(),i=["list","--json"];if(e.category)i.push("--category",e.category);if(e.source)i.push("--source",e.source);let s=he(`${o} ${i.join(" ")}`,t,n);if(!s.ok)return{ok:!1,data:null,rawOutput:s.stdout,stderr:s.stderr.slice(0,500),durationMs:Date.now()-r,code:"cli-hub-list-failed"};try{return{ok:!0,data:JSON.parse(s.stdout),rawOutput:null,stderr:s.stderr,durationMs:Date.now()-r,code:"cli-hub-list-succeeded"}}catch{return{ok:!1,data:null,rawOutput:s.stdout,stderr:"Failed to parse cli-hub list JSON output",durationMs:Date.now()-r,code:"cli-hub-list-failed"}}}function Eh(e,t=Ce,n=30000,o="cli-hub"){let r=Date.now();if(!e.trim())return{ok:!1,data:null,rawOutput:null,stderr:"empty query",durationMs:0,code:"cli-hub-search-failed"};let i=he(`${o} search "${e}" --json`,t,n);if(!i.ok)return{ok:!1,data:null,rawOutput:i.stdout,stderr:i.stderr.slice(0,500),durationMs:Date.now()-r,code:"cli-hub-search-failed"};try{return{ok:!0,data:JSON.parse(i.stdout),rawOutput:null,stderr:i.stderr,durationMs:Date.now()-r,code:"cli-hub-search-succeeded"}}catch{return{ok:!1,data:null,rawOutput:i.stdout,stderr:"Failed to parse cli-hub search JSON output",durationMs:Date.now()-r,code:"cli-hub-search-failed"}}}function Rh(e,t=Ce,n=1e4,o="cli-hub"){let r=Date.now(),i=he(`${o} info "${e}"`,t,n);if(!i.ok)return{ok:!1,data:null,rawOutput:i.stdout,stderr:i.stderr.slice(0,500),durationMs:Date.now()-r,code:"cli-hub-info-failed"};return{ok:!0,data:i.stdout,rawOutput:null,stderr:i.stderr,durationMs:Date.now()-r,code:"cli-hub-info-succeeded"}}function zh(e,t=Ce,n=120000,o="cli-hub"){let r=Date.now(),i=he(`${o} install "${e}"`,t,n);if(!i.ok)return{ok:!1,data:null,rawOutput:i.stdout,stderr:i.stderr.slice(0,500),durationMs:Date.now()-r,code:"cli-hub-install-failed"};return{ok:!0,data:null,rawOutput:i.stdout,stderr:i.stderr,durationMs:Date.now()-r,code:"cli-hub-install-succeeded"}}function ui(e="global",t=Ce,n=60000,o="npx skills"){let r=Date.now(),s=`${o} add HKUDS/CLI-Anything --skill cli-hub-meta-skill ${e==="global"?"-g":"-p"} -y`,a=he(s,t,n);if(!a.ok)return{ok:!1,data:null,rawOutput:a.stdout,stderr:a.stderr.slice(0,500),durationMs:Date.now()-r,code:"skill-install-failed"};return{ok:!0,data:null,rawOutput:a.stdout,stderr:a.stderr,durationMs:Date.now()-r,code:"skill-install-succeeded"}}function di(e="global",t=Ce,n=60000,o="npx skills"){let r=Date.now(),s=`${o} update cli-hub-meta-skill ${e==="global"?"-g":"-p"} -y`,a=he(s,t,n);if(!a.ok)return{ok:!1,data:null,rawOutput:a.stdout,stderr:a.stderr.slice(0,500),durationMs:Date.now()-r,code:"skill-upgrade-failed"};return{ok:!0,data:null,rawOutput:a.stdout,stderr:a.stderr,durationMs:Date.now()-r,code:"skill-upgrade-succeeded"}}function mi(e="global",t=Ce,n=1e4,o="npx skills"){let i=he(`${o} list ${e==="global"?"-g":"-p"}`,t,n);if(!i.ok)return!1;return/cli-hub-meta-skill/i.test(i.stdout)}var Ce=(e,t)=>Ph(e,{timeout:t?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]}).toString();var Pt=()=>{};var Up={};ye(Up,{_sessionStore:()=>Hr,buildEscalationPrompt:()=>gu,existsSync:()=>kk,hasSessionClient:()=>Wt,join:()=>_k,persistSessionMessage:()=>Oo,promptAgent:()=>lt,promptAgentText:()=>fu,runWithClient:()=>xk,setSessionClient:()=>pu});import{join as _k}from"node:path";import{existsSync as kk}from"node:fs";import{AsyncLocalStorage as wk}from"node:async_hooks";function pu(e){if(e){let t=Date.now();if(t-Np>1000)Np=t,Promise.resolve().then(() => (gt(),an)).then(({logToFile:n})=>{n("info","SessionBridge: OpenCode client hydrated — session.prompt() available")}).catch((n)=>{Promise.resolve().then(() => (gt(),an)).then(({logToFile:o})=>o("warn",`session-bridge setSessionClient log init failed: ${String(n)}`))})}Po=e}function xk(e,t){return Hr.run(e,t)}function Wt(){return(Hr.getStore()??Po)!==null}async function lt(e,t){let n=Date.now(),o=t.timeoutMs??15000,r=Hr.getStore()??Po;if(!r)return{ok:!1,messageID:null,error:"SessionBridge: no OpenCode client captured (plugin not initialized?)",durationMs:0};if(!e)return{ok:!1,messageID:null,error:"SessionBridge: sessionID is required",durationMs:0};let i=JSON.stringify(t.mcpArgs,null,2),l={type:"text",text:`${t.preamble??"The user wants to record this."}
|
|
23
23
|
|
|
24
24
|
Please call the \`${t.mcpTool}\` MCP tool with EXACTLY these args:
|
|
25
25
|
|
|
@@ -28,15 +28,15 @@ Please call the \`${t.mcpTool}\` MCP tool with EXACTLY these args:
|
|
|
28
28
|
\`\`\`
|
|
29
29
|
|
|
30
30
|
Do not paraphrase, modify, or add fields. Pass the args through verbatim.
|
|
31
|
-
After the tool call, briefly confirm what you stored and for which tool.`};try{return{ok:!0,messageID:(await
|
|
31
|
+
After the tool call, briefly confirm what you stored and for which tool.`};try{return{ok:!0,messageID:(await jp(r.session.prompt({path:{id:e},body:{parts:[l]}}),o,`session.prompt for ${t.mcpTool}`))?.data?.info?.id??null,error:null,durationMs:Date.now()-n}}catch(c){return{ok:!1,messageID:null,error:c instanceof Error?c.message:String(c),durationMs:Date.now()-n}}}async function Oo(e,t,n=1e4){let o=Date.now(),r=Hr.getStore()??Po;if(!r)return{ok:!1,messageID:null,error:"SessionBridge: no OpenCode client captured (plugin not initialized?)",durationMs:0};if(!e||!t)return{ok:!1,messageID:null,error:"SessionBridge: sessionID and text are required",durationMs:0};let i={type:"text",text:t};try{return{ok:!0,messageID:(await jp(r.session.prompt({path:{id:e},body:{parts:[i]}}),n,`session.prompt persist for ${e}`))?.data?.info?.id??null,error:null,durationMs:Date.now()-o}}catch(s){return{ok:!1,messageID:null,error:s instanceof Error?s.message:String(s),durationMs:Date.now()-o}}}async function fu(e,t){return Oo(e,t)}function jp(e,t,n){return new Promise((o,r)=>{let i=setTimeout(()=>{r(Error(`${n} timed out after ${t}ms`))},t);e.then((s)=>{clearTimeout(i),o(s)},(s)=>{clearTimeout(i),r(s)})})}function gu(e){if(e.target==="oracle")return`[MetaGovernor] Escalation triggered. Reason: ${e.reasoning}
|
|
32
32
|
|
|
33
33
|
Please invoke the \`task\` tool with \`subagent_type=oracle\` to perform a verification pass on the current session state. Decision context: ${e.evidenceCount} evidence unit(s). After Oracle returns, you should continue with the recommended action.`;return`[MetaGovernor] Escalation to user required. Reason: ${e.reasoning}
|
|
34
34
|
|
|
35
|
-
Present a clear summary to the user with the deviation(s) detected and your recommended next steps. Wait for explicit user input before proceeding.`}var
|
|
36
|
-
`)n++;continue}if(r==="/"&&n+1<e.length&&e[n+1]==="*"){n+=2;while(n<e.length){if(e[n]==="*"&&n+1<e.length&&e[n+1]==="/"){n+=2;break}n++}continue}t.push(r),n++}let o=t.join("");for(let r=0;r<10;r++){let i=o;if(o=o.replace(/,(\s*[\]}])/g,"$1"),o===i)break}return o}function
|
|
37
|
-
`).trim()}catch{return null}}function Xw(e){let t=
|
|
35
|
+
Present a clear summary to the user with the deviation(s) detected and your recommended next steps. Wait for explicit user input before proceeding.`}var Hr,Np=0,Po=null;var Eo=He(()=>{Hr=new wk});var Lp=()=>{};var Bf={};ye(Bf,{deepMerge:()=>Vr,getProjectConfigPath:()=>Vf,getUserConfigPath:()=>Hf,loadJsoncFile:()=>bu,loadMetaGovernorConfig:()=>_u,parseJsonc:()=>Wf,stripJsoncComments:()=>Gf});import{readFile as Nk,access as jk}from"node:fs/promises";import{resolve as Uk,join as Lk}from"node:path";import{homedir as Fk}from"node:os";function Gf(e){let t=[],n=0;while(n<e.length){let r=e[n];if(r==='"'||r==="'"){let i=r;t.push(i),n++;while(n<e.length){let s=e[n];if(t.push(s),s==="\\"){if(n++,n<e.length)t.push(e[n])}else if(s===i){n++;break}n++}continue}if(r==="/"&&n+1<e.length&&e[n+1]==="/"){n+=2;while(n<e.length&&e[n]!==`
|
|
36
|
+
`)n++;continue}if(r==="/"&&n+1<e.length&&e[n+1]==="*"){n+=2;while(n<e.length){if(e[n]==="*"&&n+1<e.length&&e[n+1]==="/"){n+=2;break}n++}continue}t.push(r),n++}let o=t.join("");for(let r=0;r<10;r++){let i=o;if(o=o.replace(/,(\s*[\]}])/g,"$1"),o===i)break}return o}function Wf(e,t){try{let n=Gf(e);return JSON.parse(n)}catch(n){Promise.resolve().then(() => (gt(),an)).then(({logToFile:o})=>o("warn",`JSONC parse failed for ${t??"<inline>"}: ${n instanceof Error?n.message:String(n)}`));return}}function Hf(){return Uk(Fk(),".config","opencode",Zf)}function Vf(e){let t=e??process.cwd();return Lk(t,".opencode",Zf)}async function Zk(e){try{return await jk(e),!0}catch{return!1}}async function bu(e){if(!await Zk(e))return;try{let t=await Nk(e,"utf-8");return Wf(t,e)}catch(t){let n=t instanceof Error?t.message:String(t);I("warn","jsonc_parse_failed",{path:e,error:n,hint:"Check syntax: comments must use // or /* */, no trailing commas. Run `node -e \"JSON.parse(require('fs').readFileSync('"+e+"','utf-8').replace(/\\/\\*[\\s\\S]*?\\*\\//g,'').replace(/\\/\\/[^\\n]*/g,'').replace(/,(\\s*[}\\]])/g,'$1'))\"` to isolate the issue."});return}}function Vr(e,t){let n={...e};for(let o of Object.keys(t)){let r=t[o],i=n[o];if(r===void 0)continue;if(Ff(r)&&Ff(i))n[o]=Vr(i,r);else n[o]=r}return n}function Ff(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}async function _u(e={}){let t=[],n="defaults",o={},r=e.userConfigPath??Hf(),i=await bu(r);if(i)o=Vr(o,i),t.push(`user:${r}`),n="user";let s=Vf(e.projectDir),a=await bu(s);if(a)o=Vr(o,a),t.push(`project:${s}`),n="project";if(e.cliOptions&&Object.keys(e.cliOptions).length>0)o=Vr(o,e.cliOptions),t.push("cli:inline"),n="cli";return{config:o,sources:t,effectiveSource:n}}var Zf="omo-meta-governor.jsonc";var ku=He(()=>{gt()});var Rg={};ye(Rg,{DEFAULT_CI_MONITOR_CONFIG:()=>Kw,getFailedLogs:()=>ex,getLatestRunForSha:()=>Xw,pollRunUntilComplete:()=>Yw,triggerWorkflow:()=>Qw});import{execFileSync as Jw}from"node:child_process";function Kr(e,t=1e4){try{return Jw("gh",e,{encoding:"utf-8",timeout:t,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().replace(/\r\n/g,`
|
|
37
|
+
`).trim()}catch{return null}}function Xw(e){let t=Kr(["run","list","--limit","1","--commit",e,"--json","databaseId,status,conclusion,displayTitle,headSha,url"],1e4);if(!t)return null;try{return JSON.parse(t)[0]??null}catch{return null}}function Yw(e,t){let n=Date.now(),o="",r=Kr(["run","view",String(e),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!r)return null;let i;try{i=JSON.parse(r)}catch{return null}while((i.status==="queued"||i.status==="in_progress"||i.status==="waiting"||i.status==="requested")&&Date.now()-n<t.maxWaitMs){let s=Date.now()+t.pollIntervalMs;while(Date.now()<s);let a=Kr(["run","view",String(e),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!a)return null;try{i=JSON.parse(a)}catch{return null}}return i}function Qw(e,t){let n=Kr(["workflow","run",e,"--ref",t],15000);return null}function ex(e,t=4000){let n=Kr(["run","view",String(e),"--log-failed"],30000);if(!n)return"";if(n.length<=t)return n;return n.slice(0,t)+`
|
|
38
38
|
|
|
39
|
-
… (${n.length-t} chars truncated) …`}var Kw;var Rg=We(()=>{Kw={enabled:!0,workflow:"CI",pollIntervalMs:15000,maxWaitMs:600000,failOnly:!0}});mn();nn();import{randomUUID as tD,createHash as tx}from"node:crypto";import{fileURLToPath as rx}from"node:url";Kt();Dt();import{existsSync as Ch,readFileSync as Mh,writeFileSync as Ah,mkdirSync as Nh}from"node:fs";import{dirname as jh}from"node:path";import{execSync as Uh}from"node:child_process";try{Ve({oldPaths:He(),newPaths:fe()})}catch{}function Lh(e){if(!Ch(e))return null;try{return JSON.parse(Mh(e,"utf8"))}catch{return null}}function Fh(e,t){try{Nh(jh(e),{recursive:!0}),Ah(e,JSON.stringify(t,null,2),"utf8")}catch{}}async function Md(e={}){let t={enabled:e.enabled??!0,autoInstall:e.autoInstall??!0,autoUpgrade:e.autoUpgrade??!0,cachePath:e.cachePath??fe().cliAnythingUpgradeCheck,upgradeCheckTtlMs:e.upgradeCheckTtlMs??86400000,projectDir:e.projectDir,runner:e.runner,installScope:e.installScope??"global",cliHubBin:e.cliHubBin,skillsBin:e.skillsBin,installTimeoutMs:e.installTimeoutMs??60000};if(!t.enabled)return{attempted:!1,codes:["cli-anything-upgrade-skipped"],availability:{cliHub:!1,cliHubVersion:null,metaSkill:!1},alreadyInitialized:!0};let n=[],o=t.runner??((a,l)=>Uh(a,{timeout:l?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]})),r=er(o),i=ui(t.installScope,o,1e4,t.skillsBin),s={cliHub:r!==null,cliHubVersion:r,metaSkill:i};if(r===null&&t.autoInstall){let a=si(o,t.installTimeoutMs);if(n.push(a.code),a.ok){let l=er(o);s.cliHub=!0,s.cliHubVersion=l}}else if(r!==null)n.push("cli-anything-already-installed");if(!i&&t.autoInstall){let a=li(t.installScope,o,t.installTimeoutMs,t.skillsBin);if(n.push(a.code),a.ok)s.metaSkill=!0}else if(i)n.push("skill-already-current");if(t.autoUpgrade){let a=Lh(t.cachePath),l=Date.now(),c=!0;if(a?.updatedAtISO){let f=Date.parse(a.updatedAtISO);if(Number.isFinite(f)&&l-f<t.upgradeCheckTtlMs)c=!1}let u=a?.cliHubLatestVersion??null;if(c)u=oi(o),Fh(t.cachePath,{cliHubLatestVersion:u,metaSkillLastCheckedISO:new Date(l).toISOString(),updatedAtISO:new Date(l).toISOString()});if(s.cliHub&&u!==null&&s.cliHubVersion!==null&&ii(u,s.cliHubVersion)>0){let f=ai(o,t.installTimeoutMs);if(n.push(f.code),f.ok){let g=er(o);s.cliHubVersion=g}}else if(s.cliHub&&s.cliHubVersion);if(s.metaSkill){let f=ci(t.installScope,o,t.installTimeoutMs,t.skillsBin);if(f.ok||/no update/i.test(f.stderr)){if(!n.includes("skill-already-current"))n.push(f.ok?"skill-upgrade-succeeded":"skill-already-current")}else n.push(f.code)}}return{attempted:!0,codes:n,availability:s,alreadyInitialized:!1}}import{homedir as sv}from"node:os";import{join as av}from"node:path";var Ad={limits:{maxLessons:10,maxSlots:20,maxTasks:10},timeouts:{agentmemoryMs:2000,boulderStateMs:1000}};async function Ld(e,t){let n=performance.now(),o={...Ad.limits,...e.limits},r={...Ad.timeouts,...e.timeouts},[i,s]=await Promise.allSettled([Zh(e,t.agentmemory,o,r.agentmemoryMs),Gh(e,t.boulderState,o,r.boulderStateMs)]),a=[],l={},c=i.status==="fulfilled"?i.value:(jd(a,l,"agentmemory",Nd(i.reason)),Ud.agentmemory),u=s.status==="fulfilled"?s.value:(jd(a,l,"boulderState",Nd(s.reason)),Ud.boulderState);return{query:e.query,timestampISO:new Date().toISOString(),agentmemory:c,boulderState:u,degradedSources:a,durationMs:performance.now()-n,errorMessages:l}}async function Zh(e,t,n,o){let r=await Fd(t.smartSearch({query:e.query,limit:n.maxLessons}),o,"agentmemory");return{available:!0,lessons:Wh(r.lessons).slice(0,n.maxLessons).map((s)=>({id:s.id,title:s.title,advice:s.advice??"info",confidence:s.confidence,concepts:s.concepts}))}}async function Gh(e,t,n,o){let r=await Fd(t.boulderRead({directory:e.directory,sessionID:e.sessionID,query:e.query}),o,"boulderState");return{available:!0,tasks:r.sort((s,a)=>s.priority-a.priority||a.updatedAtMs-s.updatedAtMs).slice(0,n.maxTasks).map((s)=>({id:s.id,status:s.status,title:s.title})),planProgress:Hh(r)}}function Wh(e){return[...e].sort((t,n)=>n.confidence-t.confidence)}function Hh(e){if(e.length===0)return 0;return e.filter((n)=>n.status==="done").length/e.length}function Nd(e){if(e instanceof Error)return e.message;if(typeof e==="string")return e;return"unknown error"}function jd(e,t,n,o){e.push(n),t[n]=o}var Ud={agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0}};async function Fd(e,t,n){return new Promise((o,r)=>{let i=setTimeout(()=>r(Error(`${n} timeout after ${t}ms`)),t);e.then((s)=>{clearTimeout(i),o(s)},(s)=>{clearTimeout(i),r(s)})})}function e$(){return{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}}function Vh(e){if(e.length===0)return 0;return e.reduce((n,o)=>n+o,0)/e.length}function Bh(e,t){let n=0;for(let o=e.length-1;o>=0;o--)if(e[o]>=t)n++;else break;return n}function qh(e,t,n,o){let r=t-e;if(r<=0)return o;if(n<=0)return null;let i=Math.floor(r/n);if(i<=0)return o;let s=i*2;return new Date(new Date(o).getTime()+s*1000).toISOString()}function Zd(e){let{currentUsage:t,modelLimit:n,recentTurnTokens:o,timestampISO:r,config:i}=e,s=o.slice(-i.windowSize),a=Vh(s),l=n-t,c=n>0?t/n:1,u=Math.min(0.95,0.3+s.length/i.windowSize*0.65),f="no-action",g=[],d="within normal parameters";if(c>=i.switchModelUsageThreshold)d=`context usage ${(c*100).toFixed(1)}% exceeds switch threshold ${(i.switchModelUsageThreshold*100).toFixed(1)}%`,g.push("switch-model");if(c>=i.compactUsageThreshold||a>=i.compactBurnRateThreshold){if(f==="no-action")f="compact-now",d=c>=i.compactUsageThreshold?`context usage ${(c*100).toFixed(1)}% exceeds compact threshold ${(i.compactUsageThreshold*100).toFixed(1)}%`:`burn rate ${a.toFixed(0)} tokens/turn exceeds threshold ${i.compactBurnRateThreshold}`}let y=Bh(s,i.compactBurnRateThreshold);if(y>=i.delegateConsecutiveHighBurn&&f==="no-action")d=`${y} consecutive high-burn turns (threshold: ${i.delegateConsecutiveHighBurn})`,g.push("delegate-to-subagent");let x=qh(t,n,a,r);return{currentUsage:t,burnRate:a,budgetLeft:l,willOverflowAt:x,recommendation:f,recommendations:g,confidence:u,modelLimit:n,windowRemaining:Math.max(0,Math.floor(l/Math.max(a,1))),input:{...e},computedAtISO:r,turnsAnalyzed:s.length}}var je={"oracle-verified":0.25,"no-progress-detector":0.2,"deviation-detector":0.2,"iteration-budget":0.15,"lesson-recall":0.1,"token-predictor":0.1},di=()=>({continueThreshold:0.3,warnThreshold:0.3,escalateThreshold:0.45,stopThreshold:0.55,paralysisThreshold:3,defaultEscalationTarget:"oracle",oracleFrequency:"per-stop"});function Jh(e,t){let n=[];n.push({source:"oracle-verified",rawScore:e.oracleVerified?0.6:0,weight:je["oracle-verified"],weightedScore:e.oracleVerified?0.6*je["oracle-verified"]:0,description:e.oracleVerified?"Oracle verification passed":"No Oracle verification"}),n.push({source:"no-progress-detector",rawScore:e.noProgress?-0.8:0,weight:je["no-progress-detector"],weightedScore:e.noProgress?-0.8*je["no-progress-detector"]:0,description:e.noProgress?"No progress detected in last turn":"Progress detected"});let o=Kh(e.deviations,t),r=60000,i=e.deviations.filter((l)=>l.ts===void 0||t-l.ts<=r);n.push({source:"deviation-detector",rawScore:o,weight:je["deviation-detector"],weightedScore:o*je["deviation-detector"],description:i.length>0?`${i.length} deviation(s) detected (worst: ${i[0].severity})`:"No deviations detected"});let s=Xh(e.iterationRatio);n.push({source:"iteration-budget",rawScore:s,weight:je["iteration-budget"],weightedScore:s*je["iteration-budget"],description:`Iteration ratio: ${e.iterationRatio.toFixed(2)} (${e.ambient.iteration}/${e.ambient.maxIterations})`});let a=Yh(e.lessonsRelevant);return n.push({source:"lesson-recall",rawScore:a,weight:je["lesson-recall"],weightedScore:a*je["lesson-recall"],description:e.lessonsRelevant.length>0?`${e.lessonsRelevant.length} relevant lesson(s) (avg confidence: ${Qh(e.lessonsRelevant).toFixed(2)})`:"No relevant lessons"}),n}function Kh(e,t=Date.now()){let o=e.filter((a)=>a.ts===void 0||t-a.ts<=60000);if(o.length===0)return 0;let r={grave:-0.9,media:-0.5,leve:-0.2},i=0;for(let a of o){let l=r[a.severity]??-0.3;if(l<i)i=l}let s=Math.min(o.length*0.05,0.2);return Math.max(i-s,-1)}function Xh(e){if(e<=0.5)return-e*0.6;return-0.3-(e-0.5)*1}function Yh(e){if(e.length===0)return 0;let t=0;for(let n of e)t+=({continue:0.3,info:0,warn:-0.3,stop:-0.7}[n.advice]??0)*n.confidence;return Math.max(Math.min(t/e.length,1),-1)}function Qh(e){if(e.length===0)return 0;return e.reduce((t,n)=>t+n.confidence,0)/e.length}function ev(e,t){if(e>=t.continueThreshold)return"continue";if(e<=-t.stopThreshold)return"stop";if(e<=-t.escalateThreshold)return"escalate";if(e<=-t.warnThreshold)return"warn";return"continue"}function tv(e,t,n){if(t.oracleFrequency==="off")return null;if(t.oracleFrequency==="final-only")return null;if(n!=="stop")return null;if(!e.oracleVerified)return"oracle";if(e.deviations.some((o)=>o.severity==="grave"))return"user";return t.defaultEscalationTarget}function Gd(e,t,n,o){if(o)return`Paralysis detected: forced continue despite score ${e.toFixed(3)} (too many consecutive stops)`;let r=[...n].sort((c,u)=>c.weightedScore-u.weightedScore),i=r[0],s=r[r.length-1],a=[];if(i.weightedScore<0)a.push(`primary concern: ${i.description}`);if(s.weightedScore>0)a.push(`positive signal: ${s.description}`);return`${{continue:"Continue",warn:"Warn",escalate:"Escalate",stop:"Stop"}[t]} (score: ${e.toFixed(3)}): ${a.join("; ")||"balanced signals"}`}function Wd(e,t,n=Date.now()){let o={...di(),...t},r=e.deviations.map((d)=>({...d}));if(!Number.isFinite(e.iterationRatio)||!Number.isFinite(e.ambient.iteration)||!Number.isFinite(e.ambient.maxIterations))return{decision:{action:"continue",score:0,reasoning:"Score neutral: NaN detected in input(s); defaulting to continue.",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()};let i=Jh(e,n),s=i.reduce((d,y)=>d+y.weightedScore,0),a=Math.max(Math.min(s,1),-1),l=e.slotMemory.consecutiveStops>=o.paralysisThreshold&&a<=-o.warnThreshold,c=l?"continue":ev(a,o),u=[];if(c!=="continue"||Math.abs(a)<o.continueThreshold){for(let d of i)if(Math.abs(d.weightedScore)>0.01)u.push({source:d.source,value:d.description,confidence:Math.abs(d.rawScore),weight:d.weight});if(u.length===0&&c!=="continue")u.push({source:"ambient",value:Gd(a,c,i,l),confidence:0.5,weight:0.1})}let f=tv(e,o,c);return{decision:{action:c,score:a,reasoning:Gd(a,c,i,l),evidence:u,shouldEscalateTo:f},contributions:i,rawScore:a,paralysisOverride:l,computedAtISO:new Date().toISOString()}}var mi=()=>({enabled:!0,maxHistoryPerSession:50,forceContinueAfterStops:3,warnMessageTemplate:"[MetaGovernor] Score {score}: {reasoning}. Evidence: {evidenceCount} signal(s).",escalateMessageTemplate:"[MetaGovernor] Escalating to {target}: {reasoning}",stopMessageTemplate:"[MetaGovernor] STOP — {reasoning}. Evidence: {evidenceCount} signal(s)."});function pn(e,t){let n=e;for(let[o,r]of Object.entries(t))n=n.replaceAll(`{${o}}`,r);return n}function rv(e){return e.length}function Hd(e,t){let n={...mi(),...t};if(!n.enabled)return{action:"continue",message:null,historyEntry:{decision:e.scoringResult.decision,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:"Decision handler disabled — pass-through continue"}};let o=e.scoringResult.decision,r=o.score,i=o.reasoning,s=rv(o.evidence),a=o.shouldEscalateTo??n.defaultEscalationTarget??"oracle";if(e.scoringResult.paralysisOverride)return{action:"continue",message:pn(n.warnMessageTemplate,{score:r.toFixed(3),reasoning:`Paralysis detected — forced continue. ${i}`,evidenceCount:String(s)}),historyEntry:{decision:o,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:`Paralysis override: ${i}`}};switch(o.action){case"continue":return{action:"continue",message:null,historyEntry:{decision:o,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}};case"warn":return{action:"warn",message:pn(n.warnMessageTemplate,{score:r.toFixed(3),reasoning:i,evidenceCount:String(s)}),historyEntry:{decision:o,action:"warn",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}};case"escalate":return{action:"escalate",message:pn(n.escalateMessageTemplate,{target:a,reasoning:i}),historyEntry:{decision:o,action:"escalate",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:`Escalate to ${a}: ${i}`}};case"stop":return{action:"stop",message:pn(n.stopMessageTemplate,{reasoning:i,evidenceCount:String(s)}),historyEntry:{decision:o,action:"stop",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}}}}function n$(e,t){if(e.length<=t)return{trimmed:[...e],dropped:0};let n=e.length-t;return{trimmed:e.slice(-t),dropped:n}}function Vd(e){let t=0;for(let n=e.length-1;n>=0;n--)if(e[n].action==="stop")t++;else break;return t}var Bd={leve:0,media:1,grave:2};function nv(e,t,n){let o=`${e}-${t}-${n}`.split("").reduce((r,i)=>(r<<5)-r+i.charCodeAt(0)|0,0);return`D-${Math.abs(o).toString(36)}`}function qd(e,t){let n=Bd[t]??0;return e.some((o)=>(Bd[o.severity]??0)>=n)}function ov(e,t=[]){let n=new Set;for(let o of e)if(n.add(o.category),n.add(o.severity),o.filePath){let r=o.filePath.split("/").pop()??o.filePath;n.add(r)}for(let o of t){let r=o.split("/").pop()??o;if(r)n.add(r)}return[...n]}function iv(e,t){let n=t.map((o)=>`[${o.severity}] ${o.category}: ${o.detail}`).join("; ");return`Action "${e.action}" (score ${e.score.toFixed(2)}) after deviations: ${n}. Reasoning: ${e.reasoning}`}async function Jd(e,t){let{decision:n,config:o,sessionID:r,directory:i,filesChanged:s}=e,a=new Date().toISOString();if(!o.enabled)return{lessonSaved:null,decisionSaved:null,reason:"closed-loop learning disabled"};if(n.evidence.length===0&&n.action==="continue")return{lessonSaved:null,decisionSaved:null,reason:"no deviations to learn from"};let l=null,c=null;if(o.saveDecisions){let y={id:nv(r,n.action,a),timestampISO:a,action:n.action,score:n.score,reasoning:n.reasoning,sessionID:r,directory:i,deviations:n.evidence.filter((x)=>x.source==="deviation-detector").map((x)=>({severity:"media",category:x.source,detail:x.value}))};try{await t.saveMemory({content:`Decision: ${n.action} (score ${n.score.toFixed(2)}). ${n.reasoning}`,concepts:["meta-governor","decision",n.action],type:"fact",files:[...s]}),c=y}catch{}}let u=n.evidence.filter((y)=>y.source==="deviation-detector").map((y)=>({severity:"media",category:y.source,detail:y.value})),f=e.currentLessonCount??0;if(f>=o.maxLessonsPerSession)return{lessonSaved:null,decisionSaved:c,reason:`maxLessonsPerSession cap reached (${f} >= ${o.maxLessonsPerSession})`};let g=o.saveLessons!==!1;if(g&&qd(u,o.minSeverityToLearn)){let y=ov(u,s),x=iv(n,u);try{l={id:(await t.saveLesson({content:x,context:`session:${r} dir:${i}`,confidence:Math.max(0.3,Math.min(0.8,Math.abs(n.score))),tags:y})).id,title:`${n.action} after ${u[0]?.category??"deviation"}`,content:x,type:"pattern",concepts:y,confidence:Math.max(0.3,Math.min(0.8,Math.abs(n.score))),files:[...s],sessionID:r}}catch{}}let d=[];if(c)d.push("decision saved");if(l)d.push("lesson saved");if(!c&&!l)if(!g)d.push("saveLessons disabled");else if(!qd(u,o.minSeverityToLearn))d.push("severity below threshold");else d.push("no saveable content");return{lessonSaved:l,decisionSaved:c,reason:d.join("; ")||"no action taken"}}function fn(){return{enabled:!0,minSeverityToLearn:"media",maxLessonsPerSession:20,saveDecisions:!0,saveLessons:!0}}var lv=()=>({enabled:!0,memory:{enabled:!0,query:"",timeoutMs:3000},tokenPredictor:{},oracle:{frequency:"per-stop"},scoring:{oracleFrequency:"per-stop"},decision:{},closedLoop:{},intervention:{mode:"silent",includeDecisionHistory:!0,maxHistoryMessages:5,minActionForMessage:"stop",maxInterventionsPerSession:3,respectDoneSignal:!0,phaseAwareDoneSignal:!1,persistToSession:!0,compactionLoopGuard:{enabled:!0,maxOverflowRecoveries:1}},protocolEnforcement:{enabled:!1,path:void 0,injectIntoSystem:!1,auditToolCalls:!1},skillPriming:{enabled:!1,trigger:"firstImplement",router:"both",enforceMode:"directive"},skillHub:{enabled:!1,syncIntervalMs:86400000,bootstrapUrl:"https://skills-library.com/api/skills.json",searchFallbackUrl:"https://skills.sh/api/search",downloadBaseUrl:"https://skills.sh/api/download",embedBaseUrl:"http://127.0.0.1:3114/v1",embedModel:"bge-m3",minInstalls:0,filterDuplicates:!0,depsCheck:!0,choreDir:av(sv(),".agents","skills"),autoMaterialize:!0},graphSync:{killOrphanedOnInit:!0,reindexOnFetch:!0,fetchBranch:"main",autoUpgrade:!0,upgradeCachePath:void 0,checkGraphifyNeedsUpdate:!0,addToGlobalGraph:!1},graphRetrieval:{preferredTool:"auto",preferLocalCodegraph:!1,contextRouting:!1},cliAnything:{enabled:!0,autoInstall:!0,autoUpgrade:!0,cachePath:void 0,upgradeCheckTtlMs:void 0,cliHubBin:"cli-hub",skillsBin:"npx skills",installScope:"global"}}),pi={query:"",timestampISO:new Date().toISOString(),agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0},degradedSources:["agentmemory","boulderState"]},cv={consecutiveStops:0,consecutiveContinues:0,lastUpdatedISO:new Date().toISOString()},uv={action:"continue",message:null,historyEntry:{decision:{action:"continue",score:0,reasoning:"no decision made",evidence:[],shouldEscalateTo:null},action:"continue",timestampISO:new Date().toISOString(),sessionID:"",reasoning:"no decision made"}};function dv(e,t=pi){let n=e.maxIterations>0?e.iteration/e.maxIterations:0,o={...cv,consecutiveStops:e.consecutiveStops??0};return{oracleVerified:e.oracleVerified,noProgress:e.noProgress,deviations:e.deviations,iterationRatio:n,lessonsRelevant:t.agentmemory.lessons,slotMemory:o,ambient:{sessionID:e.sessionID,directory:".",mode:"simple",agentName:e.agentName??"unknown",iteration:e.iteration,maxIterations:e.maxIterations}}}async function Xd(e,t={}){let n={...lv(),...t};if(!n.enabled)return{memoryRead:pi,tokenPrediction:Kd(e),scoringResult:{decision:{action:"continue",score:0,reasoning:"MetaGovernor disabled",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()},decision:uv,lessonSaved:null,decisionHistory:[],skipped:!0,skipReason:"disabled"};let o=pi;if(n.memory.enabled)try{let c={agentmemory:e.backends.agentmemory,boulderState:e.backends.boulderState};o=await Ld({directory:".",sessionID:e.sessionID,query:n.memory.query||e.toolName},c)}catch{}let r;try{r=Zd({currentUsage:e.recentTurnTokens.reduce((c,u)=>c+u,0),modelLimit:e.modelLimit??t.modelOverride?.modelLimit??200000,recentTurnTokens:e.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:e.providerID??"",modelID:e.modelID??"",config:n.tokenPredictor})}catch{r=Kd(e)}let i=Wd(dv(e,o),n.scoring),s={sessionID:e.sessionID,scoringResult:i},a=Hd(s,n.decision),l=null;try{if(n.closedLoop.enabled!==!1)l=await Jd({decision:a.historyEntry.decision,memoryRead:o,config:{...fn(),...n.closedLoop},sessionID:e.sessionID,directory:".",filesChanged:e.filePaths??[],currentLessonCount:e.currentLessonCount},e.writeBackend)}catch{}return{memoryRead:o,tokenPrediction:r,scoringResult:i,decision:a,lessonSaved:l,decisionHistory:[a.historyEntry],skipped:!1}}function Kd(e){let t=e.recentTurnTokens.reduce((n,o)=>n+o,0);return{burnRate:0,budgetLeft:200000,currentUsage:t,modelLimit:200000,willOverflowAt:null,recommendation:"no-action",confidence:1,windowRemaining:200000,input:{currentUsage:t,modelLimit:200000,recentTurnTokens:e.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:e.providerID??"",modelID:e.modelID??"",config:{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}},computedAtISO:new Date().toISOString(),turnsAnalyzed:e.recentTurnTokens.length,recommendations:[]}}import{createRequire as mv}from"node:module";var Yd=mv(import.meta.url);function pv(e){if(typeof process<"u"&&process.versions?.bun){let n=Yd("bun:sqlite");if(!n.Database)throw Error("sqlite-driver: bun:sqlite loaded but Database export missing");return new n.Database(e,{create:!0})}let t;try{t=Yd("node:sqlite")}catch{throw Error("sqlite-driver: node:sqlite is unavailable. omo-meta-governor MCP mode requires Bun, or Node >= 23.4 (Node 22.5-23.3 needs --experimental-sqlite).")}if(!t.DatabaseSync)throw Error("sqlite-driver: node:sqlite loaded but DatabaseSync export missing (Node too old?). Use Bun or Node >= 23.4.");return new t.DatabaseSync(e)}class Qd{raw;constructor(e){this.raw=e}run(...e){return this.raw.run(...e)}get(...e){return this.raw.get(...e)}all(...e){let t=this.raw.all(...e);return Array.isArray(t)?t:[]}}class em{raw;constructor(e){this.raw=e}exec(e){this.raw.exec(e)}prepare(e){return new Qd(this.raw.prepare(e))}query(e){return this.prepare(e)}close(){this.raw.close()}}function tm(e){return new em(pv(e))}import{existsSync as fv,mkdirSync as gv}from"node:fs";import{join as rm}from"node:path";import{homedir as hv}from"node:os";function vv(){let e=rm(hv(),".omo-meta-governor");if(!fv(e))gv(e,{recursive:!0});return rm(e,"meta-governor.db")}var fi="1",yv=`
|
|
39
|
+
… (${n.length-t} chars truncated) …`}var Kw;var zg=He(()=>{Kw={enabled:!0,workflow:"CI",pollIntervalMs:15000,maxWaitMs:600000,failOnly:!0}});pn();on();import{randomUUID as tD,createHash as tx}from"node:crypto";import{fileURLToPath as rx}from"node:url";Xt();Pt();import{existsSync as Ch,readFileSync as Mh,writeFileSync as Ah,mkdirSync as Nh}from"node:fs";import{dirname as jh}from"node:path";import{execSync as Uh}from"node:child_process";try{Be({oldPaths:Ve(),newPaths:ge()})}catch{}function Lh(e){if(!Ch(e))return null;try{return JSON.parse(Mh(e,"utf8"))}catch{return null}}function Fh(e,t){try{Nh(jh(e),{recursive:!0}),Ah(e,JSON.stringify(t,null,2),"utf8")}catch{}}async function Ad(e={}){let t={enabled:e.enabled??!0,autoInstall:e.autoInstall??!0,autoUpgrade:e.autoUpgrade??!0,cachePath:e.cachePath??ge().cliAnythingUpgradeCheck,upgradeCheckTtlMs:e.upgradeCheckTtlMs??86400000,projectDir:e.projectDir,runner:e.runner,installScope:e.installScope??"global",cliHubBin:e.cliHubBin,skillsBin:e.skillsBin,installTimeoutMs:e.installTimeoutMs??60000};if(!t.enabled)return{attempted:!1,codes:["cli-anything-upgrade-skipped"],availability:{cliHub:!1,cliHubVersion:null,metaSkill:!1},alreadyInitialized:!0};let n=[],o=t.runner??((a,l)=>Uh(a,{timeout:l?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]})),r=tr(o),i=mi(t.installScope,o,1e4,t.skillsBin),s={cliHub:r!==null,cliHubVersion:r,metaSkill:i};if(r===null&&t.autoInstall){let a=li(o,t.installTimeoutMs);if(n.push(a.code),a.ok){let l=tr(o);s.cliHub=!0,s.cliHubVersion=l}}else if(r!==null)n.push("cli-anything-already-installed");if(!i&&t.autoInstall){let a=ui(t.installScope,o,t.installTimeoutMs,t.skillsBin);if(n.push(a.code),a.ok)s.metaSkill=!0}else if(i)n.push("skill-already-current");if(t.autoUpgrade){let a=Lh(t.cachePath),l=Date.now(),c=!0;if(a?.updatedAtISO){let f=Date.parse(a.updatedAtISO);if(Number.isFinite(f)&&l-f<t.upgradeCheckTtlMs)c=!1}let u=a?.cliHubLatestVersion??null;if(c)u=si(o),Fh(t.cachePath,{cliHubLatestVersion:u,metaSkillLastCheckedISO:new Date(l).toISOString(),updatedAtISO:new Date(l).toISOString()});if(s.cliHub&&u!==null&&s.cliHubVersion!==null&&ai(u,s.cliHubVersion)>0){let f=ci(o,t.installTimeoutMs);if(n.push(f.code),f.ok){let g=tr(o);s.cliHubVersion=g}}else if(s.cliHub&&s.cliHubVersion);if(s.metaSkill){let f=di(t.installScope,o,t.installTimeoutMs,t.skillsBin);if(f.ok||/no update/i.test(f.stderr)){if(!n.includes("skill-already-current"))n.push(f.ok?"skill-upgrade-succeeded":"skill-already-current")}else n.push(f.code)}}return{attempted:!0,codes:n,availability:s,alreadyInitialized:!1}}import{homedir as sv}from"node:os";import{join as av}from"node:path";var Nd={limits:{maxLessons:10,maxSlots:20,maxTasks:10},timeouts:{agentmemoryMs:2000,boulderStateMs:1000}};async function Fd(e,t){let n=performance.now(),o={...Nd.limits,...e.limits},r={...Nd.timeouts,...e.timeouts},[i,s]=await Promise.allSettled([Zh(e,t.agentmemory,o,r.agentmemoryMs),Gh(e,t.boulderState,o,r.boulderStateMs)]),a=[],l={},c=i.status==="fulfilled"?i.value:(Ud(a,l,"agentmemory",jd(i.reason)),Ld.agentmemory),u=s.status==="fulfilled"?s.value:(Ud(a,l,"boulderState",jd(s.reason)),Ld.boulderState);return{query:e.query,timestampISO:new Date().toISOString(),agentmemory:c,boulderState:u,degradedSources:a,durationMs:performance.now()-n,errorMessages:l}}async function Zh(e,t,n,o){let r=await Zd(t.smartSearch({query:e.query,limit:n.maxLessons}),o,"agentmemory");return{available:!0,lessons:Wh(r.lessons).slice(0,n.maxLessons).map((s)=>({id:s.id,title:s.title,advice:s.advice??"info",confidence:s.confidence,concepts:s.concepts}))}}async function Gh(e,t,n,o){let r=await Zd(t.boulderRead({directory:e.directory,sessionID:e.sessionID,query:e.query}),o,"boulderState");return{available:!0,tasks:r.sort((s,a)=>s.priority-a.priority||a.updatedAtMs-s.updatedAtMs).slice(0,n.maxTasks).map((s)=>({id:s.id,status:s.status,title:s.title})),planProgress:Hh(r)}}function Wh(e){return[...e].sort((t,n)=>n.confidence-t.confidence)}function Hh(e){if(e.length===0)return 0;return e.filter((n)=>n.status==="done").length/e.length}function jd(e){if(e instanceof Error)return e.message;if(typeof e==="string")return e;return"unknown error"}function Ud(e,t,n,o){e.push(n),t[n]=o}var Ld={agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0}};async function Zd(e,t,n){return new Promise((o,r)=>{let i=setTimeout(()=>r(Error(`${n} timeout after ${t}ms`)),t);e.then((s)=>{clearTimeout(i),o(s)},(s)=>{clearTimeout(i),r(s)})})}function e$(){return{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}}function Vh(e){if(e.length===0)return 0;return e.reduce((n,o)=>n+o,0)/e.length}function Bh(e,t){let n=0;for(let o=e.length-1;o>=0;o--)if(e[o]>=t)n++;else break;return n}function qh(e,t,n,o){let r=t-e;if(r<=0)return o;if(n<=0)return null;let i=Math.floor(r/n);if(i<=0)return o;let s=i*2;return new Date(new Date(o).getTime()+s*1000).toISOString()}function Gd(e){let{currentUsage:t,modelLimit:n,recentTurnTokens:o,timestampISO:r,config:i}=e,s=o.slice(-i.windowSize),a=Vh(s),l=n-t,c=n>0?t/n:1,u=Math.min(0.95,0.3+s.length/i.windowSize*0.65),f="no-action",g=[],d="within normal parameters";if(c>=i.switchModelUsageThreshold)d=`context usage ${(c*100).toFixed(1)}% exceeds switch threshold ${(i.switchModelUsageThreshold*100).toFixed(1)}%`,g.push("switch-model");if(c>=i.compactUsageThreshold||a>=i.compactBurnRateThreshold){if(f==="no-action")f="compact-now",d=c>=i.compactUsageThreshold?`context usage ${(c*100).toFixed(1)}% exceeds compact threshold ${(i.compactUsageThreshold*100).toFixed(1)}%`:`burn rate ${a.toFixed(0)} tokens/turn exceeds threshold ${i.compactBurnRateThreshold}`}let y=Bh(s,i.compactBurnRateThreshold);if(y>=i.delegateConsecutiveHighBurn&&f==="no-action")d=`${y} consecutive high-burn turns (threshold: ${i.delegateConsecutiveHighBurn})`,g.push("delegate-to-subagent");let x=qh(t,n,a,r);return{currentUsage:t,burnRate:a,budgetLeft:l,willOverflowAt:x,recommendation:f,recommendations:g,confidence:u,modelLimit:n,windowRemaining:Math.max(0,Math.floor(l/Math.max(a,1))),input:{...e},computedAtISO:r,turnsAnalyzed:s.length}}var Ue={"oracle-verified":0.25,"no-progress-detector":0.2,"deviation-detector":0.2,"iteration-budget":0.15,"lesson-recall":0.1,"token-predictor":0.1},pi=()=>({continueThreshold:0.3,warnThreshold:0.3,escalateThreshold:0.45,stopThreshold:0.55,paralysisThreshold:3,defaultEscalationTarget:"oracle",oracleFrequency:"per-stop"});function Jh(e,t){let n=[];n.push({source:"oracle-verified",rawScore:e.oracleVerified?0.6:0,weight:Ue["oracle-verified"],weightedScore:e.oracleVerified?0.6*Ue["oracle-verified"]:0,description:e.oracleVerified?"Oracle verification passed":"No Oracle verification"}),n.push({source:"no-progress-detector",rawScore:e.noProgress?-0.8:0,weight:Ue["no-progress-detector"],weightedScore:e.noProgress?-0.8*Ue["no-progress-detector"]:0,description:e.noProgress?"No progress detected in last turn":"Progress detected"});let o=Kh(e.deviations,t),r=60000,i=e.deviations.filter((l)=>l.ts===void 0||t-l.ts<=r);n.push({source:"deviation-detector",rawScore:o,weight:Ue["deviation-detector"],weightedScore:o*Ue["deviation-detector"],description:i.length>0?`${i.length} deviation(s) detected (worst: ${i[0].severity})`:"No deviations detected"});let s=Xh(e.iterationRatio);n.push({source:"iteration-budget",rawScore:s,weight:Ue["iteration-budget"],weightedScore:s*Ue["iteration-budget"],description:`Iteration ratio: ${e.iterationRatio.toFixed(2)} (${e.ambient.iteration}/${e.ambient.maxIterations})`});let a=Yh(e.lessonsRelevant);return n.push({source:"lesson-recall",rawScore:a,weight:Ue["lesson-recall"],weightedScore:a*Ue["lesson-recall"],description:e.lessonsRelevant.length>0?`${e.lessonsRelevant.length} relevant lesson(s) (avg confidence: ${Qh(e.lessonsRelevant).toFixed(2)})`:"No relevant lessons"}),n}function Kh(e,t=Date.now()){let o=e.filter((a)=>a.ts===void 0||t-a.ts<=60000);if(o.length===0)return 0;let r={grave:-0.9,media:-0.5,leve:-0.2},i=0;for(let a of o){let l=r[a.severity]??-0.3;if(l<i)i=l}let s=Math.min(o.length*0.05,0.2);return Math.max(i-s,-1)}function Xh(e){if(e<=0.5)return-e*0.6;return-0.3-(e-0.5)*1}function Yh(e){if(e.length===0)return 0;let t=0;for(let n of e)t+=({continue:0.3,info:0,warn:-0.3,stop:-0.7}[n.advice]??0)*n.confidence;return Math.max(Math.min(t/e.length,1),-1)}function Qh(e){if(e.length===0)return 0;return e.reduce((t,n)=>t+n.confidence,0)/e.length}function ev(e,t){if(e>=t.continueThreshold)return"continue";if(e<=-t.stopThreshold)return"stop";if(e<=-t.escalateThreshold)return"escalate";if(e<=-t.warnThreshold)return"warn";return"continue"}function tv(e,t,n){if(t.oracleFrequency==="off")return null;if(t.oracleFrequency==="final-only")return null;if(n!=="stop")return null;if(!e.oracleVerified)return"oracle";if(e.deviations.some((o)=>o.severity==="grave"))return"user";return t.defaultEscalationTarget}function Wd(e,t,n,o){if(o)return`Paralysis detected: forced continue despite score ${e.toFixed(3)} (too many consecutive stops)`;let r=[...n].sort((c,u)=>c.weightedScore-u.weightedScore),i=r[0],s=r[r.length-1],a=[];if(i.weightedScore<0)a.push(`primary concern: ${i.description}`);if(s.weightedScore>0)a.push(`positive signal: ${s.description}`);return`${{continue:"Continue",warn:"Warn",escalate:"Escalate",stop:"Stop"}[t]} (score: ${e.toFixed(3)}): ${a.join("; ")||"balanced signals"}`}function Hd(e,t,n=Date.now()){let o={...pi(),...t},r=e.deviations.map((d)=>({...d}));if(!Number.isFinite(e.iterationRatio)||!Number.isFinite(e.ambient.iteration)||!Number.isFinite(e.ambient.maxIterations))return{decision:{action:"continue",score:0,reasoning:"Score neutral: NaN detected in input(s); defaulting to continue.",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()};let i=Jh(e,n),s=i.reduce((d,y)=>d+y.weightedScore,0),a=Math.max(Math.min(s,1),-1),l=e.slotMemory.consecutiveStops>=o.paralysisThreshold&&a<=-o.warnThreshold,c=l?"continue":ev(a,o),u=[];if(c!=="continue"||Math.abs(a)<o.continueThreshold){for(let d of i)if(Math.abs(d.weightedScore)>0.01)u.push({source:d.source,value:d.description,confidence:Math.abs(d.rawScore),weight:d.weight});if(u.length===0&&c!=="continue")u.push({source:"ambient",value:Wd(a,c,i,l),confidence:0.5,weight:0.1})}let f=tv(e,o,c);return{decision:{action:c,score:a,reasoning:Wd(a,c,i,l),evidence:u,shouldEscalateTo:f},contributions:i,rawScore:a,paralysisOverride:l,computedAtISO:new Date().toISOString()}}var fi=()=>({enabled:!0,maxHistoryPerSession:50,forceContinueAfterStops:3,warnMessageTemplate:"[MetaGovernor] Score {score}: {reasoning}. Evidence: {evidenceCount} signal(s).",escalateMessageTemplate:"[MetaGovernor] Escalating to {target}: {reasoning}",stopMessageTemplate:"[MetaGovernor] STOP — {reasoning}. Evidence: {evidenceCount} signal(s)."});function fn(e,t){let n=e;for(let[o,r]of Object.entries(t))n=n.replaceAll(`{${o}}`,r);return n}function rv(e){return e.length}function Vd(e,t){let n={...fi(),...t};if(!n.enabled)return{action:"continue",message:null,historyEntry:{decision:e.scoringResult.decision,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:"Decision handler disabled — pass-through continue"}};let o=e.scoringResult.decision,r=o.score,i=o.reasoning,s=rv(o.evidence),a=o.shouldEscalateTo??n.defaultEscalationTarget??"oracle";if(e.scoringResult.paralysisOverride)return{action:"continue",message:fn(n.warnMessageTemplate,{score:r.toFixed(3),reasoning:`Paralysis detected — forced continue. ${i}`,evidenceCount:String(s)}),historyEntry:{decision:o,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:`Paralysis override: ${i}`}};switch(o.action){case"continue":return{action:"continue",message:null,historyEntry:{decision:o,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}};case"warn":return{action:"warn",message:fn(n.warnMessageTemplate,{score:r.toFixed(3),reasoning:i,evidenceCount:String(s)}),historyEntry:{decision:o,action:"warn",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}};case"escalate":return{action:"escalate",message:fn(n.escalateMessageTemplate,{target:a,reasoning:i}),historyEntry:{decision:o,action:"escalate",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:`Escalate to ${a}: ${i}`}};case"stop":return{action:"stop",message:fn(n.stopMessageTemplate,{reasoning:i,evidenceCount:String(s)}),historyEntry:{decision:o,action:"stop",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}}}}function n$(e,t){if(e.length<=t)return{trimmed:[...e],dropped:0};let n=e.length-t;return{trimmed:e.slice(-t),dropped:n}}function Bd(e){let t=0;for(let n=e.length-1;n>=0;n--)if(e[n].action==="stop")t++;else break;return t}var qd={leve:0,media:1,grave:2};function nv(e,t,n){let o=`${e}-${t}-${n}`.split("").reduce((r,i)=>(r<<5)-r+i.charCodeAt(0)|0,0);return`D-${Math.abs(o).toString(36)}`}function Jd(e,t){let n=qd[t]??0;return e.some((o)=>(qd[o.severity]??0)>=n)}function ov(e,t=[]){let n=new Set;for(let o of e)if(n.add(o.category),n.add(o.severity),o.filePath){let r=o.filePath.split("/").pop()??o.filePath;n.add(r)}for(let o of t){let r=o.split("/").pop()??o;if(r)n.add(r)}return[...n]}function iv(e,t){let n=t.map((o)=>`[${o.severity}] ${o.category}: ${o.detail}`).join("; ");return`Action "${e.action}" (score ${e.score.toFixed(2)}) after deviations: ${n}. Reasoning: ${e.reasoning}`}async function Kd(e,t){let{decision:n,config:o,sessionID:r,directory:i,filesChanged:s}=e,a=new Date().toISOString();if(!o.enabled)return{lessonSaved:null,decisionSaved:null,reason:"closed-loop learning disabled"};if(n.evidence.length===0&&n.action==="continue")return{lessonSaved:null,decisionSaved:null,reason:"no deviations to learn from"};let l=null,c=null;if(o.saveDecisions){let y={id:nv(r,n.action,a),timestampISO:a,action:n.action,score:n.score,reasoning:n.reasoning,sessionID:r,directory:i,deviations:n.evidence.filter((x)=>x.source==="deviation-detector").map((x)=>({severity:"media",category:x.source,detail:x.value}))};try{await t.saveMemory({content:`Decision: ${n.action} (score ${n.score.toFixed(2)}). ${n.reasoning}`,concepts:["meta-governor","decision",n.action],type:"fact",files:[...s]}),c=y}catch{}}let u=n.evidence.filter((y)=>y.source==="deviation-detector").map((y)=>({severity:"media",category:y.source,detail:y.value})),f=e.currentLessonCount??0;if(f>=o.maxLessonsPerSession)return{lessonSaved:null,decisionSaved:c,reason:`maxLessonsPerSession cap reached (${f} >= ${o.maxLessonsPerSession})`};let g=o.saveLessons!==!1;if(g&&Jd(u,o.minSeverityToLearn)){let y=ov(u,s),x=iv(n,u);try{l={id:(await t.saveLesson({content:x,context:`session:${r} dir:${i}`,confidence:Math.max(0.3,Math.min(0.8,Math.abs(n.score))),tags:y})).id,title:`${n.action} after ${u[0]?.category??"deviation"}`,content:x,type:"pattern",concepts:y,confidence:Math.max(0.3,Math.min(0.8,Math.abs(n.score))),files:[...s],sessionID:r}}catch{}}let d=[];if(c)d.push("decision saved");if(l)d.push("lesson saved");if(!c&&!l)if(!g)d.push("saveLessons disabled");else if(!Jd(u,o.minSeverityToLearn))d.push("severity below threshold");else d.push("no saveable content");return{lessonSaved:l,decisionSaved:c,reason:d.join("; ")||"no action taken"}}function gn(){return{enabled:!0,minSeverityToLearn:"media",maxLessonsPerSession:20,saveDecisions:!0,saveLessons:!0}}var lv=()=>({enabled:!0,memory:{enabled:!0,query:"",timeoutMs:3000},tokenPredictor:{},oracle:{frequency:"per-stop"},scoring:{oracleFrequency:"per-stop"},decision:{},closedLoop:{},intervention:{mode:"silent",includeDecisionHistory:!0,maxHistoryMessages:5,minActionForMessage:"stop",maxInterventionsPerSession:3,respectDoneSignal:!0,phaseAwareDoneSignal:!1,persistToSession:!0,compactionLoopGuard:{enabled:!0,maxOverflowRecoveries:1}},protocolEnforcement:{enabled:!1,path:void 0,injectIntoSystem:!1,auditToolCalls:!1},skillPriming:{enabled:!1,trigger:"firstImplement",router:"both",enforceMode:"directive"},skillHub:{enabled:!1,syncIntervalMs:86400000,bootstrapUrl:"https://skills-library.com/api/skills.json",searchFallbackUrl:"https://skills.sh/api/search",downloadBaseUrl:"https://skills.sh/api/download",embedBaseUrl:"http://127.0.0.1:3114/v1",embedModel:"bge-m3",minInstalls:0,filterDuplicates:!0,depsCheck:!0,choreDir:av(sv(),".agents","skills"),autoMaterialize:!0},graphSync:{killOrphanedOnInit:!0,reindexOnFetch:!0,fetchBranch:"main",autoUpgrade:!0,upgradeCachePath:void 0,checkGraphifyNeedsUpdate:!0,addToGlobalGraph:!1},graphRetrieval:{preferredTool:"auto",preferLocalCodegraph:!1,contextRouting:!1},cliAnything:{enabled:!0,autoInstall:!0,autoUpgrade:!0,cachePath:void 0,upgradeCheckTtlMs:void 0,cliHubBin:"cli-hub",skillsBin:"npx skills",installScope:"global"}}),gi={query:"",timestampISO:new Date().toISOString(),agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0},degradedSources:["agentmemory","boulderState"]},cv={consecutiveStops:0,consecutiveContinues:0,lastUpdatedISO:new Date().toISOString()},uv={action:"continue",message:null,historyEntry:{decision:{action:"continue",score:0,reasoning:"no decision made",evidence:[],shouldEscalateTo:null},action:"continue",timestampISO:new Date().toISOString(),sessionID:"",reasoning:"no decision made"}};function dv(e,t=gi){let n=e.maxIterations>0?e.iteration/e.maxIterations:0,o={...cv,consecutiveStops:e.consecutiveStops??0};return{oracleVerified:e.oracleVerified,noProgress:e.noProgress,deviations:e.deviations,iterationRatio:n,lessonsRelevant:t.agentmemory.lessons,slotMemory:o,ambient:{sessionID:e.sessionID,directory:".",mode:"simple",agentName:e.agentName??"unknown",iteration:e.iteration,maxIterations:e.maxIterations}}}async function Yd(e,t={}){let n={...lv(),...t};if(!n.enabled)return{memoryRead:gi,tokenPrediction:Xd(e),scoringResult:{decision:{action:"continue",score:0,reasoning:"MetaGovernor disabled",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()},decision:uv,lessonSaved:null,decisionHistory:[],skipped:!0,skipReason:"disabled"};let o=gi;if(n.memory.enabled)try{let c={agentmemory:e.backends.agentmemory,boulderState:e.backends.boulderState};o=await Fd({directory:".",sessionID:e.sessionID,query:n.memory.query||e.toolName},c)}catch{}let r;try{r=Gd({currentUsage:e.recentTurnTokens.reduce((c,u)=>c+u,0),modelLimit:e.modelLimit??t.modelOverride?.modelLimit??200000,recentTurnTokens:e.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:e.providerID??"",modelID:e.modelID??"",config:n.tokenPredictor})}catch{r=Xd(e)}let i=Hd(dv(e,o),n.scoring),s={sessionID:e.sessionID,scoringResult:i},a=Vd(s,n.decision),l=null;try{if(n.closedLoop.enabled!==!1)l=await Kd({decision:a.historyEntry.decision,memoryRead:o,config:{...gn(),...n.closedLoop},sessionID:e.sessionID,directory:".",filesChanged:e.filePaths??[],currentLessonCount:e.currentLessonCount},e.writeBackend)}catch{}return{memoryRead:o,tokenPrediction:r,scoringResult:i,decision:a,lessonSaved:l,decisionHistory:[a.historyEntry],skipped:!1}}function Xd(e){let t=e.recentTurnTokens.reduce((n,o)=>n+o,0);return{burnRate:0,budgetLeft:200000,currentUsage:t,modelLimit:200000,willOverflowAt:null,recommendation:"no-action",confidence:1,windowRemaining:200000,input:{currentUsage:t,modelLimit:200000,recentTurnTokens:e.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:e.providerID??"",modelID:e.modelID??"",config:{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}},computedAtISO:new Date().toISOString(),turnsAnalyzed:e.recentTurnTokens.length,recommendations:[]}}import{createRequire as mv}from"node:module";var Qd=mv(import.meta.url);function pv(e){if(typeof process<"u"&&process.versions?.bun){let n=Qd("bun:sqlite");if(!n.Database)throw Error("sqlite-driver: bun:sqlite loaded but Database export missing");return new n.Database(e,{create:!0})}let t;try{t=Qd("node:sqlite")}catch{throw Error("sqlite-driver: node:sqlite is unavailable. omo-meta-governor MCP mode requires Bun, or Node >= 23.4 (Node 22.5-23.3 needs --experimental-sqlite).")}if(!t.DatabaseSync)throw Error("sqlite-driver: node:sqlite loaded but DatabaseSync export missing (Node too old?). Use Bun or Node >= 23.4.");return new t.DatabaseSync(e)}class em{raw;constructor(e){this.raw=e}run(...e){return this.raw.run(...e)}get(...e){return this.raw.get(...e)}all(...e){let t=this.raw.all(...e);return Array.isArray(t)?t:[]}}class tm{raw;constructor(e){this.raw=e}exec(e){this.raw.exec(e)}prepare(e){return new em(this.raw.prepare(e))}query(e){return this.prepare(e)}close(){this.raw.close()}}function rm(e){return new tm(pv(e))}import{existsSync as fv,mkdirSync as gv}from"node:fs";import{join as nm}from"node:path";import{homedir as hv}from"node:os";function vv(){let e=nm(hv(),".omo-meta-governor");if(!fv(e))gv(e,{recursive:!0});return nm(e,"meta-governor.db")}var hi="1",yv=`
|
|
40
40
|
CREATE TABLE IF NOT EXISTS _meta (
|
|
41
41
|
key TEXT PRIMARY KEY,
|
|
42
42
|
value TEXT NOT NULL
|
|
@@ -132,7 +132,7 @@ CREATE INDEX IF NOT EXISTS idx_skill_deps_dep ON skill_deps(dep_type, dep_name);
|
|
|
132
132
|
CREATE INDEX IF NOT EXISTS idx_entries_kind ON entries(kind);
|
|
133
133
|
CREATE INDEX IF NOT EXISTS idx_entries_session ON entries(session_id, directory);
|
|
134
134
|
CREATE INDEX IF NOT EXISTS idx_boulder_dir_session ON boulder_tasks(directory, session_id);
|
|
135
|
-
`;function
|
|
135
|
+
`;function om(e){let t=Date.now().toString(36),n=Math.floor(Math.random()*65535).toString(36);return`${e}-${t}-${n}`}class sm{db;stmts;constructor(e){let t=e??vv();this.db=rm(t),this.db.exec("PRAGMA journal_mode = WAL;"),this.db.exec("PRAGMA synchronous = NORMAL;"),this.db.exec("PRAGMA foreign_keys = ON;"),this.db.exec("PRAGMA busy_timeout = 5000;"),this.db.exec(yv);let n=this.db.prepare("SELECT value FROM _meta WHERE key = 'schema_version'").get();if(!n)this.db.prepare("INSERT INTO _meta (key, value) VALUES ('schema_version', ?)").run(hi);else if(n.value!==hi){if(n.value==="1"){if(!this.db.prepare("PRAGMA table_info(skills)").all().some((r)=>r.name==="last_materialized_at"))this.db.exec("ALTER TABLE skills ADD COLUMN last_materialized_at TEXT");this.db.prepare("UPDATE _meta SET value = ? WHERE key = 'schema_version'").run(hi)}}this.stmts={insertEntry:this.db.prepare(`
|
|
136
136
|
INSERT INTO entries (id, kind, title, content, context, advice, confidence, tags, files, session_id, directory, created_at)
|
|
137
137
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
138
138
|
`),ftsSearch:this.db.prepare(`
|
|
@@ -147,8 +147,8 @@ CREATE INDEX IF NOT EXISTS idx_boulder_dir_session ON boulder_tasks(directory, s
|
|
|
147
147
|
FROM boulder_tasks
|
|
148
148
|
WHERE directory = ? AND session_id = ?
|
|
149
149
|
ORDER BY priority ASC, updated_at_ms DESC
|
|
150
|
-
`)}}saveMemory(e){let t=
|
|
151
|
-
`)[0]??"lesson").slice(0,80);return this.stmts.insertEntry.run(t,"lesson",o,e.content,e.context,null,n,JSON.stringify(e.tags??[]),JSON.stringify([]),"","",Date.now()),Promise.resolve({id:t})}smartSearch(e){let t=e.limit??10,n=this.toFtsQuery(e.query),r=this.stmts.ftsSearch.all(n,t).map((i)=>({id:i.id,title:i.title,content:i.content,type:i.kind,concepts:
|
|
150
|
+
`)}}saveMemory(e){let t=om("M"),n=(e.concepts[0]??"memory").slice(0,80);return this.stmts.insertEntry.run(t,"memory",n,e.content,"",null,0.5,JSON.stringify(e.concepts),JSON.stringify(e.files??[]),"","",Date.now()),Promise.resolve({id:t})}saveLesson(e){let t=om("L"),n=e.confidence??0.5,o=(e.content.split(`
|
|
151
|
+
`)[0]??"lesson").slice(0,80);return this.stmts.insertEntry.run(t,"lesson",o,e.content,e.context,null,n,JSON.stringify(e.tags??[]),JSON.stringify([]),"","",Date.now()),Promise.resolve({id:t})}smartSearch(e){let t=e.limit??10,n=this.toFtsQuery(e.query),r=this.stmts.ftsSearch.all(n,t).map((i)=>({id:i.id,title:i.title,content:i.content,type:i.kind,concepts:im(i.tags),confidence:i.confidence,files:im(i.files),advice:i.advice??"info"}));return Promise.resolve({lessons:r,crystals:[]})}boulderRead(e){let n=this.stmts.boulderSelect.all(e.directory,e.sessionID).map((o)=>({id:o.id,title:o.title,priority:o.priority,status:o.status,description:o.description,createdAtMs:o.created_at_ms,updatedAtMs:o.updated_at_ms}));if(e.query){let o=e.query.toLowerCase();n=n.filter((r)=>r.title.toLowerCase().includes(o)||r.description.toLowerCase().includes(o))}return Promise.resolve(n)}skillSearch(e){let t=[],n=[];if(e.query){let s=this.toFtsQuery(e.query);if(s&&s!=='""')t.push("skills_fts MATCH ?"),n.push(s)}if(e.minInstalls!==void 0)t.push("installs >= ?"),n.push(e.minInstalls);let o=t.length>0?`WHERE ${t.join(" AND ")}`:"",r=e.filterDuplicates!==!1?50:100,i=this.db.prepare(`SELECT s.id, s.name, s.description, s.installs, s.skill_id, s.repo_url, s.download_count
|
|
152
152
|
FROM skills s
|
|
153
153
|
JOIN skills_fts f ON f.rowid = (SELECT rowid FROM skills WHERE id = s.id)
|
|
154
154
|
${o}
|
|
@@ -167,10 +167,10 @@ CREATE INDEX IF NOT EXISTS idx_boulder_dir_session ON boulder_tasks(directory, s
|
|
|
167
167
|
download_count = excluded.download_count,
|
|
168
168
|
last_synced = excluded.last_synced,
|
|
169
169
|
content_hash = excluded.content_hash
|
|
170
|
-
`).run(e.id,e.name,e.description,e.repo_url,e.installs??0,e.skill_id,e.download_count??0,e.last_synced??t,e.content_hash),Promise.resolve(e.id)}setSkillMaterializedAt(e,t){this.db.prepare("UPDATE skills SET last_materialized_at = ? WHERE id LIKE ? OR id = ?").run(t,`%/${e}`,e)}getSkillMaterializedAt(e){return this.db.prepare("SELECT last_materialized_at FROM skills WHERE id = ?").get(e)?.last_materialized_at??null}skillReplaceDeps(e,t){this.db.exec("BEGIN");try{this.db.prepare("DELETE FROM skill_deps WHERE skill_id = ?").run(e);let n=this.db.prepare("INSERT OR IGNORE INTO skill_deps (skill_id, dep_type, dep_name) VALUES (?, ?, ?)"),o=0;for(let r of t)if(typeof r.depType==="string"&&r.depType.length>0&&typeof r.depName==="string"&&r.depName.length>0)n.run(e,r.depType,r.depName),o++;return this.db.exec("COMMIT"),Promise.resolve(o)}catch(n){throw this.db.exec("ROLLBACK"),n}}skillGetDeps(e){let t=this.db.prepare("SELECT dep_type AS depType, dep_name AS depName FROM skill_deps WHERE skill_id = ? ORDER BY dep_type ASC, dep_name ASC").all(e);return Promise.resolve(t)}close(){this.db.close()}toFtsQuery(e){let t=e.trim().split(/\s+/).filter(Boolean).map((n)=>n.replace(/["()*:^]/g,"")).filter(Boolean);if(t.length===0)return'""';return t.map((n)=>`"${n}"*`).join(" ")}}function om(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}var gi=null;function gn(){if(!gi)gi=new im;return gi}var $o={};ye($o,{$brand:()=>vi,$input:()=>wl,$output:()=>kl,NEVER:()=>hi,TimePrecision:()=>Sl,ZodAny:()=>Vm,ZodArray:()=>Km,ZodBase64:()=>Zc,ZodBase64URL:()=>Gc,ZodBigInt:()=>Zr,ZodBigIntFormat:()=>Vc,ZodBoolean:()=>Fr,ZodCIDRv4:()=>Lc,ZodCIDRv6:()=>Fc,ZodCUID:()=>zc,ZodCUID2:()=>Cc,ZodCatch:()=>gp,ZodCodec:()=>ru,ZodCustom:()=>xo,ZodCustomStringFormat:()=>Ur,ZodDate:()=>_o,ZodDefault:()=>cp,ZodDiscriminatedUnion:()=>Xm,ZodE164:()=>Wc,ZodEmail:()=>Oc,ZodEmoji:()=>Ec,ZodEnum:()=>Nr,ZodError:()=>Wb,ZodFile:()=>sp,ZodFirstPartyTypeKind:()=>nu,ZodFunction:()=>$p,ZodGUID:()=>go,ZodIPv4:()=>jc,ZodIPv6:()=>Uc,ZodISODate:()=>uo,ZodISODateTime:()=>co,ZodISODuration:()=>po,ZodISOTime:()=>mo,ZodIntersection:()=>Ym,ZodIssueCode:()=>tk,ZodJWT:()=>Hc,ZodKSUID:()=>Nc,ZodLazy:()=>kp,ZodLiteral:()=>ip,ZodMap:()=>np,ZodNaN:()=>vp,ZodNanoID:()=>Rc,ZodNever:()=>qm,ZodNonOptional:()=>eu,ZodNull:()=>Wm,ZodNullable:()=>lp,ZodNumber:()=>Lr,ZodNumberFormat:()=>Zt,ZodObject:()=>wo,ZodOptional:()=>Qc,ZodPipe:()=>tu,ZodPrefault:()=>dp,ZodPromise:()=>xp,ZodReadonly:()=>yp,ZodRealError:()=>we,ZodRecord:()=>Kc,ZodSet:()=>op,ZodString:()=>jr,ZodStringFormat:()=>K,ZodSuccess:()=>fp,ZodSymbol:()=>Zm,ZodTemplateLiteral:()=>_p,ZodTransform:()=>ap,ZodTuple:()=>ep,ZodType:()=>E,ZodULID:()=>Mc,ZodURL:()=>bo,ZodUUID:()=>Xe,ZodUndefined:()=>Gm,ZodUnion:()=>qc,ZodUnknown:()=>Bm,ZodVoid:()=>Jm,ZodXID:()=>Ac,_ZodString:()=>Pc,_default:()=>up,_function:()=>q_,any:()=>D_,array:()=>ko,base64:()=>d_,base64url:()=>m_,bigint:()=>x_,boolean:()=>Fm,catch:()=>hp,check:()=>J_,cidrv4:()=>c_,cidrv6:()=>u_,clone:()=>he,codec:()=>H_,coerce:()=>ou,config:()=>ie,core:()=>Ke,cuid:()=>r_,cuid2:()=>n_,custom:()=>K_,date:()=>O_,decode:()=>_c,decodeAsync:()=>wc,discriminatedUnion:()=>M_,e164:()=>p_,email:()=>Vb,emoji:()=>e_,encode:()=>bc,encodeAsync:()=>kc,endsWith:()=>Er,enum:()=>Xc,file:()=>F_,flattenError:()=>ur,float32:()=>b_,float64:()=>__,formatError:()=>dr,function:()=>q_,getErrorMap:()=>nk,globalRegistry:()=>Fe,gt:()=>qe,gte:()=>ke,guid:()=>Bb,hash:()=>y_,hex:()=>v_,hostname:()=>h_,httpUrl:()=>Qb,includes:()=>Pr,instanceof:()=>X_,int:()=>Dc,int32:()=>k_,int64:()=>$_,intersection:()=>Qm,ipv4:()=>a_,ipv6:()=>l_,iso:()=>fo,json:()=>Q_,jwt:()=>f_,keyof:()=>E_,ksuid:()=>s_,lazy:()=>wp,length:()=>Ut,literal:()=>L_,locales:()=>kr,looseObject:()=>C_,lowercase:()=>Tr,lt:()=>Be,lte:()=>Ee,map:()=>N_,maxLength:()=>jt,maxSize:()=>Nt,mime:()=>Rr,minLength:()=>it,minSize:()=>_t,multipleOf:()=>bt,nan:()=>W_,nanoid:()=>t_,nativeEnum:()=>U_,negative:()=>ec,never:()=>Bc,nonnegative:()=>rc,nonoptional:()=>pp,nonpositive:()=>tc,normalize:()=>zr,null:()=>Hm,nullable:()=>vo,nullish:()=>Z_,number:()=>Lm,object:()=>R_,optional:()=>ho,overwrite:()=>Je,parse:()=>gc,parseAsync:()=>hc,partialRecord:()=>A_,pipe:()=>yo,positive:()=>Ql,prefault:()=>mp,preprocess:()=>ek,prettifyError:()=>Ti,promise:()=>B_,property:()=>nc,readonly:()=>bp,record:()=>rp,refine:()=>Sp,regex:()=>Ir,regexes:()=>Oe,registry:()=>Fn,safeDecode:()=>$c,safeDecodeAsync:()=>Ic,safeEncode:()=>xc,safeEncodeAsync:()=>Sc,safeParse:()=>vc,safeParseAsync:()=>yc,set:()=>j_,setErrorMap:()=>rk,size:()=>Sr,startsWith:()=>Or,strictObject:()=>z_,string:()=>Tc,stringFormat:()=>g_,stringbool:()=>Y_,success:()=>G_,superRefine:()=>Ip,symbol:()=>I_,templateLiteral:()=>V_,toJSONSchema:()=>uc,toLowerCase:()=>Mr,toUpperCase:()=>Ar,transform:()=>Yc,treeifyError:()=>Ii,trim:()=>Cr,tuple:()=>tp,uint32:()=>w_,uint64:()=>S_,ulid:()=>o_,undefined:()=>T_,union:()=>Jc,unknown:()=>Ft,uppercase:()=>Dr,url:()=>Yb,util:()=>b,uuid:()=>qb,uuidv4:()=>Jb,uuidv6:()=>Kb,uuidv7:()=>Xb,void:()=>P_,xid:()=>i_});var Ke={};ye(Ke,{$ZodAny:()=>ta,$ZodArray:()=>sa,$ZodAsyncError:()=>Ue,$ZodBase64:()=>Hs,$ZodBase64URL:()=>Vs,$ZodBigInt:()=>jn,$ZodBigIntFormat:()=>Xs,$ZodBoolean:()=>fr,$ZodCIDRv4:()=>Zs,$ZodCIDRv6:()=>Gs,$ZodCUID:()=>Es,$ZodCUID2:()=>Rs,$ZodCatch:()=>xa,$ZodCheck:()=>Y,$ZodCheckBigIntFormat:()=>as,$ZodCheckEndsWith:()=>bs,$ZodCheckGreaterThan:()=>On,$ZodCheckIncludes:()=>vs,$ZodCheckLengthEquals:()=>ps,$ZodCheckLessThan:()=>Pn,$ZodCheckLowerCase:()=>gs,$ZodCheckMaxLength:()=>ds,$ZodCheckMaxSize:()=>ls,$ZodCheckMimeType:()=>ks,$ZodCheckMinLength:()=>ms,$ZodCheckMinSize:()=>cs,$ZodCheckMultipleOf:()=>is,$ZodCheckNumberFormat:()=>ss,$ZodCheckOverwrite:()=>ws,$ZodCheckProperty:()=>_s,$ZodCheckRegex:()=>fs,$ZodCheckSizeEquals:()=>us,$ZodCheckStartsWith:()=>ys,$ZodCheckStringFormat:()=>At,$ZodCheckUpperCase:()=>hs,$ZodCodec:()=>gr,$ZodCustom:()=>Ea,$ZodCustomStringFormat:()=>Js,$ZodDate:()=>ia,$ZodDefault:()=>ba,$ZodDiscriminatedUnion:()=>la,$ZodE164:()=>Bs,$ZodEmail:()=>Ts,$ZodEmoji:()=>Ps,$ZodEncodeError:()=>gt,$ZodEnum:()=>pa,$ZodError:()=>cr,$ZodFile:()=>ga,$ZodFunction:()=>Da,$ZodGUID:()=>Ss,$ZodIPv4:()=>Ls,$ZodIPv6:()=>Fs,$ZodISODate:()=>Ns,$ZodISODateTime:()=>As,$ZodISODuration:()=>Us,$ZodISOTime:()=>js,$ZodIntersection:()=>ca,$ZodJWT:()=>qs,$ZodKSUID:()=>Ms,$ZodLazy:()=>Oa,$ZodLiteral:()=>fa,$ZodMap:()=>da,$ZodNaN:()=>$a,$ZodNanoID:()=>Os,$ZodNever:()=>na,$ZodNonOptional:()=>ka,$ZodNull:()=>ea,$ZodNullable:()=>ya,$ZodNumber:()=>Nn,$ZodNumberFormat:()=>Ks,$ZodObject:()=>Rm,$ZodObjectJIT:()=>aa,$ZodOptional:()=>va,$ZodPipe:()=>Sa,$ZodPrefault:()=>_a,$ZodPromise:()=>Pa,$ZodReadonly:()=>Ia,$ZodRealError:()=>_e,$ZodRecord:()=>ua,$ZodRegistry:()=>wr,$ZodSet:()=>ma,$ZodString:()=>yt,$ZodStringFormat:()=>q,$ZodSuccess:()=>wa,$ZodSymbol:()=>Ys,$ZodTemplateLiteral:()=>Ta,$ZodTransform:()=>ha,$ZodTuple:()=>Ln,$ZodType:()=>P,$ZodULID:()=>zs,$ZodURL:()=>Ds,$ZodUUID:()=>Is,$ZodUndefined:()=>Qs,$ZodUnion:()=>Un,$ZodUnknown:()=>ra,$ZodVoid:()=>oa,$ZodXID:()=>Cs,$brand:()=>vi,$constructor:()=>m,$input:()=>wl,$output:()=>kl,Doc:()=>En,JSONSchema:()=>Nm,JSONSchemaGenerator:()=>lo,NEVER:()=>hi,TimePrecision:()=>Sl,_any:()=>Vl,_array:()=>oc,_base64:()=>oo,_base64url:()=>io,_bigint:()=>Ul,_boolean:()=>Nl,_catch:()=>Nb,_check:()=>Am,_cidrv4:()=>ro,_cidrv6:()=>no,_coercedBigint:()=>Ll,_coercedBoolean:()=>jl,_coercedDate:()=>Xl,_coercedNumber:()=>El,_coercedString:()=>$l,_cuid:()=>Jn,_cuid2:()=>Kn,_custom:()=>sc,_date:()=>Kl,_decode:()=>kn,_decodeAsync:()=>xn,_default:()=>Cb,_discriminatedUnion:()=>wb,_e164:()=>so,_email:()=>Zn,_emoji:()=>Bn,_encode:()=>_n,_encodeAsync:()=>wn,_endsWith:()=>Er,_enum:()=>Db,_file:()=>ic,_float32:()=>zl,_float64:()=>Cl,_gt:()=>qe,_gte:()=>ke,_guid:()=>xr,_includes:()=>Pr,_int:()=>Rl,_int32:()=>Ml,_int64:()=>Fl,_intersection:()=>xb,_ipv4:()=>eo,_ipv6:()=>to,_isoDate:()=>Tl,_isoDateTime:()=>Il,_isoDuration:()=>Pl,_isoTime:()=>Dl,_jwt:()=>ao,_ksuid:()=>Qn,_lazy:()=>Fb,_length:()=>Ut,_literal:()=>Ob,_lowercase:()=>Tr,_lt:()=>Be,_lte:()=>Ee,_map:()=>Ib,_max:()=>Ee,_maxLength:()=>jt,_maxSize:()=>Nt,_mime:()=>Rr,_min:()=>ke,_minLength:()=>it,_minSize:()=>_t,_multipleOf:()=>bt,_nan:()=>Yl,_nanoid:()=>qn,_nativeEnum:()=>Pb,_negative:()=>ec,_never:()=>ql,_nonnegative:()=>rc,_nonoptional:()=>Mb,_nonpositive:()=>tc,_normalize:()=>zr,_null:()=>Hl,_nullable:()=>zb,_number:()=>Ol,_optional:()=>Rb,_overwrite:()=>Je,_parse:()=>Rt,_parseAsync:()=>zt,_pipe:()=>jb,_positive:()=>Ql,_promise:()=>Zb,_property:()=>nc,_readonly:()=>Ub,_record:()=>Sb,_refine:()=>ac,_regex:()=>Ir,_safeDecode:()=>Sn,_safeDecodeAsync:()=>Tn,_safeEncode:()=>$n,_safeEncodeAsync:()=>In,_safeParse:()=>Ct,_safeParseAsync:()=>Mt,_set:()=>Tb,_size:()=>Sr,_startsWith:()=>Or,_string:()=>xl,_stringFormat:()=>Lt,_stringbool:()=>cc,_success:()=>Ab,_superRefine:()=>lc,_symbol:()=>Gl,_templateLiteral:()=>Lb,_toLowerCase:()=>Mr,_toUpperCase:()=>Ar,_transform:()=>Eb,_trim:()=>Cr,_tuple:()=>$b,_uint32:()=>Al,_uint64:()=>Zl,_ulid:()=>Xn,_undefined:()=>Wl,_union:()=>kb,_unknown:()=>Bl,_uppercase:()=>Dr,_url:()=>$r,_uuid:()=>Gn,_uuidv4:()=>Wn,_uuidv6:()=>Hn,_uuidv7:()=>Vn,_void:()=>Jl,_xid:()=>Yn,clone:()=>he,config:()=>ie,decode:()=>Vv,decodeAsync:()=>qv,encode:()=>Hv,encodeAsync:()=>Bv,flattenError:()=>ur,formatError:()=>dr,globalConfig:()=>rr,globalRegistry:()=>Fe,isValidBase64:()=>Ws,isValidBase64URL:()=>Dm,isValidJWT:()=>Pm,locales:()=>kr,parse:()=>yn,parseAsync:()=>bn,prettifyError:()=>Ti,regexes:()=>Oe,registry:()=>Fn,safeDecode:()=>Kv,safeDecodeAsync:()=>Yv,safeEncode:()=>Jv,safeEncodeAsync:()=>Xv,safeParse:()=>Di,safeParseAsync:()=>Pi,toDotPath:()=>dm,toJSONSchema:()=>uc,treeifyError:()=>Ii,util:()=>b,version:()=>xs});var hi=Object.freeze({status:"aborted"});function m(e,t,n){function o(a,l){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(e),t(a,l);for(let u in s.prototype)if(!(u in a))Object.defineProperty(a,u,{value:s.prototype[u].bind(a)});a._zod.constr=s,a._zod.def=l}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function s(a){var l;let c=n?.Parent?new i:this;o(c,a),(l=c._zod).deferred??(l.deferred=[]);for(let u of c._zod.deferred)u();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:(a)=>{if(n?.Parent&&a instanceof n.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var vi=Symbol("zod_brand");class Ue extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}var rr={};function ie(e){if(e)Object.assign(rr,e);return rr}var b={};ye(b,{BIGINT_FORMAT_RANGES:()=>Si,Class:()=>cm,NUMBER_FORMAT_RANGES:()=>$i,aborted:()=>ot,allowsEval:()=>_i,assert:()=>xv,assertEqual:()=>bv,assertIs:()=>kv,assertNever:()=>wv,assertNotEqual:()=>_v,assignProp:()=>tt,base64ToUint8Array:()=>am,base64urlToUint8Array:()=>Lv,cached:()=>Ot,captureStackTrace:()=>vn,cleanEnum:()=>Uv,cleanRegex:()=>ir,clone:()=>he,cloneDef:()=>Sv,createTransparentProxy:()=>Ev,defineLazy:()=>M,esc:()=>hn,escapeRegex:()=>Le,extend:()=>Cv,finalizeIssue:()=>Te,floatSafeRemainder:()=>bi,getElementAtPath:()=>Iv,getEnumValues:()=>or,getLengthableOrigin:()=>lr,getParsedType:()=>Ov,getSizableOrigin:()=>ar,hexToUint8Array:()=>Zv,isObject:()=>ht,isPlainObject:()=>nt,issue:()=>Et,joinValues:()=>h,jsonStringifyReplacer:()=>Pt,merge:()=>Av,mergeDefs:()=>rt,normalizeParams:()=>k,nullish:()=>et,numKeys:()=>Pv,objectClone:()=>$v,omit:()=>zv,optionalKeys:()=>xi,partial:()=>Nv,pick:()=>Rv,prefixIssues:()=>Ie,primitiveTypes:()=>wi,promiseAllObject:()=>Tv,propertyKeyTypes:()=>sr,randomString:()=>Dv,required:()=>jv,safeExtend:()=>Mv,shallowClone:()=>ki,stringifyPrimitive:()=>_,uint8ArrayToBase64:()=>lm,uint8ArrayToBase64url:()=>Fv,uint8ArrayToHex:()=>Gv,unwrapMessage:()=>nr});function bv(e){return e}function _v(e){return e}function kv(e){}function wv(e){throw Error()}function xv(e){}function or(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function h(e,t="|"){return e.map((n)=>_(n)).join(t)}function Pt(e,t){if(typeof t==="bigint")return t.toString();return t}function Ot(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function et(e){return e===null||e===void 0}function ir(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function bi(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let l=o.match(/\d?e-(\d?)/);if(l?.[1])r=Number.parseInt(l[1])}let i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return s%a/10**i}var sm=Symbol("evaluating");function M(e,t,n){let o=void 0;Object.defineProperty(e,t,{get(){if(o===sm)return;if(o===void 0)o=sm,o=n();return o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function $v(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function tt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function rt(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function Sv(e){return rt(e._zod.def)}function Iv(e,t){if(!t)return e;return t.reduce((n,o)=>n?.[o],e)}function Tv(e){let t=Object.keys(e),n=t.map((o)=>e[o]);return Promise.all(n).then((o)=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function Dv(e=10){let n="";for(let o=0;o<e;o++)n+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return n}function hn(e){return JSON.stringify(e)}var vn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ht(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var _i=Ot(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function nt(e){if(ht(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;if(ht(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function ki(e){if(nt(e))return{...e};if(Array.isArray(e))return[...e];return e}function Pv(e){let t=0;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n))t++;return t}var Ov=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},sr=new Set(["string","number","symbol"]),wi=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(e,t,n){let o=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)o._zod.parent=e;return o}function k(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Ev(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function _(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function xi(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var $i={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Si={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Rv(e,t){let n=e._zod.def,o=rt(e._zod.def,{get shape(){let r={};for(let i in t){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);if(!t[i])continue;r[i]=n.shape[i]}return tt(this,"shape",r),r},checks:[]});return he(e,o)}function zv(e,t){let n=e._zod.def,o=rt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let i in t){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);if(!t[i])continue;delete r[i]}return tt(this,"shape",r),r},checks:[]});return he(e,o)}function Cv(e,t){if(!nt(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let r=rt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return tt(this,"shape",i),i},checks:[]});return he(e,r)}function Mv(e,t){if(!nt(t))throw Error("Invalid input to safeExtend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...t};return tt(this,"shape",o),o},checks:e._zod.def.checks};return he(e,n)}function Av(e,t){let n=rt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return tt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return he(e,n)}function Nv(e,t,n){let o=rt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let s in n){if(!(s in r))throw Error(`Unrecognized key: "${s}"`);if(!n[s])continue;i[s]=e?new e({type:"optional",innerType:r[s]}):r[s]}else for(let s in r)i[s]=e?new e({type:"optional",innerType:r[s]}):r[s];return tt(this,"shape",i),i},checks:[]});return he(t,o)}function jv(e,t,n){let o=rt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let s in n){if(!(s in i))throw Error(`Unrecognized key: "${s}"`);if(!n[s])continue;i[s]=new e({type:"nonoptional",innerType:r[s]})}else for(let s in r)i[s]=new e({type:"nonoptional",innerType:r[s]});return tt(this,"shape",i),i},checks:[]});return he(t,o)}function ot(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ie(e,t){return t.map((n)=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function nr(e){return typeof e==="string"?e:e?.message}function Te(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=nr(e.inst?._zod.def?.error?.(e))??nr(t?.error?.(e))??nr(n.customError?.(e))??nr(n.localeError?.(e))??"Invalid input";o.message=r}if(delete o.inst,delete o.continue,!t?.reportInput)delete o.input;return o}function ar(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function lr(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Et(...e){let[t,n,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:o};return{...t}}function Uv(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}function am(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function lm(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Lv(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return am(t+n)}function Fv(e){return lm(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Zv(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function Gv(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class cm{constructor(...e){}}var um=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cr=m("$ZodError",um),_e=m("$ZodError",um,{Parent:Error});function ur(e,t=(n)=>n.message){let n={},o=[];for(let r of e.issues)if(r.path.length>0)n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r));else o.push(t(r));return{formErrors:o,fieldErrors:n}}function dr(e,t){let n=t||function(i){return i.message},o={_errors:[]},r=(i)=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((a)=>r({issues:a}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)o._errors.push(n(s));else{let a=o,l=0;while(l<s.path.length){let c=s.path[l];if(l!==s.path.length-1)a[c]=a[c]||{_errors:[]};else a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s));a=a[c],l++}}};return r(e),o}function Ii(e,t){let n=t||function(i){return i.message},o={errors:[]},r=(i,s=[])=>{var a,l;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((u)=>r({issues:u},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{let u=[...s,...c.path];if(u.length===0){o.errors.push(n(c));continue}let f=o,g=0;while(g<u.length){let d=u[g],y=g===u.length-1;if(typeof d==="string")f.properties??(f.properties={}),(a=f.properties)[d]??(a[d]={errors:[]}),f=f.properties[d];else f.items??(f.items=[]),(l=f.items)[d]??(l[d]={errors:[]}),f=f.items[d];if(y)f.errors.push(n(c));g++}}};return r(e),o}function dm(e){let t=[],n=e.map((o)=>typeof o==="object"?o.key:o);for(let o of n)if(typeof o==="number")t.push(`[${o}]`);else if(typeof o==="symbol")t.push(`[${JSON.stringify(String(o))}]`);else if(/[^\w$]/.test(o))t.push(`[${JSON.stringify(o)}]`);else{if(t.length)t.push(".");t.push(o)}return t.join("")}function Ti(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)if(t.push(`✖ ${o.message}`),o.path?.length)t.push(` → at ${dm(o.path)}`);return t.join(`
|
|
171
|
-
`)}var Rt=(e)=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Ue;if(s.issues.length){let a=new(r?.Err??e)(s.issues.map((l)=>Te(l,i,ie())));throw vn(a,r?.callee),a}return s.value},yn=Rt(_e),zt=(e)=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)s=await s;if(s.issues.length){let a=new(r?.Err??e)(s.issues.map((l)=>Te(l,i,ie())));throw vn(a,r?.callee),a}return s.value},bn=zt(_e),Ct=(e)=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new Ue;return i.issues.length?{success:!1,error:new(e??cr)(i.issues.map((s)=>Te(s,r,ie())))}:{success:!0,data:i.value}},Di=Ct(_e),Mt=(e)=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((s)=>Te(s,r,ie())))}:{success:!0,data:i.value}},Pi=Mt(_e),_n=(e)=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Rt(e)(t,n,r)},Hv=_n(_e),kn=(e)=>(t,n,o)=>Rt(e)(t,n,o),Vv=kn(_e),wn=(e)=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return zt(e)(t,n,r)},Bv=wn(_e),xn=(e)=>async(t,n,o)=>zt(e)(t,n,o),qv=xn(_e),$n=(e)=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ct(e)(t,n,r)},Jv=$n(_e),Sn=(e)=>(t,n,o)=>Ct(e)(t,n,o),Kv=Sn(_e),In=(e)=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Mt(e)(t,n,r)},Xv=In(_e),Tn=(e)=>async(t,n,o)=>Mt(e)(t,n,o),Yv=Tn(_e);var Oe={};ye(Oe,{base64:()=>Wi,base64url:()=>Dn,bigint:()=>Xi,boolean:()=>es,browserEmail:()=>sy,cidrv4:()=>Zi,cidrv6:()=>Gi,cuid:()=>Oi,cuid2:()=>Ei,date:()=>Bi,datetime:()=>Ji,domain:()=>ay,duration:()=>Ai,e164:()=>Vi,email:()=>ji,emoji:()=>Ui,extendedDuration:()=>Qv,guid:()=>Ni,hex:()=>ly,hostname:()=>Hi,html5Email:()=>ny,idnEmail:()=>iy,integer:()=>Yi,ipv4:()=>Li,ipv6:()=>Fi,ksuid:()=>Ci,lowercase:()=>ns,md5_base64:()=>uy,md5_base64url:()=>dy,md5_hex:()=>cy,nanoid:()=>Mi,null:()=>ts,number:()=>Qi,rfc5322Email:()=>oy,sha1_base64:()=>py,sha1_base64url:()=>fy,sha1_hex:()=>my,sha256_base64:()=>hy,sha256_base64url:()=>vy,sha256_hex:()=>gy,sha384_base64:()=>by,sha384_base64url:()=>_y,sha384_hex:()=>yy,sha512_base64:()=>wy,sha512_base64url:()=>xy,sha512_hex:()=>ky,string:()=>Ki,time:()=>qi,ulid:()=>Ri,undefined:()=>rs,unicodeEmail:()=>mm,uppercase:()=>os,uuid:()=>vt,uuid4:()=>ey,uuid6:()=>ty,uuid7:()=>ry,xid:()=>zi});var Oi=/^[cC][^\s-]{8,}$/,Ei=/^[0-9a-z]+$/,Ri=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zi=/^[0-9a-vA-V]{20}$/,Ci=/^[A-Za-z0-9]{27}$/,Mi=/^[a-zA-Z0-9_-]{21}$/,Ai=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ni=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},ey=vt(4),ty=vt(6),ry=vt(7),ji=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ny=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,oy=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,mm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,iy=mm,sy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function Ui(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var Li=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Fi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Zi=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Gi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Dn=/^[A-Za-z0-9_-]*$/,Hi=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ay=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Vi=/^\+(?:[0-9]){6,14}[0-9]$/,pm="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Bi=new RegExp(`^${pm}$`);function fm(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function qi(e){return new RegExp(`^${fm(e)}$`)}function Ji(e){let t=fm({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${pm}T(?:${o})$`)}var Ki=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Xi=/^-?\d+n?$/,Yi=/^-?\d+$/,Qi=/^-?\d+(?:\.\d+)?/,es=/^(?:true|false)$/i,ts=/^null$/i;var rs=/^undefined$/i;var ns=/^[^A-Z]*$/,os=/^[^a-z]*$/,ly=/^[0-9a-fA-F]*$/;function mr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function pr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var cy=/^[0-9a-fA-F]{32}$/,uy=mr(22,"=="),dy=pr(22),my=/^[0-9a-fA-F]{40}$/,py=mr(27,"="),fy=pr(27),gy=/^[0-9a-fA-F]{64}$/,hy=mr(43,"="),vy=pr(43),yy=/^[0-9a-fA-F]{96}$/,by=mr(64,""),_y=pr(64),ky=/^[0-9a-fA-F]{128}$/,wy=mr(86,"=="),xy=pr(86);var Y=m("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),hm={number:"number",bigint:"bigint",object:"date"},Pn=m("$ZodCheckLessThan",(e,t)=>{Y.init(e,t);let n=hm[typeof t.value];e._zod.onattach.push((o)=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)r.maximum=t.value;else r.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),On=m("$ZodCheckGreaterThan",(e,t)=>{Y.init(e,t);let n=hm[typeof t.value];e._zod.onattach.push((o)=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)r.minimum=t.value;else r.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),is=m("$ZodCheckMultipleOf",(e,t)=>{Y.init(e,t),e._zod.onattach.push((n)=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=(n)=>{if(typeof n.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?n.value%t.value===BigInt(0):bi(n.value,t.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ss=m("$ZodCheckNumberFormat",(e,t)=>{Y.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=$i[t.format];e._zod.onattach.push((s)=>{let a=s._zod.bag;if(a.format=t.format,a.minimum=r,a.maximum=i,n)a.pattern=Yi}),e._zod.check=(s)=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});else s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}if(a<r)s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),as=m("$ZodCheckBigIntFormat",(e,t)=>{Y.init(e,t);let[n,o]=Si[t.format];e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=(r)=>{let i=r.value;if(i<n)r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(i>o)r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),ls=m("$ZodCheckMaxSize",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!et(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let r=o.value;if(r.size<=t.maximum)return;o.issues.push({origin:ar(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cs=m("$ZodCheckMinSize",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!et(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let r=o.value;if(r.size>=t.minimum)return;o.issues.push({origin:ar(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),us=m("$ZodCheckSizeEquals",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!et(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=(o)=>{let r=o.value,i=r.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:ar(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),ds=m("$ZodCheckMaxLength",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!et(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let r=o.value;if(r.length<=t.maximum)return;let s=lr(r);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ms=m("$ZodCheckMinLength",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!et(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let r=o.value;if(r.length>=t.minimum)return;let s=lr(r);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ps=m("$ZodCheckLengthEquals",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!et(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=(o)=>{let r=o.value,i=r.length;if(i===t.length)return;let s=lr(r),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),At=m("$ZodCheckStringFormat",(e,t)=>{var n,o;if(Y.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(n=e._zod).check??(n.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),fs=m("$ZodCheckRegex",(e,t)=>{At.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),gs=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ns),At.init(e,t)}),hs=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=os),At.init(e,t)}),vs=m("$ZodCheckIncludes",(e,t)=>{Y.init(e,t);let n=Le(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=(r)=>{if(r.value.includes(t.includes,t.position))return;r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),ys=m("$ZodCheckStartsWith",(e,t)=>{Y.init(e,t);let n=new RegExp(`^${Le(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),bs=m("$ZodCheckEndsWith",(e,t)=>{Y.init(e,t);let n=new RegExp(`.*${Le(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function gm(e,t,n){if(e.issues.length)t.issues.push(...Ie(n,e.issues))}var _s=m("$ZodCheckProperty",(e,t)=>{Y.init(e,t),e._zod.check=(n)=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then((r)=>gm(r,n,t.property));gm(o,n,t.property);return}}),ks=m("$ZodCheckMimeType",(e,t)=>{Y.init(e,t);let n=new Set(t.mime);e._zod.onattach.push((o)=>{o._zod.bag.mime=t.mime}),e._zod.check=(o)=>{if(n.has(o.value.type))return;o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),ws=m("$ZodCheckOverwrite",(e,t)=>{Y.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class En{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
|
|
170
|
+
`).run(e.id,e.name,e.description,e.repo_url,e.installs??0,e.skill_id,e.download_count??0,e.last_synced??t,e.content_hash),Promise.resolve(e.id)}setSkillMaterializedAt(e,t){this.db.prepare("UPDATE skills SET last_materialized_at = ? WHERE id LIKE ? OR id = ?").run(t,`%/${e}`,e)}getSkillMaterializedAt(e){return this.db.prepare("SELECT last_materialized_at FROM skills WHERE id = ?").get(e)?.last_materialized_at??null}skillReplaceDeps(e,t){this.db.exec("BEGIN");try{this.db.prepare("DELETE FROM skill_deps WHERE skill_id = ?").run(e);let n=this.db.prepare("INSERT OR IGNORE INTO skill_deps (skill_id, dep_type, dep_name) VALUES (?, ?, ?)"),o=0;for(let r of t)if(typeof r.depType==="string"&&r.depType.length>0&&typeof r.depName==="string"&&r.depName.length>0)n.run(e,r.depType,r.depName),o++;return this.db.exec("COMMIT"),Promise.resolve(o)}catch(n){throw this.db.exec("ROLLBACK"),n}}skillGetDeps(e){let t=this.db.prepare("SELECT dep_type AS depType, dep_name AS depName FROM skill_deps WHERE skill_id = ? ORDER BY dep_type ASC, dep_name ASC").all(e);return Promise.resolve(t)}close(){this.db.close()}toFtsQuery(e){let t=e.trim().split(/\s+/).filter(Boolean).map((n)=>n.replace(/["()*:^]/g,"")).filter(Boolean);if(t.length===0)return'""';return t.map((n)=>`"${n}"*`).join(" ")}}function im(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}var vi=null;function hn(){if(!vi)vi=new sm;return vi}var So={};ye(So,{$brand:()=>bi,$input:()=>$l,$output:()=>xl,NEVER:()=>yi,TimePrecision:()=>Tl,ZodAny:()=>Bm,ZodArray:()=>Xm,ZodBase64:()=>Wc,ZodBase64URL:()=>Hc,ZodBigInt:()=>Gr,ZodBigIntFormat:()=>qc,ZodBoolean:()=>Zr,ZodCIDRv4:()=>Zc,ZodCIDRv6:()=>Gc,ZodCUID:()=>Mc,ZodCUID2:()=>Ac,ZodCatch:()=>hp,ZodCodec:()=>ou,ZodCustom:()=>$o,ZodCustomStringFormat:()=>Lr,ZodDate:()=>ko,ZodDefault:()=>up,ZodDiscriminatedUnion:()=>Ym,ZodE164:()=>Vc,ZodEmail:()=>Rc,ZodEmoji:()=>zc,ZodEnum:()=>jr,ZodError:()=>Wb,ZodFile:()=>ap,ZodFirstPartyTypeKind:()=>iu,ZodFunction:()=>Sp,ZodGUID:()=>ho,ZodIPv4:()=>Lc,ZodIPv6:()=>Fc,ZodISODate:()=>mo,ZodISODateTime:()=>uo,ZodISODuration:()=>fo,ZodISOTime:()=>po,ZodIntersection:()=>Qm,ZodIssueCode:()=>tk,ZodJWT:()=>Bc,ZodKSUID:()=>Uc,ZodLazy:()=>wp,ZodLiteral:()=>sp,ZodMap:()=>op,ZodNaN:()=>yp,ZodNanoID:()=>Cc,ZodNever:()=>Jm,ZodNonOptional:()=>ru,ZodNull:()=>Hm,ZodNullable:()=>cp,ZodNumber:()=>Fr,ZodNumberFormat:()=>Gt,ZodObject:()=>xo,ZodOptional:()=>tu,ZodPipe:()=>nu,ZodPrefault:()=>mp,ZodPromise:()=>$p,ZodReadonly:()=>bp,ZodRealError:()=>we,ZodRecord:()=>Yc,ZodSet:()=>ip,ZodString:()=>Ur,ZodStringFormat:()=>X,ZodSuccess:()=>gp,ZodSymbol:()=>Gm,ZodTemplateLiteral:()=>kp,ZodTransform:()=>lp,ZodTuple:()=>tp,ZodType:()=>R,ZodULID:()=>Nc,ZodURL:()=>_o,ZodUUID:()=>Ye,ZodUndefined:()=>Wm,ZodUnion:()=>Kc,ZodUnknown:()=>qm,ZodVoid:()=>Km,ZodXID:()=>jc,_ZodString:()=>Ec,_default:()=>dp,_function:()=>q_,any:()=>D_,array:()=>wo,base64:()=>d_,base64url:()=>m_,bigint:()=>x_,boolean:()=>Zm,catch:()=>vp,check:()=>J_,cidrv4:()=>c_,cidrv6:()=>u_,clone:()=>ve,codec:()=>H_,coerce:()=>su,config:()=>ie,core:()=>Xe,cuid:()=>r_,cuid2:()=>n_,custom:()=>K_,date:()=>O_,decode:()=>wc,decodeAsync:()=>$c,discriminatedUnion:()=>M_,e164:()=>p_,email:()=>Vb,emoji:()=>e_,encode:()=>kc,encodeAsync:()=>xc,endsWith:()=>Rr,enum:()=>Qc,file:()=>F_,flattenError:()=>dr,float32:()=>b_,float64:()=>__,formatError:()=>mr,function:()=>q_,getErrorMap:()=>nk,globalRegistry:()=>Ze,gt:()=>Je,gte:()=>ke,guid:()=>Bb,hash:()=>y_,hex:()=>v_,hostname:()=>h_,httpUrl:()=>Qb,includes:()=>Or,instanceof:()=>X_,int:()=>Oc,int32:()=>k_,int64:()=>$_,intersection:()=>ep,ipv4:()=>a_,ipv6:()=>l_,iso:()=>go,json:()=>Q_,jwt:()=>f_,keyof:()=>E_,ksuid:()=>s_,lazy:()=>xp,length:()=>Lt,literal:()=>L_,locales:()=>wr,looseObject:()=>C_,lowercase:()=>Dr,lt:()=>qe,lte:()=>Re,map:()=>N_,maxLength:()=>Ut,maxSize:()=>jt,mime:()=>zr,minLength:()=>at,minSize:()=>wt,multipleOf:()=>kt,nan:()=>W_,nanoid:()=>t_,nativeEnum:()=>U_,negative:()=>rc,never:()=>Jc,nonnegative:()=>oc,nonoptional:()=>fp,nonpositive:()=>nc,normalize:()=>Cr,null:()=>Vm,nullable:()=>yo,nullish:()=>Z_,number:()=>Fm,object:()=>R_,optional:()=>vo,overwrite:()=>Ke,parse:()=>vc,parseAsync:()=>yc,partialRecord:()=>A_,pipe:()=>bo,positive:()=>tc,prefault:()=>pp,preprocess:()=>ek,prettifyError:()=>Pi,promise:()=>B_,property:()=>ic,readonly:()=>_p,record:()=>np,refine:()=>Ip,regex:()=>Tr,regexes:()=>Ee,registry:()=>Zn,safeDecode:()=>Ic,safeDecodeAsync:()=>Dc,safeEncode:()=>Sc,safeEncodeAsync:()=>Tc,safeParse:()=>bc,safeParseAsync:()=>_c,set:()=>j_,setErrorMap:()=>rk,size:()=>Ir,startsWith:()=>Er,strictObject:()=>z_,string:()=>Pc,stringFormat:()=>g_,stringbool:()=>Y_,success:()=>G_,superRefine:()=>Tp,symbol:()=>I_,templateLiteral:()=>V_,toJSONSchema:()=>mc,toLowerCase:()=>Ar,toUpperCase:()=>Nr,transform:()=>eu,treeifyError:()=>Di,trim:()=>Mr,tuple:()=>rp,uint32:()=>w_,uint64:()=>S_,ulid:()=>o_,undefined:()=>T_,union:()=>Xc,unknown:()=>Zt,uppercase:()=>Pr,url:()=>Yb,util:()=>b,uuid:()=>qb,uuidv4:()=>Jb,uuidv6:()=>Kb,uuidv7:()=>Xb,void:()=>P_,xid:()=>i_});var Xe={};ye(Xe,{$ZodAny:()=>na,$ZodArray:()=>la,$ZodAsyncError:()=>Le,$ZodBase64:()=>Bs,$ZodBase64URL:()=>qs,$ZodBigInt:()=>Un,$ZodBigIntFormat:()=>Qs,$ZodBoolean:()=>gr,$ZodCIDRv4:()=>Ws,$ZodCIDRv6:()=>Hs,$ZodCUID:()=>zs,$ZodCUID2:()=>Cs,$ZodCatch:()=>Sa,$ZodCheck:()=>Y,$ZodCheckBigIntFormat:()=>cs,$ZodCheckEndsWith:()=>ks,$ZodCheckGreaterThan:()=>En,$ZodCheckIncludes:()=>bs,$ZodCheckLengthEquals:()=>gs,$ZodCheckLessThan:()=>On,$ZodCheckLowerCase:()=>vs,$ZodCheckMaxLength:()=>ps,$ZodCheckMaxSize:()=>us,$ZodCheckMimeType:()=>xs,$ZodCheckMinLength:()=>fs,$ZodCheckMinSize:()=>ds,$ZodCheckMultipleOf:()=>as,$ZodCheckNumberFormat:()=>ls,$ZodCheckOverwrite:()=>$s,$ZodCheckProperty:()=>ws,$ZodCheckRegex:()=>hs,$ZodCheckSizeEquals:()=>ms,$ZodCheckStartsWith:()=>_s,$ZodCheckStringFormat:()=>Nt,$ZodCheckUpperCase:()=>ys,$ZodCodec:()=>hr,$ZodCustom:()=>za,$ZodCustomStringFormat:()=>Xs,$ZodDate:()=>aa,$ZodDefault:()=>ka,$ZodDiscriminatedUnion:()=>ua,$ZodE164:()=>Js,$ZodEmail:()=>Ps,$ZodEmoji:()=>Es,$ZodEncodeError:()=>vt,$ZodEnum:()=>ga,$ZodError:()=>ur,$ZodFile:()=>va,$ZodFunction:()=>Oa,$ZodGUID:()=>Ts,$ZodIPv4:()=>Zs,$ZodIPv6:()=>Gs,$ZodISODate:()=>Us,$ZodISODateTime:()=>js,$ZodISODuration:()=>Fs,$ZodISOTime:()=>Ls,$ZodIntersection:()=>da,$ZodJWT:()=>Ks,$ZodKSUID:()=>Ns,$ZodLazy:()=>Ra,$ZodLiteral:()=>ha,$ZodMap:()=>pa,$ZodNaN:()=>Ia,$ZodNanoID:()=>Rs,$ZodNever:()=>ia,$ZodNonOptional:()=>xa,$ZodNull:()=>ra,$ZodNullable:()=>_a,$ZodNumber:()=>jn,$ZodNumberFormat:()=>Ys,$ZodObject:()=>zm,$ZodObjectJIT:()=>ca,$ZodOptional:()=>ba,$ZodPipe:()=>Ta,$ZodPrefault:()=>wa,$ZodPromise:()=>Ea,$ZodReadonly:()=>Da,$ZodRealError:()=>_e,$ZodRecord:()=>ma,$ZodRegistry:()=>xr,$ZodSet:()=>fa,$ZodString:()=>_t,$ZodStringFormat:()=>J,$ZodSuccess:()=>$a,$ZodSymbol:()=>ea,$ZodTemplateLiteral:()=>Pa,$ZodTransform:()=>ya,$ZodTuple:()=>Fn,$ZodType:()=>P,$ZodULID:()=>Ms,$ZodURL:()=>Os,$ZodUUID:()=>Ds,$ZodUndefined:()=>ta,$ZodUnion:()=>Ln,$ZodUnknown:()=>oa,$ZodVoid:()=>sa,$ZodXID:()=>As,$brand:()=>bi,$constructor:()=>m,$input:()=>$l,$output:()=>xl,Doc:()=>Rn,JSONSchema:()=>jm,JSONSchemaGenerator:()=>co,NEVER:()=>yi,TimePrecision:()=>Tl,_any:()=>ql,_array:()=>sc,_base64:()=>io,_base64url:()=>so,_bigint:()=>Fl,_boolean:()=>Ul,_catch:()=>Nb,_check:()=>Nm,_cidrv4:()=>no,_cidrv6:()=>oo,_coercedBigint:()=>Zl,_coercedBoolean:()=>Ll,_coercedDate:()=>Ql,_coercedNumber:()=>zl,_coercedString:()=>Il,_cuid:()=>Kn,_cuid2:()=>Xn,_custom:()=>lc,_date:()=>Yl,_decode:()=>wn,_decodeAsync:()=>$n,_default:()=>Cb,_discriminatedUnion:()=>wb,_e164:()=>ao,_email:()=>Gn,_emoji:()=>qn,_encode:()=>kn,_encodeAsync:()=>xn,_endsWith:()=>Rr,_enum:()=>Db,_file:()=>ac,_float32:()=>Ml,_float64:()=>Al,_gt:()=>Je,_gte:()=>ke,_guid:()=>$r,_includes:()=>Or,_int:()=>Cl,_int32:()=>Nl,_int64:()=>Gl,_intersection:()=>xb,_ipv4:()=>to,_ipv6:()=>ro,_isoDate:()=>Pl,_isoDateTime:()=>Dl,_isoDuration:()=>El,_isoTime:()=>Ol,_jwt:()=>lo,_ksuid:()=>eo,_lazy:()=>Fb,_length:()=>Lt,_literal:()=>Ob,_lowercase:()=>Dr,_lt:()=>qe,_lte:()=>Re,_map:()=>Ib,_max:()=>Re,_maxLength:()=>Ut,_maxSize:()=>jt,_mime:()=>zr,_min:()=>ke,_minLength:()=>at,_minSize:()=>wt,_multipleOf:()=>kt,_nan:()=>ec,_nanoid:()=>Jn,_nativeEnum:()=>Pb,_negative:()=>rc,_never:()=>Kl,_nonnegative:()=>oc,_nonoptional:()=>Mb,_nonpositive:()=>nc,_normalize:()=>Cr,_null:()=>Bl,_nullable:()=>zb,_number:()=>Rl,_optional:()=>Rb,_overwrite:()=>Ke,_parse:()=>zt,_parseAsync:()=>Ct,_pipe:()=>jb,_positive:()=>tc,_promise:()=>Zb,_property:()=>ic,_readonly:()=>Ub,_record:()=>Sb,_refine:()=>cc,_regex:()=>Tr,_safeDecode:()=>In,_safeDecodeAsync:()=>Dn,_safeEncode:()=>Sn,_safeEncodeAsync:()=>Tn,_safeParse:()=>Mt,_safeParseAsync:()=>At,_set:()=>Tb,_size:()=>Ir,_startsWith:()=>Er,_string:()=>Sl,_stringFormat:()=>Ft,_stringbool:()=>dc,_success:()=>Ab,_superRefine:()=>uc,_symbol:()=>Hl,_templateLiteral:()=>Lb,_toLowerCase:()=>Ar,_toUpperCase:()=>Nr,_transform:()=>Eb,_trim:()=>Mr,_tuple:()=>$b,_uint32:()=>jl,_uint64:()=>Wl,_ulid:()=>Yn,_undefined:()=>Vl,_union:()=>kb,_unknown:()=>Jl,_uppercase:()=>Pr,_url:()=>Sr,_uuid:()=>Wn,_uuidv4:()=>Hn,_uuidv6:()=>Vn,_uuidv7:()=>Bn,_void:()=>Xl,_xid:()=>Qn,clone:()=>ve,config:()=>ie,decode:()=>Vv,decodeAsync:()=>qv,encode:()=>Hv,encodeAsync:()=>Bv,flattenError:()=>dr,formatError:()=>mr,globalConfig:()=>nr,globalRegistry:()=>Ze,isValidBase64:()=>Vs,isValidBase64URL:()=>Pm,isValidJWT:()=>Om,locales:()=>wr,parse:()=>bn,parseAsync:()=>_n,prettifyError:()=>Pi,regexes:()=>Ee,registry:()=>Zn,safeDecode:()=>Kv,safeDecodeAsync:()=>Yv,safeEncode:()=>Jv,safeEncodeAsync:()=>Xv,safeParse:()=>Oi,safeParseAsync:()=>Ei,toDotPath:()=>mm,toJSONSchema:()=>mc,treeifyError:()=>Di,util:()=>b,version:()=>Ss});var yi=Object.freeze({status:"aborted"});function m(e,t,n){function o(a,l){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(e),t(a,l);for(let u in s.prototype)if(!(u in a))Object.defineProperty(a,u,{value:s.prototype[u].bind(a)});a._zod.constr=s,a._zod.def=l}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function s(a){var l;let c=n?.Parent?new i:this;o(c,a),(l=c._zod).deferred??(l.deferred=[]);for(let u of c._zod.deferred)u();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:(a)=>{if(n?.Parent&&a instanceof n.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var bi=Symbol("zod_brand");class Le extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class vt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}var nr={};function ie(e){if(e)Object.assign(nr,e);return nr}var b={};ye(b,{BIGINT_FORMAT_RANGES:()=>Ti,Class:()=>um,NUMBER_FORMAT_RANGES:()=>Ii,aborted:()=>st,allowsEval:()=>wi,assert:()=>xv,assertEqual:()=>bv,assertIs:()=>kv,assertNever:()=>wv,assertNotEqual:()=>_v,assignProp:()=>nt,base64ToUint8Array:()=>lm,base64urlToUint8Array:()=>Lv,cached:()=>Et,captureStackTrace:()=>yn,cleanEnum:()=>Uv,cleanRegex:()=>sr,clone:()=>ve,cloneDef:()=>Sv,createTransparentProxy:()=>Ev,defineLazy:()=>A,esc:()=>vn,escapeRegex:()=>Fe,extend:()=>Cv,finalizeIssue:()=>Te,floatSafeRemainder:()=>ki,getElementAtPath:()=>Iv,getEnumValues:()=>ir,getLengthableOrigin:()=>cr,getParsedType:()=>Ov,getSizableOrigin:()=>lr,hexToUint8Array:()=>Zv,isObject:()=>yt,isPlainObject:()=>it,issue:()=>Rt,joinValues:()=>h,jsonStringifyReplacer:()=>Ot,merge:()=>Av,mergeDefs:()=>ot,normalizeParams:()=>k,nullish:()=>rt,numKeys:()=>Pv,objectClone:()=>$v,omit:()=>zv,optionalKeys:()=>Si,partial:()=>Nv,pick:()=>Rv,prefixIssues:()=>Ie,primitiveTypes:()=>$i,promiseAllObject:()=>Tv,propertyKeyTypes:()=>ar,randomString:()=>Dv,required:()=>jv,safeExtend:()=>Mv,shallowClone:()=>xi,stringifyPrimitive:()=>_,uint8ArrayToBase64:()=>cm,uint8ArrayToBase64url:()=>Fv,uint8ArrayToHex:()=>Gv,unwrapMessage:()=>or});function bv(e){return e}function _v(e){return e}function kv(e){}function wv(e){throw Error()}function xv(e){}function ir(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function h(e,t="|"){return e.map((n)=>_(n)).join(t)}function Ot(e,t){if(typeof t==="bigint")return t.toString();return t}function Et(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function rt(e){return e===null||e===void 0}function sr(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ki(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let l=o.match(/\d?e-(\d?)/);if(l?.[1])r=Number.parseInt(l[1])}let i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return s%a/10**i}var am=Symbol("evaluating");function A(e,t,n){let o=void 0;Object.defineProperty(e,t,{get(){if(o===am)return;if(o===void 0)o=am,o=n();return o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function $v(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function nt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ot(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function Sv(e){return ot(e._zod.def)}function Iv(e,t){if(!t)return e;return t.reduce((n,o)=>n?.[o],e)}function Tv(e){let t=Object.keys(e),n=t.map((o)=>e[o]);return Promise.all(n).then((o)=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function Dv(e=10){let n="";for(let o=0;o<e;o++)n+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return n}function vn(e){return JSON.stringify(e)}var yn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function yt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var wi=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function it(e){if(yt(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;if(yt(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function xi(e){if(it(e))return{...e};if(Array.isArray(e))return[...e];return e}function Pv(e){let t=0;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n))t++;return t}var Ov=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},ar=new Set(["string","number","symbol"]),$i=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ve(e,t,n){let o=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)o._zod.parent=e;return o}function k(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Ev(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function _(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Si(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Ii={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ti={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Rv(e,t){let n=e._zod.def,o=ot(e._zod.def,{get shape(){let r={};for(let i in t){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);if(!t[i])continue;r[i]=n.shape[i]}return nt(this,"shape",r),r},checks:[]});return ve(e,o)}function zv(e,t){let n=e._zod.def,o=ot(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let i in t){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);if(!t[i])continue;delete r[i]}return nt(this,"shape",r),r},checks:[]});return ve(e,o)}function Cv(e,t){if(!it(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let r=ot(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return nt(this,"shape",i),i},checks:[]});return ve(e,r)}function Mv(e,t){if(!it(t))throw Error("Invalid input to safeExtend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...t};return nt(this,"shape",o),o},checks:e._zod.def.checks};return ve(e,n)}function Av(e,t){let n=ot(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return nt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return ve(e,n)}function Nv(e,t,n){let o=ot(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let s in n){if(!(s in r))throw Error(`Unrecognized key: "${s}"`);if(!n[s])continue;i[s]=e?new e({type:"optional",innerType:r[s]}):r[s]}else for(let s in r)i[s]=e?new e({type:"optional",innerType:r[s]}):r[s];return nt(this,"shape",i),i},checks:[]});return ve(t,o)}function jv(e,t,n){let o=ot(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let s in n){if(!(s in i))throw Error(`Unrecognized key: "${s}"`);if(!n[s])continue;i[s]=new e({type:"nonoptional",innerType:r[s]})}else for(let s in r)i[s]=new e({type:"nonoptional",innerType:r[s]});return nt(this,"shape",i),i},checks:[]});return ve(t,o)}function st(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ie(e,t){return t.map((n)=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function or(e){return typeof e==="string"?e:e?.message}function Te(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=or(e.inst?._zod.def?.error?.(e))??or(t?.error?.(e))??or(n.customError?.(e))??or(n.localeError?.(e))??"Invalid input";o.message=r}if(delete o.inst,delete o.continue,!t?.reportInput)delete o.input;return o}function lr(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function cr(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Rt(...e){let[t,n,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:o};return{...t}}function Uv(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}function lm(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function cm(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Lv(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return lm(t+n)}function Fv(e){return cm(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Zv(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function Gv(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class um{constructor(...e){}}var dm=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ot,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ur=m("$ZodError",dm),_e=m("$ZodError",dm,{Parent:Error});function dr(e,t=(n)=>n.message){let n={},o=[];for(let r of e.issues)if(r.path.length>0)n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r));else o.push(t(r));return{formErrors:o,fieldErrors:n}}function mr(e,t){let n=t||function(i){return i.message},o={_errors:[]},r=(i)=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((a)=>r({issues:a}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)o._errors.push(n(s));else{let a=o,l=0;while(l<s.path.length){let c=s.path[l];if(l!==s.path.length-1)a[c]=a[c]||{_errors:[]};else a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s));a=a[c],l++}}};return r(e),o}function Di(e,t){let n=t||function(i){return i.message},o={errors:[]},r=(i,s=[])=>{var a,l;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((u)=>r({issues:u},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{let u=[...s,...c.path];if(u.length===0){o.errors.push(n(c));continue}let f=o,g=0;while(g<u.length){let d=u[g],y=g===u.length-1;if(typeof d==="string")f.properties??(f.properties={}),(a=f.properties)[d]??(a[d]={errors:[]}),f=f.properties[d];else f.items??(f.items=[]),(l=f.items)[d]??(l[d]={errors:[]}),f=f.items[d];if(y)f.errors.push(n(c));g++}}};return r(e),o}function mm(e){let t=[],n=e.map((o)=>typeof o==="object"?o.key:o);for(let o of n)if(typeof o==="number")t.push(`[${o}]`);else if(typeof o==="symbol")t.push(`[${JSON.stringify(String(o))}]`);else if(/[^\w$]/.test(o))t.push(`[${JSON.stringify(o)}]`);else{if(t.length)t.push(".");t.push(o)}return t.join("")}function Pi(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)if(t.push(`✖ ${o.message}`),o.path?.length)t.push(` → at ${mm(o.path)}`);return t.join(`
|
|
171
|
+
`)}var zt=(e)=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Le;if(s.issues.length){let a=new(r?.Err??e)(s.issues.map((l)=>Te(l,i,ie())));throw yn(a,r?.callee),a}return s.value},bn=zt(_e),Ct=(e)=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)s=await s;if(s.issues.length){let a=new(r?.Err??e)(s.issues.map((l)=>Te(l,i,ie())));throw yn(a,r?.callee),a}return s.value},_n=Ct(_e),Mt=(e)=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new Le;return i.issues.length?{success:!1,error:new(e??ur)(i.issues.map((s)=>Te(s,r,ie())))}:{success:!0,data:i.value}},Oi=Mt(_e),At=(e)=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((s)=>Te(s,r,ie())))}:{success:!0,data:i.value}},Ei=At(_e),kn=(e)=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return zt(e)(t,n,r)},Hv=kn(_e),wn=(e)=>(t,n,o)=>zt(e)(t,n,o),Vv=wn(_e),xn=(e)=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ct(e)(t,n,r)},Bv=xn(_e),$n=(e)=>async(t,n,o)=>Ct(e)(t,n,o),qv=$n(_e),Sn=(e)=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Mt(e)(t,n,r)},Jv=Sn(_e),In=(e)=>(t,n,o)=>Mt(e)(t,n,o),Kv=In(_e),Tn=(e)=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return At(e)(t,n,r)},Xv=Tn(_e),Dn=(e)=>async(t,n,o)=>At(e)(t,n,o),Yv=Dn(_e);var Ee={};ye(Ee,{base64:()=>Vi,base64url:()=>Pn,bigint:()=>Qi,boolean:()=>rs,browserEmail:()=>sy,cidrv4:()=>Wi,cidrv6:()=>Hi,cuid:()=>Ri,cuid2:()=>zi,date:()=>Ji,datetime:()=>Xi,domain:()=>ay,duration:()=>ji,e164:()=>qi,email:()=>Li,emoji:()=>Fi,extendedDuration:()=>Qv,guid:()=>Ui,hex:()=>ly,hostname:()=>Bi,html5Email:()=>ny,idnEmail:()=>iy,integer:()=>es,ipv4:()=>Zi,ipv6:()=>Gi,ksuid:()=>Ai,lowercase:()=>is,md5_base64:()=>uy,md5_base64url:()=>dy,md5_hex:()=>cy,nanoid:()=>Ni,null:()=>ns,number:()=>ts,rfc5322Email:()=>oy,sha1_base64:()=>py,sha1_base64url:()=>fy,sha1_hex:()=>my,sha256_base64:()=>hy,sha256_base64url:()=>vy,sha256_hex:()=>gy,sha384_base64:()=>by,sha384_base64url:()=>_y,sha384_hex:()=>yy,sha512_base64:()=>wy,sha512_base64url:()=>xy,sha512_hex:()=>ky,string:()=>Yi,time:()=>Ki,ulid:()=>Ci,undefined:()=>os,unicodeEmail:()=>pm,uppercase:()=>ss,uuid:()=>bt,uuid4:()=>ey,uuid6:()=>ty,uuid7:()=>ry,xid:()=>Mi});var Ri=/^[cC][^\s-]{8,}$/,zi=/^[0-9a-z]+$/,Ci=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mi=/^[0-9a-vA-V]{20}$/,Ai=/^[A-Za-z0-9]{27}$/,Ni=/^[a-zA-Z0-9_-]{21}$/,ji=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ui=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,bt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},ey=bt(4),ty=bt(6),ry=bt(7),Li=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ny=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,oy=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,pm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,iy=pm,sy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function Fi(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var Zi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Wi=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Hi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pn=/^[A-Za-z0-9_-]*$/,Bi=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ay=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,qi=/^\+(?:[0-9]){6,14}[0-9]$/,fm="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ji=new RegExp(`^${fm}$`);function gm(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Ki(e){return new RegExp(`^${gm(e)}$`)}function Xi(e){let t=gm({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${fm}T(?:${o})$`)}var Yi=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Qi=/^-?\d+n?$/,es=/^-?\d+$/,ts=/^-?\d+(?:\.\d+)?/,rs=/^(?:true|false)$/i,ns=/^null$/i;var os=/^undefined$/i;var is=/^[^A-Z]*$/,ss=/^[^a-z]*$/,ly=/^[0-9a-fA-F]*$/;function pr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function fr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var cy=/^[0-9a-fA-F]{32}$/,uy=pr(22,"=="),dy=fr(22),my=/^[0-9a-fA-F]{40}$/,py=pr(27,"="),fy=fr(27),gy=/^[0-9a-fA-F]{64}$/,hy=pr(43,"="),vy=fr(43),yy=/^[0-9a-fA-F]{96}$/,by=pr(64,""),_y=fr(64),ky=/^[0-9a-fA-F]{128}$/,wy=pr(86,"=="),xy=fr(86);var Y=m("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vm={number:"number",bigint:"bigint",object:"date"},On=m("$ZodCheckLessThan",(e,t)=>{Y.init(e,t);let n=vm[typeof t.value];e._zod.onattach.push((o)=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)r.maximum=t.value;else r.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),En=m("$ZodCheckGreaterThan",(e,t)=>{Y.init(e,t);let n=vm[typeof t.value];e._zod.onattach.push((o)=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)r.minimum=t.value;else r.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),as=m("$ZodCheckMultipleOf",(e,t)=>{Y.init(e,t),e._zod.onattach.push((n)=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=(n)=>{if(typeof n.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?n.value%t.value===BigInt(0):ki(n.value,t.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ls=m("$ZodCheckNumberFormat",(e,t)=>{Y.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=Ii[t.format];e._zod.onattach.push((s)=>{let a=s._zod.bag;if(a.format=t.format,a.minimum=r,a.maximum=i,n)a.pattern=es}),e._zod.check=(s)=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});else s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}if(a<r)s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),cs=m("$ZodCheckBigIntFormat",(e,t)=>{Y.init(e,t);let[n,o]=Ti[t.format];e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=(r)=>{let i=r.value;if(i<n)r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(i>o)r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),us=m("$ZodCheckMaxSize",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!rt(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let r=o.value;if(r.size<=t.maximum)return;o.issues.push({origin:lr(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ds=m("$ZodCheckMinSize",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!rt(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let r=o.value;if(r.size>=t.minimum)return;o.issues.push({origin:lr(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ms=m("$ZodCheckSizeEquals",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!rt(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=(o)=>{let r=o.value,i=r.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:lr(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),ps=m("$ZodCheckMaxLength",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!rt(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let r=o.value;if(r.length<=t.maximum)return;let s=cr(r);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fs=m("$ZodCheckMinLength",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!rt(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let r=o.value;if(r.length>=t.minimum)return;let s=cr(r);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gs=m("$ZodCheckLengthEquals",(e,t)=>{var n;Y.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!rt(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=(o)=>{let r=o.value,i=r.length;if(i===t.length)return;let s=cr(r),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Nt=m("$ZodCheckStringFormat",(e,t)=>{var n,o;if(Y.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(n=e._zod).check??(n.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),hs=m("$ZodCheckRegex",(e,t)=>{Nt.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vs=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=is),Nt.init(e,t)}),ys=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ss),Nt.init(e,t)}),bs=m("$ZodCheckIncludes",(e,t)=>{Y.init(e,t);let n=Fe(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=(r)=>{if(r.value.includes(t.includes,t.position))return;r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),_s=m("$ZodCheckStartsWith",(e,t)=>{Y.init(e,t);let n=new RegExp(`^${Fe(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),ks=m("$ZodCheckEndsWith",(e,t)=>{Y.init(e,t);let n=new RegExp(`.*${Fe(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function hm(e,t,n){if(e.issues.length)t.issues.push(...Ie(n,e.issues))}var ws=m("$ZodCheckProperty",(e,t)=>{Y.init(e,t),e._zod.check=(n)=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then((r)=>hm(r,n,t.property));hm(o,n,t.property);return}}),xs=m("$ZodCheckMimeType",(e,t)=>{Y.init(e,t);let n=new Set(t.mime);e._zod.onattach.push((o)=>{o._zod.bag.mime=t.mime}),e._zod.check=(o)=>{if(n.has(o.value.type))return;o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),$s=m("$ZodCheckOverwrite",(e,t)=>{Y.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class Rn{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
|
|
172
172
|
`).filter((i)=>i),o=Math.min(...n.map((i)=>i.length-i.trimStart().length)),r=n.map((i)=>i.slice(o)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of r)this.content.push(i)}compile(){let e=Function,t=this?.args,o=[...(this?.content??[""]).map((r)=>` ${r}`)];return new e(...t,o.join(`
|
|
173
|
-
`))}}var xs={major:4,minor:1,patch:8};var P=m("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xs;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(s,a,l)=>{let c=ot(s),u;for(let f of a){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(c)continue;let g=s.issues.length,d=f._zod.check(s);if(d instanceof Promise&&l?.async===!1)throw new Ue;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{if(await d,s.issues.length===g)return;if(!c)c=ot(s,g)});else{if(s.issues.length===g)continue;if(!c)c=ot(s,g)}}if(u)return u.then(()=>s);return s},i=(s,a,l)=>{if(ot(s))return s.aborted=!0,s;let c=r(a,o,l);if(c instanceof Promise){if(l.async===!1)throw new Ue;return c.then((u)=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let c=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});if(c instanceof Promise)return c.then((u)=>i(u,s,a));return i(c,s,a)}let l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new Ue;return l.then((c)=>r(c,o,a))}return r(l,o,a)}}e["~standard"]={validate:(r)=>{try{let i=Di(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return Pi(e,r).then((s)=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),yt=m("$ZodString",(e,t)=>{P.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ki(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),q=m("$ZodStringFormat",(e,t)=>{At.init(e,t),yt.init(e,t)}),Ss=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ni),q.init(e,t)}),Is=m("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vt(o))}else t.pattern??(t.pattern=vt());q.init(e,t)}),Ts=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ji),q.init(e,t)}),Ds=m("$ZodURL",(e,t)=>{q.init(e,t),e._zod.check=(n)=>{try{let o=n.value.trim(),r=new URL(o);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(r.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Hi.source,input:n.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})}if(t.normalize)n.value=r.href;else n.value=o;return}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ps=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ui()),q.init(e,t)}),Os=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Mi),q.init(e,t)}),Es=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Oi),q.init(e,t)}),Rs=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ei),q.init(e,t)}),zs=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ri),q.init(e,t)}),Cs=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zi),q.init(e,t)}),Ms=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ci),q.init(e,t)}),As=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ji(t)),q.init(e,t)}),Ns=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Bi),q.init(e,t)}),js=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=qi(t)),q.init(e,t)}),Us=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ai),q.init(e,t)}),Ls=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Li),q.init(e,t),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format="ipv4"})}),Fs=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Fi),q.init(e,t),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=(n)=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Zs=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Zi),q.init(e,t)}),Gs=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Gi),q.init(e,t),e._zod.check=(n)=>{let o=n.value.split("/");try{if(o.length!==2)throw Error();let[r,i]=o;if(!i)throw Error();let s=Number(i);if(`${s}`!==i)throw Error();if(s<0||s>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Ws(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Hs=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Wi),q.init(e,t),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=(n)=>{if(Ws(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Dm(e){if(!Dn.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ws(n)}var Vs=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Dn),q.init(e,t),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=(n)=>{if(Dm(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Bs=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Vi),q.init(e,t)});function Pm(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(t&&(!("alg"in r)||r.alg!==t))return!1;return!0}catch{return!1}}var qs=m("$ZodJWT",(e,t)=>{q.init(e,t),e._zod.check=(n)=>{if(Pm(n.value,t.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Js=m("$ZodCustomStringFormat",(e,t)=>{q.init(e,t),e._zod.check=(n)=>{if(t.fn(n.value))return;n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Nn=m("$ZodNumber",(e,t)=>{P.init(e,t),e._zod.pattern=e._zod.bag.pattern??Qi,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch(s){}let r=n.value;if(typeof r==="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r==="number"?Number.isNaN(r)?"NaN":!Number.isFinite(r)?"Infinity":void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),Ks=m("$ZodNumber",(e,t)=>{ss.init(e,t),Nn.init(e,t)}),fr=m("$ZodBoolean",(e,t)=>{P.init(e,t),e._zod.pattern=es,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(i){}let r=n.value;if(typeof r==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),jn=m("$ZodBigInt",(e,t)=>{P.init(e,t),e._zod.pattern=Xi,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(r){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Xs=m("$ZodBigInt",(e,t)=>{as.init(e,t),jn.init(e,t)}),Ys=m("$ZodSymbol",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r==="symbol")return n;return n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Qs=m("$ZodUndefined",(e,t)=>{P.init(e,t),e._zod.pattern=rs,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;if(typeof r>"u")return n;return n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),ea=m("$ZodNull",(e,t)=>{P.init(e,t),e._zod.pattern=ts,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;if(r===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),ta=m("$ZodAny",(e,t)=>{P.init(e,t),e._zod.parse=(n)=>n}),ra=m("$ZodUnknown",(e,t)=>{P.init(e,t),e._zod.parse=(n)=>n}),na=m("$ZodNever",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),oa=m("$ZodVoid",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),ia=m("$ZodDate",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(a){}let r=n.value,i=r instanceof Date;if(i&&!Number.isNaN(r.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function ym(e,t,n){if(e.issues.length)t.issues.push(...Ie(n,e.issues));t.value[n]=e.value}var sa=m("$ZodArray",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let s=0;s<r.length;s++){let a=r[s],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)i.push(l.then((c)=>ym(c,n,s)));else ym(l,n,s)}if(i.length)return Promise.all(i).then(()=>n);return n}});function An(e,t,n,o){if(e.issues.length)t.issues.push(...Ie(n,e.issues));if(e.value===void 0){if(n in o)t.value[n]=void 0}else t.value[n]=e.value}function Om(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let n=xi(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Em(e,t,n,o,r,i){let s=[],a=r.keySet,l=r.catchall._zod,c=l.def.type;for(let u of Object.keys(t)){if(a.has(u))continue;if(c==="never"){s.push(u);continue}let f=l.run({value:t[u],issues:[]},o);if(f instanceof Promise)e.push(f.then((g)=>An(g,n,u,t)));else An(f,n,u,t)}if(s.length)n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i});if(!e.length)return n;return Promise.all(e).then(()=>n)}var Rm=m("$ZodObject",(e,t)=>{P.init(e,t);let n=Ot(()=>Om(t));M(e._zod,"propValues",()=>{let s=t.shape,a={};for(let l in s){let c=s[l]._zod;if(c.values){a[l]??(a[l]=new Set);for(let u of c.values)a[l].add(u)}}return a});let o=ht,r=t.catchall,i;e._zod.parse=(s,a)=>{i??(i=n.value);let l=s.value;if(!o(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};let c=[],u=i.shape;for(let f of i.keys){let d=u[f]._zod.run({value:l[f],issues:[]},a);if(d instanceof Promise)c.push(d.then((y)=>An(y,s,f,l)));else An(d,s,f,l)}if(!r)return c.length?Promise.all(c).then(()=>s):s;return Em(c,l,s,a,n.value,e)}}),aa=m("$ZodObjectJIT",(e,t)=>{Rm.init(e,t);let n=e._zod.parse,o=Ot(()=>Om(t)),r=(g)=>{let d=new En(["shape","payload","ctx"]),y=o.value,x=(G)=>{let ae=hn(G);return`shape[${ae}]._zod.run({ value: input[${ae}], issues: [] }, ctx)`};d.write("const input = payload.value;");let z=Object.create(null),N=0;for(let G of y.keys)z[G]=`key_${N++}`;d.write("const newResult = {};");for(let G of y.keys){let ae=z[G],Pe=hn(G);d.write(`const ${ae} = ${x(G)};`),d.write(`
|
|
173
|
+
`))}}var Ss={major:4,minor:1,patch:8};var P=m("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ss;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(s,a,l)=>{let c=st(s),u;for(let f of a){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(c)continue;let g=s.issues.length,d=f._zod.check(s);if(d instanceof Promise&&l?.async===!1)throw new Le;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{if(await d,s.issues.length===g)return;if(!c)c=st(s,g)});else{if(s.issues.length===g)continue;if(!c)c=st(s,g)}}if(u)return u.then(()=>s);return s},i=(s,a,l)=>{if(st(s))return s.aborted=!0,s;let c=r(a,o,l);if(c instanceof Promise){if(l.async===!1)throw new Le;return c.then((u)=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let c=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});if(c instanceof Promise)return c.then((u)=>i(u,s,a));return i(c,s,a)}let l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new Le;return l.then((c)=>r(c,o,a))}return r(l,o,a)}}e["~standard"]={validate:(r)=>{try{let i=Oi(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return Ei(e,r).then((s)=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),_t=m("$ZodString",(e,t)=>{P.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Yi(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),J=m("$ZodStringFormat",(e,t)=>{Nt.init(e,t),_t.init(e,t)}),Ts=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ui),J.init(e,t)}),Ds=m("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=bt(o))}else t.pattern??(t.pattern=bt());J.init(e,t)}),Ps=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Li),J.init(e,t)}),Os=m("$ZodURL",(e,t)=>{J.init(e,t),e._zod.check=(n)=>{try{let o=n.value.trim(),r=new URL(o);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(r.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Bi.source,input:n.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})}if(t.normalize)n.value=r.href;else n.value=o;return}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Es=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fi()),J.init(e,t)}),Rs=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ni),J.init(e,t)}),zs=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ri),J.init(e,t)}),Cs=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=zi),J.init(e,t)}),Ms=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ci),J.init(e,t)}),As=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Mi),J.init(e,t)}),Ns=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ai),J.init(e,t)}),js=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xi(t)),J.init(e,t)}),Us=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ji),J.init(e,t)}),Ls=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ki(t)),J.init(e,t)}),Fs=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ji),J.init(e,t)}),Zs=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Zi),J.init(e,t),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format="ipv4"})}),Gs=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Gi),J.init(e,t),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=(n)=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Ws=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Wi),J.init(e,t)}),Hs=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Hi),J.init(e,t),e._zod.check=(n)=>{let o=n.value.split("/");try{if(o.length!==2)throw Error();let[r,i]=o;if(!i)throw Error();let s=Number(i);if(`${s}`!==i)throw Error();if(s<0||s>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Vs(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Bs=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Vi),J.init(e,t),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=(n)=>{if(Vs(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Pm(e){if(!Pn.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Vs(n)}var qs=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Pn),J.init(e,t),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=(n)=>{if(Pm(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Js=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=qi),J.init(e,t)});function Om(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(t&&(!("alg"in r)||r.alg!==t))return!1;return!0}catch{return!1}}var Ks=m("$ZodJWT",(e,t)=>{J.init(e,t),e._zod.check=(n)=>{if(Om(n.value,t.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Xs=m("$ZodCustomStringFormat",(e,t)=>{J.init(e,t),e._zod.check=(n)=>{if(t.fn(n.value))return;n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),jn=m("$ZodNumber",(e,t)=>{P.init(e,t),e._zod.pattern=e._zod.bag.pattern??ts,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch(s){}let r=n.value;if(typeof r==="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r==="number"?Number.isNaN(r)?"NaN":!Number.isFinite(r)?"Infinity":void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),Ys=m("$ZodNumber",(e,t)=>{ls.init(e,t),jn.init(e,t)}),gr=m("$ZodBoolean",(e,t)=>{P.init(e,t),e._zod.pattern=rs,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(i){}let r=n.value;if(typeof r==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Un=m("$ZodBigInt",(e,t)=>{P.init(e,t),e._zod.pattern=Qi,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(r){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Qs=m("$ZodBigInt",(e,t)=>{cs.init(e,t),Un.init(e,t)}),ea=m("$ZodSymbol",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r==="symbol")return n;return n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),ta=m("$ZodUndefined",(e,t)=>{P.init(e,t),e._zod.pattern=os,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;if(typeof r>"u")return n;return n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),ra=m("$ZodNull",(e,t)=>{P.init(e,t),e._zod.pattern=ns,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;if(r===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),na=m("$ZodAny",(e,t)=>{P.init(e,t),e._zod.parse=(n)=>n}),oa=m("$ZodUnknown",(e,t)=>{P.init(e,t),e._zod.parse=(n)=>n}),ia=m("$ZodNever",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),sa=m("$ZodVoid",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),aa=m("$ZodDate",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(a){}let r=n.value,i=r instanceof Date;if(i&&!Number.isNaN(r.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function bm(e,t,n){if(e.issues.length)t.issues.push(...Ie(n,e.issues));t.value[n]=e.value}var la=m("$ZodArray",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let s=0;s<r.length;s++){let a=r[s],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)i.push(l.then((c)=>bm(c,n,s)));else bm(l,n,s)}if(i.length)return Promise.all(i).then(()=>n);return n}});function Nn(e,t,n,o){if(e.issues.length)t.issues.push(...Ie(n,e.issues));if(e.value===void 0){if(n in o)t.value[n]=void 0}else t.value[n]=e.value}function Em(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let n=Si(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Rm(e,t,n,o,r,i){let s=[],a=r.keySet,l=r.catchall._zod,c=l.def.type;for(let u of Object.keys(t)){if(a.has(u))continue;if(c==="never"){s.push(u);continue}let f=l.run({value:t[u],issues:[]},o);if(f instanceof Promise)e.push(f.then((g)=>Nn(g,n,u,t)));else Nn(f,n,u,t)}if(s.length)n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i});if(!e.length)return n;return Promise.all(e).then(()=>n)}var zm=m("$ZodObject",(e,t)=>{P.init(e,t);let n=Et(()=>Em(t));A(e._zod,"propValues",()=>{let s=t.shape,a={};for(let l in s){let c=s[l]._zod;if(c.values){a[l]??(a[l]=new Set);for(let u of c.values)a[l].add(u)}}return a});let o=yt,r=t.catchall,i;e._zod.parse=(s,a)=>{i??(i=n.value);let l=s.value;if(!o(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};let c=[],u=i.shape;for(let f of i.keys){let d=u[f]._zod.run({value:l[f],issues:[]},a);if(d instanceof Promise)c.push(d.then((y)=>Nn(y,s,f,l)));else Nn(d,s,f,l)}if(!r)return c.length?Promise.all(c).then(()=>s):s;return Rm(c,l,s,a,n.value,e)}}),ca=m("$ZodObjectJIT",(e,t)=>{zm.init(e,t);let n=e._zod.parse,o=Et(()=>Em(t)),r=(g)=>{let d=new Rn(["shape","payload","ctx"]),y=o.value,x=(W)=>{let ae=vn(W);return`shape[${ae}]._zod.run({ value: input[${ae}], issues: [] }, ctx)`};d.write("const input = payload.value;");let C=Object.create(null),j=0;for(let W of y.keys)C[W]=`key_${j++}`;d.write("const newResult = {};");for(let W of y.keys){let ae=C[W],Pe=vn(W);d.write(`const ${ae} = ${x(W)};`),d.write(`
|
|
174
174
|
if (${ae}.issues.length) {
|
|
175
175
|
payload.issues = payload.issues.concat(${ae}.issues.map(iss => ({
|
|
176
176
|
...iss,
|
|
@@ -187,20 +187,20 @@ CREATE INDEX IF NOT EXISTS idx_boulder_dir_session ON boulder_tasks(directory, s
|
|
|
187
187
|
newResult[${Pe}] = ${ae}.value;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
`)}d.write("payload.value = newResult;"),d.write("return payload;");let J=d.compile();return(G,ae)=>J(g,G,ae)},i,s=ht,a=!rr.jitless,c=a&&_i.value,u=t.catchall,f;e._zod.parse=(g,d)=>{f??(f=o.value);let y=g.value;if(!s(y))return g.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),g;if(a&&c&&d?.async===!1&&d.jitless!==!0){if(!i)i=r(t.shape);if(g=i(g,d),!u)return g;return Em([],y,g,d,f,e)}return n(g,d)}});function bm(e,t,n,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter((i)=>!ot(i));if(r.length===1)return t.value=r[0].value,r[0];return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((i)=>i.issues.map((s)=>Te(s,o,ie())))}),t}var Un=m("$ZodUnion",(e,t)=>{P.init(e,t),M(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),M(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),M(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),M(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((i)=>i._zod.pattern);return new RegExp(`^(${r.map((i)=>ir(i.source)).join("|")})$`)}return});let n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let s=!1,a=[];for(let l of t.options){let c=l._zod.run({value:r.value,issues:[]},i);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}if(!s)return bm(a,r,e,i);return Promise.all(a).then((l)=>bm(l,r,e,i))}}),la=m("$ZodDiscriminatedUnion",(e,t)=>{Un.init(e,t);let n=e._zod.parse;M(e._zod,"propValues",()=>{let r={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,l]of Object.entries(s)){if(!r[a])r[a]=new Set;for(let c of l)r[a].add(c)}}return r});let o=Ot(()=>{let r=t.options,i=new Map;for(let s of r){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let l of a){if(i.has(l))throw Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(r,i)=>{let s=r.value;if(!ht(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let a=o.value.get(s?.[t.discriminator]);if(a)return a._zod.run(r,i);if(t.unionFallback)return n(r,i);return r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),r}}),ca=m("$ZodIntersection",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),s=t.right._zod.run({value:r,issues:[]},o);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([l,c])=>_m(n,l,c));return _m(n,i,s)}});function $s(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(nt(e)&&nt(t)){let n=Object.keys(t),o=Object.keys(e).filter((i)=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let s=$s(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r[i]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],s=$s(r,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function _m(e,t,n){if(t.issues.length)e.issues.push(...t.issues);if(n.issues.length)e.issues.push(...n.issues);if(ot(e))return e;let o=$s(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Ln=m("$ZodTuple",(e,t)=>{P.init(e,t);let n=t.items,o=n.length-[...n].reverse().findIndex((r)=>r._zod.optin!=="optional");e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let a=[];if(!t.rest){let c=s.length>n.length,u=s.length<o-1;if(c||u)return r.issues.push({...c?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:s,inst:e,origin:"array"}),r}let l=-1;for(let c of n){if(l++,l>=s.length){if(l>=o)continue}let u=c._zod.run({value:s[l],issues:[]},i);if(u instanceof Promise)a.push(u.then((f)=>Rn(f,r,l)));else Rn(u,r,l)}if(t.rest){let c=s.slice(n.length);for(let u of c){l++;let f=t.rest._zod.run({value:u,issues:[]},i);if(f instanceof Promise)a.push(f.then((g)=>Rn(g,r,l)));else Rn(f,r,l)}}if(a.length)return Promise.all(a).then(()=>r);return r}});function Rn(e,t,n){if(e.issues.length)t.issues.push(...Ie(n,e.issues));t.value[n]=e.value}var ua=m("$ZodRecord",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!nt(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;n.value={};for(let l of s)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){let c=t.valueType._zod.run({value:r[l],issues:[]},o);if(c instanceof Promise)i.push(c.then((u)=>{if(u.issues.length)n.issues.push(...Ie(l,u.issues));n.value[l]=u.value}));else{if(c.issues.length)n.issues.push(...Ie(l,c.issues));n.value[l]=c.value}}let a;for(let l in r)if(!s.has(l))a=a??[],a.push(l);if(a&&a.length>0)n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:a})}else{n.value={};for(let s of Reflect.ownKeys(r)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},o);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map((c)=>Te(c,o,ie())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}let l=t.valueType._zod.run({value:r[s],issues:[]},o);if(l instanceof Promise)i.push(l.then((c)=>{if(c.issues.length)n.issues.push(...Ie(s,c.issues));n.value[a.value]=c.value}));else{if(l.issues.length)n.issues.push(...Ie(s,l.issues));n.value[a.value]=l.value}}}if(i.length)return Promise.all(i).then(()=>n);return n}}),da=m("$ZodMap",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[s,a]of r){let l=t.keyType._zod.run({value:s,issues:[]},o),c=t.valueType._zod.run({value:a,issues:[]},o);if(l instanceof Promise||c instanceof Promise)i.push(Promise.all([l,c]).then(([u,f])=>{km(u,f,n,s,r,e,o)}));else km(l,c,n,s,r,e,o)}if(i.length)return Promise.all(i).then(()=>n);return n}});function km(e,t,n,o,r,i,s){if(e.issues.length)if(sr.has(typeof o))n.issues.push(...Ie(o,e.issues));else n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map((a)=>Te(a,s,ie()))});if(t.issues.length)if(sr.has(typeof o))n.issues.push(...Ie(o,t.issues));else n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map((a)=>Te(a,s,ie()))});n.value.set(e.value,t.value)}var ma=m("$ZodSet",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let s of r){let a=t.valueType._zod.run({value:s,issues:[]},o);if(a instanceof Promise)i.push(a.then((l)=>wm(l,n)));else wm(a,n)}if(i.length)return Promise.all(i).then(()=>n);return n}});function wm(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}var pa=m("$ZodEnum",(e,t)=>{P.init(e,t);let n=or(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter((r)=>sr.has(typeof r)).map((r)=>typeof r==="string"?Le(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let s=r.value;if(o.has(s))return r;return r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),fa=m("$ZodLiteral",(e,t)=>{if(P.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((n)=>typeof n==="string"?Le(n):n?Le(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let r=n.value;if(e._zod.values.has(r))return n;return n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}}),ga=m("$ZodFile",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(r instanceof File)return n;return n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),ha=m("$ZodTransform",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new gt(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then((s)=>(n.value=s,n));if(r instanceof Promise)throw new Ue;return n.value=r,n}});function xm(e,t){if(e.issues.length&&t===void 0)return{issues:[],value:void 0};return e}var va=m("$ZodOptional",(e,t)=>{P.init(e,t),e._zod.optin="optional",e._zod.optout="optional",M(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),M(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${ir(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>xm(i,n.value));return xm(r,n.value)}if(n.value===void 0)return n;return t.innerType._zod.run(n,o)}}),ya=m("$ZodNullable",(e,t)=>{P.init(e,t),M(e._zod,"optin",()=>t.innerType._zod.optin),M(e._zod,"optout",()=>t.innerType._zod.optout),M(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${ir(n.source)}|null)$`):void 0}),M(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>{if(n.value===null)return n;return t.innerType._zod.run(n,o)}}),ba=m("$ZodDefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",M(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>$m(i,t));return $m(r,t)}});function $m(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var _a=m("$ZodPrefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",M(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)n.value=t.defaultValue;return t.innerType._zod.run(n,o)}}),ka=m("$ZodNonOptional",(e,t)=>{P.init(e,t),M(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>Sm(i,e));return Sm(r,e)}});function Sm(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var wa=m("$ZodSuccess",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new gt("ZodSuccess");let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>(n.value=i.issues.length===0,n));return n.value=r.issues.length===0,n}}),xa=m("$ZodCatch",(e,t)=>{P.init(e,t),M(e._zod,"optin",()=>t.innerType._zod.optin),M(e._zod,"optout",()=>t.innerType._zod.optout),M(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>{if(n.value=i.value,i.issues.length)n.value=t.catchValue({...n,error:{issues:i.issues.map((s)=>Te(s,o,ie()))},input:n.value}),n.issues=[];return n});if(n.value=r.value,r.issues.length)n.value=t.catchValue({...n,error:{issues:r.issues.map((i)=>Te(i,o,ie()))},input:n.value}),n.issues=[];return n}}),$a=m("$ZodNaN",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{if(typeof n.value!=="number"||!Number.isNaN(n.value))return n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n;return n}}),Sa=m("$ZodPipe",(e,t)=>{P.init(e,t),M(e._zod,"values",()=>t.in._zod.values),M(e._zod,"optin",()=>t.in._zod.optin),M(e._zod,"optout",()=>t.out._zod.optout),M(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(n,o);if(i instanceof Promise)return i.then((s)=>zn(s,t.in,o));return zn(i,t.in,o)}let r=t.in._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>zn(i,t.out,o));return zn(r,t.out,o)}});function zn(e,t,n){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},n)}var gr=m("$ZodCodec",(e,t)=>{P.init(e,t),M(e._zod,"values",()=>t.in._zod.values),M(e._zod,"optin",()=>t.in._zod.optin),M(e._zod,"optout",()=>t.out._zod.optout),M(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(n,o);if(i instanceof Promise)return i.then((s)=>Cn(s,t,o));return Cn(i,t,o)}else{let i=t.out._zod.run(n,o);if(i instanceof Promise)return i.then((s)=>Cn(s,t,o));return Cn(i,t,o)}}});function Cn(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);if(r instanceof Promise)return r.then((i)=>Mn(e,i,t.out,n));return Mn(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);if(r instanceof Promise)return r.then((i)=>Mn(e,i,t.in,n));return Mn(e,r,t.in,n)}}function Mn(e,t,n,o){if(e.issues.length)return e.aborted=!0,e;return n._zod.run({value:t,issues:e.issues},o)}var Ia=m("$ZodReadonly",(e,t)=>{P.init(e,t),M(e._zod,"propValues",()=>t.innerType._zod.propValues),M(e._zod,"values",()=>t.innerType._zod.values),M(e._zod,"optin",()=>t.innerType._zod.optin),M(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then(Im);return Im(r)}});function Im(e){return e.value=Object.freeze(e.value),e}var Ta=m("$ZodTemplateLiteral",(e,t)=>{P.init(e,t);let n=[];for(let o of t.parts)if(typeof o==="object"&&o!==null){if(!o._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,s))}else if(o===null||wi.has(typeof o))n.push(Le(`${o}`));else throw Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>{if(typeof o.value!=="string")return o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(o.value))return o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o;return o}}),Da=m("$ZodFunction",(e,t)=>(P.init(e,t),e._def=t,e._zod.def=t,e.implement=(n)=>{if(typeof n!=="function")throw Error("implement() must be called with a function");return function(...o){let r=e._def.input?yn(e._def.input,o):o,i=Reflect.apply(n,this,r);if(e._def.output)return yn(e._def.output,i);return i}},e.implementAsync=(n)=>{if(typeof n!=="function")throw Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await bn(e._def.input,o):o,i=await Reflect.apply(n,this,r);if(e._def.output)return await bn(e._def.output,i);return i}},e._zod.parse=(n,o)=>{if(typeof n.value!=="function")return n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n;if(e._def.output&&e._def.output._zod.def.type==="promise")n.value=e.implementAsync(n.value);else n.value=e.implement(n.value);return n},e.input=(...n)=>{let o=e.constructor;if(Array.isArray(n[0]))return new o({type:"function",input:new Ln({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output});return new o({type:"function",input:n[0],output:e._def.output})},e.output=(n)=>new e.constructor({type:"function",input:e._def.input,output:n}),e)),Pa=m("$ZodPromise",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then((r)=>t.innerType._zod.run({value:r,issues:[]},o))}),Oa=m("$ZodLazy",(e,t)=>{P.init(e,t),M(e._zod,"innerType",()=>t.getter()),M(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),M(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),M(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),M(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),Ea=m("$ZodCustom",(e,t)=>{Y.init(e,t),P.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=(n)=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then((i)=>Tm(i,n,o,e));Tm(r,n,o,e);return}});function Tm(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)r.params=o._zod.def.params;t.issues.push(Et(r))}}var kr={};ye(kr,{ar:()=>Ra,az:()=>za,be:()=>Ca,ca:()=>Ma,cs:()=>Aa,da:()=>Na,de:()=>ja,en:()=>hr,eo:()=>Ua,es:()=>La,fa:()=>Fa,fi:()=>Za,fr:()=>Ga,frCA:()=>Wa,he:()=>Ha,hu:()=>Va,id:()=>Ba,is:()=>qa,it:()=>Ja,ja:()=>Ka,ka:()=>Xa,kh:()=>Ya,km:()=>vr,ko:()=>Qa,lt:()=>el,mk:()=>tl,ms:()=>rl,nl:()=>nl,no:()=>ol,ota:()=>il,pl:()=>al,ps:()=>sl,pt:()=>ll,ru:()=>cl,sl:()=>ul,sv:()=>dl,ta:()=>ml,th:()=>pl,tr:()=>fl,ua:()=>gl,uk:()=>_r,ur:()=>hl,vi:()=>vl,yo:()=>_l,zhCN:()=>yl,zhTW:()=>bl});var Sy=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(r)=>{switch(r.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${r.expected}، ولكن تم إدخال ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${_(r.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return` أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()} ${s.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()} ${s.unit}`;return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${r.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${o[i.format]??r.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${r.divisor}`;case"unrecognized_keys":return`معرف${r.keys.length>1?"ات":""} غريب${r.keys.length>1?"ة":""}: ${h(r.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${r.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${r.origin}`;default:return"مدخل غير مقبول"}}};function Ra(){return{localeError:Sy()}}var Iy=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${r.expected}, daxil olan ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Yanlış dəyər: gözlənilən ${_(r.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()} ${s.unit??"element"}`;return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`;return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanlış ədəd: ${r.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${r.keys.length>1?"lar":""}: ${h(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${r.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function za(){return{localeError:Iy()}}function zm(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;if(s>=11&&s<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return n;return o}var Ty=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"лік";case"object":{if(Array.isArray(r))return"масіў";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(r)=>{switch(r.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${r.expected}, атрымана ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Няправільны ўвод: чакалася ${_(r.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),l=zm(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${s.verb} ${i}${r.maximum.toString()} ${l}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),l=zm(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${s.verb} ${i}${r.minimum.toString()} ${l}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${o[i.format]??r.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${h(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`;default:return"Няправільны ўвод"}}};function Ca(){return{localeError:Ty()}}var Dy=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(r)=>{switch(r.code){case"invalid_type":return`Tipus invàlid: s'esperava ${r.expected}, s'ha rebut ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Valor invàlid: s'esperava ${_(r.values[0])}`;return`Opció invàlida: s'esperava una de ${h(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a màxim":"menys de",s=t(r.origin);if(s)return`Massa gran: s'esperava que ${r.origin??"el valor"} contingués ${i} ${r.maximum.toString()} ${s.unit??"elements"}`;return`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a mínim":"més de",s=t(r.origin);if(s)return`Massa petit: s'esperava que ${r.origin} contingués ${i} ${r.minimum.toString()} ${s.unit}`;return`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${r.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${r.origin}`;default:return"Entrada invàlida"}}};function Ma(){return{localeError:Dy()}}var Py=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(r))return"pole";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(r)=>{switch(r.code){case"invalid_type":return`Neplatný vstup: očekáváno ${r.expected}, obdrženo ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Neplatný vstup: očekáváno ${_(r.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí mít ${i}${r.maximum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí být ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí mít ${i}${r.minimum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí být ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${r.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${h(r.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${r.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${r.origin}`;default:return"Neplatný vstup"}}};function Aa(){return{localeError:Py()}}var Oy=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function n(s){return e[s]??null}function o(s){return t[s]??s}let r=(s)=>{let a=typeof s;switch(a){case"number":return Number.isNaN(s)?"NaN":"tal";case"object":{if(Array.isArray(s))return"liste";if(s===null)return"null";if(Object.getPrototypeOf(s)!==Object.prototype&&s.constructor)return s.constructor.name;return"objekt"}}return a},i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(s)=>{switch(s.code){case"invalid_type":return`Ugyldigt input: forventede ${o(s.expected)}, fik ${o(r(s.input))}`;case"invalid_value":if(s.values.length===1)return`Ugyldig værdi: forventede ${_(s.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${h(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=n(s.origin),c=o(s.origin);if(l)return`For stor: forventede ${c??"value"} ${l.verb} ${a} ${s.maximum.toString()} ${l.unit??"elementer"}`;return`For stor: forventede ${c??"value"} havde ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=n(s.origin),c=o(s.origin);if(l)return`For lille: forventede ${c} ${l.verb} ${a} ${s.minimum.toString()} ${l.unit}`;return`For lille: forventede ${c} havde ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;if(a.format==="starts_with")return`Ugyldig streng: skal starte med "${a.prefix}"`;if(a.format==="ends_with")return`Ugyldig streng: skal ende med "${a.suffix}"`;if(a.format==="includes")return`Ugyldig streng: skal indeholde "${a.includes}"`;if(a.format==="regex")return`Ugyldig streng: skal matche mønsteret ${a.pattern}`;return`Ugyldig ${i[a.format]??s.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${s.divisor}`;case"unrecognized_keys":return`${s.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${h(s.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${s.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${s.origin}`;default:return"Ugyldigt input"}}};function Na(){return{localeError:Oy()}}var Ey=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"Zahl";case"object":{if(Array.isArray(r))return"Array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(r)=>{switch(r.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${r.expected}, erhalten ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ungültige Eingabe: erwartet ${_(r.values[0])}`;return`Ungültige Option: erwartet eine von ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${s.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${s.unit} hat`;return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${h(r.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${r.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${r.origin}`;default:return"Ungültige Eingabe"}}};function ja(){return{localeError:Ey()}}var Ry=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},zy=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(o)=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${Ry(o.input)}`;case"invalid_value":if(o.values.length===1)return`Invalid input: expected ${_(o.values[0])}`;return`Invalid option: expected one of ${h(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${i.unit??"elements"}`;return`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${i.unit}`;return`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Invalid string: must start with "${r.prefix}"`;if(r.format==="ends_with")return`Invalid string: must end with "${r.suffix}"`;if(r.format==="includes")return`Invalid string: must include "${r.includes}"`;if(r.format==="regex")return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${n[r.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${h(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function hr(){return{localeError:zy()}}var Cy=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},My=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(o)=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${o.expected}, riceviĝis ${Cy(o.input)}`;case"invalid_value":if(o.values.length===1)return`Nevalida enigo: atendiĝis ${_(o.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${h(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()} ${i.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`Tro malgranda: atendiĝis ke ${o.origin} havu ${r}${o.minimum.toString()} ${i.unit}`;return`Tro malgranda: atendiĝis ke ${o.origin} estu ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${r.prefix}"`;if(r.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${r.suffix}"`;if(r.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${r.includes}"`;if(r.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`;return`Nevalida ${n[r.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} ŝlosilo${o.keys.length>1?"j":""}: ${h(o.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function Ua(){return{localeError:My()}}var Ay=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function n(s){return e[s]??null}function o(s){return t[s]??s}let r=(s)=>{let a=typeof s;switch(a){case"number":return Number.isNaN(s)?"NaN":"number";case"object":{if(Array.isArray(s))return"array";if(s===null)return"null";if(Object.getPrototypeOf(s)!==Object.prototype)return s.constructor.name;return"object"}}return a},i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(s)=>{switch(s.code){case"invalid_type":return`Entrada inválida: se esperaba ${o(s.expected)}, recibido ${o(r(s.input))}`;case"invalid_value":if(s.values.length===1)return`Entrada inválida: se esperaba ${_(s.values[0])}`;return`Opción inválida: se esperaba una de ${h(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=n(s.origin),c=o(s.origin);if(l)return`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${a}${s.maximum.toString()} ${l.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${c??"valor"} fuera ${a}${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=n(s.origin),c=o(s.origin);if(l)return`Demasiado pequeño: se esperaba que ${c} tuviera ${a}${s.minimum.toString()} ${l.unit}`;return`Demasiado pequeño: se esperaba que ${c} fuera ${a}${s.minimum.toString()}`}case"invalid_format":{let a=s;if(a.format==="starts_with")return`Cadena inválida: debe comenzar con "${a.prefix}"`;if(a.format==="ends_with")return`Cadena inválida: debe terminar en "${a.suffix}"`;if(a.format==="includes")return`Cadena inválida: debe incluir "${a.includes}"`;if(a.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${a.pattern}`;return`Inválido ${i[a.format]??s.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${s.divisor}`;case"unrecognized_keys":return`Llave${s.keys.length>1?"s":""} desconocida${s.keys.length>1?"s":""}: ${h(s.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o(s.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o(s.origin)}`;default:return"Entrada inválida"}}};function La(){return{localeError:Ay()}}var Ny=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"عدد";case"object":{if(Array.isArray(r))return"آرایه";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(r)=>{switch(r.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${r.expected} میبود، ${n(r.input)} دریافت شد`;case"invalid_value":if(r.values.length===1)return`ورودی نامعتبر: میبایست ${_(r.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${h(r.values,"|")} میبود`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} ${s.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} باشد`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} ${s.unit} باشد`;return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} باشد`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${o[i.format]??r.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${r.divisor} باشد`;case"unrecognized_keys":return`کلید${r.keys.length>1?"های":""} ناشناس: ${h(r.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${r.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${r.origin}`;default:return"ورودی نامعتبر"}}};function Fa(){return{localeError:Ny()}}var jy=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(r)=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Virheellinen syöte: täytyy olla ${_(r.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Liian suuri: ${s.subject} täytyy olla ${i}${r.maximum.toString()} ${s.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Liian pieni: ${s.subject} täytyy olla ${i}${r.minimum.toString()} ${s.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${h(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function Za(){return{localeError:jy()}}var Uy=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombre";case"object":{if(Array.isArray(r))return"tableau";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(r)=>{switch(r.code){case"invalid_type":return`Entrée invalide : ${r.expected} attendu, ${n(r.input)} reçu`;case"invalid_value":if(r.values.length===1)return`Entrée invalide : ${_(r.values[0])} attendu`;return`Option invalide : une valeur parmi ${h(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Trop grand : ${r.origin??"valeur"} doit ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"élément(s)"}`;return`Trop grand : ${r.origin??"valeur"} doit être ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Trop petit : ${r.origin} doit ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`;return`Trop petit : ${r.origin} doit être ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${h(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function Ga(){return{localeError:Uy()}}var Ly=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(r)=>{switch(r.code){case"invalid_type":return`Entrée invalide : attendu ${r.expected}, reçu ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Entrée invalide : attendu ${_(r.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"≤":"<",s=t(r.origin);if(s)return`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${s.unit}`;return`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"≥":">",s=t(r.origin);if(s)return`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${s.unit}`;return`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${h(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function Wa(){return{localeError:Ly()}}var Fy=()=>{let e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(r)=>{switch(r.code){case"invalid_type":return`קלט לא תקין: צריך ${r.expected}, התקבל ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`קלט לא תקין: צריך ${_(r.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`גדול מדי: ${r.origin??"value"} צריך להיות ${i}${r.maximum.toString()} ${s.unit??"elements"}`;return`גדול מדי: ${r.origin??"value"} צריך להיות ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`קטן מדי: ${r.origin} צריך להיות ${i}${r.minimum.toString()} ${s.unit}`;return`קטן מדי: ${r.origin} צריך להיות ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${i.prefix}"`;if(i.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${i.suffix}"`;if(i.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${i.includes}"`;if(i.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${i.pattern}`;return`${o[i.format]??r.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${r.divisor}`;case"unrecognized_keys":return`מפתח${r.keys.length>1?"ות":""} לא מזוה${r.keys.length>1?"ים":"ה"}: ${h(r.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${r.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${r.origin}`;default:return"קלט לא תקין"}}};function Ha(){return{localeError:Fy()}}var Zy=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"szám";case"object":{if(Array.isArray(r))return"tömb";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(r)=>{switch(r.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${r.expected}, a kapott érték ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Érvénytelen bemenet: a várt érték ${_(r.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Túl nagy: ${r.origin??"érték"} mérete túl nagy ${i}${r.maximum.toString()} ${s.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${r.origin??"érték"} túl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Túl kicsi: a bemeneti érték ${r.origin} mérete túl kicsi ${i}${r.minimum.toString()} ${s.unit}`;return`Túl kicsi: a bemeneti érték ${r.origin} túl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`Érvénytelen szám: ${r.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${r.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${r.origin}`;default:return"Érvénytelen bemenet"}}};function Va(){return{localeError:Zy()}}var Gy=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Input tidak valid: diharapkan ${_(r.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${s.unit}`;return`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function Ba(){return{localeError:Gy()}}var Wy=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"númer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Hy=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(o){return e[o]??null}let n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(o)=>{switch(o.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Wy(o.input)} þar sem á að vera ${o.expected}`;case"invalid_value":if(o.values.length===1)return`Rangt gildi: gert ráð fyrir ${_(o.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${h(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} hafi ${r}${o.maximum.toString()} ${i.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} sé ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`Of lítið: gert er ráð fyrir að ${o.origin} hafi ${r}${o.minimum.toString()} ${i.unit}`;return`Of lítið: gert er ráð fyrir að ${o.origin} sé ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Ógildur strengur: verður að byrja á "${r.prefix}"`;if(r.format==="ends_with")return`Ógildur strengur: verður að enda á "${r.suffix}"`;if(r.format==="includes")return`Ógildur strengur: verður að innihalda "${r.includes}"`;if(r.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${r.pattern}`;return`Rangt ${n[r.format]??o.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`Óþekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${h(o.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${o.origin}`;default:return"Rangt gildi"}}};function qa(){return{localeError:Hy()}}var Vy=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numero";case"object":{if(Array.isArray(r))return"vettore";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Input non valido: atteso ${_(r.values[0])}`;return`Opzione non valida: atteso uno tra ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${s.unit??"elementi"}`;return`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${s.unit}`;return`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${h(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function Ja(){return{localeError:Vy()}}var By=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"数値";case"object":{if(Array.isArray(r))return"配列";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(r)=>{switch(r.code){case"invalid_type":return`無効な入力: ${r.expected}が期待されましたが、${n(r.input)}が入力されました`;case"invalid_value":if(r.values.length===1)return`無効な入力: ${_(r.values[0])}が期待されました`;return`無効な選択: ${h(r.values,"、")}のいずれかである必要があります`;case"too_big":{let i=r.inclusive?"以下である":"より小さい",s=t(r.origin);if(s)return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${s.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${i}必要があります`}case"too_small":{let i=r.inclusive?"以上である":"より大きい",s=t(r.origin);if(s)return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${s.unit}${i}必要があります`;return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${o[i.format]??r.format}`}case"not_multiple_of":return`無効な数値: ${r.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${r.keys.length>1?"群":""}: ${h(r.keys,"、")}`;case"invalid_key":return`${r.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${r.origin}内の無効な値`;default:return"無効な入力"}}};function Ka(){return{localeError:By()}}var qy=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"რიცხვი";case"object":{if(Array.isArray(e))return"მასივი";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[t]??t},Jy=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(o){return e[o]??null}let n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(o)=>{switch(o.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${o.expected}, მიღებული ${qy(o.input)}`;case"invalid_value":if(o.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${_(o.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${h(o.values,"|")}-დან`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} ${i.verb} ${r}${o.maximum.toString()} ${i.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} იყოს ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} ${i.verb} ${r}${o.minimum.toString()} ${i.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} იყოს ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${r.prefix}"-ით`;if(r.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${r.suffix}"-ით`;if(r.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${r.includes}"-ს`;if(r.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${r.pattern}`;return`არასწორი ${n[r.format]??o.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${o.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${o.keys.length>1?"ები":"ი"}: ${h(o.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${o.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${o.origin}-ში`;default:return"არასწორი შეყვანა"}}};function Xa(){return{localeError:Jy()}}var Ky=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(r))return"អារេ (Array)";if(r===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(r)=>{switch(r.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${r.expected} ប៉ុន្តែទទួលបាន ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${_(r.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()} ${s.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()} ${s.unit}`;return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${o[i.format]??r.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${r.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${h(r.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function vr(){return{localeError:Ky()}}function Ya(){return vr()}var Xy=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(r)=>{switch(r.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${r.expected}, 받은 타입은 ${n(r.input)}입니다`;case"invalid_value":if(r.values.length===1)return`잘못된 입력: 값은 ${_(r.values[0])} 이어야 합니다`;return`잘못된 옵션: ${h(r.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=r.inclusive?"이하":"미만",s=i==="미만"?"이어야 합니다":"여야 합니다",a=t(r.origin),l=a?.unit??"요소";if(a)return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()}${l} ${i}${s}`;return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()} ${i}${s}`}case"too_small":{let i=r.inclusive?"이상":"초과",s=i==="이상"?"이어야 합니다":"여야 합니다",a=t(r.origin),l=a?.unit??"요소";if(a)return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()}${l} ${i}${s}`;return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${o[i.format]??r.format}`}case"not_multiple_of":return`잘못된 숫자: ${r.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${h(r.keys,", ")}`;case"invalid_key":return`잘못된 키: ${r.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${r.origin}`;default:return"잘못된 입력"}}};function Qa(){return{localeError:Xy()}}var Yy=(e)=>br(typeof e,e),br=(e,t=void 0)=>{switch(e){case"number":return Number.isNaN(t)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(t===void 0)return"nežinomas objektas";if(t===null)return"nulinė reikšmė";if(Array.isArray(t))return"masyvas";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return e},yr=(e)=>e.charAt(0).toUpperCase()+e.slice(1);function Cm(e){let t=Math.abs(e),n=t%10,o=t%100;if(o>=11&&o<=19||n===0)return"many";if(n===1)return"one";return"few"}var Qy=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(o,r,i,s){let a=e[o]??null;if(a===null)return a;return{unit:a.unit[r],verb:a.verb[s][i?"inclusive":"notInclusive"]}}let n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(o)=>{switch(o.code){case"invalid_type":return`Gautas tipas ${Yy(o.input)}, o tikėtasi - ${br(o.expected)}`;case"invalid_value":if(o.values.length===1)return`Privalo būti ${_(o.values[0])}`;return`Privalo būti vienas iš ${h(o.values,"|")} pasirinkimų`;case"too_big":{let r=br(o.origin),i=t(o.origin,Cm(Number(o.maximum)),o.inclusive??!1,"smaller");if(i?.verb)return`${yr(r??o.origin??"reikšmė")} ${i.verb} ${o.maximum.toString()} ${i.unit??"elementų"}`;let s=o.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${yr(r??o.origin??"reikšmė")} turi būti ${s} ${o.maximum.toString()} ${i?.unit}`}case"too_small":{let r=br(o.origin),i=t(o.origin,Cm(Number(o.minimum)),o.inclusive??!1,"bigger");if(i?.verb)return`${yr(r??o.origin??"reikšmė")} ${i.verb} ${o.minimum.toString()} ${i.unit??"elementų"}`;let s=o.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${yr(r??o.origin??"reikšmė")} turi būti ${s} ${o.minimum.toString()} ${i?.unit}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Eilutė privalo prasidėti "${r.prefix}"`;if(r.format==="ends_with")return`Eilutė privalo pasibaigti "${r.suffix}"`;if(r.format==="includes")return`Eilutė privalo įtraukti "${r.includes}"`;if(r.format==="regex")return`Eilutė privalo atitikti ${r.pattern}`;return`Neteisingas ${n[r.format]??o.format}`}case"not_multiple_of":return`Skaičius privalo būti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${h(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let r=br(o.origin);return`${yr(r??o.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function el(){return{localeError:Qy()}}var eb=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"број";case"object":{if(Array.isArray(r))return"низа";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(r)=>{switch(r.code){case"invalid_type":return`Грешен внес: се очекува ${r.expected}, примено ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${_(r.values[0])}`;return`Грешана опција: се очекува една ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Премногу голем: се очекува ${r.origin??"вредноста"} да има ${i}${r.maximum.toString()} ${s.unit??"елементи"}`;return`Премногу голем: се очекува ${r.origin??"вредноста"} да биде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Премногу мал: се очекува ${r.origin} да има ${i}${r.minimum.toString()} ${s.unit}`;return`Премногу мал: се очекува ${r.origin} да биде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${h(r.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${r.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${r.origin}`;default:return"Грешен внес"}}};function tl(){return{localeError:eb()}}var tb=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombor";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Input tidak sah: dijangka ${_(r.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`;return`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${h(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function rl(){return{localeError:tb()}}var rb=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"getal";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(r)=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ongeldige invoer: verwacht ${_(r.values[0])}`;return`Ongeldige optie: verwacht één van ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${s.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${s.unit} bevat`;return`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function nl(){return{localeError:rb()}}var nb=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"tall";case"object":{if(Array.isArray(r))return"liste";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ugyldig verdi: forventet ${_(r.values[0])}`;return`Ugyldig valg: forventet en av ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()} ${s.unit??"elementer"}`;return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()} ${s.unit}`;return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${h(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function ol(){return{localeError:nb()}}var ob=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numara";case"object":{if(Array.isArray(r))return"saf";if(r===null)return"gayb";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(r)=>{switch(r.code){case"invalid_type":return`Fâsit giren: umulan ${r.expected}, alınan ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Fâsit giren: umulan ${_(r.values[0])}`;return`Fâsit tercih: mûteberler ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmalıydı.`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} ${s.unit} sahip olmalıydı.`;return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${o[i.format]??r.format}`}case"not_multiple_of":return`Fâsit sayı: ${r.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`${r.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${r.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function il(){return{localeError:ob()}}var ib=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"عدد";case"object":{if(Array.isArray(r))return"ارې";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(r)=>{switch(r.code){case"invalid_type":return`ناسم ورودي: باید ${r.expected} وای, مګر ${n(r.input)} ترلاسه شو`;case"invalid_value":if(r.values.length===1)return`ناسم ورودي: باید ${_(r.values[0])} وای`;return`ناسم انتخاب: باید یو له ${h(r.values,"|")} څخه وای`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} ${s.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} وي`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} ${s.unit} ولري`;return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} وي`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${o[i.format]??r.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${r.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${r.keys.length>1?"کلیډونه":"کلیډ"}: ${h(r.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${r.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${r.origin} کې`;default:return"ناسمه ورودي"}}};function sl(){return{localeError:ib()}}var sb=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"liczba";case"object":{if(Array.isArray(r))return"tablica";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(r)=>{switch(r.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${r.expected}, otrzymano ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${_(r.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Za duża wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.maximum.toString()} ${s.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Za mała wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.minimum.toString()} ${s.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${r.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${r.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function al(){return{localeError:sb()}}var ab=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"número";case"object":{if(Array.isArray(r))return"array";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(r)=>{switch(r.code){case"invalid_type":return`Tipo inválido: esperado ${r.expected}, recebido ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Entrada inválida: esperado ${_(r.values[0])}`;return`Opção inválida: esperada uma das ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${s.unit??"elementos"}`;return`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${s.unit}`;return`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${o[i.format]??r.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Chave inválida em ${r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${r.origin}`;default:return"Campo inválido"}}};function ll(){return{localeError:ab()}}function Mm(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;if(s>=11&&s<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return n;return o}var lb=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"число";case"object":{if(Array.isArray(r))return"массив";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(r)=>{switch(r.code){case"invalid_type":return`Неверный ввод: ожидалось ${r.expected}, получено ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Неверный ввод: ожидалось ${_(r.values[0])}`;return`Неверный вариант: ожидалось одно из ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),l=Mm(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${i}${r.maximum.toString()} ${l}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),l=Mm(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${i}${r.minimum.toString()} ${l}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${o[i.format]??r.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`;default:return"Неверные входные данные"}}};function cl(){return{localeError:lb()}}var cb=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"število";case"object":{if(Array.isArray(r))return"tabela";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(r)=>{switch(r.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${r.expected}, prejeto ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Neveljaven vnos: pričakovano ${_(r.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${s.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Premajhno: pričakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${s.unit}`;return`Premajhno: pričakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i ključi":" ključ"}: ${h(r.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function ul(){return{localeError:cb()}}var ub=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"antal";case"object":{if(Array.isArray(r))return"lista";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(r)=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${r.expected}, fick ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ogiltig inmatning: förväntat ${_(r.values[0])}`;return`Ogiltigt val: förväntade en av ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`För stor(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()} ${s.unit??"element"}`;return`För stor(t): förväntat ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()} ${s.unit}`;return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${h(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${r.origin??"värdet"}`;default:return"Ogiltig input"}}};function dl(){return{localeError:ub()}}var db=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(r))return"அணி";if(r===null)return"வெறுமை";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${r.expected}, பெறப்பட்டது ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${_(r.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${h(r.values,"|")} இல் ஒன்று`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${o[i.format]??r.format}`}case"not_multiple_of":return`தவறான எண்: ${r.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${r.keys.length>1?"கள்":""}: ${h(r.keys,", ")}`;case"invalid_key":return`${r.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${r.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function ml(){return{localeError:db()}}var mb=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(r))return"อาร์เรย์ (Array)";if(r===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(r)=>{switch(r.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${r.expected} แต่ได้รับ ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${_(r.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"ไม่เกิน":"น้อยกว่า",s=t(r.origin);if(s)return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()} ${s.unit??"รายการ"}`;return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"อย่างน้อย":"มากกว่า",s=t(r.origin);if(s)return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()} ${s.unit}`;return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${o[i.format]??r.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${r.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${h(r.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${r.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${r.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function pl(){return{localeError:mb()}}var pb=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},fb=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(o){return e[o]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(o)=>{switch(o.code){case"invalid_type":return`Geçersiz değer: beklenen ${o.expected}, alınan ${pb(o.input)}`;case"invalid_value":if(o.values.length===1)return`Geçersiz değer: beklenen ${_(o.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${h(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`Çok büyük: beklenen ${o.origin??"değer"} ${r}${o.maximum.toString()} ${i.unit??"öğe"}`;return`Çok büyük: beklenen ${o.origin??"değer"} ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`Çok küçük: beklenen ${o.origin} ${r}${o.minimum.toString()} ${i.unit}`;return`Çok küçük: beklenen ${o.origin} ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Geçersiz metin: "${r.prefix}" ile başlamalı`;if(r.format==="ends_with")return`Geçersiz metin: "${r.suffix}" ile bitmeli`;if(r.format==="includes")return`Geçersiz metin: "${r.includes}" içermeli`;if(r.format==="regex")return`Geçersiz metin: ${r.pattern} desenine uymalı`;return`Geçersiz ${n[r.format]??o.format}`}case"not_multiple_of":return`Geçersiz sayı: ${o.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${o.keys.length>1?"lar":""}: ${h(o.keys,", ")}`;case"invalid_key":return`${o.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${o.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function fl(){return{localeError:fb()}}var gb=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"число";case"object":{if(Array.isArray(r))return"масив";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(r)=>{switch(r.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${r.expected}, отримано ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Неправильні вхідні дані: очікується ${_(r.values[0])}`;return`Неправильна опція: очікується одне з ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Занадто велике: очікується, що ${r.origin??"значення"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"елементів"}`;return`Занадто велике: очікується, що ${r.origin??"значення"} буде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Занадто мале: очікується, що ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`;return`Занадто мале: очікується, що ${r.origin} буде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${o[i.format]??r.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${r.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${r.keys.length>1?"і":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${r.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${r.origin}`;default:return"Неправильні вхідні дані"}}};function _r(){return{localeError:gb()}}function gl(){return _r()}var hb=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"نمبر";case"object":{if(Array.isArray(r))return"آرے";if(r===null)return"نل";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(r)=>{switch(r.code){case"invalid_type":return`غلط ان پٹ: ${r.expected} متوقع تھا، ${n(r.input)} موصول ہوا`;case"invalid_value":if(r.values.length===1)return`غلط ان پٹ: ${_(r.values[0])} متوقع تھا`;return`غلط آپشن: ${h(r.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`بہت بڑا: ${r.origin??"ویلیو"} کے ${i}${r.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${r.origin??"ویلیو"} کا ${i}${r.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`بہت چھوٹا: ${r.origin} کے ${i}${r.minimum.toString()} ${s.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${r.origin} کا ${i}${r.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${o[i.format]??r.format}`}case"not_multiple_of":return`غلط نمبر: ${r.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${r.keys.length>1?"ز":""}: ${h(r.keys,"، ")}`;case"invalid_key":return`${r.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${r.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function hl(){return{localeError:hb()}}var vb=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"số";case"object":{if(Array.isArray(r))return"mảng";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(r)=>{switch(r.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${r.expected}, nhận được ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${_(r.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"phần tử"}`;return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Quá nhỏ: mong đợi ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`;return`Quá nhỏ: mong đợi ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${o[i.format]??r.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${r.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${h(r.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${r.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${r.origin}`;default:return"Đầu vào không hợp lệ"}}};function vl(){return{localeError:vb()}}var yb=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(r))return"数组";if(r===null)return"空值(null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(r)=>{switch(r.code){case"invalid_type":return`无效输入:期望 ${r.expected},实际接收 ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`无效输入:期望 ${_(r.values[0])}`;return`无效选项:期望以下之一 ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()} ${s.unit??"个元素"}`;return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`;return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${o[i.format]??r.format}`}case"not_multiple_of":return`无效数字:必须是 ${r.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${h(r.keys,", ")}`;case"invalid_key":return`${r.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${r.origin} 中包含无效值(value)`;default:return"无效输入"}}};function yl(){return{localeError:yb()}}var bb=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(r)=>{switch(r.code){case"invalid_type":return`無效的輸入值:預期為 ${r.expected},但收到 ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`無效的輸入值:預期為 ${_(r.values[0])}`;return`無效的選項:預期為以下其中之一 ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()} ${s.unit??"個元素"}`;return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()} ${s.unit}`;return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${o[i.format]??r.format}`}case"not_multiple_of":return`無效的數字:必須為 ${r.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${r.keys.length>1?"們":""}:${h(r.keys,"、")}`;case"invalid_key":return`${r.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${r.origin} 中有無效的值`;default:return"無效的輸入值"}}};function bl(){return{localeError:bb()}}var _b=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(r))return"akopọ";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(r)=>{switch(r.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${r.expected}, àmọ̀ a rí ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${_(r.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${r.origin??"iye"} ${s.verb} ${i}${r.maximum} ${s.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Kéré ju: a ní láti jẹ́ pé ${r.origin} ${s.verb} ${i}${r.minimum} ${s.unit}`;return`Kéré ju: a ní láti jẹ́ ${i}${r.minimum}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`;if(i.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`;if(i.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`;if(i.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`;return`Aṣìṣe: ${o[i.format]??r.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${r.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${h(r.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${r.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${r.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function _l(){return{localeError:_b()}}var kl=Symbol("ZodOutput"),wl=Symbol("ZodInput");class wr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Fn(){return new wr}var Fe=Fn();function xl(e,t){return new e({type:"string",...k(t)})}function $l(e,t){return new e({type:"string",coerce:!0,...k(t)})}function Zn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...k(t)})}function xr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...k(t)})}function Gn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...k(t)})}function Wn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...k(t)})}function Hn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...k(t)})}function Vn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...k(t)})}function $r(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...k(t)})}function Bn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...k(t)})}function qn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...k(t)})}function Jn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...k(t)})}function Kn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...k(t)})}function Xn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...k(t)})}function Yn(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...k(t)})}function Qn(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...k(t)})}function eo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...k(t)})}function to(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...k(t)})}function ro(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...k(t)})}function no(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...k(t)})}function oo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...k(t)})}function io(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...k(t)})}function so(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...k(t)})}function ao(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...k(t)})}var Sl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Il(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...k(t)})}function Tl(e,t){return new e({type:"string",format:"date",check:"string_format",...k(t)})}function Dl(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...k(t)})}function Pl(e,t){return new e({type:"string",format:"duration",check:"string_format",...k(t)})}function Ol(e,t){return new e({type:"number",checks:[],...k(t)})}function El(e,t){return new e({type:"number",coerce:!0,checks:[],...k(t)})}function Rl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...k(t)})}function zl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...k(t)})}function Cl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...k(t)})}function Ml(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...k(t)})}function Al(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...k(t)})}function Nl(e,t){return new e({type:"boolean",...k(t)})}function jl(e,t){return new e({type:"boolean",coerce:!0,...k(t)})}function Ul(e,t){return new e({type:"bigint",...k(t)})}function Ll(e,t){return new e({type:"bigint",coerce:!0,...k(t)})}function Fl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...k(t)})}function Zl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...k(t)})}function Gl(e,t){return new e({type:"symbol",...k(t)})}function Wl(e,t){return new e({type:"undefined",...k(t)})}function Hl(e,t){return new e({type:"null",...k(t)})}function Vl(e){return new e({type:"any"})}function Bl(e){return new e({type:"unknown"})}function ql(e,t){return new e({type:"never",...k(t)})}function Jl(e,t){return new e({type:"void",...k(t)})}function Kl(e,t){return new e({type:"date",...k(t)})}function Xl(e,t){return new e({type:"date",coerce:!0,...k(t)})}function Yl(e,t){return new e({type:"nan",...k(t)})}function Be(e,t){return new Pn({check:"less_than",...k(t),value:e,inclusive:!1})}function Ee(e,t){return new Pn({check:"less_than",...k(t),value:e,inclusive:!0})}function qe(e,t){return new On({check:"greater_than",...k(t),value:e,inclusive:!1})}function ke(e,t){return new On({check:"greater_than",...k(t),value:e,inclusive:!0})}function Ql(e){return qe(0,e)}function ec(e){return Be(0,e)}function tc(e){return Ee(0,e)}function rc(e){return ke(0,e)}function bt(e,t){return new is({check:"multiple_of",...k(t),value:e})}function Nt(e,t){return new ls({check:"max_size",...k(t),maximum:e})}function _t(e,t){return new cs({check:"min_size",...k(t),minimum:e})}function Sr(e,t){return new us({check:"size_equals",...k(t),size:e})}function jt(e,t){return new ds({check:"max_length",...k(t),maximum:e})}function it(e,t){return new ms({check:"min_length",...k(t),minimum:e})}function Ut(e,t){return new ps({check:"length_equals",...k(t),length:e})}function Ir(e,t){return new fs({check:"string_format",format:"regex",...k(t),pattern:e})}function Tr(e){return new gs({check:"string_format",format:"lowercase",...k(e)})}function Dr(e){return new hs({check:"string_format",format:"uppercase",...k(e)})}function Pr(e,t){return new vs({check:"string_format",format:"includes",...k(t),includes:e})}function Or(e,t){return new ys({check:"string_format",format:"starts_with",...k(t),prefix:e})}function Er(e,t){return new bs({check:"string_format",format:"ends_with",...k(t),suffix:e})}function nc(e,t,n){return new _s({check:"property",property:e,schema:t,...k(n)})}function Rr(e,t){return new ks({check:"mime_type",mime:e,...k(t)})}function Je(e){return new ws({check:"overwrite",tx:e})}function zr(e){return Je((t)=>t.normalize(e))}function Cr(){return Je((e)=>e.trim())}function Mr(){return Je((e)=>e.toLowerCase())}function Ar(){return Je((e)=>e.toUpperCase())}function oc(e,t,n){return new e({type:"array",element:t,...k(n)})}function kb(e,t,n){return new e({type:"union",options:t,...k(n)})}function wb(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...k(o)})}function xb(e,t,n){return new e({type:"intersection",left:t,right:n})}function $b(e,t,n,o){let r=n instanceof P;return new e({type:"tuple",items:t,rest:r?n:null,...k(r?o:n)})}function Sb(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...k(o)})}function Ib(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...k(o)})}function Tb(e,t,n){return new e({type:"set",valueType:t,...k(n)})}function Db(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map((r)=>[r,r])):t;return new e({type:"enum",entries:o,...k(n)})}function Pb(e,t,n){return new e({type:"enum",entries:t,...k(n)})}function Ob(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...k(n)})}function ic(e,t){return new e({type:"file",...k(t)})}function Eb(e,t){return new e({type:"transform",transform:t})}function Rb(e,t){return new e({type:"optional",innerType:t})}function zb(e,t){return new e({type:"nullable",innerType:t})}function Cb(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n==="function"?n():ki(n)}})}function Mb(e,t,n){return new e({type:"nonoptional",innerType:t,...k(n)})}function Ab(e,t){return new e({type:"success",innerType:t})}function Nb(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n==="function"?n:()=>n})}function jb(e,t,n){return new e({type:"pipe",in:t,out:n})}function Ub(e,t){return new e({type:"readonly",innerType:t})}function Lb(e,t,n){return new e({type:"template_literal",parts:t,...k(n)})}function Fb(e,t){return new e({type:"lazy",getter:t})}function Zb(e,t){return new e({type:"promise",innerType:t})}function sc(e,t,n){let o=k(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function ac(e,t,n){return new e({type:"custom",check:"custom",fn:t,...k(n)})}function lc(e){let t=Am((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(Et(o,n.value,t._zod.def));else{let r=o;if(r.fatal)r.continue=!1;r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Et(r))}},e(n.value,n)));return t}function Am(e,t){let n=new Y({check:"custom",...k(t)});return n._zod.check=e,n}function cc(e,t){let n=k(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];if(n.case!=="sensitive")o=o.map((d)=>typeof d==="string"?d.toLowerCase():d),r=r.map((d)=>typeof d==="string"?d.toLowerCase():d);let i=new Set(o),s=new Set(r),a=e.Codec??gr,l=e.Boolean??fr,u=new(e.String??yt)({type:"string",error:n.error}),f=new l({type:"boolean",error:n.error}),g=new a({type:"pipe",in:u,out:f,transform:(d,y)=>{let x=d;if(n.case!=="sensitive")x=x.toLowerCase();if(i.has(x))return!0;else if(s.has(x))return!1;else return y.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:y.value,inst:g,continue:!1}),{}},reverseTransform:(d,y)=>{if(d===!0)return o[0]||"true";else return r[0]||"false"},error:n.error});return g}function Lt(e,t,n,o={}){let r=k(o),i={...k(o),check:"string_format",type:"string",format:t,fn:typeof n==="function"?n:(a)=>n.test(a),...r};if(n instanceof RegExp)i.pattern=n;return new e(i)}class lo{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??Fe,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let o=e._zod.def,r={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i){if(i.count++,t.schemaPath.includes(e))i.cycle=t.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)s.ref=f,this.process(f,u),this.seen.get(f).isParent=!0;else{let g=s.schema;switch(o.type){case"string":{let d=g;d.type="string";let{minimum:y,maximum:x,format:z,patterns:N,contentEncoding:J}=e._zod.bag;if(typeof y==="number")d.minLength=y;if(typeof x==="number")d.maxLength=x;if(z){if(d.format=r[z]??z,d.format==="")delete d.format}if(J)d.contentEncoding=J;if(N&&N.size>0){let G=[...N];if(G.length===1)d.pattern=G[0].source;else if(G.length>1)s.schema.allOf=[...G.map((ae)=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:ae.source}))]}break}case"number":{let d=g,{minimum:y,maximum:x,format:z,multipleOf:N,exclusiveMaximum:J,exclusiveMinimum:G}=e._zod.bag;if(typeof z==="string"&&z.includes("int"))d.type="integer";else d.type="number";if(typeof G==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")d.minimum=G,d.exclusiveMinimum=!0;else d.exclusiveMinimum=G;if(typeof y==="number"){if(d.minimum=y,typeof G==="number"&&this.target!=="draft-4")if(G>=y)delete d.minimum;else delete d.exclusiveMinimum}if(typeof J==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")d.maximum=J,d.exclusiveMaximum=!0;else d.exclusiveMaximum=J;if(typeof x==="number"){if(d.maximum=x,typeof J==="number"&&this.target!=="draft-4")if(J<=x)delete d.maximum;else delete d.exclusiveMaximum}if(typeof N==="number")d.multipleOf=N;break}case"boolean":{let d=g;d.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{if(this.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{g.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let d=g,{minimum:y,maximum:x}=e._zod.bag;if(typeof y==="number")d.minItems=y;if(typeof x==="number")d.maxItems=x;d.type="array",d.items=this.process(o.element,{...u,path:[...u.path,"items"]});break}case"object":{let d=g;d.type="object",d.properties={};let y=o.shape;for(let N in y)d.properties[N]=this.process(y[N],{...u,path:[...u.path,"properties",N]});let x=new Set(Object.keys(y)),z=new Set([...x].filter((N)=>{let J=o.shape[N]._zod;if(this.io==="input")return J.optin===void 0;else return J.optout===void 0}));if(z.size>0)d.required=Array.from(z);if(o.catchall?._zod.def.type==="never")d.additionalProperties=!1;else if(!o.catchall){if(this.io==="output")d.additionalProperties=!1}else if(o.catchall)d.additionalProperties=this.process(o.catchall,{...u,path:[...u.path,"additionalProperties"]});break}case"union":{let d=g,y=o.options.map((x,z)=>this.process(x,{...u,path:[...u.path,"anyOf",z]}));d.anyOf=y;break}case"intersection":{let d=g,y=this.process(o.left,{...u,path:[...u.path,"allOf",0]}),x=this.process(o.right,{...u,path:[...u.path,"allOf",1]}),z=(J)=>("allOf"in J)&&Object.keys(J).length===1,N=[...z(y)?y.allOf:[y],...z(x)?x.allOf:[x]];d.allOf=N;break}case"tuple":{let d=g;d.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",x=this.target==="draft-2020-12"?"items":this.target==="openapi-3.0"?"items":"additionalItems",z=o.items.map((ae,Pe)=>this.process(ae,{...u,path:[...u.path,y,Pe]})),N=o.rest?this.process(o.rest,{...u,path:[...u.path,x,...this.target==="openapi-3.0"?[o.items.length]:[]]}):null;if(this.target==="draft-2020-12"){if(d.prefixItems=z,N)d.items=N}else if(this.target==="openapi-3.0"){if(d.items={anyOf:z},N)d.items.anyOf.push(N);if(d.minItems=z.length,!N)d.maxItems=z.length}else if(d.items=z,N)d.additionalItems=N;let{minimum:J,maximum:G}=e._zod.bag;if(typeof J==="number")d.minItems=J;if(typeof G==="number")d.maxItems=G;break}case"record":{let d=g;if(d.type="object",this.target==="draft-7"||this.target==="draft-2020-12")d.propertyNames=this.process(o.keyType,{...u,path:[...u.path,"propertyNames"]});d.additionalProperties=this.process(o.valueType,{...u,path:[...u.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let d=g,y=or(o.entries);if(y.every((x)=>typeof x==="number"))d.type="number";if(y.every((x)=>typeof x==="string"))d.type="string";d.enum=y;break}case"literal":{let d=g,y=[];for(let x of o.values)if(x===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else y.push(Number(x));else y.push(x);if(y.length===0);else if(y.length===1){let x=y[0];if(d.type=x===null?"null":typeof x,this.target==="draft-4"||this.target==="openapi-3.0")d.enum=[x];else d.const=x}else{if(y.every((x)=>typeof x==="number"))d.type="number";if(y.every((x)=>typeof x==="string"))d.type="string";if(y.every((x)=>typeof x==="boolean"))d.type="string";if(y.every((x)=>x===null))d.type="null";d.enum=y}break}case"file":{let d=g,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:z,mime:N}=e._zod.bag;if(x!==void 0)y.minLength=x;if(z!==void 0)y.maxLength=z;if(N)if(N.length===1)y.contentMediaType=N[0],Object.assign(d,y);else d.anyOf=N.map((J)=>({...y,contentMediaType:J}));else Object.assign(d,y);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let d=this.process(o.innerType,u);if(this.target==="openapi-3.0")s.ref=o.innerType,g.nullable=!0;else g.anyOf=[d,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,u),s.ref=o.innerType;break}case"success":{let d=g;d.type="boolean";break}case"default":{this.process(o.innerType,u),s.ref=o.innerType,g.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{if(this.process(o.innerType,u),s.ref=o.innerType,this.io==="input")g._prefault=JSON.parse(JSON.stringify(o.defaultValue));break}case"catch":{this.process(o.innerType,u),s.ref=o.innerType;let d;try{d=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=d;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let d=g,y=e._zod.pattern;if(!y)throw Error("Pattern not found in template literal");d.type="string",d.pattern=y.source;break}case"pipe":{let d=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(d,u),s.ref=d;break}case"readonly":{this.process(o.innerType,u),s.ref=o.innerType,g.readOnly=!0;break}case"promise":{this.process(o.innerType,u),s.ref=o.innerType;break}case"optional":{this.process(o.innerType,u),s.ref=o.innerType;break}case"lazy":{let d=e._zod.innerType;this.process(d,u),s.ref=d;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema");break}default:}}}let l=this.metadataRegistry.get(e);if(l)Object.assign(s.schema,l);if(this.io==="input"&&le(e))delete s.schema.examples,delete s.schema.default;if(this.io==="input"&&s.schema._prefault)(n=s.schema).default??(n.default=s.schema._prefault);return delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let r=(c)=>{let u=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(c[0])?.id,x=n.external.uri??((N)=>N);if(y)return{ref:x(y)};let z=c[1].defId??c[1].schema.id??`schema${this.counter++}`;return c[1].defId=z,{defId:z,ref:`${x("__shared")}#/${u}/${z}`}}if(c[1]===o)return{ref:"#"};let g=`${"#"}/${u}/`,d=c[1].schema.id??`__schema${this.counter++}`;return{defId:d,ref:g+d}},i=(c)=>{if(c[1].schema.$ref)return;let u=c[1],{ref:f,defId:g}=r(c);if(u.def={...u.schema},g)u.defId=g;let d=u.schema;for(let y in d)delete d[y];d.$ref=f};if(n.cycles==="throw")for(let c of this.seen.entries()){let u=c[1];if(u.cycle)throw Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
191
|
-
|
|
192
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of this.seen.entries()){let u=c[1];if(e===c[0]){i(c);continue}if(n.external){let g=n.external.registry.get(c[0])?.id;if(e!==c[0]&&g){i(c);continue}}if(this.metadataRegistry.get(c[0])?.id){i(c);continue}if(u.cycle){i(c);continue}if(u.count>1){if(n.reused==="ref"){i(c);continue}}}let s=(c,u)=>{let f=this.seen.get(c),g=f.def??f.schema,d={...g};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){s(y,u);let x=this.seen.get(y).schema;if(x.$ref&&(u.target==="draft-7"||u.target==="draft-4"||u.target==="openapi-3.0"))g.allOf=g.allOf??[],g.allOf.push(x);else Object.assign(g,x),Object.assign(g,d)}if(!f.isParent)this.override({zodSchema:c,jsonSchema:g,path:f.path??[]})};for(let c of[...this.seen.entries()].reverse())s(c[0],{target:this.target});let a={};if(this.target==="draft-2020-12")a.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")a.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")a.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(n.external?.uri){let c=n.external.registry.get(e)?.id;if(!c)throw Error("Schema is missing an `id` property");a.$id=n.external.uri(c)}Object.assign(a,o.def);let l=n.external?.defs??{};for(let c of this.seen.entries()){let u=c[1];if(u.def&&u.defId)l[u.defId]=u.def}if(n.external);else if(Object.keys(l).length>0)if(this.target==="draft-2020-12")a.$defs=l;else a.definitions=l;try{return JSON.parse(JSON.stringify(a))}catch(c){throw Error("Error converting schema to JSON.")}}}function uc(e,t){if(e instanceof wr){let o=new lo(t),r={};for(let a of e._idmap.entries()){let[l,c]=a;o.process(c)}let i={},s={registry:e,uri:t?.uri,defs:r};for(let a of e._idmap.entries()){let[l,c]=a;i[l]=o.emit(c,{...t,external:s})}if(Object.keys(r).length>0){let a=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:r}}return{schemas:i}}let n=new lo(t);return n.process(e),n.emit(e,t)}function le(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return le(r.element,n);case"object":{for(let i in r.shape)if(le(r.shape[i],n))return!0;return!1}case"union":{for(let i of r.options)if(le(i,n))return!0;return!1}case"intersection":return le(r.left,n)||le(r.right,n);case"tuple":{for(let i of r.items)if(le(i,n))return!0;if(r.rest&&le(r.rest,n))return!0;return!1}case"record":return le(r.keyType,n)||le(r.valueType,n);case"map":return le(r.keyType,n)||le(r.valueType,n);case"set":return le(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return le(r.innerType,n);case"lazy":return le(r.getter(),n);case"default":return le(r.innerType,n);case"prefault":return le(r.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return le(r.in,n)||le(r.out,n);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw Error(`Unknown schema type: ${r.type}`)}var Nm={};var fo={};ye(fo,{ZodISODate:()=>uo,ZodISODateTime:()=>co,ZodISODuration:()=>po,ZodISOTime:()=>mo,date:()=>mc,datetime:()=>dc,duration:()=>fc,time:()=>pc});var co=m("ZodISODateTime",(e,t)=>{As.init(e,t),K.init(e,t)});function dc(e){return Il(co,e)}var uo=m("ZodISODate",(e,t)=>{Ns.init(e,t),K.init(e,t)});function mc(e){return Tl(uo,e)}var mo=m("ZodISOTime",(e,t)=>{js.init(e,t),K.init(e,t)});function pc(e){return Dl(mo,e)}var po=m("ZodISODuration",(e,t)=>{Us.init(e,t),K.init(e,t)});function fc(e){return Pl(po,e)}var Um=(e,t)=>{cr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>dr(e,n)},flatten:{value:(n)=>ur(e,n)},addIssue:{value:(n)=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Pt,2)}},addIssues:{value:(n)=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Pt,2)}},isEmpty:{get(){return e.issues.length===0}}})},Wb=m("ZodError",Um),we=m("ZodError",Um,{Parent:Error});var gc=Rt(we),hc=zt(we),vc=Ct(we),yc=Mt(we),bc=_n(we),_c=kn(we),kc=wn(we),wc=xn(we),xc=$n(we),$c=Sn(we),Sc=In(we),Ic=Tn(we);var E=m("ZodType",(e,t)=>(P.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((o)=>typeof o==="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>he(e,n,o),e.brand=()=>e,e.register=(n,o)=>(n.add(e,o),e),e.parse=(n,o)=>gc(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>vc(e,n,o),e.parseAsync=async(n,o)=>hc(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>yc(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>bc(e,n,o),e.decode=(n,o)=>_c(e,n,o),e.encodeAsync=async(n,o)=>kc(e,n,o),e.decodeAsync=async(n,o)=>wc(e,n,o),e.safeEncode=(n,o)=>xc(e,n,o),e.safeDecode=(n,o)=>$c(e,n,o),e.safeEncodeAsync=async(n,o)=>Sc(e,n,o),e.safeDecodeAsync=async(n,o)=>Ic(e,n,o),e.refine=(n,o)=>e.check(Sp(n,o)),e.superRefine=(n)=>e.check(Ip(n)),e.overwrite=(n)=>e.check(Je(n)),e.optional=()=>ho(e),e.nullable=()=>vo(e),e.nullish=()=>ho(vo(e)),e.nonoptional=(n)=>pp(e,n),e.array=()=>ko(e),e.or=(n)=>Jc([e,n]),e.and=(n)=>Qm(e,n),e.transform=(n)=>yo(e,Yc(n)),e.default=(n)=>up(e,n),e.prefault=(n)=>mp(e,n),e.catch=(n)=>hp(e,n),e.pipe=(n)=>yo(e,n),e.readonly=()=>bp(e),e.describe=(n)=>{let o=e.clone();return Fe.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return Fe.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Fe.get(e);let o=e.clone();return Fe.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Pc=m("_ZodString",(e,t)=>{yt.init(e,t),E.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Ir(...o)),e.includes=(...o)=>e.check(Pr(...o)),e.startsWith=(...o)=>e.check(Or(...o)),e.endsWith=(...o)=>e.check(Er(...o)),e.min=(...o)=>e.check(it(...o)),e.max=(...o)=>e.check(jt(...o)),e.length=(...o)=>e.check(Ut(...o)),e.nonempty=(...o)=>e.check(it(1,...o)),e.lowercase=(o)=>e.check(Tr(o)),e.uppercase=(o)=>e.check(Dr(o)),e.trim=()=>e.check(Cr()),e.normalize=(...o)=>e.check(zr(...o)),e.toLowerCase=()=>e.check(Mr()),e.toUpperCase=()=>e.check(Ar())}),jr=m("ZodString",(e,t)=>{yt.init(e,t),Pc.init(e,t),e.email=(n)=>e.check(Zn(Oc,n)),e.url=(n)=>e.check($r(bo,n)),e.jwt=(n)=>e.check(ao(Hc,n)),e.emoji=(n)=>e.check(Bn(Ec,n)),e.guid=(n)=>e.check(xr(go,n)),e.uuid=(n)=>e.check(Gn(Xe,n)),e.uuidv4=(n)=>e.check(Wn(Xe,n)),e.uuidv6=(n)=>e.check(Hn(Xe,n)),e.uuidv7=(n)=>e.check(Vn(Xe,n)),e.nanoid=(n)=>e.check(qn(Rc,n)),e.guid=(n)=>e.check(xr(go,n)),e.cuid=(n)=>e.check(Jn(zc,n)),e.cuid2=(n)=>e.check(Kn(Cc,n)),e.ulid=(n)=>e.check(Xn(Mc,n)),e.base64=(n)=>e.check(oo(Zc,n)),e.base64url=(n)=>e.check(io(Gc,n)),e.xid=(n)=>e.check(Yn(Ac,n)),e.ksuid=(n)=>e.check(Qn(Nc,n)),e.ipv4=(n)=>e.check(eo(jc,n)),e.ipv6=(n)=>e.check(to(Uc,n)),e.cidrv4=(n)=>e.check(ro(Lc,n)),e.cidrv6=(n)=>e.check(no(Fc,n)),e.e164=(n)=>e.check(so(Wc,n)),e.datetime=(n)=>e.check(dc(n)),e.date=(n)=>e.check(mc(n)),e.time=(n)=>e.check(pc(n)),e.duration=(n)=>e.check(fc(n))});function Tc(e){return xl(jr,e)}var K=m("ZodStringFormat",(e,t)=>{q.init(e,t),Pc.init(e,t)}),Oc=m("ZodEmail",(e,t)=>{Ts.init(e,t),K.init(e,t)});function Vb(e){return Zn(Oc,e)}var go=m("ZodGUID",(e,t)=>{Ss.init(e,t),K.init(e,t)});function Bb(e){return xr(go,e)}var Xe=m("ZodUUID",(e,t)=>{Is.init(e,t),K.init(e,t)});function qb(e){return Gn(Xe,e)}function Jb(e){return Wn(Xe,e)}function Kb(e){return Hn(Xe,e)}function Xb(e){return Vn(Xe,e)}var bo=m("ZodURL",(e,t)=>{Ds.init(e,t),K.init(e,t)});function Yb(e){return $r(bo,e)}function Qb(e){return $r(bo,{protocol:/^https?$/,hostname:Oe.domain,...b.normalizeParams(e)})}var Ec=m("ZodEmoji",(e,t)=>{Ps.init(e,t),K.init(e,t)});function e_(e){return Bn(Ec,e)}var Rc=m("ZodNanoID",(e,t)=>{Os.init(e,t),K.init(e,t)});function t_(e){return qn(Rc,e)}var zc=m("ZodCUID",(e,t)=>{Es.init(e,t),K.init(e,t)});function r_(e){return Jn(zc,e)}var Cc=m("ZodCUID2",(e,t)=>{Rs.init(e,t),K.init(e,t)});function n_(e){return Kn(Cc,e)}var Mc=m("ZodULID",(e,t)=>{zs.init(e,t),K.init(e,t)});function o_(e){return Xn(Mc,e)}var Ac=m("ZodXID",(e,t)=>{Cs.init(e,t),K.init(e,t)});function i_(e){return Yn(Ac,e)}var Nc=m("ZodKSUID",(e,t)=>{Ms.init(e,t),K.init(e,t)});function s_(e){return Qn(Nc,e)}var jc=m("ZodIPv4",(e,t)=>{Ls.init(e,t),K.init(e,t)});function a_(e){return eo(jc,e)}var Uc=m("ZodIPv6",(e,t)=>{Fs.init(e,t),K.init(e,t)});function l_(e){return to(Uc,e)}var Lc=m("ZodCIDRv4",(e,t)=>{Zs.init(e,t),K.init(e,t)});function c_(e){return ro(Lc,e)}var Fc=m("ZodCIDRv6",(e,t)=>{Gs.init(e,t),K.init(e,t)});function u_(e){return no(Fc,e)}var Zc=m("ZodBase64",(e,t)=>{Hs.init(e,t),K.init(e,t)});function d_(e){return oo(Zc,e)}var Gc=m("ZodBase64URL",(e,t)=>{Vs.init(e,t),K.init(e,t)});function m_(e){return io(Gc,e)}var Wc=m("ZodE164",(e,t)=>{Bs.init(e,t),K.init(e,t)});function p_(e){return so(Wc,e)}var Hc=m("ZodJWT",(e,t)=>{qs.init(e,t),K.init(e,t)});function f_(e){return ao(Hc,e)}var Ur=m("ZodCustomStringFormat",(e,t)=>{Js.init(e,t),K.init(e,t)});function g_(e,t,n={}){return Lt(Ur,e,t,n)}function h_(e){return Lt(Ur,"hostname",Oe.hostname,e)}function v_(e){return Lt(Ur,"hex",Oe.hex,e)}function y_(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=Oe[o];if(!r)throw Error(`Unrecognized hash format: ${o}`);return Lt(Ur,o,r,t)}var Lr=m("ZodNumber",(e,t)=>{Nn.init(e,t),E.init(e,t),e.gt=(o,r)=>e.check(qe(o,r)),e.gte=(o,r)=>e.check(ke(o,r)),e.min=(o,r)=>e.check(ke(o,r)),e.lt=(o,r)=>e.check(Be(o,r)),e.lte=(o,r)=>e.check(Ee(o,r)),e.max=(o,r)=>e.check(Ee(o,r)),e.int=(o)=>e.check(Dc(o)),e.safe=(o)=>e.check(Dc(o)),e.positive=(o)=>e.check(qe(0,o)),e.nonnegative=(o)=>e.check(ke(0,o)),e.negative=(o)=>e.check(Be(0,o)),e.nonpositive=(o)=>e.check(Ee(0,o)),e.multipleOf=(o,r)=>e.check(bt(o,r)),e.step=(o,r)=>e.check(bt(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),e.isFinite=!0,e.format=n.format??null});function Lm(e){return Ol(Lr,e)}var Zt=m("ZodNumberFormat",(e,t)=>{Ks.init(e,t),Lr.init(e,t)});function Dc(e){return Rl(Zt,e)}function b_(e){return zl(Zt,e)}function __(e){return Cl(Zt,e)}function k_(e){return Ml(Zt,e)}function w_(e){return Al(Zt,e)}var Fr=m("ZodBoolean",(e,t)=>{fr.init(e,t),E.init(e,t)});function Fm(e){return Nl(Fr,e)}var Zr=m("ZodBigInt",(e,t)=>{jn.init(e,t),E.init(e,t),e.gte=(o,r)=>e.check(ke(o,r)),e.min=(o,r)=>e.check(ke(o,r)),e.gt=(o,r)=>e.check(qe(o,r)),e.gte=(o,r)=>e.check(ke(o,r)),e.min=(o,r)=>e.check(ke(o,r)),e.lt=(o,r)=>e.check(Be(o,r)),e.lte=(o,r)=>e.check(Ee(o,r)),e.max=(o,r)=>e.check(Ee(o,r)),e.positive=(o)=>e.check(qe(BigInt(0),o)),e.negative=(o)=>e.check(Be(BigInt(0),o)),e.nonpositive=(o)=>e.check(Ee(BigInt(0),o)),e.nonnegative=(o)=>e.check(ke(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(bt(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function x_(e){return Ul(Zr,e)}var Vc=m("ZodBigIntFormat",(e,t)=>{Xs.init(e,t),Zr.init(e,t)});function $_(e){return Fl(Vc,e)}function S_(e){return Zl(Vc,e)}var Zm=m("ZodSymbol",(e,t)=>{Ys.init(e,t),E.init(e,t)});function I_(e){return Gl(Zm,e)}var Gm=m("ZodUndefined",(e,t)=>{Qs.init(e,t),E.init(e,t)});function T_(e){return Wl(Gm,e)}var Wm=m("ZodNull",(e,t)=>{ea.init(e,t),E.init(e,t)});function Hm(e){return Hl(Wm,e)}var Vm=m("ZodAny",(e,t)=>{ta.init(e,t),E.init(e,t)});function D_(){return Vl(Vm)}var Bm=m("ZodUnknown",(e,t)=>{ra.init(e,t),E.init(e,t)});function Ft(){return Bl(Bm)}var qm=m("ZodNever",(e,t)=>{na.init(e,t),E.init(e,t)});function Bc(e){return ql(qm,e)}var Jm=m("ZodVoid",(e,t)=>{oa.init(e,t),E.init(e,t)});function P_(e){return Jl(Jm,e)}var _o=m("ZodDate",(e,t)=>{ia.init(e,t),E.init(e,t),e.min=(o,r)=>e.check(ke(o,r)),e.max=(o,r)=>e.check(Ee(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function O_(e){return Kl(_o,e)}var Km=m("ZodArray",(e,t)=>{sa.init(e,t),E.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(it(n,o)),e.nonempty=(n)=>e.check(it(1,n)),e.max=(n,o)=>e.check(jt(n,o)),e.length=(n,o)=>e.check(Ut(n,o)),e.unwrap=()=>e.element});function ko(e,t){return oc(Km,e,t)}function E_(e){let t=e._zod.def.shape;return Xc(Object.keys(t))}var wo=m("ZodObject",(e,t)=>{aa.init(e,t),E.init(e,t),b.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Xc(Object.keys(e._zod.def.shape)),e.catchall=(n)=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ft()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ft()}),e.strict=()=>e.clone({...e._zod.def,catchall:Bc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(n)=>b.extend(e,n),e.safeExtend=(n)=>b.safeExtend(e,n),e.merge=(n)=>b.merge(e,n),e.pick=(n)=>b.pick(e,n),e.omit=(n)=>b.omit(e,n),e.partial=(...n)=>b.partial(Qc,e,n[0]),e.required=(...n)=>b.required(eu,e,n[0])});function R_(e,t){let n={type:"object",get shape(){return b.assignProp(this,"shape",e?b.objectClone(e):{}),this.shape},...b.normalizeParams(t)};return new wo(n)}function z_(e,t){return new wo({type:"object",get shape(){return b.assignProp(this,"shape",b.objectClone(e)),this.shape},catchall:Bc(),...b.normalizeParams(t)})}function C_(e,t){return new wo({type:"object",get shape(){return b.assignProp(this,"shape",b.objectClone(e)),this.shape},catchall:Ft(),...b.normalizeParams(t)})}var qc=m("ZodUnion",(e,t)=>{Un.init(e,t),E.init(e,t),e.options=t.options});function Jc(e,t){return new qc({type:"union",options:e,...b.normalizeParams(t)})}var Xm=m("ZodDiscriminatedUnion",(e,t)=>{qc.init(e,t),la.init(e,t)});function M_(e,t,n){return new Xm({type:"union",options:t,discriminator:e,...b.normalizeParams(n)})}var Ym=m("ZodIntersection",(e,t)=>{ca.init(e,t),E.init(e,t)});function Qm(e,t){return new Ym({type:"intersection",left:e,right:t})}var ep=m("ZodTuple",(e,t)=>{Ln.init(e,t),E.init(e,t),e.rest=(n)=>e.clone({...e._zod.def,rest:n})});function tp(e,t,n){let o=t instanceof P,r=o?n:t;return new ep({type:"tuple",items:e,rest:o?t:null,...b.normalizeParams(r)})}var Kc=m("ZodRecord",(e,t)=>{ua.init(e,t),E.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function rp(e,t,n){return new Kc({type:"record",keyType:e,valueType:t,...b.normalizeParams(n)})}function A_(e,t,n){let o=he(e);return o._zod.values=void 0,new Kc({type:"record",keyType:o,valueType:t,...b.normalizeParams(n)})}var np=m("ZodMap",(e,t)=>{da.init(e,t),E.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function N_(e,t,n){return new np({type:"map",keyType:e,valueType:t,...b.normalizeParams(n)})}var op=m("ZodSet",(e,t)=>{ma.init(e,t),E.init(e,t),e.min=(...n)=>e.check(_t(...n)),e.nonempty=(n)=>e.check(_t(1,n)),e.max=(...n)=>e.check(Nt(...n)),e.size=(...n)=>e.check(Sr(...n))});function j_(e,t){return new op({type:"set",valueType:e,...b.normalizeParams(t)})}var Nr=m("ZodEnum",(e,t)=>{pa.init(e,t),E.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let s of o)if(n.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Nr({...t,checks:[],...b.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let s of o)if(n.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Nr({...t,checks:[],...b.normalizeParams(r),entries:i})}});function Xc(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new Nr({type:"enum",entries:n,...b.normalizeParams(t)})}function U_(e,t){return new Nr({type:"enum",entries:e,...b.normalizeParams(t)})}var ip=m("ZodLiteral",(e,t)=>{fa.init(e,t),E.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function L_(e,t){return new ip({type:"literal",values:Array.isArray(e)?e:[e],...b.normalizeParams(t)})}var sp=m("ZodFile",(e,t)=>{ga.init(e,t),E.init(e,t),e.min=(n,o)=>e.check(_t(n,o)),e.max=(n,o)=>e.check(Nt(n,o)),e.mime=(n,o)=>e.check(Rr(Array.isArray(n)?n:[n],o))});function F_(e){return ic(sp,e)}var ap=m("ZodTransform",(e,t)=>{ha.init(e,t),E.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new gt(e.constructor.name);n.addIssue=(i)=>{if(typeof i==="string")n.issues.push(b.issue(i,n.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(b.issue(s))}};let r=t.transform(n.value,n);if(r instanceof Promise)return r.then((i)=>(n.value=i,n));return n.value=r,n}});function Yc(e){return new ap({type:"transform",transform:e})}var Qc=m("ZodOptional",(e,t)=>{va.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ho(e){return new Qc({type:"optional",innerType:e})}var lp=m("ZodNullable",(e,t)=>{ya.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.innerType});function vo(e){return new lp({type:"nullable",innerType:e})}function Z_(e){return ho(vo(e))}var cp=m("ZodDefault",(e,t)=>{ba.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function up(e,t){return new cp({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():b.shallowClone(t)}})}var dp=m("ZodPrefault",(e,t)=>{_a.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.innerType});function mp(e,t){return new dp({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():b.shallowClone(t)}})}var eu=m("ZodNonOptional",(e,t)=>{ka.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pp(e,t){return new eu({type:"nonoptional",innerType:e,...b.normalizeParams(t)})}var fp=m("ZodSuccess",(e,t)=>{wa.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.innerType});function G_(e){return new fp({type:"success",innerType:e})}var gp=m("ZodCatch",(e,t)=>{xa.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function hp(e,t){return new gp({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var vp=m("ZodNaN",(e,t)=>{$a.init(e,t),E.init(e,t)});function W_(e){return Yl(vp,e)}var tu=m("ZodPipe",(e,t)=>{Sa.init(e,t),E.init(e,t),e.in=t.in,e.out=t.out});function yo(e,t){return new tu({type:"pipe",in:e,out:t})}var ru=m("ZodCodec",(e,t)=>{tu.init(e,t),gr.init(e,t)});function H_(e,t,n){return new ru({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}var yp=m("ZodReadonly",(e,t)=>{Ia.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.innerType});function bp(e){return new yp({type:"readonly",innerType:e})}var _p=m("ZodTemplateLiteral",(e,t)=>{Ta.init(e,t),E.init(e,t)});function V_(e,t){return new _p({type:"template_literal",parts:e,...b.normalizeParams(t)})}var kp=m("ZodLazy",(e,t)=>{Oa.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.getter()});function wp(e){return new kp({type:"lazy",getter:e})}var xp=m("ZodPromise",(e,t)=>{Pa.init(e,t),E.init(e,t),e.unwrap=()=>e._zod.def.innerType});function B_(e){return new xp({type:"promise",innerType:e})}var $p=m("ZodFunction",(e,t)=>{Da.init(e,t),E.init(e,t)});function q_(e){return new $p({type:"function",input:Array.isArray(e?.input)?tp(e?.input):e?.input??ko(Ft()),output:e?.output??Ft()})}var xo=m("ZodCustom",(e,t)=>{Ea.init(e,t),E.init(e,t)});function J_(e){let t=new Y({check:"custom"});return t._zod.check=e,t}function K_(e,t){return sc(xo,e??(()=>!0),t)}function Sp(e,t={}){return ac(xo,e,t)}function Ip(e){return lc(e)}function X_(e,t={error:`Input not instance of ${e.name}`}){let n=new xo({type:"custom",check:"custom",fn:(o)=>o instanceof e,abort:!0,...b.normalizeParams(t)});return n._zod.bag.Class=e,n}var Y_=(...e)=>cc({Codec:ru,Boolean:Fr,String:jr},...e);function Q_(e){let t=wp(()=>Jc([Tc(e),Lm(),Fm(),Hm(),ko(t),rp(Tc(),t)]));return t}function ek(e,t){return yo(Yc(e),t)}var tk={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function rk(e){ie({customError:e})}function nk(){return ie().customError}var nu;(function(e){})(nu||(nu={}));var ou={};ye(ou,{bigint:()=>ak,boolean:()=>sk,date:()=>lk,number:()=>ik,string:()=>ok});function ok(e){return $l(jr,e)}function ik(e){return El(Lr,e)}function sk(e){return jl(Fr,e)}function ak(e){return Ll(Zr,e)}function lk(e){return Xl(_o,e)}ie(hr());function O(e){return e}O.schema=$o;import{readFileSync as $k}from"node:fs";import{dirname as Sk,join as Ik}from"node:path";import{fileURLToPath as Tk}from"node:url";import{renameSync as ck,writeFileSync as uk,readFileSync as YI,existsSync as iu,statSync as dk}from"node:fs";import{dirname as mk}from"node:path";import{mkdirSync as pk}from"node:fs";function So(e,t){let n=mk(t);if(!iu(n))pk(n,{recursive:!0});let o=`${t}.tmp`;uk(o,JSON.stringify(e,null,2),"utf8"),ck(o,t)}function fk(e){let t=0;if(iu(e))try{t=dk(e).size}catch{}let n=0;for(let o=1;o<=10;o++)if(iu(`${e}.${o}`))n=o;else break;return{path:e,sizeBytes:t,rotatedFiles:n}}function Io(e){let t=e.snapshot.counters,n=t.orchestrator_errors?.count??0,o=(t.decisions_skipped_continue?.count??0)+(t.decisions_skipped_no_decision?.count??0)+(t.decisions_skipped_no_message?.count??0)+(t.decisions_skipped_below_threshold?.count??0);return{version:e.version,status:n?"degraded":"healthy",enabled:e.enabled,startedAtISO:e.snapshot.startedAtISO,uptimeMs:e.snapshot.uptimeMs,metrics:{decisionsTaken:t.decisions_taken?.count??0,decisionsStored:t.decisions_stored?.count??0,interventionsDelivered:t.interventions_delivered?.count??0,orchestratorRuns:t.orchestrator_runs?.count??0,orchestratorErrors:n,materializationFailures:t.materialization_failures?.count??0,tier3RemindersSent:t.tier3_reminders_sent?.count??0,tier3SkillsCreated:t.tier3_skills_created?.count??0,lastDecisionISO:t.decisions_taken?.lastOccurrenceISO??null,lastInterventionISO:t.interventions_delivered?.lastOccurrenceISO??null},logFile:fk(e.logFilePath),session:{id:e.sessionID,toolCallsObserved:t.tool_calls_observed?.count??0,violationsDetected:t.protocol_violations_detected?.count??0,interventionsSkipped:o,firstSeenISO:e.snapshot.startedAtISO,lastSeenISO:new Date().toISOString()},graphSync:{lastUpgradeAtISO:null,lastUpgradeResult:"unknown",lastUpgradeTarget:null,lastUpgradeMs:null},graphToolsUsed:{omo_search:0,omo_recall:0,omo_health:0,omo_find:0,omo_impact:0,omo_remember:0,omo_recall_mcp:0,omo_path:0,omo_explain:0,omo_files:0,omo_callers:0,omo_node:0,omo_context:0,omo_affected_cg:0,omo_status:0,omo_unlock:0,omo_mark_dirty:0,omo_sync_if_dirty:0,omo_index:0,omo_visualize:0,omo_serve:0,omo_uninit:0,omo_diagnose:0,omo_merge_graphs:0,omo_save_result:0,omo_extract:0,omo_cluster_only:0,omo_label:0,omo_tree:0,omo_clone:0,omo_add:0,omo_check_update:0,omo_hook_status:0,omo_cli_anything_install:0,omo_cli_anything_list:0,omo_cli_anything_search:0,omo_cli_anything_info:0}}}function Tp(e,t,n=Date.now){let o=-1/0;return{write(r){let i=n();if(i-o<t)return;o=i,e(r)}}}nn();import{statSync as Pp,existsSync as i0}from"node:fs";import{join as au}from"node:path";class Dp{client=null;defaultTimeoutMs;toolCache=null;constructor(e={}){this.defaultTimeoutMs=e.defaultTimeoutMs??5000}setClient(e){this.client=e,this.toolCache=null}isReady(){return this.client!==null}async callTool(e,t={},n){let o=Date.now(),r=n??this.defaultTimeoutMs;if(!this.client)return{data:null,timedOut:!1,durationMs:Date.now()-o,error:"MCP client not initialized"};try{let s=(await this.raceWithTimeout(this.client.tool.invoke({toolID:e,input:t}),r,e)).data;return{data:s&&typeof s==="object"&&!Array.isArray(s)?s:null,timedOut:!1,durationMs:Date.now()-o,error:null}}catch(i){return{data:null,timedOut:i instanceof Error&&/timed out/i.test(i.message),durationMs:Date.now()-o,error:i instanceof Error?i.message:String(i)}}}async isAvailable(e){if(!this.client)return!1;if(this.toolCache===null)try{let t=await this.client.tool.list();this.toolCache=new Set((t.data??[]).map((n)=>n.id))}catch{this.toolCache=new Set}return this.toolCache.has(e)}async availableTools(){if(!this.client)return[];if(this.toolCache===null)await this.isAvailable("__bootstrap__");return Array.from(this.toolCache??new Set)}invalidateCache(){this.toolCache=null}raceWithTimeout(e,t,n){return new Promise((o,r)=>{let i=setTimeout(()=>{r(Error(`${n} timed out after ${t}ms`))},t);e.then((s)=>{clearTimeout(i),o(s)},(s)=>{clearTimeout(i),r(s)})})}}var su=null;function Gr(){if(!su)su=new Dp;return su}function gk(e,t,n,o){let r=t&&n;if(e==="codegraph")return t?{kind:"codegraph",cmd:"codegraph",args:[]}:null;if(e==="graphify")return n?{kind:"graphify",cmd:"graphify",args:[]}:null;if(e==="alternate"&&r)return(o??"").trim().toLowerCase().split("").reduce((a,l)=>a+l.charCodeAt(0),0)%2===0?{kind:"codegraph",cmd:"codegraph",args:[]}:{kind:"graphify",cmd:"graphify",args:[]};if(t)return{kind:"codegraph",cmd:"codegraph",args:[]};if(n)return{kind:"graphify",cmd:"graphify",args:[]};return null}function Op(e){let t=e.trim().toLowerCase(),n=2166136261;for(let o=0;o<t.length;o++)n^=t.charCodeAt(o),n=n*16777619>>>0;return n.toString(16)}class Ep{timeoutMs;cacheTtlMs;maxEntriesPerSession;cache=new Map;preferredTool;mcpTimeoutMs;preferredMcpServer;constructor(e={}){this.timeoutMs=e.timeoutMs??5000,this.cacheTtlMs=e.cacheTtlMs??300000,this.maxEntriesPerSession=e.maxEntriesPerSession??10,this.preferredTool=e.preferredTool??"auto",this.mcpTimeoutMs=e.mcpTimeoutMs??5000,this.preferredMcpServer=e.preferredMcpServer??"auto"}setPreferredTool(e){this.preferredTool=e}hasCodegraphDir(e){try{return Pp(au(e,".codegraph")).isDirectory()}catch{return!1}}hasGraphifyDir(e){try{return Pp(au(e,"graphify-out")).isDirectory()}catch{return!1}}cacheContext(e,t,n){let o=this.cache.get(e);if(!o)o={entries:new Map},this.cache.set(e,o);let r=Op(t);o.entries.set(r,{query:t,content:n,insertedAtMs:Date.now()});while(o.entries.size>this.maxEntriesPerSession){let i=o.entries.keys().next().value;if(!i)break;o.entries.delete(i)}}getCachedContext(e,t){let n=this.cache.get(e);if(!n)return null;if(t){let r=Op(t),i=n.entries.get(r);if(!i)return null;if(Date.now()-i.insertedAtMs>this.cacheTtlMs)return n.entries.delete(r),null;return i.content}let o=null;for(let r of n.entries.values())if(Date.now()-r.insertedAtMs<=this.cacheTtlMs)o=r.content;return o}clear(){this.cache.clear()}clearSession(e){this.cache.delete(e)}kindForServer(e){if(e==="codegraph")return"codegraph";if(e==="graphify")return"graphify";return null}async isMcpServerAvailable(e,t){try{let n=Gr();if(!n.isReady())return!1;return t?await n.isAvailable(t):!0}catch{return!1}}async detectMcpServers(){let[e,t]=await Promise.all([this.isMcpServerAvailable("codegraph","codegraph_search"),this.isMcpServerAvailable("graphify","query_graph")]);return{codegraph:e,graphify:t}}async invokeMCP(e,t,n,o){let r=Date.now();try{let s=await Gr().callTool(t,n,o.timeoutMs);if(s.error||s.data===null)return{kind:this.kindForServer(e),query:o.queryLabel,result:null,timedOut:s.timedOut,durationMs:Date.now()-r};let l=s.data.content,c=null;if(Array.isArray(l)&&l.length>0){let u=l[0];if(typeof u.text==="string")c=u.text}return{kind:this.kindForServer(e),query:o.queryLabel,result:c||null,timedOut:!1,durationMs:Date.now()-r}}catch{return{kind:this.kindForServer(e),query:o?.queryLabel??t,result:null,timedOut:!1,durationMs:Date.now()-r}}}async invoke(e,t,n={}){let o=Date.now(),r=n.timeoutMs??this.timeoutMs,i=this.hasCodegraphDir(e),s=this.hasGraphifyDir(e),a=n.preferredTool??this.preferredTool,l=gk(a,i,s,t);if(n.forceSubprocess!==!0&&l){let g=(n.preferredMcpServer??"auto")==="auto"?l.kind==="codegraph"?"codegraph":"graphify":n.preferredMcpServer;if(g!==null&&await this.isMcpServerAvailable(g)){let d=l.kind==="codegraph"?"codegraph_search":"query_graph",y=l.kind==="codegraph"?{query:t,projectPath:e}:{question:t,project_path:e};return{...await this.invokeMCP(g,d,y,{timeoutMs:r,queryLabel:t}),kind:l.kind}}}let c=null,u=null,f=[];if(l)if(c=l.kind,c==="codegraph")u=n.codegraphBin??"codegraph",f=["explore",t,"--project-path",e];else u=n.graphifyBin??"graphify",f=["query",t,"--graph",au(e,"graphify-out")];if(!u||!c)return{kind:null,query:t,result:null,timedOut:!1,durationMs:Date.now()-o};try{let g=await this.spawnWithTimeout(u,f,r,e);return{kind:c,query:t,result:g.trim()||null,timedOut:!1,durationMs:Date.now()-o}}catch(g){let d=g instanceof Error&&g.message.includes("timed out");return{kind:c,query:t,result:null,timedOut:d,durationMs:Date.now()-o}}}spawnWithTimeout(e,t,n,o){return rn(e,t,{cwd:o,timeoutMs:n}).then((r)=>{if(r.timedOut)throw Error(`graph retrieval subprocess timed out after ${n}ms`);if(r.code===null)throw Error(`graph retrieval subprocess failed to spawn: ${e}`);if(r.code!==0)throw Error(`graph retrieval subprocess exited ${r.code}: ${r.stderr.slice(0,200)}`);return r.stdout})}async invokeNode(e,t,n={}){return this.invokeCodegraphSubcommand("node",e,t,n)}async invokeCallers(e,t,n={}){return this.invokeCodegraphSubcommand("callers",e,t,n)}async invokeImpact(e,t,n={}){return this.invokeCodegraphSubcommand("impact",e,t,n)}async invokeFiles(e,t={}){return this.invokeCodegraphSubcommand("files",void 0,e,t)}async invokeContext(e,t,n={}){return this.invokeCodegraphSubcommand("context",e,t,n)}async invokeAffected(e,t,n={}){return this.invokeCodegraphSubcommand("affected",e,t,n)}async invokeStatus(e,t={}){return this.invokeCodegraphSubcommand("status",void 0,e,t)}async invokeUnlock(e,t={}){return this.invokeCodegraphSubcommand("unlock",void 0,e,t)}async invokeMarkDirty(e,t={}){return this.invokeCodegraphSubcommand("mark-dirty",void 0,e,t)}async invokeSyncIfDirty(e,t={}){return this.invokeCodegraphSubcommand("sync-if-dirty",void 0,e,t)}async invokeIndex(e,t={}){return this.invokeCodegraphSubcommand("index",void 0,e,t)}async invokeVisualize(e,t={}){return this.invokeCodegraphSubcommand("visualize",void 0,e,t)}async invokeServe(e,t,n={}){return this.invokeCodegraphSubcommand("serve",String(e),t,n)}async invokeUninit(e,t={}){return this.invokeCodegraphSubcommand("uninit",void 0,e,t)}async invokeCodegraphSubcommand(e,t,n,o){let r=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasCodegraphDir(n))return{kind:null,query:t===void 0?e:Array.isArray(t)?t.join(","):t,result:null,timedOut:!1,durationMs:Date.now()-r};let s=o.codegraphBin??"codegraph",a=t===void 0?[]:Array.isArray(t)?t:[t],l=[e,...a,"--project-path",n],c=t===void 0?e:Array.isArray(t)?t.join(","):t;try{let u=await this.spawnWithTimeout(s,l,i,n);return{kind:"codegraph",query:c,result:u.trim()||null,timedOut:!1,durationMs:Date.now()-r}}catch(u){let f=u instanceof Error&&/timed out/i.test(u.message);return{kind:"codegraph",query:c,result:null,timedOut:f,durationMs:Date.now()-r}}}async invokePath(e,t,n,o={}){let r=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(n))return{kind:null,query:`${e} ${t}`,result:null,timedOut:!1,durationMs:Date.now()-r};let s=o.graphifyBin??"graphify",a=["path",e,t];try{let l=await this.spawnWithTimeout(s,a,i,n);return{kind:"graphify",query:`${e} ${t}`,result:l.trim()||null,timedOut:!1,durationMs:Date.now()-r}}catch(l){return{kind:"graphify",query:`${e} ${t}`,result:null,timedOut:l instanceof Error&&/timed out/i.test(l.message),durationMs:Date.now()-r}}}async invokeExplain(e,t,n={}){return this.invokeGraphifySubcommand("explain",e,t,n)}async invokeGraphifySubcommand(e,t,n,o){let r=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(n))return{kind:null,query:t??e,result:null,timedOut:!1,durationMs:Date.now()-r};let s=o.graphifyBin??"graphify",a=t===void 0?[e]:[e,t];try{let l=await this.spawnWithTimeout(s,a,i,n);return{kind:"graphify",query:t??e,result:l.trim()||null,timedOut:!1,durationMs:Date.now()-r}}catch(l){return{kind:"graphify",query:t??e,result:null,timedOut:l instanceof Error&&/timed out/i.test(l.message),durationMs:Date.now()-r}}}async invokeDiagnose(e,t={}){return this.invokeGraphifySubcommand("diagnose",void 0,e,t)}async invokeMergeDriver(e,t={}){return this.invokeGraphifySubcommand("merge-driver",void 0,e,t)}async invokeSaveResult(e,t={}){return this.invokeGraphifySubcommand("save-result",void 0,e,t)}async invokeExtract(e,t={}){return this.invokeGraphifySubcommand("extract",void 0,e,t)}async invokeClusterOnly(e,t={}){return this.invokeGraphifySubcommand("cluster-only",void 0,e,t)}async invokeLabel(e,t,n={}){return this.invokeGraphifySubcommand("label",e,t,n)}async invokeTree(e,t={}){return this.invokeGraphifySubcommand("tree",void 0,e,t)}async invokeClone(e,t={}){return this.invokeGraphifySubcommand("clone",void 0,e,t)}async invokeAdd(e,t,n={}){return this.invokeGraphifySubcommand("add",e,t,n)}async invokeCheckUpdate(e,t={}){return this.invokeGraphifySubcommand("check-update",void 0,e,t)}}var lu=null;function F(){if(!lu)lu=new Ep;return lu}function Rp(e){let t=F();if(e.preferredTool)t.setPreferredTool(e.preferredTool)}var hk=F();class Mp{retrieval;constructor(e=hk){this.retrieval=e}async find(e,t,n=5000){let o=Date.now(),r=await this.retrieval.invokeNode(e,t,{timeoutMs:n});if(r.kind==="codegraph"&&r.result)return vk(e,r.result,o,"codegraph");let i=await this.retrieval.invoke(t,e,{timeoutMs:n});if(i.kind==="graphify"&&i.result)return yk(e,i.result,o,"graphify");return{symbol:e,source:null,callers:[],found:!1,kind:r.kind??i.kind,durationMs:Date.now()-o}}async impact(e,t,n=5000){let o=Date.now(),r=await this.retrieval.invokeImpact(e,t,{timeoutMs:n});if(r.kind==="codegraph"&&r.result)return bk(e,r.result,o,"codegraph",r.timedOut);let i=await this.retrieval.invokeCallers(e,t,{timeoutMs:n});if(i.kind==="codegraph"&&i.result)return{symbol:e,directCallers:To(i.result),transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:new Set(To(i.result).map((s)=>s.file)).size,kind:"codegraph",durationMs:Date.now()-o,timedOut:i.timedOut};return{symbol:e,directCallers:[],transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:0,kind:r.kind??i.kind,durationMs:Date.now()-o,timedOut:r.timedOut||i.timedOut}}async listFiles(e,t=5000){let n=Date.now(),o=await this.retrieval.invokeFiles(e,{timeoutMs:t});if(o.kind==="codegraph"&&o.result){let r=o.result.split(`
|
|
193
|
-
`).map((i)=>i.trim()).filter(Boolean);return{files:r,count:r.length,kind:"codegraph",durationMs:Date.now()-n}}return{files:[],count:0,kind:o.kind,durationMs:Date.now()-n}}}function vk(e,t,n,o){let r=
|
|
194
|
-
`);for(let o of n){let r=o.match(/^\s*[-*]?\s*([^\s:]+\.[a-z]+):(\d+)(?:[:\s—–-]+(.+))?/i);if(r){let i=r[1]??"",s=r[2]?parseInt(r[2],10):0,a=(r[3]??"").trim();if(i&&s>0)t.push({file:i,line:s,context:a})}}return t}function
|
|
195
|
-
`),o=!1,r=[];for(let i of n){if(t.test(i)){o=!0;continue}if(o){if(/^#\s/.test(i)&&!t.test(i))break;if(i.trim()===""&&r.length>0)break;r.push(i)}}return
|
|
196
|
-
`))}function
|
|
197
|
-
`),o=!1,r=[];for(let i of n){if(t.test(i)){o=!0;continue}if(o){if(/^#\s/.test(i)&&!t.test(i))break;if(i.trim()===""&&r.length>0)break;let s=i.trim().replace(/^[-*]\s*/,"");if(s.match(/[^\s:]+\.[a-z]+/i))r.push(s)}}return r}var
|
|
190
|
+
`)}d.write("payload.value = newResult;"),d.write("return payload;");let K=d.compile();return(W,ae)=>K(g,W,ae)},i,s=yt,a=!nr.jitless,c=a&&wi.value,u=t.catchall,f;e._zod.parse=(g,d)=>{f??(f=o.value);let y=g.value;if(!s(y))return g.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),g;if(a&&c&&d?.async===!1&&d.jitless!==!0){if(!i)i=r(t.shape);if(g=i(g,d),!u)return g;return Rm([],y,g,d,f,e)}return n(g,d)}});function _m(e,t,n,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter((i)=>!st(i));if(r.length===1)return t.value=r[0].value,r[0];return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((i)=>i.issues.map((s)=>Te(s,o,ie())))}),t}var Ln=m("$ZodUnion",(e,t)=>{P.init(e,t),A(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),A(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),A(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),A(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((i)=>i._zod.pattern);return new RegExp(`^(${r.map((i)=>sr(i.source)).join("|")})$`)}return});let n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let s=!1,a=[];for(let l of t.options){let c=l._zod.run({value:r.value,issues:[]},i);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}if(!s)return _m(a,r,e,i);return Promise.all(a).then((l)=>_m(l,r,e,i))}}),ua=m("$ZodDiscriminatedUnion",(e,t)=>{Ln.init(e,t);let n=e._zod.parse;A(e._zod,"propValues",()=>{let r={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,l]of Object.entries(s)){if(!r[a])r[a]=new Set;for(let c of l)r[a].add(c)}}return r});let o=Et(()=>{let r=t.options,i=new Map;for(let s of r){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let l of a){if(i.has(l))throw Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(r,i)=>{let s=r.value;if(!yt(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let a=o.value.get(s?.[t.discriminator]);if(a)return a._zod.run(r,i);if(t.unionFallback)return n(r,i);return r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),r}}),da=m("$ZodIntersection",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),s=t.right._zod.run({value:r,issues:[]},o);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([l,c])=>km(n,l,c));return km(n,i,s)}});function Is(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(it(e)&&it(t)){let n=Object.keys(t),o=Object.keys(e).filter((i)=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let s=Is(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r[i]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],s=Is(r,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function km(e,t,n){if(t.issues.length)e.issues.push(...t.issues);if(n.issues.length)e.issues.push(...n.issues);if(st(e))return e;let o=Is(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Fn=m("$ZodTuple",(e,t)=>{P.init(e,t);let n=t.items,o=n.length-[...n].reverse().findIndex((r)=>r._zod.optin!=="optional");e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let a=[];if(!t.rest){let c=s.length>n.length,u=s.length<o-1;if(c||u)return r.issues.push({...c?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:s,inst:e,origin:"array"}),r}let l=-1;for(let c of n){if(l++,l>=s.length){if(l>=o)continue}let u=c._zod.run({value:s[l],issues:[]},i);if(u instanceof Promise)a.push(u.then((f)=>zn(f,r,l)));else zn(u,r,l)}if(t.rest){let c=s.slice(n.length);for(let u of c){l++;let f=t.rest._zod.run({value:u,issues:[]},i);if(f instanceof Promise)a.push(f.then((g)=>zn(g,r,l)));else zn(f,r,l)}}if(a.length)return Promise.all(a).then(()=>r);return r}});function zn(e,t,n){if(e.issues.length)t.issues.push(...Ie(n,e.issues));t.value[n]=e.value}var ma=m("$ZodRecord",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!it(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;n.value={};for(let l of s)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){let c=t.valueType._zod.run({value:r[l],issues:[]},o);if(c instanceof Promise)i.push(c.then((u)=>{if(u.issues.length)n.issues.push(...Ie(l,u.issues));n.value[l]=u.value}));else{if(c.issues.length)n.issues.push(...Ie(l,c.issues));n.value[l]=c.value}}let a;for(let l in r)if(!s.has(l))a=a??[],a.push(l);if(a&&a.length>0)n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:a})}else{n.value={};for(let s of Reflect.ownKeys(r)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},o);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map((c)=>Te(c,o,ie())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}let l=t.valueType._zod.run({value:r[s],issues:[]},o);if(l instanceof Promise)i.push(l.then((c)=>{if(c.issues.length)n.issues.push(...Ie(s,c.issues));n.value[a.value]=c.value}));else{if(l.issues.length)n.issues.push(...Ie(s,l.issues));n.value[a.value]=l.value}}}if(i.length)return Promise.all(i).then(()=>n);return n}}),pa=m("$ZodMap",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[s,a]of r){let l=t.keyType._zod.run({value:s,issues:[]},o),c=t.valueType._zod.run({value:a,issues:[]},o);if(l instanceof Promise||c instanceof Promise)i.push(Promise.all([l,c]).then(([u,f])=>{wm(u,f,n,s,r,e,o)}));else wm(l,c,n,s,r,e,o)}if(i.length)return Promise.all(i).then(()=>n);return n}});function wm(e,t,n,o,r,i,s){if(e.issues.length)if(ar.has(typeof o))n.issues.push(...Ie(o,e.issues));else n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map((a)=>Te(a,s,ie()))});if(t.issues.length)if(ar.has(typeof o))n.issues.push(...Ie(o,t.issues));else n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map((a)=>Te(a,s,ie()))});n.value.set(e.value,t.value)}var fa=m("$ZodSet",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let s of r){let a=t.valueType._zod.run({value:s,issues:[]},o);if(a instanceof Promise)i.push(a.then((l)=>xm(l,n)));else xm(a,n)}if(i.length)return Promise.all(i).then(()=>n);return n}});function xm(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}var ga=m("$ZodEnum",(e,t)=>{P.init(e,t);let n=ir(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter((r)=>ar.has(typeof r)).map((r)=>typeof r==="string"?Fe(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let s=r.value;if(o.has(s))return r;return r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),ha=m("$ZodLiteral",(e,t)=>{if(P.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((n)=>typeof n==="string"?Fe(n):n?Fe(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let r=n.value;if(e._zod.values.has(r))return n;return n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}}),va=m("$ZodFile",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(r instanceof File)return n;return n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),ya=m("$ZodTransform",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new vt(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then((s)=>(n.value=s,n));if(r instanceof Promise)throw new Le;return n.value=r,n}});function $m(e,t){if(e.issues.length&&t===void 0)return{issues:[],value:void 0};return e}var ba=m("$ZodOptional",(e,t)=>{P.init(e,t),e._zod.optin="optional",e._zod.optout="optional",A(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),A(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${sr(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>$m(i,n.value));return $m(r,n.value)}if(n.value===void 0)return n;return t.innerType._zod.run(n,o)}}),_a=m("$ZodNullable",(e,t)=>{P.init(e,t),A(e._zod,"optin",()=>t.innerType._zod.optin),A(e._zod,"optout",()=>t.innerType._zod.optout),A(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${sr(n.source)}|null)$`):void 0}),A(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>{if(n.value===null)return n;return t.innerType._zod.run(n,o)}}),ka=m("$ZodDefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>Sm(i,t));return Sm(r,t)}});function Sm(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var wa=m("$ZodPrefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)n.value=t.defaultValue;return t.innerType._zod.run(n,o)}}),xa=m("$ZodNonOptional",(e,t)=>{P.init(e,t),A(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>Im(i,e));return Im(r,e)}});function Im(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var $a=m("$ZodSuccess",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new vt("ZodSuccess");let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>(n.value=i.issues.length===0,n));return n.value=r.issues.length===0,n}}),Sa=m("$ZodCatch",(e,t)=>{P.init(e,t),A(e._zod,"optin",()=>t.innerType._zod.optin),A(e._zod,"optout",()=>t.innerType._zod.optout),A(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>{if(n.value=i.value,i.issues.length)n.value=t.catchValue({...n,error:{issues:i.issues.map((s)=>Te(s,o,ie()))},input:n.value}),n.issues=[];return n});if(n.value=r.value,r.issues.length)n.value=t.catchValue({...n,error:{issues:r.issues.map((i)=>Te(i,o,ie()))},input:n.value}),n.issues=[];return n}}),Ia=m("$ZodNaN",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>{if(typeof n.value!=="number"||!Number.isNaN(n.value))return n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n;return n}}),Ta=m("$ZodPipe",(e,t)=>{P.init(e,t),A(e._zod,"values",()=>t.in._zod.values),A(e._zod,"optin",()=>t.in._zod.optin),A(e._zod,"optout",()=>t.out._zod.optout),A(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(n,o);if(i instanceof Promise)return i.then((s)=>Cn(s,t.in,o));return Cn(i,t.in,o)}let r=t.in._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>Cn(i,t.out,o));return Cn(r,t.out,o)}});function Cn(e,t,n){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},n)}var hr=m("$ZodCodec",(e,t)=>{P.init(e,t),A(e._zod,"values",()=>t.in._zod.values),A(e._zod,"optin",()=>t.in._zod.optin),A(e._zod,"optout",()=>t.out._zod.optout),A(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(n,o);if(i instanceof Promise)return i.then((s)=>Mn(s,t,o));return Mn(i,t,o)}else{let i=t.out._zod.run(n,o);if(i instanceof Promise)return i.then((s)=>Mn(s,t,o));return Mn(i,t,o)}}});function Mn(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);if(r instanceof Promise)return r.then((i)=>An(e,i,t.out,n));return An(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);if(r instanceof Promise)return r.then((i)=>An(e,i,t.in,n));return An(e,r,t.in,n)}}function An(e,t,n,o){if(e.issues.length)return e.aborted=!0,e;return n._zod.run({value:t,issues:e.issues},o)}var Da=m("$ZodReadonly",(e,t)=>{P.init(e,t),A(e._zod,"propValues",()=>t.innerType._zod.propValues),A(e._zod,"values",()=>t.innerType._zod.values),A(e._zod,"optin",()=>t.innerType._zod.optin),A(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then(Tm);return Tm(r)}});function Tm(e){return e.value=Object.freeze(e.value),e}var Pa=m("$ZodTemplateLiteral",(e,t)=>{P.init(e,t);let n=[];for(let o of t.parts)if(typeof o==="object"&&o!==null){if(!o._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,s))}else if(o===null||$i.has(typeof o))n.push(Fe(`${o}`));else throw Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>{if(typeof o.value!=="string")return o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(o.value))return o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o;return o}}),Oa=m("$ZodFunction",(e,t)=>(P.init(e,t),e._def=t,e._zod.def=t,e.implement=(n)=>{if(typeof n!=="function")throw Error("implement() must be called with a function");return function(...o){let r=e._def.input?bn(e._def.input,o):o,i=Reflect.apply(n,this,r);if(e._def.output)return bn(e._def.output,i);return i}},e.implementAsync=(n)=>{if(typeof n!=="function")throw Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await _n(e._def.input,o):o,i=await Reflect.apply(n,this,r);if(e._def.output)return await _n(e._def.output,i);return i}},e._zod.parse=(n,o)=>{if(typeof n.value!=="function")return n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n;if(e._def.output&&e._def.output._zod.def.type==="promise")n.value=e.implementAsync(n.value);else n.value=e.implement(n.value);return n},e.input=(...n)=>{let o=e.constructor;if(Array.isArray(n[0]))return new o({type:"function",input:new Fn({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output});return new o({type:"function",input:n[0],output:e._def.output})},e.output=(n)=>new e.constructor({type:"function",input:e._def.input,output:n}),e)),Ea=m("$ZodPromise",(e,t)=>{P.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then((r)=>t.innerType._zod.run({value:r,issues:[]},o))}),Ra=m("$ZodLazy",(e,t)=>{P.init(e,t),A(e._zod,"innerType",()=>t.getter()),A(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),A(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),A(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),A(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),za=m("$ZodCustom",(e,t)=>{Y.init(e,t),P.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=(n)=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then((i)=>Dm(i,n,o,e));Dm(r,n,o,e);return}});function Dm(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)r.params=o._zod.def.params;t.issues.push(Rt(r))}}var wr={};ye(wr,{ar:()=>Ca,az:()=>Ma,be:()=>Aa,ca:()=>Na,cs:()=>ja,da:()=>Ua,de:()=>La,en:()=>vr,eo:()=>Fa,es:()=>Za,fa:()=>Ga,fi:()=>Wa,fr:()=>Ha,frCA:()=>Va,he:()=>Ba,hu:()=>qa,id:()=>Ja,is:()=>Ka,it:()=>Xa,ja:()=>Ya,ka:()=>Qa,kh:()=>el,km:()=>yr,ko:()=>tl,lt:()=>rl,mk:()=>nl,ms:()=>ol,nl:()=>il,no:()=>sl,ota:()=>al,pl:()=>cl,ps:()=>ll,pt:()=>ul,ru:()=>dl,sl:()=>ml,sv:()=>pl,ta:()=>fl,th:()=>gl,tr:()=>hl,ua:()=>vl,uk:()=>kr,ur:()=>yl,vi:()=>bl,yo:()=>wl,zhCN:()=>_l,zhTW:()=>kl});var Sy=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(r)=>{switch(r.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${r.expected}، ولكن تم إدخال ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${_(r.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return` أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()} ${s.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()} ${s.unit}`;return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${r.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${o[i.format]??r.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${r.divisor}`;case"unrecognized_keys":return`معرف${r.keys.length>1?"ات":""} غريب${r.keys.length>1?"ة":""}: ${h(r.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${r.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${r.origin}`;default:return"مدخل غير مقبول"}}};function Ca(){return{localeError:Sy()}}var Iy=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${r.expected}, daxil olan ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Yanlış dəyər: gözlənilən ${_(r.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()} ${s.unit??"element"}`;return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`;return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanlış ədəd: ${r.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${r.keys.length>1?"lar":""}: ${h(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${r.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Ma(){return{localeError:Iy()}}function Cm(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;if(s>=11&&s<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return n;return o}var Ty=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"лік";case"object":{if(Array.isArray(r))return"масіў";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(r)=>{switch(r.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${r.expected}, атрымана ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Няправільны ўвод: чакалася ${_(r.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),l=Cm(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${s.verb} ${i}${r.maximum.toString()} ${l}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),l=Cm(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${s.verb} ${i}${r.minimum.toString()} ${l}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${o[i.format]??r.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${h(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`;default:return"Няправільны ўвод"}}};function Aa(){return{localeError:Ty()}}var Dy=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(r)=>{switch(r.code){case"invalid_type":return`Tipus invàlid: s'esperava ${r.expected}, s'ha rebut ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Valor invàlid: s'esperava ${_(r.values[0])}`;return`Opció invàlida: s'esperava una de ${h(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a màxim":"menys de",s=t(r.origin);if(s)return`Massa gran: s'esperava que ${r.origin??"el valor"} contingués ${i} ${r.maximum.toString()} ${s.unit??"elements"}`;return`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a mínim":"més de",s=t(r.origin);if(s)return`Massa petit: s'esperava que ${r.origin} contingués ${i} ${r.minimum.toString()} ${s.unit}`;return`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${r.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${r.origin}`;default:return"Entrada invàlida"}}};function Na(){return{localeError:Dy()}}var Py=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(r))return"pole";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(r)=>{switch(r.code){case"invalid_type":return`Neplatný vstup: očekáváno ${r.expected}, obdrženo ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Neplatný vstup: očekáváno ${_(r.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí mít ${i}${r.maximum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí být ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí mít ${i}${r.minimum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí být ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${r.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${h(r.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${r.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${r.origin}`;default:return"Neplatný vstup"}}};function ja(){return{localeError:Py()}}var Oy=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function n(s){return e[s]??null}function o(s){return t[s]??s}let r=(s)=>{let a=typeof s;switch(a){case"number":return Number.isNaN(s)?"NaN":"tal";case"object":{if(Array.isArray(s))return"liste";if(s===null)return"null";if(Object.getPrototypeOf(s)!==Object.prototype&&s.constructor)return s.constructor.name;return"objekt"}}return a},i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(s)=>{switch(s.code){case"invalid_type":return`Ugyldigt input: forventede ${o(s.expected)}, fik ${o(r(s.input))}`;case"invalid_value":if(s.values.length===1)return`Ugyldig værdi: forventede ${_(s.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${h(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=n(s.origin),c=o(s.origin);if(l)return`For stor: forventede ${c??"value"} ${l.verb} ${a} ${s.maximum.toString()} ${l.unit??"elementer"}`;return`For stor: forventede ${c??"value"} havde ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=n(s.origin),c=o(s.origin);if(l)return`For lille: forventede ${c} ${l.verb} ${a} ${s.minimum.toString()} ${l.unit}`;return`For lille: forventede ${c} havde ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;if(a.format==="starts_with")return`Ugyldig streng: skal starte med "${a.prefix}"`;if(a.format==="ends_with")return`Ugyldig streng: skal ende med "${a.suffix}"`;if(a.format==="includes")return`Ugyldig streng: skal indeholde "${a.includes}"`;if(a.format==="regex")return`Ugyldig streng: skal matche mønsteret ${a.pattern}`;return`Ugyldig ${i[a.format]??s.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${s.divisor}`;case"unrecognized_keys":return`${s.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${h(s.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${s.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${s.origin}`;default:return"Ugyldigt input"}}};function Ua(){return{localeError:Oy()}}var Ey=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"Zahl";case"object":{if(Array.isArray(r))return"Array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(r)=>{switch(r.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${r.expected}, erhalten ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ungültige Eingabe: erwartet ${_(r.values[0])}`;return`Ungültige Option: erwartet eine von ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${s.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${s.unit} hat`;return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${h(r.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${r.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${r.origin}`;default:return"Ungültige Eingabe"}}};function La(){return{localeError:Ey()}}var Ry=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},zy=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(o)=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${Ry(o.input)}`;case"invalid_value":if(o.values.length===1)return`Invalid input: expected ${_(o.values[0])}`;return`Invalid option: expected one of ${h(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${i.unit??"elements"}`;return`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${i.unit}`;return`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Invalid string: must start with "${r.prefix}"`;if(r.format==="ends_with")return`Invalid string: must end with "${r.suffix}"`;if(r.format==="includes")return`Invalid string: must include "${r.includes}"`;if(r.format==="regex")return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${n[r.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${h(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function vr(){return{localeError:zy()}}var Cy=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},My=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(o)=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${o.expected}, riceviĝis ${Cy(o.input)}`;case"invalid_value":if(o.values.length===1)return`Nevalida enigo: atendiĝis ${_(o.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${h(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()} ${i.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`Tro malgranda: atendiĝis ke ${o.origin} havu ${r}${o.minimum.toString()} ${i.unit}`;return`Tro malgranda: atendiĝis ke ${o.origin} estu ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${r.prefix}"`;if(r.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${r.suffix}"`;if(r.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${r.includes}"`;if(r.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`;return`Nevalida ${n[r.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} ŝlosilo${o.keys.length>1?"j":""}: ${h(o.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function Fa(){return{localeError:My()}}var Ay=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function n(s){return e[s]??null}function o(s){return t[s]??s}let r=(s)=>{let a=typeof s;switch(a){case"number":return Number.isNaN(s)?"NaN":"number";case"object":{if(Array.isArray(s))return"array";if(s===null)return"null";if(Object.getPrototypeOf(s)!==Object.prototype)return s.constructor.name;return"object"}}return a},i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(s)=>{switch(s.code){case"invalid_type":return`Entrada inválida: se esperaba ${o(s.expected)}, recibido ${o(r(s.input))}`;case"invalid_value":if(s.values.length===1)return`Entrada inválida: se esperaba ${_(s.values[0])}`;return`Opción inválida: se esperaba una de ${h(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=n(s.origin),c=o(s.origin);if(l)return`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${a}${s.maximum.toString()} ${l.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${c??"valor"} fuera ${a}${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=n(s.origin),c=o(s.origin);if(l)return`Demasiado pequeño: se esperaba que ${c} tuviera ${a}${s.minimum.toString()} ${l.unit}`;return`Demasiado pequeño: se esperaba que ${c} fuera ${a}${s.minimum.toString()}`}case"invalid_format":{let a=s;if(a.format==="starts_with")return`Cadena inválida: debe comenzar con "${a.prefix}"`;if(a.format==="ends_with")return`Cadena inválida: debe terminar en "${a.suffix}"`;if(a.format==="includes")return`Cadena inválida: debe incluir "${a.includes}"`;if(a.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${a.pattern}`;return`Inválido ${i[a.format]??s.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${s.divisor}`;case"unrecognized_keys":return`Llave${s.keys.length>1?"s":""} desconocida${s.keys.length>1?"s":""}: ${h(s.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o(s.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o(s.origin)}`;default:return"Entrada inválida"}}};function Za(){return{localeError:Ay()}}var Ny=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"عدد";case"object":{if(Array.isArray(r))return"آرایه";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(r)=>{switch(r.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${r.expected} میبود، ${n(r.input)} دریافت شد`;case"invalid_value":if(r.values.length===1)return`ورودی نامعتبر: میبایست ${_(r.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${h(r.values,"|")} میبود`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} ${s.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} باشد`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} ${s.unit} باشد`;return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} باشد`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${o[i.format]??r.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${r.divisor} باشد`;case"unrecognized_keys":return`کلید${r.keys.length>1?"های":""} ناشناس: ${h(r.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${r.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${r.origin}`;default:return"ورودی نامعتبر"}}};function Ga(){return{localeError:Ny()}}var jy=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(r)=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Virheellinen syöte: täytyy olla ${_(r.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Liian suuri: ${s.subject} täytyy olla ${i}${r.maximum.toString()} ${s.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Liian pieni: ${s.subject} täytyy olla ${i}${r.minimum.toString()} ${s.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${h(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function Wa(){return{localeError:jy()}}var Uy=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombre";case"object":{if(Array.isArray(r))return"tableau";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(r)=>{switch(r.code){case"invalid_type":return`Entrée invalide : ${r.expected} attendu, ${n(r.input)} reçu`;case"invalid_value":if(r.values.length===1)return`Entrée invalide : ${_(r.values[0])} attendu`;return`Option invalide : une valeur parmi ${h(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Trop grand : ${r.origin??"valeur"} doit ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"élément(s)"}`;return`Trop grand : ${r.origin??"valeur"} doit être ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Trop petit : ${r.origin} doit ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`;return`Trop petit : ${r.origin} doit être ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${h(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function Ha(){return{localeError:Uy()}}var Ly=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(r)=>{switch(r.code){case"invalid_type":return`Entrée invalide : attendu ${r.expected}, reçu ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Entrée invalide : attendu ${_(r.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"≤":"<",s=t(r.origin);if(s)return`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${s.unit}`;return`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"≥":">",s=t(r.origin);if(s)return`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${s.unit}`;return`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${h(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function Va(){return{localeError:Ly()}}var Fy=()=>{let e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(r)=>{switch(r.code){case"invalid_type":return`קלט לא תקין: צריך ${r.expected}, התקבל ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`קלט לא תקין: צריך ${_(r.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`גדול מדי: ${r.origin??"value"} צריך להיות ${i}${r.maximum.toString()} ${s.unit??"elements"}`;return`גדול מדי: ${r.origin??"value"} צריך להיות ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`קטן מדי: ${r.origin} צריך להיות ${i}${r.minimum.toString()} ${s.unit}`;return`קטן מדי: ${r.origin} צריך להיות ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${i.prefix}"`;if(i.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${i.suffix}"`;if(i.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${i.includes}"`;if(i.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${i.pattern}`;return`${o[i.format]??r.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${r.divisor}`;case"unrecognized_keys":return`מפתח${r.keys.length>1?"ות":""} לא מזוה${r.keys.length>1?"ים":"ה"}: ${h(r.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${r.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${r.origin}`;default:return"קלט לא תקין"}}};function Ba(){return{localeError:Fy()}}var Zy=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"szám";case"object":{if(Array.isArray(r))return"tömb";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(r)=>{switch(r.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${r.expected}, a kapott érték ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Érvénytelen bemenet: a várt érték ${_(r.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Túl nagy: ${r.origin??"érték"} mérete túl nagy ${i}${r.maximum.toString()} ${s.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${r.origin??"érték"} túl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Túl kicsi: a bemeneti érték ${r.origin} mérete túl kicsi ${i}${r.minimum.toString()} ${s.unit}`;return`Túl kicsi: a bemeneti érték ${r.origin} túl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`Érvénytelen szám: ${r.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${r.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${r.origin}`;default:return"Érvénytelen bemenet"}}};function qa(){return{localeError:Zy()}}var Gy=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Input tidak valid: diharapkan ${_(r.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${s.unit}`;return`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function Ja(){return{localeError:Gy()}}var Wy=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"númer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Hy=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(o){return e[o]??null}let n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(o)=>{switch(o.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Wy(o.input)} þar sem á að vera ${o.expected}`;case"invalid_value":if(o.values.length===1)return`Rangt gildi: gert ráð fyrir ${_(o.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${h(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} hafi ${r}${o.maximum.toString()} ${i.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} sé ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`Of lítið: gert er ráð fyrir að ${o.origin} hafi ${r}${o.minimum.toString()} ${i.unit}`;return`Of lítið: gert er ráð fyrir að ${o.origin} sé ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Ógildur strengur: verður að byrja á "${r.prefix}"`;if(r.format==="ends_with")return`Ógildur strengur: verður að enda á "${r.suffix}"`;if(r.format==="includes")return`Ógildur strengur: verður að innihalda "${r.includes}"`;if(r.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${r.pattern}`;return`Rangt ${n[r.format]??o.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`Óþekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${h(o.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${o.origin}`;default:return"Rangt gildi"}}};function Ka(){return{localeError:Hy()}}var Vy=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numero";case"object":{if(Array.isArray(r))return"vettore";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Input non valido: atteso ${_(r.values[0])}`;return`Opzione non valida: atteso uno tra ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${s.unit??"elementi"}`;return`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${s.unit}`;return`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${h(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function Xa(){return{localeError:Vy()}}var By=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"数値";case"object":{if(Array.isArray(r))return"配列";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(r)=>{switch(r.code){case"invalid_type":return`無効な入力: ${r.expected}が期待されましたが、${n(r.input)}が入力されました`;case"invalid_value":if(r.values.length===1)return`無効な入力: ${_(r.values[0])}が期待されました`;return`無効な選択: ${h(r.values,"、")}のいずれかである必要があります`;case"too_big":{let i=r.inclusive?"以下である":"より小さい",s=t(r.origin);if(s)return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${s.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${i}必要があります`}case"too_small":{let i=r.inclusive?"以上である":"より大きい",s=t(r.origin);if(s)return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${s.unit}${i}必要があります`;return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${o[i.format]??r.format}`}case"not_multiple_of":return`無効な数値: ${r.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${r.keys.length>1?"群":""}: ${h(r.keys,"、")}`;case"invalid_key":return`${r.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${r.origin}内の無効な値`;default:return"無効な入力"}}};function Ya(){return{localeError:By()}}var qy=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"რიცხვი";case"object":{if(Array.isArray(e))return"მასივი";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[t]??t},Jy=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(o){return e[o]??null}let n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(o)=>{switch(o.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${o.expected}, მიღებული ${qy(o.input)}`;case"invalid_value":if(o.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${_(o.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${h(o.values,"|")}-დან`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} ${i.verb} ${r}${o.maximum.toString()} ${i.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} იყოს ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} ${i.verb} ${r}${o.minimum.toString()} ${i.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} იყოს ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${r.prefix}"-ით`;if(r.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${r.suffix}"-ით`;if(r.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${r.includes}"-ს`;if(r.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${r.pattern}`;return`არასწორი ${n[r.format]??o.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${o.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${o.keys.length>1?"ები":"ი"}: ${h(o.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${o.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${o.origin}-ში`;default:return"არასწორი შეყვანა"}}};function Qa(){return{localeError:Jy()}}var Ky=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(r))return"អារេ (Array)";if(r===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(r)=>{switch(r.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${r.expected} ប៉ុន្តែទទួលបាន ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${_(r.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()} ${s.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()} ${s.unit}`;return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${o[i.format]??r.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${r.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${h(r.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function yr(){return{localeError:Ky()}}function el(){return yr()}var Xy=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(r)=>{switch(r.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${r.expected}, 받은 타입은 ${n(r.input)}입니다`;case"invalid_value":if(r.values.length===1)return`잘못된 입력: 값은 ${_(r.values[0])} 이어야 합니다`;return`잘못된 옵션: ${h(r.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=r.inclusive?"이하":"미만",s=i==="미만"?"이어야 합니다":"여야 합니다",a=t(r.origin),l=a?.unit??"요소";if(a)return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()}${l} ${i}${s}`;return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()} ${i}${s}`}case"too_small":{let i=r.inclusive?"이상":"초과",s=i==="이상"?"이어야 합니다":"여야 합니다",a=t(r.origin),l=a?.unit??"요소";if(a)return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()}${l} ${i}${s}`;return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${o[i.format]??r.format}`}case"not_multiple_of":return`잘못된 숫자: ${r.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${h(r.keys,", ")}`;case"invalid_key":return`잘못된 키: ${r.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${r.origin}`;default:return"잘못된 입력"}}};function tl(){return{localeError:Xy()}}var Yy=(e)=>_r(typeof e,e),_r=(e,t=void 0)=>{switch(e){case"number":return Number.isNaN(t)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(t===void 0)return"nežinomas objektas";if(t===null)return"nulinė reikšmė";if(Array.isArray(t))return"masyvas";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return e},br=(e)=>e.charAt(0).toUpperCase()+e.slice(1);function Mm(e){let t=Math.abs(e),n=t%10,o=t%100;if(o>=11&&o<=19||n===0)return"many";if(n===1)return"one";return"few"}var Qy=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(o,r,i,s){let a=e[o]??null;if(a===null)return a;return{unit:a.unit[r],verb:a.verb[s][i?"inclusive":"notInclusive"]}}let n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(o)=>{switch(o.code){case"invalid_type":return`Gautas tipas ${Yy(o.input)}, o tikėtasi - ${_r(o.expected)}`;case"invalid_value":if(o.values.length===1)return`Privalo būti ${_(o.values[0])}`;return`Privalo būti vienas iš ${h(o.values,"|")} pasirinkimų`;case"too_big":{let r=_r(o.origin),i=t(o.origin,Mm(Number(o.maximum)),o.inclusive??!1,"smaller");if(i?.verb)return`${br(r??o.origin??"reikšmė")} ${i.verb} ${o.maximum.toString()} ${i.unit??"elementų"}`;let s=o.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${br(r??o.origin??"reikšmė")} turi būti ${s} ${o.maximum.toString()} ${i?.unit}`}case"too_small":{let r=_r(o.origin),i=t(o.origin,Mm(Number(o.minimum)),o.inclusive??!1,"bigger");if(i?.verb)return`${br(r??o.origin??"reikšmė")} ${i.verb} ${o.minimum.toString()} ${i.unit??"elementų"}`;let s=o.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${br(r??o.origin??"reikšmė")} turi būti ${s} ${o.minimum.toString()} ${i?.unit}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Eilutė privalo prasidėti "${r.prefix}"`;if(r.format==="ends_with")return`Eilutė privalo pasibaigti "${r.suffix}"`;if(r.format==="includes")return`Eilutė privalo įtraukti "${r.includes}"`;if(r.format==="regex")return`Eilutė privalo atitikti ${r.pattern}`;return`Neteisingas ${n[r.format]??o.format}`}case"not_multiple_of":return`Skaičius privalo būti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${h(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let r=_r(o.origin);return`${br(r??o.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function rl(){return{localeError:Qy()}}var eb=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"број";case"object":{if(Array.isArray(r))return"низа";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(r)=>{switch(r.code){case"invalid_type":return`Грешен внес: се очекува ${r.expected}, примено ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${_(r.values[0])}`;return`Грешана опција: се очекува една ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Премногу голем: се очекува ${r.origin??"вредноста"} да има ${i}${r.maximum.toString()} ${s.unit??"елементи"}`;return`Премногу голем: се очекува ${r.origin??"вредноста"} да биде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Премногу мал: се очекува ${r.origin} да има ${i}${r.minimum.toString()} ${s.unit}`;return`Премногу мал: се очекува ${r.origin} да биде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${h(r.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${r.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${r.origin}`;default:return"Грешен внес"}}};function nl(){return{localeError:eb()}}var tb=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombor";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Input tidak sah: dijangka ${_(r.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`;return`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${h(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function ol(){return{localeError:tb()}}var rb=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"getal";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(r)=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ongeldige invoer: verwacht ${_(r.values[0])}`;return`Ongeldige optie: verwacht één van ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${s.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${s.unit} bevat`;return`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function il(){return{localeError:rb()}}var nb=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"tall";case"object":{if(Array.isArray(r))return"liste";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ugyldig verdi: forventet ${_(r.values[0])}`;return`Ugyldig valg: forventet en av ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()} ${s.unit??"elementer"}`;return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()} ${s.unit}`;return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${h(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function sl(){return{localeError:nb()}}var ob=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numara";case"object":{if(Array.isArray(r))return"saf";if(r===null)return"gayb";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(r)=>{switch(r.code){case"invalid_type":return`Fâsit giren: umulan ${r.expected}, alınan ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Fâsit giren: umulan ${_(r.values[0])}`;return`Fâsit tercih: mûteberler ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmalıydı.`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} ${s.unit} sahip olmalıydı.`;return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${o[i.format]??r.format}`}case"not_multiple_of":return`Fâsit sayı: ${r.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`${r.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${r.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function al(){return{localeError:ob()}}var ib=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"عدد";case"object":{if(Array.isArray(r))return"ارې";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(r)=>{switch(r.code){case"invalid_type":return`ناسم ورودي: باید ${r.expected} وای, مګر ${n(r.input)} ترلاسه شو`;case"invalid_value":if(r.values.length===1)return`ناسم ورودي: باید ${_(r.values[0])} وای`;return`ناسم انتخاب: باید یو له ${h(r.values,"|")} څخه وای`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} ${s.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} وي`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} ${s.unit} ولري`;return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} وي`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${o[i.format]??r.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${r.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${r.keys.length>1?"کلیډونه":"کلیډ"}: ${h(r.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${r.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${r.origin} کې`;default:return"ناسمه ورودي"}}};function ll(){return{localeError:ib()}}var sb=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"liczba";case"object":{if(Array.isArray(r))return"tablica";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(r)=>{switch(r.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${r.expected}, otrzymano ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${_(r.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Za duża wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.maximum.toString()} ${s.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Za mała wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.minimum.toString()} ${s.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${r.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${r.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function cl(){return{localeError:sb()}}var ab=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"número";case"object":{if(Array.isArray(r))return"array";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(r)=>{switch(r.code){case"invalid_type":return`Tipo inválido: esperado ${r.expected}, recebido ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Entrada inválida: esperado ${_(r.values[0])}`;return`Opção inválida: esperada uma das ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${s.unit??"elementos"}`;return`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${s.unit}`;return`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${o[i.format]??r.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Chave inválida em ${r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${r.origin}`;default:return"Campo inválido"}}};function ul(){return{localeError:ab()}}function Am(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;if(s>=11&&s<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return n;return o}var lb=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"число";case"object":{if(Array.isArray(r))return"массив";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(r)=>{switch(r.code){case"invalid_type":return`Неверный ввод: ожидалось ${r.expected}, получено ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Неверный ввод: ожидалось ${_(r.values[0])}`;return`Неверный вариант: ожидалось одно из ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),l=Am(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${i}${r.maximum.toString()} ${l}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),l=Am(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${i}${r.minimum.toString()} ${l}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${o[i.format]??r.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`;default:return"Неверные входные данные"}}};function dl(){return{localeError:lb()}}var cb=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"število";case"object":{if(Array.isArray(r))return"tabela";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(r)=>{switch(r.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${r.expected}, prejeto ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Neveljaven vnos: pričakovano ${_(r.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${s.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Premajhno: pričakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${s.unit}`;return`Premajhno: pričakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i ključi":" ključ"}: ${h(r.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function ml(){return{localeError:cb()}}var ub=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"antal";case"object":{if(Array.isArray(r))return"lista";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(r)=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${r.expected}, fick ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ogiltig inmatning: förväntat ${_(r.values[0])}`;return`Ogiltigt val: förväntade en av ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`För stor(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()} ${s.unit??"element"}`;return`För stor(t): förväntat ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()} ${s.unit}`;return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${h(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${r.origin??"värdet"}`;default:return"Ogiltig input"}}};function pl(){return{localeError:ub()}}var db=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(r))return"அணி";if(r===null)return"வெறுமை";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(r)=>{switch(r.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${r.expected}, பெறப்பட்டது ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${_(r.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${h(r.values,"|")} இல் ஒன்று`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${o[i.format]??r.format}`}case"not_multiple_of":return`தவறான எண்: ${r.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${r.keys.length>1?"கள்":""}: ${h(r.keys,", ")}`;case"invalid_key":return`${r.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${r.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function fl(){return{localeError:db()}}var mb=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(r))return"อาร์เรย์ (Array)";if(r===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(r)=>{switch(r.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${r.expected} แต่ได้รับ ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${_(r.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"ไม่เกิน":"น้อยกว่า",s=t(r.origin);if(s)return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()} ${s.unit??"รายการ"}`;return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"อย่างน้อย":"มากกว่า",s=t(r.origin);if(s)return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()} ${s.unit}`;return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${o[i.format]??r.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${r.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${h(r.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${r.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${r.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function gl(){return{localeError:mb()}}var pb=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},fb=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(o){return e[o]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(o)=>{switch(o.code){case"invalid_type":return`Geçersiz değer: beklenen ${o.expected}, alınan ${pb(o.input)}`;case"invalid_value":if(o.values.length===1)return`Geçersiz değer: beklenen ${_(o.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${h(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`Çok büyük: beklenen ${o.origin??"değer"} ${r}${o.maximum.toString()} ${i.unit??"öğe"}`;return`Çok büyük: beklenen ${o.origin??"değer"} ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);if(i)return`Çok küçük: beklenen ${o.origin} ${r}${o.minimum.toString()} ${i.unit}`;return`Çok küçük: beklenen ${o.origin} ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;if(r.format==="starts_with")return`Geçersiz metin: "${r.prefix}" ile başlamalı`;if(r.format==="ends_with")return`Geçersiz metin: "${r.suffix}" ile bitmeli`;if(r.format==="includes")return`Geçersiz metin: "${r.includes}" içermeli`;if(r.format==="regex")return`Geçersiz metin: ${r.pattern} desenine uymalı`;return`Geçersiz ${n[r.format]??o.format}`}case"not_multiple_of":return`Geçersiz sayı: ${o.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${o.keys.length>1?"lar":""}: ${h(o.keys,", ")}`;case"invalid_key":return`${o.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${o.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function hl(){return{localeError:fb()}}var gb=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"число";case"object":{if(Array.isArray(r))return"масив";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(r)=>{switch(r.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${r.expected}, отримано ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Неправильні вхідні дані: очікується ${_(r.values[0])}`;return`Неправильна опція: очікується одне з ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Занадто велике: очікується, що ${r.origin??"значення"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"елементів"}`;return`Занадто велике: очікується, що ${r.origin??"значення"} буде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Занадто мале: очікується, що ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`;return`Занадто мале: очікується, що ${r.origin} буде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${o[i.format]??r.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${r.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${r.keys.length>1?"і":""}: ${h(r.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${r.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${r.origin}`;default:return"Неправильні вхідні дані"}}};function kr(){return{localeError:gb()}}function vl(){return kr()}var hb=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"نمبر";case"object":{if(Array.isArray(r))return"آرے";if(r===null)return"نل";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(r)=>{switch(r.code){case"invalid_type":return`غلط ان پٹ: ${r.expected} متوقع تھا، ${n(r.input)} موصول ہوا`;case"invalid_value":if(r.values.length===1)return`غلط ان پٹ: ${_(r.values[0])} متوقع تھا`;return`غلط آپشن: ${h(r.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`بہت بڑا: ${r.origin??"ویلیو"} کے ${i}${r.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${r.origin??"ویلیو"} کا ${i}${r.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`بہت چھوٹا: ${r.origin} کے ${i}${r.minimum.toString()} ${s.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${r.origin} کا ${i}${r.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${o[i.format]??r.format}`}case"not_multiple_of":return`غلط نمبر: ${r.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${r.keys.length>1?"ز":""}: ${h(r.keys,"، ")}`;case"invalid_key":return`${r.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${r.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function yl(){return{localeError:hb()}}var vb=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"số";case"object":{if(Array.isArray(r))return"mảng";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(r)=>{switch(r.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${r.expected}, nhận được ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${_(r.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"phần tử"}`;return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Quá nhỏ: mong đợi ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`;return`Quá nhỏ: mong đợi ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${o[i.format]??r.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${r.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${h(r.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${r.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${r.origin}`;default:return"Đầu vào không hợp lệ"}}};function bl(){return{localeError:vb()}}var yb=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(r))return"数组";if(r===null)return"空值(null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(r)=>{switch(r.code){case"invalid_type":return`无效输入:期望 ${r.expected},实际接收 ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`无效输入:期望 ${_(r.values[0])}`;return`无效选项:期望以下之一 ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()} ${s.unit??"个元素"}`;return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`;return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${o[i.format]??r.format}`}case"not_multiple_of":return`无效数字:必须是 ${r.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${h(r.keys,", ")}`;case"invalid_key":return`${r.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${r.origin} 中包含无效值(value)`;default:return"无效输入"}}};function _l(){return{localeError:yb()}}var bb=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(r)=>{switch(r.code){case"invalid_type":return`無效的輸入值:預期為 ${r.expected},但收到 ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`無效的輸入值:預期為 ${_(r.values[0])}`;return`無效的選項:預期為以下其中之一 ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()} ${s.unit??"個元素"}`;return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()} ${s.unit}`;return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${o[i.format]??r.format}`}case"not_multiple_of":return`無效的數字:必須為 ${r.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${r.keys.length>1?"們":""}:${h(r.keys,"、")}`;case"invalid_key":return`${r.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${r.origin} 中有無效的值`;default:return"無效的輸入值"}}};function kl(){return{localeError:bb()}}var _b=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(r){return e[r]??null}let n=(r)=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(r))return"akopọ";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(r)=>{switch(r.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${r.expected}, àmọ̀ a rí ${n(r.input)}`;case"invalid_value":if(r.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${_(r.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${h(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${r.origin??"iye"} ${s.verb} ${i}${r.maximum} ${s.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s)return`Kéré ju: a ní láti jẹ́ pé ${r.origin} ${s.verb} ${i}${r.minimum} ${s.unit}`;return`Kéré ju: a ní láti jẹ́ ${i}${r.minimum}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`;if(i.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`;if(i.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`;if(i.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`;return`Aṣìṣe: ${o[i.format]??r.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${r.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${h(r.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${r.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${r.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function wl(){return{localeError:_b()}}var xl=Symbol("ZodOutput"),$l=Symbol("ZodInput");class xr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Zn(){return new xr}var Ze=Zn();function Sl(e,t){return new e({type:"string",...k(t)})}function Il(e,t){return new e({type:"string",coerce:!0,...k(t)})}function Gn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...k(t)})}function $r(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...k(t)})}function Wn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...k(t)})}function Hn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...k(t)})}function Vn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...k(t)})}function Bn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...k(t)})}function Sr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...k(t)})}function qn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...k(t)})}function Jn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...k(t)})}function Kn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...k(t)})}function Xn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...k(t)})}function Yn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...k(t)})}function Qn(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...k(t)})}function eo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...k(t)})}function to(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...k(t)})}function ro(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...k(t)})}function no(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...k(t)})}function oo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...k(t)})}function io(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...k(t)})}function so(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...k(t)})}function ao(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...k(t)})}function lo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...k(t)})}var Tl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Dl(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...k(t)})}function Pl(e,t){return new e({type:"string",format:"date",check:"string_format",...k(t)})}function Ol(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...k(t)})}function El(e,t){return new e({type:"string",format:"duration",check:"string_format",...k(t)})}function Rl(e,t){return new e({type:"number",checks:[],...k(t)})}function zl(e,t){return new e({type:"number",coerce:!0,checks:[],...k(t)})}function Cl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...k(t)})}function Ml(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...k(t)})}function Al(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...k(t)})}function Nl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...k(t)})}function jl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...k(t)})}function Ul(e,t){return new e({type:"boolean",...k(t)})}function Ll(e,t){return new e({type:"boolean",coerce:!0,...k(t)})}function Fl(e,t){return new e({type:"bigint",...k(t)})}function Zl(e,t){return new e({type:"bigint",coerce:!0,...k(t)})}function Gl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...k(t)})}function Wl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...k(t)})}function Hl(e,t){return new e({type:"symbol",...k(t)})}function Vl(e,t){return new e({type:"undefined",...k(t)})}function Bl(e,t){return new e({type:"null",...k(t)})}function ql(e){return new e({type:"any"})}function Jl(e){return new e({type:"unknown"})}function Kl(e,t){return new e({type:"never",...k(t)})}function Xl(e,t){return new e({type:"void",...k(t)})}function Yl(e,t){return new e({type:"date",...k(t)})}function Ql(e,t){return new e({type:"date",coerce:!0,...k(t)})}function ec(e,t){return new e({type:"nan",...k(t)})}function qe(e,t){return new On({check:"less_than",...k(t),value:e,inclusive:!1})}function Re(e,t){return new On({check:"less_than",...k(t),value:e,inclusive:!0})}function Je(e,t){return new En({check:"greater_than",...k(t),value:e,inclusive:!1})}function ke(e,t){return new En({check:"greater_than",...k(t),value:e,inclusive:!0})}function tc(e){return Je(0,e)}function rc(e){return qe(0,e)}function nc(e){return Re(0,e)}function oc(e){return ke(0,e)}function kt(e,t){return new as({check:"multiple_of",...k(t),value:e})}function jt(e,t){return new us({check:"max_size",...k(t),maximum:e})}function wt(e,t){return new ds({check:"min_size",...k(t),minimum:e})}function Ir(e,t){return new ms({check:"size_equals",...k(t),size:e})}function Ut(e,t){return new ps({check:"max_length",...k(t),maximum:e})}function at(e,t){return new fs({check:"min_length",...k(t),minimum:e})}function Lt(e,t){return new gs({check:"length_equals",...k(t),length:e})}function Tr(e,t){return new hs({check:"string_format",format:"regex",...k(t),pattern:e})}function Dr(e){return new vs({check:"string_format",format:"lowercase",...k(e)})}function Pr(e){return new ys({check:"string_format",format:"uppercase",...k(e)})}function Or(e,t){return new bs({check:"string_format",format:"includes",...k(t),includes:e})}function Er(e,t){return new _s({check:"string_format",format:"starts_with",...k(t),prefix:e})}function Rr(e,t){return new ks({check:"string_format",format:"ends_with",...k(t),suffix:e})}function ic(e,t,n){return new ws({check:"property",property:e,schema:t,...k(n)})}function zr(e,t){return new xs({check:"mime_type",mime:e,...k(t)})}function Ke(e){return new $s({check:"overwrite",tx:e})}function Cr(e){return Ke((t)=>t.normalize(e))}function Mr(){return Ke((e)=>e.trim())}function Ar(){return Ke((e)=>e.toLowerCase())}function Nr(){return Ke((e)=>e.toUpperCase())}function sc(e,t,n){return new e({type:"array",element:t,...k(n)})}function kb(e,t,n){return new e({type:"union",options:t,...k(n)})}function wb(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...k(o)})}function xb(e,t,n){return new e({type:"intersection",left:t,right:n})}function $b(e,t,n,o){let r=n instanceof P;return new e({type:"tuple",items:t,rest:r?n:null,...k(r?o:n)})}function Sb(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...k(o)})}function Ib(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...k(o)})}function Tb(e,t,n){return new e({type:"set",valueType:t,...k(n)})}function Db(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map((r)=>[r,r])):t;return new e({type:"enum",entries:o,...k(n)})}function Pb(e,t,n){return new e({type:"enum",entries:t,...k(n)})}function Ob(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...k(n)})}function ac(e,t){return new e({type:"file",...k(t)})}function Eb(e,t){return new e({type:"transform",transform:t})}function Rb(e,t){return new e({type:"optional",innerType:t})}function zb(e,t){return new e({type:"nullable",innerType:t})}function Cb(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n==="function"?n():xi(n)}})}function Mb(e,t,n){return new e({type:"nonoptional",innerType:t,...k(n)})}function Ab(e,t){return new e({type:"success",innerType:t})}function Nb(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n==="function"?n:()=>n})}function jb(e,t,n){return new e({type:"pipe",in:t,out:n})}function Ub(e,t){return new e({type:"readonly",innerType:t})}function Lb(e,t,n){return new e({type:"template_literal",parts:t,...k(n)})}function Fb(e,t){return new e({type:"lazy",getter:t})}function Zb(e,t){return new e({type:"promise",innerType:t})}function lc(e,t,n){let o=k(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function cc(e,t,n){return new e({type:"custom",check:"custom",fn:t,...k(n)})}function uc(e){let t=Nm((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(Rt(o,n.value,t._zod.def));else{let r=o;if(r.fatal)r.continue=!1;r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Rt(r))}},e(n.value,n)));return t}function Nm(e,t){let n=new Y({check:"custom",...k(t)});return n._zod.check=e,n}function dc(e,t){let n=k(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];if(n.case!=="sensitive")o=o.map((d)=>typeof d==="string"?d.toLowerCase():d),r=r.map((d)=>typeof d==="string"?d.toLowerCase():d);let i=new Set(o),s=new Set(r),a=e.Codec??hr,l=e.Boolean??gr,u=new(e.String??_t)({type:"string",error:n.error}),f=new l({type:"boolean",error:n.error}),g=new a({type:"pipe",in:u,out:f,transform:(d,y)=>{let x=d;if(n.case!=="sensitive")x=x.toLowerCase();if(i.has(x))return!0;else if(s.has(x))return!1;else return y.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:y.value,inst:g,continue:!1}),{}},reverseTransform:(d,y)=>{if(d===!0)return o[0]||"true";else return r[0]||"false"},error:n.error});return g}function Ft(e,t,n,o={}){let r=k(o),i={...k(o),check:"string_format",type:"string",format:t,fn:typeof n==="function"?n:(a)=>n.test(a),...r};if(n instanceof RegExp)i.pattern=n;return new e(i)}class co{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??Ze,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let o=e._zod.def,r={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i){if(i.count++,t.schemaPath.includes(e))i.cycle=t.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)s.ref=f,this.process(f,u),this.seen.get(f).isParent=!0;else{let g=s.schema;switch(o.type){case"string":{let d=g;d.type="string";let{minimum:y,maximum:x,format:C,patterns:j,contentEncoding:K}=e._zod.bag;if(typeof y==="number")d.minLength=y;if(typeof x==="number")d.maxLength=x;if(C){if(d.format=r[C]??C,d.format==="")delete d.format}if(K)d.contentEncoding=K;if(j&&j.size>0){let W=[...j];if(W.length===1)d.pattern=W[0].source;else if(W.length>1)s.schema.allOf=[...W.map((ae)=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:ae.source}))]}break}case"number":{let d=g,{minimum:y,maximum:x,format:C,multipleOf:j,exclusiveMaximum:K,exclusiveMinimum:W}=e._zod.bag;if(typeof C==="string"&&C.includes("int"))d.type="integer";else d.type="number";if(typeof W==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")d.minimum=W,d.exclusiveMinimum=!0;else d.exclusiveMinimum=W;if(typeof y==="number"){if(d.minimum=y,typeof W==="number"&&this.target!=="draft-4")if(W>=y)delete d.minimum;else delete d.exclusiveMinimum}if(typeof K==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")d.maximum=K,d.exclusiveMaximum=!0;else d.exclusiveMaximum=K;if(typeof x==="number"){if(d.maximum=x,typeof K==="number"&&this.target!=="draft-4")if(K<=x)delete d.maximum;else delete d.exclusiveMaximum}if(typeof j==="number")d.multipleOf=j;break}case"boolean":{let d=g;d.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{if(this.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{g.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let d=g,{minimum:y,maximum:x}=e._zod.bag;if(typeof y==="number")d.minItems=y;if(typeof x==="number")d.maxItems=x;d.type="array",d.items=this.process(o.element,{...u,path:[...u.path,"items"]});break}case"object":{let d=g;d.type="object",d.properties={};let y=o.shape;for(let j in y)d.properties[j]=this.process(y[j],{...u,path:[...u.path,"properties",j]});let x=new Set(Object.keys(y)),C=new Set([...x].filter((j)=>{let K=o.shape[j]._zod;if(this.io==="input")return K.optin===void 0;else return K.optout===void 0}));if(C.size>0)d.required=Array.from(C);if(o.catchall?._zod.def.type==="never")d.additionalProperties=!1;else if(!o.catchall){if(this.io==="output")d.additionalProperties=!1}else if(o.catchall)d.additionalProperties=this.process(o.catchall,{...u,path:[...u.path,"additionalProperties"]});break}case"union":{let d=g,y=o.options.map((x,C)=>this.process(x,{...u,path:[...u.path,"anyOf",C]}));d.anyOf=y;break}case"intersection":{let d=g,y=this.process(o.left,{...u,path:[...u.path,"allOf",0]}),x=this.process(o.right,{...u,path:[...u.path,"allOf",1]}),C=(K)=>("allOf"in K)&&Object.keys(K).length===1,j=[...C(y)?y.allOf:[y],...C(x)?x.allOf:[x]];d.allOf=j;break}case"tuple":{let d=g;d.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",x=this.target==="draft-2020-12"?"items":this.target==="openapi-3.0"?"items":"additionalItems",C=o.items.map((ae,Pe)=>this.process(ae,{...u,path:[...u.path,y,Pe]})),j=o.rest?this.process(o.rest,{...u,path:[...u.path,x,...this.target==="openapi-3.0"?[o.items.length]:[]]}):null;if(this.target==="draft-2020-12"){if(d.prefixItems=C,j)d.items=j}else if(this.target==="openapi-3.0"){if(d.items={anyOf:C},j)d.items.anyOf.push(j);if(d.minItems=C.length,!j)d.maxItems=C.length}else if(d.items=C,j)d.additionalItems=j;let{minimum:K,maximum:W}=e._zod.bag;if(typeof K==="number")d.minItems=K;if(typeof W==="number")d.maxItems=W;break}case"record":{let d=g;if(d.type="object",this.target==="draft-7"||this.target==="draft-2020-12")d.propertyNames=this.process(o.keyType,{...u,path:[...u.path,"propertyNames"]});d.additionalProperties=this.process(o.valueType,{...u,path:[...u.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let d=g,y=ir(o.entries);if(y.every((x)=>typeof x==="number"))d.type="number";if(y.every((x)=>typeof x==="string"))d.type="string";d.enum=y;break}case"literal":{let d=g,y=[];for(let x of o.values)if(x===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else y.push(Number(x));else y.push(x);if(y.length===0);else if(y.length===1){let x=y[0];if(d.type=x===null?"null":typeof x,this.target==="draft-4"||this.target==="openapi-3.0")d.enum=[x];else d.const=x}else{if(y.every((x)=>typeof x==="number"))d.type="number";if(y.every((x)=>typeof x==="string"))d.type="string";if(y.every((x)=>typeof x==="boolean"))d.type="string";if(y.every((x)=>x===null))d.type="null";d.enum=y}break}case"file":{let d=g,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:C,mime:j}=e._zod.bag;if(x!==void 0)y.minLength=x;if(C!==void 0)y.maxLength=C;if(j)if(j.length===1)y.contentMediaType=j[0],Object.assign(d,y);else d.anyOf=j.map((K)=>({...y,contentMediaType:K}));else Object.assign(d,y);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let d=this.process(o.innerType,u);if(this.target==="openapi-3.0")s.ref=o.innerType,g.nullable=!0;else g.anyOf=[d,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,u),s.ref=o.innerType;break}case"success":{let d=g;d.type="boolean";break}case"default":{this.process(o.innerType,u),s.ref=o.innerType,g.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{if(this.process(o.innerType,u),s.ref=o.innerType,this.io==="input")g._prefault=JSON.parse(JSON.stringify(o.defaultValue));break}case"catch":{this.process(o.innerType,u),s.ref=o.innerType;let d;try{d=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=d;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let d=g,y=e._zod.pattern;if(!y)throw Error("Pattern not found in template literal");d.type="string",d.pattern=y.source;break}case"pipe":{let d=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(d,u),s.ref=d;break}case"readonly":{this.process(o.innerType,u),s.ref=o.innerType,g.readOnly=!0;break}case"promise":{this.process(o.innerType,u),s.ref=o.innerType;break}case"optional":{this.process(o.innerType,u),s.ref=o.innerType;break}case"lazy":{let d=e._zod.innerType;this.process(d,u),s.ref=d;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema");break}default:}}}let l=this.metadataRegistry.get(e);if(l)Object.assign(s.schema,l);if(this.io==="input"&&le(e))delete s.schema.examples,delete s.schema.default;if(this.io==="input"&&s.schema._prefault)(n=s.schema).default??(n.default=s.schema._prefault);return delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let r=(c)=>{let u=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(c[0])?.id,x=n.external.uri??((j)=>j);if(y)return{ref:x(y)};let C=c[1].defId??c[1].schema.id??`schema${this.counter++}`;return c[1].defId=C,{defId:C,ref:`${x("__shared")}#/${u}/${C}`}}if(c[1]===o)return{ref:"#"};let g=`${"#"}/${u}/`,d=c[1].schema.id??`__schema${this.counter++}`;return{defId:d,ref:g+d}},i=(c)=>{if(c[1].schema.$ref)return;let u=c[1],{ref:f,defId:g}=r(c);if(u.def={...u.schema},g)u.defId=g;let d=u.schema;for(let y in d)delete d[y];d.$ref=f};if(n.cycles==="throw")for(let c of this.seen.entries()){let u=c[1];if(u.cycle)throw Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
191
|
+
|
|
192
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of this.seen.entries()){let u=c[1];if(e===c[0]){i(c);continue}if(n.external){let g=n.external.registry.get(c[0])?.id;if(e!==c[0]&&g){i(c);continue}}if(this.metadataRegistry.get(c[0])?.id){i(c);continue}if(u.cycle){i(c);continue}if(u.count>1){if(n.reused==="ref"){i(c);continue}}}let s=(c,u)=>{let f=this.seen.get(c),g=f.def??f.schema,d={...g};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){s(y,u);let x=this.seen.get(y).schema;if(x.$ref&&(u.target==="draft-7"||u.target==="draft-4"||u.target==="openapi-3.0"))g.allOf=g.allOf??[],g.allOf.push(x);else Object.assign(g,x),Object.assign(g,d)}if(!f.isParent)this.override({zodSchema:c,jsonSchema:g,path:f.path??[]})};for(let c of[...this.seen.entries()].reverse())s(c[0],{target:this.target});let a={};if(this.target==="draft-2020-12")a.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")a.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")a.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(n.external?.uri){let c=n.external.registry.get(e)?.id;if(!c)throw Error("Schema is missing an `id` property");a.$id=n.external.uri(c)}Object.assign(a,o.def);let l=n.external?.defs??{};for(let c of this.seen.entries()){let u=c[1];if(u.def&&u.defId)l[u.defId]=u.def}if(n.external);else if(Object.keys(l).length>0)if(this.target==="draft-2020-12")a.$defs=l;else a.definitions=l;try{return JSON.parse(JSON.stringify(a))}catch(c){throw Error("Error converting schema to JSON.")}}}function mc(e,t){if(e instanceof xr){let o=new co(t),r={};for(let a of e._idmap.entries()){let[l,c]=a;o.process(c)}let i={},s={registry:e,uri:t?.uri,defs:r};for(let a of e._idmap.entries()){let[l,c]=a;i[l]=o.emit(c,{...t,external:s})}if(Object.keys(r).length>0){let a=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:r}}return{schemas:i}}let n=new co(t);return n.process(e),n.emit(e,t)}function le(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return le(r.element,n);case"object":{for(let i in r.shape)if(le(r.shape[i],n))return!0;return!1}case"union":{for(let i of r.options)if(le(i,n))return!0;return!1}case"intersection":return le(r.left,n)||le(r.right,n);case"tuple":{for(let i of r.items)if(le(i,n))return!0;if(r.rest&&le(r.rest,n))return!0;return!1}case"record":return le(r.keyType,n)||le(r.valueType,n);case"map":return le(r.keyType,n)||le(r.valueType,n);case"set":return le(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return le(r.innerType,n);case"lazy":return le(r.getter(),n);case"default":return le(r.innerType,n);case"prefault":return le(r.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return le(r.in,n)||le(r.out,n);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw Error(`Unknown schema type: ${r.type}`)}var jm={};var go={};ye(go,{ZodISODate:()=>mo,ZodISODateTime:()=>uo,ZodISODuration:()=>fo,ZodISOTime:()=>po,date:()=>fc,datetime:()=>pc,duration:()=>hc,time:()=>gc});var uo=m("ZodISODateTime",(e,t)=>{js.init(e,t),X.init(e,t)});function pc(e){return Dl(uo,e)}var mo=m("ZodISODate",(e,t)=>{Us.init(e,t),X.init(e,t)});function fc(e){return Pl(mo,e)}var po=m("ZodISOTime",(e,t)=>{Ls.init(e,t),X.init(e,t)});function gc(e){return Ol(po,e)}var fo=m("ZodISODuration",(e,t)=>{Fs.init(e,t),X.init(e,t)});function hc(e){return El(fo,e)}var Lm=(e,t)=>{ur.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>mr(e,n)},flatten:{value:(n)=>dr(e,n)},addIssue:{value:(n)=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ot,2)}},addIssues:{value:(n)=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ot,2)}},isEmpty:{get(){return e.issues.length===0}}})},Wb=m("ZodError",Lm),we=m("ZodError",Lm,{Parent:Error});var vc=zt(we),yc=Ct(we),bc=Mt(we),_c=At(we),kc=kn(we),wc=wn(we),xc=xn(we),$c=$n(we),Sc=Sn(we),Ic=In(we),Tc=Tn(we),Dc=Dn(we);var R=m("ZodType",(e,t)=>(P.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((o)=>typeof o==="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>ve(e,n,o),e.brand=()=>e,e.register=(n,o)=>(n.add(e,o),e),e.parse=(n,o)=>vc(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>bc(e,n,o),e.parseAsync=async(n,o)=>yc(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>_c(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>kc(e,n,o),e.decode=(n,o)=>wc(e,n,o),e.encodeAsync=async(n,o)=>xc(e,n,o),e.decodeAsync=async(n,o)=>$c(e,n,o),e.safeEncode=(n,o)=>Sc(e,n,o),e.safeDecode=(n,o)=>Ic(e,n,o),e.safeEncodeAsync=async(n,o)=>Tc(e,n,o),e.safeDecodeAsync=async(n,o)=>Dc(e,n,o),e.refine=(n,o)=>e.check(Ip(n,o)),e.superRefine=(n)=>e.check(Tp(n)),e.overwrite=(n)=>e.check(Ke(n)),e.optional=()=>vo(e),e.nullable=()=>yo(e),e.nullish=()=>vo(yo(e)),e.nonoptional=(n)=>fp(e,n),e.array=()=>wo(e),e.or=(n)=>Xc([e,n]),e.and=(n)=>ep(e,n),e.transform=(n)=>bo(e,eu(n)),e.default=(n)=>dp(e,n),e.prefault=(n)=>pp(e,n),e.catch=(n)=>vp(e,n),e.pipe=(n)=>bo(e,n),e.readonly=()=>_p(e),e.describe=(n)=>{let o=e.clone();return Ze.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return Ze.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ze.get(e);let o=e.clone();return Ze.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ec=m("_ZodString",(e,t)=>{_t.init(e,t),R.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Tr(...o)),e.includes=(...o)=>e.check(Or(...o)),e.startsWith=(...o)=>e.check(Er(...o)),e.endsWith=(...o)=>e.check(Rr(...o)),e.min=(...o)=>e.check(at(...o)),e.max=(...o)=>e.check(Ut(...o)),e.length=(...o)=>e.check(Lt(...o)),e.nonempty=(...o)=>e.check(at(1,...o)),e.lowercase=(o)=>e.check(Dr(o)),e.uppercase=(o)=>e.check(Pr(o)),e.trim=()=>e.check(Mr()),e.normalize=(...o)=>e.check(Cr(...o)),e.toLowerCase=()=>e.check(Ar()),e.toUpperCase=()=>e.check(Nr())}),Ur=m("ZodString",(e,t)=>{_t.init(e,t),Ec.init(e,t),e.email=(n)=>e.check(Gn(Rc,n)),e.url=(n)=>e.check(Sr(_o,n)),e.jwt=(n)=>e.check(lo(Bc,n)),e.emoji=(n)=>e.check(qn(zc,n)),e.guid=(n)=>e.check($r(ho,n)),e.uuid=(n)=>e.check(Wn(Ye,n)),e.uuidv4=(n)=>e.check(Hn(Ye,n)),e.uuidv6=(n)=>e.check(Vn(Ye,n)),e.uuidv7=(n)=>e.check(Bn(Ye,n)),e.nanoid=(n)=>e.check(Jn(Cc,n)),e.guid=(n)=>e.check($r(ho,n)),e.cuid=(n)=>e.check(Kn(Mc,n)),e.cuid2=(n)=>e.check(Xn(Ac,n)),e.ulid=(n)=>e.check(Yn(Nc,n)),e.base64=(n)=>e.check(io(Wc,n)),e.base64url=(n)=>e.check(so(Hc,n)),e.xid=(n)=>e.check(Qn(jc,n)),e.ksuid=(n)=>e.check(eo(Uc,n)),e.ipv4=(n)=>e.check(to(Lc,n)),e.ipv6=(n)=>e.check(ro(Fc,n)),e.cidrv4=(n)=>e.check(no(Zc,n)),e.cidrv6=(n)=>e.check(oo(Gc,n)),e.e164=(n)=>e.check(ao(Vc,n)),e.datetime=(n)=>e.check(pc(n)),e.date=(n)=>e.check(fc(n)),e.time=(n)=>e.check(gc(n)),e.duration=(n)=>e.check(hc(n))});function Pc(e){return Sl(Ur,e)}var X=m("ZodStringFormat",(e,t)=>{J.init(e,t),Ec.init(e,t)}),Rc=m("ZodEmail",(e,t)=>{Ps.init(e,t),X.init(e,t)});function Vb(e){return Gn(Rc,e)}var ho=m("ZodGUID",(e,t)=>{Ts.init(e,t),X.init(e,t)});function Bb(e){return $r(ho,e)}var Ye=m("ZodUUID",(e,t)=>{Ds.init(e,t),X.init(e,t)});function qb(e){return Wn(Ye,e)}function Jb(e){return Hn(Ye,e)}function Kb(e){return Vn(Ye,e)}function Xb(e){return Bn(Ye,e)}var _o=m("ZodURL",(e,t)=>{Os.init(e,t),X.init(e,t)});function Yb(e){return Sr(_o,e)}function Qb(e){return Sr(_o,{protocol:/^https?$/,hostname:Ee.domain,...b.normalizeParams(e)})}var zc=m("ZodEmoji",(e,t)=>{Es.init(e,t),X.init(e,t)});function e_(e){return qn(zc,e)}var Cc=m("ZodNanoID",(e,t)=>{Rs.init(e,t),X.init(e,t)});function t_(e){return Jn(Cc,e)}var Mc=m("ZodCUID",(e,t)=>{zs.init(e,t),X.init(e,t)});function r_(e){return Kn(Mc,e)}var Ac=m("ZodCUID2",(e,t)=>{Cs.init(e,t),X.init(e,t)});function n_(e){return Xn(Ac,e)}var Nc=m("ZodULID",(e,t)=>{Ms.init(e,t),X.init(e,t)});function o_(e){return Yn(Nc,e)}var jc=m("ZodXID",(e,t)=>{As.init(e,t),X.init(e,t)});function i_(e){return Qn(jc,e)}var Uc=m("ZodKSUID",(e,t)=>{Ns.init(e,t),X.init(e,t)});function s_(e){return eo(Uc,e)}var Lc=m("ZodIPv4",(e,t)=>{Zs.init(e,t),X.init(e,t)});function a_(e){return to(Lc,e)}var Fc=m("ZodIPv6",(e,t)=>{Gs.init(e,t),X.init(e,t)});function l_(e){return ro(Fc,e)}var Zc=m("ZodCIDRv4",(e,t)=>{Ws.init(e,t),X.init(e,t)});function c_(e){return no(Zc,e)}var Gc=m("ZodCIDRv6",(e,t)=>{Hs.init(e,t),X.init(e,t)});function u_(e){return oo(Gc,e)}var Wc=m("ZodBase64",(e,t)=>{Bs.init(e,t),X.init(e,t)});function d_(e){return io(Wc,e)}var Hc=m("ZodBase64URL",(e,t)=>{qs.init(e,t),X.init(e,t)});function m_(e){return so(Hc,e)}var Vc=m("ZodE164",(e,t)=>{Js.init(e,t),X.init(e,t)});function p_(e){return ao(Vc,e)}var Bc=m("ZodJWT",(e,t)=>{Ks.init(e,t),X.init(e,t)});function f_(e){return lo(Bc,e)}var Lr=m("ZodCustomStringFormat",(e,t)=>{Xs.init(e,t),X.init(e,t)});function g_(e,t,n={}){return Ft(Lr,e,t,n)}function h_(e){return Ft(Lr,"hostname",Ee.hostname,e)}function v_(e){return Ft(Lr,"hex",Ee.hex,e)}function y_(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=Ee[o];if(!r)throw Error(`Unrecognized hash format: ${o}`);return Ft(Lr,o,r,t)}var Fr=m("ZodNumber",(e,t)=>{jn.init(e,t),R.init(e,t),e.gt=(o,r)=>e.check(Je(o,r)),e.gte=(o,r)=>e.check(ke(o,r)),e.min=(o,r)=>e.check(ke(o,r)),e.lt=(o,r)=>e.check(qe(o,r)),e.lte=(o,r)=>e.check(Re(o,r)),e.max=(o,r)=>e.check(Re(o,r)),e.int=(o)=>e.check(Oc(o)),e.safe=(o)=>e.check(Oc(o)),e.positive=(o)=>e.check(Je(0,o)),e.nonnegative=(o)=>e.check(ke(0,o)),e.negative=(o)=>e.check(qe(0,o)),e.nonpositive=(o)=>e.check(Re(0,o)),e.multipleOf=(o,r)=>e.check(kt(o,r)),e.step=(o,r)=>e.check(kt(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),e.isFinite=!0,e.format=n.format??null});function Fm(e){return Rl(Fr,e)}var Gt=m("ZodNumberFormat",(e,t)=>{Ys.init(e,t),Fr.init(e,t)});function Oc(e){return Cl(Gt,e)}function b_(e){return Ml(Gt,e)}function __(e){return Al(Gt,e)}function k_(e){return Nl(Gt,e)}function w_(e){return jl(Gt,e)}var Zr=m("ZodBoolean",(e,t)=>{gr.init(e,t),R.init(e,t)});function Zm(e){return Ul(Zr,e)}var Gr=m("ZodBigInt",(e,t)=>{Un.init(e,t),R.init(e,t),e.gte=(o,r)=>e.check(ke(o,r)),e.min=(o,r)=>e.check(ke(o,r)),e.gt=(o,r)=>e.check(Je(o,r)),e.gte=(o,r)=>e.check(ke(o,r)),e.min=(o,r)=>e.check(ke(o,r)),e.lt=(o,r)=>e.check(qe(o,r)),e.lte=(o,r)=>e.check(Re(o,r)),e.max=(o,r)=>e.check(Re(o,r)),e.positive=(o)=>e.check(Je(BigInt(0),o)),e.negative=(o)=>e.check(qe(BigInt(0),o)),e.nonpositive=(o)=>e.check(Re(BigInt(0),o)),e.nonnegative=(o)=>e.check(ke(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(kt(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function x_(e){return Fl(Gr,e)}var qc=m("ZodBigIntFormat",(e,t)=>{Qs.init(e,t),Gr.init(e,t)});function $_(e){return Gl(qc,e)}function S_(e){return Wl(qc,e)}var Gm=m("ZodSymbol",(e,t)=>{ea.init(e,t),R.init(e,t)});function I_(e){return Hl(Gm,e)}var Wm=m("ZodUndefined",(e,t)=>{ta.init(e,t),R.init(e,t)});function T_(e){return Vl(Wm,e)}var Hm=m("ZodNull",(e,t)=>{ra.init(e,t),R.init(e,t)});function Vm(e){return Bl(Hm,e)}var Bm=m("ZodAny",(e,t)=>{na.init(e,t),R.init(e,t)});function D_(){return ql(Bm)}var qm=m("ZodUnknown",(e,t)=>{oa.init(e,t),R.init(e,t)});function Zt(){return Jl(qm)}var Jm=m("ZodNever",(e,t)=>{ia.init(e,t),R.init(e,t)});function Jc(e){return Kl(Jm,e)}var Km=m("ZodVoid",(e,t)=>{sa.init(e,t),R.init(e,t)});function P_(e){return Xl(Km,e)}var ko=m("ZodDate",(e,t)=>{aa.init(e,t),R.init(e,t),e.min=(o,r)=>e.check(ke(o,r)),e.max=(o,r)=>e.check(Re(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function O_(e){return Yl(ko,e)}var Xm=m("ZodArray",(e,t)=>{la.init(e,t),R.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(at(n,o)),e.nonempty=(n)=>e.check(at(1,n)),e.max=(n,o)=>e.check(Ut(n,o)),e.length=(n,o)=>e.check(Lt(n,o)),e.unwrap=()=>e.element});function wo(e,t){return sc(Xm,e,t)}function E_(e){let t=e._zod.def.shape;return Qc(Object.keys(t))}var xo=m("ZodObject",(e,t)=>{ca.init(e,t),R.init(e,t),b.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Qc(Object.keys(e._zod.def.shape)),e.catchall=(n)=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Jc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(n)=>b.extend(e,n),e.safeExtend=(n)=>b.safeExtend(e,n),e.merge=(n)=>b.merge(e,n),e.pick=(n)=>b.pick(e,n),e.omit=(n)=>b.omit(e,n),e.partial=(...n)=>b.partial(tu,e,n[0]),e.required=(...n)=>b.required(ru,e,n[0])});function R_(e,t){let n={type:"object",get shape(){return b.assignProp(this,"shape",e?b.objectClone(e):{}),this.shape},...b.normalizeParams(t)};return new xo(n)}function z_(e,t){return new xo({type:"object",get shape(){return b.assignProp(this,"shape",b.objectClone(e)),this.shape},catchall:Jc(),...b.normalizeParams(t)})}function C_(e,t){return new xo({type:"object",get shape(){return b.assignProp(this,"shape",b.objectClone(e)),this.shape},catchall:Zt(),...b.normalizeParams(t)})}var Kc=m("ZodUnion",(e,t)=>{Ln.init(e,t),R.init(e,t),e.options=t.options});function Xc(e,t){return new Kc({type:"union",options:e,...b.normalizeParams(t)})}var Ym=m("ZodDiscriminatedUnion",(e,t)=>{Kc.init(e,t),ua.init(e,t)});function M_(e,t,n){return new Ym({type:"union",options:t,discriminator:e,...b.normalizeParams(n)})}var Qm=m("ZodIntersection",(e,t)=>{da.init(e,t),R.init(e,t)});function ep(e,t){return new Qm({type:"intersection",left:e,right:t})}var tp=m("ZodTuple",(e,t)=>{Fn.init(e,t),R.init(e,t),e.rest=(n)=>e.clone({...e._zod.def,rest:n})});function rp(e,t,n){let o=t instanceof P,r=o?n:t;return new tp({type:"tuple",items:e,rest:o?t:null,...b.normalizeParams(r)})}var Yc=m("ZodRecord",(e,t)=>{ma.init(e,t),R.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function np(e,t,n){return new Yc({type:"record",keyType:e,valueType:t,...b.normalizeParams(n)})}function A_(e,t,n){let o=ve(e);return o._zod.values=void 0,new Yc({type:"record",keyType:o,valueType:t,...b.normalizeParams(n)})}var op=m("ZodMap",(e,t)=>{pa.init(e,t),R.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function N_(e,t,n){return new op({type:"map",keyType:e,valueType:t,...b.normalizeParams(n)})}var ip=m("ZodSet",(e,t)=>{fa.init(e,t),R.init(e,t),e.min=(...n)=>e.check(wt(...n)),e.nonempty=(n)=>e.check(wt(1,n)),e.max=(...n)=>e.check(jt(...n)),e.size=(...n)=>e.check(Ir(...n))});function j_(e,t){return new ip({type:"set",valueType:e,...b.normalizeParams(t)})}var jr=m("ZodEnum",(e,t)=>{ga.init(e,t),R.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let s of o)if(n.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new jr({...t,checks:[],...b.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let s of o)if(n.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new jr({...t,checks:[],...b.normalizeParams(r),entries:i})}});function Qc(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new jr({type:"enum",entries:n,...b.normalizeParams(t)})}function U_(e,t){return new jr({type:"enum",entries:e,...b.normalizeParams(t)})}var sp=m("ZodLiteral",(e,t)=>{ha.init(e,t),R.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function L_(e,t){return new sp({type:"literal",values:Array.isArray(e)?e:[e],...b.normalizeParams(t)})}var ap=m("ZodFile",(e,t)=>{va.init(e,t),R.init(e,t),e.min=(n,o)=>e.check(wt(n,o)),e.max=(n,o)=>e.check(jt(n,o)),e.mime=(n,o)=>e.check(zr(Array.isArray(n)?n:[n],o))});function F_(e){return ac(ap,e)}var lp=m("ZodTransform",(e,t)=>{ya.init(e,t),R.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new vt(e.constructor.name);n.addIssue=(i)=>{if(typeof i==="string")n.issues.push(b.issue(i,n.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(b.issue(s))}};let r=t.transform(n.value,n);if(r instanceof Promise)return r.then((i)=>(n.value=i,n));return n.value=r,n}});function eu(e){return new lp({type:"transform",transform:e})}var tu=m("ZodOptional",(e,t)=>{ba.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.innerType});function vo(e){return new tu({type:"optional",innerType:e})}var cp=m("ZodNullable",(e,t)=>{_a.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.innerType});function yo(e){return new cp({type:"nullable",innerType:e})}function Z_(e){return vo(yo(e))}var up=m("ZodDefault",(e,t)=>{ka.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dp(e,t){return new up({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():b.shallowClone(t)}})}var mp=m("ZodPrefault",(e,t)=>{wa.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pp(e,t){return new mp({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():b.shallowClone(t)}})}var ru=m("ZodNonOptional",(e,t)=>{xa.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.innerType});function fp(e,t){return new ru({type:"nonoptional",innerType:e,...b.normalizeParams(t)})}var gp=m("ZodSuccess",(e,t)=>{$a.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.innerType});function G_(e){return new gp({type:"success",innerType:e})}var hp=m("ZodCatch",(e,t)=>{Sa.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vp(e,t){return new hp({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var yp=m("ZodNaN",(e,t)=>{Ia.init(e,t),R.init(e,t)});function W_(e){return ec(yp,e)}var nu=m("ZodPipe",(e,t)=>{Ta.init(e,t),R.init(e,t),e.in=t.in,e.out=t.out});function bo(e,t){return new nu({type:"pipe",in:e,out:t})}var ou=m("ZodCodec",(e,t)=>{nu.init(e,t),hr.init(e,t)});function H_(e,t,n){return new ou({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}var bp=m("ZodReadonly",(e,t)=>{Da.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.innerType});function _p(e){return new bp({type:"readonly",innerType:e})}var kp=m("ZodTemplateLiteral",(e,t)=>{Pa.init(e,t),R.init(e,t)});function V_(e,t){return new kp({type:"template_literal",parts:e,...b.normalizeParams(t)})}var wp=m("ZodLazy",(e,t)=>{Ra.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.getter()});function xp(e){return new wp({type:"lazy",getter:e})}var $p=m("ZodPromise",(e,t)=>{Ea.init(e,t),R.init(e,t),e.unwrap=()=>e._zod.def.innerType});function B_(e){return new $p({type:"promise",innerType:e})}var Sp=m("ZodFunction",(e,t)=>{Oa.init(e,t),R.init(e,t)});function q_(e){return new Sp({type:"function",input:Array.isArray(e?.input)?rp(e?.input):e?.input??wo(Zt()),output:e?.output??Zt()})}var $o=m("ZodCustom",(e,t)=>{za.init(e,t),R.init(e,t)});function J_(e){let t=new Y({check:"custom"});return t._zod.check=e,t}function K_(e,t){return lc($o,e??(()=>!0),t)}function Ip(e,t={}){return cc($o,e,t)}function Tp(e){return uc(e)}function X_(e,t={error:`Input not instance of ${e.name}`}){let n=new $o({type:"custom",check:"custom",fn:(o)=>o instanceof e,abort:!0,...b.normalizeParams(t)});return n._zod.bag.Class=e,n}var Y_=(...e)=>dc({Codec:ou,Boolean:Zr,String:Ur},...e);function Q_(e){let t=xp(()=>Xc([Pc(e),Fm(),Zm(),Vm(),wo(t),np(Pc(),t)]));return t}function ek(e,t){return bo(eu(e),t)}var tk={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function rk(e){ie({customError:e})}function nk(){return ie().customError}var iu;(function(e){})(iu||(iu={}));var su={};ye(su,{bigint:()=>ak,boolean:()=>sk,date:()=>lk,number:()=>ik,string:()=>ok});function ok(e){return Il(Ur,e)}function ik(e){return zl(Fr,e)}function sk(e){return Ll(Zr,e)}function ak(e){return Zl(Gr,e)}function lk(e){return Ql(ko,e)}ie(vr());function E(e){return e}E.schema=So;import{readFileSync as $k}from"node:fs";import{dirname as Sk,join as Ik}from"node:path";import{fileURLToPath as Tk}from"node:url";import{renameSync as ck,writeFileSync as uk,readFileSync as YI,existsSync as au,statSync as dk}from"node:fs";import{dirname as mk}from"node:path";import{mkdirSync as pk}from"node:fs";function Io(e,t){let n=mk(t);if(!au(n))pk(n,{recursive:!0});let o=`${t}.tmp`;uk(o,JSON.stringify(e,null,2),"utf8"),ck(o,t)}function fk(e){let t=0;if(au(e))try{t=dk(e).size}catch{}let n=0;for(let o=1;o<=10;o++)if(au(`${e}.${o}`))n=o;else break;return{path:e,sizeBytes:t,rotatedFiles:n}}function To(e){let t=e.snapshot.counters,n=t.orchestrator_errors?.count??0,o=(t.decisions_skipped_continue?.count??0)+(t.decisions_skipped_no_decision?.count??0)+(t.decisions_skipped_no_message?.count??0)+(t.decisions_skipped_below_threshold?.count??0);return{version:e.version,status:n?"degraded":"healthy",enabled:e.enabled,startedAtISO:e.snapshot.startedAtISO,uptimeMs:e.snapshot.uptimeMs,metrics:{decisionsTaken:t.decisions_taken?.count??0,decisionsStored:t.decisions_stored?.count??0,interventionsDelivered:t.interventions_delivered?.count??0,orchestratorRuns:t.orchestrator_runs?.count??0,orchestratorErrors:n,materializationFailures:t.materialization_failures?.count??0,tier3RemindersSent:t.tier3_reminders_sent?.count??0,tier3SkillsCreated:t.tier3_skills_created?.count??0,lastDecisionISO:t.decisions_taken?.lastOccurrenceISO??null,lastInterventionISO:t.interventions_delivered?.lastOccurrenceISO??null},logFile:fk(e.logFilePath),session:{id:e.sessionID,toolCallsObserved:t.tool_calls_observed?.count??0,violationsDetected:t.protocol_violations_detected?.count??0,interventionsSkipped:o,firstSeenISO:e.snapshot.startedAtISO,lastSeenISO:new Date().toISOString()},graphSync:{lastUpgradeAtISO:null,lastUpgradeResult:"unknown",lastUpgradeTarget:null,lastUpgradeMs:null},graphToolsUsed:{omo_search:0,omo_recall:0,omo_health:0,omo_find:0,omo_impact:0,omo_remember:0,omo_recall_mcp:0,omo_path:0,omo_explain:0,omo_files:0,omo_callers:0,omo_node:0,omo_context:0,omo_affected_cg:0,omo_status:0,omo_unlock:0,omo_mark_dirty:0,omo_sync_if_dirty:0,omo_index:0,omo_visualize:0,omo_serve:0,omo_uninit:0,omo_diagnose:0,omo_merge_graphs:0,omo_save_result:0,omo_extract:0,omo_cluster_only:0,omo_label:0,omo_tree:0,omo_clone:0,omo_add:0,omo_check_update:0,omo_hook_status:0,omo_cli_anything_install:0,omo_cli_anything_list:0,omo_cli_anything_search:0,omo_cli_anything_info:0}}}function Dp(e,t,n=Date.now){let o=-1/0;return{write(r){let i=n();if(i-o<t)return;o=i,e(r)}}}on();import{statSync as Op,existsSync as i0}from"node:fs";import{join as cu}from"node:path";class Pp{client=null;defaultTimeoutMs;toolCache=null;constructor(e={}){this.defaultTimeoutMs=e.defaultTimeoutMs??5000}setClient(e){this.client=e,this.toolCache=null}isReady(){return this.client!==null}async callTool(e,t={},n){let o=Date.now(),r=n??this.defaultTimeoutMs;if(!this.client)return{data:null,timedOut:!1,durationMs:Date.now()-o,error:"MCP client not initialized"};try{let s=(await this.raceWithTimeout(this.client.tool.invoke({toolID:e,input:t}),r,e)).data;return{data:s&&typeof s==="object"&&!Array.isArray(s)?s:null,timedOut:!1,durationMs:Date.now()-o,error:null}}catch(i){return{data:null,timedOut:i instanceof Error&&/timed out/i.test(i.message),durationMs:Date.now()-o,error:i instanceof Error?i.message:String(i)}}}async isAvailable(e){if(!this.client)return!1;if(this.toolCache===null)try{let t=await this.client.tool.list();this.toolCache=new Set((t.data??[]).map((n)=>n.id))}catch{this.toolCache=new Set}return this.toolCache.has(e)}async availableTools(){if(!this.client)return[];if(this.toolCache===null)await this.isAvailable("__bootstrap__");return Array.from(this.toolCache??new Set)}invalidateCache(){this.toolCache=null}raceWithTimeout(e,t,n){return new Promise((o,r)=>{let i=setTimeout(()=>{r(Error(`${n} timed out after ${t}ms`))},t);e.then((s)=>{clearTimeout(i),o(s)},(s)=>{clearTimeout(i),r(s)})})}}var lu=null;function Wr(){if(!lu)lu=new Pp;return lu}function gk(e,t,n,o){let r=t&&n;if(e==="codegraph")return t?{kind:"codegraph",cmd:"codegraph",args:[]}:null;if(e==="graphify")return n?{kind:"graphify",cmd:"graphify",args:[]}:null;if(e==="alternate"&&r)return(o??"").trim().toLowerCase().split("").reduce((a,l)=>a+l.charCodeAt(0),0)%2===0?{kind:"codegraph",cmd:"codegraph",args:[]}:{kind:"graphify",cmd:"graphify",args:[]};if(t)return{kind:"codegraph",cmd:"codegraph",args:[]};if(n)return{kind:"graphify",cmd:"graphify",args:[]};return null}function Ep(e){let t=e.trim().toLowerCase(),n=2166136261;for(let o=0;o<t.length;o++)n^=t.charCodeAt(o),n=n*16777619>>>0;return n.toString(16)}class Rp{timeoutMs;cacheTtlMs;maxEntriesPerSession;cache=new Map;preferredTool;mcpTimeoutMs;preferredMcpServer;constructor(e={}){this.timeoutMs=e.timeoutMs??5000,this.cacheTtlMs=e.cacheTtlMs??300000,this.maxEntriesPerSession=e.maxEntriesPerSession??10,this.preferredTool=e.preferredTool??"auto",this.mcpTimeoutMs=e.mcpTimeoutMs??5000,this.preferredMcpServer=e.preferredMcpServer??"auto"}setPreferredTool(e){this.preferredTool=e}hasCodegraphDir(e){try{return Op(cu(e,".codegraph")).isDirectory()}catch{return!1}}hasGraphifyDir(e){try{return Op(cu(e,"graphify-out")).isDirectory()}catch{return!1}}cacheContext(e,t,n){let o=this.cache.get(e);if(!o)o={entries:new Map},this.cache.set(e,o);let r=Ep(t);o.entries.set(r,{query:t,content:n,insertedAtMs:Date.now()});while(o.entries.size>this.maxEntriesPerSession){let i=o.entries.keys().next().value;if(!i)break;o.entries.delete(i)}}getCachedContext(e,t){let n=this.cache.get(e);if(!n)return null;if(t){let r=Ep(t),i=n.entries.get(r);if(!i)return null;if(Date.now()-i.insertedAtMs>this.cacheTtlMs)return n.entries.delete(r),null;return i.content}let o=null;for(let r of n.entries.values())if(Date.now()-r.insertedAtMs<=this.cacheTtlMs)o=r.content;return o}clear(){this.cache.clear()}clearSession(e){this.cache.delete(e)}kindForServer(e){if(e==="codegraph")return"codegraph";if(e==="graphify")return"graphify";return null}async isMcpServerAvailable(e,t){try{let n=Wr();if(!n.isReady())return!1;return t?await n.isAvailable(t):!0}catch{return!1}}async detectMcpServers(){let[e,t]=await Promise.all([this.isMcpServerAvailable("codegraph","codegraph_search"),this.isMcpServerAvailable("graphify","query_graph")]);return{codegraph:e,graphify:t}}async invokeMCP(e,t,n,o){let r=Date.now();try{let s=await Wr().callTool(t,n,o.timeoutMs);if(s.error||s.data===null)return{kind:this.kindForServer(e),query:o.queryLabel,result:null,timedOut:s.timedOut,durationMs:Date.now()-r};let l=s.data.content,c=null;if(Array.isArray(l)&&l.length>0){let u=l[0];if(typeof u.text==="string")c=u.text}return{kind:this.kindForServer(e),query:o.queryLabel,result:c||null,timedOut:!1,durationMs:Date.now()-r}}catch{return{kind:this.kindForServer(e),query:o?.queryLabel??t,result:null,timedOut:!1,durationMs:Date.now()-r}}}async invoke(e,t,n={}){let o=Date.now(),r=n.timeoutMs??this.timeoutMs,i=this.hasCodegraphDir(e),s=this.hasGraphifyDir(e),a=n.preferredTool??this.preferredTool,l=gk(a,i,s,t);if(n.forceSubprocess!==!0&&l){let g=(n.preferredMcpServer??"auto")==="auto"?l.kind==="codegraph"?"codegraph":"graphify":n.preferredMcpServer;if(g!==null&&await this.isMcpServerAvailable(g)){let d=l.kind==="codegraph"?"codegraph_search":"query_graph",y=l.kind==="codegraph"?{query:t,projectPath:e}:{question:t,project_path:e};return{...await this.invokeMCP(g,d,y,{timeoutMs:r,queryLabel:t}),kind:l.kind}}}let c=null,u=null,f=[];if(l)if(c=l.kind,c==="codegraph")u=n.codegraphBin??"codegraph",f=["explore",t,"--project-path",e];else u=n.graphifyBin??"graphify",f=["query",t,"--graph",cu(e,"graphify-out")];if(!u||!c)return{kind:null,query:t,result:null,timedOut:!1,durationMs:Date.now()-o};try{let g=await this.spawnWithTimeout(u,f,r,e);return{kind:c,query:t,result:g.trim()||null,timedOut:!1,durationMs:Date.now()-o}}catch(g){let d=g instanceof Error&&g.message.includes("timed out");return{kind:c,query:t,result:null,timedOut:d,durationMs:Date.now()-o}}}spawnWithTimeout(e,t,n,o){return nn(e,t,{cwd:o,timeoutMs:n}).then((r)=>{if(r.timedOut)throw Error(`graph retrieval subprocess timed out after ${n}ms`);if(r.code===null)throw Error(`graph retrieval subprocess failed to spawn: ${e}`);if(r.code!==0)throw Error(`graph retrieval subprocess exited ${r.code}: ${r.stderr.slice(0,200)}`);return r.stdout})}async invokeNode(e,t,n={}){return this.invokeCodegraphSubcommand("node",e,t,n)}async invokeCallers(e,t,n={}){return this.invokeCodegraphSubcommand("callers",e,t,n)}async invokeImpact(e,t,n={}){return this.invokeCodegraphSubcommand("impact",e,t,n)}async invokeFiles(e,t={}){return this.invokeCodegraphSubcommand("files",void 0,e,t)}async invokeContext(e,t,n={}){return this.invokeCodegraphSubcommand("context",e,t,n)}async invokeAffected(e,t,n={}){return this.invokeCodegraphSubcommand("affected",e,t,n)}async invokeStatus(e,t={}){return this.invokeCodegraphSubcommand("status",void 0,e,t)}async invokeUnlock(e,t={}){return this.invokeCodegraphSubcommand("unlock",void 0,e,t)}async invokeMarkDirty(e,t={}){return this.invokeCodegraphSubcommand("mark-dirty",void 0,e,t)}async invokeSyncIfDirty(e,t={}){return this.invokeCodegraphSubcommand("sync-if-dirty",void 0,e,t)}async invokeIndex(e,t={}){return this.invokeCodegraphSubcommand("index",void 0,e,t)}async invokeVisualize(e,t={}){return this.invokeCodegraphSubcommand("visualize",void 0,e,t)}async invokeServe(e,t,n={}){return this.invokeCodegraphSubcommand("serve",String(e),t,n)}async invokeUninit(e,t={}){return this.invokeCodegraphSubcommand("uninit",void 0,e,t)}async invokeCodegraphSubcommand(e,t,n,o){let r=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasCodegraphDir(n))return{kind:null,query:t===void 0?e:Array.isArray(t)?t.join(","):t,result:null,timedOut:!1,durationMs:Date.now()-r};let s=o.codegraphBin??"codegraph",a=t===void 0?[]:Array.isArray(t)?t:[t],l=[e,...a,"--project-path",n],c=t===void 0?e:Array.isArray(t)?t.join(","):t;try{let u=await this.spawnWithTimeout(s,l,i,n);return{kind:"codegraph",query:c,result:u.trim()||null,timedOut:!1,durationMs:Date.now()-r}}catch(u){let f=u instanceof Error&&/timed out/i.test(u.message);return{kind:"codegraph",query:c,result:null,timedOut:f,durationMs:Date.now()-r}}}async invokePath(e,t,n,o={}){let r=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(n))return{kind:null,query:`${e} ${t}`,result:null,timedOut:!1,durationMs:Date.now()-r};let s=o.graphifyBin??"graphify",a=["path",e,t];try{let l=await this.spawnWithTimeout(s,a,i,n);return{kind:"graphify",query:`${e} ${t}`,result:l.trim()||null,timedOut:!1,durationMs:Date.now()-r}}catch(l){return{kind:"graphify",query:`${e} ${t}`,result:null,timedOut:l instanceof Error&&/timed out/i.test(l.message),durationMs:Date.now()-r}}}async invokeExplain(e,t,n={}){return this.invokeGraphifySubcommand("explain",e,t,n)}async invokeGraphifySubcommand(e,t,n,o){let r=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(n))return{kind:null,query:t??e,result:null,timedOut:!1,durationMs:Date.now()-r};let s=o.graphifyBin??"graphify",a=t===void 0?[e]:[e,t];try{let l=await this.spawnWithTimeout(s,a,i,n);return{kind:"graphify",query:t??e,result:l.trim()||null,timedOut:!1,durationMs:Date.now()-r}}catch(l){return{kind:"graphify",query:t??e,result:null,timedOut:l instanceof Error&&/timed out/i.test(l.message),durationMs:Date.now()-r}}}async invokeDiagnose(e,t={}){return this.invokeGraphifySubcommand("diagnose",void 0,e,t)}async invokeMergeDriver(e,t={}){return this.invokeGraphifySubcommand("merge-driver",void 0,e,t)}async invokeSaveResult(e,t={}){return this.invokeGraphifySubcommand("save-result",void 0,e,t)}async invokeExtract(e,t={}){return this.invokeGraphifySubcommand("extract",void 0,e,t)}async invokeClusterOnly(e,t={}){return this.invokeGraphifySubcommand("cluster-only",void 0,e,t)}async invokeLabel(e,t,n={}){return this.invokeGraphifySubcommand("label",e,t,n)}async invokeTree(e,t={}){return this.invokeGraphifySubcommand("tree",void 0,e,t)}async invokeClone(e,t={}){return this.invokeGraphifySubcommand("clone",void 0,e,t)}async invokeAdd(e,t,n={}){return this.invokeGraphifySubcommand("add",e,t,n)}async invokeCheckUpdate(e,t={}){return this.invokeGraphifySubcommand("check-update",void 0,e,t)}}var uu=null;function Z(){if(!uu)uu=new Rp;return uu}function zp(e){let t=Z();if(e.preferredTool)t.setPreferredTool(e.preferredTool)}var hk=Z();class Ap{retrieval;constructor(e=hk){this.retrieval=e}async find(e,t,n=5000){let o=Date.now(),r=await this.retrieval.invokeNode(e,t,{timeoutMs:n});if(r.kind==="codegraph"&&r.result)return vk(e,r.result,o,"codegraph");let i=await this.retrieval.invoke(t,e,{timeoutMs:n});if(i.kind==="graphify"&&i.result)return yk(e,i.result,o,"graphify");return{symbol:e,source:null,callers:[],found:!1,kind:r.kind??i.kind,durationMs:Date.now()-o}}async impact(e,t,n=5000){let o=Date.now(),r=await this.retrieval.invokeImpact(e,t,{timeoutMs:n});if(r.kind==="codegraph"&&r.result)return bk(e,r.result,o,"codegraph",r.timedOut);let i=await this.retrieval.invokeCallers(e,t,{timeoutMs:n});if(i.kind==="codegraph"&&i.result)return{symbol:e,directCallers:Do(i.result),transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:new Set(Do(i.result).map((s)=>s.file)).size,kind:"codegraph",durationMs:Date.now()-o,timedOut:i.timedOut};return{symbol:e,directCallers:[],transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:0,kind:r.kind??i.kind,durationMs:Date.now()-o,timedOut:r.timedOut||i.timedOut}}async listFiles(e,t=5000){let n=Date.now(),o=await this.retrieval.invokeFiles(e,{timeoutMs:t});if(o.kind==="codegraph"&&o.result){let r=o.result.split(`
|
|
193
|
+
`).map((i)=>i.trim()).filter(Boolean);return{files:r,count:r.length,kind:"codegraph",durationMs:Date.now()-n}}return{files:[],count:0,kind:o.kind,durationMs:Date.now()-n}}}function vk(e,t,n,o){let r=Do(t),i=t.search(/callers?:|## callers?/i),s=i>0?t.slice(0,i).trim():t.trim();return{symbol:e,source:s||null,callers:r,found:r.length>0||s.length>0,kind:o,durationMs:Date.now()-n}}function yk(e,t,n,o){return{symbol:e,source:t.trim()||null,callers:[],found:t.trim().length>0,kind:o,durationMs:Date.now()-n}}function bk(e,t,n,o,r){let i=Cp(t,/direct\s*callers?:|## direct/i),s=Cp(t,/transitive\s*callers?:|## transitive/i),a=Mp(t,/tests?:|## tests?/i),l=Mp(t,/docs?:|## docs?/i),c=new Set;for(let u of i)c.add(u.file);for(let u of s)c.add(u.file);for(let u of a)c.add(u);for(let u of l)c.add(u);return{symbol:e,directCallers:i,transitiveCallers:s,testFiles:a,docFiles:l,totalAffectedFiles:c.size,kind:o,durationMs:Date.now()-n,timedOut:r}}function Do(e){let t=[],n=e.split(`
|
|
194
|
+
`);for(let o of n){let r=o.match(/^\s*[-*]?\s*([^\s:]+\.[a-z]+):(\d+)(?:[:\s—–-]+(.+))?/i);if(r){let i=r[1]??"",s=r[2]?parseInt(r[2],10):0,a=(r[3]??"").trim();if(i&&s>0)t.push({file:i,line:s,context:a})}}return t}function Cp(e,t){let n=e.split(`
|
|
195
|
+
`),o=!1,r=[];for(let i of n){if(t.test(i)){o=!0;continue}if(o){if(/^#\s/.test(i)&&!t.test(i))break;if(i.trim()===""&&r.length>0)break;r.push(i)}}return Do(r.join(`
|
|
196
|
+
`))}function Mp(e,t){let n=e.split(`
|
|
197
|
+
`),o=!1,r=[];for(let i of n){if(t.test(i)){o=!0;continue}if(o){if(/^#\s/.test(i)&&!t.test(i))break;if(i.trim()===""&&r.length>0)break;let s=i.trim().replace(/^[-*]\s*/,"");if(s.match(/[^\s:]+\.[a-z]+/i))r.push(s)}}return r}var du=null;function mu(){if(!du)du=new Ap;return du}Eo();Lp();var q=E.schema,hu="0.0.0";try{hu=(()=>{try{let e=Sk(Tk(import.meta.url)),t=$k(Ik(e,"..","package.json"),"utf-8"),n=JSON.parse(t);return typeof n.version==="string"?n.version:"0.0.0"}catch{return"0.0.0"}})()}catch{}async function ct(e,t,n,o){try{let r=Z();if(!await r.isMcpServerAvailable(e,t))return null;return(await r.invokeMCP(e,t,n,{timeoutMs:o,queryLabel:t})).result}catch{return null}}async function Dk(e,t,n=1500){if(!vu)return"pending";return await vu.awaitDelivery({sessionID:e,mcpTool:t,timeoutMs:n})}var vu=null;function Fp(e){vu=e}async function Zp(e,t){return await Dk(e,t)}function Gp(e){return E({description:"Semantic code search over the project graph. ROUTING (v0.25.0): with both indexes present, codegraph handles code-structure queries (symbols, call sites, module layout) and graphify "+"handles concept/architecture queries — the plugin alternates deterministically per query, "+"or you can force one via config graphRetrieval.preferredTool. USE THIS for architecture questions, finding call sites, understanding module structure. "+"Prefer over grep/glob for high-level understanding — grep is still better for literal text matches.",args:{query:q.string().min(3).describe("Natural language query describing what you're looking for"),maxResults:q.number().int().min(1).max(20).optional().describe("Max results to return (default 10)")},async execute(t,n){let o=Date.now(),r=await e.graphRetrieval.invoke(e.cwd,t.query,{timeoutMs:8000}),i={tool:"omo_search",query:t.query,kind:r.kind,timedOut:r.timedOut,durationMs:r.durationMs,resultSize:r.result?.length??0,sessionID:n.sessionID};if(r.timedOut)return{title:"omo_search: timeout",output:`Graph search timed out after ${r.durationMs}ms. No graph tools available at ${e.cwd}, or the query is too expensive. Fall back to grep/glob for direct text matching.`,metadata:i};if(!r.result)return{title:"omo_search: no graph backend",output:`No codegraph or graphify directory found at ${e.cwd}. Run \`npx codegraph init\` or \`graphify . --no-viz\` to build the index, then call omo_search again. Until then, use grep/glob for direct text matching.`,metadata:i};return{title:`omo_search: ${r.kind}`,output:r.result,metadata:i}}})}function Wp(e){return E({description:"Search lessons learned in past sessions of this project. Returns ranked lessons (highest confidence first) matching the query. "+"Use before making non-trivial decisions — the answer may already be in memory.",args:{query:q.string().min(2).describe("What kind of lesson you're looking for"),limit:q.number().int().min(1).max(20).optional().describe("Max lessons to return (default 5)")},async execute(t,n){let o=Date.now(),i=(await e.sqlite.smartSearch({query:t.query,limit:t.limit??5})).lessons;if(i.length===0)return{title:"omo_recall: no matches",output:`No past lessons found matching "${t.query}". This is the first time the agent is encountering this question.`,metadata:{tool:"omo_recall",query:t.query,durationMs:Date.now()-o,lessonsFound:0}};let s=i.map((a,l)=>`${l+1}. [${a.id}] confidence=${a.confidence.toFixed(2)}
|
|
198
198
|
${a.title}
|
|
199
199
|
${a.content.slice(0,500)}${a.content.length>500?"...":""}`).join(`
|
|
200
200
|
|
|
201
201
|
`);return{title:`omo_recall: ${i.length} lesson${i.length===1?"":"s"}`,output:`Found ${i.length} past lesson${i.length===1?"":"s"} matching "${t.query}":
|
|
202
202
|
|
|
203
|
-
${s}`,metadata:{tool:"omo_recall",query:t.query,durationMs:Date.now()-o,lessonsFound:i.length}}}})}function
|
|
203
|
+
${s}`,metadata:{tool:"omo_recall",query:t.query,durationMs:Date.now()-o,lessonsFound:i.length}}}})}function Hp(e){return E({description:"Show omo-meta-governor plugin status: enabled, metrics, recent decisions, and current config. Use when the user asks 'is the plugin working?' or to verify that lessons are being persisted.",args:{},async execute(t,n){let o=e.metrics.getMetrics(),r=To({version:hu,enabled:!0,sessionID:n.sessionID??"__unknown__",snapshot:o,logFilePath:e.logFilePath});try{Io(r,e.healthFilePath)}catch{}return{title:"omo_health",output:`# omo-meta-governor v${hu} — Health Report
|
|
204
204
|
|
|
205
205
|
`+`**Status**: ${r.status}
|
|
206
206
|
**Enabled**: ${r.enabled}
|
|
@@ -222,7 +222,7 @@ ${s}`,metadata:{tool:"omo_recall",query:t.query,durationMs:Date.now()-o,lessonsF
|
|
|
222
222
|
- Health JSON: \`${e.healthFilePath}\`
|
|
223
223
|
- Log file: \`${e.logFilePath}\`
|
|
224
224
|
|
|
225
|
-
The health JSON file is updated on every invocation. Run \`cat ${e.healthFilePath}\` to see the full snapshot.`,metadata:{tool:"omo_health",sessionID:n.sessionID,uptimeMs:r.uptimeMs}}}})}function
|
|
225
|
+
The health JSON file is updated on every invocation. Run \`cat ${e.healthFilePath}\` to see the full snapshot.`,metadata:{tool:"omo_health",sessionID:n.sessionID,uptimeMs:r.uptimeMs}}}})}function Vp(e){return E({description:"Find the exact source location and direct callers of a symbol (function, class, method, variable). "+"CODEGRAPH TOOL (v0.25.0): symbol precision lives in codegraph — use this for exact definitions "+"and call sites. USE THIS when you know the exact symbol name and need its source code. Example: omo_find with symbol='UserService.create' returns the file:line of the definition and every call site.",args:{symbol:q.string().min(1).describe("The exact symbol name to find (e.g. 'UserService.create', 'validateToken')")},async execute(t,n){let o=Date.now(),i=await(e.codeGraph??mu()).find(t.symbol,e.cwd,5000),s={tool:"omo_find",symbol:t.symbol,kind:i.kind,found:i.found,callerCount:i.callers.length,durationMs:i.durationMs,sessionID:n.sessionID};if(!i.found)return{title:`omo_find: ${t.symbol} not found`,output:`Symbol "${t.symbol}" was not found in the codebase graph. If .codegraph/ doesn't exist, run \`npx codegraph init\` first. Otherwise, try omo_search with a natural-language description.`,metadata:s};let a=i.source?`
|
|
226
226
|
## Definition
|
|
227
227
|
|
|
228
228
|
\`\`\`
|
|
@@ -237,45 +237,47 @@ ${i.source.slice(0,2000)}
|
|
|
237
237
|
## Direct Callers
|
|
238
238
|
|
|
239
239
|
None found in the indexed graph.`;return{title:`omo_find: ${t.symbol}${i.callers.length>0?` (${i.callers.length} callers)`:""}`,output:`Found definition for "${t.symbol}" (via ${i.kind??"fallback"}).
|
|
240
|
-
`+a+l,metadata:s}}})}function
|
|
240
|
+
`+a+l,metadata:s}}})}function Bp(e){return E({description:"Analyze the impact of changing a symbol. Lists direct callers, transitive callers, and affected test/doc files. CODEGRAPH TOOL (v0.25.0): call-graph analysis is codegraph-only. "+"ALWAYS run this BEFORE modifying a function or class — "+"knows what will break. Example: omo_impact with symbol='validateToken' lists every file that calls validateToken and every test that exercises it.",args:{symbol:q.string().min(1).describe("The symbol to analyze (function, class, method)")},async execute(t,n){let o=Date.now(),r=await ct("codegraph","codegraph_impact",{symbol:t.symbol,depth:2,projectPath:e.cwd},5000);if(r!==null)return{title:`omo_impact: ${t.symbol}`,output:r,metadata:{tool:"omo_impact",symbol:t.symbol,kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.codeGraph??mu()).impact(t.symbol,e.cwd,5000),a={tool:"omo_impact",symbol:t.symbol,kind:s.kind,directCallers:s.directCallers.length,transitiveCallers:s.transitiveCallers.length,testFiles:s.testFiles.length,docFiles:s.docFiles.length,totalAffectedFiles:s.totalAffectedFiles,timedOut:s.timedOut,durationMs:s.durationMs,sessionID:n.sessionID};if(s.totalAffectedFiles===0&&s.directCallers.length===0)return{title:`omo_impact: no callers found for ${t.symbol}`,output:`No call sites found for "${t.symbol}". Either the symbol is unused, or the codegraph index is stale. Run \`npx codegraph sync\` to refresh the index and try again.`,metadata:a};let l=[];if(l.push(`Impact analysis for "${t.symbol}" (via ${s.kind??"fallback"}).
|
|
241
241
|
`),l.push("## Summary"),l.push(`- Direct callers: **${s.directCallers.length}**`),l.push(`- Transitive callers: **${s.transitiveCallers.length}**`),l.push(`- Test files affected: **${s.testFiles.length}**`),l.push(`- Doc files affected: **${s.docFiles.length}**`),l.push(`- Total affected files: **${s.totalAffectedFiles}**
|
|
242
242
|
`),s.directCallers.length>0){l.push("## Direct Callers");for(let c of s.directCallers.slice(0,30))l.push(`- ${c.file}:${c.line}${c.context?` — ${c.context}`:""}`);if(s.directCallers.length>30)l.push(`- ... and ${s.directCallers.length-30} more`);l.push("")}if(s.testFiles.length>0){l.push("## Test Files Affected");for(let c of s.testFiles.slice(0,20))l.push(`- ${c}`);l.push("")}if(s.docFiles.length>0){l.push("## Doc Files Affected");for(let c of s.docFiles.slice(0,20))l.push(`- ${c}`);l.push("")}if(s.timedOut)l.push("⚠️ Analysis timed out — results may be incomplete. Try with a more specific symbol.");return{title:`omo_impact: ${t.symbol} (${s.totalAffectedFiles} files)`,output:l.join(`
|
|
243
|
-
`),metadata:a}}})}function Bp(e){return O({description:"Save a fact, observation, or insight to AgentMemory so it persists across sessions. USE THIS when you learn something worth remembering: a bug pattern, a config quirk, a user preference, a project rule. The system will route the save to AgentMemory's MCP server. Example: omo_remember with content='Always use bun:sqlite, not better-sqlite3' "+"concepts=['storage', 'bun'] — the system will save this to AgentMemory.",args:{content:B.string().min(1).describe("The fact/observation/lesson to remember"),concepts:B.array(B.string()).optional().describe("Tags to categorize this memory (e.g. ['security', 'auth'])"),type:B.enum(["fact","pattern","observation"]).optional().describe("Type of memory: fact, pattern, or observation")},async execute(t,n){let o=n.sessionID;if(!Gt())return{title:"omo_remember: session not initialized",output:"Could not save to AgentMemory: the plugin has not captured the OpenCode session client. Try restarting the plugin or check that the OpenCode session is running.",metadata:{tool:"omo_remember",ok:!1}};let r={content:t.content,concepts:t.concepts??[],type:t.type??"observation"},i=await kt(o,{toolName:"omo_remember",mcpTool:"agentmemory_memory_save",mcpArgs:r,preamble:"Save this to AgentMemory (cross-session persistent memory)."});if(!i.ok)return{title:"omo_remember: failed",output:`Failed to dispatch save to AgentMemory: ${i.error??"unknown error"}`,metadata:{tool:"omo_remember",ok:!1,durationMs:i.durationMs}};e.onDispatch?.({sessionID:o,mcpTool:"agentmemory_memory_save",mcpArgs:r});let s=await Fp(o,"agentmemory_memory_save");return{title:`omo_remember: ${s}`,output:`Save to AgentMemory ${s==="delivered"?"verified":s==="expired"?"not delivered within TTL":"dispatched"} (messageID: ${i.messageID??"pending"}). LLM call to agentmemory_memory_save ${s==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(r)}. It will be available in future sessions via agentmemory_memory_recall.`,metadata:{tool:"omo_remember",ok:!0,messageID:i.messageID,durationMs:i.durationMs,contentLength:t.content.length,deliveryStatus:s}}}})}function qp(e){return O({description:"Search AgentMemory's cross-session memory (via agentmemory_memory_smart_search). USE THIS for questions that need context from PREVIOUS sessions: 'how did we set up X', 'what was the last approach to Y', 'recall the config for Z'. For current-session recall, prefer omo_recall (local SQLite) instead.",args:{query:B.string().min(2).describe("The search query"),limit:B.number().int().min(1).max(20).optional().describe("Max results (default 5)")},async execute(t,n){let o=n.sessionID;if(!Gt())return{title:"omo_recall_mcp: session not initialized",output:"Could not search AgentMemory: session client not captured. Use omo_recall for local session memory instead.",metadata:{tool:"omo_recall_mcp",ok:!1}};let r={query:t.query,limit:t.limit??5},i=await kt(o,{toolName:"omo_recall_mcp",mcpTool:"agentmemory_memory_smart_search",mcpArgs:r,preamble:"Search AgentMemory for this query and report the results."});if(!i.ok)return{title:"omo_recall_mcp: failed",output:`Failed to dispatch search to AgentMemory: ${i.error??"unknown error"}`,metadata:{tool:"omo_recall_mcp",ok:!1,durationMs:i.durationMs}};e.onDispatch?.({sessionID:o,mcpTool:"agentmemory_memory_smart_search",mcpArgs:r});let s=await Fp(o,"agentmemory_memory_smart_search");return{title:`omo_recall_mcp: ${s}`,output:`Search to AgentMemory ${s==="delivered"?"verified":"dispatched"} (messageID: ${i.messageID??"pending"}). LLM call to agentmemory_memory_smart_search ${s==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(r)}. Results will appear in the next assistant message.`,metadata:{tool:"omo_recall_mcp",ok:!0,messageID:i.messageID,durationMs:i.durationMs,query:t.query,deliveryStatus:s}}}})}function Jp(e){return O({description:"Find the shortest conceptual path between two concepts in the codebase "+"using the graphify knowledge graph. GRAPHIFY TOOL (v0.25.0): concept-level relations live in graphify — "+"codegraph cannot answer these. USE THIS to understand how two apparently unrelated parts of the codebase connect. Example: omo_path with from='auth' to='database' traces the chain from authentication handlers to DB queries.",args:{from:B.string().min(1).describe("Start concept"),to:B.string().min(1).describe("End concept")},async execute(t,n){let o=Date.now(),r=await st("graphify","shortest_path",{source:t.from,target:t.to,project_path:e.cwd},8000);if(r!==null)return{title:"omo_path: path found",output:r,metadata:{tool:"omo_path",from:t.from,to:t.to,kind:"graphify",transport:"mcp",durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}};let s=await F().invokePath(t.from,t.to,e.cwd,{timeoutMs:8000});return{title:s.kind==="graphify"?"omo_path: path found":"omo_path: unavailable",output:s.result??`No path found between "${t.from}" and "${t.to}". Check if graphify-out/ exists and is up to date.`,metadata:{tool:"omo_path",from:t.from,to:t.to,kind:s.kind,durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}}}})}function Kp(e){return O({description:"Get a plain-language explanation of a concept from the graphify knowledge graph. "+"GRAPHIFY TOOL (v0.25.0): conceptual overviews live in graphify — codegraph cannot produce them. "+"USE THIS when you encounter an unfamiliar term or module and need a quick overview of what it is and how it fits into the codebase. Example: 'omo_explain SwinTransformer'.",args:{concept:B.string().min(1).describe("The concept to explain")},async execute(t,n){let o=Date.now(),r=await st("graphify","get_node",{label:t.concept,project_path:e.cwd},8000);if(r!==null)return{title:"omo_explain: done",output:r,metadata:{tool:"omo_explain",concept:t.concept,kind:"graphify",transport:"mcp",durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}};let s=await F().invokeExplain(t.concept,e.cwd,{timeoutMs:8000});return{title:s.kind==="graphify"?"omo_explain: done":"omo_explain: unavailable",output:s.result??`Concept "${t.concept}" not found in the knowledge graph. Run \`graphify . --no-viz\` first.`,metadata:{tool:"omo_explain",concept:t.concept,kind:s.kind,durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}}}})}function Xp(e){return O({description:"List files indexed by the codebase graph (codegraph or graphify). USAGE: returns a list of indexed file paths. Use this when you need to discover which files are in the graph before drilling into a specific one.",args:{},async execute(t,n){let o=Date.now(),r=await st("codegraph","codegraph_files",{projectPath:e.cwd},5000);if(r!==null)return{title:"omo_files: codegraph backend",output:r,metadata:{tool:"omo_files",kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??F()).invokeFiles(e.cwd,{timeoutMs:5000});if(!s.result)return{title:"omo_files: no index",output:"No indexed files found. If `.codegraph/` doesn't exist, run `npx codegraph init` first. If `graphify-out/` doesn't exist, run `graphify . --no-viz` first.",metadata:{tool:"omo_files",kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_files: ${s.kind??"unknown"} backend`,output:s.result,metadata:{tool:"omo_files",kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function Yp(e){return O({description:"List all call sites of a symbol in the codebase graph. USAGE: omo_callers with symbol='UserService.create' returns every file:line "+"where that symbol is called. Codegraph-only — returns null if .codegraph/ is missing.",args:{symbol:B.string().min(1).describe("The symbol to find callers for (function, class, method, variable)")},async execute(t,n){let o=Date.now(),r=await st("codegraph","codegraph_callers",{symbol:t.symbol,projectPath:e.cwd},5000);if(r!==null)return{title:`omo_callers: ${t.symbol}`,output:r,metadata:{tool:"omo_callers",symbol:t.symbol,kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??F()).invokeCallers(t.symbol,e.cwd,{timeoutMs:5000});if(!s.result)return{title:`omo_callers: ${t.symbol} (no callers or no codegraph)`,output:`No call sites found for "${t.symbol}". Either the symbol is unused, or codegraph is not installed / has no index. Run \`npx codegraph init\` to create the index.`,metadata:{tool:"omo_callers",symbol:t.symbol,kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_callers: ${t.symbol}`,output:s.result,metadata:{tool:"omo_callers",symbol:t.symbol,kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function Qp(e){return O({description:"Get the source code of a symbol (function/class/method/variable) and its direct callers. USAGE: omo_node with symbol='UserService.create' returns the symbol's definition and "+"every direct call site. Distinct from omo_find (which only returns a definition summary) — "+"this tool returns the full source body. Codegraph-only.",args:{symbol:B.string().min(1).describe("The symbol to resolve (function, class, method, variable)")},async execute(t,n){let o=Date.now(),r=await st("codegraph","codegraph_node",{symbol:t.symbol,projectPath:e.cwd},5000);if(r!==null)return{title:`omo_node: ${t.symbol}`,output:r,metadata:{tool:"omo_node",symbol:t.symbol,kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??F()).invokeNode(t.symbol,e.cwd,{timeoutMs:5000});if(!s.result)return{title:`omo_node: ${t.symbol} not found`,output:`Symbol "${t.symbol}" was not found in the codegraph index. Run \`npx codegraph init\` if the index doesn't exist, or \`npx codegraph sync\` to refresh.`,metadata:{tool:"omo_node",symbol:t.symbol,kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_node: ${t.symbol}`,output:s.result,metadata:{tool:"omo_node",symbol:t.symbol,kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function se(e,t,n,o,r,i){let s=Date.now()-o;if(!n.result)return{title:`${e}: no result`,output:i,metadata:{tool:e,kind:n.kind,durationMs:s,sessionID:r.sessionID,...t}};return{title:e,output:n.result,metadata:{tool:e,kind:n.kind,durationMs:s,sessionID:r.sessionID,...t}}}function ef(e){return O({description:"Get a focused code context window for a given task. USAGE: omo_context with task='validate JWT tokens' returns relevant code blocks (file paths + line ranges). "+"Codegraph-only — returns null if .codegraph/ is missing.",args:{task:B.string().min(1).describe("The task to extract context for")},async execute(t,n){let o=Date.now(),r=await st("codegraph","codegraph_context",{task:t.task,maxNodes:20,projectPath:e.cwd},5000);if(r!==null)return{title:"omo_context",output:r,metadata:{tool:"omo_context",task:t.task,kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??F()).invokeContext(t.task,e.cwd,{timeoutMs:5000});return se("omo_context",{task:t.task},{...s,durationMs:Date.now()-o},o,n,`No context for task "${t.task}". Run \`npx codegraph init\` if the index doesn't exist.`)}})}function tf(e){return O({description:"List files affected by changes in the given source files. USAGE: omo_affected_cg with files=['src/auth.ts'] returns the set of test files, callers, and dependent modules. Codegraph-only.",args:{files:B.array(B.string().min(1)).min(1).describe("Source file paths to analyze (relative to cwd)")},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeAffected(t.files,e.cwd,{timeoutMs:5000});return se("omo_affected_cg",{files:t.files.join(",")},{...i,durationMs:Date.now()-o},o,n,`Could not compute affected files for [${t.files.join(", ")}]. Run \`npx codegraph init\` if needed.`)}})}function rf(e){return O({description:"Show codegraph health: node count, version, last update timestamp. USAGE: omo_status returns a multi-line report. Codegraph-only.",args:{},async execute(t,n){let o=Date.now(),r=await st("codegraph","codegraph_status",{projectPath:e.cwd},5000);if(r!==null)return{title:"omo_status",output:r,metadata:{tool:"omo_status",kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??F()).invokeStatus(e.cwd,{timeoutMs:5000});return se("omo_status",{},{...s,durationMs:Date.now()-o},o,n,"codegraph is not installed or has no index. Run `npx codegraph init` to create one.")}})}function nf(e){return O({description:"Remove a stale codegraph lock file (left behind after a crash). USAGE: omo_unlock clears the lock so the next sync can run. Codegraph-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeUnlock(e.cwd,{timeoutMs:5000});return se("omo_unlock",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function of(e){return O({description:"Mark the codegraph index as dirty so the next sync re-extracts. USAGE: omo_mark_dirty when you know source files changed without git hooks firing.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeMarkDirty(e.cwd,{timeoutMs:5000});return se("omo_mark_dirty",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function sf(e){return O({description:"Trigger a codegraph sync ONLY if the graph was previously marked dirty. USAGE: omo_sync_if_dirty is a cheap daily check; omo_status shows the dirty flag.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeSyncIfDirty(e.cwd,{timeoutMs:30000});return se("omo_sync_if_dirty",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed or no index exists.")}})}function af(e){return O({description:"Manually trigger a full codegraph reindex. USAGE: omo_index when you want a guaranteed-fresh graph (bypasses the dirty-flag check).",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeIndex(e.cwd,{timeoutMs:60000});return se("omo_index",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function lf(e){return O({description:"Generate an HTML visualization of the codegraph. USAGE: omo_visualize returns the path to the generated HTML file.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeVisualize(e.cwd,{timeoutMs:30000});return se("omo_visualize",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function cf(e){return O({description:"Start the codegraph HTTP server on the given port. USAGE: omo_serve with port=3030 starts the server in the background. Returns the port + status.",args:{port:B.number().int().min(1).max(65535).describe("TCP port to bind the codegraph server to")},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeServe(t.port,e.cwd,{timeoutMs:5000});return se("omo_serve",{port:t.port},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function uf(e){return O({description:"Remove the codegraph index (.codegraph/) from disk. "+"USAGE: omo_uninit when you want a clean slate — next sync will rebuild from scratch.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeUninit(e.cwd,{timeoutMs:5000});return se("omo_uninit",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function df(e){return O({description:"Diagnose the graphify graph for inconsistencies, multigraph warnings, and stale nodes. USAGE: omo_diagnose returns a JSON-like report. Graphify-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeDiagnose(e.cwd,{timeoutMs:1e4});return se("omo_diagnose",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed. Run `pip install graphifyy` first.")}})}function mf(e){return O({description:"Run graphify's 3-way merge driver to resolve conflicting graph segments. USAGE: omo_merge_graphs when git reports a conflict in graphify-out/. Graphify-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeMergeDriver(e.cwd,{timeoutMs:30000});return se("omo_merge_graphs",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function pf(e){return O({description:"Persist the result of the last graphify query to disk for later inspection. USAGE: omo_save_result after omo_explain or omo_path returns a useful output.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeSaveResult(e.cwd,{timeoutMs:5000});return se("omo_save_result",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function ff(e){return O({description:"Re-run graphify's semantic extraction over the entire source tree. USAGE: omo_extract when the graph schema changed and you want a fresh semantic layer.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeExtract(e.cwd,{timeoutMs:60000});return se("omo_extract",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function gf(e){return O({description:"Re-run graphify's clustering step (skip semantic extraction). USAGE: omo_cluster_only after minor node additions to refresh the topic map.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeClusterOnly(e.cwd,{timeoutMs:30000});return se("omo_cluster_only",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function hf(e){return O({description:"Apply a label to a graphify node (e.g. for categorization or human notes). USAGE: omo_label with node='validateToken' applies a label.",args:{node:B.string().min(1).describe("The graph node to label")},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeLabel(t.node,e.cwd,{timeoutMs:5000});return se("omo_label",{node:t.node},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function vf(e){return O({description:"Emit a tree visualization of the graphify graph (hierarchical topic layout). USAGE: omo_tree for a structural overview of the topic map. Graphify-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeTree(e.cwd,{timeoutMs:1e4});return se("omo_tree",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function yf(e){return O({description:"Clone the graphify graph to a new location. USAGE: omo_clone when forking a project or creating a backup.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeClone(e.cwd,{timeoutMs:30000});return se("omo_clone",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function bf(e){return O({description:"Add specific files to the graphify graph (instead of re-extracting the whole tree). USAGE: omo_add with files='src/auth.ts src/login.ts' after writing new files.",args:{files:B.string().min(1).describe("Space-separated list of file paths to add (relative to cwd)")},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeAdd(t.files,e.cwd,{timeoutMs:30000});return se("omo_add",{files:t.files},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function _f(e){return O({description:"Check if the graphify schema or extractors changed since the last extraction. USAGE: omo_check_update to decide if re-extraction is needed. Graphify-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??F()).invokeCheckUpdate(e.cwd,{timeoutMs:1e4});return se("omo_check_update",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function kf(e){return O({description:"Check whether the graphify post-commit git hook is installed in this project. USAGE: omo_hook_status returns 'installed' or 'missing' along with the hook path. Run after `git init` to confirm the hook is wired.",args:{},async execute(t,n){let o=Date.now(),{isGraphifyHookInstalled:r}=await Promise.resolve().then(() => (mn(),Cd)),i=await r(e.cwd),s=`${e.cwd}/.git/hooks/post-commit`,a=i?`graphify post-commit hook is INSTALLED at ${s}.`:"graphify post-commit hook is NOT installed. Run `graphify hook install` or enable graphSync in plugin config to install automatically.";return{title:`omo_hook_status: ${i?"installed":"missing"}`,output:a,metadata:{tool:"omo_hook_status",installed:i,hookPath:s,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function Eo(e,t,n,o,r,i){let s=Date.now()-o;if(!n.ok)return{title:`${e}: ${n.code}`,output:`${i}
|
|
243
|
+
`),metadata:a}}})}function qp(e){return E({description:"Save a fact, observation, or insight to AgentMemory so it persists across sessions. USE THIS when you learn something worth remembering: a bug pattern, a config quirk, a user preference, a project rule. The system will route the save to AgentMemory's MCP server. Example: omo_remember with content='Always use bun:sqlite, not better-sqlite3' "+"concepts=['storage', 'bun'] — the system will save this to AgentMemory.",args:{content:q.string().min(1).describe("The fact/observation/lesson to remember"),concepts:q.array(q.string()).optional().describe("Tags to categorize this memory (e.g. ['security', 'auth'])"),type:q.enum(["fact","pattern","observation"]).optional().describe("Type of memory: fact, pattern, or observation")},async execute(t,n){let o=n.sessionID;if(!Wt())return{title:"omo_remember: session not initialized",output:"Could not save to AgentMemory: the plugin has not captured the OpenCode session client. Try restarting the plugin or check that the OpenCode session is running.",metadata:{tool:"omo_remember",ok:!1}};let r={content:t.content,concepts:t.concepts??[],type:t.type??"observation"},i=await lt(o,{toolName:"omo_remember",mcpTool:"agentmemory_memory_save",mcpArgs:r,preamble:"Save this to AgentMemory (cross-session persistent memory)."});if(!i.ok)return{title:"omo_remember: failed",output:`Failed to dispatch save to AgentMemory: ${i.error??"unknown error"}`,metadata:{tool:"omo_remember",ok:!1,durationMs:i.durationMs}};e.onDispatch?.({sessionID:o,mcpTool:"agentmemory_memory_save",mcpArgs:r});let s=await Zp(o,"agentmemory_memory_save");return{title:`omo_remember: ${s}`,output:`Save to AgentMemory ${s==="delivered"?"verified":s==="expired"?"not delivered within TTL":"dispatched"} (messageID: ${i.messageID??"pending"}). LLM call to agentmemory_memory_save ${s==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(r)}. It will be available in future sessions via agentmemory_memory_recall.`,metadata:{tool:"omo_remember",ok:!0,messageID:i.messageID,durationMs:i.durationMs,contentLength:t.content.length,deliveryStatus:s}}}})}function Jp(e){return E({description:"Search AgentMemory's cross-session memory (via agentmemory_memory_smart_search). USE THIS for questions that need context from PREVIOUS sessions: 'how did we set up X', 'what was the last approach to Y', 'recall the config for Z'. For current-session recall, prefer omo_recall (local SQLite) instead.",args:{query:q.string().min(2).describe("The search query"),limit:q.number().int().min(1).max(20).optional().describe("Max results (default 5)")},async execute(t,n){let o=n.sessionID;if(!Wt())return{title:"omo_recall_mcp: session not initialized",output:"Could not search AgentMemory: session client not captured. Use omo_recall for local session memory instead.",metadata:{tool:"omo_recall_mcp",ok:!1}};let r={query:t.query,limit:t.limit??5},i=await lt(o,{toolName:"omo_recall_mcp",mcpTool:"agentmemory_memory_smart_search",mcpArgs:r,preamble:"Search AgentMemory for this query and report the results."});if(!i.ok)return{title:"omo_recall_mcp: failed",output:`Failed to dispatch search to AgentMemory: ${i.error??"unknown error"}`,metadata:{tool:"omo_recall_mcp",ok:!1,durationMs:i.durationMs}};e.onDispatch?.({sessionID:o,mcpTool:"agentmemory_memory_smart_search",mcpArgs:r});let s=await Zp(o,"agentmemory_memory_smart_search");return{title:`omo_recall_mcp: ${s}`,output:`Search to AgentMemory ${s==="delivered"?"verified":"dispatched"} (messageID: ${i.messageID??"pending"}). LLM call to agentmemory_memory_smart_search ${s==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(r)}. Results will appear in the next assistant message.`,metadata:{tool:"omo_recall_mcp",ok:!0,messageID:i.messageID,durationMs:i.durationMs,query:t.query,deliveryStatus:s}}}})}function Kp(e){return E({description:"Find the shortest conceptual path between two concepts in the codebase "+"using the graphify knowledge graph. GRAPHIFY TOOL (v0.25.0): concept-level relations live in graphify — "+"codegraph cannot answer these. USE THIS to understand how two apparently unrelated parts of the codebase connect. Example: omo_path with from='auth' to='database' traces the chain from authentication handlers to DB queries.",args:{from:q.string().min(1).describe("Start concept"),to:q.string().min(1).describe("End concept")},async execute(t,n){let o=Date.now(),r=await ct("graphify","shortest_path",{source:t.from,target:t.to,project_path:e.cwd},8000);if(r!==null)return{title:"omo_path: path found",output:r,metadata:{tool:"omo_path",from:t.from,to:t.to,kind:"graphify",transport:"mcp",durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}};let s=await Z().invokePath(t.from,t.to,e.cwd,{timeoutMs:8000});return{title:s.kind==="graphify"?"omo_path: path found":"omo_path: unavailable",output:s.result??`No path found between "${t.from}" and "${t.to}". Check if graphify-out/ exists and is up to date.`,metadata:{tool:"omo_path",from:t.from,to:t.to,kind:s.kind,durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}}}})}function Xp(e){return E({description:"Get a plain-language explanation of a concept from the graphify knowledge graph. "+"GRAPHIFY TOOL (v0.25.0): conceptual overviews live in graphify — codegraph cannot produce them. "+"USE THIS when you encounter an unfamiliar term or module and need a quick overview of what it is and how it fits into the codebase. Example: 'omo_explain SwinTransformer'.",args:{concept:q.string().min(1).describe("The concept to explain")},async execute(t,n){let o=Date.now(),r=await ct("graphify","get_node",{label:t.concept,project_path:e.cwd},8000);if(r!==null)return{title:"omo_explain: done",output:r,metadata:{tool:"omo_explain",concept:t.concept,kind:"graphify",transport:"mcp",durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}};let s=await Z().invokeExplain(t.concept,e.cwd,{timeoutMs:8000});return{title:s.kind==="graphify"?"omo_explain: done":"omo_explain: unavailable",output:s.result??`Concept "${t.concept}" not found in the knowledge graph. Run \`graphify . --no-viz\` first.`,metadata:{tool:"omo_explain",concept:t.concept,kind:s.kind,durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}}}})}function Yp(e){return E({description:"List files indexed by the codebase graph (codegraph or graphify). USAGE: returns a list of indexed file paths. Use this when you need to discover which files are in the graph before drilling into a specific one.",args:{},async execute(t,n){let o=Date.now(),r=await ct("codegraph","codegraph_files",{projectPath:e.cwd},5000);if(r!==null)return{title:"omo_files: codegraph backend",output:r,metadata:{tool:"omo_files",kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??Z()).invokeFiles(e.cwd,{timeoutMs:5000});if(!s.result)return{title:"omo_files: no index",output:"No indexed files found. If `.codegraph/` doesn't exist, run `npx codegraph init` first. If `graphify-out/` doesn't exist, run `graphify . --no-viz` first.",metadata:{tool:"omo_files",kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_files: ${s.kind??"unknown"} backend`,output:s.result,metadata:{tool:"omo_files",kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function Qp(e){return E({description:"List all call sites of a symbol in the codebase graph. USAGE: omo_callers with symbol='UserService.create' returns every file:line "+"where that symbol is called. Codegraph-only — returns null if .codegraph/ is missing.",args:{symbol:q.string().min(1).describe("The symbol to find callers for (function, class, method, variable)")},async execute(t,n){let o=Date.now(),r=await ct("codegraph","codegraph_callers",{symbol:t.symbol,projectPath:e.cwd},5000);if(r!==null)return{title:`omo_callers: ${t.symbol}`,output:r,metadata:{tool:"omo_callers",symbol:t.symbol,kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??Z()).invokeCallers(t.symbol,e.cwd,{timeoutMs:5000});if(!s.result)return{title:`omo_callers: ${t.symbol} (no callers or no codegraph)`,output:`No call sites found for "${t.symbol}". Either the symbol is unused, or codegraph is not installed / has no index. Run \`npx codegraph init\` to create the index.`,metadata:{tool:"omo_callers",symbol:t.symbol,kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_callers: ${t.symbol}`,output:s.result,metadata:{tool:"omo_callers",symbol:t.symbol,kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function ef(e){return E({description:"Get the source code of a symbol (function/class/method/variable) and its direct callers. USAGE: omo_node with symbol='UserService.create' returns the symbol's definition and "+"every direct call site. Distinct from omo_find (which only returns a definition summary) — "+"this tool returns the full source body. Codegraph-only.",args:{symbol:q.string().min(1).describe("The symbol to resolve (function, class, method, variable)")},async execute(t,n){let o=Date.now(),r=await ct("codegraph","codegraph_node",{symbol:t.symbol,projectPath:e.cwd},5000);if(r!==null)return{title:`omo_node: ${t.symbol}`,output:r,metadata:{tool:"omo_node",symbol:t.symbol,kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??Z()).invokeNode(t.symbol,e.cwd,{timeoutMs:5000});if(!s.result)return{title:`omo_node: ${t.symbol} not found`,output:`Symbol "${t.symbol}" was not found in the codegraph index. Run \`npx codegraph init\` if the index doesn't exist, or \`npx codegraph sync\` to refresh.`,metadata:{tool:"omo_node",symbol:t.symbol,kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_node: ${t.symbol}`,output:s.result,metadata:{tool:"omo_node",symbol:t.symbol,kind:s.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function se(e,t,n,o,r,i){let s=Date.now()-o;if(!n.result)return{title:`${e}: no result`,output:i,metadata:{tool:e,kind:n.kind,durationMs:s,sessionID:r.sessionID,...t}};return{title:e,output:n.result,metadata:{tool:e,kind:n.kind,durationMs:s,sessionID:r.sessionID,...t}}}function tf(e){return E({description:"Get a focused code context window for a given task. USAGE: omo_context with task='validate JWT tokens' returns relevant code blocks (file paths + line ranges). "+"Codegraph-only — returns null if .codegraph/ is missing.",args:{task:q.string().min(1).describe("The task to extract context for")},async execute(t,n){let o=Date.now(),r=await ct("codegraph","codegraph_context",{task:t.task,maxNodes:20,projectPath:e.cwd},5000);if(r!==null)return{title:"omo_context",output:r,metadata:{tool:"omo_context",task:t.task,kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??Z()).invokeContext(t.task,e.cwd,{timeoutMs:5000});return se("omo_context",{task:t.task},{...s,durationMs:Date.now()-o},o,n,`No context for task "${t.task}". Run \`npx codegraph init\` if the index doesn't exist.`)}})}function rf(e){return E({description:"List files affected by changes in the given source files. USAGE: omo_affected_cg with files=['src/auth.ts'] returns the set of test files, callers, and dependent modules. Codegraph-only.",args:{files:q.array(q.string().min(1)).min(1).describe("Source file paths to analyze (relative to cwd)")},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeAffected(t.files,e.cwd,{timeoutMs:5000});return se("omo_affected_cg",{files:t.files.join(",")},{...i,durationMs:Date.now()-o},o,n,`Could not compute affected files for [${t.files.join(", ")}]. Run \`npx codegraph init\` if needed.`)}})}function nf(e){return E({description:"Show codegraph health: node count, version, last update timestamp. USAGE: omo_status returns a multi-line report. Codegraph-only.",args:{},async execute(t,n){let o=Date.now(),r=await ct("codegraph","codegraph_status",{projectPath:e.cwd},5000);if(r!==null)return{title:"omo_status",output:r,metadata:{tool:"omo_status",kind:"codegraph",transport:"mcp",durationMs:Date.now()-o,sessionID:n.sessionID}};let s=await(e.graphRetrieval??Z()).invokeStatus(e.cwd,{timeoutMs:5000});return se("omo_status",{},{...s,durationMs:Date.now()-o},o,n,"codegraph is not installed or has no index. Run `npx codegraph init` to create one.")}})}function of(e){return E({description:"Remove a stale codegraph lock file (left behind after a crash). USAGE: omo_unlock clears the lock so the next sync can run. Codegraph-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeUnlock(e.cwd,{timeoutMs:5000});return se("omo_unlock",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function sf(e){return E({description:"Mark the codegraph index as dirty so the next sync re-extracts. USAGE: omo_mark_dirty when you know source files changed without git hooks firing.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeMarkDirty(e.cwd,{timeoutMs:5000});return se("omo_mark_dirty",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function af(e){return E({description:"Trigger a codegraph sync ONLY if the graph was previously marked dirty. USAGE: omo_sync_if_dirty is a cheap daily check; omo_status shows the dirty flag.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeSyncIfDirty(e.cwd,{timeoutMs:30000});return se("omo_sync_if_dirty",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed or no index exists.")}})}function lf(e){return E({description:"Manually trigger a full codegraph reindex. USAGE: omo_index when you want a guaranteed-fresh graph (bypasses the dirty-flag check).",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeIndex(e.cwd,{timeoutMs:60000});return se("omo_index",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function cf(e){return E({description:"Generate an HTML visualization of the codegraph. USAGE: omo_visualize returns the path to the generated HTML file.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeVisualize(e.cwd,{timeoutMs:30000});return se("omo_visualize",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function uf(e){return E({description:"Start the codegraph HTTP server on the given port. USAGE: omo_serve with port=3030 starts the server in the background. Returns the port + status.",args:{port:q.number().int().min(1).max(65535).describe("TCP port to bind the codegraph server to")},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeServe(t.port,e.cwd,{timeoutMs:5000});return se("omo_serve",{port:t.port},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function df(e){return E({description:"Remove the codegraph index (.codegraph/) from disk. "+"USAGE: omo_uninit when you want a clean slate — next sync will rebuild from scratch.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeUninit(e.cwd,{timeoutMs:5000});return se("omo_uninit",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function mf(e){return E({description:"Diagnose the graphify graph for inconsistencies, multigraph warnings, and stale nodes. USAGE: omo_diagnose returns a JSON-like report. Graphify-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeDiagnose(e.cwd,{timeoutMs:1e4});return se("omo_diagnose",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed. Run `pip install graphifyy` first.")}})}function pf(e){return E({description:"Run graphify's 3-way merge driver to resolve conflicting graph segments. USAGE: omo_merge_graphs when git reports a conflict in graphify-out/. Graphify-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeMergeDriver(e.cwd,{timeoutMs:30000});return se("omo_merge_graphs",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function ff(e){return E({description:"Persist the result of the last graphify query to disk for later inspection. USAGE: omo_save_result after omo_explain or omo_path returns a useful output.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeSaveResult(e.cwd,{timeoutMs:5000});return se("omo_save_result",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function gf(e){return E({description:"Re-run graphify's semantic extraction over the entire source tree. USAGE: omo_extract when the graph schema changed and you want a fresh semantic layer.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeExtract(e.cwd,{timeoutMs:60000});return se("omo_extract",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function hf(e){return E({description:"Re-run graphify's clustering step (skip semantic extraction). USAGE: omo_cluster_only after minor node additions to refresh the topic map.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeClusterOnly(e.cwd,{timeoutMs:30000});return se("omo_cluster_only",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function vf(e){return E({description:"Apply a label to a graphify node (e.g. for categorization or human notes). USAGE: omo_label with node='validateToken' applies a label.",args:{node:q.string().min(1).describe("The graph node to label")},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeLabel(t.node,e.cwd,{timeoutMs:5000});return se("omo_label",{node:t.node},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function yf(e){return E({description:"Emit a tree visualization of the graphify graph (hierarchical topic layout). USAGE: omo_tree for a structural overview of the topic map. Graphify-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeTree(e.cwd,{timeoutMs:1e4});return se("omo_tree",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function bf(e){return E({description:"Clone the graphify graph to a new location. USAGE: omo_clone when forking a project or creating a backup.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeClone(e.cwd,{timeoutMs:30000});return se("omo_clone",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function _f(e){return E({description:"Add specific files to the graphify graph (instead of re-extracting the whole tree). USAGE: omo_add with files='src/auth.ts src/login.ts' after writing new files.",args:{files:q.string().min(1).describe("Space-separated list of file paths to add (relative to cwd)")},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeAdd(t.files,e.cwd,{timeoutMs:30000});return se("omo_add",{files:t.files},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function kf(e){return E({description:"Check if the graphify schema or extractors changed since the last extraction. USAGE: omo_check_update to decide if re-extraction is needed. Graphify-only.",args:{},async execute(t,n){let o=Date.now(),i=await(e.graphRetrieval??Z()).invokeCheckUpdate(e.cwd,{timeoutMs:1e4});return se("omo_check_update",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function wf(e){return E({description:"Check whether the graphify post-commit git hook is installed in this project. USAGE: omo_hook_status returns 'installed' or 'missing' along with the hook path. Run after `git init` to confirm the hook is wired.",args:{},async execute(t,n){let o=Date.now(),{isGraphifyHookInstalled:r}=await Promise.resolve().then(() => (pn(),Md)),i=await r(e.cwd),s=`${e.cwd}/.git/hooks/post-commit`,a=i?`graphify post-commit hook is INSTALLED at ${s}.`:"graphify post-commit hook is NOT installed. Run `graphify hook install` or enable graphSync in plugin config to install automatically.";return{title:`omo_hook_status: ${i?"installed":"missing"}`,output:a,metadata:{tool:"omo_hook_status",installed:i,hookPath:s,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function Ro(e,t,n,o,r,i){let s=Date.now()-o;if(!n.ok)return{title:`${e}: ${n.code}`,output:`${i}
|
|
244
244
|
|
|
245
245
|
Diagnostic: ${n.code}
|
|
246
|
-
stderr: ${n.stderr||"(empty)"}`,metadata:{tool:e,code:n.code,durationMs:s,sessionID:r.sessionID,...t}};let a=n.data!==null&&n.data!==void 0?typeof n.data==="string"?n.data:JSON.stringify(n.data,null,2):n.rawOutput??"";return{title:e,output:a,metadata:{tool:e,code:n.code,durationMs:s,sessionID:r.sessionID,...t}}}function wf(e){return O({description:"Install a CLI from the CLI-Anything hub so the agent can drive that software. USAGE: omo_cli_anything_install with name='gimp' installs `cli-anything-gimp`, which exposes a `cli-anything-gimp` command. Browse the catalog with omo_cli_anything_list. See https://github.com/HKUDS/CLI-Anything for the full registry.",args:{name:B.string().min(1).describe("The CLI name to install (e.g. 'gimp', 'blender', 'drawio')")},async execute(t,n){let o=Date.now(),{installCli:r}=await Promise.resolve().then(() => (Dt(),tr)),i=r(t.name,e.runner,120000,"cli-hub");return Eo("omo_cli_anything_install",{name:t.name},{...i,durationMs:Date.now()-o},o,n,`Could not install '${t.name}'. Check that cli-anything-hub is installed (omo_health) and the name is correct.`)}})}function xf(e){return O({description:"List all CLIs available in the CLI-Anything hub (40+ GUI software harnesses). USAGE: omo_cli_anything_list with category='image' returns only image-related CLIs. Returns JSON with name, version, description, category, install_cmd, entry_point. See https://github.com/HKUDS/CLI-Anything.",args:{category:B.string().optional().describe("Optional category filter (e.g. 'image', 'devops', '3d', 'audio')"),source:B.enum(["harness","public","npm","all"]).optional().describe("Optional source filter. 'all' includes harness + public + npm.")},async execute(t,n){let o=Date.now(),{listClis:r}=await Promise.resolve().then(() => (Dt(),tr)),i=r({category:t.category,source:t.source},e.runner,30000,"cli-hub");return Eo("omo_cli_anything_list",{category:t.category,source:t.source},{...i,durationMs:Date.now()-o},o,n,"Could not list CLIs from the hub. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function $f(e){return O({description:"Search the CLI-Anything hub for CLIs matching a query (name, description, or category). USAGE: omo_cli_anything_search with query='cad' returns CAD-related CLIs. Returns JSON array. See https://github.com/HKUDS/CLI-Anything.",args:{query:B.string().min(1).describe("Search query (matches name, description, or category)")},async execute(t,n){let o=Date.now(),{searchClis:r}=await Promise.resolve().then(() => (Dt(),tr)),i=r(t.query,e.runner,30000,"cli-hub");return Eo("omo_cli_anything_search",{query:t.query},{...i,durationMs:Date.now()-o},o,n,"Search failed. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function Sf(e){return O({description:"Show details for a specific CLI in the CLI-Anything hub. USAGE: omo_cli_anything_info with name='blender' returns display name, version, description, requirements (e.g. 'blender (apt install blender)'), entry point, install command. See https://github.com/HKUDS/CLI-Anything.",args:{name:B.string().min(1).describe("The CLI name to look up")},async execute(t,n){let o=Date.now(),{infoCli:r}=await Promise.resolve().then(() => (Dt(),tr)),i=r(t.name,e.runner,1e4,"cli-hub");return Eo("omo_cli_anything_info",{name:t.name},{...i,durationMs:Date.now()-o},o,n,`Could not find '${t.name}' in the hub. Try omo_cli_anything_search to find similar names.`)}})}Oo();class hu{entries=new Map;deliveredCount=0;expiredCount=0;register(e){this.cleanup();let t=`deliv-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,n=If(e.mcpArgs);return this.entries.set(t,{id:t,sessionID:e.sessionID,mcpTool:e.mcpTool,mcpArgsHash:n,registeredAt:Date.now(),ttlMs:e.ttlMs??1e4}),t}markDelivered(e){this.cleanup();let t=e.mcpArgs?If(e.mcpArgs):null;for(let[n,o]of this.entries){if(o.sessionID!==e.sessionID)continue;if(o.mcpTool!==e.mcpTool)continue;if(t!==null&&o.mcpArgsHash!==t)continue;return this.entries.delete(n),this.deliveredCount++,n}return null}async awaitDelivery(e){let t=e.timeoutMs??2000,n=Date.now();while(Date.now()-n<t){if(this.cleanup(),![...this.entries.values()].find((r)=>r.sessionID===e.sessionID&&r.mcpTool===e.mcpTool))return"delivered";await Pk(50)}return"expired"}getStats(){return{pending:this.entries.size,delivered:this.deliveredCount,expired:this.expiredCount}}clearSession(e){for(let[t,n]of this.entries)if(n.sessionID===e)this.entries.delete(t)}cleanup(){let e=Date.now();for(let[t,n]of this.entries)if(e-n.registeredAt>n.ttlMs)this.entries.delete(t),this.expiredCount++}}function If(e){return JSON.stringify(e,Object.keys(e).sort())}function Pk(e){return new Promise((t)=>setTimeout(t,e))}pt();Kt();import{resolve as nx}from"node:path";import{readFileSync as Ok}from"node:fs";import{dirname as Ek,resolve as Rk}from"node:path";import{fileURLToPath as zk}from"node:url";var Tf="0.0.0";try{let e=Ek(zk(import.meta.url)),t=Rk(e,"..","package.json"),n=JSON.parse(Ok(t,"utf8"));if(typeof n.version==="string"&&n.version.length>0)Tf=n.version}catch{}var de=Tf,Df=["decisions_taken","decisions_skipped_continue","decisions_skipped_no_decision","decisions_skipped_no_message","decisions_skipped_below_threshold","interventions_delivered","interventions_disabled_done","interventions_disabled_cap","decisions_stored","plan_reminders_injected","bot_feedback_injected","violations_injected","protocol_audits_passed","protocol_violations_detected","git_commit_reindex","orchestrator_runs","orchestrator_errors","materialization_failures","tier3_reminders_sent","tier3_skills_created","tool_calls_observed","governance_blocks","governance_asks","governance_tools_hidden","governance_tools_rewritten","governance_commands_blocked"];function Pf(){let e={};for(let t of Df)e[t]={count:0,lastOccurrenceISO:null};return e}var Ck=Pf(),eT=new Date().toISOString();function Of(e){let t=e??{},n=Pf(),o=new Date().toISOString(),r=t.version??de,i=t.global===!0;return{inc(s){let a=n[s];if(!a)return;if(a.count++,a.lastOccurrenceISO=new Date().toISOString(),i){let l=Ck[s];if(l)l.count++,l.lastOccurrenceISO=a.lastOccurrenceISO}},getMetrics(){return{version:r,sessionID:t.sessionID??"",startedAtISO:o,uptimeMs:Date.now()-new Date(o).getTime(),counters:{...n}}},reset(){for(let s of Df)n[s]={count:0,lastOccurrenceISO:null}}}}function Ef(e,t){for(let n of t)try{if(new RegExp(n).test(e))return n}catch{}return null}function Mk(e){let n=e.replace(/^\*\*\//,"").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(n)}function Rf(e,t){for(let n of t)try{if(Mk(n).test(e))return n}catch{}return null}function Ak(e,t){let n;try{n=new URL(e).host}catch{return null}for(let o of t)if(n===o||n.endsWith("."+o)||n.includes(o))return o;return null}function zf(e,t){let n=Ef(e,t.bashDenyPatterns??[]);if(n!==null)return{decision:"deny",reason:'bash command matches deny pattern "'+n+'"'};let o=Ef(e,t.bashAskPatterns??[]);if(o!==null)return{decision:"ask",reason:'bash command matches ask pattern "'+o+'"'};return null}function Cf(e,t){let n=Rf(e,t.editDenyPaths??[]);if(n!==null)return{decision:"deny",reason:'edit path matches deny pattern "'+n+'"'};let o=Rf(e,t.editAskPaths??[]);if(o!==null)return{decision:"ask",reason:'edit path matches ask pattern "'+o+'"'};return null}function Mf(e,t){let n=Ak(e,t.webfetchDenyHosts??[]);if(n!==null)return{decision:"deny",reason:'webfetch host matches deny pattern "'+n+'"'};return null}async function Af(e,t,n,o){if(!n||n.mode===void 0)return;if(!n.mode)return;let r;switch(e.type){case"bash":r=zf(e.command,n);break;case"edit":r=Cf(e.pattern,n);break;case"webfetch":r=Mf(e.url,n);break;default:return}if(r===null)return;if(t.status=r.decision,r.decision==="deny")o.inc("governance_blocks");else o.inc("governance_asks")}async function Nf(e,t,n,o){if(!n.enabled)return;if(n.hideToolIDs?.includes(e.toolID)){t.description="",o.inc("governance_tools_hidden");return}if(n.descriptionSuffix)t.description=(t.description??"")+n.descriptionSuffix,o.inc("governance_tools_rewritten");let r=n.parameterOverrides?.[e.toolID];if(!r||!t.parameters?.properties)return;for(let[i,s]of Object.entries(r))if(t.parameters.properties[i])t.parameters.properties[i].description=s}async function jf(e,t,n,o){if(!n.enabled)return;if(n.denyPatterns?.length)for(let r of n.denyPatterns)try{if(new RegExp(r).test(e.command))throw o.inc("governance_commands_blocked"),Error('[meta-governor] blocked command matching pattern "'+r+'"')}catch(i){if((i instanceof Error?i.message:String(i)).includes("blocked command matching"))throw i}if(n.replacementPrefix)t.parts.push({type:"text",text:n.replacementPrefix+" executing: "+e.command,synthetic:!0})}async function Uf(e,t,n){if(!n.enabled)return;if(!n.modelID||!n.providerID)return;let o=e.provider.models??{},r=Object.values(o).find((i)=>typeof i==="object"&&i!==null&&i.id===n.modelID);if(r)t.model=r}import{homedir as Gk}from"node:os";import{join as Wk}from"node:path";function _u(e){let t={enabled:!1,...e},n=di(),o=mi(),r=fn();return{enabled:t.enabled===!0,memory:{enabled:!0,query:t.memory?.query??"meta_governor_context",timeoutMs:t.memory?.timeoutMs??t.memory?.agentmemoryTimeoutMs??2000},tokenPredictor:{compactBurnRateThreshold:t.tokenPredictor?.compactBurnRateThreshold??500,compactUsageThreshold:t.tokenPredictor?.compactUsageThreshold??0.85,switchModelUsageThreshold:t.tokenPredictor?.switchModelUsageThreshold??0.95,delegateConsecutiveHighBurn:t.tokenPredictor?.delegateConsecutiveHighBurn??5},scoring:{...n,...t.scoring?.continueThreshold!==void 0?{continueThreshold:t.scoring.continueThreshold}:{},...t.scoring?.warnThreshold!==void 0?{warnThreshold:t.scoring.warnThreshold}:{},...t.scoring?.escalateThreshold!==void 0?{escalateThreshold:t.scoring.escalateThreshold}:{},...t.scoring?.stopThreshold!==void 0?{stopThreshold:t.scoring.stopThreshold}:{},...t.scoring?.paralysisThreshold!==void 0?{paralysisThreshold:t.scoring.paralysisThreshold}:{},...t.scoring?.defaultEscalationTarget!==void 0?{defaultEscalationTarget:t.scoring.defaultEscalationTarget}:{},oracleFrequency:t.oracle?.frequency??t.scoring?.oracleFrequency??"per-stop"},closedLoop:{...r,...t.closedLoop?.enabled!==void 0?{enabled:t.closedLoop.enabled}:{},...t.closedLoop?.minSeverityToLearn!==void 0?{minSeverityToLearn:t.closedLoop.minSeverityToLearn}:{},...t.closedLoop?.maxLessonsPerSession!==void 0?{maxLessonsPerSession:t.closedLoop.maxLessonsPerSession}:{},...t.closedLoop?.saveDecisions!==void 0?{saveDecisions:t.closedLoop.saveDecisions}:{},...t.closedLoop?.saveLessons!==void 0?{saveLessons:t.closedLoop.saveLessons}:{}},decision:{...o,...t.decision?.maxHistoryPerSession!==void 0?{maxHistoryPerSession:t.decision.maxHistoryPerSession}:{},...t.decision?.forceContinueAfterStops!==void 0?{forceContinueAfterStops:t.decision.forceContinueAfterStops}:{},...t.decision?.warnMessageTemplate!==void 0?{warnMessageTemplate:t.decision.warnMessageTemplate}:{},...t.decision?.escalateMessageTemplate!==void 0?{escalateMessageTemplate:t.decision.escalateMessageTemplate}:{},...t.decision?.stopMessageTemplate!==void 0?{stopMessageTemplate:t.decision.stopMessageTemplate}:{}},modelOverride:t.modelOverride?{providerID:t.modelOverride.providerID,modelID:t.modelOverride.modelID,modelLimit:t.modelOverride.modelLimit,temperature:t.modelOverride.temperature??0.2,topP:t.modelOverride.topP??1,maxTokens:t.modelOverride.maxTokens??2048,reasoning:t.modelOverride.reasoning??!1,verbosity:t.modelOverride.verbosity??"minimal"}:void 0,intervention:{mode:t.intervention?.mode??"silent",includeDecisionHistory:t.intervention?.includeDecisionHistory??!0,maxHistoryMessages:t.intervention?.maxHistoryMessages??5,minActionForMessage:t.intervention?.minActionForMessage??"stop",maxInterventionsPerSession:t.intervention?.maxInterventionsPerSession??3,respectDoneSignal:t.intervention?.respectDoneSignal??!0,phaseAwareDoneSignal:t.intervention?.phaseAwareDoneSignal??!1,persistToSession:t.intervention?.persistToSession??!0,compactionLoopGuard:{enabled:t.intervention?.compactionLoopGuard?.enabled??!0,maxOverflowRecoveries:Math.max(1,t.intervention?.compactionLoopGuard?.maxOverflowRecoveries??1)}},postWave:{enabled:t.postWave?.enabled??t.intervention?.phaseAwareDoneSignal===!0,repoMode:t.postWave?.repoMode??"auto",aasToolPrefix:t.postWave?.aasToolPrefix??"aas",ciTimeoutMs:t.postWave?.ciTimeoutMs??600000,maxRetriesPerWave:t.postWave?.maxRetriesPerWave??1,reinjectCooldownMs:t.postWave?.reinjectCooldownMs??60000,respectSilentMode:t.postWave?.respectSilentMode??!1,...t.postWave?.ownRepoDirective!==void 0?{ownRepoDirective:t.postWave.ownRepoDirective}:{},...t.postWave?.thirdPartyDirective!==void 0?{thirdPartyDirective:t.postWave.thirdPartyDirective}:{}},protocolEnforcement:{enabled:t.protocolEnforcement?.enabled??!1,path:t.protocolEnforcement?.path,injectIntoSystem:t.protocolEnforcement?.injectIntoSystem??!1,auditToolCalls:t.protocolEnforcement?.auditToolCalls??!1},skillPriming:{enabled:t.skillPriming?.enabled??!0,trigger:t.skillPriming?.trigger??"firstImplement",router:t.skillPriming?.router??"registry",enforceMode:t.skillPriming?.enforceMode??"directive"},skillHub:{enabled:t.skillHub?.enabled??!1,syncIntervalMs:t.skillHub?.syncIntervalMs??86400000,bootstrapUrl:t.skillHub?.bootstrapUrl??"https://skills-library.com/api/skills.json",searchFallbackUrl:t.skillHub?.searchFallbackUrl??"https://skills.sh/api/search",downloadBaseUrl:t.skillHub?.downloadBaseUrl??"https://skills.sh/api/download",embedBaseUrl:t.skillHub?.embedBaseUrl??"http://127.0.0.1:3114/v1",embedModel:t.skillHub?.embedModel??"bge-m3",minInstalls:t.skillHub?.minInstalls??0,filterDuplicates:t.skillHub?.filterDuplicates!==!1,depsCheck:t.skillHub?.depsCheck!==!1,choreDir:t.skillHub?.choreDir??Wk(Gk(),".agents","skills"),autoMaterialize:t.skillHub?.autoMaterialize??!0},graphSync:{killOrphanedOnInit:t.graphSync?.killOrphanedOnInit??!0,reindexOnFetch:t.graphSync?.reindexOnFetch!==!1,fetchBranch:t.graphSync?.fetchBranch??"main",autoUpgrade:t.graphSync?.autoUpgrade!==!1,upgradeCachePath:t.graphSync?.upgradeCachePath,checkGraphifyNeedsUpdate:t.graphSync?.checkGraphifyNeedsUpdate!==!1,addToGlobalGraph:t.graphSync?.addToGlobalGraph===!0},graphRetrieval:{preferredTool:t.graphRetrieval?.preferredTool??"auto",preferLocalCodegraph:t.graphRetrieval?.preferLocalCodegraph===!0,contextRouting:t.graphRetrieval?.contextRouting===!0},cliAnything:{enabled:t.cliAnything?.enabled!==!1,autoInstall:t.cliAnything?.autoInstall!==!1,autoUpgrade:t.cliAnything?.autoUpgrade!==!1,cachePath:t.cliAnything?.cachePath,upgradeCheckTtlMs:t.cliAnything?.upgradeCheckTtlMs,cliHubBin:t.cliAnything?.cliHubBin??"cli-hub",skillsBin:t.cliAnything?.skillsBin??"npx skills",installScope:t.cliAnything?.installScope??"global"},governance:{permissionPolicy:t.governance?.permissionPolicy?{mode:t.governance.permissionPolicy.mode,bashDenyPatterns:t.governance.permissionPolicy.bashDenyPatterns,bashAskPatterns:t.governance.permissionPolicy.bashAskPatterns,editDenyPaths:t.governance.permissionPolicy.editDenyPaths,editAskPaths:t.governance.permissionPolicy.editAskPaths,webfetchDenyHosts:t.governance.permissionPolicy.webfetchDenyHosts}:void 0,toolRewrite:{enabled:t.governance?.toolRewrite?.enabled??!0,descriptionSuffix:t.governance?.toolRewrite?.descriptionSuffix,hideToolIDs:t.governance?.toolRewrite?.hideToolIDs,parameterOverrides:t.governance?.toolRewrite?.parameterOverrides},commandFilter:{enabled:t.governance?.commandFilter?.enabled??!0,denyPatterns:t.governance?.commandFilter?.denyPatterns,replacementPrefix:t.governance?.commandFilter?.replacementPrefix},smallModelOverride:t.governance?.smallModelOverride?{enabled:t.governance.smallModelOverride.enabled,modelID:t.governance.smallModelOverride.modelID,providerID:t.governance.smallModelOverride.providerID}:void 0}}}function vT(e){if(!e)return!1;if(e.enabled===!0)return!0;return e.meta_governor?.enabled===!0}async function yT(e={}){let{loadMetaGovernorConfig:t}=await Promise.resolve().then(() => (bu(),Vf)),n=await t(e);return _u(n.config)}bu();var at=new Map,Ro=new Map;function ku(e,t){at.set(e,t);let n=Ro.get(e)??[];if(n.push(t.historyEntry),n.length>20)n.splice(0,n.length-20);Ro.set(e,n)}function Wt(e){let t=at.get(e);if(t!==void 0)at.delete(e);return t}function Bf(e){return at.get(e)}function _T(e){return at.has(e)}function kT(){for(let[e,t]of at)return at.delete(e),t;return}function wT(){at.clear(),Ro.clear()}function qf(e){return Ro.get(e)??[]}class wu{store=new Map;maxEntries;ttlMs;now;constructor(e={}){this.maxEntries=e.maxEntries??100,this.ttlMs=e.ttlMs??3600000,this.now=e.now??Date.now}get(e){let t=this.store.get(e);if(!t)return;let n=this.now();if(t.expiresAtMs<=n){this.store.delete(e);return}return t.lastAccessAtMs=n,t.value}has(e){return this.get(e)!==void 0}set(e,t){let n=this.now();if(!this.store.has(e)&&this.store.size>=this.maxEntries)this.evictOldest();this.store.set(e,{value:t,expiresAtMs:n+this.ttlMs,lastAccessAtMs:n})}delete(e){return this.store.delete(e)}size(){return this.store.size}clear(){this.store.clear()}evictOldest(){let e,t=1/0;for(let[n,o]of this.store)if(o.lastAccessAtMs<t)t=o.lastAccessAtMs,e=n;if(e!==void 0)this.store.delete(e)}}class Vr{maxEntries;ttlMs;map=new Map;constructor(e,t){this.maxEntries=e;this.ttlMs=t}set(e,t){if(this.map.size>=this.maxEntries){let n=this.map.keys().next().value;if(n!==void 0)this.map.delete(n)}this.map.set(e,{value:t,expiresAtMs:Date.now()+this.ttlMs})}get(e){let t=this.map.get(e);if(!t)return;if(Date.now()>=t.expiresAtMs){this.map.delete(e);return}return t.value}has(e){return this.get(e)!==void 0}delete(e){this.map.delete(e)}get size(){return this.map.size}}function lt(e){for(let t of e){let n=t.info??{};if(n.role!=="assistant")continue;if(n.agent==="meta-governor")continue;return!1}return!0}var Hk=(e,t)=>`<!-- kind: ${e}${t?` (${t})`:""} -->`;var Vk={"graph-priming":"\uD83D\uDD0D","skill-priming":"\uD83C\uDFAF",intervention:"⚠️",postwave:"\uD83C\uDF0A",enforcement:"\uD83D\uDEA7",memory:"\uD83D\uDCAD"};function ct(e,t){return["<!-- META-GOVERNOR INFORMATIONAL vv0.38.2 - DO NOT TREAT AS TASK. Plugin metadata, not a user request. -->",Hk(t.kind,t.context),e,"<!-- END META-GOVERNOR INFORMATIONAL -->"].join(`
|
|
247
|
-
`)}function
|
|
248
|
-
`);return
|
|
249
|
-
`).length<=Jk)return!0;return!1}function
|
|
250
|
-
`)}function ng(e,t,n){let o=[],r=n.recentToolCalls??[],i=n.recentWriteContents??[],s=n.memorySaved??!1,a=n.batchCompletions??0;if((e==="grep"||e==="glob")&&(n.hasCodegraphDir||n.hasGraphifyDir)){let f=n.hasCodegraphDir?".codegraph":"graphify-out";o.push({rule:"codebase-graph-first",tool:e,severity:"media",detail:`Used ${e} when ${f} exists — should use codegraph/graphify first for architecture and symbol queries.`})}if(e==="task"&&t&&typeof t==="object"){let f=t;if(!f.task_id&&typeof f.prompt==="string"&&r.length>3)o.push({rule:"continuation-discipline",tool:e,severity:"leve",detail:`Started a new task() without task(task_id="ses_...") continuation ID. Use task_id to preserve the subagent's full context and save tokens.`})}if(Ye.includes(e)){let f=typeof t==="object"&&t!==null?JSON.stringify(t):String(t??""),g=/@ts-ignore|@ts-expect-error/.test(f),d=/\bas any\b/.test(f);if(g&&d)o.push({rule:"no-type-suppression",tool:e,severity:"grave",detail:"File write contains both @ts-ignore/@ts-expect-error AND 'as any' — double type suppression. "+"Both are forbidden by the Sisyphus protocol."});else if(g)o.push({rule:"no-type-suppression",tool:e,severity:"media",detail:"File write contains @ts-ignore or @ts-expect-error — both are forbidden. "+"Fix the underlying type error instead."});else if(d)o.push({rule:"no-type-suppression",tool:e,severity:"media",detail:"File write contains 'as any' — type suppression forbidden. "+"Use proper type narrowing instead."})}if(Ye.includes(e)){let f=typeof t==="object"&&t!==null?JSON.stringify(t):String(t??"");if(/catch\s*\(\s*\w+\s*\)\s*\{\s*\}/.test(f))o.push({rule:"no-empty-catch",tool:e,severity:"media",detail:"Empty catch block detected — `catch(e) {}` is forbidden. "+"Log the error or handle it gracefully."})}if(["codegraph_explore","graphify query"].includes(e)&&r.length>=2){if(!s)o.push({rule:"save-discovery-to-memory",tool:e,severity:"leve",detail:`Used ${e} to discover code but no memory save was made afterwards. Save non-obvious findings with agentmemory_memory_save so future sessions benefit.`})}if(a>0&&e!=="todowrite")o.push({rule:"no-batch-todo-completion",tool:e,severity:"leve",detail:"Batch todo completion detected. Each todo must be marked `completed` immediately "+"after finishing — do not batch-complete multiple items."});if(n.emptyRecall&&!n.escalationAttempted){if(e.startsWith("question")||e==="ask")o.push({rule:"empty-result-escalation",tool:e,severity:"grave",detail:"Memory recall returned empty but agent did not fire smart_search + export before asking the user. Steps 1-3 of empty-result escalation protocol are mandatory."})}let c=["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"];if(!n.memoryToolsUsed.some((f)=>c.some((g)=>f.startsWith(g)))&&(e.startsWith("question")||e==="ask"))o.push({rule:"memory-first",tool:e,severity:"grave",detail:"Asked a question without first querying memory. Must fire agentmemory_memory_recall or agentmemory_memory_smart_search before asking the user."});if(n.filesChanged>=3&&!n.oracleInvoked&&Ye.includes(e))o.push({rule:"oracle-verification",tool:e,severity:"media",detail:`Files changed (${n.filesChanged}) >= 3 but Oracle was not invoked. The POST-TASK ORACLE VERIFICATION protocol requires Oracle invocation on multi-file changes.`});return o}import{stat as Dw}from"fs";import{stat as Pw,readdir as Ow}from"fs/promises";import{EventEmitter as Ew}from"events";import*as A from"path";import{stat as Qk,lstat as og,readdir as ew,realpath as tw}from"node:fs/promises";import{Readable as rw}from"node:stream";import{resolve as ig,relative as nw,join as ow,sep as iw}from"node:path";var De={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},$u={root:".",fileFilter:(e)=>!0,directoryFilter:(e)=>!0,type:De.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze($u);var cg="READDIRP_RECURSIVE_ERROR",sw=new Set(["ENOENT","EPERM","EACCES","ELOOP",cg]),sg=[De.DIR_TYPE,De.EVERYTHING_TYPE,De.FILE_DIR_TYPE,De.FILE_TYPE],aw=new Set([De.DIR_TYPE,De.EVERYTHING_TYPE,De.FILE_DIR_TYPE]),lw=new Set([De.EVERYTHING_TYPE,De.FILE_DIR_TYPE,De.FILE_TYPE]),cw=(e)=>sw.has(e.code),uw=process.platform==="win32",ag=(e)=>!0,lg=(e)=>{if(e===void 0)return ag;if(typeof e==="function")return e;if(typeof e==="string"){let t=e.trim();return(n)=>n.basename===t}if(Array.isArray(e)){let t=e.map((n)=>n.trim());return(n)=>t.some((o)=>n.basename===o)}return ag};class ug extends rw{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...$u,...e},{root:n,type:o}=t;this._fileFilter=lg(t.fileFilter),this._directoryFilter=lg(t.directoryFilter);let r=t.lstat?og:Qk;if(uw)this._stat=(i)=>r(i,{bigint:!0});else this._stat=r;this._maxDepth=t.depth??$u.depth,this._wantsDir=o?aw.has(o):!1,this._wantsFile=o?lw.has(o):!1,this._wantsEverything=o===De.EVERYTHING_TYPE,this._root=ig(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(this.reading)return;this.reading=!0;try{while(!this.destroyed&&e>0){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:o,depth:r}=t,i=n.splice(0,e).map((a)=>this._formatEntry(a,o)),s=await Promise.all(i);for(let a of s){if(!a)continue;if(this.destroyed)return;let l=await this._getEntryType(a);if(l==="directory"&&this._directoryFilter(a)){if(r<=this._maxDepth)this.parents.push(this._exploreDir(a.fullPath,r+1));if(this._wantsDir)this.push(a),e--}else if((l==="file"||this._includeAsFile(a))&&this._fileFilter(a)){if(this._wantsFile)this.push(a),e--}}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}async _exploreDir(e,t){let n;try{n=await ew(e,this._rdOptions)}catch(o){this._onError(o)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n,o=this._isDirent?e.name:e;try{let r=ig(ow(t,o));n={path:nw(this._root,r),fullPath:r,basename:o},n[this._statsProp]=this._isDirent?e:await this._stat(r)}catch(r){this._onError(r);return}return n}_onError(e){if(cw(e)&&!this.destroyed)this.emit("warn",e);else this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let n=e.fullPath;try{let o=await tw(n),r=await og(o);if(r.isFile())return"file";if(r.isDirectory()){let i=o.length;if(n.startsWith(o)&&n.substr(i,1)===iw){let s=Error(`Circular symlink detected: "${n}" points to "${o}"`);return s.code=cg,this._onError(s)}return"directory"}}catch(o){return this._onError(o),""}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}function dg(e,t={}){let n=t.entryType||t.type;if(n==="both")n=De.FILE_DIR_TYPE;if(n)t.type=n;if(!e)throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");else if(typeof e!=="string")throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");else if(n&&!sg.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${sg.join(", ")}`);return t.root=e,new ug(t)}import{watchFile as dw,unwatchFile as mg,watch as mw}from"fs";import{open as pw,stat as fg,lstat as fw,realpath as Su}from"fs/promises";import*as ee from"path";import{type as gw}from"os";var hw="data",Du="end",gg="close",Ao=()=>{};var No=process.platform,Pu=No==="win32",vw=No==="darwin",yw=No==="linux",bw=No==="freebsd",hg=gw()==="OS400",Q={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},ze=Q,_w="watch",kw={lstat:fw,stat:fg},wt="listeners",zo="errHandlers",Ht="rawEmitters",ww=[wt,zo,Ht],xw=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),$w=(e)=>xw.has(ee.extname(e).slice(1).toLowerCase()),Tu=(e,t)=>{if(e instanceof Set)e.forEach(t);else t(e)},Br=(e,t,n)=>{let o=e[t];if(!(o instanceof Set))e[t]=o=new Set([o]);o.add(n)},Sw=(e)=>(t)=>{let n=e[t];if(n instanceof Set)n.clear();else delete e[t]},qr=(e,t,n)=>{let o=e[t];if(o instanceof Set)o.delete(n);else if(o===n)delete e[t]},vg=(e)=>e instanceof Set?e.size===0:!e,Co=new Map;function pg(e,t,n,o,r){let i=(s,a)=>{if(n(e),r(s,a,{watchedPath:e}),a&&e!==a)Mo(ee.resolve(e,a),wt,ee.join(e,a))};try{return mw(e,{persistent:t.persistent},i)}catch(s){o(s);return}}var Mo=(e,t,n,o,r)=>{let i=Co.get(e);if(!i)return;Tu(i[t],(s)=>{s(n,o,r)})},Iw=(e,t,n,o)=>{let{listener:r,errHandler:i,rawEmitter:s}=o,a=Co.get(t),l;if(!n.persistent){if(l=pg(e,n,r,i,s),!l)return;return l.close.bind(l)}if(a)Br(a,wt,r),Br(a,zo,i),Br(a,Ht,s);else{if(l=pg(e,n,Mo.bind(null,t,wt),i,Mo.bind(null,t,Ht)),!l)return;l.on(ze.ERROR,async(c)=>{let u=Mo.bind(null,t,zo);if(a)a.watcherUnusable=!0;if(Pu&&c.code==="EPERM")try{await(await pw(e,"r")).close(),u(c)}catch(f){}else u(c)}),a={listeners:r,errHandlers:i,rawEmitters:s,watcher:l},Co.set(t,a)}return()=>{if(qr(a,wt,r),qr(a,zo,i),qr(a,Ht,s),vg(a.listeners))a.watcher.close(),Co.delete(t),ww.forEach(Sw(a)),a.watcher=void 0,Object.freeze(a)}},Iu=new Map,Tw=(e,t,n,o)=>{let{listener:r,rawEmitter:i}=o,s=Iu.get(t),a=s&&s.options;if(a&&(a.persistent<n.persistent||a.interval>n.interval))mg(t),s=void 0;if(s)Br(s,wt,r),Br(s,Ht,i);else s={listeners:r,rawEmitters:i,options:n,watcher:dw(t,n,(l,c)=>{Tu(s.rawEmitters,(f)=>{f(ze.CHANGE,t,{curr:l,prev:c})});let u=l.mtimeMs;if(l.size!==c.size||u>c.mtimeMs||u===0)Tu(s.listeners,(f)=>f(e,l))})},Iu.set(t,s);return()=>{if(qr(s,wt,r),qr(s,Ht,i),vg(s.listeners))Iu.delete(t),mg(t),s.options=s.watcher=void 0,Object.freeze(s)}};class Ou{constructor(e){this.fsw=e,this._boundHandleError=(t)=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,o=ee.dirname(e),r=ee.basename(e);this.fsw._getWatchedDir(o).add(r);let s=ee.resolve(e),a={persistent:n.persistent};if(!t)t=Ao;let l;if(n.usePolling){let c=n.interval!==n.binaryInterval;a.interval=c&&$w(r)?n.binaryInterval:n.interval,l=Tw(e,s,a,{listener:t,rawEmitter:this.fsw._emitRaw})}else l=Iw(e,s,a,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return l}_handleFile(e,t,n){if(this.fsw.closed)return;let o=ee.dirname(e),r=ee.basename(e),i=this.fsw._getWatchedDir(o),s=t;if(i.has(r))return;let a=async(c,u)=>{if(!this.fsw._throttle(_w,e,5))return;if(!u||u.mtimeMs===0)try{let f=await fg(e);if(this.fsw.closed)return;let{atimeMs:g,mtimeMs:d}=f;if(!g||g<=d||d!==s.mtimeMs)this.fsw._emit(ze.CHANGE,e,f);if((vw||yw||bw)&&s.ino!==f.ino){this.fsw._closeFile(c),s=f;let y=this._watchWithNodeFs(e,a);if(y)this.fsw._addPathCloser(c,y)}else s=f}catch(f){this.fsw._remove(o,r)}else if(i.has(r)){let{atimeMs:f,mtimeMs:g}=u;if(!f||f<=g||g!==s.mtimeMs)this.fsw._emit(ze.CHANGE,e,u);s=u}},l=this._watchWithNodeFs(e,a);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ze.ADD,e,0))return;this.fsw._emit(ze.ADD,e,t)}return l}async _handleSymlink(e,t,n,o){if(this.fsw.closed)return;let r=e.fullPath,i=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let s;try{s=await Su(n)}catch(a){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;if(i.has(o)){if(this.fsw._symlinkPaths.get(r)!==s)this.fsw._symlinkPaths.set(r,s),this.fsw._emit(ze.CHANGE,n,e.stats)}else i.add(o),this.fsw._symlinkPaths.set(r,s),this.fsw._emit(ze.ADD,n,e.stats);return this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(r))return!0;this.fsw._symlinkPaths.set(r,!0)}_handleRead(e,t,n,o,r,i,s){if(e=ee.join(e,""),s=this.fsw._throttle("readdir",e,1000),!s)return;let a=this.fsw._getWatchedDir(n.path),l=new Set,c=this.fsw._readdirp(e,{fileFilter:(u)=>n.filterPath(u),directoryFilter:(u)=>n.filterDir(u)});if(!c)return;return c.on(hw,async(u)=>{if(this.fsw.closed){c=void 0;return}let f=u.path,g=ee.join(e,f);if(l.add(f),u.stats.isSymbolicLink()&&await this._handleSymlink(u,e,g,f))return;if(this.fsw.closed){c=void 0;return}if(f===o||!o&&!a.has(f))this.fsw._incrReadyCount(),g=ee.join(r,ee.relative(r,g)),this._addToNodeFs(g,t,n,i+1)}).on(ze.ERROR,this._boundHandleError),new Promise((u,f)=>{if(!c)return f();c.once(Du,()=>{if(this.fsw.closed){c=void 0;return}let g=s?s.clear():!1;if(u(void 0),a.getChildren().filter((d)=>d!==e&&!l.has(d)).forEach((d)=>{this.fsw._remove(e,d)}),c=void 0,g)this._handleRead(e,!1,n,o,r,i,s)})})}async _handleDir(e,t,n,o,r,i,s){let a=this.fsw._getWatchedDir(ee.dirname(e)),l=a.has(ee.basename(e));if(!(n&&this.fsw.options.ignoreInitial)&&!r&&!l)this.fsw._emit(ze.ADD_DIR,e,t);a.add(ee.basename(e)),this.fsw._getWatchedDir(e);let c,u,f=this.fsw.options.depth;if((f==null||o<=f)&&!this.fsw._symlinkPaths.has(s)){if(!r){if(await this._handleRead(e,n,i,r,e,o,c),this.fsw.closed)return}u=this._watchWithNodeFs(e,(g,d)=>{if(d&&d.mtimeMs===0)return;this._handleRead(g,!1,i,r,e,o,c)})}return u}async _addToNodeFs(e,t,n,o,r){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let s=this.fsw._getWatchHelpers(e);if(n)s.filterPath=(a)=>n.filterPath(a),s.filterDir=(a)=>n.filterDir(a);try{let a=await kw[s.statMethod](s.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(s.watchPath,a))return i(),!1;let l=this.fsw.options.followSymlinks,c;if(a.isDirectory()){let u=ee.resolve(e),f=l?await Su(e):e;if(this.fsw.closed)return;if(c=await this._handleDir(s.watchPath,a,t,o,r,s,f),this.fsw.closed)return;if(u!==f&&f!==void 0)this.fsw._symlinkPaths.set(u,f)}else if(a.isSymbolicLink()){let u=l?await Su(e):e;if(this.fsw.closed)return;let f=ee.dirname(s.watchPath);if(this.fsw._getWatchedDir(f).add(s.watchPath),this.fsw._emit(ze.ADD,s.watchPath,a),c=await this._handleDir(f,a,t,o,e,s,u),this.fsw.closed)return;if(u!==void 0)this.fsw._symlinkPaths.set(ee.resolve(e),u)}else c=this._handleFile(s.watchPath,a,t);if(i(),c)this.fsw._addPathCloser(e,c);return!1}catch(a){if(this.fsw._handleError(a))return i(),e}}}/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */var Eu="/",Rw="//",xg=".",zw="..",Cw="string",Mw=/\\/g,yg=/\/\//,Aw=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Nw=/^\.[/\\]/;function jo(e){return Array.isArray(e)?e:[e]}var Ru=(e)=>typeof e==="object"&&e!==null&&!(e instanceof RegExp);function jw(e){if(typeof e==="function")return e;if(typeof e==="string")return(t)=>e===t;if(e instanceof RegExp)return(t)=>e.test(t);if(typeof e==="object"&&e!==null)return(t)=>{if(e.path===t)return!0;if(e.recursive){let n=A.relative(e.path,t);if(!n)return!1;return!n.startsWith("..")&&!A.isAbsolute(n)}return!1};return()=>!1}function Uw(e){if(typeof e!=="string")throw Error("string expected");e=A.normalize(e),e=e.replace(/\\/g,"/");let t=!1;if(e.startsWith("//"))t=!0;let n=/\/\//;while(e.match(n))e=e.replace(n,"/");if(t)e="/"+e;return e}function bg(e,t,n){let o=Uw(t);for(let r=0;r<e.length;r++){let i=e[r];if(i(o,n))return!0}return!1}function Lw(e,t){if(e==null)throw TypeError("anymatch: specify first argument");let o=jo(e).map((r)=>jw(r));if(t==null)return(r,i)=>bg(o,r,i);return bg(o,t)}var _g=(e)=>{let t=jo(e).flat();if(!t.every((n)=>typeof n===Cw))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map($g)},kg=(e)=>{let t=e.replace(Mw,Eu),n=!1;if(t.startsWith(Rw))n=!0;while(t.match(yg))t=t.replace(yg,Eu);if(n)t=Eu+t;return t},$g=(e)=>kg(A.normalize(kg(e))),wg=(e="")=>(t)=>{if(typeof t==="string")return $g(A.isAbsolute(t)?t:A.join(e,t));else return t},Fw=(e,t)=>{if(A.isAbsolute(e))return e;return A.join(t,e)},Zw=Object.freeze(new Set);class Sg{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;if(!t)return;if(e!==xg&&e!==zw)t.add(e)}async remove(e){let{items:t}=this;if(!t)return;if(t.delete(e),t.size>0)return;let n=this.path;try{await Ow(n)}catch(o){if(this._removeWatcher)this._removeWatcher(A.dirname(n),A.basename(n))}}has(e){let{items:t}=this;if(!t)return;return t.has(e)}getChildren(){let{items:e}=this;if(!e)return[];return[...e.values()]}dispose(){this.items.clear(),this.path="",this._removeWatcher=Ao,this.items=Zw,Object.freeze(this)}}var Gw="stat",Ww="lstat";class Ig{constructor(e,t,n){this.fsw=n;let o=e;this.path=e=e.replace(Nw,""),this.watchPath=o,this.fullWatchPath=A.resolve(o),this.dirParts=[],this.dirParts.forEach((r)=>{if(r.length>1)r.pop()}),this.followSymlinks=t,this.statMethod=t?Gw:Ww}entryPath(e){return A.join(this.watchPath,A.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class Tg extends Ew{constructor(e={}){super();this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2000,pollInterval:100},o={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?jo(e.ignored):jo([]),awaitWriteFinish:t===!0?n:typeof t==="object"?{...n,...t}:!1};if(hg)o.usePolling=!0;if(o.atomic===void 0)o.atomic=!o.usePolling;let r=process.env.CHOKIDAR_USEPOLLING;if(r!==void 0){let a=r.toLowerCase();if(a==="false"||a==="0")o.usePolling=!1;else if(a==="true"||a==="1")o.usePolling=!0;else o.usePolling=!!a}let i=process.env.CHOKIDAR_INTERVAL;if(i)o.interval=Number.parseInt(i,10);let s=0;this._emitReady=()=>{if(s++,s>=this._readyCount)this._emitReady=Ao,this._readyEmitted=!0,process.nextTick(()=>this.emit(Q.READY))},this._emitRaw=(...a)=>this.emit(Q.RAW,...a),this._boundRemove=this._remove.bind(this),this.options=o,this._nodeFsHandler=new Ou(this),Object.freeze(o)}_addIgnoredPath(e){if(Ru(e)){for(let t of this._ignoredPaths)if(Ru(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==="string"){for(let t of this._ignoredPaths)if(Ru(t)&&t.path===e)this._ignoredPaths.delete(t)}}add(e,t,n){let{cwd:o}=this.options;this.closed=!1,this._closePromise=void 0;let r=_g(e);if(o)r=r.map((i)=>Fw(i,o));if(r.forEach((i)=>{this._removeIgnoredPath(i)}),this._userIgnored=void 0,!this._readyCount)this._readyCount=0;return this._readyCount+=r.length,Promise.all(r.map(async(i)=>{let s=await this._nodeFsHandler._addToNodeFs(i,!n,void 0,0,t);if(s)this._emitReady();return s})).then((i)=>{if(this.closed)return;i.forEach((s)=>{if(s)this.add(A.dirname(s),A.basename(t||s))})}),this}unwatch(e){if(this.closed)return this;let t=_g(e),{cwd:n}=this.options;return t.forEach((o)=>{if(!A.isAbsolute(o)&&!this._closers.has(o)){if(n)o=A.join(n,o);o=A.resolve(o)}if(this._closePath(o),this._addIgnoredPath(o),this._watched.has(o))this._addIgnoredPath({path:o,recursive:!0});this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach((t)=>t.forEach((n)=>{let o=n();if(o instanceof Promise)e.push(o)})),this._streams.forEach((t)=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach((t)=>t.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{return}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let r=(this.options.cwd?A.relative(this.options.cwd,n):n)||xg;e[r]=t.getChildren().sort()}),e}emitWithAll(e,t){if(this.emit(e,...t),e!==Q.ERROR)this.emit(Q.ALL,e,...t)}async _emit(e,t,n){if(this.closed)return;let o=this.options;if(Pu)t=A.normalize(t);if(o.cwd)t=A.relative(o.cwd,t);let r=[t];if(n!=null)r.push(n);let i=o.awaitWriteFinish,s;if(i&&(s=this._pendingWrites.get(t)))return s.lastChange=new Date,this;if(o.atomic){if(e===Q.UNLINK)return this._pendingUnlinks.set(t,[e,...r]),setTimeout(()=>{this._pendingUnlinks.forEach((a,l)=>{this.emit(...a),this.emit(Q.ALL,...a),this._pendingUnlinks.delete(l)})},typeof o.atomic==="number"?o.atomic:100),this;if(e===Q.ADD&&this._pendingUnlinks.has(t))e=Q.CHANGE,this._pendingUnlinks.delete(t)}if(i&&(e===Q.ADD||e===Q.CHANGE)&&this._readyEmitted){let a=(l,c)=>{if(l)e=Q.ERROR,r[0]=l,this.emitWithAll(e,r);else if(c){if(r.length>1)r[1]=c;else r.push(c);this.emitWithAll(e,r)}};return this._awaitWriteFinish(t,i.stabilityThreshold,e,a),this}if(e===Q.CHANGE){if(!this._throttle(Q.CHANGE,t,50))return this}if(o.alwaysStat&&n===void 0&&(e===Q.ADD||e===Q.ADD_DIR||e===Q.CHANGE)){let a=o.cwd?A.join(o.cwd,t):t,l;try{l=await Pw(a)}catch(c){}if(!l||this.closed)return;r.push(l)}return this.emitWithAll(e,r),this}_handleError(e){let t=e&&e.code;if(e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES"))this.emit(Q.ERROR,e);return e||this.closed}_throttle(e,t,n){if(!this._throttled.has(e))this._throttled.set(e,new Map);let o=this._throttled.get(e);if(!o)throw Error("invalid throttle");let r=o.get(t);if(r)return r.count++,!1;let i,s=()=>{let l=o.get(t),c=l?l.count:0;if(o.delete(t),clearTimeout(i),l)clearTimeout(l.timeoutObject);return c};i=setTimeout(s,n);let a={timeoutObject:i,clear:s,count:0};return o.set(t,a),a}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,o){let r=this.options.awaitWriteFinish;if(typeof r!=="object")return;let i=r.pollInterval,s,a=e;if(this.options.cwd&&!A.isAbsolute(e))a=A.join(this.options.cwd,e);let l=new Date,c=this._pendingWrites;function u(f){Dw(a,(g,d)=>{if(g||!c.has(e)){if(g&&g.code!=="ENOENT")o(g);return}let y=Number(new Date);if(f&&d.size!==f.size)c.get(e).lastChange=y;let x=c.get(e);if(y-x.lastChange>=t)c.delete(e),o(void 0,d);else s=setTimeout(u,i,d)})}if(!c.has(e))c.set(e,{lastChange:l,cancelWait:()=>(c.delete(e),clearTimeout(s),n)}),s=setTimeout(u,i)}_isIgnored(e,t){if(this.options.atomic&&Aw.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,r=(this.options.ignored||[]).map(wg(n)),s=[...[...this._ignoredPaths].map(wg(n)),...r];this._userIgnored=Lw(s,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new Ig(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=A.resolve(e);if(!this._watched.has(t))this._watched.set(t,new Sg(t,this._boundRemove));return this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;return Boolean(Number(e.mode)&256)}_remove(e,t,n){let o=A.join(e,t),r=A.resolve(o);if(n=n!=null?n:this._watched.has(o)||this._watched.has(r),!this._throttle("remove",o,100))return;if(!n&&this._watched.size===1)this.add(e,t,!0);this._getWatchedDir(o).getChildren().forEach((f)=>this._remove(o,f));let a=this._getWatchedDir(e),l=a.has(t);if(a.remove(t),this._symlinkPaths.has(r))this._symlinkPaths.delete(r);let c=o;if(this.options.cwd)c=A.relative(this.options.cwd,o);if(this.options.awaitWriteFinish&&this._pendingWrites.has(c)){if(this._pendingWrites.get(c).cancelWait()===Q.ADD)return}this._watched.delete(o),this._watched.delete(r);let u=n?Q.UNLINK_DIR:Q.UNLINK;if(l&&!this._isIgnored(o))this._emit(u,o);this._closePath(o)}_closePath(e){this._closeFile(e);let t=A.dirname(e);this._getWatchedDir(t).remove(A.basename(e))}_closeFile(e){let t=this._closers.get(e);if(!t)return;t.forEach((n)=>n()),this._closers.delete(e)}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);if(!n)n=[],this._closers.set(e,n);n.push(t)}_readdirp(e,t){if(this.closed)return;let n={type:Q.ALL,alwaysStat:!0,lstat:!0,...t,depth:0},o=dg(e,n);return this._streams.add(o),o.once(gg,()=>{o=void 0}),o.once(Du,()=>{if(o)this._streams.delete(o),o=void 0}),o}}function Dg(e,t={}){let n=new Tg(t);return n.add(e),n}import{existsSync as Hw}from"node:fs";var Vw=/^[A-Z]:[\\/](pagefile\.sys|DumpStack\.log\.tmp|hiberfil\.sys|swapfile\.sys)/i;async function Pg(e){if(!e.projectDir||!Hw(e.projectDir))return{stop:async()=>{}};let t=(i)=>i.endsWith("SKILL.md"),n=Dg(e.projectDir,{ignoreInitial:!0,usePolling:!0,interval:100,binaryInterval:100,ignored:(i)=>Vw.test(i)}),o=!1,r=new Promise((i)=>{n.once("ready",()=>{if(!o)i()})});return n.on("add",(i)=>{if(!o&&t(i))e.onChange(i,"add")}),n.on("change",(i)=>{if(!o&&t(i))e.onChange(i,"change")}),await r,await new Promise((i)=>setTimeout(i,100)),{async stop(){o=!0,await n.close()}}}var Bw=[/^[A-Z]:[\\/](pagefile\.sys|DumpStack\.log\.tmp)/i,/^[A-Z]:[\\/](Users|home)[\\/][^\\/]+[\\/]AppData[\\/]Local[\\/]Temp[\\/]/i,/^\/(var|private\/var)\/folders\//,/^\/snap\//],qw=new Set(["EINVAL","ENOENT","EACCES","EBADF","EPERM"]),Uo=null;function Og(e={}){let t=Object.keys(e).length===0;if(t&&Uo)return Uo;let n=e.paths??Bw,o=e.errorCodes??qw,r=e.logger??console,i=(u)=>{let f=u&&typeof u==="object"&&"code"in u&&u.code?o.has(u.code):!1,g=!!(u?.path&&n.some((d)=>d.test(u.path)));if(f&&g){r.warn?.("watcher_scan_blocked",{path:u.path,code:u.code,message:u.message});return}};process.on("uncaughtException",i);let s=()=>process.off("uncaughtException",i),a=(u)=>{if(u&&typeof u==="object"&&"code"in u)i(u)};process.on("unhandledRejection",a);let l=()=>process.off("unhandledRejection",a),c=()=>{if(s(),l(),t)Uo=null};if(t)Uo=c;return c}mn();Og();var zg={continue:0,warn:1,escalate:2,stop:3};function Cg(e,t){return zg[e]>=zg[t]}function Mg(e){if(e.tool!=="bash")return!1;let t=e.args?.command;if(typeof t!=="string")return!1;return/(?:>>?|[<>]\s*&?\s*[''"]?\s*\S+|\btee\s+[^|;&]+)/.test(t)}function sx(e){let t=e.args;if(!t||typeof t!=="object")return null;let n=["pattern","query","path","glob","regex","include_pattern"];for(let o of n){let r=t[o];if(typeof r==="string"&&r.trim().length>0)return r.trim()}return null}var Ce=Of({sessionID:"__global__",global:!0,version:de});var Ag=fe().health;try{Ve({oldPaths:He(),newPaths:fe()})}catch{}function Ug(e={},t={}){let n=F(),o=new hu;Lp(o);let r=process.cwd(),i=gn(),s=Zp({graphRetrieval:n,cwd:r}),a=Gp({sqlite:i}),l=Wp({metrics:Ce,logFilePath:be,healthFilePath:Ag}),c=Hp({cwd:r}),u=Vp({cwd:r}),f=Bp({onDispatch:({sessionID:ce,mcpTool:Me,mcpArgs:xe})=>{o.register({sessionID:ce,mcpTool:Me,mcpArgs:xe})}}),g=qp({onDispatch:({sessionID:ce,mcpTool:Me,mcpArgs:xe})=>{o.register({sessionID:ce,mcpTool:Me,mcpArgs:xe})}}),d=Jp({cwd:r}),y=Kp({cwd:r}),x=Xp({graphRetrieval:n,cwd:r}),z=Yp({graphRetrieval:n,cwd:r}),N=Qp({graphRetrieval:n,cwd:r}),J=ef({graphRetrieval:n,cwd:r}),G=tf({graphRetrieval:n,cwd:r}),ae=rf({graphRetrieval:n,cwd:r}),Pe=nf({graphRetrieval:n,cwd:r}),Vt=of({graphRetrieval:n,cwd:r}),Au=sf({graphRetrieval:n,cwd:r}),Nu=af({graphRetrieval:n,cwd:r}),ju=lf({graphRetrieval:n,cwd:r}),Uu=cf({graphRetrieval:n,cwd:r}),Lu=uf({graphRetrieval:n,cwd:r}),Fu=df({graphRetrieval:n,cwd:r}),Zu=mf({graphRetrieval:n,cwd:r}),Gu=pf({graphRetrieval:n,cwd:r}),Wu=ff({graphRetrieval:n,cwd:r}),Hu=gf({graphRetrieval:n,cwd:r}),Vu=hf({graphRetrieval:n,cwd:r}),Bu=vf({graphRetrieval:n,cwd:r}),qu=yf({graphRetrieval:n,cwd:r}),Ju=bf({graphRetrieval:n,cwd:r}),Ku=_f({graphRetrieval:n,cwd:r}),Xu=kf({cwd:r}),Yu=wf({cwd:r}),Qu=xf({cwd:r}),ed=$f({cwd:r}),td=Sf({cwd:r});S("info",`v${de} MetaGovernor plugin loaded`,{version:de,build:de,cwd:r,projectHasCodegraph:n.hasCodegraphDir(r),projectHasGraphify:n.hasGraphifyDir(r)});let rd="?";try{let Me=rx(import.meta.url),xe=Cu(Me);rd=tx("sha256").update(xe).digest("hex").slice(0,8)}catch{}return console.log(`[meta-governor] v${de} loaded (bundle: ${rd})`),(async()=>{let ce=fe().selfVersionCache,Me=86400000,xe=null;try{let $e=Cu(ce,"utf-8"),Ze=JSON.parse($e);if(typeof Ze.latest==="string"&&typeof Ze.checkedAtMs==="number"&&Date.now()-Ze.checkedAtMs<86400000)xe={latest:Ze.latest,checkedAtMs:Ze.checkedAtMs}}catch{}let Ae=xe?.latest??null;if(!Ae)try{let{execSync:$e}=await import("node:child_process");if(Ae=$e("npm view @herjarsa/omo-meta-governor version",{timeout:5000,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()||null,Ae)try{let Ze=ce.replace(/[\\/][^\\/]+$/,""),{mkdirSync:T,writeFileSync:Kr}=await import("node:fs");T(Ze,{recursive:!0}),Kr(ce,JSON.stringify({latest:Ae,checkedAtMs:Date.now()}))}catch{}}catch{}if(Ae&&Ae!==de)S("warn",`STALE_CACHE: loaded v${de} but npm has v${Ae}. Run: npm cache clean --force && rm -rf ~/.cache/opencode/packages/@herjarsa/omo-meta-governor*`)})(),async(ce,Me)=>{S("info",`v${de} factory_invoked`,{version:de,hasInput:ce!=null,inputDir:ce?.directory??null,inputKeys:ce?Object.keys(ce):[]});let xe=ce.client,Ae=xe!=null&&typeof xe==="object"&&"tool"in xe?xe:null;Gr().setClient(Ae),du(Ae);let $e;try{$e=await yu({projectDir:ce.directory??r})}catch(p){throw S("error","factory_config_load_failed",{message:p instanceof Error?p.message:String(p),stack:p instanceof Error?p.stack?.slice(0,800):void 0}),p}let Ze={...e,...$e.config,...Me?.meta_governor??{}},T;try{T=_u(Ze)}catch(p){throw S("error","factory_orchestrator_config_failed",{message:p instanceof Error?p.message:String(p)}),p}if(Rp({preferredTool:T.graphRetrieval.preferredTool}),$e.sources.length>0)S("info",`v${de} config_loaded`,{version:de,sources:$e.sources,effectiveSource:$e.effectiveSource,enabled:T.enabled});if(T.postWave?.enabled===!0&&T.intervention.respectDoneSignal===!1)S("info","post_wave_warning",{message:"postWave.enabled=true but intervention.respectDoneSignal=false: post-wave directives still fire on Oracle-verified PHASE-N-COMPLETE, but the done-signal latch is off (intervention is not auto-disabled at plan end)."});let Kr=new Set,nd=new Set,Lg=new Set,Se=ce.directory?nx(ce.directory):r,Bt=Me?.meta_governor?.graphSync??$e.config?.graphSync??e.graphSync;if(Bt?.enabled!==!1){if(t.__test_onGraphSyncInit?.({projectDir:Se}),(t.__test_runGraphSync??Qt)({enabled:!0,watch:Bt?.watch??!1,autoInstall:Bt?.autoInstall??!0,installTimeoutMs:Bt?.installTimeoutMs??60000,killOrphanedOnInit:Bt?.killOrphanedOnInit??!0,projectDir:Se}).then((w)=>{if(w?.attempted&&w.availability.codegraph&&w.availability.graphify)Kr.add(Se)}).catch((w)=>{S("warn",`graphSync init failed: ${String(w)}`)}),T.cliAnything?.enabled!==!1){let w=Me?.meta_governor?.cliAnything??$e.config?.cliAnything;(t.__test_runCliAnythingSync??Md)({enabled:!0,autoInstall:w?.autoInstall??!0,autoUpgrade:w?.autoUpgrade??!0,cachePath:w?.cachePath??fe().cliAnythingUpgradeCheck,upgradeCheckTtlMs:w?.upgradeCheckTtlMs??86400000,projectDir:Se,installScope:w?.installScope??"global",cliHubBin:w?.cliHubBin??"cli-hub",skillsBin:w?.skillsBin??"npx skills"}).then((I)=>{if(I?.attempted&&I.availability.cliHub)Lg.add(Se)}).catch((I)=>{S("warn",`cli-anything sync failed: ${String(I)}`)})}queueMicrotask(()=>{try{let w=T.graphSync.fetchBranch,v=ni(Se,w);if(v>0)S("info",`reindexOnFetch: ${v} new commits on origin/${w}, reindexing`),dn(Se).catch((I)=>{S("warn",`reindexOnFetch failed: ${String(I)}`)})}catch{}})}let qt=null;if(!T.enabled){if($e.sources.length>0)S("warn","config_loaded_but_disabled",{version:de,sources:$e.sources,hint:"Set meta_governor.enabled=true (or top-level enabled:true) in your omo-meta-governor.jsonc to activate governance."});return{tool:{omo_search:s,omo_recall:a,omo_health:l,omo_find:c,omo_impact:u,omo_remember:f,omo_recall_mcp:g,omo_path:d,omo_explain:y,omo_files:x,omo_callers:z,omo_node:N,omo_context:J,omo_affected_cg:G,omo_status:ae,omo_unlock:Pe,omo_mark_dirty:Vt,omo_sync_if_dirty:Au,omo_index:Nu,omo_visualize:ju,omo_serve:Uu,omo_uninit:Lu,omo_diagnose:Fu,omo_merge_graphs:Zu,omo_save_result:Gu,omo_extract:Wu,omo_cluster_only:Hu,omo_label:Vu,omo_tree:Bu,omo_clone:qu,omo_add:Ju,omo_check_update:Ku,omo_hook_status:Xu,omo_cli_anything_install:Yu,omo_cli_anything_list:Qu,omo_cli_anything_search:ed,omo_cli_anything_info:td},dispose:async()=>{try{Vo()}catch{}try{Yt()}catch{}try{tn()}catch{}try{St()}catch{}try{if(qt)await qt.stop()}catch{}}}}let Fo=()=>T.modelOverride?.providerID??t.providerID?.(),Zo=()=>T.modelOverride?.modelID??t.modelID?.(),Fg=()=>T.modelOverride?.modelLimit??200000,Sx=Fo()??"unknown",Ix=Zo()??"unknown",od,id;if(T.protocolEnforcement.enabled||T.protocolEnforcement.injectIntoSystem){let p=T.protocolEnforcement.path??xu;try{od=await tg(p),id=rg(od)}catch(w){if(T.modelOverride?.verbosity!=="silent")S("warn",`could not load protocol: ${w instanceof Error?w.message:String(w)}`)}}let me=new wu({maxEntries:100,ttlMs:3600000}),Xr=new Vr(1000,300000),xt=new Vr(1000,300000),sd=new Set,ad=new Set,Zg=new Map,ld=new Set,Gg=new Set,Wg=new Set,Tx=new Set,cd=new Set,Hg=()=>({currentWaveN:null,lastInjectedWaveN:null,lastInjectedAtMs:null,postWaveInjectionsThisWave:0,rulesReadForWave:{},oracleAfterPhaseAtMs:{},repoModeResolved:null}),ud=new Vr(1000,86400000),dd=(p)=>{if(typeof t.__test_isMainSession==="function")try{return t.__test_isMainSession(p)}catch{return!0}return!0},$t=(p,w)=>{if(!p||!w)return;if(!dd(p)){S("info",`persist skipped (subagent) for ${p}`);return}if(!T.intervention.persistToSession)return;let v=me.get(p);if(v?.backgroundTaskInFlight||v?.oracleInFlight){S("info",`persist skipped (background task in flight) for ${p}`);return}let I=()=>(t.__test_persistSessionMessage??Po)(p,w),D=(L)=>{if(!L.ok)S("warn",`persist intervention failed for ${p}`,{error:L.error});else S("info",`persisted intervention for ${p}`)};if(t.__test_persistSessionMessage){I().then((L)=>{if(!L.ok&&L.error&&/timed out/i.test(L.error)){let H=me.get(p);if(H?.backgroundTaskInFlight||H?.oracleInFlight){S("info",`persist retry skipped (background task in flight) for ${p}`);return}setTimeout(()=>{I().then(D)},t.__test_persistRetryDelayMs??1500);return}D(L)});return}S("info",`persist intervention (superficial, not queued) for ${p}: ${w.slice(0,200)}`),Ce.inc("interventions_delivered")},Vg=Tp((p)=>{try{So(p,Ag)}catch(w){S("warn","health snapshot write failed",{error:String(w)})}},5000);try{let p=Mu(Se,".agents","skills");qt=await(t.__test_startSkillsFsWatcher??Pg)({projectDir:p,onChange:async(v,I)=>{if(I!=="add")return;try{Ce.inc("tier3_skills_created"),S("info",`tier3_skills_created: ${v}`)}catch(D){S("warn",`tier3 watcher onChange failed: ${String(D)}`)}}})}catch(p){S("warn",`tier3 fs watcher failed to start: ${String(p)}`)}return{dispose:async()=>{try{Vo()}catch{}try{Yt()}catch{}try{tn()}catch{}try{St()}catch{}try{if(qt)await qt.stop()}catch{}},"tool.execute.before":async(p,w)=>{if(!T.enabled)return;if(!p.sessionID)return;if(T.skillPriming.enabled&&T.skillPriming.enforceMode==="block"&&p.tool!=="omo_skill_find"&&!ld.has(p.sessionID)&&(Ye.includes(p.tool)||Mg(p))&&!Qf(p.tool,w?.args)){let D=eg(p.tool,w?.args);throw Error(`[meta-governor] skill-priming required: run \`${D}\` to discover relevant skills before using "${p.tool}". Pass the candidates to a sub-agent via \`task(category='<category>', load_skills=[...])\` to load 2-3 capabilities. Set skillPriming.enforceMode='directive' in your config to bypass this gate, or write to a tmp/test/scratch path for trivial edits.`)}if(!T.protocolEnforcement.auditToolCalls)return;let v=me.get(p.sessionID);if(!v)v={memoryToolsUsed:[],hasCodegraphDir:n.hasCodegraphDir(r),hasGraphifyDir:n.hasGraphifyDir(r),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,lastViolationInjectionAtMs:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[],overflowCompactionCount:0,overflowLoopGuardTripped:!1},me.set(p.sessionID,v);if(v?.oracleInFlight)return;if(id)S("info","protocol loaded, system injection ready");let I=ng(p.tool,w.args,{memoryToolsUsed:v.memoryToolsUsed,hasCodegraphDir:v.hasCodegraphDir,hasGraphifyDir:v.hasGraphifyDir,oracleInvoked:v.oracleInvoked,filesChanged:v.filesChanged,emptyRecall:v.emptyRecall,escalationAttempted:v.escalationAttempted,recentToolCalls:v.recentToolCalls,recentWriteContents:v.recentWriteContents,memorySaved:v.memorySaved,batchCompletions:v.batchCompletions});if(I.length>0){let L=v.lastViolationInjectionAtMs??0;if(L>0&&Date.now()-L<30000){S("info",`violation during cooldown (${Math.round((30000-(Date.now()-L))/1000)}s remaining), skipping queue`);let H=I.map((ne)=>({severity:ne.severity,category:ne.rule,detail:ne.detail,ts:Date.now()}));v.accumulatedDeviations=[...v.accumulatedDeviations,...H].slice(-5)}else{S("warn",`protocol violations on tool ${p.tool}`,I);let H=Xr.get(p.sessionID)?.items??[],ne=new Set;for(let X of I){let ue=`${X.severity}::${X.rule}::${X.detail}`;if(ne.has(ue))continue;ne.add(ue);let R=`[${X.severity.toUpperCase()}] ${X.rule}: ${X.detail}`;if(!H.includes(R))H.push(R)}Xr.set(p.sessionID,{items:H});let j=I.map((X)=>({severity:X.severity,category:X.rule,detail:X.detail,ts:Date.now()}));v.accumulatedDeviations=[...v.accumulatedDeviations,...j].slice(-5)}}else S("info",`audit OK on tool ${p.tool}`);if((p.tool==="grep"||p.tool==="glob")&&(n.hasCodegraphDir(r)||n.hasGraphifyDir(r))){let D=sx(p);if(D)n.invoke(r,D,{timeoutMs:5000}).then((L)=>{if(L.result)n.cacheContext(p.sessionID,D,L.result)}).catch((L)=>{S("warn",`graphRetrieval.invoke failed for session ${p.sessionID}: ${String(L)}`)})}},"tool.execute.after":async(p,w)=>{if(!T.enabled)return;if(Ce.inc("tool_calls_observed"),p.sessionID&&(p.tool==="omo_skill_find"||p.tool==="omo_skill_add"||p.tool==="omo_skill_get"||p.tool==="omo_skill_local_link"||p.tool==="omo_skill_semantic_find"||p.tool==="omo_skill_create"))ld.add(p.sessionID);if(p.sessionID){let R=p.sessionID;if(p.tool==="omo_search"||p.tool==="omo_find"||p.tool==="omo_impact"||p.tool==="omo_path"||p.tool==="omo_explain")Gg.add(R);if(p.tool==="omo_recall"||p.tool==="omo_recall_mcp")Wg.add(R)}Vg.write(Io({version:de,enabled:!0,sessionID:p.sessionID||"__unknown__",snapshot:Ce.getMetrics(),logFilePath:be}));try{o.markDelivered({sessionID:p.sessionID,mcpTool:p.tool,mcpArgs:p.args})}catch{}if(Ye.includes(p.tool))cd.add(p.sessionID);let v=me.get(p.sessionID);if(v){if(v.iteration++,v.recentToolCalls=[p.tool].concat(v.recentToolCalls).slice(0,20),Ye.includes(p.tool)||Mg(p)){v.filesChanged++;let Z=(w.output??"").slice(0,500);v.recentWriteContents=[Z].concat(v.recentWriteContents).slice(0,3);let C=p.args,te=C?.filePath??C?.path;if(p.tool==="bash"&&(typeof te!=="string"||te.length===0)){let Jt=(p.args?.command??"").match(/(?:>>?)\s*[''"]?([^''"&\s;]+)/);if(Jt)te=Jt[1]}if(typeof te==="string"&&te.length>0)v.recentWriteFilePaths=[te].concat(v.recentWriteFilePaths).slice(0,10)}if(["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"].some((Z)=>p.tool.startsWith(Z))&&!v.memoryToolsUsed.includes(p.tool))v.memoryToolsUsed.push(p.tool);if(p.tool.startsWith("agentmemory_memory_save")){let Z=w.output??"";if(Z.includes("saved")||Z.includes("written"))v.memorySaved=!0}if(p.tool==="task"){let Z=w.output??"",C=p.args,te=C?.subagent_type;if(te==="oracle"||/"subagent_type"\s*:\s*"oracle"/.test(Z)){if(v.oracleInvoked=!0,C?.run_in_background===!0)v.oracleInFlight=!0,v.oracleInFlightSinceMs=Date.now()}if(C?.run_in_background===!0&&typeof te==="string")v.backgroundTaskInFlight=!0,v.backgroundTaskInFlightSinceMs=Date.now(),v.backgroundTaskType=te,S("info",`background_task_in_flight: subagent_type=${te} for session ${p.sessionID}`)}let U=(w.output??"").toLowerCase();if(p.tool.includes("recall")&&(U.includes("returned empty")||U.includes("no results")))v.emptyRecall=!0;if(p.tool==="todowrite"&&(w.output??"").includes("completed")){if(((w.output??"").match(/"status":"completed"/g)??[]).length>=3)v.batchCompletions++}let V=[typeof w.output==="string"?w.output:"",typeof p.args==="string"?p.args:""].join(`
|
|
251
|
-
`);if(!v.taskDoneSignal&&fx(
|
|
252
|
-
`),U=vx(
|
|
253
|
-
|
|
254
|
-
${
|
|
246
|
+
stderr: ${n.stderr||"(empty)"}`,metadata:{tool:e,code:n.code,durationMs:s,sessionID:r.sessionID,...t}};let a=n.data!==null&&n.data!==void 0?typeof n.data==="string"?n.data:JSON.stringify(n.data,null,2):n.rawOutput??"";return{title:e,output:a,metadata:{tool:e,code:n.code,durationMs:s,sessionID:r.sessionID,...t}}}function xf(e){return E({description:"Install a CLI from the CLI-Anything hub so the agent can drive that software. USAGE: omo_cli_anything_install with name='gimp' installs `cli-anything-gimp`, which exposes a `cli-anything-gimp` command. Browse the catalog with omo_cli_anything_list. See https://github.com/HKUDS/CLI-Anything for the full registry.",args:{name:q.string().min(1).describe("The CLI name to install (e.g. 'gimp', 'blender', 'drawio')")},async execute(t,n){let o=Date.now(),{installCli:r}=await Promise.resolve().then(() => (Pt(),rr)),i=r(t.name,e.runner,120000,"cli-hub");return Ro("omo_cli_anything_install",{name:t.name},{...i,durationMs:Date.now()-o},o,n,`Could not install '${t.name}'. Check that cli-anything-hub is installed (omo_health) and the name is correct.`)}})}function $f(e){return E({description:"List all CLIs available in the CLI-Anything hub (40+ GUI software harnesses). USAGE: omo_cli_anything_list with category='image' returns only image-related CLIs. Returns JSON with name, version, description, category, install_cmd, entry_point. See https://github.com/HKUDS/CLI-Anything.",args:{category:q.string().optional().describe("Optional category filter (e.g. 'image', 'devops', '3d', 'audio')"),source:q.enum(["harness","public","npm","all"]).optional().describe("Optional source filter. 'all' includes harness + public + npm.")},async execute(t,n){let o=Date.now(),{listClis:r}=await Promise.resolve().then(() => (Pt(),rr)),i=r({category:t.category,source:t.source},e.runner,30000,"cli-hub");return Ro("omo_cli_anything_list",{category:t.category,source:t.source},{...i,durationMs:Date.now()-o},o,n,"Could not list CLIs from the hub. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function Sf(e){return E({description:"Search the CLI-Anything hub for CLIs matching a query (name, description, or category). USAGE: omo_cli_anything_search with query='cad' returns CAD-related CLIs. Returns JSON array. See https://github.com/HKUDS/CLI-Anything.",args:{query:q.string().min(1).describe("Search query (matches name, description, or category)")},async execute(t,n){let o=Date.now(),{searchClis:r}=await Promise.resolve().then(() => (Pt(),rr)),i=r(t.query,e.runner,30000,"cli-hub");return Ro("omo_cli_anything_search",{query:t.query},{...i,durationMs:Date.now()-o},o,n,"Search failed. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function If(e){return E({description:"Show details for a specific CLI in the CLI-Anything hub. USAGE: omo_cli_anything_info with name='blender' returns display name, version, description, requirements (e.g. 'blender (apt install blender)'), entry point, install command. See https://github.com/HKUDS/CLI-Anything.",args:{name:q.string().min(1).describe("The CLI name to look up")},async execute(t,n){let o=Date.now(),{infoCli:r}=await Promise.resolve().then(() => (Pt(),rr)),i=r(t.name,e.runner,1e4,"cli-hub");return Ro("omo_cli_anything_info",{name:t.name},{...i,durationMs:Date.now()-o},o,n,`Could not find '${t.name}' in the hub. Try omo_cli_anything_search to find similar names.`)}})}Eo();class yu{entries=new Map;deliveredCount=0;expiredCount=0;register(e){this.cleanup();let t=`deliv-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,n=Tf(e.mcpArgs);return this.entries.set(t,{id:t,sessionID:e.sessionID,mcpTool:e.mcpTool,mcpArgsHash:n,registeredAt:Date.now(),ttlMs:e.ttlMs??1e4}),t}markDelivered(e){this.cleanup();let t=e.mcpArgs?Tf(e.mcpArgs):null;for(let[n,o]of this.entries){if(o.sessionID!==e.sessionID)continue;if(o.mcpTool!==e.mcpTool)continue;if(t!==null&&o.mcpArgsHash!==t)continue;return this.entries.delete(n),this.deliveredCount++,n}return null}async awaitDelivery(e){let t=e.timeoutMs??2000,n=Date.now();while(Date.now()-n<t){if(this.cleanup(),![...this.entries.values()].find((r)=>r.sessionID===e.sessionID&&r.mcpTool===e.mcpTool))return"delivered";await Pk(50)}return"expired"}getStats(){return{pending:this.entries.size,delivered:this.deliveredCount,expired:this.expiredCount}}clearSession(e){for(let[t,n]of this.entries)if(n.sessionID===e)this.entries.delete(t)}cleanup(){let e=Date.now();for(let[t,n]of this.entries)if(e-n.registeredAt>n.ttlMs)this.entries.delete(t),this.expiredCount++}}function Tf(e){return JSON.stringify(e,Object.keys(e).sort())}function Pk(e){return new Promise((t)=>setTimeout(t,e))}gt();Xt();import{resolve as nx}from"node:path";import{readFileSync as Ok}from"node:fs";import{dirname as Ek,resolve as Rk}from"node:path";import{fileURLToPath as zk}from"node:url";var Df="0.0.0";try{let e=Ek(zk(import.meta.url)),t=Rk(e,"..","package.json"),n=JSON.parse(Ok(t,"utf8"));if(typeof n.version==="string"&&n.version.length>0)Df=n.version}catch{}var me=Df,Pf=["decisions_taken","decisions_skipped_continue","decisions_skipped_no_decision","decisions_skipped_no_message","decisions_skipped_below_threshold","interventions_delivered","interventions_disabled_done","interventions_disabled_cap","decisions_stored","plan_reminders_injected","bot_feedback_injected","violations_injected","protocol_audits_passed","protocol_violations_detected","git_commit_reindex","orchestrator_runs","orchestrator_errors","materialization_failures","tier3_reminders_sent","tier3_skills_created","tool_calls_observed","governance_blocks","governance_asks","governance_tools_hidden","governance_tools_rewritten","governance_commands_blocked"];function Of(){let e={};for(let t of Pf)e[t]={count:0,lastOccurrenceISO:null};return e}var Ck=Of(),eT=new Date().toISOString();function Ef(e){let t=e??{},n=Of(),o=new Date().toISOString(),r=t.version??me,i=t.global===!0;return{inc(s){let a=n[s];if(!a)return;if(a.count++,a.lastOccurrenceISO=new Date().toISOString(),i){let l=Ck[s];if(l)l.count++,l.lastOccurrenceISO=a.lastOccurrenceISO}},getMetrics(){return{version:r,sessionID:t.sessionID??"",startedAtISO:o,uptimeMs:Date.now()-new Date(o).getTime(),counters:{...n}}},reset(){for(let s of Pf)n[s]={count:0,lastOccurrenceISO:null}}}}function Rf(e,t){for(let n of t)try{if(new RegExp(n).test(e))return n}catch{}return null}function Mk(e){let n=e.replace(/^\*\*\//,"").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(n)}function zf(e,t){for(let n of t)try{if(Mk(n).test(e))return n}catch{}return null}function Ak(e,t){let n;try{n=new URL(e).host}catch{return null}for(let o of t)if(n===o||n.endsWith("."+o)||n.includes(o))return o;return null}function Cf(e,t){let n=Rf(e,t.bashDenyPatterns??[]);if(n!==null)return{decision:"deny",reason:'bash command matches deny pattern "'+n+'"'};let o=Rf(e,t.bashAskPatterns??[]);if(o!==null)return{decision:"ask",reason:'bash command matches ask pattern "'+o+'"'};return null}function Mf(e,t){let n=zf(e,t.editDenyPaths??[]);if(n!==null)return{decision:"deny",reason:'edit path matches deny pattern "'+n+'"'};let o=zf(e,t.editAskPaths??[]);if(o!==null)return{decision:"ask",reason:'edit path matches ask pattern "'+o+'"'};return null}function Af(e,t){let n=Ak(e,t.webfetchDenyHosts??[]);if(n!==null)return{decision:"deny",reason:'webfetch host matches deny pattern "'+n+'"'};return null}async function Nf(e,t,n,o){if(!n||n.mode===void 0)return;if(!n.mode)return;let r;switch(e.type){case"bash":r=Cf(e.command,n);break;case"edit":r=Mf(e.pattern,n);break;case"webfetch":r=Af(e.url,n);break;default:return}if(r===null)return;if(t.status=r.decision,r.decision==="deny")o.inc("governance_blocks");else o.inc("governance_asks")}async function jf(e,t,n,o){if(!n.enabled)return;if(n.hideToolIDs?.includes(e.toolID)){t.description="",o.inc("governance_tools_hidden");return}if(n.descriptionSuffix)t.description=(t.description??"")+n.descriptionSuffix,o.inc("governance_tools_rewritten");let r=n.parameterOverrides?.[e.toolID];if(!r||!t.parameters?.properties)return;for(let[i,s]of Object.entries(r))if(t.parameters.properties[i])t.parameters.properties[i].description=s}async function Uf(e,t,n,o){if(!n.enabled)return;if(n.denyPatterns?.length)for(let r of n.denyPatterns)try{if(new RegExp(r).test(e.command))throw o.inc("governance_commands_blocked"),Error('[meta-governor] blocked command matching pattern "'+r+'"')}catch(i){if((i instanceof Error?i.message:String(i)).includes("blocked command matching"))throw i}if(n.replacementPrefix)t.parts.push({type:"text",text:n.replacementPrefix+" executing: "+e.command,synthetic:!0})}async function Lf(e,t,n){if(!n.enabled)return;if(!n.modelID||!n.providerID)return;let o=e.provider.models??{},r=Object.values(o).find((i)=>typeof i==="object"&&i!==null&&i.id===n.modelID);if(r)t.model=r}import{homedir as Gk}from"node:os";import{join as Wk}from"node:path";function wu(e){let t={enabled:!1,...e},n=pi(),o=fi(),r=gn();return{enabled:t.enabled===!0,memory:{enabled:!0,query:t.memory?.query??"meta_governor_context",timeoutMs:t.memory?.timeoutMs??t.memory?.agentmemoryTimeoutMs??2000},tokenPredictor:{compactBurnRateThreshold:t.tokenPredictor?.compactBurnRateThreshold??500,compactUsageThreshold:t.tokenPredictor?.compactUsageThreshold??0.85,switchModelUsageThreshold:t.tokenPredictor?.switchModelUsageThreshold??0.95,delegateConsecutiveHighBurn:t.tokenPredictor?.delegateConsecutiveHighBurn??5},scoring:{...n,...t.scoring?.continueThreshold!==void 0?{continueThreshold:t.scoring.continueThreshold}:{},...t.scoring?.warnThreshold!==void 0?{warnThreshold:t.scoring.warnThreshold}:{},...t.scoring?.escalateThreshold!==void 0?{escalateThreshold:t.scoring.escalateThreshold}:{},...t.scoring?.stopThreshold!==void 0?{stopThreshold:t.scoring.stopThreshold}:{},...t.scoring?.paralysisThreshold!==void 0?{paralysisThreshold:t.scoring.paralysisThreshold}:{},...t.scoring?.defaultEscalationTarget!==void 0?{defaultEscalationTarget:t.scoring.defaultEscalationTarget}:{},oracleFrequency:t.oracle?.frequency??t.scoring?.oracleFrequency??"per-stop"},closedLoop:{...r,...t.closedLoop?.enabled!==void 0?{enabled:t.closedLoop.enabled}:{},...t.closedLoop?.minSeverityToLearn!==void 0?{minSeverityToLearn:t.closedLoop.minSeverityToLearn}:{},...t.closedLoop?.maxLessonsPerSession!==void 0?{maxLessonsPerSession:t.closedLoop.maxLessonsPerSession}:{},...t.closedLoop?.saveDecisions!==void 0?{saveDecisions:t.closedLoop.saveDecisions}:{},...t.closedLoop?.saveLessons!==void 0?{saveLessons:t.closedLoop.saveLessons}:{}},decision:{...o,...t.decision?.maxHistoryPerSession!==void 0?{maxHistoryPerSession:t.decision.maxHistoryPerSession}:{},...t.decision?.forceContinueAfterStops!==void 0?{forceContinueAfterStops:t.decision.forceContinueAfterStops}:{},...t.decision?.warnMessageTemplate!==void 0?{warnMessageTemplate:t.decision.warnMessageTemplate}:{},...t.decision?.escalateMessageTemplate!==void 0?{escalateMessageTemplate:t.decision.escalateMessageTemplate}:{},...t.decision?.stopMessageTemplate!==void 0?{stopMessageTemplate:t.decision.stopMessageTemplate}:{}},modelOverride:t.modelOverride?{providerID:t.modelOverride.providerID,modelID:t.modelOverride.modelID,modelLimit:t.modelOverride.modelLimit,temperature:t.modelOverride.temperature??0.2,topP:t.modelOverride.topP??1,maxTokens:t.modelOverride.maxTokens??2048,reasoning:t.modelOverride.reasoning??!1,verbosity:t.modelOverride.verbosity??"minimal"}:void 0,intervention:{mode:t.intervention?.mode??"silent",includeDecisionHistory:t.intervention?.includeDecisionHistory??!0,maxHistoryMessages:t.intervention?.maxHistoryMessages??5,minActionForMessage:t.intervention?.minActionForMessage??"stop",maxInterventionsPerSession:t.intervention?.maxInterventionsPerSession??3,respectDoneSignal:t.intervention?.respectDoneSignal??!0,phaseAwareDoneSignal:t.intervention?.phaseAwareDoneSignal??!1,persistToSession:t.intervention?.persistToSession??!0,compactionLoopGuard:{enabled:t.intervention?.compactionLoopGuard?.enabled??!0,maxOverflowRecoveries:Math.max(1,t.intervention?.compactionLoopGuard?.maxOverflowRecoveries??1)}},postWave:{enabled:t.postWave?.enabled??t.intervention?.phaseAwareDoneSignal===!0,repoMode:t.postWave?.repoMode??"auto",aasToolPrefix:t.postWave?.aasToolPrefix??"aas",ciTimeoutMs:t.postWave?.ciTimeoutMs??600000,maxRetriesPerWave:t.postWave?.maxRetriesPerWave??1,reinjectCooldownMs:t.postWave?.reinjectCooldownMs??60000,respectSilentMode:t.postWave?.respectSilentMode??!1,...t.postWave?.ownRepoDirective!==void 0?{ownRepoDirective:t.postWave.ownRepoDirective}:{},...t.postWave?.thirdPartyDirective!==void 0?{thirdPartyDirective:t.postWave.thirdPartyDirective}:{}},protocolEnforcement:{enabled:t.protocolEnforcement?.enabled??!1,path:t.protocolEnforcement?.path,injectIntoSystem:t.protocolEnforcement?.injectIntoSystem??!1,auditToolCalls:t.protocolEnforcement?.auditToolCalls??!1},skillPriming:{enabled:t.skillPriming?.enabled??!0,trigger:t.skillPriming?.trigger??"firstImplement",router:t.skillPriming?.router??"registry",enforceMode:t.skillPriming?.enforceMode??"directive"},skillHub:{enabled:t.skillHub?.enabled??!1,syncIntervalMs:t.skillHub?.syncIntervalMs??86400000,bootstrapUrl:t.skillHub?.bootstrapUrl??"https://skills-library.com/api/skills.json",searchFallbackUrl:t.skillHub?.searchFallbackUrl??"https://skills.sh/api/search",downloadBaseUrl:t.skillHub?.downloadBaseUrl??"https://skills.sh/api/download",embedBaseUrl:t.skillHub?.embedBaseUrl??"http://127.0.0.1:3114/v1",embedModel:t.skillHub?.embedModel??"bge-m3",minInstalls:t.skillHub?.minInstalls??0,filterDuplicates:t.skillHub?.filterDuplicates!==!1,depsCheck:t.skillHub?.depsCheck!==!1,choreDir:t.skillHub?.choreDir??Wk(Gk(),".agents","skills"),autoMaterialize:t.skillHub?.autoMaterialize??!0},graphSync:{killOrphanedOnInit:t.graphSync?.killOrphanedOnInit??!0,reindexOnFetch:t.graphSync?.reindexOnFetch!==!1,fetchBranch:t.graphSync?.fetchBranch??"main",autoUpgrade:t.graphSync?.autoUpgrade!==!1,upgradeCachePath:t.graphSync?.upgradeCachePath,checkGraphifyNeedsUpdate:t.graphSync?.checkGraphifyNeedsUpdate!==!1,addToGlobalGraph:t.graphSync?.addToGlobalGraph===!0},graphRetrieval:{preferredTool:t.graphRetrieval?.preferredTool??"auto",preferLocalCodegraph:t.graphRetrieval?.preferLocalCodegraph===!0,contextRouting:t.graphRetrieval?.contextRouting===!0},cliAnything:{enabled:t.cliAnything?.enabled!==!1,autoInstall:t.cliAnything?.autoInstall!==!1,autoUpgrade:t.cliAnything?.autoUpgrade!==!1,cachePath:t.cliAnything?.cachePath,upgradeCheckTtlMs:t.cliAnything?.upgradeCheckTtlMs,cliHubBin:t.cliAnything?.cliHubBin??"cli-hub",skillsBin:t.cliAnything?.skillsBin??"npx skills",installScope:t.cliAnything?.installScope??"global"},governance:{permissionPolicy:t.governance?.permissionPolicy?{mode:t.governance.permissionPolicy.mode,bashDenyPatterns:t.governance.permissionPolicy.bashDenyPatterns,bashAskPatterns:t.governance.permissionPolicy.bashAskPatterns,editDenyPaths:t.governance.permissionPolicy.editDenyPaths,editAskPaths:t.governance.permissionPolicy.editAskPaths,webfetchDenyHosts:t.governance.permissionPolicy.webfetchDenyHosts}:void 0,toolRewrite:{enabled:t.governance?.toolRewrite?.enabled??!0,descriptionSuffix:t.governance?.toolRewrite?.descriptionSuffix,hideToolIDs:t.governance?.toolRewrite?.hideToolIDs,parameterOverrides:t.governance?.toolRewrite?.parameterOverrides},commandFilter:{enabled:t.governance?.commandFilter?.enabled??!0,denyPatterns:t.governance?.commandFilter?.denyPatterns,replacementPrefix:t.governance?.commandFilter?.replacementPrefix},smallModelOverride:t.governance?.smallModelOverride?{enabled:t.governance.smallModelOverride.enabled,modelID:t.governance.smallModelOverride.modelID,providerID:t.governance.smallModelOverride.providerID}:void 0}}}function vT(e){if(!e)return!1;if(e.enabled===!0)return!0;return e.meta_governor?.enabled===!0}async function yT(e={}){let{loadMetaGovernorConfig:t}=await Promise.resolve().then(() => (ku(),Bf)),n=await t(e);return wu(n.config)}ku();var ut=new Map,zo=new Map;function xu(e,t){ut.set(e,t);let n=zo.get(e)??[];if(n.push(t.historyEntry),n.length>20)n.splice(0,n.length-20);zo.set(e,n)}function Ht(e){let t=ut.get(e);if(t!==void 0)ut.delete(e);return t}function qf(e){return ut.get(e)}function _T(e){return ut.has(e)}function kT(){for(let[e,t]of ut)return ut.delete(e),t;return}function wT(){ut.clear(),zo.clear()}function Jf(e){return zo.get(e)??[]}class $u{store=new Map;maxEntries;ttlMs;now;constructor(e={}){this.maxEntries=e.maxEntries??100,this.ttlMs=e.ttlMs??3600000,this.now=e.now??Date.now}get(e){let t=this.store.get(e);if(!t)return;let n=this.now();if(t.expiresAtMs<=n){this.store.delete(e);return}return t.lastAccessAtMs=n,t.value}has(e){return this.get(e)!==void 0}set(e,t){let n=this.now();if(!this.store.has(e)&&this.store.size>=this.maxEntries)this.evictOldest();this.store.set(e,{value:t,expiresAtMs:n+this.ttlMs,lastAccessAtMs:n})}delete(e){return this.store.delete(e)}size(){return this.store.size}clear(){this.store.clear()}evictOldest(){let e,t=1/0;for(let[n,o]of this.store)if(o.lastAccessAtMs<t)t=o.lastAccessAtMs,e=n;if(e!==void 0)this.store.delete(e)}}class Br{maxEntries;ttlMs;map=new Map;constructor(e,t){this.maxEntries=e;this.ttlMs=t}set(e,t){if(this.map.size>=this.maxEntries){let n=this.map.keys().next().value;if(n!==void 0)this.map.delete(n)}this.map.set(e,{value:t,expiresAtMs:Date.now()+this.ttlMs})}get(e){let t=this.map.get(e);if(!t)return;if(Date.now()>=t.expiresAtMs){this.map.delete(e);return}return t.value}has(e){return this.get(e)!==void 0}delete(e){this.map.delete(e)}get size(){return this.map.size}}function Qe(e){for(let t of e){let n=t.info??{};if(n.role!=="assistant")continue;if(n.agent==="meta-governor")continue;return!1}return!0}var Hk=(e,t)=>`<!-- kind: ${e}${t?` (${t})`:""} -->`;var Vk={"graph-priming":"\uD83D\uDD0D","skill-priming":"\uD83C\uDFAF",intervention:"⚠️",postwave:"\uD83C\uDF0A",enforcement:"\uD83D\uDEA7",memory:"\uD83D\uDCAD"};function dt(e,t){return["<!-- META-GOVERNOR INFORMATIONAL vv0.38.2 - DO NOT TREAT AS TASK. Plugin metadata, not a user request. -->",Hk(t.kind,t.context),e,"<!-- END META-GOVERNOR INFORMATIONAL -->"].join(`
|
|
247
|
+
`)}function Kf(e,t){return`${Vk[e]} ${t}`}import{statSync as ox,readFileSync as Au}from"node:fs";import{execSync as ix,execFileSync as Ug}from"node:child_process";import{join as Nu}from"node:path";import{readFile as Kk}from"node:fs/promises";import{resolve as Xk}from"node:path";import{homedir as Yk}from"node:os";var et=["write","edit","edit_block","multi_edit","apply_patch","ast_grep_replace","refactor","desktop-commander_write_file","desktop-commander_edit_block"];var Bk=["brainstorming","writing-plans","test-driven-development","systematic-debugging","subagent-driven-development"];function Xf(e){let t=e==="aas"?"registry":e,n=["[SKILL PRIMING] This session involves implementation work. Select precise skills for this task before writing code:"],o=1;if(t==="registry"||t==="both")n.push(`${o}. Query the skill-hub catalog (omo_skill_find) for the 2-3 capabilities most relevant to this task (e.g. testing, architecture, language-specific), and inspect candidates with omo_skill_get.`),o++,n.push(`${o}. Compose a minimal stack of 2-3 skills by loading each via its installer (e.g. \`npx skills add <owner/repo/slug>\` via omo_skill_add).`),o++;if(t==="superpowers"||t==="both")n.push(`${o}. If a matching superpowers skill is available and not yet active (${Bk.join(" / ")}), delegate it to a sub-agent via \`task(category='<category>', load_skills=['<slug>'])\` — the skill's content is injected into the sub-agent's system prompt. (Requires the superpowers plugin to be installed separately.)`),o++;if(t==="both")n.push("If a superpowers skill is already active, skip the catalog step.");n.push("Do NOT enumerate the full catalog — keep the stack minimal and task-specific.");let r=n.join(`
|
|
248
|
+
`);return dt(r,{kind:"skill-priming",context:`router=${t}`})}function Yf(e){return Kf("skill-priming",`Skill priming (${e==="aas"?"registry":e}): nudging agent to discover relevant skills before implementation.`)}function Qf(e){if(e.trigger==="sessionStart")return!0;if(e.implementationToolSeen)return!0;return e.recentToolCalls.some((t)=>et.includes(t))}var qk=[/[\\/](\.tmp|\.scratch|scratch|tmp|trash|throwaway)[\\/]/i,/[\\/]tests?[\\/]|^tests?[\\/]/,/[\\/]__tests__[\\/]/,/[\\/]fixtures?[\\/]/,/[\\/]examples?[\\/]/,/\.test\.[a-z]+$/,/\.spec\.[a-z]+$/],Jk=50;function eg(e,t){if(e==="edit"||e==="edit_block"||e==="multi_edit"||e==="apply_patch"||e==="ast_grep_replace"||e==="refactor"||e==="desktop-commander_edit_block")return!0;if(e!=="write"&&e!=="desktop-commander_write_file")return!1;let n=t,o=typeof n?.filePath==="string"?n.filePath:typeof n?.path==="string"?n.path:"";if(o&&qk.some((i)=>i.test(o)))return!0;let r=n?.content;if(typeof r==="string"&&r.split(`
|
|
249
|
+
`).length<=Jk)return!0;return!1}function tg(e,t){let n=t,o=typeof n?.filePath==="string"?n.filePath:typeof n?.path==="string"?n.path:"",r=/\.([a-z]+)$/i.exec(o),i=r?r[1].toLowerCase():"";return`omo_skill_find "${{ts:"typescript",tsx:"typescript-react",js:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cs:"csharp",cpp:"cpp",c:"c",sh:"bash",bash:"bash",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",toml:"config",sql:"sql",html:"html",css:"css",scss:"css",vue:"vue",svelte:"svelte"}[i]??"code"} ${e}" --limit 5`}var Su=Xk(Yk(),".config","opencode","sisyphus-mandatory","sisyphus-mandatory.md");async function rg(e){return await Kk(e??Su,"utf-8")}function ng(e,t){let n=t?.oracleVerified===!0,o=t?.filesChanged??0,r=["","## Sisyphus Protocol Enforcement","","You MUST follow these Sisyphus protocol rules:","","1. **Pre-response Memory Check**: Before any action, read `<project-memory>` and `<session-history-since>` blocks in context. Cite `<memory id>` for any fact used from memory. Do not ask questions whose answers are in those blocks.","","2. **Codebase Graph First**: Before using grep/glob/read for architecture or symbol queries, check whether `.codegraph/` or `graphify-out/` exists. If so, use codegraph/graphify tools first, then grep/read only as last resort.","","3. **Tool Routing Table**: Match common intents to the correct tool:",' - "we did this before" / "you should know" → `agentmemory_memory_recall`'," - Starting a task that resembles a previous one → `agentmemory_memory_smart_search`"," - Before asking the user a clarifying question → `agentmemory_memory_recall` first"," - Save durable insight/decision/rule → `agentmemory_memory_save`",""];if(/\boracle\b/i.test(e)&&!(n&&o>0))r.push("4. **Post-task Oracle Verification**: If files touched >= 3 OR any INVOKE trigger matches, invoke Oracle with the exact format:",' `task(subagent_type="oracle", run_in_background=false, prompt="Verify: ...")`'," - INVOKE triggers: created 1+ new file, modified abstraction, touched security/auth paths, modified DB/persistence, modified CI/CD, added/removed dependency, modified perf-critical path, todo had 2+ completed items."," - SKIP only when: files touched <= 2, no new file, no dependency change, single-step task, change is typo/comment/rename only."," - Verdict: PASS → done. FAIL/CONDITIONAL → fix and re-invoke. Max 3 invocations."," - Cost: Max 3 oracle invocations per task. Skip rate: Must NOT skip Oracle on 2+ file change.","");return r.push("5. **Parallel Query Rule**: Fire independent tool queries in the same turn. Do NOT serialize independent memory/context queries.","","6. **Empty-Result Escalation**: On empty `agentmemory_memory_recall`, fire `agentmemory_memory_smart_search` + `agentmemory_memory_export` before asking the user.","","7. **Hard Rules (No Exceptions)**:"," - Do NOT ask 'where is X?' if memory or session record already contains it."," - Do NOT claim 'I don't know' before firing at least 2 different recall tools."," - Do NOT re-issue clarifying questions whose answer is in `<project-memory>` or `<session-history-since>`."," - Do NOT suppress type errors with `as any`, `@ts-ignore`, or `@ts-expect-error`."," - Do NOT leave empty catch blocks `catch(e) {}`.",' - Do NOT start a fresh agent via `task()` when `task(task_id="ses_...")` (continuation) exists — use continuation IDs.'," - Do NOT batch-complete todos — mark each one `completed` immediately after finishing."," - Do NOT skip creating todos for multi-step tasks.","","8. **Self-Check Before Responding**:"," - Verify you read `<project-memory>` and `<session-history-since>` blocks."," - Verify you cited `<memory id>` for any fact used from memory."," - Verify you did not ask a question whose answer is in those blocks."," - For multi-file changes, verify Oracle was invoked."," - For codebase exploration, verify codegraph/graphify was tried before grep/read."," - After discovering something non-obvious, save it with `agentmemory_memory_save` so future sessions benefit."," - Do NOT save routine operations (file reads, greps, list commands), trivial decisions, or facts already covered by existing memory. Save only novel insights, non-obvious patterns, or corrections to previous assumptions.","","9. **CI Verification Loop (NON-NEGOTIABLE)**: After EVERY step of an implementation plan that produces a code change you intend to keep, you MUST execute the full CI loop BEFORE moving to the next step:"," a. Commit the changes atomically (one commit per verified increment, never omnibus)."," b. Push to the remote that has CI configured (own repo: `git push origin <branch>`. Fork upstream: `git push fork <branch>` + open/update PR)."," c. Wait for the CI run triggered by the push to reach a terminal state (`gh run watch <run-id> --exit-status`).",' d. Assert `conclusion == "success"` on EVERY job. If any job fails, fix the regression, re-push, and re-verify until all jobs are green.'," e. Capture the green run-id so the final plan-completion message can cite it as evidence."," - Anti-pattern this rule kills: running local tests, seeing 0 failures, declaring done, then shipping the next step on top of an unverified CI. Local green is NOT CI green. Pushed-not-watched is NOT CI green."," - At the END of the plan (when the last step is done), run a final guarantee: `gh run list --branch <branch> --limit 5` and assert EVERY recent run on this branch has `conclusion=success`. If any run shows `failure`, surface it explicitly to the user with the run-id, the failing job, and the log excerpt - do NOT claim plan success."," - For fork -> upstream PR workflow: verify the workflow_run on the upstream repo (the PR's head ref), not just the fork. Both must be green."," - This rule applies whenever the repo has a `.github/workflows/*.yml` file (or equivalent CI config). For repos without CI, document the absence explicitly."," - If the user explicitly says 'skip CI' or 'local only', this rule is suppressed for that turn ONLY - re-engage on next step.",""),r.join(`
|
|
250
|
+
`)}function og(e,t,n){let o=[],r=n.recentToolCalls??[],i=n.recentWriteContents??[],s=n.memorySaved??!1,a=n.batchCompletions??0;if((e==="grep"||e==="glob")&&(n.hasCodegraphDir||n.hasGraphifyDir)){let f=n.hasCodegraphDir?".codegraph":"graphify-out";o.push({rule:"codebase-graph-first",tool:e,severity:"media",detail:`Used ${e} when ${f} exists — should use codegraph/graphify first for architecture and symbol queries.`})}if(e==="task"&&t&&typeof t==="object"){let f=t;if(!f.task_id&&typeof f.prompt==="string"&&r.length>3)o.push({rule:"continuation-discipline",tool:e,severity:"leve",detail:`Started a new task() without task(task_id="ses_...") continuation ID. Use task_id to preserve the subagent's full context and save tokens.`})}if(et.includes(e)){let f=typeof t==="object"&&t!==null?JSON.stringify(t):String(t??""),g=/@ts-ignore|@ts-expect-error/.test(f),d=/\bas any\b/.test(f);if(g&&d)o.push({rule:"no-type-suppression",tool:e,severity:"grave",detail:"File write contains both @ts-ignore/@ts-expect-error AND 'as any' — double type suppression. "+"Both are forbidden by the Sisyphus protocol."});else if(g)o.push({rule:"no-type-suppression",tool:e,severity:"media",detail:"File write contains @ts-ignore or @ts-expect-error — both are forbidden. "+"Fix the underlying type error instead."});else if(d)o.push({rule:"no-type-suppression",tool:e,severity:"media",detail:"File write contains 'as any' — type suppression forbidden. "+"Use proper type narrowing instead."})}if(et.includes(e)){let f=typeof t==="object"&&t!==null?JSON.stringify(t):String(t??"");if(/catch\s*\(\s*\w+\s*\)\s*\{\s*\}/.test(f))o.push({rule:"no-empty-catch",tool:e,severity:"media",detail:"Empty catch block detected — `catch(e) {}` is forbidden. "+"Log the error or handle it gracefully."})}if(["codegraph_explore","graphify query"].includes(e)&&r.length>=2){if(!s)o.push({rule:"save-discovery-to-memory",tool:e,severity:"leve",detail:`Used ${e} to discover code but no memory save was made afterwards. Save non-obvious findings with agentmemory_memory_save so future sessions benefit.`})}if(a>0&&e!=="todowrite")o.push({rule:"no-batch-todo-completion",tool:e,severity:"leve",detail:"Batch todo completion detected. Each todo must be marked `completed` immediately "+"after finishing — do not batch-complete multiple items."});if(n.emptyRecall&&!n.escalationAttempted){if(e.startsWith("question")||e==="ask")o.push({rule:"empty-result-escalation",tool:e,severity:"grave",detail:"Memory recall returned empty but agent did not fire smart_search + export before asking the user. Steps 1-3 of empty-result escalation protocol are mandatory."})}let c=["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"];if(!n.memoryToolsUsed.some((f)=>c.some((g)=>f.startsWith(g)))&&(e.startsWith("question")||e==="ask"))o.push({rule:"memory-first",tool:e,severity:"grave",detail:"Asked a question without first querying memory. Must fire agentmemory_memory_recall or agentmemory_memory_smart_search before asking the user."});if(n.filesChanged>=3&&!n.oracleInvoked&&et.includes(e))o.push({rule:"oracle-verification",tool:e,severity:"media",detail:`Files changed (${n.filesChanged}) >= 3 but Oracle was not invoked. The POST-TASK ORACLE VERIFICATION protocol requires Oracle invocation on multi-file changes.`});return o}import{stat as Dw}from"fs";import{stat as Pw,readdir as Ow}from"fs/promises";import{EventEmitter as Ew}from"events";import*as N from"path";import{stat as Qk,lstat as ig,readdir as ew,realpath as tw}from"node:fs/promises";import{Readable as rw}from"node:stream";import{resolve as sg,relative as nw,join as ow,sep as iw}from"node:path";var De={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Iu={root:".",fileFilter:(e)=>!0,directoryFilter:(e)=>!0,type:De.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Iu);var ug="READDIRP_RECURSIVE_ERROR",sw=new Set(["ENOENT","EPERM","EACCES","ELOOP",ug]),ag=[De.DIR_TYPE,De.EVERYTHING_TYPE,De.FILE_DIR_TYPE,De.FILE_TYPE],aw=new Set([De.DIR_TYPE,De.EVERYTHING_TYPE,De.FILE_DIR_TYPE]),lw=new Set([De.EVERYTHING_TYPE,De.FILE_DIR_TYPE,De.FILE_TYPE]),cw=(e)=>sw.has(e.code),uw=process.platform==="win32",lg=(e)=>!0,cg=(e)=>{if(e===void 0)return lg;if(typeof e==="function")return e;if(typeof e==="string"){let t=e.trim();return(n)=>n.basename===t}if(Array.isArray(e)){let t=e.map((n)=>n.trim());return(n)=>t.some((o)=>n.basename===o)}return lg};class dg extends rw{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...Iu,...e},{root:n,type:o}=t;this._fileFilter=cg(t.fileFilter),this._directoryFilter=cg(t.directoryFilter);let r=t.lstat?ig:Qk;if(uw)this._stat=(i)=>r(i,{bigint:!0});else this._stat=r;this._maxDepth=t.depth??Iu.depth,this._wantsDir=o?aw.has(o):!1,this._wantsFile=o?lw.has(o):!1,this._wantsEverything=o===De.EVERYTHING_TYPE,this._root=sg(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(this.reading)return;this.reading=!0;try{while(!this.destroyed&&e>0){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:o,depth:r}=t,i=n.splice(0,e).map((a)=>this._formatEntry(a,o)),s=await Promise.all(i);for(let a of s){if(!a)continue;if(this.destroyed)return;let l=await this._getEntryType(a);if(l==="directory"&&this._directoryFilter(a)){if(r<=this._maxDepth)this.parents.push(this._exploreDir(a.fullPath,r+1));if(this._wantsDir)this.push(a),e--}else if((l==="file"||this._includeAsFile(a))&&this._fileFilter(a)){if(this._wantsFile)this.push(a),e--}}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}async _exploreDir(e,t){let n;try{n=await ew(e,this._rdOptions)}catch(o){this._onError(o)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n,o=this._isDirent?e.name:e;try{let r=sg(ow(t,o));n={path:nw(this._root,r),fullPath:r,basename:o},n[this._statsProp]=this._isDirent?e:await this._stat(r)}catch(r){this._onError(r);return}return n}_onError(e){if(cw(e)&&!this.destroyed)this.emit("warn",e);else this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let n=e.fullPath;try{let o=await tw(n),r=await ig(o);if(r.isFile())return"file";if(r.isDirectory()){let i=o.length;if(n.startsWith(o)&&n.substr(i,1)===iw){let s=Error(`Circular symlink detected: "${n}" points to "${o}"`);return s.code=ug,this._onError(s)}return"directory"}}catch(o){return this._onError(o),""}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}function mg(e,t={}){let n=t.entryType||t.type;if(n==="both")n=De.FILE_DIR_TYPE;if(n)t.type=n;if(!e)throw Error("readdirp: root argument is required. Usage: readdirp(root, options)");else if(typeof e!=="string")throw TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");else if(n&&!ag.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${ag.join(", ")}`);return t.root=e,new dg(t)}import{watchFile as dw,unwatchFile as pg,watch as mw}from"fs";import{open as pw,stat as gg,lstat as fw,realpath as Tu}from"fs/promises";import*as ee from"path";import{type as gw}from"os";var hw="data",Ou="end",hg="close",No=()=>{};var jo=process.platform,Eu=jo==="win32",vw=jo==="darwin",yw=jo==="linux",bw=jo==="freebsd",vg=gw()==="OS400",Q={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},Me=Q,_w="watch",kw={lstat:fw,stat:gg},xt="listeners",Co="errHandlers",Vt="rawEmitters",ww=[xt,Co,Vt],xw=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),$w=(e)=>xw.has(ee.extname(e).slice(1).toLowerCase()),Pu=(e,t)=>{if(e instanceof Set)e.forEach(t);else t(e)},qr=(e,t,n)=>{let o=e[t];if(!(o instanceof Set))e[t]=o=new Set([o]);o.add(n)},Sw=(e)=>(t)=>{let n=e[t];if(n instanceof Set)n.clear();else delete e[t]},Jr=(e,t,n)=>{let o=e[t];if(o instanceof Set)o.delete(n);else if(o===n)delete e[t]},yg=(e)=>e instanceof Set?e.size===0:!e,Mo=new Map;function fg(e,t,n,o,r){let i=(s,a)=>{if(n(e),r(s,a,{watchedPath:e}),a&&e!==a)Ao(ee.resolve(e,a),xt,ee.join(e,a))};try{return mw(e,{persistent:t.persistent},i)}catch(s){o(s);return}}var Ao=(e,t,n,o,r)=>{let i=Mo.get(e);if(!i)return;Pu(i[t],(s)=>{s(n,o,r)})},Iw=(e,t,n,o)=>{let{listener:r,errHandler:i,rawEmitter:s}=o,a=Mo.get(t),l;if(!n.persistent){if(l=fg(e,n,r,i,s),!l)return;return l.close.bind(l)}if(a)qr(a,xt,r),qr(a,Co,i),qr(a,Vt,s);else{if(l=fg(e,n,Ao.bind(null,t,xt),i,Ao.bind(null,t,Vt)),!l)return;l.on(Me.ERROR,async(c)=>{let u=Ao.bind(null,t,Co);if(a)a.watcherUnusable=!0;if(Eu&&c.code==="EPERM")try{await(await pw(e,"r")).close(),u(c)}catch(f){}else u(c)}),a={listeners:r,errHandlers:i,rawEmitters:s,watcher:l},Mo.set(t,a)}return()=>{if(Jr(a,xt,r),Jr(a,Co,i),Jr(a,Vt,s),yg(a.listeners))a.watcher.close(),Mo.delete(t),ww.forEach(Sw(a)),a.watcher=void 0,Object.freeze(a)}},Du=new Map,Tw=(e,t,n,o)=>{let{listener:r,rawEmitter:i}=o,s=Du.get(t),a=s&&s.options;if(a&&(a.persistent<n.persistent||a.interval>n.interval))pg(t),s=void 0;if(s)qr(s,xt,r),qr(s,Vt,i);else s={listeners:r,rawEmitters:i,options:n,watcher:dw(t,n,(l,c)=>{Pu(s.rawEmitters,(f)=>{f(Me.CHANGE,t,{curr:l,prev:c})});let u=l.mtimeMs;if(l.size!==c.size||u>c.mtimeMs||u===0)Pu(s.listeners,(f)=>f(e,l))})},Du.set(t,s);return()=>{if(Jr(s,xt,r),Jr(s,Vt,i),yg(s.listeners))Du.delete(t),pg(t),s.options=s.watcher=void 0,Object.freeze(s)}};class Ru{constructor(e){this.fsw=e,this._boundHandleError=(t)=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,o=ee.dirname(e),r=ee.basename(e);this.fsw._getWatchedDir(o).add(r);let s=ee.resolve(e),a={persistent:n.persistent};if(!t)t=No;let l;if(n.usePolling){let c=n.interval!==n.binaryInterval;a.interval=c&&$w(r)?n.binaryInterval:n.interval,l=Tw(e,s,a,{listener:t,rawEmitter:this.fsw._emitRaw})}else l=Iw(e,s,a,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return l}_handleFile(e,t,n){if(this.fsw.closed)return;let o=ee.dirname(e),r=ee.basename(e),i=this.fsw._getWatchedDir(o),s=t;if(i.has(r))return;let a=async(c,u)=>{if(!this.fsw._throttle(_w,e,5))return;if(!u||u.mtimeMs===0)try{let f=await gg(e);if(this.fsw.closed)return;let{atimeMs:g,mtimeMs:d}=f;if(!g||g<=d||d!==s.mtimeMs)this.fsw._emit(Me.CHANGE,e,f);if((vw||yw||bw)&&s.ino!==f.ino){this.fsw._closeFile(c),s=f;let y=this._watchWithNodeFs(e,a);if(y)this.fsw._addPathCloser(c,y)}else s=f}catch(f){this.fsw._remove(o,r)}else if(i.has(r)){let{atimeMs:f,mtimeMs:g}=u;if(!f||f<=g||g!==s.mtimeMs)this.fsw._emit(Me.CHANGE,e,u);s=u}},l=this._watchWithNodeFs(e,a);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Me.ADD,e,0))return;this.fsw._emit(Me.ADD,e,t)}return l}async _handleSymlink(e,t,n,o){if(this.fsw.closed)return;let r=e.fullPath,i=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let s;try{s=await Tu(n)}catch(a){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;if(i.has(o)){if(this.fsw._symlinkPaths.get(r)!==s)this.fsw._symlinkPaths.set(r,s),this.fsw._emit(Me.CHANGE,n,e.stats)}else i.add(o),this.fsw._symlinkPaths.set(r,s),this.fsw._emit(Me.ADD,n,e.stats);return this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(r))return!0;this.fsw._symlinkPaths.set(r,!0)}_handleRead(e,t,n,o,r,i,s){if(e=ee.join(e,""),s=this.fsw._throttle("readdir",e,1000),!s)return;let a=this.fsw._getWatchedDir(n.path),l=new Set,c=this.fsw._readdirp(e,{fileFilter:(u)=>n.filterPath(u),directoryFilter:(u)=>n.filterDir(u)});if(!c)return;return c.on(hw,async(u)=>{if(this.fsw.closed){c=void 0;return}let f=u.path,g=ee.join(e,f);if(l.add(f),u.stats.isSymbolicLink()&&await this._handleSymlink(u,e,g,f))return;if(this.fsw.closed){c=void 0;return}if(f===o||!o&&!a.has(f))this.fsw._incrReadyCount(),g=ee.join(r,ee.relative(r,g)),this._addToNodeFs(g,t,n,i+1)}).on(Me.ERROR,this._boundHandleError),new Promise((u,f)=>{if(!c)return f();c.once(Ou,()=>{if(this.fsw.closed){c=void 0;return}let g=s?s.clear():!1;if(u(void 0),a.getChildren().filter((d)=>d!==e&&!l.has(d)).forEach((d)=>{this.fsw._remove(e,d)}),c=void 0,g)this._handleRead(e,!1,n,o,r,i,s)})})}async _handleDir(e,t,n,o,r,i,s){let a=this.fsw._getWatchedDir(ee.dirname(e)),l=a.has(ee.basename(e));if(!(n&&this.fsw.options.ignoreInitial)&&!r&&!l)this.fsw._emit(Me.ADD_DIR,e,t);a.add(ee.basename(e)),this.fsw._getWatchedDir(e);let c,u,f=this.fsw.options.depth;if((f==null||o<=f)&&!this.fsw._symlinkPaths.has(s)){if(!r){if(await this._handleRead(e,n,i,r,e,o,c),this.fsw.closed)return}u=this._watchWithNodeFs(e,(g,d)=>{if(d&&d.mtimeMs===0)return;this._handleRead(g,!1,i,r,e,o,c)})}return u}async _addToNodeFs(e,t,n,o,r){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let s=this.fsw._getWatchHelpers(e);if(n)s.filterPath=(a)=>n.filterPath(a),s.filterDir=(a)=>n.filterDir(a);try{let a=await kw[s.statMethod](s.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(s.watchPath,a))return i(),!1;let l=this.fsw.options.followSymlinks,c;if(a.isDirectory()){let u=ee.resolve(e),f=l?await Tu(e):e;if(this.fsw.closed)return;if(c=await this._handleDir(s.watchPath,a,t,o,r,s,f),this.fsw.closed)return;if(u!==f&&f!==void 0)this.fsw._symlinkPaths.set(u,f)}else if(a.isSymbolicLink()){let u=l?await Tu(e):e;if(this.fsw.closed)return;let f=ee.dirname(s.watchPath);if(this.fsw._getWatchedDir(f).add(s.watchPath),this.fsw._emit(Me.ADD,s.watchPath,a),c=await this._handleDir(f,a,t,o,e,s,u),this.fsw.closed)return;if(u!==void 0)this.fsw._symlinkPaths.set(ee.resolve(e),u)}else c=this._handleFile(s.watchPath,a,t);if(i(),c)this.fsw._addPathCloser(e,c);return!1}catch(a){if(this.fsw._handleError(a))return i(),e}}}/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */var zu="/",Rw="//",$g=".",zw="..",Cw="string",Mw=/\\/g,bg=/\/\//,Aw=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Nw=/^\.[/\\]/;function Uo(e){return Array.isArray(e)?e:[e]}var Cu=(e)=>typeof e==="object"&&e!==null&&!(e instanceof RegExp);function jw(e){if(typeof e==="function")return e;if(typeof e==="string")return(t)=>e===t;if(e instanceof RegExp)return(t)=>e.test(t);if(typeof e==="object"&&e!==null)return(t)=>{if(e.path===t)return!0;if(e.recursive){let n=N.relative(e.path,t);if(!n)return!1;return!n.startsWith("..")&&!N.isAbsolute(n)}return!1};return()=>!1}function Uw(e){if(typeof e!=="string")throw Error("string expected");e=N.normalize(e),e=e.replace(/\\/g,"/");let t=!1;if(e.startsWith("//"))t=!0;let n=/\/\//;while(e.match(n))e=e.replace(n,"/");if(t)e="/"+e;return e}function _g(e,t,n){let o=Uw(t);for(let r=0;r<e.length;r++){let i=e[r];if(i(o,n))return!0}return!1}function Lw(e,t){if(e==null)throw TypeError("anymatch: specify first argument");let o=Uo(e).map((r)=>jw(r));if(t==null)return(r,i)=>_g(o,r,i);return _g(o,t)}var kg=(e)=>{let t=Uo(e).flat();if(!t.every((n)=>typeof n===Cw))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(Sg)},wg=(e)=>{let t=e.replace(Mw,zu),n=!1;if(t.startsWith(Rw))n=!0;while(t.match(bg))t=t.replace(bg,zu);if(n)t=zu+t;return t},Sg=(e)=>wg(N.normalize(wg(e))),xg=(e="")=>(t)=>{if(typeof t==="string")return Sg(N.isAbsolute(t)?t:N.join(e,t));else return t},Fw=(e,t)=>{if(N.isAbsolute(e))return e;return N.join(t,e)},Zw=Object.freeze(new Set);class Ig{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;if(!t)return;if(e!==$g&&e!==zw)t.add(e)}async remove(e){let{items:t}=this;if(!t)return;if(t.delete(e),t.size>0)return;let n=this.path;try{await Ow(n)}catch(o){if(this._removeWatcher)this._removeWatcher(N.dirname(n),N.basename(n))}}has(e){let{items:t}=this;if(!t)return;return t.has(e)}getChildren(){let{items:e}=this;if(!e)return[];return[...e.values()]}dispose(){this.items.clear(),this.path="",this._removeWatcher=No,this.items=Zw,Object.freeze(this)}}var Gw="stat",Ww="lstat";class Tg{constructor(e,t,n){this.fsw=n;let o=e;this.path=e=e.replace(Nw,""),this.watchPath=o,this.fullWatchPath=N.resolve(o),this.dirParts=[],this.dirParts.forEach((r)=>{if(r.length>1)r.pop()}),this.followSymlinks=t,this.statMethod=t?Gw:Ww}entryPath(e){return N.join(this.watchPath,N.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class Dg extends Ew{constructor(e={}){super();this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2000,pollInterval:100},o={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?Uo(e.ignored):Uo([]),awaitWriteFinish:t===!0?n:typeof t==="object"?{...n,...t}:!1};if(vg)o.usePolling=!0;if(o.atomic===void 0)o.atomic=!o.usePolling;let r=process.env.CHOKIDAR_USEPOLLING;if(r!==void 0){let a=r.toLowerCase();if(a==="false"||a==="0")o.usePolling=!1;else if(a==="true"||a==="1")o.usePolling=!0;else o.usePolling=!!a}let i=process.env.CHOKIDAR_INTERVAL;if(i)o.interval=Number.parseInt(i,10);let s=0;this._emitReady=()=>{if(s++,s>=this._readyCount)this._emitReady=No,this._readyEmitted=!0,process.nextTick(()=>this.emit(Q.READY))},this._emitRaw=(...a)=>this.emit(Q.RAW,...a),this._boundRemove=this._remove.bind(this),this.options=o,this._nodeFsHandler=new Ru(this),Object.freeze(o)}_addIgnoredPath(e){if(Cu(e)){for(let t of this._ignoredPaths)if(Cu(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==="string"){for(let t of this._ignoredPaths)if(Cu(t)&&t.path===e)this._ignoredPaths.delete(t)}}add(e,t,n){let{cwd:o}=this.options;this.closed=!1,this._closePromise=void 0;let r=kg(e);if(o)r=r.map((i)=>Fw(i,o));if(r.forEach((i)=>{this._removeIgnoredPath(i)}),this._userIgnored=void 0,!this._readyCount)this._readyCount=0;return this._readyCount+=r.length,Promise.all(r.map(async(i)=>{let s=await this._nodeFsHandler._addToNodeFs(i,!n,void 0,0,t);if(s)this._emitReady();return s})).then((i)=>{if(this.closed)return;i.forEach((s)=>{if(s)this.add(N.dirname(s),N.basename(t||s))})}),this}unwatch(e){if(this.closed)return this;let t=kg(e),{cwd:n}=this.options;return t.forEach((o)=>{if(!N.isAbsolute(o)&&!this._closers.has(o)){if(n)o=N.join(n,o);o=N.resolve(o)}if(this._closePath(o),this._addIgnoredPath(o),this._watched.has(o))this._addIgnoredPath({path:o,recursive:!0});this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach((t)=>t.forEach((n)=>{let o=n();if(o instanceof Promise)e.push(o)})),this._streams.forEach((t)=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach((t)=>t.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{return}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let r=(this.options.cwd?N.relative(this.options.cwd,n):n)||$g;e[r]=t.getChildren().sort()}),e}emitWithAll(e,t){if(this.emit(e,...t),e!==Q.ERROR)this.emit(Q.ALL,e,...t)}async _emit(e,t,n){if(this.closed)return;let o=this.options;if(Eu)t=N.normalize(t);if(o.cwd)t=N.relative(o.cwd,t);let r=[t];if(n!=null)r.push(n);let i=o.awaitWriteFinish,s;if(i&&(s=this._pendingWrites.get(t)))return s.lastChange=new Date,this;if(o.atomic){if(e===Q.UNLINK)return this._pendingUnlinks.set(t,[e,...r]),setTimeout(()=>{this._pendingUnlinks.forEach((a,l)=>{this.emit(...a),this.emit(Q.ALL,...a),this._pendingUnlinks.delete(l)})},typeof o.atomic==="number"?o.atomic:100),this;if(e===Q.ADD&&this._pendingUnlinks.has(t))e=Q.CHANGE,this._pendingUnlinks.delete(t)}if(i&&(e===Q.ADD||e===Q.CHANGE)&&this._readyEmitted){let a=(l,c)=>{if(l)e=Q.ERROR,r[0]=l,this.emitWithAll(e,r);else if(c){if(r.length>1)r[1]=c;else r.push(c);this.emitWithAll(e,r)}};return this._awaitWriteFinish(t,i.stabilityThreshold,e,a),this}if(e===Q.CHANGE){if(!this._throttle(Q.CHANGE,t,50))return this}if(o.alwaysStat&&n===void 0&&(e===Q.ADD||e===Q.ADD_DIR||e===Q.CHANGE)){let a=o.cwd?N.join(o.cwd,t):t,l;try{l=await Pw(a)}catch(c){}if(!l||this.closed)return;r.push(l)}return this.emitWithAll(e,r),this}_handleError(e){let t=e&&e.code;if(e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES"))this.emit(Q.ERROR,e);return e||this.closed}_throttle(e,t,n){if(!this._throttled.has(e))this._throttled.set(e,new Map);let o=this._throttled.get(e);if(!o)throw Error("invalid throttle");let r=o.get(t);if(r)return r.count++,!1;let i,s=()=>{let l=o.get(t),c=l?l.count:0;if(o.delete(t),clearTimeout(i),l)clearTimeout(l.timeoutObject);return c};i=setTimeout(s,n);let a={timeoutObject:i,clear:s,count:0};return o.set(t,a),a}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,o){let r=this.options.awaitWriteFinish;if(typeof r!=="object")return;let i=r.pollInterval,s,a=e;if(this.options.cwd&&!N.isAbsolute(e))a=N.join(this.options.cwd,e);let l=new Date,c=this._pendingWrites;function u(f){Dw(a,(g,d)=>{if(g||!c.has(e)){if(g&&g.code!=="ENOENT")o(g);return}let y=Number(new Date);if(f&&d.size!==f.size)c.get(e).lastChange=y;let x=c.get(e);if(y-x.lastChange>=t)c.delete(e),o(void 0,d);else s=setTimeout(u,i,d)})}if(!c.has(e))c.set(e,{lastChange:l,cancelWait:()=>(c.delete(e),clearTimeout(s),n)}),s=setTimeout(u,i)}_isIgnored(e,t){if(this.options.atomic&&Aw.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,r=(this.options.ignored||[]).map(xg(n)),s=[...[...this._ignoredPaths].map(xg(n)),...r];this._userIgnored=Lw(s,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new Tg(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=N.resolve(e);if(!this._watched.has(t))this._watched.set(t,new Ig(t,this._boundRemove));return this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;return Boolean(Number(e.mode)&256)}_remove(e,t,n){let o=N.join(e,t),r=N.resolve(o);if(n=n!=null?n:this._watched.has(o)||this._watched.has(r),!this._throttle("remove",o,100))return;if(!n&&this._watched.size===1)this.add(e,t,!0);this._getWatchedDir(o).getChildren().forEach((f)=>this._remove(o,f));let a=this._getWatchedDir(e),l=a.has(t);if(a.remove(t),this._symlinkPaths.has(r))this._symlinkPaths.delete(r);let c=o;if(this.options.cwd)c=N.relative(this.options.cwd,o);if(this.options.awaitWriteFinish&&this._pendingWrites.has(c)){if(this._pendingWrites.get(c).cancelWait()===Q.ADD)return}this._watched.delete(o),this._watched.delete(r);let u=n?Q.UNLINK_DIR:Q.UNLINK;if(l&&!this._isIgnored(o))this._emit(u,o);this._closePath(o)}_closePath(e){this._closeFile(e);let t=N.dirname(e);this._getWatchedDir(t).remove(N.basename(e))}_closeFile(e){let t=this._closers.get(e);if(!t)return;t.forEach((n)=>n()),this._closers.delete(e)}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);if(!n)n=[],this._closers.set(e,n);n.push(t)}_readdirp(e,t){if(this.closed)return;let n={type:Q.ALL,alwaysStat:!0,lstat:!0,...t,depth:0},o=mg(e,n);return this._streams.add(o),o.once(hg,()=>{o=void 0}),o.once(Ou,()=>{if(o)this._streams.delete(o),o=void 0}),o}}function Pg(e,t={}){let n=new Dg(t);return n.add(e),n}import{existsSync as Hw}from"node:fs";var Vw=/^[A-Z]:[\\/](pagefile\.sys|DumpStack\.log\.tmp|hiberfil\.sys|swapfile\.sys)/i;async function Og(e){if(!e.projectDir||!Hw(e.projectDir))return{stop:async()=>{}};let t=(i)=>i.endsWith("SKILL.md"),n=Pg(e.projectDir,{ignoreInitial:!0,usePolling:!0,interval:100,binaryInterval:100,ignored:(i)=>Vw.test(i)}),o=!1,r=new Promise((i)=>{n.once("ready",()=>{if(!o)i()})});return n.on("add",(i)=>{if(!o&&t(i))e.onChange(i,"add")}),n.on("change",(i)=>{if(!o&&t(i))e.onChange(i,"change")}),await r,await new Promise((i)=>setTimeout(i,100)),{async stop(){o=!0,await n.close()}}}var Bw=[/^[A-Z]:[\\/](pagefile\.sys|DumpStack\.log\.tmp)/i,/^[A-Z]:[\\/](Users|home)[\\/][^\\/]+[\\/]AppData[\\/]Local[\\/]Temp[\\/]/i,/^\/(var|private\/var)\/folders\//,/^\/snap\//],qw=new Set(["EINVAL","ENOENT","EACCES","EBADF","EPERM"]),Lo=null;function Eg(e={}){let t=Object.keys(e).length===0;if(t&&Lo)return Lo;let n=e.paths??Bw,o=e.errorCodes??qw,r=e.logger??console,i=(u)=>{let f=u&&typeof u==="object"&&"code"in u&&u.code?o.has(u.code):!1,g=!!(u?.path&&n.some((d)=>d.test(u.path)));if(f&&g){r.warn?.("watcher_scan_blocked",{path:u.path,code:u.code,message:u.message});return}};process.on("uncaughtException",i);let s=()=>process.off("uncaughtException",i),a=(u)=>{if(u&&typeof u==="object"&&"code"in u)i(u)};process.on("unhandledRejection",a);let l=()=>process.off("unhandledRejection",a),c=()=>{if(s(),l(),t)Lo=null};if(t)Lo=c;return c}pn();Eg();var Cg={continue:0,warn:1,escalate:2,stop:3};function Mg(e,t){return Cg[e]>=Cg[t]}function Ag(e){if(e.tool!=="bash")return!1;let t=e.args?.command;if(typeof t!=="string")return!1;return/(?:>>?|[<>]\s*&?\s*[''"]?\s*\S+|\btee\s+[^|;&]+)/.test(t)}function sx(e){let t=e.args;if(!t||typeof t!=="object")return null;let n=["pattern","query","path","glob","regex","include_pattern"];for(let o of n){let r=t[o];if(typeof r==="string"&&r.trim().length>0)return r.trim()}return null}var ze=Ef({sessionID:"__global__",global:!0,version:me});var Ng=ge().health;try{Be({oldPaths:Ve(),newPaths:ge()})}catch{}function Lg(e={},t={}){let n=Z(),o=new yu;Fp(o);let r=process.cwd(),i=hn(),s=Gp({graphRetrieval:n,cwd:r}),a=Wp({sqlite:i}),l=Hp({metrics:ze,logFilePath:be,healthFilePath:Ng}),c=Vp({cwd:r}),u=Bp({cwd:r}),f=qp({onDispatch:({sessionID:ce,mcpTool:Ae,mcpArgs:xe})=>{o.register({sessionID:ce,mcpTool:Ae,mcpArgs:xe})}}),g=Jp({onDispatch:({sessionID:ce,mcpTool:Ae,mcpArgs:xe})=>{o.register({sessionID:ce,mcpTool:Ae,mcpArgs:xe})}}),d=Kp({cwd:r}),y=Xp({cwd:r}),x=Yp({graphRetrieval:n,cwd:r}),C=Qp({graphRetrieval:n,cwd:r}),j=ef({graphRetrieval:n,cwd:r}),K=tf({graphRetrieval:n,cwd:r}),W=rf({graphRetrieval:n,cwd:r}),ae=nf({graphRetrieval:n,cwd:r}),Pe=of({graphRetrieval:n,cwd:r}),Bt=sf({graphRetrieval:n,cwd:r}),ju=af({graphRetrieval:n,cwd:r}),Uu=lf({graphRetrieval:n,cwd:r}),Lu=cf({graphRetrieval:n,cwd:r}),Fu=uf({graphRetrieval:n,cwd:r}),Zu=df({graphRetrieval:n,cwd:r}),Gu=mf({graphRetrieval:n,cwd:r}),Wu=pf({graphRetrieval:n,cwd:r}),Hu=ff({graphRetrieval:n,cwd:r}),Vu=gf({graphRetrieval:n,cwd:r}),Bu=hf({graphRetrieval:n,cwd:r}),qu=vf({graphRetrieval:n,cwd:r}),Ju=yf({graphRetrieval:n,cwd:r}),Ku=bf({graphRetrieval:n,cwd:r}),Xu=_f({graphRetrieval:n,cwd:r}),Yu=kf({graphRetrieval:n,cwd:r}),Qu=wf({cwd:r}),ed=xf({cwd:r}),td=$f({cwd:r}),rd=Sf({cwd:r}),nd=If({cwd:r});I("info",`v${me} MetaGovernor plugin loaded`,{version:me,build:me,cwd:r,projectHasCodegraph:n.hasCodegraphDir(r),projectHasGraphify:n.hasGraphifyDir(r)});let od="?";try{let Ae=rx(import.meta.url),xe=Au(Ae);od=tx("sha256").update(xe).digest("hex").slice(0,8)}catch{}return console.log(`[meta-governor] v${me} loaded (bundle: ${od})`),(async()=>{let ce=ge().selfVersionCache,Ae=86400000,xe=null;try{let $e=Au(ce,"utf-8"),Ge=JSON.parse($e);if(typeof Ge.latest==="string"&&typeof Ge.checkedAtMs==="number"&&Date.now()-Ge.checkedAtMs<86400000)xe={latest:Ge.latest,checkedAtMs:Ge.checkedAtMs}}catch{}let Ne=xe?.latest??null;if(!Ne)try{let{execSync:$e}=await import("node:child_process");if(Ne=$e("npm view @herjarsa/omo-meta-governor version",{timeout:5000,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()||null,Ne)try{let Ge=ce.replace(/[\\/][^\\/]+$/,""),{mkdirSync:T,writeFileSync:Xr}=await import("node:fs");T(Ge,{recursive:!0}),Xr(ce,JSON.stringify({latest:Ne,checkedAtMs:Date.now()}))}catch{}}catch{}if(Ne&&Ne!==me)I("warn",`STALE_CACHE: loaded v${me} but npm has v${Ne}. Run: npm cache clean --force && rm -rf ~/.cache/opencode/packages/@herjarsa/omo-meta-governor*`)})(),async(ce,Ae)=>{I("info",`v${me} factory_invoked`,{version:me,hasInput:ce!=null,inputDir:ce?.directory??null,inputKeys:ce?Object.keys(ce):[]});let xe=ce.client,Ne=xe!=null&&typeof xe==="object"&&"tool"in xe?xe:null;Wr().setClient(Ne),pu(Ne);let $e;try{$e=await _u({projectDir:ce.directory??r})}catch(p){throw I("error","factory_config_load_failed",{message:p instanceof Error?p.message:String(p),stack:p instanceof Error?p.stack?.slice(0,800):void 0}),p}let Ge={...e,...$e.config,...Ae?.meta_governor??{}},T;try{T=wu(Ge)}catch(p){throw I("error","factory_orchestrator_config_failed",{message:p instanceof Error?p.message:String(p)}),p}if(zp({preferredTool:T.graphRetrieval.preferredTool}),$e.sources.length>0)I("info",`v${me} config_loaded`,{version:me,sources:$e.sources,effectiveSource:$e.effectiveSource,enabled:T.enabled});if(T.postWave?.enabled===!0&&T.intervention.respectDoneSignal===!1)I("info","post_wave_warning",{message:"postWave.enabled=true but intervention.respectDoneSignal=false: post-wave directives still fire on Oracle-verified PHASE-N-COMPLETE, but the done-signal latch is off (intervention is not auto-disabled at plan end)."});let Xr=new Set,id=new Set,Fg=new Set,Se=ce.directory?nx(ce.directory):r,qt=Ae?.meta_governor?.graphSync??$e.config?.graphSync??e.graphSync;if(qt?.enabled!==!1){if(t.__test_onGraphSyncInit?.({projectDir:Se}),(t.__test_runGraphSync??er)({enabled:!0,watch:qt?.watch??!1,autoInstall:qt?.autoInstall??!0,installTimeoutMs:qt?.installTimeoutMs??60000,killOrphanedOnInit:qt?.killOrphanedOnInit??!0,projectDir:Se}).then((w)=>{if(w?.attempted&&w.availability.codegraph&&w.availability.graphify)Xr.add(Se)}).catch((w)=>{I("warn",`graphSync init failed: ${String(w)}`)}),T.cliAnything?.enabled!==!1){let w=Ae?.meta_governor?.cliAnything??$e.config?.cliAnything;(t.__test_runCliAnythingSync??Ad)({enabled:!0,autoInstall:w?.autoInstall??!0,autoUpgrade:w?.autoUpgrade??!0,cachePath:w?.cachePath??ge().cliAnythingUpgradeCheck,upgradeCheckTtlMs:w?.upgradeCheckTtlMs??86400000,projectDir:Se,installScope:w?.installScope??"global",cliHubBin:w?.cliHubBin??"cli-hub",skillsBin:w?.skillsBin??"npx skills"}).then((S)=>{if(S?.attempted&&S.availability.cliHub)Fg.add(Se)}).catch((S)=>{I("warn",`cli-anything sync failed: ${String(S)}`)})}queueMicrotask(()=>{try{let w=T.graphSync.fetchBranch,v=ii(Se,w);if(v>0)I("info",`reindexOnFetch: ${v} new commits on origin/${w}, reindexing`),mn(Se).catch((S)=>{I("warn",`reindexOnFetch failed: ${String(S)}`)})}catch{}})}let Jt=null;if(!T.enabled){if($e.sources.length>0)I("warn","config_loaded_but_disabled",{version:me,sources:$e.sources,hint:"Set meta_governor.enabled=true (or top-level enabled:true) in your omo-meta-governor.jsonc to activate governance."});return{tool:{omo_search:s,omo_recall:a,omo_health:l,omo_find:c,omo_impact:u,omo_remember:f,omo_recall_mcp:g,omo_path:d,omo_explain:y,omo_files:x,omo_callers:C,omo_node:j,omo_context:K,omo_affected_cg:W,omo_status:ae,omo_unlock:Pe,omo_mark_dirty:Bt,omo_sync_if_dirty:ju,omo_index:Uu,omo_visualize:Lu,omo_serve:Fu,omo_uninit:Zu,omo_diagnose:Gu,omo_merge_graphs:Wu,omo_save_result:Hu,omo_extract:Vu,omo_cluster_only:Bu,omo_label:qu,omo_tree:Ju,omo_clone:Ku,omo_add:Xu,omo_check_update:Yu,omo_hook_status:Qu,omo_cli_anything_install:ed,omo_cli_anything_list:td,omo_cli_anything_search:rd,omo_cli_anything_info:nd},dispose:async()=>{try{qo()}catch{}try{Qt()}catch{}try{rn()}catch{}try{It()}catch{}try{if(Jt)await Jt.stop()}catch{}}}}let Zo=()=>T.modelOverride?.providerID??t.providerID?.(),Go=()=>T.modelOverride?.modelID??t.modelID?.(),Zg=()=>T.modelOverride?.modelLimit??200000,Sx=Zo()??"unknown",Ix=Go()??"unknown",sd,ad;if(T.protocolEnforcement.enabled||T.protocolEnforcement.injectIntoSystem){let p=T.protocolEnforcement.path??Su;try{sd=await rg(p),ad=ng(sd)}catch(w){if(T.modelOverride?.verbosity!=="silent")I("warn",`could not load protocol: ${w instanceof Error?w.message:String(w)}`)}}let pe=new $u({maxEntries:100,ttlMs:3600000}),Yr=new Br(1000,300000),$t=new Br(1000,300000),ld=new Set,cd=new Set,Gg=new Map,ud=new Set,Wg=new Set,Hg=new Set,Tx=new Set,dd=new Set,Vg=()=>({currentWaveN:null,lastInjectedWaveN:null,lastInjectedAtMs:null,postWaveInjectionsThisWave:0,rulesReadForWave:{},oracleAfterPhaseAtMs:{},repoModeResolved:null}),md=new Br(1000,86400000),Wo=(p)=>{if(typeof t.__test_isMainSession==="function")try{return t.__test_isMainSession(p)}catch{return!0}return!0},St=(p,w)=>{if(!p||!w)return;if(!Wo(p)){I("info",`persist skipped (subagent) for ${p}`);return}if(!T.intervention.persistToSession)return;let v=pe.get(p);if(v?.backgroundTaskInFlight||v?.oracleInFlight){I("info",`persist skipped (background task in flight) for ${p}`);return}let S=()=>(t.__test_persistSessionMessage??Oo)(p,w),D=(L)=>{if(!L.ok)I("warn",`persist intervention failed for ${p}`,{error:L.error});else I("info",`persisted intervention for ${p}`)};if(t.__test_persistSessionMessage){S().then((L)=>{if(!L.ok&&L.error&&/timed out/i.test(L.error)){let V=pe.get(p);if(V?.backgroundTaskInFlight||V?.oracleInFlight){I("info",`persist retry skipped (background task in flight) for ${p}`);return}setTimeout(()=>{S().then(D)},t.__test_persistRetryDelayMs??1500);return}D(L)});return}I("info",`persist intervention (superficial, not queued) for ${p}: ${w.slice(0,200)}`),ze.inc("interventions_delivered")},Bg=Dp((p)=>{try{Io(p,Ng)}catch(w){I("warn","health snapshot write failed",{error:String(w)})}},5000);try{let p=Nu(Se,".agents","skills");Jt=await(t.__test_startSkillsFsWatcher??Og)({projectDir:p,onChange:async(v,S)=>{if(S!=="add")return;try{ze.inc("tier3_skills_created"),I("info",`tier3_skills_created: ${v}`)}catch(D){I("warn",`tier3 watcher onChange failed: ${String(D)}`)}}})}catch(p){I("warn",`tier3 fs watcher failed to start: ${String(p)}`)}return{dispose:async()=>{try{qo()}catch{}try{Qt()}catch{}try{rn()}catch{}try{It()}catch{}try{if(Jt)await Jt.stop()}catch{}},"tool.execute.before":async(p,w)=>{if(!T.enabled)return;if(!p.sessionID)return;if(T.skillPriming.enabled&&T.skillPriming.enforceMode==="block"&&p.tool!=="omo_skill_find"&&!ud.has(p.sessionID)&&(et.includes(p.tool)||Ag(p))&&!eg(p.tool,w?.args)){let D=tg(p.tool,w?.args);throw Error(`[meta-governor] skill-priming required: run \`${D}\` to discover relevant skills before using "${p.tool}". Pass the candidates to a sub-agent via \`task(category='<category>', load_skills=[...])\` to load 2-3 capabilities. Set skillPriming.enforceMode='directive' in your config to bypass this gate, or write to a tmp/test/scratch path for trivial edits.`)}if(!T.protocolEnforcement.auditToolCalls)return;let v=pe.get(p.sessionID);if(!v)v={memoryToolsUsed:[],hasCodegraphDir:n.hasCodegraphDir(r),hasGraphifyDir:n.hasGraphifyDir(r),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,lastViolationInjectionAtMs:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[],overflowCompactionCount:0,overflowLoopGuardTripped:!1},pe.set(p.sessionID,v);if(v?.oracleInFlight)return;if(ad)I("info","protocol loaded, system injection ready");let S=og(p.tool,w.args,{memoryToolsUsed:v.memoryToolsUsed,hasCodegraphDir:v.hasCodegraphDir,hasGraphifyDir:v.hasGraphifyDir,oracleInvoked:v.oracleInvoked,filesChanged:v.filesChanged,emptyRecall:v.emptyRecall,escalationAttempted:v.escalationAttempted,recentToolCalls:v.recentToolCalls,recentWriteContents:v.recentWriteContents,memorySaved:v.memorySaved,batchCompletions:v.batchCompletions});if(S.length>0){let L=v.lastViolationInjectionAtMs??0;if(L>0&&Date.now()-L<30000){I("info",`violation during cooldown (${Math.round((30000-(Date.now()-L))/1000)}s remaining), skipping queue`);let V=S.map((oe)=>({severity:oe.severity,category:oe.rule,detail:oe.detail,ts:Date.now()}));v.accumulatedDeviations=[...v.accumulatedDeviations,...V].slice(-5)}else{I("warn",`protocol violations on tool ${p.tool}`,S);let V=Yr.get(p.sessionID)?.items??[],oe=new Set;for(let F of S){let ue=`${F.severity}::${F.rule}::${F.detail}`;if(oe.has(ue))continue;oe.add(ue);let z=`[${F.severity.toUpperCase()}] ${F.rule}: ${F.detail}`;if(!V.includes(z))V.push(z)}Yr.set(p.sessionID,{items:V});let O=S.map((F)=>({severity:F.severity,category:F.rule,detail:F.detail,ts:Date.now()}));v.accumulatedDeviations=[...v.accumulatedDeviations,...O].slice(-5)}}else I("info",`audit OK on tool ${p.tool}`);if((p.tool==="grep"||p.tool==="glob")&&(n.hasCodegraphDir(r)||n.hasGraphifyDir(r))){let D=sx(p);if(D)n.invoke(r,D,{timeoutMs:5000}).then((L)=>{if(L.result)n.cacheContext(p.sessionID,D,L.result)}).catch((L)=>{I("warn",`graphRetrieval.invoke failed for session ${p.sessionID}: ${String(L)}`)})}},"tool.execute.after":async(p,w)=>{if(!T.enabled)return;if(ze.inc("tool_calls_observed"),p.sessionID&&(p.tool==="omo_skill_find"||p.tool==="omo_skill_add"||p.tool==="omo_skill_get"||p.tool==="omo_skill_local_link"||p.tool==="omo_skill_semantic_find"||p.tool==="omo_skill_create"))ud.add(p.sessionID);if(p.sessionID){let z=p.sessionID;if(p.tool==="omo_search"||p.tool==="omo_find"||p.tool==="omo_impact"||p.tool==="omo_path"||p.tool==="omo_explain")Wg.add(z);if(p.tool==="omo_recall"||p.tool==="omo_recall_mcp")Hg.add(z)}Bg.write(To({version:me,enabled:!0,sessionID:p.sessionID||"__unknown__",snapshot:ze.getMetrics(),logFilePath:be}));try{o.markDelivered({sessionID:p.sessionID,mcpTool:p.tool,mcpArgs:p.args})}catch{}if(et.includes(p.tool))dd.add(p.sessionID);let v=pe.get(p.sessionID);if(v){if(v.iteration++,v.recentToolCalls=[p.tool].concat(v.recentToolCalls).slice(0,20),et.includes(p.tool)||Ag(p)){v.filesChanged++;let G=(w.output??"").slice(0,500);v.recentWriteContents=[G].concat(v.recentWriteContents).slice(0,3);let M=p.args,re=M?.filePath??M?.path;if(p.tool==="bash"&&(typeof re!=="string"||re.length===0)){let Kt=(p.args?.command??"").match(/(?:>>?)\s*[''"]?([^''"&\s;]+)/);if(Kt)re=Kt[1]}if(typeof re==="string"&&re.length>0)v.recentWriteFilePaths=[re].concat(v.recentWriteFilePaths).slice(0,10)}if(["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"].some((G)=>p.tool.startsWith(G))&&!v.memoryToolsUsed.includes(p.tool))v.memoryToolsUsed.push(p.tool);if(p.tool.startsWith("agentmemory_memory_save")){let G=w.output??"";if(G.includes("saved")||G.includes("written"))v.memorySaved=!0}if(p.tool==="task"){let G=w.output??"",M=p.args,re=M?.subagent_type;if(re==="oracle"||/"subagent_type"\s*:\s*"oracle"/.test(G)){if(v.oracleInvoked=!0,M?.run_in_background===!0)v.oracleInFlight=!0,v.oracleInFlightSinceMs=Date.now()}if(M?.run_in_background===!0&&typeof re==="string")v.backgroundTaskInFlight=!0,v.backgroundTaskInFlightSinceMs=Date.now(),v.backgroundTaskType=re,I("info",`background_task_in_flight: subagent_type=${re} for session ${p.sessionID}`)}let U=(w.output??"").toLowerCase();if(p.tool.includes("recall")&&(U.includes("returned empty")||U.includes("no results")))v.emptyRecall=!0;if(p.tool==="todowrite"&&(w.output??"").includes("completed")){if(((w.output??"").match(/"status":"completed"/g)??[]).length>=3)v.batchCompletions++}let B=[typeof w.output==="string"?w.output:"",typeof p.args==="string"?p.args:""].join(`
|
|
251
|
+
`);if(!v.taskDoneSignal&&fx(B))v.taskDoneSignal=!0,v.signalAtMs=Date.now(),I("info",`task_done_signal detected (legacy) for session ${p.sessionID}`);if(!v.phaseCompleteSignal&&gx(B))v.phaseCompleteSignal=!0,v.signalAtMs=Date.now(),I("info",`phase_complete_signal detected for session ${p.sessionID}`);if(!v.planCompleteSignal&&hx(B))v.planCompleteSignal=!0,v.signalAtMs=Date.now(),I("info",`plan_complete_signal detected for session ${p.sessionID}`);if(v.oracleInFlight){let M=v.oracleInFlightSinceMs!==null&&Date.now()-v.oracleInFlightSinceMs>300000;if(v.oracleInFlightSinceMs!==null&&v.signalAtMs>v.oracleInFlightSinceMs||M)v.oracleInFlight=!1,v.oracleInFlightSinceMs=null,I("info",`oracle_completed: re-enabling intervention for session ${p.sessionID}${M?" (timeout)":""}`);if(p.tool==="task"&&p.args?.subagent_type==="oracle"&&p.args?.run_in_background===!1)v.oracleInFlight=!1,v.oracleInFlightSinceMs=null,I("info",`oracle_completed (foreground call): re-enabling intervention for session ${p.sessionID}`)}if(v.backgroundTaskInFlight){if(v.backgroundTaskInFlightSinceMs!==null&&Date.now()-v.backgroundTaskInFlightSinceMs>300000)v.backgroundTaskInFlight=!1,v.backgroundTaskInFlightSinceMs=null,v.backgroundTaskType=null,I("info",`background_task_timed_out: re-enabling intervention for session ${p.sessionID}`)}}if(T.postWave?.enabled){let z=T.postWave,H=[typeof w.output==="string"?w.output:"",typeof p.args==="string"?p.args:""].join(`
|
|
252
|
+
`),U=vx(H),B=p.tool==="task"&&/"subagent_type"\s*:\s*"oracle"/.test(H);if(U!==null||B){let G=pe.get(p.sessionID);if(G){let We=jg(H);if(G.recentPwArgsHashes.includes(We)){if(U===null&&B)I("info",`post_wave_dedupe: skipping re-detection of identical Oracle-call text for session ${p.sessionID}`)}else G.recentPwArgsHashes=[We,...G.recentPwArgsHashes].slice(0,8)}let M=md.get(p.sessionID);if(!M)M=Vg(),md.set(p.sessionID,M);if(U!==null&&U!==M.currentWaveN)M.currentWaveN=U,M.postWaveInjectionsThisWave=0;if(B&&M.currentWaveN!==null){if(!(G!==void 0&&G.recentPwArgsHashes.slice(1).includes(jg(H))))M.oracleAfterPhaseAtMs[M.currentWaveN]=Date.now()}let re=Date.now();if(yx({postWave:M},z,re)){let We=M.repoModeResolved??kx(z.repoMode??"auto",Se);M.repoModeResolved=We;let Kt=We==="third-party"?_x(z.thirdPartyDirective,M.currentWaveN,z.aasToolPrefix):bx(z.ownRepoDirective,M.currentWaveN);M.lastInjectedWaveN=M.currentWaveN,M.lastInjectedAtMs=re,M.postWaveInjectionsThisWave++,fu(p.sessionID,Kt).then((Qr)=>{if(!Qr.ok)I("info",`post-wave directive delivery failed for ${p.sessionID}: ${Qr.error??"unknown"}`)})}}}if(v?.interventionDisabled)return;let D=(v?.recentToolCalls??[]).slice(0,5).filter((z)=>["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block","task"].includes(z)),L=v?!(v.oracleInFlight||v.backgroundTaskInFlight)&&D.length===0:!1,V=v?.accumulatedDeviations??[],oe=Jf(p.sessionID),O=Bd(oe),F={sessionID:p.sessionID,toolName:p.tool,toolOutput:w.output,consecutiveStops:O,iteration:v?.iteration??0,maxIterations:T.closedLoop.maxLessonsPerSession??10,oracleVerified:v?.oracleInvoked??!1,noProgress:L,filesChanged:v?.filesChanged??0,recentTurnTokens:[],deviations:V,filePaths:v?.recentWriteFilePaths??[],...(()=>{let{backends:z,writeBackend:H}=t;if(z&&H)return{backends:z,writeBackend:H};try{let U=hn();return{backends:z??{agentmemory:U,boulderState:U},writeBackend:H??U}}catch{return{backends:z??{agentmemory:{smartSearch:async()=>({lessons:[],crystals:[]})},boulderState:{boulderRead:async()=>[]}},writeBackend:H??{saveMemory:async()=>({id:""}),saveLesson:async()=>({id:""})}}}})(),config:T,...Zo()?{providerID:Zo()}:{},...Go()?{modelID:Go()}:{},modelLimit:Zg(),currentLessonCount:v?.lessonCount??0},ue;try{if(ue=await Yd(F),ue.lessonSaved?.lessonSaved&&v)v.lessonCount++;if(ue.decision.action!=="continue")ze.inc("decisions_taken");if(ue.decision.action==="escalate"&&p.sessionID&&Wt()){let z=pe.get(p.sessionID)??v;if(z?.backgroundTaskInFlight||z?.oracleInFlight)I("info",`escalation prompt skipped (background task in flight) for ${p.sessionID}`);else{let H=ue.decision.historyEntry.decision,U=H.evidence.length,B=H.shouldEscalateTo;if(!B){I("info",`escalation suppressed by oracle.frequency for ${p.sessionID} (action=${H.action})`);return}let G=gu({reasoning:H.reasoning,target:B,evidenceCount:U,sessionID:p.sessionID});setTimeout(()=>{lt(p.sessionID,{toolName:"meta_governor_escalate",mcpTool:"task",mcpArgs:{subagent_type:B},preamble:G}).catch((M)=>{I("warn",`escalation prompt failed: ${String(M)}`)})},250)}}if(T.intervention.mode!=="silent"&&v){let z=ue.decision;if(v.oracleInFlight||v.backgroundTaskInFlight){let U=v.oracleInFlight?"oracle_in_flight":"background_task_in_flight";I("info",`${U}: skipping intervention for session ${p.sessionID} (score ${ue.scoringResult.rawScore.toFixed(2)})`);return}let H=T.intervention.phaseAwareDoneSignal===!0;if(T.intervention.respectDoneSignal&&v.oracleInvoked&&(v.planCompleteSignal||!H&&(v.taskDoneSignal||v.phaseCompleteSignal))){v.interventionDisabled=!0;let U=v.planCompleteSignal?"PLAN-COMPLETE":v.taskDoneSignal?"DONE":"PHASE-N-COMPLETE";I("info",`task verified (${U} + Oracle): disabling intervention for session ${p.sessionID}`),Ht(p.sessionID);return}if(z.action!=="continue"&&Mg(z.action,T.intervention.minActionForMessage)){let U=Math.max(0,T.intervention.maxInterventionsPerSession??0);if(U>0&&v.interventionCount>=U){v.interventionDisabled=!0,I("warn",`intervention cap (${U}) reached for session ${p.sessionID}; disabling further intervention`),Ht(p.sessionID);return}let B=60000,G=Date.now(),M=z.historyEntry?.reasoning??z.message??"",re=`${z.action}::${M.slice(0,80)}`;if((z.action==="warn"||z.action==="escalate")&&v.lastWarnHash===re&&v.lastWarnAtMs>0&&G-v.lastWarnAtMs<B){I("info",`warn_cooldown: suppressing duplicate ${z.action} (${Math.round((B-(G-v.lastWarnAtMs))/1000)}s remaining) for session ${p.sessionID}`),Ht(p.sessionID);return}if(v.interventionCount++,z.action==="warn"||z.action==="escalate")v.lastWarnAtMs=G,v.lastWarnHash=re}}}catch{}if(ue&&ue.decision&&ue.decision.action!=="continue")xu(p.sessionID,ue.decision);try{if(p.tool==="bash"){let H=p.args?.command;if(dn(H))I("info","git_commit_reindex_triggered",{sessionID:p.sessionID,command:H}),t.__test_onCommitTrigger?.({projectDir:Se,command:H??"",sessionID:p.sessionID}),mn(Se).catch((U)=>{I("warn",`codegraph sync failed: ${String(U)}`)})}}catch{}try{if(p.tool==="bash"){let H=p.args?.command;if(lx(H)){let U=ax(w.output,p.sessionID);if(U.length>0){let B=$t.get(p.sessionID)?.items??[];$t.set(p.sessionID,{items:B.concat(U)}),I("info",`captured ${U.length} bot feedback line(s) for session ${p.sessionID}`)}}}}catch{}try{let z=p.args?.command;if(p.tool==="bash"&&cx(z)){let H=T.ciMonitor;if(H?.enabled){let U=ux(r),B=dx(r);if(U&&B)I("info",`ci_monitor: git push detected on ${B}@${U.slice(0,7)} — starting background poll`),mx(U,B,H,p.sessionID).catch((G)=>{I("warn",`ci_monitor: background poll failed: ${G instanceof Error?G.message:String(G)}`)})}}}catch{}},"experimental.chat.messages.transform":async(p,w)=>{if(!T.enabled)return;let S=w.messages[w.messages.length-1]?.info?.sessionID;if(!S)return;let D=pe.get(S);if(T.skillPriming.enabled&&!cd.has(S)&&Qf({trigger:T.skillPriming.trigger,recentToolCalls:D?.recentToolCalls??[],implementationToolSeen:dd.has(S)})){cd.add(S);let te=Xf(T.skillPriming.router);if(Gg.set(S,te),!Qe(w.messages))w.messages.push({info:{role:"assistant",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:te,synthetic:!0}]});I("info",`skill_priming_injected for session ${S}`),St(S,Yf(T.skillPriming.router))}if(Xr.has(Se)&&!id.has(S)){let te=["[META-GOVERNOR] codegraph y graphify ya están inicializados en este repo. ","ROUTING EXPLÃCITO (v0.25.0): ","• SÃmbolos/definiciones/callers/impacto (código) → CODEGRAPH: omo_find, omo_impact, omo_search. ","• Conceptos/arquitectura/conexiones/explicaciones → GRAPHIFY: omo_path, omo_explain (y omo_search en modo alternate). ","• Vista general del repo → lee graphify-out/GRAPH_REPORT.md. ","Actualizan tras cada commit."].join(" ");if(!Qe(w.messages)){id.add(S);let de=dt(te,{kind:"graph-priming"});w.messages.push({info:{role:"assistant",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:de,synthetic:!0}]})}I("info",`graph_tools_ready_injected for session ${S}`),St(S,te)}let L=$t.get(S);if(L){let te=L.items;if(te.length>0){let de=`[MetaGovernor PR Reviewer Feedback]
|
|
253
|
+
|
|
254
|
+
${te.map((Oe,je)=>`${je+1}. ${Oe}`).join(`
|
|
255
255
|
`)}
|
|
256
256
|
|
|
257
|
-
Apply these fixes to keep the PR mergeable.`;if(!
|
|
257
|
+
Apply these fixes to keep the PR mergeable.`;if(!Qe(w.messages)){let Oe=dt(de,{kind:"postwave"});w.messages.push({info:{role:"assistant",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:Oe,synthetic:!0}]}),$t.delete(S)}I("info",`injected ${te.length} bot feedback line(s) to model for session ${S}`),St(S,de)}}if(T.intervention.mode!=="message")return;if(D?.interventionDisabled){Ht(S);return}if(D&&!ld.has(S)&&!D.backgroundTaskInFlight&&!D.oracleInFlight&&px(Se,D.interventionCount)){if(!Qe(w.messages)){ld.add(S);let de=dt("[MetaGovernor] Before any code change, create PLAN.md or a `## Plan` section in AGENTS.md that enumerates the phases. After each phase, commit (local + fork + upstream). Each commit triggers automatic reindex via the graphify post-commit hook + `codegraph sync`.",{kind:"postwave"});w.messages.push({info:{role:"assistant",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:de,synthetic:!0}]})}I("info",`plan_reminder_injected for session ${S}`),St(S,"[MetaGovernor] Before any code change, create PLAN.md or a `## Plan` section in AGENTS.md that enumerates the phases. After each phase, commit (local + fork + upstream). Each commit triggers automatic reindex via the graphify post-commit hook + `codegraph sync`.")}let V=Yr.get(S);if(!Boolean(D?.backgroundTaskInFlight||D?.oracleInFlight)&&V){let te=V.items;if(te.length>0){let de=`[META-GOVERNOR PROTOCOL VIOLATIONS - YOU MUST COMPLY]
|
|
258
258
|
|
|
259
|
-
${
|
|
259
|
+
${te.map((je,mt)=>`${mt+1}. ${je}`).join(`
|
|
260
260
|
`)}
|
|
261
261
|
|
|
262
|
-
Remember: use codegraph/graphify for architecture queries, do not grep without trying codegraph/graphify first, no @ts-ignore/as-any, no empty catch, check memory before asking.`;if(!
|
|
263
|
-
${
|
|
262
|
+
Remember: use codegraph/graphify for architecture queries, do not grep without trying codegraph/graphify first, no @ts-ignore/as-any, no empty catch, check memory before asking.`;if(!Qe(w.messages)){Yr.delete(S);let je=dt(de,{kind:"enforcement"});w.messages.push({info:{role:"assistant",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:je,synthetic:!0}]}),I("info",`violations injected for ${S}: ${te.length} item(s)`,te)}St(S,de);let Oe=pe.get(S);if(Oe)Oe.lastViolationInjectionAtMs=Date.now()}}let O=qf(S);if(!O)return;if(O.action==="continue")return;if(!O.message)return;if(!Mg(O.action,T.intervention.minActionForMessage))return;let F=D??pe.get(S);if(!F)F={memoryToolsUsed:[],hasCodegraphDir:n.hasCodegraphDir(r),hasGraphifyDir:n.hasGraphifyDir(r),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,lastViolationInjectionAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[],overflowCompactionCount:0,overflowLoopGuardTripped:!1},pe.set(S,F);let ue=Math.max(0,T.intervention.maxInterventionsPerSession??0);if(ue>0&&F.interventionCount>=ue){F.interventionDisabled=!0;return}if(F.backgroundTaskInFlight||F.oracleInFlight){I("info",`decision injection suppressed (background task in flight) for ${S}`);try{xu(S,O)}catch{}return}let z=T.intervention.includeDecisionHistory!==!1,H=T.intervention.maxHistoryMessages??5,U=(F.recentInterventionTexts??[]).slice(-H),B=[];for(let te of U)if(B.length===0||B[B.length-1]!==te)B.push(te);let G=Math.max(H,B.length),M=`[MetaGovernor] ${O.message}`;if(z&&B.length>0)M=`[MetaGovernor] Recent decisions in this session:
|
|
263
|
+
${B.map((de,Oe)=>`${Oe+1}. ${de}`).join(`
|
|
264
264
|
`)}
|
|
265
265
|
|
|
266
266
|
---
|
|
267
267
|
|
|
268
|
-
Current decision: ${
|
|
269
|
-
|
|
268
|
+
Current decision: ${O.message}`;let re=`[${O.action}] ${O.message}`;if(F.recentInterventionTexts?.slice(-1)[0]!==re)F.recentInterventionTexts=[...F.recentInterventionTexts??[],re].slice(-G);let Qr={type:"text",text:dt(M,{kind:"intervention"}),synthetic:!0};if(!Qe(w.messages))Ht(S),F.interventionCount++,w.messages.push({info:{role:"assistant",agent:"meta-governor",synthetic:!0},parts:[Qr]});St(S,M);try{if((O.action==="warn"||O.action==="escalate"||O.action==="stop")&&Wo(S)&&!Qe(w.messages)){let de=`MetaGovernor ${O.action}: ${O.message} (reasoning: ${O.historyEntry?.reasoning??O.message})`,Oe="Please call the `agentmemory_memory_save` MCP tool with EXACTLY these args:\n\n```json\n"+JSON.stringify({content:de,concepts:["metagovernor",O.action]},null,2)+"\n```\n\nDo not paraphrase, modify, or add fields. Pass the args through verbatim.";if(typeof t.__test_autoRemember==="function")try{t.__test_autoRemember({sessionID:S,decision:O,promptText:Oe})}catch{}else setTimeout(()=>{lt(S,{toolName:"omo_remember",mcpTool:"agentmemory_memory_save",mcpArgs:{content:de,concepts:["metagovernor",O.action]},preamble:"MetaGovernor auto-remember: notable decision — remember WHY this intervention fired."}).catch((je)=>{I("warn","auto-remember promptAgent failed: "+String(je))})},0);I("info",`auto-remember queued for ${S}: ${O.action}`)}}catch{}if(T.enabled&&F&&Wo(S)&&!Qe(w.messages)&&(O.action==="escalate"||O.action==="stop")&&!F.backgroundTaskInFlight&&!F.oracleInFlight&&(F.lastReflectionAtMs===void 0||Date.now()-F.lastReflectionAtMs>300000)){F.lastReflectionAtMs=Date.now(),ze.inc("reflections_triggered");let te=O.historyEntry?.reasoning??O.message,de=F.accumulatedDeviations.slice(-3),Oe=de.length>0?de.map((mt)=>` - [${mt.severity}] ${mt.category}: ${mt.detail.slice(0,200)}`).join(`
|
|
269
|
+
`):" (none recorded)",je=["[omo-meta-governor audit - self-reflection required]","",`Recent decision: ${O.action} (score ${(O.historyEntry?.decision?.score??0).toFixed(2)})`,`Reasoning: ${te.slice(0,400)}`,`Message: ${O.message.slice(0,400)}`,`Tool calls so far: ${F.iteration}`,"","Recent protocol violations (if any):",Oe,"","You are being audited by omo-meta-governor v"+me+". As a senior engineer,","review what you have just done and answer these questions honestly:"," 1. What is going wrong or inefficiently?"," 2. Are you stuck in a loop? Cite specific evidence."," 3. What is the correct path forward to complete the user's task?","","Be specific and actionable. If you should stop or pivot, say so clearly."].join(`
|
|
270
|
+
`);if(typeof t.__test_reflectionPrompt==="function")try{t.__test_reflectionPrompt({sessionID:S,text:je})}catch{}else setTimeout(()=>{lt(S,{toolName:"omo_reflection",mcpTool:"session.prompt",mcpArgs:{parts:[{type:"text",text:je}]},preamble:"omo-meta-governor audit: senior-engineer self-reflection required."}).catch((mt)=>{I("warn","reflection promptAgent failed: "+String(mt))})},0)}},event:async(p)=>{if(!T.enabled)return;let w=p.event,v=w?.type??"";if(v==="tool.execute.before"||v==="tool.execute.after"){ze.inc("tool_calls_observed");let S=w?.properties??{},D=String(S.tool??""),L=String(S.sessionID??S.sessionId??"");if(L&&D){let V=pe.get(L)??null;if(V){let oe=V.recentToolCalls.indexOf(D);if(oe>=0)V.recentToolCalls.splice(oe,1);if(V.recentToolCalls.push(D),V.recentToolCalls.length>20)V.recentToolCalls.splice(0,V.recentToolCalls.length-20)}if(v==="tool.execute.after")ze.inc("orchestrator_runs")}}},"permission.ask":async(p,w)=>{if(!T.enabled)return;await Nf(p,w,T.governance?.permissionPolicy??{},ze)},"tool.definition":async(p,w)=>{if(!T.enabled)return;await jf(p,w,T.governance?.toolRewrite??{},ze)},"command.execute.before":async(p,w)=>{if(!T.enabled)return;await Uf(p,w,T.governance?.commandFilter??{},ze)},"experimental.provider.small_model":async(p,w)=>{if(!T.enabled)return;await Lf(p,w,T.governance?.smallModelOverride??{})},tool:{omo_search:s,omo_recall:a,omo_health:l,omo_find:c,omo_impact:u,omo_remember:f,omo_recall_mcp:g,omo_path:d,omo_explain:y,omo_files:x,omo_callers:C,omo_node:j,omo_context:K,omo_affected_cg:W,omo_status:ae,omo_unlock:Pe,omo_mark_dirty:Bt,omo_sync_if_dirty:ju,omo_index:Uu,omo_visualize:Lu,omo_serve:Fu,omo_uninit:Zu,omo_diagnose:Gu,omo_merge_graphs:Wu,omo_save_result:Hu,omo_extract:Vu,omo_cluster_only:Bu,omo_label:qu,omo_tree:Ju,omo_clone:Ku,omo_add:Xu,omo_check_update:Yu,omo_hook_status:Qu,omo_cli_anything_install:ed,omo_cli_anything_list:td,omo_cli_anything_search:rd,omo_cli_anything_info:nd},"experimental.session.compacting":async(p,w)=>{if(!T.enabled||!T.closedLoop.enabled)return;let v=hn(),S=`session:${p.sessionID}`,D=await v.smartSearch({query:S,limit:3});if(D.lessons.length>0){let L=D.lessons.map((V,oe)=>`${oe+1}. [${V.id}] confidence=${V.confidence.toFixed(2)}
|
|
271
|
+
${V.content.slice(0,300)}`).join(`
|
|
270
272
|
|
|
271
273
|
`);w.context.push(`
|
|
272
|
-
### Past Lessons (auto-retrieved)`,L,"---")}},"experimental.chat.system.transform":async(p,w)=>{if(!T.enabled)return;let v=p.sessionID;if(!v)return;let
|
|
273
|
-
`))},"experimental.compaction.autocontinue":async(p,w)=>{if(!T.enabled)return;let{sessionID:v,overflow:
|
|
274
|
-
`),o=[];for(let r of n){let i=r.match(/^\s*(\S+)\s+(fail)\s+(.*)$/);if(i){let s=i[1].trim(),a=i[3].trim();o.push(`${t} · ${s}: ${a}`)}}return o}function lx(e){if(typeof e!=="string"||e.length===0)return!1;let t=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])gh\s+pr(?:\s|$)/.test(t)}function cx(e){if(typeof e!=="string"||e.length===0)return!1;let t=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])git\s+push(?:\s|$)/.test(t)}function ux(e){try{return
|
|
275
|
-
`);
|
|
274
|
+
### Past Lessons (auto-retrieved)`,L,"---")}},"experimental.chat.system.transform":async(p,w)=>{if(!T.enabled)return;let v=p.sessionID;if(!v)return;let S=pe.get(v);if(!S)return;let D=[];D.push("[omo-meta-governor audit] v"+me+" — runtime governance active"),D.push("");let L=S.accumulatedDeviations.slice(-5);if(L.length>0){D.push("RECENT PROTOCOL VIOLATIONS (most recent first):");for(let O of L.slice().reverse())D.push(` - [${O.severity}] ${O.category}: ${O.detail.slice(0,200)}`);D.push("")}let oe=(S.recentDecisions??[]).filter((O)=>O.action!=="continue").slice(-3);if(oe.length>0){D.push("RECENT DECISIONS (non-continue):");for(let O of oe.slice().reverse())D.push(` - [${O.action}] score=${O.score.toFixed(2)} reasoning=${(O.reasoning??"").slice(0,200)}`);D.push("")}if(L.length===0&&oe.length===0)D.push("No violations or non-continue decisions in this session yet."),D.push("Continue to use tools; the auditor will surface issues here.");w.system.push(D.join(`
|
|
275
|
+
`))},"experimental.compaction.autocontinue":async(p,w)=>{if(!T.enabled)return;let{sessionID:v,overflow:S}=p,D=pe.get(v);if(!D)D={memoryToolsUsed:[],hasCodegraphDir:!1,hasGraphifyDir:!1,oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,lastViolationInjectionAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[],overflowCompactionCount:0,overflowLoopGuardTripped:!1},pe.set(v,D);if(D.interventionDisabled){w.enabled=!1;return}let L=T.intervention.compactionLoopGuard;if(L.enabled)if(S){if(D.overflowCompactionCount++,!D.overflowLoopGuardTripped&&D.overflowCompactionCount>L.maxOverflowRecoveries){D.overflowLoopGuardTripped=!0,D.interventionDisabled=!0,w.enabled=!1,I("warn",`compaction_loop_guard_tripped for session ${v}: ${D.overflowCompactionCount} consecutive overflow compactions; autocontinue disabled and guidance queued`);let V=$t.get(v),oe=`[META-GOVERNOR] Overflow compaction loop detected (${D.overflowCompactionCount} consecutive overflow compactions). opencode issue #27924 is in play. Auto-continue is now disabled for this session. Resume your pending tasks using the existing context — do NOT regenerate context you have already produced.`;$t.set(v,{items:(V?.items??[]).concat(oe)})}}else D.overflowCompactionCount=0}}}}function ax(e,t){if(typeof e!=="string"||e.length===0)return[];let n=e.split(`
|
|
276
|
+
`),o=[];for(let r of n){let i=r.match(/^\s*(\S+)\s+(fail)\s+(.*)$/);if(i){let s=i[1].trim(),a=i[3].trim();o.push(`${t} · ${s}: ${a}`)}}return o}function lx(e){if(typeof e!=="string"||e.length===0)return!1;let t=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])gh\s+pr(?:\s|$)/.test(t)}function cx(e){if(typeof e!=="string"||e.length===0)return!1;let t=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])git\s+push(?:\s|$)/.test(t)}function ux(e){try{return Ug("git",["rev-parse","HEAD"],{cwd:e,encoding:"utf-8",timeout:5000,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().trim()||null}catch{return null}}function dx(e){try{let n=Ug("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,encoding:"utf-8",timeout:5000,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().trim();return n&&n!=="HEAD"?n:null}catch{return null}}var Mu=new Map;async function mx(e,t,n,o){let r=await Promise.resolve().then(() => (zg(),Rg)),i=Mu.get(o)??{lastPolledSha:null,lastFailureInjectionAtMs:0,pending:new Set};i.pending.add(e),Mu.set(o,i);try{r.triggerWorkflow(n.workflow,t);let s=Date.now(),a=null;while(Date.now()-s<n.maxWaitMs){if(a=r.getLatestRunForSha(e),!a){await new Promise((l)=>setTimeout(l,n.pollIntervalMs));continue}if(a.status==="completed")break;await new Promise((l)=>setTimeout(l,n.pollIntervalMs))}if(!a||a.status!=="completed"){I("warn",`ci_monitor: timeout waiting for run on ${e.slice(0,7)} (${n.maxWaitMs}ms)`);return}if(i.lastPolledSha=e,a.conclusion==="failure"){let l=Date.now();if(l-i.lastFailureInjectionAtMs<60000)return;i.lastFailureInjectionAtMs=l;let c=r.getFailedLogs(a.databaseId,4000),u=[`[CI Monitor] GitHub Actions run #${a.databaseId} FAILED on ${t}@${e.slice(0,7)}.`,"",`Title: ${a.displayTitle}`,`URL: ${a.url}`,`Conclusion: ${a.conclusion}`,"","── FAILED-STEP LOGS (truncated) ──",c||"(no failed-log output available — run `gh run view "+a.databaseId+" --log-failed` for full output)","","── ACTION ──",n.failOnly?"Read the failed logs above, identify which tests broke, run them locally to reproduce, fix, and re-push. Use `bun run typecheck` first (fastest signal), then run only the failing test files.":"Review the run and take action."].join(`
|
|
277
|
+
`);I("warn",`ci_monitor: CI failed for ${e.slice(0,7)} — ${a.url}`);let g=await(await Promise.resolve().then(() => (Eo(),Up))).persistSessionMessage(o,u,1e4);if(!g.ok)I("warn",`ci_monitor: failed to inject failure message: ${g.error??"unknown"}`)}else if(a.conclusion==="success")I("info",`ci_monitor: run #${a.databaseId} passed for ${e.slice(0,7)}`);else I("info",`ci_monitor: run #${a.databaseId} conclusion=${a.conclusion} for ${e.slice(0,7)}`)}finally{i.pending.delete(e),Mu.set(o,i)}}function px(e,t){if(t>=1)return!1;try{return ox(Nu(e,"PLAN.md")),!1}catch{}try{let n=Au(Nu(e,"AGENTS.md"),"utf-8");if(/^##\s+Plan\b/im.test(n))return!1}catch{}return!0}function fx(e){if(typeof e!=="string"||e.length===0)return!1;return/<promise>\s*DONE!?\s*<\/promise>/i.test(e)}function gx(e){if(typeof e!=="string"||e.length===0)return!1;return/<promise>\s*DONE!?\s*<\/promise>/i.test(e)||/<promise>\s*PHASE-\d+-COMPLETE\s*<\/promise>/i.test(e)}function hx(e){if(typeof e!=="string"||e.length===0)return!1;return/<promise>\s*PLAN-COMPLETE\s*<\/promise>/i.test(e)}function vx(e){let t=/(?:<promise>\s*)?PHASE-(\d+)-COMPLETE\s*(?:<\/promise>)?/i.exec(e);return t?Number.parseInt(t[1],10):null}function jg(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function yx(e,t,n){if(t.enabled===!1)return!1;let o=e.postWave.currentWaveN;if(o===null)return!1;if(!(o in e.postWave.oracleAfterPhaseAtMs))return!1;let r=t.maxRetriesPerWave??1,i=t.reinjectCooldownMs??60000,s=e.postWave.lastInjectedWaveN===o;if(s&&e.postWave.postWaveInjectionsThisWave>=r)return!1;if(s&&e.postWave.lastInjectedAtMs!==null&&n-e.postWave.lastInjectedAtMs<i)return!1;return!0}function bx(e,t){if(e)return e;return[`Wave ${t===null||t===void 0?"?":String(t)} is Oracle-verified. Land it now:`,"1. Use a CLEAN dedicated branch for this PR: `git checkout -b <branch>` (each PR gets its own independent branch; never mix PRs on one branch unless they fix the same problem).","2. `git push -u origin HEAD` (sets upstream on first push).","3. If no PR exists yet: `gh pr create --fill`.","4. Monitor CI: `timeout 600 gh pr checks --watch` (auto-stops after 10 min).","5. Only start the next wave after checks are green."].join(`
|
|
276
278
|
`)}function _x(e,t,n=""){if(e)return e;let o=t===null||t===void 0?"?":String(t),r=n?`3. Invoke the \`${n}\` MCP GitHub skills to create the PR/issue, then `:"3. ";return[`Wave ${o} is Oracle-verified. This is a THIRD-PARTY repo — land it as a contribution:`,"1. READ FIRST the repo's contribution rules (read CONTRIBUTING.md, PR/issue templates and guides) and follow them exactly.","2. Create a CLEAN dedicated branch for THIS PR: `git checkout -b <branch>` — each PR gets its own independent branch; never mix PRs on one branch unless they fix the same problem (then commit onto that same branch).",`${r}push the branch to your FORK (\`git push -u origin HEAD\`) and open the PR against the UPSTREAM repo following the repo's template. Use \`gh pr create\` for GitHub.`,"4. Request review on the PR (add reviewers) and wait for CI to pass before starting the next wave."].join(`
|
|
277
279
|
`)}function kx(e,t,n=ix){if(e==="own"||e==="third-party")return e;try{let o=n("gh repo view --json isFork,parent",{cwd:t,stdio:"pipe",timeout:1e4}),r=JSON.parse(String(o));if(r.isFork===!0&&r.parent!==null&&r.parent!==void 0)return"third-party";return"own"}catch{try{let o=n("git remote -v",{cwd:t,stdio:"pipe",timeout:1e4});if(String(o).split(`
|
|
278
|
-
`).some((i)=>/^\s*upstream\s+/.test(i)))return"third-party"}catch{}return"own"}}var wx=
|
|
280
|
+
`).some((i)=>/^\s*upstream\s+/.test(i)))return"third-party"}catch{}return"own"}}var wx=Lg();function Fo(e,t){return wx(e,t)}Fo.id="omo-meta-governor";Fo.server=Fo;var JD=Fo;export{JD as default};
|
|
279
281
|
|
|
280
|
-
//# debugId=
|
|
282
|
+
//# debugId=D421D15E9F24B5FD64756E2164756E21
|
|
281
283
|
//# sourceMappingURL=index.js.map
|