werkmeister 0.94.0 → 0.94.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/{budget-6BEZP2MF.js → budget-FA5L3BHN.js} +2 -2
  2. package/dist/{cache-HK7TAPL5.js → cache-KR6NO2NM.js} +2 -2
  3. package/dist/{chunk-LM5RDTYV.js → chunk-2AGRPXQR.js} +2 -2
  4. package/dist/{chunk-QXRZGJ6P.js → chunk-2FWQM2EJ.js} +2 -2
  5. package/dist/{chunk-QWI55NYX.js → chunk-2LZ2JKBE.js} +2 -2
  6. package/dist/{chunk-AHI6JJ7M.js → chunk-2TCL57JK.js} +2 -2
  7. package/dist/{chunk-YUSN6ATL.js → chunk-3HAZOPUB.js} +2 -2
  8. package/dist/{chunk-76QOU4PO.js → chunk-526FRAP4.js} +2 -2
  9. package/dist/{chunk-YELLLMDI.js → chunk-54NAFRC6.js} +2 -2
  10. package/dist/{chunk-PLOU2ZRT.js → chunk-5VP2WWNJ.js} +2 -2
  11. package/dist/{chunk-IJQ2NP5F.js → chunk-5VVB6YC6.js} +2 -2
  12. package/dist/{chunk-XN5UHSRT.js → chunk-5WJHEJTT.js} +2 -2
  13. package/dist/{chunk-6RXTW4LU.js → chunk-6TPYQWQK.js} +2 -2
  14. package/dist/{chunk-XNHLRR2R.js → chunk-6U2SNX3K.js} +2 -2
  15. package/dist/{chunk-OMLAA2E2.js → chunk-73QKXDC6.js} +2 -2
  16. package/dist/{chunk-F4U3AMMH.js → chunk-7INXBU6Y.js} +2 -2
  17. package/dist/{chunk-FQEP2RZP.js → chunk-A5MAGECY.js} +2 -2
  18. package/dist/{chunk-JHM3QBJZ.js → chunk-A7IMVARC.js} +2 -2
  19. package/dist/{chunk-O242ZRGI.js → chunk-BHYVYHCK.js} +3 -3
  20. package/dist/{chunk-4TZAFRQL.js → chunk-BRV6D7JW.js} +2 -2
  21. package/dist/{chunk-74HXYLXD.js → chunk-BWUYKFIB.js} +2 -2
  22. package/dist/{chunk-4JHTEADK.js → chunk-DC6IOBVI.js} +3 -3
  23. package/dist/{chunk-RK6XWGTK.js → chunk-DLBTBJ3C.js} +2 -2
  24. package/dist/{chunk-HMFIRWVJ.js → chunk-E32KAXI5.js} +2 -2
  25. package/dist/{chunk-LULXY7J5.js → chunk-EYT7UYY3.js} +2 -2
  26. package/dist/{chunk-H6U67IB5.js → chunk-G5SA7ML4.js} +2 -2
  27. package/dist/{chunk-OBFA4YEN.js → chunk-GGZGYD5D.js} +2 -2
  28. package/dist/{chunk-SLVS2TAO.js → chunk-H77DNTBZ.js} +2 -2
  29. package/dist/chunk-I72TXKZT.js +4 -0
  30. package/dist/{chunk-7XABNR7Y.js → chunk-IHFYLDCB.js} +2 -2
  31. package/dist/{chunk-XHYIFBRR.js → chunk-IJSQZCXK.js} +18 -18
  32. package/dist/{chunk-IK7W2LBK.js → chunk-ITA7LRQI.js} +2 -2
  33. package/dist/{chunk-MZFVZCM3.js → chunk-IWHZ5X77.js} +2 -2
  34. package/dist/{chunk-CS3C6IZJ.js → chunk-K7T22QBW.js} +2 -2
  35. package/dist/{chunk-O22TMXNP.js → chunk-LQIICTKP.js} +2 -2
  36. package/dist/{chunk-QQPUGUBV.js → chunk-MGHS2MNT.js} +2 -2
  37. package/dist/{chunk-NOYTCS5B.js → chunk-MLM5746H.js} +2 -2
  38. package/dist/chunk-MLNPL4GQ.js +4 -0
  39. package/dist/{chunk-VU3APKHW.js → chunk-NELXXBDP.js} +2 -2
  40. package/dist/{chunk-AK3LSHFT.js → chunk-NV3B6JFY.js} +2 -2
  41. package/dist/{chunk-CYYGHFTA.js → chunk-O2KHHQ5F.js} +2 -2
  42. package/dist/{chunk-EGH4ZUSB.js → chunk-O6HU5JLN.js} +2 -2
  43. package/dist/{chunk-GINS7EJK.js → chunk-OG6IADS2.js} +2 -2
  44. package/dist/{chunk-MMZ3SFZC.js → chunk-OHEMSDGY.js} +2 -2
  45. package/dist/{chunk-MUSFS3P4.js → chunk-OURDTRZW.js} +2 -2
  46. package/dist/{chunk-ATGF4AVD.js → chunk-PLSBAHK3.js} +2 -2
  47. package/dist/{chunk-EFNV3TFI.js → chunk-PZOR2K2Q.js} +2 -2
  48. package/dist/{chunk-4DUMKXHS.js → chunk-QJPZTGT3.js} +2 -2
  49. package/dist/{chunk-N63S7XEN.js → chunk-RA3PYTPH.js} +2 -2
  50. package/dist/{chunk-CBDTSTWG.js → chunk-TXUUPRUV.js} +3 -3
  51. package/dist/{chunk-2XQ52RUU.js → chunk-TYU3RTXE.js} +2 -2
  52. package/dist/{chunk-QKNBTD2X.js → chunk-U2Z2X3T5.js} +2 -2
  53. package/dist/{chunk-XNPHA7HX.js → chunk-U5V4AE7H.js} +2 -2
  54. package/dist/{chunk-K2W4MAI7.js → chunk-UGFDU7XO.js} +2 -2
  55. package/dist/{chunk-SKXZCGUV.js → chunk-V2O67H4Z.js} +2 -2
  56. package/dist/{chunk-TAU7BRTN.js → chunk-VFOVT4JH.js} +49 -49
  57. package/dist/chunk-VSI2BYHR.js +84 -0
  58. package/dist/{chunk-TVYHBSWN.js → chunk-VWF2MQHQ.js} +2 -2
  59. package/dist/{chunk-XMMOB7QK.js → chunk-W6LFIOQM.js} +2 -2
  60. package/dist/{chunk-UPCRI3OW.js → chunk-WHU24JN3.js} +2 -2
  61. package/dist/{chunk-TBWHG3QY.js → chunk-WQARIBJE.js} +2 -2
  62. package/dist/{chunk-HPX7AYPN.js → chunk-X67Z7742.js} +2 -2
  63. package/dist/{chunk-IFSSMLFN.js → chunk-XC6H6SQW.js} +3 -3
  64. package/dist/{chunk-YH36XQ4K.js → chunk-XCBSJYK3.js} +2 -2
  65. package/dist/{chunk-XAXQJKLP.js → chunk-XW5MCVHV.js} +2 -2
  66. package/dist/{chunk-HLTNOAF7.js → chunk-XZPFZOFJ.js} +2 -2
  67. package/dist/{chunk-KPIXRVP2.js → chunk-YJATE7FY.js} +2 -2
  68. package/dist/clean-DYQA5JT2.js +8 -0
  69. package/dist/close_out-MZ6BRADH.js +8 -0
  70. package/dist/code-5JIGPUVB.js +4 -0
  71. package/dist/{config-KNTWG6EB.js → config-BVZW4KFS.js} +2 -2
  72. package/dist/{connect-C7JHA64B.js → connect-EDHF2L44.js} +2 -2
  73. package/dist/{daemon-XYZNTCAM.js → daemon-LASVYIJG.js} +2 -2
  74. package/dist/dashboard.js +1 -1
  75. package/dist/{detect-VL2VYCV3.js → detect-2MHDORKZ.js} +2 -2
  76. package/dist/{down-6JMGYWXR.js → down-B4XJIQVU.js} +3 -3
  77. package/dist/{fixture-NOVLAM5W.js → fixture-DIHUCKCG.js} +2 -2
  78. package/dist/form-cli.js +1 -1
  79. package/dist/hooks-HDMRXH5T.js +4 -0
  80. package/dist/{hooks_gen-IRFN64CG.js → hooks_gen-6EPZ5Y7T.js} +2 -2
  81. package/dist/infra-AAUCV5C7.js +4 -0
  82. package/dist/init_workspace-TGAY62Y5.js +4 -0
  83. package/dist/{intercept-NKFHJDSS.js → intercept-AR4IYK7O.js} +2 -2
  84. package/dist/{issue-E2EAVT4O.js → issue-J7SBKQKS.js} +2 -2
  85. package/dist/lib/agent_state.js +1 -1
  86. package/dist/lib/gate.js +1 -1
  87. package/dist/lib/pr_guard.js +1 -1
  88. package/dist/list_workspaces-JM5GZGEK.js +7 -0
  89. package/dist/logs-D45PN3OY.js +6 -0
  90. package/dist/main.js +3 -3
  91. package/dist/mcp-proxy.js +1 -1
  92. package/dist/mcp.js +1 -1
  93. package/dist/{migrate-IICFUXYU.js → migrate-DZRBSLUI.js} +2 -2
  94. package/dist/notes-NSW36EJH.js +4 -0
  95. package/dist/{open-AMNSPLO3.js → open-QCYAVZHQ.js} +2 -2
  96. package/dist/{optimize-PMP7P2UK.js → optimize-L3KQEJMH.js} +2 -2
  97. package/dist/pause-JQSIBAGY.js +4 -0
  98. package/dist/pr-HBB4GQPF.js +5 -0
  99. package/dist/proxy_reload-MPTY4LIS.js +6 -0
  100. package/dist/{registry-VQR3PCMJ.js → registry-YUTQAIMB.js} +2 -2
  101. package/dist/remove-KUSJWWF5.js +7 -0
  102. package/dist/remove_workspace-75PY3OCV.js +8 -0
  103. package/dist/restart-EC5GZC7A.js +8 -0
  104. package/dist/resume-UXEAYOM4.js +8 -0
  105. package/dist/{safari-OZQGP3ME.js → safari-ROMSPIMB.js} +2 -2
  106. package/dist/{sandbox-56EMTKOZ.js → sandbox-YSADRKUE.js} +2 -2
  107. package/dist/{services-QS75OCBZ.js → services-ZA65UCMG.js} +2 -2
  108. package/dist/{setup-MTWBDAIC.js → setup-GBKNJKEN.js} +2 -2
  109. package/dist/skills-OQF55QBA.js +4 -0
  110. package/dist/{slots-NHWJHL2S.js → slots-6AK4VMDY.js} +2 -2
  111. package/dist/{standards-UROAKPMD.js → standards-L2W5LZ2H.js} +2 -2
  112. package/dist/start_args-G46RQARY.js +4 -0
  113. package/dist/starting_prompt-NXHXAVAW.js +4 -0
  114. package/dist/stats-W76OCYHX.js +4 -0
  115. package/dist/{status-R7TOMOBL.js → status-67BZFRRL.js} +2 -2
  116. package/dist/{stop-QVCPCITU.js → stop-T657BPS6.js} +2 -2
  117. package/dist/{telepresence-7N3K5SSF.js → telepresence-GYBD5IRA.js} +2 -2
  118. package/dist/{test-ZN6SHWTT.js → test-XNI2YS6R.js} +2 -2
  119. package/dist/{tokens-2E2LG6YE.js → tokens-AWWWENVF.js} +2 -2
  120. package/dist/{up-L27S3JKI.js → up-XCO3TCQT.js} +3 -3
  121. package/dist/{v4-UWZ6HALV.js → v4-ODDHSICJ.js} +2 -2
  122. package/dist/wait_load-THVU4F2A.js +4 -0
  123. package/dist/werkmeister-workspaces.vsix +0 -0
  124. package/dist/{workspace-43VU3SGP.js → workspace-RO463CAQ.js} +2 -2
  125. package/package.json +3 -3
  126. package/dist/chunk-7WDBV2LF.js +0 -84
  127. package/dist/chunk-BZE7LPZS.js +0 -4
  128. package/dist/chunk-USB7XTDC.js +0 -4
  129. package/dist/clean-FAYXLB4Z.js +0 -8
  130. package/dist/close_out-6I75ESRZ.js +0 -8
  131. package/dist/code-WTWMNW37.js +0 -4
  132. package/dist/hooks-SDUAIWWN.js +0 -4
  133. package/dist/infra-HOVBHUMZ.js +0 -4
  134. package/dist/init_workspace-VX7OFHTK.js +0 -4
  135. package/dist/list_workspaces-BLHAGXCZ.js +0 -7
  136. package/dist/logs-AQYVO3CT.js +0 -6
  137. package/dist/notes-UPBD5LBR.js +0 -4
  138. package/dist/pause-VEEBLHN5.js +0 -4
  139. package/dist/pr-LWES6IYE.js +0 -5
  140. package/dist/proxy_reload-K7C6EHPH.js +0 -6
  141. package/dist/remove-4J2TWDTL.js +0 -7
  142. package/dist/remove_workspace-WBKG2WUL.js +0 -8
  143. package/dist/restart-7QZO6FO5.js +0 -8
  144. package/dist/resume-JKZXVXAV.js +0 -8
  145. package/dist/skills-CK4FAV74.js +0 -4
  146. package/dist/start_args-OS3YJM4I.js +0 -4
  147. package/dist/starting_prompt-JA4R4GAA.js +0 -4
  148. package/dist/stats-WG2ZTV53.js +0 -4
  149. package/dist/wait_load-WGNYRM67.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{d as v,m as L}from"./chunk-O242ZRGI.js";import"./chunk-VU3APKHW.js";import"./chunk-PLOU2ZRT.js";import"./chunk-IJQ2NP5F.js";import"./chunk-K2W4MAI7.js";import"./chunk-2XQ52RUU.js";import"./chunk-XHYIFBRR.js";import"./chunk-IK7W2LBK.js";import"./chunk-TAU7BRTN.js";import"./chunk-4DUMKXHS.js";import"./chunk-SLVS2TAO.js";import"./chunk-MUSFS3P4.js";import"./chunk-YELLLMDI.js";import"./chunk-USB7XTDC.js";import"./chunk-IFSSMLFN.js";import"./chunk-7WDBV2LF.js";import"./chunk-QXRZGJ6P.js";import"./chunk-OBFA4YEN.js";import{B as h,C as w,I as b,L as y,Q as k,v as f,w as $}from"./chunk-YH36XQ4K.js";import"./chunk-XMMOB7QK.js";import"./chunk-EGH4ZUSB.js";import"./chunk-QWI55NYX.js";import"./chunk-XNHLRR2R.js";import{p as d}from"./chunk-H6U67IB5.js";import"./chunk-HMFIRWVJ.js";import"./chunk-XAXQJKLP.js";import"./chunk-6RXTW4LU.js";import"./chunk-EFNV3TFI.js";import"./chunk-4TZAFRQL.js";import"./chunk-TVYHBSWN.js";import"./chunk-O22TMXNP.js";import{a as c,f as g}from"./chunk-KPIXRVP2.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-6BEZP2MF.js.map
