@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.
Files changed (158) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/bin/cli.js +19 -19
  3. package/dist/{chunk-p9z0hzej.js → chunk-08daxhzx.js} +2 -2
  4. package/dist/{chunk-ja3rvd6y.js → chunk-0f1xye20.js} +1 -1
  5. package/dist/{chunk-be059ncv.js → chunk-0g4ybxwj.js} +2 -2
  6. package/dist/{chunk-2m0134q8.js → chunk-0m1z85m9.js} +1 -1
  7. package/dist/chunk-0m6b7bac.js +2 -0
  8. package/dist/{chunk-6xzzs109.js → chunk-0rbxek2f.js} +2 -2
  9. package/dist/chunk-0sm25gee.js +2 -0
  10. package/dist/{chunk-xny4kgcc.js → chunk-142zh7e5.js} +1 -1
  11. package/dist/chunk-18xha279.js +2 -0
  12. package/dist/{chunk-jpdd59fh.js → chunk-1pecmenc.js} +1 -1
  13. package/dist/chunk-1tx3t9ke.js +2 -0
  14. package/dist/chunk-1w1h2tsf.js +2 -0
  15. package/dist/{chunk-nwrr6jas.js → chunk-1xe0960b.js} +2 -2
  16. package/dist/{chunk-emygmh7r.js → chunk-24xvskkf.js} +1 -1
  17. package/dist/{chunk-r7nh070r.js → chunk-25sjd6zk.js} +5 -5
  18. package/dist/{chunk-6wxwewbh.js → chunk-2e4e6zjs.js} +1 -1
  19. package/dist/chunk-2h90wcxe.js +2 -0
  20. package/dist/{chunk-7bctsv0x.js → chunk-2hb8dan0.js} +1 -1
  21. package/dist/{chunk-z21tw4fz.js → chunk-2jjrxgs1.js} +2 -2
  22. package/dist/{chunk-6k6dgwmy.js → chunk-2z9pkk1y.js} +1 -1
  23. package/dist/{chunk-9m0epv44.js → chunk-33h1me7n.js} +2 -2
  24. package/dist/{chunk-khn11t39.js → chunk-3c114myc.js} +1 -1
  25. package/dist/{chunk-rg996jqw.js → chunk-40pvn33p.js} +1 -1
  26. package/dist/{chunk-k3x0mabj.js → chunk-42xvqxdw.js} +2 -2
  27. package/dist/{chunk-d4wqe366.js → chunk-4kr6evh6.js} +1 -1
  28. package/dist/{chunk-1m5wprvm.js → chunk-54er1whp.js} +2 -2
  29. package/dist/{chunk-y7z0br2x.js → chunk-59993g25.js} +1 -1
  30. package/dist/{chunk-7crh00m7.js → chunk-5jvde2as.js} +2 -2
  31. package/dist/{chunk-y9senfb6.js → chunk-5pheqk23.js} +1 -1
  32. package/dist/{chunk-db9rffcf.js → chunk-5vekh5w1.js} +1 -1
  33. package/dist/{chunk-drkzf2gz.js → chunk-62j8q7sg.js} +1 -1
  34. package/dist/chunk-64kt1w23.js +2 -0
  35. package/dist/{chunk-4akhxmfk.js → chunk-65by8f14.js} +1 -1
  36. package/dist/chunk-6gdenphk.js +2 -0
  37. package/dist/chunk-6pcnvdj9.js +2 -0
  38. package/dist/{chunk-mdbf728w.js → chunk-77qe887p.js} +1 -1
  39. package/dist/{chunk-mg3em5qj.js → chunk-7b4jsg36.js} +2 -2
  40. package/dist/{chunk-hkb714k3.js → chunk-7c1284fb.js} +1 -1
  41. package/dist/chunk-7m1ab6p8.js +2 -0
  42. package/dist/{chunk-bggpgbdx.js → chunk-7m3pzkcj.js} +1 -1
  43. package/dist/chunk-83yea9pk.js +2 -0
  44. package/dist/{chunk-04qvf24t.js → chunk-89jytkd6.js} +1 -1
  45. package/dist/{chunk-bjymeq7e.js → chunk-8swwcx7w.js} +1 -1
  46. package/dist/chunk-9exbsfz5.js +2 -0
  47. package/dist/{chunk-ysgex7h7.js → chunk-a3zgenkh.js} +1 -1
  48. package/dist/{chunk-xffrrs85.js → chunk-afstgmb4.js} +11 -11
  49. package/dist/{chunk-7ds5q6j3.js → chunk-apdrg3r7.js} +1 -1
  50. package/dist/{chunk-88xaexj1.js → chunk-b3s185kp.js} +1 -1
  51. package/dist/chunk-b59zbkfx.js +2 -0
  52. package/dist/{chunk-34rmja4x.js → chunk-b6a5txek.js} +2 -2
  53. package/dist/{chunk-a3bnhq58.js → chunk-b9szrnxw.js} +1 -1
  54. package/dist/{chunk-fpzgxg8a.js → chunk-be7g40yf.js} +1 -1
  55. package/dist/{chunk-89s9f3mf.js → chunk-bnp0r4eh.js} +1 -1
  56. package/dist/{chunk-se4g70q2.js → chunk-bsh3kp53.js} +1 -1
  57. package/dist/{chunk-vckn5ate.js → chunk-cj4d5ad7.js} +1 -1
  58. package/dist/chunk-csqh2ca4.js +3 -0
  59. package/dist/{chunk-xps8n8nj.js → chunk-d9m42wym.js} +2 -2
  60. package/dist/{chunk-61gfjcqt.js → chunk-dd895pm0.js} +1 -1
  61. package/dist/{chunk-h8e796qs.js → chunk-ddky3026.js} +1 -1
  62. package/dist/{chunk-rrnvxj90.js → chunk-dsnd6ndd.js} +1 -1
  63. package/dist/{chunk-pmszvhja.js → chunk-esm5jjgf.js} +1 -1
  64. package/dist/chunk-ffbbc38r.js +2 -0
  65. package/dist/{chunk-p5yaf72b.js → chunk-g0x10e1d.js} +38 -34
  66. package/dist/{chunk-kh6v93yb.js → chunk-gpjde0j6.js} +2 -2
  67. package/dist/{chunk-4wbbbcs2.js → chunk-gweqk008.js} +2 -2
  68. package/dist/{chunk-a34szd4r.js → chunk-gzkwszsg.js} +3 -3
  69. package/dist/{chunk-jxd64dzs.js → chunk-h8wskvjv.js} +1 -1
  70. package/dist/{chunk-kpdz73mc.js → chunk-hc651afv.js} +1 -1
  71. package/dist/chunk-hmymd6m2.js +2 -0
  72. package/dist/{chunk-88j356ng.js → chunk-j46f90n8.js} +1 -1
  73. package/dist/chunk-jhz202wk.js +2 -0
  74. package/dist/{chunk-1szfwcst.js → chunk-jqh7vx2n.js} +1 -1
  75. package/dist/{chunk-amj037yy.js → chunk-jsf2322c.js} +3 -3
  76. package/dist/{chunk-qdmr84mc.js → chunk-k3r7v3dp.js} +2 -2
  77. package/dist/{chunk-s3ksf6s5.js → chunk-kbvj6qxc.js} +1 -1
  78. package/dist/{chunk-gvnsr72j.js → chunk-knpdntnh.js} +1 -1
  79. package/dist/chunk-kq0n3x2e.js +2 -0
  80. package/dist/{chunk-ktmgq0ja.js → chunk-ktn47bq8.js} +1 -1
  81. package/dist/chunk-m1zv8db4.js +2 -0
  82. package/dist/chunk-m63hkte2.js +2 -0
  83. package/dist/{chunk-s3q7g2hy.js → chunk-mpb1g0xk.js} +1 -1
  84. package/dist/{chunk-d7jpbw1z.js → chunk-mt53v4sx.js} +1 -1
  85. package/dist/{chunk-3waqfh3y.js → chunk-naz864cb.js} +2 -2
  86. package/dist/{chunk-90q6r1j7.js → chunk-nbyxgt9c.js} +1 -1
  87. package/dist/chunk-njrezpsw.js +2 -0
  88. package/dist/{chunk-gyf7psxg.js → chunk-nkztawjh.js} +1 -1
  89. package/dist/chunk-pegk4jhq.js +2 -0
  90. package/dist/{chunk-k7x9af5r.js → chunk-pq115qkn.js} +2 -2
  91. package/dist/{chunk-q90s02qc.js → chunk-q7y8dvbz.js} +1 -1
  92. package/dist/{chunk-wjmp2hsj.js → chunk-qdr900z7.js} +1 -1
  93. package/dist/chunk-qxf3f6ks.js +2 -0
  94. package/dist/{chunk-tx9m7y1z.js → chunk-raj75r4h.js} +2 -2
  95. package/dist/chunk-rphwf28s.js +2 -0
  96. package/dist/chunk-rr8apsh5.js +2 -0
  97. package/dist/{chunk-jj1gjkb7.js → chunk-ry5zh9cx.js} +1 -1
  98. package/dist/chunk-sd5xqd44.js +2 -0
  99. package/dist/{chunk-7rjrea9g.js → chunk-sxfk3naz.js} +2 -2
  100. package/dist/chunk-tbt8btwf.js +2 -0
  101. package/dist/chunk-tjvvb919.js +2 -0
  102. package/dist/{chunk-ggzjv4s0.js → chunk-va3k91tf.js} +1 -1
  103. package/dist/{chunk-hdqmcp3n.js → chunk-vmt1bed1.js} +1 -1
  104. package/dist/chunk-vpsvtb9v.js +2 -0
  105. package/dist/{chunk-pxdrwhxx.js → chunk-vpw7adwd.js} +1 -1
  106. package/dist/{chunk-8tsw3cjk.js → chunk-vs68hsbp.js} +1 -1
  107. package/dist/{chunk-2145m12g.js → chunk-vtr2vbk0.js} +1 -1
  108. package/dist/{chunk-4hd1mryc.js → chunk-w55x2g9n.js} +2 -2
  109. package/dist/{chunk-hyp0wfta.js → chunk-wjfw6rx8.js} +2 -2
  110. package/dist/chunk-wt83nzn3.js +2 -0
  111. package/dist/{chunk-8dj94fsy.js → chunk-x1w6q9tk.js} +1 -1
  112. package/dist/{chunk-wreexgkb.js → chunk-xdrvb89m.js} +3 -3
  113. package/dist/chunk-xxwevpnr.js +2 -0
  114. package/dist/{chunk-wd8w0vjs.js → chunk-y3w8h4sy.js} +1 -1
  115. package/dist/{chunk-4c3dws2k.js → chunk-ycbk7tg9.js} +1 -1
  116. package/dist/chunk-yf01hyxn.js +2 -0
  117. package/dist/{chunk-srz5kgyg.js → chunk-yqfwvk9z.js} +1 -1
  118. package/dist/{chunk-0apd8zqn.js → chunk-z05djfac.js} +7 -7
  119. package/dist/{chunk-kpqez1ht.js → chunk-z18bksyr.js} +1 -1
  120. package/dist/chunk-z4btj7s0.js +2 -0
  121. package/dist/{chunk-1tg7dfq5.js → chunk-zk8zdv23.js} +1 -1
  122. package/dist/src/index.js +1 -1
  123. package/dist/src/setup.js +1 -1
  124. package/dist/src/utils/lock-file.d.ts +19 -0
  125. package/package.json +1 -1
  126. package/dist/chunk-00vbhh0z.js +0 -2
  127. package/dist/chunk-0y706m2d.js +0 -2
  128. package/dist/chunk-1aee33aa.js +0 -2
  129. package/dist/chunk-1vhqtq6m.js +0 -2
  130. package/dist/chunk-2fx0tbc0.js +0 -2
  131. package/dist/chunk-3ggd7z2f.js +0 -2
  132. package/dist/chunk-3xbx315d.js +0 -2
  133. package/dist/chunk-4k9f9vn2.js +0 -2
  134. package/dist/chunk-4zvjzesh.js +0 -2
  135. package/dist/chunk-5dw0q5ng.js +0 -2
  136. package/dist/chunk-5qtdc2mb.js +0 -2
  137. package/dist/chunk-6gttmvww.js +0 -2
  138. package/dist/chunk-7f6mpphq.js +0 -2
  139. package/dist/chunk-7mmdxbcm.js +0 -2
  140. package/dist/chunk-7ze1qrmt.js +0 -2
  141. package/dist/chunk-9634xcvq.js +0 -2
  142. package/dist/chunk-ea6rtyvy.js +0 -2
  143. package/dist/chunk-gs5b2ssa.js +0 -2
  144. package/dist/chunk-gw69sjx2.js +0 -2
  145. package/dist/chunk-j0fcqty9.js +0 -2
  146. package/dist/chunk-mzb7cg8a.js +0 -2
  147. package/dist/chunk-pjq0qxst.js +0 -2
  148. package/dist/chunk-pksrcdh6.js +0 -2
  149. package/dist/chunk-sdhyhefy.js +0 -2
  150. package/dist/chunk-sxdfmskp.js +0 -2
  151. package/dist/chunk-tf9nqr0p.js +0 -2
  152. package/dist/chunk-tm8eg4sk.js +0 -2
  153. package/dist/chunk-tq1w2wwa.js +0 -2
  154. package/dist/chunk-w93akf6h.js +0 -2
  155. package/dist/chunk-ydt2sn0j.js +0 -2
  156. package/dist/chunk-z0qbkvyz.js +0 -2
  157. package/dist/chunk-zefqbamj.js +0 -2
  158. package/dist/chunk-zrg5ss0x.js +0 -3
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{vh as L$}from"./chunk-hkb714k3.js";import{wh as P$}from"./chunk-6k6dgwmy.js";import{Ih as Z1}from"./chunk-a3bnhq58.js";import{Oh as H}from"./chunk-8dj94fsy.js";import{bl as u7,cl as B,dl as O1}from"./chunk-s3ksf6s5.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.
2
+ import{wh as L$}from"./chunk-7c1284fb.js";import{xh as P$}from"./chunk-2z9pkk1y.js";import{Jh as Z1}from"./chunk-b9szrnxw.js";import{Ph as H}from"./chunk-x1w6q9tk.js";import{cl as u7,dl as B,el as O1}from"./chunk-kbvj6qxc.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(`
@@ -1067,4 +1067,4 @@ ${Y}:`),$.errors.length>0)H().info("\u274C Errors:"),$.errors.forEach((Z)=>H().i
1067
1067
  2. \u26A0\uFE0F Using default GITHUB_TOKEN (limited functionality):`),H().info(" \u2022 Dependency updates: \u2705 Will work"),H().info(" \u2022 Dashboard creation: \u2705 Will work"),H().info(" \u2022 Workflow file updates: \u274C Won't work"),H().info(" \uD83D\uDCA1 Consider setting up a Personal Access Token later for full functionality");H().info(`
1068
1068
  3. \uD83D\uDD27 Configure repository permissions:`),H().info(` - Go to: https://github.com/${$.owner}/${$.name}/settings/actions`),H().info(' - Under "Workflow permissions":'),H().info(' \u2705 Select "Read and write permissions"'),H().info(' \u2705 Check "Allow GitHub Actions to create and approve pull requests"'),H().info(' - Click "Save"'),H().info(`
1069
1069
  \uD83C\uDF89 Setup Complete!`),H().info("\uD83D\uDCA1 Your workflows will now run automatically on schedule!"),H().info("\uD83D\uDCCA First dashboard update will appear within 24 hours"),H().info("\uD83D\uDD17 Learn more: https://docs.github.com/en/actions")}
