@buddysh/buddy 0.11.17 → 0.11.18
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 +14 -0
- package/README.md +12 -0
- package/bin/cli.ts +14 -1
- package/dist/bin/cli.js +42 -40
- package/dist/bin/entry.d.ts +1 -0
- package/dist/bin/entry.js +3 -0
- package/dist/bin/stacks.d.ts +1 -0
- package/dist/bin/stacks.js +3 -0
- package/dist/{chunk-7hm46cej.js → chunk-09qpgqgj.js} +1 -1
- package/dist/{chunk-wk175yyw.js → chunk-0baffydm.js} +1 -1
- package/dist/{chunk-pxfrq43h.js → chunk-0g44mytk.js} +1 -1
- package/dist/{chunk-1a14rx5n.js → chunk-0hrxtesf.js} +2 -2
- package/dist/{chunk-4chtv4nh.js → chunk-13cpe0kf.js} +1 -1
- package/dist/{chunk-qngnmrpw.js → chunk-18wwzwcz.js} +1 -1
- package/dist/{chunk-bw43q8k7.js → chunk-249qcsjm.js} +1 -1
- package/dist/chunk-255r8t6k.js +2 -0
- package/dist/{chunk-k8sd78td.js → chunk-292qaqqe.js} +1 -1
- package/dist/chunk-2c2bkhwj.js +2 -0
- package/dist/chunk-2k7b8te1.js +5 -0
- package/dist/{chunk-ewhvahnb.js → chunk-2z54h4e9.js} +2 -2
- package/dist/{chunk-j57716xw.js → chunk-339ae7vn.js} +1 -1
- package/dist/{chunk-4r03rh93.js → chunk-35wxea5y.js} +1 -1
- package/dist/{chunk-bnp0r4eh.js → chunk-3zp7a103.js} +1 -1
- package/dist/{chunk-bafzw99p.js → chunk-48a66w2p.js} +2 -2
- package/dist/chunk-4aavwqyt.js +2 -0
- package/dist/{chunk-byqzhgzs.js → chunk-4yy4f6wc.js} +1 -1
- package/dist/{chunk-r1jvyhhd.js → chunk-5107xbwj.js} +1 -1
- package/dist/{chunk-wzncz6j5.js → chunk-56t2za4k.js} +1 -1
- package/dist/{chunk-nk8wxxy7.js → chunk-5czhqsvn.js} +2 -2
- package/dist/chunk-6c6e5xgb.js +2 -0
- package/dist/{chunk-r7qa2ykf.js → chunk-6v9c84ds.js} +2 -2
- package/dist/chunk-7qp8ng5e.js +2 -0
- package/dist/chunk-7rdqaj9g.js +2 -0
- package/dist/chunk-87x43s85.js +2 -0
- package/dist/{chunk-g09atq0m.js → chunk-8efgn47g.js} +1 -1
- package/dist/{chunk-wfwrm4k3.js → chunk-97857d8t.js} +1 -1
- package/dist/chunk-981xyxzj.js +2 -0
- package/dist/{chunk-her5azyp.js → chunk-9mpeqda3.js} +2 -2
- package/dist/{chunk-qbep9dk4.js → chunk-a12s15m8.js} +1 -1
- package/dist/chunk-a7veqg3a.js +2 -0
- package/dist/{chunk-2f7j0dmw.js → chunk-ad8ws736.js} +1 -1
- package/dist/{chunk-dxd0eg4r.js → chunk-b22d85q8.js} +1 -1
- package/dist/{chunk-9chq5m4p.js → chunk-b27ezdzq.js} +4 -4
- package/dist/{chunk-cb25v2mp.js → chunk-b75yqx1f.js} +1 -1
- package/dist/{chunk-mthd2c8m.js → chunk-b8bfag6k.js} +2 -2
- package/dist/chunk-b9b3xwar.js +2 -0
- package/dist/chunk-bjvx1r6g.js +2 -0
- package/dist/{chunk-1g43mpqn.js → chunk-c067bnx5.js} +1 -1
- package/dist/{chunk-a8wcn3mh.js → chunk-c5d5webv.js} +2 -2
- package/dist/chunk-c7s8nsbr.js +2 -0
- package/dist/chunk-ckvtfmyg.js +2 -0
- package/dist/{chunk-0f1xye20.js → chunk-d2vrstjq.js} +1 -1
- package/dist/{chunk-7m3pzkcj.js → chunk-d3cqth47.js} +1 -1
- package/dist/{chunk-s3b3vrsj.js → chunk-dbhgxe35.js} +2 -2
- package/dist/{chunk-sj7n6xa1.js → chunk-dcbkac9x.js} +1 -1
- package/dist/{chunk-m3rftash.js → chunk-drn3hq53.js} +7 -7
- package/dist/{chunk-16aeend1.js → chunk-eaz23nsf.js} +1 -1
- package/dist/{chunk-69qyr9ef.js → chunk-ejfyc7r8.js} +1 -1
- package/dist/{chunk-51m5tgwp.js → chunk-ems4rhqe.js} +1 -1
- package/dist/{chunk-6kd81nf9.js → chunk-erges5h8.js} +1 -1
- package/dist/chunk-f1d20z92.js +2 -0
- package/dist/{chunk-km4aszfp.js → chunk-f4rmh2s9.js} +1 -1
- package/dist/chunk-ff1dah6m.js +2 -0
- package/dist/chunk-fz9th4yv.js +2 -0
- package/dist/{chunk-67bjaw56.js → chunk-g482e1b0.js} +3 -3
- package/dist/{chunk-1pdvjg0x.js → chunk-gkdmk7xt.js} +1 -1
- package/dist/{chunk-fsghqtgf.js → chunk-gs26n8tm.js} +2 -2
- package/dist/{chunk-0kce7e60.js → chunk-h3vdnyqy.js} +1 -1
- package/dist/chunk-haemkbh1.js +2 -0
- package/dist/chunk-hgcr63c6.js +2 -0
- package/dist/chunk-hh4zq6m0.js +2 -0
- package/dist/{chunk-d09qj570.js → chunk-hzpsmg4z.js} +1 -1
- package/dist/{chunk-8wrbxhs3.js → chunk-j5k195b6.js} +1 -1
- package/dist/{chunk-1jgh0ff1.js → chunk-j9xw849s.js} +2 -2
- package/dist/{chunk-z2gcfvze.js → chunk-jan74vw2.js} +5 -5
- package/dist/{chunk-wfg3bp85.js → chunk-jf4s1r34.js} +1 -1
- package/dist/{chunk-h2f92qwd.js → chunk-jpbq9xqv.js} +1 -1
- package/dist/chunk-k1w134pz.js +2 -0
- package/dist/{chunk-s0ps33ft.js → chunk-kqwdg3nw.js} +1 -1
- package/dist/chunk-ksght1x7.js +2 -0
- package/dist/chunk-mkfsh53w.js +2 -0
- package/dist/{chunk-sddaassq.js → chunk-mm9b9pwb.js} +1 -1
- package/dist/{chunk-mr2d1zp0.js → chunk-n2de4spv.js} +1 -1
- package/dist/chunk-nfcxgb5d.js +2 -0
- package/dist/{chunk-26yejy1v.js → chunk-nkwfez01.js} +1 -1
- package/dist/{chunk-whtdmv3p.js → chunk-nn9rcqsz.js} +2 -2
- package/dist/{chunk-6b0fmw0d.js → chunk-npjgqzfg.js} +1 -1
- package/dist/{chunk-743mhx0e.js → chunk-p09rsh3z.js} +1 -1
- package/dist/chunk-pbrpej0s.js +2 -0
- package/dist/chunk-pz2nmnhh.js +2 -0
- package/dist/{chunk-7p1b809h.js → chunk-r7c4arkp.js} +1 -1
- package/dist/{chunk-gq9gkyah.js → chunk-r976qdkb.js} +2 -2
- package/dist/{chunk-hk4d7rky.js → chunk-rb6gzts6.js} +1 -1
- package/dist/{chunk-gg1ddvnf.js → chunk-rxqph6cj.js} +2 -2
- package/dist/{chunk-gvpsbmeg.js → chunk-rzxj5fgp.js} +1 -1
- package/dist/{chunk-6gvx1g6h.js → chunk-s3t54kj1.js} +2 -2
- package/dist/{chunk-pag93kz1.js → chunk-sc4bxrwb.js} +1 -1
- package/dist/{chunk-4wv5s3vr.js → chunk-sveh3wjr.js} +1 -1
- package/dist/{chunk-4dz5x4xw.js → chunk-t74w5ddy.js} +1 -1
- package/dist/{chunk-ttkjzy0m.js → chunk-tp3hze1v.js} +1 -1
- package/dist/chunk-v02hzntq.js +2 -0
- package/dist/{chunk-8r2819xn.js → chunk-v9aakgat.js} +1 -1
- package/dist/chunk-vg0pry4b.js +2 -0
- package/dist/chunk-vgys0c1v.js +2 -0
- package/dist/{chunk-t1r2ycn7.js → chunk-vjav82c6.js} +1 -1
- package/dist/{chunk-wc2z7krw.js → chunk-vna64r40.js} +1 -1
- package/dist/{chunk-mtn4angk.js → chunk-vx23zjwq.js} +1 -1
- package/dist/{chunk-psjrcpgb.js → chunk-w20n4t27.js} +2 -2
- package/dist/{chunk-c63e4ssc.js → chunk-w3ktf7th.js} +2 -2
- package/dist/{chunk-hd74jxm2.js → chunk-wjzravb7.js} +2 -2
- package/dist/{chunk-y5fdq7cd.js → chunk-wk4rtet9.js} +1 -1
- package/dist/{chunk-6w0n6c07.js → chunk-wkjv03yr.js} +1 -1
- package/dist/{chunk-5yfaptmp.js → chunk-wm6g7y1r.js} +1 -1
- package/dist/chunk-wq4g8082.js +2 -0
- package/dist/chunk-x8dry63m.js +2 -0
- package/dist/{chunk-vs61069x.js → chunk-xaw1yts1.js} +1 -1
- package/dist/chunk-y2zqnbbf.js +2 -0
- package/dist/{chunk-vckhctmr.js → chunk-yy8vb4yk.js} +1 -1
- package/dist/chunk-za2yg8vc.js +2 -0
- package/dist/{chunk-jqh7vx2n.js → chunk-zdh3gd22.js} +1 -1
- package/dist/{chunk-y2ntnpdb.js → chunk-zrnfjw7d.js} +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/setup.js +1 -1
- package/dist/src/stacks-cli.d.ts +7 -0
- package/package.json +4 -2
- package/dist/chunk-0n03s02h.js +0 -2
- package/dist/chunk-1k4p8wyx.js +0 -2
- package/dist/chunk-1mkwhnsf.js +0 -2
- package/dist/chunk-2309x9r7.js +0 -2
- package/dist/chunk-3jm67wxm.js +0 -2
- package/dist/chunk-3mnpvfg3.js +0 -2
- package/dist/chunk-485kgdtb.js +0 -2
- package/dist/chunk-5t07s3dv.js +0 -2
- package/dist/chunk-6bqs7rtc.js +0 -2
- package/dist/chunk-8b7cwedf.js +0 -2
- package/dist/chunk-9fagkyrp.js +0 -2
- package/dist/chunk-9gabxm8n.js +0 -2
- package/dist/chunk-bgb44971.js +0 -2
- package/dist/chunk-bz5yx7g6.js +0 -2
- package/dist/chunk-dttp44vs.js +0 -2
- package/dist/chunk-fzs7vpps.js +0 -2
- package/dist/chunk-gkb0gja4.js +0 -2
- package/dist/chunk-hxkxset4.js +0 -2
- package/dist/chunk-jgq5d6s2.js +0 -2
- package/dist/chunk-kthwzc4p.js +0 -2
- package/dist/chunk-m9qtb4xj.js +0 -2
- package/dist/chunk-p9xksx9p.js +0 -2
- package/dist/chunk-q4j2f72t.js +0 -2
- package/dist/chunk-rqj1vrfs.js +0 -2
- package/dist/chunk-s4fccg73.js +0 -2
- package/dist/chunk-tjj6ttj1.js +0 -2
- package/dist/chunk-tsd9jw07.js +0 -2
- package/dist/chunk-txe5z472.js +0 -2
- package/dist/chunk-vffz69jj.js +0 -2
- package/dist/chunk-wn9vr9ct.js +0 -2
- package/dist/chunk-yr6qyeab.js +0 -2
- package/dist/chunk-zj2pt1bx.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var j=Object.create;var{getPrototypeOf:k,defineProperty:i,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,q=(a,b,d)=>{var f=a!=null&&typeof a==="object";if(f){var g=b?o??=new WeakMap:p??=new WeakMap,h=g.get(a);if(h)return h}d=a!=null?j(k(a)):{};let c=b||!a||!a.__esModule?i(d,"default",{value:a,enumerable:!0}):d;for(let e of l(a))if(!m.call(c,e))i(c,e,{get:n.bind(a,e),enumerable:!0});if(f)g.set(a,c);return c};var r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var s=import.meta.require;
|
|
3
|
-
export{q as
|
|
3
|
+
export{q as gl,r as hl,s as il};
|
|
@@ -5,4 +5,4 @@ function J(L,q){if(!L.trim())return[];let D=L.toLowerCase(),Q=[];for(let B of q)
|
|
|
5
5
|
|---|---|---|---|
|
|
6
6
|
`;for(let Q of q){let B=[];if(Q.vulnerable)B.push("\u26A0\uFE0F known advisory");if(Q.deprecated)B.push("\uD83D\uDEAB deprecated");if(Q.openPRs?.length)B.push(`open PR ${Q.openPRs.map((F)=>`#${F}`).join(", ")}`);D+=`| \`${Q.name}\` | ${Q.declaredVersion??"\u2014"} | ${Q.latestVersion??"\u2014"} | ${B.join(", ")||"\u2014"} |
|
|
7
7
|
`}return D}function Z(L,q){let D=new Map(q.map((F)=>[F.toLowerCase(),F])),Q=[],B=[];for(let F of L){let G=D.get(F.trim().toLowerCase());if(G&&!Q.includes(G))Q.push(G);else if(!G)B.push(F)}return{apply:Q,rejected:B}}function X(L,q){let D=V(L),Q=V(q);if(D.size===0||Q.size===0)return 0;let B=0;for(let F of D)if(Q.has(F))B++;return B/Math.min(D.size,Q.size)}function $(L,q,D=0.6){return q.map((Q)=>({number:Q.number,score:X(L,Q.text)})).filter((Q)=>Q.score>=D).sort((Q,B)=>B.score-Q.score)}var A=new Set(["the","a","an","is","are","was","were","to","of","in","on","for","and","or","but","with","this","that","it","be","has","have","not","when","then","i","we","you","my","our"]);function V(L){return new Set(L.toLowerCase().split(/[^\w.-]+/).filter((q)=>q.length>2&&!A.has(q)))}function H(L){return L.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Y="<!-- buddy:quick-links -->",S=[{id:"plan",label:"Make a plan",description:"Read the issue and the relevant code, then post an implementation plan. Changes nothing."},{id:"build",label:"Build this",description:"Open a draft pull request implementing the issue."}],U=/- \[x\]\s*<!--\s*quick-action=([\w-]+)\s*-->/gi;function j(L){if(!L)return{actions:[]};let q=[];for(let D of L.matchAll(U)){let Q=D[1].trim();if(S.some((B)=>B.id===Q)&&!q.includes(Q))q.push(Q)}return{actions:q}}function v(L){return L.replace(/- \[x\](\s*<!--\s*quick-action=[\w-]+\s*-->)/gi,"- [ ]$1")}function w(L={}){let q=[Y,"","### Buddy","","Tick a box to have Buddy pick this up:",""];for(let Q of S)q.push(`- [ ] <!-- quick-action=${Q.id} -->**${Q.label}** \u2014 ${Q.description}`);let D=L.packages?.length&&L.body?J(L.body,L.packages.map((Q)=>Q.name)):[];if(D.length>0){let Q=L.packages.filter((B)=>D.includes(B.name));q.push("",M(Q))}return q.join(`
|
|
8
|
-
`)}export{J as
|
|
8
|
+
`)}export{J as ga,M as ha,Z as ia,X as ja,$ as ka,Y as la,S as ma,j as na,v as oa,w as pa};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{cg as a,dg as b,eg as c,fg as d,gg as e,hg as f,ig as g,jg as h,kg as i,lg as j,mg as k,ng as l,og as m}from"./chunk-
|
|
2
|
+
import{cg as a,dg as b,eg as c,fg as d,gg as e,hg as f,ig as g,jg as h,kg as i,lg as j,mg as k,ng as l,og as m}from"./chunk-w3ktf7th.js";import"./chunk-x9vpk4kk.js";import"./chunk-5107xbwj.js";import"./chunk-2z9mh5y4.js";import"./chunk-yh13j2af.js";import"./chunk-kqwdg3nw.js";import"./chunk-56t2za4k.js";import"./chunk-drn3hq53.js";import"./chunk-eaz23nsf.js";export{h as sortUpdatesByPriority,j as satisfiesRange,a as parsePackageFile,g as groupUpdates,i as getUpdateType,f as generateBranchName,d as formatPRTitle,e as formatPRBody,c as formatCommitMessage,l as extractPackageNamesFromPRBody,b as detectPackageManager,k as checkForRebaseRequests,m as checkForAutoClose};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{yh as L$}from"./chunk-nznpzbq4.js";import{zh as P$}from"./chunk-yh13j2af.js";import{
|
|
2
|
+
import{yh as L$}from"./chunk-nznpzbq4.js";import{zh as P$}from"./chunk-yh13j2af.js";import{Nh as Z1}from"./chunk-kqwdg3nw.js";import{Th as H}from"./chunk-56t2za4k.js";import{gl as u7,hl as B,il as O1}from"./chunk-eaz23nsf.js";var N=B((Kz,R0)=>{var{FORCE_COLOR:x$,NODE_DISABLE_COLORS:h$,TERM:d$}=process.env,G={enabled:!h$&&d$!=="dumb"&&x$!=="0",reset:F(0,0),bold:F(1,22),dim:F(2,22),italic:F(3,23),underline:F(4,24),inverse:F(7,27),hidden:F(8,28),strikethrough:F(9,29),black:F(30,39),red:F(31,39),green:F(32,39),yellow:F(33,39),blue:F(34,39),magenta:F(35,39),cyan:F(36,39),white:F(37,39),gray:F(90,39),grey:F(90,39),bgBlack:F(40,49),bgRed:F(41,49),bgGreen:F(42,49),bgYellow:F(43,49),bgBlue:F(44,49),bgMagenta:F(45,49),bgCyan:F(46,49),bgWhite:F(47,49)};function U0($,Y){let Z=0,z,X="",Q="";for(;Z<$.length;Z++)if(z=$[Z],X+=z.open,Q+=z.close,Y.includes(z.close))Y=Y.replace(z.rgx,z.close+z.open);return X+Y+Q}function v$($,Y){let Z={has:$,keys:Y};return Z.reset=G.reset.bind(Z),Z.bold=G.bold.bind(Z),Z.dim=G.dim.bind(Z),Z.italic=G.italic.bind(Z),Z.underline=G.underline.bind(Z),Z.inverse=G.inverse.bind(Z),Z.hidden=G.hidden.bind(Z),Z.strikethrough=G.strikethrough.bind(Z),Z.black=G.black.bind(Z),Z.red=G.red.bind(Z),Z.green=G.green.bind(Z),Z.yellow=G.yellow.bind(Z),Z.blue=G.blue.bind(Z),Z.magenta=G.magenta.bind(Z),Z.cyan=G.cyan.bind(Z),Z.white=G.white.bind(Z),Z.gray=G.gray.bind(Z),Z.grey=G.grey.bind(Z),Z.bgBlack=G.bgBlack.bind(Z),Z.bgRed=G.bgRed.bind(Z),Z.bgGreen=G.bgGreen.bind(Z),Z.bgYellow=G.bgYellow.bind(Z),Z.bgBlue=G.bgBlue.bind(Z),Z.bgMagenta=G.bgMagenta.bind(Z),Z.bgCyan=G.bgCyan.bind(Z),Z.bgWhite=G.bgWhite.bind(Z),Z}function F($,Y){let Z={open:`\x1B[${$}m`,close:`\x1B[${Y}m`,rgx:new RegExp(`\\x1b\\[${Y}m`,"g")};return function(z){if(this!==void 0&&this.has!==void 0)return this.has.includes($)||(this.has.push($),this.keys.push(Z)),z===void 0?this:G.enabled?U0(this.keys,z+""):z+"";return z===void 0?v$([$],[Z]):G.enabled?U0([Z],z+""):z+""}}R0.exports=G});var F0=B((Qz,G0)=>{G0.exports=($,Y)=>{if($.meta&&$.name!=="escape")return;if($.ctrl){if($.name==="a")return"first";if($.name==="c")return"abort";if($.name==="d")return"abort";if($.name==="e")return"last";if($.name==="g")return"reset"}if(Y){if($.name==="j")return"down";if($.name==="k")return"up"}if($.name==="return")return"submit";if($.name==="enter")return"submit";if($.name==="backspace")return"delete";if($.name==="delete")return"deleteForward";if($.name==="abort")return"abort";if($.name==="escape")return"exit";if($.name==="tab")return"next";if($.name==="pagedown")return"nextPage";if($.name==="pageup")return"prevPage";if($.name==="home")return"home";if($.name==="end")return"end";if($.name==="up")return"up";if($.name==="down")return"down";if($.name==="right")return"right";if($.name==="left")return"left";return!1}});var V1=B((Hz,N0)=>{N0.exports=($)=>{let Y=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),Z=new RegExp(Y,"g");return typeof $==="string"?$.replace(Z,""):$}});var W=B((Jz,W0)=>{var y1={to($,Y){if(!Y)return`\x1B[${$+1}G`;return`\x1B[${Y+1};${$+1}H`},move($,Y){let Z="";if($<0)Z+=`\x1B[${-$}D`;else if($>0)Z+=`\x1B[${$}C`;if(Y<0)Z+=`\x1B[${-Y}A`;else if(Y>0)Z+=`\x1B[${Y}B`;return Z},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},y$={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},f$={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let Y="";for(let Z=0;Z<$;Z++)Y+=this.line+(Z<$-1?y1.up():"");if($)Y+=y1.left;return Y}};W0.exports={cursor:y1,scroll:y$,erase:f$,beep:"\x07"}});var A0=B((Mz,E0)=>{function g$($,Y){var Z=typeof Symbol<"u"&&$[Symbol.iterator]||$["@@iterator"];if(!Z){if(Array.isArray($)||(Z=m$($))||Y&&$&&typeof $.length==="number"){if(Z)$=Z;var z=0,X=function(){};return{s:X,n:function(){if(z>=$.length)return{done:!0};return{done:!1,value:$[z++]}},e:function(U){throw U},f:X}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Q=!0,K=!1,J;return{s:function(){Z=Z.call($)},n:function(){var U=Z.next();return Q=U.done,U},e:function(U){K=!0,J=U},f:function(){try{if(!Q&&Z.return!=null)Z.return()}finally{if(K)throw J}}}}function m$($,Y){if(!$)return;if(typeof $==="string")return V0($,Y);var Z=Object.prototype.toString.call($).slice(8,-1);if(Z==="Object"&&$.constructor)Z=$.constructor.name;if(Z==="Map"||Z==="Set")return Array.from($);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return V0($,Y)}function V0($,Y){if(Y==null||Y>$.length)Y=$.length;for(var Z=0,z=Array(Y);Z<Y;Z++)z[Z]=$[Z];return z}var u$=V1(),C0=W(),O0=C0.erase,c$=C0.cursor,n$=($)=>[...u$($)].length;E0.exports=function($,Y){if(!Y)return O0.line+c$.to(0);let Z=0,z=$.split(/\r?\n/);var X=g$(z),Q;try{for(X.s();!(Q=X.n()).done;){let K=Q.value;Z+=1+Math.floor(Math.max(n$(K)-1,0)/Y)}}catch(K){X.e(K)}finally{X.f()}return O0.lines(Z)}});var f1=B((Bz,I0)=>{var K1={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},i$={arrowUp:K1.arrowUp,arrowDown:K1.arrowDown,arrowLeft:K1.arrowLeft,arrowRight:K1.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},l$=process.platform==="win32"?i$:K1;I0.exports=l$});var S0=B((Uz,q0)=>{var r=N(),s=f1(),g1=Object.freeze({password:{scale:1,render:($)=>"*".repeat($.length)},emoji:{scale:2,render:($)=>"\uD83D\uDE03".repeat($.length)},invisible:{scale:0,render:($)=>""},default:{scale:1,render:($)=>`${$}`}}),p$=($)=>g1[$]||g1.default,Q1=Object.freeze({aborted:r.red(s.cross),done:r.green(s.tick),exited:r.yellow(s.cross),default:r.cyan("?")}),a$=($,Y,Z)=>Y?Q1.aborted:Z?Q1.exited:$?Q1.done:Q1.default,s$=($)=>r.gray($?s.ellipsis:s.pointerSmall),o$=($,Y)=>r.gray($?Y?s.pointerSmall:"+":s.line);q0.exports={styles:g1,render:p$,symbols:Q1,symbol:a$,delimiter:s$,item:o$}});var D0=B((Rz,j0)=>{var t$=V1();j0.exports=function($,Y){let Z=String(t$($)||"").split(/\r?\n/);if(!Y)return Z.length;return Z.map((z)=>Math.ceil(z.length/Y)).reduce((z,X)=>z+X)}});var P0=B((Gz,T0)=>{T0.exports=($,Y={})=>{let Z=Number.isSafeInteger(parseInt(Y.margin))?Array(parseInt(Y.margin)).fill(" ").join(""):Y.margin||"",z=Y.width;return($||"").split(/\r?\n/g).map((X)=>X.split(/\s+/g).reduce((Q,K)=>{if(K.length+Z.length>=z||Q[Q.length-1].length+K.length+1<z)Q[Q.length-1]+=` ${K}`;else Q.push(`${Z}${K}`);return Q},[Z]).join(`
|
|
4
4
|
`)).join(`
|
|
5
5
|
`)}});var w0=B((Fz,L0)=>{L0.exports=($,Y,Z)=>{Z=Z||Y;let z=Math.min(Y-Z,$-Math.floor(Z/2));if(z<0)z=0;let X=Math.min(z+Z,Y);return{startIndex:z,endIndex:X}}});var P=B((Nz,_0)=>{_0.exports={action:F0(),clear:A0(),style:S0(),strip:V1(),figures:f1(),lines:D0(),wrap:P0(),entriesToDisplay:w0()}});var d=B((Wz,h0)=>{var b0=O1("readline"),r$=P(),e$=r$.action,$Y=O1("events"),k0=W(),YY=k0.beep,ZY=k0.cursor,zY=N();class x0 extends $Y{constructor($={}){super();this.firstRender=!0,this.in=$.stdin||process.stdin,this.out=$.stdout||process.stdout,this.onRender=($.onRender||(()=>{return})).bind(this);let Y=b0.createInterface({input:this.in,escapeCodeTimeout:50});if(b0.emitKeypressEvents(this.in,Y),this.in.isTTY)this.in.setRawMode(!0);let Z=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,z=(X,Q)=>{let K=e$(Q,Z);if(K===!1)this._&&this._(X,Q);else if(typeof this[K]==="function")this[K](Q);else this.bell()};this.close=()=>{if(this.out.write(ZY.show),this.in.removeListener("keypress",z),this.in.isTTY)this.in.setRawMode(!1);Y.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",z)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(YY)}render(){if(this.onRender(zY),this.firstRender)this.firstRender=!1}}h0.exports=x0});var m0=B((Vz,g0)=>{function d0($,Y,Z,z,X,Q,K){try{var J=$[Q](K),M=J.value}catch(U){Z(U);return}if(J.done)Y(M);else Promise.resolve(M).then(z,X)}function v0($){return function(){var Y=this,Z=arguments;return new Promise(function(z,X){var Q=$.apply(Y,Z);function K(M){d0(Q,z,X,K,J,"next",M)}function J(M){d0(Q,z,X,K,J,"throw",M)}K(void 0)})}}var C1=N(),XY=d(),y0=W(),KY=y0.erase,H1=y0.cursor,E1=P(),m1=E1.style,u1=E1.clear,QY=E1.lines,HY=E1.figures;class f0 extends XY{constructor($={}){super($);this.transform=m1.render($.style),this.scale=this.transform.scale,this.msg=$.message,this.initial=$.initial||"",this.validator=$.validate||(()=>!0),this.value="",this.errorMsg=$.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=u1("",this.out.columns),this.render()}set value($){if(!$&&this.initial)this.placeholder=!0,this.rendered=C1.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render($);this._value=$,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qe as a,Re as b,Se as c,Te as d,Ue as e,Ve as f}from"./chunk-
|
|
2
|
+
import{Qe as a,Re as b,Se as c,Te as d,Ue as e,Ve as f}from"./chunk-sveh3wjr.js";import"./chunk-kqwdg3nw.js";import"./chunk-56t2za4k.js";import"./chunk-eaz23nsf.js";export{e as updateDockerfile,d as resolveDockerDigest,b as parseDockerfile,a as isDockerfile,f as generateDockerfileUpdates,c as fetchLatestDockerImageVersion};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Xa as a}from"./chunk-j9xw849s.js";import"./chunk-jan74vw2.js";import"./chunk-c5d5webv.js";import"./chunk-g482e1b0.js";import"./chunk-b8bfag6k.js";import"./chunk-3zp7a103.js";import"./chunk-d2vrstjq.js";import"./chunk-wjzravb7.js";import"./chunk-s3t54kj1.js";import"./chunk-p09rsh3z.js";import"./chunk-hzpsmg4z.js";import"./chunk-0baffydm.js";import"./chunk-sveh3wjr.js";import"./chunk-rzxj5fgp.js";import"./chunk-j46f90n8.js";import"./chunk-09qpgqgj.js";import"./chunk-vna64r40.js";import"./chunk-1pecmenc.js";import"./chunk-rb6gzts6.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-w3ktf7th.js";import"./chunk-x9vpk4kk.js";import"./chunk-5107xbwj.js";import"./chunk-2z9mh5y4.js";import"./chunk-yh13j2af.js";import"./chunk-wkjv03yr.js";import"./chunk-kqwdg3nw.js";import"./chunk-56t2za4k.js";import"./chunk-drn3hq53.js";import"./chunk-eaz23nsf.js";export{a as Scheduler};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$c as a,ad as b,bd as c,cd as d,dd as e,ed as f,fd as g,gd as h,hd as i,id as j}from"./chunk-d3cqth47.js";import"./chunk-eaz23nsf.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,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{wd as h}from"./chunk-3zp7a103.js";import{yd as B}from"./chunk-d2vrstjq.js";import{kg as E}from"./chunk-w3ktf7th.js";import{Ch as w,Dh as f,zh as y}from"./chunk-yh13j2af.js";import{Nh as A,Oh as V}from"./chunk-kqwdg3nw.js";import{il as v}from"./chunk-eaz23nsf.js";import{spawn as N}from"child_process";import q from"fs";import F from"path";import T from"process";var P=8;async function M(X,Z,$=8){if(X.length===0)return[];let K=Math.max(1,Math.min($,X.length)),Y=Array.from({length:X.length}),H=0;async function Q(){while(!0){let z=H++;if(z>=X.length)return;Y[z]=await Z(X[z],z)}}return await Promise.all(Array.from({length:K},Q)),Y}function m(X,Z){let $=Math.max(1,Z),K=[];for(let Y=0;Y<X.length;Y+=$)K.push(X.slice(Y,Y+$));return K}class J{entries=new Map;async get(X,Z){let $=this.entries.get(X);if($)return $;let K=Z().catch((Y)=>{throw this.entries.delete(X),Y});return this.entries.set(X,K),K}clear(){this.entries.clear()}get size(){return this.entries.size}}var d=/^[\w.@/*+-]+$/;function C(X,Z){if(!d.test(X))throw new B(`Refusing to pass untrusted ${Z} to bun: ${JSON.stringify(X)}`)}function g(X){let Z={Accept:"application/vnd.github.v3+json","User-Agent":"buddy"},$=X?.repository?.token||T.env.BUDDY_TOKEN||T.env.GITHUB_TOKEN||T.env.GH_TOKEN;if($)Z.Authorization=`Bearer ${$}`;return Z}function R(X){if(typeof X==="string")return X.trim();if(X&&typeof X==="object"&&"version"in X){let Z=X.version;if(typeof Z==="string")return Z.trim()}return""}class k{projectPath;logger;config;concurrency;packumentCache=new J;composerCache=new J;constructor(X,Z,$=void 0,K=P){this.projectPath=X;this.logger=Z;this.config=$;this.concurrency=K}clearCache(){this.packumentCache.clear(),this.composerCache.clear()}async fetchPackument(X){return this.packumentCache.get(X,async()=>{let $=`${w(X,this.config,this.projectPath)}/${encodeURIComponent(X).replace("%40","@")}`;try{let K=await A($,{headers:{"User-Agent":"buddy"},onRetry:({delayMs:Y,reason:H})=>this.logger.debug(`Retrying ${X} in ${Math.round(Y/1000)}s (${H})`)});if(!K.ok)return(K.status===404?this.logger.debug:this.logger.warn).call(this.logger,`No registry data for ${X}: HTTP ${K.status}`),null;return await K.json()}catch(K){return this.logger.warn(`Failed to fetch registry data for ${X}:`,K),null}})}async fetchComposerPackage(X){return this.composerCache.get(X,async()=>{let Z=f(this.config);try{let $=await A(`${Z}/packages/${X}.json`,{headers:{"User-Agent":"buddy"}});if(!$.ok)return null;return await $.json()}catch($){return this.logger.warn(`Failed to get Composer metadata for ${X}:`,$),null}})}shouldRespectVersion(X){if(!(this.config?.packages?.respectLatest??!0))return!1;let $=["latest","*","main","master","develop","dev"],K=X.toLowerCase().trim();return $.includes(K)}async getOutdatedPackages(X){this.logger.info("Checking for outdated packages...");try{let Z=await this.runBunOutdated(X),$=await this.getWorkspaceOutdatedPackages(),K=await this.getPackageJsonOutdated(X),Y=new Map;for(let G of Z)Y.set(G.name,G);for(let G of $)if(!Y.has(G.name))Y.set(G.name,G);for(let G of K)if(!Y.get(G.name))Y.set(G.name,G);let H=[...Y.values()].filter((G)=>{if(this.shouldRespectVersion(G.current))return this.logger.debug(`Skipping ${G.name} - version "${G.current}" should be respected`),!1;return!0}),Q=await M(H,async(G)=>{let[_,I]=await Promise.all([this.getPackageMetadata(G.name),this.findPackageLocation(G.name)]);return{name:G.name,currentVersion:G.current,newVersion:G.latest,updateType:E(G.current,G.latest),dependencyType:"dependencies",file:I||"package.json",metadata:_,releaseNotesUrl:this.getReleaseNotesUrl(G.name,_),changelogUrl:this.getChangelogUrl(G.name,_),homepage:_?.homepage}},this.concurrency),z=F.join(this.projectPath,"composer.json");if(q.existsSync(z))try{let G=await this.getComposerOutdatedPackages();Q.push(...G)}catch(G){this.logger.warn("Failed to check Composer packages:",G)}return this.logger.success(`Found ${Q.length} package updates`),Q}catch(Z){throw this.logger.error("Failed to check for outdated packages:",Z),new B(`Failed to check for outdated packages: ${Z instanceof Error?Z.message:"Unknown error"}`)}}async getUpdatesForPackages(X){let Z=X.join(" ");return this.getOutdatedPackages(Z)}async getUpdatesWithPattern(X){return this.getOutdatedPackages(X)}async getPackageMetadata(X){try{C(X,"package name");let Z=await this.fetchPackument(X);if(!Z)return;let $=Object.keys(Z.versions??{}),K=Z["dist-tags"]?.latest??$[$.length-1]??"",Y=Z.versions?.[K]??{},H=Y.repository??Z.repository,Q=Y.license??Z.license,z=Y.author??Z.author;return{name:Y.name??Z.name??X,description:Y.description??Z.description,repository:typeof H==="string"?H:H?.url,homepage:Y.homepage??Z.homepage,license:typeof Q==="string"?Q:Q?.type,author:typeof z==="string"?z:z?.name,keywords:Y.keywords??Z.keywords,latestVersion:K,versions:$,weeklyDownloads:void 0,dependencies:Y.dependencies,devDependencies:Y.devDependencies,peerDependencies:Y.peerDependencies}}catch(Z){this.logger.warn(`Failed to get metadata for ${X}:`,Z);return}}async packageExists(X){try{return C(X,"package name"),await this.fetchPackument(X)!==null}catch{return!1}}async getLatestVersion(X){try{return await this.getLatestVersionFromNpm(X)}catch{return null}}async getReleaseVersions(X){let Z=await this.getLatestVersion(X);if(!Z)return[];let $=await this.fetchPackument(X),K=this.config?.packages?.includePrerelease??!1;return Object.keys($?.versions??{}).filter((Y)=>(K||!this.isPrerelease(Y))&&Bun.semver.order(Y,Z)<=0)}async getLatestVersionFromNpm(X){let Z=await this.fetchPackument(X);if(!Z)return null;let $=Object.keys(Z.versions??{});if($.length===0)return null;let K=this.config?.packages?.includePrerelease??!1,Y=Z["dist-tags"]?.latest;if(Y&&(K||!this.isPrerelease(Y)))return Y;let H=K?$:$.filter((z)=>!this.isPrerelease(z));if(H.length===0)return null;return[...H].sort((z,G)=>{try{return Bun.semver.order(G,z)}catch{return 0}})[0]||null}isPrerelease(X){return/-(?:alpha|beta|rc|dev|canary|next|experimental|snapshot|nightly)/i.test(X)}async runBunOutdated(X){let Z=[];if(X)for(let $ of X.split(/\s+/).filter(Boolean))C($,"package filter"),Z.push($);try{let $=await this.runCommand("bun",["outdated","--json",...Z]),K=this.parseBunOutdatedJson($);if(K)return K;this.logger.debug("bun outdated --json produced unrecognized output, falling back to table parsing")}catch($){this.logger.debug("bun outdated --json unavailable, falling back to table parsing:",$)}try{let $=await this.runCommand("bun",["outdated",...Z]);return this.parseBunOutdatedOutput($)}catch($){this.logger.error("Failed to run bun outdated:",$);let K=$ instanceof Error?$.message:String($);throw new B(`bun outdated command failed: ${K}`)}}parseBunOutdatedJson(X){let Z=X.trim();if(!Z||!Z.startsWith("[")&&!Z.startsWith("{"))return null;let $;try{$=JSON.parse(Z)}catch{return null}let K=Array.isArray($)?$:Object.entries($).map(([H,Q])=>({name:H,...Q&&typeof Q==="object"?Q:{}})),Y=[];for(let H of K){let Q=typeof H.name==="string"?H.name:void 0,z=R(H.current),G=R(H.latest);if(!Q||!z||!G)continue;let _={name:Q,current:z,update:R(H.update)||G,latest:G},I=typeof H.workspace==="string"?H.workspace:void 0;if(I)_.workspace=I;Y.push(_)}return Y}parseBunOutdatedOutput(X){let Z=[],$=`${String.fromCharCode(27)}[`,Y=X.replace(new RegExp(`${$}[0-9;]*m`,"g"),"").split(`
|
|
3
3
|
`).filter((Q)=>Q.trim()),H=!1;for(let Q of Y){if(Q.includes("Package")&&Q.includes("Current")&&Q.includes("Update")){H=!0;continue}if(!H||!Q.trim())continue;if(Q.match(/^[\u2502\u251C\u2500\u253C\u2524\u2514\u2534\u2518\u250C\u252C\u2510|\-\s]+$/))continue;let z;if(Q.includes("\u2502"))z=Q.split("\u2502").map((G)=>G.trim());else z=Q.split("|").map((G)=>G.trim());if(z.length>=4){let G=z[1]?.trim()||"",_=z[2]?.trim()||"",I=z[3]?.trim()||"",W=z[4]?.trim()||"",L=z.length>=6?z[5]?.trim():void 0;if(G=G.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,""),G&&_&&W&&G!=="Package"){let O={name:G,current:_,update:I,latest:W};if(L&&L!=="Workspace")O.workspace=L;Z.push(O)}}}return Z}async getPackageJsonOutdated(X){try{let Z=F.join(this.projectPath,"package.json");if(!q.existsSync(Z))return[];let $;try{let I=q.readFileSync(Z,"utf-8"),W=JSON.parse(I);if(W===null||typeof W!=="object"||Array.isArray(W))throw new B(`package.json at ${Z} is not a JSON object`);$=W}catch(I){if(I instanceof B)throw I;let W=I instanceof Error?I.message:String(I);throw new B(`Failed to parse ${Z}: ${W}`)}let K=(I)=>{let W=$[I];return W&&typeof W==="object"&&!Array.isArray(W)?W:{}},Y={...K("dependencies"),...K("devDependencies"),...K("peerDependencies")},H=Object.keys(Y),Q=this.config?.packages?.ignore||[],z=this.config?.packages?.excludeMajor??!1,G=(X?H.filter((I)=>X.split(" ").some((W)=>I.includes(W))):H).flatMap((I)=>{if(!Y[I]||Q.includes(I))return[];let W=this.cleanVersionRange(Y[I]);return W?[{packageName:I,cleanVersion:W}]:[]});return(await M(G,async({packageName:I,cleanVersion:W})=>{let L=await this.getLatestVersion(I);if(!L)return null;if(Bun.semver.order(W,L)>=0)return null;if(z&&E(W,L)==="major")return null;return{name:I,current:W,update:L,latest:L}},this.concurrency)).filter((I)=>I!==null)}catch(Z){return this.logger.warn("Failed to check package.json versions:",Z),[]}}cleanVersionRange(X){if(X.startsWith("workspace:"))return null;return X.replace(/^[\^~>=<]/,"").trim()}async runCommand(X,Z){return new Promise(($,K)=>{let Y=N(X,Z,{cwd:this.projectPath,stdio:"pipe"}),H="",Q="";Y.stdout?.on("data",(z)=>{H+=z.toString()}),Y.stderr?.on("data",(z)=>{Q+=z.toString()}),Y.on("close",(z)=>{if(z===0)$(H);else K(Error(`Command failed with code ${z}: ${Q}`))}),Y.on("error",(z)=>{K(z)})})}getReleaseNotesUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/releases`;return}getChangelogUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/blob/main/CHANGELOG.md`;return}async getUpdatesForWorkspace(X){try{C(X,"workspace name");let Z=["outdated","--filter",X],$=await this.runCommand("bun",Z),K=this.parseBunOutdatedOutput($),Y=[];for(let H of K){let Q=E(H.current,H.latest),z=await this.getPackageMetadata(H.name);Y.push({name:H.name,currentVersion:H.current,newVersion:H.latest,updateType:Q,dependencyType:"dependencies",file:`${X}/package.json`,metadata:z,releaseNotesUrl:this.getReleaseNotesUrl(H.name,z),changelogUrl:this.getChangelogUrl(H.name,z),homepage:z?.homepage})}return Y}catch(Z){return this.logger.warn(`Failed to get updates for workspace ${X}:`,Z),[]}}async searchPackages(X,Z=10){try{let $=encodeURIComponent(X),Y=`${w(void 0,this.config,this.projectPath)}/-/v1/search?text=${$}&size=${Z}`,H=await A(Y,{headers:{"User-Agent":"buddy"}});if(!H.ok)throw Error(`HTTP ${H.status}: ${H.statusText}`);return(await H.json()).objects?.map((z)=>({name:z.package.name,version:z.package.version,description:z.package.description,keywords:z.package.keywords}))??[]}catch($){return this.logger.warn("Failed to search packages via registry API:",$),[]}}async getComposerOutdatedPackages(){this.logger.info("Checking for outdated Composer packages...");let X=[];try{this.logger.info("\uD83D\uDD0D Checking Composer availability...");try{let Q=await this.runCommand("composer",["--version"]);this.logger.info("\u2705 Composer version:",Q.split(`
|
|
4
4
|
`)[0])}catch(Q){return this.logger.info("\u274C Composer not available:",Q),this.logger.warn("Composer not found, skipping Composer package updates"),[]}let Z=F.join(this.projectPath,"composer.json");if(this.logger.info(`\uD83D\uDD0D Reading composer.json from: ${Z}`),!q.existsSync(Z))return this.logger.info("\u274C composer.json not found"),[];let $=q.readFileSync(Z,"utf8"),K=JSON.parse($);this.logger.info("\uD83D\uDCE6 composer.json require packages:",Object.keys(K.require||{})),this.logger.info("\uD83D\uDCE6 composer.json require-dev packages:",Object.keys(K["require-dev"]||{})),this.logger.info("\uD83D\uDD0D Running composer outdated (including dev dependencies)...");let Y=await this.runCommand("composer",["outdated","--format=json"]);this.logger.info("\uD83D\uDCCA Raw composer outdated output length:",Y.length);let H;try{H=JSON.parse(Y),this.logger.info(`\uD83D\uDCCB Composer outdated found ${H.installed?.length||0} packages`)}catch(Q){return this.logger.info("\u274C Failed to parse composer outdated JSON:",Q),this.logger.info("Raw output:",Y.substring(0,500)),[]}if(H.installed){this.logger.info("\uD83D\uDD04 Processing outdated packages...");for(let Q of H.installed)if(this.logger.info(`
|
|
5
|
-
\uD83D\uDCE6 Processing package: ${Q.name}`),this.logger.info(` Current version: ${Q.version}`),this.logger.info(` Latest version: ${Q.latest}`),Q.name&&Q.version&&Q.latest){let z=K.require?.[Q.name],G=K["require-dev"]?.[Q.name],_=z||G;if(this.logger.info(` Constraint: ${_||"NOT FOUND"}`),!_){this.logger.info(` \u26A0\uFE0F Skipping ${Q.name} - not found in composer.json`);continue}if((this.config?.packages?.ignore||[]).includes(Q.name)){this.logger.info(` \u26A0\uFE0F Skipping ${Q.name} - in ignore list`);continue}let W="require";if(K["require-dev"]&&K["require-dev"][Q.name])W="require-dev";this.logger.info(` Dependency type: ${W}`);let L=await this.getComposerPackageMetadata(Q.name),O=this.extractConstraintBaseVersion(_);if(this.logger.info(` Constraint base version: ${O}`),!O){this.logger.warn(`\u274C Could not extract base version from constraint "${_}" for ${Q.name}`);continue}let S=O,b=Q.latest;this.logger.info(` Using current version: ${S} (from constraint)`),this.logger.info(` Target latest version: ${b}`);let j=[];try{this.logger.info(` \uD83D\uDD0D Getting available versions for ${Q.name}...`);let x=await this.runCommand("composer",["show",Q.name,"--available","--format=json"]),U=JSON.parse(x);if(U.versions)j=U.versions,this.logger.info(` \uD83D\uDCCB Found ${j.length} available versions`)}catch(x){this.logger.warn(`\u274C Failed to get available versions for ${Q.name}, using latest only:`,x),j=[b]}this.logger.info(" \uD83C\uDFAF Finding best constraint updates...");let D=await this.findBestConstraintUpdates(_,j,S);this.logger.info(` \uD83D\uDCCA Found ${D.length} update candidates`);for(let x of D){let U=E(S,x.version);if(this.logger.info(` \uD83D\uDCC8 Update candidate: ${S} \u2192 ${x.version} (${U})`),(this.config?.packages?.excludeMajor??!1)&&U==="major"){this.logger.info(` \u26A0\uFE0F Skipping major update for ${Q.name} - excludeMajor is true`);continue}this.logger.info(` \u2705 Adding update: ${Q.name} ${S} \u2192 ${x.version}`),X.push({name:Q.name,currentVersion:S,newVersion:x.version,updateType:U,dependencyType:W,file:"composer.json",metadata:L,releaseNotesUrl:this.getComposerReleaseNotesUrl(Q.name,L),changelogUrl:this.getComposerChangelogUrl(Q.name,L),homepage:L?.homepage})}}}return this.logger.info(`\u2705 Final result: Found ${X.length} Composer package updates`),this.logger.success(`Found ${X.length} Composer package updates`),X}catch(Z){return this.logger.warn("Failed to check for outdated Composer packages:",Z),[]}}parseVersion(X){let $=X.replace(/^v/,"").split("-")[0].split("+")[0].split(".").map((K)=>Number.parseInt(K,10));if($.length<2||$.some((K)=>Number.isNaN(K)))return null;return{major:$[0]||0,minor:$[1]||0,patch:$[2]||0}}compareVersions(X,Z){let $=this.parseVersion(X),K=this.parseVersion(Z);if(!$||!K)return 0;if($.major!==K.major)return $.major-K.major;if($.minor!==K.minor)return $.minor-K.minor;return $.patch-K.patch}async getComposerPackageMetadata(X){try{let $=(await this.fetchComposerPackage(X))?.package;if(!$?.versions)return;let K=Object.keys($.versions),Y=K.find((Q)=>!Q.includes("dev")&&!Q.includes("alpha")&&!Q.includes("beta"))??K[0],H=(Y?$.versions[Y]:void 0)??{};return{name:$.name??X,description:H.description,repository:H.source?.url??H.homepage,homepage:H.homepage,license:Array.isArray(H.license)?H.license.join(", "):H.license,author:H.authors?.[0]?.name,keywords:H.keywords,latestVersion:Y,versions:K,weeklyDownloads:$.downloads?.monthly,dependencies:H.require,devDependencies:H["require-dev"]}}catch(Z){this.logger.warn(`Failed to get Composer metadata for ${X}:`,Z);return}}async composerPackageExists(X){try{return await this.fetchComposerPackage(X)!==null}catch{return!1}}async getComposerLatestVersion(X){try{let $=(await this.fetchComposerPackage(X))?.package;if(!$?.versions)return null;let K=Object.keys($.versions),Y=K.filter((Q)=>!Q.includes("dev")&&!Q.includes("alpha")&&!Q.includes("beta")&&!Q.includes("rc"));if(Y.length===0)return K[0]||null;let H=Y.sort((Q,z)=>{try{if(typeof Bun<"u"&&Bun.semver)return Bun.semver.order(Q,z);return Q.localeCompare(z,void 0,{numeric:!0})}catch{return Q.localeCompare(z)}});return H[H.length-1]||null}catch(Z){return this.logger.warn(`Failed to get latest Composer version for ${X}:`,Z),null}}getComposerReleaseNotesUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/releases`;return}getComposerChangelogUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/blob/main/CHANGELOG.md`;return}extractConstraintBaseVersion(X){let Z=X.match(/^[\^~>=<]*([\d.]+)/);if(Z)return Z[1];return null}async findBestConstraintUpdates(X,Z,$){let{getUpdateType:K}=await import("./chunk-
|
|
6
|
-
export{P as
|
|
5
|
+
\uD83D\uDCE6 Processing package: ${Q.name}`),this.logger.info(` Current version: ${Q.version}`),this.logger.info(` Latest version: ${Q.latest}`),Q.name&&Q.version&&Q.latest){let z=K.require?.[Q.name],G=K["require-dev"]?.[Q.name],_=z||G;if(this.logger.info(` Constraint: ${_||"NOT FOUND"}`),!_){this.logger.info(` \u26A0\uFE0F Skipping ${Q.name} - not found in composer.json`);continue}if((this.config?.packages?.ignore||[]).includes(Q.name)){this.logger.info(` \u26A0\uFE0F Skipping ${Q.name} - in ignore list`);continue}let W="require";if(K["require-dev"]&&K["require-dev"][Q.name])W="require-dev";this.logger.info(` Dependency type: ${W}`);let L=await this.getComposerPackageMetadata(Q.name),O=this.extractConstraintBaseVersion(_);if(this.logger.info(` Constraint base version: ${O}`),!O){this.logger.warn(`\u274C Could not extract base version from constraint "${_}" for ${Q.name}`);continue}let S=O,b=Q.latest;this.logger.info(` Using current version: ${S} (from constraint)`),this.logger.info(` Target latest version: ${b}`);let j=[];try{this.logger.info(` \uD83D\uDD0D Getting available versions for ${Q.name}...`);let x=await this.runCommand("composer",["show",Q.name,"--available","--format=json"]),U=JSON.parse(x);if(U.versions)j=U.versions,this.logger.info(` \uD83D\uDCCB Found ${j.length} available versions`)}catch(x){this.logger.warn(`\u274C Failed to get available versions for ${Q.name}, using latest only:`,x),j=[b]}this.logger.info(" \uD83C\uDFAF Finding best constraint updates...");let D=await this.findBestConstraintUpdates(_,j,S);this.logger.info(` \uD83D\uDCCA Found ${D.length} update candidates`);for(let x of D){let U=E(S,x.version);if(this.logger.info(` \uD83D\uDCC8 Update candidate: ${S} \u2192 ${x.version} (${U})`),(this.config?.packages?.excludeMajor??!1)&&U==="major"){this.logger.info(` \u26A0\uFE0F Skipping major update for ${Q.name} - excludeMajor is true`);continue}this.logger.info(` \u2705 Adding update: ${Q.name} ${S} \u2192 ${x.version}`),X.push({name:Q.name,currentVersion:S,newVersion:x.version,updateType:U,dependencyType:W,file:"composer.json",metadata:L,releaseNotesUrl:this.getComposerReleaseNotesUrl(Q.name,L),changelogUrl:this.getComposerChangelogUrl(Q.name,L),homepage:L?.homepage})}}}return this.logger.info(`\u2705 Final result: Found ${X.length} Composer package updates`),this.logger.success(`Found ${X.length} Composer package updates`),X}catch(Z){return this.logger.warn("Failed to check for outdated Composer packages:",Z),[]}}parseVersion(X){let $=X.replace(/^v/,"").split("-")[0].split("+")[0].split(".").map((K)=>Number.parseInt(K,10));if($.length<2||$.some((K)=>Number.isNaN(K)))return null;return{major:$[0]||0,minor:$[1]||0,patch:$[2]||0}}compareVersions(X,Z){let $=this.parseVersion(X),K=this.parseVersion(Z);if(!$||!K)return 0;if($.major!==K.major)return $.major-K.major;if($.minor!==K.minor)return $.minor-K.minor;return $.patch-K.patch}async getComposerPackageMetadata(X){try{let $=(await this.fetchComposerPackage(X))?.package;if(!$?.versions)return;let K=Object.keys($.versions),Y=K.find((Q)=>!Q.includes("dev")&&!Q.includes("alpha")&&!Q.includes("beta"))??K[0],H=(Y?$.versions[Y]:void 0)??{};return{name:$.name??X,description:H.description,repository:H.source?.url??H.homepage,homepage:H.homepage,license:Array.isArray(H.license)?H.license.join(", "):H.license,author:H.authors?.[0]?.name,keywords:H.keywords,latestVersion:Y,versions:K,weeklyDownloads:$.downloads?.monthly,dependencies:H.require,devDependencies:H["require-dev"]}}catch(Z){this.logger.warn(`Failed to get Composer metadata for ${X}:`,Z);return}}async composerPackageExists(X){try{return await this.fetchComposerPackage(X)!==null}catch{return!1}}async getComposerLatestVersion(X){try{let $=(await this.fetchComposerPackage(X))?.package;if(!$?.versions)return null;let K=Object.keys($.versions),Y=K.filter((Q)=>!Q.includes("dev")&&!Q.includes("alpha")&&!Q.includes("beta")&&!Q.includes("rc"));if(Y.length===0)return K[0]||null;let H=Y.sort((Q,z)=>{try{if(typeof Bun<"u"&&Bun.semver)return Bun.semver.order(Q,z);return Q.localeCompare(z,void 0,{numeric:!0})}catch{return Q.localeCompare(z)}});return H[H.length-1]||null}catch(Z){return this.logger.warn(`Failed to get latest Composer version for ${X}:`,Z),null}}getComposerReleaseNotesUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/releases`;return}getComposerChangelogUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/blob/main/CHANGELOG.md`;return}extractConstraintBaseVersion(X){let Z=X.match(/^[\^~>=<]*([\d.]+)/);if(Z)return Z[1];return null}async findBestConstraintUpdates(X,Z,$){let{getUpdateType:K}=await import("./chunk-ems4rhqe.js"),Y=[],H=this.parseVersion($);if(!H)return[];let Q=null,z=null,G=null;for(let _ of Z){if(_.includes("dev")||_.includes("alpha")||_.includes("beta")||_.includes("RC"))continue;let I=this.parseVersion(_);if(!I)continue;if(this.compareVersions(_,$)<=0)continue;let L=K($,_);if(L==="patch"&&I.major===H.major&&I.minor===H.minor){if(!Q||this.compareVersions(_,Q)>0)Q=_}else if(L==="minor"&&I.major===H.major){if(!z||this.compareVersions(_,z)>0)z=_}else if(L==="major"){if(!G||this.compareVersions(_,G)>0)G=_}}if(Q)Y.push({version:Q,type:"patch"});if(z)Y.push({version:z,type:"minor"});if(G)Y.push({version:G,type:"major"});return Y}async getWorkspaceOutdatedPackages(){try{let X=await this.getWorkspaceNames(),Z=await this.findPackageJsonFiles(),$=[];this.logger.info(`Found ${X.length} workspace packages to check`);for(let K of X)try{let Y=await this.runBunOutdatedForWorkspace(K);$.push(...Y)}catch(Y){this.logger.warn(`Failed to check workspace ${K}:`,Y)}this.logger.info(`Checking ${Z.length} package.json files directly`);for(let K of Z){if(K==="package.json")continue;try{let Y=F.join(this.projectPath,K),H=q.readFileSync(Y,"utf-8"),Q=JSON.parse(H),z={...Q.dependencies,...Q.devDependencies,...Q.peerDependencies,...Q.optionalDependencies};for(let[G,_]of Object.entries(z)){if(typeof _!=="string"||_.startsWith("workspace:"))continue;if($.some((I)=>I.name===G))continue;try{let I=await this.getLatestVersion(G);if(I){let W=this.cleanVersionRange(_);if(W&&Bun.semver.order(W,I)<0)$.push({name:G,current:W,update:I,latest:I,file:K})}}catch{continue}}}catch(Y){this.logger.warn(`Failed to check packages in ${K}:`,Y)}}return this.logger.info(`Found ${$.length} outdated packages across workspaces`),$}catch(X){return this.logger.warn("Failed to check workspace packages:",X),[]}}async getWorkspaceNames(){let X=[],Z=await this.findPackageJsonFiles();for(let $ of Z)try{let K=F.join(this.projectPath,$),Y=q.readFileSync(K,"utf-8"),H=JSON.parse(Y);if(H.name&&$!=="package.json")X.push(H.name)}catch(K){this.logger.warn(`Failed to parse package.json ${$}:`,K)}return X}async findPackageJsonFiles(){let X=[],Z=async($,K="")=>{try{let Y=await q.promises.readdir($);for(let H of Y){let Q=F.join($,H),z=K?F.join(K,H):H,G=await q.promises.lstat(Q);if(G.isDirectory()){if(!this.shouldSkipDirectory(H))await Z(Q,z)}else if(G.isFile()&&H==="package.json")X.push(z)}}catch{}};return await Z(this.projectPath),X}shouldSkipDirectory(X){return h(X)}async findPackageLocation(X){let Z=await this.findPackageJsonFiles();for(let $ of Z)try{let K=F.join(this.projectPath,$),Y=q.readFileSync(K,"utf-8"),H=JSON.parse(Y);if({...H.dependencies,...H.devDependencies,...H.peerDependencies,...H.optionalDependencies}[X])return $}catch{continue}return null}async getPackageVersionReleaseDate(X,Z){try{let K=(await this.fetchPackument(X))?.time?.[Z];if(!K)return null;let Y=new Date(K);return Number.isNaN(Y.getTime())?null:Y}catch($){return this.logger.debug(`Failed to get release date for ${X}@${Z}:`,$),null}}async getGitHubActionReleaseDate(X,Z){try{let[$,K]=X.split("/");if(!$||!K)return null;let Y=`${y(this.config)}/repos/${$}/${K}/releases/tags/${encodeURIComponent(Z)}`,H=await V(Y,{headers:g(this.config)});if(!H?.published_at)return null;let Q=new Date(H.published_at);return Number.isNaN(Q.getTime())?null:Q}catch($){return this.logger.debug(`Failed to get GitHub Action release date for ${X}@${Z}:`,$),null}}async getComposerPackageReleaseDate(X,Z){try{let K=(await this.fetchComposerPackage(X))?.package?.versions?.[Z]?.time;if(!K)return null;let Y=new Date(K);return Number.isNaN(Y.getTime())?null:Y}catch($){return this.logger.debug(`Failed to get Composer package release date for ${X}@${Z}:`,$),null}}async getDockerImageReleaseDate(X,Z){try{return this.logger.debug(`Docker image release date checking not fully implemented for ${X}:${Z}`),null}catch($){return this.logger.debug(`Failed to get Docker image release date for ${X}:${Z}:`,$),null}}async meetsMinimumReleaseAge(X,Z,$,K){let Y=K??this.config?.packages?.minimumReleaseAge??0,H=this.config?.packages?.minimumReleaseAgeExclude??[];if(Y===0)return!0;if(H.includes(X))return this.logger.debug(`Package ${X} is excluded from minimum release age requirement`),!0;let Q=null;switch($){case"github-actions":Q=await this.getGitHubActionReleaseDate(X,Z);break;case"require":case"require-dev":Q=await this.getComposerPackageReleaseDate(X,Z);break;case"docker-image":Q=await this.getDockerImageReleaseDate(X,Z);break;default:Q=await this.getPackageVersionReleaseDate(X,Z);break}if(!Q)return this.logger.warn(`Could not determine release date for ${X}@${Z} (${$||"unknown type"}), allowing update`),!0;let G=(new Date().getTime()-Q.getTime())/60000,_=G>=Y;if(!_)this.logger.info(`Package ${X}@${Z} (${$||"unknown type"}) is too new (${Math.round(G)} minutes old, minimum: ${Y} minutes)`);return _}async runBunOutdatedForWorkspace(X){try{C(X,"workspace name");let Z=await this.runCommand("bun",["outdated","--filter",X]);return this.parseBunOutdatedOutput(Z).map((K)=>({...K,workspace:X}))}catch(Z){return this.logger.warn(`Failed to run bun outdated for workspace ${X}:`,Z),[]}}}
|
|
6
|
+
export{P as qd,M as rd,m as sd,J as td,k as ud};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Th as X}from"./chunk-56t2za4k.js";import"./chunk-eaz23nsf.js";import{readFileSync as _}from"fs";function L(q){let z=q.split("/").pop()||"";return z==="composer.json"||z==="composer.lock"}async function R(q,z){try{let j=JSON.parse(z),A=[];if(j.require)J(j.require,"require",q,A);if(j["require-dev"])J(j["require-dev"],"require-dev",q,A);return{path:q,type:"composer.json",content:z,dependencies:A}}catch(j){return X().warn(`Failed to parse composer.json file ${q}:`,j),null}}async function S(q,z){try{let j=JSON.parse(z),A=[];if(j.packages){for(let b of j.packages)if(b.name&&b.version)A.push({name:b.name,currentVersion:b.version,type:"require",file:q})}if(j["packages-dev"]){for(let b of j["packages-dev"])if(b.name&&b.version)A.push({name:b.name,currentVersion:b.version,type:"require-dev",file:q})}return{path:q,type:"composer.lock",content:z,dependencies:A}}catch(j){return X().warn(`Failed to parse composer.lock file ${q}:`,j),null}}async function v(q,z){let j=q.split("/").pop()||"";if(j==="composer.json")return R(q,z);if(j==="composer.lock")return S(q,z);return null}function J(q,z,j,A){for(let[b,Z]of Object.entries(q)){if(b==="php"||b.startsWith("ext-"))continue;if(b.includes("/"))A.push({name:b,currentVersion:Z,type:z,file:j})}}async function U(q){let z=[],j=q.filter((b)=>b.file.endsWith("composer.json"));if(j.length===0)return z;let A=new Map;for(let b of j){if(!A.has(b.file))A.set(b.file,[]);A.get(b.file).push({name:b.name,newVersion:b.newVersion})}for(let[b,Z]of A)try{let K=_(b,"utf-8"),T=JSON.parse(K);for(let E of Z){let Y=!1;if(T.require&&T.require[E.name]){let H=T.require[E.name],O;if(H.includes(",")){let G=H.match(/\d+\.\d+(?:\.\d+)?/),Q=G?G[0]:null;O=H.replace(/\d+\.\d+(?:\.\d+)?/g,(W)=>{return Q!==null&&W===Q?E.newVersion:W})}else{let G=H.match(/^(\D*)/);O=`${G?G[1]:""}${E.newVersion}`}let $=new RegExp(`("${E.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"\\s*:\\s*")([^"]+)(")`,"g");K=K.replace($,`$1${O}$3`),Y=!0}if(!Y&&T["require-dev"]&&T["require-dev"][E.name]){let H=T["require-dev"][E.name],O;if(H.includes(",")){let G=H.match(/\d+\.\d+(?:\.\d+)?/),Q=G?G[0]:null;O=H.replace(/\d+\.\d+(?:\.\d+)?/g,(W)=>{return Q!==null&&W===Q?E.newVersion:W})}else{let G=H.match(/^(\D*)/);O=`${G?G[1]:""}${E.newVersion}`}let $=new RegExp(`("${E.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"\\s*:\\s*")([^"]+)(")`,"g");K=K.replace($,`$1${O}$3`),Y=!0}if(!Y)X().warn(`Package ${E.name} not found in ${b}`)}z.push({path:b,content:K,type:"update"})}catch(K){X().error(`Failed to update ${b}:`,K)}return z}export{S as parseComposerLock,R as parseComposerJson,v as parseComposerFile,L as isComposerFile,U as generateComposerUpdates};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fc as _}from"./chunk-
|
|
2
|
+
import{fc as _}from"./chunk-97857d8t.js";import{Th as X}from"./chunk-56t2za4k.js";import{il as M}from"./chunk-eaz23nsf.js";var K={review:"review","full-review":"full-review",full:"full-review",summary:"summary",resolve:"resolve",pause:"pause",resume:"resume",ignore:"ignore",rebase:"rebase",retry:"rebase",merge:"merge",plan:"plan","fix-ci":"fix-ci",fix:"fix-ci",remember:"remember",help:"help"},Q=["help","summary"];function V(H){return H.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ").split(`
|
|
3
3
|
`).filter((C)=>!C.trimStart().startsWith(">")).join(`
|
|
4
|
-
`)}function $(H,C="@buddy"){if(!H)return null;let B=V(H),O=C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),j=new RegExp(`(?:^|\\s)${O}\\b[ \\t]*(.*)`,"i"),z=B.match(j);if(!z)return null;let A=(z[1]??"").trim();if(!A)return{name:"help",args:"",raw:z[0].trim()};let[D,...E]=A.split(/\s+/),J=K[D.toLowerCase()];if(!J)return{name:"chat",args:A,raw:z[0].trim()};return{name:J,args:E.join(" "),raw:z[0].trim()}}function G(H){return Q.includes(H)}function F(H,C="@buddy"){return Boolean(H?.toLowerCase().includes(C.toLowerCase()))}var Y="**Buddy commands**\n\n| Command | What it does |\n|---|---|\n| `@buddy review` | Review new changes since the last review |\n| `@buddy full-review` | Review the whole diff again, ignoring previous findings |\n| `@buddy summary` | Post a fresh summary without inline findings |\n| `@buddy pause` / `resume` | Stop or restart reviewing this pull request |\n| `@buddy rebase` | Rebase a dependency update pull request |\n| `@buddy merge` | Re-check auto-merge conditions now |\n| `@buddy fix-ci` | Diagnose the failing checks, and retry a flake |\n| `@buddy plan` | Research the repository and write an implementation plan |\n| `@buddy resolve` | Close the review threads Buddy opened |\n| `@buddy remember <text>` | Record a durable note for future runs |\n| `@buddy help` | Show this table |\n\nAnything else after the mention is treated as a question.";function Z(H){if(H.actor.isBot)return"comment was written by a bot";if(G(H.command.name))return null;if(!H.actor.canWrite)return`@${H.actor.login} does not have write access`;return null}async function L(H,C){let B=H.logger??X(),O=Z(H);if(O)return B.info(`\uD83D\uDEAB Ignoring \`${H.command.name}\`: ${O}`),{handled:!1,refusal:O};if(H.command.name==="help")return{handled:!0,reply:Y};let j=C[H.command.name];if(!j)return{handled:!1,refusal:`no handler for ${H.command.name}`,reply:`I don't know how to \`${H.command.name}\` yet. Try \`@buddy help\`.`};return B.info(`\uD83E\uDD16 Running \`${H.command.name}\` for @${H.actor.login}`),await j(H)}function T(H){return{async review(C){if(!C.isPullRequest)return{handled:!1,reply:"There is nothing to review \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.review(C.number,{})}},async "full-review"(C){if(!C.isPullRequest)return{handled:!1,reply:"There is nothing to review \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.review(C.number,{full:!0})}},async summary(C){if(!C.isPullRequest)return{handled:!1,reply:"There is nothing to summarize \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.review(C.number,{summaryOnly:!0})}},async pause(C){return await I(H,C.number,!0),{handled:!0,reply:"Paused. I will not review this pull request again until you say `@buddy resume`."}},async resume(C){return await I(H,C.number,!1),{handled:!0,reply:"Resumed. I will review the next push."}},async ignore(C){return await I(H,C.number,!0),{handled:!0,reply:"Understood \u2014 I will leave this pull request alone."}},async rebase(C){return{handled:!0,reply:await H.rebase(C.number)}},async merge(C){return{handled:!0,reply:(await H.merge()).includes(C.number)?"Merged.":"This pull request does not currently qualify for auto-merge. Check the conditions in your config and whether its checks have passed."}},async "fix-ci"(C){if(!C.isPullRequest)return{handled:!1,reply:"There are no checks to look at \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.fixCi(C.number)}},async remember(C){let B=C.command.args.trim();if(!B)return{handled:!1,reply:"Tell me what to remember, e.g. `@buddy remember we pin react to 17`."};return{handled:!0,reply:await H.remember(B,C)}},async resolve(C){if(!C.isPullRequest)return{handled:!1,reply:"There are no review threads here \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.resolve(C.number)}},async plan(C){return{handled:!0,reply:await H.plan(C.number,C.isPullRequest,C.command.args.trim())}},async chat(C){let B=_(H.config,C.logger);if(!B)return{handled:!1,reply:"I need an AI provider configured to answer questions. See https://buddy.sh/ai/providers"};return{handled:!0,reply:(await B.complete({system:"You are Buddy, answering a question in a pull request or issue thread. Be brief and concrete. If you do not know, say so rather than guessing.",messages:[{role:"user",content:C.command.args}]})).text}}}}async function I(H,C,B){let j=(await H.provider.getPullRequests("open")).find((E)=>E.number===C);if(!j)return;let{parseReviewState:z,upsertReviewState:A}=await import("./chunk-
|
|
4
|
+
`)}function $(H,C="@buddy"){if(!H)return null;let B=V(H),O=C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),j=new RegExp(`(?:^|\\s)${O}\\b[ \\t]*(.*)`,"i"),z=B.match(j);if(!z)return null;let A=(z[1]??"").trim();if(!A)return{name:"help",args:"",raw:z[0].trim()};let[D,...E]=A.split(/\s+/),J=K[D.toLowerCase()];if(!J)return{name:"chat",args:A,raw:z[0].trim()};return{name:J,args:E.join(" "),raw:z[0].trim()}}function G(H){return Q.includes(H)}function F(H,C="@buddy"){return Boolean(H?.toLowerCase().includes(C.toLowerCase()))}var Y="**Buddy commands**\n\n| Command | What it does |\n|---|---|\n| `@buddy review` | Review new changes since the last review |\n| `@buddy full-review` | Review the whole diff again, ignoring previous findings |\n| `@buddy summary` | Post a fresh summary without inline findings |\n| `@buddy pause` / `resume` | Stop or restart reviewing this pull request |\n| `@buddy rebase` | Rebase a dependency update pull request |\n| `@buddy merge` | Re-check auto-merge conditions now |\n| `@buddy fix-ci` | Diagnose the failing checks, and retry a flake |\n| `@buddy plan` | Research the repository and write an implementation plan |\n| `@buddy resolve` | Close the review threads Buddy opened |\n| `@buddy remember <text>` | Record a durable note for future runs |\n| `@buddy help` | Show this table |\n\nAnything else after the mention is treated as a question.";function Z(H){if(H.actor.isBot)return"comment was written by a bot";if(G(H.command.name))return null;if(!H.actor.canWrite)return`@${H.actor.login} does not have write access`;return null}async function L(H,C){let B=H.logger??X(),O=Z(H);if(O)return B.info(`\uD83D\uDEAB Ignoring \`${H.command.name}\`: ${O}`),{handled:!1,refusal:O};if(H.command.name==="help")return{handled:!0,reply:Y};let j=C[H.command.name];if(!j)return{handled:!1,refusal:`no handler for ${H.command.name}`,reply:`I don't know how to \`${H.command.name}\` yet. Try \`@buddy help\`.`};return B.info(`\uD83E\uDD16 Running \`${H.command.name}\` for @${H.actor.login}`),await j(H)}function T(H){return{async review(C){if(!C.isPullRequest)return{handled:!1,reply:"There is nothing to review \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.review(C.number,{})}},async "full-review"(C){if(!C.isPullRequest)return{handled:!1,reply:"There is nothing to review \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.review(C.number,{full:!0})}},async summary(C){if(!C.isPullRequest)return{handled:!1,reply:"There is nothing to summarize \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.review(C.number,{summaryOnly:!0})}},async pause(C){return await I(H,C.number,!0),{handled:!0,reply:"Paused. I will not review this pull request again until you say `@buddy resume`."}},async resume(C){return await I(H,C.number,!1),{handled:!0,reply:"Resumed. I will review the next push."}},async ignore(C){return await I(H,C.number,!0),{handled:!0,reply:"Understood \u2014 I will leave this pull request alone."}},async rebase(C){return{handled:!0,reply:await H.rebase(C.number)}},async merge(C){return{handled:!0,reply:(await H.merge()).includes(C.number)?"Merged.":"This pull request does not currently qualify for auto-merge. Check the conditions in your config and whether its checks have passed."}},async "fix-ci"(C){if(!C.isPullRequest)return{handled:!1,reply:"There are no checks to look at \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.fixCi(C.number)}},async remember(C){let B=C.command.args.trim();if(!B)return{handled:!1,reply:"Tell me what to remember, e.g. `@buddy remember we pin react to 17`."};return{handled:!0,reply:await H.remember(B,C)}},async resolve(C){if(!C.isPullRequest)return{handled:!1,reply:"There are no review threads here \u2014 this is an issue, not a pull request."};return{handled:!0,reply:await H.resolve(C.number)}},async plan(C){return{handled:!0,reply:await H.plan(C.number,C.isPullRequest,C.command.args.trim())}},async chat(C){let B=_(H.config,C.logger);if(!B)return{handled:!1,reply:"I need an AI provider configured to answer questions. See https://buddy.sh/ai/providers"};return{handled:!0,reply:(await B.complete({system:"You are Buddy, answering a question in a pull request or issue thread. Be brief and concrete. If you do not know, say so rather than guessing.",messages:[{role:"user",content:C.command.args}]})).text}}}}async function I(H,C,B){let j=(await H.provider.getPullRequests("open")).find((E)=>E.number===C);if(!j)return;let{parseReviewState:z,upsertReviewState:A}=await import("./chunk-7rdqaj9g.js"),D=z(j.body);await H.provider.updatePullRequest(C,{body:A(j.body,{reviewedSha:D?.reviewedSha??"",fingerprints:D?.fingerprints??[],reviewedAt:D?.reviewedAt??new Date().toISOString(),...B?{paused:!0}:{}})})}export{K as db,Q as eb,V as fb,$ as gb,G as hb,F as ib,Y as jb,Z as kb,L as lb,T as mb};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ei as a,Fi as e,Gi as s,Hi as t,Ii as c,Ji as r,Ki as P,Li as n,Mi as o,Ni as g,Oi as l,Pi as p,Qi as d,Ri as k}from"./chunk-drn3hq53.js";import"./chunk-eaz23nsf.js";export{o as startPeriodicCleanup,n as setupCleanupHandlers,p as scanPantryPackages,t as saveToCacheAndOutput,a as savePackageAsTypeScript,d as readPantryPackageInfo,s as getValidCachedPackage,r as fetchPkgxProjects,k as fetchPantryPackageWithMetadata,P as fetchPantryPackage,l as fetchAndSavePackage,g as fetchAndSaveAllPackages,c as cleanupBrowserResources,e as cleanStaleOutputFiles};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{vd as a}from"./chunk-b8bfag6k.js";import"./chunk-3zp7a103.js";import"./chunk-d2vrstjq.js";import"./chunk-hzpsmg4z.js";import"./chunk-0baffydm.js";import"./chunk-sveh3wjr.js";import"./chunk-j46f90n8.js";import"./chunk-5107xbwj.js";import"./chunk-2z9mh5y4.js";import"./chunk-yh13j2af.js";import"./chunk-kqwdg3nw.js";import"./chunk-56t2za4k.js";import"./chunk-drn3hq53.js";import"./chunk-eaz23nsf.js";export{a as PackageScanner};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$a as d,Ya as a,Za as b,_a as c,ab as e,bb as f,cb as g}from"./chunk-b27ezdzq.js";import"./chunk-dbhgxe35.js";import"./chunk-s3t54kj1.js";import"./chunk-p09rsh3z.js";import"./chunk-1pecmenc.js";import"./chunk-rb6gzts6.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-kqwdg3nw.js";import"./chunk-56t2za4k.js";import"./chunk-eaz23nsf.js";export{g as runFixCi,e as latestFailurePerWorkflow,d as failsOnBaseBranch,b as extractErrorLines,c as describeFailure,a as classifyFailure,f as attemptFix};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{od as a}from"./chunk-jan74vw2.js";import"./chunk-c5d5webv.js";import"./chunk-g482e1b0.js";import"./chunk-b8bfag6k.js";import"./chunk-3zp7a103.js";import"./chunk-d2vrstjq.js";import"./chunk-wjzravb7.js";import"./chunk-s3t54kj1.js";import"./chunk-p09rsh3z.js";import"./chunk-hzpsmg4z.js";import"./chunk-0baffydm.js";import"./chunk-sveh3wjr.js";import"./chunk-rzxj5fgp.js";import"./chunk-j46f90n8.js";import"./chunk-09qpgqgj.js";import"./chunk-vna64r40.js";import"./chunk-1pecmenc.js";import"./chunk-rb6gzts6.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-w3ktf7th.js";import"./chunk-x9vpk4kk.js";import"./chunk-5107xbwj.js";import"./chunk-2z9mh5y4.js";import"./chunk-yh13j2af.js";import"./chunk-wkjv03yr.js";import"./chunk-kqwdg3nw.js";import"./chunk-56t2za4k.js";import"./chunk-drn3hq53.js";import"./chunk-eaz23nsf.js";export{a as Buddy};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Th as K}from"./chunk-56t2za4k.js";import{il as N}from"./chunk-eaz23nsf.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
3
|
export{F as te,S as ue,w as ve,U as we};
|
|
@@ -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-xaw1yts1.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-97857d8t.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-kqwdg3nw.js";import"./chunk-56t2za4k.js";import"./chunk-eaz23nsf.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,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{L as
|
|
2
|
+
import{od as Z}from"./chunk-jan74vw2.js";import{Rh as _}from"./chunk-56t2za4k.js";import Y from"process";class L{jobs=new Map;timers=new Map;logger;isRunning=!1;constructor(q=!1){this.logger=q?_.verbose():_.quiet()}addJob(q){this.jobs.set(q.id,q),this.scheduleJob(q),this.logger.info(`Scheduled job '${q.name}' with cron: ${q.schedule.cron}`)}removeJob(q){let C=this.timers.get(q);if(C)clearTimeout(C),this.timers.delete(q);this.jobs.delete(q),this.logger.info(`Removed scheduled job: ${q}`)}start(){if(this.isRunning){this.logger.warn("Scheduler is already running");return}this.isRunning=!0,this.logger.info("\uD83D\uDD52 Buddy Scheduler started");for(let q of this.jobs.values())if(this.scheduleJob(q),q.schedule.runOnStartup)this.logger.info(`Running startup job: ${q.name}`),setImmediate(()=>this.runJob(q));Y.on("SIGINT",()=>this.stop()),Y.on("SIGTERM",()=>this.stop())}stop(){if(!this.isRunning)return;this.isRunning=!1,this.logger.info("\uD83D\uDED1 Stopping Buddy Scheduler...");for(let q of this.timers.values())clearTimeout(q);this.timers.clear(),this.logger.success("\u2705 Buddy Scheduler stopped"),Y.exit(0)}getJobStatus(q){return this.jobs.get(q)}getAllJobs(){return Array.from(this.jobs.values())}scheduleJob(q){let C=this.timers.get(q.id);if(C)clearTimeout(C);let D=this.getNextRunTime(q.schedule.cron,q.schedule.timezone);if(q.nextRun=D||void 0,D){let G=D.getTime()-Date.now(),F=setTimeout(()=>{this.runJob(q),this.scheduleJob(q)},G);this.timers.set(q.id,F),this.logger.debug(`Job '${q.name}' scheduled for ${D.toISOString()}`)}}async runJob(q){if(q.status==="running"){this.logger.warn(`Job '${q.name}' is already running, skipping`);return}q.status="running",q.lastRun=new Date,this.logger.info(`\uD83D\uDE80 Running scheduled job: ${q.name}`);let C=Date.now(),D=q.schedule.maxRuntime||1800000;try{let G=new Promise((Q,U)=>{setTimeout(()=>U(Error("Job timeout")),D)}),F=this.executeJob(q);await Promise.race([F,G]);let J=Date.now()-C;q.status="idle",this.logger.success(`\u2705 Job '${q.name}' completed in ${J}ms`)}catch(G){q.status="error",this.logger.error(`\u274C Job '${q.name}' failed:`,G)}}async executeJob(q){let C=new Z(q.config),D=await C.scanForUpdates();if(D.updates.length===0){this.logger.info("No dependency updates found");return}if(this.logger.info(`Found ${D.updates.length} dependency updates`),q.config.repository&&q.config.pullRequest)await C.createPullRequests(D),this.logger.success(`Created pull requests for ${D.groups.length} update groups`);else this.logger.info("Repository not configured, skipping PR creation")}getNextRunTime(q,C){try{return this.parseCronExpression(q,C)}catch(D){return this.logger.error(`Invalid cron expression '${q}':`,D),null}}parseCronExpression(q,C){let D=q.trim().split(/\s+/);if(D.length!==5)throw Error("Cron expression must have 5 parts: minute hour day month dayOfWeek");let[G,F,J,Q,U]=D,K=new Date,V=C?this.timezoneOffsetMinutes(K,C):0;if(C)this.logger.debug(`Using timezone: ${C} (offset ${V} minutes)`);let X=new Date(K.getTime()+V*60*1000);X.setSeconds(0,0);let $=this.parseCronField(F,0,23),B=this.parseCronField(G,0,59);if($.length>0&&B.length>0){if(X.setHours($[0],B[0],0,0),X.getTime()-V*60*1000<=K.getTime())X.setDate(X.getDate()+1);return new Date(X.getTime()-V*60*1000)}return new Date(K.getTime()+3600000)}timezoneOffsetMinutes(q,C){try{let D=new Date(q.toLocaleString("en-US",{timeZone:C})),G=new Date(q.toLocaleString("en-US"));return Math.round((D.getTime()-G.getTime())/60000)}catch{return this.logger.warn(`\u26A0\uFE0F Unknown timezone "${C}", scheduling in host time instead`),0}}parseCronField(q,C,D){if(q==="*")return Array.from({length:D-C+1},(F,J)=>C+J);if(q.includes(","))return q.split(",").map(Number).filter((F)=>Number.isFinite(F)&&F>=C&&F<=D);if(q.includes("-")){let F=q.split("-").map(Number),J=F[0],Q=F[1];if(F.length!==2||!Number.isFinite(J)||!Number.isFinite(Q)||Q<J)return[];return Array.from({length:Q-J+1},(U,K)=>J+K).filter((U)=>U>=C&&U<=D)}if(q.includes("/")){let[F,J]=q.split("/"),Q=Number(J);if(!Number.isFinite(Q)||Q<=0)return[];if(F==="*")return Array.from({length:D-C+1},(K,V)=>C+V).filter((K,V)=>V%Q===0);let U=Number(F);return Number.isFinite(U)?[U].filter((K)=>K>=C&&K<=D):[]}let G=Number(q);return Number.isFinite(G)&&G>=C&&G<=D?[G]:[]}static createJobFromConfig(q,C="default"){let D={cron:q.schedule?.cron||"0 2 * * 1",timezone:q.schedule?.timezone,runOnStartup:!1,maxRuntime:1800000};return{id:C,name:`Buddy Dependency Updates (${C})`,schedule:D,status:"idle",config:q}}static PRESETS={DAILY:"0 2 * * *",WEEKLY:"0 2 * * 1",WEEKDAYS:"0 2 * * 1-5",TWICE_WEEKLY:"0 2 * * 1,4",MONTHLY:"0 2 1 * *",HOURLY:"0 * * * *",CUSTOM:(q,C,D="*")=>`${q} ${C} * * ${D}`}}
|
|
3
|
+
export{L as Xa};
|