werkmeister 0.96.1 → 0.96.3

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 (154) hide show
  1. package/dist/{budget-ADP6XATE.js → budget-BY7UHDWV.js} +2 -2
  2. package/dist/{cache-WGVB3HHY.js → cache-KU2OR24G.js} +2 -2
  3. package/dist/{chunk-XKV6PKER.js → chunk-2CGM6YPC.js} +2 -2
  4. package/dist/{chunk-ANG6K7AX.js → chunk-2KSHRJ7Z.js} +2 -2
  5. package/dist/{chunk-QSUU3YHI.js → chunk-2PUTXWSQ.js} +2 -2
  6. package/dist/{chunk-EBHSLKSS.js → chunk-2QN5A2HQ.js} +2 -2
  7. package/dist/{chunk-GJ3SYTXH.js → chunk-3MWOBACO.js} +2 -2
  8. package/dist/{chunk-QEBQN6GO.js → chunk-3QWL4KRQ.js} +2 -2
  9. package/dist/{chunk-QTPEKM7P.js → chunk-3XZESG5R.js} +2 -2
  10. package/dist/{chunk-PZ2GDA2C.js → chunk-44YXA4EM.js} +2 -2
  11. package/dist/{chunk-CTREWDO3.js → chunk-5DHOCYKT.js} +2 -2
  12. package/dist/chunk-5GYW24OF.js +118 -0
  13. package/dist/{chunk-LWL7B4OC.js → chunk-5IYELKXT.js} +2 -2
  14. package/dist/{chunk-O5HTMFMB.js → chunk-7DIPOY72.js} +2 -2
  15. package/dist/{chunk-TDM4JRLR.js → chunk-7MCHFA45.js} +2 -2
  16. package/dist/{chunk-L72JRLVB.js → chunk-7PRAEUOZ.js} +2 -2
  17. package/dist/{chunk-7LHFC6EU.js → chunk-7ZI2INQ5.js} +2 -2
  18. package/dist/{chunk-F2F7DR6E.js → chunk-AU2TCXHC.js} +2 -2
  19. package/dist/{chunk-R43MNY77.js → chunk-AUM7GNGM.js} +5 -5
  20. package/dist/{chunk-VZZHDVWL.js → chunk-AVKAJV52.js} +2 -2
  21. package/dist/{chunk-23CYJTFR.js → chunk-AW7S6HT3.js} +2 -2
  22. package/dist/{chunk-7I3LWYUX.js → chunk-B4WTMVEB.js} +2 -2
  23. package/dist/{chunk-YKLBFW3R.js → chunk-BSWADTOC.js} +2 -2
  24. package/dist/{chunk-PMKHQT2Q.js → chunk-CVOMHLJC.js} +2 -2
  25. package/dist/{chunk-CUU6Z3X5.js → chunk-DW6UXWTB.js} +2 -2
  26. package/dist/{chunk-7P3DWOGC.js → chunk-EKGVTRCP.js} +2 -2
  27. package/dist/{chunk-KM7POFKW.js → chunk-FEHRNZT3.js} +2 -2
  28. package/dist/{chunk-VHKVUXJ6.js → chunk-G6EFFT7P.js} +2 -2
  29. package/dist/chunk-GQEKUI55.js +43 -0
  30. package/dist/{chunk-BVIKBQAH.js → chunk-H3RW6C4N.js} +2 -2
  31. package/dist/{chunk-RJ6XDQIX.js → chunk-HFTT5WN7.js} +2 -2
  32. package/dist/{chunk-X3BVHQBV.js → chunk-HMWFRFSI.js} +2 -2
  33. package/dist/{chunk-6MT6DRTH.js → chunk-HOO6MAOY.js} +3 -3
  34. package/dist/{chunk-JVZO2PPL.js → chunk-HWUOYPJK.js} +2 -2
  35. package/dist/{chunk-4PPE3D2O.js → chunk-I2MHOTP3.js} +2 -2
  36. package/dist/{chunk-KRCHSWAM.js → chunk-I6B3IHA6.js} +2 -2
  37. package/dist/{chunk-775A5XJ5.js → chunk-IBCKPBDX.js} +2 -2
  38. package/dist/chunk-INMHGD7I.js +4 -0
  39. package/dist/{chunk-D2NVDPPY.js → chunk-JOH2PMI7.js} +2 -2
  40. package/dist/{chunk-NMRHVWPW.js → chunk-KDYY6IOI.js} +2 -2
  41. package/dist/{chunk-DH7Q4APV.js → chunk-KOVPNRGU.js} +2 -2
  42. package/dist/{chunk-2IVVFZZJ.js → chunk-KSS5GZIU.js} +2 -2
  43. package/dist/{chunk-NXKWXJCV.js → chunk-L6KNLWI2.js} +2 -2
  44. package/dist/{chunk-MMKJQM4D.js → chunk-LK4PDYKU.js} +3 -3
  45. package/dist/{chunk-ZIPGL36M.js → chunk-LLRAUXPI.js} +2 -2
  46. package/dist/{chunk-RH4P5LFS.js → chunk-LUDZPDBU.js} +2 -2
  47. package/dist/{chunk-OKGMYOT7.js → chunk-LY3ZWJMJ.js} +2 -2
  48. package/dist/{chunk-75IHWBQF.js → chunk-NAOCP6YZ.js} +2 -2
  49. package/dist/{chunk-FBQ33N6I.js → chunk-OEKE6Z4K.js} +2 -2
  50. package/dist/{chunk-Q2JJ2QUS.js → chunk-P5NSN5NS.js} +2 -2
  51. package/dist/{chunk-PEDMLT4J.js → chunk-PMS6GXID.js} +3 -3
  52. package/dist/{chunk-THOV4TCW.js → chunk-QIYYQLEA.js} +2 -2
  53. package/dist/{chunk-BNAXFXZZ.js → chunk-QMHRB7DX.js} +2 -2
  54. package/dist/{chunk-SJOQJFJS.js → chunk-QYEESXBZ.js} +2 -2
  55. package/dist/{chunk-TVN25JD2.js → chunk-RWUYXYDU.js} +2 -2
  56. package/dist/chunk-SHPWUXGO.js +13 -0
  57. package/dist/{chunk-APUXJWRW.js → chunk-SIHBDZUL.js} +2 -2
  58. package/dist/{chunk-WT2JKYQN.js → chunk-SKOHUBCV.js} +2 -2
  59. package/dist/{chunk-BC4YRJ7Z.js → chunk-U5YTYX2C.js} +2 -2
  60. package/dist/{chunk-PWQHXKUT.js → chunk-VRIOJE2R.js} +2 -2
  61. package/dist/{chunk-OHSDQB5O.js → chunk-VXFRUABZ.js} +2 -2
  62. package/dist/{chunk-DVPC46VE.js → chunk-WPEUGJSF.js} +2 -2
  63. package/dist/{chunk-CTXCJLSF.js → chunk-WT5JJ7XV.js} +2 -2
  64. package/dist/{chunk-APFV3VIB.js → chunk-XK5XPYGK.js} +2 -2
  65. package/dist/{chunk-VEXRAN7A.js → chunk-YXBFFIVC.js} +2 -2
  66. package/dist/{chunk-JNJEP5WQ.js → chunk-ZMQWWONH.js} +2 -2
  67. package/dist/chunk-ZSB7NGEL.js +12 -0
  68. package/dist/clean-CWWWP27U.js +8 -0
  69. package/dist/close_out-5ANHYMLR.js +8 -0
  70. package/dist/code-HSDXK5T3.js +4 -0
  71. package/dist/{config-4TNLULY6.js → config-R546D6JE.js} +2 -2
  72. package/dist/{connect-NQDZIRVB.js → connect-SP4CLM7M.js} +2 -2
  73. package/dist/{daemon-F72G4JQ4.js → daemon-HZV22VRH.js} +2 -2
  74. package/dist/dashboard.js +1 -1
  75. package/dist/{detect-BG4RNLTU.js → detect-UX4OBVGN.js} +2 -2
  76. package/dist/{down-QMGPFITF.js → down-2XHPUJQR.js} +3 -3
  77. package/dist/{fixture-IN7OP6RN.js → fixture-ALII4KSW.js} +2 -2
  78. package/dist/form-cli.js +1 -1
  79. package/dist/hooks-GTMJ77KM.js +4 -0
  80. package/dist/{hooks_gen-SGJZQKVL.js → hooks_gen-SB22JWDQ.js} +2 -2
  81. package/dist/infra-7J6OBODY.js +4 -0
  82. package/dist/init_workspace-AVQOGN4J.js +4 -0
  83. package/dist/{intercept-DAVMNTEU.js → intercept-HVPFQVGL.js} +2 -2
  84. package/dist/{issue-Z4VVOXE4.js → issue-UVOGQGFX.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-TZE72LGR.js +7 -0
  89. package/dist/logs-HGTSTGP6.js +6 -0
  90. package/dist/main.js +9 -9
  91. package/dist/mcp-proxy.js +1 -1
  92. package/dist/mcp.js +1 -1
  93. package/dist/{migrate-XJUZGAX7.js → migrate-5HIWFU2Z.js} +2 -2
  94. package/dist/notes-24DBTQBS.js +4 -0
  95. package/dist/{open-4ANF2TU4.js → open-M3YGSQBZ.js} +2 -2
  96. package/dist/{optimize-WIIAMR2M.js → optimize-S26SANYJ.js} +2 -2
  97. package/dist/pause-JANP44KU.js +4 -0
  98. package/dist/pr-3ARQQGIX.js +5 -0
  99. package/dist/proxy_reload-AXST6BQP.js +6 -0
  100. package/dist/{registry-DUQWE674.js → registry-XOCMU6MP.js} +2 -2
  101. package/dist/remove-I5UHGQRD.js +7 -0
  102. package/dist/remove_workspace-ELA2LFCZ.js +8 -0
  103. package/dist/restart-7B2IQAC4.js +8 -0
  104. package/dist/resume-23RRQ7C3.js +8 -0
  105. package/dist/{safari-4RJMPJ4C.js → safari-4QMHL4US.js} +2 -2
  106. package/dist/{sandbox-ZG5VYHKE.js → sandbox-RWF2FN35.js} +2 -2
  107. package/dist/{services-U45X6EJT.js → services-EO3PGPTL.js} +2 -2
  108. package/dist/{setup-5L43EARW.js → setup-A4VXLDBV.js} +2 -2
  109. package/dist/skills-KPNBUYDE.js +4 -0
  110. package/dist/slots-N3RQ63YG.js +4 -0
  111. package/dist/{standards-TTWZF3HT.js → standards-GWM7FO7E.js} +2 -2
  112. package/dist/start_args-3OMA4XVN.js +4 -0
  113. package/dist/starting_prompt-6DHKTBLK.js +4 -0
  114. package/dist/stats-UIVROPXE.js +4 -0
  115. package/dist/{status-IOXEOUMG.js → status-JXT2JSM2.js} +2 -2
  116. package/dist/{stop-D3L47LQ3.js → stop-TPB47MJP.js} +2 -2
  117. package/dist/{telepresence-JMMQG7E6.js → telepresence-DZTBRQ4S.js} +2 -2
  118. package/dist/{test-GMVFMYJ3.js → test-KANOZ6PV.js} +2 -2
  119. package/dist/{tokens-CH2Y6M5H.js → tokens-5VLANIPP.js} +2 -2
  120. package/dist/{up-JMON4Q7J.js → up-6IQ672XN.js} +5 -5
  121. package/dist/{v4-JPA5L55U.js → v4-VPAYVSIU.js} +2 -2
  122. package/dist/wait_load-67UACCO6.js +4 -0
  123. package/dist/werkmeister-workspaces.vsix +0 -0
  124. package/dist/{workspace-YQTZCTVI.js → workspace-7NDOATRB.js} +2 -2
  125. package/man/werkmeister-feature-up.1 +1 -1
  126. package/man/werkmeister-pr.1 +1 -1
  127. package/package.json +4 -4
  128. package/dist/chunk-D5K2X3AE.js +0 -12
  129. package/dist/chunk-MXLHBRDC.js +0 -43
  130. package/dist/chunk-QRMDJXNX.js +0 -117
  131. package/dist/chunk-XKZDH45Y.js +0 -4
  132. package/dist/chunk-Y56OMR5W.js +0 -13
  133. package/dist/clean-6HBPVRRO.js +0 -8
  134. package/dist/close_out-L3QAHQU2.js +0 -8
  135. package/dist/code-ZFDSTUGB.js +0 -4
  136. package/dist/hooks-2CMF5BOT.js +0 -4
  137. package/dist/infra-2TWHIYKX.js +0 -4
  138. package/dist/init_workspace-LBQ6J64K.js +0 -4
  139. package/dist/list_workspaces-H6WMEXON.js +0 -7
  140. package/dist/logs-BV7CHHYU.js +0 -6
  141. package/dist/notes-X7E34DZT.js +0 -4
  142. package/dist/pause-V7K6UEW5.js +0 -4
  143. package/dist/pr-XJ2DEY7K.js +0 -5
  144. package/dist/proxy_reload-NTDWWWTX.js +0 -6
  145. package/dist/remove-THH4KXDN.js +0 -7
  146. package/dist/remove_workspace-PHOIX5QN.js +0 -8
  147. package/dist/restart-IUM5DIV6.js +0 -8
  148. package/dist/resume-UXJ6N6P3.js +0 -8
  149. package/dist/skills-SUJTM7FU.js +0 -4
  150. package/dist/slots-CIZ4ORA5.js +0 -4
  151. package/dist/start_args-JGELLH7F.js +0 -4
  152. package/dist/starting_prompt-EG74AYOM.js +0 -4
  153. package/dist/stats-HRCTUSB7.js +0 -4
  154. package/dist/wait_load-JONN2ODD.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{e as x,n as L}from"./chunk-MXLHBRDC.js";import"./chunk-7I3LWYUX.js";import"./chunk-JVZO2PPL.js";import"./chunk-TDM4JRLR.js";import"./chunk-OHSDQB5O.js";import"./chunk-QSUU3YHI.js";import"./chunk-APUXJWRW.js";import"./chunk-KM7POFKW.js";import"./chunk-DH7Q4APV.js";import"./chunk-NXKWXJCV.js";import"./chunk-4PPE3D2O.js";import"./chunk-7P3DWOGC.js";import"./chunk-X3BVHQBV.js";import"./chunk-RH4P5LFS.js";import"./chunk-PEDMLT4J.js";import"./chunk-R43MNY77.js";import"./chunk-75IHWBQF.js";import"./chunk-VZZHDVWL.js";import{C as b,D as y,J as w,M as k,R as v,v as g,w as $,x as h}from"./chunk-Y56OMR5W.js";import"./chunk-APFV3VIB.js";import"./chunk-QTPEKM7P.js";import"./chunk-OKGMYOT7.js";import"./chunk-VEXRAN7A.js";import{p as f}from"./chunk-D5K2X3AE.js";import"./chunk-ANG6K7AX.js";import"./chunk-KRCHSWAM.js";import"./chunk-VHKVUXJ6.js";import"./chunk-CTXCJLSF.js";import"./chunk-775A5XJ5.js";import"./chunk-2IVVFZZJ.js";import"./chunk-CTREWDO3.js";import{a as i,f as p}from"./chunk-O5HTMFMB.js";p();import O from"node:os";var S=2**30,M=i((n,t)=>Number.isFinite(n)?`${Number(n.toFixed(1))}${t}`:"no limit","limit");function P(n,t=process.platform){return n?`host load limit ${n}${t==="darwin"?" (not enforced on macOS)":""}`:"host load limit off"}i(P,"hostLoadText");async function T(n){let t=await b(),l=y(O.availableParallelism()),c=h(),m=await v(),r=L(),u=g(k(m,r??[])).map((e,o)=>{let s=c[e.feature]?.workspace,a=s&&f(s)?.services||null,N=s?w(s,a??void 0):null,B=o===0&&e.waitedMs>=3e5&&!e.parked&&$(t,r??[],e);return{...e,position:o+1,services:a,cost:N,holds:B}});if(n.json){let e=i(o=>Number.isFinite(o)?o:null,"n");console.log(JSON.stringify({budget:{memory:e(t.memory),cpus:e(t.cpus),preempt:t.preempt},host_load:l,leases:c,waiting:m,running:r?.map(o=>({feature:o.feature,cpus:o.cost.cpus,memory:o.cost.memory,rank:o.rank,busy:o.busy}))??null,waiters:u.map(o=>({feature:o.feature,position:o.position,services:o.services,cpus:o.cost?.cpus??null,memory:o.cost?.memory??null,waited_ms:o.waitedMs,gate:o.gate}))}));return}console.log(`Budget: ${M(t.memory/S," GiB")} memory, ${M(t.cpus," CPUs")}, ${P(l)}, preemption ${t.preempt?"on":"off"}`);let d=Object.entries(c).sort(([,e],[,o])=>e.slot-o.slot);console.log(d.length?"Slots:":"Slots: none held");for(let[e,o]of d)console.log(` ${o.slot} ${e}${o.workspace?` ${o.workspace}`:""}`);console.log(r?r.length?"Running:":"Running: none":"Running: docker unavailable");for(let e of[...r??[]].sort((o,s)=>s.cost.cpus-o.cost.cpus))console.log(` ${x(e)}`);console.log(u.length?"Waiting:":"Waiting: none");for(let e of u){let o=e.services?`${e.services.join(", ")}${e.gate?" for a running feature":""}`:"whole feature",s=e.cost?` (${Number(e.cost.cpus.toFixed(1))} CPUs, ${(e.cost.memory/S).toFixed(1)} GiB)`:"",a=e.waitedMs?` waited ${Math.round(e.waitedMs/6e4)} min${e.holds?", gets the next free room":""}`:"";console.log(` ${e.position}. ${e.feature} ${o}${s}${a}`)}}i(T,"run");export{P as hostLoadText,T as run};
4
- //# sourceMappingURL=budget-ADP6XATE.js.map
3
+ import{e as x,n as L}from"./chunk-GQEKUI55.js";import"./chunk-B4WTMVEB.js";import"./chunk-HWUOYPJK.js";import"./chunk-7MCHFA45.js";import"./chunk-VXFRUABZ.js";import"./chunk-2PUTXWSQ.js";import"./chunk-SIHBDZUL.js";import"./chunk-FEHRNZT3.js";import"./chunk-KOVPNRGU.js";import"./chunk-L6KNLWI2.js";import"./chunk-I2MHOTP3.js";import"./chunk-EKGVTRCP.js";import"./chunk-HMWFRFSI.js";import"./chunk-LUDZPDBU.js";import"./chunk-PMS6GXID.js";import"./chunk-AUM7GNGM.js";import"./chunk-NAOCP6YZ.js";import"./chunk-AVKAJV52.js";import{D as b,E as y,K as w,N as k,S as v,v as g,w as $,x as h}from"./chunk-SHPWUXGO.js";import"./chunk-XK5XPYGK.js";import"./chunk-3XZESG5R.js";import"./chunk-LY3ZWJMJ.js";import"./chunk-YXBFFIVC.js";import{p as f}from"./chunk-ZSB7NGEL.js";import"./chunk-2KSHRJ7Z.js";import"./chunk-I6B3IHA6.js";import"./chunk-G6EFFT7P.js";import"./chunk-WT5JJ7XV.js";import"./chunk-IBCKPBDX.js";import"./chunk-KSS5GZIU.js";import"./chunk-5DHOCYKT.js";import{a as i,f as p}from"./chunk-7DIPOY72.js";p();import O from"node:os";var S=2**30,M=i((n,t)=>Number.isFinite(n)?`${Number(n.toFixed(1))}${t}`:"no limit","limit");function P(n,t=process.platform){return n?`host load limit ${n}${t==="darwin"?" (not enforced on macOS)":""}`:"host load limit off"}i(P,"hostLoadText");async function T(n){let t=await b(),l=y(O.availableParallelism()),c=h(),m=await v(),r=L(),u=g(k(m,r??[])).map((e,o)=>{let s=c[e.feature]?.workspace,a=s&&f(s)?.services||null,N=s?w(s,a??void 0):null,B=o===0&&e.waitedMs>=3e5&&!e.parked&&$(t,r??[],e);return{...e,position:o+1,services:a,cost:N,holds:B}});if(n.json){let e=i(o=>Number.isFinite(o)?o:null,"n");console.log(JSON.stringify({budget:{memory:e(t.memory),cpus:e(t.cpus),preempt:t.preempt},host_load:l,leases:c,waiting:m,running:r?.map(o=>({feature:o.feature,cpus:o.cost.cpus,memory:o.cost.memory,rank:o.rank,busy:o.busy}))??null,waiters:u.map(o=>({feature:o.feature,position:o.position,services:o.services,cpus:o.cost?.cpus??null,memory:o.cost?.memory??null,waited_ms:o.waitedMs,gate:o.gate}))}));return}console.log(`Budget: ${M(t.memory/S," GiB")} memory, ${M(t.cpus," CPUs")}, ${P(l)}, preemption ${t.preempt?"on":"off"}`);let d=Object.entries(c).sort(([,e],[,o])=>e.slot-o.slot);console.log(d.length?"Slots:":"Slots: none held");for(let[e,o]of d)console.log(` ${o.slot} ${e}${o.workspace?` ${o.workspace}`:""}`);console.log(r?r.length?"Running:":"Running: none":"Running: docker unavailable");for(let e of[...r??[]].sort((o,s)=>s.cost.cpus-o.cost.cpus))console.log(` ${x(e)}`);console.log(u.length?"Waiting:":"Waiting: none");for(let e of u){let o=e.services?`${e.services.join(", ")}${e.gate?" for a running feature":""}`:"whole feature",s=e.cost?` (${Number(e.cost.cpus.toFixed(1))} CPUs, ${(e.cost.memory/S).toFixed(1)} GiB)`:"",a=e.waitedMs?` waited ${Math.round(e.waitedMs/6e4)} min${e.holds?", gets the next free room":""}`:"";console.log(` ${e.position}. ${e.feature} ${o}${s}${a}`)}}i(T,"run");export{P as hostLoadText,T as run};
4
+ //# sourceMappingURL=budget-BY7UHDWV.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-XKZDH45Y.js";import{d as s}from"./chunk-NXKWXJCV.js";import"./chunk-RH4P5LFS.js";import"./chunk-APFV3VIB.js";import"./chunk-OKGMYOT7.js";import"./chunk-775A5XJ5.js";import{h as e,l as c}from"./chunk-2IVVFZZJ.js";import"./chunk-CTREWDO3.js";import{a as r,f as i}from"./chunk-O5HTMFMB.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-WGVB3HHY.js.map
3
+ import"./chunk-INMHGD7I.js";import{d as s}from"./chunk-L6KNLWI2.js";import"./chunk-LUDZPDBU.js";import"./chunk-XK5XPYGK.js";import"./chunk-LY3ZWJMJ.js";import"./chunk-IBCKPBDX.js";import{h as e,l as c}from"./chunk-KSS5GZIU.js";import"./chunk-5DHOCYKT.js";import{a as r,f as i}from"./chunk-7DIPOY72.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-KU2OR24G.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-O5HTMFMB.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-7DIPOY72.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-XKV6PKER.js.map
13
+ //# sourceMappingURL=chunk-2CGM6YPC.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 p,b as a}from"./chunk-CTREWDO3.js";import{a as o,f as c}from"./chunk-O5HTMFMB.js";c();import*as i from"node:fs";import*as s from"node:path";function u(t){let e=s.resolve(t);for(;;){if(i.existsSync(s.join(a(e),"workspace.yml")))return e;let r=s.dirname(e);if(r===e)return null;e=r}}o(u,"findRecordRoot");function d(t){try{let e=i.readdirSync(s.join(t,"stages")).filter(n=>/^\d+_/.test(n)).sort(),r=e.find(n=>/^\d+_propose$/.test(n))??e.find(n=>/^\d+_ship$/.test(n))??e.at(-1);return r?`stages/${r}/output/`:"the last stage's output/"}catch{return`${s.basename(a(t))}/notes/`}}o(d,"prFileDirName");var f=/(?<!<)<<(?!<)-?\s*(['"]?)(\w+)\1([^\n]*)(?:\n(?:[\s\S]*?\n)?\t*\2(?=\n|$)|[\s\S]*$)/g,m=/'[^']*(?:'|$)|"(?:[^"\\]|\\[\s\S])*(?:"|$)/g,h=/(?:^|[;&|({\n`])\s*(?:(?:\w+=\S*|command|exec|env|then|do|else)\s+)*gh\s+pr\s+create\b/,R=/create_pull_request$/;function y(t){return h.test(t.replace(f,"$3").replace(m,"_"))}o(y,"opensPr");function S(t){return["_shared/pr-rules.md",`${p}/pr-rules.md`].find(e=>i.existsSync(s.join(t,e)))??"docs/workspace-lifecycle.md in the werkmeister repo"}o(S,"prRulesPath");function _(t){let e=u(String(t.cwd||process.cwd()));if(!e)return null;let r=String(t.tool_name||""),n=String(t.tool_input?.command||"");if(!(r==="Bash"&&y(n)||R.test(r)))return null;let l=S(e);return`Inside workspace \`${s.basename(e)}\`, PRs open only through \`werkmeister pr open\`: it runs the pre-PR gate and records the URL. Write the PR file in \`${d(e)}\`, have the person set \`status: approved\`, then run \`werkmeister pr open\`. Rules: \`${l}\`.`}o(_,"decide");function w(){let t=null;try{let e=process.stdin.isTTY?"":i.readFileSync(0,"utf8"),r=e.trim()?JSON.parse(e):{};typeof r=="object"&&r!==null&&!Array.isArray(r)&&(t=_(r))}catch{t=null}t&&console.log(JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:t}}))}o(w,"main");export{u as a,S as b,w as c};
4
- //# sourceMappingURL=chunk-ANG6K7AX.js.map
3
+ import{a as p,b as a}from"./chunk-5DHOCYKT.js";import{a as o,f as c}from"./chunk-7DIPOY72.js";c();import*as i from"node:fs";import*as s from"node:path";function u(t){let e=s.resolve(t);for(;;){if(i.existsSync(s.join(a(e),"workspace.yml")))return e;let r=s.dirname(e);if(r===e)return null;e=r}}o(u,"findRecordRoot");function d(t){try{let e=i.readdirSync(s.join(t,"stages")).filter(n=>/^\d+_/.test(n)).sort(),r=e.find(n=>/^\d+_propose$/.test(n))??e.find(n=>/^\d+_ship$/.test(n))??e.at(-1);return r?`stages/${r}/output/`:"the last stage's output/"}catch{return`${s.basename(a(t))}/notes/`}}o(d,"prFileDirName");var f=/(?<!<)<<(?!<)-?\s*(['"]?)(\w+)\1([^\n]*)(?:\n(?:[\s\S]*?\n)?\t*\2(?=\n|$)|[\s\S]*$)/g,m=/'[^']*(?:'|$)|"(?:[^"\\]|\\[\s\S])*(?:"|$)/g,h=/(?:^|[;&|({\n`])\s*(?:(?:\w+=\S*|command|exec|env|then|do|else)\s+)*gh\s+pr\s+create\b/,R=/create_pull_request$/;function y(t){return h.test(t.replace(f,"$3").replace(m,"_"))}o(y,"opensPr");function S(t){return["_shared/pr-rules.md",`${p}/pr-rules.md`].find(e=>i.existsSync(s.join(t,e)))??"docs/workspace-lifecycle.md in the werkmeister repo"}o(S,"prRulesPath");function _(t){let e=u(String(t.cwd||process.cwd()));if(!e)return null;let r=String(t.tool_name||""),n=String(t.tool_input?.command||"");if(!(r==="Bash"&&y(n)||R.test(r)))return null;let l=S(e);return`Inside workspace \`${s.basename(e)}\`, PRs open only through \`werkmeister pr open\`: it runs the pre-PR gate and records the URL. Write the PR file in \`${d(e)}\`, have the person set \`status: approved\`, then run \`werkmeister pr open\`. Rules: \`${l}\`.`}o(_,"decide");function w(){let t=null;try{let e=process.stdin.isTTY?"":i.readFileSync(0,"utf8"),r=e.trim()?JSON.parse(e):{};typeof r=="object"&&r!==null&&!Array.isArray(r)&&(t=_(r))}catch{t=null}t&&console.log(JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:t}}))}o(w,"main");export{u as a,S as b,w as c};
4
+ //# sourceMappingURL=chunk-2KSHRJ7Z.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{K as re,d as q,g as se,u as Ie,w as ut,x as pt}from"./chunk-APUXJWRW.js";import{a as oe,b as gt,c as yt}from"./chunk-DH7Q4APV.js";import{c as he,d as Qe,e as Ze,g as et,h as j,i as tt,j as I,k as nt,m as V,n as me,o as ge}from"./chunk-X3BVHQBV.js";import{e as Ve,j as ze,m as Je}from"./chunk-RH4P5LFS.js";import{B as dt,C as Se,I as lt,K as Y,Q as ne,T as G,o as z,u as U,z as ke}from"./chunk-PEDMLT4J.js";import{a as st,c as rt,d as ye,e as ot,f as it,g as je,h as we,i as B,j as at,k as ct}from"./chunk-R43MNY77.js";import{a as ft}from"./chunk-VZZHDVWL.js";import{a as ue}from"./chunk-QTPEKM7P.js";import{n as te}from"./chunk-OKGMYOT7.js";import{c as Oe,d as ht,e as mt}from"./chunk-VEXRAN7A.js";import{d as M,e as fe}from"./chunk-CTXCJLSF.js";import{b as pe}from"./chunk-775A5XJ5.js";import{I as qe,S as Xe,_ as Ke,a as Ae,j as C,k as b,l as A}from"./chunk-2IVVFZZJ.js";import{a as K,b as v}from"./chunk-CTREWDO3.js";import{a,e as Re,f as g}from"./chunk-O5HTMFMB.js";g();var Qt="This is an interactive run: check with me at each stage's human check.",wt="Run `werkmeister feature up` only when the gate, the exercise or a measurement needs the container, and `werkmeister feature stop` this workspace's containers right after `werkmeister pr open` succeeds.",Ne=["Tests never call the real Jira or GitHub APIs; the tracker is mocked. The only real issue updates are the status moves `werkmeister issue start` and `werkmeister pr open` make for this ticket and its `group:` members; run both. A follow-up the run finds is filed with `werkmeister issue create --relates <this ticket>` (SW-815); no other tracker writes.","Never read or write the real `~/.werkmeister`; tests use a temporary HOME. To see the machine config's shape run `werkmeister machine config`: it masks secrets such as `jira.api_token`.","No `npm link`, `npm`/`pnpm install -g`, `npm publish`, `werkmeister infra proxy-reload`, and no other workspaces.",'Where the ticket says "to confirm", use it as written unless the code shows a reason to change it, and record each choice in the stage output for PR review.',wt].map(e=>`- ${e}`).join(`
3
+ import{K as re,d as q,g as se,u as Ie,w as ut,x as pt}from"./chunk-SIHBDZUL.js";import{a as oe,b as gt,c as yt}from"./chunk-KOVPNRGU.js";import{c as he,d as Qe,e as Ze,g as et,h as j,i as tt,j as I,k as nt,m as V,n as me,o as ge}from"./chunk-HMWFRFSI.js";import{e as Ve,j as ze,m as Je}from"./chunk-LUDZPDBU.js";import{B as dt,C as Se,I as lt,K as Y,Q as ne,T as G,o as z,u as U,z as ke}from"./chunk-PMS6GXID.js";import{a as st,c as rt,d as ye,e as ot,f as it,g as je,h as we,i as B,j as at,k as ct}from"./chunk-AUM7GNGM.js";import{a as ft}from"./chunk-AVKAJV52.js";import{a as ue}from"./chunk-3XZESG5R.js";import{n as te}from"./chunk-LY3ZWJMJ.js";import{c as Oe,d as ht,e as mt}from"./chunk-YXBFFIVC.js";import{d as M,e as fe}from"./chunk-WT5JJ7XV.js";import{b as pe}from"./chunk-IBCKPBDX.js";import{I as qe,S as Xe,_ as Ke,a as Ae,j as C,k as b,l as A}from"./chunk-KSS5GZIU.js";import{a as K,b as v}from"./chunk-5DHOCYKT.js";import{a,e as Re,f as g}from"./chunk-7DIPOY72.js";g();var Qt="This is an interactive run: check with me at each stage's human check.",wt="Run `werkmeister feature up` only when the gate, the exercise or a measurement needs the container, and `werkmeister feature stop` this workspace's containers right after `werkmeister pr open` succeeds.",Ne=["Tests never call the real Jira or GitHub APIs; the tracker is mocked. The only real issue updates are the status moves `werkmeister issue start` and `werkmeister pr open` make for this ticket and its `group:` members; run both. A follow-up the run finds is filed with `werkmeister issue create --relates <this ticket>` (SW-815); no other tracker writes.","Never read or write the real `~/.werkmeister`; tests use a temporary HOME. To see the machine config's shape run `werkmeister machine config`: it masks secrets such as `jira.api_token`.","No `npm link`, `npm`/`pnpm install -g`, `npm publish`, `werkmeister infra proxy-reload`, and no other workspaces.",'Where the ticket says "to confirm", use it as written unless the code shows a reason to change it, and record each choice in the stage output for PR review.',wt].map(e=>`- ${e}`).join(`
4
4
  `),kt=[[/werkmeister registry sync/,"- Registry sync: the next `werkmeister registry sync` after merge picks up the change; the gate reads the branch's own `.werkmeister/services.yaml` fragment."],[/werkmeister infra proxy-reload/,"- Proxy reload: the next `werkmeister infra proxy-reload` after merge applies the change."],[/(?:npm|pnpm|yarn) link\b/,"- Linking the CLI: after merge, if at all; the run runs the built binary with `node`."],[/(?:(?:npm|pnpm|yarn) (?:install|i|add)\b[^`\n]*?(?: -g\b| --global\b)|yarn global add\b)/,"- Global installs: after merge, if at all; the run uses the workspace's own install."]],Zt=a(e=>new RegExp(`(?:^|(?<!["\u201C'])\\brun )\`?${e.source}`,"i"),"stepRe"),en=kt.map(([e])=>Zt(e)),tn=/^(\s*(?:[-*]|\d+\.) +(?:\[[ x]\] +)?)?(.*)$/;function St(e){let t=new Set,n=e.split(`
5
5
  `).flatMap(s=>{let[,r="",o=""]=tn.exec(s)??[],i=o.split(/(?<=[.!?]) +/).filter(c=>{let d=en.flatMap((l,u)=>l.test(c)?[u]:[]);for(let l of d)t.add(l);return!d.length});return i.join(" ")===o?[s]:i.length?[r+i.join(" ")]:[]});return t.size?[n.join(`
6
6
  `).trimEnd(),"","## After merge","","Not steps for this run: the run limits forbid writing machine state under `~/.werkmeister` and global installs. These happen after the PR merges:",...kt.filter((s,r)=>t.has(r)).map(([,s])=>s)].join(`
@@ -294,4 +294,4 @@ ${r}
294
294
  `),b(`Salvaged legacy Handoff Notes \u2192 ${x.relative(e,x.join(o,i))}`)}catch(n){A(`Could not salvage legacy Handoff Notes: ${n.message}`)}}a(es,"salvageLegacyHandoffNotes");function ts(e){return e.type==="handoff"&&e.frontmatter.author==="workspace-creation"&&!e.body.includes("Seeded from `starting_prompt`")}a(ts,"isPlaceholderHandoff");function ns(e){let t=S.readFileSync(e.path,"utf8");S.writeFileSync(e.path,t.replace(/^status:.*$/m,"status: superseded"))}a(ns,"supersedeNote");function ss(e,t,n,s=null){let r=t.trim();if(!r&&!s)return;let o=n.trim().toLowerCase(),i=ne(o);try{let c=ie(e),d=ve(e,!0).filter(p=>p.type==="handoff");if(d.some(p=>!ts(p)))return;for(let p of d)ns(p);S.mkdirSync(c,{recursive:!0});let l=Le(Fe(c),"handoff","starting-prompt"),u=["---","type: handoff",`phase: ${i.phases[0]}`,"author: workspace-creation","refs: []","status: open","---","","# Handoff: workspace creation",""];s&&u.push(oe(s)),o&&u.push(`This workspace is a ${o} \u2014 ${i.hint}.`,""),r&&u.push("Seeded from `starting_prompt` in .werkmeister/workspace.yml when the","workspace was created. The task below has not begun \u2014 confirm","direction with the user before executing it.","",r),S.writeFileSync(x.join(c,l),u.join(`
295
295
  `)+`
296
296
  `),b(`Seeded starting handoff \u2192 ${x.relative(e,x.join(c,l))}`)}catch(c){A(`Could not seed starting handoff: ${c.message}`)}}a(ss,"seedStartingHandoff");function rs(e){let{workspaceRoot:t,workspaceName:n,repos:s,task:r,meta:o,inputs:i,configOverride:c}=e,d=q(t),l=x.join(t,d.instructionsFile),u=null,p=null,h=I(null,j(t));if(Object.keys(h).length){let[R,ee]=G();for(let H of nt(R,h))A(H);let _e=Y(t,c),de=s.map(([H])=>H),Jt=(o.SERVICES??"").split(",").map(H=>H.trim()).filter(H=>H),[le]=V(de,R,ee,_e,h,Jt);p=le,u=gt(le,h,de,i.work_type??""),C(`Standards routing: active = ${le.join(", ")}`),ge(t,me(le,h,ne(i.work_type??"").gate))}else A(fe()||`no standard modules found in ${M()} \u2014 this workspace gets no standards routing, skills, or edit-time gate`);S.mkdirSync(ie(t),{recursive:!0}),es(t,l);let $=i.starting_prompt??"";ss(t,$,i.work_type??"",e.isCreate||$.trim()?e.issue??null:null);let _=yt(n,t,s,r,o,u,e.issue??null);S.writeFileSync(l,_+d.notice()),b(`Wrote ${l}`);let X=x.join(v(t),"issues-report.md");S.mkdirSync(x.dirname(X),{recursive:!0}),S.writeFileSync(X,Ee(n,U(o),z({project:i.project,text:U(o)}),d.questionTool)),b(`Wrote ${X}`);let Z=x.join(v(t),"pr-rules.md");S.writeFileSync(Z,ye(".werkmeister/notes/")),b(`Wrote ${Z}`);for(let R of Ye(t,null,null,p))b(`Wrote ${R}`);if(d.agents&&os(e),se(t)){let R=Ie(t);re(t),b(`Wrote ${R}`)}}a(rs,"init");function os({workspaceRoot:e,repos:t,meta:n}){let[s,r]=G(),o=Xe(),i=Je(t,n,s,r,o),c={};try{c=ft(s)}catch{c={}}let d=Wt(i,s,o,(n.FEATURE??"").trim(),c,(n.TEST_PATH??"").trim());for(let l of Mt(e,d))b(`Wrote ${l}`)}a(os,"writeAgents");var Kt={id:"jit",init:rs,refresh(e){se(e)&&(Ie(e),re(e))},check(e){let t=ce(e),{authoring:n,drift:s}=Yt(e,t?.active??null),r=qt(e,t);return[...n,...s,...r===null?[]:[r]]},sync(e){let{written:t,manifestPath:n}=Xt(e);return{wrote:n===null?t:[...t,n]}},sessionContext(e,t){let n=String(t.source||"");return(n==="compact"||n==="clear")&&ht(e,String(t.session_id||"")),_t(e,n)||null},gate:mt,ownedPaths:a(()=>["CLAUDE.md","AGENTS.md",".claude/settings.json",".claude/skills/w9r-*",".agents/skills/w9r-*",".claude/agents/w9r-*",".claude/skills/sb-*",".claude/agents/sb-*",`${K}/notes`,`${K}/standards.json`,`${K}/issues-report.md`,`${K}/pr-rules.md`,`${K}/.gate`],"ownedPaths"),decisions:$e};var zt={jit:Kt,icm:Ge};function Vr(e){return zt[e]}a(Vr,"strategyById");function is(e){let t=e==null?"":String(e).trim();if(!t)return"jit";if(ke.includes(t))return t;throw new pe(`Unknown context_strategy '${t}' in workspace.yml \u2014 expected one of: ${ke.join(", ")}`,"UNKNOWN_CONTEXT_STRATEGY")}a(is,"parseStrategyId");function as(e){return is(lt(e,"context_strategy"))}a(as,"readContextStrategy");function zr(e){return zt[as(e)]}a(zr,"strategyFor");function Vt(e,t){let n=[];for(let s of t){if(!s.endsWith("*")){Q.existsSync(W.join(e,s))&&n.push(s);continue}let r=W.dirname(s),o=W.basename(s).slice(0,-1),i;try{i=Q.readdirSync(W.join(e,r)).sort()}catch{continue}for(let c of i)c.startsWith(o)&&n.push(W.join(r,c))}return n}a(Vt,"expandOwned");function cs(e,t,n){let s=new Set(Vt(e,n.ownedPaths()));return Vt(e,t.ownedPaths()).filter(r=>!s.has(r))}a(cs,"leftoverPaths");function ds(e,t){if(te(["git","-C",e,"ls-files","--error-unmatch","--",t],{capture:!0}).status!==0)return!1;let s=te(["git","-C",e,"status","--porcelain","--ignored","--untracked-files=all","--",t],{capture:!0});return s.status===0&&!s.stdout.trim()}a(ds,"restorable");function Jr(e,t,n,s){let r=cs(e,t,n);if(r.length){if(!s){A(`${t.id} layer still present: ${r.join(", ")}; remove by hand or run \`werkmeister workspace init --prune-context\``);return}for(let o of r)ds(e,o)?(Q.rmSync(W.join(e,o),{recursive:!0,force:!0}),b(`Pruned ${o}`)):A(`Kept ${o}: untracked, ignored or modified \u2014 git could not restore it`)}}a(Jr,"reportLeftovers");export{Qt as a,wt as b,Ne as c,St as d,nn as e,ls as f,ln as g,ve as h,un as i,De as j,rn as k,O as l,an as m,Ss as n,cn as o,$t as p,bs as q,Vr as r,is as s,zr as t,Jr as u};
297
- //# sourceMappingURL=chunk-QSUU3YHI.js.map
297
+ //# sourceMappingURL=chunk-2PUTXWSQ.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-O5HTMFMB.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-7DIPOY72.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-O5HTMFMB.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-EBHSLKSS.js.map
11
+ //# sourceMappingURL=chunk-2QN5A2HQ.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 D,s as B}from"./chunk-JVZO2PPL.js";import{a as F,b as j,c as H,d as y,e as v,g as G,h as I,i as _,k as K,l as M,n as J,o as L}from"./chunk-OHSDQB5O.js";import{l as b,m as x,n as N}from"./chunk-BVIKBQAH.js";import{f as P,o as T}from"./chunk-Y56OMR5W.js";import{d as A,l as O}from"./chunk-APFV3VIB.js";import{m as p,n as w,o as C}from"./chunk-OKGMYOT7.js";import{X as S,j as c,k as u,l as d,m,t as $,w as R}from"./chunk-2IVVFZZJ.js";import{a as i,f as g}from"./chunk-O5HTMFMB.js";g();import*as f from"node:fs";import*as X from"node:net";import*as Z from"node:os";import*as E from"node:path";g();import*as U from"node:fs";import*as W from"node:path";var l=".githooks";function Y(e){let t=e??S();if(!U.existsSync(W.join(t,".git")))return!1;let o;try{o=w(["git","-C",t,"config","--get","core.hooksPath"],{capture:!0})}catch(r){if(r instanceof p&&r.code==="ENOENT")return d(`git was not found on PATH \u2014 could not check or configure core.hooksPath. The werkmeister secret-commit guard (${l}/pre-commit) was NOT installed.`),!1;throw r}let s=o.status===0?o.stdout.trim():"";if(s===l)return!0;if(s)return d(`core.hooksPath is already set to '${s}' \u2014 leaving it unchanged. The werkmeister secret-commit guard (${l}/pre-commit) was NOT installed. Run 'git config core.hooksPath ${l}' manually if you want to activate it.`),!1;try{w(["git","-C",t,"config","core.hooksPath",l],{capture:!0,check:!0})}catch(r){let a=r instanceof p&&r.code===void 0&&r.stderr?r.stderr.trim():String(r instanceof Error?r.message:r);return d(`Could not set core.hooksPath to ${l} (${a}). The werkmeister secret-commit guard (${l}/pre-commit) was NOT installed.`),!1}return c(`Configuring core.hooksPath -> ${l} (first-time setup)...`),u(`core.hooksPath set to ${l} (secret-commit guard active)`),!0}i(Y,"configureGitHooksPath");function Q(e){let{argv:t,env:o,cwd:s}=I(),r=[...t,...e];c(`Running: ${r.join(" ")}`);try{let a=w(r,{capture:!0,timeout:120,env:o,cwd:s});return a.status!==0?(m(`docker compose failed:
3
+ import{a as D,s as B}from"./chunk-HWUOYPJK.js";import{a as F,b as j,c as H,d as y,e as v,g as G,h as I,i as _,k as K,l as M,n as J,o as L}from"./chunk-VXFRUABZ.js";import{l as b,m as x,n as N}from"./chunk-H3RW6C4N.js";import{f as P,o as T}from"./chunk-SHPWUXGO.js";import{d as A,l as O}from"./chunk-XK5XPYGK.js";import{m as p,n as w,o as C}from"./chunk-LY3ZWJMJ.js";import{X as S,j as c,k as u,l as d,m,t as $,w as R}from"./chunk-KSS5GZIU.js";import{a as i,f as g}from"./chunk-7DIPOY72.js";g();import*as f from"node:fs";import*as X from"node:net";import*as Z from"node:os";import*as E from"node:path";g();import*as U from"node:fs";import*as W from"node:path";var l=".githooks";function Y(e){let t=e??S();if(!U.existsSync(W.join(t,".git")))return!1;let o;try{o=w(["git","-C",t,"config","--get","core.hooksPath"],{capture:!0})}catch(r){if(r instanceof p&&r.code==="ENOENT")return d(`git was not found on PATH \u2014 could not check or configure core.hooksPath. The werkmeister secret-commit guard (${l}/pre-commit) was NOT installed.`),!1;throw r}let s=o.status===0?o.stdout.trim():"";if(s===l)return!0;if(s)return d(`core.hooksPath is already set to '${s}' \u2014 leaving it unchanged. The werkmeister secret-commit guard (${l}/pre-commit) was NOT installed. Run 'git config core.hooksPath ${l}' manually if you want to activate it.`),!1;try{w(["git","-C",t,"config","core.hooksPath",l],{capture:!0,check:!0})}catch(r){let a=r instanceof p&&r.code===void 0&&r.stderr?r.stderr.trim():String(r instanceof Error?r.message:r);return d(`Could not set core.hooksPath to ${l} (${a}). The werkmeister secret-commit guard (${l}/pre-commit) was NOT installed.`),!1}return c(`Configuring core.hooksPath -> ${l} (first-time setup)...`),u(`core.hooksPath set to ${l} (secret-commit guard active)`),!0}i(Y,"configureGitHooksPath");function Q(e){let{argv:t,env:o,cwd:s}=I(),r=[...t,...e];c(`Running: ${r.join(" ")}`);try{let a=w(r,{capture:!0,timeout:120,env:o,cwd:s});return a.status!==0?(m(`docker compose failed:
4
4
  ${a.stderr.trim()}`),!1):!0}catch(a){if(a instanceof p&&a.code==="ENOENT")return m("docker not found"),!1;if(a instanceof p&&a.code==="ETIMEDOUT")return m("docker compose timed out"),!1;throw a}}i(Q,"composeCmd");function ee(){let e=E.join(R(),"corp-ca.crt");if(f.mkdirSync(E.dirname(e),{recursive:!0}),(f.existsSync(e)?f.readFileSync(e,"utf8"):"").includes("BEGIN CERTIFICATE"))return;if(Z.platform()!=="darwin"){f.writeFileSync(e,"");return}let o=["goskope","certadmin","Zscaler","Palo Alto"],s=[];for(let a of o){let n=w(["security","find-certificate","-a","-p","-c",a,"/Library/Keychains/System.keychain"],{capture:!0,timeout:5});n.status===0&&n.stdout.includes("BEGIN CERTIFICATE")&&s.push(n.stdout)}let r=s.join("");f.writeFileSync(e,r),r.includes("BEGIN CERTIFICATE")&&c(`Corporate CA extracted to ${e} (image builds will trust it)`)}i(ee,"ensureCorpCa");async function te(){c("Generating proxy/Caddyfile..."),await B(),H(),j(),J()}i(te,"ensureProxyFiles");async function re(e){if($())return c("Shared infra (Caddy, k8s forwards) skipped (WERKMEISTER_FIXTURE)"),!0;let{argv:t,env:o,cwd:s}=I(),r=t[3];if(!f.existsSync(r))return d(`Missing ${r}`),!1;P(v,"the pre-rename shared infra");let a=["k8s-forwards","caddy",...G(),...F().map(n=>`baseline-${n.service}`)];c(`Starting shared infrastructure (${a.join(", ")})...`);try{let n=await C([...t,"up","-d","--build"],{capture:!0,signal:e,env:o,cwd:s});if(n.status!==0)return m(`docker compose failed:
5
5
  ${n.stderr.trim()}`),!1;let{recreate:k,leftover:q}=K(await _(),a);for(let h of q)d(`${h.name} was ${h.reason}, and this checkout has no such service: remove it with \`docker rm -f ${h.name}\``);if(k.length){c(`Recreating ${k.join(", ")} from this checkout...`);let h=await C([...t,"up","-d","--no-deps","--force-recreate",...k],{capture:!0,signal:e,env:o,cwd:s});if(h.status!==0)return m(`docker compose failed:
6
6
  ${h.stderr.trim()}`),!1}return u("Shared infrastructure started"),!0}catch(n){if(n instanceof p&&n.code==="ABORT_ERR")return d("Shared infrastructure start was cancelled"),!1;if(n instanceof p&&n.code==="ENOENT")return m("docker not found"),!1;throw n}}i(re,"startSharedInfra");var oe="/werkmeister/proxy/ui/index.html";function se(e,t,o){return new Promise(s=>{let r=X.createConnection({host:e,port:t}),a=!1,n=i(k=>{a||(a=!0,r.destroy(),s(k))},"finish");r.setTimeout(o*1e3),r.on("connect",()=>n(!0)),r.on("timeout",()=>n(!1)),r.on("error",()=>n(!1))})}i(se,"checkPort");async function V(){let e={};for(let t of await A(y,void 0,{all:!1})??[])e[t.service||t.name]=t.health==="healthy"||t.state==="running"&&!t.health;if(e.caddy){let t=await O(D,["test","-s",oe]).catch(()=>null);e.caddy=t?.exitCode===0}if(!Object.keys(e).length){let t=[["redis",9050],["postgres",9051],["caddy",443]];for(let[o,s]of t)e[o]=await se("127.0.0.1",s,2)}return e}i(V,"checkInfraHealth");async function xe({signal:e}={}){if(e?.aborted)return d("Infrastructure start was cancelled before it began"),!1;Y(),await te(),ee();let t=await re(e);return await b(!0),t}i(xe,"up");async function ve(e){c("Waiting for services to become healthy...");let t=Date.now()+e*1e3,o=await V();for(;Object.keys(o).length>0&&Object.values(o).some(s=>!s)&&Date.now()<t;)await new Promise(s=>setTimeout(s,3e3)),o=await V();return o}i(ve,"infraHealth");async function Ie(){if((await M())["k8s-forwards"]??!1)return u("k8s port-forwards container is already healthy"),!0;c("Attempting to start/restart k8s-forwards container...");let e=await L()!=="failed";return e&&u("k8s port-forwards started"),e}i(Ie,"connectK8s");async function $e(e=!1){await x(),P(v,"the pre-rename shared infra",{removeVolumes:e});let t=["--profile","*","down"];if(e&&t.push("--volumes"),Q(t)){let o="Shared infrastructure stopped";e&&(o+=" (volumes removed)"),u(o)}}i($e,"down");async function Re(){await x();let e=await T("stop",y);if(e){m(e);return}u("Shared infrastructure stopped (containers preserved, resumable with 'werkmeister infra up')")}i(Re,"stop");async function Se(){let e=await T("restart",y);e?m(e):u("Shared infrastructure restarted"),await N()}i(Se,"restart");export{re as a,xe as b,ve as c,Ie as d,$e as e,Re as f,Se as g};
7
- //# sourceMappingURL=chunk-GJ3SYTXH.js.map
7
+ //# sourceMappingURL=chunk-3MWOBACO.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-O5HTMFMB.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-QEBQN6GO.js.map
3
+ import{a as c,f as p}from"./chunk-7DIPOY72.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-3QWL4KRQ.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,f as c}from"./chunk-O5HTMFMB.js";c();import*as t from"node:fs";import*as s from"node:path";var i="compose.yml",p="docker-compose.yml";function f(o){try{return t.statSync(o).isFile()}catch{return!1}}r(f,"isFile");function m(o){for(let e of[i,p]){let n=s.join(o,e);if(f(n))return n}return null}r(m,"findWorkspaceCompose");function u(o){let e=s.join(o,p),n=s.join(o,i);f(e)&&!t.existsSync(n)&&t.renameSync(e,n)}r(u,"migrateWorkspaceCompose");export{i as a,p as b,m as c,u as d};
4
- //# sourceMappingURL=chunk-QTPEKM7P.js.map
3
+ import{a as r,f as c}from"./chunk-7DIPOY72.js";c();import*as t from"node:fs";import*as s from"node:path";var i="compose.yml",p="docker-compose.yml";function f(o){try{return t.statSync(o).isFile()}catch{return!1}}r(f,"isFile");function m(o){for(let e of[i,p]){let n=s.join(o,e);if(f(n))return n}return null}r(m,"findWorkspaceCompose");function u(o){let e=s.join(o,p),n=s.join(o,i);f(e)&&!t.existsSync(n)&&t.renameSync(e,n)}r(u,"migrateWorkspaceCompose");export{i as a,p as b,m as c,u as d};
4
+ //# sourceMappingURL=chunk-3XZESG5R.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 n,f as o}from"./chunk-O5HTMFMB.js";o();function u(t){return t.listenerCount("SIGINT")>1}n(u,"claimed");var r=new AbortController;function s(){return r.signal}n(s,"interruptSignal");function d(t=process,i=()=>{},l=e=>process.exit(e)){let e=!1;r=new AbortController,t.on("SIGINT",()=>{if(r.abort(),u(t)&&!e){e=!0;return}i(),l(130)})}n(d,"installDefaultInterrupt");export{s as a,d as b};
4
- //# sourceMappingURL=chunk-PZ2GDA2C.js.map
3
+ import{a as n,f as o}from"./chunk-7DIPOY72.js";o();function u(t){return t.listenerCount("SIGINT")>1}n(u,"claimed");var r=new AbortController;function s(){return r.signal}n(s,"interruptSignal");function d(t=process,i=()=>{},l=e=>process.exit(e)){let e=!1;r=new AbortController,t.on("SIGINT",()=>{if(r.abort(),u(t)&&!e){e=!0;return}i(),l(130)})}n(d,"installDefaultInterrupt");export{s as a,d as b};
4
+ //# sourceMappingURL=chunk-44YXA4EM.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 t,f as r}from"./chunk-O5HTMFMB.js";r();import*as o from"node:path";var i=".werkmeister";function p(e){return o.join(e,i)}t(p,"dotDir");export{i as a,p as b};
4
- //# sourceMappingURL=chunk-CTREWDO3.js.map
3
+ import{a as t,f as r}from"./chunk-7DIPOY72.js";r();import*as o from"node:path";var i=".werkmeister";function p(e){return o.join(e,i)}t(p,"dotDir");export{i as a,p as b};
4
+ //# sourceMappingURL=chunk-5DHOCYKT.js.map