werkmeister 0.94.3 → 0.94.4
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-ZRAQK3PZ.js → budget-UZNKM2Q6.js} +2 -2
- package/dist/{cache-E4DLJUAP.js → cache-42DLOO6V.js} +2 -2
- package/dist/{chunk-PW2EKDJ4.js → chunk-2T3SQHI7.js} +21 -21
- package/dist/{chunk-AEM77RAL.js → chunk-3U2F5C5L.js} +2 -2
- package/dist/{chunk-23GM2V7B.js → chunk-3VCFOXJB.js} +2 -2
- package/dist/{chunk-TQXT66GY.js → chunk-5PAAV65H.js} +2 -2
- package/dist/{chunk-4EQH55B3.js → chunk-5XCXWEXR.js} +3 -3
- package/dist/{chunk-2WQY5YYA.js → chunk-6E2WDEKE.js} +2 -2
- package/dist/{chunk-4UASFLJQ.js → chunk-6HNEESFL.js} +2 -2
- package/dist/{chunk-Y7MUE52D.js → chunk-774YBMV5.js} +2 -2
- package/dist/chunk-7K6HE4RU.js +13 -0
- package/dist/{chunk-KRXEK5IM.js → chunk-AMJNPIVK.js} +16 -7
- package/dist/{chunk-6JVXGXN2.js → chunk-ANEHGQGP.js} +2 -2
- package/dist/{chunk-6HU4LHQY.js → chunk-APHOIKD7.js} +2 -2
- package/dist/{chunk-IJUWNQO2.js → chunk-BAJAQUDA.js} +2 -2
- package/dist/{chunk-IZTW5UT4.js → chunk-BLELYNJW.js} +2 -2
- package/dist/{chunk-YBDM4MR6.js → chunk-CRNZVND4.js} +2 -2
- package/dist/{chunk-BVNQPKFK.js → chunk-CZII63PP.js} +2 -2
- package/dist/{chunk-3PZ6HQYD.js → chunk-DCHFN3K7.js} +3 -3
- package/dist/{chunk-STMEAZFZ.js → chunk-E32D74LR.js} +2 -2
- package/dist/{chunk-VK7IBUGG.js → chunk-FD6HSMLR.js} +2 -2
- package/dist/{chunk-V4WXF46Y.js → chunk-FQN2DYMC.js} +2 -2
- package/dist/{chunk-DJGLCWSW.js → chunk-GWGD4KE3.js} +2 -2
- package/dist/{chunk-7E35KHQU.js → chunk-GWIDS7NP.js} +2 -2
- package/dist/{chunk-3JJ2DVAG.js → chunk-H3ZVMUBR.js} +2 -2
- package/dist/{chunk-VW2X6CB5.js → chunk-HHPGLL6V.js} +2 -2
- package/dist/{chunk-LIS7CNJ2.js → chunk-HQOGTB4X.js} +2 -2
- package/dist/{chunk-VI7O564A.js → chunk-IJ4RWPPV.js} +2 -2
- package/dist/{chunk-3MYYJ2O6.js → chunk-IOZ77SLR.js} +2 -2
- package/dist/{chunk-TOVULDID.js → chunk-JBPTLWYB.js} +2 -2
- package/dist/{chunk-MMXALKQ4.js → chunk-JV6PU2IQ.js} +2 -2
- package/dist/{chunk-ZDRNJGSF.js → chunk-K4C5ZUN5.js} +2 -2
- package/dist/{chunk-A3VNC7IG.js → chunk-K4RQHVS6.js} +2 -2
- package/dist/{chunk-TAHLKIRL.js → chunk-K5VYJM24.js} +2 -2
- package/dist/{chunk-TKXEX3J7.js → chunk-KS2YR7YP.js} +2 -2
- package/dist/{chunk-ZB5MYPP3.js → chunk-MIUYQBGU.js} +2 -2
- package/dist/{chunk-AAUSOM4O.js → chunk-MNVQWXOM.js} +3 -3
- package/dist/{chunk-36Y5TWCS.js → chunk-MQDHBFCX.js} +2 -2
- package/dist/{chunk-VZ3CPOPB.js → chunk-MVZJNBGX.js} +2 -2
- package/dist/{chunk-ZLNXIRGJ.js → chunk-OGPEYBDT.js} +16 -16
- package/dist/{chunk-A2JDE4VC.js → chunk-OK3RJEE5.js} +2 -2
- package/dist/{chunk-7KGYE5LJ.js → chunk-OLM2WX73.js} +2 -2
- package/dist/chunk-OWYB3TLS.js +137 -0
- package/dist/{chunk-642DWZGI.js → chunk-OZVJNXGQ.js} +2 -2
- package/dist/{chunk-COOC6H6Z.js → chunk-P4QU727J.js} +2 -2
- package/dist/chunk-PHNQ5QBT.js +4 -0
- package/dist/{chunk-QUKZMMNJ.js → chunk-PJRPGJBB.js} +2 -2
- package/dist/{chunk-APZJEON2.js → chunk-PLUGFNP3.js} +2 -2
- package/dist/{chunk-NONNQTC3.js → chunk-PWRV4UX6.js} +2 -2
- package/dist/{chunk-34IKHARR.js → chunk-QL4Z6HB7.js} +2 -2
- package/dist/{chunk-F7TUYDEI.js → chunk-RKHD4RFR.js} +2 -2
- package/dist/{chunk-LEIPUXIV.js → chunk-RTOH3QCC.js} +2 -2
- package/dist/{chunk-ZREP3Q6O.js → chunk-RUTG5HQP.js} +2 -2
- package/dist/{chunk-736XQT7E.js → chunk-TJOLDBXF.js} +2 -2
- package/dist/{chunk-G55F62O5.js → chunk-UOJF7UOJ.js} +2 -2
- package/dist/{chunk-2IODMVLJ.js → chunk-V33FIIEY.js} +2 -2
- package/dist/{chunk-R4WVSQHH.js → chunk-V3LWRWC6.js} +2 -2
- package/dist/{chunk-GHLXJUIB.js → chunk-V5EXIS2K.js} +2 -2
- package/dist/{chunk-T3LXZQBK.js → chunk-V5OL3JC2.js} +2 -2
- package/dist/{chunk-DEWNXQDG.js → chunk-VCOPO6MA.js} +3 -3
- package/dist/{chunk-MA4ZNBJQ.js → chunk-VUF52ZMA.js} +2 -2
- package/dist/{chunk-BTZGFSAD.js → chunk-WECT3AU3.js} +2 -2
- package/dist/{chunk-EVHOXBDD.js → chunk-WJFLL2AZ.js} +2 -2
- package/dist/chunk-WQFKHDI4.js +4 -0
- package/dist/{chunk-RP7X3XDD.js → chunk-WWPSXI2S.js} +2 -2
- package/dist/{chunk-OXUT73ZK.js → chunk-YHLXQZFR.js} +2 -2
- package/dist/{chunk-P2KMXUCB.js → chunk-YHYPX7NL.js} +3 -3
- package/dist/{chunk-ERS24IKS.js → chunk-Z6IGWMQO.js} +2 -2
- package/dist/clean-6IQNYWU7.js +8 -0
- package/dist/close_out-MKV5YQ7S.js +8 -0
- package/dist/code-BD2TUBLN.js +4 -0
- package/dist/{config-L3TANQJ3.js → config-BNZTWPKN.js} +2 -2
- package/dist/{connect-RQD45V4L.js → connect-ZMA472UF.js} +2 -2
- package/dist/{daemon-O6QSXDGP.js → daemon-ZLM4ZJT2.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-JPV4YC6P.js → detect-OGZGTDOF.js} +2 -2
- package/dist/{down-XKZIIZKL.js → down-IGLGTHO7.js} +3 -3
- package/dist/fixture-DYIZFQA6.js +15 -0
- package/dist/form-cli.js +1 -1
- package/dist/hooks-LHGWJQDM.js +4 -0
- package/dist/{hooks_gen-ULTNL4SI.js → hooks_gen-YQQE5AWN.js} +2 -2
- package/dist/infra-Z4TS62Q6.js +4 -0
- package/dist/init_workspace-NVCC4XR5.js +4 -0
- package/dist/{intercept-E2UXVZO2.js → intercept-OPXA2J5U.js} +2 -2
- package/dist/{issue-JGG36D3F.js → issue-NHJ2U63E.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-7LYFTM5A.js +7 -0
- package/dist/logs-FAN7CDVQ.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-HEATCDFW.js +8 -0
- package/dist/notes-LL3TY7GZ.js +4 -0
- package/dist/{open-6IM3BRTK.js → open-C23WTFTD.js} +2 -2
- package/dist/{optimize-QUVTAHU7.js → optimize-XHGLPAYD.js} +2 -2
- package/dist/pause-5QIRIQXQ.js +4 -0
- package/dist/pr-DNONGDCJ.js +5 -0
- package/dist/proxy_reload-4NWZNPQM.js +6 -0
- package/dist/{registry-FWV3GMBC.js → registry-W3R2CVXR.js} +2 -2
- package/dist/remove-7X4IE6ZA.js +7 -0
- package/dist/remove_workspace-SGYD6MDQ.js +8 -0
- package/dist/restart-2DCYKCJ5.js +8 -0
- package/dist/resume-FTEOO2KH.js +8 -0
- package/dist/{safari-O36TVN7H.js → safari-UPQ6L5EB.js} +2 -2
- package/dist/{sandbox-GYKSQM6Y.js → sandbox-HHLIYDQF.js} +2 -2
- package/dist/{services-KS7ZX5HD.js → services-7UIQC47G.js} +2 -2
- package/dist/{setup-PBJHUVDP.js → setup-XWRCUXRJ.js} +2 -2
- package/dist/skills-IK4EDDEC.js +4 -0
- package/dist/{slots-2TNE7QVT.js → slots-KRUW2CNX.js} +2 -2
- package/dist/{standards-33HP5ISI.js → standards-W45FYJ4G.js} +2 -2
- package/dist/start_args-OU3LKYHR.js +4 -0
- package/dist/starting_prompt-BBA4VY3D.js +4 -0
- package/dist/stats-FBEDUPOX.js +4 -0
- package/dist/{status-HOGTW5NK.js → status-7DVYYFU2.js} +2 -2
- package/dist/{stop-K63QPP2T.js → stop-DXSG5LNH.js} +2 -2
- package/dist/{telepresence-RNQJ6STO.js → telepresence-YSTCK3CQ.js} +2 -2
- package/dist/{test-5OKDB5W6.js → test-6VGFJQJ5.js} +2 -2
- package/dist/{tokens-2E2YOUGM.js → tokens-LS6F6NJB.js} +2 -2
- package/dist/{up-5RWHIAIE.js → up-4EQI5XV5.js} +3 -3
- package/dist/{v4-K4ELABVT.js → v4-LQBESF3Q.js} +2 -2
- package/dist/wait_load-DR7D7ZHN.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-TZ4LCYK7.js → workspace-OD4JK6QJ.js} +2 -2
- package/package.json +4 -4
- package/dist/chunk-CP5QRUYE.js +0 -13
- package/dist/chunk-U54E44M2.js +0 -4
- package/dist/chunk-WH66XR3Z.js +0 -137
- package/dist/chunk-ZOPN2T2K.js +0 -4
- package/dist/clean-NSMHWY5Q.js +0 -8
- package/dist/close_out-DAKMIDZN.js +0 -8
- package/dist/code-GK23DHSQ.js +0 -4
- package/dist/fixture-6MKI6ZI2.js +0 -15
- package/dist/hooks-3EOBCPEK.js +0 -4
- package/dist/infra-JX3AOCSP.js +0 -4
- package/dist/init_workspace-DG7JYR2X.js +0 -4
- package/dist/list_workspaces-ZNHKGLB3.js +0 -7
- package/dist/logs-EYJ4FLFO.js +0 -6
- package/dist/migrate-RTGGW7NR.js +0 -8
- package/dist/notes-QRKTX7I2.js +0 -4
- package/dist/pause-7QRTNAWG.js +0 -4
- package/dist/pr-NPWK4XZX.js +0 -5
- package/dist/proxy_reload-CKIEXATI.js +0 -6
- package/dist/remove-72IG4RPR.js +0 -7
- package/dist/remove_workspace-4ATUGFDT.js +0 -8
- package/dist/restart-ZL642OLA.js +0 -8
- package/dist/resume-EBFIT7LE.js +0 -8
- package/dist/skills-KTHUF3OQ.js +0 -4
- package/dist/start_args-WWUIVZP7.js +0 -4
- package/dist/starting_prompt-HIWHUCHA.js +0 -4
- package/dist/stats-FYPAWFPK.js +0 -4
- package/dist/wait_load-WC4EQSID.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{d as v,m as L}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=budget-
|
|
3
|
+
import{d as v,m as L}from"./chunk-YHYPX7NL.js";import"./chunk-HQOGTB4X.js";import"./chunk-V5OL3JC2.js";import"./chunk-FQN2DYMC.js";import"./chunk-MQDHBFCX.js";import"./chunk-OZVJNXGQ.js";import"./chunk-K4C5ZUN5.js";import"./chunk-OGPEYBDT.js";import"./chunk-YHLXQZFR.js";import"./chunk-2T3SQHI7.js";import"./chunk-QL4Z6HB7.js";import"./chunk-AMJNPIVK.js";import"./chunk-VUF52ZMA.js";import"./chunk-GWGD4KE3.js";import"./chunk-WQFKHDI4.js";import"./chunk-DCHFN3K7.js";import"./chunk-JBPTLWYB.js";import"./chunk-UOJF7UOJ.js";import"./chunk-K5VYJM24.js";import{B as h,C as w,I as b,L as y,Q as k,v as f,w as $}from"./chunk-7K6HE4RU.js";import"./chunk-774YBMV5.js";import"./chunk-OLM2WX73.js";import"./chunk-6E2WDEKE.js";import"./chunk-IOZ77SLR.js";import{p as d}from"./chunk-5PAAV65H.js";import"./chunk-KS2YR7YP.js";import"./chunk-GWIDS7NP.js";import"./chunk-TJOLDBXF.js";import"./chunk-P4QU727J.js";import"./chunk-PWRV4UX6.js";import"./chunk-APHOIKD7.js";import"./chunk-H3ZVMUBR.js";import{a as c,f as g}from"./chunk-MIUYQBGU.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-UZNKM2Q6.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-PHNQ5QBT.js";import{d as s}from"./chunk-QL4Z6HB7.js";import"./chunk-WQFKHDI4.js";import"./chunk-774YBMV5.js";import"./chunk-6E2WDEKE.js";import"./chunk-PWRV4UX6.js";import{h as e,l as c}from"./chunk-APHOIKD7.js";import"./chunk-H3ZVMUBR.js";import{a as r,f as i}from"./chunk-MIUYQBGU.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-42DLOO6V.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as ce}from"./chunk-
|
|
4
|
-
`)}c(he,"renderIssueRef");function Pe(t){try{let s=X(),i=I(void 0,s),a=t.find(r=>i[r]?.hostname),o=a?i[a].hostname:Object.values(i).map(r=>r.hostname).filter(Boolean).sort()[0];return o?{host:o,domain:s.local_domain.replace(/^\.+/,"")}:null}catch{return null}}c(Pe,"resolveProxyHost");function B(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}c(B,"isDict");function je(t,s,i){let a=[];for(let[o]of t){let r=!1;try{r=de.statSync(
|
|
3
|
+
import{a as ce}from"./chunk-QL4Z6HB7.js";import{a as F,b as H,f as re}from"./chunk-GWGD4KE3.js";import{a as Y,b as K,e as Q,f as J,g as Z,i as ee,l as te}from"./chunk-WQFKHDI4.js";import{P as ne,Q as ae,v as se}from"./chunk-DCHFN3K7.js";import{b as oe}from"./chunk-JBPTLWYB.js";import{a as I,b as ie}from"./chunk-K5VYJM24.js";import{da as le}from"./chunk-7K6HE4RU.js";import{r as X}from"./chunk-P4QU727J.js";import{D as G,S as q,U as V}from"./chunk-APHOIKD7.js";import{a as c,f as A}from"./chunk-MIUYQBGU.js";A();import*as de from"node:fs";import*as me from"node:path";A();function he(t){let s=t.url?`[${t.ref}](${t.url})`:t.ref,i=t.title?`: ${t.title}`:"",a=t.fetchedAt?`Copy taken ${t.fetchedAt.slice(0,10)}: \`.werkmeister/issue.md\`.`:"No stored copy; run `werkmeister workspace init --refresh-issue`.";return["## Issue","",`${s}${i}. ${a}`,"Before each stage, re-read the live issue for newer direction: `werkmeister issue view`","Its status moves by itself (In Progress \u2192 In Review \u2192 Done): `docs/workspace-lifecycle.md` \xA7 Issue status in the werkmeister repo.",""].join(`
|
|
4
|
+
`)}c(he,"renderIssueRef");function Pe(t){try{let s=X(),i=I(void 0,s),a=t.find(r=>i[r]?.hostname),o=a?i[a].hostname:Object.values(i).map(r=>r.hostname).filter(Boolean).sort()[0];return o?{host:o,domain:s.local_domain.replace(/^\.+/,"")}:null}catch{return null}}c(Pe,"resolveProxyHost");function B(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}c(B,"isDict");function je(t,s,i){let a=[];for(let[o]of t){let r=!1;try{r=de.statSync(me.join(s,o,"CLAUDE.md")).isFile()}catch{}r&&a.push(`| Working in ${o} | ${o}/CLAUDE.md |`)}return i&&a.push("| Running or validating the change \u2014 test commands, how to validate, ports, lifecycle | .werkmeister/werkmeister-context.md |"),t.length>1&&a.push("| Cross-repo contract change | .werkmeister/notes/ (`contract` notes) |"),a.push("| Open or create a PR (including `/create-pr`), merge, close out | .werkmeister/pr-rules.md |"),a.length===0?"":`| Task | Read |
|
|
5
5
|
|------|------|
|
|
6
6
|
`+a.join(`
|
|
7
|
-
`)}c(je,"buildRoutingTable");function Oe(t){return t.path==="spike"?"No implement, review, or PR phase. Deliverable: `finding` notes. Anything built is throwaway.":t.gate===null?"Gate: none \u2014 `w9r-implement` loads the standards.":t.gate.status?`Gate: no source edit until a \`${t.gate.note}\` note in \`.werkmeister/notes/\` reads \`status: ${t.gate.status}\`. Write it at the end of research, after the user approves the design; the flip *is* the approval \u2014 do not ask again.`:`Gate: no source edit until a \`${t.gate.note}\` note in \`.werkmeister/notes/\` names the root cause.`}c(Oe,"gateLine");function Ze(t,s,i,a=""){let o=re(s),r=[];for(let
|
|
8
|
-
> Module source: ${
|
|
7
|
+
`)}c(je,"buildRoutingTable");function Oe(t){return t.path==="spike"?"No implement, review, or PR phase. Deliverable: `finding` notes. Anything built is throwaway.":t.gate===null?"Gate: none \u2014 `w9r-implement` loads the standards.":t.gate.status?`Gate: no source edit until a \`${t.gate.note}\` note in \`.werkmeister/notes/\` reads \`status: ${t.gate.status}\`. Write it at the end of research, after the user approves the design; the flip *is* the approval \u2014 do not ask again.`:`Gate: no source edit until a \`${t.gate.note}\` note in \`.werkmeister/notes/\` names the root cause.`}c(Oe,"gateLine");function Ze(t,s,i,a=""){let o=re(s),r=[];for(let m of t){let v=s[m]??{},k;o.includes(m)?k="any code edit":k=(v.applies_to||[]).map(x=>`\`${x}\``).join(", ")||"\u2014",r.push(`| ${m} | \`w9r-${m}-standard\` | ${k} |`)}let p=i.length>0?i.join(", "):"none discovered",f=H(F(),"","tree"),u=f?`
|
|
8
|
+
> Module source: ${f}`:"",y=["`ponytail`",...o.map(m=>`\`w9r-${m}-standard\``)].join(" + "),h=ae(a),R={research:"| research / planning | `w9r-research` | nothing \u2014 spawns the read-only `w9r-researcher` agent |",implement:`| implementing (before the first code edit) | \`w9r-implement\` | universal base (${y}) + rows matching the files you edit |`,test:"| testing | `w9r-test` | nothing \u2014 spawns the matching `w9r-tester-<archetype>` agent(s) |",review:"| review (before reading any diff or PR) | `w9r-review` | the standards covering files in the diff |",pr:"| PR / finishing | `w9r-pr` | `.werkmeister/pr-rules.md` \u2014 PRs open only via `werkmeister pr open` |"},C=h===ne?"":`**Work type:** ${a.trim().toLowerCase()} (${h.path} path) \u2014 phases: ${h.phases.join(" \u2192 ")}.
|
|
9
9
|
${Oe(h)}
|
|
10
10
|
|
|
11
11
|
`;return`## Standards routing
|
|
12
12
|
|
|
13
|
-
> Compiled from services.yaml + .werkmeister/workspace.yml (\`standards_override\`) \u2014 regenerated by \`werkmeister workspace init\`. Do not hand-edit.${
|
|
13
|
+
> Compiled from services.yaml + .werkmeister/workspace.yml (\`standards_override\`) \u2014 regenerated by \`werkmeister workspace init\`. Do not hand-edit.${u}
|
|
14
14
|
|
|
15
15
|
**Active in this workspace** (repos: ${p}):
|
|
16
16
|
|
|
@@ -23,11 +23,11 @@ ${C}**By phase** \u2014 invoke the entry skill before starting the phase:
|
|
|
23
23
|
|
|
24
24
|
| Phase | Invoke first | Loads |
|
|
25
25
|
|-------|--------------|-------|
|
|
26
|
-
${h.phases.map(
|
|
26
|
+
${h.phases.map(m=>R[m]).join(`
|
|
27
27
|
`)}
|
|
28
28
|
|
|
29
|
-
`}c(Ze,"buildStandardsRoutingSection");function et(t,s,i,a,o,r=null,p=null){let
|
|
30
|
-
`),
|
|
29
|
+
`}c(Ze,"buildStandardsRoutingSection");function et(t,s,i,a,o,r=null,p=null){let f=i.map(([g,L])=>`- ${g}/ \u2014 branch: ${L}`).join(`
|
|
30
|
+
`),u=!!(o.FEATURE??"").trim(),y=je(i,s,u),h=y?`
|
|
31
31
|
## Routing
|
|
32
32
|
|
|
33
33
|
${y}
|
|
@@ -57,28 +57,28 @@ ${T}
|
|
|
57
57
|
|
|
58
58
|
${C}
|
|
59
59
|
|
|
60
|
-
${
|
|
60
|
+
${f}
|
|
61
61
|
${h}
|
|
62
62
|
${$}${v}
|
|
63
63
|
## Issues
|
|
64
64
|
|
|
65
65
|
Hit a bug, or need to log a feature or task, in the \`werkmeister\` tool or a repo's code? If this workspace's changes caused a bug, fix it here; otherwise file an issue (bug | feature | task) where it belongs (the werkmeister repo, or this machine's issue tracker) and report the URL. Rules, labels and templates: [.werkmeister/issues-report.md](.werkmeister/issues-report.md).
|
|
66
|
-
`}c(et,"buildClaudeMd");var Ee=c((t,s)=>s&&Y(t)&&K(t,s)?s:"","withTempHome");function Ae(t,s,i,a,o,r=""){let p=Q(s,i[s],a),
|
|
67
|
-
Shared caches, mounted by every workspace on this machine: never delete from them (\`werkmeister cache prune\` evicts for every workspace, so it is the person's call). ${s.map(([a,o])=>{let r=ce(a,o),p=r.kind==="volume"?`volume \`${r.name}\``:`host dir \`${r.name}\``,
|
|
68
|
-
`:""}c(Be,"sharedCachesLine");function tt(t,s,i,a,o,r,p="",
|
|
66
|
+
`}c(et,"buildClaudeMd");var Ee=c((t,s)=>s&&Y(t)&&K(t,s)?s:"","withTempHome");function Ae(t,s,i,a,o,r=""){let p=Q(s,i[s],a),f=J(i[s]);return f?`- \`${s}\`: no tests (registry: ${f})`:p?`- \`${s}\`: \`${Z(t,s,o?`${o} && ${p}`:p,Ee(i[s],r))}\``:`- \`${s}\`: no test command registered (add \`test:\` to its registry entry)`}c(Ae,"testCommandLine");var Ie=c(t=>`A one-off probe is a \`node --test\` file, run as \`${t} --no-wait node --test <file>\` (in the service's container, after its \`docker exec -w <dir> <container>\`, when the host has no node_modules); never host \`node <script>\`, a compound shell line or \`docker exec \u2026 node <script>\`. That form, with no \`--cwd\` (pass the file's path instead), asks each time and is never pre-approved, since it runs any file (SW-510); with \`--cwd\` it matches no rule and auto mode denies it (SW-652).`,"PROBE_FORM");function Be(t){let s=Object.entries(t);return s.length?`
|
|
67
|
+
Shared caches, mounted by every workspace on this machine: never delete from them (\`werkmeister cache prune\` evicts for every workspace, so it is the person's call). ${s.map(([a,o])=>{let r=ce(a,o),p=r.kind==="volume"?`volume \`${r.name}\``:`host dir \`${r.name}\``,f=Object.entries(o.env??{}).map(([u,y])=>`\`${u}=${y}\``);return`\`${a}\` at \`${o.path}\` (${[...f,p].join(", ")})`}).join("; ")}.
|
|
68
|
+
`:""}c(Be,"sharedCachesLine");function tt(t,s,i,a,o,r,p="",f=null,u=o,y=!1,h="",R={},C=V()){let m=[],v=new Set;try{m=ie(r);for(let e of Object.values(I(r)))e.hostname&&!e.remoteUpstream&&v.add(e.hostname)}catch{m=[]}let k="answers only while a feature runs its service",x=m.length?`These hosts are routed through Caddy:
|
|
69
69
|
|
|
70
|
-
`+
|
|
71
|
-
`):"No services declare a `feature_router:` block, so Caddy terminates no public hosts for this workspace.",b=[],_=[],T=new Set;try{let e=I(r),n=c(d=>d.map(l=>e[l]?.hostname).filter(l=>!!l).sort(),"hostsOf");b=n(o),_=n(
|
|
70
|
+
`+m.map(e=>`- \`https://${e}\`${v.has(e)?` \u2014 ${k}`:""}`).join(`
|
|
71
|
+
`):"No services declare a `feature_router:` block, so Caddy terminates no public hosts for this workspace.",b=[],_=[],T=new Set;try{let e=I(r),n=c(d=>d.map(l=>e[l]?.hostname).filter(l=>!!l).sort(),"hostsOf");b=n(o),_=n(u),T=new Set(u.filter(d=>e[d]?.hostname))}catch{b=[]}let $=o.length>0,g=T.size>0,L=c(e=>R[e]?.lint,"lintOf"),pe=c(e=>e.test?`\`${ee(h,e.test,L(e.repo),e.repo)}\``:"\u2014","testCell"),M=c(e=>B(r[e])?r[e].repo:void 0,"repoOf"),ue=new Set(u.map(M).filter(Boolean)),we=Object.keys(r).filter(e=>ue.has(M(e))),P=te([...u,...we],r,f,T),fe=P.some(e=>!u.includes(e.service)),ke=[...new Set(P.map(e=>e.repo))].map(e=>{let{format:n,release_check:d,ship:l}=R[e]??{},w=[n&&`- Format: \`${n}\` \u2014 ${n.includes("{files}")?"`{files}` replaced with the files you touched":"run as written, from the repo root"}`,l==="tag"&&d&&`- Release check: \`${d}\` \u2014 the PR gate's release row; commit the release entry it looks for`].filter(Boolean);return w.length?`
|
|
72
72
|
|
|
73
73
|
Repo commands for ${e}:
|
|
74
|
-
${
|
|
74
|
+
${w.join(`
|
|
75
75
|
`)}`:""}).join(""),$e=P.some(e=>e.test&&L(e.repo)),ge=`| Service | Repo | Path in repo | Test command | Validation |
|
|
76
76
|
|---------|------|--------------|--------------|------------|
|
|
77
77
|
`+P.map(e=>`| \`${e.service}\` | ${e.repo} | \`${e.path}\` | ${pe(e)} | ${e.validate} |`).join(`
|
|
78
|
-
`),ye=c(e=>{let n=r[e]??{};return B(n)&&n.k8s_forward_port!==null&&n.k8s_forward_port!==void 0?Number(n.k8s_forward_port):null},"k8sPort"),S=[],j=null;for(let e of[...o].sort()){let n=r[e]??{};if(!B(n))continue;let d=n.port_offset??0,l=le(s,d);j===null&&T.has(e)&&(j=l);let
|
|
78
|
+
`),ye=c(e=>{let n=r[e]??{};return B(n)&&n.k8s_forward_port!==null&&n.k8s_forward_port!==void 0?Number(n.k8s_forward_port):null},"k8sPort"),S=[],j=null;for(let e of[...o].sort()){let n=r[e]??{};if(!B(n))continue;let d=n.port_offset??0,l=le(s,d);j===null&&T.has(e)&&(j=l);let w=n.internal_port??3e3,N=`${e.toUpperCase().replace(/-/g,"_")}_URL`;S.push(`| \`${e}\` | local | \`${n.path??"."}\` | \`${t}-${e}\` | ${l} | \`${N}=http://${e}:${w}\` |`)}for(let e of Object.keys(r).sort()){if(o.includes(e)||!$&&!u.includes(e))continue;let n=r[e]??{};if(!B(n))continue;let d=`${e.toUpperCase().replace(/-/g,"_")}_URL`,l=G(e,n);if(l){S.push(`| \`${e}\` | baseline | \`${n.path??"."}\` | \u2014 | \u2014 | \`${d}=http://${l.host}:${l.port}\` |`);continue}let w=ye(e);w&&S.push(`| \`${e}\` | k8s | \`${n.path??"."}\` | \u2014 | \u2014 | \`${d}=http://k8s-forwards:${w}\` |`)}let U;S.length>0?U=`| Service | Location | Path in repo | Container | Host Port | In-cluster URL (env var) |
|
|
79
79
|
|---------|----------|--------------|-----------|-----------|--------------------------|
|
|
80
80
|
`+S.join(`
|
|
81
|
-
`):U="_No services configured._";let D;if(o.length>0){let e=[...o].sort(),n=e.map(
|
|
81
|
+
`):U="_No services configured._";let D;if(o.length>0){let e=[...o].sort(),n=e.map(w=>L(String(r[w]?.repo??""))),d=e.map(w=>`\`${t}-${w}\``).join(", "),l=e[0];D=`### Container Commands
|
|
82
82
|
|
|
83
83
|
Container naming pattern: \`${t}-<service>\` \u2014 ${d}
|
|
84
84
|
|
|
@@ -97,7 +97,7 @@ docker compose restart ${l}
|
|
|
97
97
|
|
|
98
98
|
The registry's \`test:\` for each service (or its archetype's), run in its container \u2014 the worktree is mounted at \`/app\` with its \`node_modules\`; the host checkout has none. The pre-PR gate runs these (\`werkmeister pr gate\`).${n.some(Boolean)?" A line starting with `<lint> &&` first runs the repo's lint, the PR gate's lint row, so a `docs:check` or format failure shows here, before the tests, and not first at the gate.":""}
|
|
99
99
|
|
|
100
|
-
${e.map((
|
|
100
|
+
${e.map((w,N)=>Ae(t,w,r,f??q(),n[N],h)).join(`
|
|
101
101
|
`)}
|
|
102
102
|
${Be(C)}
|
|
103
103
|
`}else D="";let O,W=c(e=>v.has(e)?`# ${e} ${k}
|
|
@@ -121,9 +121,9 @@ document.cookie = "X-Feature=${t}; domain=.${E.domain}; path=/; SameSite=Lax";
|
|
|
121
121
|
\`\`\`
|
|
122
122
|
|
|
123
123
|
or visit https://${E.host}/__werkmeister and select \`${t}\` \u2014 the selector is served on every routed host and the cookie applies to each host sharing the base domain.
|
|
124
|
-
`:"",z=
|
|
124
|
+
`:"",z=u.filter(e=>!o.includes(e)).sort(),be=`## How to validate
|
|
125
125
|
|
|
126
|
-
How to exercise a change to each service in this workspace.${
|
|
126
|
+
How to exercise a change to each service in this workspace.${fe?" The table also lists the other services in this workspace's repos: the PR gate tests each service a change reaches, the workspace's own or not.":""}${z.length?` A plain \`werkmeister feature up\` skips the on-demand ones, ${z.map(e=>`\`${e}\``).join(", ")}: start one with \`werkmeister feature up --service <name>\`.`:""}${h?` Each test command runs through \`.werkmeister/bin/with-temp-home\`, which gives it a fresh temporary HOME and deletes it on exit: never hand-roll \`HOME=\u2026\`. Start every exercise command with the script itself, never with env assignments or a \`cd\`, so one permission rule matches it: \`${h} --cwd <worktree> <test command>\`. Its \`--cwd <worktree>\` runs the command from that service's worktree, whatever the shell's cwd, so it works from the workspace root too (SW-652). A command that needs an env var takes it after the script (\`${h} env WERKMEISTER_ROOT=\u2026 <cmd>\`); no rule pre-approves that form, so it asks. Put \`--no-wait\` first (\`${h} --no-wait <cmd>\`) to skip its host-load and free-memory wait; the allow rules below cover that form too. That wait lasts up to 90 s; if load or memory is still over its limit then, the script exits 75 without running the command (retry later). It prints only on stderr, so a foreground call shows nothing until it ends and its only child is \`werkmeister internal wait-load\`: that is the wait, not a hang. The allow rule that covers them is \`Bash(${h} --cwd <worktree> <test command>:*)\` for each test command below: run those for a test without a prompt. A test command of more than one command (an \`&&\` chain, a \`{ \u2026; }\` group, \`||\`, \`;\` or a pipe) is shown as \`${h} --cwd <worktree> sh -c '\u2026'\`, so every part runs under the temp HOME, and its rule allows that exact line: run it as shown, with no extra arguments. ${Ie(h)} The script alone is never allowed either, since it runs any command. The temp HOME only keeps a run from writing to the real one by accident; it is not an isolation boundary. A pre-approved test command or built CLI still runs whatever the worktree holds, a test written in this run included, and that code can reach absolute paths, the caller's env, the network, docker and gh (SW-522).`:""}${$e?" A test command starting with `<lint> &&` first runs the repo's lint, the same command the PR gate's lint row runs, so a format error fails here, before the tests, and not first at `werkmeister pr open`.":""} ${oe}
|
|
127
127
|
|
|
128
128
|
${ge}${ke}
|
|
129
129
|
|
|
@@ -179,4 +179,4 @@ ${ve}
|
|
|
179
179
|
${be}${Re}${Te}${Se}${D}${xe}${Le}${g||$?`## Troubleshooting
|
|
180
180
|
|
|
181
181
|
${g?"### Feature missing from `/__werkmeister` selector\n\nThe dropdown is populated from `~/.werkmeister/infra/proxy/features.json` (a static file served by Caddy), which is regenerated alongside the Caddyfile. It can drift from the live container labels (`com.werkmeister.feature` \u2014 the source of truth) if a slot is allocated without a proxy regen.\n\nDiagnose \u2014 compare what's labeled vs. what the UI shows:\n```bash\ndocker ps -a --filter label=com.werkmeister.feature --format '{{ .Label \"com.werkmeister.feature\" }}' | sort -u\njq '[.[].name]' \"$HOME/.werkmeister/infra/proxy/features.json\"\n```\n\nResync:\n```bash\nwerkmeister infra proxy-reload # regenerates Caddyfile + features.json, reloads Caddy\n```\n\n### Caddy returns `content-length: 0` but direct service hit works\n\nCaddy routing issue, not an app issue. Try `werkmeister infra proxy-reload` first; if Caddy is still misrouting, check `docker logs w9r-caddy --tail 50`.\n\n":""}${$?"### Containers expected per the table above are missing from `docker ps`\n\n`werkmeister feature up` may have partially failed. Re-run from the workspace root:\n```bash\nwerkmeister feature up # idempotent \u2014 starts missing containers\ndocker compose logs -f # watch startup if something crashes\n```\n":""}`:""}`}c(tt,"buildSandboxContextMd");export{he as a,Ze as b,et as c,tt as d};
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
182
|
+
//# sourceMappingURL=chunk-2T3SQHI7.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-MIUYQBGU.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-3U2F5C5L.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{k as _,l as j}from"./chunk-
|
|
3
|
+
import{k as _,l as j}from"./chunk-WQFKHDI4.js";import{a as R}from"./chunk-K5VYJM24.js";import{aa as O}from"./chunk-7K6HE4RU.js";import{l as y,m as I,n as N}from"./chunk-6E2WDEKE.js";import{b as h}from"./chunk-PWRV4UX6.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-APHOIKD7.js";import{b as S}from"./chunk-H3ZVMUBR.js";import{a,f as $}from"./chunk-MIUYQBGU.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-3VCFOXJB.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 E}from"./chunk-
|
|
3
|
+
import{a as E}from"./chunk-KS2YR7YP.js";import{w as $}from"./chunk-APHOIKD7.js";import{b as h}from"./chunk-H3ZVMUBR.js";import{a as r,f as _}from"./chunk-MIUYQBGU.js";_();import*as c from"node:fs";import*as d from"node:path";_();var P="mcp__ccd_turn__wrap_up",mt="Don't turn on Auto-fix in the Claude desktop app (`ccd_pr`).";var K=new Set(["AskUserQuestion","ExitPlanMode"]),L=new Set(["permission_prompt","elicitation_dialog"]),I=30*6e4,G=24*60*6e4,b=/^[\w-]+$/,T=r(t=>d.join(h(t),"agent-state.json"),"legacyFile"),w=r(t=>d.join(h(t),"sessions"),"sessionsDir"),B=r((t,e)=>d.join(w(t),`${e}.json`),"sessionPath");function y(t){try{let e=JSON.parse(c.readFileSync(t,"utf8"));return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}r(y,"readJson");function S(t){if(t?.status!=="busy"&&t?.status!=="idle"||typeof t.at!="string")return null;let e={status:t.status,at:t.at};return t.headless===!0&&(e.headless=!0),typeof t.last=="string"&&(e.last=t.last),typeof t.tool?.name=="string"&&typeof t.tool.at=="string"&&(e.tool=t.tool),Number.isInteger(t.subagents)&&t.subagents>0&&(e.subagents=t.subagents),typeof t.shell?.command=="string"&&typeof t.shell.at=="string"&&(e.shell={command:t.shell.command,at:t.shell.at,...typeof t.shell.id=="string"&&{id:t.shell.id}}),typeof t.ask?.what=="string"&&typeof t.ask.at=="string"&&(e.ask=t.ask),t.stopped===!0&&(e.stopped=!0),e}r(S,"sessionOf");function wt(t,e=Date.now()){let n={},o=r(a=>a.status==="idle"||a.ask!==void 0||e-x(a)<G,"fresh");for(let[a,s]of Object.entries(y(T(t))?.sessions??{})){let u=S(s);u&&o(u)&&(n[a]=u)}let i=[];try{i=c.readdirSync(w(t))}catch{}for(let a of i){let s=a.match(/^([\w-]+)\.json$/)?.[1],u=d.join(w(t),a),f=s?S(y(u)):null;!s||!f||(o(f)?n[s]=f:Y(u,o))}return n}r(wt,"readSessions");function Y(t,e){try{let n=S(y(t));n&&!e(n)&&c.rmSync(t,{force:!0})}catch{}}r(Y,"removeIfStale");var x=r(t=>Date.parse(t.last??t.at),"lastOf"),H=r((t,e=Date.now())=>t.status==="busy"&&e-x(t)>=I,"sessionGone");function xt(t,e=Date.now()){let n=Object.values(t),o=n.flatMap(u=>u.ask?[u.ask]:[]).sort((u,f)=>u.at.localeCompare(f.at))[0];if(o)return{agent:"needs-you",at:o.at,question:o.what};let i=n.find(u=>u.status==="busy"&&!H(u,e));if(i)return{agent:"working",at:i.at,question:null};let a=n.find(u=>u.shell&&e-Date.parse(u.shell.at)<I)?.shell;if(a)return{agent:"working",at:a.at,question:null};let s=n.sort((u,f)=>x(f)-x(u))[0];return s?s.stopped?{agent:"done",at:s.at,question:null}:s.status==="busy"?{agent:"idle",at:s.at,question:null}:null:null}r(xt,"agentOf");function Q(t){return/\?(?=[\s*_`'")\]]|$)/.test(U(t))}r(Q,"asksQuestion");function U(t){let e=t.trim().split(/\n\s*\n/);return e[e.length-1].trim().slice(0,200)}r(U,"questionOf");function q(t,e){let n=c.openSync(t,"r");try{let o=c.fstatSync(n).size,i=Math.min(o,e),a=Buffer.alloc(i);return c.readSync(n,a,0,i,o-i),a.toString("utf8")}finally{c.closeSync(n)}}r(q,"tailOf");function z(t){let e=q(t,65536).split(`
|
|
4
4
|
`);for(let n=e.length-1;n>=0;n--){let o;try{o=JSON.parse(e[n])}catch{continue}if(o.type!=="assistant")continue;let i=o.message?.content;if(typeof i=="string")return i;if(!Array.isArray(i))continue;let a=i.filter(s=>s?.type==="text"&&typeof s.text=="string");if(a.length)return a.map(s=>s.text).join(`
|
|
5
5
|
`)}return null}r(z,"lastAssistantText");var X=1<<20;function V(t,e,n){if(!t.id)return t.at<e;if(typeof n!="string")return!1;let o=`<task-id>${t.id}</task-id>`;try{return q(n,X).split(`
|
|
6
6
|
`).some(i=>i.includes(o)&&Z(i,o))}catch{return!1}}r(V,"shellExited");function Z(t,e){try{let n=JSON.parse(t);return n?.type==="queue-operation"?String(n.content??"").includes(e):n?.attachment?.type==="queued_command"&&String(n.attachment.prompt??"").includes(e)}catch{return!1}}r(Z,"isExitNotice");var D=r(t=>t.ask?.kind!=="permission"&&t.tool!==void 0&&K.has(t.tool.name),"askingTool");function tt(t,e,n,o={}){let i=t.hook_event_name,a=n.toISOString(),s=e?{...e}:{status:"idle",at:a};o.foreign||(o.headless?s.headless=!0:delete s.headless),s.last=a;let u=r(l=>{s.status!==l&&Object.assign(s,{status:l,at:a})},"status");if(i==="SubagentStart"||i==="SubagentStop"){let l=(s.subagents??0)+(i==="SubagentStart"?1:-1);return l>0?s.subagents=l:delete s.subagents,s}if(t.agent_id)return e?s:void 0;let f=String(t.tool_name??""),m=o.foreign;switch(i){case"SessionStart":if(u("idle"),!m)for(let l of["tool","ask","stopped","subagents","shell"])delete s[l];return s;case"UserPromptSubmit":if(u("busy"),!m)for(let l of["tool","ask","stopped"])delete s[l];return s;case"PreToolUse":{if(u("busy"),m)return s;delete s.stopped;let l=t.tool_input?.command;s.tool={name:f,...typeof l=="string"&&{command:l.slice(0,200)},at:a},f==="Bash"&&t.tool_input?.run_in_background===!0&&(s.shell={command:typeof l=="string"?l.slice(0,200):"",at:a});let p=t.tool_input?.ask;if(f===P&&typeof p=="string"&&p.trim())s.ask={kind:"question",what:p.trim(),at:a,source:"session",via:"wrap_up"};else if(f==="AskUserQuestion"){let A=t.tool_input?.questions?.[0]?.question;s.ask={kind:"question",what:typeof A=="string"?A:"Answer the question",at:a,source:"session"}}else f==="ExitPlanMode"?s.ask={kind:"plan",what:"Approve the plan?",at:a,source:"session"}:delete s.ask;return s}case"PostToolUse":case"PostToolUseFailure":{if(u("busy"),m)return s;delete s.tool;let l=t.tool_response?.backgroundTaskId;s.shell&&typeof l=="string"&&t.tool_input?.run_in_background===!0&&(s.shell={...s.shell,id:l});let p=t.tool_input?.task_id??t.tool_input?.shell_id;return(f==="TaskStop"||f==="KillShell")&&s.shell?.id&&p===s.shell.id&&delete s.shell,f===P&&s.ask?.via==="wrap_up"||delete s.ask,s}case"Notification":{let l=t.notification_type,p=String(t.message??"");return!(typeof l=="string"?L.has(l):!/waiting for your input/i.test(p))||m||D(s)||s.ask?.kind==="permission"?void 0:(s.ask={kind:l==="elicitation_dialog"?"question":"permission",what:p||"Approve the tool call?",at:a,source:"session"},s)}case"PermissionRequest":{if(m||D(s)||s.ask?.kind==="permission")return;let l=t.tool_input?.description;return s.ask={kind:"permission",what:typeof l=="string"&&l.trim()?l.trim():`Approve ${f||"the tool call"}?`,at:a,source:"session"},s}case"PermissionDenied":return s.ask?.kind==="permission"&&delete s.ask,s;case"Stop":case"StopFailure":{let l=s.at;if(u("idle"),m)return s;delete s.tool,s.shell&&V(s.shell,l,t.transcript_path)&&delete s.shell,s.stopped=!0;let p=null;return typeof t.last_assistant_message=="string"?p=t.last_assistant_message:typeof t.transcript_path=="string"&&(p=z(t.transcript_path)),p&&Q(p)?s.ask={kind:"question",what:U(p),at:a,source:"text"}:s.ask?.via!=="wrap_up"&&delete s.ask,s}case"SessionEnd":return o.foreign?s:null;default:return}}r(tt,"nextSession");var et="Workspace paused by the person from its card. End your turn now; it continues when they press Resume.",bt="Workspace resumed by the person. Continue where you left off.",O=r(t=>d.join(h(t),"paused.json"),"pausedPath"),N=r(t=>d.join(h(t),"resume-nudge.json"),"nudgePath"),k=r(t=>d.join(h(t),"waiting.json"),"waitingPath");function g(t,e){let n=`${t}.${process.pid}.tmp`;c.writeFileSync(n,`${JSON.stringify(e)}
|
|
@@ -9,4 +9,4 @@ import{a as E}from"./chunk-TKXEX3J7.js";import{w as $}from"./chunk-6HU4LHQY.js";
|
|
|
9
9
|
${n}`:n,at:o.toISOString()})}catch(u){throw s!==null&&c.renameSync(a,i),u}c.rmSync(a,{force:!0})}r(Dt,"writeWakeNudge");function rt(t,e){let n=t.hook_event_name;if(n!=="UserPromptSubmit"&&n!=="PostToolUse"&&n!=="Stop"||t.agent_id||!ot(e,t.session_id))return null;let o=v(e,t.session_id),i=`${o}.${process.pid}-${Date.now()}.claimed`;try{c.renameSync(o,i)}catch{return null}let a=F(i);return c.rmSync(i,{force:!0}),a===null?null:n==="Stop"?{decision:"block",reason:a}:{hookSpecificOutput:{hookEventName:n,additionalContext:a}}}r(rt,"deliverWake");var it=r(()=>d.join($(),"scheduler","queue.json"),"queuePath");function J(t){let e=c.statSync(k(t),{throwIfNoEntry:!1})?.mtimeMs??Date.now();if(Date.now()-e<5e3)return!1;let n;try{n=/^FEATURE=(.+)$/m.exec(c.readFileSync(d.join(t,".env"),"utf8"))?.[1]?.trim()}catch{return!1}if(!n)return!1;try{let o=JSON.parse(c.readFileSync(it(),"utf8"));return!(Array.isArray(o)&&o.includes(n))}catch{return!0}}r(J,"leftOver");var at=/(^|[\s;&|(`/'"])(docker|pnpm|npm|npx|node|turbo|vitest|with-temp-home|with-fixture-workspace)(\s|$)|\b(werkmeister|w9r)\s+(feature\s+(up|restart)|pr\s+(gate|open))\b/,ct=/^mcp__.*werkmeister.*__(up|restart|test|workspace-pr)$/;function ut(t){if(t.hook_event_name!=="PreToolUse")return!1;let e=String(t.tool_name??""),n=String(t.tool_input?.command??"").replace(/(\s(?:-m|--message)[= ]?\s*)('[^']*'|"[^"]*")/g,"$1''");return e==="Bash"?at.test(n):ct.test(e)&&t.tool_input?.action!=="status"}r(ut,"needsCapacity");function lt(t,e){let n=c.existsSync(O(e)),o=n?null:C(e);if(!n&&!o||o?.services)return null;if(o&&J(e))return R(e),null;if(o&&!ut(t))return null;let i=o?`Waiting for capacity (position ${o.position}): containers and tests wait until this workspace starts, and the session is told to continue then. Edits and git still work; end your turn if nothing else is left.`:et;switch(t.hook_event_name){case"PreToolUse":{let a={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:i}};return process.env.WERKMEISTER_HOOK_HARNESS==="codex"?a:{continue:!1,stopReason:i,...a}}case"UserPromptSubmit":return{decision:"block",reason:"This workspace is paused. Press \u25B6 Resume on its card first."};default:return null}}r(lt,"pauseGate");function ft(t,e){if(t.hook_event_name!=="UserPromptSubmit")return null;let n=nt(e);return n?.services?n.parked&&J(e)?(R(e),null):n.parked?`This workspace's start of ${n.parked.service} is queued for capacity (position ${n.position}). Nothing polls for it: it starts by itself when room frees, and the session is told to continue. Rerunning \`werkmeister feature up --service\` keeps its place.`:`This session's own service start is waiting for capacity (position ${n.position}): ${n.services.join(", ")}. The werkmeister command that started it (pr gate, pr open or feature up --service), usually a background job in this session, polls every 15 s for up to 10 min and goes on by itself when room frees. To stop the wait, stop that job (TaskStop, or kill its pid; never pkill).`:null}r(ft,"serviceWaitContext");function pt(t,e){let n=t?.hookSpecificOutput?.additionalContext;return{hookSpecificOutput:{hookEventName:"UserPromptSubmit",additionalContext:n?`${e}
|
|
10
10
|
|
|
11
11
|
${n}`:e}}}r(pt,"withContext");function dt(t,e=new Date){let n=E(String(t.cwd||process.cwd())),o=t.session_id;if(!n||typeof o!="string"||!b.test(o))return null;let i=B(n,o),a=S(y(i)),s=y(T(n)),u=a??S(s?.sessions?.[o]),f=process.env.CLAUDE_CODE_ENTRYPOINT?.startsWith("sdk")??!1,m=f&&u!==null&&!u.headless,l=tt(t,u,e,{headless:f,foreign:m});return l===void 0?null:(s?.sessions?.[o]&&(delete s.sessions[o],g(T(n),s)),l===null?u?(c.rmSync(i,{force:!0}),i):null:(c.mkdirSync(w(n),{recursive:!0}),g(i,l),i))}r(dt,"record");function It(){try{let t=process.stdin.isTTY?"":c.readFileSync(0,"utf8"),e=t.trim()?JSON.parse(t):{};if(typeof e!="object"||e===null||Array.isArray(e))return;let n=E(String(e.cwd||process.cwd())),o=n?lt(e,n):null;if(o){console.log(JSON.stringify(o));return}n&&e.hook_event_name==="UserPromptSubmit"&&c.rmSync(N(n),{force:!0});let i=n?rt(e,n):null,a=n?ft(e,n):null;if(a?console.log(JSON.stringify(pt(i,a))):i&&console.log(JSON.stringify(i)),i&&e.hook_event_name==="Stop")return;dt(e)}catch{}}r(It,"main");export{mt as a,I as b,G as c,wt as d,H as e,xt as f,Q as g,U as h,bt as i,N as j,k,g as l,Ot as m,Nt as n,vt as o,C as p,nt as q,At as r,R as s,Et as t,Pt as u,W as v,Tt as w,jt as x,$t as y,Dt as z,It as A};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-5PAAV65H.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{n as C,r as M}from"./chunk-
|
|
3
|
+
import{n as C,r as M}from"./chunk-P4QU727J.js";import{a as j,h as B,j as b,m as x,n as S}from"./chunk-APHOIKD7.js";import{b as I}from"./chunk-H3ZVMUBR.js";import{a as i,e as L,f as F}from"./chunk-MIUYQBGU.js";F();var _=L(j(),1);import{spawn as W}from"node:child_process";import*as k from"node:crypto";import*as p from"node:fs";import*as v from"node:net";import*as R from"node:os";import*as P from"node:path";function N(){return`.${M().local_domain.replace(/^\.+/,"")}`}i(N,"cookieDomain");var y={chrome:{label:"Google Chrome",engine:"chromium",macPath:"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"},chromium:{label:"Chromium",engine:"chromium",macPath:"/Applications/Chromium.app/Contents/MacOS/Chromium"},brave:{label:"Brave Browser",engine:"chromium",macPath:"/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"},edge:{label:"Microsoft Edge",engine:"chromium",macPath:"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"},firefox:{label:"Firefox",engine:"gecko",macPath:"/Applications/Firefox.app/Contents/MacOS/firefox"},safari:{label:"Safari",engine:"webkit",macPath:"/Applications/Safari.app/Contents/MacOS/Safari"},duckduckgo:{label:"DuckDuckGo",engine:"webkit",macPath:"/Applications/DuckDuckGo.app/Contents/MacOS/DuckDuckGo"}},A="chrome",oe={key:"browser",label:"Browser for `werkmeister feature open`",help:"Chromium browsers (chrome, chromium, brave, edge) work via CDP; safari works via Apple's bundled safaridriver. Firefox/DuckDuckGo are listed for visibility but aren't wired up yet.",acceptEmpty:!1,pattern:`(${Object.keys(y).join("|")})`,placeholder:A,choicesFn:i(()=>Object.keys(y),"choicesFn")};function H(){if(process.env.CHROME_BIN)return process.env.CHROME_BIN;let s=C().overrides??{};if(s.browser_path)return s.browser_path;let t=s.browser||A,e=y[t];if(!e)return x(`Unknown overrides.browser '${t}' -- choices: ${Object.keys(y).join(", ")}`),null;if(e.engine!=="chromium"){let o=e.engine==="webkit"?"WebKit":"Gecko",r=Object.keys(y).filter(n=>y[n].engine==="chromium");return x(`${e.label} uses ${o}, not Chromium -- \`werkmeister feature open\` only speaks the Chrome DevTools Protocol, which just Chromium-based browsers support. Run \`werkmeister machine setup\` and pick one of: ${r.join(", ")}.`),null}return e.macPath}i(H,"resolveBrowserBinary");function $(s){return new Promise(t=>setTimeout(t,s))}i($,"sleep");var O=class s{static{i(this,"WS")}host;port;sock;fatalError=null;rxbuf=Buffer.alloc(0);nextId=0;pending=[];handler=null;set onMessage(t){if(this.handler=t,t)for(;this.pending.length;)t(this.pending.shift())}constructor(t,e,o){this.sock=t,this.host=e,this.port=o}static connect(t){let e=new URL(t),o=e.hostname,r=e.port?parseInt(e.port,10):80,n=e.pathname||"/";return e.search&&(n+=e.search),new Promise((a,l)=>{let c=v.createConnection({host:o,port:r}),u=new s(c,o,r),d=!1,f=Buffer.alloc(0);c.setTimeout(1e4,()=>c.destroy(new Error("websocket handshake timed out"))),c.on("error",h=>{d?u.fatalError||(u.fatalError=h):l(h)}),c.on("close",()=>{d?u.fatalError||(u.fatalError=new Error("websocket closed by peer")):l(new Error("websocket handshake failed (closed)"))});let m=i(h=>{f=Buffer.concat([f,h]);let w=f.indexOf(`\r
|
|
4
4
|
\r
|
|
5
5
|
`);if(w===-1)return;if(!f.subarray(0,f.indexOf(`\r
|
|
6
6
|
`)).toString("latin1").includes(" 101 ")){c.destroy(),l(new Error(`websocket handshake failed: ${f.subarray(0,80).toString("latin1")}`));return}u.rxbuf=f.subarray(w+4),c.setTimeout(0),c.off("data",m),c.on("data",g=>{u.rxbuf=Buffer.concat([u.rxbuf,g]),u.pump()}),d=!0,a(u),u.pump()},"onHandshakeData");c.on("data",m),c.on("connect",()=>{let h=k.randomBytes(16).toString("base64"),w=`GET ${n} HTTP/1.1\r
|
|
@@ -37,9 +37,9 @@ Sec-WebSocket-Version: 13\r
|
|
|
37
37
|
tick();
|
|
38
38
|
setInterval(tick,1000); // self-heal across SPA route changes
|
|
39
39
|
})();
|
|
40
|
-
`}i(J,"badgeScript");function K(){return new Promise((s,t)=>{let e=v.createServer();e.once("error",t),e.listen(0,"127.0.0.1",()=>{let o=e.address().port;e.close(()=>s(o))})})}i(K,"findFreePort");async function q(s,t=15){let e=Date.now()+t*1e3,o=null;for(;Date.now()<e;)try{return(await(await fetch(`http://127.0.0.1:${s}/json/version`,{signal:AbortSignal.timeout(2e3)})).json()).webSocketDebuggerUrl}catch(r){o=r,await $(250)}throw new Error(`Chrome debug endpoint never came up on :${s} (${o})`)}i(q,"waitForBrowserWs");var T=class{static{i(this,"FeatureSession")}ws;feature;url;script;procExited;shouldStop;configured=new Set;cookieSet=!1;navigated=!1;constructor(t,e,o,r,n,a){this.ws=t,this.feature=e,this.url=r,this.script=J(e,o),this.procExited=n,this.shouldStop=a}configureTarget(t){this.cookieSet||(this.ws.send("Network.enable",null,t),this.ws.send("Network.setCookie",{name:"X-Feature",value:this.feature,domain:N(),path:"/",secure:!0,sameSite:"Lax"},t),this.cookieSet=!0),this.ws.send("Page.enable",null,t),this.ws.send("Page.addScriptToEvaluateOnNewDocument",{source:this.script},t),this.ws.send("Runtime.evaluate",{expression:this.script},t),this.navigated||(this.ws.send("Page.navigate",{url:this.url},t),this.navigated=!0)}onEvent(t){if(t?.method!=="Target.attachedToTarget")return;let e=t.params,o=e.sessionId;if(e.targetInfo?.type==="page"&&!this.configured.has(o)){this.configured.add(o);try{this.configureTarget(o)}catch(r){x(`could not configure tab: ${r instanceof Error?r.message:r}`)}}}async start(t=15e3){this.ws.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),this.ws.onMessage=o=>this.onEvent(o);let e=Date.now()+t;for(;!this.navigated;){if(this.ws.fatalError)throw this.ws.fatalError;if(this.procExited()||Date.now()>e)return!1;await $(50)}return!0}async poll(){for(;!this.procExited()&&!this.shouldStop();){if(this.ws.fatalError)throw this.ws.fatalError;await $(1e3)}}};function X(){if(process.env.CHROME_BIN)return!1;let s=C().overrides??{};return s.browser_path?!1:(s.browser||A)==="safari"}i(X,"wantsSafari");async function ne(s,t,e={}){if(X()){let{launchSafariWindow:o}=await import("./safari-
|
|
40
|
+
`}i(J,"badgeScript");function K(){return new Promise((s,t)=>{let e=v.createServer();e.once("error",t),e.listen(0,"127.0.0.1",()=>{let o=e.address().port;e.close(()=>s(o))})})}i(K,"findFreePort");async function q(s,t=15){let e=Date.now()+t*1e3,o=null;for(;Date.now()<e;)try{return(await(await fetch(`http://127.0.0.1:${s}/json/version`,{signal:AbortSignal.timeout(2e3)})).json()).webSocketDebuggerUrl}catch(r){o=r,await $(250)}throw new Error(`Chrome debug endpoint never came up on :${s} (${o})`)}i(q,"waitForBrowserWs");var T=class{static{i(this,"FeatureSession")}ws;feature;url;script;procExited;shouldStop;configured=new Set;cookieSet=!1;navigated=!1;constructor(t,e,o,r,n,a){this.ws=t,this.feature=e,this.url=r,this.script=J(e,o),this.procExited=n,this.shouldStop=a}configureTarget(t){this.cookieSet||(this.ws.send("Network.enable",null,t),this.ws.send("Network.setCookie",{name:"X-Feature",value:this.feature,domain:N(),path:"/",secure:!0,sameSite:"Lax"},t),this.cookieSet=!0),this.ws.send("Page.enable",null,t),this.ws.send("Page.addScriptToEvaluateOnNewDocument",{source:this.script},t),this.ws.send("Runtime.evaluate",{expression:this.script},t),this.navigated||(this.ws.send("Page.navigate",{url:this.url},t),this.navigated=!0)}onEvent(t){if(t?.method!=="Target.attachedToTarget")return;let e=t.params,o=e.sessionId;if(e.targetInfo?.type==="page"&&!this.configured.has(o)){this.configured.add(o);try{this.configureTarget(o)}catch(r){x(`could not configure tab: ${r instanceof Error?r.message:r}`)}}}async start(t=15e3){this.ws.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),this.ws.onMessage=o=>this.onEvent(o);let e=Date.now()+t;for(;!this.navigated;){if(this.ws.fatalError)throw this.ws.fatalError;if(this.procExited()||Date.now()>e)return!1;await $(50)}return!0}async poll(){for(;!this.procExited()&&!this.shouldStop();){if(this.ws.fatalError)throw this.ws.fatalError;await $(1e3)}}};function X(){if(process.env.CHROME_BIN)return!1;let s=C().overrides??{};return s.browser_path?!1:(s.browser||A)==="safari"}i(X,"wantsSafari");async function ne(s,t,e={}){if(X()){let{launchSafariWindow:o}=await import("./safari-UPQ6L5EB.js");return o(s,t,e)}return V(s,t,e)}i(ne,"launchFeatureWindow");async function V(s,t,e={}){let o=e.size??"1440,900",r=e.position??null,n=H();if(!n)return null;if(!p.existsSync(n))return x(`Browser not found at ${n} (set CHROME_BIN, or overrides.browser_path in config.yaml, to override -- or run \`werkmeister machine setup\` to pick an installed browser)`),null;let a=z(s),l=await K(),c=p.mkdtempSync(P.join(R.tmpdir(),`chrome-${s}-`));if(!r){let g=Number(G(s)%8n)*40;r=`${60+g},${60+g}`}let u=[`--user-data-dir=${c}`,`--remote-debugging-port=${l}`,"--no-first-run","--no-default-browser-check","--new-window",`--window-size=${o}`,`--window-position=${r}`,"about:blank"],d=W(n,u,{stdio:"ignore",detached:!0});d.unref();let f=!1;d.on("exit",()=>{f=!0});let m=null;async function h(){m?.close();try{d.kill()}catch{}if(!f&&!await new Promise(D=>{let U=setTimeout(()=>D(!1),5e3);d.once("exit",()=>{clearTimeout(U),D(!0)})}))try{d.kill("SIGKILL")}catch{}p.rmSync(c,{recursive:!0,force:!0})}i(h,"cleanup");let w,E=!1;try{if(m=await O.connect(await q(l)),w=new T(m,s,a,t,()=>f,()=>E),!await w.start())return x("The browser window never came up \u2014 nothing was tagged."),await h(),null}catch(g){throw await h(),g}return S(`
|
|
41
41
|
`),b(`Feature : ${s}`),b(`Cookie : X-Feature=${s} (domain ${N()})`),b(`Badge : ${a}`),b(`URL : ${t}`),b(`Profile : ${c} (throwaway)`),S(`
|
|
42
42
|
Window is tagged ${B.BOLD}[${s}]${B.RESET} in the title bar + corner badge.
|
|
43
43
|
`),{stop:i(()=>{E=!0},"stop"),async supervise(){try{return await w.poll(),E?(S(`
|
|
44
44
|
`),b("Closing feature window\u2026"),130):0}finally{await h()}}}}i(V,"launchChromiumWindow");function se(s){for(let t of["workspace.yml","workspace.yaml"]){let e=P.join(I(s),t);if(!(p.existsSync(e)&&p.statSync(e).isFile()))continue;let o;try{o=(0,_.parse)(p.readFileSync(e,"utf8"))}catch{return{}}return o&&typeof o=="object"&&!Array.isArray(o)?o:{}}return{}}i(se,"readWorkspaceYaml");export{N as a,y as b,A as c,oe as d,$ as e,z as f,J as g,K as h,ne as i,se as j};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-5XCXWEXR.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-PWRV4UX6.js";import{s as C,t as g}from"./chunk-APHOIKD7.js";import{a as r,f as h}from"./chunk-MIUYQBGU.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-6E2WDEKE.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as M}from"./chunk-
|
|
3
|
+
import{a as M}from"./chunk-V3LWRWC6.js";import{a as $,b as v,c as y,d as u,e as S}from"./chunk-RTOH3QCC.js";import{f as x}from"./chunk-774YBMV5.js";import{h as e,j as E,k as R,l as C}from"./chunk-APHOIKD7.js";import{a as p,f as h}from"./chunk-MIUYQBGU.js";h();function T(n,t){if(Object.keys(n).length===0)return" No container data collected.";let a=[],o=` ${e.BOLD}${"Container".padEnd(35)} ${"Avg CPU".padStart(8)} ${"Max CPU".padStart(8)} ${"Avg Mem".padStart(8)} ${"Max Mem".padStart(8)} ${"Samples".padStart(7)} ${"CPU Lim".padStart(7)}${e.RESET}`;a.push(o),a.push(` ${"\u2500".repeat(94)}`);for(let r of Object.keys(n).sort()){let s=n[r];a.push(` ${r.padEnd(35)} ${s.avgCpu.toFixed(1).padStart(7)}% ${s.maxCpu.toFixed(1).padStart(7)}% ${$(s.avgMem).padStart(8)} ${$(s.maxMem).padStart(8)} ${String(s.samples).padStart(7)} ${(S(r,t)??"n/a").padStart(7)}`)}return a.join(`
|
|
4
4
|
`)}p(T,"formatStatsTable");function O(n){if(n.length===0)return" No recommendations available (no data collected).";let t=[],a=` ${e.BOLD}${"Container".padEnd(35)} ${"Max CPU".padStart(8)} ${"Max Mem".padStart(8)} ${"Rec. CPU".padStart(9)} ${"Rec. Mem".padStart(9)} ${"Rec. Rsrv".padStart(9)}${e.RESET}`;t.push(a),t.push(` ${"\u2500".repeat(90)}`);for(let o of n)t.push(` ${o.name.padEnd(35)} ${o.max_cpu_pct.toFixed(1).padStart(7)}% ${$(o.max_mem_mib).padStart(8)} ${o.recommended_cpus.padStart(9)} ${o.recommended_memory.padStart(9)} ${o.recommended_reservation.padStart(9)}`);t.push(""),t.push(` ${e.BOLD}YAML Snippets:${e.RESET}`),t.push("");for(let o of n)t.push(` # ${o.name}`),t.push(" deploy:"),t.push(" resources:"),t.push(" limits:"),t.push(` cpus: "${o.recommended_cpus}"`),t.push(` memory: ${o.recommended_memory}`),t.push(" reservations:"),t.push(` cpus: "${v(o.recommended_cpus)}"`),t.push(` memory: ${o.recommended_reservation}`),t.push("");return t.join(`
|
|
5
5
|
`)}p(O,"formatRecommendations");async function k(n){let t=n.collect??0,a=n.interval??10,o=!!n.save;console.log(`
|
|
6
6
|
${e.BOLD}=== Docker Resource Usage ===${e.RESET}
|
|
@@ -10,4 +10,4 @@ ${e.BOLD}--- Collected Statistics ---${e.RESET}
|
|
|
10
10
|
`),console.log(T(r.stats,u())),console.log(`
|
|
11
11
|
${e.BOLD}--- Recommended Resource Limits ---${e.RESET}
|
|
12
12
|
`),console.log(O(r.recommendations)),r.reportPath?R(`Report saved to: ${r.reportPath}`):a||console.log(` ${e.DIM}Tip: Use --save to write results to stats/ directory${e.RESET}`),console.log())}p(D,"renderCollection");function f(n){return n>=1024?`${(n/1024).toFixed(1)} GiB`:n>=1?`${n.toFixed(0)} MiB`:`${(n*1024).toFixed(0)} KiB`}p(f,"fmtMem");export{k as a,f as b};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-6HNEESFL.js.map
|