3
+ import{d as v,m as L}from"./chunk-BHYVYHCK.js";import"./chunk-NELXXBDP.js";import"./chunk-5VP2WWNJ.js";import"./chunk-5VVB6YC6.js";import"./chunk-UGFDU7XO.js";import"./chunk-TYU3RTXE.js";import"./chunk-IJSQZCXK.js";import"./chunk-ITA7LRQI.js";import"./chunk-VFOVT4JH.js";import"./chunk-QJPZTGT3.js";import"./chunk-H77DNTBZ.js";import"./chunk-OURDTRZW.js";import"./chunk-54NAFRC6.js";import"./chunk-MLNPL4GQ.js";import"./chunk-XC6H6SQW.js";import"./chunk-VSI2BYHR.js";import"./chunk-2FWQM2EJ.js";import"./chunk-GGZGYD5D.js";import{B as h,C as w,I as b,L as y,Q as k,v as f,w as $}from"./chunk-XCBSJYK3.js";import"./chunk-W6LFIOQM.js";import"./chunk-O6HU5JLN.js";import"./chunk-2LZ2JKBE.js";import"./chunk-6U2SNX3K.js";import{p as d}from"./chunk-G5SA7ML4.js";import"./chunk-E32KAXI5.js";import"./chunk-XW5MCVHV.js";import"./chunk-6TPYQWQK.js";import"./chunk-PZOR2K2Q.js";import"./chunk-BRV6D7JW.js";import"./chunk-VWF2MQHQ.js";import"./chunk-LQIICTKP.js";import{a as c,f as g}from"./chunk-YJATE7FY.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-FA5L3BHN.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-BZE7LPZS.js";import{d as s}from"./chunk-4DUMKXHS.js";import"./chunk-USB7XTDC.js";import"./chunk-XMMOB7QK.js";import"./chunk-QWI55NYX.js";import"./chunk-4TZAFRQL.js";import{h as e,l as c}from"./chunk-TVYHBSWN.js";import"./chunk-O22TMXNP.js";import{a as r,f as i}from"./chunk-KPIXRVP2.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-HK7TAPL5.js.map
3
+ import"./chunk-I72TXKZT.js";import{d as s}from"./chunk-QJPZTGT3.js";import"./chunk-MLNPL4GQ.js";import"./chunk-W6LFIOQM.js";import"./chunk-2LZ2JKBE.js";import"./chunk-BRV6D7JW.js";import{h as e,l as c}from"./chunk-VWF2MQHQ.js";import"./chunk-LQIICTKP.js";import{a as r,f as i}from"./chunk-YJATE7FY.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-KR6NO2NM.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 M}from"./chunk-LULXY7J5.js";import{a as $,b as v,c as y,d as u,e as S}from"./chunk-RK6XWGTK.js";import{f as x}from"./chunk-XMMOB7QK.js";import{h as e,j as E,k as R,l as C}from"./chunk-TVYHBSWN.js";import{a as p,f as h}from"./chunk-KPIXRVP2.js";h();function T(n,t){if(Object.keys(n).length===0)return" No container data collected.";let a=[],o=` ${e.BOLD}${"Container".padEnd(35)} ${"Avg CPU".padStart(8)} ${"Max CPU".padStart(8)} ${"Avg Mem".padStart(8)} ${"Max Mem".padStart(8)} ${"Samples".padStart(7)} ${"CPU Lim".padStart(7)}${e.RESET}`;a.push(o),a.push(` ${"\u2500".repeat(94)}`);for(let r of Object.keys(n).sort()){let s=n[r];a.push(` ${r.padEnd(35)} ${s.avgCpu.toFixed(1).padStart(7)}% ${s.maxCpu.toFixed(1).padStart(7)}% ${$(s.avgMem).padStart(8)} ${$(s.maxMem).padStart(8)} ${String(s.samples).padStart(7)} ${(S(r,t)??"n/a").padStart(7)}`)}return a.join(`
3
+ import{a as M}from"./chunk-EYT7UYY3.js";import{a as $,b as v,c as y,d as u,e as S}from"./chunk-DLBTBJ3C.js";import{f as x}from"./chunk-W6LFIOQM.js";import{h as e,j as E,k as R,l as C}from"./chunk-VWF2MQHQ.js";import{a as p,f as h}from"./chunk-YJATE7FY.js";h();function T(n,t){if(Object.keys(n).length===0)return" No container data collected.";let a=[],o=` ${e.BOLD}${"Container".padEnd(35)} ${"Avg CPU".padStart(8)} ${"Max CPU".padStart(8)} ${"Avg Mem".padStart(8)} ${"Max Mem".padStart(8)} ${"Samples".padStart(7)} ${"CPU Lim".padStart(7)}${e.RESET}`;a.push(o),a.push(` ${"\u2500".repeat(94)}`);for(let r of Object.keys(n).sort()){let s=n[r];a.push(` ${r.padEnd(35)} ${s.avgCpu.toFixed(1).padStart(7)}% ${s.maxCpu.toFixed(1).padStart(7)}% ${$(s.avgMem).padStart(8)} ${$(s.maxMem).padStart(8)} ${String(s.samples).padStart(7)} ${(S(r,t)??"n/a").padStart(7)}`)}return a.join(`
4
4
  `)}p(T,"formatStatsTable");function O(n){if(n.length===0)return" No recommendations available (no data collected).";let t=[],a=` ${e.BOLD}${"Container".padEnd(35)} ${"Max CPU".padStart(8)} ${"Max Mem".padStart(8)} ${"Rec. CPU".padStart(9)} ${"Rec. Mem".padStart(9)} ${"Rec. Rsrv".padStart(9)}${e.RESET}`;t.push(a),t.push(` ${"\u2500".repeat(90)}`);for(let o of n)t.push(` ${o.name.padEnd(35)} ${o.max_cpu_pct.toFixed(1).padStart(7)}% ${$(o.max_mem_mib).padStart(8)} ${o.recommended_cpus.padStart(9)} ${o.recommended_memory.padStart(9)} ${o.recommended_reservation.padStart(9)}`);t.push(""),t.push(` ${e.BOLD}YAML Snippets:${e.RESET}`),t.push("");for(let o of n)t.push(` # ${o.name}`),t.push(" deploy:"),t.push(" resources:"),t.push(" limits:"),t.push(` cpus: "${o.recommended_cpus}"`),t.push(` memory: ${o.recommended_memory}`),t.push(" reservations:"),t.push(` cpus: "${v(o.recommended_cpus)}"`),t.push(` memory: ${o.recommended_reservation}`),t.push("");return t.join(`
5
5
  `)}p(O,"formatRecommendations");async function k(n){let t=n.collect??0,a=n.interval??10,o=!!n.save;console.log(`
6
6
  ${e.BOLD}=== Docker Resource Usage ===${e.RESET}
@@ -10,4 +10,4 @@ ${e.BOLD}--- Collected Statistics ---${e.RESET}
10
10
  `),console.log(T(r.stats,u())),console.log(`
11
11
  ${e.BOLD}--- Recommended Resource Limits ---${e.RESET}
12
12
  `),console.log(O(r.recommendations)),r.reportPath?R(`Report saved to: ${r.reportPath}`):a||console.log(` ${e.DIM}Tip: Use --save to write results to stats/ directory${e.RESET}`),console.log())}p(D,"renderCollection");function f(n){return n>=1024?`${(n/1024).toFixed(1)} GiB`:n>=1?`${n.toFixed(0)} MiB`:`${(n*1024).toFixed(0)} KiB`}p(f,"fmtMem");export{k as a,f as b};
