werkmeister 0.90.6 → 0.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{budget-CBZKGPH6.js → budget-AH6CFJIP.js} +2 -2
- package/dist/{cache-2RPLP2EL.js → cache-4Z67QJ73.js} +2 -2
- package/dist/{chunk-52AX2MHH.js → chunk-2NSHZRMP.js} +2 -2
- package/dist/{chunk-6L5CLHRT.js → chunk-3BXCMPNT.js} +2 -2
- package/dist/{chunk-VCQRVQAX.js → chunk-3LKKRHDW.js} +2 -2
- package/dist/{chunk-75XONUTO.js → chunk-4ZFUVHBF.js} +2 -2
- package/dist/{chunk-NDM6AWKW.js → chunk-5LAKVBXK.js} +2 -2
- package/dist/{chunk-Y5DLEHDL.js → chunk-5LHHJX46.js} +2 -2
- package/dist/{chunk-4Z4MXVUF.js → chunk-5NJTUKCB.js} +2 -2
- package/dist/{chunk-PMBGYFHB.js → chunk-6BHGSAA6.js} +2 -2
- package/dist/{chunk-J645JVDC.js → chunk-7H4RTP3H.js} +2 -2
- package/dist/{chunk-EUDJJIWQ.js → chunk-7IZXOVO4.js} +2 -2
- package/dist/{chunk-SAIKRIYT.js → chunk-7YPA7VJQ.js} +3 -3
- package/dist/{chunk-OTCDKVIU.js → chunk-AF2X5LK6.js} +2 -2
- package/dist/{chunk-I4B347WO.js → chunk-BCFVKR67.js} +2 -2
- package/dist/{chunk-4C3PM7XN.js → chunk-BEA6MZ6Y.js} +2 -2
- package/dist/{chunk-KH4XBJ57.js → chunk-BJMRSW3U.js} +2 -2
- package/dist/{chunk-56MUQHVC.js → chunk-BTVL6SPA.js} +2 -2
- package/dist/{chunk-DSNU53BH.js → chunk-BY643VNH.js} +2 -2
- package/dist/{chunk-3TR2OQ47.js → chunk-C237CVXE.js} +2 -2
- package/dist/{chunk-AZ2AIQC6.js → chunk-CEDTL7DC.js} +2 -2
- package/dist/{chunk-IWDPDFQJ.js → chunk-D5K4YE7K.js} +2 -2
- package/dist/{chunk-254WS45V.js → chunk-DH4MVYEK.js} +2 -2
- package/dist/{chunk-Q3WEJFEX.js → chunk-DRKGMFUU.js} +2 -2
- package/dist/{chunk-ENZNKQ5L.js → chunk-E37YZI3X.js} +2 -2
- package/dist/{chunk-BJ5NITOX.js → chunk-F4XGTOHP.js} +2 -2
- package/dist/{chunk-ZEMAMGY5.js → chunk-F7E6QXJV.js} +2 -2
- package/dist/{chunk-DJTA5THU.js → chunk-FFKCNRUN.js} +2 -2
- package/dist/{chunk-KPONDQXG.js → chunk-FJ2TYM7L.js} +2 -2
- package/dist/{chunk-HHUD6FGN.js → chunk-FMFXF76I.js} +2 -2
- package/dist/{chunk-H762HFEG.js → chunk-GFFE3SM3.js} +2 -2
- package/dist/{chunk-JSGHZLPQ.js → chunk-GGU75XPS.js} +2 -2
- package/dist/{chunk-LLNW5RYI.js → chunk-GTKK3LKS.js} +2 -2
- package/dist/{chunk-J4Y3RU6X.js → chunk-HUKXMFHW.js} +2 -2
- package/dist/{chunk-CGWMFLTS.js → chunk-HWJCGLMH.js} +2 -2
- package/dist/{chunk-VJI7EYWA.js → chunk-HY2HFZ2W.js} +2 -2
- package/dist/{chunk-CWCYYAN2.js → chunk-J7LLXIFD.js} +2 -2
- package/dist/{chunk-2Y73JNTL.js → chunk-LBESQTHU.js} +2 -2
- package/dist/{chunk-Y7FAEZCL.js → chunk-LEX7JGFG.js} +2 -2
- package/dist/{chunk-MRRSQM42.js → chunk-MSMCUTHU.js} +2 -2
- package/dist/{chunk-SVK54RYD.js → chunk-NDYJNCRQ.js} +2 -2
- package/dist/{chunk-DKBX26S7.js → chunk-NJC72QTE.js} +2 -2
- package/dist/{chunk-QL7WXWER.js → chunk-NJRFNCYS.js} +2 -2
- package/dist/{chunk-O7MADCXS.js → chunk-NTE446SO.js} +2 -2
- package/dist/{chunk-LELQQYJ4.js → chunk-NW2W4JZ3.js} +3 -3
- package/dist/{chunk-LBBW6OFT.js → chunk-OYYD7LS6.js} +2 -2
- package/dist/{chunk-I26E37NR.js → chunk-QXFF3FTK.js} +2 -2
- package/dist/{chunk-P3NXXXGH.js → chunk-RJT2NOJY.js} +2 -2
- package/dist/{chunk-BS2LMAZ7.js → chunk-RON372LM.js} +2 -2
- package/dist/{chunk-UHLN7X4W.js → chunk-RS67Y76B.js} +2 -2
- package/dist/{chunk-Y6PDCJDN.js → chunk-S32UWSU5.js} +2 -2
- package/dist/{chunk-KZXDHODT.js → chunk-SO5EJ5QK.js} +3 -3
- package/dist/{chunk-WEIYUYAJ.js → chunk-T5NBS5HI.js} +2 -2
- package/dist/{chunk-RLBVPLSZ.js → chunk-U3GM2WSU.js} +2 -2
- package/dist/{chunk-QB627UKL.js → chunk-UYESNXMS.js} +3 -3
- package/dist/{chunk-NLBNHLRB.js → chunk-VH2ZJ777.js} +2 -2
- package/dist/{chunk-G77QEZGX.js → chunk-VXRMWVGY.js} +2 -2
- package/dist/{chunk-4WMEGT45.js → chunk-W43BCA3V.js} +2 -2
- package/dist/{chunk-YLOJLD65.js → chunk-WFXTRHX2.js} +2 -2
- package/dist/{chunk-N5AKSA4V.js → chunk-WPCAHRQF.js} +2 -2
- package/dist/{chunk-QOAKTCGE.js → chunk-WUN4UKLJ.js} +2 -2
- package/dist/{chunk-TIJZDXVP.js → chunk-WZARSTL6.js} +2 -2
- package/dist/{chunk-B5FSK3YS.js → chunk-XYBYBXWX.js} +2 -2
- package/dist/{chunk-7R74VJQR.js → chunk-YSRY4GFI.js} +2 -2
- package/dist/{chunk-2N5EDMDH.js → chunk-Z2IIHFSA.js} +2 -2
- package/dist/{chunk-UVPOJG4L.js → chunk-Z4M36MYI.js} +2 -2
- package/dist/{chunk-LCI23FFF.js → chunk-Z6XPYFMK.js} +2 -2
- package/dist/chunk-ZJ6HW6TS.js +4 -0
- package/dist/clean-ICDNIE7C.js +8 -0
- package/dist/close_out-7SKM4KLE.js +8 -0
- package/dist/code-4K7JX3W7.js +4 -0
- package/dist/{config-USWO6AGK.js → config-3B7LQP2N.js} +2 -2
- package/dist/{connect-PAN7V32H.js → connect-HCYG3NJ7.js} +2 -2
- package/dist/{daemon-H73L3SC5.js → daemon-IHP5WRNJ.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-PDENTTJH.js → detect-5BVFIYEP.js} +2 -2
- package/dist/{down-MT3Q6B5T.js → down-S3M6DUVQ.js} +3 -3
- package/dist/{fixture-4M2N6555.js → fixture-GSAV775J.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-YOQI5Q77.js +4 -0
- package/dist/{hooks_gen-EKDBOXBM.js → hooks_gen-YUHXEAJX.js} +2 -2
- package/dist/infra-KLDVSAUY.js +4 -0
- package/dist/init_workspace-E2LRNEOF.js +4 -0
- package/dist/{intercept-3WRMKPIM.js → intercept-XZJQT2BX.js} +2 -2
- package/dist/{issue-54NRI4BS.js → issue-QUTDCRBA.js} +2 -2
- package/dist/lib/agent_state.js +1 -1
- package/dist/lib/gate.js +1 -1
- package/dist/lib/pr_guard.js +1 -1
- package/dist/list_workspaces-MU74HMKL.js +7 -0
- package/dist/logs-ER3Z7X6L.js +6 -0
- package/dist/main.js +3 -3
- package/dist/mcp-proxy.js +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{migrate-TO57R3IQ.js → migrate-IYVPJKA4.js} +2 -2
- package/dist/notes-2RU4VPLB.js +4 -0
- package/dist/{open-CFZGYOGB.js → open-ZACT4ASO.js} +2 -2
- package/dist/{optimize-SVX7UFQT.js → optimize-VLC5NDWL.js} +2 -2
- package/dist/pause-RUWK4VPN.js +4 -0
- package/dist/pr-NXC6G2QO.js +5 -0
- package/dist/proxy_reload-EYKYJ5X3.js +6 -0
- package/dist/{registry-MCJUYUB4.js → registry-BPYTNZRL.js} +2 -2
- package/dist/remove-WCMJYPBV.js +7 -0
- package/dist/remove_workspace-YFMDYF22.js +8 -0
- package/dist/restart-Y6YZCZQR.js +8 -0
- package/dist/resume-7PQ575JW.js +8 -0
- package/dist/{safari-ZIVNCZPN.js → safari-QQKR4VS5.js} +2 -2
- package/dist/{sandbox-WW4DVJE6.js → sandbox-RLKFTSZC.js} +2 -2
- package/dist/{services-CSLL6KIG.js → services-ZTOYBCFU.js} +2 -2
- package/dist/{setup-UXABDCN6.js → setup-WXXMUIDN.js} +2 -2
- package/dist/skills-HDZUITGO.js +4 -0
- package/dist/{slots-QXTGCGF7.js → slots-QVKF6YHF.js} +2 -2
- package/dist/{standards-YLBO5DOK.js → standards-DXP3VO2P.js} +2 -2
- package/dist/start_args-JQPS2CJU.js +4 -0
- package/dist/starting_prompt-BNPFSYW7.js +4 -0
- package/dist/stats-3IHYQAXW.js +4 -0
- package/dist/{status-IHKZYNHU.js → status-TORFUFHN.js} +2 -2
- package/dist/{stop-HZJ6VFWH.js → stop-JKK27I5M.js} +2 -2
- package/dist/{telepresence-ZGIGA43P.js → telepresence-7TW5NQ6L.js} +2 -2
- package/dist/{test-2Q4YNZ37.js → test-UIL5VHV4.js} +2 -2
- package/dist/{tokens-BT3GS77T.js → tokens-EQZUMIQN.js} +2 -2
- package/dist/{up-YDJED7SL.js → up-TFRMI33E.js} +3 -3
- package/dist/{v4-LTDTGMJJ.js → v4-65AMGY3J.js} +2 -2
- package/dist/wait_load-5QCJ7CSQ.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-GLHICEMZ.js → workspace-TGYO5CGW.js} +2 -2
- package/package.json +3 -3
- package/dist/chunk-76GCN3TN.js +0 -4
- package/dist/clean-XBUYVVYM.js +0 -8
- package/dist/close_out-Q7SFA5WM.js +0 -8
- package/dist/code-3N7DQSV2.js +0 -4
- package/dist/hooks-PCNG22RS.js +0 -4
- package/dist/infra-IPZ5HVTT.js +0 -4
- package/dist/init_workspace-IFCUN6UK.js +0 -4
- package/dist/list_workspaces-VL7AGNVJ.js +0 -7
- package/dist/logs-GNMRM6AW.js +0 -6
- package/dist/notes-YFTRC3O7.js +0 -4
- package/dist/pause-MXYCNP2M.js +0 -4
- package/dist/pr-ZTUJWLW4.js +0 -5
- package/dist/proxy_reload-ETF7OUNM.js +0 -6
- package/dist/remove-BHXASO2G.js +0 -7
- package/dist/remove_workspace-OK3W7ZZS.js +0 -8
- package/dist/restart-IDWEAQ57.js +0 -8
- package/dist/resume-UJCPSO7P.js +0 -8
- package/dist/skills-767TBJUB.js +0 -4
- package/dist/start_args-5YMAKY53.js +0 -4
- package/dist/starting_prompt-MXITZEBX.js +0 -4
- package/dist/stats-EJW6SXZF.js +0 -4
- package/dist/wait_load-WDDIV7VL.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{c as v,k as L}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=budget-
|
|
3
|
+
import{c as v,k as L}from"./chunk-UYESNXMS.js";import"./chunk-Z6XPYFMK.js";import"./chunk-OYYD7LS6.js";import"./chunk-5LAKVBXK.js";import"./chunk-D5K4YE7K.js";import"./chunk-U3GM2WSU.js";import"./chunk-2NSHZRMP.js";import"./chunk-FJ2TYM7L.js";import"./chunk-BEA6MZ6Y.js";import"./chunk-NJRFNCYS.js";import"./chunk-VH2ZJ777.js";import"./chunk-Z2IIHFSA.js";import"./chunk-W43BCA3V.js";import"./chunk-CEDTL7DC.js";import"./chunk-LEX7JGFG.js";import"./chunk-SO5EJ5QK.js";import"./chunk-BJMRSW3U.js";import"./chunk-XYBYBXWX.js";import{A as h,B as w,H as b,K as y,P as k,v as f,w as $}from"./chunk-LBESQTHU.js";import"./chunk-HWJCGLMH.js";import"./chunk-Z4M36MYI.js";import"./chunk-AF2X5LK6.js";import"./chunk-5LHHJX46.js";import{o as d}from"./chunk-YSRY4GFI.js";import"./chunk-7IZXOVO4.js";import"./chunk-7H4RTP3H.js";import"./chunk-WUN4UKLJ.js";import"./chunk-BTVL6SPA.js";import"./chunk-GTKK3LKS.js";import"./chunk-MSMCUTHU.js";import"./chunk-T5NBS5HI.js";import"./chunk-E37YZI3X.js";import{a as c,f as g}from"./chunk-DRKGMFUU.js";g();import N from"node:os";var M=2**30,x=c((r,t)=>Number.isFinite(r)?`${Number(r.toFixed(1))}${t}`:"no limit","limit");async function P(r){let t=await h(),m=w(N.cpus().length),u=$(),l=await k(),n=L(),a=f(y(l,n??[])).map((o,e)=>{let s=u[o.feature]?.workspace,i=s&&d(s)?.services||null,B=s?b(s,i??void 0):null;return{...o,position:e+1,services:i,cost:B}});if(r.json){let o=c(e=>Number.isFinite(e)?e:null,"n");console.log(JSON.stringify({budget:{memory:o(t.memory),cpus:o(t.cpus),preempt:t.preempt},host_load:m,leases:u,waiting:l,running:n?.map(e=>({feature:e.feature,cpus:e.cost.cpus,memory:e.cost.memory,rank:e.rank,busy:e.busy}))??null,waiters:a.map(e=>({feature:e.feature,position:e.position,services:e.services,cpus:e.cost?.cpus??null,memory:e.cost?.memory??null,waited_ms:e.waitedMs,gate:e.gate}))}));return}console.log(`Budget: ${x(t.memory/M," GiB")} memory, ${x(t.cpus," CPUs")}, host load ${m||"unchecked"}, preemption ${t.preempt?"on":"off"}`);let p=Object.entries(u).sort(([,o],[,e])=>o.slot-e.slot);console.log(p.length?"Slots:":"Slots: none held");for(let[o,e]of p)console.log(` ${e.slot} ${o}${e.workspace?` ${e.workspace}`:""}`);console.log(n?n.length?"Running:":"Running: none":"Running: docker unavailable");for(let o of[...n??[]].sort((e,s)=>s.cost.cpus-e.cost.cpus))console.log(` ${v(o)}`);console.log(a.length?"Waiting:":"Waiting: none");for(let o of a){let e=o.services?`${o.services.join(", ")}${o.gate?" for a running feature":""}`:"whole feature",s=o.cost?` (${Number(o.cost.cpus.toFixed(1))} CPUs, ${(o.cost.memory/M).toFixed(1)} GiB)`:"",i=o.waitedMs?` waited ${Math.round(o.waitedMs/6e4)} min${o.position===1&&o.waitedMs>=3e5?", gets the next free room":""}`:"";console.log(` ${o.position}. ${o.feature} ${e}${s}${i}`)}}c(P,"run");export{P as run};
|
|
4
|
+
//# sourceMappingURL=budget-AH6CFJIP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import"./chunk-
|
|
4
|
-
//# sourceMappingURL=cache-
|
|
3
|
+
import"./chunk-ZJ6HW6TS.js";import{c as s}from"./chunk-U3GM2WSU.js";import"./chunk-LEX7JGFG.js";import"./chunk-HWJCGLMH.js";import"./chunk-AF2X5LK6.js";import"./chunk-MSMCUTHU.js";import{h as e,l as c}from"./chunk-T5NBS5HI.js";import"./chunk-E37YZI3X.js";import{a as r,f as i}from"./chunk-DRKGMFUU.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-4Z67QJ73.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{h as H}from"./chunk-
|
|
3
|
+
import{h as H}from"./chunk-CEDTL7DC.js";import{r as W}from"./chunk-GTKK3LKS.js";import{C as B,G as A,a as ne,l as K,w as U,y as G,z as L}from"./chunk-T5NBS5HI.js";import{a as N}from"./chunk-E37YZI3X.js";import{a as c,e as se,f as R}from"./chunk-DRKGMFUU.js";R();var w=se(ne(),1);import*as l from"node:fs";import*as V from"node:os";import*as _ from"node:path";R();import*as $ from"node:fs";import*as X from"node:path";var ue=`# Port Allocation Scheme
|
|
4
4
|
# Each feature slot (1-12) gets a dedicated port range.
|
|
5
5
|
#
|
|
6
6
|
# k8s port-forward listen-ports (the 9000-range) are NOT defined here \u2014 they
|
|
@@ -45,4 +45,4 @@ models:
|
|
|
45
45
|
k8s_context: ${e.trim()||"orbstack"}
|
|
46
46
|
`}c(J,"renderServicesLocalYaml");function z(e,n,r=420){return $.existsSync(e)?{path:e,status:"present"}:($.mkdirSync(X.dirname(e),{recursive:!0}),$.writeFileSync(e,n,{mode:r}),$.chmodSync(e,r),{path:e,status:"created"})}c(z,"seedFile");var C={archetypes:{"node-web":{standards:["ui","config","testing"],mcp_servers:["context7"],test:"npm test"},"node-service":{standards:["service","testing"],test:"npm test"},"node-tool":{standards:["engineering","testing"],validate:"Library: run the unit/smoke tests. No URL, cookie, or Caddy step applies."},"mcp-client":{standards:["engineering","testing"],validate:"Build, then npm run test:integration (Extension Development Host via @vscode/test-cli). Walk the open items in MANUAL-CHECKLIST.md for anything visual."}},caches:{"pnpm-store":{path:"/pnpm-store",env:{npm_config_store_dir:"/pnpm-store"},detect:["pnpm-lock.yaml"]},turbo:{path:"/turbo-cache",env:{TURBO_CACHE_DIR:"/turbo-cache",TURBO_CACHE_MAX_AGE:"14d"},detect:["turbo.json"],max_age:"14d"}},mcp_servers:{context7:{type:"stdio",command:"npx",args:["-y","@upstash/context7-mcp"],env:{CONTEXT7_API_KEY:"${CONTEXT7_API_KEY:-}"}},werkmeister:{type:"http",url:"http://host.docker.internal:${WERKMEISTER_MCP_PORT:-3002}/mcp",headers:{Authorization:"Bearer ${WERKMEISTER_MCP_TOKEN}"}}}};var D=_.join(N,"services.yaml");function M(e){let n=_.join(e,D);return l.existsSync(n)?n:null}c(M,"fragmentPath");var ie="# GENERATED by `werkmeister registry sync` \u2014 do not edit.",F=c(e=>e.startsWith("# GENERATED by "),"isGenerated"),x=["services","setup_services","infrastructure","caches"],ae=["archetypes","caches","mcp_servers","k8s_context","services","infrastructure","setup_services","repos"],y=class extends Error{static{c(this,"RegistryError")}};function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}c(m,"isDict");function q(e){if(!l.existsSync(e))return[];let n=[];for(let r of l.readdirSync(e).sort()){let s=M(_.join(e,r));s&&(l.statSync(_.join(e,r,".git"),{throwIfNoEntry:!1})?.isFile()||n.push(P(r,s)))}return n}c(q,"discoverFragments");function P(e,n){let r;try{r=(0,w.parse)(l.readFileSync(n,"utf8"))}catch(s){throw new y(`${n}: ${s instanceof Error?s.message:String(s)}`)}return{repo:e,path:n,doc:m(r)?r:{}}}c(P,"readFragment");var ce=/\{\{\s*(home|repos_root|workspaces_root|werkmeister_home|local_domain)\s*\}\}/g;function I(e,n){if(typeof e=="string")return e.replace(ce,(r,s)=>n[s]);if(Array.isArray(e))return e.map(r=>I(r,n));if(m(e)){let r={};for(let[s,o]of Object.entries(e))r[s]=I(o,n);return r}return e}c(I,"expandPlaceholders");function Q(e,n){let r={...e};for(let[s,o]of Object.entries(n))r[s]=m(o)&&m(r[s])?Q(r[s],o):o;return r}c(Q,"deepMerge");function j(e,n,r,s){let o=e.get(n);if(o!==void 0&&o!==r)throw new y(`${s} is defined by both ${o} and ${r}`);e.set(n,r)}c(j,"claim");function Z(e,n){let r={archetypes:structuredClone(n.defaults.archetypes??{}),caches:structuredClone(n.defaults.caches??{}),mcp_servers:structuredClone(n.defaults.mcp_servers??{}),services:{},infrastructure:{},setup_services:{},repos:{}},s=new Map;for(let o of Object.keys(r.caches))s.set(`caches/${o}`,"werkmeister");for(let o of e){let i=I(o.doc,n.paths);for(let t of Object.keys(i))if(!(t.startsWith("x-")||t==="repo"||x.includes(t)))throw new y(`${o.path}: unexpected top-level key \`${t}\` \u2014 a fragment may only contain ${x.join(", ")}, repo (and x-* anchor blocks)`);if(i.repo!==void 0){if(!m(i.repo))throw new y(`${o.path}: \`repo:\` must be a map`);Object.assign(r.repos[o.repo]??={services:[],path_mappings:{}},i.repo)}for(let t of x){let d=i[t]??{};if(!m(d))throw new y(`${o.path}: \`${t}:\` must be a map`);for(let[f,a]of Object.entries(d)){if(!m(a))throw new y(`${o.path}: \`${t}.${f}\` must be a map`);j(s,`${t}/${f}`,o.repo,`${t}.${f}`);let p=a;if(t==="services"||t==="setup_services"){if(a.repo!==void 0&&a.repo!==o.repo)throw new y(`${o.path}: ${t}.${f} says repo: ${a.repo} but lives in ${o.repo}`);p={repo:o.repo,...a}}if(t==="services"){p.port_offset!==void 0&&j(s,`port_offset/${p.port_offset}`,`${o.repo}:${f}`,`port_offset ${p.port_offset}`);let k=r.repos[o.repo]??={services:[],path_mappings:{}};k.services.push(f);let g=String(p.path??".").replace(/^\/+|\/+$/g,"");g!==""&&g!=="."&&(k.path_mappings[g]=f)}(t==="services"||t==="infrastructure")&&p.k8s_forward_port!==void 0&&j(s,`k8s_forward_port/${p.k8s_forward_port}`,`${o.repo}:${f}`,`k8s_forward_port ${p.k8s_forward_port}`),r[t][f]=p}}}return Q(r,n.local)}c(Z,"mergeRegistry");var v="disabled_fragments";function ee(e,n,r){let{[v]:s,...o}=n,i=s??[];if(!Array.isArray(i)||!i.every(a=>typeof a=="string"))throw new y(`${r}: ${v} must be a list of repo names`);let t=new Set(i),d=e.filter(a=>t.has(a.repo)),f=structuredClone(o);for(let a of["services","setup_services","infrastructure"]){let p=f[a];if(m(p))for(let[k,g]of Object.entries(p))(d.some(E=>m(E.doc[a])&&k in E.doc[a])||m(g)&&t.has(g.repo))&&delete p[k]}if(m(f.repos))for(let a of t)delete f.repos[a];return{fragments:e.filter(a=>!t.has(a.repo)),skipped:d,unknown:i.filter(a=>!e.some(p=>p.repo===a)),local:f}}c(ee,"applyDisabled");function fe(e,n,r,s=[]){let o={};for(let t of ae)t in e&&(o[t]=e[t]);for(let t of Object.keys(e))t in o||(o[t]=e[t]);return[ie,"# Edit a repo's .werkmeister/services.yaml fragment, or the machine overrides file, then","# run `werkmeister registry sync` (or `werkmeister machine setup`). Regenerated from:",...n.map(t=>`# Source: ${t}`),...s.map(t=>`# Disabled: ${t}`),`# Machine overrides: ${r}`,""].join(`
|
|
47
47
|
`)+(0,w.stringify)(o,{lineWidth:0})}c(fe,"renderRegistry");function pe(e){if(!l.existsSync(e))return null;let n=l.readFileSync(e,"utf8");if(F(n))return null;try{let r=(0,w.parse)(n),s=m(r)?r.k8s_context:void 0;return typeof s=="string"&&s.trim()?s.trim():null}catch{return null}}c(pe,"inheritedK8sContext");function le(e,n){let r;try{r=(0,w.parse)(e)}catch{return[]}if(!m(r))return[];let s=[];for(let o of x){let i=r[o];if(m(i))for(let t of Object.keys(i))t in(n[o]??{})||s.push(`${o}.${t}`)}return s}c(le,"orphanedEntries");function Ee(e,n){let r=c(t=>{try{let d=t===null?null:(0,w.parse)(t);return m(d)?d:{}}catch{return{}}},"sections"),s=r(e),o=r(n),i={added:[],removed:[],changed:[]};for(let t of x){let d=m(s[t])?s[t]:{},f=m(o[t])?o[t]:{};for(let a of new Set([...Object.keys(d),...Object.keys(f)])){let p=`${t}.${a}`;a in d?a in f?JSON.stringify(d[a])!==JSON.stringify(f[a])&&i.changed.push(p):i.removed.push(p):i.added.push(p)}}for(let t of Object.values(i))t.sort();return i}c(Ee,"registryChanges");function te(){return{home:V.homedir(),repos_root:A(),workspaces_root:B(),werkmeister_home:U(),local_domain:W().local_domain}}c(te,"placeholderPaths");function re(e){if(!l.existsSync(e))return{};let n;try{n=(0,w.parse)(l.readFileSync(e,"utf8"))}catch(r){throw new y(`${e}: ${r instanceof Error?r.message:String(r)}`)}if(n==null)return{};if(!m(n))throw new y(`${e}: must be a map of registry keys`);return n}c(re,"readLocalOverlay");function de(e,n,r=A()){let s=M(n);if(!s)return null;let o=q(r).filter(a=>a.repo!==e);o.push(P(e,s));let i=L(),t=re(i),d=t[v];Array.isArray(d)&&(t[v]=d.filter(a=>a!==e));let f=ee(o,t,i);return Z(f.fragments,{defaults:C,local:f.local,paths:te()})}c(de,"branchRegistry");function Se(e,n){let r={...e};for(let s of H(n)){let o=_.basename(s),i;try{i=de(o,s)}catch(t){K(`${o}: branch fragment ignored: ${t instanceof Error?t.message:String(t)}`);continue}for(let[t,d]of Object.entries(i?.services??{}))d.repo===o&&(r[t]=d)}return r}c(Se,"workspaceServices");function xe(e={}){let n="config services.yaml",r=e.reposRoot??A(),s=e.target??G(),o=L();if(e.generatedOnly&&l.existsSync(s)&&!F(l.readFileSync(s,"utf8")))return[{label:n,ok:!1,detail:`${s} is hand-written \u2014 left as is; \`werkmeister registry sync\` converts it (with a backup)`}];let i,t,d,f="";try{if(!e.checkOnly&&!e.target&&!l.existsSync(o)){let h=pe(s)??"orbstack";z(o,J(h)),f=`; seeded ${o} (k8s_context: ${h} \u2014 edit there)`}let u=q(r);if(u.length===0)return[{label:n,ok:!1,detail:`no ${D} found under ${r} \u2014 clone your team's repos there and re-run \`werkmeister machine setup\` (or answer yes to the demo apps)`}];let S=re(o);if(e.from){let h=M(e.from);if(!h)return[{label:n,ok:!1,detail:`no ${D} in ${e.from}`}];let O=_.basename(e.from);u=[...u.filter(T=>T.repo!==O),P(O,h)];let Y=S[v];Array.isArray(Y)&&(S[v]=Y.filter(T=>T!==O))}i=ee(u,S,o),t=Z(i.fragments,{defaults:C,local:i.local,paths:te()}),d=fe(t,i.fragments.map(h=>h.path),o,i.skipped.map(h=>h.path))}catch(u){return[{label:n,ok:!1,detail:u instanceof Error?u.message:String(u)}]}let a=[...i.skipped.map(u=>({label:`fragment ${u.repo}`,ok:!0,detail:`disabled in ${o} \u2014 skipped`})),...i.unknown.map(u=>({label:`fragment ${u}`,ok:!0,detail:`listed in ${v} in ${o}, but no fragment under ${r}`}))],p=c(u=>[u,...a],"report"),k=i.fragments.length,g=`${k} fragment${k===1?"":"s"}`,b=l.existsSync(s)?l.readFileSync(s,"utf8"):null;if(b===d)return p({label:n,ok:!0,detail:`up to date (${g}) at ${s}${f}`});if(e.checkOnly)return p({label:n,ok:!1,detail:b===null?`missing \u2014 would generate ${s} from ${g}`:`drift \u2014 would regenerate ${s} from ${g}`});let E="";if(b!==null&&!F(b)){let u=Math.floor((e.now??Date.now)()/1e3),S=`${s}.bak-${u}`;l.copyFileSync(s,S),E=`; hand-written registry backed up to ${S}`;let h=le(b,t);h.length&&(E+=`; not in any fragment: ${h.join(", ")}`)}try{l.mkdirSync(_.dirname(s),{recursive:!0}),l.writeFileSync(s,d)}catch(u){return p({label:n,ok:!1,detail:`could not write ${s}: ${u}`})}return p({label:n,ok:!0,detail:`generated ${s} from ${g}${E}${f}`})}c(xe,"syncRegistry");export{ue as a,me as b,he as c,J as d,z as e,D as f,y as g,q as h,Z as i,pe as j,Ee as k,de as l,Se as m,xe as n};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-2NSHZRMP.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{j as a}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{j as a}from"./chunk-7YPA7VJQ.js";import{m as n}from"./chunk-T5NBS5HI.js";import{b as m}from"./chunk-E37YZI3X.js";import{a as s,f as p}from"./chunk-DRKGMFUU.js";p();import*as f from"node:fs";import*as o from"node:path";function c(i){let t=o.resolve(i??"."),r=t;for(;!f.existsSync(o.join(m(r),"workspace.yml"));){let e=o.dirname(r);e===r&&(n(`No .werkmeister/workspace.yml found from ${t}`),process.exit(1)),r=e}return r}s(c,"findWorkspaceDir");function h(i){let t=c(i.start),r=a(t).starting_prompt;(typeof r!="string"||!r.trim())&&(n(`${t} has no starting_prompt`),process.exit(2)),console.log(r.trim())}s(h,"run");export{c as a,h as b};
|
|
4
|
+
//# sourceMappingURL=chunk-3BXCMPNT.js.map
|