werkmeister 0.91.4 → 0.91.5
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-WQIPDR2Q.js → budget-R4FJOTP6.js} +2 -2
- package/dist/{cache-FARPRG5E.js → cache-OGGVG7KB.js} +2 -2
- package/dist/{chunk-O44SKWZ7.js → chunk-23EQE7RX.js} +2 -2
- package/dist/{chunk-T5WV3QDA.js → chunk-2IVIZEQL.js} +2 -2
- package/dist/{chunk-HJSLSOJ3.js → chunk-3A6IASTK.js} +2 -2
- package/dist/{chunk-WIGQSS2X.js → chunk-4OB7RKKL.js} +2 -2
- package/dist/{chunk-NXOJRIS6.js → chunk-4OQR5UBS.js} +2 -2
- package/dist/{chunk-4GSTJMF7.js → chunk-4QAG5LXA.js} +2 -2
- package/dist/{chunk-VN32SZ2L.js → chunk-5FEH5O4E.js} +2 -2
- package/dist/{chunk-5TZIMYNB.js → chunk-6GKCXKXD.js} +2 -2
- package/dist/{chunk-TUQS6D6O.js → chunk-6J3LEO5L.js} +2 -2
- package/dist/{chunk-GQDWUIMF.js → chunk-72GRCLSV.js} +2 -2
- package/dist/{chunk-XIMWU2VK.js → chunk-75GZRX2Y.js} +2 -2
- package/dist/{chunk-RBNJHJXD.js → chunk-75ZFZAPO.js} +2 -2
- package/dist/chunk-7QJZXCOL.js +4 -0
- package/dist/{chunk-RQX7WACB.js → chunk-7ZWI45QR.js} +2 -2
- package/dist/{chunk-JOSVYYXM.js → chunk-AAEPE22B.js} +2 -2
- package/dist/{chunk-HIUZMW2O.js → chunk-B7QKF6MH.js} +2 -2
- package/dist/{chunk-DAHOI5D7.js → chunk-CJ2MMCT2.js} +2 -2
- package/dist/{chunk-ZAIWJCRW.js → chunk-COMQAIZ5.js} +3 -3
- package/dist/{chunk-7JBLTEN4.js → chunk-CRLQWXKY.js} +2 -2
- package/dist/{chunk-JYSOWCPY.js → chunk-CTPE3UKH.js} +2 -2
- package/dist/{chunk-IYMCWSAM.js → chunk-CTW3AKOC.js} +2 -2
- package/dist/{chunk-JUFGJUHL.js → chunk-DLQDRYME.js} +2 -2
- package/dist/{chunk-XDBGPY7T.js → chunk-ERRNQYCR.js} +2 -2
- package/dist/{chunk-NQPGEZLI.js → chunk-ERVC6WFY.js} +2 -2
- package/dist/{chunk-SVIEMSKY.js → chunk-ES6NWI5A.js} +2 -2
- package/dist/chunk-EXJDOSUY.js +82 -0
- package/dist/{chunk-ZXTMB5AU.js → chunk-F2GIRLO4.js} +3 -3
- package/dist/{chunk-MYTRAGRP.js → chunk-FHZIDXWS.js} +2 -2
- package/dist/{chunk-NLSN2C4E.js → chunk-FR6WM7DP.js} +2 -2
- package/dist/{chunk-OKTWE2V4.js → chunk-GGNHXHCJ.js} +2 -2
- package/dist/{chunk-K5A7BVAE.js → chunk-GO25POZN.js} +2 -2
- package/dist/{chunk-2OBDFCPM.js → chunk-GQFG54TB.js} +2 -2
- package/dist/{chunk-IVTU4Y6X.js → chunk-HTXPEFB5.js} +3 -3
- package/dist/{chunk-LTQ2HPT4.js → chunk-HURUDHZY.js} +2 -2
- package/dist/{chunk-URZNCOSY.js → chunk-HZW46MXF.js} +2 -2
- package/dist/{chunk-MECWXUDJ.js → chunk-IAKIYAB6.js} +2 -2
- package/dist/{chunk-CBRXAY2R.js → chunk-IGFJKONX.js} +2 -2
- package/dist/{chunk-HLXXHDVL.js → chunk-IHLJZ264.js} +2 -2
- package/dist/{chunk-FDYQ5FWY.js → chunk-IX432NBB.js} +2 -2
- package/dist/{chunk-UKPYZ37C.js → chunk-JIQKEAAT.js} +2 -2
- package/dist/{chunk-XG3X2W2I.js → chunk-JKWBF6YT.js} +3 -3
- package/dist/{chunk-SXYNVTE3.js → chunk-JVNGHPFK.js} +2 -2
- package/dist/{chunk-KO2QZFBQ.js → chunk-KIFTALQU.js} +2 -2
- package/dist/{chunk-4QT5TSSH.js → chunk-LI5SIN5C.js} +2 -2
- package/dist/{chunk-6ATXXE43.js → chunk-LRCUNKEV.js} +2 -2
- package/dist/{chunk-3EREHOZ2.js → chunk-M5W4QN43.js} +2 -2
- package/dist/{chunk-FOYHYKRH.js → chunk-MVSLV4HP.js} +2 -2
- package/dist/{chunk-NW75RG7X.js → chunk-NBNZZ5L3.js} +2 -2
- package/dist/{chunk-JJYNDTAA.js → chunk-O5ZMBYFB.js} +2 -2
- package/dist/{chunk-6VANSDFT.js → chunk-O73IDX5U.js} +2 -2
- package/dist/{chunk-4MTBW4JJ.js → chunk-PDOPZCTO.js} +2 -2
- package/dist/{chunk-BR37L7RV.js → chunk-PHVIBSDN.js} +2 -2
- package/dist/{chunk-QNDD32A4.js → chunk-PQWBLNGT.js} +2 -2
- package/dist/{chunk-DWUV7N2R.js → chunk-Q4ADR7ES.js} +2 -2
- package/dist/{chunk-APBEHTAV.js → chunk-TBWYSXGE.js} +2 -2
- package/dist/{chunk-GGFXAXKK.js → chunk-TSUANNLO.js} +2 -2
- package/dist/{chunk-IQ6HP7BI.js → chunk-U4MCZGXF.js} +2 -2
- package/dist/{chunk-6D2YQWII.js → chunk-UNP37CAA.js} +2 -2
- package/dist/{chunk-LI6L7E6G.js → chunk-UQEK67GG.js} +2 -2
- package/dist/{chunk-PT37SD6G.js → chunk-VQPQGIIA.js} +2 -2
- package/dist/{chunk-KHJGK7KA.js → chunk-W2A3APW3.js} +2 -2
- package/dist/{chunk-FFB3QH7L.js → chunk-WTRWIBE2.js} +2 -2
- package/dist/{chunk-6RS4O3IL.js → chunk-WWRZELOF.js} +2 -2
- package/dist/{chunk-KDGX6LYQ.js → chunk-XYYHMHJN.js} +2 -2
- package/dist/{chunk-F5ONBOUW.js → chunk-XZE2RETE.js} +2 -2
- package/dist/{chunk-HD6XWZ3T.js → chunk-YA2EFUJR.js} +2 -2
- package/dist/clean-VMJ6L75S.js +8 -0
- package/dist/close_out-AZIIK5Z6.js +8 -0
- package/dist/code-WQAJ5EMW.js +4 -0
- package/dist/{config-UHCYUID6.js → config-AJVTKLJS.js} +2 -2
- package/dist/{connect-TURJXKGI.js → connect-NJFQPCS7.js} +2 -2
- package/dist/{daemon-KU2ZFQTL.js → daemon-Q7T3SKVE.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-VFW2CTPQ.js → detect-V53OC27D.js} +2 -2
- package/dist/{down-F3LIVSOX.js → down-36V575ZF.js} +3 -3
- package/dist/{fixture-C2MJ4C7C.js → fixture-UAPZVSPK.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-2BJJQSEF.js +4 -0
- package/dist/{hooks_gen-W5F4WNDX.js → hooks_gen-FEBMW3OW.js} +2 -2
- package/dist/infra-2DHIMM4F.js +4 -0
- package/dist/init_workspace-XZIYDQFW.js +4 -0
- package/dist/{intercept-U4HY2RHL.js → intercept-27ZGKYAZ.js} +2 -2
- package/dist/{issue-7NKALCG3.js → issue-VB4WNURR.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-NNQ4X7QZ.js +7 -0
- package/dist/logs-NVNETSH6.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-OTCDVPVD.js → migrate-PWDRNISF.js} +2 -2
- package/dist/notes-3ZKBU334.js +4 -0
- package/dist/{open-HDOUIVGM.js → open-36OQDVQE.js} +2 -2
- package/dist/{optimize-FZT3DNJ2.js → optimize-X53SFNF7.js} +2 -2
- package/dist/pause-A6JQJGIO.js +4 -0
- package/dist/pr-Y43NJ2FK.js +5 -0
- package/dist/proxy_reload-OW6TVBCE.js +6 -0
- package/dist/{registry-FY2UCHTZ.js → registry-UYTUM5HO.js} +2 -2
- package/dist/remove-NXU7V4A2.js +7 -0
- package/dist/remove_workspace-PSMGBAAS.js +8 -0
- package/dist/restart-6K4BINQB.js +8 -0
- package/dist/resume-H7OF52RP.js +8 -0
- package/dist/{safari-JSZDEKSI.js → safari-AIMRD3E3.js} +2 -2
- package/dist/{sandbox-FYH2VLRR.js → sandbox-TBPUWSSN.js} +2 -2
- package/dist/{services-TCZ2PPWU.js → services-523KMJHF.js} +2 -2
- package/dist/{setup-XRX7OXYW.js → setup-UVG3NYQE.js} +2 -2
- package/dist/skills-NM4PWYNT.js +4 -0
- package/dist/{slots-6PHGK5TC.js → slots-EYLMSV4K.js} +2 -2
- package/dist/{standards-PEIVD6JT.js → standards-ZB7DEVTU.js} +2 -2
- package/dist/start_args-GZJA6MLA.js +4 -0
- package/dist/starting_prompt-T7OVVDSA.js +4 -0
- package/dist/stats-6T7JOSLN.js +4 -0
- package/dist/{status-2OKGTZRJ.js → status-JC2EUSON.js} +2 -2
- package/dist/{stop-AOOT6NUR.js → stop-Z2EQBRL4.js} +2 -2
- package/dist/{telepresence-P6Y4C6WA.js → telepresence-XSYMMYID.js} +2 -2
- package/dist/{test-L77SOWWQ.js → test-5RZZFC2Y.js} +2 -2
- package/dist/{tokens-7HWFYQSY.js → tokens-MED253WW.js} +2 -2
- package/dist/{up-L6PHDJVM.js → up-SBMD53BV.js} +3 -3
- package/dist/{v4-5US2O6QZ.js → v4-NEZ2BIHB.js} +2 -2
- package/dist/wait_load-FQJOFDDH.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-Z6USOTFM.js → workspace-6AEGC4FR.js} +2 -2
- package/package.json +3 -3
- package/dist/chunk-LQXTBGKC.js +0 -82
- package/dist/chunk-SHROYIK7.js +0 -4
- package/dist/clean-6YVOSY5U.js +0 -8
- package/dist/close_out-CNBRJKZQ.js +0 -8
- package/dist/code-WN6UPYIM.js +0 -4
- package/dist/hooks-L7KGVKEZ.js +0 -4
- package/dist/infra-K6FUKFUI.js +0 -4
- package/dist/init_workspace-V5TNTIUR.js +0 -4
- package/dist/list_workspaces-7OH5BQRX.js +0 -7
- package/dist/logs-W7RKEROW.js +0 -6
- package/dist/notes-TKVMQ6RW.js +0 -4
- package/dist/pause-HATOBYHP.js +0 -4
- package/dist/pr-IKUZTXV7.js +0 -5
- package/dist/proxy_reload-3CA5QYSY.js +0 -6
- package/dist/remove-7MAT5MUC.js +0 -7
- package/dist/remove_workspace-E2URO3HT.js +0 -8
- package/dist/restart-USUQW3ZJ.js +0 -8
- package/dist/resume-GF4S6EMB.js +0 -8
- package/dist/skills-RJXOVOVL.js +0 -4
- package/dist/start_args-NMVYVCUX.js +0 -4
- package/dist/starting_prompt-H6ZBHU5H.js +0 -4
- package/dist/stats-IGG5ZSCD.js +0 -4
- package/dist/wait_load-TXGI7LYA.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-HTXPEFB5.js";import"./chunk-Q4ADR7ES.js";import"./chunk-YA2EFUJR.js";import"./chunk-3A6IASTK.js";import"./chunk-W2A3APW3.js";import"./chunk-GO25POZN.js";import"./chunk-2IVIZEQL.js";import"./chunk-5FEH5O4E.js";import"./chunk-EXJDOSUY.js";import"./chunk-LI5SIN5C.js";import"./chunk-PHVIBSDN.js";import"./chunk-IGFJKONX.js";import"./chunk-CJ2MMCT2.js";import"./chunk-ERVC6WFY.js";import"./chunk-DLQDRYME.js";import"./chunk-JKWBF6YT.js";import"./chunk-M5W4QN43.js";import"./chunk-75GZRX2Y.js";import{A as h,B as w,H as b,K as y,P as k,v as f,w as $}from"./chunk-6J3LEO5L.js";import"./chunk-IX432NBB.js";import"./chunk-GGNHXHCJ.js";import"./chunk-4OQR5UBS.js";import"./chunk-FHZIDXWS.js";import{o as d}from"./chunk-ERRNQYCR.js";import"./chunk-CTPE3UKH.js";import"./chunk-75ZFZAPO.js";import"./chunk-UNP37CAA.js";import"./chunk-PQWBLNGT.js";import"./chunk-WWRZELOF.js";import"./chunk-O73IDX5U.js";import"./chunk-TSUANNLO.js";import"./chunk-ES6NWI5A.js";import{a as c,f as g}from"./chunk-4QAG5LXA.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-R4FJOTP6.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-7QJZXCOL.js";import{c as s}from"./chunk-GO25POZN.js";import"./chunk-DLQDRYME.js";import"./chunk-IX432NBB.js";import"./chunk-4OQR5UBS.js";import"./chunk-O73IDX5U.js";import{h as e,l as c}from"./chunk-TSUANNLO.js";import"./chunk-ES6NWI5A.js";import{a as r,f as i}from"./chunk-4QAG5LXA.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-OGGVG7KB.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{b as f}from"./chunk-
|
|
3
|
+
import{b as f}from"./chunk-72GRCLSV.js";import{q as c}from"./chunk-HTXPEFB5.js";import{b as u}from"./chunk-O73IDX5U.js";import{h as o,j as a,m as n}from"./chunk-TSUANNLO.js";import{a as s,f as i}from"./chunk-4QAG5LXA.js";i();function m(r,e){let t=r.feature||f(process.cwd()).FEATURE;return t||(n("Feature name required: pass it as an argument or set FEATURE in a .env file."),process.exit(1)),t==="infra"&&(n(`${e} the infra stack is not supported: every workspace shares it.`),process.exit(1)),t}s(m,"featureArg");function p(r,e){throw r instanceof u&&e[r.code]&&(n(r.message),a(e[r.code]),process.exit(1)),r}s(p,"reportHint");async function l(r){let e=m(r,"Pausing");console.log(`
|
|
4
4
|
${o.BOLD}=== werkmeister pause: ${e} ===${o.RESET}
|
|
5
5
|
`);try{let{containers:t}=await c(e);console.log(`
|
|
6
6
|
${o.GREEN}${o.BOLD}Paused '${e}': ${t.length} container(s) frozen, its Claude session is held.${o.RESET} Resume with: werkmeister feature resume ${e}
|
|
7
7
|
`)}catch(t){p(t,{NOT_RUNNING:`Nothing to pause. Start it with: werkmeister feature up ${e}`,ALREADY_PAUSED:`Resume it with: werkmeister feature resume ${e}`,NO_WORKSPACE:"Run it from the workspace folder, or check: werkmeister workspace list",COMPOSE_PAUSE_FAILED:`Undo what did freeze with: werkmeister feature resume ${e}`})}}s(l,"run");export{m as a,p as b,l as c};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-23EQE7RX.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-ERVC6WFY.js";import{r as W}from"./chunk-WWRZELOF.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-TSUANNLO.js";import{a as N}from"./chunk-ES6NWI5A.js";import{a as c,e as se,f as R}from"./chunk-4QAG5LXA.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-2IVIZEQL.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{m as c}from"./chunk-
|
|
3
|
+
import{m as c}from"./chunk-4OQR5UBS.js";import{j as h,l as k}from"./chunk-TSUANNLO.js";import{a,f as w}from"./chunk-4QAG5LXA.js";w();import*as m from"node:fs";import*as d from"node:path";var $="# --- sandbox workspace (managed section)",E=`${$} -----------------------------------
|
|
4
4
|
# Repo worktrees nested in this workspace, ignored by name. Rewritten by
|
|
5
5
|
# \`werkmeister workspace init\` on each run; rules above come from the repo's main.
|
|
6
6
|
`,x=["compose.yml","compose.gate.yml",".werkmeister/agent-state.json",".werkmeister/sessions/",".werkmeister/notices.json",".werkmeister/last-exec",".werkmeister/starts.json",".werkmeister/token",".werkmeister/wake-nudge*"],C=["/.env","/.env.*",...x.map(t=>`/${t}`)];function v(t){let i=["rm","--cached","--quiet","--ignore-unmatch","--",...x];c(["git","-C",t,...i],{capture:!0})}a(v,"untrackRuntimeFiles");function A(t){let i=d.join(t,".gitignore"),e="";try{e=m.readFileSync(i,"utf8")}catch{}let n=new Set(e.split(`
|
|
@@ -20,4 +20,4 @@ import{m as c}from"./chunk-NXOJRIS6.js";import{j as h,l as k}from"./chunk-GGFXAX
|
|
|
20
20
|
then rerun; the worktree lands on that branch.
|
|
21
21
|
Start over (deletes the remote branch): rerun with --force
|
|
22
22
|
Keep both: pick a different feature name.`)}h(` ${r}: worktree \u2192 ${e} (from ${l})`),f=["git","-C",t,"worktree","add","--no-track","-b",e,i,l]}let o=c(f,{capture:!0});if(o.status!==0)throw new Error(o.stderr.trim()||`git worktree add failed for ${r}`);if(s.status!==0)for(let[l,u]of[["remote","origin"],["merge",`refs/heads/${e}`]])c(["git","-C",t,"config",`branch.${e}.${l}`,u],{capture:!0})}a(D,"createWorktree");function S(t){return!!c(["git","-C",t,"status","--porcelain"],{capture:!0}).stdout.trim()}a(S,"worktreeIsDirty");function N(t,i,e){let n=c(["git","-C",t,"worktree","remove","--force",i],{capture:!0});if(n.status!==0)return[!1,n.stderr.trim()||`could not remove worktree ${i}`];let r=c(["git","-C",t,"branch","-D",e],{capture:!0});return r.status!==0?[!0,`worktree removed but branch ${e} lingered: ${r.stderr.trim()}`]:[!0,""]}a(N,"removeWorktree");function H(t,i,e=[]){if(!m.existsSync(d.join(t,".git")))return!1;let n=e.length?["--",...e]:[];try{return c(["git","-C",t,"add","-A",...n],{capture:!0,check:!0}),c(["git","-C",t,"diff","--cached","--quiet",...n],{capture:!0}).status===0?!1:(c(["git","-C",t,"commit","-q","-m",i,...n],{capture:!0,check:!0}),!0)}catch(r){return k(`Could not commit ${i}: ${r.message}`),!1}}a(H,"commitRecord");export{A as a,F as b,W as c,j as d,_ as e,T as f,D as g,S as h,N as i,H as j};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-3A6IASTK.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{d as rt}from"./chunk-
|
|
3
|
+
import{d as rt}from"./chunk-IHLJZ264.js";import{a as Xe,b as M,c as Ze,e as et,g as tt}from"./chunk-LRCUNKEV.js";import{d as Qe,o as qe}from"./chunk-YA2EFUJR.js";import{b as ze,c as ce,g as ae,h as Je,i as fe,j as Ye}from"./chunk-3A6IASTK.js";import{n as Ke}from"./chunk-2IVIZEQL.js";import{r as se,s as ie,u as Ve}from"./chunk-5FEH5O4E.js";import{c as ne,d as Le}from"./chunk-LI5SIN5C.js";import{c as Oe}from"./chunk-CJ2MMCT2.js";import{h as je}from"./chunk-ERVC6WFY.js";import{k as Ae}from"./chunk-DLQDRYME.js";import{A as Ne,E as te,F as Fe,H as z,J as re,M as Me,Q as Ue,R as oe,i as Te,o as j,p as We,w as Ie,y as ee,z as De}from"./chunk-JKWBF6YT.js";import{b as Ge,e as He,g as Be}from"./chunk-6J3LEO5L.js";import{a as B}from"./chunk-GGNHXHCJ.js";import{m as K}from"./chunk-4OQR5UBS.js";import{a as Pe}from"./chunk-FHZIDXWS.js";import{b as be}from"./chunk-UNP37CAA.js";import{b as Re,c as Ce}from"./chunk-PQWBLNGT.js";import{o as _e,p as Z,s as xe}from"./chunk-WWRZELOF.js";import{b as ve}from"./chunk-O73IDX5U.js";import{G as X,M as Se,S as $e,T as Ee,a as Rt,h as A,j as k,k as y,l as g,m as V,n as F,o as ge,r as ye,s as q}from"./chunk-TSUANNLO.js";import{b as N}from"./chunk-ES6NWI5A.js";import{a as i,e as xt,f as C}from"./chunk-4QAG5LXA.js";C();import*as T from"node:fs";import*as J from"node:path";var ot=i(e=>J.join(N(e),"issue.md"),"issueCopyPath"),U=class extends Error{static{i(this,"IssueFetchError")}};async function nt(e,r=()=>new Date,o=j({text:e})){let t=await o.fetchIssue(e);if(!t)throw new U(`couldn't read ${e} from ${o.label}`);return{ref:t.ref,url:t.url??o.url(t.ref),tracker:o.id,title:t.title??"",status:t.status??"",body:t.description??"",comments:t.comments??[],fetchedAt:r().toISOString()}}i(nt,"fetchIssueSnapshot");var ue=`
|
|
4
4
|
|
|
5
5
|
## Comments
|
|
6
6
|
`;function Ct(e){let r=["---",`ref: ${e.ref}`,`url: ${e.url??""}`,`tracker: ${e.tracker}`,`status: ${e.status}`,`fetched: ${e.fetchedAt}`,"---","",`# ${e.title}`,"",e.body].join(`
|
|
@@ -33,4 +33,4 @@ ${A.BOLD}Workspace initialised.${A.RESET} Open a new Claude Code session from th
|
|
|
33
33
|
${A.BOLD}Workspace ready.${A.RESET} cd ${a} and open a Claude Code session from there.
|
|
34
34
|
|
|
35
35
|
`),a):(g(`Workspace created at ${a}, but its containers are not set up: it has no slot (see the slot warning above). Free a slot with \`werkmeister feature down <feature>\`, then run \`werkmeister workspace init\` there.`),a)}i(Lr,"provisionWorkspace");export{U as a,nt as b,R as c,de as d,wt as e,Xt as f,Lr as g};
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-4OB7RKKL.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as I,b as _}from"./chunk-
|
|
3
|
+
import{a as I,b as _}from"./chunk-O73IDX5U.js";import{s as C,t as g}from"./chunk-TSUANNLO.js";import{a as r,f as h}from"./chunk-4QAG5LXA.js";h();import{spawn as B}from"node:child_process";import{writeFileSync as A}from"node:fs";import O from"node:fs/promises";import T from"node:os";import E from"node:path";import{stripVTControlCharacters as M}from"node:util";function J(t){return M(t)}r(J,"stripAnsi");async function Y(t){try{return await O.access(t,O.constants.X_OK),!0}catch{return!1}}r(Y,"isExecutable");async function Z(t){try{return(await O.stat(t)).isFile()}catch{return!1}}r(Z,"isFile");var D=["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR"];function R(t=process.env){return Object.fromEntries(Object.entries(t).filter(([e])=>!D.includes(e)))}r(R,"gitEnv");function y(){let t=[E.join(T.homedir(),".local","bin"),E.join(T.homedir(),".cargo","bin"),"/opt/homebrew/bin","/usr/local/bin","/usr/bin","/bin"],e=process.env.PATH?process.env.PATH.split(E.delimiter):[],o=[...new Set([...t,...e])].join(E.delimiter);return R({...process.env,PATH:o})}r(y,"childEnv");var K=r(()=>C("GH_BIN")||(g()?w("gh"):"gh"),"ghBin"),P=r(()=>process.env.CLAUDE_BIN||w("claude"),"fixtureClaudeBin"),tt=r(()=>process.env.CODEX_BIN||w("codex"),"fixtureCodexBin"),G=r(()=>C("DOCKER_BIN")||"docker","dockerBin");function x(t){return t==="gh"?K():t==="docker"?G():g()?t==="claude"?P():t==="kubectl"?w("kubectl"):t:t}r(x,"toolBin");var v=new Map;function w(t){let e=v.get(t);if(e)return e;let o=E.join(T.tmpdir(),`werkmeister-fixture-${t}-${process.pid}`);return A(o,`#!/bin/sh
|
|
4
4
|
echo "${t} called under WERKMEISTER_FIXTURE: $*" >&2
|
|
5
5
|
exit 1
|
|
6
6
|
`,{mode:493}),v.set(t,o),o}r(w,"fixtureStub");function et(t,e,o=T.homedir()){return new Promise((i,s)=>{let n=B(x(t),e,{cwd:o,env:y(),stdio:["ignore","pipe","pipe"]}),u="",a="",m=setTimeout(()=>{n.kill("SIGKILL"),s(new _("The `claude` CLI timed out after 120s.",I))},12e4);n.stdout.on("data",c=>u+=c.toString()),n.stderr.on("data",c=>a+=c.toString()),n.on("error",c=>{clearTimeout(m),s(c)}),n.on("close",c=>{clearTimeout(m),i({stdout:u,stderr:a,code:c})})})}r(et,"runCapture");function rt(t){return`'${t.replace(/'/g,"'\\''")}'`}r(rt,"shellQuote");h();import{spawn as U,spawnSync as F}from"node:child_process";var S=r((t,e)=>t[0]==="git"?R(e):e,"spawnEnv"),N=r(t=>t*Number(process.env.WERKMEISTER_TIMEOUT_SCALE||1)*1e3,"timeoutMs"),l=class extends Error{static{r(this,"ProcError")}status;stdout;stderr;cmd;code;constructor(e,o,i,s="",n="",u){super(e),this.name="ProcError",this.cmd=o,this.status=i,this.stdout=s,this.stderr=n,this.code=u}};function ct(t,e={}){let o=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(o[0]="pipe");let i=F(x(t[0]),t.slice(1),{cwd:e.cwd,env:S(t,e.env),input:e.input,timeout:e.timeout!==void 0?N(e.timeout):void 0,encoding:"utf8",stdio:o}),s=i.stdout??"",n=i.stderr??"";if(i.error){let a=i.error.code;throw a==="ETIMEDOUT"?new l(`Command timed out after ${e.timeout}s: ${t.join(" ")}`,t,i.status??-1,s,n,"ETIMEDOUT"):a==="ENOENT"?new l(`Command not found: ${t[0]}`,t,-1,s,n,"ENOENT"):new l(`Command failed to start: ${t.join(" ")} (${i.error.message})`,t,i.status??-1,s,n,a)}let u=i.status??-1;if(e.check&&u!==0)throw new l(`Command failed with exit code ${u}: ${t.join(" ")}`,t,u,s,n);return{status:u,stdout:s,stderr:n}}r(ct,"run");function dt(t,e={}){return new Promise((o,i)=>{let s=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(s[0]="pipe");let n=U(x(t[0]),t.slice(1),{cwd:e.cwd,env:S(t,e.env),stdio:s,signal:e.signal}),u=e.timeout!==void 0?setTimeout(()=>n.kill(),N(e.timeout)):void 0,a="",m="";n.stdout?.on("data",d=>a+=d.toString()),n.stderr?.on("data",d=>m+=d.toString()),e.input!==void 0&&n.stdin?.end(e.input);let c=!1,p=r((d,f,j)=>{c||(c=!0,i(new l(d,t,f,a,m,j)))},"fail"),b=r(d=>{c||(c=!0,o({status:d,stdout:a,stderr:m}))},"done"),$=r(()=>e.signal?.aborted===!0,"aborted");n.on("error",d=>{clearTimeout(u);let f=d.code;if($()){p(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(f==="ENOENT"){p(`Command not found: ${t[0]}`,-1,"ENOENT");return}p(`Command failed to start: ${t.join(" ")} (${d.message})`,-1,f)}),n.on("close",d=>{if(clearTimeout(u),$()){p(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(n.killed&&e.timeout!==void 0){p(`Command timed out after ${e.timeout}s: ${t.join(" ")}`,-1,"ETIMEDOUT");return}let f=d??-1;if(e.check&&f!==0){p(`Command failed with exit code ${f}: ${t.join(" ")}`,f);return}b(f)})})}r(dt,"runAsync");export{J as a,Y as b,Z as c,R as d,y as e,K as f,P as g,tt as h,x as i,et as j,rt as k,l,ct as m,dt as n};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-4OQR5UBS.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var p=(a,b)=>e(a,"name",{value:b,configurable:!0}),q=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var l=(a,b)=>()=>(a&&(b=a(a=0)),b);var r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),s=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},m=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var t=(a,b,c)=>(c=a!=null?g(j(a)):{},m(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));var w,o=l(()=>{w={sha:"
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var p=(a,b)=>e(a,"name",{value:b,configurable:!0}),q=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var l=(a,b)=>()=>(a&&(b=a(a=0)),b);var r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),s=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},m=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var t=(a,b,c)=>(c=a!=null?g(j(a)):{},m(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));var w,o=l(()=>{w={sha:"fb5fec2bd1102caa2b94bfd72ac24d7362c63a0a",dirty:!1}});export{p as a,q as b,r as c,s as d,t as e,o as f,w as g};
|
|
4
|
+
//# sourceMappingURL=chunk-4QAG5LXA.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 it,b as ke,c as at,d as ct,e as Se,f as q,g as dt,h as lt}from"./chunk-
|
|
3
|
+
import{a as it,b as ke,c as at,d as ct,e as Se,f as q,g as dt,h as lt}from"./chunk-EXJDOSUY.js";import{J as re,d as Y,g as se,u as je,w as rt,x as ot}from"./chunk-LI5SIN5C.js";import{a as oe,b as ht,c as mt}from"./chunk-IGFJKONX.js";import{c as he,d as Je,e as Qe,g as Ze,h as j,i as et,j as I,k as tt,m as V,n as me,o as ge}from"./chunk-ERVC6WFY.js";import{c as Ke,h as Ve,k as ze}from"./chunk-DLQDRYME.js";import{A as nt,B as we,G as st,I as B,O as ne,R as G,o as z,t as U,y as ye}from"./chunk-JKWBF6YT.js";import{a as ut}from"./chunk-75GZRX2Y.js";import{a as ue}from"./chunk-GGNHXHCJ.js";import{m as te}from"./chunk-4OQR5UBS.js";import{c as Ie,d as ft,e as pt}from"./chunk-FHZIDXWS.js";import{d as W,e as pe}from"./chunk-WWRZELOF.js";import{b as fe}from"./chunk-O73IDX5U.js";import{I as Ye,S as qe,Z as Xe,a as Ae,j as C,k as b,l as A}from"./chunk-TSUANNLO.js";import{a as K,b as v}from"./chunk-ES6NWI5A.js";import{a,e as Re,f as m}from"./chunk-4QAG5LXA.js";m();var zt="This is an interactive run: check with me at each stage's human check.",gt="Run `werkmeister feature up` only when the gate needs it, 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.","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.',gt].map(e=>`- ${e}`).join(`
|
|
4
4
|
`),yt=[[/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."]],Jt=a(e=>new RegExp(`(?:^|(?<!["\u201C'])\\brun )\`?${e.source}`,"i"),"stepRe"),Qt=yt.map(([e])=>Jt(e)),Zt=/^(\s*(?:[-*]|\d+\.) +(?:\[[ x]\] +)?)?(.*)$/;function wt(e){let t=new Set,n=e.split(`
|
|
5
5
|
`).flatMap(s=>{let[,r="",o=""]=Zt.exec(s)??[],i=o.split(/(?<=[.!?]) +/).filter(c=>{let d=Qt.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:",...yt.filter((s,r)=>t.has(r)).map(([,s])=>s)].join(`
|
|
@@ -291,4 +291,4 @@ ${r}
|
|
|
291
291
|
`),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(Qn,"salvageLegacyHandoffNotes");function Zn(e){return e.type==="handoff"&&e.frontmatter.author==="workspace-creation"&&!e.body.includes("Seeded from `starting_prompt`")}a(Zn,"isPlaceholderHandoff");function es(e){let t=S.readFileSync(e.path,"utf8");S.writeFileSync(e.path,t.replace(/^status:.*$/m,"status: superseded"))}a(es,"supersedeNote");function ts(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(f=>f.type==="handoff");if(d.some(f=>!Zn(f)))return;for(let f of d)es(f);S.mkdirSync(c,{recursive:!0});let l=Pe(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(`
|
|
292
292
|
`)+`
|
|
293
293
|
`),b(`Seeded starting handoff \u2192 ${x.relative(e,x.join(c,l))}`)}catch(c){A(`Could not seed starting handoff: ${c.message}`)}}a(ts,"seedStartingHandoff");function ns(e){let{workspaceRoot:t,workspaceName:n,repos:s,task:r,meta:o,inputs:i,configOverride:c}=e,d=Y(t),l=x.join(t,d.instructionsFile),u=null,f=null,w=I(null,j(t));if(Object.keys(w).length){let[R,ee]=G();for(let H of tt(R,w))A(H);let _e=B(t,c),de=s.map(([H])=>H),Vt=(o.SERVICES??"").split(",").map(H=>H.trim()).filter(H=>H),[le]=V(de,R,ee,_e,w,Vt);f=le,u=ht(le,w,de,i.work_type??""),C(`Standards routing: active = ${le.join(", ")}`),ge(t,me(le,w,ne(i.work_type??"").gate))}else A(pe()||`no standard modules found in ${W()} \u2014 this workspace gets no standards routing, skills, or edit-time gate`);S.mkdirSync(ie(t),{recursive:!0}),Qn(t,l);let $=i.starting_prompt??"";ts(t,$,i.work_type??"",e.isCreate||$.trim()?e.issue??null:null);let _=mt(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)}))),b(`Wrote ${X}`);let Z=x.join(v(t),"pr-rules.md");S.writeFileSync(Z,ke(".werkmeister/notes/")),b(`Wrote ${Z}`);for(let R of Be(t,null,null,f))b(`Wrote ${R}`);if(d.agents&&ss(e),se(t)){let R=je(t);re(t),b(`Wrote ${R}`)}}a(ns,"init");function ss({workspaceRoot:e,repos:t,meta:n}){let[s,r]=G(),o=qe(),i=ze(t,n,s,r,o),c={};try{c=ut(s)}catch{c={}}let d=Pt(i,s,o,(n.FEATURE??"").trim(),c,(n.TEST_PATH??"").trim());for(let l of Lt(e,d))b(`Wrote ${l}`)}a(ss,"writeAgents");var qt={id:"jit",init:ns,refresh(e){se(e)&&(je(e),re(e))},check(e){let t=ce(e),{authoring:n,drift:s}=Ut(e,t?.active??null),r=Bt(e,t);return[...n,...s,...r===null?[]:[r]]},sync(e){let{written:t,manifestPath:n}=Yt(e);return{wrote:n===null?t:[...t,n]}},sessionContext(e,t){let n=String(t.source||"");return(n==="compact"||n==="clear")&&ft(e,String(t.session_id||"")),Tt(e,n)||null},gate:pt,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 Kt={jit:qt,icm:We};function qr(e){return Kt[e]}a(qr,"strategyById");function rs(e){let t=e==null?"":String(e).trim();if(!t)return"jit";if(ye.includes(t))return t;throw new fe(`Unknown context_strategy '${t}' in workspace.yml \u2014 expected one of: ${ye.join(", ")}`,"UNKNOWN_CONTEXT_STRATEGY")}a(rs,"parseStrategyId");function os(e){return rs(st(e,"context_strategy"))}a(os,"readContextStrategy");function Xr(e){return Kt[os(e)]}a(Xr,"strategyFor");function Xt(e,t){let n=[];for(let s of t){if(!s.endsWith("*")){Q.existsSync(M.join(e,s))&&n.push(s);continue}let r=M.dirname(s),o=M.basename(s).slice(0,-1),i;try{i=Q.readdirSync(M.join(e,r)).sort()}catch{continue}for(let c of i)c.startsWith(o)&&n.push(M.join(r,c))}return n}a(Xt,"expandOwned");function is(e,t,n){let s=new Set(Xt(e,n.ownedPaths()));return Xt(e,t.ownedPaths()).filter(r=>!s.has(r))}a(is,"leftoverPaths");function as(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(as,"restorable");function Kr(e,t,n,s){let r=is(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)as(e,o)?(Q.rmSync(M.join(e,o),{recursive:!0,force:!0}),b(`Pruned ${o}`)):A(`Kept ${o}: untracked, ignored or modified \u2014 git could not restore it`)}}a(Kr,"reportLeftovers");export{zt as a,gt as b,Ne as c,wt as d,en as e,cs as f,cn as g,ve as h,dn as i,Ce as j,nn as k,N as l,rn as m,ws as n,on as o,St as p,ks as q,qr as r,rs as s,Xr as t,Kr as u};
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
294
|
+
//# sourceMappingURL=chunk-5FEH5O4E.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-
|
|
3
|
+
import{a as o,c as w,f as u}from"./chunk-4QAG5LXA.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-
|
|
13
|
+
//# sourceMappingURL=chunk-6GKCXKXD.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{c as k,d as X,i as at}from"./chunk-
|
|
3
|
+
import{c as k,d as X,i as at}from"./chunk-IX432NBB.js";import{a as T,c as J}from"./chunk-GGNHXHCJ.js";import{l as C,m as O,n as Rt}from"./chunk-4OQR5UBS.js";import{j as Mt,k as Ft,o as z,q as st,r as it}from"./chunk-ERRNQYCR.js";import{d as Tt,e as jt,m as Ct}from"./chunk-UNP37CAA.js";import{n as V}from"./chunk-WWRZELOF.js";import{b as j}from"./chunk-O73IDX5U.js";import{D as Lt,F as At,H as Nt,M as rt,Q as nt,a as vt,h as U,j as y,k as h,l as m,m as b,n as x,o as Et,s as _t,w as Ot}from"./chunk-TSUANNLO.js";import{b as Q}from"./chunk-ES6NWI5A.js";import{a as i,e as kt,f as w}from"./chunk-4QAG5LXA.js";w();import*as A from"node:fs";import*as de from"node:os";import*as we from"node:path";w();var Z=kt(vt(),1);import*as L from"node:fs";import*as It from"node:os";import*as Pt from"node:path";function ct(t){let e=q(t);return e===null?null:J(e)}i(ct,"composeFile");function q(t){let e=xe(t);if(e!==null&&J(e)!==null)return e;let o;try{o=Nt(t)}catch{return e}return J(o)!==null&&$e(o,t)?o:e}i(q,"workspaceForFeature");function $e(t,e){let o;try{o=L.readFileSync(Pt.join(t,".env"),"utf8")}catch{return!1}return o.split(`
|
|
4
4
|
`).some(r=>{let n=/^\s*(?:WERKMEISTER_)?FEATURE=(.*)$/.exec(r);return n!==null&&n[1].trim()===e})}i($e,"envNamesFeature");function ut(t){try{return L.statSync(t).isFile()}catch{return!1}}i(ut,"isFile");function xe(t){for(let e of[ft,mt]){let o;try{o=O(["docker","ps","-a","--filter",`label=${e}=${t}`,"--format",'{{.Label "com.docker.compose.project.working_dir"}}'],{capture:!0,timeout:M})}catch(n){if(n instanceof C)return null;throw n}if(o.status!==0)return null;let r=o.stdout.split(`
|
|
5
5
|
`).map(n=>n.trim()).find(Boolean);if(r)return r}return null}i(xe,"workspaceFromContainerLabel");function ke(t,e,o){return["docker","compose",...o?["-f",o]:[],"-p",Wt(t,o),...e]}i(ke,"workspaceComposeArgv");function Dt(t){return`werkmeister-${t}`}i(Dt,"projectName");function Ut(t){return`sandbox-${t}`}i(Ut,"legacyProjectName");async function B(t){let e=Ut(t);return(await X(e))?.length?e:Dt(t)}i(B,"liveProject");function Wt(t,e){try{let o=e&&(0,Z.parse)(L.readFileSync(e,"utf8"));if(o&&typeof o.name=="string")return o.name}catch{}return Dt(t)}i(Wt,"fileProject");function ve(t,e,{removeVolumes:o=!1}={}){let r=Ut(t);Wt(t,e)!==r&&Ee(r,`'${t}''s pre-rename project`,{removeVolumes:o})}i(ve,"retireLegacyProject");function Ee(t,e,{removeVolumes:o=!1}={}){let r=`label=com.docker.compose.project=${t}`;try{let n=[["docker","ps","-aq","--filter",r]];if(o&&n.push(["docker","volume","ls","-q","--filter",r]),!n.some(c=>O(c,{capture:!0,timeout:M}).stdout.trim()))return;y(`Taking down ${e} ${t}`);let s=["down","--remove-orphans",...o?["--volumes"]:[]],a=O(["docker","compose","-p",t,...s],{capture:!0,cwd:It.tmpdir(),timeout:M});a.status!==0&&m(`Could not take down ${t}: ${a.stderr.trim()}`)}catch(n){m(`Could not take down ${t}: ${n instanceof Error?n.message:String(n)}`)}}i(Ee,"takeDownProject");var M=300,Bt=Number(process.env.WERKMEISTER_UP_TIMEOUT_S||20*60);function Ht(t,e,{capture:o=!1,stream:r=!1,composePath:n=null}={}){let s=Yt(t,e,n);if(s===null)return null;try{return r?(O(s,{stdio:"inherit"}),null):Gt(O(s,{capture:o,timeout:M}),o)}catch(a){return Kt(a,M)}}i(Ht,"runCompose");async function lt(t,e,{capture:o=!1,composePath:r=null,signal:n,timeout:s=M}={}){let a=Yt(t,e,r);if(a===null)return null;try{return Gt(await Rt(a,{capture:o,timeout:s,signal:n}),o)}catch(c){return Kt(c,s)}}i(lt,"runComposeAsync");function Yt(t,e,o){if(o??=ct(t),o===null||!ut(o))return b(`No ${T} found for feature '${t}'.
|
|
6
6
|
Run 'werkmeister workspace init' (and 'werkmeister feature up') from the feature's workspace first.`),null;e.includes("up")&&_e(o),(e.includes("up")||e.includes("down"))&&ve(t,o,{removeVolumes:e.includes("--volumes")});let r=ke(t,e,o);return y(`Running: ${r.join(" ")}`),r}i(Yt,"composeCommand");function _e(t){try{let e=(0,Z.parse)(L.readFileSync(t,"utf8")),o=Object.entries(e?.volumes??{}).filter(([,r])=>r?.external===!0).map(([r,n])=>n?.name??r);for(let r of o){let n=O(["docker","volume","create",r],{capture:!0});n.status!==0&&m(`Could not create shared volume '${r}': ${n.stderr.trim()}`)}}catch(e){m(`Could not create shared volumes: ${e instanceof Error?e.message:String(e)}`)}}i(_e,"ensureSharedVolumes");function Gt(t,e){if(t.status!==0){let o=e?t.stderr:"";b(`docker compose failed (exit ${t.status})`),o&&x(`${U.DIM}${o.trim()}${U.RESET}
|
|
@@ -10,4 +10,4 @@ import{c as k,d as X,i as at}from"./chunk-FDYQ5FWY.js";import{a as T,c as J}from
|
|
|
10
10
|
`)));return{stop:i(()=>r.abort(),"stop"),done:n}}i(Eo,"composeLogsStream");async function _o(t){return(await X(await B(t))??[]).map(o=>({name:o.name,status:o.state,health:o.health,ports:o.ports,service:o.service,role:F(o.labels,"role"),exitCode:o.exitCode}))}i(_o,"getContainerStatus");function Ae(t,e){return e==="setup"||t.endsWith("-setup")}i(Ae,"isOneShotService");w();import*as p from"node:fs";import*as Vt from"node:os";import*as dt from"node:path";import{setTimeout as Ne}from"node:timers/promises";var Te=i(()=>dt.join(Q(Vt.homedir()),"locks"),"lockDir"),je=.1;function Ce(t){let e;try{e=Number.parseInt(p.readFileSync(t,"utf8").trim(),10)}catch{return!1}if(!Number.isInteger(e)||e<=0)return!0;try{return process.kill(e,0),!1}catch(o){return o.code==="ESRCH"}}i(Ce,"holderIsDead");function Me(t){try{let e=p.openSync(t,"wx");return p.writeSync(e,String(process.pid)),p.closeSync(e),!0}catch(e){if(e.code==="EEXIST"){if(Ce(t))try{p.unlinkSync(t)}catch{}return!1}throw e}}i(Me,"tryAcquire");async function v(t,e,{timeout:o}={}){let r=Te();p.mkdirSync(r,{recursive:!0});let n=dt.join(r,`${t}.lock`),s=o!==void 0?performance.now()+o*1e3:null;for(;!Me(n);){if(s!==null&&performance.now()>=s)throw new Error(`Timed out after ${o}s waiting for lock '${t}' (${n}). The previous holder may have crashed without releasing it; if no werkmeister process is running, it is safe to delete this file and retry.`);await Ne(je*1e3)}try{return await e()}finally{try{p.unlinkSync(n)}catch{}}}i(v,"sandboxLock");w();var Fe={"":1,b:1,k:1024,m:1048576,g:1073741824,t:1099511627776};function wt(t){if(typeof t=="number")return t;let e=/^\s*(\d+(?:\.\d+)?)\s*([bkmgt]?)b?\s*$/i.exec(t);if(!e)throw new Error(`Not a size: '${t}'`);return Math.round(Number(e[1])*(Fe[e[2].toLowerCase()]??1))}i(wt,"parseSize");var zt=["idle","human-check","working"];function Re(t){return[...t.filter(e=>e.gate),...t.filter(e=>!e.gate)]}i(Re,"queueOrder");function Xt(t,e,o,r){if(!r.services&&e.some(f=>f.feature===r.feature))return{kind:"admit"};if(r.cost.memory>t.memory||r.cost.cpus>t.cpus)return{kind:"never-fits",cost:r.cost};let n=e.reduce((f,K)=>({memory:f.memory+K.cost.memory,cpus:f.cpus+K.cost.cpus}),{memory:0,cpus:0}),s=i(f=>n.memory-f.memory+r.cost.memory<=t.memory&&n.cpus-f.cpus+r.cost.cpus<=t.cpus,"fits"),a=!!r.gate||!!r.services&&e.some(f=>f.feature===r.feature),c=o.find(f=>f.feature===r.feature),u={feature:r.feature,waitedMs:c?.waitedMs??0,gate:a},l=Re(c?o.map(f=>f===c?u:f):[...o,u]),d=l.indexOf(u)+1,N=d===1,_=!!r.services&&e.some(f=>f.feature===r.feature&&f.busy),et=!N&&!_&&(l[0].gate||l[0].waitedMs>=3e5);if(s({memory:0,cpus:0})&&(r.byPerson||!et))return{kind:"admit"};let ge=N&&(!!r.services||u.waitedMs>=3e5);if(t.preempt&&(r.byPerson||ge)){let K=(r.byPerson?zt:zt.slice(0,2)).flatMap(P=>e.filter(D=>D.rank===P&&!D.busy&&D.feature!==r.feature&&(D.cost.memory||D.cost.cpus))),xt=[],ot={memory:0,cpus:0};for(let P of K)if(xt.push(P.feature),ot.memory+=P.cost.memory,ot.cpus+=P.cost.cpus,s(ot))return{kind:"preempt",victims:xt}}return{kind:"wait",position:d}}i(Xt,"admit");function Zt(t,e,o,r){for(let[n,s]of e)if(s===t)return n;if(r!==null&&r>=1&&r<=o&&!e.has(r))return r;for(let n=1;n<=o;n++)if(!e.has(n))return n;return null}i(Zt,"pickSlot");w();w();var te=kt(vt(),1);import{execFileSync as Ie}from"node:child_process";import{createHash as Pe}from"node:crypto";import*as g from"node:fs";import*as qt from"node:net";import*as E from"node:os";import*as S from"node:path";import{setTimeout as De}from"node:timers/promises";var ht=30,ee=i(()=>S.join(Ot(),"scheduler"),"stateDir"),oe=i(()=>S.join(ee(),"leases.json"),"leasesPath"),re=i(()=>S.join(ee(),"queue.json"),"queuePath");function ne(t,e,o){try{let r=JSON.parse(g.readFileSync(t,"utf8"));return e(r)?r:o}catch{return o}}i(ne,"readJson");function se(t,e){g.mkdirSync(S.dirname(t),{recursive:!0}),Ft(t,e)}i(se,"writeJson");var $=i(t=>typeof t=="object"&&t!==null&&!Array.isArray(t),"isDict");function I(){let t=ne(oe(),$,{}),e={};for(let[o,r]of Object.entries(t))$(r)&&Number.isInteger(r.slot)&&(e[o]={slot:r.slot,workspace:String(r.workspace??"")});return e}i(I,"readLeases");function St(t){se(oe(),t)}i(St,"writeLeases");function H(){return ne(re(),t=>Array.isArray(t),[]).map(String)}i(H,"readQueue");function bt(t){se(re(),t)}i(bt,"writeQueue");function ie(t){return v("scheduler",async()=>bt(H().filter(e=>e!==t)),{timeout:ht})}i(ie,"dequeue");function zo(t,e){return v("scheduler",async()=>{let o=H().filter(r=>r!==t);st(e,{position:o.length+1,reason:"preempted",since:new Date().toISOString()}),bt([...o,t])},{timeout:ht})}i(zo,"enqueue");async function Xo(t=()=>k().info()){let e=V().budget,o=$(e)?e:{},r={};if(o.memory===void 0||o.cpus===void 0)try{r=await t()}catch{}let n=o.memory!==void 0?wt(o.memory):r.MemTotal?r.MemTotal-2**30:1/0,s=o.cpus!==void 0?Number(o.cpus):r.NCPU??1/0;return{memory:n,cpus:s,preempt:o.preempt!==!1}}i(Xo,"loadBudget");function ae(t){let e=V().budget,o=$(e)?Number(e.host_load??Number.NaN):Number.NaN;return Number.isFinite(o)&&o>=0?o:2*t}i(ae,"hostLoadLimit");function Ue(){let t=V().budget,e=$(t)?Number(t.free_memory??Number.NaN):Number.NaN;return Number.isFinite(e)&&e>=0?e:15}i(Ue,"freeMemoryLimit");function ce(t=process.platform){let e=E.totalmem();if(t!=="darwin")return{free:E.freemem(),total:e};let o=Number(Ie("sysctl",["-n","kern.memorystatus_level"],{encoding:"utf8"}));return{free:e*o/100,total:e}}i(ce,"readHostMemory");function ue(t=ce){let e=Ue();if(e===0)return"";let o;try{let{free:r,total:n}=t();o=100*r/n}catch{return""}return Number.isFinite(o)&&o<e?`${o.toFixed(0)}% free, under budget.free_memory ${e}%`:""}i(ue,"lowMemory");var yt=15e3,R=9e4,We=6e4,Be=i(()=>({load:E.loadavg(),cores:E.availableParallelism()}),"readHostLoad"),le={hostLoad:Be,hostMemory:ce,sleep:i(t=>De(t),"sleep")},tt=i(t=>Number((t/6e4).toFixed(1)),"minutes");async function He(t=le,e=process.platform,o="with-temp-home; --no-wait skips"){if(_t("NO_WAIT"))return"";let r=i(()=>{let{load:c,cores:u}=t.hostLoad(),l=e==="darwin"?0:ae(u);return{load:c[0],limit:l,loadOver:l!==0&&c[0]>l,memory:ue(t.hostMemory)}},"read"),n=r();if(!n.loadOver&&!n.memory)return"";let s=[n.loadOver&&"host load",n.memory&&"free memory"].filter(Boolean).join(" and ");y(`waiting up to ${tt(R)} min for ${[n.loadOver&&`host load ${n.load.toFixed(1)} to fall to ${n.limit} (budget.host_load)`,n.memory&&`free memory to rise (${n.memory})`].filter(Boolean).join(" and ")} before ${o}`);let a=i(()=>[n.loadOver&&`host load ${n.load.toFixed(1)} over ${n.limit}`,n.memory&&`low memory (${n.memory})`].filter(Boolean).join(", "),"state");for(let c=yt;c<=R;c+=yt){if(await t.sleep(yt),n=r(),!n.loadOver&&!n.memory)return`waited ${c/1e3} s for ${s}`;c%We===0&&c<R&&y(`still waiting: ${a()}, ${c/1e3} s so far, up to ${tt(R-c)} min left`)}return`ran with ${a()}; the ${tt(R)} min host-load wait is spent`}i(He,"waitForHostLoadNow");async function Zo(t,e,o=le,r=process.platform){let n=Object.entries(Y(t)).filter(([_,et])=>e?e.includes(_):!et?.profiles).filter(([,_])=>_?.labels?.["com.werkmeister.role"]==="setup").map(([_])=>_);if(!n.length)return;let s=n.join(", "),a=await He(o,r,`starting ${s}; WERKMEISTER_NO_WAIT=1 skips`);if(!a.startsWith("ran with"))return;let{load:c,cores:u}=o.hostLoad(),l=ae(u),d=ue(o.hostMemory),N=[r!=="darwin"&&l!==0&&c[0]>l&&`host load ${c[0].toFixed(1)} is over ${l} (budget.host_load)`,d&&`memory is low (${d})`].filter(Boolean).join(" and ");throw new j(`${N||a} after the ${tt(R)} min wait; ${s} not started. Retry when load falls or memory frees, or set WERKMEISTER_NO_WAIT=1 to start anyway.`,"HOST_LOAD")}i(Zo,"waitForSetupLoad");function Y(t,e=S.join(t,T)){try{let o=te.parse(g.readFileSync(e,"utf8"));return $(o?.services)?o.services:{}}catch{return{}}}i(Y,"composeServices");function Ye(t,e){let o={memory:0,cpus:0};for(let[r,n]of Object.entries(Y(t))){if(!$(n)||(e?!e.includes(r):n.profiles))continue;let s=n.deploy?.resources,a=s?.reservations?.memory;a!==void 0&&(o.memory+=wt(a)),o.cpus+=Number(s?.limits?.cpus??0)||0}return o}i(Ye,"featureCost");var fe=i(t=>{let e=t?.depends_on;return Array.isArray(e)?e.map(String):$(e)?Object.keys(e):[]},"dependsOn");function qo(t,e){return[e,...fe(Y(t)[e])]}i(qo,"serviceStarts");async function tr(t,e){let o=Y(S.dirname(t),t),r=fe(o[e]);if(!r.length||!r.every(n=>Ge(o[n])))return!1;for(let n of r){let s=o[n]?.container_name,a=s?await k().getContainer(String(s)).inspect().then(c=>c.State,()=>null):null;if(a?.Status!=="exited"||a.ExitCode!==0)return!1}return!0}i(tr,"setupsCurrent");function Ge(t){if(t?.labels?.["com.werkmeister.role"]!=="setup")return!1;let e=/^node:(\d+)/.exec(String(t.image??""))?.[1],o=(t.volumes??[]).map(String).find(a=>a.endsWith(":/app"));if(!e||!o)return!1;let r=o.slice(0,-5),n=Buffer.concat(["package-lock.json","pnpm-lock.yaml"].flatMap(a=>{try{return[g.readFileSync(S.join(r,a))]}catch{return[]}})),s=`${Pe("sha256").update(n).digest("hex")} v${e}`;try{return g.readFileSync(S.join(r,".turbo/.werkmeister-install-hash"),"utf8").trim()===s}catch{return!1}}i(Ge,"installStamped");var Ke=6e4;function Je(t){let e=I();return t.filter(o=>{let r=e[o]?.workspace;if(!r||!z(r)?.services)return!0;let n=g.statSync(Mt(r),{throwIfNoEntry:!1})?.mtimeMs??0;return Date.now()-n<Ke?!0:(it(r),!1)})}i(Je,"withoutDeadWaiters");function Qe(t,e,o=Date.now()){let r=I();return t.map(n=>{let s=r[n]?.workspace,a=s?z(s):null,c=a?.since?Date.parse(a.since):Number.NaN;return{feature:n,waitedMs:Number.isFinite(c)?Math.max(0,o-c):0,gate:!!a?.gate||!!a?.services&&e.some(u=>u.feature===n)}})}i(Qe,"waiters");function er(t,e,o,r,n,s){let a=Ye(e,s?.services);return!a.memory&&!a.cpus?Promise.resolve({kind:"admit"}):v("scheduler",async()=>{let c=H(),u=Je(c),l=Xt(n,r,Qe(u,r),{feature:t,cost:a,byPerson:o,services:s?.services,...s?.gate&&{gate:!0}}),d=u;return l.kind==="wait"?(st(e,{position:l.position,reason:"waiting for capacity",...s,since:z(e)?.since??new Date().toISOString()}),u.includes(t)||(d=[...u,t])):(d=u.filter(N=>N!==t),it(e)),d.join(`
|
|
11
11
|
`)!==c.join(`
|
|
12
12
|
`)&&bt(d),l},{timeout:ht})}i(er,"requestAdmission");function Ve(t,e){let o=[];for(let[r,n]of Object.entries(Y(t)))if(!(!$(n)||(e?!e.includes(r):n.profiles)))for(let s of n.ports??[]){let a=Number.parseInt(String(s).split(":").slice(-2)[0]??"",10);Number.isInteger(a)&&o.push(a)}return o}i(Ve,"publishedPorts");function ze(t){return new Promise(e=>{let o=qt.createServer();o.once("error",r=>e(r.code==="EADDRINUSE")),o.listen(t,"0.0.0.0",()=>o.close(()=>e(!1)))})}i(ze,"bound");async function or(t,e,o){let r=new Map;try{for(let s of await k().listContainers()){let a=(s.Names[0]??"").replace(/^\//,""),c=s.Labels?.["com.werkmeister.feature"]??"";for(let u of s.Ports??[])u.PublicPort&&r.set(u.PublicPort,{name:a,feature:c})}}catch{}let n=[];for(let s of Ve(e,o)){let a=r.get(s);a?.feature!==t&&(a||await ze(s))&&n.push({port:s,holder:a?.name??"a host process"})}return n}i(or,"portHolders");var pe=!1,me=!1;function ur(){pe=!0}i(ur,"ownScheduler");async function G(t,e,o,r){if(pe||!Tt())return o();try{let{data:n,text:s}=await Ct("scheduler",{op:t,...e},{timeoutMs:r});return s&&x(s),n.value}catch(n){if(!(n instanceof jt))throw n;return me||m(`${n.message} Scheduling in this process instead.`),me=!0,o()}}i(G,"schedulerOp");function lr(){return G("queue",{},async()=>H())}i(lr,"waitingQueue");var ye="com.werkmeister",ft=`${ye}.feature`,he="com.sandbox.local",mt=`${he}.feature`;function F(t,e){return t?.[`${ye}.${e}`]??t?.[`${he}.${e}`]??""}i(F,"labelOf");var gt=30,Xe=1e4;async function Ze(){let t;try{let e=await Promise.all([ft,mt].map(r=>k().listContainers({all:!0,filters:{label:[r]},abortSignal:AbortSignal.timeout(Xe)}))),o=new Set;t=e.flat().filter(r=>!o.has(r.Names[0])&&o.add(r.Names[0]))}catch{return null}return t.map(e=>({name:(e.Names[0]??"").replace(/^\//,""),feature:F(e.Labels,"feature"),slot:F(e.Labels,"slot"),service:F(e.Labels,"service")}))}i(Ze,"queryLabeledContainers");function qe(){let t=nt().feature_slots;return(typeof t=="object"&&t!==null&&!Array.isArray(t)?t.count:void 0)??12}i(qe,"slotCount");function to(){let t=rt();if(typeof t!="object"||t===null)return new Set;let e=new Set;for(let[o,r]of Object.entries(t))typeof r=="object"&&r!==null&&!Array.isArray(r)&&r.port_offset!==null&&r.port_offset!==void 0&&e.add(o);return e}i(to,"routableServiceNames");async function $t(){let t=await Ze();if(t===null)return null;let e=to(),o={};for(let r of t){let n=r.feature,s=Number.parseInt(r.slot,10);if(Number.isNaN(s)){m(`Container '${r.name}' has unparseable slot label: '${r.slot}'`);continue}let a=r.service,c=o[n];c||(c={slot:s,services:[]},o[n]=c),c.slot!==s&&(m(`Feature '${n}' has inconsistent slot labels across containers (saw ${c.slot} and ${s}) -- using ${s}`),c.slot=s),a&&e.has(a)&&!c.services.includes(a)&&c.services.push(a)}return o}i($t,"getAllSlotsFromDocker");var Se={labels:$t};function eo(t){let e=I();for(let[r,n]of Object.entries(e))n.workspace&&!A.existsSync(n.workspace)&&delete e[r];for(let[r,n]of Object.entries(t??{}))e[r]??={slot:n.slot,workspace:q(r)??""};let o=new Map;for(let[r,n]of Object.entries(e))o.set(n.slot,r);for(let[r,n]of Object.entries(t??{})){let s=o.get(n.slot);s&&s!==r&&m(`Slot ${n.slot} is leased to '${s}' but '${r}' has containers on it`),o.set(n.slot,r)}return{leases:e,held:o}}i(eo,"heldSlots");function oo(t,e,o,r=Se){return G("allocate",{feature:t,preferredSlot:e??null,workspace:o??null},()=>ro(t,e,o,r))}i(oo,"allocateSlot");function ro(t,e,o,r){let n=qe();return v("allocate",async()=>{let{leases:s,held:a}=eo(await r.labels()),c=Zt(t,a,n,e??null);if(c===null)throw b(`All ${n} feature slots are occupied!`),new Error("No available slots. Stop an existing feature with 'werkmeister feature down <feature>' first.");return s[t]?.slot!==c&&h(`Allocated slot ${c} for '${t}'`),s[t]={slot:c,workspace:o??s[t]?.workspace??q(t)??""},St(s),c},{timeout:gt})}i(ro,"allocateSlotHere");async function kr(t,e,o,r=Se){let n=await r.labels(),s=await no(t);if(!s)try{return await oo(t,o,e,r)}catch(c){throw new j(c instanceof Error?c.message:String(c),"SLOT_ALLOC")}let a=Object.entries(n??{}).find(([c,u])=>c!==t&&u.slot===s.slot);if(a){let[c]=a;throw new j(`Slot ${s.slot} is leased to '${t}' but '${c}' has containers on it \u2014 stop it or run 'werkmeister feature down ${c}'`,"SLOT_ALLOC")}return s.slot}i(kr,"requireLeasedSlot");function no(t){return G("lease",{feature:t},()=>v("allocate",()=>I()[t]??null,{timeout:gt}))}i(no,"slotLease");function vr(t){return G("release",{feature:t},()=>so(t))}i(vr,"releaseSlot");async function so(t){await v("allocate",()=>{let e=I();t in e&&(delete e[t],St(e))},{timeout:gt}),await ie(t)}i(so,"releaseSlotHere");async function pt(t){let e=(await be())[t];return e?e.slot:null}i(pt,"getSlot");async function be(){let t=await $t();return t===null?{}:t}i(be,"getAllSlots");function io(t){return At(t,nt())}i(io,"getPortRange");function ao(t,e){let[o]=io(t);return o+e}i(ao,"getServicePort");function co(t,e,o,r){let n=e.type??"unknown";if(o.includes(t)){let c=e.port_offset??0;return{service:t,source:"local",endpoint:`localhost:${ao(r,c)}`,type:n}}let s=Lt(t,e);if(s)return{service:t,source:"baseline",endpoint:`${s.host}:${s.port}`,type:n};let a=e.k8s_forward_port;return a?{service:t,source:"k8s",endpoint:`localhost:${a}`,type:n}:{service:t,source:"none",endpoint:null,type:n}}i(co,"classifyEndpoint");async function Er(t){let e=await pt(t);if(e===null)throw new j(`Feature '${t}' is not running (no slot allocated)`,"NOT_RUNNING");let o=(await be())[t]?.services??[],r=rt(),n=[];for(let s of Object.keys(r).sort()){let a=r[s]??{};typeof a!="object"||a===null||Array.isArray(a)||n.push(co(s,a,o,e))}return{feature:t,slot:e,endpoints:n}}i(Er,"featureServices");async function _r(){let t=we.join(Q(de.homedir()),"slots.json");if(!A.existsSync(t))return;let e;try{let n=JSON.parse(A.readFileSync(t,"utf8"));e=typeof n=="object"&&n!==null?n:{}}catch{e={}}let o=await $t()??{},r=Object.keys(e).filter(n=>typeof e[n]=="object"&&e[n]!==null&&!Array.isArray(e[n])&&!(n in o));r.length>0&&(m(`~/.werkmeister/slots.json had features with no labeled containers: ${r.join(", ")}`),m("These are now forgotten \u2014 restart them with 'werkmeister feature up' to re-register.")),y("Migrating: removing legacy ~/.werkmeister/slots.json (labels are now authoritative)");try{A.unlinkSync(t)}catch(n){m(`Could not remove ${t}: ${n}`)}}i(_r,"migrateSlotsJson");export{q as a,ke as b,Dt as c,B as d,ve as e,Ee as f,_e as g,ho as h,So as i,bo as j,go as k,$o as l,xo as m,ko as n,Qt as o,Le as p,vo as q,Eo as r,_o as s,Ae as t,v as u,Re as v,I as w,H as x,ie as y,zo as z,Xo as A,ae as B,ce as C,ue as D,Be as E,He as F,Zo as G,Ye as H,qo as I,tr as J,Qe as K,er as L,or as M,ur as N,G as O,lr as P,ye as Q,ft as R,he as S,mt as T,F as U,qe as V,$t as W,oo as X,kr as Y,no as Z,vr as _,pt as $,be as aa,io as ba,ao as ca,co as da,Er as ea,_r as fa};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-6J3LEO5L.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{L as c}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{L as c}from"./chunk-JKWBF6YT.js";import{a as l,f}from"./chunk-4QAG5LXA.js";f();import*as s from"node:fs";import*as e from"node:path";function p(o){let n=e.resolve(o);for(;;){let r=e.join(n,".env"),t=!1;try{t=s.statSync(r).isFile()}catch{t=!1}if(t)return r;let i=e.dirname(n);if(i===n)return null;n=i}}l(p,"findDotenv");function v(o){let n=p(o);if(!n)return{};let r={};for(let t of s.readFileSync(n,"utf8").split(/\r?\n/)){if(t=t.trim(),!t||t.startsWith("#")||!t.includes("="))continue;let i=t.indexOf("="),a=t.slice(0,i),u=t.slice(i+1);r[a.trim()]=c(u.trim())}return r}l(v,"loadDotenv");export{p as a,v as b};
|
|
4
|
+
//# sourceMappingURL=chunk-72GRCLSV.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{r as l}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{r as l}from"./chunk-WWRZELOF.js";import{M as f,l as i}from"./chunk-TSUANNLO.js";import{a as n,f as u}from"./chunk-4QAG5LXA.js";u();import{promises as p}from"node:dns";function h(e,o){return`${e}.${o.replace(/^\.+/,"")}`}n(h,"hostFor");function v(e,o){let a=e??f(),s=o??l(),m={};for(let[t,r]of Object.entries(a)){let c=r&&typeof r=="object"?r.feature_router:null;if(!c)continue;let d=c.remote_upstream??void 0;m[t]={hostname:c.hostname??h(t,s.local_domain),k8s:c.k8s??void 0,remoteHostname:c.remote_hostname??(d?h(t,s.remote_domain):void 0),remoteUpstream:d}}return m}n(v,"loadFeatureRouters");function $(e,o){let a=new Set;for(let s of Object.values(v(e,o)))s.hostname&&a.add(s.hostname),s.remoteHostname&&a.add(s.remoteHostname);return[...a].sort()}n($,"ingressHostnames");function _(e){let o;try{o=$()}catch{return null}return o.length?`https://${o[0]}${e.startsWith("/")?e:`/${e}`}`:null}n(_,"featureUrl");var g=n(e=>p.lookup(e,{all:!0}),"platformLookup");async function b(e,o=g){let s=(await Promise.all(e.map(async t=>{try{return{host:t,addresses:(await o(t)).map(r=>r.address)}}catch{return{host:t,addresses:[]}}}))).filter(({addresses:t})=>!t.includes("127.0.0.1"));if(!s.length)return[];let m=s.map(({host:t})=>t);i(`${m.length} routed hostname(s) do not resolve to 127.0.0.1 on this machine:`);for(let{host:t,addresses:r}of s)i(` ${t}: ${r.length?`resolves to ${r.join(", ")}`:"no address"}`);return i(`Add them: echo "127.0.0.1 ${m.join(" ")}" | sudo tee -a /etc/hosts`),i('or run `werkmeister machine setup` (docs/configuration.md: "New hostnames need /etc/hosts entries")'),m}n(b,"warnUnresolvedHosts");export{v as a,$ as b,_ as c,b as d};
|
|
4
|
+
//# sourceMappingURL=chunk-75GZRX2Y.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-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as p,b as a}from"./chunk-ES6NWI5A.js";import{a as o,f as c}from"./chunk-4QAG5LXA.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-75ZFZAPO.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{X as e,aa as r}from"./chunk-TSUANNLO.js";import{f as o}from"./chunk-4QAG5LXA.js";o();var W=e,h=r;export{W as a,h as b};
|
|
4
|
+
//# sourceMappingURL=chunk-7QJZXCOL.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-F2GIRLO4.js";import{m as n}from"./chunk-TSUANNLO.js";import{b as m}from"./chunk-ES6NWI5A.js";import{a as s,f as p}from"./chunk-4QAG5LXA.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-7ZWI45QR.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{i as _,j}from"./chunk-
|
|
3
|
+
import{i as _,j}from"./chunk-DLQDRYME.js";import{a as R}from"./chunk-75GZRX2Y.js";import{$ as O}from"./chunk-6J3LEO5L.js";import{l as y,m as I,n as N}from"./chunk-4OQR5UBS.js";import{b as h}from"./chunk-O73IDX5U.js";import{M as x,R as A,S as F,j as g,k as v,l as d,n as p,o as T}from"./chunk-TSUANNLO.js";import{b as S}from"./chunk-ES6NWI5A.js";import{a,f as $}from"./chunk-4QAG5LXA.js";$();import*as n from"node:fs";import{createRequire as C}from"node:module";import*as c from"node:path";var m="1.63.0",P=600,D=["playwright.config.ts","playwright.config.js","playwright.config.mjs"];function U(t){let e=[t];try{for(let s of n.readdirSync(t,{withFileTypes:!0}))s.isDirectory()&&n.existsSync(c.join(t,s.name,".git"))&&e.push(c.join(t,s.name))}catch{}return e}a(U,"playwrightSearchDirs");function k(t){for(let e of t)if(n.existsSync(e)&&n.statSync(e).isDirectory()&&D.some(s=>n.existsSync(c.join(e,s))))return e;return null}a(k,"playwrightCwd");function M(t){let e=U(t).slice(1).map(f=>c.basename(f)),s="";try{s=/^SERVICES=(.*)$/m.exec(n.readFileSync(c.join(t,".env"),"utf8"))?.[1]??""}catch{}let l=s.split(",").map(f=>f.trim()).filter(Boolean),r=x(),i=R(r),u=j(_(e,A(),l),r,F(),new Set(Object.keys(i))).map(f=>` - ${f.service} \u2014 test: ${f.test??"\u2014"} \u2014 validate: ${f.validate}`);return"No Playwright suite found for this workspace (no playwright.config.{ts,js,mjs} in the workspace root or a repo worktree), so nothing was run."+(u.length?`
|
|
4
4
|
Validate each service as follows:
|
|
5
5
|
${u.join(`
|
|
6
6
|
`)}`:"")}a(M,"noSuiteMessage");function b(t){try{let e=C(c.join(t,"package.json")).resolve("@playwright/test/package.json");return JSON.parse(n.readFileSync(e,"utf8")).version??null}catch{return null}}a(b,"installedPlaywrightVersion");async function Q({feature:t,workspace:e,extraArgs:s=[],signal:l}){let r=await O(t),i=k(U(e));if(i===null)return{status:1,cwd:i,slot:r,message:M(e)};r===null&&(d(`Feature '${t}' does not have an allocated slot`),d("Start it first with: werkmeister feature up "+t),d("Running tests anyway with feature header routing..."));let w={...process.env,WERKMEISTER_FEATURE:t,SANDBOX_FEATURE:t};r&&(w.WERKMEISTER_SLOT=String(r)),g(`Working directory: ${i}`);let u=b(i);u!==m&&d(`@playwright/test is ${u??"not installed"} here, but \`werkmeister machine setup\` installs Chromium for ${m} -- the browser may be missing. Fix with: npm install -D @playwright/test@${m}`),g(`WERKMEISTER_FEATURE=${t}`);let f=["npx","playwright","test",...s];g(`Running: ${f.join(" ")}`),p(`
|
|
@@ -54,4 +54,4 @@ test('feature: ${t}', async ({ page, context }) => {
|
|
|
54
54
|
await page.pause();
|
|
55
55
|
});
|
|
56
56
|
`,"featureSpec");function tt(t,e,s){if(c.basename(t)!==t)throw new h(`Invalid feature name: ${t}`,"BAD_FEATURE_NAME");let l=[["playwright.config.ts",L(s.baseUrl)],[`${t}.spec.ts`,W(t,s)]],r=[];for(let[i,w]of l){let u=c.join(e,i);n.existsSync(u)||(n.writeFileSync(u,w),r.push(u))}return r}a(tt,"scaffoldFeatureTests");function et(t){let e=b(t);if(e===m){g(`@playwright/test ${e} present`);return}if(e){d(`workspace pins @playwright/test ${e}, but \`werkmeister machine setup\` installs Chromium for ${m} -- if launch fails, run: npx playwright@${e} install chromium`);return}let s=["npm","install","--save-dev",`@playwright/test@${m}`];if(!n.existsSync(S(t)))throw new h(`${t} is not a workspace (no ${c.basename(S(t))}/) -- pass --workspace, or install manually there: ${s.join(" ")}`,"NOT_A_WORKSPACE");let l=T(),r;try{r=I(s,{cwd:t,...l?{}:{capture:!0}})}catch(i){r={status:127,stderr:i instanceof Error?i.message:String(i)}}if(r.status!==0)throw!l&&r.stderr&&p(r.stderr,"stderr"),new h(`\`${s.join(" ")}\` failed in ${t}`,"PLAYWRIGHT_INSTALL");v(`installed @playwright/test ${m}`)}a(et,"ensurePlaywright");export{m as a,Q as b,Z as c,tt as d,et as e};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-AAEPE22B.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-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as c,f as p}from"./chunk-4QAG5LXA.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-B7QKF6MH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{b as a}from"./chunk-
|
|
3
|
+
import{b as a}from"./chunk-ES6NWI5A.js";import{a as s,f as i}from"./chunk-4QAG5LXA.js";i();import*as e from"node:fs";import*as o from"node:path";var n=`#!/bin/sh
|
|
4
4
|
# Generated by \`werkmeister workspace init\` (SW-124); rerun it to regenerate.
|
|
5
5
|
# Runs <cmd...> with HOME set to a fresh temporary directory, removed on exit,
|
|
6
6
|
# so no test or CLI exercise reads or writes the real ~/.werkmeister.
|
|
@@ -37,4 +37,4 @@ status=$?
|
|
|
37
37
|
[ "$status" -eq 0 ] || echo "with-temp-home: exit $status; host load $(uptime | sed 's/.*load averages*: //; s/,//g') on $(getconf _NPROCESSORS_ONLN) cores" >&2
|
|
38
38
|
exit "$status"
|
|
39
39
|
`;function p(r){return o.join(a(r),"bin","with-temp-home")}s(p,"tempHomeWrapper");function m(r){let t=p(r);return e.mkdirSync(o.dirname(t),{recursive:!0}),e.writeFileSync(t,n),e.chmodSync(t,493),t}s(m,"writeTempHomeWrapper");export{n as a,p as b,m as c};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-CJ2MMCT2.js.map
|