13
- //# sourceMappingURL=chunk-LM5RDTYV.js.map
13
+ //# sourceMappingURL=chunk-2AGRPXQR.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{x as $}from"./chunk-TVYHBSWN.js";import{a,f as y}from"./chunk-KPIXRVP2.js";y();var j=new Set(["PASTE_TOKEN_HERE","<your-atlassian-login-email>","https://your-org.atlassian.net"]),d=a(e=>j.has(e.trim().replace(/\/+$/,"")),"isJiraPlaceholder");function h(e,t,s){let n=e.trim();for(;n.endsWith("/");)n=n.slice(0,-1);return!n||!t||!s||d(n)||d(t)||d(s)?null:{baseUrl:n,email:t,token:s}}a(h,"normalizeCreds");async function u(){let e=h(process.env.JIRA_BASE_URL??"",process.env.JIRA_EMAIL??"",process.env.JIRA_API_TOKEN??"");if(e)return e;try{let t=$().jira??{};return h(String(t.base_url??""),String(t.email??""),String(t.api_token??""))}catch{return null}}a(u,"jiraCreds");async function f(e,t,s){let n=await fetch(`${e.baseUrl}${t}`,{method:s===void 0?"GET":"POST",headers:{Authorization:"Basic "+Buffer.from(`${e.email}:${e.token}`).toString("base64"),Accept:"application/json",...s===void 0?{}:{"Content-Type":"application/json"}},body:s===void 0?void 0:JSON.stringify(s),signal:AbortSignal.timeout(1e4)});if(!n.ok){let o=(await n.text().catch(()=>"")).trim().slice(0,500);throw new Error(`Jira REST ${t} \u2192 HTTP ${n.status}${o?`: ${o}`:""}`)}return n}a(f,"jiraFetch");async function S(){let e=await u();if(!e)return null;let s=await(await f(e,"/rest/api/3/myself")).json();return{who:s.emailAddress??s.displayName??e.email}}a(S,"jiraMyself");async function l(e,t){return await(await f(e,t)).json()}a(l,"jiraGet");var C="summary,description,status,issuetype,assignee,comment";async function T(e,t){let s=await u();if(!s)return t?.push("no Jira REST credentials"),null;try{return await l(s,`/rest/api/2/issue/${encodeURIComponent(e)}?fields=${C}`)}catch(n){return t?.push(E(n)),null}}a(T,"fetchIssueRest");function E(e){let t=e;if(t.message?.startsWith("Jira REST "))return t.message;let s=t.cause?.code??t.cause?.message;return`Jira REST: ${t.message}${s?` (${s})`:""}`}a(E,"restFailure");async function A(e){if(!e.length)return{};let t=await u();if(!t)return null;let s=encodeURIComponent(`key in (${e.join(",")})`);try{let n=await l(t,`/rest/api/2/search/jql?jql=${s}&fields=status&maxResults=100`),o={};for(let r of n.issues??[]){let c=r.fields?.status?.name;r.key&&c&&(o[r.key.toUpperCase()]=c)}return o}catch{return null}}a(A,"fetchStatusesRest");var R="fields=summary,status&maxResults=100";async function b(e){let t=await u();return t?(await l(t,`/rest/api/2/search/jql?jql=${encodeURIComponent(e)}&${R}`)).issues??[]:null}a(b,"searchIssuesRest");async function L(e,t){let s=await u();if(!s)return null;let n=encodeURIComponent(e),{columnConfig:o}=await l(s,`/rest/agile/1.0/board/${n}/configuration`),r=o?.columns??[],c=r.find(p=>p.name?.toLowerCase()===t.toLowerCase());if(!c)throw new Error(`board ${e} has no "${t}" column (it has: ${r.map(p=>p.name).join(", ")})`);let i=(c.statuses??[]).flatMap(p=>p.id?[p.id]:[]);if(!i.length)return[];let m=encodeURIComponent(`status in (${i.join(",")})`);return(await l(s,`/rest/agile/1.0/board/${n}/issue?jql=${m}&${R}`)).issues??[]}a(L,"boardColumnRest");async function x(e){let t=await u();if(!t)return null;let s=encodeURIComponent(e.project),{issueTypes:n=[]}=await l(t,`/rest/api/2/issue/createmeta/${s}/issuetypes`),o=a(m=>n.some(w=>w.name?.toLowerCase()===m.toLowerCase()),"has"),r=o(e.issueType)||!o("Task")?e.issueType:"Task",c=await f(t,"/rest/api/2/issue",{fields:{project:{key:e.project},issuetype:{name:r},summary:e.summary,description:e.description,...r===e.issueType?{}:{labels:[e.fallbackLabel]}}}),{key:i}=await c.json();return{key:i,url:`${t.baseUrl}/browse/${i}`,issueType:r}}a(x,"createIssueRest");async function U(e,t){let s=await u();return s?(await f(s,"/rest/api/2/issueLink",{type:{name:"Relates"},inwardIssue:{key:e},outwardIssue:{key:t}}),!0):null}a(U,"linkIssueRest");async function _(e,t){let s=await u();if(!s)return null;let n=`/rest/api/2/issue/${encodeURIComponent(e)}`;if(t.status){let o=t.status.trim().toLowerCase(),{transitions:r=[]}=await l(s,`${n}/transitions`),c=r.find(i=>i.to?.name?.toLowerCase()===o)??r.find(i=>i.name?.toLowerCase()===o);if(!c){let i=r.map(m=>m.to?.name??m.name).filter(Boolean).join(", ");throw new Error(`${e} has no transition to "${t.status}" (available: ${i||"none"})`)}await f(s,`${n}/transitions`,{transition:{id:c.id}})}return t.comment&&await f(s,`${n}/comment`,{body:t.comment}),!0}a(_,"updateIssueRest");export{j as a,d as b,S as c,T as d,A as e,b as f,L as g,x as h,U as i,_ as j};
4
- //# sourceMappingURL=chunk-QXRZGJ6P.js.map
3
+ import{x as $}from"./chunk-VWF2MQHQ.js";import{a,f as y}from"./chunk-YJATE7FY.js";y();var j=new Set(["PASTE_TOKEN_HERE","<your-atlassian-login-email>","https://your-org.atlassian.net"]),d=a(e=>j.has(e.trim().replace(/\/+$/,"")),"isJiraPlaceholder");function h(e,t,s){let n=e.trim();for(;n.endsWith("/");)n=n.slice(0,-1);return!n||!t||!s||d(n)||d(t)||d(s)?null:{baseUrl:n,email:t,token:s}}a(h,"normalizeCreds");async function u(){let e=h(process.env.JIRA_BASE_URL??"",process.env.JIRA_EMAIL??"",process.env.JIRA_API_TOKEN??"");if(e)return e;try{let t=$().jira??{};return h(String(t.base_url??""),String(t.email??""),String(t.api_token??""))}catch{return null}}a(u,"jiraCreds");async function f(e,t,s){let n=await fetch(`${e.baseUrl}${t}`,{method:s===void 0?"GET":"POST",headers:{Authorization:"Basic "+Buffer.from(`${e.email}:${e.token}`).toString("base64"),Accept:"application/json",...s===void 0?{}:{"Content-Type":"application/json"}},body:s===void 0?void 0:JSON.stringify(s),signal:AbortSignal.timeout(1e4)});if(!n.ok){let o=(await n.text().catch(()=>"")).trim().slice(0,500);throw new Error(`Jira REST ${t} \u2192 HTTP ${n.status}${o?`: ${o}`:""}`)}return n}a(f,"jiraFetch");async function S(){let e=await u();if(!e)return null;let s=await(await f(e,"/rest/api/3/myself")).json();return{who:s.emailAddress??s.displayName??e.email}}a(S,"jiraMyself");async function l(e,t){return await(await f(e,t)).json()}a(l,"jiraGet");var C="summary,description,status,issuetype,assignee,comment";async function T(e,t){let s=await u();if(!s)return t?.push("no Jira REST credentials"),null;try{return await l(s,`/rest/api/2/issue/${encodeURIComponent(e)}?fields=${C}`)}catch(n){return t?.push(E(n)),null}}a(T,"fetchIssueRest");function E(e){let t=e;if(t.message?.startsWith("Jira REST "))return t.message;let s=t.cause?.code??t.cause?.message;return`Jira REST: ${t.message}${s?` (${s})`:""}`}a(E,"restFailure");async function A(e){if(!e.length)return{};let t=await u();if(!t)return null;let s=encodeURIComponent(`key in (${e.join(",")})`);try{let n=await l(t,`/rest/api/2/search/jql?jql=${s}&fields=status&maxResults=100`),o={};for(let r of n.issues??[]){let c=r.fields?.status?.name;r.key&&c&&(o[r.key.toUpperCase()]=c)}return o}catch{return null}}a(A,"fetchStatusesRest");var R="fields=summary,status&maxResults=100";async function b(e){let t=await u();return t?(await l(t,`/rest/api/2/search/jql?jql=${encodeURIComponent(e)}&${R}`)).issues??[]:null}a(b,"searchIssuesRest");async function L(e,t){let s=await u();if(!s)return null;let n=encodeURIComponent(e),{columnConfig:o}=await l(s,`/rest/agile/1.0/board/${n}/configuration`),r=o?.columns??[],c=r.find(p=>p.name?.toLowerCase()===t.toLowerCase());if(!c)throw new Error(`board ${e} has no "${t}" column (it has: ${r.map(p=>p.name).join(", ")})`);let i=(c.statuses??[]).flatMap(p=>p.id?[p.id]:[]);if(!i.length)return[];let m=encodeURIComponent(`status in (${i.join(",")})`);return(await l(s,`/rest/agile/1.0/board/${n}/issue?jql=${m}&${R}`)).issues??[]}a(L,"boardColumnRest");async function x(e){let t=await u();if(!t)return null;let s=encodeURIComponent(e.project),{issueTypes:n=[]}=await l(t,`/rest/api/2/issue/createmeta/${s}/issuetypes`),o=a(m=>n.some(w=>w.name?.toLowerCase()===m.toLowerCase()),"has"),r=o(e.issueType)||!o("Task")?e.issueType:"Task",c=await f(t,"/rest/api/2/issue",{fields:{project:{key:e.project},issuetype:{name:r},summary:e.summary,description:e.description,...r===e.issueType?{}:{labels:[e.fallbackLabel]}}}),{key:i}=await c.json();return{key:i,url:`${t.baseUrl}/browse/${i}`,issueType:r}}a(x,"createIssueRest");async function U(e,t){let s=await u();return s?(await f(s,"/rest/api/2/issueLink",{type:{name:"Relates"},inwardIssue:{key:e},outwardIssue:{key:t}}),!0):null}a(U,"linkIssueRest");async function _(e,t){let s=await u();if(!s)return null;let n=`/rest/api/2/issue/${encodeURIComponent(e)}`;if(t.status){let o=t.status.trim().toLowerCase(),{transitions:r=[]}=await l(s,`${n}/transitions`),c=r.find(i=>i.to?.name?.toLowerCase()===o)??r.find(i=>i.name?.toLowerCase()===o);if(!c){let i=r.map(m=>m.to?.name??m.name).filter(Boolean).join(", ");throw new Error(`${e} has no transition to "${t.status}" (available: ${i||"none"})`)}await f(s,`${n}/transitions`,{transition:{id:c.id}})}return t.comment&&await f(s,`${n}/comment`,{body:t.comment}),!0}a(_,"updateIssueRest");export{j as a,d as b,S as c,T as d,A as e,b as f,L as g,x as h,U as i,_ as j};
4
+ //# sourceMappingURL=chunk-2FWQM2EJ.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 I,b as _}from"./chunk-4TZAFRQL.js";import{s as C,t as g}from"./chunk-TVYHBSWN.js";import{a as r,f as h}from"./chunk-KPIXRVP2.js";h();import{spawn as B}from"node:child_process";import{writeFileSync as A}from"node:fs";import O from"node:fs/promises";import T from"node:os";import E from"node:path";import{stripVTControlCharacters as M}from"node:util";function J(t){return M(t)}r(J,"stripAnsi");async function Y(t){try{return await O.access(t,O.constants.X_OK),!0}catch{return!1}}r(Y,"isExecutable");async function Z(t){try{return(await O.stat(t)).isFile()}catch{return!1}}r(Z,"isFile");var D=["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR"];function R(t=process.env){return Object.fromEntries(Object.entries(t).filter(([e])=>!D.includes(e)))}r(R,"gitEnv");function y(){let t=[E.join(T.homedir(),".local","bin"),E.join(T.homedir(),".cargo","bin"),"/opt/homebrew/bin","/usr/local/bin","/usr/bin","/bin"],e=process.env.PATH?process.env.PATH.split(E.delimiter):[],o=[...new Set([...t,...e])].join(E.delimiter);return R({...process.env,PATH:o})}r(y,"childEnv");var K=r(()=>C("GH_BIN")||(g()?w("gh"):"gh"),"ghBin"),P=r(()=>process.env.CLAUDE_BIN||w("claude"),"fixtureClaudeBin"),tt=r(()=>process.env.CODEX_BIN||w("codex"),"fixtureCodexBin"),G=r(()=>C("DOCKER_BIN")||"docker","dockerBin");function x(t){return t==="gh"?K():t==="docker"?G():g()?t==="claude"?P():t==="kubectl"?w("kubectl"):t:t}r(x,"toolBin");var v=new Map;function w(t){let e=v.get(t);if(e)return e;let o=E.join(T.tmpdir(),`werkmeister-fixture-${t}-${process.pid}`);return A(o,`#!/bin/sh
3
+ import{a as I,b as _}from"./chunk-BRV6D7JW.js";import{s as C,t as g}from"./chunk-VWF2MQHQ.js";import{a as r,f as h}from"./chunk-YJATE7FY.js";h();import{spawn as B}from"node:child_process";import{writeFileSync as A}from"node:fs";import O from"node:fs/promises";import T from"node:os";import E from"node:path";import{stripVTControlCharacters as M}from"node:util";function J(t){return M(t)}r(J,"stripAnsi");async function Y(t){try{return await O.access(t,O.constants.X_OK),!0}catch{return!1}}r(Y,"isExecutable");async function Z(t){try{return(await O.stat(t)).isFile()}catch{return!1}}r(Z,"isFile");var D=["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR"];function R(t=process.env){return Object.fromEntries(Object.entries(t).filter(([e])=>!D.includes(e)))}r(R,"gitEnv");function y(){let t=[E.join(T.homedir(),".local","bin"),E.join(T.homedir(),".cargo","bin"),"/opt/homebrew/bin","/usr/local/bin","/usr/bin","/bin"],e=process.env.PATH?process.env.PATH.split(E.delimiter):[],o=[...new Set([...t,...e])].join(E.delimiter);return R({...process.env,PATH:o})}r(y,"childEnv");var K=r(()=>C("GH_BIN")||(g()?w("gh"):"gh"),"ghBin"),P=r(()=>process.env.CLAUDE_BIN||w("claude"),"fixtureClaudeBin"),tt=r(()=>process.env.CODEX_BIN||w("codex"),"fixtureCodexBin"),G=r(()=>C("DOCKER_BIN")||"docker","dockerBin");function x(t){return t==="gh"?K():t==="docker"?G():g()?t==="claude"?P():t==="kubectl"?w("kubectl"):t:t}r(x,"toolBin");var v=new Map;function w(t){let e=v.get(t);if(e)return e;let o=E.join(T.tmpdir(),`werkmeister-fixture-${t}-${process.pid}`);return A(o,`#!/bin/sh
4
4
  echo "${t} called under WERKMEISTER_FIXTURE: $*" >&2
5
5
  exit 1
6
6
  `,{mode:493}),v.set(t,o),o}r(w,"fixtureStub");function et(t,e,o=T.homedir()){return new Promise((i,s)=>{let n=B(x(t),e,{cwd:o,env:y(),stdio:["ignore","pipe","pipe"]}),u="",a="",m=setTimeout(()=>{n.kill("SIGKILL"),s(new _("The `claude` CLI timed out after 120s.",I))},12e4);n.stdout.on("data",c=>u+=c.toString()),n.stderr.on("data",c=>a+=c.toString()),n.on("error",c=>{clearTimeout(m),s(c)}),n.on("close",c=>{clearTimeout(m),i({stdout:u,stderr:a,code:c})})})}r(et,"runCapture");function rt(t){return`'${t.replace(/'/g,"'\\''")}'`}r(rt,"shellQuote");h();import{spawn as U,spawnSync as F}from"node:child_process";var S=r((t,e)=>t[0]==="git"?R(e):e,"spawnEnv"),N=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,s="",n="",u){super(e),this.name="ProcError",this.cmd=o,this.status=i,this.stdout=s,this.stderr=n,this.code=u}};function ct(t,e={}){let o=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(o[0]="pipe");let i=F(x(t[0]),t.slice(1),{cwd:e.cwd,env:S(t,e.env),input:e.input,timeout:e.timeout!==void 0?N(e.timeout):void 0,encoding:"utf8",stdio:o}),s=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,s,n,"ETIMEDOUT"):a==="ENOENT"?new l(`Command not found: ${t[0]}`,t,-1,s,n,"ENOENT"):new l(`Command failed to start: ${t.join(" ")} (${i.error.message})`,t,i.status??-1,s,n,a)}let u=i.status??-1;if(e.check&&u!==0)throw new l(`Command failed with exit code ${u}: ${t.join(" ")}`,t,u,s,n);return{status:u,stdout:s,stderr:n}}r(ct,"run");function dt(t,e={}){return new Promise((o,i)=>{let s=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(s[0]="pipe");let n=U(x(t[0]),t.slice(1),{cwd:e.cwd,env:S(t,e.env),stdio:s,signal:e.signal}),u=e.timeout!==void 0?setTimeout(()=>n.kill(),N(e.timeout)):void 0,a="",m="";n.stdout?.on("data",d=>a+=d.toString()),n.stderr?.on("data",d=>m+=d.toString()),e.input!==void 0&&n.stdin?.end(e.input);let c=!1,p=r((d,f,j)=>{c||(c=!0,i(new l(d,t,f,a,m,j)))},"fail"),b=r(d=>{c||(c=!0,o({status:d,stdout:a,stderr:m}))},"done"),$=r(()=>e.signal?.aborted===!0,"aborted");n.on("error",d=>{clearTimeout(u);let f=d.code;if($()){p(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(f==="ENOENT"){p(`Command not found: ${t[0]}`,-1,"ENOENT");return}p(`Command failed to start: ${t.join(" ")} (${d.message})`,-1,f)}),n.on("close",d=>{if(clearTimeout(u),$()){p(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(n.killed&&e.timeout!==void 0){p(`Command timed out after ${e.timeout}s: ${t.join(" ")}`,-1,"ETIMEDOUT");return}let f=d??-1;if(e.check&&f!==0){p(`Command failed with exit code ${f}: ${t.join(" ")}`,f);return}b(f)})})}r(dt,"runAsync");export{J as a,Y as b,Z as c,R as d,y as e,K as f,P as g,tt as h,x as i,et as j,rt as k,l,ct as m,dt as n};
7
- //# sourceMappingURL=chunk-QWI55NYX.js.map
7
+ //# sourceMappingURL=chunk-2LZ2JKBE.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 w,f as u}from"./chunk-KPIXRVP2.js";var $=w(s=>{"use strict";u();var y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,c=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,E=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,v=/\\([\u000b\u0020-\u00ff])/g,h=/([\\"])/g,d=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;s.format=g;s.parse=T;function g(r){if(!r||typeof r!="object")throw new TypeError("argument obj is required");var e=r.parameters,t=r.type;if(!t||!d.test(t))throw new TypeError("invalid type");var f=t;if(e&&typeof e=="object")for(var a,p=Object.keys(e).sort(),n=0;n<p.length;n++){if(a=p[n],!E.test(a))throw new TypeError("invalid parameter name");f+="; "+a+"="+m(e[a])}return f}o(g,"format");function T(r){if(!r)throw new TypeError("argument string is required");var e=typeof r=="object"?l(r):r;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var t=e.indexOf(";"),f=t!==-1?e.slice(0,t).trim():e.trim();if(!d.test(f))throw new TypeError("invalid media type");var a=new _(f.toLowerCase());if(t!==-1){var p,n,i;for(y.lastIndex=t;n=y.exec(e);){if(n.index!==t)throw new TypeError("invalid parameter format");t+=n[0].length,p=n[1].toLowerCase(),i=n[2],i.charCodeAt(0)===34&&(i=i.slice(1,-1),i.indexOf("\\")!==-1&&(i=i.replace(v,"$1"))),a.parameters[p]=i}if(t!==e.length)throw new TypeError("invalid parameter format")}return a}o(T,"parse");function l(r){var e;if(typeof r.getHeader=="function"?e=r.getHeader("content-type"):typeof r.headers=="object"&&(e=r.headers&&r.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}o(l,"getcontenttype");function m(r){var e=String(r);if(E.test(e))return e;if(e.length>0&&!c.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(h,"\\$1")+'"'}o(m,"qstring");function _(r){this.parameters=Object.create(null),this.type=r}o(_,"ContentType")});export{$ as a};
3
+ import{a as o,c as w,f as u}from"./chunk-YJATE7FY.js";var $=w(s=>{"use strict";u();var y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,c=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,E=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,v=/\\([\u000b\u0020-\u00ff])/g,h=/([\\"])/g,d=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;s.format=g;s.parse=T;function g(r){if(!r||typeof r!="object")throw new TypeError("argument obj is required");var e=r.parameters,t=r.type;if(!t||!d.test(t))throw new TypeError("invalid type");var f=t;if(e&&typeof e=="object")for(var a,p=Object.keys(e).sort(),n=0;n<p.length;n++){if(a=p[n],!E.test(a))throw new TypeError("invalid parameter name");f+="; "+a+"="+m(e[a])}return f}o(g,"format");function T(r){if(!r)throw new TypeError("argument string is required");var e=typeof r=="object"?l(r):r;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var t=e.indexOf(";"),f=t!==-1?e.slice(0,t).trim():e.trim();if(!d.test(f))throw new TypeError("invalid media type");var a=new _(f.toLowerCase());if(t!==-1){var p,n,i;for(y.lastIndex=t;n=y.exec(e);){if(n.index!==t)throw new TypeError("invalid parameter format");t+=n[0].length,p=n[1].toLowerCase(),i=n[2],i.charCodeAt(0)===34&&(i=i.slice(1,-1),i.indexOf("\\")!==-1&&(i=i.replace(v,"$1"))),a.parameters[p]=i}if(t!==e.length)throw new TypeError("invalid parameter format")}return a}o(T,"parse");function l(r){var e;if(typeof r.getHeader=="function"?e=r.getHeader("content-type"):typeof r.headers=="object"&&(e=r.headers&&r.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}o(l,"getcontenttype");function m(r){var e=String(r);if(E.test(e))return e;if(e.length>0&&!c.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(h,"\\$1")+'"'}o(m,"qstring");function _(r){this.parameters=Object.create(null),this.type=r}o(_,"ContentType")});export{$ as a};
4
4
  /*! Bundled license information:
5
5
 
6
6
  content-type/index.js:
@@ -10,4 +10,4 @@ content-type/index.js:
10
10
  * MIT Licensed
11
11
  *)
12
12
  */
13
- //# sourceMappingURL=chunk-AHI6JJ7M.js.map
13
+ //# sourceMappingURL=chunk-2TCL57JK.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{d as rt}from"./chunk-GINS7EJK.js";import{a as Xe,c as M,d as Ze,f as et,h as tt}from"./chunk-QQPUGUBV.js";import{d as Qe,o as qe}from"./chunk-PLOU2ZRT.js";import{b as ze,c as ce,g as ae,h as Je,i as fe,j as Ye}from"./chunk-IJQ2NP5F.js";import{r as se,s as ie,u as Ke}from"./chunk-2XQ52RUU.js";import{c as ne,d as Pe}from"./chunk-XHYIFBRR.js";import{c as Te}from"./chunk-SLVS2TAO.js";import{o as Oe}from"./chunk-MUSFS3P4.js";import{h as je}from"./chunk-YELLLMDI.js";import{k as Ae}from"./chunk-USB7XTDC.js";import{A as Ne,B as Fe,G as te,H as Me,J as z,L as re,O as Ue,S as Le,T as oe,i as We,o as j,p as Ie,x as De,z as ee}from"./chunk-IFSSMLFN.js";import{b as He,e as Be,g as Ve}from"./chunk-YH36XQ4K.js";import{a as B}from"./chunk-EGH4ZUSB.js";import{m as K}from"./chunk-QWI55NYX.js";import{a as Ge}from"./chunk-XNHLRR2R.js";import{b as be}from"./chunk-XAXQJKLP.js";import{b as Re,c as Ce}from"./chunk-6RXTW4LU.js";import{o as _e,p as Z,s as xe}from"./chunk-EFNV3TFI.js";import{c as ve}from"./chunk-4TZAFRQL.js";import{G as X,M as Se,S as $e,T as Ee,a as Rt,h as A,j as k,k as y,l as g,m as V,n as F,o as ge,r as ye,s as q}from"./chunk-TVYHBSWN.js";import{b as N}from"./chunk-O22TMXNP.js";import{a as i,e as xt,f as C}from"./chunk-KPIXRVP2.js";C();import*as T from"node:fs";import*as J from"node:path";var ot=i(e=>J.join(N(e),"issue.md"),"issueCopyPath"),U=class extends Error{static{i(this,"IssueFetchError")}};async function nt(e,r=()=>new Date,o=j({text:e})){let t=await o.fetchIssue(e);if(!t)throw new U(`couldn't read ${e} from ${o.label}`);return{ref:t.ref,url:t.url??o.url(t.ref),tracker:o.id,title:t.title??"",status:t.status??"",body:t.description??"",comments:t.comments??[],fetchedAt:r().toISOString()}}i(nt,"fetchIssueSnapshot");var ue=`
3
+ import{d as rt}from"./chunk-OG6IADS2.js";import{a as Xe,c as M,d as Ze,f as et,h as tt}from"./chunk-MGHS2MNT.js";import{d as Qe,o as qe}from"./chunk-5VP2WWNJ.js";import{b as ze,c as ce,g as ae,h as Je,i as fe,j as Ye}from"./chunk-5VVB6YC6.js";import{r as se,s as ie,u as Ke}from"./chunk-TYU3RTXE.js";import{c as ne,d as Pe}from"./chunk-IJSQZCXK.js";import{c as Te}from"./chunk-H77DNTBZ.js";import{o as Oe}from"./chunk-OURDTRZW.js";import{h as je}from"./chunk-54NAFRC6.js";import{m as Ae}from"./chunk-MLNPL4GQ.js";import{A as Ne,B as Fe,G as te,H as Me,J as z,L as re,O as Ue,S as Le,T as oe,i as We,o as j,p as Ie,x as De,z as ee}from"./chunk-XC6H6SQW.js";import{b as He,e as Be,g as Ve}from"./chunk-XCBSJYK3.js";import{a as B}from"./chunk-O6HU5JLN.js";import{m as K}from"./chunk-2LZ2JKBE.js";import{a as Ge}from"./chunk-6U2SNX3K.js";import{b as be}from"./chunk-XW5MCVHV.js";import{b as Re,c as Ce}from"./chunk-6TPYQWQK.js";import{o as _e,p as Z,s as xe}from"./chunk-PZOR2K2Q.js";import{c as ve}from"./chunk-BRV6D7JW.js";import{G as X,M as Se,S as $e,T as Ee,a as Rt,h as A,j as k,k as y,l as g,m as V,n as F,o as ge,r as ye,s as q}from"./chunk-VWF2MQHQ.js";import{b as N}from"./chunk-LQIICTKP.js";import{a as i,e as xt,f as C}from"./chunk-YJATE7FY.js";C();import*as T from"node:fs";import*as J from"node:path";var ot=i(e=>J.join(N(e),"issue.md"),"issueCopyPath"),U=class extends Error{static{i(this,"IssueFetchError")}};async function nt(e,r=()=>new Date,o=j({text:e})){let t=await o.fetchIssue(e);if(!t)throw new U(`couldn't read ${e} from ${o.label}`);return{ref:t.ref,url:t.url??o.url(t.ref),tracker:o.id,title:t.title??"",status:t.status??"",body:t.description??"",comments:t.comments??[],fetchedAt:r().toISOString()}}i(nt,"fetchIssueSnapshot");var ue=`
4
4
 
5
5
  ## Comments
6
6
  `;function Ct(e){let r=["---",`ref: ${e.ref}`,`url: ${e.url??""}`,`tracker: ${e.tracker}`,`status: ${e.status}`,`fetched: ${e.fetchedAt}`,"---","",`# ${e.title}`,"",e.body].join(`
@@ -33,4 +33,4 @@ ${A.BOLD}Workspace initialised.${A.RESET} Open a new Claude Code session from th
33
33
  ${A.BOLD}Workspace ready.${A.RESET} cd ${a} and open a Claude Code session from there.
34
34
 
35
35
  `),a):(g(`Workspace created at ${a}, but its containers are not set up: it has no slot (see the slot warning above). Free a slot with \`werkmeister feature down <feature>\`, then run \`werkmeister workspace init\` there.`),a)}i(Lr,"provisionWorkspace");export{U as a,nt as b,R as c,de as d,wt as e,Xt as f,Lr as g};
36
- //# sourceMappingURL=chunk-YUSN6ATL.js.map
36
+ //# sourceMappingURL=chunk-3HAZOPUB.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-YUSN6ATL.js";import{a as o,f as t}from"./chunk-KPIXRVP2.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-76QOU4PO.js.map
3
+ import{c as i,d as n,f as s}from"./chunk-3HAZOPUB.js";import{a as o,f as t}from"./chunk-YJATE7FY.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-526FRAP4.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{b as C,l as G}from"./chunk-USB7XTDC.js";import{m as x}from"./chunk-QWI55NYX.js";import{d as g,e as P,u as L}from"./chunk-EFNV3TFI.js";import{G as F,M as W,S as T,a as X}from"./chunk-TVYHBSWN.js";import{b as I}from"./chunk-O22TMXNP.js";import{a,e as Q,f as O}from"./chunk-KPIXRVP2.js";O();var K=Q(X(),1);import*as d from"node:fs";import*as u from"node:path";O();import*as D from"node:fs";import*as y from"node:path";var ee=5;function te(t){let e=t.trim().replace(/\.git$/,""),n=/^(?:ssh:\/\/)?git@([^:/]+)[:/](.+)$/.exec(e);return n?`https://${n[1]}/${n[2]}`:/^https?:\/\//.test(e)?e:""}a(te,"httpsRemote");function ne(t=g()){let e=a((...i)=>{try{let r=x(["git","-C",t,...i],{capture:!0,timeout:ee});return r.status===0?r.stdout.trim():""}catch{return""}},"git"),n=te(e("remote","get-url","origin"));return n?{base:n,prefix:e("rev-parse","--show-prefix").replace(/\/+$/,"")}:null}a(ne,"standardsSource");function H(t,e,n="blob"){if(!t)return"";let i=y.posix.normalize(y.posix.join(t.prefix,e)).replace(/\/+$/,"");return i==="."?`${t.base}/${n}/HEAD`:`${t.base}/${n}/HEAD/${i}`}a(H,"standardsUrl");function re(){let t=L();return t?`https://github.com/${t}`:""}a(re,"serviceRepoBase");var se=`<!--
3
+ import{d as C,n as G}from"./chunk-MLNPL4GQ.js";import{m as x}from"./chunk-2LZ2JKBE.js";import{d as g,e as P,u as L}from"./chunk-PZOR2K2Q.js";import{G as F,M as W,S as T,a as X}from"./chunk-VWF2MQHQ.js";import{b as I}from"./chunk-LQIICTKP.js";import{a,e as Q,f as O}from"./chunk-YJATE7FY.js";O();var K=Q(X(),1);import*as d from"node:fs";import*as u from"node:path";O();import*as D from"node:fs";import*as y from"node:path";var ee=5;function te(t){let e=t.trim().replace(/\.git$/,""),n=/^(?:ssh:\/\/)?git@([^:/]+)[:/](.+)$/.exec(e);return n?`https://${n[1]}/${n[2]}`:/^https?:\/\//.test(e)?e:""}a(te,"httpsRemote");function ne(t=g()){let e=a((...i)=>{try{let r=x(["git","-C",t,...i],{capture:!0,timeout:ee});return r.status===0?r.stdout.trim():""}catch{return""}},"git"),n=te(e("remote","get-url","origin"));return n?{base:n,prefix:e("rev-parse","--show-prefix").replace(/\/+$/,"")}:null}a(ne,"standardsSource");function H(t,e,n="blob"){if(!t)return"";let i=y.posix.normalize(y.posix.join(t.prefix,e)).replace(/\/+$/,"");return i==="."?`${t.base}/${n}/HEAD`:`${t.base}/${n}/HEAD/${i}`}a(H,"standardsUrl");function re(){let t=L();return t?`https://github.com/${t}`:""}a(re,"serviceRepoBase");var se=`<!--
4
4
  AUTO-GENERATED FILE \u2014 DO NOT EDIT BY HAND.
5
5
  Source: {source} (edit that file instead)
6
6
  Generator: werkmeister workspace init / werkmeister skills sync
@@ -28,4 +28,4 @@ Full file: \`${n}\`${c}
28
28
  `))return{};let n=e.indexOf(`
29
29
  ---`,4);if(n===-1)return{};let i;try{i=K.parse(e.slice(4,n))}catch{return{}}return R(i)?i:{}}a(w,"parseFrontmatter");function ge(t,e,n){n==null&&(n=T());let i=G(t,n);for(let r of Object.keys(n).sort()){let s=n[r];if(R(s))for(let o of s.standards??[])o in e||i.push(`services.yaml: archetype '${r}' lists unknown standard '${o}' \u2014 no docs/standards/${o}.md with \`domain: ${o}\``)}for(let[r,s]of Object.entries(t))if(!(!R(s)||s.archetype))for(let o of s.standards??[])o in e||i.push(`services.yaml: service '${r}' lists unknown standard '${o}' \u2014 no docs/standards/${o}.md with \`domain: ${o}\``);return i}a(ge,"validateServiceStandards");function z(t){t==null&&(t=g());let e=[];if(!(d.existsSync(t)&&d.statSync(t).isDirectory()))return e;for(let n of J(t)){let i=u.relative(t,n),r=w(n),s=r.domain;if(!(typeof s=="string"&&s.trim())){e.push(`${i}: unparseable frontmatter or missing \`domain:\``);continue}let o=r.summary;typeof o=="string"&&o.trim()||e.push(`${i}: missing or empty \`summary:\``);let c=r.applies_to;Array.isArray(c)&&c.length&&c.every(h=>typeof h=="string"&&h.trim())||e.push(`${i}: \`applies_to:\` must be a non-empty list of non-empty globs (empty means the standard never loads and never re-injects)`);let f=r.phase;f!=null&&!(Array.isArray(f)&&f.length&&f.every(h=>typeof h=="string"&&h.trim()))&&e.push(`${i}: \`phase:\` if present must be a non-empty list of strings (a scalar string silently breaks skill_gen's substring gate)`);let m=r.universal;m!=null&&!Number.isInteger(m)&&e.push(`${i}: \`universal:\` if present must be an integer (its load order) \u2014 \`universal: true\` reads as universal but silently is not`);let p=u.basename(n)==="STANDARD.md"?u.basename(u.dirname(n)):u.basename(n,".md");s.trim()!==p&&e.push(`${i}: \`domain: ${s}\` does not match its location (expected \`${p}\` \u2014 w9r-<domain>-standard would diverge from where the standard lives)`)}return e}a(z,"validateStandardModules");function _e(){let t=g(),e=$e(),n=P();if(n)return{dir:t,repoTrees:e,moduleCount:0,errors:[n]};let i=k();if(!Object.keys(i).length)return{dir:t,repoTrees:e,moduleCount:0,errors:[`no standard modules found in ${t}`]};let r={...i},s=[];for(let o of e){let c=u.basename(u.resolve(o,"..","..")),f=N(o),m=a(p=>`${c}: ${p}`,"tag");s.push(...z(o).map(m)),s.push(...E(f).map(m));for(let p of Object.keys(f))p in i?s.push(m(`\`${p}\` is also a module in ${t}, which wins; rename this one`)):r[p]=f[p]}return{dir:t,repoTrees:e,moduleCount:Object.keys(r).length,errors:[...z(),...E(i),...s,...ge(W(),r)]}}a(_e,"checkStandards");function $e(t=F()){let e;try{e=d.readdirSync(t).sort()}catch{return[]}return e.map(n=>u.join(t,n)).filter(n=>d.statSync(u.join(n,".git"),{throwIfNoEntry:!1})?.isDirectory()).map(Y).filter(n=>d.statSync(n,{throwIfNoEntry:!1})?.isDirectory())}a($e,"repoStandardTrees");function be(t,e){if(!t)return new Set;let n=t.toLowerCase(),i=new Set;for(let[r,s]of Object.entries(e))(s.task_signatures??[]).some(c=>n.includes(String(c).toLowerCase()))&&i.add(r);return i}a(be,"domainsMatchingTaskText");function Me(t,e,n,i,r,s,o){r==null&&(r=k()),o==null&&(o=T());let c;s?.length?c=[...s]:c=t.flatMap(l=>n[l]?.services??[]);let f=new Set;for(let l of c)for(let v of C(e[l],o))f.add(v);let m=i??{},p=m.standards_override??{};for(let l of p.add??[])f.add(l);for(let[l,v]of Object.entries(r))v.repo&&f.add(l);let h=["starting_prompt","task","description"].map(l=>m[l]?String(m[l]):"").join(" ");for(let l of be(h,r))f.add(l);for(let l of p.remove??[])f.delete(l);let $=_(r);for(let l of $)f.add(l);for(let l of[...f])l in r||f.delete(l);let M=a(l=>$.includes(l)?[0,$.indexOf(l),""]:[1,0,l],"sortKey"),q=[...f].sort((l,v)=>{let b=M(l),S=M(v);return b[0]!==S[0]?b[0]-S[0]:b[1]!==S[1]?b[1]-S[1]:b[2]<S[2]?-1:b[2]>S[2]?1:0}),V=Object.keys(r).filter(l=>!f.has(l)).sort();return[q,V]}a(Me,"resolveActiveStandards");function Ie(t,e,n=null){let i=_(e),r={};for(let o of t)i.includes(o)||(r[o]={applies_to:Array.from(e[o]?.applies_to??[]),summary:String(e[o]?.summary??"").trim()});let s={generated_by:"werkmeister workspace init",universal:t.filter(o=>i.includes(o)),domains:r};return n&&(s.phase_gate={...n}),s}a(Ie,"buildStandardsManifest");function Fe(t,e){let n=u.join(I(t),"standards.json");return d.mkdirSync(u.dirname(n),{recursive:!0}),d.writeFileSync(n,JSON.stringify(e,null,2)+`
30
30
  `),n}a(Fe,"writeStandardsManifest");export{ne as a,H as b,j as c,we as d,E as e,_ as f,me as g,U as h,Ne as i,k as j,ge as k,_e as l,Me as m,Ie as n,Fe as o};
31
- //# sourceMappingURL=chunk-YELLLMDI.js.map
31
+ //# sourceMappingURL=chunk-54NAFRC6.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 kr}from"./chunk-IJQ2NP5F.js";import{d as gr}from"./chunk-TAU7BRTN.js";import{b as dr}from"./chunk-4DUMKXHS.js";import{b as fr}from"./chunk-SLVS2TAO.js";import{n as ur}from"./chunk-MUSFS3P4.js";import{i as cr}from"./chunk-USB7XTDC.js";import{F as pr,M as hr}from"./chunk-IFSSMLFN.js";import{a as mr}from"./chunk-OBFA4YEN.js";import{Y as _r,ba as yr,c as $e,ca as ye,da as ut,u as vr}from"./chunk-YH36XQ4K.js";import{a as _e,d as Zt}from"./chunk-EGH4ZUSB.js";import{f as lr,y as ct}from"./chunk-EFNV3TFI.js";import{$ as lt,D as it,H as Ke,I as er,K as Me,L as tr,M as st,O as rr,Q as ot,R as nr,S as ir,U as sr,V as at,X as Ae,Z as or,_ as ar,a as Ki,j as je,k as te,l as fe}from"./chunk-TVYHBSWN.js";import{b as Te}from"./chunk-O22TMXNP.js";import{a,b as Q,c as M,e as Qt,f as b}from"./chunk-KPIXRVP2.js";var ee=M((fc,Ar)=>{"use strict";b();var De=Array.prototype,Ne=Object.prototype,Mi={"&":"&amp;",'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","\\":"&#92;"},$i=/[&"'<>\\]/g,j=Ar.exports={};function ft(t,n){return Ne.hasOwnProperty.call(t,n)}a(ft,"hasOwnProp");j.hasOwnProp=ft;function Di(t){return Mi[t]}a(Di,"lookupEscape");function qi(t,n,s){if(s.Update||(s=new j.TemplateError(s)),s.Update(t),!n){var i=s;s=new Error(i.message),s.name=i.name}return s}a(qi,"_prettifyError");j._prettifyError=qi;function Le(t,n,s){var i,e;t instanceof Error&&(e=t,t=e.name+": "+e.message),Object.setPrototypeOf?(i=new Error(t),Object.setPrototypeOf(i,Le.prototype)):(i=this,Object.defineProperty(i,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(i,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(i,this.constructor);var r;if(e){var o=Object.getOwnPropertyDescriptor(e,"stack");r=o&&(o.get||function(){return o.value}),r||(r=a(function(){return e.stack},"getStack"))}else{var l=new Error(t).stack;r=a(function(){return l},"getStack")}return Object.defineProperty(i,"stack",{get:a(function(){return r.call(i)},"get")}),Object.defineProperty(i,"cause",{value:e}),i.lineno=n,i.colno=s,i.firstUpdate=!0,i.Update=a(function(u){var f="("+(u||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?f+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(f+=" [Line "+this.lineno+"]")),f+=`
3
+ import{a as kr}from"./chunk-5VVB6YC6.js";import{d as gr}from"./chunk-VFOVT4JH.js";import{b as dr}from"./chunk-QJPZTGT3.js";import{b as fr}from"./chunk-H77DNTBZ.js";import{n as ur}from"./chunk-OURDTRZW.js";import{k as cr}from"./chunk-MLNPL4GQ.js";import{F as pr,M as hr}from"./chunk-XC6H6SQW.js";import{a as mr}from"./chunk-GGZGYD5D.js";import{Y as _r,ba as yr,c as $e,ca as ye,da as ut,u as vr}from"./chunk-XCBSJYK3.js";import{a as _e,d as Zt}from"./chunk-O6HU5JLN.js";import{f as lr,y as ct}from"./chunk-PZOR2K2Q.js";import{$ as lt,D as it,H as Ke,I as er,K as Me,L as tr,M as st,O as rr,Q as ot,R as nr,S as ir,U as sr,V as at,X as Ae,Z as or,_ as ar,a as Ki,j as je,k as te,l as fe}from"./chunk-VWF2MQHQ.js";import{b as Te}from"./chunk-LQIICTKP.js";import{a,b as Q,c as M,e as Qt,f as b}from"./chunk-YJATE7FY.js";var ee=M((fc,Ar)=>{"use strict";b();var De=Array.prototype,Ne=Object.prototype,Mi={"&":"&amp;",'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","\\":"&#92;"},$i=/[&"'<>\\]/g,j=Ar.exports={};function ft(t,n){return Ne.hasOwnProperty.call(t,n)}a(ft,"hasOwnProp");j.hasOwnProp=ft;function Di(t){return Mi[t]}a(Di,"lookupEscape");function qi(t,n,s){if(s.Update||(s=new j.TemplateError(s)),s.Update(t),!n){var i=s;s=new Error(i.message),s.name=i.name}return s}a(qi,"_prettifyError");j._prettifyError=qi;function Le(t,n,s){var i,e;t instanceof Error&&(e=t,t=e.name+": "+e.message),Object.setPrototypeOf?(i=new Error(t),Object.setPrototypeOf(i,Le.prototype)):(i=this,Object.defineProperty(i,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(i,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(i,this.constructor);var r;if(e){var o=Object.getOwnPropertyDescriptor(e,"stack");r=o&&(o.get||function(){return o.value}),r||(r=a(function(){return e.stack},"getStack"))}else{var l=new Error(t).stack;r=a(function(){return l},"getStack")}return Object.defineProperty(i,"stack",{get:a(function(){return r.call(i)},"get")}),Object.defineProperty(i,"cause",{value:e}),i.lineno=n,i.colno=s,i.firstUpdate=!0,i.Update=a(function(u){var f="("+(u||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?f+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(f+=" [Line "+this.lineno+"]")),f+=`
4
4
  `,this.firstUpdate&&(f+=" "),this.message=f+(this.message||""),this.firstUpdate=!1,this},"Update"),i}a(Le,"TemplateError");Object.setPrototypeOf?Object.setPrototypeOf(Le.prototype,Error.prototype):Le.prototype=Object.create(Error.prototype,{constructor:{value:Le}});j.TemplateError=Le;function Ui(t){return t.replace($i,Di)}a(Ui,"escape");j.escape=Ui;function Er(t){return Ne.toString.call(t)==="[object Function]"}a(Er,"isFunction");j.isFunction=Er;function wr(t){return Ne.toString.call(t)==="[object Array]"}a(wr,"isArray");j.isArray=wr;function br(t){return Ne.toString.call(t)==="[object String]"}a(br,"isString");j.isString=br;function xr(t){return Ne.toString.call(t)==="[object Object]"}a(xr,"isObject");j.isObject=xr;function Vi(t){return t?typeof t=="string"?t.split("."):[t]:[]}a(Vi,"_prepareAttributeParts");function Or(t){var n=Vi(t);return a(function(i){for(var e=i,r=0;r<n.length;r++){var o=n[r];if(ft(e,o))e=e[o];else return}return e},"attrGetter")}a(Or,"getAttrGetter");j.getAttrGetter=Or;function Wi(t,n,s){for(var i={},e=Er(n)?n:Or(n),r=0;r<t.length;r++){var o=t[r],l=e(o,r);if(l===void 0&&s===!0)throw new TypeError('groupby: attribute "'+n+'" resolved to undefined');(i[l]||(i[l]=[])).push(o)}return i}a(Wi,"groupBy");j.groupBy=Wi;function Sr(t){return Array.prototype.slice.call(t)}a(Sr,"toArray");j.toArray=Sr;function Gi(t){var n=[];if(!t)return n;for(var s=t.length,i=Sr(arguments).slice(1),e=-1;++e<s;)Tr(i,t[e])===-1&&n.push(t[e]);return n}a(Gi,"without");j.without=Gi;function Hi(t,n){for(var s="",i=0;i<n;i++)s+=t;return s}a(Hi,"repeat");j.repeat=Hi;function Yi(t,n,s){if(t!=null){if(De.forEach&&t.forEach===De.forEach)t.forEach(n,s);else if(t.length===+t.length)for(var i=0,e=t.length;i<e;i++)n.call(s,t[i],i,t)}}a(Yi,"each");j.each=Yi;function Xi(t,n){var s=[];if(t==null)return s;if(De.map&&t.map===De.map)return t.map(n);for(var i=0;i<t.length;i++)s[s.length]=n(t[i],i);return t.length===+t.length&&(s.length=t.length),s}a(Xi,"map");j.map=Xi;function zi(t,n,s){var i=-1;function e(){i++,i<t.length?n(t[i],i,e,s):s()}a(e,"next"),e()}a(zi,"asyncIter");j.asyncIter=zi;function Ji(t,n,s){var i=Ce(t||{}),e=i.length,r=-1;function o(){r++;var l=i[r];r<e?n(l,t[l],r,e,o):s()}a(o,"next"),o()}a(Ji,"asyncFor");j.asyncFor=Ji;function Tr(t,n,s){return Array.prototype.indexOf.call(t||[],n,s)}a(Tr,"indexOf");j.indexOf=Tr;function Ce(t){var n=[];for(var s in t)ft(t,s)&&n.push(s);return n}a(Ce,"keys_");j.keys=Ce;function Qi(t){return Ce(t).map(function(n){return[n,t[n]]})}a(Qi,"_entries");j._entries=Qi;function Zi(t){return Ce(t).map(function(n){return t[n]})}a(Zi,"_values");j._values=Zi;function es(t,n){return t=t||{},Ce(n).forEach(function(s){t[s]=n[s]}),t}a(es,"extend");j._assign=j.extend=es;function ts(t,n){if(wr(n)||br(n))return n.indexOf(t)!==-1;if(xr(n))return t in n;throw new Error('Cannot use "in" operator to search for "'+t+'" in unexpected types.')}a(ts,"inOperator");j.inOperator=ts});var Rr=M((mc,Fr)=>{"use strict";b();var qe,rs=typeof setImmediate=="function";Fr.exports=Nr;function Nr(t){ne.length||(Cr(),pt=!0),ne[ne.length]=t}a(Nr,"rawAsap");var ne=[],pt=!1,re=0,ns=1024;function Lr(){for(;re<ne.length;){var t=re;if(re=re+1,ne[t].call(),re>ns){for(var n=0,s=ne.length-re;n<s;n++)ne[n]=ne[n+re];ne.length-=re,re=0}}ne.length=0,re=0,pt=!1}a(Lr,"flush");Nr.requestFlush=Cr;function Cr(){var t=process.domain;t&&(qe||(qe=Q("domain")),qe.active=process.domain=null),pt&&rs?setImmediate(Lr):process.nextTick(Lr),t&&(qe.active=process.domain=t)}a(Cr,"requestFlush")});var jr=M((_c,Br)=>{"use strict";b();var Pr=Rr(),ht=[];Br.exports=is;function is(t){var n;ht.length?n=ht.pop():n=new Ir,n.task=t,n.domain=process.domain,Pr(n)}a(is,"asap");function Ir(){this.task=null,this.domain=null}a(Ir,"RawTask");Ir.prototype.call=function(){this.domain&&this.domain.enter();var t=!0;try{this.task.call(),t=!1,this.domain&&this.domain.exit()}finally{t&&Pr.requestFlush(),this.task=null,this.domain=null,ht.push(this)}}});var Mr=M((Kr,Ue)=>{b();(function(t){"use strict";var n=a(function(){var o=Array.prototype.slice.call(arguments);typeof o[0]=="function"&&o[0].apply(null,o.splice(1))},"executeSync"),s=a(function(o){typeof setImmediate=="function"?setImmediate(o):typeof process<"u"&&process.nextTick?process.nextTick(o):setTimeout(o,0)},"executeAsync"),i=a(function(o){var l=a(function(c){var u=a(function(){return o.length&&o[c].apply(null,arguments),u.next()},"fn");return u.next=function(){return c<o.length-1?l(c+1):null},u},"makeCallback");return l(0)},"makeIterator"),e=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"},r=a(function(o,l,c){var u=c?s:n;if(l=l||function(){},!e(o)){var f=new Error("First argument to waterfall must be an array of functions");return l(f)}if(!o.length)return l();var p=a(function(m){return function(y){if(y)l.apply(null,arguments),l=a(function(){},"callback");else{var w=Array.prototype.slice.call(arguments,1),O=m.next();O?w.push(p(O)):w.push(l),u(function(){m.apply(null,w)})}}},"wrapIterator");p(i(o))()},"waterfall");typeof define<"u"&&define.amd?define([],function(){return r}):typeof Ue<"u"&&Ue.exports?Ue.exports=r:t.waterfall=r})(Kr)});var dt=M((wc,mn)=>{"use strict";b();var $r=ee(),Dr=`
5
5
  \r\xA0`,qr="()[]{}%*-+~/#,:|.<>=!",ss="0123456789",os="{%",as="%}",ls="{{",cs="}}",us="{#",fs="#}",Ur="string",Vr="whitespace",Wr="data",Gr="block-start",Hr="block-end",Yr="variable-start",Xr="variable-end",zr="comment",Jr="left-paren",Qr="right-paren",Zr="left-bracket",en="right-bracket",tn="left-curly",rn="right-curly",nn="operator",sn="comma",on="colon",an="tilde",ln="pipe",cn="int",un="float",fn="boolean",mt="none",pn="symbol",ps="special",hn="regex";function Y(t,n,s,i){return{type:t,value:n,lineno:s,colno:i}}a(Y,"token");var hs=function(){function t(s,i){this.str=s,this.index=0,this.len=s.length,this.lineno=0,this.colno=0,this.in_code=!1,i=i||{};var e=i.tags||{};this.tags={BLOCK_START:e.blockStart||os,BLOCK_END:e.blockEnd||as,VARIABLE_START:e.variableStart||ls,VARIABLE_END:e.variableEnd||cs,COMMENT_START:e.commentStart||us,COMMENT_END:e.commentEnd||fs},this.trimBlocks=!!i.trimBlocks,this.lstripBlocks=!!i.lstripBlocks}a(t,"Tokenizer");var n=t.prototype;return n.nextToken=a(function(){var i=this.lineno,e=this.colno,r;if(this.in_code){var o=this.current();if(this.isFinished())return null;if(o==='"'||o==="'")return Y(Ur,this._parseString(o),i,e);if(r=this._extract(Dr))return Y(Vr,r,i,e);if((r=this._extractString(this.tags.BLOCK_END))||(r=this._extractString("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&(o=this.current(),o===`
6
6
  `?this.forward():o==="\r"&&(this.forward(),o=this.current(),o===`
@@ -78,4 +78,4 @@ Why: ${L}
78
78
 
79
79
  Next: ${x} That rewrites this file with the container recipe.
80
80
  `),null}Zl(t,w,m,l,s,"werkmeister workspace init"),nc(t,w,m,l,s),sc(t,w,m,l,s);let[O,k]=ye(w);te(`Compose ready (slot ${w}, ports ${O}-${k})`);let _=nr(),h=gr(t,w,O,k,m,r,i,null,cr(e,_,m),pr(s),fr(s),_),d=Te(s);return T.mkdirSync(d,{recursive:!0}),T.writeFileSync(C.join(d,"werkmeister-context.md"),h),T.rmSync(C.join(d,"sandbox-context.md"),{force:!0}),te(`Wrote ${C.basename(d)}/werkmeister-context.md`),w}a(Qu,"generateWorkspaceCompose");export{Ai as a,Li as b,Ni as c,Yu as d,Bi as e,Ql as f,Zl as g,Xu as h,ec as i,zu as j,nc as k,ic as l,sc as m,Ju as n,Qu as o};
81
- //# sourceMappingURL=chunk-PLOU2ZRT.js.map
81
+ //# sourceMappingURL=chunk-5VP2WWNJ.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{m as c}from"./chunk-QWI55NYX.js";import{j as h,l as k}from"./chunk-TVYHBSWN.js";import{a,f as w}from"./chunk-KPIXRVP2.js";w();import*as m from"node:fs";import*as d from"node:path";var $="# --- sandbox workspace (managed section)",E=`${$} -----------------------------------
3
+ import{m as c}from"./chunk-2LZ2JKBE.js";import{j as h,l as k}from"./chunk-VWF2MQHQ.js";import{a,f as w}from"./chunk-YJATE7FY.js";w();import*as m from"node:fs";import*as d from"node:path";var $="# --- sandbox workspace (managed section)",E=`${$} -----------------------------------
4
4
  # Repo worktrees nested in this workspace, ignored by name. Rewritten by
5
5
  # \`werkmeister workspace init\` on each run; rules above come from the repo's main.
6
6
  `,x=["compose.yml","compose.gate.yml",".werkmeister/agent-state.json",".werkmeister/sessions/",".werkmeister/notices.json",".werkmeister/last-exec",".werkmeister/starts.json",".werkmeister/token",".werkmeister/wake-nudge*"],C=["/.env","/.env.*",...x.map(t=>`/${t}`)];function v(t){let i=["rm","--cached","--quiet","--ignore-unmatch","--",...x];c(["git","-C",t,...i],{capture:!0})}a(v,"untrackRuntimeFiles");function A(t){let i=d.join(t,".gitignore"),e="";try{e=m.readFileSync(i,"utf8")}catch{}let n=new Set(e.split(`
@@ -20,4 +20,4 @@ import{m as c}from"./chunk-QWI55NYX.js";import{j as h,l as k}from"./chunk-TVYHBS
20
20
  then rerun; the worktree lands on that branch.
21
21
  Start over (deletes the remote branch): rerun with --force
22
22
  Keep both: pick a different feature name.`)}h(` ${r}: worktree \u2192 ${e} (from ${l})`),f=["git","-C",t,"worktree","add","--no-track","-b",e,i,l]}let o=c(f,{capture:!0});if(o.status!==0)throw new Error(o.stderr.trim()||`git worktree add failed for ${r}`);if(s.status!==0)for(let[l,u]of[["remote","origin"],["merge",`refs/heads/${e}`]])c(["git","-C",t,"config",`branch.${e}.${l}`,u],{capture:!0})}a(D,"createWorktree");function S(t){return!!c(["git","-C",t,"status","--porcelain"],{capture:!0}).stdout.trim()}a(S,"worktreeIsDirty");function N(t,i,e){let n=c(["git","-C",t,"worktree","remove","--force",i],{capture:!0});if(n.status!==0)return[!1,n.stderr.trim()||`could not remove worktree ${i}`];let r=c(["git","-C",t,"branch","-D",e],{capture:!0});return r.status!==0?[!0,`worktree removed but branch ${e} lingered: ${r.stderr.trim()}`]:[!0,""]}a(N,"removeWorktree");function H(t,i,e=[]){if(!m.existsSync(d.join(t,".git")))return!1;let n=e.length?["--",...e]:[];try{return c(["git","-C",t,"add","-A",...n],{capture:!0,check:!0}),c(["git","-C",t,"diff","--cached","--quiet",...n],{capture:!0}).status===0?!1:(c(["git","-C",t,"commit","-q","-m",i,...n],{capture:!0,check:!0}),!0)}catch(r){return k(`Could not commit ${i}: ${r.message}`),!1}}a(H,"commitRecord");export{A as a,F as b,W as c,j as d,_ as e,T as f,D as g,S as h,N as i,H as j};
23
- //# sourceMappingURL=chunk-IJQ2NP5F.js.map
23
+ //# sourceMappingURL=chunk-5VVB6YC6.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{f as $,t as B,u as F,w as _}from"./chunk-JHM3QBJZ.js";import{b as D,d as N}from"./chunk-VU3APKHW.js";import{d as E,o as T}from"./chunk-K2W4MAI7.js";import{f as O}from"./chunk-74HXYLXD.js";import{c as k}from"./chunk-4DUMKXHS.js";import{Q as A,W as C,ba as y,ca as I,d as R,s as j,t as P}from"./chunk-YH36XQ4K.js";import{d as v}from"./chunk-XMMOB7QK.js";import{M as w}from"./chunk-TVYHBSWN.js";import{a,f as x}from"./chunk-KPIXRVP2.js";x();async function M(){return(await v(E,void 0,{all:!1})??[]).map(({service:e,state:n,health:r})=>{let s;return r==="healthy"?s="healthy":r==="starting"?s="starting":n==="running"?s="running":s=n||"down",{service:e||"unknown",display:s}})}a(M,"getInfraStatus");function Q(t){if(typeof t=="number"){let[e,n]=I(t);return`${e}-${n}`}return"?"}a(Q,"featurePortRange");function U(t){return P(t.service,t.role)&&t.status==="exited"&&t.exitCode===0}a(U,"finishedSetup");function V(t){return t.filter(e=>!U(e))}a(V,"tallied");function H(t){return Object.entries(t).sort((e,n)=>{let r=typeof e[1].slot=="number"?e[1].slot:99,s=typeof n[1].slot=="number"?n[1].slot:99;return r-s})}a(H,"sortedSlots");function J(t,e,n){let r=[];for(let[s,f]of H(t))for(let l of f.services??[]){let u=e[l],p=B(u),c=p===null?String(u.k8s_deployment):null,i=c!==null?n.intercepts.get(c):void 0;r.push({feature:s,service:l,deployment:c,interceptable:p===null,blocker:p,intercepted:i!==void 0,intercepted_by:i??null})}return r}a(J,"buildInterceptRows");var L=a(t=>$(t,void 0,15),"STATUS_READ");async function ot(){let t=await _(L),e=w(),n=t.installed?J(await y(),e,t):[];return{available:t.available,installed:t.installed,connected_namespace:t.namespace,intercepts:n,remote_services:Object.keys(e).filter(r=>F(e[r])).sort()}}a(ot,"interceptsSnapshot");async function W(){let[t,e]=await Promise.all([v().then(n=>D(n??[])),N().catch(()=>null)]);return{health:t,resources:e}}a(W,"featureVitals");async function at(){let t=W(),e=k().catch(()=>[]),n=await M(),r=await T(),s=await y(),f=await O(),l=await _(L),u=J(s,w(),l),{health:p,resources:c}=await t,i=[];for(let[o,m]of H(s)){let h=V(await j(o)),S=await R(o),b=c?.projects[S],d=p.get(S);i.push({name:o,slot:m.slot,services:m.services??[],port_range:Q(m.slot),containers:h,containers_running:h.filter(g=>g.status==="running").length,containers_total:h.length,intercepts:u.filter(g=>g.feature===o),cpu_percent:b?.cpuPercent??null,mem_mib:b?.memMib??null,started_at:d?.started?.at??null,started_by:d?.started?.by??null,crash_loops:d?.crashLoops??[]})}return{host:c?.host??null,infrastructure:n,mcp_web_server:f,k8s_forwards:r,features:i,waiting:await A(),caches:await e,summary:{total_features:i.length,available_slots:C()-i.length,infra_healthy:n.length>0&&n.every(o=>o.display==="healthy"||o.display==="running"),k8s_alive:r.filter(o=>o.status==="alive").length,k8s_total:r.length,telepresence_available:l.available,intercepts_active:u.filter(o=>o.intercepted).length}}}a(at,"statusSnapshot");export{M as a,Q as b,U as c,V as d,H as e,J as f,ot as g,W as h,at as i};
4
- //# sourceMappingURL=chunk-XN5UHSRT.js.map
3
+ import{f as $,t as B,u as F,w as _}from"./chunk-A7IMVARC.js";import{b as D,d as N}from"./chunk-NELXXBDP.js";import{d as E,o as T}from"./chunk-UGFDU7XO.js";import{f as O}from"./chunk-BWUYKFIB.js";import{c as k}from"./chunk-QJPZTGT3.js";import{Q as A,W as C,ba as y,ca as I,d as R,s as j,t as P}from"./chunk-XCBSJYK3.js";import{d as v}from"./chunk-W6LFIOQM.js";import{M as w}from"./chunk-VWF2MQHQ.js";import{a,f as x}from"./chunk-YJATE7FY.js";x();async function M(){return(await v(E,void 0,{all:!1})??[]).map(({service:e,state:n,health:r})=>{let s;return r==="healthy"?s="healthy":r==="starting"?s="starting":n==="running"?s="running":s=n||"down",{service:e||"unknown",display:s}})}a(M,"getInfraStatus");function Q(t){if(typeof t=="number"){let[e,n]=I(t);return`${e}-${n}`}return"?"}a(Q,"featurePortRange");function U(t){return P(t.service,t.role)&&t.status==="exited"&&t.exitCode===0}a(U,"finishedSetup");function V(t){return t.filter(e=>!U(e))}a(V,"tallied");function H(t){return Object.entries(t).sort((e,n)=>{let r=typeof e[1].slot=="number"?e[1].slot:99,s=typeof n[1].slot=="number"?n[1].slot:99;return r-s})}a(H,"sortedSlots");function J(t,e,n){let r=[];for(let[s,f]of H(t))for(let l of f.services??[]){let u=e[l],p=B(u),c=p===null?String(u.k8s_deployment):null,i=c!==null?n.intercepts.get(c):void 0;r.push({feature:s,service:l,deployment:c,interceptable:p===null,blocker:p,intercepted:i!==void 0,intercepted_by:i??null})}return r}a(J,"buildInterceptRows");var L=a(t=>$(t,void 0,15),"STATUS_READ");async function ot(){let t=await _(L),e=w(),n=t.installed?J(await y(),e,t):[];return{available:t.available,installed:t.installed,connected_namespace:t.namespace,intercepts:n,remote_services:Object.keys(e).filter(r=>F(e[r])).sort()}}a(ot,"interceptsSnapshot");async function W(){let[t,e]=await Promise.all([v().then(n=>D(n??[])),N().catch(()=>null)]);return{health:t,resources:e}}a(W,"featureVitals");async function at(){let t=W(),e=k().catch(()=>[]),n=await M(),r=await T(),s=await y(),f=await O(),l=await _(L),u=J(s,w(),l),{health:p,resources:c}=await t,i=[];for(let[o,m]of H(s)){let h=V(await j(o)),S=await R(o),b=c?.projects[S],d=p.get(S);i.push({name:o,slot:m.slot,services:m.services??[],port_range:Q(m.slot),containers:h,containers_running:h.filter(g=>g.status==="running").length,containers_total:h.length,intercepts:u.filter(g=>g.feature===o),cpu_percent:b?.cpuPercent??null,mem_mib:b?.memMib??null,started_at:d?.started?.at??null,started_by:d?.started?.by??null,crash_loops:d?.crashLoops??[]})}return{host:c?.host??null,infrastructure:n,mcp_web_server:f,k8s_forwards:r,features:i,waiting:await A(),caches:await e,summary:{total_features:i.length,available_slots:C()-i.length,infra_healthy:n.length>0&&n.every(o=>o.display==="healthy"||o.display==="running"),k8s_alive:r.filter(o=>o.status==="alive").length,k8s_total:r.length,telepresence_available:l.available,intercepts_active:u.filter(o=>o.intercepted).length}}}a(at,"statusSnapshot");export{M as a,Q as b,U as c,V as d,H as e,J as f,ot as g,W as h,at as i};
4
+ //# sourceMappingURL=chunk-5WJHEJTT.js.map
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __sandboxCreateRequire } from "node:module";
2
2
  const require = __sandboxCreateRequire(import.meta.url);
3
- import{w as p}from"./chunk-TVYHBSWN.js";import{b as m}from"./chunk-O22TMXNP.js";import{a as n,f as a}from"./chunk-KPIXRVP2.js";a();import{randomBytes as u}from"node:crypto";import*as r from"node:fs";import*as o from"node:path";var h="token";function f(){return o.join(p(),"tokens")}n(f,"tokensDir");function l(e){return o.join(m(e),h)}n(l,"workspaceTokenFile");function F(e,s){let i=o.join(f(),e),t="";try{t=r.readFileSync(i,"utf8").trim()}catch{}t||=u(32).toString("hex");for(let c of[i,l(s)])r.mkdirSync(o.dirname(c),{recursive:!0}),r.writeFileSync(c,`${t}
3
+ import{w as p}from"./chunk-VWF2MQHQ.js";import{b as m}from"./chunk-LQIICTKP.js";import{a as n,f as a}from"./chunk-YJATE7FY.js";a();import{randomBytes as u}from"node:crypto";import*as r from"node:fs";import*as o from"node:path";var h="token";function f(){return o.join(p(),"tokens")}n(f,"tokensDir");function l(e){return o.join(m(e),h)}n(l,"workspaceTokenFile");function F(e,s){let i=o.join(f(),e),t="";try{t=r.readFileSync(i,"utf8").trim()}catch{}t||=u(32).toString("hex");for(let c of[i,l(s)])r.mkdirSync(o.dirname(c),{recursive:!0}),r.writeFileSync(c,`${t}
4
4
  `,{mode:384}),r.chmodSync(c,384);return t}n(F,"mintWorkspaceToken");function T(e){r.rmSync(o.join(f(),e),{force:!0})}n(T,"revokeWorkspaceToken");function j(e){let s=new Set(r.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()||t.isSymbolicLink()&&y(o.join(e,t.name))).map(t=>t.name)),i=[];try{i=r.readdirSync(f())}catch{}if(i.length&&!s.size)throw new Error(`no workspace folders found under ${e}`);return i.filter(t=>!s.has(t)).sort()}n(j,"staleTokens");function y(e){try{return r.statSync(e).isDirectory()}catch{return!1}}n(y,"isDir");export{f as a,l as b,F as c,T as d,j as e};
5
- //# sourceMappingURL=chunk-6RXTW4LU.js.map
5
+ //# sourceMappingURL=chunk-6TPYQWQK.js.map
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __sandboxCreateRequire } from "node:module";
2
2
  const require = __sandboxCreateRequire(import.meta.url);
3
- import{a as $,b as g}from"./chunk-O22TMXNP.js";import{a,f as v}from"./chunk-KPIXRVP2.js";v();import*as l from"node:fs";import*as i from"node:path";var A="Precedence: these standards' rules win over conflicting task framing \u2014 if a rule and the task clash, follow the rule and say so (invariant: apply it and write a `decision` note; rule: surface the conflict in one line, then apply). This gate fires once; your retry will proceed.",j="Standards gate: invoke `w9r-implement` before coding \u2014 it loads the universal base (ponytail + comments + engineering) and the workspace notes. Then retry this edit.";function D(t){let e="",n=0,r=t.length;for(;n<r;){let o=t[n];if(n+=1,o==="*")e+=".*";else if(o==="?")e+=".";else if(o==="["){let s=n;for(s<r&&t[s]==="!"&&(s+=1),s<r&&t[s]==="]"&&(s+=1);s<r&&t[s]!=="]";)s+=1;if(s>=r)e+="\\[";else{let c=t.slice(n,s).replace(/\\/g,"\\\\");n=s+1,c.startsWith("!")?c="^"+c.slice(1):c.startsWith("^")&&(c="\\"+c),e+=`[${c}]`}}else e+=o.replace(/[.+^${}()|[\]\\]/g,"\\$&")}return`^(?:${e})$`}a(D,"_translate");function F(t,e){return new RegExp(D(e),"s").test(t)}a(F,"fnmatch");function O(t,e){let n=T(t);for(let r of e){let o=T(r),s=i.relative(o,n);if(!(s===""||s===".."||s.startsWith(".."+i.sep)||i.isAbsolute(s)))return i.join(o,s.split(i.sep)[0])}return null}a(O,"workspaceUnder");function T(t){try{return l.realpathSync(t)}catch{return i.resolve(t)}}a(T,"_realpath");function R(t,e){if(e){let r=O(t,e);return r!==null&&E(g(r))?r:null}let n=i.resolve(t);for(;;){if(E(g(n)))return n;let r=i.dirname(n);if(r===n)return null;n=r}}a(R,"findWorkspaceRoot");function E(t){try{return l.statSync(t).isDirectory()}catch{return!1}}a(E,"_isDir");function P(t){try{return l.statSync(t).isFile()}catch{return!1}}a(P,"_isFile");function p(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(p,"_isDict");function W(t){let e=i.join(g(t),"standards.json");if(!P(e))return null;let n;try{n=JSON.parse(l.readFileSync(e,"utf8"))}catch{return null}return p(n)?n:null}a(W,"loadManifest");function k(t,e){return i.join(g(t),".gate",`${e}.json`)}a(k,"_statePath");function C(t,e){let n=k(t,e);if(!P(n))return{};let r;try{r=JSON.parse(l.readFileSync(n,"utf8"))}catch{return null}return p(r)?r:null}a(C,"_loadState");function J(t,e,n){try{let r=k(t,e);return l.mkdirSync(i.dirname(r),{recursive:!0}),l.writeFileSync(r,JSON.stringify(n)),!0}catch{return!1}}a(J,"_saveState");function q(t,e){if(!(!e||e.includes("/")||e.includes("..")))try{l.unlinkSync(k(t,e))}catch{}}a(q,"resetSessionState");function N(t){return[...t].sort()}a(N,"_sorted");function G(t){let e=/^---\r?\n([\s\S]*?)\r?\n---/.exec(t);if(!e)return;let n=/^status:\s*["']?([^\s"'#]+)/m.exec(e[1]);return n?n[1].toLowerCase():null}a(G,"_noteStatus");function H(t,e){let n=String(e.note??"");if(!/^[a-z]+$/.test(n))return!0;let r=e.status?String(e.status).toLowerCase():null,o=i.join(g(t),"notes"),s;try{s=l.readdirSync(o)}catch(u){return u.code!=="ENOENT"}let c=new RegExp(`^\\d{3}-${n}-.+\\.md$`);for(let u of s){if(!c.test(u))continue;let f;try{f=l.readFileSync(i.join(o,u),"utf8")}catch{return!0}let d=G(f);if(d===void 0)return!0;if(!(d==="superseded"||d==="graduated")&&(r===null||d===r))return!0}return!1}a(H,"_phaseGateSatisfied");function U(t){let e=String(t.note);if(t.status){let n=String(t.status);return`Phase gate: no \`${e}\` note in \`.werkmeister/notes/\` has \`status: ${n}\`, so source edits wait for an approved design. Invoke \`w9r-research\`, present the design to the user, and when they approve write \`NNN-${e}-<slug>.md\` with \`status: ${n}\` recording what was approved. Then retry this edit. Edits under \`.werkmeister/\` are not gated.`}return`Phase gate: no \`${e}\` note in \`.werkmeister/notes/\` names the root cause yet. Invoke \`w9r-research\`, reproduce the problem, and write \`NNN-${e}-<slug>.md\` stating the root cause. Then retry this edit. Edits under \`.werkmeister/\` are not gated.`}a(U,"_phaseGateText");function L(t,e,n){if(!e||e.includes("/")||e.includes(".."))return null;let r=R(t);if(r===null)return null;let o=W(r);if(o===null)return null;let s=C(r,e);if(s===null)return null;let c=n?i.relative(r,n):"",u=o.phase_gate;if(p(u)&&c&&c!==".."&&!c.startsWith(".."+i.sep)&&!i.isAbsolute(c)&&!c.startsWith($+i.sep)&&!H(r,u))return U(u);let f=new Set(Array.isArray(s.delivered)?s.delivered:[]),d=!s.phase_entry_delivered,h=null,S=p(o.domains)?o.domains:{};for(let m of N(Object.keys(S))){let y=S[m];if(f.has(m)||!p(y))continue;if((Array.isArray(y.applies_to)?y.applies_to:[]).some(b=>F(c,String(b)))){h=m;break}}if(!d&&h===null)return null;let w=[];if(d&&w.push(j),h!==null){let m=S[h],y=String(p(m)&&m.summary||"").trim(),_=`Standards gate: you are editing a path governed by the \`${h}\` standard, which has not been loaded this session. Invoke the \`w9r-${h}-standard\` skill, then retry this edit.`;y&&(_+=` Summary: ${y}.`),w.push(_)}w.push(A);let x={phase_entry_delivered:!0,delivered:N(h?new Set([...f,h]):f)};return J(r,e,x)?w.join(`
3
+ import{a as $,b as g}from"./chunk-LQIICTKP.js";import{a,f as v}from"./chunk-YJATE7FY.js";v();import*as l from"node:fs";import*as i from"node:path";var A="Precedence: these standards' rules win over conflicting task framing \u2014 if a rule and the task clash, follow the rule and say so (invariant: apply it and write a `decision` note; rule: surface the conflict in one line, then apply). This gate fires once; your retry will proceed.",j="Standards gate: invoke `w9r-implement` before coding \u2014 it loads the universal base (ponytail + comments + engineering) and the workspace notes. Then retry this edit.";function D(t){let e="",n=0,r=t.length;for(;n<r;){let o=t[n];if(n+=1,o==="*")e+=".*";else if(o==="?")e+=".";else if(o==="["){let s=n;for(s<r&&t[s]==="!"&&(s+=1),s<r&&t[s]==="]"&&(s+=1);s<r&&t[s]!=="]";)s+=1;if(s>=r)e+="\\[";else{let c=t.slice(n,s).replace(/\\/g,"\\\\");n=s+1,c.startsWith("!")?c="^"+c.slice(1):c.startsWith("^")&&(c="\\"+c),e+=`[${c}]`}}else e+=o.replace(/[.+^${}()|[\]\\]/g,"\\$&")}return`^(?:${e})$`}a(D,"_translate");function F(t,e){return new RegExp(D(e),"s").test(t)}a(F,"fnmatch");function O(t,e){let n=T(t);for(let r of e){let o=T(r),s=i.relative(o,n);if(!(s===""||s===".."||s.startsWith(".."+i.sep)||i.isAbsolute(s)))return i.join(o,s.split(i.sep)[0])}return null}a(O,"workspaceUnder");function T(t){try{return l.realpathSync(t)}catch{return i.resolve(t)}}a(T,"_realpath");function R(t,e){if(e){let r=O(t,e);return r!==null&&E(g(r))?r:null}let n=i.resolve(t);for(;;){if(E(g(n)))return n;let r=i.dirname(n);if(r===n)return null;n=r}}a(R,"findWorkspaceRoot");function E(t){try{return l.statSync(t).isDirectory()}catch{return!1}}a(E,"_isDir");function P(t){try{return l.statSync(t).isFile()}catch{return!1}}a(P,"_isFile");function p(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(p,"_isDict");function W(t){let e=i.join(g(t),"standards.json");if(!P(e))return null;let n;try{n=JSON.parse(l.readFileSync(e,"utf8"))}catch{return null}return p(n)?n:null}a(W,"loadManifest");function k(t,e){return i.join(g(t),".gate",`${e}.json`)}a(k,"_statePath");function C(t,e){let n=k(t,e);if(!P(n))return{};let r;try{r=JSON.parse(l.readFileSync(n,"utf8"))}catch{return null}return p(r)?r:null}a(C,"_loadState");function J(t,e,n){try{let r=k(t,e);return l.mkdirSync(i.dirname(r),{recursive:!0}),l.writeFileSync(r,JSON.stringify(n)),!0}catch{return!1}}a(J,"_saveState");function q(t,e){if(!(!e||e.includes("/")||e.includes("..")))try{l.unlinkSync(k(t,e))}catch{}}a(q,"resetSessionState");function N(t){return[...t].sort()}a(N,"_sorted");function G(t){let e=/^---\r?\n([\s\S]*?)\r?\n---/.exec(t);if(!e)return;let n=/^status:\s*["']?([^\s"'#]+)/m.exec(e[1]);return n?n[1].toLowerCase():null}a(G,"_noteStatus");function H(t,e){let n=String(e.note??"");if(!/^[a-z]+$/.test(n))return!0;let r=e.status?String(e.status).toLowerCase():null,o=i.join(g(t),"notes"),s;try{s=l.readdirSync(o)}catch(u){return u.code!=="ENOENT"}let c=new RegExp(`^\\d{3}-${n}-.+\\.md$`);for(let u of s){if(!c.test(u))continue;let f;try{f=l.readFileSync(i.join(o,u),"utf8")}catch{return!0}let d=G(f);if(d===void 0)return!0;if(!(d==="superseded"||d==="graduated")&&(r===null||d===r))return!0}return!1}a(H,"_phaseGateSatisfied");function U(t){let e=String(t.note);if(t.status){let n=String(t.status);return`Phase gate: no \`${e}\` note in \`.werkmeister/notes/\` has \`status: ${n}\`, so source edits wait for an approved design. Invoke \`w9r-research\`, present the design to the user, and when they approve write \`NNN-${e}-<slug>.md\` with \`status: ${n}\` recording what was approved. Then retry this edit. Edits under \`.werkmeister/\` are not gated.`}return`Phase gate: no \`${e}\` note in \`.werkmeister/notes/\` names the root cause yet. Invoke \`w9r-research\`, reproduce the problem, and write \`NNN-${e}-<slug>.md\` stating the root cause. Then retry this edit. Edits under \`.werkmeister/\` are not gated.`}a(U,"_phaseGateText");function L(t,e,n){if(!e||e.includes("/")||e.includes(".."))return null;let r=R(t);if(r===null)return null;let o=W(r);if(o===null)return null;let s=C(r,e);if(s===null)return null;let c=n?i.relative(r,n):"",u=o.phase_gate;if(p(u)&&c&&c!==".."&&!c.startsWith(".."+i.sep)&&!i.isAbsolute(c)&&!c.startsWith($+i.sep)&&!H(r,u))return U(u);let f=new Set(Array.isArray(s.delivered)?s.delivered:[]),d=!s.phase_entry_delivered,h=null,S=p(o.domains)?o.domains:{};for(let m of N(Object.keys(S))){let y=S[m];if(f.has(m)||!p(y))continue;if((Array.isArray(y.applies_to)?y.applies_to:[]).some(b=>F(c,String(b)))){h=m;break}}if(!d&&h===null)return null;let w=[];if(d&&w.push(j),h!==null){let m=S[h],y=String(p(m)&&m.summary||"").trim(),_=`Standards gate: you are editing a path governed by the \`${h}\` standard, which has not been loaded this session. Invoke the \`w9r-${h}-standard\` skill, then retry this edit.`;y&&(_+=` Summary: ${y}.`),w.push(_)}w.push(A);let x={phase_entry_delivered:!0,delivered:N(h?new Set([...f,h]):f)};return J(r,e,x)?w.join(`
4
4
  `):null}a(L,"decide");var M=/^\*\*\* (?:Add File|Update File|Delete File|Move to): (.+)$/gm;function X(t){return[...new Set([...t.matchAll(M)].map(e=>e[1].trim()))]}a(X,"patchPaths");function B(){let t;try{let f=process.stdin.isTTY?"":l.readFileSync(0,"utf8"),d=f.trim()?JSON.parse(f):{};t=p(d)?d:{}}catch{t={}}let e=String(t.session_id||""),n=t.tool_input,r=p(n)?n:{},o=String(t.cwd||process.cwd()),s=t.tool_name==="apply_patch"?r.command:void 0,c=typeof s=="string"?X(s).map(f=>i.resolve(o,f)):[String(r.file_path||"")],u=null;try{for(let f of c)if(u=L(o,e,f),u)break}catch{u=null}u&&console.log(JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:u}}))}a(B,"main");export{O as a,R as b,W as c,q as d,B as e};
5
- //# sourceMappingURL=chunk-XNHLRR2R.js.map
5
+ //# sourceMappingURL=chunk-6U2SNX3K.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{a as c,f as p}from"./chunk-KPIXRVP2.js";p();function k(e){let t=e.resolved_value;return(t==null||t==="")&&(t=e.default),t||""}c(k,"_default");function q(e){return e.accept_empty===!1||!!e.recommended}c(q,"_required");function w(e,t,n,o){let i=e.choices,s=Array.isArray(i)&&i.length>0;if(e.boolean)return n.type="boolean",t===!0||t==="true";if(e.multi&&s)return Object.assign(n,{type:"array",uniqueItems:!0,items:{type:"string",enum:i}}),o["ui:widget"]="checkboxes",e.choice_groups&&(o["ui:options"]={groups:e.choice_groups}),t?String(t).split(",").map(r=>r.trim()).filter(r=>r):null;if(s)return Object.assign(n,{type:"string",enum:i}),t||null;if(n.type="string",e.multiline&&(o["ui:widget"]="textarea",e.refinable)){let r={refinable:!0};e.refine_instruction&&(r.refineInstruction=e.refine_instruction),o["ui:options"]=r}return t||null}c(w,"_shape");function m(e){let t={title:e.label||e.key};e.help&&(t.description=e.help);let n={},o=k(e),i=w(e,o,t,n),s=q(e),r=e.pattern;return r&&t.type==="string"&&!("enum"in t)&&(t.pattern=s?r:`^$|(?:${r})`),e.placeholder&&(n["ui:placeholder"]=e.placeholder),s&&t.type==="string"&&(t.minLength=1),[t,n,i,s]}c(m,"_field");function A(e,t){let n={},o=[],i=[],s={},r={};for(let f of e.prompts??[]){if(f.resolved)continue;let d=f.key;i.push(d);let[b,h,g,_]=m(f);n[d]=b,g!==null&&(r[d]=g),_&&o.push(d),i.length===1&&(h["ui:autofocus"]=!0),Object.keys(h).length&&(s[d]=h)}let u=e.workspace_name||"workspace",a=t||`Initialize ${u}`,l={type:"object",title:a,properties:n};return o.length&&(l.required=o),i.length&&(s["ui:order"]=i),{schema:l,uiSchema:s,formData:r,title:a}}c(A,"buildFormSchema");function v(e){let t=c(n=>Array.isArray(n)?n.filter(Boolean).length:0,"picked");return t(e.services)+t(e.repos)>0?null:"Select at least one service (or add a repo below) \u2014 a workspace needs at least one repo."}c(v,"repoSelectionError");var y=c(e=>e==null||e===""||Array.isArray(e)&&e.length===0,"blank");function j(e,t){let n={},o=new Set(e.schema.required??[]);for(let[s,r]of Object.entries(e.schema.properties??{})){let u=t[s];if(y(u)){o.has(s)&&(n[s]="required");continue}let a=r.type==="array"?r.items?.enum:r.enum,l=a?(Array.isArray(u)?u:[u]).filter(f=>!a.includes(f)):[];l.length?n[s]=`not offered: ${l.join(", ")}`:r.pattern&&typeof u=="string"&&!new RegExp(r.pattern).test(u)&&(n[s]=`"${u}" doesn't match the expected format`)}let i=v(t);return i&&!n.services&&(n.services=i),n}c(j,"validateFormData");function S(e,t){let n={...e};for(let[o,i]of Object.entries(t))!y(i)&&y(n[o])&&(n[o]=i);return typeof t.issue_id=="string"&&t.issue_id&&(n.issue_id=t.issue_id),n}c(S,"mergeFormData");export{A as a,v as b,j as c,S as d};
4
- //# sourceMappingURL=chunk-OMLAA2E2.js.map
3
+ import{a as c,f as p}from"./chunk-YJATE7FY.js";p();function k(e){let t=e.resolved_value;return(t==null||t==="")&&(t=e.default),t||""}c(k,"_default");function q(e){return e.accept_empty===!1||!!e.recommended}c(q,"_required");function w(e,t,n,o){let i=e.choices,s=Array.isArray(i)&&i.length>0;if(e.boolean)return n.type="boolean",t===!0||t==="true";if(e.multi&&s)return Object.assign(n,{type:"array",uniqueItems:!0,items:{type:"string",enum:i}}),o["ui:widget"]="checkboxes",e.choice_groups&&(o["ui:options"]={groups:e.choice_groups}),t?String(t).split(",").map(r=>r.trim()).filter(r=>r):null;if(s)return Object.assign(n,{type:"string",enum:i}),t||null;if(n.type="string",e.multiline&&(o["ui:widget"]="textarea",e.refinable)){let r={refinable:!0};e.refine_instruction&&(r.refineInstruction=e.refine_instruction),o["ui:options"]=r}return t||null}c(w,"_shape");function m(e){let t={title:e.label||e.key};e.help&&(t.description=e.help);let n={},o=k(e),i=w(e,o,t,n),s=q(e),r=e.pattern;return r&&t.type==="string"&&!("enum"in t)&&(t.pattern=s?r:`^$|(?:${r})`),e.placeholder&&(n["ui:placeholder"]=e.placeholder),s&&t.type==="string"&&(t.minLength=1),[t,n,i,s]}c(m,"_field");function A(e,t){let n={},o=[],i=[],s={},r={};for(let f of e.prompts??[]){if(f.resolved)continue;let d=f.key;i.push(d);let[b,h,g,_]=m(f);n[d]=b,g!==null&&(r[d]=g),_&&o.push(d),i.length===1&&(h["ui:autofocus"]=!0),Object.keys(h).length&&(s[d]=h)}let u=e.workspace_name||"workspace",a=t||`Initialize ${u}`,l={type:"object",title:a,properties:n};return o.length&&(l.required=o),i.length&&(s["ui:order"]=i),{schema:l,uiSchema:s,formData:r,title:a}}c(A,"buildFormSchema");function v(e){let t=c(n=>Array.isArray(n)?n.filter(Boolean).length:0,"picked");return t(e.services)+t(e.repos)>0?null:"Select at least one service (or add a repo below) \u2014 a workspace needs at least one repo."}c(v,"repoSelectionError");var y=c(e=>e==null||e===""||Array.isArray(e)&&e.length===0,"blank");function j(e,t){let n={},o=new Set(e.schema.required??[]);for(let[s,r]of Object.entries(e.schema.properties??{})){let u=t[s];if(y(u)){o.has(s)&&(n[s]="required");continue}let a=r.type==="array"?r.items?.enum:r.enum,l=a?(Array.isArray(u)?u:[u]).filter(f=>!a.includes(f)):[];l.length?n[s]=`not offered: ${l.join(", ")}`:r.pattern&&typeof u=="string"&&!new RegExp(r.pattern).test(u)&&(n[s]=`"${u}" doesn't match the expected format`)}let i=v(t);return i&&!n.services&&(n.services=i),n}c(j,"validateFormData");function S(e,t){let n={...e};for(let[o,i]of Object.entries(t))!y(i)&&y(n[o])&&(n[o]=i);return typeof t.issue_id=="string"&&t.issue_id&&(n.issue_id=t.issue_id),n}c(S,"mergeFormData");export{A as a,v as b,j as c,S as d};
4
+ //# sourceMappingURL=chunk-73QKXDC6.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{a as R}from"./chunk-XNPHA7HX.js";import{o as x,s as j}from"./chunk-HLTNOAF7.js";import{c as y}from"./chunk-4TZAFRQL.js";import{a as i,e as F,f as b}from"./chunk-KPIXRVP2.js";b();var g=F(R(),1);import{spawn as D}from"node:child_process";import L from"node:fs/promises";import l from"node:path";var S=import.meta.filename.endsWith(".ts")?l.join(import.meta.dirname,"..","..","dist"):l.basename(import.meta.dirname)==="lib"?l.join(import.meta.dirname,".."):import.meta.dirname;function C(o){let e=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",c=process.platform==="win32"?["/c","start","",o]:[o];try{D(e,c,{detached:!0,stdio:"ignore"}).unref()}catch{}}i(C,"openBrowser");function k(o){if(!o)return!1;let e=o.replace(/:\d+$/,"").replace(/^\[|\]$/g,"");return e==="localhost"||e==="127.0.0.1"||e==="::1"}i(k,"isLocalHost");function I(o,e,c){let m=o.headers.origin;if(m){let s=null;try{s=new URL(m).hostname}catch{}if(!k(s??void 0)){e.status(403).json({error:"cross-origin request refused"});return}}if(!k(o.headers.host)){e.status(403).json({error:"non-local host refused"});return}c()}i(I,"localOnly");function P(o,e={}){let c=e.timeoutMs??6e5;return new Promise(m=>{let s=(0,g.default)();s.use(g.default.json({limit:"1mb"}));let w=!1,d,u=i(n=>{w||(w=!0,d&&clearTimeout(d),setTimeout(()=>f.close(()=>m(n)),50))},"settle");s.get("/",async(n,t)=>{try{let p=await L.readFile(l.join(S,"form.html"),"utf-8");t.type("html").send(p)}catch{t.status(500).type("text").send("Form UI bundle missing \u2014 run `pnpm run build` in apps/werkmeister-dashboard.")}}),s.post("/api/tool",I,async(n,t)=>{let{name:p,arguments:a}=n.body??{};try{switch(p){case"workspace-form-schema":t.json({structuredContent:o});return;case"refine-prompt":{let r=a??{},h=await x(r.text??"",r.instruction??"",r.formData);t.json({structuredContent:{refined:h}});return}case"issue-form-data":{let r=typeof a?.ref=="string"?a.ref:"";t.json({structuredContent:{formData:await j(r)}});return}case"create-workspace":t.json({structuredContent:{output:"Submitted \u2014 return to Claude; the workspace is being created there."}}),u({status:"submitted",formData:a?.formData??{},open:typeof a?.open=="boolean"?a.open:void 0});return;case"cancel-form":t.json({structuredContent:null}),u({status:"cancelled"});return;default:t.status(400).json({error:`unknown tool ${String(p)}`})}}catch(r){let h=(r instanceof y,r.message);t.status(500).json({error:h})}});let f=s.listen(0,"127.0.0.1",()=>{let{port:n}=f.address(),t=`http://127.0.0.1:${n}/`;console.error(`[workspaces] workspace form: ${t}`),e.open!==!1&&C(t)});f.on("error",()=>u({status:"cancelled"})),d=setTimeout(()=>u({status:"timeout"}),c)})}i(P,"promptViaLocalhostForm");export{I as a,P as b};
4
- //# sourceMappingURL=chunk-F4U3AMMH.js.map
3
+ import{a as R}from"./chunk-U5V4AE7H.js";import{o as x,s as j}from"./chunk-XZPFZOFJ.js";import{c as y}from"./chunk-BRV6D7JW.js";import{a as i,e as F,f as b}from"./chunk-YJATE7FY.js";b();var g=F(R(),1);import{spawn as D}from"node:child_process";import L from"node:fs/promises";import l from"node:path";var S=import.meta.filename.endsWith(".ts")?l.join(import.meta.dirname,"..","..","dist"):l.basename(import.meta.dirname)==="lib"?l.join(import.meta.dirname,".."):import.meta.dirname;function C(o){let e=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",c=process.platform==="win32"?["/c","start","",o]:[o];try{D(e,c,{detached:!0,stdio:"ignore"}).unref()}catch{}}i(C,"openBrowser");function k(o){if(!o)return!1;let e=o.replace(/:\d+$/,"").replace(/^\[|\]$/g,"");return e==="localhost"||e==="127.0.0.1"||e==="::1"}i(k,"isLocalHost");function I(o,e,c){let m=o.headers.origin;if(m){let s=null;try{s=new URL(m).hostname}catch{}if(!k(s??void 0)){e.status(403).json({error:"cross-origin request refused"});return}}if(!k(o.headers.host)){e.status(403).json({error:"non-local host refused"});return}c()}i(I,"localOnly");function P(o,e={}){let c=e.timeoutMs??6e5;return new Promise(m=>{let s=(0,g.default)();s.use(g.default.json({limit:"1mb"}));let w=!1,d,u=i(n=>{w||(w=!0,d&&clearTimeout(d),setTimeout(()=>f.close(()=>m(n)),50))},"settle");s.get("/",async(n,t)=>{try{let p=await L.readFile(l.join(S,"form.html"),"utf-8");t.type("html").send(p)}catch{t.status(500).type("text").send("Form UI bundle missing \u2014 run `pnpm run build` in apps/werkmeister-dashboard.")}}),s.post("/api/tool",I,async(n,t)=>{let{name:p,arguments:a}=n.body??{};try{switch(p){case"workspace-form-schema":t.json({structuredContent:o});return;case"refine-prompt":{let r=a??{},h=await x(r.text??"",r.instruction??"",r.formData);t.json({structuredContent:{refined:h}});return}case"issue-form-data":{let r=typeof a?.ref=="string"?a.ref:"";t.json({structuredContent:{formData:await j(r)}});return}case"create-workspace":t.json({structuredContent:{output:"Submitted \u2014 return to Claude; the workspace is being created there."}}),u({status:"submitted",formData:a?.formData??{},open:typeof a?.open=="boolean"?a.open:void 0});return;case"cancel-form":t.json({structuredContent:null}),u({status:"cancelled"});return;default:t.status(400).json({error:`unknown tool ${String(p)}`})}}catch(r){let h=(r instanceof y,r.message);t.status(500).json({error:h})}});let f=s.listen(0,"127.0.0.1",()=>{let{port:n}=f.address(),t=`http://127.0.0.1:${n}/`;console.error(`[workspaces] workspace form: ${t}`),e.open!==!1&&C(t)});f.on("error",()=>u({status:"cancelled"})),d=setTimeout(()=>u({status:"timeout"}),c)})}i(P,"promptViaLocalhostForm");export{I as a,P as b};
4
+ //# sourceMappingURL=chunk-7INXBU6Y.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-KPIXRVP2.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-YJATE7FY.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-KPIXRVP2.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-FQEP2RZP.js.map
11
+ //# sourceMappingURL=chunk-A5MAGECY.js.map