werkmeister 0.90.1 → 0.90.2
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/{budget-PT3VF26C.js → budget-VVV4W7GV.js} +2 -2
- package/dist/{cache-NH5PTL64.js → cache-4RFUYO4D.js} +2 -2
- package/dist/{chunk-7P6T7FUL.js → chunk-2EBFF67G.js} +2 -2
- package/dist/{chunk-EBWWRAUU.js → chunk-3HP4LXFW.js} +2 -2
- package/dist/{chunk-AM7AS4M2.js → chunk-3IYW4GH7.js} +2 -2
- package/dist/{chunk-3DUSX5P7.js → chunk-5E6TBEKS.js} +2 -2
- package/dist/{chunk-MYL3NDG5.js → chunk-5FEUWFZU.js} +2 -2
- package/dist/{chunk-FI225MEI.js → chunk-6W4VDTZ7.js} +51 -51
- package/dist/{chunk-WEUNR7XZ.js → chunk-7WWXRFDJ.js} +2 -2
- package/dist/{chunk-AJEK2VJF.js → chunk-ACRCO2SK.js} +2 -2
- package/dist/{chunk-7KNVGADJ.js → chunk-BNXAAYSP.js} +2 -2
- package/dist/{chunk-N2T4QH5R.js → chunk-BWBFHDBY.js} +2 -2
- package/dist/{chunk-JSPETF6W.js → chunk-COKEH2YU.js} +2 -2
- package/dist/{chunk-R4UIOLSU.js → chunk-CUXEKUPQ.js} +2 -2
- package/dist/{chunk-DU32YNDK.js → chunk-DQ73PEN4.js} +2 -2
- package/dist/{chunk-6TLZGFXP.js → chunk-E6H3OPHH.js} +2 -2
- package/dist/{chunk-IOJGQSF4.js → chunk-ENMXHMXC.js} +2 -2
- package/dist/{chunk-MXKSIM3S.js → chunk-EVXY6FSW.js} +2 -2
- package/dist/chunk-FQIPYXS3.js +4 -0
- package/dist/{chunk-73TW2WJJ.js → chunk-FR225LYD.js} +2 -2
- package/dist/{chunk-B6D7CSHG.js → chunk-GCCUEPYG.js} +2 -2
- package/dist/{chunk-BOIIVFVD.js → chunk-GJJPGT2W.js} +2 -2
- package/dist/{chunk-TZ5RA4N6.js → chunk-GZNJ7GIP.js} +2 -2
- package/dist/{chunk-WRNA4NF3.js → chunk-HTOZ5C3T.js} +2 -2
- package/dist/{chunk-OGJI6KTY.js → chunk-HWGGARGZ.js} +2 -2
- package/dist/{chunk-7MSLZTTK.js → chunk-ICWQFEAC.js} +2 -2
- package/dist/{chunk-SZL3VDBG.js → chunk-IFURHJUW.js} +2 -2
- package/dist/{chunk-6GHL46O6.js → chunk-IIJXCSAC.js} +2 -2
- package/dist/{chunk-CTCXMTDL.js → chunk-J4T3Y5M5.js} +44 -44
- package/dist/{chunk-5YMMXIXJ.js → chunk-JEAU27N2.js} +2 -2
- package/dist/{chunk-7WVRV24A.js → chunk-JU6Y2G3K.js} +2 -2
- package/dist/{chunk-TZNKWKBE.js → chunk-KNH7K7K5.js} +3 -3
- package/dist/{chunk-BISSN2O3.js → chunk-LXREE532.js} +19 -19
- package/dist/{chunk-7GJ2J2EE.js → chunk-MLXY7JPA.js} +2 -2
- package/dist/{chunk-OQJUDYGN.js → chunk-MSBPGE5M.js} +2 -2
- package/dist/{chunk-WKXBV7DF.js → chunk-MWQQLIYI.js} +27 -27
- package/dist/{chunk-QTEV75OD.js → chunk-N3B4CFR5.js} +2 -2
- package/dist/{chunk-JXKPSODN.js → chunk-NCFKYG7Q.js} +2 -2
- package/dist/{chunk-GDBENCJL.js → chunk-OQCQB7D4.js} +2 -2
- package/dist/{chunk-MHOPJQZX.js → chunk-PENBQLTX.js} +2 -2
- package/dist/{chunk-NJ5TYAXZ.js → chunk-PGFTMWD4.js} +2 -2
- package/dist/{chunk-7PIVMEQX.js → chunk-PK4WPMSC.js} +2 -2
- package/dist/{chunk-FGA47ZU7.js → chunk-PPYOIKTU.js} +2 -2
- package/dist/{chunk-LLL2ER26.js → chunk-PUFDKXDA.js} +2 -2
- package/dist/{chunk-LXEIIDCP.js → chunk-QCGGZOW3.js} +2 -2
- package/dist/{chunk-MUICDO3D.js → chunk-QY5PXC6N.js} +2 -2
- package/dist/{chunk-DRVSQMU4.js → chunk-R5SNQ5H4.js} +2 -2
- package/dist/{chunk-72GDJSLI.js → chunk-RAIBCJC6.js} +2 -2
- package/dist/{chunk-66MITC5V.js → chunk-RKNCIEAQ.js} +2 -2
- package/dist/{chunk-ZPZNTG4C.js → chunk-RM7GNPYV.js} +2 -2
- package/dist/{chunk-KNPK5NCZ.js → chunk-S2LN47CB.js} +3 -3
- package/dist/{chunk-KHOZUHBP.js → chunk-TDVG5BD2.js} +2 -2
- package/dist/{chunk-JUY35LCT.js → chunk-TTCCGRPC.js} +2 -2
- package/dist/{chunk-572F3AQM.js → chunk-TV6IMMES.js} +2 -2
- package/dist/{chunk-RALGVL7W.js → chunk-TXXDMCWB.js} +2 -2
- package/dist/{chunk-BEUUGV73.js → chunk-VVBFEHYG.js} +2 -2
- package/dist/{chunk-G5SPVAY5.js → chunk-W6YKINRT.js} +2 -2
- package/dist/{chunk-JN2Q5S3G.js → chunk-WXADSSGR.js} +2 -2
- package/dist/{chunk-4IPVX536.js → chunk-WYA36Q6O.js} +2 -2
- package/dist/{chunk-N667SZQA.js → chunk-WZ4C5LQF.js} +2 -2
- package/dist/{chunk-LV4UESBO.js → chunk-XF4O72WE.js} +2 -2
- package/dist/{chunk-JWNQU45X.js → chunk-XOE3BKEQ.js} +2 -2
- package/dist/{chunk-62HUYOP4.js → chunk-XSZLSRIK.js} +2 -2
- package/dist/{chunk-T4WAAV7G.js → chunk-YFVAUZZJ.js} +2 -2
- package/dist/{chunk-GJSGK4EZ.js → chunk-YJOXEIPT.js} +2 -2
- package/dist/{chunk-2KNFKILM.js → chunk-YMSOTNNY.js} +3 -3
- package/dist/{chunk-LNSRYF2J.js → chunk-YSVDNV4A.js} +2 -2
- package/dist/chunk-ZAGBWZZM.js +5 -0
- package/dist/clean-PTQC3FA7.js +8 -0
- package/dist/close_out-TLFEWQFQ.js +8 -0
- package/dist/code-TWCGFVWG.js +4 -0
- package/dist/{config-L3GDSJGU.js → config-IAJB5GGA.js} +2 -2
- package/dist/{connect-FD5SMVXF.js → connect-IRGN7IK4.js} +2 -2
- package/dist/{daemon-XNNULAM4.js → daemon-EYEZ6H4X.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-OC7MY7AM.js → detect-GNPDUBUC.js} +2 -2
- package/dist/{down-ALMOGL37.js → down-KFOAIOPX.js} +3 -3
- package/dist/{fixture-ENXSYGR3.js → fixture-B6WISNOK.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-BMVMCV25.js +4 -0
- package/dist/{hooks_gen-BCRR3DUZ.js → hooks_gen-26V7XODO.js} +2 -2
- package/dist/infra-YMHZ67JJ.js +4 -0
- package/dist/init_workspace-CCDLF2OH.js +4 -0
- package/dist/{intercept-4OFWB3WH.js → intercept-JFG74AG7.js} +2 -2
- package/dist/{issue-PI74KB5P.js → issue-GHYOX7Z5.js} +2 -2
- package/dist/lib/agent_state.js +1 -1
- package/dist/lib/gate.js +1 -1
- package/dist/lib/pr_guard.js +1 -1
- package/dist/list_workspaces-JYXQJFXD.js +7 -0
- package/dist/logs-JNFSJSZ3.js +6 -0
- package/dist/main.js +3 -3
- package/dist/mcp-proxy.js +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{migrate-SJMAZ557.js → migrate-AFZGYGXD.js} +2 -2
- package/dist/notes-US5GD3X6.js +4 -0
- package/dist/{open-WUVAUVNM.js → open-KYYLKCVG.js} +2 -2
- package/dist/{optimize-X6Q6CNBL.js → optimize-ATFBPIDM.js} +2 -2
- package/dist/pause-RG4V4U2C.js +4 -0
- package/dist/pr-EA7L7OHK.js +5 -0
- package/dist/proxy_reload-PQLB5T4O.js +6 -0
- package/dist/{registry-ZFDRUZIP.js → registry-DEM7RIVB.js} +2 -2
- package/dist/remove-UJ3MKFBT.js +7 -0
- package/dist/remove_workspace-22BCMLR5.js +8 -0
- package/dist/restart-ZJVGRP7T.js +8 -0
- package/dist/resume-WS337JIU.js +8 -0
- package/dist/{safari-SQ6BCVH3.js → safari-DX6MKSWG.js} +2 -2
- package/dist/{sandbox-K7CSYEZS.js → sandbox-F7J2KY6T.js} +2 -2
- package/dist/{services-RSPIOC7B.js → services-W7USB623.js} +2 -2
- package/dist/{setup-FSIVQMWD.js → setup-BCLBKP6T.js} +2 -2
- package/dist/skills-TSB262GQ.js +4 -0
- package/dist/{slots-UT56AWR4.js → slots-OV73ZSPU.js} +2 -2
- package/dist/{standards-XVSL5YAK.js → standards-GZVWZOSV.js} +2 -2
- package/dist/start_args-ATXJRWZS.js +4 -0
- package/dist/starting_prompt-7SEPN5BJ.js +4 -0
- package/dist/stats-CHQ6HNR3.js +4 -0
- package/dist/{status-IP5T3YPA.js → status-XOG2XZB5.js} +2 -2
- package/dist/{stop-RGTE4JCC.js → stop-RHSBWGXC.js} +2 -2
- package/dist/{telepresence-WSMD6D76.js → telepresence-HUF6577A.js} +2 -2
- package/dist/{test-XCNK3UZG.js → test-B3ROSN62.js} +2 -2
- package/dist/{tokens-ES3FVOJM.js → tokens-NPLPVGIK.js} +2 -2
- package/dist/{up-NI6TNVH3.js → up-IBKCCV4R.js} +3 -3
- package/dist/{v4-2VX2CBIA.js → v4-IBECLGXA.js} +2 -2
- package/dist/wait_load-QVXDWK6A.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-Y2CLE7DM.js → workspace-HLXV6IGD.js} +2 -2
- package/infra/templates/Caddyfile.njk +18 -0
- package/package.json +4 -4
- package/dist/chunk-NT5VHO4I.js +0 -5
- package/dist/chunk-UFD2WSA2.js +0 -4
- package/dist/clean-6JJPOJEB.js +0 -8
- package/dist/close_out-IK3ZYWH7.js +0 -8
- package/dist/code-IGKOMVLK.js +0 -4
- package/dist/hooks-LLIP6F2T.js +0 -4
- package/dist/infra-N7DU4727.js +0 -4
- package/dist/init_workspace-Z2XEBMHT.js +0 -4
- package/dist/list_workspaces-NZWNAOSF.js +0 -7
- package/dist/logs-ZSDHFYUN.js +0 -6
- package/dist/notes-4L2LLG57.js +0 -4
- package/dist/pause-QXPJBER5.js +0 -4
- package/dist/pr-XG4W7OWB.js +0 -5
- package/dist/proxy_reload-OUWXC6NW.js +0 -6
- package/dist/remove-ROVJH244.js +0 -7
- package/dist/remove_workspace-D253KRYB.js +0 -8
- package/dist/restart-V63JJEIT.js +0 -8
- package/dist/resume-HQ4BS6IG.js +0 -8
- package/dist/skills-LTXTCKUB.js +0 -4
- package/dist/start_args-GQC6R2KX.js +0 -4
- package/dist/starting_prompt-NZKXVNC2.js +0 -4
- package/dist/stats-IVJ6DGTA.js +0 -4
- package/dist/wait_load-HJOIQVTW.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{c as v,k as L}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=budget-
|
|
3
|
+
import{c as v,k as L}from"./chunk-S2LN47CB.js";import"./chunk-NCFKYG7Q.js";import"./chunk-MWQQLIYI.js";import"./chunk-FR225LYD.js";import"./chunk-PGFTMWD4.js";import"./chunk-HTOZ5C3T.js";import"./chunk-IIJXCSAC.js";import"./chunk-YFVAUZZJ.js";import"./chunk-TTCCGRPC.js";import"./chunk-JEAU27N2.js";import"./chunk-ICWQFEAC.js";import"./chunk-5FEUWFZU.js";import"./chunk-N3B4CFR5.js";import"./chunk-RAIBCJC6.js";import"./chunk-7WWXRFDJ.js";import"./chunk-LXREE532.js";import"./chunk-RKNCIEAQ.js";import"./chunk-IFURHJUW.js";import{A as h,B as w,H as b,K as y,P as k,v as f,w as $}from"./chunk-MSBPGE5M.js";import"./chunk-EVXY6FSW.js";import"./chunk-GCCUEPYG.js";import"./chunk-5E6TBEKS.js";import"./chunk-PPYOIKTU.js";import{o as d}from"./chunk-GJJPGT2W.js";import"./chunk-WZ4C5LQF.js";import"./chunk-DQ73PEN4.js";import"./chunk-2EBFF67G.js";import"./chunk-YSVDNV4A.js";import"./chunk-VVBFEHYG.js";import"./chunk-TXXDMCWB.js";import"./chunk-J4T3Y5M5.js";import"./chunk-ENMXHMXC.js";import{a as c,f as g}from"./chunk-XF4O72WE.js";g();import N from"node:os";var M=2**30,x=c((r,t)=>Number.isFinite(r)?`${Number(r.toFixed(1))}${t}`:"no limit","limit");async function P(r){let t=await h(),m=w(N.cpus().length),u=$(),l=await k(),n=L(),a=f(y(l,n??[])).map((o,e)=>{let s=u[o.feature]?.workspace,i=s&&d(s)?.services||null,B=s?b(s,i??void 0):null;return{...o,position:e+1,services:i,cost:B}});if(r.json){let o=c(e=>Number.isFinite(e)?e:null,"n");console.log(JSON.stringify({budget:{memory:o(t.memory),cpus:o(t.cpus),preempt:t.preempt},host_load:m,leases:u,waiting:l,running:n?.map(e=>({feature:e.feature,cpus:e.cost.cpus,memory:e.cost.memory,rank:e.rank,busy:e.busy}))??null,waiters:a.map(e=>({feature:e.feature,position:e.position,services:e.services,cpus:e.cost?.cpus??null,memory:e.cost?.memory??null,waited_ms:e.waitedMs,gate:e.gate}))}));return}console.log(`Budget: ${x(t.memory/M," GiB")} memory, ${x(t.cpus," CPUs")}, host load ${m||"unchecked"}, preemption ${t.preempt?"on":"off"}`);let p=Object.entries(u).sort(([,o],[,e])=>o.slot-e.slot);console.log(p.length?"Slots:":"Slots: none held");for(let[o,e]of p)console.log(` ${e.slot} ${o}${e.workspace?` ${e.workspace}`:""}`);console.log(n?n.length?"Running:":"Running: none":"Running: docker unavailable");for(let o of[...n??[]].sort((e,s)=>s.cost.cpus-e.cost.cpus))console.log(` ${v(o)}`);console.log(a.length?"Waiting:":"Waiting: none");for(let o of a){let e=o.services?`${o.services.join(", ")}${o.gate?" for a running feature":""}`:"whole feature",s=o.cost?` (${Number(o.cost.cpus.toFixed(1))} CPUs, ${(o.cost.memory/M).toFixed(1)} GiB)`:"",i=o.waitedMs?` waited ${Math.round(o.waitedMs/6e4)} min${o.position===1&&o.waitedMs>=3e5?", gets the next free room":""}`:"";console.log(` ${o.position}. ${o.feature} ${e}${s}${i}`)}}c(P,"run");export{P as run};
|
|
4
|
+
//# sourceMappingURL=budget-VVV4W7GV.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import"./chunk-
|
|
4
|
-
//# sourceMappingURL=cache-
|
|
3
|
+
import"./chunk-FQIPYXS3.js";import{c as s}from"./chunk-HTOZ5C3T.js";import"./chunk-7WWXRFDJ.js";import"./chunk-EVXY6FSW.js";import"./chunk-5E6TBEKS.js";import"./chunk-TXXDMCWB.js";import{h as e,l as c}from"./chunk-J4T3Y5M5.js";import"./chunk-ENMXHMXC.js";import{a as r,f as i}from"./chunk-XF4O72WE.js";i();async function u(o){o.action!=="prune"&&(c(`Unknown action \`${String(o.action)}\` \u2014 the only action is \`prune\`.`),process.exit(2));let t=await s({name:typeof o.name=="string"?o.name:void 0,reset:!!o.reset,force:!!o.force,dryRun:!!o.dry_run});t.length||console.log("No caches in the registry.");for(let n of t){let a=n.ok?`${e.GREEN}\u2713${e.RESET}`:`${e.RED}\u2717${e.RESET}`;console.log(`${a} ${n.name} (${n.action}): ${n.detail}`)}t.some(n=>!n.ok)&&process.exit(1)}r(u,"run");export{u as run};
|
|
4
|
+
//# sourceMappingURL=cache-4RFUYO4D.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{b as O}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{b as O}from"./chunk-YSVDNV4A.js";import{n as N}from"./chunk-VVBFEHYG.js";import{b as d}from"./chunk-TXXDMCWB.js";import{l as g,s as l}from"./chunk-J4T3Y5M5.js";import{b as x}from"./chunk-ENMXHMXC.js";import{a as n,f as T}from"./chunk-XF4O72WE.js";T();import*as c from"node:fs";import*as $ from"node:os";import*as i from"node:path";var P=3002;function U(){let t=l("MCP_PORT")||N().overrides?.mcp_port,e=Number(t);return Number.isInteger(e)&&e>0?e:P}n(U,"daemonPort");function w(){return(l("HOST")||`http://127.0.0.1:${U()}`).replace(/\/+$/,"")}n(w,"daemonUrl");function S(t){try{return c.readFileSync(t,"utf8").trim()||null}catch{return null}}n(S,"readToken");function H(t){return l("MCP_TOKEN")||(t?S(O(t)):null)||S(i.join(x($.homedir()),"mcp-token"))}n(H,"daemonToken");var m=class extends d{static{n(this,"DaemonUnavailable")}constructor(e){super(`werkmeister daemon not reachable at ${w()} (${e}). Run \`werkmeister machine setup\` (macOS) or \`werkmeister infra connect\`.`,"DAEMON_DOWN")}};function y(t){let e=t===void 0?H():t;return e?{Authorization:`Bearer ${e}`}:{}}n(y,"headers");var p=class extends d{static{n(this,"DaemonTimeout")}constructor(e){super(`werkmeister daemon at ${w()} took the call but did not answer in time (${e}); it may still be running it.`,"DAEMON_TIMEOUT")}},b={ECONNREFUSED:"ECONNREFUSED: nothing is listening, the daemon is not running",ECONNRESET:"ECONNRESET: the daemon reset the connection while exiting or restarting"},I=n(()=>Number(l("DAEMON_RETRY_MS"))||15e3,"restartGapMs"),E=!1,L=n(t=>t==="TimeoutError"||t.startsWith("UND_ERR_")&&t!=="UND_ERR_CONNECT_TIMEOUT","tookTheCall"),R=n(t=>{let e=t;return e.cause?.code??e.name},"codeOf");async function A(t,e,r=!0){let s=Date.now()+(E?0:I());for(;;)try{let a=await fetch(t,e);return r&&(E=!1),a}catch(a){let o=R(a);if(L(o))throw new p(o);if(!(o in b))throw new m(o);if(!r||Date.now()>=s)throw r&&(E=!0),new m(b[o]);await new Promise(f=>setTimeout(f,500))}}n(A,"send");var D="x-werkmeister-build",_="x-werkmeister-stream",q="x-werkmeister-launcher",z="x-werkmeister-client-ui";function K(t){if(!t)return null;try{let e=c.statSync(t).mtime.toISOString().replace(/\.\d+Z$/,"Z");for(let r=i.dirname(t);;r=i.dirname(r)){let s=i.join(r,"package.json");if(c.existsSync(s))return`${JSON.parse(c.readFileSync(s,"utf8")).version} @ ${e}`;if(i.dirname(r)===r)return null}}catch{return null}}n(K,"buildOf");var C=null,k=!1;function V(t){C=t}n(V,"expectDaemonBuild");function j(t,e){let r=e.headers.get(D);k||!t||!r||r===t||(k=!0,g(`The werkmeister daemon runs an older build (loaded ${r}, on disk ${t}); it restarts by itself once idle, or run \`werkmeister daemon restart\`.`))}n(j,"checkBuild");async function Y(){try{let t=await A(`${w()}/api/status`,{headers:y(void 0),signal:AbortSignal.timeout(5e3)},!1);return t.ok?await t.json():null}catch{return null}}n(Y,"daemonStatus");async function Q(t,e={},r={}){let s=AbortSignal.timeout(r.timeoutMs??12e4),a=C?.()??null,o=await A(`${w()}/api/tool`,{method:"POST",headers:{"Content-Type":"application/json",...y(r.token),...a?{[D]:a}:{},[_]:"1"},body:JSON.stringify({name:t,arguments:e}),signal:r.signal?AbortSignal.any([r.signal,s]):s});if(j(a,o),!o.headers.get("content-type")?.includes("json")&&o.status!==401&&o.status!==403)throw new m(`HTTP ${o.status}: the port is held by something that is not the werkmeister daemon`);let f=o.headers.get(_)==="1",u=await o.json().catch(M=>{if(f)throw new p(R(M));return{}}),h=f?u.status??500:o.status;if(h<200||h>299)throw u.error?.replace(/^MCP error -?\d+: /,"")===`Tool ${t} not found`?new d(`The werkmeister daemon is older than this CLI: it has no \`${t}\` tool. Run \`werkmeister daemon restart\`.`,"DAEMON_STALE"):new d(u.error??`daemon answered HTTP ${h} to ${t}`,u.code??`HTTP_${h}`);return{data:u.structuredContent,text:u.text??""}}n(Q,"callTool");export{P as a,U as b,w as c,H as d,m as e,D as f,_ as g,q as h,z as i,K as j,V as k,Y as l,Q as m};
|
|
4
|
+
//# sourceMappingURL=chunk-2EBFF67G.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{c as i,d as n,f as s}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{c as i,d as n,f as s}from"./chunk-HWGGARGZ.js";import{a as o,f as t}from"./chunk-XF4O72WE.js";t();import*as c from"node:fs";function a(){if(process.stdin.isTTY)return"";try{return c.readFileSync(0,"utf8")}catch{return""}}o(a,"readStdinTask");async function d(e){try{await s(e,void 0,{readStdinTask:a,build:e.build!==!1})}catch(r){throw r instanceof n&&(console.log(r.message),process.exit(1)),r instanceof i&&process.exit(1),r}}o(d,"run");export{a,d as b};
|
|
4
|
+
//# sourceMappingURL=chunk-3HP4LXFW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as o,c as v,f}from"./chunk-LV4UESBO.js";var et=v(C=>{"use strict";f();Object.defineProperty(C,"__esModule",{value:!0});C.regexpCode=C.getEsmExportName=C.getProperty=C.safeStringify=C.stringify=C.strConcat=C.addCodeArg=C.str=C._=C.nil=C._Code=C.Name=C.IDENTIFIER=C._CodeOrName=void 0;var Xe=class{static{o(this,"_CodeOrName")}};C._CodeOrName=Xe;C.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Se=class extends Xe{static{o(this,"Name")}constructor(e){if(super(),!C.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};C.Name=Se;var ee=class extends Xe{static{o(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,s)=>`${r}${s}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,s)=>(s instanceof Se&&(r[s.str]=(r[s.str]||0)+1),r),{})}};C._Code=ee;C.nil=new ee("");function nn(t,...e){let r=[t[0]],s=0;for(;s<e.length;)fr(r,e[s]),r.push(t[++s]);return new ee(r)}o(nn,"_");C._=nn;var dr=new ee("+");function on(t,...e){let r=[Ye(t[0])],s=0;for(;s<e.length;)r.push(dr),fr(r,e[s]),r.push(dr,Ye(t[++s]));return Gi(r),new ee(r)}o(on,"str");C.str=on;function fr(t,e){e instanceof ee?t.push(...e._items):e instanceof Se?t.push(e):t.push(Wi(e))}o(fr,"addCodeArg");C.addCodeArg=fr;function Gi(t){let e=1;for(;e<t.length-1;){if(t[e]===dr){let r=Ji(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}o(Gi,"optimize");function Ji(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Se||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Se))return`"${t}${e.slice(1)}`}o(Ji,"mergeExprItems");function Bi(t,e){return e.emptyStr()?t:t.emptyStr()?e:on`${t}${e}`}o(Bi,"strConcat");C.strConcat=Bi;function Wi(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ye(Array.isArray(t)?t.join(","):t)}o(Wi,"interpolate");function Qi(t){return new ee(Ye(t))}o(Qi,"stringify");C.stringify=Qi;function Ye(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Ye,"safeStringify");C.safeStringify=Ye;function Zi(t){return typeof t=="string"&&C.IDENTIFIER.test(t)?new ee(`.${t}`):nn`[${t}]`}o(Zi,"getProperty");C.getProperty=Zi;function Xi(t){if(typeof t=="string"&&C.IDENTIFIER.test(t))return new ee(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}o(Xi,"getEsmExportName");C.getEsmExportName=Xi;function Yi(t){return new ee(t.toString())}o(Yi,"regexpCode");C.regexpCode=Yi});var mr=v(Q=>{"use strict";f();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var W=et(),hr=class extends Error{static{o(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ot;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ot||(Q.UsedValueState=Ot={}));Q.varKinds={const:new W.Name("const"),let:new W.Name("let"),var:new W.Name("var")};var kt=class{static{o(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof W.Name?e:this.name(e)}name(e){return new W.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,s;if(!((s=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=kt;var qt=class extends W.Name{static{o(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:s}){this.value=e,this.scopePath=(0,W._)`.${new W.Name(r)}[${s}]`}};Q.ValueScopeName=qt;var ea=(0,W._)`\n`,pr=class extends kt{static{o(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ea:W.nil}}get(){return this._scope}name(e){return new qt(e,this._newName(e))}value(e,r){var s;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,a=(s=r.key)!==null&&s!==void 0?s:r.ref,c=this._values[i];if(c){let l=c.get(a);if(l)return l}else c=this._values[i]=new Map;c.set(a,n);let u=this._scope[i]||(this._scope[i]=[]),d=u.length;return u[d]=r.ref,n.setValue(r,{property:i,itemIndex:d}),n}getValue(e,r){let s=this._values[e];if(s)return s.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,W._)`${e}${s.scopePath}`})}scopeCode(e=this._values,r,s){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,s)}_reduceValues(e,r,s={},n){let i=W.nil;for(let a in e){let c=e[a];if(!c)continue;let u=s[a]=s[a]||new Map;c.forEach(d=>{if(u.has(d))return;u.set(d,Ot.Started);let l=r(d);if(l){let h=this.opts.es5?Q.varKinds.var:Q.varKinds.const;i=(0,W._)`${i}${h} ${d} = ${l};${this.opts._n}`}else if(l=n?.(d))i=(0,W._)`${i}${l}${this.opts._n}`;else throw new hr(d);u.set(d,Ot.Completed)})}return i}};Q.ValueScope=pr});var q=v(k=>{"use strict";f();Object.defineProperty(k,"__esModule",{value:!0});k.or=k.and=k.not=k.CodeGen=k.operators=k.varKinds=k.ValueScopeName=k.ValueScope=k.Scope=k.Name=k.regexpCode=k.stringify=k.getProperty=k.nil=k.strConcat=k.str=k._=void 0;var j=et(),ne=mr(),ge=et();Object.defineProperty(k,"_",{enumerable:!0,get:o(function(){return ge._},"get")});Object.defineProperty(k,"str",{enumerable:!0,get:o(function(){return ge.str},"get")});Object.defineProperty(k,"strConcat",{enumerable:!0,get:o(function(){return ge.strConcat},"get")});Object.defineProperty(k,"nil",{enumerable:!0,get:o(function(){return ge.nil},"get")});Object.defineProperty(k,"getProperty",{enumerable:!0,get:o(function(){return ge.getProperty},"get")});Object.defineProperty(k,"stringify",{enumerable:!0,get:o(function(){return ge.stringify},"get")});Object.defineProperty(k,"regexpCode",{enumerable:!0,get:o(function(){return ge.regexpCode},"get")});Object.defineProperty(k,"Name",{enumerable:!0,get:o(function(){return ge.Name},"get")});var Tt=mr();Object.defineProperty(k,"Scope",{enumerable:!0,get:o(function(){return Tt.Scope},"get")});Object.defineProperty(k,"ValueScope",{enumerable:!0,get:o(function(){return Tt.ValueScope},"get")});Object.defineProperty(k,"ValueScopeName",{enumerable:!0,get:o(function(){return Tt.ValueScopeName},"get")});Object.defineProperty(k,"varKinds",{enumerable:!0,get:o(function(){return Tt.varKinds},"get")});k.operators={GT:new j._Code(">"),GTE:new j._Code(">="),LT:new j._Code("<"),LTE:new j._Code("<="),EQ:new j._Code("==="),NEQ:new j._Code("!=="),NOT:new j._Code("!"),OR:new j._Code("||"),AND:new j._Code("&&"),ADD:new j._Code("+")};var he=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},yr=class extends he{static{o(this,"Def")}constructor(e,r,s){super(),this.varKind=e,this.name=r,this.rhs=s}render({es5:e,_n:r}){let s=e?ne.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Me(this.rhs,e,r)),this}get names(){return this.rhs instanceof j._CodeOrName?this.rhs.names:{}}},It=class extends he{static{o(this,"Assign")}constructor(e,r,s){super(),this.lhs=e,this.rhs=r,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof j.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Me(this.rhs,e,r),this}get names(){let e=this.lhs instanceof j.Name?{}:{...this.lhs.names};return Rt(e,this.rhs)}},gr=class extends It{static{o(this,"AssignOp")}constructor(e,r,s,n){super(e,s,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},_r=class extends he{static{o(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},$r=class extends he{static{o(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},vr=class extends he{static{o(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},wr=class extends he{static{o(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Me(this.code,e,r),this}get names(){return this.code instanceof j._CodeOrName?this.code.names:{}}},tt=class extends he{static{o(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,s)=>r+s.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let s=e[r].optimizeNodes();Array.isArray(s)?e.splice(r,1,...s):s?e[r]=s:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:s}=this,n=s.length;for(;n--;){let i=s[n];i.optimizeNames(e,r)||(ta(e,i.names),s.splice(n,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Oe(e,r.names),{})}},pe=class extends tt{static{o(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},br=class extends tt{static{o(this,"Root")}},De=class extends pe{static{o(this,"Else")}};De.kind="else";var Pe=class t extends pe{static{o(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let s=r.optimizeNodes();r=this.else=Array.isArray(s)?new De(s):s}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(an(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Me(this.condition,e,r),this}get names(){let e=super.names;return Rt(e,this.condition),this.else&&Oe(e,this.else.names),e}};Pe.kind="if";var Ne=class extends pe{static{o(this,"For")}};Ne.kind="for";var Er=class extends Ne{static{o(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Me(this.iteration,e,r),this}get names(){return Oe(super.names,this.iteration.names)}},Sr=class extends Ne{static{o(this,"ForRange")}constructor(e,r,s,n){super(),this.varKind=e,this.name=r,this.from=s,this.to=n}render(e){let r=e.es5?ne.varKinds.var:this.varKind,{name:s,from:n,to:i}=this;return`for(${r} ${s}=${n}; ${s}<${i}; ${s}++)`+super.render(e)}get names(){let e=Rt(super.names,this.from);return Rt(e,this.to)}},jt=class extends Ne{static{o(this,"ForIter")}constructor(e,r,s,n){super(),this.loop=e,this.varKind=r,this.name=s,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Me(this.iterable,e,r),this}get names(){return Oe(super.names,this.iterable.names)}},rt=class extends pe{static{o(this,"Func")}constructor(e,r,s){super(),this.name=e,this.args=r,this.async=s}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};rt.kind="func";var st=class extends tt{static{o(this,"Return")}render(e){return"return "+super.render(e)}};st.kind="return";var Pr=class extends pe{static{o(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var s,n;return super.optimizeNames(e,r),(s=this.catch)===null||s===void 0||s.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Oe(e,this.catch.names),this.finally&&Oe(e,this.finally.names),e}},nt=class extends pe{static{o(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};nt.kind="catch";var ot=class extends pe{static{o(this,"Finally")}render(e){return"finally"+super.render(e)}};ot.kind="finally";var Nr=class{static{o(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
+
import{a as o,c as v,f}from"./chunk-XF4O72WE.js";var et=v(C=>{"use strict";f();Object.defineProperty(C,"__esModule",{value:!0});C.regexpCode=C.getEsmExportName=C.getProperty=C.safeStringify=C.stringify=C.strConcat=C.addCodeArg=C.str=C._=C.nil=C._Code=C.Name=C.IDENTIFIER=C._CodeOrName=void 0;var Xe=class{static{o(this,"_CodeOrName")}};C._CodeOrName=Xe;C.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Se=class extends Xe{static{o(this,"Name")}constructor(e){if(super(),!C.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};C.Name=Se;var ee=class extends Xe{static{o(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,s)=>`${r}${s}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,s)=>(s instanceof Se&&(r[s.str]=(r[s.str]||0)+1),r),{})}};C._Code=ee;C.nil=new ee("");function nn(t,...e){let r=[t[0]],s=0;for(;s<e.length;)fr(r,e[s]),r.push(t[++s]);return new ee(r)}o(nn,"_");C._=nn;var dr=new ee("+");function on(t,...e){let r=[Ye(t[0])],s=0;for(;s<e.length;)r.push(dr),fr(r,e[s]),r.push(dr,Ye(t[++s]));return Gi(r),new ee(r)}o(on,"str");C.str=on;function fr(t,e){e instanceof ee?t.push(...e._items):e instanceof Se?t.push(e):t.push(Wi(e))}o(fr,"addCodeArg");C.addCodeArg=fr;function Gi(t){let e=1;for(;e<t.length-1;){if(t[e]===dr){let r=Ji(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}o(Gi,"optimize");function Ji(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Se||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Se))return`"${t}${e.slice(1)}`}o(Ji,"mergeExprItems");function Bi(t,e){return e.emptyStr()?t:t.emptyStr()?e:on`${t}${e}`}o(Bi,"strConcat");C.strConcat=Bi;function Wi(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ye(Array.isArray(t)?t.join(","):t)}o(Wi,"interpolate");function Qi(t){return new ee(Ye(t))}o(Qi,"stringify");C.stringify=Qi;function Ye(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Ye,"safeStringify");C.safeStringify=Ye;function Zi(t){return typeof t=="string"&&C.IDENTIFIER.test(t)?new ee(`.${t}`):nn`[${t}]`}o(Zi,"getProperty");C.getProperty=Zi;function Xi(t){if(typeof t=="string"&&C.IDENTIFIER.test(t))return new ee(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}o(Xi,"getEsmExportName");C.getEsmExportName=Xi;function Yi(t){return new ee(t.toString())}o(Yi,"regexpCode");C.regexpCode=Yi});var mr=v(Q=>{"use strict";f();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var W=et(),hr=class extends Error{static{o(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ot;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ot||(Q.UsedValueState=Ot={}));Q.varKinds={const:new W.Name("const"),let:new W.Name("let"),var:new W.Name("var")};var kt=class{static{o(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof W.Name?e:this.name(e)}name(e){return new W.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,s;if(!((s=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=kt;var qt=class extends W.Name{static{o(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:s}){this.value=e,this.scopePath=(0,W._)`.${new W.Name(r)}[${s}]`}};Q.ValueScopeName=qt;var ea=(0,W._)`\n`,pr=class extends kt{static{o(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ea:W.nil}}get(){return this._scope}name(e){return new qt(e,this._newName(e))}value(e,r){var s;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,a=(s=r.key)!==null&&s!==void 0?s:r.ref,c=this._values[i];if(c){let l=c.get(a);if(l)return l}else c=this._values[i]=new Map;c.set(a,n);let u=this._scope[i]||(this._scope[i]=[]),d=u.length;return u[d]=r.ref,n.setValue(r,{property:i,itemIndex:d}),n}getValue(e,r){let s=this._values[e];if(s)return s.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,W._)`${e}${s.scopePath}`})}scopeCode(e=this._values,r,s){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,s)}_reduceValues(e,r,s={},n){let i=W.nil;for(let a in e){let c=e[a];if(!c)continue;let u=s[a]=s[a]||new Map;c.forEach(d=>{if(u.has(d))return;u.set(d,Ot.Started);let l=r(d);if(l){let h=this.opts.es5?Q.varKinds.var:Q.varKinds.const;i=(0,W._)`${i}${h} ${d} = ${l};${this.opts._n}`}else if(l=n?.(d))i=(0,W._)`${i}${l}${this.opts._n}`;else throw new hr(d);u.set(d,Ot.Completed)})}return i}};Q.ValueScope=pr});var q=v(k=>{"use strict";f();Object.defineProperty(k,"__esModule",{value:!0});k.or=k.and=k.not=k.CodeGen=k.operators=k.varKinds=k.ValueScopeName=k.ValueScope=k.Scope=k.Name=k.regexpCode=k.stringify=k.getProperty=k.nil=k.strConcat=k.str=k._=void 0;var j=et(),ne=mr(),ge=et();Object.defineProperty(k,"_",{enumerable:!0,get:o(function(){return ge._},"get")});Object.defineProperty(k,"str",{enumerable:!0,get:o(function(){return ge.str},"get")});Object.defineProperty(k,"strConcat",{enumerable:!0,get:o(function(){return ge.strConcat},"get")});Object.defineProperty(k,"nil",{enumerable:!0,get:o(function(){return ge.nil},"get")});Object.defineProperty(k,"getProperty",{enumerable:!0,get:o(function(){return ge.getProperty},"get")});Object.defineProperty(k,"stringify",{enumerable:!0,get:o(function(){return ge.stringify},"get")});Object.defineProperty(k,"regexpCode",{enumerable:!0,get:o(function(){return ge.regexpCode},"get")});Object.defineProperty(k,"Name",{enumerable:!0,get:o(function(){return ge.Name},"get")});var Tt=mr();Object.defineProperty(k,"Scope",{enumerable:!0,get:o(function(){return Tt.Scope},"get")});Object.defineProperty(k,"ValueScope",{enumerable:!0,get:o(function(){return Tt.ValueScope},"get")});Object.defineProperty(k,"ValueScopeName",{enumerable:!0,get:o(function(){return Tt.ValueScopeName},"get")});Object.defineProperty(k,"varKinds",{enumerable:!0,get:o(function(){return Tt.varKinds},"get")});k.operators={GT:new j._Code(">"),GTE:new j._Code(">="),LT:new j._Code("<"),LTE:new j._Code("<="),EQ:new j._Code("==="),NEQ:new j._Code("!=="),NOT:new j._Code("!"),OR:new j._Code("||"),AND:new j._Code("&&"),ADD:new j._Code("+")};var he=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},yr=class extends he{static{o(this,"Def")}constructor(e,r,s){super(),this.varKind=e,this.name=r,this.rhs=s}render({es5:e,_n:r}){let s=e?ne.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Me(this.rhs,e,r)),this}get names(){return this.rhs instanceof j._CodeOrName?this.rhs.names:{}}},It=class extends he{static{o(this,"Assign")}constructor(e,r,s){super(),this.lhs=e,this.rhs=r,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof j.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Me(this.rhs,e,r),this}get names(){let e=this.lhs instanceof j.Name?{}:{...this.lhs.names};return Rt(e,this.rhs)}},gr=class extends It{static{o(this,"AssignOp")}constructor(e,r,s,n){super(e,s,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},_r=class extends he{static{o(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},$r=class extends he{static{o(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},vr=class extends he{static{o(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},wr=class extends he{static{o(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Me(this.code,e,r),this}get names(){return this.code instanceof j._CodeOrName?this.code.names:{}}},tt=class extends he{static{o(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,s)=>r+s.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let s=e[r].optimizeNodes();Array.isArray(s)?e.splice(r,1,...s):s?e[r]=s:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:s}=this,n=s.length;for(;n--;){let i=s[n];i.optimizeNames(e,r)||(ta(e,i.names),s.splice(n,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Oe(e,r.names),{})}},pe=class extends tt{static{o(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},br=class extends tt{static{o(this,"Root")}},De=class extends pe{static{o(this,"Else")}};De.kind="else";var Pe=class t extends pe{static{o(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let s=r.optimizeNodes();r=this.else=Array.isArray(s)?new De(s):s}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(an(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Me(this.condition,e,r),this}get names(){let e=super.names;return Rt(e,this.condition),this.else&&Oe(e,this.else.names),e}};Pe.kind="if";var Ne=class extends pe{static{o(this,"For")}};Ne.kind="for";var Er=class extends Ne{static{o(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Me(this.iteration,e,r),this}get names(){return Oe(super.names,this.iteration.names)}},Sr=class extends Ne{static{o(this,"ForRange")}constructor(e,r,s,n){super(),this.varKind=e,this.name=r,this.from=s,this.to=n}render(e){let r=e.es5?ne.varKinds.var:this.varKind,{name:s,from:n,to:i}=this;return`for(${r} ${s}=${n}; ${s}<${i}; ${s}++)`+super.render(e)}get names(){let e=Rt(super.names,this.from);return Rt(e,this.to)}},jt=class extends Ne{static{o(this,"ForIter")}constructor(e,r,s,n){super(),this.loop=e,this.varKind=r,this.name=s,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Me(this.iterable,e,r),this}get names(){return Oe(super.names,this.iterable.names)}},rt=class extends pe{static{o(this,"Func")}constructor(e,r,s){super(),this.name=e,this.args=r,this.async=s}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};rt.kind="func";var st=class extends tt{static{o(this,"Return")}render(e){return"return "+super.render(e)}};st.kind="return";var Pr=class extends pe{static{o(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var s,n;return super.optimizeNames(e,r),(s=this.catch)===null||s===void 0||s.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Oe(e,this.catch.names),this.finally&&Oe(e,this.finally.names),e}},nt=class extends pe{static{o(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};nt.kind="catch";var ot=class extends pe{static{o(this,"Finally")}render(e){return"finally"+super.render(e)}};ot.kind="finally";var Nr=class{static{o(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
4
4
|
`:""},this._extScope=e,this._scope=new ne.Scope({parent:e}),this._nodes=[new br]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let s=this._extScope.value(e,r);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,s,n){let i=this._scope.toName(r);return s!==void 0&&n&&(this._constants[i.str]=s),this._leafNode(new yr(e,i,s)),i}const(e,r,s){return this._def(ne.varKinds.const,e,r,s)}let(e,r,s){return this._def(ne.varKinds.let,e,r,s)}var(e,r,s){return this._def(ne.varKinds.var,e,r,s)}assign(e,r,s){return this._leafNode(new It(e,r,s))}add(e,r){return this._leafNode(new gr(e,k.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==j.nil&&this._leafNode(new wr(e)),this}object(...e){let r=["{"];for(let[s,n]of e)r.length>1&&r.push(","),r.push(s),(s!==n||this.opts.es5)&&(r.push(":"),(0,j.addCodeArg)(r,n));return r.push("}"),new j._Code(r)}if(e,r,s){if(this._blockNode(new Pe(e)),r&&s)this.code(r).else().code(s).endIf();else if(r)this.code(r).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Pe(e))}else(){return this._elseNode(new De)}endIf(){return this._endBlockNode(Pe,De)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Er(e),r)}forRange(e,r,s,n,i=this.opts.es5?ne.varKinds.var:ne.varKinds.let){let a=this._scope.toName(e);return this._for(new Sr(i,a,r,s),()=>n(a))}forOf(e,r,s,n=ne.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let a=r instanceof j.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,j._)`${a}.length`,c=>{this.var(i,(0,j._)`${a}[${c}]`),s(i)})}return this._for(new jt("of",n,i,r),()=>s(i))}forIn(e,r,s,n=this.opts.es5?ne.varKinds.var:ne.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,j._)`Object.keys(${r})`,s);let i=this._scope.toName(e);return this._for(new jt("in",n,i,r),()=>s(i))}endFor(){return this._endBlockNode(Ne)}label(e){return this._leafNode(new _r(e))}break(e){return this._leafNode(new $r(e))}return(e){let r=new st;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(st)}try(e,r,s){if(!r&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Pr;if(this._blockNode(n),this.code(e),r){let i=this.name("e");this._currNode=n.catch=new nt(i),r(i)}return s&&(this._currNode=n.finally=new ot,this.code(s)),this._endBlockNode(nt,ot)}throw(e){return this._leafNode(new vr(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-r;if(s<0||e!==void 0&&s!==e)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=j.nil,s,n){return this._blockNode(new rt(e,r,s)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(rt)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let s=this._currNode;if(s instanceof e||r&&s instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Pe))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};k.CodeGen=Nr;function Oe(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}o(Oe,"addNames");function Rt(t,e){return e instanceof j._CodeOrName?Oe(t,e.names):t}o(Rt,"addExprNames");function Me(t,e,r){if(t instanceof j.Name)return s(t);if(!n(t))return t;return new j._Code(t._items.reduce((i,a)=>(a instanceof j.Name&&(a=s(a)),a instanceof j._Code?i.push(...a._items):i.push(a),i),[]));function s(i){let a=r[i.str];return a===void 0||e[i.str]!==1?i:(delete e[i.str],a)}function n(i){return i instanceof j._Code&&i._items.some(a=>a instanceof j.Name&&e[a.str]===1&&r[a.str]!==void 0)}}o(Me,"optimizeExpr");function ta(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}o(ta,"subtractNames");function an(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,j._)`!${Or(t)}`}o(an,"not");k.not=an;var ra=cn(k.operators.AND);function sa(...t){return t.reduce(ra)}o(sa,"and");k.and=sa;var na=cn(k.operators.OR);function oa(...t){return t.reduce(na)}o(oa,"or");k.or=oa;function cn(t){return(e,r)=>e===j.nil?r:r===j.nil?e:(0,j._)`${Or(e)} ${t} ${Or(r)}`}o(cn,"mappend");function Or(t){return t instanceof j.Name?t:(0,j._)`(${t})`}o(Or,"par")});var R=v(I=>{"use strict";f();Object.defineProperty(I,"__esModule",{value:!0});I.checkStrictMode=I.getErrorPath=I.Type=I.useFunc=I.setEvaluated=I.evaluatedPropsToName=I.mergeEvaluated=I.eachItem=I.unescapeJsonPointer=I.escapeJsonPointer=I.escapeFragment=I.unescapeFragment=I.schemaRefOrVal=I.schemaHasRulesButRef=I.schemaHasRules=I.checkUnknownRules=I.alwaysValidSchema=I.toHash=void 0;var M=q(),ia=et();function aa(t){let e={};for(let r of t)e[r]=!0;return e}o(aa,"toHash");I.toHash=aa;function ca(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(dn(t,e),!fn(e,t.self.RULES.all))}o(ca,"alwaysValidSchema");I.alwaysValidSchema=ca;function dn(t,e=t.schema){let{opts:r,self:s}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=s.RULES.keywords;for(let i in e)n[i]||mn(t,`unknown keyword: "${i}"`)}o(dn,"checkUnknownRules");I.checkUnknownRules=dn;function fn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}o(fn,"schemaHasRules");I.schemaHasRules=fn;function ua(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}o(ua,"schemaHasRulesButRef");I.schemaHasRulesButRef=ua;function la({topSchemaRef:t,schemaPath:e},r,s,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,M._)`${r}`}return(0,M._)`${t}${e}${(0,M.getProperty)(s)}`}o(la,"schemaRefOrVal");I.schemaRefOrVal=la;function da(t){return hn(decodeURIComponent(t))}o(da,"unescapeFragment");I.unescapeFragment=da;function fa(t){return encodeURIComponent(qr(t))}o(fa,"escapeFragment");I.escapeFragment=fa;function qr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}o(qr,"escapeJsonPointer");I.escapeJsonPointer=qr;function hn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(hn,"unescapeJsonPointer");I.unescapeJsonPointer=hn;function ha(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}o(ha,"eachItem");I.eachItem=ha;function un({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:s}){return(n,i,a,c)=>{let u=a===void 0?i:a instanceof M.Name?(i instanceof M.Name?t(n,i,a):e(n,i,a),a):i instanceof M.Name?(e(n,a,i),i):r(i,a);return c===M.Name&&!(u instanceof M.Name)?s(n,u):u}}o(un,"makeMergeEvaluated");I.mergeEvaluated={props:un({mergeNames:o((t,e,r)=>t.if((0,M._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,M._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,M._)`${r} || {}`).code((0,M._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:o((t,e,r)=>t.if((0,M._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,M._)`${r} || {}`),Ir(t,r,e))}),"mergeToName"),mergeValues:o((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:pn}),items:un({mergeNames:o((t,e,r)=>t.if((0,M._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,M._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:o((t,e,r)=>t.if((0,M._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,M._)`${r} > ${e} ? ${r} : ${e}`)),"mergeToName"),mergeValues:o((t,e)=>t===!0?!0:Math.max(t,e),"mergeValues"),resultToName:o((t,e)=>t.var("items",e),"resultToName")})};function pn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,M._)`{}`);return e!==void 0&&Ir(t,r,e),r}o(pn,"evaluatedPropsToName");I.evaluatedPropsToName=pn;function Ir(t,e,r){Object.keys(r).forEach(s=>t.assign((0,M._)`${e}${(0,M.getProperty)(s)}`,!0))}o(Ir,"setEvaluated");I.setEvaluated=Ir;var ln={};function pa(t,e){return t.scopeValue("func",{ref:e,code:ln[e.code]||(ln[e.code]=new ia._Code(e.code))})}o(pa,"useFunc");I.useFunc=pa;var kr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(kr||(I.Type=kr={}));function ma(t,e,r){if(t instanceof M.Name){let s=e===kr.Num;return r?s?(0,M._)`"[" + ${t} + "]"`:(0,M._)`"['" + ${t} + "']"`:s?(0,M._)`"/" + ${t}`:(0,M._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,M.getProperty)(t).toString():"/"+qr(t)}o(ma,"getErrorPath");I.getErrorPath=ma;function mn(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}o(mn,"checkStrictMode");I.checkStrictMode=mn});var me=v(jr=>{"use strict";f();Object.defineProperty(jr,"__esModule",{value:!0});var K=q(),ya={data:new K.Name("data"),valCxt:new K.Name("valCxt"),instancePath:new K.Name("instancePath"),parentData:new K.Name("parentData"),parentDataProperty:new K.Name("parentDataProperty"),rootData:new K.Name("rootData"),dynamicAnchors:new K.Name("dynamicAnchors"),vErrors:new K.Name("vErrors"),errors:new K.Name("errors"),this:new K.Name("this"),self:new K.Name("self"),scope:new K.Name("scope"),json:new K.Name("json"),jsonPos:new K.Name("jsonPos"),jsonLen:new K.Name("jsonLen"),jsonPart:new K.Name("jsonPart")};jr.default=ya});var it=v(H=>{"use strict";f();Object.defineProperty(H,"__esModule",{value:!0});H.extendErrors=H.resetErrorsCount=H.reportExtraError=H.reportError=H.keyword$DataError=H.keywordError=void 0;var T=q(),Ct=R(),J=me();H.keywordError={message:o(({keyword:t})=>(0,T.str)`must pass "${t}" keyword validation`,"message")};H.keyword$DataError={message:o(({keyword:t,schemaType:e})=>e?(0,T.str)`"${t}" keyword must be ${e} ($data)`:(0,T.str)`"${t}" keyword is invalid ($data)`,"message")};function ga(t,e=H.keywordError,r,s){let{it:n}=t,{gen:i,compositeRule:a,allErrors:c}=n,u=_n(t,e,r);s??(a||c)?yn(i,u):gn(n,(0,T._)`[${u}]`)}o(ga,"reportError");H.reportError=ga;function _a(t,e=H.keywordError,r){let{it:s}=t,{gen:n,compositeRule:i,allErrors:a}=s,c=_n(t,e,r);yn(n,c),i||a||gn(s,J.default.vErrors)}o(_a,"reportExtraError");H.reportExtraError=_a;function $a(t,e){t.assign(J.default.errors,e),t.if((0,T._)`${J.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,T._)`${J.default.vErrors}.length`,e),()=>t.assign(J.default.vErrors,null)))}o($a,"resetErrorsCount");H.resetErrorsCount=$a;function va({gen:t,keyword:e,schemaValue:r,data:s,errsCount:n,it:i}){if(n===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",n,J.default.errors,c=>{t.const(a,(0,T._)`${J.default.vErrors}[${c}]`),t.if((0,T._)`${a}.instancePath === undefined`,()=>t.assign((0,T._)`${a}.instancePath`,(0,T.strConcat)(J.default.instancePath,i.errorPath))),t.assign((0,T._)`${a}.schemaPath`,(0,T.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,T._)`${a}.schema`,r),t.assign((0,T._)`${a}.data`,s))})}o(va,"extendErrors");H.extendErrors=va;function yn(t,e){let r=t.const("err",e);t.if((0,T._)`${J.default.vErrors} === null`,()=>t.assign(J.default.vErrors,(0,T._)`[${r}]`),(0,T._)`${J.default.vErrors}.push(${r})`),t.code((0,T._)`${J.default.errors}++`)}o(yn,"addError");function gn(t,e){let{gen:r,validateName:s,schemaEnv:n}=t;n.$async?r.throw((0,T._)`new ${t.ValidationError}(${e})`):(r.assign((0,T._)`${s}.errors`,e),r.return(!1))}o(gn,"returnErrors");var ke={keyword:new T.Name("keyword"),schemaPath:new T.Name("schemaPath"),params:new T.Name("params"),propertyName:new T.Name("propertyName"),message:new T.Name("message"),schema:new T.Name("schema"),parentSchema:new T.Name("parentSchema")};function _n(t,e,r){let{createErrors:s}=t.it;return s===!1?(0,T._)`{}`:wa(t,e,r)}o(_n,"errorObjectCode");function wa(t,e,r={}){let{gen:s,it:n}=t,i=[ba(n,r),Ea(t,r)];return Sa(t,e,i),s.object(...i)}o(wa,"errorObject");function ba({errorPath:t},{instancePath:e}){let r=e?(0,T.str)`${t}${(0,Ct.getErrorPath)(e,Ct.Type.Str)}`:t;return[J.default.instancePath,(0,T.strConcat)(J.default.instancePath,r)]}o(ba,"errorInstancePath");function Ea({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:s}){let n=s?e:(0,T.str)`${e}/${t}`;return r&&(n=(0,T.str)`${n}${(0,Ct.getErrorPath)(r,Ct.Type.Str)}`),[ke.schemaPath,n]}o(Ea,"errorSchemaPath");function Sa(t,{params:e,message:r},s){let{keyword:n,data:i,schemaValue:a,it:c}=t,{opts:u,propertyName:d,topSchemaRef:l,schemaPath:h}=c;s.push([ke.keyword,n],[ke.params,typeof e=="function"?e(t):e||(0,T._)`{}`]),u.messages&&s.push([ke.message,typeof r=="function"?r(t):r]),u.verbose&&s.push([ke.schema,a],[ke.parentSchema,(0,T._)`${l}${h}`],[J.default.data,i]),d&&s.push([ke.propertyName,d])}o(Sa,"extraErrorProps")});var vn=v(xe=>{"use strict";f();Object.defineProperty(xe,"__esModule",{value:!0});xe.boolOrEmptySchema=xe.topBoolOrEmptySchema=void 0;var Pa=it(),Na=q(),Oa=me(),ka={message:"boolean schema is false"};function qa(t){let{gen:e,schema:r,validateName:s}=t;r===!1?$n(t,!1):typeof r=="object"&&r.$async===!0?e.return(Oa.default.data):(e.assign((0,Na._)`${s}.errors`,null),e.return(!0))}o(qa,"topBoolOrEmptySchema");xe.topBoolOrEmptySchema=qa;function Ia(t,e){let{gen:r,schema:s}=t;s===!1?(r.var(e,!1),$n(t)):r.var(e,!0)}o(Ia,"boolOrEmptySchema");xe.boolOrEmptySchema=Ia;function $n(t,e){let{gen:r,data:s}=t,n={gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Pa.reportError)(n,ka,void 0,e)}o($n,"falseSchemaError")});var Rr=v(Fe=>{"use strict";f();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.getRules=Fe.isJSONType=void 0;var ja=["string","number","integer","boolean","null","object","array"],Ra=new Set(ja);function Ta(t){return typeof t=="string"&&Ra.has(t)}o(Ta,"isJSONType");Fe.isJSONType=Ta;function Ca(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}o(Ca,"getRules");Fe.getRules=Ca});var Tr=v(_e=>{"use strict";f();Object.defineProperty(_e,"__esModule",{value:!0});_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function Aa({schema:t,self:e},r){let s=e.RULES.types[r];return s&&s!==!0&&wn(t,s)}o(Aa,"schemaHasRulesForType");_e.schemaHasRulesForType=Aa;function wn(t,e){return e.rules.some(r=>bn(t,r))}o(wn,"shouldUseGroup");_e.shouldUseGroup=wn;function bn(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(s=>t[s]!==void 0))}o(bn,"shouldUseRule");_e.shouldUseRule=bn});var at=v(L=>{"use strict";f();Object.defineProperty(L,"__esModule",{value:!0});L.reportTypeError=L.checkDataTypes=L.checkDataType=L.coerceAndCheckDataType=L.getJSONTypes=L.getSchemaTypes=L.DataType=void 0;var Da=Rr(),Ma=Tr(),xa=it(),O=q(),En=R(),Ve;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ve||(L.DataType=Ve={}));function Fa(t){let e=Sn(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}o(Fa,"getSchemaTypes");L.getSchemaTypes=Fa;function Sn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Da.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}o(Sn,"getJSONTypes");L.getJSONTypes=Sn;function Va(t,e){let{gen:r,data:s,opts:n}=t,i=za(e,n.coerceTypes),a=e.length>0&&!(i.length===0&&e.length===1&&(0,Ma.schemaHasRulesForType)(t,e[0]));if(a){let c=Ar(e,s,n.strictNumbers,Ve.Wrong);r.if(c,()=>{i.length?Ua(t,e,i):Dr(t)})}return a}o(Va,"coerceAndCheckDataType");L.coerceAndCheckDataType=Va;var Pn=new Set(["string","number","integer","boolean","null"]);function za(t,e){return e?t.filter(r=>Pn.has(r)||e==="array"&&r==="array"):[]}o(za,"coerceToTypes");function Ua(t,e,r){let{gen:s,data:n,opts:i}=t,a=s.let("dataType",(0,O._)`typeof ${n}`),c=s.let("coerced",(0,O._)`undefined`);i.coerceTypes==="array"&&s.if((0,O._)`${a} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>s.assign(n,(0,O._)`${n}[0]`).assign(a,(0,O._)`typeof ${n}`).if(Ar(e,n,i.strictNumbers),()=>s.assign(c,n))),s.if((0,O._)`${c} !== undefined`);for(let d of r)(Pn.has(d)||d==="array"&&i.coerceTypes==="array")&&u(d);s.else(),Dr(t),s.endIf(),s.if((0,O._)`${c} !== undefined`,()=>{s.assign(n,c),Ka(t,c)});function u(d){switch(d){case"string":s.elseIf((0,O._)`${a} == "number" || ${a} == "boolean"`).assign(c,(0,O._)`"" + ${n}`).elseIf((0,O._)`${n} === null`).assign(c,(0,O._)`""`);return;case"number":s.elseIf((0,O._)`${a} == "boolean" || ${n} === null
|
|
5
5
|
|| (${a} == "string" && ${n} && ${n} == +${n})`).assign(c,(0,O._)`+${n}`);return;case"integer":s.elseIf((0,O._)`${a} === "boolean" || ${n} === null
|
|
6
6
|
|| (${a} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(c,(0,O._)`+${n}`);return;case"boolean":s.elseIf((0,O._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(c,!1).elseIf((0,O._)`${n} === "true" || ${n} === 1`).assign(c,!0);return;case"null":s.elseIf((0,O._)`${n} === "" || ${n} === 0 || ${n} === false`),s.assign(c,null);return;case"array":s.elseIf((0,O._)`${a} === "string" || ${a} === "number"
|
|
@@ -8,4 +8,4 @@ import{a as o,c as v,f}from"./chunk-LV4UESBO.js";var et=v(C=>{"use strict";f();O
|
|
|
8
8
|
missingProperty: ${s},
|
|
9
9
|
depsCount: ${e},
|
|
10
10
|
deps: ${r}}`,"params")};var Id={keyword:"dependencies",type:"object",schemaType:"object",error:de.error,code(t){let[e,r]=jd(t);hi(t,e),pi(t,r)}};function jd({schema:t}){let e={},r={};for(let s in t){if(s==="__proto__")continue;let n=Array.isArray(t[s])?e:r;n[s]=t[s]}return[e,r]}o(jd,"splitDependencies");function hi(t,e=t.schema){let{gen:r,data:s,it:n}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let a in e){let c=e[a];if(c.length===0)continue;let u=(0,Nt.propertyInData)(r,s,a,n.opts.ownProperties);t.setParams({property:a,depsCount:c.length,deps:c.join(", ")}),n.allErrors?r.if(u,()=>{for(let d of c)(0,Nt.checkReportMissingProp)(t,d)}):(r.if((0,Ds._)`${u} && (${(0,Nt.checkMissingProp)(t,c,i)})`),(0,Nt.reportMissingProp)(t,i),r.else())}}o(hi,"validatePropertyDeps");de.validatePropertyDeps=hi;function pi(t,e=t.schema){let{gen:r,data:s,keyword:n,it:i}=t,a=r.name("valid");for(let c in e)(0,qd.alwaysValidSchema)(i,e[c])||(r.if((0,Nt.propertyInData)(r,s,c,i.opts.ownProperties),()=>{let u=t.subschema({keyword:n,schemaProp:c},a);t.mergeValidEvaluated(u,a)},()=>r.var(a,!0)),t.ok(a))}o(pi,"validateSchemaDeps");de.validateSchemaDeps=pi;de.default=Id});var gi=v(Ms=>{"use strict";f();Object.defineProperty(Ms,"__esModule",{value:!0});var yi=q(),Rd=R(),Td={message:"property name must be valid",params:o(({params:t})=>(0,yi._)`{propertyName: ${t.propertyName}}`,"params")},Cd={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Td,code(t){let{gen:e,schema:r,data:s,it:n}=t;if((0,Rd.alwaysValidSchema)(n,r))return;let i=e.name("valid");e.forIn("key",s,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),e.if((0,yi.not)(i),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(i)}};Ms.default=Cd});var Fs=v(xs=>{"use strict";f();Object.defineProperty(xs,"__esModule",{value:!0});var tr=te(),ae=q(),Ad=me(),rr=R(),Dd={message:"must NOT have additional properties",params:o(({params:t})=>(0,ae._)`{additionalProperty: ${t.additionalProperty}}`,"params")},Md={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Dd,code(t){let{gen:e,schema:r,parentSchema:s,data:n,errsCount:i,it:a}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,rr.alwaysValidSchema)(a,r))return;let d=(0,tr.allSchemaProperties)(s.properties),l=(0,tr.allSchemaProperties)(s.patternProperties);h(),t.ok((0,ae._)`${i} === ${Ad.default.errors}`);function h(){e.forIn("key",n,y=>{!d.length&&!l.length?m(y):e.if(_(y),()=>m(y))})}o(h,"checkAdditionalProperties");function _(y){let $;if(d.length>8){let S=(0,rr.schemaRefOrVal)(a,s.properties,"properties");$=(0,tr.isOwnProperty)(e,S,y)}else d.length?$=(0,ae.or)(...d.map(S=>(0,ae._)`${y} === ${S}`)):$=ae.nil;return l.length&&($=(0,ae.or)($,...l.map(S=>(0,ae._)`${(0,tr.usePattern)(t,S)}.test(${y})`))),(0,ae.not)($)}o(_,"isAdditional");function g(y){e.code((0,ae._)`delete ${n}[${y}]`)}o(g,"deleteAdditional");function m(y){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),c||e.break();return}if(typeof r=="object"&&!(0,rr.alwaysValidSchema)(a,r)){let $=e.name("valid");u.removeAdditional==="failing"?(p(y,$,!1),e.if((0,ae.not)($),()=>{t.reset(),g(y)})):(p(y,$),c||e.if((0,ae.not)($),()=>e.break()))}}o(m,"additionalPropertyCode");function p(y,$,S){let P={keyword:"additionalProperties",dataProp:y,dataPropType:rr.Type.Str};S===!1&&Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(P,$)}o(p,"applyAdditionalSchema")}};xs.default=Md});var vi=v(zs=>{"use strict";f();Object.defineProperty(zs,"__esModule",{value:!0});var xd=dt(),_i=te(),Vs=R(),$i=Fs(),Fd={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:s,data:n,it:i}=t;i.opts.removeAdditional==="all"&&s.additionalProperties===void 0&&$i.default.code(new xd.KeywordCxt(i,$i.default,"additionalProperties"));let a=(0,_i.allSchemaProperties)(r);for(let h of a)i.definedProperties.add(h);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=Vs.mergeEvaluated.props(e,(0,Vs.toHash)(a),i.props));let c=a.filter(h=>!(0,Vs.alwaysValidSchema)(i,r[h]));if(c.length===0)return;let u=e.name("valid");for(let h of c)d(h)?l(h):(e.if((0,_i.propertyInData)(e,n,h,i.opts.ownProperties)),l(h),i.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(u);function d(h){return i.opts.useDefaults&&!i.compositeRule&&r[h].default!==void 0}o(d,"hasDefault");function l(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}o(l,"applyPropertySchema")}};zs.default=Fd});var Si=v(Us=>{"use strict";f();Object.defineProperty(Us,"__esModule",{value:!0});var wi=te(),sr=q(),bi=R(),Ei=R(),Vd={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:s,parentSchema:n,it:i}=t,{opts:a}=i,c=(0,wi.allSchemaProperties)(r),u=c.filter(p=>(0,bi.alwaysValidSchema)(i,r[p]));if(c.length===0||u.length===c.length&&(!i.opts.unevaluated||i.props===!0))return;let d=a.strictSchema&&!a.allowMatchingProperties&&n.properties,l=e.name("valid");i.props!==!0&&!(i.props instanceof sr.Name)&&(i.props=(0,Ei.evaluatedPropsToName)(e,i.props));let{props:h}=i;_();function _(){for(let p of c)d&&g(p),i.allErrors?m(p):(e.var(l,!0),m(p),e.if(l))}o(_,"validatePatternProperties");function g(p){for(let y in d)new RegExp(p).test(y)&&(0,bi.checkStrictMode)(i,`property ${y} matches pattern ${p} (use allowMatchingProperties)`)}o(g,"checkMatchingProperties");function m(p){e.forIn("key",s,y=>{e.if((0,sr._)`${(0,wi.usePattern)(t,p)}.test(${y})`,()=>{let $=u.includes(p);$||t.subschema({keyword:"patternProperties",schemaProp:p,dataProp:y,dataPropType:Ei.Type.Str},l),i.opts.unevaluated&&h!==!0?e.assign((0,sr._)`${h}[${y}]`,!0):!$&&!i.allErrors&&e.if((0,sr.not)(l),()=>e.break())})})}o(m,"validateProperties")}};Us.default=Vd});var Pi=v(Ks=>{"use strict";f();Object.defineProperty(Ks,"__esModule",{value:!0});var zd=R(),Ud={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:s}=t;if((0,zd.alwaysValidSchema)(s,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Ks.default=Ud});var Ni=v(Hs=>{"use strict";f();Object.defineProperty(Hs,"__esModule",{value:!0});var Kd=te(),Hd={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Kd.validateUnion,error:{message:"must match a schema in anyOf"}};Hs.default=Hd});var Oi=v(Ls=>{"use strict";f();Object.defineProperty(Ls,"__esModule",{value:!0});var nr=q(),Ld=R(),Gd={message:"must match exactly one schema in oneOf",params:o(({params:t})=>(0,nr._)`{passingSchemas: ${t.passing}}`,"params")},Jd={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Gd,code(t){let{gen:e,schema:r,parentSchema:s,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&s.discriminator)return;let i=r,a=e.let("valid",!1),c=e.let("passing",null),u=e.name("_valid");t.setParams({passing:c}),e.block(d),t.result(a,()=>t.reset(),()=>t.error(!0));function d(){i.forEach((l,h)=>{let _;(0,Ld.alwaysValidSchema)(n,l)?e.var(u,!0):_=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,nr._)`${u} && ${a}`).assign(a,!1).assign(c,(0,nr._)`[${c}, ${h}]`).else(),e.if(u,()=>{e.assign(a,!0),e.assign(c,h),_&&t.mergeEvaluated(_,nr.Name)})})}o(d,"validateOneOf")}};Ls.default=Jd});var ki=v(Gs=>{"use strict";f();Object.defineProperty(Gs,"__esModule",{value:!0});var Bd=R(),Wd={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((i,a)=>{if((0,Bd.alwaysValidSchema)(s,i))return;let c=t.subschema({keyword:"allOf",schemaProp:a},n);t.ok(n),t.mergeEvaluated(c)})}};Gs.default=Wd});var ji=v(Js=>{"use strict";f();Object.defineProperty(Js,"__esModule",{value:!0});var or=q(),Ii=R(),Qd={message:o(({params:t})=>(0,or.str)`must match "${t.ifClause}" schema`,"message"),params:o(({params:t})=>(0,or._)`{failingKeyword: ${t.ifClause}}`,"params")},Zd={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Qd,code(t){let{gen:e,parentSchema:r,it:s}=t;r.then===void 0&&r.else===void 0&&(0,Ii.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let n=qi(s,"then"),i=qi(s,"else");if(!n&&!i)return;let a=e.let("valid",!0),c=e.name("_valid");if(u(),t.reset(),n&&i){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(c,d("then",l),d("else",l))}else n?e.if(c,d("then")):e.if((0,or.not)(c),d("else"));t.pass(a,()=>t.error(!0));function u(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(l)}o(u,"validateIf");function d(l,h){return()=>{let _=t.subschema({keyword:l},c);e.assign(a,c),t.mergeValidEvaluated(_,a),h?e.assign(h,(0,or._)`${l}`):t.setParams({ifClause:l})}}o(d,"validateClause")}};function qi(t,e){let r=t.schema[e];return r!==void 0&&!(0,Ii.alwaysValidSchema)(t,r)}o(qi,"hasSchema");Js.default=Zd});var Ri=v(Bs=>{"use strict";f();Object.defineProperty(Bs,"__esModule",{value:!0});var Xd=R(),Yd={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Xd.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Bs.default=Yd});var Ti=v(Ws=>{"use strict";f();Object.defineProperty(Ws,"__esModule",{value:!0});var ef=js(),tf=ui(),rf=Rs(),sf=di(),nf=fi(),of=mi(),af=gi(),cf=Fs(),uf=vi(),lf=Si(),df=Pi(),ff=Ni(),hf=Oi(),pf=ki(),mf=ji(),yf=Ri();function gf(t=!1){let e=[df.default,ff.default,hf.default,pf.default,mf.default,yf.default,af.default,cf.default,of.default,uf.default,lf.default];return t?e.push(tf.default,sf.default):e.push(ef.default,rf.default),e.push(nf.default),e}o(gf,"getApplicator");Ws.default=gf});var Ci=v(Qs=>{"use strict";f();Object.defineProperty(Qs,"__esModule",{value:!0});var V=q(),_f={message:o(({schemaCode:t})=>(0,V.str)`must match format "${t}"`,"message"),params:o(({schemaCode:t})=>(0,V._)`{format: ${t}}`,"params")},$f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:_f,code(t,e){let{gen:r,data:s,$data:n,schema:i,schemaCode:a,it:c}=t,{opts:u,errSchemaPath:d,schemaEnv:l,self:h}=c;if(!u.validateFormats)return;n?_():g();function _(){let m=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),p=r.const("fDef",(0,V._)`${m}[${a}]`),y=r.let("fType"),$=r.let("format");r.if((0,V._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>r.assign(y,(0,V._)`${p}.type || "string"`).assign($,(0,V._)`${p}.validate`),()=>r.assign(y,(0,V._)`"string"`).assign($,p)),t.fail$data((0,V.or)(S(),P()));function S(){return u.strictSchema===!1?V.nil:(0,V._)`${a} && !${$}`}o(S,"unknownFmt");function P(){let A=l.$async?(0,V._)`(${p}.async ? await ${$}(${s}) : ${$}(${s}))`:(0,V._)`${$}(${s})`,N=(0,V._)`(typeof ${$} == "function" ? ${A} : ${$}.test(${s}))`;return(0,V._)`${$} && ${$} !== true && ${y} === ${e} && !${N}`}o(P,"invalidFmt")}o(_,"validate$DataFormat");function g(){let m=h.formats[i];if(!m){S();return}if(m===!0)return;let[p,y,$]=P(m);p===e&&t.pass(A());function S(){if(u.strictSchema===!1){h.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${i}" ignored in schema at path "${d}"`}}o(S,"unknownFormat");function P(N){let ce=N instanceof RegExp?(0,V.regexpCode)(N):u.code.formats?(0,V._)`${u.code.formats}${(0,V.getProperty)(i)}`:void 0,fe=r.scopeValue("formats",{key:i,ref:N,code:ce});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,V._)`${fe}.validate`]:["string",N,fe]}o(P,"getFormat");function A(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,V._)`await ${$}(${s})`}return typeof y=="function"?(0,V._)`${$}(${s})`:(0,V._)`${$}.test(${s})`}o(A,"validCondition")}o(g,"validateFormat")}};Qs.default=$f});var Ai=v(Zs=>{"use strict";f();Object.defineProperty(Zs,"__esModule",{value:!0});var vf=Ci(),wf=[vf.default];Zs.default=wf});var Di=v(Je=>{"use strict";f();Object.defineProperty(Je,"__esModule",{value:!0});Je.contentVocabulary=Je.metadataVocabulary=void 0;Je.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Je.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var xi=v(Xs=>{"use strict";f();Object.defineProperty(Xs,"__esModule",{value:!0});var bf=Lo(),Ef=oi(),Sf=Ti(),Pf=Ai(),Mi=Di(),Nf=[bf.default,Ef.default,(0,Sf.default)(),Pf.default,Mi.metadataVocabulary,Mi.contentVocabulary];Xs.default=Nf});var Vi=v(ir=>{"use strict";f();Object.defineProperty(ir,"__esModule",{value:!0});ir.DiscrError=void 0;var Fi;(function(t){t.Tag="tag",t.Mapping="mapping"})(Fi||(ir.DiscrError=Fi={}))});var Ui=v(en=>{"use strict";f();Object.defineProperty(en,"__esModule",{value:!0});var Be=q(),Ys=Vi(),zi=zt(),Of=ft(),kf=R(),qf={message:o(({params:{discrError:t,tagName:e}})=>t===Ys.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:o(({params:{discrError:t,tag:e,tagName:r}})=>(0,Be._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},If={keyword:"discriminator",type:"object",schemaType:"object",error:qf,code(t){let{gen:e,data:r,schema:s,parentSchema:n,it:i}=t,{oneOf:a}=n;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=s.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(s.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,Be._)`${r}${(0,Be.getProperty)(c)}`);e.if((0,Be._)`typeof ${d} == "string"`,()=>l(),()=>t.error(!1,{discrError:Ys.DiscrError.Tag,tag:d,tagName:c})),t.ok(u);function l(){let g=_();e.if(!1);for(let m in g)e.elseIf((0,Be._)`${d} === ${m}`),e.assign(u,h(g[m]));e.else(),t.error(!1,{discrError:Ys.DiscrError.Mapping,tag:d,tagName:c}),e.endIf()}o(l,"validateMapping");function h(g){let m=e.name("valid"),p=t.subschema({keyword:"oneOf",schemaProp:g},m);return t.mergeEvaluated(p,Be.Name),m}o(h,"applyTagSchema");function _(){var g;let m={},p=$(n),y=!0;for(let A=0;A<a.length;A++){let N=a[A];if(N?.$ref&&!(0,kf.schemaHasRulesButRef)(N,i.self.RULES)){let fe=N.$ref;if(N=zi.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,fe),N instanceof zi.SchemaEnv&&(N=N.schema),N===void 0)throw new Of.default(i.opts.uriResolver,i.baseId,fe)}let ce=(g=N?.properties)===null||g===void 0?void 0:g[c];if(typeof ce!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);y=y&&(p||$(N)),S(ce,A)}if(!y)throw new Error(`discriminator: "${c}" must be required`);return m;function $({required:A}){return Array.isArray(A)&&A.includes(c)}function S(A,N){if(A.const)P(A.const,N);else if(A.enum)for(let ce of A.enum)P(ce,N);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function P(A,N){if(typeof A!="string"||A in m)throw new Error(`discriminator: "${c}" values must be unique strings`);m[A]=N}}o(_,"getMapping")}};en.default=If});var Ki=v((iy,jf)=>{jf.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Ff=v((F,tn)=>{"use strict";f();Object.defineProperty(F,"__esModule",{value:!0});F.MissingRefError=F.ValidationError=F.CodeGen=F.Name=F.nil=F.stringify=F.str=F._=F.KeywordCxt=F.Ajv=void 0;var Rf=Fo(),Tf=xi(),Cf=Ui(),Hi=Ki(),Af=["/properties"],ar="http://json-schema.org/draft-07/schema",We=class extends Rf.default{static{o(this,"Ajv")}_addVocabularies(){super._addVocabularies(),Tf.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Cf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Hi,Af):Hi;this.addMetaSchema(e,ar,!1),this.refs["http://json-schema.org/schema"]=ar}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ar)?ar:void 0)}};F.Ajv=We;tn.exports=F=We;tn.exports.Ajv=We;Object.defineProperty(F,"__esModule",{value:!0});F.default=We;var Df=dt();Object.defineProperty(F,"KeywordCxt",{enumerable:!0,get:o(function(){return Df.KeywordCxt},"get")});var Qe=q();Object.defineProperty(F,"_",{enumerable:!0,get:o(function(){return Qe._},"get")});Object.defineProperty(F,"str",{enumerable:!0,get:o(function(){return Qe.str},"get")});Object.defineProperty(F,"stringify",{enumerable:!0,get:o(function(){return Qe.stringify},"get")});Object.defineProperty(F,"nil",{enumerable:!0,get:o(function(){return Qe.nil},"get")});Object.defineProperty(F,"Name",{enumerable:!0,get:o(function(){return Qe.Name},"get")});Object.defineProperty(F,"CodeGen",{enumerable:!0,get:o(function(){return Qe.CodeGen},"get")});var Mf=Ft();Object.defineProperty(F,"ValidationError",{enumerable:!0,get:o(function(){return Mf.default},"get")});var xf=ft();Object.defineProperty(F,"MissingRefError",{enumerable:!0,get:o(function(){return xf.default},"get")})});export{q as a,Ff as b};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-3IYW4GH7.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as $,b as I}from"./chunk-
|
|
3
|
+
import{a as $,b as I}from"./chunk-TXXDMCWB.js";import{s as T,t as C}from"./chunk-J4T3Y5M5.js";import{a as r,f as E}from"./chunk-XF4O72WE.js";E();import{spawn as k}from"node:child_process";import{writeFileSync as B}from"node:fs";import g from"node:fs/promises";import h from"node:os";import m from"node:path";import{stripVTControlCharacters as A}from"node:util";function z(t){return A(t)}r(z,"stripAnsi");async function J(t){try{return await g.access(t,g.constants.X_OK),!0}catch{return!1}}r(J,"isExecutable");async function Y(t){try{return(await g.stat(t)).isFile()}catch{return!1}}r(Y,"isFile");var M=["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR"];function O(t=process.env){return Object.fromEntries(Object.entries(t).filter(([e])=>!M.includes(e)))}r(O,"gitEnv");function D(){let t=[m.join(h.homedir(),".local","bin"),m.join(h.homedir(),".cargo","bin"),"/opt/homebrew/bin","/usr/local/bin","/usr/bin","/bin"],e=process.env.PATH?process.env.PATH.split(m.delimiter):[],o=[...new Set([...t,...e])].join(m.delimiter);return O({...process.env,PATH:o})}r(D,"childEnv");var y=r(()=>T("GH_BIN")||(C()?w("gh"):"gh"),"ghBin"),K=r(()=>process.env.CLAUDE_BIN||w("claude"),"fixtureClaudeBin"),Z=r(()=>process.env.CODEX_BIN||w("codex"),"fixtureCodexBin"),P=r(()=>T("DOCKER_BIN")||"docker","dockerBin");function x(t){return t==="gh"?y():t==="docker"?P():C()?t==="claude"?K():t==="kubectl"?w("kubectl"):t:t}r(x,"toolBin");var _=new Map;function w(t){let e=_.get(t);if(e)return e;let o=m.join(h.tmpdir(),`werkmeister-fixture-${t}-${process.pid}`);return B(o,`#!/bin/sh
|
|
4
4
|
echo "${t} called under WERKMEISTER_FIXTURE: $*" >&2
|
|
5
5
|
exit 1
|
|
6
6
|
`,{mode:493}),_.set(t,o),o}r(w,"fixtureStub");function tt(t,e,o=h.homedir()){return new Promise((i,u)=>{let n=k(x(t),e,{cwd:o,env:D(),stdio:["ignore","pipe","pipe"]}),c="",a="",p=setTimeout(()=>{n.kill("SIGKILL"),u(new I("The `claude` CLI timed out after 120s.",$))},12e4);n.stdout.on("data",s=>c+=s.toString()),n.stderr.on("data",s=>a+=s.toString()),n.on("error",s=>{clearTimeout(p),u(s)}),n.on("close",s=>{clearTimeout(p),i({stdout:c,stderr:a,code:s})})})}r(tt,"runCapture");function et(t){return`'${t.replace(/'/g,"'\\''")}'`}r(et,"shellQuote");E();import{spawn as G,spawnSync as U}from"node:child_process";var v=r((t,e)=>t[0]==="git"?O(e):e,"spawnEnv"),S=r(t=>t*Number(process.env.WERKMEISTER_TIMEOUT_SCALE||1)*1e3,"timeoutMs"),l=class extends Error{static{r(this,"ProcError")}status;stdout;stderr;cmd;code;constructor(e,o,i,u="",n="",c){super(e),this.name="ProcError",this.cmd=o,this.status=i,this.stdout=u,this.stderr=n,this.code=c}};function ut(t,e={}){let o=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(o[0]="pipe");let i=U(x(t[0]),t.slice(1),{cwd:e.cwd,env:v(t,e.env),input:e.input,timeout:e.timeout!==void 0?S(e.timeout):void 0,encoding:"utf8",stdio:o}),u=i.stdout??"",n=i.stderr??"";if(i.error){let a=i.error.code;throw a==="ETIMEDOUT"?new l(`Command timed out after ${e.timeout}s: ${t.join(" ")}`,t,i.status??-1,u,n,"ETIMEDOUT"):a==="ENOENT"?new l(`Command not found: ${t[0]}`,t,-1,u,n,"ENOENT"):new l(`Command failed to start: ${t.join(" ")} (${i.error.message})`,t,i.status??-1,u,n,a)}let c=i.status??-1;if(e.check&&c!==0)throw new l(`Command failed with exit code ${c}: ${t.join(" ")}`,t,c,u,n);return{status:c,stdout:u,stderr:n}}r(ut,"run");function ct(t,e={}){return new Promise((o,i)=>{let u=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(u[0]="pipe");let n=G(x(t[0]),t.slice(1),{cwd:e.cwd,env:v(t,e.env),stdio:u,signal:e.signal,timeout:e.timeout!==void 0?S(e.timeout):void 0}),c="",a="";n.stdout?.on("data",d=>c+=d.toString()),n.stderr?.on("data",d=>a+=d.toString()),e.input!==void 0&&n.stdin?.end(e.input);let p=!1,s=r((d,f,b)=>{p||(p=!0,i(new l(d,t,f,c,a,b)))},"fail"),N=r(d=>{p||(p=!0,o({status:d,stdout:c,stderr:a}))},"done"),R=r(()=>e.signal?.aborted===!0,"aborted");n.on("error",d=>{let f=d.code;if(R()){s(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(f==="ENOENT"){s(`Command not found: ${t[0]}`,-1,"ENOENT");return}s(`Command failed to start: ${t.join(" ")} (${d.message})`,-1,f)}),n.on("close",d=>{if(R()){s(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(n.killed&&e.timeout!==void 0){s(`Command timed out after ${e.timeout}s: ${t.join(" ")}`,-1,"ETIMEDOUT");return}let f=d??-1;if(e.check&&f!==0){s(`Command failed with exit code ${f}: ${t.join(" ")}`,f);return}N(f)})})}r(ct,"runAsync");export{z as a,J as b,Y as c,O as d,D as e,y as f,K as g,Z as h,x as i,tt as j,et as k,l,ut as m,ct as n};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-5E6TBEKS.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as N,b as F,f as J}from"./chunk-
|
|
3
|
+
import{a as N,b as F,f as J}from"./chunk-RAIBCJC6.js";import{c as V,d as X,e as Y,g as K,j as Q}from"./chunk-7WWXRFDJ.js";import{N as ee,O as te,u as Z}from"./chunk-LXREE532.js";import{a as A,b as re}from"./chunk-IFURHJUW.js";import{ca as oe}from"./chunk-MSBPGE5M.js";import{r as q}from"./chunk-VVBFEHYG.js";import{D as z,S as G}from"./chunk-J4T3Y5M5.js";import{a as l,f as E}from"./chunk-XF4O72WE.js";E();import*as ne from"node:fs";import*as ae from"node:path";E();function se(t){let n=t.url?`[${t.ref}](${t.url})`:t.ref,i=t.title?`: ${t.title}`:"",a=t.fetchedAt?`Copy taken ${t.fetchedAt.slice(0,10)}: \`.werkmeister/issue.md\`.`:"No stored copy; run `werkmeister workspace init --refresh-issue`.";return["## Issue","",`${n}${i}. ${a}`,"Before each stage, re-read the live issue for newer direction: `werkmeister issue view`","Its status moves by itself (In Progress \u2192 In Review \u2192 Done): `docs/workspace-lifecycle.md` \xA7 Issue status in the werkmeister repo.",""].join(`
|
|
4
4
|
`)}l(se,"renderIssueRef");function ye(t){try{let n=q(),i=A(void 0,n),a=t.find(r=>i[r]?.hostname),o=a?i[a].hostname:Object.values(i).map(r=>r.hostname).filter(Boolean).sort()[0];return o?{host:o,domain:n.local_domain.replace(/^\.+/,"")}:null}catch{return null}}l(ye,"resolveProxyHost");function H(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}l(H,"isDict");function ve(t,n,i){let a=[];for(let[o]of t){let r=!1;try{r=ne.statSync(ae.join(n,o,"CLAUDE.md")).isFile()}catch{}r&&a.push(`| Working in ${o} | ${o}/CLAUDE.md |`)}return i&&a.push("| Running or validating the change \u2014 test commands, how to validate, ports, lifecycle | .werkmeister/werkmeister-context.md |"),t.length>1&&a.push("| Cross-repo contract change | .werkmeister/notes/ (`contract` notes) |"),a.push("| Open or create a PR (including `/create-pr`), merge, close out | .werkmeister/pr-rules.md |"),a.length===0?"":`| Task | Read |
|
|
5
5
|
|------|------|
|
|
6
6
|
`+a.join(`
|
|
@@ -177,4 +177,4 @@ ${de}
|
|
|
177
177
|
${ue}${me}${pe}${fe}${D}${ke}${$e}${y||w?`## Troubleshooting
|
|
178
178
|
|
|
179
179
|
${y?"### Feature missing from `/__werkmeister` selector\n\nThe dropdown is populated from `~/.werkmeister/infra/proxy/features.json` (a static file served by Caddy), which is regenerated alongside the Caddyfile. It can drift from the live container labels (`com.werkmeister.feature` \u2014 the source of truth) if a slot is allocated without a proxy regen.\n\nDiagnose \u2014 compare what's labeled vs. what the UI shows:\n```bash\ndocker ps -a --filter label=com.werkmeister.feature --format '{{ .Label \"com.werkmeister.feature\" }}' | sort -u\njq '[.[].name]' \"$HOME/.werkmeister/infra/proxy/features.json\"\n```\n\nResync:\n```bash\nwerkmeister infra proxy-reload # regenerates Caddyfile + features.json, reloads Caddy\n```\n\n### Caddy returns `content-length: 0` but direct service hit works\n\nCaddy routing issue, not an app issue. Try `werkmeister infra proxy-reload` first; if Caddy is still misrouting, check `docker logs w9r-caddy --tail 50`.\n\n":""}${w?"### Containers expected per the table above are missing from `docker ps`\n\n`werkmeister feature up` may have partially failed. Re-run from the workspace root:\n```bash\nwerkmeister feature up # idempotent \u2014 starts missing containers\ndocker compose logs -f # watch startup if something crashes\n```\n":""}`:""}`}l(Fe,"buildSandboxContextMd");export{se as a,Ue as b,Ne as c,Fe as d};
|
|
180
|
-
//# sourceMappingURL=chunk-
|
|
180
|
+
//# sourceMappingURL=chunk-5FEUWFZU.js.map
|