werkmeister 0.101.1 → 0.101.2
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/{branch_cli-EDVPZC6B.js → branch_cli-NMX7FSRF.js} +2 -2
- package/dist/{budget-3KULQYZ5.js → budget-6VQEAU2A.js} +2 -2
- package/dist/{cache-F7L6ZUGC.js → cache-XDFLEBQK.js} +2 -2
- package/dist/{chunk-PJEEZKGI.js → chunk-22UWEGCB.js} +2 -2
- package/dist/{chunk-YHEF33EF.js → chunk-3VV3O3AJ.js} +2 -2
- package/dist/{chunk-5W35MNM5.js → chunk-4D6PVTKQ.js} +2 -2
- package/dist/{chunk-5QBAWLKA.js → chunk-5H3PSAWE.js} +2 -2
- package/dist/{chunk-SVZJSMYU.js → chunk-5SCP3EXM.js} +2 -2
- package/dist/{chunk-W64CXS3E.js → chunk-5VYM7DYM.js} +2 -2
- package/dist/{chunk-P3MWLFKP.js → chunk-6CTKWPKT.js} +2 -2
- package/dist/{chunk-5TLC3VFB.js → chunk-7C2L5JJY.js} +3 -3
- package/dist/{chunk-RQNDWABP.js → chunk-7XYYH5MA.js} +2 -2
- package/dist/{chunk-UMHIPIQJ.js → chunk-A3ZNFREC.js} +2 -2
- package/dist/{chunk-XKNPM5VT.js → chunk-AQTOIZHD.js} +2 -2
- package/dist/{chunk-IUW7SKO3.js → chunk-BL5ILVA4.js} +2 -2
- package/dist/{chunk-NLG5QDV2.js → chunk-BWEXE3W7.js} +2 -2
- package/dist/{chunk-KCZGBANA.js → chunk-C3HTRI5Q.js} +2 -2
- package/dist/{chunk-QFQ4LXMG.js → chunk-C6AIXHAO.js} +2 -2
- package/dist/{chunk-TWFTR4AV.js → chunk-C6C3XBGS.js} +2 -2
- package/dist/{chunk-BSPTDTK6.js → chunk-CGBUMMVD.js} +2 -2
- package/dist/{chunk-U6B7XQXX.js → chunk-DFZTYBOT.js} +2 -2
- package/dist/{chunk-LOFDH6HJ.js → chunk-EZYKEOM5.js} +3 -3
- package/dist/{chunk-PHDU6BYL.js → chunk-FE535BBP.js} +2 -2
- package/dist/{chunk-QICB7GFD.js → chunk-G3ZNBYZA.js} +2 -2
- package/dist/{chunk-DV4XOWAL.js → chunk-GHKTFSXT.js} +2 -2
- package/dist/{chunk-N3PRYYPU.js → chunk-GMRIBP64.js} +2 -2
- package/dist/{chunk-R2TARGC4.js → chunk-GPQQN67U.js} +2 -2
- package/dist/{chunk-FTKV6CMC.js → chunk-HYPE4DIW.js} +2 -2
- package/dist/{chunk-MBGGF3QE.js → chunk-IBSXSUBD.js} +2 -2
- package/dist/{chunk-EMPCS25L.js → chunk-INMKNNF4.js} +2 -2
- package/dist/{chunk-FTKUBF3T.js → chunk-IUYWVX6W.js} +2 -2
- package/dist/{chunk-2ODO75P3.js → chunk-JZK62ZPT.js} +2 -2
- package/dist/{chunk-KC6TFLNB.js → chunk-KLGOXWOT.js} +2 -2
- package/dist/chunk-KPUSLWXT.js +86 -0
- package/dist/{chunk-RDKKERUY.js → chunk-KURLPIEU.js} +2 -2
- package/dist/{chunk-BY2SB4IB.js → chunk-MFFXPZAH.js} +15 -15
- package/dist/{chunk-MRFOKKW7.js → chunk-MJDU2CJL.js} +2 -2
- package/dist/{chunk-EZI7MC4Q.js → chunk-MS22FCDC.js} +2 -2
- package/dist/{chunk-C5QAWFAG.js → chunk-MWMCYK6S.js} +2 -2
- package/dist/{chunk-MUVDGYJP.js → chunk-MZIIFP2G.js} +2 -2
- package/dist/{chunk-HQPCZ63Y.js → chunk-O4RW4VT2.js} +2 -2
- package/dist/{chunk-J66LW7UG.js → chunk-OMYKAVZL.js} +2 -2
- package/dist/{chunk-C4OO6ISY.js → chunk-P63KS5RH.js} +2 -2
- package/dist/{chunk-7CA3DMXW.js → chunk-PFUSJ2BR.js} +2 -2
- package/dist/{chunk-7FEII2RL.js → chunk-PIITZ2ES.js} +2 -2
- package/dist/{chunk-LAODRBNR.js → chunk-PNGE7773.js} +3 -3
- package/dist/{chunk-ZDFOS2CF.js → chunk-QTCNMK77.js} +2 -2
- package/dist/{chunk-GMKFTACH.js → chunk-QYAZ2TU3.js} +2 -2
- package/dist/{chunk-7P43WGDN.js → chunk-TJOX6QPS.js} +2 -2
- package/dist/{chunk-GJSQDDWE.js → chunk-TTMCVG3B.js} +2 -2
- package/dist/{chunk-EL64V2BP.js → chunk-TYTB3EE4.js} +2 -2
- package/dist/{chunk-UQHLOKSQ.js → chunk-UFDUBO7W.js} +2 -2
- package/dist/{chunk-T4367T3L.js → chunk-UH4MZ6XT.js} +2 -2
- package/dist/{chunk-4FBAY6JN.js → chunk-UPDJBW6P.js} +2 -2
- package/dist/{chunk-QA2ZTOKQ.js → chunk-UVUUZSP5.js} +2 -2
- package/dist/{chunk-Y2H4QBY2.js → chunk-UYIMCECG.js} +2 -2
- package/dist/{chunk-XIWXDXMG.js → chunk-VB6QEYWA.js} +2 -2
- package/dist/{chunk-24XS5X3Z.js → chunk-VMTXW4WJ.js} +2 -2
- package/dist/{chunk-XW3ALKS4.js → chunk-VQHFMCZH.js} +2 -2
- package/dist/chunk-XCC3VEFU.js +4 -0
- package/dist/{chunk-YNGD7GVK.js → chunk-XEFOU5MQ.js} +2 -2
- package/dist/{chunk-FDJBNPPL.js → chunk-XSMFQ6HQ.js} +14 -14
- package/dist/{chunk-HCYVEWNT.js → chunk-XSN4B4IG.js} +2 -2
- package/dist/{chunk-YTXDFHM4.js → chunk-Y233LHDO.js} +2 -2
- package/dist/{chunk-5GCETXZA.js → chunk-Y3IS7TFB.js} +2 -2
- package/dist/{chunk-V4NEQUNK.js → chunk-ZO4Q73F3.js} +2 -2
- package/dist/chunk-ZSPERK6M.js +4 -0
- package/dist/{chunk-VY7H4UHS.js → chunk-ZYWLUH7U.js} +2 -2
- package/dist/clean-RNCFWDGF.js +8 -0
- package/dist/{close_out-ZWXUAHEO.js → close_out-WVBLKPBG.js} +2 -2
- package/dist/code-LX7NM5SP.js +4 -0
- package/dist/{config-X4NBALQK.js → config-H7BR3F4E.js} +2 -2
- package/dist/{connect-Z4JLCWGB.js → connect-GL2OTVGW.js} +2 -2
- package/dist/{daemon-HOOMA7GL.js → daemon-7GYGMKAZ.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-MHZ2YUQD.js → detect-HOO2MKMS.js} +2 -2
- package/dist/{down-6EZTIZHA.js → down-EPNFB7LU.js} +3 -3
- package/dist/{fixture-IS4Y4SYB.js → fixture-G6ZXPLOS.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-IELVRE7Y.js +4 -0
- package/dist/{hooks_gen-NZSO5HJG.js → hooks_gen-DMN6MBWZ.js} +2 -2
- package/dist/infra-G6X4WBAO.js +4 -0
- package/dist/init_workspace-MYBY5UQ6.js +4 -0
- package/dist/{intercept-VZEEYNSK.js → intercept-QFO4YSGE.js} +2 -2
- package/dist/{issue-4F7JXPLH.js → issue-CH4HZ6MB.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-RJ2FBCIX.js +7 -0
- package/dist/logs-QG75NKCQ.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-OXRFGCQR.js +4 -0
- package/dist/notes-CXCZVMPV.js +4 -0
- package/dist/{open-VTBIQ2II.js → open-QG7FLWIX.js} +2 -2
- package/dist/{optimize-ASJWGEJP.js → optimize-MPOBGHP2.js} +2 -2
- package/dist/pause-HMYPPKS6.js +4 -0
- package/dist/pr-TX3PNFES.js +5 -0
- package/dist/proxy_reload-RELESVKW.js +6 -0
- package/dist/{registry-B4VWMSDT.js → registry-4YQPICLU.js} +2 -2
- package/dist/remove-YHAW2XKI.js +7 -0
- package/dist/remove_workspace-UXXNFC5L.js +8 -0
- package/dist/restart-7X3PRX2A.js +8 -0
- package/dist/resume-JRAUMDWS.js +8 -0
- package/dist/{safari-VRVTUQBS.js → safari-L3RVJDHY.js} +2 -2
- package/dist/{sandbox-UFDM7G47.js → sandbox-ZVWPKNXC.js} +2 -2
- package/dist/{services-B7Y5VLH2.js → services-RJPHSSWX.js} +2 -2
- package/dist/{setup-K7ORYFSP.js → setup-GL4XLLMX.js} +2 -2
- package/dist/skills-GUQOVXAX.js +4 -0
- package/dist/{slots-UOHWOCUH.js → slots-4M5IUYQW.js} +2 -2
- package/dist/{standards-3BKAFLLB.js → standards-KRPCQIFN.js} +2 -2
- package/dist/start_args-FQ6CPEWI.js +4 -0
- package/dist/starting_prompt-NLL35ZGO.js +4 -0
- package/dist/stats-OJLQ4ZJS.js +4 -0
- package/dist/{status-3XEKEJDK.js → status-QP4JZYVA.js} +2 -2
- package/dist/{stop-4KMPHWYO.js → stop-7SFIXOQM.js} +2 -2
- package/dist/{telepresence-Y2SLXQGK.js → telepresence-K2XTEGT7.js} +2 -2
- package/dist/{test-M6SOPTJC.js → test-UI7GWRL6.js} +2 -2
- package/dist/{tokens-TZBP7U42.js → tokens-7DVOPJ73.js} +2 -2
- package/dist/{up-RVWPNGH5.js → up-XGYPEGFO.js} +3 -3
- package/dist/{v4-D2TVC57Z.js → v4-IGGH2EY3.js} +2 -2
- package/dist/wait_load-3OZWZFJE.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-VZPPK7RM.js → workspace-A7LWQXVX.js} +2 -2
- package/man/werkmeister-workspace-init.1 +1 -1
- package/man/werkmeister-workspace-new.1 +1 -1
- package/package.json +3 -3
- package/dist/chunk-5T5EP7RE.js +0 -86
- package/dist/chunk-CYNDVRAH.js +0 -4
- package/dist/chunk-EBFM5NWM.js +0 -4
- package/dist/clean-6AKEIMHK.js +0 -8
- package/dist/code-VECCJ6JM.js +0 -4
- package/dist/hooks-W244JOSW.js +0 -4
- package/dist/infra-YBZPPXHL.js +0 -4
- package/dist/init_workspace-SFFDPSGN.js +0 -4
- package/dist/list_workspaces-V3W2YHFS.js +0 -7
- package/dist/logs-R37PLBUZ.js +0 -6
- package/dist/migrate-FRFC3ZTR.js +0 -4
- package/dist/notes-VFJ5LZGW.js +0 -4
- package/dist/pause-LMEWZAQ5.js +0 -4
- package/dist/pr-3PL3X4S2.js +0 -5
- package/dist/proxy_reload-PWJQDBV2.js +0 -6
- package/dist/remove-DBJMJH42.js +0 -7
- package/dist/remove_workspace-45QAXEFK.js +0 -8
- package/dist/restart-KHNVVFTV.js +0 -8
- package/dist/resume-IJLZRNZP.js +0 -8
- package/dist/skills-VET3O5WJ.js +0 -4
- package/dist/start_args-XYQ5S3OW.js +0 -4
- package/dist/starting_prompt-AZ3COJEM.js +0 -4
- package/dist/stats-CWALP3NS.js +0 -4
- package/dist/wait_load-GZ6DIP3M.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{f as w}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=branch_cli-
|
|
3
|
+
import{f as w}from"./chunk-ZO4Q73F3.js";import"./chunk-AQTOIZHD.js";import"./chunk-OMYKAVZL.js";import"./chunk-HYPE4DIW.js";import"./chunk-EZYKEOM5.js";import"./chunk-PIITZ2ES.js";import"./chunk-MJDU2CJL.js";import"./chunk-UVUUZSP5.js";import"./chunk-GMRIBP64.js";import"./chunk-XSN4B4IG.js";import"./chunk-MFFXPZAH.js";import"./chunk-G3ZNBYZA.js";import"./chunk-A3ZNFREC.js";import"./chunk-C6AIXHAO.js";import"./chunk-TJOX6QPS.js";import"./chunk-Y233LHDO.js";import"./chunk-DFZTYBOT.js";import{h as E}from"./chunk-22UWEGCB.js";import"./chunk-INMKNNF4.js";import"./chunk-XSMFQ6HQ.js";import"./chunk-KPUSLWXT.js";import"./chunk-BL5ILVA4.js";import"./chunk-MWMCYK6S.js";import"./chunk-TTMCVG3B.js";import"./chunk-6CTKWPKT.js";import"./chunk-CGBUMMVD.js";import{d as h}from"./chunk-5VYM7DYM.js";import"./chunk-MS22FCDC.js";import"./chunk-P63KS5RH.js";import"./chunk-5H3PSAWE.js";import"./chunk-PFUSJ2BR.js";import"./chunk-GPQQN67U.js";import"./chunk-7XYYH5MA.js";import"./chunk-VB6QEYWA.js";import{X as d,aa as l}from"./chunk-3VV3O3AJ.js";import"./chunk-QYAZ2TU3.js";import{a,f as u}from"./chunk-4D6PVTKQ.js";u();import{execFileSync as g,spawn as k}from"node:child_process";import*as r from"node:fs";import*as t from"node:path";var x=["pr gate","feature up","feature stop","feature status"];function p(o){console.error(`branch-cli: ${o}`),process.exitCode=2}a(p,"refuse");async function S(o){if(!x.includes(o.slice(0,2).join(" ")))return p(`runs only ${x.map(e=>`\`${e}\``).join(", ")}; got \`${o.join(" ")}\``);let s=w(),c=E(s).find(e=>r.existsSync(t.join(e,"apps","cli","werkmeister")));if(!c)return p(`no werkmeister worktree in ${s}`);let i=t.join(c,"apps","cli","dist","main.js");if(!r.existsSync(i)){let e="";try{e=r.readFileSync(t.join(s,".env"),"utf8")}catch{}let n=/^FEATURE=(.+)$/m.exec(e)?.[1]?.trim()??"<feature>";return p(`${i} is not built. Build it in the container: docker exec -w /app ${l(n,"werkmeister-core")} pnpm turbo run build --filter=werkmeister`)}let m="?";try{m=g("git",["-C",c,"rev-parse","--short","HEAD"],{encoding:"utf8",env:h(),stdio:["ignore","pipe","ignore"]}).trim()}catch{}console.error(`branch-cli: running ${i} (worktree at ${m})`);let f=d(),$=[t.join(f,"node_modules"),process.env.NODE_PATH].filter(Boolean),j={...process.env,WERKMEISTER_ROOT:f,NODE_PATH:$.join(t.delimiter),WERKMEISTER_BRANCH_CLI:"1"};process.exitCode=await new Promise(e=>{let n=k(process.execPath,[i,...o],{stdio:"inherit",env:j});n.on("error",()=>e(1)),n.on("exit",R=>e(R??1))})}a(S,"run");export{S as run};
|
|
4
|
+
//# sourceMappingURL=branch_cli-NMX7FSRF.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{e as x,n as S}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=budget-
|
|
3
|
+
import{e as x,n as S}from"./chunk-EZYKEOM5.js";import"./chunk-PIITZ2ES.js";import"./chunk-MJDU2CJL.js";import"./chunk-UVUUZSP5.js";import"./chunk-GMRIBP64.js";import"./chunk-MFFXPZAH.js";import"./chunk-G3ZNBYZA.js";import"./chunk-A3ZNFREC.js";import"./chunk-C6AIXHAO.js";import"./chunk-TJOX6QPS.js";import"./chunk-Y233LHDO.js";import"./chunk-DFZTYBOT.js";import"./chunk-22UWEGCB.js";import"./chunk-INMKNNF4.js";import"./chunk-XSMFQ6HQ.js";import"./chunk-KPUSLWXT.js";import"./chunk-BL5ILVA4.js";import"./chunk-MWMCYK6S.js";import{D as b,E as y,I as v,L as k,O as L,T as M,v as $,w as h,x as w}from"./chunk-TTMCVG3B.js";import"./chunk-6CTKWPKT.js";import"./chunk-CGBUMMVD.js";import"./chunk-5VYM7DYM.js";import"./chunk-MS22FCDC.js";import{p as g}from"./chunk-P63KS5RH.js";import"./chunk-5H3PSAWE.js";import"./chunk-PFUSJ2BR.js";import"./chunk-GPQQN67U.js";import"./chunk-7XYYH5MA.js";import"./chunk-VB6QEYWA.js";import"./chunk-3VV3O3AJ.js";import"./chunk-QYAZ2TU3.js";import{a as i,f}from"./chunk-4D6PVTKQ.js";f();import R from"node:os";var N=2**30,B=i((n,t)=>Number.isFinite(n)?`${Number(n.toFixed(1))}${t}`:"no limit","limit");function W(n,t=process.platform){return n?`host load limit ${n}${{darwin:" (Docker VM load on macOS)",win32:" (Docker VM load on Windows)"}[t]??""}`:"host load limit off"}i(W,"hostLoadText");async function T(n){let t=await b(),m=process.platform==="darwin"||process.platform==="win32",u=y(m&&(await v())?.cores||R.availableParallelism()),c=w(),d=await M(),r=S(),l=$(L(d,r??[])).map((e,o)=>{let s=c[e.feature]?.workspace,a=s&&g(s)?.services||null,F=s?k(s,a??void 0):null,O=o===0&&e.waitedMs>=3e5&&!e.parked&&h(t,r??[],e);return{...e,position:o+1,services:a,cost:F,holds:O}});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:u,leases:c,waiting:d,running:r?.map(o=>({feature:o.feature,cpus:o.cost.cpus,memory:o.cost.memory,rank:o.rank,busy:o.busy}))??null,waiters:l.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: ${B(t.memory/N," GiB")} memory, ${B(t.cpus," CPUs")}, ${W(u)}, preemption ${t.preempt?"on":"off"}`);let p=Object.entries(c).sort(([,e],[,o])=>e.slot-o.slot);console.log(p.length?"Slots:":"Slots: none held");for(let[e,o]of p)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(l.length?"Waiting:":"Waiting: none");for(let e of l){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/N).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{W as hostLoadText,T as run};
|
|
4
|
+
//# sourceMappingURL=budget-6VQEAU2A.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-ZSPERK6M.js";import{d as s}from"./chunk-TJOX6QPS.js";import"./chunk-INMKNNF4.js";import"./chunk-6CTKWPKT.js";import"./chunk-5VYM7DYM.js";import"./chunk-VB6QEYWA.js";import{h as e,l as c}from"./chunk-3VV3O3AJ.js";import"./chunk-QYAZ2TU3.js";import{a as r,f as i}from"./chunk-4D6PVTKQ.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-XDFLEBQK.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{e as C,o as G}from"./chunk-
|
|
3
|
+
import{e as C,o as G}from"./chunk-INMKNNF4.js";import{o as x}from"./chunk-5VYM7DYM.js";import{d as g,e as P,u as L}from"./chunk-7XYYH5MA.js";import{G as F,M as W,S as T,a as X}from"./chunk-3VV3O3AJ.js";import{b as I}from"./chunk-QYAZ2TU3.js";import{a,e as Q,f as O}from"./chunk-4D6PVTKQ.js";O();var K=Q(X(),1);import*as d from"node:fs";import*as u from"node:path";O();import*as D from"node:fs";import*as y from"node:path";var ee=5;function te(t){let e=t.trim().replace(/\.git$/,""),n=/^(?:ssh:\/\/)?git@([^:/]+)[:/](.+)$/.exec(e);return n?`https://${n[1]}/${n[2]}`:/^https?:\/\//.test(e)?e:""}a(te,"httpsRemote");function ne(t=g()){let e=a((...i)=>{try{let r=x(["git","-C",t,...i],{capture:!0,timeout:ee});return r.status===0?r.stdout.trim():""}catch{return""}},"git"),n=te(e("remote","get-url","origin"));return n?{base:n,prefix:e("rev-parse","--show-prefix").replace(/\/+$/,"")}:null}a(ne,"standardsSource");function H(t,e,n="blob"){if(!t)return"";let i=y.posix.normalize(y.posix.join(t.prefix,e)).replace(/\/+$/,"");return i==="."?`${t.base}/${n}/HEAD`:`${t.base}/${n}/HEAD/${i}`}a(H,"standardsUrl");function re(){let t=L();return t?`https://github.com/${t}`:""}a(re,"serviceRepoBase");var se=`<!--
|
|
4
4
|
AUTO-GENERATED FILE \u2014 DO NOT EDIT BY HAND.
|
|
5
5
|
Source: {source} (edit that file instead)
|
|
6
6
|
Generator: werkmeister workspace init / werkmeister skills sync
|
|
@@ -28,4 +28,4 @@ Full file: \`${n}\`${c}
|
|
|
28
28
|
`))return{};let n=e.indexOf(`
|
|
29
29
|
---`,4);if(n===-1)return{};let i;try{i=K.parse(e.slice(4,n))}catch{return{}}return R(i)?i:{}}a(w,"parseFrontmatter");function ge(t,e,n){n==null&&(n=T());let i=G(t,n);for(let r of Object.keys(n).sort()){let s=n[r];if(R(s))for(let o of s.standards??[])o in e||i.push(`services.yaml: archetype '${r}' lists unknown standard '${o}' \u2014 no docs/standards/${o}.md with \`domain: ${o}\``)}for(let[r,s]of Object.entries(t))if(!(!R(s)||s.archetype))for(let o of s.standards??[])o in e||i.push(`services.yaml: service '${r}' lists unknown standard '${o}' \u2014 no docs/standards/${o}.md with \`domain: ${o}\``);return i}a(ge,"validateServiceStandards");function z(t){t==null&&(t=g());let e=[];if(!(d.existsSync(t)&&d.statSync(t).isDirectory()))return e;for(let n of J(t)){let i=u.relative(t,n),r=w(n),s=r.domain;if(!(typeof s=="string"&&s.trim())){e.push(`${i}: unparseable frontmatter or missing \`domain:\``);continue}let o=r.summary;typeof o=="string"&&o.trim()||e.push(`${i}: missing or empty \`summary:\``);let c=r.applies_to;Array.isArray(c)&&c.length&&c.every(h=>typeof h=="string"&&h.trim())||e.push(`${i}: \`applies_to:\` must be a non-empty list of non-empty globs (empty means the standard never loads and never re-injects)`);let f=r.phase;f!=null&&!(Array.isArray(f)&&f.length&&f.every(h=>typeof h=="string"&&h.trim()))&&e.push(`${i}: \`phase:\` if present must be a non-empty list of strings (a scalar string silently breaks skill_gen's substring gate)`);let m=r.universal;m!=null&&!Number.isInteger(m)&&e.push(`${i}: \`universal:\` if present must be an integer (its load order) \u2014 \`universal: true\` reads as universal but silently is not`);let p=u.basename(n)==="STANDARD.md"?u.basename(u.dirname(n)):u.basename(n,".md");s.trim()!==p&&e.push(`${i}: \`domain: ${s}\` does not match its location (expected \`${p}\` \u2014 w9r-<domain>-standard would diverge from where the standard lives)`)}return e}a(z,"validateStandardModules");function _e(){let t=g(),e=$e(),n=P();if(n)return{dir:t,repoTrees:e,moduleCount:0,errors:[n]};let i=k();if(!Object.keys(i).length)return{dir:t,repoTrees:e,moduleCount:0,errors:[`no standard modules found in ${t}`]};let r={...i},s=[];for(let o of e){let c=u.basename(u.resolve(o,"..","..")),f=N(o),m=a(p=>`${c}: ${p}`,"tag");s.push(...z(o).map(m)),s.push(...E(f).map(m));for(let p of Object.keys(f))p in i?s.push(m(`\`${p}\` is also a module in ${t}, which wins; rename this one`)):r[p]=f[p]}return{dir:t,repoTrees:e,moduleCount:Object.keys(r).length,errors:[...z(),...E(i),...s,...ge(W(),r)]}}a(_e,"checkStandards");function $e(t=F()){let e;try{e=d.readdirSync(t).sort()}catch{return[]}return e.map(n=>u.join(t,n)).filter(n=>d.statSync(u.join(n,".git"),{throwIfNoEntry:!1})?.isDirectory()).map(Y).filter(n=>d.statSync(n,{throwIfNoEntry:!1})?.isDirectory())}a($e,"repoStandardTrees");function be(t,e){if(!t)return new Set;let n=t.toLowerCase(),i=new Set;for(let[r,s]of Object.entries(e))(s.task_signatures??[]).some(c=>n.includes(String(c).toLowerCase()))&&i.add(r);return i}a(be,"domainsMatchingTaskText");function Me(t,e,n,i,r,s,o){r==null&&(r=k()),o==null&&(o=T());let c;s?.length?c=[...s]:c=t.flatMap(l=>n[l]?.services??[]);let f=new Set;for(let l of c)for(let v of C(e[l],o))f.add(v);let m=i??{},p=m.standards_override??{};for(let l of p.add??[])f.add(l);for(let[l,v]of Object.entries(r))v.repo&&f.add(l);let h=["starting_prompt","task","description"].map(l=>m[l]?String(m[l]):"").join(" ");for(let l of be(h,r))f.add(l);for(let l of p.remove??[])f.delete(l);let $=_(r);for(let l of $)f.add(l);for(let l of[...f])l in r||f.delete(l);let M=a(l=>$.includes(l)?[0,$.indexOf(l),""]:[1,0,l],"sortKey"),q=[...f].sort((l,v)=>{let b=M(l),S=M(v);return b[0]!==S[0]?b[0]-S[0]:b[1]!==S[1]?b[1]-S[1]:b[2]<S[2]?-1:b[2]>S[2]?1:0}),V=Object.keys(r).filter(l=>!f.has(l)).sort();return[q,V]}a(Me,"resolveActiveStandards");function Ie(t,e,n=null){let i=_(e),r={};for(let o of t)i.includes(o)||(r[o]={applies_to:Array.from(e[o]?.applies_to??[]),summary:String(e[o]?.summary??"").trim()});let s={generated_by:"werkmeister workspace init",universal:t.filter(o=>i.includes(o)),domains:r};return n&&(s.phase_gate={...n}),s}a(Ie,"buildStandardsManifest");function Fe(t,e){let n=u.join(I(t),"standards.json");return d.mkdirSync(u.dirname(n),{recursive:!0}),d.writeFileSync(n,JSON.stringify(e,null,2)+`
|
|
30
30
|
`),n}a(Fe,"writeStandardsManifest");export{ne as a,H as b,j as c,we as d,E as e,_ as f,me as g,U as h,Ne as i,k as j,ge as k,_e as l,Me as m,Ie as n,Fe as o};
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
31
|
+
//# sourceMappingURL=chunk-22UWEGCB.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 rs}from"./chunk-
|
|
3
|
+
import{b as rs}from"./chunk-QYAZ2TU3.js";import{a,b as rt,c as S,e as Qo,f as u}from"./chunk-4D6PVTKQ.js";var T=S(B=>{"use strict";u();var os=Symbol.for("yaml.alias"),zn=Symbol.for("yaml.document"),ot=Symbol.for("yaml.map"),Zn=Symbol.for("yaml.pair"),as=Symbol.for("yaml.scalar"),at=Symbol.for("yaml.seq"),J=Symbol.for("yaml.node.type"),Ho=a(s=>!!s&&typeof s=="object"&&s[J]===os,"isAlias"),Xo=a(s=>!!s&&typeof s=="object"&&s[J]===zn,"isDocument"),zo=a(s=>!!s&&typeof s=="object"&&s[J]===ot,"isMap"),Zo=a(s=>!!s&&typeof s=="object"&&s[J]===Zn,"isPair"),ei=a(s=>!!s&&typeof s=="object"&&s[J]===as,"isScalar"),ea=a(s=>!!s&&typeof s=="object"&&s[J]===at,"isSeq");function ti(s){if(s&&typeof s=="object")switch(s[J]){case ot:case at:return!0}return!1}a(ti,"isCollection");function ta(s){if(s&&typeof s=="object")switch(s[J]){case os:case ot:case as:case at:return!0}return!1}a(ta,"isNode");var sa=a(s=>(ei(s)||ti(s))&&!!s.anchor,"hasAnchor");B.ALIAS=os;B.DOC=zn;B.MAP=ot;B.NODE_TYPE=J;B.PAIR=Zn;B.SCALAR=as;B.SEQ=at;B.hasAnchor=sa;B.isAlias=Ho;B.isCollection=ti;B.isDocument=Xo;B.isMap=zo;B.isNode=ta;B.isPair=Zo;B.isScalar=ei;B.isSeq=ea});var Ee=S(ls=>{"use strict";u();var $=T(),R=Symbol("break visit"),si=Symbol("skip children"),U=Symbol("remove node");function lt(s,e){let t=ni(e);$.isDocument(s)?me(null,s.contents,t,Object.freeze([s]))===U&&(s.contents=null):me(null,s,t,Object.freeze([]))}a(lt,"visit");lt.BREAK=R;lt.SKIP=si;lt.REMOVE=U;function me(s,e,t,n){let i=ii(s,e,t,n);if($.isNode(i)||$.isPair(i))return ri(s,n,i),me(s,i,t,n);if(typeof i!="symbol"){if($.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=me(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===R)return R;o===U&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){n=Object.freeze(n.concat(e));let r=me("key",e.key,t,n);if(r===R)return R;r===U&&(e.key=null);let o=me("value",e.value,t,n);if(o===R)return R;o===U&&(e.value=null)}}return i}a(me,"visit_");async function ct(s,e){let t=ni(e);$.isDocument(s)?await ge(null,s.contents,t,Object.freeze([s]))===U&&(s.contents=null):await ge(null,s,t,Object.freeze([]))}a(ct,"visitAsync");ct.BREAK=R;ct.SKIP=si;ct.REMOVE=U;async function ge(s,e,t,n){let i=await ii(s,e,t,n);if($.isNode(i)||$.isPair(i))return ri(s,n,i),ge(s,i,t,n);if(typeof i!="symbol"){if($.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await ge(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===R)return R;o===U&&(e.items.splice(r,1),r-=1)}}}else if($.isPair(e)){n=Object.freeze(n.concat(e));let r=await ge("key",e.key,t,n);if(r===R)return R;r===U&&(e.key=null);let o=await ge("value",e.value,t,n);if(o===R)return R;o===U&&(e.value=null)}}return i}a(ge,"visitAsync_");function ni(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}a(ni,"initVisitor");function ii(s,e,t,n){if(typeof t=="function")return t(s,e,n);if($.isMap(e))return t.Map?.(s,e,n);if($.isSeq(e))return t.Seq?.(s,e,n);if($.isPair(e))return t.Pair?.(s,e,n);if($.isScalar(e))return t.Scalar?.(s,e,n);if($.isAlias(e))return t.Alias?.(s,e,n)}a(ii,"callVisitor");function ri(s,e,t){let n=e[e.length-1];if($.isCollection(n))n.items[s]=t;else if($.isPair(n))s==="key"?n.key=t:n.value=t;else if($.isDocument(n))n.contents=t;else{let i=$.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}a(ri,"replaceNode");ls.visit=lt;ls.visitAsync=ct});var cs=S(ai=>{"use strict";u();var oi=T(),na=Ee(),ia={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ra=a(s=>s.replace(/[!,[\]{}]/g,e=>ia[e]),"escapeTagName"),Oe=class s{static{a(this,"Directives")}constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ra(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&oi.isNode(e.contents)){let r={};na.visit(e.contents,(o,l)=>{oi.isNode(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
4
4
|
`)}};Oe.defaultYaml={explicit:!1,version:"1.2"};Oe.defaultTags={"!!":"tag:yaml.org,2002:"};ai.Directives=Oe});var ft=S(Le=>{"use strict";u();var li=T(),oa=Ee();function aa(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}a(aa,"anchorIsValid");function ci(s){let e=new Set;return oa.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}a(ci,"anchorNames");function fi(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}a(fi,"findNewAnchor");function la(s,e){let t=[],n=new Map,i=null;return{onAnchor:a(r=>{t.push(r),i??(i=ci(s));let o=fi(e,i);return i.add(o),o},"onAnchor"),setAnchors:a(()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(li.isScalar(o.node)||li.isCollection(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},"setAnchors"),sourceObjects:n}}a(la,"createNodeAnchors");Le.anchorIsValid=aa;Le.anchorNames=ci;Le.createNodeAnchors=la;Le.findNewAnchor=fi});var fs=S(ui=>{"use strict";u();function Te(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],l=Te(s,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=Te(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=Te(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=Te(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}a(Te,"applyReviver");ui.applyReviver=Te});var H=S(di=>{"use strict";u();var ca=T();function hi(s,e,t){if(Array.isArray(s))return s.map((n,i)=>hi(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!ca.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}a(hi,"toJS");di.toJS=hi});var ut=S(mi=>{"use strict";u();var fa=fs(),pi=T(),ua=H(),us=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,pi.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!pi.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=ua.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:f}of o.anchors.values())i(f,c);return typeof r=="function"?fa.applyReviver(r,{"":l},"",l):l}};mi.NodeBase=us});var Ce=S(gi=>{"use strict";u();var ha=ft(),da=Ee(),ye=T(),pa=ut(),ma=H(),hs=class extends pa.NodeBase{static{a(this,"Alias")}constructor(e){super(ye.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],da.visit(e,{Node:a((r,o)=>{(ye.isAlias(o)||ye.hasAnchor(o))&&n.push(o)},"Node")}),t&&(t.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=n.get(o);if(l||(ma.toJS(o,null,t),l=n.get(o)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=ht(i,o,n)),l.count*l.aliasCount>r)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(ha.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function ht(s,e,t){if(ye.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(ye.isCollection(e)){let n=0;for(let i of e.items){let r=ht(s,i,t);r>n&&(n=r)}return n}else if(ye.isPair(e)){let n=ht(s,e.key,t),i=ht(s,e.value,t);return Math.max(n,i)}return 1}a(ht,"getAliasCount");gi.Alias=hs});var _=S(ds=>{"use strict";u();var ga=T(),ya=ut(),ba=H(),Sa=a(s=>!s||typeof s!="function"&&typeof s!="object","isScalarValue"),X=class extends ya.NodeBase{static{a(this,"Scalar")}constructor(e){super(ga.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:ba.toJS(this.value,e,t)}toString(){return String(this.value)}};X.BLOCK_FOLDED="BLOCK_FOLDED";X.BLOCK_LITERAL="BLOCK_LITERAL";X.PLAIN="PLAIN";X.QUOTE_DOUBLE="QUOTE_DOUBLE";X.QUOTE_SINGLE="QUOTE_SINGLE";ds.Scalar=X;ds.isScalarValue=Sa});var Ie=S(bi=>{"use strict";u();var wa=Ce(),le=T(),yi=_(),va="tag:yaml.org,2002:";function ka(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}a(ka,"findTagObject");function Na(s,e,t){if(le.isDocument(s)&&(s=s.contents),le.isNode(s))return s;if(le.isPair(s)){let h=t.schema[le.MAP].createNode?.(t.schema,null,t);return h.items.push(s),h}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t,c;if(n&&s&&typeof s=="object"){if(c=l.get(s),c)return c.anchor??(c.anchor=i(s)),new wa.Alias(c.anchor);c={anchor:null,node:null},l.set(s,c)}e?.startsWith("!!")&&(e=va+e.slice(2));let f=ka(s,e,o.tags);if(!f){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let h=new yi.Scalar(s);return c&&(c.node=h),h}f=s instanceof Map?o[le.MAP]:Symbol.iterator in Object(s)?o[le.SEQ]:o[le.MAP]}r&&(r(f),delete t.onTagObj);let m=f?.createNode?f.createNode(t.schema,s,t):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(t.schema,s,t):new yi.Scalar(s);return e?m.tag=e:f.default||(m.tag=f.tag),c&&(c.node=m),m}a(Na,"createNode");bi.createNode=Na});var pt=S(dt=>{"use strict";u();var Aa=Ie(),V=T(),qa=ut();function ps(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Aa.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:s,sourceObjects:new Map})}a(ps,"collectionFromPath");var Si=a(s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,"isEmptyPath"),ms=class extends qa.NodeBase{static{a(this,"Collection")}constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>V.isNode(n)||V.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Si(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(V.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,ps(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(V.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&V.isScalar(r)?r.value:r:V.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!V.isPair(t))return!1;let n=t.value;return n==null||e&&V.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return V.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(V.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,ps(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};dt.Collection=ms;dt.collectionFromPath=ps;dt.isEmptyPath=Si});var _e=S(mt=>{"use strict";u();var Ea=a(s=>s.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function gs(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}a(gs,"indentComment");var Oa=a((s,e,t)=>s.endsWith(`
|
|
5
5
|
`)?gs(t,e):t.includes(`
|
|
6
6
|
`)?`
|
|
@@ -142,4 +142,4 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
142
142
|
`;e.push(n),s?.(n)},text:a(()=>e.join(""),"text")}}a(Gm,"collectingReporter");u();var Gn=Qo(Fo(),1);import*as D from"node:fs";import*as oe from"node:os";import*as A from"node:path";function G(s){return s==="~"?oe.homedir():s.startsWith("~/")?A.join(oe.homedir(),s.slice(2)):s}a(G,"expandUser");function nt(s){return process.env[`WERKMEISTER_${s}`]}a(nt,"envVar");var Cu=a(()=>nt("FIXTURE")==="1","isFixture");function tg(){if(Cu())return"WERKMEISTER_FIXTURE";if(A.resolve(Qn())!==A.join(rs(oe.homedir()),"config.yaml"))return"WERKMEISTER_CONFIG_FILE is not the default home"}a(tg,"sharedProxySkipReason");function Qn(){let s=nt("CONFIG_FILE");return s?G(s):A.join(rs(oe.homedir()),"config.yaml")}a(Qn,"configPath");function Uo(){return A.dirname(Qn())}a(Uo,"sandboxHome");function Y(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}a(Y,"isDict");function it(){let s=Qn();if(!D.existsSync(s))return{};let e=(0,Gn.parse)(D.readFileSync(s,"utf8"));return Y(e)?e:{}}a(it,"loadConfig");function Hn(s,e,t){let n=it().overrides?.[s];if(n)return A.resolve(G(String(n)));let i=nt(e);return i?A.resolve(G(i)):A.join(Uo(),t)}a(Hn,"registryPath");function Vo(){return Hn("services_yaml","SERVICES_YAML","services.yaml")}a(Vo,"servicesYamlPath");function sg(){return A.join(A.dirname(Vo()),"services.local.yaml")}a(sg,"servicesLocalYamlPath");function Iu(){return Hn("ports_yaml","PORTS_YAML","ports.yaml")}a(Iu,"portsYamlPath");function ng(){return Hn("model_pricing_yaml","MODEL_PRICING_YAML","model-pricing.yaml")}a(ng,"modelPricingYamlPath");function ig(){let s=it().paths?.workspaces_root;if(s)return A.resolve(G(String(s)));let e=nt("WORKSPACES_ROOT");return e?A.resolve(G(e)):A.join(oe.homedir(),"workspace")}a(ig,"workspacesRoot");function _u(s,e){if(!Y(e)||e.baseline_upstream===void 0||e.baseline_upstream===null)return null;let t=e.baseline_upstream,n=typeof t=="string"?/^(\S+):([0-9]{1,5})$/.exec(t):null,i=n?Number(n[2]):0;if(!n||i<1||i>65535)throw new Error(`services.yaml: '${s}'.baseline_upstream must be host:port, got ${JSON.stringify(t)}`);return{host:n[1],port:i}}a(_u,"baselineUpstream");function rg(s,e){let t=[],n=a((i,r)=>{if(Y(i))for(let[o,l]of Object.entries(i))!Y(l)||l.k8s_forward_port===null||l.k8s_forward_port===void 0||_u(o,l)||t.push({name:r&&l.k8s_forward_name||o,listen:Number(l.k8s_forward_port),remote:l.internal_port,ns:l.k8s_namespace||"",prefix:l.k8s_pod_prefix||"",health:l.health_endpoint||""})},"collect");return n(s,!0),n(e,!1),t}a(rg,"forwardSpecs");function og(s,e){let t=Y(e)&&Y(e.feature_slots)?e.feature_slots:{},n=t.base_port??11100,i=t.ports_per_slot??20,r=n+(s-1)*100;return[r,r+i-1]}a(og,"slotPortRange");function Jo(s){return Y(s)?s:{}}a(Jo,"asDict");function ag(){let s=Jo(it().paths).repos_root;return s?A.resolve(G(s)):A.resolve(A.join(oe.homedir(),"workspace"))}a(ag,"getReposRoot");function Pu(){let s=process.cwd();try{for(let t of D.readdirSync(s,{withFileTypes:!0}))if(t.isDirectory()&&D.existsSync(A.join(s,t.name,".git")))return s}catch{}let e=s;for(;;){if(D.existsSync(A.join(e,".git")))return A.dirname(e);let t=A.dirname(e);if(t===e)break;e=t}return null}a(Pu,"detectWorkspaceFromCwd");function lg(s,e){if(e)return A.resolve(e);let t=Jo(it().paths).workspaces_root;if(t){let i=A.resolve(G(t)),r=A.resolve(process.cwd()),o=A.relative(i,r);if(o&&!o.startsWith("..")&&!A.isAbsolute(o))return A.join(i,o.split(A.sep)[0]);let l=A.join(i,s);return D.existsSync(l)&&D.statSync(l).isDirectory()?l:i}let n=Pu();return n||A.join(oe.homedir(),"workspace")}a(lg,"resolveWorkspace");function Wo(s,{required:e=!1}={}){if(!D.existsSync(s)){if(e){let n=`Required config file not found: ${s}
|
|
143
143
|
Run \`werkmeister machine setup\` to seed the machine-global config in ~/.werkmeister.`;throw Wn(n),new Error(n)}return xo(`Config file not found: ${s}`),{}}let t=(0,Gn.parse)(D.readFileSync(s,"utf8"));if(!Y(t)||Object.keys(t).length===0){if(e){let n=`Required config file is empty or invalid: ${s}
|
|
144
144
|
Run \`werkmeister machine setup\` to seed the machine-global config in ~/.werkmeister.`;throw Wn(n),new Error(n)}return{}}return t}a(Wo,"loadYaml");var cg=["cli","library","extension"];function fg(s,e){let t=a(n=>!s.includes(n),"remote");return s.some(n=>{let i=e[n];if(!Y(i))return!1;if(i.k8s_deployment)return!0;let r=Y(i.environment)?Object.values(i.environment):[];for(let o of r)if(typeof o=="string"){if(/\bk8s-[a-z0-9-]+/.test(o))return!0;for(let[,l]of o.matchAll(/(?<!\$)\{([a-zA-Z0-9_-]+)\}/g))if(t(l))return!0}return(i.depends_on??[]).some(t)})}a(fg,"needsCluster");var ug="1.0",hg="2.0";function ae({required:s=!0}={}){return Wo(Vo(),{required:s})}a(ae,"servicesDoc");function Mu(){let s=ae();return s.services??s}a(Mu,"loadServices");function dg(){let e=ae().k8s_context;if(!e||typeof e!="string")throw new Error("services.yaml has no top-level `k8s_context` key \u2014 add the dev cluster kube context there (e.g. `k8s_context: orbstack`); `kubectl config get-contexts` lists the available names.");return e}a(dg,"getK8sContext");function $u(){return ae({required:!1}).setup_services??{}}a($u,"loadSetupServices");function pg(){return ae({required:!1}).infrastructure??{}}a(pg,"loadInfrastructure");function mg(){return Wo(Iu(),{required:!0})}a(mg,"loadPorts");function gg(){return ae({required:!1}).repos??{}}a(gg,"loadReposConfig");function yg(){return ae({required:!1}).archetypes??{}}a(yg,"loadArchetypes");function bg(){return ae({required:!1}).mcp_servers??{}}a(bg,"loadMcpServers");function Sg(){return ae({required:!1}).caches??{}}a(Sg,"loadCaches");var Du="^";function Bu(){let s=new Set,e=a(t=>{for(let n of Object.values(t)){if(!Y(n))continue;let i=n.node_modules_volume;typeof i=="string"&&i&&(s.add(i),typeof n.repo=="string"&&n.repo&&s.add(`${n.repo}-${i}`));let r=n.extra_volumes;if(Array.isArray(r))for(let o of r){if(typeof o!="string")continue;let l=o.split(":")[0];l&&!l.startsWith(Du)&&!l.includes("/")&&s.add(l)}}},"collect");return e(Mu()),e($u()),s}a(Bu,"registryVolumeBases");function wg(){return[...Bu()].sort()}a(wg,"getVolumeBaseNames");function Go(){let s=import.meta.dirname;for(let e=0;e<8;e++){let t=A.join(s,"apps","cli");if(D.existsSync(t))return t;let n=A.dirname(s);if(n===s)break;s=n}return null}a(Go,"ownCheckoutCli");function Ru(){try{let s=it().paths?.werkmeister_root;return typeof s=="string"&&s?A.resolve(G(s)):null}catch{return null}}a(Ru,"storedWerkmeisterRoot");function is(){if(process.env.NODE_TEST_CONTEXT&&!process.env.WERKMEISTER_ROOT_PINNED)throw new Error("sandboxRoot() reached in a test without pinWerkmeisterRoot() (fixtures.mjs)");let s=nt("ROOT");if(s)return A.resolve(G(s));let e=Go();if(e)return e;let t=ju();if(t)return t;throw new Error("Could not locate the werkmeister CLI package. Install it (npm install -g werkmeister) or set WERKMEISTER_ROOT to its package directory (a checkout's apps/cli).")}a(is,"sandboxRoot");function ju(s=process.env.PATH??""){for(let e of s.split(A.delimiter)){if(!e)continue;let t;try{t=A.dirname(D.realpathSync(A.join(e,"werkmeister")))}catch{continue}for(;t!==A.dirname(t);t=A.dirname(t)){let n=A.join(t,"package.json");if(D.existsSync(n)){try{if(JSON.parse(D.readFileSync(n,"utf8")).name==="werkmeister")return t}catch{}break}}}return null}a(ju,"installedCliPackage");function vg(){return A.join(is(),"infra")}a(vg,"infraRoot");function kg(){let s=is(),e=Go(),t=e!==null&&e!==s&&s===Ru();return A.join(t?e:s,"infra")}a(kg,"sourceInfraRoot");function Ng(){return A.resolve(Uo(),"infra")}a(Ng,"stateInfraRoot");function Ag(s,e){return`${s}-${e}`}a(Ag,"containerOf");function qg(){let s=is();for(let e=0;e<4;e++){if(D.existsSync(A.join(s,"apps")))return s;let t=A.dirname(s);if(t===s)break;s=t}return is()}a(qg,"monorepoRoot");export{Fo as a,xn as b,Yn as c,Au as d,qu as e,Un as f,Vn as g,Bm as h,xm as i,Ym as j,Um as k,xo as l,Wn as m,Vm as n,Jm as o,Wm as p,Gm as q,G as r,nt as s,Cu as t,tg as u,Qn as v,Uo as w,it as x,Vo as y,sg as z,Iu as A,ng as B,ig as C,_u as D,rg as E,og as F,ag as G,lg as H,cg as I,fg as J,ug as K,hg as L,Mu as M,dg as N,$u as O,pg as P,mg as Q,gg as R,yg as S,bg as T,Sg as U,Du as V,wg as W,is as X,ju as Y,vg as Z,kg as _,Ng as $,Ag as aa,qg as ba};
|
|
145
|
-
//# sourceMappingURL=chunk-
|
|
145
|
+
//# sourceMappingURL=chunk-3VV3O3AJ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var p=(a,b)=>e(a,"name",{value:b,configurable:!0}),q=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var l=(a,b)=>()=>(a&&(b=a(a=0)),b);var r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),s=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},m=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var t=(a,b,c)=>(c=a!=null?g(j(a)):{},m(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));var w,o=l(()=>{w={sha:"
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var p=(a,b)=>e(a,"name",{value:b,configurable:!0}),q=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var l=(a,b)=>()=>(a&&(b=a(a=0)),b);var r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),s=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},m=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var t=(a,b,c)=>(c=a!=null?g(j(a)):{},m(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));var w,o=l(()=>{w={sha:"c48fd683eed147be3a9b2e0ae8dddf866c21e53e",dirty:!1,content:""}});export{p as a,q as b,r as c,s as d,t as e,o as f,w as g};
|
|
4
|
+
//# sourceMappingURL=chunk-4D6PVTKQ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as p,b as a}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as p,b as a}from"./chunk-QYAZ2TU3.js";import{a as o,f as c}from"./chunk-4D6PVTKQ.js";c();import*as i from"node:fs";import*as s from"node:path";function u(t){let e=s.resolve(t);for(;;){if(i.existsSync(s.join(a(e),"workspace.yml")))return e;let r=s.dirname(e);if(r===e)return null;e=r}}o(u,"findRecordRoot");function d(t){try{let e=i.readdirSync(s.join(t,"stages")).filter(n=>/^\d+_/.test(n)).sort(),r=e.find(n=>/^\d+_propose$/.test(n))??e.find(n=>/^\d+_ship$/.test(n))??e.at(-1);return r?`stages/${r}/output/`:"the last stage's output/"}catch{return`${s.basename(a(t))}/notes/`}}o(d,"prFileDirName");var f=/(?<!<)<<(?!<)-?\s*(['"]?)(\w+)\1([^\n]*)(?:\n(?:[\s\S]*?\n)?\t*\2(?=\n|$)|[\s\S]*$)/g,m=/'[^']*(?:'|$)|"(?:[^"\\]|\\[\s\S])*(?:"|$)/g,h=/(?:^|[;&|({\n`])\s*(?:(?:\w+=\S*|command|exec|env|then|do|else)\s+)*gh\s+pr\s+create\b/,R=/create_pull_request$/;function y(t){return h.test(t.replace(f,"$3").replace(m,"_"))}o(y,"opensPr");function S(t){return["_shared/pr-rules.md",`${p}/pr-rules.md`].find(e=>i.existsSync(s.join(t,e)))??"docs/workspace-lifecycle.md in the werkmeister repo"}o(S,"prRulesPath");function _(t){let e=u(String(t.cwd||process.cwd()));if(!e)return null;let r=String(t.tool_name||""),n=String(t.tool_input?.command||"");if(!(r==="Bash"&&y(n)||R.test(r)))return null;let l=S(e);return`Inside workspace \`${s.basename(e)}\`, PRs open only through \`werkmeister pr open\`: it runs the pre-PR gate and records the URL. Write the PR file in \`${d(e)}\`, have the person set \`status: approved\`, then run \`werkmeister pr open\`. Rules: \`${l}\`.`}o(_,"decide");function w(){let t=null;try{let e=process.stdin.isTTY?"":i.readFileSync(0,"utf8"),r=e.trim()?JSON.parse(e):{};typeof r=="object"&&r!==null&&!Array.isArray(r)&&(t=_(r))}catch{t=null}t&&console.log(JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:t}}))}o(w,"main");export{u as a,S as b,w as c};
|
|
4
|
+
//# sourceMappingURL=chunk-5H3PSAWE.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as o,c as w,f as u}from"./chunk-
|
|
3
|
+
import{a as o,c as w,f as u}from"./chunk-4D6PVTKQ.js";var $=w(s=>{"use strict";u();var y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,c=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,E=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,v=/\\([\u000b\u0020-\u00ff])/g,h=/([\\"])/g,d=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;s.format=g;s.parse=T;function g(r){if(!r||typeof r!="object")throw new TypeError("argument obj is required");var e=r.parameters,t=r.type;if(!t||!d.test(t))throw new TypeError("invalid type");var f=t;if(e&&typeof e=="object")for(var a,p=Object.keys(e).sort(),n=0;n<p.length;n++){if(a=p[n],!E.test(a))throw new TypeError("invalid parameter name");f+="; "+a+"="+m(e[a])}return f}o(g,"format");function T(r){if(!r)throw new TypeError("argument string is required");var e=typeof r=="object"?l(r):r;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var t=e.indexOf(";"),f=t!==-1?e.slice(0,t).trim():e.trim();if(!d.test(f))throw new TypeError("invalid media type");var a=new _(f.toLowerCase());if(t!==-1){var p,n,i;for(y.lastIndex=t;n=y.exec(e);){if(n.index!==t)throw new TypeError("invalid parameter format");t+=n[0].length,p=n[1].toLowerCase(),i=n[2],i.charCodeAt(0)===34&&(i=i.slice(1,-1),i.indexOf("\\")!==-1&&(i=i.replace(v,"$1"))),a.parameters[p]=i}if(t!==e.length)throw new TypeError("invalid parameter format")}return a}o(T,"parse");function l(r){var e;if(typeof r.getHeader=="function"?e=r.getHeader("content-type"):typeof r.headers=="object"&&(e=r.headers&&r.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}o(l,"getcontenttype");function m(r){var e=String(r);if(E.test(e))return e;if(e.length>0&&!c.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(h,"\\$1")+'"'}o(m,"qstring");function _(r){this.parameters=Object.create(null),this.type=r}o(_,"ContentType")});export{$ as a};
|
|
4
4
|
/*! Bundled license information:
|
|
5
5
|
|
|
6
6
|
content-type/index.js:
|
|
@@ -10,4 +10,4 @@ content-type/index.js:
|
|
|
10
10
|
* MIT Licensed
|
|
11
11
|
*)
|
|
12
12
|
*/
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-5SCP3EXM.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as _,b as $}from"./chunk-
|
|
3
|
+
import{a as _,b as $}from"./chunk-VB6QEYWA.js";import{s as O,t as C}from"./chunk-3VV3O3AJ.js";import{a as r,f as x}from"./chunk-4D6PVTKQ.js";x();import{spawn as b}from"node:child_process";import{writeFileSync as A}from"node:fs";import g from"node:fs/promises";import T from"node:os";import E from"node:path";import{stripVTControlCharacters as D}from"node:util";function Z(e){return D(e)}r(Z,"stripAnsi");async function ee(e){try{return await g.access(e,g.constants.X_OK),!0}catch{return!1}}r(ee,"isExecutable");async function te(e){try{return(await g.stat(e)).isFile()}catch{return!1}}r(te,"isFile");var M=["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR"];function R(e=process.env){return Object.fromEntries(Object.entries(e).filter(([t])=>!M.includes(t)))}r(R,"gitEnv");function P(){let e=[E.join(T.homedir(),".local","bin"),E.join(T.homedir(),".cargo","bin"),"/opt/homebrew/bin","/usr/local/bin","/usr/bin","/bin"],t=process.env.PATH?process.env.PATH.split(E.delimiter):[],o=[...new Set([...e,...t])].join(E.delimiter);return R({...process.env,PATH:o})}r(P,"childEnv");var y=r(()=>O("GH_BIN")||(C()?h("gh"):"gh"),"ghBin"),K=r(()=>process.env.CLAUDE_BIN||h("claude"),"fixtureClaudeBin"),G=r(()=>process.env.CODEX_BIN||h("codex"),"fixtureCodexBin"),U=r(()=>process.env.OPENCODE_BIN||h("opencode"),"fixtureOpencodeBin"),F=r(()=>O("DOCKER_BIN")||"docker","dockerBin");function w(e){return e==="gh"?y():e==="docker"?F():C()?e==="claude"?K():e==="codex"?G():e==="opencode"?U():e==="kubectl"?h("kubectl"):e:e}r(w,"toolBin");var v=new Map;function h(e){let t=v.get(e);if(t)return t;let o=E.join(T.tmpdir(),`werkmeister-fixture-${e}-${process.pid}`);return A(o,`#!/bin/sh
|
|
4
4
|
echo "${e} called under WERKMEISTER_FIXTURE: $*" >&2
|
|
5
5
|
exit 1
|
|
6
6
|
`,{mode:493}),v.set(e,o),o}r(h,"fixtureStub");function re(e,t,o=T.homedir()){return new Promise((i,s)=>{let n=b(w(e),t,{cwd:o,env:P(),stdio:["ignore","pipe","pipe"]}),u="",a="",l=setTimeout(()=>{n.kill("SIGKILL"),s(new $("The `claude` CLI timed out after 120s.",_))},12e4);n.stdout.on("data",c=>u+=c.toString()),n.stderr.on("data",c=>a+=c.toString()),n.on("error",c=>{clearTimeout(l),s(c)}),n.on("close",c=>{clearTimeout(l),i({stdout:u,stderr:a,code:c})})})}r(re,"runCapture");function ne(e){return`'${e.replace(/'/g,"'\\''")}'`}r(ne,"shellQuote");x();import{spawn as L,spawnSync as H}from"node:child_process";var N=r((e,t)=>e[0]==="git"?R(t):t,"spawnEnv"),S=r(e=>e*Number(process.env.WERKMEISTER_TIMEOUT_SCALE||1)*1e3,"timeoutMs"),p=class extends Error{static{r(this,"ProcError")}status;stdout;stderr;cmd;code;constructor(t,o,i,s="",n="",u){super(t),this.name="ProcError",this.cmd=o,this.status=i,this.stdout=s,this.stderr=n,this.code=u}};function de(e,t={}){let o=t.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];t.input!==void 0&&(o[0]="pipe");let i=H(w(e[0]),e.slice(1),{cwd:t.cwd,env:N(e,t.env),input:t.input,timeout:t.timeout!==void 0?S(t.timeout):void 0,encoding:"utf8",stdio:o}),s=i.stdout??"",n=i.stderr??"";if(i.error){let a=i.error.code;throw a==="ETIMEDOUT"?new p(`Command timed out after ${t.timeout}s: ${e.join(" ")}`,e,i.status??-1,s,n,"ETIMEDOUT"):a==="ENOENT"?new p(`Command not found: ${e[0]}`,e,-1,s,n,"ENOENT"):new p(`Command failed to start: ${e.join(" ")} (${i.error.message})`,e,i.status??-1,s,n,a)}let u=i.status??-1;if(t.check&&u!==0)throw new p(`Command failed with exit code ${u}: ${e.join(" ")}`,e,u,s,n);return{status:u,stdout:s,stderr:n}}r(de,"run");function ae(e,t={}){return new Promise((o,i)=>{let s=t.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];t.input!==void 0&&(s[0]="pipe");let n=L(w(e[0]),e.slice(1),{cwd:t.cwd,env:N(e,t.env),stdio:s,signal:t.signal}),u=t.timeout!==void 0?setTimeout(()=>n.kill(),S(t.timeout)):void 0,a="",l="";n.stdout?.on("data",d=>a+=d.toString()),n.stderr?.on("data",d=>l+=d.toString()),t.input!==void 0&&n.stdin?.end(t.input);let c=!1,m=r((d,f,j)=>{c||(c=!0,i(new p(d,e,f,a,l,j)))},"fail"),B=r(d=>{c||(c=!0,o({status:d,stdout:a,stderr:l}))},"done"),I=r(()=>t.signal?.aborted===!0,"aborted");n.on("error",d=>{clearTimeout(u);let f=d.code;if(I()){m(`Command aborted: ${e.join(" ")}`,-1,"ABORT_ERR");return}if(f==="ENOENT"){m(`Command not found: ${e[0]}`,-1,"ENOENT");return}m(`Command failed to start: ${e.join(" ")} (${d.message})`,-1,f)}),n.on("close",d=>{if(clearTimeout(u),I()){m(`Command aborted: ${e.join(" ")}`,-1,"ABORT_ERR");return}if(n.killed&&t.timeout!==void 0){m(`Command timed out after ${t.timeout}s: ${e.join(" ")}`,-1,"ETIMEDOUT");return}let f=d??-1;if(t.check&&f!==0){m(`Command failed with exit code ${f}: ${e.join(" ")}`,f);return}B(f)})})}r(ae,"runAsync");export{Z as a,ee as b,te as c,R as d,P as e,y as f,K as g,G as h,U as i,F as j,w as k,re as l,ne as m,p as n,de as o,ae as p};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-5VYM7DYM.js.map
|