werkmeister 0.95.3 → 0.95.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-NVUVVS4K.js +4 -0
- package/dist/{cache-WZJGDU2D.js → cache-4ZIIQP7B.js} +2 -2
- package/dist/{chunk-PPPNDN3P.js → chunk-22OJBDAM.js} +2 -2
- package/dist/{chunk-WXZ5XLD3.js → chunk-35KTA3IY.js} +2 -2
- package/dist/{chunk-FKNFZNQ3.js → chunk-3FQNGQYK.js} +2 -2
- package/dist/{chunk-YTSKXM5S.js → chunk-3LM4PZWX.js} +2 -2
- package/dist/{chunk-OJBFAKNA.js → chunk-44KPJH3Y.js} +2 -2
- package/dist/{chunk-2ASXSH6K.js → chunk-4QUCJKY4.js} +2 -2
- package/dist/{chunk-26DZHYDY.js → chunk-4TWGX5IA.js} +2 -2
- package/dist/{chunk-GUDZBF7F.js → chunk-5UF6PZXA.js} +2 -2
- package/dist/{chunk-2XRDXCQV.js → chunk-6IW4YRP2.js} +2 -2
- package/dist/{chunk-UNX5R5BF.js → chunk-6OO4XGO2.js} +3 -3
- package/dist/{chunk-RNRQ26WZ.js → chunk-7FSF4E3M.js} +2 -2
- package/dist/{chunk-MG5KFPMK.js → chunk-7JG6RFOD.js} +2 -2
- package/dist/{chunk-I367ZADE.js → chunk-AJAAAOY6.js} +2 -2
- package/dist/{chunk-HXZKKRKT.js → chunk-BEG4IRCX.js} +2 -2
- package/dist/{chunk-V2TVDWU3.js → chunk-CE6XJAYW.js} +2 -2
- package/dist/{chunk-BTF2TA6L.js → chunk-CKWGUKNH.js} +2 -2
- package/dist/{chunk-TLPNES7B.js → chunk-DRL3G5TI.js} +2 -2
- package/dist/chunk-DUGKWCOA.js +13 -0
- package/dist/{chunk-YZLZDDLA.js → chunk-F5VNTMMD.js} +2 -2
- package/dist/{chunk-P2CGSC56.js → chunk-F7BD7IEA.js} +2 -2
- package/dist/{chunk-B5YHE772.js → chunk-GFMOH4B2.js} +2 -2
- package/dist/{chunk-H2XW5F6T.js → chunk-GY6XLWV7.js} +2 -2
- package/dist/chunk-GYNSTOOS.js +4 -0
- package/dist/{chunk-CQEAZRQW.js → chunk-HI3DAI7R.js} +2 -2
- package/dist/{chunk-XISNUXOK.js → chunk-HILYCUSF.js} +2 -2
- package/dist/{chunk-FKT4ITVN.js → chunk-I37GWQYM.js} +2 -2
- package/dist/{chunk-ZM7KFU5Z.js → chunk-IDAHFWNI.js} +2 -2
- package/dist/{chunk-DKEC2AK5.js → chunk-IXXZULHC.js} +2 -2
- package/dist/{chunk-LLP3H5M4.js → chunk-IY4MKK5V.js} +2 -2
- package/dist/{chunk-NBIPWFBT.js → chunk-J5ZR6JV2.js} +2 -2
- package/dist/{chunk-RNMIQO2N.js → chunk-JOX56DJH.js} +2 -2
- package/dist/{chunk-42DW42BP.js → chunk-JRIVLBE2.js} +2 -2
- package/dist/{chunk-IZEVGCZS.js → chunk-KFQFIRBL.js} +2 -2
- package/dist/{chunk-CLITYELX.js → chunk-KJJ47HDB.js} +2 -2
- package/dist/{chunk-HUFID7JR.js → chunk-LXGKOTRG.js} +2 -2
- package/dist/{chunk-UMGIBILE.js → chunk-M5WUGH7D.js} +2 -2
- package/dist/{chunk-4323MUOQ.js → chunk-MXBFE6Q5.js} +2 -2
- package/dist/{chunk-H3E3CMOV.js → chunk-NCATITXL.js} +2 -2
- package/dist/{chunk-3UNSGL3R.js → chunk-NX3UFBXF.js} +3 -3
- package/dist/{chunk-5TZZHFSC.js → chunk-OBCS3POK.js} +2 -2
- package/dist/{chunk-VOPA7UCJ.js → chunk-OPR6UFOJ.js} +2 -2
- package/dist/{chunk-X5M65LCT.js → chunk-OSFXB45Y.js} +2 -2
- package/dist/{chunk-4XAM6TTE.js → chunk-OVSUHX3O.js} +18 -18
- package/dist/{chunk-JVUTN4FW.js → chunk-OYNS5PGK.js} +2 -2
- package/dist/{chunk-2WS3J2DM.js → chunk-PBNKY77E.js} +2 -2
- package/dist/{chunk-YNZOTNUW.js → chunk-PN5CKLTS.js} +2 -2
- package/dist/{chunk-QWHCUY7V.js → chunk-PQAIKYWH.js} +2 -2
- package/dist/{chunk-PXT5642Z.js → chunk-QNN7QKSH.js} +2 -2
- package/dist/{chunk-4YYAAVN6.js → chunk-SEXE2AO2.js} +2 -2
- package/dist/{chunk-CYOM6IM6.js → chunk-SO7CKXMX.js} +2 -2
- package/dist/{chunk-WSSIG6K5.js → chunk-UAX5RURQ.js} +2 -2
- package/dist/{chunk-TBM54BUF.js → chunk-ULX6YW4J.js} +2 -2
- package/dist/{chunk-TASRMG6C.js → chunk-UPGDQDZR.js} +2 -2
- package/dist/{chunk-7CLFAXKU.js → chunk-V623T2ML.js} +2 -2
- package/dist/{chunk-DC44PMBU.js → chunk-W3BCYMKR.js} +2 -2
- package/dist/{chunk-YJQM7Q4Z.js → chunk-WE5RXY47.js} +2 -2
- package/dist/{chunk-N3XKQG5Y.js → chunk-WRRDDARK.js} +2 -2
- package/dist/{chunk-T252BIFK.js → chunk-YKCEYASM.js} +2 -2
- package/dist/{chunk-R5TI22BV.js → chunk-YS6RFUAH.js} +2 -2
- package/dist/{chunk-VIL6N7EO.js → chunk-YUQ2GINQ.js} +2 -2
- package/dist/{chunk-RDA5PIPZ.js → chunk-YWC5BICP.js} +2 -2
- package/dist/{chunk-YSJE6NRG.js → chunk-YXS2FRMN.js} +3 -3
- package/dist/{chunk-RO5CASBN.js → chunk-ZQWHKHO2.js} +2 -2
- package/dist/{chunk-LCW7PAHN.js → chunk-ZWNG23B6.js} +2 -2
- package/dist/{chunk-CYQWUDQW.js → chunk-ZXQDSGMD.js} +2 -2
- package/dist/clean-RO37LGGU.js +8 -0
- package/dist/close_out-4CF7M2DC.js +8 -0
- package/dist/code-6E77EEWD.js +4 -0
- package/dist/{config-RPFXSX53.js → config-6JQZJE7G.js} +2 -2
- package/dist/{connect-7SPLF6FJ.js → connect-QINMCT2D.js} +2 -2
- package/dist/{daemon-YBPCCPQP.js → daemon-TLHZVA6R.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-GRJNHI6J.js → detect-2MJ4FLUT.js} +2 -2
- package/dist/{down-VPPUTRIN.js → down-YKV2CJKS.js} +3 -3
- package/dist/{fixture-GBE6DXZE.js → fixture-BJBHJWJL.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-SWYBTHP7.js +4 -0
- package/dist/{hooks_gen-G4P6ARFL.js → hooks_gen-KNERKVEM.js} +2 -2
- package/dist/infra-WB7O5TSG.js +4 -0
- package/dist/init_workspace-PX2SYTGO.js +4 -0
- package/dist/{intercept-PTRQWP2D.js → intercept-XONWZ67X.js} +2 -2
- package/dist/{issue-W5WHBEEE.js → issue-PTFD5XZV.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-QYEFVY6Y.js +7 -0
- package/dist/logs-KKJXXBXU.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-QPGPXKCQ.js → migrate-LAMRQGDL.js} +2 -2
- package/dist/notes-RV43627T.js +4 -0
- package/dist/{open-JKLFSNAD.js → open-N4NS3CNE.js} +2 -2
- package/dist/{optimize-FIQKD2SG.js → optimize-ICKCAGP6.js} +2 -2
- package/dist/pause-XSFWRPV5.js +4 -0
- package/dist/pr-LLET766Y.js +5 -0
- package/dist/proxy_reload-3VHCEOK2.js +6 -0
- package/dist/{registry-IPY7A5DO.js → registry-C2GDME4G.js} +2 -2
- package/dist/remove-UVAKKDQY.js +7 -0
- package/dist/remove_workspace-HY4TLE2F.js +8 -0
- package/dist/restart-FCSV5GVC.js +8 -0
- package/dist/resume-L2CZZFZ3.js +8 -0
- package/dist/{safari-CSGTFLUG.js → safari-REJUHBCF.js} +2 -2
- package/dist/{sandbox-WDMS6H2S.js → sandbox-ILKK2QZ4.js} +2 -2
- package/dist/{services-YDBTHSCL.js → services-HY3Z4X4D.js} +2 -2
- package/dist/{setup-WUGUNCKJ.js → setup-P7EHUJB7.js} +2 -2
- package/dist/skills-HS63AJEA.js +4 -0
- package/dist/slots-6CRMOIAG.js +4 -0
- package/dist/{standards-Q7WVOKMT.js → standards-TRCB56GK.js} +2 -2
- package/dist/start_args-3H7OJZ3R.js +4 -0
- package/dist/starting_prompt-BGO22YXG.js +4 -0
- package/dist/stats-3SZIHBLB.js +4 -0
- package/dist/{status-FXDKUFWC.js → status-2RL6F3AB.js} +2 -2
- package/dist/{stop-VSU4QRLB.js → stop-HKFN7K3I.js} +2 -2
- package/dist/{telepresence-4SHS3GH3.js → telepresence-O7R54HWN.js} +2 -2
- package/dist/{test-RUQQ3BE5.js → test-ZNZYTH3O.js} +2 -2
- package/dist/{tokens-D2CHDY76.js → tokens-MC76ACR2.js} +2 -2
- package/dist/{up-VIEX3BL3.js → up-ZLRXRP7C.js} +3 -3
- package/dist/{v4-BCS3OZDZ.js → v4-2JJPWSO4.js} +2 -2
- package/dist/wait_load-ZWK7OVD2.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-T7UNGJUV.js → workspace-H4WBECY3.js} +2 -2
- package/package.json +4 -4
- package/dist/budget-VUN3FMOI.js +0 -4
- package/dist/chunk-BROW4FOT.js +0 -13
- package/dist/chunk-U3TVNR7U.js +0 -4
- package/dist/clean-WVYL3XPE.js +0 -8
- package/dist/close_out-RHRMUJNX.js +0 -8
- package/dist/code-CUZT2EDN.js +0 -4
- package/dist/hooks-WH5NWZZK.js +0 -4
- package/dist/infra-ALH3FARX.js +0 -4
- package/dist/init_workspace-4GYWFT5L.js +0 -4
- package/dist/list_workspaces-6E2OLL5K.js +0 -7
- package/dist/logs-UOG6GKWE.js +0 -6
- package/dist/notes-RTL4YKY5.js +0 -4
- package/dist/pause-L52EKGXK.js +0 -4
- package/dist/pr-ZX5WBUZ2.js +0 -5
- package/dist/proxy_reload-TNEUTXU5.js +0 -6
- package/dist/remove-V43IT66C.js +0 -7
- package/dist/remove_workspace-JORXD46D.js +0 -8
- package/dist/restart-4O4TLHQG.js +0 -8
- package/dist/resume-DPGYDCRK.js +0 -8
- package/dist/skills-PF3HAGNU.js +0 -4
- package/dist/slots-NRYQSGFH.js +0 -4
- package/dist/start_args-J7WYDCO5.js +0 -4
- package/dist/starting_prompt-7VT5ASK5.js +0 -4
- package/dist/stats-RE33HVQZ.js +0 -4
- package/dist/wait_load-IC6O2IJZ.js +0 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{e as x,n as L}from"./chunk-OVSUHX3O.js";import"./chunk-W3BCYMKR.js";import"./chunk-AJAAAOY6.js";import"./chunk-WRRDDARK.js";import"./chunk-SO7CKXMX.js";import"./chunk-CKWGUKNH.js";import"./chunk-3FQNGQYK.js";import"./chunk-HI3DAI7R.js";import"./chunk-HILYCUSF.js";import"./chunk-M5WUGH7D.js";import"./chunk-KJJ47HDB.js";import"./chunk-OBCS3POK.js";import"./chunk-ULX6YW4J.js";import"./chunk-I37GWQYM.js";import"./chunk-YXS2FRMN.js";import"./chunk-ZQWHKHO2.js";import"./chunk-35KTA3IY.js";import"./chunk-F7BD7IEA.js";import{C as b,D as y,J as w,M as k,R as v,v as g,w as $,x as h}from"./chunk-DUGKWCOA.js";import"./chunk-7FSF4E3M.js";import"./chunk-5UF6PZXA.js";import"./chunk-UAX5RURQ.js";import"./chunk-MXBFE6Q5.js";import{p as f}from"./chunk-3LM4PZWX.js";import"./chunk-DRL3G5TI.js";import"./chunk-CE6XJAYW.js";import"./chunk-44KPJH3Y.js";import"./chunk-22OJBDAM.js";import"./chunk-V623T2ML.js";import"./chunk-YUQ2GINQ.js";import"./chunk-YKCEYASM.js";import{a as i,f as p}from"./chunk-7JG6RFOD.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-NVUVVS4K.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-GYNSTOOS.js";import{d as s}from"./chunk-M5WUGH7D.js";import"./chunk-I37GWQYM.js";import"./chunk-7FSF4E3M.js";import"./chunk-UAX5RURQ.js";import"./chunk-V623T2ML.js";import{h as e,l as c}from"./chunk-YUQ2GINQ.js";import"./chunk-YKCEYASM.js";import{a as r,f as i}from"./chunk-7JG6RFOD.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-4ZIIQP7B.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{b as C}from"./chunk-
|
|
3
|
+
import{b as C}from"./chunk-V623T2ML.js";import{a as q,l as k,r as E,s as g,v as l,w as R,x as I}from"./chunk-YUQ2GINQ.js";import{a as j}from"./chunk-YKCEYASM.js";import{a as o,e as Q,f as y}from"./chunk-7JG6RFOD.js";y();var x=["jira","github"];y();y();var P=Q(q(),1);import*as a from"node:fs";import*as m from"node:os";import*as p from"node:path";var O="^/\\S*$";function Z(){return p.join(R(),"env.sh")}o(Z,"envShPath");function ee(){let e=u().overrides?.standards_dir;return e?p.resolve(E(String(e))):p.join(R(),"standards")}o(ee,"standardsDirPath");function te(){let e=ee();return a.existsSync(e)&&a.statSync(e).isDirectory()?"":u().overrides?.standards_dir?`standards tree not found: ${e} (overrides.standards_dir in ${l()})`:`no standards tree: overrides.standards_dir is unset in ${l()} and the default ${e} does not exist`}o(te,"standardsDirProblem");function Te(){return p.join(R(),"secrets.env")}o(Te,"secretsPath");function L(){return p.join(m.homedir(),".zshenv")}o(L,"zshenvPath");function re(){return p.join(m.homedir(),".zshrc")}o(re,"zshrcPath");function G(){return p.join(m.homedir(),"Library","Application Support","Claude","claude_desktop_config.json")}o(G,"desktopConfigPath");var oe=[["paths","werkmeister_root","WERKMEISTER_ROOT"],["paths","repos_root","WERKMEISTER_REPOS_ROOT"],["paths","workspaces_root","WERKMEISTER_WORKSPACES_ROOT"],["overrides","mcp_port","WERKMEISTER_MCP_PORT"],["overrides","node","WERKMEISTER_NODE"],["overrides","services_yaml","WERKMEISTER_SERVICES_YAML"],["overrides","ports_yaml","WERKMEISTER_PORTS_YAML"],["overrides","model_pricing_yaml","WERKMEISTER_MODEL_PRICING_YAML"],["overrides","cache_file","WERKMEISTER_CACHE_FILE"],["ingress","certs_dir","WERKMEISTER_CERTS_DIR"]],$="# >>> werkmeister config >>>",F="# <<< werkmeister config <<<",D="# >>> werkmeister completion >>>",W="# <<< werkmeister completion <<<",ne=["SANDBOX_ROOT","SANDBOX_REPOS_ROOT","SANDBOX_WORKSPACES_ROOT"],je=[{key:"repos_root",label:"Repos root (absolute path)",help:"Directory holding the canonical source-repo clones (exported as WERKMEISTER_REPOS_ROOT).",acceptEmpty:!1,pattern:O,placeholder:"/Users/you/workspace"},{key:"workspaces_root",label:"Workspaces root (absolute path)",help:"Directory holding per-feature worktree workspaces (exported as WERKMEISTER_WORKSPACES_ROOT).",acceptEmpty:!1,pattern:O,placeholder:"/Users/you/workspace/features"}],N={repos_root:"REPOS_ROOT",workspaces_root:"WORKSPACES_ROOT"};function se(e,t=""){let r=t||p.join(m.homedir(),"workspace");return e==="workspaces_root"?p.join(r,"features"):r}o(se,"builtinPathDefault");function Ie(e,t,r={}){let n=(t??u()).paths??{},i=n[e]||g(N[e]);if(i)return String(i);let s=r.repos_root||String(n.repos_root||g(N.repos_root)||"");return se(e,s)}o(Ie,"pathDefault");function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(_,"isDict");var ie=/token|secret|pass(word|wd)|credential|api_?key|private_?key|access_?key|auth/i,ae=o(e=>e===""||e==null||typeof e=="object"&&Object.keys(e).length===0,"isEmpty");function A(e){return Array.isArray(e)?e.map(A):_(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ie.test(t)&&!ae(r)?"<redacted>":A(r)])):e}o(A,"redact");function Ce(e){return P.stringify(A(e))}o(Ce,"redactedYaml");function u(){try{return I()}catch(e){return k(`Could not parse ${l()}: ${e}`),{}}}o(u,"load");function ce(){let e=u().paths;return _(e)?e:{}}o(ce,"loadPaths");function Me(){let e=ce().workspaces_root,t=e?[p.resolve(E(e))]:[];return[...new Set([...t,p.join(m.homedir(),"workspace")])]}o(Me,"candidateWorkspaceRoots");function De(){let e=u().jira;return _(e)?e:{}}o(De,"loadJira");var w={local_domain:"local.werkmeister.io",remote_domain:"remote.werkmeister.io",certs_dir:p.join(m.homedir(),".docker","certs")};function We(e){let t=(e??u()).ingress,r=_(t)?t:{},n=o(i=>{let s=r[i];return typeof s=="string"&&s.trim()?s.trim():w[i]},"pick");return{local_domain:n("local_domain"),remote_domain:n("remote_domain"),certs_dir:E(n("certs_dir"))}}o(We,"loadIngress");function pe(e){let t=(e??u()).overrides?.workspace_repo;return typeof t=="string"?t.trim():""}o(pe,"loadWorkspaceRepo");var ue="[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?/[A-Za-z0-9._-]+$",Ne={key:"workspace_repo",label:"Workspace config repo (owner/repo)",help:"GitHub repo cloned under the repos root and worktree'd as the root of every feature workspace, so .werkmeister/ configs and notes get history. Defaults to your own; point it at a shared <org>/sandbox-workspace to share workspace configs with your team.",acceptEmpty:!1,pattern:ue,placeholder:"your-org/sandbox-workspace"};function ze(e){let t=e??u(),r=t.overrides?.github_org;return typeof r=="string"&&r.trim()?r.trim():pe(t).split("/")[0]??""}o(ze,"loadGithubOrg");function Ke(e){let t=(e??u()).overrides?.werkmeister_issues_project,r=typeof t=="string"?t.trim().toUpperCase():"";return/^[A-Z][A-Z0-9]+$/.test(r)?r:""}o(Ke,"loadSandboxIssuesProject");var Ze={key:"github_org",label:"GitHub org for service repos",help:"Owner of the repos in your services registry. Used to link the canonical examples that standards docs cite (github.com/<org>/<repo>).",acceptEmpty:!1,pattern:"[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$",placeholder:"your-org"},z="[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)+$",Le=[{key:"local_domain",label:"Local ingress domain",help:"Base domain for docker features \u2014 each routed service is served at <service>.<domain> and Caddy terminates TLS for it.",acceptEmpty:!1,pattern:z,placeholder:w.local_domain},{key:"remote_domain",label:"Remote (K8s) ingress domain",help:"Base domain for services routed to the dev cluster instead of a local container \u2014 served at <service>.<domain>.",acceptEmpty:!1,pattern:z,placeholder:w.remote_domain},{key:"certs_dir",label:"Certificate directory (absolute path)",help:"Where bin/generate-certs.sh writes localhost.crt/.key; bind-mounted into the Caddy container (exported as WERKMEISTER_CERTS_DIR).",acceptEmpty:!1,pattern:O,placeholder:w.certs_dir}],de="# Global werkmeister configuration \u2014 single source of truth.\n# Managed by `werkmeister machine config`; safe to hand-edit, then run `werkmeister machine config --check`.\n";function fe(e="/.dockerenv"){return a.existsSync(e)}o(fe,"insideContainer");function H(e,t="/.dockerenv"){let r=p.isAbsolute(e)&&e.startsWith(m.tmpdir()+p.sep);if(fe(t)&&!g("CONFIG_FILE")&&!r)throw new C(`Refusing to write ${e} from inside a container: the host's werkmeister reads it, and the werkmeister root here is the container's /app.
|
|
4
4
|
Run it from the host, or set WERKMEISTER_CONFIG_FILE to a scratch file.`,"INSIDE_CONTAINER")}o(H,"refuseInsideContainer");function le(){for(let e of(process.env.PATH??"").split(p.delimiter))if(e)try{return p.dirname(a.realpathSync(p.join(e,"werkmeister")))}catch{}return null}o(le,"installedRoot");function Y(e){let t=e.paths?.werkmeister_root,r=u().paths?.werkmeister_root;if(!e.paths||!t||!r||t===r)return;let n=o(i=>{try{return a.realpathSync(i)}catch{return i}},"real");n(t)===n(r)||n(t)===le()||(k(`Keeping werkmeister_root ${r}: the running checkout ${t} is not the installed werkmeister. Edit ${l()} to move it.`),e.paths.werkmeister_root=r)}o(Y,"keepStoredRoot");function Ge(e){let t=l();return H(t),Y(e),a.mkdirSync(p.dirname(t),{recursive:!0}),a.writeFileSync(t,de+P.stringify(e)),a.chmodSync(t,384),t}o(Ge,"save");function me(e){return e===""?"''":/^[A-Za-z0-9_@%+=:,./-]+$/.test(e)?e:"'"+e.replace(/'/g,`'"'"'`)+"'"}o(me,"shQuote");function B(e){let t=[`# Generated by \`werkmeister machine config\` from ${l()} \u2014 DO NOT EDIT.`,"# Sourced by ~/.zshenv and the `werkmeister` wrapper for backward compatibility."];for(let[r,n,i]of oe){let s=e[r]?.[n];if(s==null||s==="")continue;let c=String(s);t.push(`export ${i}=${me(c.startsWith("~")?E(c):c)}`)}return t.join(`
|
|
5
5
|
`)+`
|
|
6
6
|
`}o(B,"renderEnvSh");function Fe(e){let t=Z();return H(t),Y(e),a.mkdirSync(p.dirname(t),{recursive:!0}),a.writeFileSync(t,B(e)),t}o(Fe,"writeEnvSh");function he(){let e=j;return`${$}
|
|
@@ -23,4 +23,4 @@ fi
|
|
|
23
23
|
${W}
|
|
24
24
|
`;return J(t,n,i,r)}o(Ye,"ensureZshrcCompletion");function v(e){let t=String(e.command??"");return p.basename(t)==="werkmeister"&&b(e).length>0}o(v,"isSandboxServer");function b(e){let t=e.args??[];return t[0]==="mcp"||t[0]==="internal"&&t[1]==="mcp"?t:[]}o(b,"serverArgs");function Be(e,t=!1){let r=e??G();if(!a.existsSync(r))return!1;let n;try{n=JSON.parse(a.readFileSync(r,"utf8"))}catch(s){return k(`Could not parse ${r}: ${s}`),!1}let i=!1;for(let s of Object.values(n.mcpServers??{}))!_(s)||!v(s)||("env"in s&&(delete s.env,i=!0),b(s)[0]==="mcp"&&(s.args=["internal",...b(s)],i=!0));return i&&!t&&a.writeFileSync(r,JSON.stringify(n,null,2)+`
|
|
25
25
|
`),i}o(Be,"patchDesktopConfig");function Ue(e){let t=[];if(!a.existsSync(l()))return t.push(`config file missing: ${l()} \u2014 run \`werkmeister machine config --write\``),t;let r=e.paths??{};for(let f of["repos_root","workspaces_root"]){let d=r[f];if(!d)t.push(`paths.${f} is not set`);else{let T=E(String(d));a.existsSync(T)&&a.statSync(T).isDirectory()||t.push(`paths.${f} does not exist: ${d} \u2014 create it, or set another with \`werkmeister machine config --${f.replace("_","-")} <path>\``)}}let n=te();n&&t.push(n),t.push(...K(e));let i=Z();a.existsSync(i)?a.readFileSync(i,"utf8")!==B(e)&&t.push(`${i} is stale \u2014 run \`werkmeister machine config --write\` to regenerate`):t.push(`${i} missing \u2014 run \`werkmeister machine config --write\``);let s=L();(!a.existsSync(s)||!a.readFileSync(s,"utf8").includes($))&&t.push(`${s} does not source env.sh \u2014 run \`werkmeister machine config --write\``);let c=G();if(a.existsSync(c))try{let f=JSON.parse(a.readFileSync(c,"utf8"));for(let d of Object.values(f.mcpServers??{}))_(d)&&v(d)&&"env"in d&&t.push(`${c}: werkmeister server still has a stale \`env\` block \u2014 run \`werkmeister machine config --write\``),_(d)&&v(d)&&b(d)[0]==="mcp"&&t.push(`${c}: werkmeister server still launches \`mcp\`, not \`internal mcp\` \u2014 run \`werkmeister machine config --write\``)}catch{}return t}o(Ue,"check");var ye=/^[a-z0-9]+(-[a-z0-9]+)*$/,ke=/^[A-Z][A-Z0-9]+$/,Ee=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,S=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isDict"),h=o(e=>typeof e=="string"||typeof e=="number"?String(e).trim():"","str");function Se(e,t){if(!ye.test(e))return"name must be lowercase letters, digits and single hyphens";if(!S(t))return"must be a map";let r=S(t.tracker)?t.tracker:{},n=h(r.id);if(!x.includes(n))return`tracker.id must be one of ${x.join(", ")}`;let i={};if(n==="jira"){let c=h(r.project).toUpperCase();if(!ke.test(c))return"tracker.project must be a Jira project key (e.g. SW)";i.project=c}else{let c=h(r.org);if(!c)return"tracker.org must name the GitHub owner";if(i.org=c,r.repos!==void 0){let f=Array.isArray(r.repos)?r.repos.map(h):[];if(!f.length||!f.every(d=>Ee.test(d)))return"tracker.repos must be a list of owner/repo";i.repos=f}}let s;if(t.board!==void 0){let c=S(t.board)?t.board:{};if(!h(c.id)||!h(c.ready))return"board needs both id and ready";s={id:h(c.id),ready:h(c.ready)}}return t.issue_statuses!==void 0&&!S(t.issue_statuses)?"issue_statuses must be a map":{name:e,tracker:n,scope:i,...s?{board:s}:{},issueStatuses:S(t.issue_statuses)?t.issue_statuses:{},default:t.default===!0}}o(Se,"parse");function X(e){let t=e.projects,r=[],n=[];if(t==null)return{projects:r,problems:n};if(!S(t))return{projects:r,problems:["projects: must be a map of name \u2192 project"]};for(let s of Object.keys(t).sort()){let c=Se(s,t[s]);typeof c=="string"?n.push(`projects.${s}: ${c}`):r.push(c)}let i=r.filter(s=>s.default).map(s=>s.name);return i.length>1&&n.push(`projects: only one project may set default: true (${i.join(", ")})`),{projects:r,problems:n}}o(X,"parseAll");function K(e){return X(e??u()).problems}o(K,"projectProblems");var V=new Set;function tt(e){let{projects:t,problems:r}=X(e??u());for(let n of r)V.has(n)||(V.add(n),k(`${n} \u2014 skipped (werkmeister machine config --check)`));return t}o(tt,"loadProjects");export{x as a,tt as b,Z as c,ee as d,te as e,Te as f,L as g,re as h,G as i,je as j,se as k,Ie as l,Ce as m,u as n,ce as o,Me as p,De as q,We as r,pe as s,Ne as t,ze as u,Ke as v,Ze as w,Le as x,fe as y,H as z,Ge as A,B,Fe as C,U as D,He as E,Ye as F,Be as G,Ue as H};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-22OJBDAM.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{x as $}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{x as $}from"./chunk-YUQ2GINQ.js";import{a,f as y}from"./chunk-7JG6RFOD.js";y();var j=new Set(["PASTE_TOKEN_HERE","<your-atlassian-login-email>","https://your-org.atlassian.net"]),d=a(e=>j.has(e.trim().replace(/\/+$/,"")),"isJiraPlaceholder");function h(e,t,s){let n=e.trim();for(;n.endsWith("/");)n=n.slice(0,-1);return!n||!t||!s||d(n)||d(t)||d(s)?null:{baseUrl:n,email:t,token:s}}a(h,"normalizeCreds");async function u(){let e=h(process.env.JIRA_BASE_URL??"",process.env.JIRA_EMAIL??"",process.env.JIRA_API_TOKEN??"");if(e)return e;try{let t=$().jira??{};return h(String(t.base_url??""),String(t.email??""),String(t.api_token??""))}catch{return null}}a(u,"jiraCreds");async function f(e,t,s){let n=await fetch(`${e.baseUrl}${t}`,{method:s===void 0?"GET":"POST",headers:{Authorization:"Basic "+Buffer.from(`${e.email}:${e.token}`).toString("base64"),Accept:"application/json",...s===void 0?{}:{"Content-Type":"application/json"}},body:s===void 0?void 0:JSON.stringify(s),signal:AbortSignal.timeout(1e4)});if(!n.ok){let o=(await n.text().catch(()=>"")).trim().slice(0,500);throw new Error(`Jira REST ${t} \u2192 HTTP ${n.status}${o?`: ${o}`:""}`)}return n}a(f,"jiraFetch");async function S(){let e=await u();if(!e)return null;let s=await(await f(e,"/rest/api/3/myself")).json();return{who:s.emailAddress??s.displayName??e.email}}a(S,"jiraMyself");async function l(e,t){return await(await f(e,t)).json()}a(l,"jiraGet");var C="summary,description,status,issuetype,assignee,comment";async function T(e,t){let s=await u();if(!s)return t?.push("no Jira REST credentials"),null;try{return await l(s,`/rest/api/2/issue/${encodeURIComponent(e)}?fields=${C}`)}catch(n){return t?.push(E(n)),null}}a(T,"fetchIssueRest");function E(e){let t=e;if(t.message?.startsWith("Jira REST "))return t.message;let s=t.cause?.code??t.cause?.message;return`Jira REST: ${t.message}${s?` (${s})`:""}`}a(E,"restFailure");async function A(e){if(!e.length)return{};let t=await u();if(!t)return null;let s=encodeURIComponent(`key in (${e.join(",")})`);try{let n=await l(t,`/rest/api/2/search/jql?jql=${s}&fields=status&maxResults=100`),o={};for(let r of n.issues??[]){let c=r.fields?.status?.name;r.key&&c&&(o[r.key.toUpperCase()]=c)}return o}catch{return null}}a(A,"fetchStatusesRest");var R="fields=summary,status&maxResults=100";async function b(e){let t=await u();return t?(await l(t,`/rest/api/2/search/jql?jql=${encodeURIComponent(e)}&${R}`)).issues??[]:null}a(b,"searchIssuesRest");async function L(e,t){let s=await u();if(!s)return null;let n=encodeURIComponent(e),{columnConfig:o}=await l(s,`/rest/agile/1.0/board/${n}/configuration`),r=o?.columns??[],c=r.find(p=>p.name?.toLowerCase()===t.toLowerCase());if(!c)throw new Error(`board ${e} has no "${t}" column (it has: ${r.map(p=>p.name).join(", ")})`);let i=(c.statuses??[]).flatMap(p=>p.id?[p.id]:[]);if(!i.length)return[];let m=encodeURIComponent(`status in (${i.join(",")})`);return(await l(s,`/rest/agile/1.0/board/${n}/issue?jql=${m}&${R}`)).issues??[]}a(L,"boardColumnRest");async function x(e){let t=await u();if(!t)return null;let s=encodeURIComponent(e.project),{issueTypes:n=[]}=await l(t,`/rest/api/2/issue/createmeta/${s}/issuetypes`),o=a(m=>n.some(w=>w.name?.toLowerCase()===m.toLowerCase()),"has"),r=o(e.issueType)||!o("Task")?e.issueType:"Task",c=await f(t,"/rest/api/2/issue",{fields:{project:{key:e.project},issuetype:{name:r},summary:e.summary,description:e.description,...r===e.issueType?{}:{labels:[e.fallbackLabel]}}}),{key:i}=await c.json();return{key:i,url:`${t.baseUrl}/browse/${i}`,issueType:r}}a(x,"createIssueRest");async function U(e,t){let s=await u();return s?(await f(s,"/rest/api/2/issueLink",{type:{name:"Relates"},inwardIssue:{key:e},outwardIssue:{key:t}}),!0):null}a(U,"linkIssueRest");async function _(e,t){let s=await u();if(!s)return null;let n=`/rest/api/2/issue/${encodeURIComponent(e)}`;if(t.status){let o=t.status.trim().toLowerCase(),{transitions:r=[]}=await l(s,`${n}/transitions`),c=r.find(i=>i.to?.name?.toLowerCase()===o)??r.find(i=>i.name?.toLowerCase()===o);if(!c){let i=r.map(m=>m.to?.name??m.name).filter(Boolean).join(", ");throw new Error(`${e} has no transition to "${t.status}" (available: ${i||"none"})`)}await f(s,`${n}/transitions`,{transition:{id:c.id}})}return t.comment&&await f(s,`${n}/comment`,{body:t.comment}),!0}a(_,"updateIssueRest");export{j as a,d as b,S as c,T as d,A as e,b as f,L as g,x as h,U as i,_ as j};
|
|
4
|
+
//# sourceMappingURL=chunk-35KTA3IY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{h as it}from"./chunk-
|
|
3
|
+
import{h as it}from"./chunk-HI3DAI7R.js";import{b as ae}from"./chunk-KJJ47HDB.js";import{n as at}from"./chunk-OBCS3POK.js";import{h as X}from"./chunk-ULX6YW4J.js";import{a as ie,e as et,g as tt,h as nt,i as ot,k as st,o as rt}from"./chunk-I37GWQYM.js";import{$ as ut,D as ce,E as ct,F as le,H as lt,I as j,b as I,c as K,d as qe,e as Ye,ea as ue,f as Ze,g as ze,i as B}from"./chunk-YXS2FRMN.js";import{a as Je,b as H,e as He,h as Ke,j as Xe,k as S}from"./chunk-UAX5RURQ.js";import{d as Ve,f as Qe}from"./chunk-3LM4PZWX.js";import{b as J,c as Ge}from"./chunk-CE6XJAYW.js";import{n as We}from"./chunk-22OJBDAM.js";import{b as Le,c as _}from"./chunk-V623T2ML.js";import{G as je,M as Ue,R as Re,S as Fe,j as De,k as Pe,l as b,t as Be}from"./chunk-YUQ2GINQ.js";import{b as Me}from"./chunk-YKCEYASM.js";import{a as r,f as u}from"./chunk-7JG6RFOD.js";u();import*as m from"node:fs";import*as h from"node:path";import{isDeepStrictEqual as In}from"node:util";u();var en=["mcp__plugin_werkmeister_werkmeister__"],pe=r(e=>en.map(t=>`${t}${e}`),"pluginTool"),tn=["werkmeister","w9r"],k=r(e=>tn.map(t=>`Bash(${t} ${e})`),"cli"),q=["Bash(git -c:*)","Bash(git config:*)",...["--config","--exec-path","--template"].flatMap(e=>[`Bash(git ${e}*)`,`Bash(git * ${e}*)`]),"Bash(git --git-dir*)",...["--output","--no-index"].map(e=>`Bash(git * ${e}*)`),"Bash(node:*)","Bash(python3:*)",...["proxy-reload","down","remove","remove-workspace","clean","setup","registry","connect","intercept","notes graduate","up infra","restart infra","stop infra","infra proxy-reload","feature down","infra down","feature drop","machine clean","machine setup","infra connect","infra intercept","workspace new","ws new","infra up","infra restart","infra stop","daemon install","daemon uninstall","daemon restart"].flatMap(e=>k(`${e}:*`)),...["stop","kill","rm","rmi","compose down","system prune","volume rm","network rm"].map(e=>`Bash(docker ${e}:*)`),...["npm","pnpm"].flatMap(e=>["publish","link","unlink","install -g","install --global","i -g","i --global","uninstall -g","uninstall --global"].map(t=>`Bash(${e} ${t}:*)`)),...["add -g","add --global","remove -g","remove --global"].map(e=>`Bash(pnpm ${e}:*)`),"Bash(gh pr merge:*)",...[".env*",".werkmeister/workspace.yml",".werkmeister/claude-permissions.json",".werkmeister/token"].map(e=>`Edit(/${e})`),"Edit(/.git/**)","Edit(/**/.git/**)",...["kube-switch","up","stop","restart","down","create-workspace","create-workspace-form","pr-approve","ask-pr-review","claude-send","claude-resume","connect","proxy-reload","remove-service","intercept"].flatMap(pe)];u();import*as T from"node:fs";import*as V from"node:path";u();var Y={id:"mcp",instructionsFile:"AGENTS.md",skillsDir:".agents/skills",hooks:{available:!1,reason:"a generic MCP harness has no hooks adapter; use harness: codex for Codex"},agents:!1,notice:r(()=>`
|
|
4
4
|
## Harness
|
|
5
5
|
|
|
6
6
|
This workspace was generated for the \`mcp\` harness. Werkmeister's tools come from the MCP server \`werkmeister\` at ${Ge()}/mcp (how to register it: docs/harnesses.md in the werkmeister repo). Hooks are unavailable on this harness: werkmeister's session-start context, standards gate, PR guard and agent state do not run here (Codex: use \`harness: codex\`). Open PRs only with \`werkmeister pr open\`.
|
|
@@ -143,4 +143,4 @@ export default {
|
|
|
143
143
|
`);return}m.rmSync(e,{force:!0});try{m.rmdirSync(h.dirname(e))}catch{}}r(se,"_saveSettings");function re(e,t){let n=W(e),s=$e(n);if(s===null)return n;"hooks"in s||(s.hooks={});let o=s.hooks;if(typeof o!="object"||o===null||Array.isArray(o))return n;for(let[a,i,c]of t)if(!Yn(o,a,i,c))return n;return se(n,s),n}r(re,"_writeManaged");function yr(e){return re(e,[["SessionStart",Jn(),ee],["PreToolUse",Hn(L(e)),te],["PreToolUse",Kt(),ne]])}r(yr,"writeWorkspaceHooks");function Gt(e){let t=L(e);return re(e,(t?Ln:Fn).map(n=>[n,Xn(t),oe]))}r(Gt,"writeAgentStateHooks");function gr(e){return re(e,[["PreToolUse",Kt(),ne]])}r(gr,"writePrGuardHook");function Sr(e){return qt(e,[["SessionStart",ee],["PreToolUse",te]])}r(Sr,"removeWorkspaceHooks");function Jt(e,t){return t?re(e,[["SessionEnd",Kn(L(e)),z]]):(qt(e,[["SessionEnd",z]]),W(e))}r(Jt,"writeAutoStopHook");function qt(e,t){let n=W(e),s;try{s=JSON.parse(m.readFileSync(n,"utf8"))}catch{return[]}let o=s?.hooks;if(typeof o!="object"||o===null||Array.isArray(o))return[];let a=[];for(let[i,c]of t){let l=o[i];if(!Array.isArray(l))continue;let d=l.filter(w=>!Xt(w,c));for(let w of l)d.includes(w)||a.push(...w.hooks.map(p=>String(p.command)));d.length?o[i]=d:delete o[i]}return a.length?(Object.keys(o).length||delete s.hooks,se(n,s),a):[]}r(qt,"_removeManaged");var Vn=["Bash(git diff:*)","Bash(git status:*)","Bash(git ls-files:*)"],Qn=["command","image","build","entrypoint","archetype","extra_volumes","environment"],ve=["up","restart","feature up","feature restart"],Zn=["status","diff","log","show","add","commit","restore","branch","rev-parse","ls-files","merge-base","rev-list","switch","checkout","symbolic-ref","worktree list"],zn=["rebase origin/main","rebase --continue","rebase --abort","fetch","fetch origin","fetch origin main","remote -v","remote get-url origin"],Yt=r((e=[])=>["",...e.map(t=>`-C ${t} `)].flatMap(t=>[...Zn.map(n=>`Bash(git ${t}${n}:*)`),...zn.map(n=>`Bash(git ${t}${n})`)]),"gitRules"),Ht=[...Yt(),...["pr view","pr checks","pr diff","pr list","issue view","run view","run list"].map(e=>`Bash(gh ${e}:*)`),...ve.flatMap(k),...["status","feature status","infra status","pr gate","pr open","pr status","pr new","pr adopt","issue view","issue start","skills","standards","notes context"].flatMap(e=>k(`${e}:*`)),...["init-workspace","workspace init"].flatMap(e=>[""," --refresh-issue"," --prune-context"," --labels focus"].flatMap(t=>k(`${e}${t}`))),"Bash(docker ps:*)","Bash(claude plugin validate:*)","Bash(claude plugin test:*)",...["issue","issue-statuses","status","workspace-prs","kube-context","k8s-forwards-status"].flatMap(pe)];function eo(e,t,n=[],s=[]){let o=r(c=>!s.includes(c),"startable"),a=t.every(o),i=a?Ht:Ht.filter(c=>!ve.flatMap(k).includes(c));return e?[...i,...a?ve.flatMap(c=>k(`${c} ${e}`)):[],...[...t,...n].filter(o).flatMap(c=>[`feature up --service ${c}`,`feature up ${e} --service ${c}`].flatMap(k)),...["logs","services","feature logs","feature services"].flatMap(c=>k(`${c} ${e}`)),...t.flatMap(c=>["logs","feature logs"].flatMap(l=>k(`${l} ${e} ${c}`))),...t.map(c=>`Bash(docker logs ${e}-${c}:*)`),...t.filter(o).map(c=>`Bash(docker restart ${e}-${c})`)]:i}r(eo,"autonomousRules");var Vt=r(e=>h.join(Me(e),"claude-permissions.json"),"permissionsRecord");function to(e,t,n,s,o="",a=[],i=[],c={}){let l=[],d=r(p=>p.split(/\s*&&\s*/).filter(Boolean),"segments");for(let p of[...t,...i]){let g=et(p,n[p],s);if(!g||(t.includes(p)&&!ie(n[p])&&(l.push(`Bash(${tt(e,p,g)})`),nt(g)&&l.push(...d(g).map(C=>`Bash(${C}:*)`))),!o))continue;let x=n[p]?.repo,O=c[String(x??"")]?.lint,E=ot(o,g,O,x?String(x):void 0),v=E.slice(o.length).replace(/^ --cwd \S+/,"").startsWith(" sh -c '");l.push(v?`Bash(${E})`:`Bash(${E}:*)`)}if(o)for(let p of a)l.push(`Bash(${o} ${p}:*)`);o&&a.length&&l.push(`Bash(${h.join(h.dirname(o),"with-fixture-workspace")}:*)`);let w=`Bash(${o} `;return o&&l.push(...l.filter(p=>p.startsWith(w)).map(p=>`${w}--no-wait ${p.slice(w.length)}`)),[...new Set([...l,...Vn])]}r(to,"buildAllowRules");function no(e){let t;try{t=m.readFileSync(h.join(e,".env"),"utf8")}catch{return{}}let n={};for(let s of t.split(`
|
|
144
144
|
`)){let o=s.indexOf("=");o>0&&(n[s.slice(0,o).trim()]=s.slice(o+1).trim())}return n}r(no,"_readEnv");function oo(e,t=ce(e)){let n=no(e),s=n.FEATURE??"",o=(n.SERVICES??"").split(",").map(f=>f.trim()).filter(Boolean),a=ae(e),i=Qt(e),c=X(e).map(f=>h.basename(f)),l=[],d={};try{(c.length||o.length)&&(d=Re(),l=st(c,d))}catch{}let w=l.filter(f=>!o.includes(f)),p=o.length>0||w.length>0,g=p?Ue():{},x=p?at(g,e):{},O=p?rt(g,e,x):{},E=to(p?s:"",o,O,p?Fe():{},a,i,w,d);if(E.push(...ct(e).flatMap(k)),!t)return E;let v=je(),C=c.flatMap(f=>it($=>m.existsSync(h.join(v,f,$))).map($=>`Bash(${$})`)),P=r(f=>Qn.every($=>In(g[f]?.[$],x[f]?.[$])),"unchanged"),G=Object.keys(O).filter(f=>ie(O[f],e)&&!(O[f]?.unattended_start&&P(f))),A=Yt(X(e).flatMap(f=>[f,h.basename(f)])).filter(f=>f.startsWith("Bash(git -C ")),Ne=String(j(e,"issue_id")??"").trim(),zt=/^[A-Z][A-Z0-9_]*-\d+$/.test(Ne)?k(`issue create --relates ${Ne}:*`):[];return[...new Set([...E,...eo(s,o,w,G),...A,...C,...zt])]}r(oo,"workspaceAllowRules");function Qt(e){return X(e).map(t=>h.join(t,"apps","cli","werkmeister")).filter(t=>m.existsSync(t))}r(Qt,"builtCliWrappers");function so(e){let t=ae(e),s=We().workspace_ask_rules===!1?[]:[`Bash(${t} env WERKMEISTER_ROOT=* node --test*)`,`Bash(${t} --no-wait env WERKMEISTER_ROOT=* node --test*)`,`Bash(${t} node --test*)`,`Bash(${t} --no-wait node --test*)`,`Bash(docker exec * ${t} node --test*)`,`Bash(docker exec * ${t} --no-wait node --test*)`],o=Qt(e);if(!o.length)return s;let a=h.join(h.dirname(t),"with-fixture-workspace");return[`Bash(${a} --exec-runs:*)`,`Bash(${a} --no-wait --exec-runs:*)`,...o.flatMap(i=>[`Bash(${t} ${i} internal fixture --exec-runs:*)`,`Bash(${t} --no-wait ${i} internal fixture --exec-runs:*)`]),...s]}r(so,"workspaceAskRules");function ro(e,t=ce(e)){return t?q:[]}r(ro,"workspaceDenyRules");var Te=r(e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[],"_strings");function Ie(e){try{let t=JSON.parse(m.readFileSync(e,"utf8"));return be(t)?{allow:Te(t.allow),deny:Te(t.deny),ask:Te(t.ask),model:typeof t.model=="string"?t.model:null}:{allow:[],deny:[],ask:[],model:null}}catch{return{allow:[],deny:[],ask:[],model:null}}}r(Ie,"_readRecord");function Ce(e,t){let n={...t.allow.length?{allow:t.allow}:{},...t.deny.length?{deny:t.deny}:{},...t.ask.length?{ask:t.ask}:{},...t.model?{model:t.model}:{}},s=Ie(e);JSON.stringify(t)!==JSON.stringify(s)&&(Object.keys(n).length?(m.mkdirSync(h.dirname(e),{recursive:!0}),m.writeFileSync(e,`${JSON.stringify(n,null,2)}
|
|
145
145
|
`)):m.rmSync(e,{force:!0}))}r(Ce,"_writeRecord");function Zt(e,t,n=[],s=[]){let o=W(e),a=$e(o);if(a===null)return o;let i=a.permissions??{};if(!be(i))return o;let c={allow:t,deny:n,ask:s},l=["allow","deny","ask"];if(l.some(x=>!Array.isArray(i[x]??[])))return o;let d=Vt(e),w=Ie(d),p={...w},g=!1;for(let x of l){let O=i[x]??[],E=new Set(w[x]),v=[...new Set(c[x])],C=O.filter(A=>!(typeof A=="string"&&E.has(A)&&!v.includes(A))),P=v.filter(A=>!C.includes(A));if(p[x]=v.filter(A=>E.has(A)||P.includes(A)),C.length===O.length&&!P.length)continue;g=!0;let G=[...C,...P];G.length?i[x]=G:delete i[x]}return g&&(Object.keys(i).length?a.permissions=i:delete a.permissions,se(o,a)),Ce(d,p),o}r(Zt,"writeWorkspacePermissions");function kr(e){return Zt(e,[],[],[])}r(kr,"removeWorkspacePermissions");function io(e,t){let n=W(e),s=$e(n);if(s===null)return n;let o=Vt(e),a=Ie(o),i=s.model;return i!==void 0&&i!==a.model?(Ce(o,{...a,model:null}),n):(i!==(t??void 0)&&(t?s.model=t:delete s.model,se(n,s)),Ce(o,{...a,model:t}),n)}r(io,"writeWorkspaceModel");function _r(e){if(L(e)){Jt(e,le(e)),Gt(e),mt(e),De(`codex: trust this folder in Codex, approve its hooks with /hooks, and start it as \`${U}\` (docs/harnesses.md \xA7 Codex)`);return}Zt(e,oo(e),ro(e),so(e)),io(e,lt(e)),Jt(e,le(e)),Gt(e)}r(_r,"writeWorkspaceSettings");export{q as a,U as b,Wt as c,Oe as d,$n as e,er as f,tr as g,Dn as h,Pn as i,Bn as j,jn as k,Un as l,Rn as m,Fn as n,Ln as o,Jn as p,Hn as q,Kt as r,Kn as s,Xn as t,yr as u,Gt as v,gr as w,Sr as x,Jt as y,Vn as z,Yt as A,Ht as B,eo as C,to as D,oo as E,so as F,ro as G,Zt as H,kr as I,io as J,_r as K};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-3FQNGQYK.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-DRL3G5TI.js";import{w as D}from"./chunk-YUQ2GINQ.js";import{b as m}from"./chunk-YKCEYASM.js";import{a as r,f as w}from"./chunk-7JG6RFOD.js";w();import*as a from"node:fs";import*as d from"node:path";w();var P="mcp__ccd_turn__wrap_up",ht="Don't turn on Auto-fix in the Claude desktop app (`ccd_pr`).";var K=new Set(["AskUserQuestion","ExitPlanMode"]),G=new Set(["permission_prompt","elicitation_dialog"]),U=30*6e4,B=24*60*6e4,b=/^[\w-]+$/,T=r(t=>d.join(m(t),"agent-state.json"),"legacyFile"),_=r(t=>d.join(m(t),"sessions"),"sessionsDir"),Y=r((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}}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 xt(t,e=Date.now()){let n={},o=r(c=>c.status==="idle"||c.ask!==void 0||e-x(c)<B,"fresh");for(let[c,s]of Object.entries(y(T(t))?.sessions??{})){let u=S(s);u&&o(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||(o(f)?n[s]=f:H(u,o))}return n}r(xt,"readSessions");function H(t,e){try{let n=S(y(t));n&&!e(n)&&a.rmSync(t,{force:!0})}catch{}}r(H,"removeIfStale");var x=r(t=>Date.parse(t.last??t.at),"lastOf"),Q=r((t,e=Date.now())=>t.status==="busy"&&e-x(t)>=U,"sessionGone");function bt(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"&&!Q(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}r(bt,"agentOf");function z(t){return/\?(?=[\s*_`'")\]]|$)/.test(q(t))}r(z,"asksQuestion");function q(t){let e=t.trim().split(/\n\s*\n/);return e[e.length-1].trim().slice(0,200)}r(q,"questionOf");function C(t,e){let n=a.openSync(t,"r");try{let o=a.fstatSync(n).size,i=Math.min(o,e),c=Buffer.alloc(i);return a.readSync(n,c,0,i,o-i),c.toString("utf8")}finally{a.closeSync(n)}}r(C,"tailOf");function X(t){let e=C(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 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}r(X,"lastAssistantText");var V=1<<20;function Z(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 C(n,V).split(`
|
|
6
6
|
`).some(i=>i.includes(o)&&tt(i,o))}catch{return!1}}r(Z,"shellExited");function tt(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(tt,"isExitNotice");var I=r(t=>t.ask?.kind!=="permission"&&t.tool!==void 0&&K.has(t.tool.name),"askingTool");function et(t,e,n,o={}){let i=t.hook_event_name,c=n.toISOString(),s=e?{...e}:{status:"idle",at:c};o.foreign||(o.headless?s.headless=!0:delete s.headless),s.last=c;let u=r(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=o.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===P&&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===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"?G.has(l):!/waiting for your input/i.test(p))||h||I(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||I(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&&Z(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=X(t.transcript_path)),p&&z(p)?s.ask={kind:"question",what:q(p),at:c,source:"text"}:s.ask?.via!=="wrap_up"&&delete s.ask,s}case"SessionEnd":return o.foreign?s:null;default:return}}r(et,"nextSession");var nt="Workspace paused by the person from its card. End your turn now; it continues when they press Resume.",Ot="Workspace resumed by the person. Continue where you left off.",O=r(t=>d.join(m(t),"paused.json"),"pausedPath"),N=r(t=>d.join(m(t),"resume-nudge.json"),"nudgePath"),k=r(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 E}from"./chunk-TLPNES7B.js";import{w as D}from"./chunk-VIL6N7EO.js";
|
|
|
9
9
|
${n}`:n,at:o.toISOString()})}catch(u){throw s!==null&&a.renameSync(c,i),u}a.rmSync(c,{force:!0})}r(qt,"writeWakeNudge");function it(t,e){let n=t.hook_event_name;if(n!=="UserPromptSubmit"&&n!=="PostToolUse"&&n!=="Stop"||t.agent_id||!rt(e,t.session_id))return null;let o=v(e,t.session_id),i=`${o}.${process.pid}-${Date.now()}.claimed`;try{a.renameSync(o,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}}}r(it,"deliverWake");var at=r(()=>d.join(D(),"scheduler","queue.json"),"queuePath");function M(t){let e=a.statSync(k(t),{throwIfNoEntry:!1})?.mtimeMs??Date.now();if(Date.now()-e<5e3)return!1;let n;try{n=/^FEATURE=(.+)$/m.exec(a.readFileSync(d.join(t,".env"),"utf8"))?.[1]?.trim()}catch{return!1}if(!n)return!1;try{let o=JSON.parse(a.readFileSync(at(),"utf8"));return!(Array.isArray(o)&&o.includes(n))}catch{return!0}}r(M,"leftOver");var ct=/(^|[\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/,ut=/^mcp__.*werkmeister.*__(up|restart|test|workspace-pr)$/;function lt(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"?ct.test(n):ut.test(e)&&t.tool_input?.action!=="status"}r(lt,"needsCapacity");function ft(t,e){let n=a.existsSync(O(e)),o=n?null:R(e);if(!n&&!o||o?.services)return null;if(o&&M(e))return F(e),null;if(o&&!lt(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.`:nt;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}}r(ft,"pauseGate");function pt(t,e){if(t.hook_event_name!=="UserPromptSubmit")return null;let n=st(e);return n?.services?n.parked&&M(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}r(pt,"serviceWaitContext");function dt(t,e){let n=t?.hookSpecificOutput?.additionalContext;return{hookSpecificOutput:{hookEventName:"UserPromptSubmit",additionalContext:n?`${e}
|
|
10
10
|
|
|
11
11
|
${n}`:e}}}r(dt,"withContext");function mt(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=Y(n,o),c=S(y(i)),s=y(T(n)),u=c??S(s?.sessions?.[o]),f=process.env.CLAUDE_CODE_ENTRYPOINT?.startsWith("sdk")??!1,h=f&&u!==null&&!u.headless,l=et(t,u,e,{headless:f,foreign:h});return l===void 0?null:(s?.sessions?.[o]&&(delete s.sessions[o],g(T(n),s)),l===null?u?(a.rmSync(i,{force:!0}),i):null:(a.mkdirSync(_(n),{recursive:!0}),g(i,l),i))}r(mt,"record");function Ct(){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=E(String(e.cwd||process.cwd())),o=n?ft(e,n):null;if(o){console.log(JSON.stringify(o));return}n&&e.hook_event_name==="UserPromptSubmit"&&a.rmSync(N(n),{force:!0});let i=n?it(e,n):null,c=n?pt(e,n):null;if(c?console.log(JSON.stringify(dt(i,c))):i&&console.log(JSON.stringify(i)),i&&e.hook_event_name==="Stop")return;mt(e)}catch{}}r(Ct,"main");export{ht as a,U as b,B as c,xt as d,Q as e,bt as f,z as g,q as h,Ot as i,N as j,k,g as l,Nt as m,vt as n,At as o,R as p,st as q,Et as r,F as s,Pt as t,Tt as u,jt as v,$t as w,W as x,Dt as y,It as z,Ut as A,qt as B,Ct as C};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-3LM4PZWX.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{w as p}from"./chunk-
|
|
3
|
+
import{w as p}from"./chunk-YUQ2GINQ.js";import{b as m}from"./chunk-YKCEYASM.js";import{a as n,f as a}from"./chunk-7JG6RFOD.js";a();import{randomBytes as u}from"node:crypto";import*as r from"node:fs";import*as o from"node:path";var h="token";function f(){return o.join(p(),"tokens")}n(f,"tokensDir");function l(e){return o.join(m(e),h)}n(l,"workspaceTokenFile");function F(e,s){let i=o.join(f(),e),t="";try{t=r.readFileSync(i,"utf8").trim()}catch{}t||=u(32).toString("hex");for(let c of[i,l(s)])r.mkdirSync(o.dirname(c),{recursive:!0}),r.writeFileSync(c,`${t}
|
|
4
4
|
`,{mode:384}),r.chmodSync(c,384);return t}n(F,"mintWorkspaceToken");function T(e){r.rmSync(o.join(f(),e),{force:!0})}n(T,"revokeWorkspaceToken");function j(e){let s=new Set(r.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()||t.isSymbolicLink()&&y(o.join(e,t.name))).map(t=>t.name)),i=[];try{i=r.readdirSync(f())}catch{}if(i.length&&!s.size)throw new Error(`no workspace folders found under ${e}`);return i.filter(t=>!s.has(t)).sort()}n(j,"staleTokens");function y(e){try{return r.statSync(e).isDirectory()}catch{return!1}}n(y,"isDir");export{f as a,l as b,F as c,T as d,j as e};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-44KPJH3Y.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 s}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as s}from"./chunk-PQAIKYWH.js";import{a as e,e as o,f as i}from"./chunk-7JG6RFOD.js";i();var r=o(s(),1);function p(n){if(n)try{return r.default.parse(n).type}catch{let t=(n.split(";",1)[0]??"").trim().toLowerCase();return t===""||n.slice(t.length).includes(",")?void 0:t}}e(p,"mediaTypeEssence");function u(n){return n==="application/json"?!0:p(n)==="application/json"}e(u,"isJsonContentType");export{p as a,u as b};
|
|
4
|
+
//# sourceMappingURL=chunk-4QUCJKY4.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-ZXQDSGMD.js";import{b as D,d as N}from"./chunk-W3BCYMKR.js";import{d as E,r as T}from"./chunk-SO7CKXMX.js";import{f as O}from"./chunk-SEXE2AO2.js";import{c as k}from"./chunk-M5WUGH7D.js";import{R as A,X as C,ca as y,d as R,da as I,s as j,t as P}from"./chunk-DUGKWCOA.js";import{d as v}from"./chunk-7FSF4E3M.js";import{M as w}from"./chunk-YUQ2GINQ.js";import{a,f as x}from"./chunk-7JG6RFOD.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-4TWGX5IA.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 r,f as c}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as r,f as c}from"./chunk-7JG6RFOD.js";c();import*as t from"node:fs";import*as s from"node:path";var i="compose.yml",p="docker-compose.yml";function f(o){try{return t.statSync(o).isFile()}catch{return!1}}r(f,"isFile");function m(o){for(let e of[i,p]){let n=s.join(o,e);if(f(n))return n}return null}r(m,"findWorkspaceCompose");function u(o){let e=s.join(o,p),n=s.join(o,i);f(e)&&!t.existsSync(n)&&t.renameSync(e,n)}r(u,"migrateWorkspaceCompose");export{i as a,p as b,m as c,u as d};
|
|
4
|
+
//# sourceMappingURL=chunk-5UF6PZXA.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 d,l as c,m as N,n as R,q as S,t as m}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{k as d,l as c,m as N,n as R,q as S,t as m}from"./chunk-CKWGUKNH.js";import{j as x}from"./chunk-ULX6YW4J.js";import{b as h}from"./chunk-MXBFE6Q5.js";import{d as b,p as g}from"./chunk-22OJBDAM.js";import{j as u,k,m as l}from"./chunk-YUQ2GINQ.js";import{a as i,f as $}from"./chunk-7JG6RFOD.js";$();import*as v from"node:fs";import*as j from"node:path";import*as D from"node:readline/promises";async function w(t){let n=D.createInterface({input:process.stdin,output:process.stdout});try{return await n.question(t)}finally{n.close()}}i(w,"input");function p(){return!!process.stdin.isTTY}i(p,"stdinIsatty");async function I(t,n,o){let e=N(n);if(o){if(!e.includes(o))throw new c(`'${o}' is not an eligible domain (eligible: ${e.join(", ")})`);return o}let a=t.frontmatter.refs??[],s=R(a,n,e);if(s.length===1)return s[0];if(!p())throw new c(`ambiguous or unmatched domain for note refs ${G(a)} \u2014 pass --domain (eligible: ${e.join(", ")})`);console.log(`Which domain? [${e.join(", ")}]`);let r=(await w("> ")).trim();if(!e.includes(r))throw new c(`'${r}' is not an eligible domain`);return r}i(I,"resolveDomain");async function K(t){if(t)return t;if(!p())throw new c(`--kind required (expected one of ${P(d)})`);let n=(await w(`Kind? [${d.join("/")}] > `)).trim();if(!d.includes(n))throw new c(`'${n}' is not a valid kind (expected one of ${P(d)})`);return n}i(K,"resolveKind");async function T(t,n,{domain:o,kind:e,slug:a}){let s=x(),r=await I(n,s,o),f=await K(e);return S(t,n,{domain:r,kind:f,slug:a,decisions:m(t).decisions})}i(T,"graduateOne");async function A(t){let n=h(process.cwd(),g());n===null&&(l("Not inside a workspace \u2014 run this from a workspace folder or below."),process.exit(1));let o=m(n).decisions.open(n);if(!o.length){u("No open decisions to graduate.");return}let e=t.note_num;if(e==null){p()||(l("Pass a note number as an argument (non-interactive mode)."),process.exit(1)),console.log("Open decision notes:");for(let y of o)console.log(` [${String(y.number).padStart(3,"0")}] ${j.basename(y.path)}`);let r=(await w("Graduate which note number? > ")).trim(),f=F(r);f===null&&(l(`'${r}' is not a note number.`),process.exit(1)),e=f}let a=o.find(r=>r.number===e)??null;a===null&&(l(`No open decision note numbered ${String(e).padStart(3,"0")}.`),process.exit(1));let s;try{s=await T(n,a,{domain:t.domain??null,kind:t.kind??null,slug:t.slug??null})}catch(r){throw r instanceof c&&(l(r.message),process.exit(1)),r}k(`Scaffolded ${s.scaffold_path}`),u(`Note marked graduating \u2192 ${s.graduated_to}`),u("Ask Claude to run the w9r-author skill to fill in the placeholder, then `werkmeister skills check`."),u(`Commit it in ${b()} \u2014 a separate repo from this workspace. The note stays an open decision until that file is tracked.`)}i(A,"runGraduate");function C(){try{if(p())return{};let t=v.readFileSync(0,"utf8"),n=t.trim()?JSON.parse(t):null;return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:{}}catch{return{}}}i(C,"hookPayload");async function L(t){if(t.action==="graduate"){await A(t);return}try{let n=h(process.cwd(),g());if(n===null)return;let o=m(n).sessionContext(n,C());o&&process.stdout.write(o)}catch{return}}i(L,"run");function F(t){let n=t.trim();return/^[+-]?\d+$/.test(n)?Number.parseInt(n,10):null}i(F,"parseIntStrict");function G(t){return`[${t.map(n=>`'${n}'`).join(", ")}]`}i(G,"reprList");function P(t){return t.length===1?`('${t[0]}',)`:`(${t.map(n=>`'${n}'`).join(", ")})`}i(P,"reprTuple");export{w as a,T as b,L as c};
|
|
4
|
+
//# sourceMappingURL=chunk-6IW4YRP2.js.map
|