werkmeister 0.96.3 → 0.96.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{budget-BY7UHDWV.js → budget-AMYNP35Q.js} +2 -2
- package/dist/{cache-KU2OR24G.js → cache-O3A5YBOT.js} +2 -2
- package/dist/{chunk-P5NSN5NS.js → chunk-2TBRFIOS.js} +2 -2
- package/dist/{chunk-ZSB7NGEL.js → chunk-2ZG5AQX6.js} +2 -2
- package/dist/{chunk-QIYYQLEA.js → chunk-3BPJRRF7.js} +2 -2
- package/dist/{chunk-BSWADTOC.js → chunk-4DRDOYPG.js} +2 -2
- package/dist/{chunk-HFTT5WN7.js → chunk-4XASPQ6S.js} +2 -2
- package/dist/{chunk-U5YTYX2C.js → chunk-4YZNJIQH.js} +2 -2
- package/dist/{chunk-KDYY6IOI.js → chunk-53U2A5BU.js} +2 -2
- package/dist/{chunk-YXBFFIVC.js → chunk-5C33Q2UM.js} +2 -2
- package/dist/{chunk-2CGM6YPC.js → chunk-5I6P3ZRZ.js} +2 -2
- package/dist/{chunk-KSS5GZIU.js → chunk-5IZDNFW6.js} +2 -2
- package/dist/{chunk-LY3ZWJMJ.js → chunk-5LW27KVM.js} +2 -2
- package/dist/{chunk-AUM7GNGM.js → chunk-5RJFHLF4.js} +2 -2
- package/dist/{chunk-QYEESXBZ.js → chunk-6452JOFU.js} +2 -2
- package/dist/{chunk-7PRAEUOZ.js → chunk-6PJBB7KP.js} +2 -2
- package/dist/{chunk-2PUTXWSQ.js → chunk-77HMVQR2.js} +2 -2
- package/dist/{chunk-5GYW24OF.js → chunk-7HLIUWNT.js} +59 -59
- package/dist/{chunk-SHPWUXGO.js → chunk-7VY2VMT3.js} +2 -2
- package/dist/{chunk-GQEKUI55.js → chunk-AZGVJNBV.js} +3 -3
- package/dist/{chunk-B4WTMVEB.js → chunk-BHUT6E4G.js} +2 -2
- package/dist/{chunk-HOO6MAOY.js → chunk-BXNZOPMH.js} +3 -3
- package/dist/{chunk-7ZI2INQ5.js → chunk-CKAM5T7Z.js} +2 -2
- package/dist/{chunk-LLRAUXPI.js → chunk-D7OZEJBT.js} +2 -2
- package/dist/{chunk-L6KNLWI2.js → chunk-DTHTT2LY.js} +2 -2
- package/dist/{chunk-3MWOBACO.js → chunk-ECSZJBNR.js} +2 -2
- package/dist/{chunk-44YXA4EM.js → chunk-EFTOYYTO.js} +2 -2
- package/dist/{chunk-VRIOJE2R.js → chunk-EPG7SWWC.js} +2 -2
- package/dist/{chunk-5DHOCYKT.js → chunk-FBY2ENLK.js} +2 -2
- package/dist/{chunk-HWUOYPJK.js → chunk-FXDGCA5X.js} +2 -2
- package/dist/{chunk-LUDZPDBU.js → chunk-GABPQOQE.js} +2 -2
- package/dist/{chunk-DW6UXWTB.js → chunk-GKBMMUVJ.js} +2 -2
- package/dist/{chunk-ZMQWWONH.js → chunk-GRX5O3CX.js} +2 -2
- package/dist/{chunk-QMHRB7DX.js → chunk-H5J25ZSC.js} +2 -2
- package/dist/{chunk-JOH2PMI7.js → chunk-HCSAC5Z6.js} +2 -2
- package/dist/{chunk-RWUYXYDU.js → chunk-I6JW6UJH.js} +2 -2
- package/dist/{chunk-3XZESG5R.js → chunk-J45TDLET.js} +2 -2
- package/dist/{chunk-7DIPOY72.js → chunk-J4YFXJND.js} +2 -2
- package/dist/{chunk-OEKE6Z4K.js → chunk-JAOYJTT5.js} +2 -2
- package/dist/{chunk-LK4PDYKU.js → chunk-JBWSCNJ7.js} +3 -3
- package/dist/{chunk-FEHRNZT3.js → chunk-JPUELP4B.js} +2 -2
- package/dist/{chunk-HMWFRFSI.js → chunk-JQVE776N.js} +2 -2
- package/dist/{chunk-AU2TCXHC.js → chunk-JWK5KGBL.js} +2 -2
- package/dist/{chunk-VXFRUABZ.js → chunk-JWVF334V.js} +2 -2
- package/dist/{chunk-I6B3IHA6.js → chunk-KWH5X47W.js} +2 -2
- package/dist/{chunk-AW7S6HT3.js → chunk-O63RZA5G.js} +2 -2
- package/dist/{chunk-2QN5A2HQ.js → chunk-OCSOMTAL.js} +2 -2
- package/dist/{chunk-I2MHOTP3.js → chunk-OJP6MUR6.js} +2 -2
- package/dist/{chunk-H3RW6C4N.js → chunk-PQ3JOJF3.js} +2 -2
- package/dist/{chunk-IBCKPBDX.js → chunk-PUJ267YF.js} +2 -2
- package/dist/{chunk-CVOMHLJC.js → chunk-RGCJAFJX.js} +2 -2
- package/dist/{chunk-SKOHUBCV.js → chunk-RXXC6UIL.js} +2 -2
- package/dist/{chunk-XK5XPYGK.js → chunk-S4BBOGT6.js} +2 -2
- package/dist/{chunk-EKGVTRCP.js → chunk-SQP3OIZA.js} +2 -2
- package/dist/{chunk-SIHBDZUL.js → chunk-T5PZGDIV.js} +2 -2
- package/dist/{chunk-KOVPNRGU.js → chunk-TNP5EKIO.js} +2 -2
- package/dist/{chunk-5IYELKXT.js → chunk-TXV3Q4D6.js} +2 -2
- package/dist/{chunk-3QWL4KRQ.js → chunk-U3B6LQPC.js} +2 -2
- package/dist/{chunk-G6EFFT7P.js → chunk-U6T4JBVH.js} +2 -2
- package/dist/chunk-UUKSAZGH.js +4 -0
- package/dist/{chunk-WT5JJ7XV.js → chunk-V2LECRKO.js} +2 -2
- package/dist/{chunk-NAOCP6YZ.js → chunk-V55RPDDX.js} +2 -2
- package/dist/{chunk-AVKAJV52.js → chunk-WGFW7GL5.js} +2 -2
- package/dist/{chunk-2KSHRJ7Z.js → chunk-WM7YOMQ4.js} +2 -2
- package/dist/{chunk-PMS6GXID.js → chunk-YJ4BIMHP.js} +3 -3
- package/dist/{chunk-7MCHFA45.js → chunk-YRSIDQWL.js} +2 -2
- package/dist/{chunk-WPEUGJSF.js → chunk-YYW2A7QM.js} +2 -2
- package/dist/clean-CAHEPB2B.js +8 -0
- package/dist/close_out-SQRRCKLM.js +8 -0
- package/dist/code-PI6DJLWT.js +4 -0
- package/dist/{config-R546D6JE.js → config-JSOAPK5M.js} +2 -2
- package/dist/{connect-SP4CLM7M.js → connect-IUHCNO7V.js} +2 -2
- package/dist/{daemon-HZV22VRH.js → daemon-JVYDS5HP.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-UX4OBVGN.js → detect-VR2C4V5H.js} +2 -2
- package/dist/{down-2XHPUJQR.js → down-3F3SQT2G.js} +3 -3
- package/dist/{fixture-ALII4KSW.js → fixture-CQAVWYXK.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-S5WFEZX2.js +4 -0
- package/dist/{hooks_gen-SB22JWDQ.js → hooks_gen-6QU32ZRN.js} +2 -2
- package/dist/infra-CQGTSW2L.js +4 -0
- package/dist/init_workspace-XA2GO7V4.js +4 -0
- package/dist/{intercept-HVPFQVGL.js → intercept-QVMMKOOT.js} +2 -2
- package/dist/{issue-UVOGQGFX.js → issue-T444B2HD.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-B2356IRL.js +7 -0
- package/dist/logs-XGGQKDFA.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-5HIWFU2Z.js → migrate-DYXEFSSV.js} +2 -2
- package/dist/notes-JHYDSTDT.js +4 -0
- package/dist/{open-M3YGSQBZ.js → open-Q3P6W62M.js} +2 -2
- package/dist/{optimize-S26SANYJ.js → optimize-PDBHKQHM.js} +2 -2
- package/dist/pause-HXMPM7YA.js +4 -0
- package/dist/pr-BKZ7IK6C.js +5 -0
- package/dist/proxy_reload-LVY7RK2R.js +6 -0
- package/dist/{registry-XOCMU6MP.js → registry-ZW467J6Z.js} +2 -2
- package/dist/remove-RG75N3KH.js +7 -0
- package/dist/remove_workspace-4NCDQRF2.js +8 -0
- package/dist/restart-NUWOA6CT.js +8 -0
- package/dist/resume-OS7VMBVR.js +8 -0
- package/dist/{safari-4QMHL4US.js → safari-7UKLWOC4.js} +2 -2
- package/dist/{sandbox-RWF2FN35.js → sandbox-UMMO5INO.js} +2 -2
- package/dist/{services-EO3PGPTL.js → services-RKX5AGON.js} +2 -2
- package/dist/{setup-A4VXLDBV.js → setup-OO7THSID.js} +2 -2
- package/dist/skills-J5XIVLHO.js +4 -0
- package/dist/{slots-N3RQ63YG.js → slots-ITKQMMI3.js} +2 -2
- package/dist/{standards-GWM7FO7E.js → standards-OOQ2WRYH.js} +2 -2
- package/dist/start_args-6Q2XQSHO.js +4 -0
- package/dist/starting_prompt-UQNHP33P.js +4 -0
- package/dist/stats-32YBXOCR.js +4 -0
- package/dist/{status-JXT2JSM2.js → status-DGAJ7I4I.js} +2 -2
- package/dist/{stop-TPB47MJP.js → stop-3GVL5ISA.js} +2 -2
- package/dist/{telepresence-DZTBRQ4S.js → telepresence-WW7RQX47.js} +2 -2
- package/dist/{test-KANOZ6PV.js → test-WGIKPWAP.js} +2 -2
- package/dist/{tokens-5VLANIPP.js → tokens-HCPRR7P5.js} +2 -2
- package/dist/{up-6IQ672XN.js → up-4CJIZFEB.js} +3 -3
- package/dist/{v4-VPAYVSIU.js → v4-F75QTHCA.js} +2 -2
- package/dist/wait_load-AJSMYUT5.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-7NDOATRB.js → workspace-6QP2COBQ.js} +2 -2
- package/package.json +4 -4
- package/dist/chunk-INMHGD7I.js +0 -4
- package/dist/clean-CWWWP27U.js +0 -8
- package/dist/close_out-5ANHYMLR.js +0 -8
- package/dist/code-HSDXK5T3.js +0 -4
- package/dist/hooks-GTMJ77KM.js +0 -4
- package/dist/infra-7J6OBODY.js +0 -4
- package/dist/init_workspace-AVQOGN4J.js +0 -4
- package/dist/list_workspaces-TZE72LGR.js +0 -7
- package/dist/logs-HGTSTGP6.js +0 -6
- package/dist/notes-24DBTQBS.js +0 -4
- package/dist/pause-JANP44KU.js +0 -4
- package/dist/pr-3ARQQGIX.js +0 -5
- package/dist/proxy_reload-AXST6BQP.js +0 -6
- package/dist/remove-I5UHGQRD.js +0 -7
- package/dist/remove_workspace-ELA2LFCZ.js +0 -8
- package/dist/restart-7B2IQAC4.js +0 -8
- package/dist/resume-23RRQ7C3.js +0 -8
- package/dist/skills-KPNBUYDE.js +0 -4
- package/dist/start_args-3OMA4XVN.js +0 -4
- package/dist/starting_prompt-6DHKTBLK.js +0 -4
- package/dist/stats-UIVROPXE.js +0 -4
- package/dist/wait_load-67UACCO6.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{e as x,n as L}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=budget-
|
|
3
|
+
import{e as x,n as L}from"./chunk-AZGVJNBV.js";import"./chunk-BHUT6E4G.js";import"./chunk-FXDGCA5X.js";import"./chunk-YRSIDQWL.js";import"./chunk-JWVF334V.js";import"./chunk-77HMVQR2.js";import"./chunk-T5PZGDIV.js";import"./chunk-JPUELP4B.js";import"./chunk-TNP5EKIO.js";import"./chunk-DTHTT2LY.js";import"./chunk-OJP6MUR6.js";import"./chunk-SQP3OIZA.js";import"./chunk-JQVE776N.js";import"./chunk-GABPQOQE.js";import"./chunk-YJ4BIMHP.js";import"./chunk-5RJFHLF4.js";import"./chunk-V55RPDDX.js";import"./chunk-WGFW7GL5.js";import{D as b,E as y,K as w,N as k,S as v,v as g,w as $,x as h}from"./chunk-7VY2VMT3.js";import"./chunk-S4BBOGT6.js";import"./chunk-J45TDLET.js";import"./chunk-5LW27KVM.js";import"./chunk-5C33Q2UM.js";import{p as f}from"./chunk-2ZG5AQX6.js";import"./chunk-WM7YOMQ4.js";import"./chunk-KWH5X47W.js";import"./chunk-U6T4JBVH.js";import"./chunk-V2LECRKO.js";import"./chunk-PUJ267YF.js";import"./chunk-5IZDNFW6.js";import"./chunk-FBY2ENLK.js";import{a as i,f as p}from"./chunk-J4YFXJND.js";p();import O from"node:os";var S=2**30,M=i((n,t)=>Number.isFinite(n)?`${Number(n.toFixed(1))}${t}`:"no limit","limit");function P(n,t=process.platform){return n?`host load limit ${n}${t==="darwin"?" (not enforced on macOS)":""}`:"host load limit off"}i(P,"hostLoadText");async function T(n){let t=await b(),l=y(O.availableParallelism()),c=h(),m=await v(),r=L(),u=g(k(m,r??[])).map((e,o)=>{let s=c[e.feature]?.workspace,a=s&&f(s)?.services||null,N=s?w(s,a??void 0):null,B=o===0&&e.waitedMs>=3e5&&!e.parked&&$(t,r??[],e);return{...e,position:o+1,services:a,cost:N,holds:B}});if(n.json){let e=i(o=>Number.isFinite(o)?o:null,"n");console.log(JSON.stringify({budget:{memory:e(t.memory),cpus:e(t.cpus),preempt:t.preempt},host_load:l,leases:c,waiting:m,running:r?.map(o=>({feature:o.feature,cpus:o.cost.cpus,memory:o.cost.memory,rank:o.rank,busy:o.busy}))??null,waiters:u.map(o=>({feature:o.feature,position:o.position,services:o.services,cpus:o.cost?.cpus??null,memory:o.cost?.memory??null,waited_ms:o.waitedMs,gate:o.gate}))}));return}console.log(`Budget: ${M(t.memory/S," GiB")} memory, ${M(t.cpus," CPUs")}, ${P(l)}, preemption ${t.preempt?"on":"off"}`);let d=Object.entries(c).sort(([,e],[,o])=>e.slot-o.slot);console.log(d.length?"Slots:":"Slots: none held");for(let[e,o]of d)console.log(` ${o.slot} ${e}${o.workspace?` ${o.workspace}`:""}`);console.log(r?r.length?"Running:":"Running: none":"Running: docker unavailable");for(let e of[...r??[]].sort((o,s)=>s.cost.cpus-o.cost.cpus))console.log(` ${x(e)}`);console.log(u.length?"Waiting:":"Waiting: none");for(let e of u){let o=e.services?`${e.services.join(", ")}${e.gate?" for a running feature":""}`:"whole feature",s=e.cost?` (${Number(e.cost.cpus.toFixed(1))} CPUs, ${(e.cost.memory/S).toFixed(1)} GiB)`:"",a=e.waitedMs?` waited ${Math.round(e.waitedMs/6e4)} min${e.holds?", gets the next free room":""}`:"";console.log(` ${e.position}. ${e.feature} ${o}${s}${a}`)}}i(T,"run");export{P as hostLoadText,T as run};
|
|
4
|
+
//# sourceMappingURL=budget-AMYNP35Q.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-UUKSAZGH.js";import{d as s}from"./chunk-DTHTT2LY.js";import"./chunk-GABPQOQE.js";import"./chunk-S4BBOGT6.js";import"./chunk-5LW27KVM.js";import"./chunk-PUJ267YF.js";import{h as e,l as c}from"./chunk-5IZDNFW6.js";import"./chunk-FBY2ENLK.js";import{a as r,f as i}from"./chunk-J4YFXJND.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-O3A5YBOT.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{K as y,k as g,m as w,o as _,q as h,t as $}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{K as y,k as g,m as w,o as _,q as h,t as $}from"./chunk-YJ4BIMHP.js";import{n as p}from"./chunk-V2LECRKO.js";import{a,f}from"./chunk-J4YFXJND.js";f();import*as d from"node:fs";import*as c from"node:path";var b=["in_progress","in_review","merged","done","abandoned"],C={jira:{in_progress:"In Progress",in_review:"In Review",merged:null,done:"Done",abandoned:"Done"},github:{in_progress:"status: in progress",in_review:"status: in review",merged:null,done:"closed",abandoned:"not planned"}},x={in_progress:"issue_progress_status",in_review:"issue_review_status",done:"issue_done_status"},O={in_progress:1,in_review:2,merged:3,done:4,abandoned:4},S=a(e=>e==null||String(e).trim()===""?null:String(e).trim(),"blankToNull");function I(e,t){let o=e.issue_statuses??{},n={...C[t]};for(let s of b){let r=x[s];Object.hasOwn(o,s)?n[s]=S(o[s]):r&&e[r]!==void 0&&(n[s]=S(e[r]))}return n}a(I,"resolveIssueStatuses");function L(e){let t=e?w(e):null;return t?I({issue_statuses:t.issueStatuses},t.tracker):I(p().overrides??{},g())}a(L,"issueStatuses");function N(e,t){let o=new Set([e.status,...e.labels??[]].flatMap(s=>s?[s.trim().toLowerCase()]:[])),n=a(s=>{let r=t[s];return r!==null&&o.has(r.toLowerCase())},"is");return e.statusCategory==="done"||n("done")?4:n("merged")?3:n("in_review")?2:n("in_progress")||e.statusCategory==="indeterminate"?1:0}a(N,"issuePosition");async function T(e,t,o,n,s){let r=n[o];try{if(r===null)return s.alwaysComment?(await e.updateIssue(t,{comment:s.comment}),`${t} commented (no ${o} status configured)`):"";let i=[],u=await e.fetchIssue(t,i)??await e.fetchIssue(t,i);if(!u)return`${t} not moved to "${r}": could not read its current status (${[...new Set(i)].join("; ")||"no reason given"}); move it by hand: werkmeister issue update ${t} --status ${JSON.stringify(r)} --comment ${JSON.stringify(s.comment)}`;let m=N(u,n);if(!(O[o]>m||s.back&&m>=2&&m<4)){s.alwaysComment&&await e.updateIssue(t,{comment:s.comment});let l=u.labels?.find(v=>b.some(j=>n[j]?.toLowerCase()===v.toLowerCase()));return`${t} already ${u.status??"past that"}${l?` (${l})`:""}`}return await e.updateIssue(t,{status:r,comment:s.comment}),`${t} \u2192 ${r}`}catch(i){return`${t} not moved to "${r??o}": ${i.message}`}}a(T,"moveIssue");function k(e){let t;try{t=d.readdirSync(c.join(e,"stages")).filter(n=>/^\d+_/.test(n)).sort()}catch{return"research phase"}return`stage ${t.find(n=>{try{return!d.readdirSync(c.join(e,"stages",n,"output")).some(s=>!s.startsWith("."))}catch{return!0}})??t[0]??"01"}`}a(k,"currentStage");async function R(e,t,o){let n=y(e,null),s=$(n);if(!s.length)return"no issue";let r=`Work started: ${k(e)} in workspace ${c.basename(e)}.`;return A(s,i=>{let u={project:h(n),text:i};return T(t??_(u),i,"in_progress",o??L(u),{comment:r})})}a(R,"startIssue");async function A(e,t){let o=[];for(let n of e)o.push(await t(n));return o.filter(Boolean).join("; ")}a(A,"eachIssue");export{L as a,T as b,R as c,A as d};
|
|
4
|
+
//# sourceMappingURL=chunk-2TBRFIOS.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 P}from"./chunk-
|
|
3
|
+
import{a as P}from"./chunk-WM7YOMQ4.js";import{w as I}from"./chunk-5IZDNFW6.js";import{b as m}from"./chunk-FBY2ENLK.js";import{a as o,f as w}from"./chunk-J4YFXJND.js";w();import*as a from"node:fs";import*as d from"node:path";w();var E="mcp__ccd_turn__wrap_up",gt="Don't turn on Auto-fix in the Claude desktop app (`ccd_pr`).";var B=new Set(["AskUserQuestion","ExitPlanMode"]),G=new Set(["permission_prompt","elicitation_dialog"]),U=30*6e4,Y=24*60*6e4,b=/^[\w-]+$/,T=o(t=>d.join(m(t),"agent-state.json"),"legacyFile"),_=o(t=>d.join(m(t),"sessions"),"sessionsDir"),H=o((t,e)=>d.join(_(t),`${e}.json`),"sessionPath");function y(t){try{let e=JSON.parse(a.readFileSync(t,"utf8"));return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}o(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}o(S,"sessionOf");function bt(t,e=Date.now()){let n={},r=o(c=>c.status==="idle"||c.ask!==void 0||e-x(c)<Y,"fresh");for(let[c,s]of Object.entries(y(T(t))?.sessions??{})){let u=S(s);u&&r(u)&&(n[c]=u)}let i=[];try{i=a.readdirSync(_(t))}catch{}for(let c of i){let s=c.match(/^([\w-]+)\.json$/)?.[1],u=d.join(_(t),c),f=s?S(y(u)):null;!s||!f||(r(f)?n[s]=f:Q(u,r))}return n}o(bt,"readSessions");function Q(t,e){try{let n=S(y(t));n&&!e(n)&&a.rmSync(t,{force:!0})}catch{}}o(Q,"removeIfStale");var x=o(t=>Date.parse(t.last??t.at),"lastOf"),z=o((t,e=Date.now())=>t.status==="busy"&&e-x(t)>=U,"sessionGone");function Ot(t,e=Date.now()){let n=Object.values(t),r=n.flatMap(u=>u.ask?[u.ask]:[]).sort((u,f)=>u.at.localeCompare(f.at))[0];if(r)return{agent:"needs-you",at:r.at,question:r.what};let i=n.find(u=>u.status==="busy"&&!z(u,e));if(i)return{agent:"working",at:i.at,question:null};let c=n.find(u=>u.shell&&e-Date.parse(u.shell.at)<U)?.shell;if(c)return{agent:"working",at:c.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}o(Ot,"agentOf");function X(t){return/\?(?=[\s*_`'")\]]|$)/.test(q(t))}o(X,"asksQuestion");function q(t){let e=t.trim().split(/\n\s*\n/);return e[e.length-1].trim().slice(0,200)}o(q,"questionOf");function C(t,e){let n=a.openSync(t,"r");try{let r=a.fstatSync(n).size,i=Math.min(r,e),c=Buffer.alloc(i);return a.readSync(n,c,0,i,r-i),c.toString("utf8")}finally{a.closeSync(n)}}o(C,"tailOf");function V(t){let e=C(t,65536).split(`
|
|
4
4
|
`);for(let n=e.length-1;n>=0;n--){let r;try{r=JSON.parse(e[n])}catch{continue}if(r.type!=="assistant")continue;let i=r.message?.content;if(typeof i=="string")return i;if(!Array.isArray(i))continue;let c=i.filter(s=>s?.type==="text"&&typeof s.text=="string");if(c.length)return c.map(s=>s.text).join(`
|
|
5
5
|
`)}return null}o(V,"lastAssistantText");var Z=1<<20;function tt(t,e,n){if(!t.id)return t.at<e;if(typeof n!="string")return!1;let r=`<task-id>${t.id}</task-id>`;try{return C(n,Z).split(`
|
|
6
6
|
`).some(i=>i.includes(r)&&et(i,r))}catch{return!1}}o(tt,"shellExited");function et(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}}o(et,"isExitNotice");var D=o(t=>t.ask?.kind!=="permission"&&t.tool!==void 0&&B.has(t.tool.name),"askingTool");function nt(t,e,n,r={}){let i=t.hook_event_name,c=n.toISOString(),s=e?{...e}:{status:"idle",at:c};r.foreign||(r.headless?s.headless=!0:delete s.headless),s.last=c;let u=o(l=>{s.status!==l&&Object.assign(s,{status:l,at:c})},"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??""),h=r.foreign;switch(i){case"SessionStart":if(u("idle"),!h)for(let l of["tool","ask","stopped","subagents","shell"])delete s[l];return s;case"UserPromptSubmit":if(u("busy"),!h)for(let l of["tool","ask","stopped"])delete s[l];return s;case"PreToolUse":{if(u("busy"),h)return s;delete s.stopped;let l=t.tool_input?.command;s.tool={name:f,...typeof l=="string"&&{command:l.slice(0,200)},at:c},f==="Bash"&&t.tool_input?.run_in_background===!0&&(s.shell={command:typeof l=="string"?l.slice(0,200):"",at:c});let p=t.tool_input?.ask;if(f===E&&typeof p=="string"&&p.trim())s.ask={kind:"question",what:p.trim(),at:c,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:c,source:"session"}}else f==="ExitPlanMode"?s.ask={kind:"plan",what:"Approve the plan?",at:c,source:"session"}:delete s.ask;return s}case"PostToolUse":case"PostToolUseFailure":{if(u("busy"),h)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===E&&s.ask?.via==="wrap_up"||delete s.ask,s}case"Notification":{let l=t.notification_type,p=String(t.message??"");return!(typeof l=="string"?G.has(l):!/waiting for your input/i.test(p))||h||D(s)||s.ask?.kind==="permission"?void 0:(s.ask={kind:l==="elicitation_dialog"?"question":"permission",what:p||"Approve the tool call?",at:c,source:"session"},s)}case"PermissionRequest":{if(h||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:c,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"),h)return s;delete s.tool,s.shell&&tt(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=V(t.transcript_path)),p&&X(p)?s.ask={kind:"question",what:q(p),at:c,source:"text"}:s.ask?.via!=="wrap_up"&&delete s.ask,s}case"SessionEnd":return r.foreign?s:null;default:return}}o(nt,"nextSession");var st="Workspace paused by the person from its card. End your turn now; it continues when they press Resume.",Nt="Workspace resumed by the person. Continue where you left off.",O=o(t=>d.join(m(t),"paused.json"),"pausedPath"),N=o(t=>d.join(m(t),"resume-nudge.json"),"nudgePath"),k=o(t=>d.join(m(t),"waiting.json"),"waitingPath");function g(t,e){let n=`${t}.${process.pid}.tmp`;a.writeFileSync(n,`${JSON.stringify(e)}
|
|
@@ -9,4 +9,4 @@ import{a as P}from"./chunk-2KSHRJ7Z.js";import{w as I}from"./chunk-KSS5GZIU.js";
|
|
|
9
9
|
${n}`:n,at:r.toISOString()})}catch(u){throw s!==null&&a.renameSync(c,i),u}a.rmSync(c,{force:!0})}o(Ct,"writeWakeNudge");function at(t,e){let n=t.hook_event_name;if(n!=="UserPromptSubmit"&&n!=="PostToolUse"&&n!=="Stop"||t.agent_id||!it(e,t.session_id))return null;let r=v(e,t.session_id),i=`${r}.${process.pid}-${Date.now()}.claimed`;try{a.renameSync(r,i)}catch{return null}let c=J(i);return a.rmSync(i,{force:!0}),c===null?null:n==="Stop"?{decision:"block",reason:c}:{hookSpecificOutput:{hookEventName:n,additionalContext:c}}}o(at,"deliverWake");var ct=o(()=>d.join(I(),"scheduler","queue.json"),"queuePath");function M(t){try{return/^FEATURE=(.+)$/m.exec(a.readFileSync(d.join(t,".env"),"utf8"))?.[1]?.trim()}catch{return}}o(M,"featureOf");function L(t){let e=a.statSync(k(t),{throwIfNoEntry:!1})?.mtimeMs??Date.now();if(Date.now()-e<5e3)return!1;let n=M(t);if(!n)return!1;try{let r=JSON.parse(a.readFileSync(ct(),"utf8"));return!(Array.isArray(r)&&r.includes(n))}catch{return!0}}o(L,"leftOver");var ut=/(^|[\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/,lt=/^mcp__.*werkmeister.*__(up|restart|test|workspace-pr)$/;function ft(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"&&/^\s*docker\s+ps(\s[^;&|`$()<>\n]*)?$/.test(n)?!1:e==="Bash"?ut.test(n):lt.test(e)&&t.tool_input?.action!=="status"}o(ft,"needsCapacity");function pt(t,e){let n=a.existsSync(O(e)),r=n?null:R(e);if(!n&&!r||r?.services)return null;if(r&&L(e))return F(e),null;if(r&&!ft(t))return null;let i=r?`Waiting for capacity (position ${r.position}): this workspace is queued, so containers and tests wait until it starts. Not a failure: \`docker ps --filter label=com.werkmeister.feature=${M(e)??"<feature>"}\` shows its containers; when they are not up, a grant notice tells this session to continue once room frees, and edits and git still work meanwhile. If they are up, the queue entry is stale: tell the person.`:st;switch(t.hook_event_name){case"PreToolUse":{let c={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:i}};return process.env.WERKMEISTER_HOOK_HARNESS==="codex"?c:{continue:!1,stopReason:i,...c}}case"UserPromptSubmit":return{decision:"block",reason:"This workspace is paused. Press \u25B6 Resume on its card first."};default:return null}}o(pt,"pauseGate");function dt(t,e){if(t.hook_event_name!=="UserPromptSubmit")return null;let n=rt(e);return n?.services?n.parked&&L(e)?(F(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}o(dt,"serviceWaitContext");function mt(t,e){let n=t?.hookSpecificOutput?.additionalContext;return{hookSpecificOutput:{hookEventName:"UserPromptSubmit",additionalContext:n?`${e}
|
|
10
10
|
|
|
11
11
|
${n}`:e}}}o(mt,"withContext");function ht(t,e=new Date){let n=P(String(t.cwd||process.cwd())),r=t.session_id;if(!n||typeof r!="string"||!b.test(r))return null;let i=H(n,r),c=S(y(i)),s=y(T(n)),u=c??S(s?.sessions?.[r]),f=process.env.CLAUDE_CODE_ENTRYPOINT?.startsWith("sdk")??!1,h=f&&u!==null&&!u.headless,l=nt(t,u,e,{headless:f,foreign:h});return l===void 0?null:(s?.sessions?.[r]&&(delete s.sessions[r],g(T(n),s)),l===null?u?(a.rmSync(i,{force:!0}),i):null:(a.mkdirSync(_(n),{recursive:!0}),g(i,l),i))}o(ht,"record");function Rt(){try{let t=process.stdin.isTTY?"":a.readFileSync(0,"utf8"),e=t.trim()?JSON.parse(t):{};if(typeof e!="object"||e===null||Array.isArray(e))return;let n=P(String(e.cwd||process.cwd())),r=n?pt(e,n):null;if(r){console.log(JSON.stringify(r));return}n&&e.hook_event_name==="UserPromptSubmit"&&a.rmSync(N(n),{force:!0});let i=n?at(e,n):null,c=n?dt(e,n):null;if(c?console.log(JSON.stringify(mt(i,c))):i&&console.log(JSON.stringify(i)),i&&e.hook_event_name==="Stop")return;ht(e)}catch{}}o(Rt,"main");export{gt as a,U as b,Y as c,bt as d,z as e,Ot as f,X as g,q as h,Nt as i,N as j,k,g as l,vt as m,At as n,Pt as o,R as p,rt as q,Et as r,F as s,Tt as t,jt as u,$t as v,It as w,W as x,Dt as y,Ut as z,qt as A,Ct as B,Rt as C};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-2ZG5AQX6.js.map
|