werkmeister 0.93.8 → 0.93.10
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-25FAUSGU.js → budget-HSTEGPDR.js} +2 -2
- package/dist/{cache-IGMYSSBW.js → cache-CIXFTDEX.js} +2 -2
- package/dist/{chunk-NI7UBGII.js → chunk-2GQA7JUY.js} +2 -2
- package/dist/{chunk-M6MBSXNM.js → chunk-2PVTCOM6.js} +2 -2
- package/dist/{chunk-7A5VOHL6.js → chunk-2QSUSKII.js} +2 -2
- package/dist/{chunk-N7VAKCJU.js → chunk-37KUQHL3.js} +2 -2
- package/dist/{chunk-PQZGPPAV.js → chunk-3FGITEDP.js} +2 -2
- package/dist/{chunk-FS6BSTZL.js → chunk-4JHC7DSH.js} +2 -2
- package/dist/{chunk-RPXPE5UJ.js → chunk-4JPK73CF.js} +2 -2
- package/dist/{chunk-YV3ALAIY.js → chunk-4QBRLKTU.js} +5 -5
- package/dist/{chunk-ZCXV2LTD.js → chunk-4WV6U2CY.js} +2 -2
- package/dist/{chunk-W75MXGXH.js → chunk-5QQEHHQ6.js} +2 -2
- package/dist/{chunk-GY37I33L.js → chunk-7GJUGGJF.js} +47 -45
- package/dist/{chunk-HXXC7TNS.js → chunk-APBHMMY6.js} +2 -2
- package/dist/chunk-AUNQG3C2.js +146 -0
- package/dist/{chunk-YVEZLQTI.js → chunk-B7VTELG4.js} +2 -2
- package/dist/{chunk-HSU2IK2O.js → chunk-BPVFCAFY.js} +2 -2
- package/dist/{chunk-BQTCRMG7.js → chunk-C4SCFUZZ.js} +2 -2
- package/dist/{chunk-N2FE3I4W.js → chunk-CXQAS2YU.js} +2 -2
- package/dist/{chunk-4AQPQQMU.js → chunk-D5FDVMAB.js} +3 -3
- package/dist/{chunk-36MMYWCU.js → chunk-D5PMKZD7.js} +2 -2
- package/dist/{chunk-EKQOI5MT.js → chunk-DQQGJ6GC.js} +2 -2
- package/dist/{chunk-CCDWJV2H.js → chunk-EXQRYVZO.js} +19 -19
- package/dist/{chunk-7YB3EVDN.js → chunk-FCGVXIU5.js} +2 -2
- package/dist/{chunk-KJ7NGCEB.js → chunk-FFSRIJNO.js} +2 -2
- package/dist/{chunk-LPLBVPO5.js → chunk-FL324RDG.js} +2 -2
- package/dist/{chunk-YDGBYPGW.js → chunk-FZKM57QD.js} +2 -2
- package/dist/{chunk-PGGYNB7O.js → chunk-GCFPHBXJ.js} +2 -2
- package/dist/{chunk-WNQPLDEI.js → chunk-GWVWLRGZ.js} +2 -2
- package/dist/{chunk-G6EOM6QS.js → chunk-HHO6VXSA.js} +2 -2
- package/dist/{chunk-TB4F2GWS.js → chunk-I3VEA4VU.js} +8 -8
- package/dist/{chunk-5BENDK5Z.js → chunk-IQPBDKNS.js} +2 -2
- package/dist/{chunk-GX24OKSW.js → chunk-JA5GY2LZ.js} +12 -12
- package/dist/{chunk-NN6Y3JUA.js → chunk-JGACW6RN.js} +2 -2
- package/dist/{chunk-Q6J4AWTS.js → chunk-K24AQXV5.js} +2 -2
- package/dist/{chunk-H7CFYXHA.js → chunk-KMOZK7TN.js} +2 -2
- package/dist/{chunk-M2BGN6KP.js → chunk-L55J3AVO.js} +2 -2
- package/dist/{chunk-DRLTATGP.js → chunk-LDCJQ5GQ.js} +2 -2
- package/dist/{chunk-5B5S623P.js → chunk-LE4QAEB6.js} +2 -2
- package/dist/{chunk-A7XCFYRC.js → chunk-LOYCZHYT.js} +2 -2
- package/dist/{chunk-OXF7YCZ4.js → chunk-MB53PNWA.js} +2 -2
- package/dist/{chunk-UB3UXHVI.js → chunk-MPTNMTZD.js} +2 -2
- package/dist/{chunk-LXAHT3FP.js → chunk-NKT3I4CG.js} +2 -2
- package/dist/{chunk-4ETPZVPP.js → chunk-OAEGXHIU.js} +2 -2
- package/dist/{chunk-Y57X2CE4.js → chunk-ODKCRYHH.js} +2 -2
- package/dist/chunk-OJPF2XIZ.js +4 -0
- package/dist/{chunk-JVKKF2TJ.js → chunk-OKDJRFLY.js} +2 -2
- package/dist/{chunk-I623AHJB.js → chunk-PM3NIMGI.js} +3 -3
- package/dist/{chunk-URJIJBKQ.js → chunk-PY2P7A3A.js} +2 -2
- package/dist/{chunk-FHKQSAOE.js → chunk-PZUT7CWJ.js} +2 -2
- package/dist/{chunk-FAGGMKLP.js → chunk-QN2T3PRU.js} +2 -2
- package/dist/{chunk-CAROO44F.js → chunk-S6NLVDZC.js} +2 -2
- package/dist/chunk-SQ57MYZ3.js +84 -0
- package/dist/{chunk-GCWDSCKO.js → chunk-TB6KBZIS.js} +2 -2
- package/dist/{chunk-QNSISZPI.js → chunk-TKTD5FTV.js} +2 -2
- package/dist/{chunk-4DE4JJVU.js → chunk-TOFFWZZ5.js} +2 -2
- package/dist/{chunk-MM6QPCKB.js → chunk-TTOLK6A4.js} +2 -2
- package/dist/{chunk-3JY3LPRL.js → chunk-UCJBLM7O.js} +3 -3
- package/dist/{chunk-SWMXTQML.js → chunk-UCOEC7UD.js} +2 -2
- package/dist/{chunk-3EUOTP7I.js → chunk-V4ASX7DZ.js} +2 -2
- package/dist/{chunk-HBY47W2F.js → chunk-VFMYAWLQ.js} +7 -7
- package/dist/{chunk-2GTJQHCP.js → chunk-VRH75IHQ.js} +2 -2
- package/dist/{chunk-PJT7WAVM.js → chunk-VUNTMEWU.js} +2 -2
- package/dist/{chunk-5RABOZIE.js → chunk-XMKQ4EEW.js} +2 -2
- package/dist/{chunk-KQCDLBKE.js → chunk-ZKQR2MXD.js} +2 -2
- package/dist/{chunk-FH5PO2PR.js → chunk-ZNYXKL2M.js} +2 -2
- package/dist/{chunk-RAPROCIP.js → chunk-ZPPWGDQJ.js} +2 -2
- package/dist/clean-FFFCAOJI.js +8 -0
- package/dist/close_out-2L3SYKNH.js +8 -0
- package/dist/code-N6KCQ4DU.js +4 -0
- package/dist/{config-GNQ3YYF4.js → config-5VG4QJBH.js} +2 -2
- package/dist/{connect-UGLXRZ4M.js → connect-OL2OKUBC.js} +2 -2
- package/dist/{daemon-BWDNB46L.js → daemon-JO3AARYE.js} +2 -2
- package/dist/dashboard.js +4 -4
- package/dist/{detect-6ZHLAVSB.js → detect-R4QY2DON.js} +2 -2
- package/dist/{down-ANORSCYD.js → down-6DUQNRQS.js} +3 -3
- package/dist/{fixture-EOKTZR7O.js → fixture-HM3PPVLF.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-CS75J2KP.js +4 -0
- package/dist/hooks_gen-FPEB2JHY.js +4 -0
- package/dist/infra-E76DC55G.js +4 -0
- package/dist/init_workspace-5FULMAUH.js +4 -0
- package/dist/{intercept-C4P6X44J.js → intercept-KO3XY5UY.js} +2 -2
- package/dist/{issue-CB4N5QDT.js → issue-5X6HDAH6.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-CHEMFYAI.js +7 -0
- package/dist/logs-MTC37E5Y.js +6 -0
- package/dist/main.js +3 -3
- package/dist/mcp-proxy.js +1 -1
- package/dist/mcp.js +6 -6
- package/dist/{migrate-SJXCOEVJ.js → migrate-FL54SYUZ.js} +3 -3
- package/dist/notes-HTKRM4GX.js +4 -0
- package/dist/{open-HVLO434G.js → open-VZTP627R.js} +2 -2
- package/dist/{optimize-MAHLCKNY.js → optimize-BUHLDLQE.js} +2 -2
- package/dist/pause-UZABNQ47.js +4 -0
- package/dist/pr-PYGXI7TY.js +5 -0
- package/dist/proxy_reload-GKOAQZFI.js +6 -0
- package/dist/{registry-RDDPX7FK.js → registry-VRONZHPB.js} +2 -2
- package/dist/remove-62QNI447.js +7 -0
- package/dist/remove_workspace-APLBX5PS.js +8 -0
- package/dist/restart-G6NBB4F5.js +8 -0
- package/dist/resume-KJ4SBGQR.js +8 -0
- package/dist/{safari-U2FZOZ5B.js → safari-HCER5JY4.js} +2 -2
- package/dist/{sandbox-2RGQHQ4C.js → sandbox-FH6TGXWP.js} +2 -2
- package/dist/{services-HY3ZKF3R.js → services-APWDYQX2.js} +2 -2
- package/dist/{setup-LFJD4NJE.js → setup-JVI2PU5H.js} +3 -3
- package/dist/skills-2B73I45W.js +4 -0
- package/dist/{slots-3JS6JWLN.js → slots-JR2N7UEO.js} +2 -2
- package/dist/{standards-GA3XZTXU.js → standards-6Y5TRWQA.js} +2 -2
- package/dist/start_args-524V4VKT.js +4 -0
- package/dist/starting_prompt-5PTF3XRY.js +4 -0
- package/dist/stats-KPUJZYIS.js +4 -0
- package/dist/{status-57ZQFVUK.js → status-TXASWUY2.js} +2 -2
- package/dist/{stop-TPBIZG35.js → stop-XGCZGEVZ.js} +2 -2
- package/dist/{telepresence-XWBRQS4V.js → telepresence-I6BJ725Y.js} +2 -2
- package/dist/{test-RIOAWNUY.js → test-NVMGHX5X.js} +2 -2
- package/dist/{tokens-X5AUHCF6.js → tokens-JQE424WZ.js} +2 -2
- package/dist/{up-NKWW4PUN.js → up-AOY6UIZ4.js} +3 -3
- package/dist/{v4-72JPNI6O.js → v4-P54ZZNSP.js} +2 -2
- package/dist/wait_load-RDXCRBEP.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-ITP6TW2T.js → workspace-MPAZKZMT.js} +2 -2
- package/package.json +3 -3
- package/dist/chunk-H5BN6X2C.js +0 -4
- package/dist/chunk-ONCXGEPI.js +0 -84
- package/dist/chunk-PFN33PWX.js +0 -146
- package/dist/clean-YDHC674C.js +0 -8
- package/dist/close_out-MZOTFVBO.js +0 -8
- package/dist/code-SKAKZHS4.js +0 -4
- package/dist/hooks-ERENZPT4.js +0 -4
- package/dist/hooks_gen-JZ34HP32.js +0 -4
- package/dist/infra-PKXRBXU3.js +0 -4
- package/dist/init_workspace-OIB57G26.js +0 -4
- package/dist/list_workspaces-J7PDPCAS.js +0 -7
- package/dist/logs-C5XMF5XB.js +0 -6
- package/dist/notes-SQIYBTZ5.js +0 -4
- package/dist/pause-BYT3XABX.js +0 -4
- package/dist/pr-KALXAXRM.js +0 -5
- package/dist/proxy_reload-EM4K7A7W.js +0 -6
- package/dist/remove-GKQ5MK4J.js +0 -7
- package/dist/remove_workspace-B7HWRS75.js +0 -8
- package/dist/restart-WBULTJY5.js +0 -8
- package/dist/resume-3K3GDEBJ.js +0 -8
- package/dist/skills-SYDK662Y.js +0 -4
- package/dist/start_args-I2LZACEJ.js +0 -4
- package/dist/starting_prompt-MNS7GWS2.js +0 -4
- package/dist/stats-GITE6A3I.js +0 -4
- package/dist/wait_load-IWWC5UFD.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-JA5GY2LZ.js";import"./chunk-B7VTELG4.js";import"./chunk-I3VEA4VU.js";import"./chunk-GCFPHBXJ.js";import"./chunk-OKDJRFLY.js";import"./chunk-7GJUGGJF.js";import"./chunk-AUNQG3C2.js";import"./chunk-FFSRIJNO.js";import"./chunk-C4SCFUZZ.js";import"./chunk-V4ASX7DZ.js";import"./chunk-K24AQXV5.js";import"./chunk-PZUT7CWJ.js";import"./chunk-TB6KBZIS.js";import"./chunk-CXQAS2YU.js";import"./chunk-UCJBLM7O.js";import"./chunk-SQ57MYZ3.js";import"./chunk-JGACW6RN.js";import"./chunk-ODKCRYHH.js";import{B as h,C as w,I as b,L as y,Q as k,v as f,w as $}from"./chunk-DQQGJ6GC.js";import"./chunk-TOFFWZZ5.js";import"./chunk-QN2T3PRU.js";import"./chunk-4JPK73CF.js";import"./chunk-OAEGXHIU.js";import{p as d}from"./chunk-4JHC7DSH.js";import"./chunk-3FGITEDP.js";import"./chunk-LOYCZHYT.js";import"./chunk-UCOEC7UD.js";import"./chunk-FL324RDG.js";import"./chunk-37KUQHL3.js";import"./chunk-XMKQ4EEW.js";import"./chunk-ZPPWGDQJ.js";import{a as c,f as g}from"./chunk-FCGVXIU5.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-HSTEGPDR.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-OJPF2XIZ.js";import{d as s}from"./chunk-V4ASX7DZ.js";import"./chunk-CXQAS2YU.js";import"./chunk-TOFFWZZ5.js";import"./chunk-4JPK73CF.js";import"./chunk-37KUQHL3.js";import{h as e,l as c}from"./chunk-XMKQ4EEW.js";import"./chunk-ZPPWGDQJ.js";import{a as r,f as i}from"./chunk-FCGVXIU5.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-CIXFTDEX.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{b as f}from"./chunk-
|
|
3
|
+
import{b as f}from"./chunk-APBHMMY6.js";import{s as c}from"./chunk-JA5GY2LZ.js";import{b as u}from"./chunk-37KUQHL3.js";import{h as o,j as a,m as n}from"./chunk-XMKQ4EEW.js";import{a as s,f as i}from"./chunk-FCGVXIU5.js";i();function m(r,e){let t=r.feature||f(process.cwd()).FEATURE;return t||(n("Feature name required: pass it as an argument or set FEATURE in a .env file."),process.exit(1)),t==="infra"&&(n(`${e} the infra stack is not supported: every workspace shares it.`),process.exit(1)),t}s(m,"featureArg");function p(r,e){throw r instanceof u&&e[r.code]&&(n(r.message),a(e[r.code]),process.exit(1)),r}s(p,"reportHint");async function l(r){let e=m(r,"Pausing");console.log(`
|
|
4
4
|
${o.BOLD}=== werkmeister pause: ${e} ===${o.RESET}
|
|
5
5
|
`);try{let{containers:t}=await c(e);console.log(`
|
|
6
6
|
${o.GREEN}${o.BOLD}Paused '${e}': ${t.length} container(s) frozen, its Claude session is held.${o.RESET} Resume with: werkmeister feature resume ${e}
|
|
7
7
|
`)}catch(t){p(t,{NOT_RUNNING:`Nothing to pause. Start it with: werkmeister feature up ${e}`,ALREADY_PAUSED:`Resume it with: werkmeister feature resume ${e}`,NO_WORKSPACE:"Run it from the workspace folder, or check: werkmeister workspace list",COMPOSE_PAUSE_FAILED:`Undo what did freeze with: werkmeister feature resume ${e}`})}}s(l,"run");export{m as a,p as b,l as c};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-2GQA7JUY.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-PM3NIMGI.js";import{m as n}from"./chunk-XMKQ4EEW.js";import{b as m}from"./chunk-ZPPWGDQJ.js";import{a as s,f as p}from"./chunk-FCGVXIU5.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-2PVTCOM6.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 Gi}from"./chunk-
|
|
3
|
+
import{a as Gi}from"./chunk-BPVFCAFY.js";import{a as Gp,b as Wp}from"./chunk-TOFFWZZ5.js";import{a as Vp}from"./chunk-L55J3AVO.js";import{a as r,b as k,c as g,f as m}from"./chunk-FCGVXIU5.js";var mn=g((ty,Wi)=>{m();var Pe=1e3,Ie=Pe*60,Re=Ie*60,be=Re*24,Xp=be*7,Qp=be*365.25;Wi.exports=function(a,e){e=e||{};var n=typeof a;if(n==="string"&&a.length>0)return Kp(a);if(n==="number"&&isFinite(a))return e.long?Yp(a):Jp(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))};function Kp(a){if(a=String(a),!(a.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(e){var n=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return n*Qp;case"weeks":case"week":case"w":return n*Xp;case"days":case"day":case"d":return n*be;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Re;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ie;case"seconds":case"second":case"secs":case"sec":case"s":return n*Pe;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}r(Kp,"parse");function Jp(a){var e=Math.abs(a);return e>=be?Math.round(a/be)+"d":e>=Re?Math.round(a/Re)+"h":e>=Ie?Math.round(a/Ie)+"m":e>=Pe?Math.round(a/Pe)+"s":a+"ms"}r(Jp,"fmtShort");function Yp(a){var e=Math.abs(a);return e>=be?ya(a,e,be,"day"):e>=Re?ya(a,e,Re,"hour"):e>=Ie?ya(a,e,Ie,"minute"):e>=Pe?ya(a,e,Pe,"second"):a+" ms"}r(Yp,"fmtLong");function ya(a,e,n,i){var t=e>=n*1.5;return Math.round(a/n)+" "+i+(t?"s":"")}r(ya,"plural")});var vn=g((sy,Vi)=>{m();function Zp(a){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=t,n.enabled=c,n.humanize=mn(),n.destroy=p,Object.keys(a).forEach(u=>{n[u]=a[u]}),n.names=[],n.skips=[],n.formatters={};function e(u){let f=0;for(let d=0;d<u.length;d++)f=(f<<5)-f+u.charCodeAt(d),f|=0;return n.colors[Math.abs(f)%n.colors.length]}r(e,"selectColor"),n.selectColor=e;function n(u){let f,d=null,v,x;function h(...b){if(!h.enabled)return;let w=h,O=Number(new Date),S=O-(f||O);w.diff=S,w.prev=f,w.curr=O,f=O,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let T=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(A,_)=>{if(A==="%%")return"%";T++;let Y=n.formatters[_];if(typeof Y=="function"){let U=b[T];A=Y.call(w,U),b.splice(T,1),T--}return A}),n.formatArgs.call(w,b),(w.log||n.log).apply(w,b)}return r(h,"debug"),h.namespace=u,h.useColors=n.useColors(),h.color=n.selectColor(u),h.extend=i,h.destroy=n.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:r(()=>d!==null?d:(v!==n.namespaces&&(v=n.namespaces,x=n.enabled(u)),x),"get"),set:r(b=>{d=b},"set")}),typeof n.init=="function"&&n.init(h),h}r(n,"createDebug");function i(u,f){let d=n(this.namespace+(typeof f>"u"?":":f)+u);return d.log=this.log,d}r(i,"extend");function t(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?n.skips.push(d.slice(1)):n.names.push(d)}r(t,"enable");function o(u,f){let d=0,v=0,x=-1,h=0;for(;d<u.length;)if(v<f.length&&(f[v]===u[d]||f[v]==="*"))f[v]==="*"?(x=v,h=d,v++):(d++,v++);else if(x!==-1)v=x+1,h++,d=h;else return!1;for(;v<f.length&&f[v]==="*";)v++;return v===f.length}r(o,"matchesTemplate");function s(){let u=[...n.names,...n.skips.map(f=>"-"+f)].join(",");return n.enable(""),u}r(s,"disable");function c(u){for(let f of n.skips)if(o(u,f))return!1;for(let f of n.names)if(o(u,f))return!0;return!1}r(c,"enabled");function l(u){return u instanceof Error?u.stack||u.message:u}r(l,"coerce");function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r(p,"destroy"),n.enable(n.load()),n}r(Zp,"setup");Vi.exports=Zp});var Xi=g((H,ba)=>{m();H.formatArgs=au;H.save=nu;H.load=iu;H.useColors=eu;H.storage=tu();H.destroy=(()=>{let a=!1;return()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();H.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function eu(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let a;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}r(eu,"useColors");function au(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+ba.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;a.splice(1,0,e,"color: inherit");let n=0,i=0;a[0].replace(/%[a-zA-Z%]/g,t=>{t!=="%%"&&(n++,t==="%c"&&(i=n))}),a.splice(i,0,e)}r(au,"formatArgs");H.log=console.debug||console.log||(()=>{});function nu(a){try{a?H.storage.setItem("debug",a):H.storage.removeItem("debug")}catch{}}r(nu,"save");function iu(){let a;try{a=H.storage.getItem("debug")||H.storage.getItem("DEBUG")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}r(iu,"load");function tu(){try{return localStorage}catch{}}r(tu,"localstorage");ba.exports=vn()(H);var{formatters:ru}=ba.exports;ru.j=function(a){try{return JSON.stringify(a)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ki=g((dy,Qi)=>{"use strict";m();Qi.exports=(a,e=process.argv)=>{let n=a.startsWith("-")?"":a.length===1?"-":"--",i=e.indexOf(n+a),t=e.indexOf("--");return i!==-1&&(t===-1||i<t)}});var Zi=g((my,Yi)=>{"use strict";m();var ou=k("os"),Ji=k("tty"),W=Ki(),{env:z}=process,wa;W("no-color")||W("no-colors")||W("color=false")||W("color=never")?wa=0:(W("color")||W("colors")||W("color=true")||W("color=always"))&&(wa=1);function su(){if("FORCE_COLOR"in z)return z.FORCE_COLOR==="true"?1:z.FORCE_COLOR==="false"?0:z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(z.FORCE_COLOR,10),3)}r(su,"envForceColor");function cu(a){return a===0?!1:{level:a,hasBasic:!0,has256:a>=2,has16m:a>=3}}r(cu,"translateLevel");function pu(a,{streamIsTTY:e,sniffFlags:n=!0}={}){let i=su();i!==void 0&&(wa=i);let t=n?wa:i;if(t===0)return 0;if(n){if(W("color=16m")||W("color=full")||W("color=truecolor"))return 3;if(W("color=256"))return 2}if(a&&!e&&t===void 0)return 0;let o=t||0;if(z.TERM==="dumb")return o;if(process.platform==="win32"){let s=ou.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in z)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in z)||z.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(z.TEAMCITY_VERSION)?1:0;if(z.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in z){let s=Number.parseInt((z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(z.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(z.TERM)||"COLORTERM"in z?1:o}r(pu,"supportsColor");function xn(a,e={}){let n=pu(a,{streamIsTTY:a&&a.isTTY,...e});return cu(n)}r(xn,"getSupportLevel");Yi.exports={supportsColor:xn,stdout:xn({isTTY:Ji.isatty(1)}),stderr:xn({isTTY:Ji.isatty(2)})}});var at=g((L,ka)=>{m();var uu=k("tty"),Ea=k("util");L.init=hu;L.log=mu;L.formatArgs=du;L.save=vu;L.load=xu;L.useColors=lu;L.destroy=Ea.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");L.colors=[6,2,3,4,5,1];try{let a=Zi();a&&(a.stderr||a).level>=2&&(L.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}L.inspectOpts=Object.keys(process.env).filter(a=>/^debug_/i.test(a)).reduce((a,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(t,o)=>o.toUpperCase()),i=process.env[e];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),a[n]=i,a},{});function lu(){return"colors"in L.inspectOpts?!!L.inspectOpts.colors:uu.isatty(process.stderr.fd)}r(lu,"useColors");function du(a){let{namespace:e,useColors:n}=this;if(n){let i=this.color,t="\x1B[3"+(i<8?i:"8;5;"+i),o=` ${t};1m${e} \x1B[0m`;a[0]=o+a[0].split(`
|
|
4
4
|
`).join(`
|
|
5
5
|
`+o),a.push(t+"m+"+ka.exports.humanize(this.diff)+"\x1B[0m")}else a[0]=fu()+e+" "+a[0]}r(du,"formatArgs");function fu(){return L.inspectOpts.hideDate?"":new Date().toISOString()+" "}r(fu,"getDate");function mu(...a){return process.stderr.write(Ea.formatWithOptions(L.inspectOpts,...a)+`
|
|
6
6
|
`)}r(mu,"log");function vu(a){a?process.env.DEBUG=a:delete process.env.DEBUG}r(vu,"save");function xu(){return process.env.DEBUG}r(xu,"load");function hu(a){a.inspectOpts={};let e=Object.keys(L.inspectOpts);for(let n=0;n<e.length;n++)a.inspectOpts[e[n]]=L.inspectOpts[e[n]]}r(hu,"init");ka.exports=vn()(L);var{formatters:et}=ka.exports;et.o=function(a){return this.inspectOpts.colors=this.useColors,Ea.inspect(a,this.inspectOpts).split(`
|
|
@@ -407,4 +407,4 @@ express/index.js:
|
|
|
407
407
|
* MIT Licensed
|
|
408
408
|
*)
|
|
409
409
|
*/
|
|
410
|
-
//# sourceMappingURL=chunk-
|
|
410
|
+
//# sourceMappingURL=chunk-2QSUSKII.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as e,f as r}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as e,f as r}from"./chunk-FCGVXIU5.js";r();var p="WORKSPACE",t=class extends Error{static{e(this,"SandboxError")}code;constructor(s,n){super(s),this.code=n,this.name="SandboxError"}},o=class extends t{static{e(this,"WorkspaceError")}constructor(s){super(s,p),this.name="WorkspaceError"}};export{p as a,t as b,o as c};
|
|
4
|
+
//# sourceMappingURL=chunk-37KUQHL3.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as p,b as a}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as p,b as a}from"./chunk-ZPPWGDQJ.js";import{a as o,f as c}from"./chunk-FCGVXIU5.js";c();import*as i from"node:fs";import*as s from"node:path";function u(t){let e=s.resolve(t);for(;;){if(i.existsSync(s.join(a(e),"workspace.yml")))return e;let r=s.dirname(e);if(r===e)return null;e=r}}o(u,"findRecordRoot");function d(t){try{let e=i.readdirSync(s.join(t,"stages")).filter(n=>/^\d+_/.test(n)).sort(),r=e.find(n=>/^\d+_propose$/.test(n))??e.find(n=>/^\d+_ship$/.test(n))??e.at(-1);return r?`stages/${r}/output/`:"the last stage's output/"}catch{return`${s.basename(a(t))}/notes/`}}o(d,"prFileDirName");var f=/(?<!<)<<(?!<)-?\s*(['"]?)(\w+)\1([^\n]*)(?:\n(?:[\s\S]*?\n)?\t*\2(?=\n|$)|[\s\S]*$)/g,m=/'[^']*(?:'|$)|"(?:[^"\\]|\\[\s\S])*(?:"|$)/g,h=/(?:^|[;&|({\n`])\s*(?:(?:\w+=\S*|command|exec|env|then|do|else)\s+)*gh\s+pr\s+create\b/,R=/create_pull_request$/;function y(t){return h.test(t.replace(f,"$3").replace(m,"_"))}o(y,"opensPr");function S(t){return["_shared/pr-rules.md",`${p}/pr-rules.md`].find(e=>i.existsSync(s.join(t,e)))??"docs/workspace-lifecycle.md in the werkmeister repo"}o(S,"prRulesPath");function _(t){let e=u(String(t.cwd||process.cwd()));if(!e)return null;let r=String(t.tool_name||""),n=String(t.tool_input?.command||"");if(!(r==="Bash"&&y(n)||R.test(r)))return null;let l=S(e);return`Inside workspace \`${s.basename(e)}\`, PRs open only through \`werkmeister pr open\`: it runs the pre-PR gate and records the URL. Write the PR file in \`${d(e)}\`, have the person set \`status: approved\`, then run \`werkmeister pr open\`. Rules: \`${l}\`.`}o(_,"decide");function w(){let t=null;try{let e=process.stdin.isTTY?"":i.readFileSync(0,"utf8"),r=e.trim()?JSON.parse(e):{};typeof r=="object"&&r!==null&&!Array.isArray(r)&&(t=_(r))}catch{t=null}t&&console.log(JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:t}}))}o(w,"main");export{u as a,S as b,w as c};
|
|
4
|
+
//# sourceMappingURL=chunk-3FGITEDP.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-3FGITEDP.js";import{w as $}from"./chunk-XMKQ4EEW.js";import{b as h}from"./chunk-ZPPWGDQJ.js";import{a as r,f as _}from"./chunk-FCGVXIU5.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-PQZGPPAV.js";import{w as $}from"./chunk-5RABOZIE.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-4JHC7DSH.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-37KUQHL3.js";import{s as C,t as g}from"./chunk-XMKQ4EEW.js";import{a as r,f as h}from"./chunk-FCGVXIU5.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-4JPK73CF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{d as rt}from"./chunk-
|
|
3
|
+
import{d as rt}from"./chunk-TKTD5FTV.js";import{a as Xe,b as M,c as Ze,e as et,g as tt}from"./chunk-VFMYAWLQ.js";import{d as Qe,o as qe}from"./chunk-I3VEA4VU.js";import{b as ze,c as ce,g as ae,h as Je,i as fe,j as Ye}from"./chunk-GCFPHBXJ.js";import{r as se,s as ie,u as Ke}from"./chunk-7GJUGGJF.js";import{c as ne,d as Pe}from"./chunk-AUNQG3C2.js";import{c as Te}from"./chunk-K24AQXV5.js";import{n as Oe}from"./chunk-PZUT7CWJ.js";import{h as je}from"./chunk-TB6KBZIS.js";import{k as Ae}from"./chunk-CXQAS2YU.js";import{A as Ne,B as Fe,G as te,H as Me,J as z,L as re,O as Ue,S as Le,T as oe,i as We,o as j,p as Ie,x as De,z as ee}from"./chunk-UCJBLM7O.js";import{b as He,e as Be,g as Ve}from"./chunk-DQQGJ6GC.js";import{a as B}from"./chunk-QN2T3PRU.js";import{m as K}from"./chunk-4JPK73CF.js";import{a as Ge}from"./chunk-OAEGXHIU.js";import{b as be}from"./chunk-LOYCZHYT.js";import{b as Re,c as Ce}from"./chunk-UCOEC7UD.js";import{o as _e,p as Z,s as xe}from"./chunk-FL324RDG.js";import{c as ve}from"./chunk-37KUQHL3.js";import{G as X,M as Se,S as $e,T as Ee,a as Rt,h as A,j as k,k as y,l as g,m as V,n as F,o as ge,r as ye,s as q}from"./chunk-XMKQ4EEW.js";import{b as N}from"./chunk-ZPPWGDQJ.js";import{a as i,e as xt,f as C}from"./chunk-FCGVXIU5.js";C();import*as T from"node:fs";import*as J from"node:path";var ot=i(e=>J.join(N(e),"issue.md"),"issueCopyPath"),U=class extends Error{static{i(this,"IssueFetchError")}};async function nt(e,r=()=>new Date,o=j({text:e})){let t=await o.fetchIssue(e);if(!t)throw new U(`couldn't read ${e} from ${o.label}`);return{ref:t.ref,url:t.url??o.url(t.ref),tracker:o.id,title:t.title??"",status:t.status??"",body:t.description??"",comments:t.comments??[],fetchedAt:r().toISOString()}}i(nt,"fetchIssueSnapshot");var ue=`
|
|
4
4
|
|
|
5
5
|
## Comments
|
|
6
6
|
`;function Ct(e){let r=["---",`ref: ${e.ref}`,`url: ${e.url??""}`,`tracker: ${e.tracker}`,`status: ${e.status}`,`fetched: ${e.fetchedAt}`,"---","",`# ${e.title}`,"",e.body].join(`
|
|
@@ -25,12 +25,12 @@ ${t.body}
|
|
|
25
25
|
# ~/.werkmeister/services.yaml instead.
|
|
26
26
|
# Format: YAML \u2014 line comments (\`#\`) are supported. The loader also
|
|
27
27
|
# accepts legacy JSONC and JSON for back-compat.
|
|
28
|
-
`;function wt(e,r){if(Object.keys(r).length===0)return;let o=N(e),t=f.join(o,z[0]),s=z.slice(1).map(c=>f.join(o,c)),n={};for(let c of[t,...s])if(l.existsSync(c)&&l.statSync(c).isFile())try{let w=
|
|
29
|
-
The workspaces root comes from ~/.werkmeister/config.yaml \u2014 run \`werkmeister machine config --write\` to set it (or \`werkmeister machine config --check\` to verify).`+A.RESET)}i(Vt,"findWorkspaceRoot");function Kt(e){let r=[],o=e;for(;;){let t=f.dirname(o);if(t===o)break;r.push(t),o=t}return r}i(Kt,"ancestors");function St(e){let o=K(["git","-C",e,"branch","--show-current"],{capture:!0}).stdout.trim();return o||K(["git","-C",e,"rev-parse","--short","HEAD"],{capture:!0}).stdout.trim()||"unknown"}i(St,"getBranch");function $t(e){return je(e).map(r=>[f.basename(r),St(r)])}i($t,"discoverRepos");function zt(e){if(l.existsSync(f.join(e,".git"))){let r=St(e);if(r&&r!=="unknown")return r}return`${It()}/${f.basename(e)}`}i(zt,"workspaceBranch");function Jt(e,r,o){let t=X(),s=r.filter(u=>u!==M),n=new Set(s),m=new Set($t(e).map(([u])=>u)),a=s.filter(u=>!m.has(u)),d=[...m].filter(u=>!n.has(u)).sort(),c=s.filter(u=>f.basename(u)!==u||u==="."||u==="..");c.length&&S(`Repo name(s) must be a folder directly under ${t}: ${c.join(", ")}.`);let w=a.filter(u=>!Wt(f.join(t,u)));if(w.length&&S(`Source repo(s) not found under ${t}: ${w.join(", ")}. Clone them there (or fix \`repos\` in .werkmeister/workspace.yml) and rerun.`),d.length&&!o){let u=d.filter(h=>Je(f.join(e,h)));u.length&&S(`Refusing to remove worktree(s) with uncommitted changes: ${u.join(", ")}. Commit or stash them, or rerun with --force to discard them.`)}if(!a.length&&!d.length)return;let I=zt(e);for(let u of d){let[h,v]=fe(f.join(t,u),f.join(e,u),I);h?(y(`Removed worktree '${u}' (no longer in workspace.yml).`),v&&g(v)):S(`Could not remove worktree '${u}': ${v}`)}let x=[];try{for(let u of a){let h=f.join(t,u),v=f.join(e,u);ae(h,v,I,{force:o}),x.push([v,h])}}catch(u){let h=`Failed to create worktree: ${u.message}`;V(h),g("Rolling back worktrees created this run...");for(let[v,P]of[...x].reverse())fe(P,v,I);throw new R(h)}(a.length||d.length)&&y(`Worktrees reconciled (+${a.length} / -${d.length}).`)}i(Jt,"reconcileWorktrees");function Yt(e,r,o){if(e)return[e.trim(),{}];let t=o?.().trim();return t?[t,{}]:[
|
|
28
|
+
`;function wt(e,r){if(Object.keys(r).length===0)return;let o=N(e),t=f.join(o,z[0]),s=z.slice(1).map(c=>f.join(o,c)),n={};for(let c of[t,...s])if(l.existsSync(c)&&l.statSync(c).isFile())try{let w=Ne(c);if(typeof w=="object"&&w!==null&&!Array.isArray(w)){n=w;break}}catch{}delete n._generator,delete n.$schema;let m={...n};for(let[,,c]of Fe)if(c in r){let w=r[c];if(Dt.has(c)&&typeof w=="string"&&(w=Nt(w)),(c==="autonomous"||c==="auto_stop")&&(w=w==="true"),c==="auto_stop"&&w===!1&&!(c in n))continue;m[c]=w}let a=ht.stringify(m,{sortMapEntries:!0,blockQuote:"literal"}),d=Mt+a;if(!(l.existsSync(t)&&l.readFileSync(t,"utf8")===d)){l.mkdirSync(o,{recursive:!0}),l.writeFileSync(t,d),y(`Persisted inputs to ${t}`);for(let c of s)l.existsSync(c)&&(l.unlinkSync(c),k(`Removed legacy ${f.basename(c)} (superseded by workspace.yml)`))}}i(wt,"writeWorkspaceConfig");var Ut=/^[a-z0-9]+(-[a-z0-9]+)*$/;function Lt(e,r){let o=(e||"").trim().toLowerCase(),t=(r||"").trim().toLowerCase(),s=o===t||o.startsWith(`${t}-`);return t&&!s?`${t}-${o}`:o}i(Lt,"buildWorkspaceName");function Pt(e,r){return`${e}/${r}`}i(Pt,"buildBranchName");function kt(){return X()}i(kt,"resolveReposRoot");function gt(){let e=_e().workspaces_root;return e?f.resolve(ye(e)):f.resolve(f.join(W.homedir(),"workspace"))}i(gt,"resolveWorkspacesRoot");function Gt(e,r,o){let t=kt(),s=f.join(t,M);if(k(`Workspace: ${e}`),k(`Branch: ${r}`),l.existsSync(f.join(s,".git"))){let n=xe()||tt(),m=n?et(s,Ze(n)):null;m!==null&&S(`${s}'s origin is ${m||"unset"}, but the configured workspace repo is ${n} \u2014 this workspace's record would push to the wrong repo. Run \`werkmeister machine setup\` to repoint it, then rerun.`);try{ae(s,e,r,{force:o})}catch(a){S(`Failed to create workspace root worktree: ${a.message}`)}y(`Created workspace root (worktree of ${M}) at ${e}`)}else g(`No '${M}' repo at ${s} \u2014 workspace root will be a plain directory (no git history for notes/config).`),l.mkdirSync(e,{recursive:!0})}i(Gt,"createWorkspaceRoot");function Ht(e,r){Ye(e,`chore: initialize workspace ${r}`)&&y("Committed initial workspace state (branch not pushed \u2014 push when ready).")}i(Ht,"commitWorkspaceState");function yt(){for(let e of Oe({generatedOnly:!0}))e.ok?e.detail.startsWith("generated")&&k(`Registry: ${e.detail}`):g(`Registry not refreshed: ${e.detail}`)}i(yt,"refreshRegistry");async function Bt(e,r){let o=Se(),[t,s,n]=ce(e??null,r??null,o);return n.length&&S(`Unknown service(s): ${n.join(", ")}. See \`werkmeister feature services\` / config/services.yaml.`),!t.length&&!s.length&&S("No repos selected. Choose at least one service or repo in the wizard, or pass --services svc1,svc2 / --repos r1,r2."),t}i(Bt,"selectRepos");function Vt(){let e=f.resolve(process.cwd()),r=Ge(e,Z());if(r!==null)return r;for(let t of[e,...Kt(e)])if(l.existsSync(f.join(t,".git")))return f.dirname(t);let o=Z().join(", ");throw new de(`${A.RED}[err] Not inside a workspace (checked: ${o}) and no parent \`.git\` directory found.
|
|
29
|
+
The workspaces root comes from ~/.werkmeister/config.yaml \u2014 run \`werkmeister machine config --write\` to set it (or \`werkmeister machine config --check\` to verify).`+A.RESET)}i(Vt,"findWorkspaceRoot");function Kt(e){let r=[],o=e;for(;;){let t=f.dirname(o);if(t===o)break;r.push(t),o=t}return r}i(Kt,"ancestors");function St(e){let o=K(["git","-C",e,"branch","--show-current"],{capture:!0}).stdout.trim();return o||K(["git","-C",e,"rev-parse","--short","HEAD"],{capture:!0}).stdout.trim()||"unknown"}i(St,"getBranch");function $t(e){return je(e).map(r=>[f.basename(r),St(r)])}i($t,"discoverRepos");function zt(e){if(l.existsSync(f.join(e,".git"))){let r=St(e);if(r&&r!=="unknown")return r}return`${It()}/${f.basename(e)}`}i(zt,"workspaceBranch");function Jt(e,r,o){let t=X(),s=r.filter(u=>u!==M),n=new Set(s),m=new Set($t(e).map(([u])=>u)),a=s.filter(u=>!m.has(u)),d=[...m].filter(u=>!n.has(u)).sort(),c=s.filter(u=>f.basename(u)!==u||u==="."||u==="..");c.length&&S(`Repo name(s) must be a folder directly under ${t}: ${c.join(", ")}.`);let w=a.filter(u=>!Wt(f.join(t,u)));if(w.length&&S(`Source repo(s) not found under ${t}: ${w.join(", ")}. Clone them there (or fix \`repos\` in .werkmeister/workspace.yml) and rerun.`),d.length&&!o){let u=d.filter(h=>Je(f.join(e,h)));u.length&&S(`Refusing to remove worktree(s) with uncommitted changes: ${u.join(", ")}. Commit or stash them, or rerun with --force to discard them.`)}if(!a.length&&!d.length)return;let I=zt(e);for(let u of d){let[h,v]=fe(f.join(t,u),f.join(e,u),I);h?(y(`Removed worktree '${u}' (no longer in workspace.yml).`),v&&g(v)):S(`Could not remove worktree '${u}': ${v}`)}let x=[];try{for(let u of a){let h=f.join(t,u),v=f.join(e,u);ae(h,v,I,{force:o}),x.push([v,h])}}catch(u){let h=`Failed to create worktree: ${u.message}`;V(h),g("Rolling back worktrees created this run...");for(let[v,P]of[...x].reverse())fe(P,v,I);throw new R(h)}(a.length||d.length)&&y(`Worktrees reconciled (+${a.length} / -${d.length}).`)}i(Jt,"reconcileWorktrees");function Yt(e,r,o){if(e)return[e.trim(),{}];let t=o?.().trim();return t?[t,{}]:[Le(r),{}]}i(Yt,"resolveTask");function Qt(e){if(!l.existsSync(e))return;l.readFileSync(e,"utf8").includes("## Layout")?g("CLAUDE.md already initialised \u2014 overwriting with fresh content."):k("Replacing stub CLAUDE.md with full workspace context.")}i(Qt,"warnIfExisting");function qt(e,r){k(`Task: ${e}`);for(let[o,t]of[["FEATURE","Feature"],["SERVICES","Services"],["ISSUE_ID","Issue"],["TEST_PATH","Test path"]]){let s=r[o];s&&k(` ${(t+":").padEnd(10)} ${s}`)}}i(qt,"logMeta");async function Xt(e,r,o={}){let t=r??Vt(),s=f.basename(t);k(`Workspace root: ${t}`),yt();let n=Ue(e,t),m=se(ie(n.context_strategy));if(ne(n.harness),!Ft(t,e.config_file??null)&&!n.feature&&S("No .werkmeister/workspace.yml found and no --feature given. Run `werkmeister workspace new <name>` to create and initialise a workspace, then rerun `werkmeister workspace init` from inside it to reconcile changes."),te(n),n.model&&!Me(t)){let p=String(e.model||q("MODEL")||"").trim(),$=p?p!==n.model?` (${p} tier)`:"":` (${De().defaultTier} tier, default)`;k(`Model: ${n.model}${$}`)}wt(t,n);let d=n.project??"",c=n.issue_id?j({project:d,text:n.issue_id}).parseRef(n.issue_id)??n.issue_id:"",w;try{w=await Tt(t,c,{issue:o.issue,refresh:!!e.refresh_issue,project:d})}catch(p){throw p instanceof R&&S(p.message),p}if(n.repos){let[p]=oe(),[$,,O]=ce(n.repos,n.services,p);O.length&&g(`Unknown service(s) in workspace.yml (no owning repo): ${O.join(", ")}`),Jt(t,$,!!e.force)}let I=f.join(t,"CLAUDE.md");Qt(I),k("Scanning for git repos...");let x=$t(t);if(!x.length)g("No git repos found in workspace. CLAUDE.md will have an empty layout.");else{for(let[p,$]of x)k(` ${p}/ \u2192 ${$}`);ze(t,x.map(([p])=>p))}let[u,h]=Yt(n.task,s,o.readStdinTask),v={feature:"FEATURE",services:"SERVICES",issue_id:"ISSUE_ID",test_path:"TEST_PATH",description:"DESCRIPTION"};for(let[p,$]of Object.entries(v))p in n&&(h[$]=n[p]);qt(u,h);let P=f.join(t,".env");Qe(P,h),y(`Wrote ${P}`),y(`Wrote ${Te(t)}`),y(`Wrote ${rt(t)}`),m.init({workspaceRoot:t,workspaceName:s,repos:x,task:u,meta:h,inputs:n,configOverride:e.config??null,issue:w,isCreate:!!o.issue});for(let p of ee)p!==m.id&&Ke(t,se(p),m,!!e.prune_context);let[Et,vt]=oe(),Y=$e(),_t=Ae(x,h,Et,vt,Y),he=Ee();for(let p of mt(Y,he))g(p);let we=(h.FEATURE??"").trim(),ke=dt(t,lt(_t,Y),he,we?{FEATURE:we}:{});ke&&y(`Wrote ${ke}`),Ce(s,t),y(`Workspace token: ${f.relative(t,Re(t))}`);let Q=Pe(t).id;if(Q==="claude"){let p=ft({workspaceName:s,workspaceRoot:t,workspacesRoot:gt(),reposRoot:kt(),home:W.homedir(),port:be()});y(`Wrote ${f.relative(t,p)}`)}else ut(t)&&k(`Removed the generated ${L} (harness: ${Q})`),k(`No ${L}: the generated one runs Claude Code, not ${Q}`);for(let p of Xe())g(p);let G=(h.FEATURE??"").trim(),H=!0;if(G){let p=await qe(G,h.SERVICES??"",t,(h.TEST_PATH??"").trim(),x.map(([$])=>$));if(H=p!==null,p!==null&&o.build!==!1){k("Building Docker images (--no-start)...");let $=ge(),O=f.join(t,B);Ve(O),Be(G,O);let D=K(He(G,["up","--build","--no-start"],O),{cwd:t,...$?{stdio:"inherit"}:{capture:!0}});$||(D.stdout&&F(D.stdout),D.stderr&&F(D.stderr,"stderr")),D.status===0?y("Docker images built successfully."):g("docker compose build exited non-zero \u2014 images may be incomplete.")}}return H?(F(`
|
|
30
30
|
${A.BOLD}Workspace initialised.${A.RESET} Open a new Claude Code session from the workspace root to pick up the context.
|
|
31
31
|
|
|
32
|
-
`),{containers:H}):(g(`Workspace initialised, but the container step did not run: no slot, so ${B} was not (re)generated (see the slot warning above). \`werkmeister feature up\` fails until you free a slot and rerun \`werkmeister workspace init\`.`),{containers:H})}i(Xt,"initWorkspace");async function Zt(e,r,o,t){k(`Running: werkmeister workspace init (feature: ${r})`);try{return await Xt({...o,feature:r,force:t.force},e,t)}catch(s){return s instanceof R||V(`init-workspace failed: ${s.message}`),null}}i(Zt,"runInitWorkspace");async function Lr(e,r={}){let o=(e.feature??"").trim();o||S("A feature name is required (pass it as an argument, set it in ./.werkmeister/workspace.yml, or run interactively)."),ie(e.context_strategy),ne(e.harness);let t=o.toLowerCase();try{let c=
|
|
32
|
+
`),{containers:H}):(g(`Workspace initialised, but the container step did not run: no slot, so ${B} was not (re)generated (see the slot warning above). \`werkmeister feature up\` fails until you free a slot and rerun \`werkmeister workspace init\`.`),{containers:H})}i(Xt,"initWorkspace");async function Zt(e,r,o,t){k(`Running: werkmeister workspace init (feature: ${r})`);try{return await Xt({...o,feature:r,force:t.force},e,t)}catch(s){return s instanceof R||V(`init-workspace failed: ${s.message}`),null}}i(Zt,"runInitWorkspace");async function Lr(e,r={}){let o=(e.feature??"").trim();o||S("A feature name is required (pass it as an argument, set it in ./.werkmeister/workspace.yml, or run interactively)."),ie(e.context_strategy),ne(e.harness);let t=o.toLowerCase();try{let c=Ie(e.issue_id??"",e.project);c&&(e.project=c.name)}catch(c){S(c.message)}let s=j({project:e.project,text:e.issue_id});e.issue_id&&(e.issue_id=s.parseRef(e.issue_id)??e.issue_id);let n=Lt(o,e.issue_id?s.slug(e.issue_id):null);Ut.test(n)||S(`Workspace name '${n}' is not a valid slug (expected lowercase letters, digits, and single hyphens).`);let m=Pt(W.userInfo().username,n),a=f.join(gt(),n);if(l.existsSync(a))k(`Workspace already exists: ${a} \u2014 re-running init-workspace.`);else{te({...e}),yt();let c=await Bt(e.repos,e.services);e.repos=c.join(","),Gt(a,m,!!r.force),e.context_strategy||=ee[0],e.harness||=We[0],wt(a,e)}let d=await Zt(a,t,e,r);if(!d){let c=`werkmeister workspace init failed. The workspace root exists at ${a}; re-run \`werkmeister workspace init\` from there once resolved.`;throw g(c),new R(c)}return Ht(a,n),d.containers?(F(`
|
|
33
33
|
${A.BOLD}Workspace ready.${A.RESET} cd ${a} and open a Claude Code session from there.
|
|
34
34
|
|
|
35
35
|
`),a):(g(`Workspace created at ${a}, but its containers are not set up: it has no slot (see the slot warning above). Free a slot with \`werkmeister feature down <feature>\`, then run \`werkmeister workspace init\` there.`),a)}i(Lr,"provisionWorkspace");export{U as a,nt as b,R as c,de as d,wt as e,Xt as f,Lr as g};
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-4QBRLKTU.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as n,f as o}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as n,f as o}from"./chunk-FCGVXIU5.js";o();function u(t){return t.listenerCount("SIGINT")>1}n(u,"claimed");var r=new AbortController;function s(){return r.signal}n(s,"interruptSignal");function d(t=process,i=()=>{},l=e=>process.exit(e)){let e=!1;r=new AbortController,t.on("SIGINT",()=>{if(r.abort(),u(t)&&!e){e=!0;return}i(),l(130)})}n(d,"installDefaultInterrupt");export{s as a,d as b};
|
|
4
|
+
//# sourceMappingURL=chunk-4WV6U2CY.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{f as $,t as B,u as F,w as _}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{f as $,t as B,u as F,w as _}from"./chunk-TTOLK6A4.js";import{b as D,d as N}from"./chunk-B7VTELG4.js";import{d as E,o as T}from"./chunk-OKDJRFLY.js";import{f as O}from"./chunk-MB53PNWA.js";import{c as k}from"./chunk-V4ASX7DZ.js";import{Q as A,W as C,ba as y,ca as I,d as R,s as j,t as P}from"./chunk-DQQGJ6GC.js";import{d as v}from"./chunk-TOFFWZZ5.js";import{M as w}from"./chunk-XMKQ4EEW.js";import{a,f as x}from"./chunk-FCGVXIU5.js";x();async function M(){return(await v(E,void 0,{all:!1})??[]).map(({service:e,state:n,health:r})=>{let s;return r==="healthy"?s="healthy":r==="starting"?s="starting":n==="running"?s="running":s=n||"down",{service:e||"unknown",display:s}})}a(M,"getInfraStatus");function Q(t){if(typeof t=="number"){let[e,n]=I(t);return`${e}-${n}`}return"?"}a(Q,"featurePortRange");function U(t){return P(t.service,t.role)&&t.status==="exited"&&t.exitCode===0}a(U,"finishedSetup");function V(t){return t.filter(e=>!U(e))}a(V,"tallied");function H(t){return Object.entries(t).sort((e,n)=>{let r=typeof e[1].slot=="number"?e[1].slot:99,s=typeof n[1].slot=="number"?n[1].slot:99;return r-s})}a(H,"sortedSlots");function J(t,e,n){let r=[];for(let[s,f]of H(t))for(let l of f.services??[]){let u=e[l],p=B(u),c=p===null?String(u.k8s_deployment):null,i=c!==null?n.intercepts.get(c):void 0;r.push({feature:s,service:l,deployment:c,interceptable:p===null,blocker:p,intercepted:i!==void 0,intercepted_by:i??null})}return r}a(J,"buildInterceptRows");var L=a(t=>$(t,void 0,15),"STATUS_READ");async function ot(){let t=await _(L),e=w(),n=t.installed?J(await y(),e,t):[];return{available:t.available,installed:t.installed,connected_namespace:t.namespace,intercepts:n,remote_services:Object.keys(e).filter(r=>F(e[r])).sort()}}a(ot,"interceptsSnapshot");async function W(){let[t,e]=await Promise.all([v().then(n=>D(n??[])),N().catch(()=>null)]);return{health:t,resources:e}}a(W,"featureVitals");async function at(){let t=W(),e=k().catch(()=>[]),n=await M(),r=await T(),s=await y(),f=await O(),l=await _(L),u=J(s,w(),l),{health:p,resources:c}=await t,i=[];for(let[o,m]of H(s)){let h=V(await j(o)),S=await R(o),b=c?.projects[S],d=p.get(S);i.push({name:o,slot:m.slot,services:m.services??[],port_range:Q(m.slot),containers:h,containers_running:h.filter(g=>g.status==="running").length,containers_total:h.length,intercepts:u.filter(g=>g.feature===o),cpu_percent:b?.cpuPercent??null,mem_mib:b?.memMib??null,started_at:d?.started?.at??null,started_by:d?.started?.by??null,crash_loops:d?.crashLoops??[]})}return{host:c?.host??null,infrastructure:n,mcp_web_server:f,k8s_forwards:r,features:i,waiting:await A(),caches:await e,summary:{total_features:i.length,available_slots:C()-i.length,infra_healthy:n.length>0&&n.every(o=>o.display==="healthy"||o.display==="running"),k8s_alive:r.filter(o=>o.status==="alive").length,k8s_total:r.length,telepresence_available:l.available,intercepts_active:u.filter(o=>o.intercepted).length}}}a(at,"statusSnapshot");export{M as a,Q as b,U as c,V as d,H as e,J as f,ot as g,W as h,at as i};
|
|
4
|
+
//# sourceMappingURL=chunk-5QQEHHQ6.js.map
|