@buddysh/buddy 0.11.9 → 0.11.11
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/CHANGELOG.md +28 -0
- package/dist/bin/cli.js +19 -19
- package/dist/{chunk-p9z0hzej.js → chunk-08daxhzx.js} +2 -2
- package/dist/{chunk-ja3rvd6y.js → chunk-0f1xye20.js} +1 -1
- package/dist/{chunk-be059ncv.js → chunk-0g4ybxwj.js} +2 -2
- package/dist/{chunk-2m0134q8.js → chunk-0m1z85m9.js} +1 -1
- package/dist/chunk-0m6b7bac.js +2 -0
- package/dist/{chunk-6xzzs109.js → chunk-0rbxek2f.js} +2 -2
- package/dist/chunk-0sm25gee.js +2 -0
- package/dist/{chunk-xny4kgcc.js → chunk-142zh7e5.js} +1 -1
- package/dist/chunk-18xha279.js +2 -0
- package/dist/{chunk-jpdd59fh.js → chunk-1pecmenc.js} +1 -1
- package/dist/chunk-1tx3t9ke.js +2 -0
- package/dist/chunk-1w1h2tsf.js +2 -0
- package/dist/{chunk-nwrr6jas.js → chunk-1xe0960b.js} +2 -2
- package/dist/{chunk-emygmh7r.js → chunk-24xvskkf.js} +1 -1
- package/dist/{chunk-r7nh070r.js → chunk-25sjd6zk.js} +5 -5
- package/dist/{chunk-6wxwewbh.js → chunk-2e4e6zjs.js} +1 -1
- package/dist/chunk-2h90wcxe.js +2 -0
- package/dist/{chunk-7bctsv0x.js → chunk-2hb8dan0.js} +1 -1
- package/dist/{chunk-z21tw4fz.js → chunk-2jjrxgs1.js} +2 -2
- package/dist/{chunk-6k6dgwmy.js → chunk-2z9pkk1y.js} +1 -1
- package/dist/{chunk-9m0epv44.js → chunk-33h1me7n.js} +2 -2
- package/dist/{chunk-khn11t39.js → chunk-3c114myc.js} +1 -1
- package/dist/{chunk-rg996jqw.js → chunk-40pvn33p.js} +1 -1
- package/dist/{chunk-k3x0mabj.js → chunk-42xvqxdw.js} +2 -2
- package/dist/{chunk-d4wqe366.js → chunk-4kr6evh6.js} +1 -1
- package/dist/{chunk-1m5wprvm.js → chunk-54er1whp.js} +2 -2
- package/dist/{chunk-y7z0br2x.js → chunk-59993g25.js} +1 -1
- package/dist/{chunk-7crh00m7.js → chunk-5jvde2as.js} +2 -2
- package/dist/{chunk-y9senfb6.js → chunk-5pheqk23.js} +1 -1
- package/dist/{chunk-db9rffcf.js → chunk-5vekh5w1.js} +1 -1
- package/dist/{chunk-drkzf2gz.js → chunk-62j8q7sg.js} +1 -1
- package/dist/chunk-64kt1w23.js +2 -0
- package/dist/{chunk-4akhxmfk.js → chunk-65by8f14.js} +1 -1
- package/dist/chunk-6gdenphk.js +2 -0
- package/dist/chunk-6pcnvdj9.js +2 -0
- package/dist/{chunk-mdbf728w.js → chunk-77qe887p.js} +1 -1
- package/dist/{chunk-mg3em5qj.js → chunk-7b4jsg36.js} +2 -2
- package/dist/{chunk-hkb714k3.js → chunk-7c1284fb.js} +1 -1
- package/dist/chunk-7m1ab6p8.js +2 -0
- package/dist/{chunk-bggpgbdx.js → chunk-7m3pzkcj.js} +1 -1
- package/dist/chunk-83yea9pk.js +2 -0
- package/dist/{chunk-04qvf24t.js → chunk-89jytkd6.js} +1 -1
- package/dist/{chunk-bjymeq7e.js → chunk-8swwcx7w.js} +1 -1
- package/dist/chunk-9exbsfz5.js +2 -0
- package/dist/{chunk-ysgex7h7.js → chunk-a3zgenkh.js} +1 -1
- package/dist/{chunk-xffrrs85.js → chunk-afstgmb4.js} +11 -11
- package/dist/{chunk-7ds5q6j3.js → chunk-apdrg3r7.js} +1 -1
- package/dist/{chunk-88xaexj1.js → chunk-b3s185kp.js} +1 -1
- package/dist/chunk-b59zbkfx.js +2 -0
- package/dist/{chunk-34rmja4x.js → chunk-b6a5txek.js} +2 -2
- package/dist/{chunk-a3bnhq58.js → chunk-b9szrnxw.js} +1 -1
- package/dist/{chunk-fpzgxg8a.js → chunk-be7g40yf.js} +1 -1
- package/dist/{chunk-89s9f3mf.js → chunk-bnp0r4eh.js} +1 -1
- package/dist/{chunk-se4g70q2.js → chunk-bsh3kp53.js} +1 -1
- package/dist/{chunk-vckn5ate.js → chunk-cj4d5ad7.js} +1 -1
- package/dist/chunk-csqh2ca4.js +3 -0
- package/dist/{chunk-xps8n8nj.js → chunk-d9m42wym.js} +2 -2
- package/dist/{chunk-61gfjcqt.js → chunk-dd895pm0.js} +1 -1
- package/dist/{chunk-h8e796qs.js → chunk-ddky3026.js} +1 -1
- package/dist/{chunk-rrnvxj90.js → chunk-dsnd6ndd.js} +1 -1
- package/dist/{chunk-pmszvhja.js → chunk-esm5jjgf.js} +1 -1
- package/dist/chunk-ffbbc38r.js +2 -0
- package/dist/{chunk-p5yaf72b.js → chunk-g0x10e1d.js} +38 -34
- package/dist/{chunk-kh6v93yb.js → chunk-gpjde0j6.js} +2 -2
- package/dist/{chunk-4wbbbcs2.js → chunk-gweqk008.js} +2 -2
- package/dist/{chunk-a34szd4r.js → chunk-gzkwszsg.js} +3 -3
- package/dist/{chunk-jxd64dzs.js → chunk-h8wskvjv.js} +1 -1
- package/dist/{chunk-kpdz73mc.js → chunk-hc651afv.js} +1 -1
- package/dist/chunk-hmymd6m2.js +2 -0
- package/dist/{chunk-88j356ng.js → chunk-j46f90n8.js} +1 -1
- package/dist/chunk-jhz202wk.js +2 -0
- package/dist/{chunk-1szfwcst.js → chunk-jqh7vx2n.js} +1 -1
- package/dist/{chunk-amj037yy.js → chunk-jsf2322c.js} +3 -3
- package/dist/{chunk-qdmr84mc.js → chunk-k3r7v3dp.js} +2 -2
- package/dist/{chunk-s3ksf6s5.js → chunk-kbvj6qxc.js} +1 -1
- package/dist/{chunk-gvnsr72j.js → chunk-knpdntnh.js} +1 -1
- package/dist/chunk-kq0n3x2e.js +2 -0
- package/dist/{chunk-ktmgq0ja.js → chunk-ktn47bq8.js} +1 -1
- package/dist/chunk-m1zv8db4.js +2 -0
- package/dist/chunk-m63hkte2.js +2 -0
- package/dist/{chunk-s3q7g2hy.js → chunk-mpb1g0xk.js} +1 -1
- package/dist/{chunk-d7jpbw1z.js → chunk-mt53v4sx.js} +1 -1
- package/dist/{chunk-3waqfh3y.js → chunk-naz864cb.js} +2 -2
- package/dist/{chunk-90q6r1j7.js → chunk-nbyxgt9c.js} +1 -1
- package/dist/chunk-njrezpsw.js +2 -0
- package/dist/{chunk-gyf7psxg.js → chunk-nkztawjh.js} +1 -1
- package/dist/chunk-pegk4jhq.js +2 -0
- package/dist/{chunk-k7x9af5r.js → chunk-pq115qkn.js} +2 -2
- package/dist/{chunk-q90s02qc.js → chunk-q7y8dvbz.js} +1 -1
- package/dist/{chunk-wjmp2hsj.js → chunk-qdr900z7.js} +1 -1
- package/dist/chunk-qxf3f6ks.js +2 -0
- package/dist/{chunk-tx9m7y1z.js → chunk-raj75r4h.js} +2 -2
- package/dist/chunk-rphwf28s.js +2 -0
- package/dist/chunk-rr8apsh5.js +2 -0
- package/dist/{chunk-jj1gjkb7.js → chunk-ry5zh9cx.js} +1 -1
- package/dist/chunk-sd5xqd44.js +2 -0
- package/dist/{chunk-7rjrea9g.js → chunk-sxfk3naz.js} +2 -2
- package/dist/chunk-tbt8btwf.js +2 -0
- package/dist/chunk-tjvvb919.js +2 -0
- package/dist/{chunk-ggzjv4s0.js → chunk-va3k91tf.js} +1 -1
- package/dist/{chunk-hdqmcp3n.js → chunk-vmt1bed1.js} +1 -1
- package/dist/chunk-vpsvtb9v.js +2 -0
- package/dist/{chunk-pxdrwhxx.js → chunk-vpw7adwd.js} +1 -1
- package/dist/{chunk-8tsw3cjk.js → chunk-vs68hsbp.js} +1 -1
- package/dist/{chunk-2145m12g.js → chunk-vtr2vbk0.js} +1 -1
- package/dist/{chunk-4hd1mryc.js → chunk-w55x2g9n.js} +2 -2
- package/dist/{chunk-hyp0wfta.js → chunk-wjfw6rx8.js} +2 -2
- package/dist/chunk-wt83nzn3.js +2 -0
- package/dist/{chunk-8dj94fsy.js → chunk-x1w6q9tk.js} +1 -1
- package/dist/{chunk-wreexgkb.js → chunk-xdrvb89m.js} +3 -3
- package/dist/chunk-xxwevpnr.js +2 -0
- package/dist/{chunk-wd8w0vjs.js → chunk-y3w8h4sy.js} +1 -1
- package/dist/{chunk-4c3dws2k.js → chunk-ycbk7tg9.js} +1 -1
- package/dist/chunk-yf01hyxn.js +2 -0
- package/dist/{chunk-srz5kgyg.js → chunk-yqfwvk9z.js} +1 -1
- package/dist/{chunk-0apd8zqn.js → chunk-z05djfac.js} +7 -7
- package/dist/{chunk-kpqez1ht.js → chunk-z18bksyr.js} +1 -1
- package/dist/chunk-z4btj7s0.js +2 -0
- package/dist/{chunk-1tg7dfq5.js → chunk-zk8zdv23.js} +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/setup.js +1 -1
- package/dist/src/utils/lock-file.d.ts +19 -0
- package/package.json +1 -1
- package/dist/chunk-00vbhh0z.js +0 -2
- package/dist/chunk-0y706m2d.js +0 -2
- package/dist/chunk-1aee33aa.js +0 -2
- package/dist/chunk-1vhqtq6m.js +0 -2
- package/dist/chunk-2fx0tbc0.js +0 -2
- package/dist/chunk-3ggd7z2f.js +0 -2
- package/dist/chunk-3xbx315d.js +0 -2
- package/dist/chunk-4k9f9vn2.js +0 -2
- package/dist/chunk-4zvjzesh.js +0 -2
- package/dist/chunk-5dw0q5ng.js +0 -2
- package/dist/chunk-5qtdc2mb.js +0 -2
- package/dist/chunk-6gttmvww.js +0 -2
- package/dist/chunk-7f6mpphq.js +0 -2
- package/dist/chunk-7mmdxbcm.js +0 -2
- package/dist/chunk-7ze1qrmt.js +0 -2
- package/dist/chunk-9634xcvq.js +0 -2
- package/dist/chunk-ea6rtyvy.js +0 -2
- package/dist/chunk-gs5b2ssa.js +0 -2
- package/dist/chunk-gw69sjx2.js +0 -2
- package/dist/chunk-j0fcqty9.js +0 -2
- package/dist/chunk-mzb7cg8a.js +0 -2
- package/dist/chunk-pjq0qxst.js +0 -2
- package/dist/chunk-pksrcdh6.js +0 -2
- package/dist/chunk-sdhyhefy.js +0 -2
- package/dist/chunk-sxdfmskp.js +0 -2
- package/dist/chunk-tf9nqr0p.js +0 -2
- package/dist/chunk-tm8eg4sk.js +0 -2
- package/dist/chunk-tq1w2wwa.js +0 -2
- package/dist/chunk-w93akf6h.js +0 -2
- package/dist/chunk-ydt2sn0j.js +0 -2
- package/dist/chunk-z0qbkvyz.js +0 -2
- package/dist/chunk-zefqbamj.js +0 -2
- package/dist/chunk-zrg5ss0x.js +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qb as p,Rb as q,Sb as r,Tb as s,Ub as t,Vb as u,Wb as v,Xb as w,Yb as x}from"./chunk-
|
|
2
|
+
import{Qb as p,Rb as q,Sb as r,Tb as s,Ub as t,Vb as u,Wb as v,Xb as w,Yb as x}from"./chunk-59993g25.js";import{$b as i,Zb as g,_b as h,ac as j,bc as k,cc as l,dc as m,ec as n,fc as o}from"./chunk-va3k91tf.js";import"./chunk-24xvskkf.js";import{Uf as a,Vf as b,Wf as c,Xf as d,Yf as e,Zf as f}from"./chunk-z18bksyr.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.js";export{s as serializeLearnings,v as selectLearnings,j as resolveModelAlias,n as resolveAiProvider,w as renderLearnings,d as redactError,c as redactDeep,b as redact,r as parseLearnings,x as loadLearnings,m as createOpenAiProvider,t as createLearning,l as createGoogleProvider,k as createAnthropicProvider,o as createAiClient,u as addLearning,a as REDACTED,i as PROVIDER_PRIORITY,h as PROVIDER_KEY_ENV,g as MODEL_ALIASES,q as DEFAULT_PROMPT_LIMIT,p as DEFAULT_LEARNINGS_FILE,f as AiProviderError,e as AiBudgetExceededError};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{xh as W}from"./chunk-2z9pkk1y.js";import{Jh as y}from"./chunk-b9szrnxw.js";import{Ph as J}from"./chunk-x1w6q9tk.js";import{el as F}from"./chunk-kbvj6qxc.js";import S from"process";function G(E){let q=E.replace(/\\/g,"/");return q.includes(".github/workflows/")&&(q.endsWith(".yml")||q.endsWith(".yaml"))}async function L(E,q){try{if(!G(E))return null;let I=[],j=q.split(`
|
|
3
3
|
`);for(let K=0;K<j.length;K++){let Q=j[K].trim().match(/^-?\s*uses:\s*(.+)/);if(Q){let $=Q[1].trim().replace(/['"`]/g,"");if($.startsWith("./")||$.startsWith("docker://"))continue;let X=$.split("@");if(X.length===2){let[_,Y]=X;if(!_||!_.trim())continue;let[z,...k]=Y.split("#"),M=z.trim(),V={name:_.trim(),currentVersion:M,type:"github-actions",file:E};if(v(M)){let x=k.join("#").trim().split(/\s+/)[0];V.metadata=x?{pinnedSha:M,pinnedVersion:x}:{pinnedSha:M}}if(!I.find((x)=>x.name===V.name&&x.currentVersion===V.currentVersion))I.push(V)}}}return{path:E,type:"github-actions",content:q,dependencies:I}}catch(I){return J().warn(`Failed to parse GitHub Actions file ${E}:`,I),null}}function v(E){return/^[0-9a-f]{40}$/i.test(E)}function R(E,q){return E.replace(/^v/i,"")===q.replace(/^v/i,"")}async function U(E,q,I){try{if(!G(E))return q;let j=q;for(let K of I){let O=K.name.replace(/\s*\(.*\)$/,""),Z=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(K.resolved?.sha){let $=new RegExp(`((?:^\\s*-\\s*)?uses:\\s*["']?)(${Z})@(${K.currentVersion})(["']?)([ \\t]*#[^\\n]*)?`,"gm");j=j.replace($,`$1$2@${K.resolved.sha}$4 # ${K.newVersion}`);continue}let Q=new RegExp(`((?:^\\s*-\\s*)?uses:\\s*["']?)(${O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})@(${K.currentVersion.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})(["']?)`,"gm");j=j.replace(Q,`$1$2@${K.newVersion}$4`)}return j}catch(j){return J().warn(`Failed to update GitHub Actions file ${E}:`,j),q}}async function D(E){let q=[],I=new Map;for(let j of E)if(G(j.file)){if(!I.has(j.file))I.set(j.file,[]);I.get(j.file).push(j)}for(let[j,K]of I)try{let O=await import("fs");if(O.existsSync(j)){let Z=O.readFileSync(j,"utf-8"),Q=await U(j,Z,K);q.push({path:j,content:Q,type:"update"})}}catch(O){J().warn(`Failed to generate updates for GitHub Actions file ${j}:`,O)}return q}async function b(E,q){let[I,j]=E.split("/");if(!I||!j)return null;let K={Accept:"application/vnd.github.v3+json","User-Agent":"buddy"},O=S.env.BUDDY_TOKEN||S.env.GITHUB_TOKEN||S.env.GH_TOKEN;if(O)K.Authorization=`Bearer ${O}`;try{let Z=await y(`${W()}/repos/${I}/${j}/commits/${encodeURIComponent(q)}`,{headers:K});if(!Z.ok)return null;let Q=await Z.json();return Q.sha&&v(Q.sha)?Q.sha:null}catch{return null}}async function P(E){try{if(!E.includes("/"))return J().info(`\u26A0\uFE0F Invalid action name format: ${E}`),null;let[q,I]=E.split("/");J().info(`\uD83D\uDD0D Fetching latest version for ${q}/${I}`);let j={Accept:"application/vnd.github.v3+json","User-Agent":"buddy"},K=S.env.BUDDY_TOKEN||S.env.GITHUB_TOKEN||S.env.GH_TOKEN;if(K)j.Authorization=`Bearer ${K}`;let O=W();J().info(`\uD83D\uDCE1 Trying latest release for ${q}/${I}`);let Z=await y(`${O}/repos/${q}/${I}/releases/latest`,{headers:j});if(Z.ok){let X=await Z.json();if(X.tag_name)return J().info(`\u2705 Found latest release: ${X.tag_name}`),X.tag_name}else J().info(`\u26A0\uFE0F Latest release not found: ${Z.status} ${Z.statusText}`);J().info(`\uD83D\uDCE1 Trying all releases for ${q}/${I}`);let Q=await y(`${O}/repos/${q}/${I}/releases?per_page=10`,{headers:j});if(Q.ok){let X=await Q.json();if(!Array.isArray(X))J().info("\u26A0\uFE0F Unexpected releases response format (expected array)");else{J().info(`\uD83D\uDCCB Found ${X.length} releases`);let _=X.filter((Y)=>Y.tag_name&&!Y.tag_name.includes("-")).sort((Y,z)=>{let k=Y.published_at?new Date(Y.published_at).getTime():0;return(z.published_at?new Date(z.published_at).getTime():0)-k});if(_.length>0)return J().info(`\u2705 Found latest stable release: ${_[0].tag_name}`),_[0].tag_name||null}}else J().info(`\u26A0\uFE0F Releases not found: ${Q.status} ${Q.statusText}`);J().info(`\uD83D\uDCE1 Trying tags for ${q}/${I}`);let $=await y(`${O}/repos/${q}/${I}/tags?per_page=10`,{headers:j});if($.ok){let X=await $.json();if(!Array.isArray(X))J().info("\u26A0\uFE0F Unexpected tags response format (expected array)");else{J().info(`\uD83D\uDCCB Found ${X.length} tags`);let _=X.filter((Y)=>Y.name&&!Y.name.includes("-")).map((Y)=>Y.name).sort((Y,z)=>{let k=Y.replace(/^v/,""),M=z.replace(/^v/,""),V=k.split(".").map(Number),B=M.split(".").map(Number);for(let x=0;x<Math.max(V.length,B.length);x++){let H=V[x]||0,T=B[x]||0;if(H!==T)return T-H}return 0});if(_.length>0)return J().info(`\u2705 Found latest stable tag: ${_[0]}`),_[0]}}else J().info(`\u26A0\uFE0F Tags not found: ${$.status} ${$.statusText}`);return J().info(`\u274C No version found for ${E}`),null}catch(q){return J().warn(`Failed to fetch latest version for ${E}:`,q),null}}
|
|
4
|
-
export{G as
|
|
4
|
+
export{G as xe,L as ye,v as ze,R as Ae,U as Be,D as Ce,b as De,P as Ee};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{F as
|
|
2
|
+
import{Ph as K}from"./chunk-x1w6q9tk.js";import{el as N}from"./chunk-kbvj6qxc.js";function F(q){return(q.split(/[/\\]/).pop()||"")==="build.zig.zon"}async function S(q,z){try{if(!F(q))return null;let J=[],j=z.match(/\.dependencies\s*=\s*\.?\{/);if(j){let Q=j.index+j[0].length,A=1,T=Q;while(T<z.length&&A>0){if(z[T]==="{")A++;else if(z[T]==="}")A--;T++}let G=z.slice(Q,T-1),O=/\.(\w+)\s*=\s*\.?\{/g,W=O.exec(G);while(W!==null){let b=W[1],X=W.index+W[0].length,Y=1,V=X;while(V<G.length&&Y>0){if(G[V]==="{")Y++;else if(G[V]==="}")Y--;V++}let _=G.slice(X,V-1),$=_.match(/\.url\s*=\s*"([^"]+)"/),R=_.match(/\.hash\s*=\s*"([^"]+)"/);if($){let H=$[1],v=H.match(/\/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/i),E=v?v[1]:"unknown",Z={url:H};if(R)Z.hash=R[1];J.push({name:b,currentVersion:E,type:"zig-dependencies",file:q,metadata:Z})}W=O.exec(G)}}return{path:q,type:"build.zig.zon",content:z,dependencies:J}}catch(J){return K().warn(`Failed to parse Zig manifest ${q}:`,J),null}}async function w(q,z,J){try{if(!F(q))return K().info(`\u26A0\uFE0F updateZigManifest: ${q} is not a Zig manifest file, returning original content`),z;let j=z;for(let Q of J){let A=Q.name.trim(),T=new RegExp(`(\\.${A}\\s*=\\s*\\.?\\{[^}]*\\.url\\s*=\\s*")([^"]+)("[^}]*\\})`,"s"),G=j.match(T);if(G){let[O,W,b,X]=G,Y=/\/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/i,V=b.replace(Y,(H)=>{return H.startsWith("/v")?`/v${Q.newVersion}`:`/${Q.newVersion}`}),_=Q.resolved?.hash,$=X;if(_)$=X.replace(/(\.hash\s*=\s*")([^"]+)(")/,`$1${_}$3`);else if(/\.hash\s*=/.test(X)){K().warn(`\u26A0\uFE0F No hash available for ${A}; leaving ${q} unchanged to avoid a hash mismatch`);continue}let R=`${W}${V}${$}`;j=j.replace(O,R),K().info(`\u2705 Updated ${A} from ${G[2]} to ${V}`)}else K().warn(`\u26A0\uFE0F Could not find dependency block for ${A} in ${q}`)}return j}catch(j){return K().warn(`Failed to update Zig manifest ${q}:`,j),z}}async function U(q){let z=[],J=new Map;for(let j of q)if(F(j.file)){if(!J.has(j.file))J.set(j.file,[]);J.get(j.file).push(j)}for(let[j,Q]of J)try{let A=await import("fs");if(A.existsSync(j)){let T=A.readFileSync(j,"utf-8"),G=await w(j,T,Q);if(G!==T)z.push({path:j,content:G,type:"update"}),K().info(`\u2705 Generated update for ${j} with ${Q.length} package changes`);else K().info(`\u2139\uFE0F No changes needed for ${j} - versions already up to date`)}else K().warn(`\u26A0\uFE0F Zig manifest file ${j} does not exist`)}catch(A){K().warn(`Failed to generate updates for Zig manifest ${j}:`,A)}return z}
|
|
3
|
+
export{F as te,S as ue,w as ve,U as we};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ed as a,Fd as b,Gd as c,Hd as d,Id as e,Jd as f,Kd as g,Ld as h,Md as i,Nd as j}from"./chunk-7m3pzkcj.js";import"./chunk-kbvj6qxc.js";export{j as shouldFail,h as formatReview,d as formatPretty,e as formatGithub,f as formatAgent,b as diffArgsFor,g as countBySeverity,c as collectLocalDiff,i as applySuggestion,a as REVIEW_FORMATS};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
class I extends Error{status;method;url;repository;responseBody;constructor(j,k,q,P,Q,S){super(j);this.status=k;this.method=q;this.url=P;this.repository=Q;this.responseBody=S;this.name="GitHubApiError"}get isNotFound(){return this.status===404||this.status===410}get isForbidden(){return this.status===403}}function G(j,k=2000){let q=J(j);return q.length>k?`${q.slice(0,k)}\u2026 (truncated)`:q}function J(j){if(j instanceof Error){let k=j.cause;if(k!==void 0&&k!==null){let q=k instanceof Error?k.message:String(k);if(q&&!j.message.includes(q))return`${j.message} (cause: ${q})`}return j.message}if(typeof j==="string")return j;try{return JSON.stringify(j)}catch{return String(j)}}import K from"process";var C={silent:0,error:1,warn:2,info:3,debug:4};function B(j){return j.map((k)=>k instanceof Error?G(k):k)}function N(){let j=K.env.BUDDY_LOG_LEVEL?.toLowerCase();return j&&j in C?j:void 0}class z{level;constructor(j=!1,k){this.level=k??N()??(j?"debug":"info")}enabled(j){return C[this.level]>=C[j]}info(j,...k){if(this.enabled("info"))console.log(j,...B(k))}warn(j,...k){if(this.enabled("warn"))console.warn(j,...B(k))}error(j,...k){if(this.enabled("error"))console.error(j,...B(k))}debug(j,...k){if(this.enabled("debug"))console.log(`\x1B[90m\uD83D\uDC1B\x1B[0m ${j}`,...B(k))}success(j,...k){if(this.enabled("info"))console.log(`\x1B[32m\u2713\x1B[0m ${j}`,...B(k))}get logLevel(){return this.level}static verbose(){return new z(!0,"debug")}static quiet(){return new z(!1,"info")}static silent(){return new z(!1,"silent")}static withLevel(j){return new z(!1,j)}}var H=new z(!1);function Y(j){H=j}function Z(){return H}
|
|
3
|
-
export{I as
|
|
3
|
+
export{I as Lh,G as Mh,z as Nh,Y as Oh,Z as Ph};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{tg as T,yg as B}from"./chunk-knpdntnh.js";import{Ag as w,zg as S}from"./chunk-54er1whp.js";import{xh as M}from"./chunk-2z9pkk1y.js";import{Jh as V}from"./chunk-b9szrnxw.js";import{el as W}from"./chunk-kbvj6qxc.js";var v={critical:"\uD83D\uDD34 Critical",high:"\uD83D\uDFE0 High",moderate:"\uD83D\uDFE1 Moderate",low:"\u26AA Low"};function A(O){let Q=O.filter((X)=>(X.securityAdvisories?.length??0)>0);if(Q.length===0)return"";let J=Q.reduce((X,$)=>X+($.securityAdvisories?.length??0),0),Z=`## \uD83D\uDD12 Security Advisories
|
|
3
3
|
|
|
4
4
|
`;Z+=`This PR resolves ${J} known ${J===1?"vulnerability":"vulnerabilities"} `,Z+=`across ${Q.length} ${Q.length===1?"package":"packages"}.
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import{sg as T,xg as B}from"./chunk-gvnsr72j.js";import{yg as S,zg as w}from"./c
|
|
|
7
7
|
`,Z+=`|---|---|---|---|---|
|
|
8
8
|
`;for(let X of Q)for(let $ of X.securityAdvisories??[]){let L=v[$.severity]??$.severity,_=$.url?`[${$.id}](${$.url})`:$.id,K=$.aliases.length>0?` (${$.aliases.join(", ")})`:"",G=$.summary.replace(/\|/g,"\\|").replace(/\s*\n\s*/g," ").trim();Z+=`| \`${X.name}\` | ${L} | ${_}${K} | \`${$.fixedVersion??"n/a"}\` | ${G} |
|
|
9
9
|
`}return`${Z}
|
|
10
|
-
`}async function g(O,Q){try{let J=Q.split("/").pop()||"";if(J==="package.json"){let Z=JSON.parse(O),X=[];return z(Z.dependencies,"dependencies",Q,X),z(Z.devDependencies,"devDependencies",Q,X),z(Z.peerDependencies,"peerDependencies",Q,X),z(Z.optionalDependencies,"optionalDependencies",Q,X),{path:Q,type:"package.json",content:O,dependencies:X}}if(S(Q))return await w(Q,O);if(J==="composer.json"||J==="composer.lock"){let{parseComposerFile:Z}=await import("./chunk-
|
|
10
|
+
`}async function g(O,Q){try{let J=Q.split("/").pop()||"";if(J==="package.json"){let Z=JSON.parse(O),X=[];return z(Z.dependencies,"dependencies",Q,X),z(Z.devDependencies,"devDependencies",Q,X),z(Z.peerDependencies,"peerDependencies",Q,X),z(Z.optionalDependencies,"optionalDependencies",Q,X),{path:Q,type:"package.json",content:O,dependencies:X}}if(S(Q))return await w(Q,O);if(J==="composer.json"||J==="composer.lock"){let{parseComposerFile:Z}=await import("./chunk-hc651afv.js");return await Z(Q,O)}return null}catch{return null}}function z(O,Q,J,Z){if(!O)return;for(let[X,$]of Object.entries(O))Z.push({name:X,currentVersion:$,type:Q,file:J})}function l(O){let{existsSync:Q}=W("fs"),{join:J}=W("path");if(Q(J(O,"bun.lockb"))||Q(J(O,"bun.lock")))return"bun";if(Q(J(O,"pnpm-lock.yaml")))return"pnpm";if(Q(J(O,"yarn.lock")))return"yarn";if(Q(J(O,"package-lock.json")))return"npm";return"bun"}function c(O,Q){if(Q)return Q;if(O.length===1){let $=O[0];return`chore(deps): update dependency ${$.name} to ${$.newVersion}`}let J=O.filter(($)=>$.updateType==="major"),Z=O.filter(($)=>$.updateType==="minor"),X=O.filter(($)=>$.updateType==="patch");if(J.length>0)return`chore(deps): update ${J.length} major dependencies`;else if(Z.length>0)return`chore(deps): update ${Z.length} minor dependencies`;else return`chore(deps): update ${X.length} patch dependencies`}function u(O,Q){if(Q)return Q;if(O.length===1){let Z=O[0];return`chore(deps): update dependency ${Z.name} to v${Z.newVersion}`}let J=O.filter((Z)=>Z.updateType==="major");if(J.length>0)return`chore(deps): update ${J.length} major dependencies`;else return"chore(deps): update all non-major dependencies"}function I(O,Q){if(Q)return Q;let J=`This PR contains the following updates:
|
|
11
11
|
|
|
12
12
|
`;J+=A(O),J+=`| Package | Change | Age | Adoption | Passing | Confidence |
|
|
13
13
|
`,J+=`|---|---|---|---|---|---|
|
|
@@ -41,4 +41,4 @@ import{sg as T,xg as B}from"./chunk-gvnsr72j.js";import{yg as S,zg as w}from"./c
|
|
|
41
41
|
`,J+=`---
|
|
42
42
|
|
|
43
43
|
`,J+="This PR was generated by [Buddy](https://github.com/stacksjs/buddy).",J}function n(O,Q="buddy"){if(O.length===1){let Z=O[0],X=Z.name.replace(/[^a-z0-9-]/gi,"-");return`${Q}/update-${X}-to-${Z.newVersion}`}if(O.filter((Z)=>Z.updateType==="major").length>0)return`${Q}/update-major-dependencies`;return`${Q}/update-dependencies`}function R(O){let Q=new Map;for(let J of O){let Z=`${J.name}:${J.currentVersion}:${J.newVersion}`,X=Q.get(Z);if(!X)Q.set(Z,J);else{let $=F(J.file),L=F(X.file);if($>L)Q.set(Z,J)}}return Array.from(Q.values())}function F(O){if(O==="package.json")return 3;if(O.endsWith("composer.json"))return 2;if(O.includes(".github/workflows/"))return 1;return 0}function d(O,Q={}){let{prioritizeSecurity:J=!0}=Q,Z=[],X=R(O),$=J?X.filter((Y)=>(Y.securityAdvisories?.length??0)>0):[],L=J?X.filter((Y)=>(Y.securityAdvisories?.length??0)===0):X;if($.length>0)Z.push({name:"Security Updates",updates:$,updateType:C($),title:"fix(deps): update vulnerable dependencies",body:I($)});let _=L.filter((Y)=>Y.dependencyType==="github-actions"),K=L.filter((Y)=>Y.dependencyType==="docker-image"),G=L.filter((Y)=>Y.dependencyType!=="github-actions"&&Y.dependencyType!=="docker-image");if(_.length>0)Z.push({name:"GitHub Actions",updates:_,updateType:C(_),title:"chore(deps): update github actions",body:I(_)});if(K.length>0)Z.push({name:"Docker Images",updates:K,updateType:C(K),title:"chore(deps): update docker images",body:I(K)});let q=G.filter((Y)=>Y.updateType==="major"),H=G.filter((Y)=>Y.updateType==="minor"),E=G.filter((Y)=>Y.updateType==="patch");if(H.length>0||E.length>0){let Y=[...H,...E];Z.push({name:"Non-Major Updates",updates:Y,updateType:H.length>0?"minor":"patch",title:"chore(deps): update all non-major dependencies",body:I(Y)})}for(let Y of q)Z.push({name:`Major Update - ${Y.name}`,updates:[Y],updateType:"major",title:`chore(deps): update dependency ${Y.name} to ${Y.newVersion}`,body:I([Y])});return Z}function C(O){if(O.some((Q)=>Q.updateType==="major"))return"major";if(O.some((Q)=>Q.updateType==="minor"))return"minor";return"patch"}var x={critical:4,high:3,moderate:2,low:1};function D(O){let Q=0;for(let J of O.securityAdvisories??[])Q=Math.max(Q,x[J.severity]??0);return Q}function o(O,Q={}){let{prioritizeSecurity:J=!0}=Q,Z={major:3,minor:2,patch:1};return O.sort((X,$)=>{let L=J?D(X):0,_=J?D($):0;if(L!==_)return _-L;let K=Z[X.updateType],G=Z[$.updateType];if(K!==G)return G-K;return X.name.localeCompare($.name)})}function s(O,Q){let J=N(O.replace(/^[v^~>=<@]+/,"")),Z=N(Q.replace(/^[v^~>=<@]+/,""));try{if(Bun.semver.order(Z,J)<=0)return"patch"}catch{return"patch"}let X=J.split(".").map((q)=>Number.parseInt(q,10)),$=Z.split(".").map((q)=>Number.parseInt(q,10));while(X.length<3)X.push(0);while($.length<3)$.push(0);let[L,_]=X,[K,G]=$;if(K>L)return"major";if(K===L&&G>_)return"minor";return"patch"}function N(O){let Q=O.split(".");if(Q.length>=3||!Q.every((J)=>/^\d+$/.test(J)))return O;while(Q.length<3)Q.push("0");return Q.join(".")}function i(O,Q){try{return Bun.semver.satisfies(O,Q)}catch{return!1}}async function r(O,Q,J){if(!O)throw Error("GitHub token is required");try{let Z=await V(`${M()}/repos/${Q}/${J}/pulls?state=open`,{headers:{Authorization:`Bearer ${O}`,Accept:"application/vnd.github+json","User-Agent":"buddy"}});if(!Z.ok)throw Error(`GitHub API error: ${Z.status} ${Z.statusText}`);return(await Z.json()).filter((L)=>{if(!L.body)return!1;return/\s*-\s*\[x\]\s*<!--\s*rebase-check\s*-->.*(?:rebase|update)\/retry/i.test(L.body)}).map((L)=>({number:L.number,branchName:L.head.ref}))}catch(Z){throw Error(`Failed to check for rebase requests: ${Z}`)}}function p(O){let Q=T(O);if(Q)return[...new Set(Q.updates.map((X)=>X.name))];let J=[],Z=O.match(/\|[^|]*\|[^|]*\|[^|]*\|[^|]*\|/g);if(Z)for(let X of Z){let $=X.match(/\[([^\]]+)\]\([^)]*\)/);if($)J.push($[1])}return J}async function a(O,Q,J){if(await j(O,Q,J))return!0;if(await k(O,Q,J))return!0;return!1}async function j(O,Q,J){if(!(Q.packages?.respectLatest??!0))return J.debug(`\uD83D\uDD0D PR #${O.number}: respectLatest is false, skipping auto-close`),!1;let X=["latest","*","main","master","develop","dev"],$=T(O.body);if($){let q=$.updates.filter((H)=>X.includes(H.current.toLowerCase().trim()));for(let H of q)J.debug(`\uD83D\uDD0D PR #${O.number}: Package ${H.name} has dynamic version "${H.current}"`);return J.debug(`\uD83D\uDD0D PR #${O.number}: Should auto-close: ${q.length>0}`),q.length>0}let L=/\|\s*\[([^\]]+)\][^|]*\|\s*\[?`?[v^~>=]*([^`|\s]+)`?\s*(?:->|\u2192)\s*`?[v^~>=]*([^`|\s]+)`?\]?/g,_,K=[];while((_=L.exec(O.body))!==null){let[,q,H]=_,E=H.toLowerCase().trim();if(X.includes(E))K.push(q),J.debug(`\uD83D\uDD0D PR #${O.number}: Package ${q} has dynamic version "${E}"`)}let G=K.length>0;return J.debug(`\uD83D\uDD0D PR #${O.number}: Packages with dynamic versions: ${K.join(", ")}`),J.debug(`\uD83D\uDD0D PR #${O.number}: Should auto-close: ${G}`),G}async function k(O,Q,J){let Z=Q.packages?.ignorePaths;if(!Z||Z.length===0)return J.debug(`\uD83D\uDD0D PR #${O.number}: No ignorePaths configured, skipping auto-close`),!1;let X=b(O.body);if(X.length===0)return J.debug(`\uD83D\uDD0D PR #${O.number}: No file paths found in PR body`),!1;J.debug(`\uD83D\uDD0D PR #${O.number}: Found file paths: ${X.join(", ")}`);let{Glob:$}=globalThis.Bun,L=X.filter((_)=>{let K=_.replace(/^\.\//,"");return Z.some((G)=>{try{return new $(G).match(K)}catch(q){return J.debug(`Failed to match path ${K} against pattern ${G}: ${q}`),!1}})});if(L.length>0)return J.debug(`\uD83D\uDD0D PR #${O.number}: Contains files now in ignorePaths: ${L.join(", ")}`),!0;return J.debug(`\uD83D\uDD0D PR #${O.number}: No files match ignorePaths patterns`),!1}function b(O){let Q=T(O);if(Q)return B(Q);let J=[],Z=/\|\s*\[[^\]]+\]\([^)]*\)\s*\|[^|]*\|\s*\*\*([^*]+)\*\*\s*\|/g,X;while((X=Z.exec(O))!==null){let K=X[1].trim();if(K&&!J.includes(K))J.push(K)}let $=/\*\*([^*]+\.(?:json|yaml|yml|lock))\*\*/g;while((X=$.exec(O))!==null){let K=X[1].trim();if(K&&!J.includes(K))J.push(K)}let L=/\|[^|]+\|[^|]+\|([^|]+)\|[^|]*\|/g;while((X=L.exec(O))!==null){let K=X[1].trim();if(K&&(K.includes("/")||/\.(?:json|yaml|yml|lock)$/.test(K))&&!J.includes(K))J.push(K)}let _=/(?:^|\s)([\w-]+(?:\/[\w.-]+)*\/[\w.-]+\.(?:json|yaml|yml|lock))(?:\s|$)/gm;while((X=_.exec(O))!==null){let K=X[1].trim();if(K&&!J.includes(K))J.push(K)}return J}
|
|
44
|
-
export{A as
|
|
44
|
+
export{A as bg,g as cg,l as dg,c as eg,u as fg,I as gg,n as hg,d as ig,o as jg,s as kg,i as lg,r as mg,p as ng,a as og};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{pg as a,qg as b,rg as c,sg as d,tg as e,ug as f,vg as g,wg as h,xg as i,yg as j}from"./chunk-knpdntnh.js";import"./chunk-kbvj6qxc.js";export{h as withManifest,g as stripManifest,c as serializeManifest,d as serializeGroupManifest,e as parseManifest,i as manifestUpdates,j as manifestFiles,f as hasManifest,a as MANIFEST_SCHEMA_VERSION,b as MANIFEST_MAX_LENGTH};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h,Q as i,R as j,S as k,T as l,U as m,V as n}from"./chunk-
|
|
2
|
+
import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h,Q as i,R as j,S as k,T as l,U as m,V as n}from"./chunk-mt53v4sx.js";import"./chunk-vpw7adwd.js";import"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.js";export{m as withNarrative,n as shouldPublishReport,l as renderReport,c as parseHistory,f as loadHistory,e as findPrevious,i as computeMetrics,j as computeDeltas,d as appendHistory,g as REPORT_PERIODS,k as REPORT_MARKER,h as PERIOD_DAYS,a as HISTORY_PATH,b as HISTORY_LIMIT};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{A as V0,B as z0,C as EQ,a as N,b as X,c as R,r as dQ,s as $0,t as HQ,x as F,y as U,z as AQ}from"./chunk-
|
|
2
|
+
import{A as V0,B as z0,C as EQ,a as N,b as X,c as R,r as dQ,s as $0,t as HQ,x as F,y as U,z as AQ}from"./chunk-2jjrxgs1.js";import"./chunk-kbvj6qxc.js";import*as O from"fs/promises";import*as XQ from"fs";import*as T from"path";import*as FQ from"child_process";import*as M0 from"crypto";import*as A0 from"readline";function S(V){if(V.inputSchema.type!=="object")throw Error(`JSON schema for tool "${V.name}" must be an object, but got ${V.inputSchema.type}`);return{type:"custom",name:V.name,input_schema:V.inputSchema,description:V.description,run:V.run,parse:(Q)=>Q,...V.close?{close:V.close}:{}}}import*as b from"fs/promises";import*as C from"path";import{randomUUID as L0}from"crypto";var e=493,T0=420;function YQ(V,Q){let $=C.relative(V,Q);return $===""||!$.startsWith(".."+C.sep)&&$!==".."&&!C.isAbsolute($)}async function OQ(V,Q){for(let $ of V)if(YQ(await r(C.resolve($)),Q))return $;return}var y0=40;function QQ(V){let Q=V?.code;return typeof Q==="string"?Q:void 0}async function r(V){let Q=[],$=V,z=0;for(;;){let K;try{K=await b.realpath($)}catch(Z){let q;try{q=(await b.lstat($)).isSymbolicLink()}catch(Y){let W=QQ(Y);if(W!=="ENOENT"&&W!=="ENOTDIR")throw Y;let J=C.dirname($);if(J===$)throw Y;Q.push(C.basename($)),$=J;continue}if(!q)throw Z;if(++z>y0)throw Object.assign(Error("too many levels of symbolic links"),{code:"ELOOP"});$=C.resolve(C.dirname($),await b.readlink($));continue}return Q.length?C.join(K,...Q.reverse()):K}}async function fQ(V,Q,$){let z=$?.allowedRoots??[],K=await r(C.resolve(V)),Z;try{Z=await r(C.resolve(K,Q))}catch(Y){throw new U(n(Y,`path ${JSON.stringify(Q)}`))}if(YQ(K,Z)||await OQ(z,Z)!==void 0)return Z;let q=z.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new U(`path ${JSON.stringify(Q)} is outside ${q}`)}async function RQ(V,Q){let $=C.dirname(V),z=C.join($,`.tmp-${process.pid}-${L0()}`),K;try{K=await b.open(z,"wx",T0),await K.writeFile(Q,"utf-8"),await K.sync(),await K.close(),K=void 0,await b.rename(z,V)}catch(Z){if(K)await K.close().catch(()=>{});throw await b.unlink(z).catch(()=>{}),Z}}function n(V,Q){let $=QQ(V);switch($){case"ENOENT":return`${Q}: no such file or directory`;case"EACCES":case"EPERM":return`${Q}: permission denied`;case"ENOTDIR":return`${Q}: not a directory`;case"EISDIR":return`${Q}: is a directory`;case"ELOOP":return`${Q}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${Q}: file name too long`;case"ENOSPC":return`${Q}: no space left on device`;case"EMFILE":case"ENFILE":return`${Q}: too many open files`;default:return`${Q}: ${$!==void 0?`i/o error (${$})`:"i/o error"}`}}import*as G from"fs/promises";import*as uQ from"fs";import*as w from"path";import{execFile as b0}from"child_process";import{promisify as x0}from"util";import{Readable as v0}from"stream";import{pipeline as P0}from"stream/promises";var E0=x0(b0);async function F0(V){let{client:Q,sessionId:$}=V;if(!Q)return async()=>{};let z=HQ(Q),K=V.session;if(!K){if($===void 0)return async()=>{};z.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),K=await Q.beta.sessions.retrieve($)}let Z=w.resolve(V.workdir,"skills"),q=[];for(let Y of K.agent.skills)try{let W=await Q.beta.skills.versions.retrieve(Y.version,{skill_id:Y.skill_id}),J=w.basename(W.name.trim());if(J===""||J==="."||J==="..")J=Y.skill_id;let H=w.resolve(Z,J);if(H!==Z&&!H.startsWith(Z+w.sep)){z.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:W.name});continue}let M=await Q.beta.skills.versions.download(W.id,{skill_id:Y.skill_id});await G.rm(H,{recursive:!0,force:!0}),await G.mkdir(H,{recursive:!0,mode:e}),q.push(H),await mQ(M,H),z.info("downloaded skill",{component:"agent-tool-context",skill_id:Y.skill_id,version:W.id,dest:H})}catch(W){z.warn("failed to download skill",{component:"agent-tool-context",skill_id:Y.skill_id,error:String(W)})}return async()=>{for(let Y of q)await G.rm(Y,{recursive:!0,force:!0}).catch((W)=>{z.warn("failed to clean up skill",{component:"agent-tool-context",dest:Y,error:String(W)})})}}function f0(V){for(let Q of V){let $=Q.trim();if(!$)continue;if(w.isAbsolute($)||$.split(/[\\/]/).includes(".."))throw new R(`refusing to extract unsafe archive member: ${$}`)}}var LQ="skill archive listing is inconsistent; refusing to extract",g0={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])};function gQ(V){let Q=V.split(`
|
|
3
3
|
`);if(Q[Q.length-1]==="")Q.pop();return Q}function u0(V,Q){return/^[\x20-\x7E]+$/.test(Q)&&!/[\\^#]/.test(Q)&&!(V==="unzip"&&Q.startsWith("-"))}function S0(V,Q,$){let z=gQ(Q),K=gQ($);if(z.length!==K.length)throw new R(LQ);let Z=[],q=[];return z.forEach((Y,W)=>{if(g0[V].has(K[W].charAt(0))){Z.push(Y);return}if(!u0(V,Y))throw new R(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(Y)}`);q.push(Y)}),{plain:Z,special:q}}async function SQ(V){for(let Q of await G.readdir(V,{withFileTypes:!0}))if(Q.isDirectory())await SQ(w.join(V,Q.name));else if(!Q.isFile())throw new R(LQ)}async function jQ(V,Q){try{let{stdout:$}=await E0(V,Q);return $}catch($){if(QQ($)==="ENOENT")throw new R(`skill extraction requires the \`${V}\` command, but it was not found on PATH`);throw $}}function m0(V){let Q,$=!1;for(let z of V){let K=z.trim().split("/").filter((q)=>q!==""&&q!==".");if(K.length===0)continue;let Z=K[0];if(Q===void 0)Q=Z;else if(Z!==Q)return"";if(K.length>1)$=!0}return Q!==void 0&&$?Q:""}async function mQ(V,Q){let $=w.join(Q,`.skill-archive-${process.pid}-${Date.now()}`);if(!V.body)throw new R("skill download response had no body");await P0(v0.fromWeb(V.body),uQ.createWriteStream($));let z=w.join(w.dirname(Q),`.skill-stage-${process.pid}-${Date.now()}`),K=w.join(w.dirname(Q),`.skill-exclude-${process.pid}-${Date.now()}`);try{let Z=await _0($,4),q=Z.length>=4&&Z[0]===80&&Z[1]===75&&Z[2]===3&&Z[3]===4,Y=q?"unzip":"tar",W=await jQ(Y,q?["-Z1",$]:["-tf",$]),J=await jQ(Y,q?["-Z","--h","--t",$]:["-tvf",$]),{plain:H,special:M}=S0(Y,W,J);f0([...H,...M]);let j=m0(H);if(await G.mkdir(z,{recursive:!0,mode:e}),H.length>0)await jQ(Y,await p0(Y,$,z,M,K));await SQ(z);let v=j?w.join(z,j):z,P=await G.readdir(v).catch((E)=>{throw QQ(E)==="ENOENT"?new R(LQ):E});for(let E of P)await G.rename(w.join(v,E),w.join(Q,E))}finally{await G.rm($,{force:!0}),await G.rm(K,{force:!0}),await G.rm(z,{recursive:!0,force:!0})}}async function p0(V,Q,$,z,K){let Z=z.map((q)=>q.replace(/[*?[\\]/g,"\\$&"));if(V==="unzip")return["-oq",Q,"-d",$,...Z.length>0?["-x",...Z]:[]];if(Z.length===0)return["-xf",Q,"-C",$];return await G.writeFile(K,Z.join(`
|
|
4
4
|
`)+`
|
|
5
5
|
`,{flag:"wx",mode:384}),["-xf",Q,"-C",$,"-X",K]}async function _0(V,Q){let $=await G.open(V,"r");try{let z=Buffer.alloc(Q),{bytesRead:K}=await $.read(z,0,Q,0);return z.subarray(0,K)}finally{await $.close()}}import*as q0 from"path";import{createHash as V1}from"crypto";import*as A from"fs/promises";import*as k from"path";import{constants as i}from"fs";import{createHash as h0,randomBytes as d0}from"crypto";var cQ=448,c0=384,n0=448,TQ=i.O_NOFOLLOW??0,i0=i.O_NONBLOCK??0;class D extends Error{constructor(V,Q){super(`path ${JSON.stringify(Q)} ${V}`);this.name="FileStoreError",this.reason=V,this.relPath=Q}}D.ESCAPES_ROOT="escapes the store root";D.IS_A_SYMLINK="is a symlink";D.NOT_A_FILE="is not a regular file";D.NOT_A_DIRECTORY="is not a directory";D.NOT_UTF8="is not valid utf-8";D.MOVE_DESTINATION_EXISTS="already exists";function yQ(V){return V.startsWith("/")&&!V.split("/").includes("..")}class l{constructor(V,Q,$=!1){this.hashes=new Map,this.rootPath=V,this.removedOnDispose=Q,this.decoder=$?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(V,Q){if(!l0())throw Error("FileStore requires O_NOFOLLOW support on this platform");let $=!1;try{await A.lstat(V)}catch(z){if(z.code!=="ENOENT")throw z;$=!0}return new l(k.resolve(V),$,Q?.utf8??!1)}async createRoot(){await a0(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){if(!this.removedOnDispose)return;await A.rm(this.rootPath,{recursive:!0,force:!0})}async put(V,Q,$){let z=V.replace(/\\/g,"/");if(z.endsWith("/")||z.endsWith("/.")||z===""||z===".")throw new D(D.NOT_A_FILE,V);let K=this.resolveUnderRoot(V),Z=typeof Q==="string"?dQ(Q):Q;this.requireUtf8(V,Z),await pQ(this.rootPath,k.dirname(K)),await o0(K,Z,$?.executable??!1)}async get(V){let Q=this.resolveUnderRoot(V),$;try{$=await nQ(V,Q)}catch(K){if(K.code==="ENOENT")return null;throw K}let z;try{let K=await $.readFile();z=new Uint8Array(K.buffer,K.byteOffset,K.byteLength)}finally{await $.close()}return this.requireUtf8(V,z),z}async ls(V="/"){let Q=this.resolveUnderRoot(V);return new Set((await _Q(this.rootPath,V,Q)).map(([$])=>$))}async findSymlinks(V="/"){let Q=this.resolveUnderRoot(V);return t0(this.rootPath,V,Q)}async hashtree(V="/"){let Q=this.resolveUnderRoot(V),$=JQ.nowNs(),z=Object.create(null);for(let[K,Z]of await _Q(this.rootPath,V,Q)){let q=await this.hashViaCache(K,Z,$);if(q!==null)z[K]=q}return z}async hashFile(V){let Q=this.resolveUnderRoot(V),$;try{$=await A.lstat(Q,{bigint:!0})}catch(K){if(K.code==="ENOENT")return null;throw K}if($.isSymbolicLink())throw new D(D.IS_A_SYMLINK,V);if(!$.isFile())throw new D(D.NOT_A_FILE,V);let z=k.relative(this.rootPath,Q).split(k.sep).join("/");return this.hashViaCache(z,Q,JQ.nowNs())}async move(V,Q){let $=this.resolveUnderRoot(V),z=this.resolveUnderRoot(Q);if($===this.rootPath||z===this.rootPath)return;if(await A.stat(z).then(()=>!0,()=>!1))throw new D(D.MOVE_DESTINATION_EXISTS,Q);await pQ(this.rootPath,k.dirname(z)),await A.rename($,z)}async remove(V){let Q=this.resolveUnderRoot(V);if(Q===this.rootPath)return;let $;try{$=await A.lstat(Q,{bigint:!0})}catch(z){if(z.code==="ENOENT")return;throw z}if($.isDirectory())await A.rm(Q,{recursive:!0,force:!0});else try{await A.unlink(Q)}catch(z){if(z.code!=="ENOENT")throw z}}resolveUnderRoot(V){let Q=V.replace(/\\/g,"/").replace(/^\/+/,""),$=Q.split("/").filter((z)=>z!==""&&z!==".");if(k.posix.isAbsolute(Q)||$.includes(".."))throw new D(D.ESCAPES_ROOT,V);return $.length===0?this.rootPath:k.join(this.rootPath,...$)}requireUtf8(V,Q){if(!this.decoder)return;try{this.decoder.decode(Q)}catch{throw new D(D.NOT_UTF8,V)}}async hashViaCache(V,Q,$){let z;try{z=await A.lstat(Q,{bigint:!0})}catch(q){if(q.code==="ENOENT")return null;throw q}if(!z.isFile())return null;let K=this.hashes.get(V),Z;if(K!==void 0&&e0(K,z))Z=K.sha;else try{Z=await JQ.hashFile(Q)}catch(q){let Y=q.code;if(Y==="ENOENT"||q instanceof D)return null;if(Y==="ELOOP"||Y==="EMLINK")return null;throw q}if(Q1(z,$))this.hashes.set(V,{mtimeNs:z.mtimeNs,ctimeNs:z.ctimeNs,size:z.size,sha:Z});return Z}}l.isPathLegal=yQ;function l0(){return TQ!==0}async function a0(V){let Q=[],$=V;for(;;){try{await A.stat($);break}catch(K){let Z=K.code;if(Z!=="ENOENT"&&Z!=="ENOTDIR"&&Z!=="ELOOP")throw K}Q.push($);let z=k.dirname($);if(z===$)break;$=z}for(let z of Q.reverse())try{await A.mkdir(z,{mode:cQ})}catch(K){if(K.code!=="EEXIST")throw K}}async function pQ(V,Q){let $=k.relative(V,Q);if($==="")return;let z=V;for(let K of $.split(k.sep)){z=k.join(z,K);try{await A.mkdir(z,{mode:cQ})}catch(Z){if(Z.code!=="EEXIST")throw Z}}}async function o0(V,Q,$){let z=$?n0:c0,K=k.join(k.dirname(V),`.fs-${d0(8).toString("hex")}.tmp`),Z;try{Z=await A.open(K,i.O_WRONLY|i.O_CREAT|i.O_EXCL|TQ,z),await Z.writeFile(Q),await Z.close(),Z=void 0,await A.rename(K,V)}catch(q){if(Z)await Z.close().catch(()=>{});throw await A.unlink(K).catch(()=>{}),q}}async function nQ(V,Q){let $;try{$=await A.open(Q,i.O_RDONLY|TQ|i0)}catch(z){let K=z.code;if(K==="ELOOP"||K==="EMLINK")throw new D(D.IS_A_SYMLINK,V);throw z}try{if(!(await $.stat()).isFile())throw new D(D.NOT_A_FILE,V)}catch(z){throw await $.close().catch(()=>{}),z}return $}async function s0(V){let Q=h0("sha256"),$=await nQ(k.basename(V),V),z=new Uint8Array(1048576);try{for(;;){let{bytesRead:K}=await $.read(z,0,z.length);if(K===0)break;Q.update(z.subarray(0,K))}}finally{await $.close()}return Q.digest("hex")}async function _Q(V,Q,$){if(!await r0(Q,$))return[];let z=[];return await iQ($,(K,Z)=>{if(Z.isFile())z.push([k.relative(V,K).split(k.sep).join("/"),K])}),z.sort(),z}async function t0(V,Q,$){let z=(q)=>k.relative(V,q).split(k.sep).join("/"),K;try{K=await A.lstat($,{bigint:!0})}catch(q){let Y=q.code;if(Y==="ENOENT"||Y==="ENOTDIR")return new Set;throw q}if(K.isSymbolicLink())return new Set([z($)]);if(!K.isDirectory())throw new D(D.NOT_A_DIRECTORY,Q);let Z=new Set;return await iQ($,(q,Y)=>{if(Y.isSymbolicLink())Z.add(z(q))}),Z}async function r0(V,Q){let $;try{$=await A.lstat(Q,{bigint:!0})}catch(z){let K=z.code;if(K==="ENOENT"||K==="ENOTDIR")return!1;throw z}if(!$.isDirectory())throw new D(D.NOT_A_DIRECTORY,V);return!0}async function iQ(V,Q){let $=[V];while($.length){let z=$.pop(),K;try{K=await A.readdir(z,{withFileTypes:!0})}catch(Z){if(Z.code==="ENOENT")continue;throw Z}for(let Z of K){let q=k.join(z,Z.name);if(Q(q,Z),Z.isDirectory()&&!Z.isSymbolicLink())$.push(q)}}}function e0(V,Q){return Q.mtimeNs===V.mtimeNs&&Q.ctimeNs===V.ctimeNs&&Q.size===V.size}function Q1(V,Q){return(V.mtimeNs>V.ctimeNs?V.mtimeNs:V.ctimeNs)<Q-JQ.timestampTrustMarginNs}var $1=2000000000n,JQ={hashFile:s0,timestampTrustMarginNs:$1,nowNs:()=>BigInt(Date.now())*1000000n},lQ=l,hQ=Symbol.asyncDispose;if(hQ)Object.defineProperty(l.prototype,hQ,{value:l.prototype.dispose,configurable:!0,writable:!0});var I,g,BQ,$Q,MQ,B,a,DQ,f,K0,NQ,Z0,X0,bQ,vQ,aQ,oQ,xQ,sQ,tQ,WQ,UQ,rQ,eQ,z1=30000,o=".anthropic-memory-store",Y0=1;function Q0(V){return V1("sha256").update(`version ${Y0}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ac as m,Bc as n,Cc as o,Dc as p,Ec as q,Fc as r,Gc as s,Hc as t,Ic as u,oc as a,pc as b,qc as c,rc as d,sc as e,tc as f,uc as g,vc as h,wc as i,xc as j,yc as k,zc as l}from"./chunk-
|
|
2
|
+
import{Ac as m,Bc as n,Cc as o,Dc as p,Ec as q,Fc as r,Gc as s,Hc as t,Ic as u,oc as a,pc as b,qc as c,rc as d,sc as e,tc as f,uc as g,vc as h,wc as i,xc as j,yc as k,zc as l}from"./chunk-0m1z85m9.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.js";export{t as stripOperators,l as splitConstraint,s as scanEcosystems,o as rustAdapter,n as rubyAdapter,c as regenerateWith,u as regenerateLockfiles,m as pythonAdapter,k as pep440UpdateType,h as parsePep440,f as numericUpdateType,j as isPep440Prerelease,g as goAdapter,a as escapeRegex,b as detectFiles,i as comparePep440,e as compareNumeric,d as commandAvailable,r as adapterNamed,q as adapterFor,p as BUILTIN_ADAPTERS};
|