1070
- export{j$ as Wg,g7 as Xg,m7 as Yg,D$ as Zg,I$ as _g,i7 as $g,a7 as ah,_5 as bh,b5 as ch,k5 as dh,x5 as eh,h5 as fh,s7 as gh,d5 as hh,v5 as ih,y5 as jh,f5 as kh,g5 as lh,w$ as mh,zz as nh,m5 as oh,_$ as ph,u5 as qh,c5 as rh,n5 as sh,i5 as th,l5 as uh};
1070
+ export{j$ as Xg,g7 as Yg,m7 as Zg,D$ as _g,I$ as $g,i7 as ah,a7 as bh,_5 as ch,b5 as dh,k5 as eh,x5 as fh,h5 as gh,s7 as hh,d5 as ih,v5 as jh,y5 as kh,f5 as lh,g5 as mh,w$ as nh,zz as oh,m5 as ph,_$ as qh,u5 as rh,c5 as sh,n5 as th,i5 as uh,l5 as vh};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Lb as a,Mb as b,Nb as c,Ob as d,Pb as e}from"./chunk-5yfaptmp.js";import"./chunk-s3ksf6s5.js";export{d as upsertReviewState,b as serializeReviewState,c as parseReviewState,e as needsReview,a as REVIEW_STATE_VERSION};
2
+ import{Lb as a,Mb as b,Nb as c,Ob as d,Pb as e}from"./chunk-5yfaptmp.js";import"./chunk-kbvj6qxc.js";export{d as upsertReviewState,b as serializeReviewState,c as parseReviewState,e as needsReview,a as REVIEW_STATE_VERSION};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Oh as V}from"./chunk-8dj94fsy.js";import{join as R}from"path";var K=/^catalog:(.*)$/;function N(X){let J;try{J=Bun.YAML.parse(X)}catch{return{entries:[],hasCatalogs:!1}}if(typeof J!=="object"||J===null)return{entries:[],hasCatalogs:!1};let B=J,z=[],$=!1,H=(M,j)=>{if(typeof M!=="object"||M===null||Array.isArray(M))return;$=!0;for(let[U,q]of Object.entries(M))if(typeof q==="string"&&q.trim())z.push({name:U,version:q.trim(),catalog:j})};if(H(B.catalog,"default"),typeof B.catalogs==="object"&&B.catalogs!==null)for(let[M,j]of Object.entries(B.catalogs))H(j,M);return{entries:z,hasCatalogs:$}}function k(X,J,B){let z=K.exec(X.trim());if(!z)return null;let $=z[1].trim()||"default";return J.find((H)=>H.name===B&&H.catalog===$)?.version??null}function w(X){return K.test(X.trim())}function S(X,J,B){let z=X.split(`
2
+ import{Ph as V}from"./chunk-x1w6q9tk.js";import{join as R}from"path";var K=/^catalog:(.*)$/;function N(X){let J;try{J=Bun.YAML.parse(X)}catch{return{entries:[],hasCatalogs:!1}}if(typeof J!=="object"||J===null)return{entries:[],hasCatalogs:!1};let B=J,z=[],$=!1,H=(M,j)=>{if(typeof M!=="object"||M===null||Array.isArray(M))return;$=!0;for(let[U,q]of Object.entries(M))if(typeof q==="string"&&q.trim())z.push({name:U,version:q.trim(),catalog:j})};if(H(B.catalog,"default"),typeof B.catalogs==="object"&&B.catalogs!==null)for(let[M,j]of Object.entries(B.catalogs))H(j,M);return{entries:z,hasCatalogs:$}}function k(X,J,B){let z=K.exec(X.trim());if(!z)return null;let $=z[1].trim()||"default";return J.find((H)=>H.name===B&&H.catalog===$)?.version??null}function w(X){return K.test(X.trim())}function S(X,J,B){let z=X.split(`
3
3
  `),$=/^(\s*)(["']?)([^"':]+)\2(\s*:\s*)(["']?)(.+?)\5(\s*(?:#.*)?)$/,H=null,M=!1,j=0;for(let U=0;U<z.length;U++){let q=z[U],Y=q.length-q.trimStart().length,Z=q.trim();if(/^catalog\s*:\s*$/.test(Z)){H="default",M=!1;continue}if(/^catalogs\s*:\s*$/.test(Z)){M=!0,j=Y,H=null;continue}if(M&&Y>j&&/^[\w@./-]+\s*:\s*$/.test(Z)){H=Z.replace(/\s*:\s*$/,"");continue}if(M&&Z&&Y<=j)M=!1,H=null;if(H!==J.catalog)continue;let D=$.exec(q);if(!D||D[3].trim()!==J.name||D[6].trim()!==J.version)continue;let[,x,F,E,P,G,,Q]=D;return z[U]=`${x}${F}${E}${F}${P}${G}${B}${G}${Q}`,z.join(`
4
4
  `)}return X}var W="pnpm-workspace.yaml",I="pnpm-workspace.yml";async function h(X,J,B={}){let z=B.logger??V(),$=new Set(B.ignore??[]);for(let H of[W,I]){let M=Bun.file(R(X,H));if(!await M.exists())continue;let{entries:j,hasCatalogs:U}=N(await M.text());if(!U)return{updates:[],entries:[],file:H};return z.debug(`\uD83D\uDCE6 ${H}: ${j.length} catalog entr(ies)`),{updates:(await Promise.all(j.map(async(Y)=>{if($.has(Y.name))return null;try{let Z=await J(Y.name);if(!Z)return null;let D=Y.version.replace(/^[\^~>=<\s]+/,"").trim();if(!D||D===Z)return null;return{name:Y.name,currentVersion:Y.version,newVersion:_(Y.version,Z),updateType:A(D,Z),dependencyType:"catalog",file:H,resolved:{catalog:Y.catalog}}}catch(Z){return z.debug(`Could not resolve catalog entry ${Y.name}: ${Z}`),null}}))).filter((Y)=>Y!==null),entries:j,file:H}}return{updates:[],entries:[]}}function _(X,J){return`${/^([\^~]|>=|<=|>|<)?/.exec(X.trim())?.[1]??""}${J}`}function A(X,J){let B=(H)=>H.split(".").map((M)=>Number.parseInt(M,10)||0),z=B(X),$=B(J);if((z[0]??0)!==($[0]??0))return"major";if((z[1]??0)!==($[1]??0))return"minor";return"patch"}function v(X,J){let B=X;for(let z of J){if(z.dependencyType!=="catalog")continue;B=S(B,{name:z.name,version:z.currentVersion,catalog:z.resolved?.catalog??"default"},z.newVersion)}return B}
5
5
  export{N as gc,k as hc,w as ic,S as jc,W as kc,I as lc,h as mc,v as nc};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{fc as _}from"./chunk-ggzjv4s0.js";import{Oh as X}from"./chunk-8dj94fsy.js";import{dl as M}from"./chunk-s3ksf6s5.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(`
2
+ import{fc as _}from"./chunk-va3k91tf.js";import{Ph as X}from"./chunk-x1w6q9tk.js";import{el as M}from"./chunk-kbvj6qxc.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-khn11t39.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 La,Q as Ma,V as Na,$ as Oa,G as Pa,F as Qa,Y as Ra,Z as Sa,L as Ta,T as Ua};
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-3c114myc.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 La,Q as Ma,V as Na,$ as Oa,G as Pa,F as Qa,Y as Ra,Z as Sa,L as Ta,T as Ua};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{dd as Z}from"./chunk-r7nh070r.js";import{Mh as _}from"./chunk-8dj94fsy.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}`}}
2
+ import{ed as Z}from"./chunk-25sjd6zk.js";import{Nh as _}from"./chunk-x1w6q9tk.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
3
  export{L as Da};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Oh as K}from"./chunk-8dj94fsy.js";import{Dj as R}from"./chunk-0apd8zqn.js";import{dl as x}from"./chunk-s3ksf6s5.js";function $(w){let z=w.split("/").pop()||"";if(["deps.yaml","dependencies.yaml","pkgx.yaml",".deps.yaml"].includes(z))return!0;let j=z.replace(/\.(yaml|yml)$/,"");return["deps","dependencies","pkgx",".deps"].includes(j)}async function V(w,z){try{if(!$(w))return null;let H=[];try{let G=await R(w);if(G&&typeof G==="object"){if(G.allDependencies&&Array.isArray(G.allDependencies)){for(let J of G.allDependencies)if(J.name&&J.constraint)H.push({name:J.name,currentVersion:J.constraint,type:"dependencies",file:w})}}}catch(G){K().warn(`ts-pantry failed to parse ${w}, attempting fallback YAML parsing:`,G)}if(H.length===0)try{H=await B(z,w)}catch(G){K().warn(`Fallback YAML parsing failed for ${w}:`,G),H=[]}let j=w.split("/").pop()||"";return{path:w,type:j,content:z,dependencies:H}}catch(H){return K().warn(`Failed to parse dependency file ${w}:`,H),null}}async function B(w,z){let H=[],j=w.split(`
2
+ import{Ph as K}from"./chunk-x1w6q9tk.js";import{Ej as R}from"./chunk-z05djfac.js";import{el as x}from"./chunk-kbvj6qxc.js";function $(w){let z=w.split("/").pop()||"";if(["deps.yaml","dependencies.yaml","pkgx.yaml",".deps.yaml"].includes(z))return!0;let j=z.replace(/\.(yaml|yml)$/,"");return["deps","dependencies","pkgx",".deps"].includes(j)}async function V(w,z){try{if(!$(w))return null;let H=[];try{let G=await R(w);if(G&&typeof G==="object"){if(G.allDependencies&&Array.isArray(G.allDependencies)){for(let J of G.allDependencies)if(J.name&&J.constraint)H.push({name:J.name,currentVersion:J.constraint,type:"dependencies",file:w})}}}catch(G){K().warn(`ts-pantry failed to parse ${w}, attempting fallback YAML parsing:`,G)}if(H.length===0)try{H=await B(z,w)}catch(G){K().warn(`Fallback YAML parsing failed for ${w}:`,G),H=[]}let j=w.split("/").pop()||"";return{path:w,type:j,content:z,dependencies:H}}catch(H){return K().warn(`Failed to parse dependency file ${w}:`,H),null}}async function B(w,z){let H=[],j=w.split(`
3
3
  `),G=!1;for(let J of j){let Q=J.trim();if(Q==="dependencies:"){G=!0;continue}if(G){if(Q&&!J.startsWith(" ")&&!J.startsWith("\t")){G=!1;continue}let T=Q.match(/^([\w@/-]+):\s*(.+)$/);if(T){let[,X,Z]=T;H.push({name:X.trim(),currentVersion:Z.trim(),type:"dependencies",file:z})}}}return H}function O(w){try{return Bun.YAML.parse(w),!0}catch{return!1}}async function M(w,z,H){try{if(!$(w))return K().info(`\u26A0\uFE0F updateDependencyFile: ${w} is not a dependency file, returning original content`),z;if(z.trim().startsWith("{")&&z.includes('"require"'))return K().info(`\u26A0\uFE0F updateDependencyFile: Content appears to be JSON (composer.json), but file is ${w}`),K().info(`Content preview: ${z.substring(0,200)}`),z;let j=z;for(let G of H){let J=G.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,""),Q=J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),T=new RegExp(`^([ \\t]*)("${Q}"|'${Q}'|${Q})([ \\t]*:[ \\t]*)(["']?)([^\\s#"']+)\\4([ \\t]*#[^\\r\\n]*)?`,"gm");j=j.replace(T,(X,Z,W,A,b,_,E)=>{if(["latest","*","main","master","develop","dev"].includes(_.toLowerCase().trim()))return K().info(`\u26A0\uFE0F Skipping update for ${J} - version "${_}" should be respected`),X;let Y=_.match(/^(\D*)/)?.[1]??"",q=/^[\^~>=<]/.test(G.newVersion)?G.newVersion:`${Y}${G.newVersion}`;return`${Z}${W}${A}${b}${q}${b}${E??""}`})}if(j!==z&&O(z)&&!O(j))return K().warn(`\u26A0\uFE0F Skipping updates for ${w}: the rewrite no longer parses as YAML, so the file is left unchanged`),z;return j}catch(j){return K().warn(`Failed to update dependency file ${w}:`,j),z}}async function k(w){let z=[],H=new Map;for(let j of w)if($(j.file)){if(!H.has(j.file))H.set(j.file,[]);H.get(j.file).push(j)}for(let[j,G]of H)try{let J=await import("fs");if(J.existsSync(j)){let Q=J.readFileSync(j,"utf-8"),T=await M(j,Q,G);if(T!==Q)z.push({path:j,content:T,type:"update"}),K().info(`\u2705 Generated update for ${j} with ${G.length} package changes`);else K().info(`\u2139\uFE0F No changes needed for ${j} - versions already up to date`)}else K().warn(`\u26A0\uFE0F Dependency file ${j} does not exist`)}catch(J){K().warn(`Failed to generate updates for dependency file ${j}:`,J)}return z}
4
- export{$ as yg,V as zg,M as Ag,k as Bg};
4
+ export{$ as zg,V as Ag,M as Bg,k as Cg};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Rf as D}from"./chunk-emygmh7r.js";import{Oh as C}from"./chunk-8dj94fsy.js";var O=".buddy/learnings.jsonl",R=20;function T(P){if(!P)return[];let E=[];for(let v of P.split(`
2
+ import{Sf as D}from"./chunk-24xvskkf.js";import{Ph as C}from"./chunk-x1w6q9tk.js";var O=".buddy/learnings.jsonl",R=20;function T(P){if(!P)return[];let E=[];for(let v of P.split(`
3
3
  `)){let L=v.trim();if(!L||L.startsWith("#"))continue;try{let A=JSON.parse(L);if(typeof A.text!=="string"||!A.text.trim())continue;E.push({id:typeof A.id==="string"?A.id:_(A.text),text:A.text.trim(),...Array.isArray(A.paths)?{paths:A.paths.filter((o)=>typeof o==="string")}:{},...typeof A.kind==="string"?{kind:A.kind}:{},...A.source&&typeof A.source==="object"?{source:A.source}:{},createdAt:typeof A.createdAt==="string"?A.createdAt:new Date(0).toISOString()})}catch{continue}}return E}function M(P){return`${P.map((E)=>JSON.stringify(E)).join(`
4
4
  `)}
5
5
  `}function N(P,E={}){return{id:_(P),text:P.trim(),...E.paths?.length?{paths:E.paths}:{},...E.kind?{kind:E.kind}:{},...E.source?{source:E.source}:{},createdAt:new Date().toISOString()}}function Y(P,E){return[...P.filter((v)=>v.id!==E.id),E]}function q(P,E,v=R){let L=P.map((A)=>{if(!A.paths?.length)return{learning:A,score:1};let o=D(A.paths),I=E.some((V)=>o.matches(V));return{learning:A,score:I?2:0}}).filter((A)=>A.score>0);return L.sort((A,o)=>{if(A.score!==o.score)return o.score-A.score;return o.learning.createdAt.localeCompare(A.learning.createdAt)}),L.slice(0,v).map((A)=>A.learning)}function B(P){if(P.length===0)return"";return`Things this repository has told you before:
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Uf as B}from"./chunk-kpqez1ht.js";import{Ih as $}from"./chunk-a3bnhq58.js";import{Oh as Z}from"./chunk-8dj94fsy.js";var _=["scan.completed","pr.created","pr.updated","pr.closed","pr.merged","security.advisories","dashboard.updated","review.completed","fixci.completed","gate.failed","run.failed"];class I{logger;sinks=[];constructor(z=Z()){this.logger=z}register(z){this.sinks.push(z)}get size(){return this.sinks.length}async emit(z,q){let j=this.sinks.filter((C)=>!C.events?.length||C.events.includes(z));if(j.length===0)return;await Promise.all(j.map(async(C)=>{try{await C.deliver(z,q),this.logger.debug(`\uD83D\uDCE3 Delivered ${z} to ${C.name}`)}catch(F){this.logger.warn(`\u26A0\uFE0F Could not deliver ${z} to ${C.name}: ${F}`)}}))}}function J(z,q){switch(z){case"scan.completed":{let j=q;return`Found ${j.total} update(s): ${j.major} major, ${j.minor} minor, ${j.patch} patch`}case"pr.created":{let j=q;return`Opened #${j.number}: ${j.title}`}case"pr.merged":{let j=q;return`Merged #${j.number}: ${j.title}`}case"security.advisories":return`${q.packages.length} dependency/dependencies with known advisories`;case"pr.updated":{let j=q;return`Updated #${j.number}: ${j.title}`}case"pr.closed":{let j=q;return`Closed #${j.number} (${j.reason}): ${j.title}`}case"dashboard.updated":return`Dashboard refreshed: #${q.number}`;case"review.completed":{let j=q;return`Reviewed #${j.number}: ${j.findings} finding(s)`}case"fixci.completed":{let j=q;return`fix-ci ${j.action}${j.fixed?" (fixed)":""}${j.number?` on #${j.number}`:""}`}case"gate.failed":{let j=q;return`Gates failed on #${j.number}: ${j.checks.join(", ")}`}case"run.failed":{let j=q;return`\`${j.command}\` failed: ${j.error}`}default:return z}}import{createHmac as K}from"crypto";import N from"process";var P=1;function U(z){if(!z)return[];let q=[],j=M(z.slack?.webhookEnv??"SLACK_WEBHOOK_URL");if(j)q.push(V(j,z.slack?.events));let C=M(z.discord?.webhookEnv??"DISCORD_WEBHOOK_URL");if(C)q.push(Y(C,z.discord?.events));for(let[F,G]of(z.webhooks??[]).entries())q.push(A(G,F));return q}function V(z,q){return{name:"slack",...q?.length?{events:q}:{},async deliver(j,C){await Q(z,{text:`Buddy: ${J(j,C)}`,blocks:[{type:"section",text:{type:"mrkdwn",text:`*Buddy*
2
+ import{Vf as B}from"./chunk-z18bksyr.js";import{Jh as $}from"./chunk-b9szrnxw.js";import{Ph as Z}from"./chunk-x1w6q9tk.js";var _=["scan.completed","pr.created","pr.updated","pr.closed","pr.merged","security.advisories","dashboard.updated","review.completed","fixci.completed","gate.failed","run.failed"];class I{logger;sinks=[];constructor(z=Z()){this.logger=z}register(z){this.sinks.push(z)}get size(){return this.sinks.length}async emit(z,q){let j=this.sinks.filter((C)=>!C.events?.length||C.events.includes(z));if(j.length===0)return;await Promise.all(j.map(async(C)=>{try{await C.deliver(z,q),this.logger.debug(`\uD83D\uDCE3 Delivered ${z} to ${C.name}`)}catch(F){this.logger.warn(`\u26A0\uFE0F Could not deliver ${z} to ${C.name}: ${F}`)}}))}}function J(z,q){switch(z){case"scan.completed":{let j=q;return`Found ${j.total} update(s): ${j.major} major, ${j.minor} minor, ${j.patch} patch`}case"pr.created":{let j=q;return`Opened #${j.number}: ${j.title}`}case"pr.merged":{let j=q;return`Merged #${j.number}: ${j.title}`}case"security.advisories":return`${q.packages.length} dependency/dependencies with known advisories`;case"pr.updated":{let j=q;return`Updated #${j.number}: ${j.title}`}case"pr.closed":{let j=q;return`Closed #${j.number} (${j.reason}): ${j.title}`}case"dashboard.updated":return`Dashboard refreshed: #${q.number}`;case"review.completed":{let j=q;return`Reviewed #${j.number}: ${j.findings} finding(s)`}case"fixci.completed":{let j=q;return`fix-ci ${j.action}${j.fixed?" (fixed)":""}${j.number?` on #${j.number}`:""}`}case"gate.failed":{let j=q;return`Gates failed on #${j.number}: ${j.checks.join(", ")}`}case"run.failed":{let j=q;return`\`${j.command}\` failed: ${j.error}`}default:return z}}import{createHmac as K}from"crypto";import N from"process";var P=1;function U(z){if(!z)return[];let q=[],j=M(z.slack?.webhookEnv??"SLACK_WEBHOOK_URL");if(j)q.push(V(j,z.slack?.events));let C=M(z.discord?.webhookEnv??"DISCORD_WEBHOOK_URL");if(C)q.push(Y(C,z.discord?.events));for(let[F,G]of(z.webhooks??[]).entries())q.push(A(G,F));return q}function V(z,q){return{name:"slack",...q?.length?{events:q}:{},async deliver(j,C){await Q(z,{text:`Buddy: ${J(j,C)}`,blocks:[{type:"section",text:{type:"mrkdwn",text:`*Buddy*
3
3
  ${J(j,C)}`}}]})}}}function Y(z,q){return{name:"discord",...q?.length?{events:q}:{},async deliver(j,C){await Q(z,{embeds:[{title:"Buddy",description:J(j,C),color:j==="security.advisories"||j==="run.failed"?14687834:3061373,timestamp:new Date().toISOString()}]})}}}function A(z,q=0){let j=z.secretEnv?M(z.secretEnv):void 0;return{name:`webhook[${q}]`,...z.events?.length?{events:z.events}:{},async deliver(C,F){let G=JSON.stringify({version:P,event:C,payload:F,sentAt:new Date().toISOString()}),X={"Content-Type":"application/json"};if(j)X["x-buddy-signature"]=`sha256=${R(G,j)}`;await Q(z.url,G,X)}}}function R(z,q){return K("sha256",q).update(z).digest("hex")}async function Q(z,q,j={}){let C=await $(z,{method:"POST",headers:{"Content-Type":"application/json",...j},body:typeof q==="string"?q:JSON.stringify(q)});if(!C.ok){let F=await C.text().catch(()=>"");throw Error(`${C.status} ${C.statusText} ${B(F.slice(0,200))}`.trim())}}function M(z){let q=N.env[z];return q?.trim()?q.trim():void 0}
4
- export{_ as ud,I as vd,J as wd,P as xd,U as yd,V as zd,Y as Ad,A as Bd,R as Cd};
4
+ export{_ as vd,I as wd,J as xd,P as yd,U as zd,V as Ad,Y as Bd,A as Cd,R as Dd};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ai as e,Bi as s,Ci as t,Di as c,Ei as r,Fi as P,Gi as n,Hi as o,Ii as g,Ji as l,Ki as p,Li as d,Mi as k,zi as a}from"./chunk-0apd8zqn.js";import"./chunk-s3ksf6s5.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};
2
+ import{Ai as a,Bi as e,Ci as s,Di as t,Ei as c,Fi as r,Gi as P,Hi as n,Ii as o,Ji as g,Ki as l,Li as p,Mi as d,Ni as k}from"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.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};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ec as Z}from"./chunk-ggzjv4s0.js";import{Xc as X}from"./chunk-tx9m7y1z.js";import{Sd as x,de as V}from"./chunk-be059ncv.js";import{me as U,ne as Y}from"./chunk-34rmja4x.js";import H from"process";var K=[["actionlint","actionlint"],["shellcheck","shellcheck"],["hadolint","hadolint"],["markdownlint","markdownlint"]];async function T(j,J={}){let W=J.env??H.env,Q=J.cwd??H.cwd(),F=J.hasCommand??x,G=[];G.push({name:"bun",status:"ok",detail:`Bun ${Bun.version}`});let C=await Bun.file(`${Q}/.git/HEAD`).exists();G.push(C?{name:"git repository",status:"ok",detail:Q}:{name:"git repository",status:"fail",detail:`${Q} is not a git repository`,remediation:"Run buddy from inside a repository, or run `git init`."});let $=X(j);G.push($.length===0?{name:"configuration",status:"ok",detail:"valid"}:{name:"configuration",status:"fail",detail:`${$.length} problem(s): ${$.slice(0,3).map((q)=>`${q.path} ${q.message}`).join("; ")}`,remediation:"Fix the paths reported above in buddy.config.ts."});let P=Boolean(j.repository?.owner&&j.repository.name);G.push(P?{name:"repository config",status:"ok",detail:`${j.repository.owner}/${j.repository.name}`}:{name:"repository config",status:"warn",detail:"owner and name are not set",remediation:"Set repository.owner and repository.name, or run in Actions where GITHUB_REPOSITORY is available. Local review works without them."});let B=j.repository?.provider??"github",D=j.repository?.token?{token:j.repository.token,source:"repository.token"}:Y(B,W);G.push(D?{name:"git token",status:"ok",detail:`found in ${D.source}`}:{name:"git token",status:"warn",detail:"no token found",remediation:`Set one of ${(U[B]??[]).join(", ")}. Local review does not need one.`});let b=Z(j,W);G.push(b?{name:"ai provider",status:"ok",detail:`${b.provider} via ${b.apiKeyEnv}`}:{name:"ai provider",status:"warn",detail:"no API key found",remediation:"Set ANTHROPIC_API_KEY (or OPENAI_API_KEY / GOOGLE_API_KEY). Dependency updates and static analysis work without one."});for(let[q,M]of K){let I=await F(M);G.push(I?{name:`analyzer: ${q}`,status:"ok",detail:`${M} found`}:{name:`analyzer: ${q}`,status:"warn",detail:`${M} not installed`,remediation:`Install ${M} to enable the ${q} analyzer. Reviews run without it and report it as skipped.`})}let w=V.filter((q)=>!K.some(([M])=>M===q.name)).map((q)=>q.name);return G.push({name:"native analyzers",status:"ok",detail:`${w.join(", ")} \u2014 always available`}),{checks:G,healthy:!G.some((q)=>q.status==="fail")}}var S={ok:"\u2705",warn:"\u26A0\uFE0F ",fail:"\u274C"};function E(j){let J=["","Buddy environment",""];for(let F of j.checks)if(J.push(`${S[F.status]} ${F.name}: ${F.detail}`),F.remediation)J.push(` \u2192 ${F.remediation}`);let W=j.checks.filter((F)=>F.status==="fail").length,Q=j.checks.filter((F)=>F.status==="warn").length;return J.push(""),J.push(j.healthy?`Ready. ${Q} optional capability/capabilities unavailable.`:`${W} problem(s) must be fixed before buddy can run.`),`${J.join(`
2
+ import{ec as Z}from"./chunk-va3k91tf.js";import{Yc as X}from"./chunk-raj75r4h.js";import{Td as x,ee as V}from"./chunk-0g4ybxwj.js";import{ne as U,oe as Y}from"./chunk-b6a5txek.js";import H from"process";var K=[["actionlint","actionlint"],["shellcheck","shellcheck"],["hadolint","hadolint"],["markdownlint","markdownlint"]];async function T(j,J={}){let W=J.env??H.env,Q=J.cwd??H.cwd(),F=J.hasCommand??x,G=[];G.push({name:"bun",status:"ok",detail:`Bun ${Bun.version}`});let C=await Bun.file(`${Q}/.git/HEAD`).exists();G.push(C?{name:"git repository",status:"ok",detail:Q}:{name:"git repository",status:"fail",detail:`${Q} is not a git repository`,remediation:"Run buddy from inside a repository, or run `git init`."});let $=X(j);G.push($.length===0?{name:"configuration",status:"ok",detail:"valid"}:{name:"configuration",status:"fail",detail:`${$.length} problem(s): ${$.slice(0,3).map((q)=>`${q.path} ${q.message}`).join("; ")}`,remediation:"Fix the paths reported above in buddy.config.ts."});let P=Boolean(j.repository?.owner&&j.repository.name);G.push(P?{name:"repository config",status:"ok",detail:`${j.repository.owner}/${j.repository.name}`}:{name:"repository config",status:"warn",detail:"owner and name are not set",remediation:"Set repository.owner and repository.name, or run in Actions where GITHUB_REPOSITORY is available. Local review works without them."});let B=j.repository?.provider??"github",D=j.repository?.token?{token:j.repository.token,source:"repository.token"}:Y(B,W);G.push(D?{name:"git token",status:"ok",detail:`found in ${D.source}`}:{name:"git token",status:"warn",detail:"no token found",remediation:`Set one of ${(U[B]??[]).join(", ")}. Local review does not need one.`});let b=Z(j,W);G.push(b?{name:"ai provider",status:"ok",detail:`${b.provider} via ${b.apiKeyEnv}`}:{name:"ai provider",status:"warn",detail:"no API key found",remediation:"Set ANTHROPIC_API_KEY (or OPENAI_API_KEY / GOOGLE_API_KEY). Dependency updates and static analysis work without one."});for(let[q,M]of K){let I=await F(M);G.push(I?{name:`analyzer: ${q}`,status:"ok",detail:`${M} found`}:{name:`analyzer: ${q}`,status:"warn",detail:`${M} not installed`,remediation:`Install ${M} to enable the ${q} analyzer. Reviews run without it and report it as skipped.`})}let w=V.filter((q)=>!K.some(([M])=>M===q.name)).map((q)=>q.name);return G.push({name:"native analyzers",status:"ok",detail:`${w.join(", ")} \u2014 always available`}),{checks:G,healthy:!G.some((q)=>q.status==="fail")}}var S={ok:"\u2705",warn:"\u26A0\uFE0F ",fail:"\u274C"};function E(j){let J=["","Buddy environment",""];for(let F of j.checks)if(J.push(`${S[F.status]} ${F.name}: ${F.detail}`),F.remediation)J.push(` \u2192 ${F.remediation}`);let W=j.checks.filter((F)=>F.status==="fail").length,Q=j.checks.filter((F)=>F.status==="warn").length;return J.push(""),J.push(j.healthy?`Ready. ${Q} optional capability/capabilities unavailable.`:`${W} problem(s) must be fixed before buddy can run.`),`${J.join(`
3
3
  `)}
4
4
  `}
5
5
  export{T as W,E as X};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ib as $}from"./chunk-vckhctmr.js";import"./chunk-s3ksf6s5.js";import{readdir as Z}from"fs/promises";import{join as W}from"path";var w=["dependencies","peerDependencies","optionalDependencies"];async function x(U,V,M,Q){let J=await G(M,Q);if(J.length===0)return[];let H=new Map,z=(q,v,E)=>{let X=H.get(q),Y={by:v,range:E};if(X)X.push(Y);else H.set(q,[Y])};for(let q of U)for(let v of q.dependencies)z(v.name,$,v.currentVersion);for(let q of J)for(let[v,E]of Object.entries(q.ranges))z(v,q.name,E);let D=[];for(let q of J){let v=H.get(q.name);if(!v||v.length===0)continue;try{let E=await V.getPackageMetadata(q.name);if(!E?.versions?.length)continue;D.push({name:q.name,installed:q.version,available:E.versions,declared:v})}catch(E){Q.debug(`Skipping drift analysis for ${q.name}: ${E}`)}}return D}async function G(U,V){let M=W(U,"node_modules"),Q=[],J;try{J=await Z(M)}catch{return V.debug("No node_modules directory, skipping resolution drift analysis"),[]}let H=[];for(let z of J){if(z.startsWith("."))continue;if(z.startsWith("@")){try{let D=await Z(W(M,z));H.push(...D.map((q)=>`${z}/${q}`))}catch{continue}continue}H.push(z)}return await Promise.all(H.map(async(z)=>{try{let D=await Bun.file(W(M,z,"package.json")).json();if(!D.name||!D.version)return;let q={};for(let v of w)Object.assign(q,D[v]??{});Q.push({name:D.name,version:D.version,ranges:q})}catch{}})),Q}export{x as collectDriftInputs};
2
+ import{Ib as $}from"./chunk-vckhctmr.js";import"./chunk-kbvj6qxc.js";import{readdir as Z}from"fs/promises";import{join as W}from"path";var w=["dependencies","peerDependencies","optionalDependencies"];async function x(U,V,M,Q){let J=await G(M,Q);if(J.length===0)return[];let H=new Map,z=(q,v,E)=>{let X=H.get(q),Y={by:v,range:E};if(X)X.push(Y);else H.set(q,[Y])};for(let q of U)for(let v of q.dependencies)z(v.name,$,v.currentVersion);for(let q of J)for(let[v,E]of Object.entries(q.ranges))z(v,q.name,E);let D=[];for(let q of J){let v=H.get(q.name);if(!v||v.length===0)continue;try{let E=await V.getPackageMetadata(q.name);if(!E?.versions?.length)continue;D.push({name:q.name,installed:q.version,available:E.versions,declared:v})}catch(E){Q.debug(`Skipping drift analysis for ${q.name}: ${E}`)}}return D}async function G(U,V){let M=W(U,"node_modules"),Q=[],J;try{J=await Z(M)}catch{return V.debug("No node_modules directory, skipping resolution drift analysis"),[]}let H=[];for(let z of J){if(z.startsWith("."))continue;if(z.startsWith("@")){try{let D=await Z(W(M,z));H.push(...D.map((q)=>`${z}/${q}`))}catch{continue}continue}H.push(z)}return await Promise.all(H.map(async(z)=>{try{let D=await Bun.file(W(M,z,"package.json")).json();if(!D.name||!D.version)return;let q={};for(let v of w)Object.assign(q,D[v]??{});Q.push({name:D.name,version:D.version,ranges:q})}catch{}})),Q}export{x as collectDriftInputs};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{wh as a}from"./chunk-7c1284fb.js";import"./chunk-kbvj6qxc.js";export{a as GitHubActionsTemplate};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Va as t,Wa as u}from"./chunk-pmszvhja.js";import{$a as z,Xa as v,Ya as w,Za as x,_a as y,ab as A,bb as B,cb as C,db as D,eb as E,fb as F,gb as G}from"./chunk-1szfwcst.js";import{hb as H,ib as I,jb as J,kb as K,lb as L}from"./chunk-88xaexj1.js";import"./chunk-y7z0br2x.js";import"./chunk-ggzjv4s0.js";import{Af as c,Bf as d,Cf as e,Df as f,yf as a,zf as b}from"./chunk-jpdd59fh.js";import{Ef as g,Ff as h,Gf as i,Hf as j,If as k,Jf as l,Kf as m,Lf as n,Mf as o,Nf as p,Of as q,Pf as r,Qf as s}from"./chunk-7rjrea9g.js";import"./chunk-emygmh7r.js";import"./chunk-kpqez1ht.js";import"./chunk-vckn5ate.js";import"./chunk-a3bnhq58.js";import"./chunk-8dj94fsy.js";import"./chunk-s3ksf6s5.js";export{i as writeFileTool,r as wrapUntrusted,F as withTouchOffer,I as verifyChanges,w as unitTestsTouch,J as stackedBranchName,y as simplifyTouch,n as shellTool,K as runStackedTouch,u as runPlan,s as runAgent,a as reviewMode,g as resolveWorkspacePath,D as renderTouchOffer,h as readFileTool,z as planTouch,d as planMode,G as parseTouchSelections,j as listDirTool,b as implementMode,E as hasTouchOffer,B as getFinishingTouch,f as getAgentMode,k as fsTools,c as fixCiMode,v as docstringsTouch,L as detectChangedFiles,t as createReadIssueTool,m as buildShellEnv,x as autofixTouch,q as Toolbelt,o as ToolPermissionError,C as TOUCH_OFFER_MARKER,H as TEST_COMMANDS,l as SHELL_ENV_ALLOWLIST,A as FINISHING_TOUCHES,p as BUILTIN_TOOLS,e as AGENT_MODES};
2
+ import{Va as t,Wa as u}from"./chunk-esm5jjgf.js";import{$a as z,Xa as v,Ya as w,Za as x,_a as y,ab as A,bb as B,cb as C,db as D,eb as E,fb as F,gb as G}from"./chunk-jqh7vx2n.js";import{hb as H,ib as I,jb as J,kb as K,lb as L}from"./chunk-b3s185kp.js";import"./chunk-59993g25.js";import"./chunk-va3k91tf.js";import{Af as b,Bf as c,Cf as d,Df as e,Ef as f,zf as a}from"./chunk-1pecmenc.js";import{Ff as g,Gf as h,Hf as i,If as j,Jf as k,Kf as l,Lf as m,Mf as n,Nf as o,Of as p,Pf as q,Qf as r,Rf as s}from"./chunk-sxfk3naz.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.js";export{i as writeFileTool,r as wrapUntrusted,F as withTouchOffer,I as verifyChanges,w as unitTestsTouch,J as stackedBranchName,y as simplifyTouch,n as shellTool,K as runStackedTouch,u as runPlan,s as runAgent,a as reviewMode,g as resolveWorkspacePath,D as renderTouchOffer,h as readFileTool,z as planTouch,d as planMode,G as parseTouchSelections,j as listDirTool,b as implementMode,E as hasTouchOffer,B as getFinishingTouch,f as getAgentMode,k as fsTools,c as fixCiMode,v as docstringsTouch,L as detectChangedFiles,t as createReadIssueTool,m as buildShellEnv,x as autofixTouch,q as Toolbelt,o as ToolPermissionError,C as TOUCH_OFFER_MARKER,H as TEST_COMMANDS,l as SHELL_ENV_ALLOWLIST,A as FINISHING_TOUCHES,p as BUILTIN_TOOLS,e as AGENT_MODES};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ld as a}from"./chunk-gweqk008.js";import"./chunk-bnp0r4eh.js";import"./chunk-0f1xye20.js";import"./chunk-wjfw6rx8.js";import"./chunk-w55x2g9n.js";import"./chunk-1xe0960b.js";import"./chunk-j46f90n8.js";import"./chunk-54er1whp.js";import"./chunk-ktn47bq8.js";import"./chunk-2z9pkk1y.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.js";export{a as PackageScanner};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Cb as a,Db as b}from"./chunk-mpb1g0xk.js";import"./chunk-q2tjkhez.js";import"./chunk-5yfaptmp.js";import"./chunk-59993g25.js";import"./chunk-va3k91tf.js";import"./chunk-0g4ybxwj.js";import"./chunk-142zh7e5.js";import"./chunk-b6a5txek.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.js";export{b as runReviewForPR,a as reviewPullRequest};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ki as a,li as e,mi as o,ni as s,oi as t,pi as i,qi as c,ri as r,si as n,ti as g,ui as m,vi as u,wi as P,xi as l,yi as h}from"./chunk-0apd8zqn.js";import"./chunk-s3ksf6s5.js";export{n as toPropertyKey,e as shouldProceedWithGitHubRequest,a as saveRateLimitInfo,s as saveGitHubPackageCache,u as resolvePackageDomain,i as logPkgxProjects,l as isKnownAlias,m as guessOriginalDomain,P as getPackageAliases,o as getGitHubPackageCache,h as getCanonicalDomain,c as formatObjectWithoutQuotedKeys,t as fetchPackageListFromGitHub,r as convertDomainToVarName,g as convertDomainToFileName};
2
+ import{li as a,mi as e,ni as o,oi as s,pi as t,qi as i,ri as c,si as r,ti as n,ui as g,vi as m,wi as u,xi as P,yi as l,zi as h}from"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.js";export{n as toPropertyKey,e as shouldProceedWithGitHubRequest,a as saveRateLimitInfo,s as saveGitHubPackageCache,u as resolvePackageDomain,i as logPkgxProjects,l as isKnownAlias,m as guessOriginalDomain,P as getPackageAliases,o as getGitHubPackageCache,h as getCanonicalDomain,c as formatObjectWithoutQuotedKeys,t as fetchPackageListFromGitHub,r as convertDomainToVarName,g as convertDomainToFileName};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{vd as j,yd as q}from"./chunk-7crh00m7.js";async function U(A,D,G){let x=q(A);if(x.length===0)return;let z=new j;for(let H of x)z.register(H);await z.emit(D,G)}
3
- export{U as td};
2
+ import{wd as j,zd as q}from"./chunk-5jvde2as.js";async function U(A,D,G){let x=q(A);if(x.length===0)return;let z=new j;for(let H of x)z.register(H);await z.emit(D,G)}
3
+ export{U as ud};
@@ -500,4 +500,4 @@ jobs:
500
500
  - name: Run buddy security
501
501
  run: bunx --bun @buddysh/buddy security
502
502
  `}}
503
- export{K as vh};
503
+ export{K as wh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ag as b,Bg as c,Cg as d,zg as a}from"./chunk-54er1whp.js";import"./chunk-ktn47bq8.js";import"./chunk-x1w6q9tk.js";import"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.js";export{c as updateDependencyFile,b as parseDependencyFile,a as isDependencyFile,d as generateDependencyFileUpdates};
@@ -13,4 +13,4 @@ var G=["pretty","json","github","agent"];function Q(k,j){switch(k){case"staged":
13
13
  `);if(j<1||j>z.length)return null;return z.splice(j-1,1,...q.split(`
14
14
  `)),z.join(`
15
15
  `)}function P(k,j="major"){let q=["critical","major","minor","nit"],z=q.indexOf(j);return k.some((D)=>q.indexOf(D.severity)<=z)}
16
- export{G as Dd,Q as Ed,L as Fd,X as Gd,Z as Hd,$ as Id,B as Jd,N as Kd,O as Ld,P as Md};
16
+ export{G as Ed,Q as Fd,L as Gd,X as Hd,Z as Id,$ as Jd,B as Kd,N as Ld,O as Md,P as Nd};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Jc as a,Kc as b,Lc as c,Mc as d}from"./chunk-afstgmb4.js";import"./chunk-csqh2ca4.js";import"./chunk-cj4d5ad7.js";import"./chunk-xdrvb89m.js";import"./chunk-knpdntnh.js";import"./chunk-54er1whp.js";import"./chunk-ktn47bq8.js";import"./chunk-2z9pkk1y.js";import"./chunk-vpw7adwd.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.js";export{c as isWorkflowPermissionRefusal,a as gitAuthConfigArgs,b as WorkflowPermissionError,d as GitHubProvider};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-s3ksf6s5.js";function f(i){return JSON.stringify({ok:!i.failed,summary:{workflows:i.workflows.length,findings:i.findings.length,errors:i.findings.filter((n)=>n.severity==="error").length,warnings:i.findings.filter((n)=>n.severity==="warning").length,info:i.findings.filter((n)=>n.severity==="info").length},findings:i.findings},null,2)}export{f as formatJson};
2
+ import"./chunk-kbvj6qxc.js";function f(i){return JSON.stringify({ok:!i.failed,summary:{workflows:i.workflows.length,findings:i.findings.length,errors:i.findings.filter((n)=>n.severity==="error").length,warnings:i.findings.filter((n)=>n.severity==="warning").length,info:i.findings.filter((n)=>n.severity==="info").length},findings:i.findings},null,2)}export{f as formatJson};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import"./chunk-s3ksf6s5.js";var $={error:"\x1B[31m",warning:"\x1B[33m",info:"\x1B[34m"},R={error:"error",warning:"warn ",info:"info "};function a(i,g={}){let l=g.color??!0,r=(n,t)=>l?`${n}${t}\x1B[0m`:t;if(i.workflows.length===0)return r("\x1B[90m","buddy security: no workflows found under .github/workflows.");if(i.findings.length===0)return r("\x1B[32m",`buddy security: ${i.workflows.length} workflow${i.workflows.length===1?"":"s"} clean.`);let e=new Map;for(let n of i.findings){if(!e.has(n.file))e.set(n.file,[]);e.get(n.file).push(n)}let s=[];for(let[n,t]of e){s.push(r("\x1B[1m",n));for(let o of t){let u=r($[o.severity],R[o.severity]),w=o.line!==void 0?r("\x1B[90m",`:${o.line}`):"",E=r("\x1B[90m",`(${o.ruleId})`);if(s.push(` ${u}${w} ${o.message} ${E}`),o.detail)s.push(r("\x1B[2m",` ${o.detail}`));if(o.fix)s.push(r("\x1B[2m",` fix: ${o.fix}`))}s.push("")}let f=i.findings.filter((n)=>n.severity==="error").length,c=i.findings.filter((n)=>n.severity==="warning").length,d=`${f} error${f===1?"":"s"}, ${c} warning${c===1?"":"s"} across ${e.size} workflow${e.size===1?"":"s"}`;return s.push(r(i.failed?"\x1B[31m":"\x1B[33m",d)),s.join(`
2
+ import"./chunk-kbvj6qxc.js";var $={error:"\x1B[31m",warning:"\x1B[33m",info:"\x1B[34m"},R={error:"error",warning:"warn ",info:"info "};function a(i,g={}){let l=g.color??!0,r=(n,t)=>l?`${n}${t}\x1B[0m`:t;if(i.workflows.length===0)return r("\x1B[90m","buddy security: no workflows found under .github/workflows.");if(i.findings.length===0)return r("\x1B[32m",`buddy security: ${i.workflows.length} workflow${i.workflows.length===1?"":"s"} clean.`);let e=new Map;for(let n of i.findings){if(!e.has(n.file))e.set(n.file,[]);e.get(n.file).push(n)}let s=[];for(let[n,t]of e){s.push(r("\x1B[1m",n));for(let o of t){let u=r($[o.severity],R[o.severity]),w=o.line!==void 0?r("\x1B[90m",`:${o.line}`):"",E=r("\x1B[90m",`(${o.ruleId})`);if(s.push(` ${u}${w} ${o.message} ${E}`),o.detail)s.push(r("\x1B[2m",` ${o.detail}`));if(o.fix)s.push(r("\x1B[2m",` fix: ${o.fix}`))}s.push("")}let f=i.findings.filter((n)=>n.severity==="error").length,c=i.findings.filter((n)=>n.severity==="warning").length,d=`${f} error${f===1?"":"s"}, ${c} warning${c===1?"":"s"} across ${e.size} workflow${e.size===1?"":"s"}`;return s.push(r(i.failed?"\x1B[31m":"\x1B[33m",d)),s.join(`
3
3
  `)}export{a as formatPretty};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{pf as a,qf as b,rf as c}from"./chunk-naz864cb.js";import"./chunk-pq115qkn.js";import"./chunk-1pecmenc.js";import"./chunk-sxfk3naz.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-xdrvb89m.js";import"./chunk-knpdntnh.js";import"./chunk-54er1whp.js";import"./chunk-ktn47bq8.js";import"./chunk-2z9pkk1y.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.js";export{a as matchesGlobs,c as appendUpgradeReport,b as analyzeGroupMajors};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ih as X}from"./chunk-a3bnhq58.js";import{Oh as Z}from"./chunk-8dj94fsy.js";var V={node:"nodejs","library/node":"nodejs",python:"python","library/python":"python",debian:"debian","library/debian":"debian",ubuntu:"ubuntu","library/ubuntu":"ubuntu",alpine:"alpine","library/alpine":"alpine",php:"php","library/php":"php",ruby:"ruby","library/ruby":"ruby",golang:"go","library/golang":"go",postgres:"postgresql","library/postgres":"postgresql",mysql:"mysql","library/mysql":"mysql",redis:"redis","library/redis":"redis",nginx:"nginx","library/nginx":"nginx"};function q(j){let x=j.replace(/^(?:docker\.io|registry-1\.docker\.io)\//,"");return V[x]??V[x.split("/").pop()??""]??null}function G(j,x){let z=/^v?(\d+(?:\.\d+)*)/.exec(j.trim());if(!z)return null;let H=z[1].split(".");for(let k=H.length;k>=1;k--){let K=H.slice(0,k).join("."),B=x.find((J)=>J.cycle===K);if(B)return B}return null}async function F(j,x,z={}){let H=z.logger??Z(),k=q(j);if(!k)return null;let K=z.baseUrl??"https://endoflife.date",B=await X(`${K}/api/${k}.json`,{headers:{"User-Agent":"buddy",Accept:"application/json"}}).catch(()=>null);if(!B?.ok)return H.debug(`Could not read the support window for ${k}`),null;let J=await B.json().catch(()=>null);if(!Array.isArray(J))return null;let v=G(x,J);if(!v)return null;if(v.eol===!1)return{product:k,cycle:v.cycle,eol:!1};if(v.eol===!0)return{product:k,cycle:v.cycle,eol:!0};let M=new Date(v.eol);if(Number.isNaN(M.getTime()))return{product:k,cycle:v.cycle,eol:!1};let $=z.now??new Date,Q=Math.round((M.getTime()-$.getTime())/86400000);return{product:k,cycle:v.cycle,eol:Q<0,date:v.eol,daysRemaining:Q}}var I=90;function N(j){if(!j)return"";if(j.eol)return j.date?`\`${j.product} ${j.cycle}\` reached end of life on ${j.date} and no longer receives security fixes.`:`\`${j.product} ${j.cycle}\` has reached end of life and no longer receives security fixes.`;if(j.daysRemaining!==void 0&&j.daysRemaining<=I)return`\`${j.product} ${j.cycle}\` reaches end of life in ${j.daysRemaining} day(s), on ${j.date}.`;return""}
2
+ import{Jh as X}from"./chunk-b9szrnxw.js";import{Ph as Z}from"./chunk-x1w6q9tk.js";var V={node:"nodejs","library/node":"nodejs",python:"python","library/python":"python",debian:"debian","library/debian":"debian",ubuntu:"ubuntu","library/ubuntu":"ubuntu",alpine:"alpine","library/alpine":"alpine",php:"php","library/php":"php",ruby:"ruby","library/ruby":"ruby",golang:"go","library/golang":"go",postgres:"postgresql","library/postgres":"postgresql",mysql:"mysql","library/mysql":"mysql",redis:"redis","library/redis":"redis",nginx:"nginx","library/nginx":"nginx"};function q(j){let x=j.replace(/^(?:docker\.io|registry-1\.docker\.io)\//,"");return V[x]??V[x.split("/").pop()??""]??null}function G(j,x){let z=/^v?(\d+(?:\.\d+)*)/.exec(j.trim());if(!z)return null;let H=z[1].split(".");for(let k=H.length;k>=1;k--){let K=H.slice(0,k).join("."),B=x.find((J)=>J.cycle===K);if(B)return B}return null}async function F(j,x,z={}){let H=z.logger??Z(),k=q(j);if(!k)return null;let K=z.baseUrl??"https://endoflife.date",B=await X(`${K}/api/${k}.json`,{headers:{"User-Agent":"buddy",Accept:"application/json"}}).catch(()=>null);if(!B?.ok)return H.debug(`Could not read the support window for ${k}`),null;let J=await B.json().catch(()=>null);if(!Array.isArray(J))return null;let v=G(x,J);if(!v)return null;if(v.eol===!1)return{product:k,cycle:v.cycle,eol:!1};if(v.eol===!0)return{product:k,cycle:v.cycle,eol:!0};let M=new Date(v.eol);if(Number.isNaN(M.getTime()))return{product:k,cycle:v.cycle,eol:!1};let $=z.now??new Date,Q=Math.round((M.getTime()-$.getTime())/86400000);return{product:k,cycle:v.cycle,eol:Q<0,date:v.eol,daysRemaining:Q}}var I=90;function N(j){if(!j)return"";if(j.eol)return j.date?`\`${j.product} ${j.cycle}\` reached end of life on ${j.date} and no longer receives security fixes.`:`\`${j.product} ${j.cycle}\` has reached end of life and no longer receives security fixes.`;if(j.daysRemaining!==void 0&&j.daysRemaining<=I)return`\`${j.product} ${j.cycle}\` reaches end of life in ${j.daysRemaining} day(s), on ${j.date}.`;return""}
3
3
  export{V as xa,q as ya,G as za,F as Aa,I as Ba,N as Ca};