werkmeister 0.89.2 → 0.90.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{budget-P5JBRTPG.js → budget-PT3VF26C.js} +2 -2
- package/dist/{cache-DUYHRESP.js → cache-NH5PTL64.js} +2 -2
- package/dist/{chunk-DRI4OHNA.js → chunk-2KNFKILM.js} +3 -3
- package/dist/{chunk-5LQO3VEP.js → chunk-3DUSX5P7.js} +2 -2
- package/dist/{chunk-F37P66U5.js → chunk-4IPVX536.js} +2 -2
- package/dist/{chunk-5H6K4MI5.js → chunk-572F3AQM.js} +2 -2
- package/dist/{chunk-C25JQ6TF.js → chunk-5YMMXIXJ.js} +2 -2
- package/dist/{chunk-XV4L6ZZW.js → chunk-62HUYOP4.js} +2 -2
- package/dist/{chunk-PK7M5KJY.js → chunk-66MITC5V.js} +2 -2
- package/dist/{chunk-5VBOWGVH.js → chunk-6GHL46O6.js} +2 -2
- package/dist/{chunk-7D73HLJW.js → chunk-6TLZGFXP.js} +2 -2
- package/dist/{chunk-PWCZJOYO.js → chunk-72GDJSLI.js} +2 -2
- package/dist/{chunk-MNANLNCS.js → chunk-73TW2WJJ.js} +2 -2
- package/dist/{chunk-E5EYLHWE.js → chunk-7GJ2J2EE.js} +2 -2
- package/dist/{chunk-YKXP53WF.js → chunk-7KNVGADJ.js} +2 -2
- package/dist/{chunk-YQWPQIAT.js → chunk-7MSLZTTK.js} +2 -2
- package/dist/{chunk-HF34U4ZF.js → chunk-7P6T7FUL.js} +2 -2
- package/dist/{chunk-PCV6NAAK.js → chunk-7PIVMEQX.js} +2 -2
- package/dist/{chunk-65WN7UFH.js → chunk-7WVRV24A.js} +2 -2
- package/dist/{chunk-ASWXLDJM.js → chunk-AJEK2VJF.js} +2 -2
- package/dist/{chunk-G3QEUH6Q.js → chunk-AM7AS4M2.js} +2 -2
- package/dist/{chunk-FS6YA3CG.js → chunk-B6D7CSHG.js} +2 -2
- package/dist/{chunk-6RPHJEST.js → chunk-BEUUGV73.js} +2 -2
- package/dist/{chunk-2DWIVGDO.js → chunk-BISSN2O3.js} +3 -3
- package/dist/{chunk-LBOP4JKF.js → chunk-BOIIVFVD.js} +2 -2
- package/dist/{chunk-J7B5NNPO.js → chunk-CTCXMTDL.js} +2 -2
- package/dist/{chunk-IGZMYHXD.js → chunk-DRVSQMU4.js} +2 -2
- package/dist/{chunk-OFNMJWQV.js → chunk-DU32YNDK.js} +2 -2
- package/dist/{chunk-OJKXMZOD.js → chunk-EBWWRAUU.js} +2 -2
- package/dist/{chunk-PM5GFZ7K.js → chunk-FGA47ZU7.js} +2 -2
- package/dist/chunk-FI225MEI.js +110 -0
- package/dist/{chunk-LBSVNANO.js → chunk-G5SPVAY5.js} +2 -2
- package/dist/{chunk-TOO3IRV2.js → chunk-GDBENCJL.js} +2 -2
- package/dist/{chunk-KAV6YZGV.js → chunk-GJSGK4EZ.js} +2 -2
- package/dist/{chunk-6JER3JWG.js → chunk-IOJGQSF4.js} +2 -2
- package/dist/{chunk-CQY3GTFJ.js → chunk-JN2Q5S3G.js} +2 -2
- package/dist/{chunk-NO4HS4QL.js → chunk-JSPETF6W.js} +6 -6
- package/dist/{chunk-WSTEEZR2.js → chunk-JUY35LCT.js} +2 -2
- package/dist/{chunk-FG2XLGNM.js → chunk-JWNQU45X.js} +2 -2
- package/dist/{chunk-WH2N7OIO.js → chunk-JXKPSODN.js} +2 -2
- package/dist/{chunk-SA7ZCS57.js → chunk-KHOZUHBP.js} +2 -2
- package/dist/{chunk-S36EPVSQ.js → chunk-KNPK5NCZ.js} +3 -3
- package/dist/{chunk-2VPTBX43.js → chunk-LLL2ER26.js} +2 -2
- package/dist/{chunk-N66DB4DW.js → chunk-LNSRYF2J.js} +2 -2
- package/dist/{chunk-MMI6XRQX.js → chunk-LV4UESBO.js} +2 -2
- package/dist/{chunk-IHSZHN6O.js → chunk-LXEIIDCP.js} +2 -2
- package/dist/{chunk-LFNRVTYS.js → chunk-MHOPJQZX.js} +2 -2
- package/dist/{chunk-4D72V6SW.js → chunk-MUICDO3D.js} +2 -2
- package/dist/{chunk-L766XAX3.js → chunk-MXKSIM3S.js} +2 -2
- package/dist/{chunk-F5YT2U6R.js → chunk-MYL3NDG5.js} +2 -2
- package/dist/{chunk-2M2FM27H.js → chunk-N2T4QH5R.js} +2 -2
- package/dist/{chunk-4TT37SCP.js → chunk-N667SZQA.js} +2 -2
- package/dist/{chunk-ELLCJ25G.js → chunk-NJ5TYAXZ.js} +2 -2
- package/dist/{chunk-OGQ4U6IV.js → chunk-NT5VHO4I.js} +2 -2
- package/dist/{chunk-HEW6VJOC.js → chunk-OGJI6KTY.js} +2 -2
- package/dist/chunk-OQJUDYGN.js +13 -0
- package/dist/{chunk-FN2A7LG6.js → chunk-QTEV75OD.js} +2 -2
- package/dist/{chunk-CONW5UWC.js → chunk-R4UIOLSU.js} +2 -2
- package/dist/{chunk-4HOBUMZ4.js → chunk-RALGVL7W.js} +2 -2
- package/dist/{chunk-SWZ47KNM.js → chunk-SZL3VDBG.js} +2 -2
- package/dist/{chunk-3QSQOSVX.js → chunk-T4WAAV7G.js} +2 -2
- package/dist/{chunk-VCXHU46R.js → chunk-TZ5RA4N6.js} +2 -2
- package/dist/{chunk-I3NEQJZQ.js → chunk-TZNKWKBE.js} +3 -3
- package/dist/chunk-UFD2WSA2.js +4 -0
- package/dist/{chunk-4YFK45ID.js → chunk-WEUNR7XZ.js} +2 -2
- package/dist/{chunk-ZH2U6Z6K.js → chunk-WKXBV7DF.js} +2 -2
- package/dist/{chunk-S6CT7QYD.js → chunk-WRNA4NF3.js} +2 -2
- package/dist/{chunk-I6XF24V6.js → chunk-ZPZNTG4C.js} +2 -2
- package/dist/clean-6JJPOJEB.js +8 -0
- package/dist/close_out-IK3ZYWH7.js +8 -0
- package/dist/code-IGKOMVLK.js +4 -0
- package/dist/{config-6MNBCGS3.js → config-L3GDSJGU.js} +2 -2
- package/dist/{connect-LQKEWBWV.js → connect-FD5SMVXF.js} +2 -2
- package/dist/{daemon-BZU6CK7N.js → daemon-XNNULAM4.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-LSPWGEOM.js → detect-OC7MY7AM.js} +2 -2
- package/dist/{down-LEOIK4OY.js → down-ALMOGL37.js} +3 -3
- package/dist/fixture-ENXSYGR3.js +14 -0
- package/dist/form-cli.js +1 -1
- package/dist/hooks-LLIP6F2T.js +4 -0
- package/dist/{hooks_gen-OVQAIWEX.js → hooks_gen-BCRR3DUZ.js} +2 -2
- package/dist/infra-N7DU4727.js +4 -0
- package/dist/init_workspace-Z2XEBMHT.js +4 -0
- package/dist/{intercept-MNBDHQJ7.js → intercept-4OFWB3WH.js} +2 -2
- package/dist/{issue-GZXM2RR5.js → issue-PI74KB5P.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-NZWNAOSF.js +7 -0
- package/dist/logs-ZSDHFYUN.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-PQR3O2FX.js → migrate-SJMAZ557.js} +2 -2
- package/dist/notes-4L2LLG57.js +4 -0
- package/dist/{open-MCQTSCWF.js → open-WUVAUVNM.js} +2 -2
- package/dist/{optimize-BIQFV4YN.js → optimize-X6Q6CNBL.js} +2 -2
- package/dist/pause-QXPJBER5.js +4 -0
- package/dist/pr-XG4W7OWB.js +5 -0
- package/dist/proxy_reload-OUWXC6NW.js +6 -0
- package/dist/{registry-UZ6VLJZP.js → registry-ZFDRUZIP.js} +2 -2
- package/dist/remove-ROVJH244.js +7 -0
- package/dist/remove_workspace-D253KRYB.js +8 -0
- package/dist/restart-V63JJEIT.js +8 -0
- package/dist/resume-HQ4BS6IG.js +8 -0
- package/dist/{safari-YX2O7P2R.js → safari-SQ6BCVH3.js} +2 -2
- package/dist/{sandbox-Z7EKZKRV.js → sandbox-K7CSYEZS.js} +2 -2
- package/dist/{services-XBD543ZZ.js → services-RSPIOC7B.js} +2 -2
- package/dist/{setup-HRAOD75R.js → setup-FSIVQMWD.js} +2 -2
- package/dist/skills-LTXTCKUB.js +4 -0
- package/dist/{slots-WDBO6I6S.js → slots-UT56AWR4.js} +2 -2
- package/dist/{standards-2FFBOKMD.js → standards-XVSL5YAK.js} +2 -2
- package/dist/start_args-GQC6R2KX.js +4 -0
- package/dist/starting_prompt-NZKXVNC2.js +4 -0
- package/dist/stats-IVJ6DGTA.js +4 -0
- package/dist/{status-MUZPU2VT.js → status-IP5T3YPA.js} +2 -2
- package/dist/{stop-QYB6W4GK.js → stop-RGTE4JCC.js} +2 -2
- package/dist/{telepresence-HDNCXLWZ.js → telepresence-WSMD6D76.js} +2 -2
- package/dist/{test-S2VBYZLP.js → test-XCNK3UZG.js} +2 -2
- package/dist/{tokens-KJ5AERQN.js → tokens-ES3FVOJM.js} +2 -2
- package/dist/{up-DRYRRB7Q.js → up-NI6TNVH3.js} +3 -3
- package/dist/{v4-423YAJGU.js → v4-2VX2CBIA.js} +2 -2
- package/dist/wait_load-HJOIQVTW.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-VASWJFFX.js → workspace-Y2CLE7DM.js} +2 -2
- package/package.json +3 -3
- package/dist/chunk-4O5AVQ7C.js +0 -13
- package/dist/chunk-CQED4F7H.js +0 -110
- package/dist/chunk-CTJWIG5A.js +0 -4
- package/dist/clean-Q3TZOFUJ.js +0 -8
- package/dist/close_out-PTIPM3PK.js +0 -8
- package/dist/code-BUNUJ2W3.js +0 -4
- package/dist/fixture-O4H4JIDN.js +0 -14
- package/dist/hooks-CHQKWPBJ.js +0 -4
- package/dist/infra-WSY5I6LI.js +0 -4
- package/dist/init_workspace-XSBDBCPS.js +0 -4
- package/dist/list_workspaces-UEFLKGMV.js +0 -7
- package/dist/logs-F4HLXLKU.js +0 -6
- package/dist/notes-JSKGX7FI.js +0 -4
- package/dist/pause-AGHXL5N4.js +0 -4
- package/dist/pr-D4WAT3SU.js +0 -5
- package/dist/proxy_reload-EVVA6LYX.js +0 -6
- package/dist/remove-4GVSAUYM.js +0 -7
- package/dist/remove_workspace-3QKG4ABK.js +0 -8
- package/dist/restart-WIFG35JS.js +0 -8
- package/dist/resume-I5RZUXQH.js +0 -8
- package/dist/skills-XGBM3JUR.js +0 -4
- package/dist/start_args-2YSDLIRJ.js +0 -4
- package/dist/starting_prompt-XMTWFIBE.js +0 -4
- package/dist/stats-EGB4LTTY.js +0 -4
- package/dist/wait_load-4PH7CAO4.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-KNPK5NCZ.js";import"./chunk-JXKPSODN.js";import"./chunk-WKXBV7DF.js";import"./chunk-73TW2WJJ.js";import"./chunk-NJ5TYAXZ.js";import"./chunk-WRNA4NF3.js";import"./chunk-6GHL46O6.js";import"./chunk-T4WAAV7G.js";import"./chunk-JUY35LCT.js";import"./chunk-5YMMXIXJ.js";import"./chunk-7MSLZTTK.js";import"./chunk-MYL3NDG5.js";import"./chunk-QTEV75OD.js";import"./chunk-72GDJSLI.js";import"./chunk-WEUNR7XZ.js";import"./chunk-BISSN2O3.js";import"./chunk-66MITC5V.js";import"./chunk-SZL3VDBG.js";import{A as h,B as w,H as b,K as y,P as k,v as f,w as $}from"./chunk-OQJUDYGN.js";import"./chunk-MXKSIM3S.js";import"./chunk-B6D7CSHG.js";import"./chunk-3DUSX5P7.js";import"./chunk-FGA47ZU7.js";import{o as d}from"./chunk-BOIIVFVD.js";import"./chunk-N667SZQA.js";import"./chunk-DU32YNDK.js";import"./chunk-7P6T7FUL.js";import"./chunk-LNSRYF2J.js";import"./chunk-BEUUGV73.js";import"./chunk-RALGVL7W.js";import"./chunk-CTCXMTDL.js";import"./chunk-IOJGQSF4.js";import{a as c,f as g}from"./chunk-LV4UESBO.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-PT3VF26C.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-UFD2WSA2.js";import{c as s}from"./chunk-WRNA4NF3.js";import"./chunk-WEUNR7XZ.js";import"./chunk-MXKSIM3S.js";import"./chunk-3DUSX5P7.js";import"./chunk-RALGVL7W.js";import{h as e,l as c}from"./chunk-CTCXMTDL.js";import"./chunk-IOJGQSF4.js";import{a as r,f as i}from"./chunk-LV4UESBO.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-NH5PTL64.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-BEUUGV73.js";import{a as j,h as B,j as b,m as x,n as S}from"./chunk-CTCXMTDL.js";import{b as I}from"./chunk-IOJGQSF4.js";import{a as i,e as L,f as F}from"./chunk-LV4UESBO.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-SQ6BCVH3.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-2KNFKILM.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 $,b as I}from"./chunk-
|
|
3
|
+
import{a as $,b as I}from"./chunk-RALGVL7W.js";import{s as T,t as C}from"./chunk-CTCXMTDL.js";import{a as r,f as E}from"./chunk-LV4UESBO.js";E();import{spawn as k}from"node:child_process";import{writeFileSync as B}from"node:fs";import g from"node:fs/promises";import h from"node:os";import m from"node:path";import{stripVTControlCharacters as A}from"node:util";function z(t){return A(t)}r(z,"stripAnsi");async function J(t){try{return await g.access(t,g.constants.X_OK),!0}catch{return!1}}r(J,"isExecutable");async function Y(t){try{return(await g.stat(t)).isFile()}catch{return!1}}r(Y,"isFile");var M=["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR"];function O(t=process.env){return Object.fromEntries(Object.entries(t).filter(([e])=>!M.includes(e)))}r(O,"gitEnv");function D(){let t=[m.join(h.homedir(),".local","bin"),m.join(h.homedir(),".cargo","bin"),"/opt/homebrew/bin","/usr/local/bin","/usr/bin","/bin"],e=process.env.PATH?process.env.PATH.split(m.delimiter):[],o=[...new Set([...t,...e])].join(m.delimiter);return O({...process.env,PATH:o})}r(D,"childEnv");var y=r(()=>T("GH_BIN")||(C()?w("gh"):"gh"),"ghBin"),K=r(()=>process.env.CLAUDE_BIN||w("claude"),"fixtureClaudeBin"),Z=r(()=>process.env.CODEX_BIN||w("codex"),"fixtureCodexBin"),P=r(()=>T("DOCKER_BIN")||"docker","dockerBin");function x(t){return t==="gh"?y():t==="docker"?P():C()?t==="claude"?K():t==="kubectl"?w("kubectl"):t:t}r(x,"toolBin");var _=new Map;function w(t){let e=_.get(t);if(e)return e;let o=m.join(h.tmpdir(),`werkmeister-fixture-${t}-${process.pid}`);return B(o,`#!/bin/sh
|
|
4
4
|
echo "${t} called under WERKMEISTER_FIXTURE: $*" >&2
|
|
5
5
|
exit 1
|
|
6
6
|
`,{mode:493}),_.set(t,o),o}r(w,"fixtureStub");function tt(t,e,o=h.homedir()){return new Promise((i,u)=>{let n=k(x(t),e,{cwd:o,env:D(),stdio:["ignore","pipe","pipe"]}),c="",a="",p=setTimeout(()=>{n.kill("SIGKILL"),u(new I("The `claude` CLI timed out after 120s.",$))},12e4);n.stdout.on("data",s=>c+=s.toString()),n.stderr.on("data",s=>a+=s.toString()),n.on("error",s=>{clearTimeout(p),u(s)}),n.on("close",s=>{clearTimeout(p),i({stdout:c,stderr:a,code:s})})})}r(tt,"runCapture");function et(t){return`'${t.replace(/'/g,"'\\''")}'`}r(et,"shellQuote");E();import{spawn as G,spawnSync as U}from"node:child_process";var v=r((t,e)=>t[0]==="git"?O(e):e,"spawnEnv"),S=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,u="",n="",c){super(e),this.name="ProcError",this.cmd=o,this.status=i,this.stdout=u,this.stderr=n,this.code=c}};function ut(t,e={}){let o=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(o[0]="pipe");let i=U(x(t[0]),t.slice(1),{cwd:e.cwd,env:v(t,e.env),input:e.input,timeout:e.timeout!==void 0?S(e.timeout):void 0,encoding:"utf8",stdio:o}),u=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,u,n,"ETIMEDOUT"):a==="ENOENT"?new l(`Command not found: ${t[0]}`,t,-1,u,n,"ENOENT"):new l(`Command failed to start: ${t.join(" ")} (${i.error.message})`,t,i.status??-1,u,n,a)}let c=i.status??-1;if(e.check&&c!==0)throw new l(`Command failed with exit code ${c}: ${t.join(" ")}`,t,c,u,n);return{status:c,stdout:u,stderr:n}}r(ut,"run");function ct(t,e={}){return new Promise((o,i)=>{let u=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(u[0]="pipe");let n=G(x(t[0]),t.slice(1),{cwd:e.cwd,env:v(t,e.env),stdio:u,signal:e.signal,timeout:e.timeout!==void 0?S(e.timeout):void 0}),c="",a="";n.stdout?.on("data",d=>c+=d.toString()),n.stderr?.on("data",d=>a+=d.toString()),e.input!==void 0&&n.stdin?.end(e.input);let p=!1,s=r((d,f,b)=>{p||(p=!0,i(new l(d,t,f,c,a,b)))},"fail"),N=r(d=>{p||(p=!0,o({status:d,stdout:c,stderr:a}))},"done"),R=r(()=>e.signal?.aborted===!0,"aborted");n.on("error",d=>{let f=d.code;if(R()){s(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(f==="ENOENT"){s(`Command not found: ${t[0]}`,-1,"ENOENT");return}s(`Command failed to start: ${t.join(" ")} (${d.message})`,-1,f)}),n.on("close",d=>{if(R()){s(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(n.killed&&e.timeout!==void 0){s(`Command timed out after ${e.timeout}s: ${t.join(" ")}`,-1,"ETIMEDOUT");return}let f=d??-1;if(e.check&&f!==0){s(`Command failed with exit code ${f}: ${t.join(" ")}`,f);return}N(f)})})}r(ct,"runAsync");export{z as a,J as b,Y as c,O as d,D as e,y as f,K as g,Z as h,x as i,tt as j,et as k,l,ut as m,ct as n};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-3DUSX5P7.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-2KNFKILM.js";import{m as n}from"./chunk-CTCXMTDL.js";import{b as m}from"./chunk-IOJGQSF4.js";import{a as s,f as p}from"./chunk-LV4UESBO.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-4IPVX536.js.map
|