@buddysh/buddy 0.11.14 → 0.11.16

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 (140) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/bin/cli.js +19 -19
  3. package/dist/{chunk-mg67hhgj.js → chunk-0kce7e60.js} +1 -1
  4. package/dist/chunk-0n03s02h.js +2 -0
  5. package/dist/{chunk-s82adeq9.js → chunk-16aeend1.js} +1 -1
  6. package/dist/{chunk-qcvtp2mt.js → chunk-1a14rx5n.js} +1 -1
  7. package/dist/{chunk-sztjfky1.js → chunk-1g43mpqn.js} +1 -1
  8. package/dist/chunk-1k4p8wyx.js +2 -0
  9. package/dist/{chunk-m00hfvnp.js → chunk-1mkwhnsf.js} +1 -1
  10. package/dist/{chunk-6prz7chv.js → chunk-1pdvjg0x.js} +1 -1
  11. package/dist/{chunk-8wvc5grf.js → chunk-20ex3fxc.js} +1 -1
  12. package/dist/chunk-2309x9r7.js +2 -0
  13. package/dist/{chunk-jkn2sdm0.js → chunk-26yejy1v.js} +1 -1
  14. package/dist/{chunk-dkhherd0.js → chunk-2f7j0dmw.js} +1 -1
  15. package/dist/{chunk-drmk6r1m.js → chunk-2z9mh5y4.js} +1 -1
  16. package/dist/chunk-3jm67wxm.js +2 -0
  17. package/dist/chunk-3mnpvfg3.js +2 -0
  18. package/dist/chunk-485kgdtb.js +2 -0
  19. package/dist/{chunk-nn5rzwty.js → chunk-4chtv4nh.js} +1 -1
  20. package/dist/{chunk-7b156stw.js → chunk-4dz5x4xw.js} +1 -1
  21. package/dist/chunk-4jgf7sfa.js +2 -0
  22. package/dist/{chunk-01d81hn0.js → chunk-4r03rh93.js} +1 -1
  23. package/dist/{chunk-3a63hke8.js → chunk-4wv5s3vr.js} +1 -1
  24. package/dist/{chunk-a6hv92fx.js → chunk-51m5tgwp.js} +1 -1
  25. package/dist/chunk-5t07s3dv.js +2 -0
  26. package/dist/{chunk-ebnc6980.js → chunk-6gvx1g6h.js} +1 -1
  27. package/dist/{chunk-c4cj24qm.js → chunk-6kd81nf9.js} +2 -2
  28. package/dist/{chunk-j6geg3qt.js → chunk-6w0n6c07.js} +1 -1
  29. package/dist/{chunk-y1d6e0ye.js → chunk-743mhx0e.js} +1 -1
  30. package/dist/{chunk-eh71jv8w.js → chunk-7hm46cej.js} +1 -1
  31. package/dist/{chunk-t879n4ab.js → chunk-7p1b809h.js} +1 -1
  32. package/dist/chunk-8b7cwedf.js +2 -0
  33. package/dist/{chunk-dg2q6egm.js → chunk-8r2819xn.js} +1 -1
  34. package/dist/{chunk-4qv88x27.js → chunk-8wrbxhs3.js} +1 -1
  35. package/dist/{chunk-s5czyzje.js → chunk-9chq5m4p.js} +3 -3
  36. package/dist/chunk-9fagkyrp.js +2 -0
  37. package/dist/{chunk-kjhqe26r.js → chunk-9gabxm8n.js} +1 -1
  38. package/dist/{chunk-c9266b5x.js → chunk-a8wcn3mh.js} +1 -1
  39. package/dist/chunk-aann4nkc.js +2 -0
  40. package/dist/{chunk-zjp519wm.js → chunk-bafzw99p.js} +1 -1
  41. package/dist/{chunk-gcwg4b2w.js → chunk-bgb44971.js} +1 -1
  42. package/dist/{chunk-4fh7w98z.js → chunk-bw43q8k7.js} +1 -1
  43. package/dist/{chunk-v808b36p.js → chunk-byqzhgzs.js} +1 -1
  44. package/dist/{chunk-zy49dwqk.js → chunk-c63e4ssc.js} +2 -2
  45. package/dist/{chunk-xn2960z7.js → chunk-cb25v2mp.js} +1 -1
  46. package/dist/{chunk-ma01xp3y.js → chunk-d09qj570.js} +1 -1
  47. package/dist/chunk-dttp44vs.js +2 -0
  48. package/dist/{chunk-1znpbjrv.js → chunk-dxd0eg4r.js} +1 -1
  49. package/dist/{chunk-6np84pfr.js → chunk-ewhvahnb.js} +1 -1
  50. package/dist/{chunk-2z85fqdp.js → chunk-fsghqtgf.js} +2 -2
  51. package/dist/chunk-fzs7vpps.js +2 -0
  52. package/dist/{chunk-zpgm9yzy.js → chunk-g09atq0m.js} +1 -1
  53. package/dist/{chunk-k907b533.js → chunk-gg1ddvnf.js} +1 -1
  54. package/dist/chunk-gkb0gja4.js +2 -0
  55. package/dist/{chunk-rwz433q2.js → chunk-gq9gkyah.js} +2 -2
  56. package/dist/{chunk-92gh2n65.js → chunk-gvpsbmeg.js} +1 -1
  57. package/dist/{chunk-wf1jcxtr.js → chunk-h2f92qwd.js} +1 -1
  58. package/dist/{chunk-66nntsnf.js → chunk-hd74jxm2.js} +1 -1
  59. package/dist/{chunk-p16pnhj3.js → chunk-her5azyp.js} +1 -1
  60. package/dist/{chunk-4kyxrwxn.js → chunk-hk4d7rky.js} +1 -1
  61. package/dist/chunk-hxkxset4.js +2 -0
  62. package/dist/{chunk-9n1kth4b.js → chunk-j57716xw.js} +1 -1
  63. package/dist/chunk-jgq5d6s2.js +2 -0
  64. package/dist/{chunk-awjm9n45.js → chunk-km4aszfp.js} +1 -1
  65. package/dist/{chunk-x9qhsyp6.js → chunk-knhvdm94.js} +2 -2
  66. package/dist/{chunk-cneecnvd.js → chunk-kpsvwjac.js} +11 -11
  67. package/dist/chunk-kthwzc4p.js +2 -0
  68. package/dist/{chunk-028354j6.js → chunk-m3rftash.js} +7 -7
  69. package/dist/{chunk-bstgsak0.js → chunk-m9qtb4xj.js} +1 -1
  70. package/dist/{chunk-2b07w74s.js → chunk-mr2d1zp0.js} +1 -1
  71. package/dist/{chunk-xyzcgskb.js → chunk-mthd2c8m.js} +1 -1
  72. package/dist/{chunk-w2ccdet4.js → chunk-mtn4angk.js} +1 -1
  73. package/dist/chunk-n960rjcr.js +2 -0
  74. package/dist/{chunk-37zd94a7.js → chunk-nk8wxxy7.js} +2 -2
  75. package/dist/{chunk-y83rsv1a.js → chunk-nzk13c4q.js} +1 -1
  76. package/dist/{chunk-cx89kty3.js → chunk-nznpzbq4.js} +1 -1
  77. package/dist/{chunk-hc2pdv4j.js → chunk-p9xksx9p.js} +1 -1
  78. package/dist/{chunk-n5mz7csc.js → chunk-pa7pav6h.js} +1 -1
  79. package/dist/{chunk-ym9475ry.js → chunk-pag93kz1.js} +1 -1
  80. package/dist/{chunk-bgw39afd.js → chunk-psjrcpgb.js} +1 -1
  81. package/dist/{chunk-q99xd3m5.js → chunk-pxfrq43h.js} +1 -1
  82. package/dist/chunk-q4j2f72t.js +2 -0
  83. package/dist/{chunk-fgec04jx.js → chunk-qbep9dk4.js} +1 -1
  84. package/dist/{chunk-j7qktvpg.js → chunk-qngnmrpw.js} +1 -1
  85. package/dist/chunk-r1jvyhhd.js +4 -0
  86. package/dist/{chunk-p2h2z6d3.js → chunk-r7qa2ykf.js} +2 -2
  87. package/dist/chunk-rqj1vrfs.js +2 -0
  88. package/dist/{chunk-34vracy4.js → chunk-s0ps33ft.js} +1 -1
  89. package/dist/{chunk-qjzpzd7j.js → chunk-s3b3vrsj.js} +1 -1
  90. package/dist/chunk-s4fccg73.js +2 -0
  91. package/dist/{chunk-zrec546r.js → chunk-sddaassq.js} +1 -1
  92. package/dist/{chunk-6qw89f68.js → chunk-sj7n6xa1.js} +1 -1
  93. package/dist/{chunk-t5hq4ke1.js → chunk-t1r2ycn7.js} +1 -1
  94. package/dist/{chunk-1tdkpeva.js → chunk-tjj6ttj1.js} +1 -1
  95. package/dist/{chunk-dq681xgx.js → chunk-tsd9jw07.js} +1 -1
  96. package/dist/{chunk-s609kp6h.js → chunk-ttkjzy0m.js} +1 -1
  97. package/dist/chunk-txe5z472.js +2 -0
  98. package/dist/chunk-vffz69jj.js +2 -0
  99. package/dist/{chunk-sn0qr6q7.js → chunk-vs61069x.js} +1 -1
  100. package/dist/{chunk-3a5gcj3y.js → chunk-wc2z7krw.js} +1 -1
  101. package/dist/{chunk-jn3t9v6d.js → chunk-wfg3bp85.js} +1 -1
  102. package/dist/{chunk-5sh69bkj.js → chunk-wfwrm4k3.js} +1 -1
  103. package/dist/{chunk-3nn2j810.js → chunk-whtdmv3p.js} +1 -1
  104. package/dist/{chunk-gjhxc6ma.js → chunk-wk175yyw.js} +1 -1
  105. package/dist/chunk-wn9vr9ct.js +2 -0
  106. package/dist/{chunk-zwtx6vn3.js → chunk-wzncz6j5.js} +1 -1
  107. package/dist/{chunk-m8brd9b5.js → chunk-y2ntnpdb.js} +1 -1
  108. package/dist/{chunk-xhn5331s.js → chunk-y5fdq7cd.js} +1 -1
  109. package/dist/{chunk-7t8s2mcf.js → chunk-yh13j2af.js} +1 -1
  110. package/dist/chunk-yr6qyeab.js +2 -0
  111. package/dist/src/index.js +1 -1
  112. package/dist/src/setup.js +1 -1
  113. package/dist/src/utils/dependency-file-parser.d.ts +6 -0
  114. package/package.json +3 -2
  115. package/dist/chunk-18en5afz.js +0 -2
  116. package/dist/chunk-3578axtf.js +0 -2
  117. package/dist/chunk-3r0jb90q.js +0 -2
  118. package/dist/chunk-4myy0a37.js +0 -2
  119. package/dist/chunk-4x1mv7qj.js +0 -2
  120. package/dist/chunk-6hyrj0b5.js +0 -2
  121. package/dist/chunk-86xv8x00.js +0 -2
  122. package/dist/chunk-87k997bm.js +0 -2
  123. package/dist/chunk-8jvmqdvc.js +0 -2
  124. package/dist/chunk-94tnmc7j.js +0 -4
  125. package/dist/chunk-c8xfj0m5.js +0 -2
  126. package/dist/chunk-cj5fkyxv.js +0 -2
  127. package/dist/chunk-d3m5kcpp.js +0 -2
  128. package/dist/chunk-dg1c0fyk.js +0 -2
  129. package/dist/chunk-fzfgvt8s.js +0 -2
  130. package/dist/chunk-j21m6rf6.js +0 -2
  131. package/dist/chunk-jjwxbcfz.js +0 -2
  132. package/dist/chunk-nd780ymh.js +0 -2
  133. package/dist/chunk-tmzd2p2n.js +0 -2
  134. package/dist/chunk-tqsrr90t.js +0 -2
  135. package/dist/chunk-v915xqf0.js +0 -2
  136. package/dist/chunk-v9avf6sc.js +0 -2
  137. package/dist/chunk-w2vsf1q0.js +0 -2
  138. package/dist/chunk-y0rng1vc.js +0 -2
  139. package/dist/chunk-z0rsmhe4.js +0 -2
  140. package/dist/chunk-zcsahxe6.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ib as $}from"./chunk-vckhctmr.js";import"./chunk-s82adeq9.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-16aeend1.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};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-rb1fh9vd.js";import{$d as n,Od as a,Pd as b,Qd as c,Rd as d,Sd as e,Td as f,Ud as g,Vd as h,Wd as i,Xd as j,Yd as k,Zd as l,_d as m,ae as o,be as p,ce as q,de as r,ee as s,fe as t}from"./chunk-2b07w74s.js";import"./chunk-142zh7e5.js";import"./chunk-24xvskkf.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{r as syntaxAnalyzer,q as shellcheckAnalyzer,p as secretsAnalyzer,b as runTool,t as runAnalyzers,e as relativize,d as parseToolJson,j as offsetToLine,n as markdownlintAnalyzer,c as mapSeverity,m as linterAnalyzer,i as hadolintAnalyzer,h as githubActionsAnalyzer,l as detectLinter,f as commandExists,g as actionlintAnalyzer,a as TOOL_TIMEOUT_MS,o as SECRET_RULES,k as LINTER_SPECS,s as BUILTIN_ANALYZERS};
2
+ import"./chunk-rb1fh9vd.js";import{$d as n,Od as a,Pd as b,Qd as c,Rd as d,Sd as e,Td as f,Ud as g,Vd as h,Wd as i,Xd as j,Yd as k,Zd as l,_d as m,ae as o,be as p,ce as q,de as r,ee as s,fe as t}from"./chunk-mr2d1zp0.js";import"./chunk-142zh7e5.js";import"./chunk-24xvskkf.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.js";export{r as syntaxAnalyzer,q as shellcheckAnalyzer,p as secretsAnalyzer,b as runTool,t as runAnalyzers,e as relativize,d as parseToolJson,j as offsetToLine,n as markdownlintAnalyzer,c as mapSeverity,m as linterAnalyzer,i as hadolintAnalyzer,h as githubActionsAnalyzer,l as detectLinter,f as commandExists,g as actionlintAnalyzer,a as TOOL_TIMEOUT_MS,o as SECRET_RULES,k as LINTER_SPECS,s as BUILTIN_ANALYZERS};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Qh as F}from"./chunk-zwtx6vn3.js";var R=/^(?:build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(?:\([^)]+\))?!?: .+/;function Y(M,G){let P=R.test(M.trim());return{name:"title-format",mode:G,passed:P,summary:P?"Title follows conventional commit format":"Title does not follow conventional commit format",...P?{}:{detail:"Expected something like `feat(scope): add the thing` or `fix: correct the off-by-one`."}}}function B(M,G){let P=M.trim();if(P.length<20)return{name:"description",mode:G.mode,passed:!1,summary:"Description is missing or too short",detail:"Explain what changed and why, so a reviewer does not have to reconstruct it from the diff."};let z=(G.requireSections??[]).filter((j)=>!new RegExp(`^#{1,6}\\s*${w(j)}\\b`,"im").test(P));return{name:"description",mode:G.mode,passed:z.length===0,summary:z.length===0?"Description is complete":`Description is missing ${z.length} required section(s)`,...z.length>0?{detail:`Missing: ${z.map((j)=>`\`${j}\``).join(", ")}`}:{}}}function C(M,G){let P=[];for(let z of M??[]){if(G.blockVulnerable!==!1&&z.vulnerable)P.push(`\`${z.name}@${z.version}\` has a known vulnerability`);if(G.blockDeprecated!==!1&&z.deprecated)P.push(`\`${z.name}\` is deprecated`);if(G.blockEol!==!1&&z.eol)P.push(z.eol);if(G.licenseAllowlist?.length&&z.license){if(!G.licenseAllowlist.includes(z.license))P.push(`\`${z.name}\` is licensed \`${z.license}\`, which is not on the allowlist`)}}return{name:"dependency-gate",mode:G.mode,passed:P.length===0,summary:P.length===0?"Dependencies satisfy the configured policy":`${P.length} dependency policy violation(s)`,...P.length>0?{detail:P.map((z)=>`- ${z}`).join(`
2
+ import{Rh as F}from"./chunk-wzncz6j5.js";var R=/^(?:build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(?:\([^)]+\))?!?: .+/;function Y(M,G){let P=R.test(M.trim());return{name:"title-format",mode:G,passed:P,summary:P?"Title follows conventional commit format":"Title does not follow conventional commit format",...P?{}:{detail:"Expected something like `feat(scope): add the thing` or `fix: correct the off-by-one`."}}}function B(M,G){let P=M.trim();if(P.length<20)return{name:"description",mode:G.mode,passed:!1,summary:"Description is missing or too short",detail:"Explain what changed and why, so a reviewer does not have to reconstruct it from the diff."};let z=(G.requireSections??[]).filter((j)=>!new RegExp(`^#{1,6}\\s*${w(j)}\\b`,"im").test(P));return{name:"description",mode:G.mode,passed:z.length===0,summary:z.length===0?"Description is complete":`Description is missing ${z.length} required section(s)`,...z.length>0?{detail:`Missing: ${z.map((j)=>`\`${j}\``).join(", ")}`}:{}}}function C(M,G){let P=[];for(let z of M??[]){if(G.blockVulnerable!==!1&&z.vulnerable)P.push(`\`${z.name}@${z.version}\` has a known vulnerability`);if(G.blockDeprecated!==!1&&z.deprecated)P.push(`\`${z.name}\` is deprecated`);if(G.blockEol!==!1&&z.eol)P.push(z.eol);if(G.licenseAllowlist?.length&&z.license){if(!G.licenseAllowlist.includes(z.license))P.push(`\`${z.name}\` is licensed \`${z.license}\`, which is not on the allowlist`)}}return{name:"dependency-gate",mode:G.mode,passed:P.length===0,summary:P.length===0?"Dependencies satisfy the configured policy":`${P.length} dependency policy violation(s)`,...P.length>0?{detail:P.map((z)=>`- ${z}`).join(`
3
3
  `)}:{}}}function q(M,G){let P=[];if(G.titleFormat&&G.titleFormat!=="off")P.push(Y(M.title,G.titleFormat));if(G.description&&G.description.mode!=="off")P.push(B(M.body,G.description));if(G.dependencyGate&&G.dependencyGate.mode!=="off")P.push(C(M.dependencies,G.dependencyGate));return P}function S(M){if(M.length===0)return{conclusion:"neutral",title:"No checks configured",summary:"No pre-merge checks are enabled."};let G=M.filter((x)=>!x.passed&&x.mode==="error"),P=M.filter((x)=>!x.passed&&x.mode==="warning"),z=M.filter((x)=>x.neutral),j=M.map((x)=>{return`${H(x)} **${x.name}** \u2014 ${x.summary}${x.detail?`
4
4
 
5
5
  ${x.detail}
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ka as a,la as b,ma as c,na as d,oa as e,pa as f,qa as g,ra as h,sa as i,ta as j,ua as k,va as l,wa as m}from"./chunk-bgw39afd.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{e as summarizeGates,l as runPostMerge,d as runGates,i as runAiGates,m as isMergeEvent,f as gateIcon,j as findLinkedIssues,a as checkTitleFormat,g as checkLinkedIssue,b as checkDescription,c as checkDependencies,h as checkCustomAssertions,k as appendChangelogEntry};
2
+ import{ka as a,la as b,ma as c,na as d,oa as e,pa as f,qa as g,ra as h,sa as i,ta as j,ua as k,va as l,wa as m}from"./chunk-psjrcpgb.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.js";export{e as summarizeGates,l as runPostMerge,d as runGates,i as runAiGates,m as isMergeEvent,f as gateIcon,j as findLinkedIssues,a as checkTitleFormat,g as checkLinkedIssue,b as checkDescription,c as checkDependencies,h as checkCustomAssertions,k as appendChangelogEntry};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{td as a}from"./chunk-hd74jxm2.js";import"./chunk-gvpsbmeg.js";import"./chunk-c63e4ssc.js";import"./chunk-x9vpk4kk.js";import"./chunk-r1jvyhhd.js";import"./chunk-2z9mh5y4.js";import"./chunk-yh13j2af.js";import"./chunk-s0ps33ft.js";import"./chunk-wzncz6j5.js";import"./chunk-m3rftash.js";import"./chunk-16aeend1.js";export{a as PullRequestGenerator};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ae as d,Be as e,Ce as f,De as g,Ee as h,xe as a,ye as b,ze as c}from"./chunk-gjhxc6ma.js";import"./chunk-7t8s2mcf.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{e as updateGitHubActionsFile,d as sameActionVersion,b as parseGitHubActionsFile,a as isGitHubActionsFile,c as isCommitSha,f as generateGitHubActionsUpdates,h as fetchLatestActionVersion,g as fetchActionTagCommit};
2
+ import{Ae as d,Be as e,Ce as f,De as g,Ee as h,xe as a,ye as b,ze as c}from"./chunk-wk175yyw.js";import"./chunk-yh13j2af.js";import"./chunk-s0ps33ft.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.js";export{e as updateGitHubActionsFile,d as sameActionVersion,b as parseGitHubActionsFile,a as isGitHubActionsFile,c as isCommitSha,f as generateGitHubActionsUpdates,h as fetchLatestActionVersion,g as fetchActionTagCommit};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-s82adeq9.js";import{spawn as E}from"child_process";async function y(z,A){return new Promise((k,x)=>{let q=E("git",z,{stdio:"pipe",cwd:A}),C="",D="";q.stdout?.on("data",(B)=>C+=B.toString()),q.stderr?.on("data",(B)=>D+=B.toString()),q.on("close",(B)=>{if(B===0)k(C);else x(Error(D||`git exited with code ${B}`))}),q.on("error",x)})}async function H(z,A,k){for(let x of z){let q=x.path.replace(/^\.\//,"").replace(/^\/+/,"");try{if(await y(["show",`${A}:${q}`],k)!==x.content)return!0;continue}catch{}try{if(await y(["show",`origin/${A}:${q}`],k)!==x.content)return!0;continue}catch{return!0}}return!1}async function I(z,A,k){if(z.length===0)return!1;if(await y(["add","--",...z],k),!(await y(["diff","--cached","--name-only"],k)).trim())return!1;await y(["commit","-m",A],k);let q=(await y(["rev-parse","--abbrev-ref","HEAD"],k)).trim();return await y(["push","origin",`HEAD:${q}`],k),!0}export{H as hasBranchDifferences,I as commitAndPush};
2
+ import"./chunk-16aeend1.js";import{spawn as E}from"child_process";async function y(z,A){return new Promise((k,x)=>{let q=E("git",z,{stdio:"pipe",cwd:A}),C="",D="";q.stdout?.on("data",(B)=>C+=B.toString()),q.stderr?.on("data",(B)=>D+=B.toString()),q.on("close",(B)=>{if(B===0)k(C);else x(Error(D||`git exited with code ${B}`))}),q.on("error",x)})}async function H(z,A,k){for(let x of z){let q=x.path.replace(/^\.\//,"").replace(/^\/+/,"");try{if(await y(["show",`${A}:${q}`],k)!==x.content)return!0;continue}catch{}try{if(await y(["show",`origin/${A}:${q}`],k)!==x.content)return!0;continue}catch{return!0}}return!1}async function I(z,A,k){if(z.length===0)return!1;if(await y(["add","--",...z],k),!(await y(["diff","--cached","--name-only"],k)).trim())return!1;await y(["commit","-m",A],k);let q=(await y(["rev-parse","--abbrev-ref","HEAD"],k)).trim();return await y(["push","origin",`HEAD:${q}`],k),!0}export{H as hasBranchDifferences,I as commitAndPush};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{Rh as O}from"./chunk-wzncz6j5.js";import{Gj as A}from"./chunk-m3rftash.js";import{gl as x}from"./chunk-16aeend1.js";function T(z){let G=z.split("/").pop()||"";if(["deps.yaml","dependencies.yaml","pkgx.yaml",".deps.yaml"].includes(G))return!0;let j=G.replace(/\.(yaml|yml)$/,"");return["deps","dependencies","pkgx",".deps"].includes(j)}async function V(z,G){try{if(!T(z))return null;let J=[];try{let H=await A(z);if(H&&typeof H==="object"){if(H.allDependencies&&Array.isArray(H.allDependencies)){for(let K of H.allDependencies)if(K.name&&K.constraint)J.push({name:K.name,currentVersion:K.constraint,type:"dependencies",file:z})}}}catch(H){O().warn(`ts-pantry failed to parse ${z}, attempting fallback YAML parsing:`,H)}if(J.length===0)try{J=await B(G,z)}catch(H){O().warn(`Fallback YAML parsing failed for ${z}:`,H),J=[]}let j=z.split("/").pop()||"";return{path:z,type:j,content:G,dependencies:J}}catch(J){return O().warn(`Failed to parse dependency file ${z}:`,J),null}}async function B(z,G){let J=[],j=z.split(`
3
+ `),H=!1;for(let K of j){let Q=K.trim();if(Q==="dependencies:"){H=!0;continue}if(H){if(Q&&!K.startsWith(" ")&&!K.startsWith("\t")){H=!1;continue}let X=Q.match(/^([\w@/-]+):\s*(.+)$/);if(X){let[,Z,$]=X;J.push({name:Z.trim(),currentVersion:$.trim(),type:"dependencies",file:G})}}}return J}function b(z){try{return Bun.YAML.parse(z),!0}catch{return!1}}async function S(z,G,J){try{if(!T(z))return O().info(`\u26A0\uFE0F updateDependencyFile: ${z} is not a dependency file, returning original content`),G;if(G.trim().startsWith("{")&&G.includes('"require"'))return O().info(`\u26A0\uFE0F updateDependencyFile: Content appears to be JSON (composer.json), but file is ${z}`),O().info(`Content preview: ${G.substring(0,200)}`),G;let j=G;for(let H of J){let K=H.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,""),Q=K.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`^([ \\t]*)("${Q}"|'${Q}'|${Q})([ \\t]*:[ \\t]*)(["']?)([^\\s#"']+)\\4([ \\t]*#[^\\r\\n]*)?`,"gm");j=j.replace(X,(Z,$,w,E,W,_,R)=>{if(["latest","*","main","master","develop","dev"].includes(_.toLowerCase().trim()))return O().info(`\u26A0\uFE0F Skipping update for ${K} - version "${_}" should be respected`),Z;if(U(_))return Z;let Y=_.match(/^(\D*)/)?.[1]??"",q=/^[\^~>=<]/.test(H.newVersion)?H.newVersion:`${Y}${H.newVersion}`;return`${$}${w}${E}${W}${q}${W}${R??""}`})}if(j!==G&&b(G)&&!b(j))return O().warn(`\u26A0\uFE0F Skipping updates for ${z}: the rewrite no longer parses as YAML, so the file is left unchanged`),G;return j}catch(j){return O().warn(`Failed to update dependency file ${z}:`,j),G}}async function v(z){let G=[],J=new Map;for(let j of z)if(T(j.file)){if(!J.has(j.file))J.set(j.file,[]);J.get(j.file).push(j)}for(let[j,H]of J)try{let K=await import("fs");if(K.existsSync(j)){let Q=K.readFileSync(j,"utf-8"),X=await S(j,Q,H);if(X!==Q)G.push({path:j,content:X,type:"update"}),O().info(`\u2705 Generated update for ${j} with ${H.length} package changes`);else O().info(`\u2139\uFE0F No changes needed for ${j} - versions already up to date`)}else O().warn(`\u26A0\uFE0F Dependency file ${j} does not exist`)}catch(K){O().warn(`Failed to generate updates for dependency file ${j}:`,K)}return G}function U(z){return/^(?:workspace|file|link|portal|git|github|gitlab|bitbucket|https?|git\+[a-z]+):/i.test(z.trim())}
4
+ export{T as Ag,V as Bg,S as Cg,v as Dg,U as Eg};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Fh as V}from"./chunk-j6geg3qt.js";import{Kh as P}from"./chunk-34vracy4.js";import{Nh as M,Qh as Q}from"./chunk-zwtx6vn3.js";function X(z){if(z==="running")return"in_progress";if(z==="success"||z==="failed"||z==="canceled"||z==="skipped"||z==="manual")return"completed";return"queued"}function Y(z){switch(z){case"success":return"success";case"failed":return"failure";case"canceled":return"cancelled";case"skipped":case"manual":return"skipped";default:return null}}class Z{token;apiUrl;logger;projectId;constructor(z,A,F,G,H){this.token=z;this.apiUrl=(G??"https://gitlab.com/api/v4").replace(/\/+$/,""),this.logger=H??Q(),this.projectId=encodeURIComponent(`${A}/${F}`)}capabilities(){return{pinIssues:!1,checkRuns:!0,inlineReviewComments:!0,reviewSuggestions:!0,nativeAutoMerge:!0,commentReactions:!0,ciLogs:!0,ciRuns:!0,reviewThreads:!0,teamReviewers:!1,draftPullRequests:!0,permissionLookup:!0,branchHousekeeping:!0,reopenPullRequests:!0,labels:!0}}async request(z,A,F,G={}){let H=await P(`${this.apiUrl}${A}`,{method:z,headers:{"PRIVATE-TOKEN":this.token,Accept:G.raw?"text/plain":"application/json","User-Agent":"buddy",...F?{"Content-Type":"application/json"}:{}},...F?{body:JSON.stringify(F)}:{}});if(!H.ok){let K=await H.text().catch(()=>"");throw Error(`GitLab ${z} ${A} failed: ${H.status} ${K.slice(0,200)}`)}let J=await H.text();if(G.raw)return J;return J.trim()?JSON.parse(J):void 0}async optional(z,A,F={}){try{return await this.request(z,A,void 0,F)}catch(G){if(String(G).includes("404"))return null;throw G}}async branchExists(z){return await this.optional("GET",`/projects/${this.projectId}/repository/branches/${encodeURIComponent(z)}`)!==null}async createBranch(z,A){await this.request("POST",`/projects/${this.projectId}/repository/branches`,{branch:z,ref:A})}async deleteBranch(z){await this.request("DELETE",`/projects/${this.projectId}/repository/branches/${encodeURIComponent(z)}`)}async commitChanges(z,A,F,G="main"){if(F.length===0)return;if(await this.branchExists(z))await this.deleteBranch(z);await this.createBranch(z,G);let J=await Promise.all(F.map(async(K)=>{if(K.type==="delete")return{action:"delete",file_path:K.path};return{action:await this.getFileContent(K.path,G)!==null?"update":"create",file_path:K.path,content:K.content}}));await this.request("POST",`/projects/${this.projectId}/repository/commits`,{branch:z,commit_message:A,actions:J})}async getFileContent(z,A){let F=await this.optional("GET",`/projects/${this.projectId}/repository/files/${encodeURIComponent(z)}?ref=${encodeURIComponent(A)}`);if(!F?.content)return null;return F.encoding==="base64"?Buffer.from(F.content,"base64").toString("utf-8"):F.content}async createPullRequest(z){let A=await this.request("POST",`/projects/${this.projectId}/merge_requests`,{source_branch:z.head,target_branch:z.base,title:z.draft?`Draft: ${z.title}`:z.title,description:z.body,...z.labels?.length?{labels:z.labels.join(",")}:{},remove_source_branch:!0});return await this.assignPeople(A.iid,z),this.toPullRequest(A)}async assignPeople(z,A){let F=async(J=[])=>{return(await Promise.all(J.map(async(O)=>{return(await this.optional("GET",`/users?username=${encodeURIComponent(O)}`))?.[0]?.id??null}))).filter((O)=>O!==null)},[G,H]=await Promise.all([F(A.reviewers),F(A.assignees)]);if(G.length===0&&H.length===0)return;try{await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}`,{...G.length?{reviewer_ids:G}:{},...H.length?{assignee_ids:H}:{}})}catch(J){this.logger.warn(`\u26A0\uFE0F Could not assign reviewers on !${z}: ${M(J)}`)}}async getPullRequests(z="open"){let A=z==="all"?"state=all":z==="open"?"state=opened":"state=all",G=(await this.request("GET",`/projects/${this.projectId}/merge_requests?${A}&per_page=100`)).map((H)=>this.toPullRequest(H));return z==="closed"?G.filter((H)=>H.state!=="open"):G}async updatePullRequest(z,A){let F=await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}`,{...A.title!==void 0?{title:A.draft?`Draft: ${A.title}`:A.title}:{},...A.body!==void 0?{description:A.body}:{},...A.base!==void 0?{target_branch:A.base}:{},...A.labels!==void 0?{labels:A.labels.join(",")}:{}});return this.toPullRequest(F)}async closePullRequest(z){await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}`,{state_event:"close"})}async reopenPullRequest(z){await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}`,{state_event:"reopen"})}async mergePullRequest(z,A="squash"){await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}/merge`,{squash:A==="squash",should_remove_source_branch:!0})}async getPullRequestDiff(z){return((await this.request("GET",`/projects/${this.projectId}/merge_requests/${z}/changes`)).changes??[]).map((F)=>[`diff --git a/${F.old_path} b/${F.new_path}`,`--- a/${F.old_path}`,`+++ b/${F.new_path}`,F.diff.replace(/\n$/,"")].join(`
2
+ import{Gh as V}from"./chunk-6w0n6c07.js";import{Lh as P}from"./chunk-s0ps33ft.js";import{Oh as M,Rh as Q}from"./chunk-wzncz6j5.js";function X(z){if(z==="running")return"in_progress";if(z==="success"||z==="failed"||z==="canceled"||z==="skipped"||z==="manual")return"completed";return"queued"}function Y(z){switch(z){case"success":return"success";case"failed":return"failure";case"canceled":return"cancelled";case"skipped":case"manual":return"skipped";default:return null}}class Z{token;apiUrl;logger;projectId;constructor(z,A,F,G,H){this.token=z;this.apiUrl=(G??"https://gitlab.com/api/v4").replace(/\/+$/,""),this.logger=H??Q(),this.projectId=encodeURIComponent(`${A}/${F}`)}capabilities(){return{pinIssues:!1,checkRuns:!0,inlineReviewComments:!0,reviewSuggestions:!0,nativeAutoMerge:!0,commentReactions:!0,ciLogs:!0,ciRuns:!0,reviewThreads:!0,teamReviewers:!1,draftPullRequests:!0,permissionLookup:!0,branchHousekeeping:!0,reopenPullRequests:!0,labels:!0}}async request(z,A,F,G={}){let H=await P(`${this.apiUrl}${A}`,{method:z,headers:{"PRIVATE-TOKEN":this.token,Accept:G.raw?"text/plain":"application/json","User-Agent":"buddy",...F?{"Content-Type":"application/json"}:{}},...F?{body:JSON.stringify(F)}:{}});if(!H.ok){let K=await H.text().catch(()=>"");throw Error(`GitLab ${z} ${A} failed: ${H.status} ${K.slice(0,200)}`)}let J=await H.text();if(G.raw)return J;return J.trim()?JSON.parse(J):void 0}async optional(z,A,F={}){try{return await this.request(z,A,void 0,F)}catch(G){if(String(G).includes("404"))return null;throw G}}async branchExists(z){return await this.optional("GET",`/projects/${this.projectId}/repository/branches/${encodeURIComponent(z)}`)!==null}async createBranch(z,A){await this.request("POST",`/projects/${this.projectId}/repository/branches`,{branch:z,ref:A})}async deleteBranch(z){await this.request("DELETE",`/projects/${this.projectId}/repository/branches/${encodeURIComponent(z)}`)}async commitChanges(z,A,F,G="main"){if(F.length===0)return;if(await this.branchExists(z))await this.deleteBranch(z);await this.createBranch(z,G);let J=await Promise.all(F.map(async(K)=>{if(K.type==="delete")return{action:"delete",file_path:K.path};return{action:await this.getFileContent(K.path,G)!==null?"update":"create",file_path:K.path,content:K.content}}));await this.request("POST",`/projects/${this.projectId}/repository/commits`,{branch:z,commit_message:A,actions:J})}async getFileContent(z,A){let F=await this.optional("GET",`/projects/${this.projectId}/repository/files/${encodeURIComponent(z)}?ref=${encodeURIComponent(A)}`);if(!F?.content)return null;return F.encoding==="base64"?Buffer.from(F.content,"base64").toString("utf-8"):F.content}async createPullRequest(z){let A=await this.request("POST",`/projects/${this.projectId}/merge_requests`,{source_branch:z.head,target_branch:z.base,title:z.draft?`Draft: ${z.title}`:z.title,description:z.body,...z.labels?.length?{labels:z.labels.join(",")}:{},remove_source_branch:!0});return await this.assignPeople(A.iid,z),this.toPullRequest(A)}async assignPeople(z,A){let F=async(J=[])=>{return(await Promise.all(J.map(async(O)=>{return(await this.optional("GET",`/users?username=${encodeURIComponent(O)}`))?.[0]?.id??null}))).filter((O)=>O!==null)},[G,H]=await Promise.all([F(A.reviewers),F(A.assignees)]);if(G.length===0&&H.length===0)return;try{await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}`,{...G.length?{reviewer_ids:G}:{},...H.length?{assignee_ids:H}:{}})}catch(J){this.logger.warn(`\u26A0\uFE0F Could not assign reviewers on !${z}: ${M(J)}`)}}async getPullRequests(z="open"){let A=z==="all"?"state=all":z==="open"?"state=opened":"state=all",G=(await this.request("GET",`/projects/${this.projectId}/merge_requests?${A}&per_page=100`)).map((H)=>this.toPullRequest(H));return z==="closed"?G.filter((H)=>H.state!=="open"):G}async updatePullRequest(z,A){let F=await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}`,{...A.title!==void 0?{title:A.draft?`Draft: ${A.title}`:A.title}:{},...A.body!==void 0?{description:A.body}:{},...A.base!==void 0?{target_branch:A.base}:{},...A.labels!==void 0?{labels:A.labels.join(",")}:{}});return this.toPullRequest(F)}async closePullRequest(z){await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}`,{state_event:"close"})}async reopenPullRequest(z){await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}`,{state_event:"reopen"})}async mergePullRequest(z,A="squash"){await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}/merge`,{squash:A==="squash",should_remove_source_branch:!0})}async getPullRequestDiff(z){return((await this.request("GET",`/projects/${this.projectId}/merge_requests/${z}/changes`)).changes??[]).map((F)=>[`diff --git a/${F.old_path} b/${F.new_path}`,`--- a/${F.old_path}`,`+++ b/${F.new_path}`,F.diff.replace(/\n$/,"")].join(`
3
3
  `)).join(`
4
4
  `)}async getPullRequestHeadSha(z){return(await this.request("GET",`/projects/${this.projectId}/merge_requests/${z}`)).sha??""}async createComment(z,A){try{await this.request("POST",`/projects/${this.projectId}/merge_requests/${z}/notes`,{body:A})}catch(F){if(!String(F).includes("404"))throw F;await this.request("POST",`/projects/${this.projectId}/issues/${z}/notes`,{body:A})}}async createIssue(z){let A=await this.request("POST",`/projects/${this.projectId}/issues`,{title:z.title,description:z.body,...z.labels?.length?{labels:z.labels.join(",")}:{}});return this.toIssue(A)}async getIssues(z="open"){let A=z==="all"?"state=all":`state=${z==="open"?"opened":"closed"}`;return(await this.request("GET",`/projects/${this.projectId}/issues?${A}&per_page=100`)).map((G)=>this.toIssue(G))}async updateIssue(z,A){let F=await this.request("PUT",`/projects/${this.projectId}/issues/${z}`,{...A.title!==void 0?{title:A.title}:{},...A.body!==void 0?{description:A.body}:{},...A.labels!==void 0?{labels:A.labels.join(",")}:{}});return this.toIssue(F)}async closeIssue(z){await this.request("PUT",`/projects/${this.projectId}/issues/${z}`,{state_event:"close"})}async unpinIssue(z){return!1}async enableAutoMerge(z,A="squash"){try{return await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}/merge`,{merge_when_pipeline_succeeds:!0,squash:A==="squash",should_remove_source_branch:!0}),!0}catch(F){return this.logger.debug(`Could not queue !${z} for auto-merge: ${M(F)}`),!1}}async getPullRequestChecksState(z){let F=(await this.optional("GET",`/projects/${this.projectId}/merge_requests/${z}/pipelines`))?.[0]?.status;if(!F)return"none";if(F==="success")return"success";if(["failed","canceled"].includes(F))return"failure";if(["running","pending","created","waiting_for_resource","preparing","scheduled"].includes(F))return"pending";return"none"}async createReview(z,A){if(await this.request("POST",`/projects/${this.projectId}/merge_requests/${z}/notes`,{body:A.body}),!A.comments?.length)return{posted:!0,inlineComments:0};let G=(await this.optional("GET",`/projects/${this.projectId}/merge_requests/${z}/versions`))?.[0];if(!G)return this.logger.warn("\u26A0\uFE0F Could not resolve diff positions; inline comments were not posted"),{posted:!0,inlineComments:0};let H=0;for(let J of A.comments)try{await this.request("POST",`/projects/${this.projectId}/merge_requests/${z}/discussions`,{body:J.body,position:{position_type:"text",base_sha:G.base_commit_sha,start_sha:G.start_commit_sha,head_sha:G.head_commit_sha,new_path:J.path,old_path:J.path,...J.side==="RIGHT"?{new_line:J.line}:{old_line:J.line}}}),H++}catch(K){this.logger.debug(`Could not place a comment on ${J.path}:${J.line}: ${M(K)}`)}return{posted:!0,inlineComments:H}}async createCheckRun(z,A,F){try{await this.request("POST",`/projects/${this.projectId}/statuses/${A}`,{state:F.conclusion==="failure"?"failed":"success",name:z,description:F.title.slice(0,140)})}catch(G){this.logger.warn(`\u26A0\uFE0F Could not report status ${z}: ${M(G)}`)}}async reactToComment(z,A){let F={eyes:"eyes","+1":"thumbsup","-1":"thumbsdown",rocket:"rocket",confused:"confused"};try{await this.request("POST",`/projects/${this.projectId}/notes/${z}/award_emoji`,{name:F[A]??"eyes"})}catch(G){this.logger.debug(`Could not react to note ${z}: ${M(G)}`)}}async hasWriteAccess(z){return(await this.optional("GET",`/projects/${this.projectId}/members/all?query=${encodeURIComponent(z)}`)??[]).some((F)=>F.username===z&&F.access_level>=30)}async getWorkflowRunLogs(z){return this.optional("GET",`/projects/${this.projectId}/jobs/${z}/trace`,{raw:!0}).catch((A)=>{return this.logger.debug(`Could not read the trace for job ${z}: ${M(A)}`),null})}async listWorkflowRuns(z,A={}){let F=A.limit??20;try{return(await this.request("GET",`/projects/${this.projectId}/jobs?per_page=${Math.min(F*5,100)}`)??[]).filter((H)=>H.ref===z).map((H)=>({id:H.id,name:H.name??"",headSha:H.commit?.id??"",headBranch:H.ref??z,status:X(H.status),conclusion:Y(H.status),createdAt:new Date(H.created_at??new Date().toISOString())})).filter((H)=>!A.status||H.status===A.status).slice(0,F)}catch(G){return this.logger.debug(`Could not list CI jobs for ${z}: ${M(G)}`),[]}}async rerunWorkflowRun(z){try{return await this.request("POST",`/projects/${this.projectId}/jobs/${z}/retry`),!0}catch(A){return this.logger.warn(`Could not retry job ${z}: ${M(A)}`),!1}}async listReviewThreads(z){try{return(await this.request("GET",`/projects/${this.projectId}/merge_requests/${z}/discussions?per_page=100`)??[]).filter((F)=>(F.notes??[]).some((G)=>G.resolvable)).map((F)=>({id:F.id,isResolved:(F.notes??[]).every((G)=>!G.resolvable||G.resolved),...F.notes?.[0]?.position?.new_path?{path:F.notes[0].position.new_path}:{},authorLogins:(F.notes??[]).map((G)=>G.author?.username).filter((G)=>typeof G==="string")}))}catch(A){return this.logger.debug(`Could not read discussions on !${z}: ${M(A)}`),[]}}async resolveReviewThread(z,A){try{return await this.request("PUT",`/projects/${this.projectId}/merge_requests/${z}/discussions/${encodeURIComponent(A)}`,{resolved:!0}),!0}catch(F){return this.logger.warn(`Could not resolve discussion ${A}: ${M(F)}`),!1}}async getBuddyBranches(){return(await this.request("GET",`/projects/${this.projectId}/repository/branches?search=buddy&per_page=100`)).filter((A)=>V(A.name)).map((A)=>({name:A.name,sha:A.commit?.id??"",lastCommitDate:A.commit?.committed_date?new Date(A.commit.committed_date):new Date(0)}))}async getOrphanedBuddyBranches(){let[z,A]=await Promise.all([this.getBuddyBranches(),this.getPullRequests("open")]),F=new Set(A.map((G)=>G.head));return z.filter((G)=>!F.has(G.name))}async cleanupStaleBranches(z=7,A=!1){let F=new Date(Date.now()-z*24*60*60*1000),G=(await this.getOrphanedBuddyBranches()).filter((K)=>K.lastCommitDate<F);if(A)return{deleted:G.map((K)=>K.name),failed:[]};let H=[],J=[];for(let K of G)try{await this.deleteBranch(K.name),H.push(K.name)}catch{J.push(K.name)}return{deleted:H,failed:J}}toPullRequest(z){let A=Boolean(z.draft??z.work_in_progress)||/^(?:draft|wip):/i.test(z.title);return{number:z.iid,title:z.title.replace(/^(?:draft|wip):\s*/i,""),body:z.description??"",head:z.source_branch,base:z.target_branch,state:z.state==="merged"?"merged":z.state==="opened"?"open":"closed",url:z.web_url,createdAt:new Date(z.created_at),updatedAt:new Date(z.updated_at),...z.merged_at?{mergedAt:new Date(z.merged_at)}:{},author:z.author?.username??"",reviewers:(z.reviewers??[]).map((F)=>F.username),assignees:(z.assignees??[]).map((F)=>F.username),labels:z.labels??[],draft:A}}toIssue(z){return{number:z.iid,title:z.title,body:z.description??"",state:z.state==="closed"?"closed":"open",url:z.web_url,createdAt:new Date(z.created_at),updatedAt:new Date(z.updated_at),...z.closed_at?{closedAt:new Date(z.closed_at)}:{},author:z.author?.username??"",assignees:(z.assignees??[]).map((A)=>A.username),labels:z.labels??[]}}}
5
- export{Z as Dh};
5
+ export{Z as Eh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Eh as a}from"./chunk-r7qa2ykf.js";import"./chunk-6w0n6c07.js";import"./chunk-s0ps33ft.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.js";export{a as GitLabProvider};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  import _ from"process";var g=30000,b=2,D=500,A=30000,R=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),S=new Set([408,425,429,500,502,503,504]);class w extends Error{url;method;attempts;timedOut;constructor(z,C,K,G,V,$){super(z,$);this.url=C;this.method=K;this.attempts=G;this.timedOut=V;this.name="HttpRequestError"}}function I(z){return new Promise((C)=>setTimeout(C,z))}function x(z){if(typeof z==="number"&&z>0)return z;let C=Number(_.env.BUDDY_HTTP_TIMEOUT_MS);if(Number.isFinite(C)&&C>0)return C;return g}function M(z,C=Date.now()){let K=z.get("retry-after");if(K){let G=Number(K);if(Number.isFinite(G)&&G>=0)return G*1000;let V=Date.parse(K);if(!Number.isNaN(V))return Math.max(0,V-C)}if(z.get("x-ratelimit-remaining")==="0"){let G=Number(z.get("x-ratelimit-reset"));if(Number.isFinite(G)&&G>0)return Math.max(0,G*1000-C)}return null}function h(z){if(S.has(z.status))return!0;if(z.status===403)return z.headers.get("x-ratelimit-remaining")==="0"||z.headers.has("retry-after");return!1}function f(z){return z.status===429||z.status===403}function L(z,C,K){let G=C*2**(z-1),V=Math.random()*C;return Math.min(G+V,K)}async function E(z,C={}){let{timeoutMs:K,retries:G=b,retryBaseMs:V=D,maxDelayMs:$=A,retryNonIdempotent:O=!1,onRetry:q,signal:W,...H}=C,Y=(H.method??"GET").toUpperCase(),N=O||R.has(Y),B=x(K),j=Math.max(1,G+1),J,P=!1;for(let Z=1;Z<=j;Z++){let k=AbortSignal.timeout(B),v=W?AbortSignal.any([W,k]):k;try{let Q=await fetch(z,{...H,signal:v});if(Z<j&&h(Q)){if(N||f(Q)){let F=M(Q.headers),X=Math.min(F??L(Z,V,$),$);q?.({attempt:Z,delayMs:X,reason:`HTTP ${Q.status}`}),await I(X);continue}}return Q}catch(Q){if(J=Q,W?.aborted)throw Q;if(P=Q instanceof Error&&(Q.name==="TimeoutError"||Q.name==="AbortError"),!(Z<j&&N))break;let X=L(Z,V,$);q?.({attempt:Z,delayMs:X,reason:P?`timeout after ${B}ms`:"network error"}),await I(X)}}let U=P?`timed out after ${B}ms`:`network error: ${J instanceof Error?J.message:String(J)}`;throw new w(`${Y} ${z} failed after ${j} attempt(s): ${U}`,z,Y,j,P,{cause:J})}async function c(z,C={}){try{let K=await E(z,C);if(!K.ok)return null;return await K.json()}catch{return null}}
3
- export{g as Gh,b as Hh,w as Ih,M as Jh,E as Kh,c as Lh};
3
+ export{g as Hh,b as Ih,w as Jh,M as Kh,E as Lh,c as Mh};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{wd as j,zd as q}from"./chunk-ebnc6980.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)}
2
+ import{wd as j,zd as q}from"./chunk-6gvx1g6h.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
3
  export{U as ud};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fd as a}from"./chunk-a8wcn3mh.js";import"./chunk-yh13j2af.js";import"./chunk-s0ps33ft.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.js";export{a as DeprecatedDependenciesChecker};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{D as s,E as t,F as u,G as v,H as w,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,u as p,v as q,w as r}from"./chunk-37zd94a7.js";import"./chunk-s82adeq9.js";export{r as toFile,v as default,w as betaRefusalFallbackMiddleware,l as UnprocessableEntityError,f as RetryableError,m as RateLimitError,i as PermissionDeniedError,q as PagePromise,j as NotFoundError,n as InternalServerError,s as HUMAN_PROMPT,k as ConflictError,o as BetaFallbackState,u as BaseAnthropic,g as BadRequestError,h as AuthenticationError,a as AnthropicError,v as Anthropic,c as APIUserAbortError,p as APIPromise,b as APIError,e as APIConnectionTimeoutError,d as APIConnectionError,t as AI_PROMPT};
2
+ import{D as s,E as t,F as u,G as v,H as w,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,u as p,v as q,w as r}from"./chunk-nk8wxxy7.js";import"./chunk-16aeend1.js";export{r as toFile,v as default,w as betaRefusalFallbackMiddleware,l as UnprocessableEntityError,f as RetryableError,m as RateLimitError,i as PermissionDeniedError,q as PagePromise,j as NotFoundError,n as InternalServerError,s as HUMAN_PROMPT,k as ConflictError,o as BetaFallbackState,u as BaseAnthropic,g as BadRequestError,h as AuthenticationError,a as AnthropicError,v as Anthropic,c as APIUserAbortError,p as APIPromise,b as APIError,e as APIConnectionTimeoutError,d as APIConnectionError,t as AI_PROMPT};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$e as e,Xe as a,Ye as b,Ze as c,_e as d,af as f,bf as g,cf as h}from"./chunk-j46f90n8.js";import"./chunk-s82adeq9.js";export{e as resolveEngineVersion,d as pinBlocksUpdate,b as extractEngines,g as engineUpdateType,c as collectResolutionPins,f as bumpEngineConstraint,h as applyEngineUpdates,a as KNOWN_ENGINES};
2
+ import{$e as e,Xe as a,Ye as b,Ze as c,_e as d,af as f,bf as g,cf as h}from"./chunk-j46f90n8.js";import"./chunk-16aeend1.js";export{e as resolveEngineVersion,d as pinBlocksUpdate,b as extractEngines,g as engineUpdateType,c as collectResolutionPins,f as bumpEngineConstraint,h as applyEngineUpdates,a as KNOWN_ENGINES};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import"./chunk-s82adeq9.js";var z={error:"error",warning:"warning",info:"notice"};function E(j){let q=[];for(let h of j.findings){let x=[`file=${h.file}`,`title=${h.ruleId}`];if(h.line!==void 0)x.push(`line=${h.line}`);let y=B(`${h.message}${h.fix?` \u2014 ${h.fix}`:""}`);q.push(`::${z[h.severity]} ${x.join(",")}::${y}`)}return q.join(`
2
+ import"./chunk-16aeend1.js";var z={error:"error",warning:"warning",info:"notice"};function E(j){let q=[];for(let h of j.findings){let x=[`file=${h.file}`,`title=${h.ruleId}`];if(h.line!==void 0)x.push(`line=${h.line}`);let y=B(`${h.message}${h.fix?` \u2014 ${h.fix}`:""}`);q.push(`::${z[h.severity]} ${x.join(",")}::${y}`)}return q.join(`
3
3
  `)}function B(j){return j.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
4
4
  `,"%0A")}export{E as formatGitHub};
@@ -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-s82adeq9.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-16aeend1.js";export{d as upsertReviewState,b as serializeReviewState,c as parseReviewState,e as needsReview,a as REVIEW_STATE_VERSION};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Hb as a,Ib as b,Jb as c,Kb as d}from"./chunk-vckhctmr.js";import"./chunk-s82adeq9.js";export{c as findDrift,a as driftFor,d as describeDrift,b as ROOT};
2
+ import{Hb as a,Ib as b,Jb as c,Kb as d}from"./chunk-vckhctmr.js";import"./chunk-16aeend1.js";export{c as findDrift,a as driftFor,d as describeDrift,b as ROOT};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ge as a,he as b}from"./chunk-142zh7e5.js";import"./chunk-s82adeq9.js";export{b as auditParsed,a as audit};
2
+ import{ge as a,he as b}from"./chunk-142zh7e5.js";import"./chunk-16aeend1.js";export{b as auditParsed,a as audit};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{We as a}from"./chunk-gvpsbmeg.js";import"./chunk-yh13j2af.js";import"./chunk-s0ps33ft.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.js";export{a as ReleaseNotesFetcher};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Cb as a,Db as b}from"./chunk-4dz5x4xw.js";import"./chunk-q2tjkhez.js";import"./chunk-5yfaptmp.js";import"./chunk-vs61069x.js";import"./chunk-wfwrm4k3.js";import"./chunk-mr2d1zp0.js";import"./chunk-142zh7e5.js";import"./chunk-743mhx0e.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-s0ps33ft.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.js";export{b as runReviewForPR,a as reviewPullRequest};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Sf as D}from"./chunk-24xvskkf.js";import{Qh as C}from"./chunk-zwtx6vn3.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{Rh as C}from"./chunk-wzncz6j5.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,3 +1,3 @@
1
1
  // @bun
2
- import{Sf as K}from"./chunk-24xvskkf.js";import{lg as D}from"./chunk-zy49dwqk.js";var F=[[0,59],[0,23],[1,31],[1,12],[0,6]];function I(j,J){let[U,B]=F[J],H=new Set;for(let Q of j.split(",")){let[X,Z]=Q.split("/"),q=Z===void 0?1:Number(Z);if(!Number.isInteger(q)||q<1)return null;let $,G;if(X==="*")$=U,G=B;else if(X.includes("-")){let[Y,_]=X.split("-").map(Number);if(!Number.isInteger(Y)||!Number.isInteger(_))return null;$=Y,G=_}else{let Y=Number(X);if(!Number.isInteger(Y))return null;$=Y,G=Y}if($<U||G>B||$>G)return null;for(let Y=$;Y<=G;Y+=q)H.add(Y)}return H.size>0?H:null}function L(j){let J=j.trim().split(/\s+/);if(J.length!==5)return null;let U=J.map((Z,q)=>I(Z,q));if(U.some((Z)=>Z===null))return null;let[,B,H,Q,X]=U;return{hours:B,daysOfMonth:H,months:Q,daysOfWeek:X}}function N(j,J){if(!J)return{hour:j.getHours(),day:j.getDate(),month:j.getMonth()+1,weekday:j.getDay()};let U=new Intl.DateTimeFormat("en-US",{timeZone:J,hour:"numeric",hour12:!1,day:"numeric",month:"numeric",weekday:"short"}),B=Object.fromEntries(U.formatToParts(j).map((Q)=>[Q.type,Q.value])),H=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return{hour:Number(B.hour)%24,day:Number(B.day),month:Number(B.month),weekday:Math.max(0,H.indexOf(B.weekday))}}function C(j,J=new Date,U){let B=L(j);if(!B)return!1;let{hour:H,day:Q,month:X,weekday:Z}=N(J,U);if(!B.hours.has(H)||!B.months.has(X))return!1;let q=B.daysOfMonth.size<31,$=B.daysOfWeek.size<7;if(q&&$)return B.daysOfMonth.has(Q)||B.daysOfWeek.has(Z);return B.daysOfMonth.has(Q)&&B.daysOfWeek.has(Z)}function W(j){if(j.dependencyType==="github-actions")return"github-actions";if(j.dependencyType==="docker-image")return"docker";if(j.dependencyType==="zig-dependencies")return"zig";if(j.dependencyType==="python"||j.dependencyType==="rust"||j.dependencyType==="go"||j.dependencyType==="ruby")return j.dependencyType;if(j.file.endsWith("composer.json")||j.file.endsWith("composer.lock"))return"composer";if(j.file.endsWith("package.json"))return"npm";return"pkgx"}function A(j,J,U=new Date){if(j.matchPackages?.length){if(!K(j.matchPackages).matches(J.name))return!1}if(j.matchEcosystems?.length&&!j.matchEcosystems.includes(W(J)))return!1;if(j.matchDepTypes?.length&&!j.matchDepTypes.includes(J.dependencyType))return!1;if(j.matchUpdateTypes?.length&&!j.matchUpdateTypes.includes(J.updateType))return!1;if(j.matchFiles?.length){if(!K(j.matchFiles).matches(J.file))return!1}if(j.matchCurrentVersion&&!E(J.currentVersion,j.matchCurrentVersion))return!1;if(j.schedule&&!C(j.schedule,U,j.scheduleTimezone))return!1;return!0}function E(j,J){let U=j.replace(/^[\^~>=<\s]+/,"").trim();return U?D(U,J):!1}function S(j,J=[],U=new Date){let B={enabled:!0,labels:[],reviewers:[],assignees:[],prPriority:0};for(let H of J){if(!A(H,j,U))continue;if(H.enabled!==void 0)B.enabled=H.enabled;if(H.strategy!==void 0)B.strategy=H.strategy;if(H.groupName!==void 0)B.groupName=H.groupName;if(H.autoMerge!==void 0)B.autoMerge=H.autoMerge;if(H.minimumReleaseAge!==void 0)B.minimumReleaseAge=H.minimumReleaseAge;if(H.prPriority!==void 0)B.prPriority=H.prPriority;if(H.autoMigrate!==void 0)B.autoMigrate=H.autoMigrate;for(let Q of H.labels??[])if(!B.labels.includes(Q))B.labels.push(Q);for(let Q of H.reviewers??[])if(!B.reviewers.includes(Q))B.reviewers.push(Q);for(let Q of H.assignees??[])if(!B.assignees.includes(Q))B.assignees.push(Q)}return B}function k(j,J=[],U=new Date){let B=[];for(let H of j){let Q=S(H,J,U);if(!Q.enabled)continue;if(Q.strategy&&!V(Q.strategy,H.updateType))continue;B.push({update:H,effects:Q})}return B}function T(j){let J=new Set,U=new Set,B=new Set,H=0;for(let Q of j)Q.labels.forEach((X)=>J.add(X)),Q.reviewers.forEach((X)=>U.add(X)),Q.assignees.forEach((X)=>B.add(X)),H=Math.max(H,Q.prPriority);return{labels:[...J],reviewers:[...U],assignees:[...B],autoMerge:j.length>0&&j.every((Q)=>Q.autoMerge===!0),prPriority:H,autoMigrate:j.some((Q)=>Q.autoMigrate===!0)}}function V(j,J){switch(j){case"all":return!0;case"major":return J==="major";case"minor":return J==="minor"||J==="patch";case"patch":return J==="patch"}}function b(j=[]){return j.map((J)=>({matchPackages:J.patterns,groupName:J.name,...J.strategy?{strategy:J.strategy}:{}}))}
2
+ import{Sf as K}from"./chunk-24xvskkf.js";import{lg as D}from"./chunk-c63e4ssc.js";var F=[[0,59],[0,23],[1,31],[1,12],[0,6]];function I(j,J){let[U,B]=F[J],H=new Set;for(let Q of j.split(",")){let[X,Z]=Q.split("/"),q=Z===void 0?1:Number(Z);if(!Number.isInteger(q)||q<1)return null;let $,G;if(X==="*")$=U,G=B;else if(X.includes("-")){let[Y,_]=X.split("-").map(Number);if(!Number.isInteger(Y)||!Number.isInteger(_))return null;$=Y,G=_}else{let Y=Number(X);if(!Number.isInteger(Y))return null;$=Y,G=Y}if($<U||G>B||$>G)return null;for(let Y=$;Y<=G;Y+=q)H.add(Y)}return H.size>0?H:null}function L(j){let J=j.trim().split(/\s+/);if(J.length!==5)return null;let U=J.map((Z,q)=>I(Z,q));if(U.some((Z)=>Z===null))return null;let[,B,H,Q,X]=U;return{hours:B,daysOfMonth:H,months:Q,daysOfWeek:X}}function N(j,J){if(!J)return{hour:j.getHours(),day:j.getDate(),month:j.getMonth()+1,weekday:j.getDay()};let U=new Intl.DateTimeFormat("en-US",{timeZone:J,hour:"numeric",hour12:!1,day:"numeric",month:"numeric",weekday:"short"}),B=Object.fromEntries(U.formatToParts(j).map((Q)=>[Q.type,Q.value])),H=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return{hour:Number(B.hour)%24,day:Number(B.day),month:Number(B.month),weekday:Math.max(0,H.indexOf(B.weekday))}}function C(j,J=new Date,U){let B=L(j);if(!B)return!1;let{hour:H,day:Q,month:X,weekday:Z}=N(J,U);if(!B.hours.has(H)||!B.months.has(X))return!1;let q=B.daysOfMonth.size<31,$=B.daysOfWeek.size<7;if(q&&$)return B.daysOfMonth.has(Q)||B.daysOfWeek.has(Z);return B.daysOfMonth.has(Q)&&B.daysOfWeek.has(Z)}function W(j){if(j.dependencyType==="github-actions")return"github-actions";if(j.dependencyType==="docker-image")return"docker";if(j.dependencyType==="zig-dependencies")return"zig";if(j.dependencyType==="python"||j.dependencyType==="rust"||j.dependencyType==="go"||j.dependencyType==="ruby")return j.dependencyType;if(j.file.endsWith("composer.json")||j.file.endsWith("composer.lock"))return"composer";if(j.file.endsWith("package.json"))return"npm";return"pkgx"}function A(j,J,U=new Date){if(j.matchPackages?.length){if(!K(j.matchPackages).matches(J.name))return!1}if(j.matchEcosystems?.length&&!j.matchEcosystems.includes(W(J)))return!1;if(j.matchDepTypes?.length&&!j.matchDepTypes.includes(J.dependencyType))return!1;if(j.matchUpdateTypes?.length&&!j.matchUpdateTypes.includes(J.updateType))return!1;if(j.matchFiles?.length){if(!K(j.matchFiles).matches(J.file))return!1}if(j.matchCurrentVersion&&!E(J.currentVersion,j.matchCurrentVersion))return!1;if(j.schedule&&!C(j.schedule,U,j.scheduleTimezone))return!1;return!0}function E(j,J){let U=j.replace(/^[\^~>=<\s]+/,"").trim();return U?D(U,J):!1}function S(j,J=[],U=new Date){let B={enabled:!0,labels:[],reviewers:[],assignees:[],prPriority:0};for(let H of J){if(!A(H,j,U))continue;if(H.enabled!==void 0)B.enabled=H.enabled;if(H.strategy!==void 0)B.strategy=H.strategy;if(H.groupName!==void 0)B.groupName=H.groupName;if(H.autoMerge!==void 0)B.autoMerge=H.autoMerge;if(H.minimumReleaseAge!==void 0)B.minimumReleaseAge=H.minimumReleaseAge;if(H.prPriority!==void 0)B.prPriority=H.prPriority;if(H.autoMigrate!==void 0)B.autoMigrate=H.autoMigrate;for(let Q of H.labels??[])if(!B.labels.includes(Q))B.labels.push(Q);for(let Q of H.reviewers??[])if(!B.reviewers.includes(Q))B.reviewers.push(Q);for(let Q of H.assignees??[])if(!B.assignees.includes(Q))B.assignees.push(Q)}return B}function k(j,J=[],U=new Date){let B=[];for(let H of j){let Q=S(H,J,U);if(!Q.enabled)continue;if(Q.strategy&&!V(Q.strategy,H.updateType))continue;B.push({update:H,effects:Q})}return B}function T(j){let J=new Set,U=new Set,B=new Set,H=0;for(let Q of j)Q.labels.forEach((X)=>J.add(X)),Q.reviewers.forEach((X)=>U.add(X)),Q.assignees.forEach((X)=>B.add(X)),H=Math.max(H,Q.prPriority);return{labels:[...J],reviewers:[...U],assignees:[...B],autoMerge:j.length>0&&j.every((Q)=>Q.autoMerge===!0),prPriority:H,autoMigrate:j.some((Q)=>Q.autoMigrate===!0)}}function V(j,J){switch(j){case"all":return!0;case"major":return J==="major";case"minor":return J==="minor"||J==="patch";case"patch":return J==="patch"}}function b(j=[]){return j.map((J)=>({matchPackages:J.patterns,groupName:J.name,...J.strategy?{strategy:J.strategy}:{}}))}
3
3
  export{W as sf,A as tf,S as uf,k as vf,T as wf,V as xf,b as yf};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Eb as a,Fb as b,Gb as c}from"./chunk-q2tjkhez.js";import"./chunk-s82adeq9.js";export{b as renderDiffForReview,a as parseUnifiedDiff,c as collectGitDiff};
2
+ import{Eb as a,Fb as b,Gb as c}from"./chunk-q2tjkhez.js";import"./chunk-16aeend1.js";export{b as renderDiffForReview,a as parseUnifiedDiff,c as collectGitDiff};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Vf as K,Xf as T,Yf as S,Zf as F}from"./chunk-z18bksyr.js";import{Kh as N}from"./chunk-34vracy4.js";import{Qh as C}from"./chunk-zwtx6vn3.js";import{fl as _}from"./chunk-s82adeq9.js";var x={claude:"claude-opus-5","claude-opus":"claude-opus-5",opus:"claude-opus-5","claude-sonnet":"claude-sonnet-5",sonnet:"claude-sonnet-5","claude-haiku":"claude-haiku-4-5",haiku:"claude-haiku-4-5","claude-fable":"claude-fable-5",fable:"claude-fable-5"},L={anthropic:"claude-opus-5"},w={anthropic:["ANTHROPIC_API_KEY"],openai:["OPENAI_API_KEY"],google:["GOOGLE_API_KEY","GEMINI_API_KEY"],openrouter:["OPENROUTER_API_KEY"],"openai-compatible":["OPENAI_COMPATIBLE_API_KEY","OPENAI_API_KEY"]},D=["anthropic","openai","google","openrouter"];function M(j){return x[j.toLowerCase().trim()]??j}var b=16000;function k(j){let Z;async function $(){if(Z)return Z;let H;try{H=(await import("./chunk-zrec546r.js")).default}catch{throw new F(`The Anthropic provider needs @anthropic-ai/sdk, which is an optional peer dependency.
2
+ import{Vf as K,Xf as T,Yf as S,Zf as F}from"./chunk-z18bksyr.js";import{Lh as N}from"./chunk-s0ps33ft.js";import{Rh as C}from"./chunk-wzncz6j5.js";import{gl as _}from"./chunk-16aeend1.js";var x={claude:"claude-opus-5","claude-opus":"claude-opus-5",opus:"claude-opus-5","claude-sonnet":"claude-sonnet-5",sonnet:"claude-sonnet-5","claude-haiku":"claude-haiku-4-5",haiku:"claude-haiku-4-5","claude-fable":"claude-fable-5",fable:"claude-fable-5"},L={anthropic:"claude-opus-5"},w={anthropic:["ANTHROPIC_API_KEY"],openai:["OPENAI_API_KEY"],google:["GOOGLE_API_KEY","GEMINI_API_KEY"],openrouter:["OPENROUTER_API_KEY"],"openai-compatible":["OPENAI_COMPATIBLE_API_KEY","OPENAI_API_KEY"]},D=["anthropic","openai","google","openrouter"];function M(j){return x[j.toLowerCase().trim()]??j}var b=16000;function k(j){let Z;async function $(){if(Z)return Z;let H;try{H=(await import("./chunk-sddaassq.js")).default}catch{throw new F(`The Anthropic provider needs @anthropic-ai/sdk, which is an optional peer dependency.
3
3
  Install it with: bun add @anthropic-ai/sdk`,"anthropic")}return Z=new H({apiKey:j.apiKey,...j.baseUrl?{baseURL:j.baseUrl}:{}}),Z}return{name:"anthropic",async complete(H,G){let W={};if(H.effort)W.effort=H.effort;if(H.jsonSchema)W.format={type:"json_schema",schema:H.jsonSchema};let z=await(await $()).messages.create({model:G,max_tokens:H.maxTokens??b,...H.system?{system:H.system}:{},messages:H.messages.map((Q)=>({role:Q.role,content:Q.content})),...H.tools?.length?{tools:H.tools.map((Q)=>({name:Q.name,description:Q.description,input_schema:Q.parameters}))}:{},...Object.keys(W).length>0?{output_config:W}:{}}),X="",J=[];for(let Q of z.content)if(Q.type==="text")X+=Q.text;else if(Q.type==="tool_use")J.push({id:Q.id,name:Q.name,input:Q.input});return{text:X,toolCalls:J,json:y(X,H.jsonSchema!==void 0),stopReason:P(z.stop_reason),usage:{inputTokens:z.usage.input_tokens,outputTokens:z.usage.output_tokens,...z.usage.cache_read_input_tokens!=null?{cachedInputTokens:z.usage.cache_read_input_tokens}:{}},model:z.model}}}}function P(j){switch(j){case"end_turn":case"stop_sequence":return"end";case"tool_use":return"tool_use";case"max_tokens":return"max_tokens";case"refusal":return"refusal";default:return"other"}}function y(j,Z){if(!Z)return;try{return JSON.parse(j)}catch{throw new F("Model returned malformed JSON for a schema-constrained request","anthropic")}}var f=16000,A="https://generativelanguage.googleapis.com/v1beta";function U(j){let Z=(j.baseUrl??A).replace(/\/+$/,"");return{name:"google",async complete($,H){let G={contents:$.messages.map((Y)=>({role:Y.role==="assistant"?"model":"user",parts:[{text:Y.content}]})),generationConfig:{maxOutputTokens:$.maxTokens??f,...$.jsonSchema?{responseMimeType:"application/json",responseSchema:$.jsonSchema}:{}}};if($.system)G.systemInstruction={parts:[{text:$.system}]};if($.tools?.length)G.tools=[{functionDeclarations:$.tools.map((Y)=>({name:Y.name,description:Y.description,parameters:Y.parameters}))}];let W=await N(`${Z}/models/${encodeURIComponent(H)}:generateContent`,{method:"POST",headers:{"x-goog-api-key":j.apiKey,"Content-Type":"application/json"},body:JSON.stringify(G)});if(!W.ok){let Y=await W.text().catch(()=>"");throw new F(`google request failed: ${W.status} ${W.statusText} ${K(Y.slice(0,500))}`.trim(),"google",W.status)}let z=await W.json(),X=z.candidates?.[0],J="",Q=[];for(let[Y,V]of(X?.content?.parts??[]).entries()){if(V.text)J+=V.text;if(V.functionCall?.name)Q.push({id:`${V.functionCall.name}-${Y}`,name:V.functionCall.name,input:V.functionCall.args??{}})}return{text:J,toolCalls:Q,json:$.jsonSchema?h(J):void 0,stopReason:E(X?.finishReason,Q.length>0),usage:{inputTokens:z.usageMetadata?.promptTokenCount??0,outputTokens:z.usageMetadata?.candidatesTokenCount??0,...z.usageMetadata?.cachedContentTokenCount!=null?{cachedInputTokens:z.usageMetadata.cachedContentTokenCount}:{}},model:z.modelVersion??H}}}}function E(j,Z){if(Z)return"tool_use";switch(j){case"STOP":return"end";case"MAX_TOKENS":return"max_tokens";case"SAFETY":case"PROHIBITED_CONTENT":case"BLOCKLIST":return"refusal";default:return"other"}}function h(j){try{return JSON.parse(j)}catch{throw new F("Model returned malformed JSON for a schema-constrained request","google")}}var g=16000,v="https://api.openai.com/v1",m="https://openrouter.ai/api/v1";function O(j){let Z=j.provider??"openai",$=(j.baseUrl??q(Z)).replace(/\/+$/,"");return{name:Z,async complete(H,G){let W=[];if(H.system)W.push({role:"system",content:H.system});for(let B of H.messages)W.push({role:B.role,content:B.content});let z={model:G,messages:W,max_completion_tokens:H.maxTokens??g};if(H.tools?.length)z.tools=H.tools.map((B)=>({type:"function",function:{name:B.name,description:B.description,parameters:B.parameters}}));if(H.jsonSchema)z.response_format={type:"json_schema",json_schema:{name:"response",schema:H.jsonSchema,strict:!0}};if(H.effort)z.reasoning_effort=H.effort;let X={Authorization:`Bearer ${j.apiKey}`,"Content-Type":"application/json"};if(Z==="openrouter")X["HTTP-Referer"]="https://github.com/stacksjs/buddy",X["X-Title"]="buddy";let J=await N(`${$}/chat/completions`,{method:"POST",headers:X,body:JSON.stringify(z)});if(!J.ok){let B=await J.text().catch(()=>"");throw new F(`${Z} request failed: ${J.status} ${J.statusText} ${K(B.slice(0,500))}`.trim(),Z,J.status)}let Q=await J.json(),Y=Q.choices?.[0],V=Y?.message?.content??"",I=(Y?.message?.tool_calls??[]).map((B)=>({id:B.id,name:B.function?.name??"",input:p(B.function?.arguments,Z)}));return{text:V,toolCalls:I,json:H.jsonSchema?d(V,Z):void 0,stopReason:c(Y?.finish_reason,I.length>0),usage:{inputTokens:Q.usage?.prompt_tokens??0,outputTokens:Q.usage?.completion_tokens??0,...Q.usage?.prompt_tokens_details?.cached_tokens!=null?{cachedInputTokens:Q.usage.prompt_tokens_details.cached_tokens}:{}},model:Q.model??G}}}}function q(j){return j==="openrouter"?m:v}function c(j,Z){if(Z||j==="tool_calls")return"tool_use";switch(j){case"stop":return"end";case"length":return"max_tokens";case"content_filter":return"refusal";default:return"other"}}function p(j,Z){if(!j)return{};try{return JSON.parse(j)}catch{throw new F("Model returned malformed JSON tool arguments",Z)}}function d(j,Z){try{return JSON.parse(j)}catch{throw new F("Model returned malformed JSON for a schema-constrained request",Z)}}import R from"process";function u(j,Z=R.env){let $=j.ai;if($?.enabled===!1)return null;let H=$?.provider?[$.provider]:D;for(let G of H){let W=i(G,$?.apiKeyEnv,Z);if(!W)continue;let{key:z,source:X}=W,J=a(G,$?.model);if(!J)continue;return{provider:G,model:J,apiKey:z,apiKeyEnv:X,...$?.baseUrl?{baseUrl:$.baseUrl}:{}}}return null}function Vj(j,Z=C()){let $=u(j);if(!$)return Z.debug("AI disabled: no provider configured with an available API key"),null;let H=n($),G=j.ai?.maxTokensPerRun,W=j.ai?.effort,z=0;return{provider:$.provider,model:$.model,get tokensUsed(){return z},async complete(X){if(G!==void 0&&z>=G)throw new S(z,G);let J=X.model?M(X.model):$.model;try{let Q=await H.complete({...X,effort:X.effort??W},J);return z+=Q.usage.outputTokens,Z.debug(`AI ${$.provider}/${Q.model}: ${Q.usage.inputTokens} in, ${Q.usage.outputTokens} out (${Q.stopReason})`),Q}catch(Q){if(Q instanceof S)throw Q;let Y=T(Q);throw Z.warn(`\u26A0\uFE0F AI request failed (${$.provider}): ${Y}`),Q instanceof F?Q:new F(Y,$.provider)}}}}function n(j){switch(j.provider){case"anthropic":return k({apiKey:j.apiKey,baseUrl:j.baseUrl});case"google":return U({apiKey:j.apiKey,baseUrl:j.baseUrl});case"openai":case"openrouter":case"openai-compatible":return O({apiKey:j.apiKey,baseUrl:j.baseUrl,provider:j.provider})}}function i(j,Z,$){let H=Z?[Z,...w[j]]:w[j];for(let G of H){let W=$[G];if(W&&W.trim().length>0)return{key:W.trim(),source:G}}return}function a(j,Z){let $=R.env.BUDDY_MODEL||Z;if($)return M($);return L[j]}
4
4
  export{x as Zb,w as _b,D as $b,M as ac,k as bc,U as cc,O as dc,u as ec,Vj as fc};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Qh as z}from"./chunk-zwtx6vn3.js";function Y(q,F,M=""){if(typeof F!=="object"||F===null)return[];let C=F,Q=M||"(root)",N=[];if(typeof C.type==="string"){let K=D(q);if(!(C.type==="integer"?Number.isInteger(q):K===C.type||C.type==="number"&&K==="integer"))return N.push({path:Q,message:`expected ${C.type}, got ${K}`}),N}if(Array.isArray(C.enum)&&!C.enum.includes(q))N.push({path:Q,message:`expected one of ${C.enum.map((K)=>JSON.stringify(K)).join(", ")}`});if(Array.isArray(C.required)&&typeof q==="object"&&q!==null){for(let K of C.required)if(!(String(K)in q))N.push({path:M?`${M}.${K}`:String(K),message:"is required but missing"})}if(typeof C.properties==="object"&&C.properties!==null&&typeof q==="object"&&q!==null)for(let[K,V]of Object.entries(C.properties)){let X=q[K];if(X!==void 0)N.push(...Y(X,V,M?`${M}.${K}`:K))}if(C.items!==void 0&&Array.isArray(q))q.forEach((K,V)=>{N.push(...Y(K,C.items,`${M}[${V}]`))});return N}function D(q){if(q===null)return"null";if(Array.isArray(q))return"array";if(Number.isInteger(q))return"integer";return typeof q}async function B(q){let F=q.logger??z(),M=q.maxRetries??2,C=q.system??"You are running as a pipeline step. Answer the request directly and completely. There is no interactive user to ask follow-up questions of.",Q="";for(let N=1;N<=M+1;N++){let K=N===1?q.prompt:`${q.prompt}
2
+ import{Rh as z}from"./chunk-wzncz6j5.js";function Y(q,F,M=""){if(typeof F!=="object"||F===null)return[];let C=F,Q=M||"(root)",N=[];if(typeof C.type==="string"){let K=D(q);if(!(C.type==="integer"?Number.isInteger(q):K===C.type||C.type==="number"&&K==="integer"))return N.push({path:Q,message:`expected ${C.type}, got ${K}`}),N}if(Array.isArray(C.enum)&&!C.enum.includes(q))N.push({path:Q,message:`expected one of ${C.enum.map((K)=>JSON.stringify(K)).join(", ")}`});if(Array.isArray(C.required)&&typeof q==="object"&&q!==null){for(let K of C.required)if(!(String(K)in q))N.push({path:M?`${M}.${K}`:String(K),message:"is required but missing"})}if(typeof C.properties==="object"&&C.properties!==null&&typeof q==="object"&&q!==null)for(let[K,V]of Object.entries(C.properties)){let X=q[K];if(X!==void 0)N.push(...Y(X,V,M?`${M}.${K}`:K))}if(C.items!==void 0&&Array.isArray(q))q.forEach((K,V)=>{N.push(...Y(K,C.items,`${M}[${V}]`))});return N}function D(q){if(q===null)return"null";if(Array.isArray(q))return"array";if(Number.isInteger(q))return"integer";return typeof q}async function B(q){let F=q.logger??z(),M=q.maxRetries??2,C=q.system??"You are running as a pipeline step. Answer the request directly and completely. There is no interactive user to ask follow-up questions of.",Q="";for(let N=1;N<=M+1;N++){let K=N===1?q.prompt:`${q.prompt}
3
3
 
4
4
  Your previous answer did not satisfy the required schema:
5
5
  ${Q}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{yh as W}from"./chunk-7t8s2mcf.js";import{Kh as y}from"./chunk-34vracy4.js";import{Qh as J}from"./chunk-zwtx6vn3.js";import{fl as F}from"./chunk-s82adeq9.js";import S from"process";function G(E){let q=E.replace(/\\/g,"/");return q.includes(".github/workflows/")&&(q.endsWith(".yml")||q.endsWith(".yaml"))}async function L(E,q){try{if(!G(E))return null;let I=[],j=q.split(`
2
+ import{zh as W}from"./chunk-yh13j2af.js";import{Lh as y}from"./chunk-s0ps33ft.js";import{Rh as J}from"./chunk-wzncz6j5.js";import{gl as F}from"./chunk-16aeend1.js";import S from"process";function G(E){let q=E.replace(/\\/g,"/");return q.includes(".github/workflows/")&&(q.endsWith(".yml")||q.endsWith(".yaml"))}async function L(E,q){try{if(!G(E))return null;let I=[],j=q.split(`
3
3
  `);for(let K=0;K<j.length;K++){let Q=j[K].trim().match(/^-?\s*uses:\s*(.+)/);if(Q){let $=Q[1].trim().replace(/['"`]/g,"");if($.startsWith("./")||$.startsWith("docker://"))continue;let X=$.split("@");if(X.length===2){let[_,Y]=X;if(!_||!_.trim())continue;let[z,...k]=Y.split("#"),M=z.trim(),V={name:_.trim(),currentVersion:M,type:"github-actions",file:E};if(v(M)){let x=k.join("#").trim().split(/\s+/)[0];V.metadata=x?{pinnedSha:M,pinnedVersion:x}:{pinnedSha:M}}if(!I.find((x)=>x.name===V.name&&x.currentVersion===V.currentVersion))I.push(V)}}}return{path:E,type:"github-actions",content:q,dependencies:I}}catch(I){return J().warn(`Failed to parse GitHub Actions file ${E}:`,I),null}}function v(E){return/^[0-9a-f]{40}$/i.test(E)}function R(E,q){return E.replace(/^v/i,"")===q.replace(/^v/i,"")}async function U(E,q,I){try{if(!G(E))return q;let j=q;for(let K of I){let O=K.name.replace(/\s*\(.*\)$/,""),Z=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(K.resolved?.sha){let $=new RegExp(`((?:^\\s*-\\s*)?uses:\\s*["']?)(${Z})@(${K.currentVersion})(["']?)([ \\t]*#[^\\n]*)?`,"gm");j=j.replace($,`$1$2@${K.resolved.sha}$4 # ${K.newVersion}`);continue}let Q=new RegExp(`((?:^\\s*-\\s*)?uses:\\s*["']?)(${O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})@(${K.currentVersion.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})(["']?)`,"gm");j=j.replace(Q,`$1$2@${K.newVersion}$4`)}return j}catch(j){return J().warn(`Failed to update GitHub Actions file ${E}:`,j),q}}async function D(E){let q=[],I=new Map;for(let j of E)if(G(j.file)){if(!I.has(j.file))I.set(j.file,[]);I.get(j.file).push(j)}for(let[j,K]of I)try{let O=await import("fs");if(O.existsSync(j)){let Z=O.readFileSync(j,"utf-8"),Q=await U(j,Z,K);q.push({path:j,content:Q,type:"update"})}}catch(O){J().warn(`Failed to generate updates for GitHub Actions file ${j}:`,O)}return q}async function b(E,q){let[I,j]=E.split("/");if(!I||!j)return null;let K={Accept:"application/vnd.github.v3+json","User-Agent":"buddy"},O=S.env.BUDDY_TOKEN||S.env.GITHUB_TOKEN||S.env.GH_TOKEN;if(O)K.Authorization=`Bearer ${O}`;try{let Z=await y(`${W()}/repos/${I}/${j}/commits/${encodeURIComponent(q)}`,{headers:K});if(!Z.ok)return null;let Q=await Z.json();return Q.sha&&v(Q.sha)?Q.sha:null}catch{return null}}async function P(E){try{if(!E.includes("/"))return J().info(`\u26A0\uFE0F Invalid action name format: ${E}`),null;let[q,I]=E.split("/");J().info(`\uD83D\uDD0D Fetching latest version for ${q}/${I}`);let j={Accept:"application/vnd.github.v3+json","User-Agent":"buddy"},K=S.env.BUDDY_TOKEN||S.env.GITHUB_TOKEN||S.env.GH_TOKEN;if(K)j.Authorization=`Bearer ${K}`;let O=W();J().info(`\uD83D\uDCE1 Trying latest release for ${q}/${I}`);let Z=await y(`${O}/repos/${q}/${I}/releases/latest`,{headers:j});if(Z.ok){let X=await Z.json();if(X.tag_name)return J().info(`\u2705 Found latest release: ${X.tag_name}`),X.tag_name}else J().info(`\u26A0\uFE0F Latest release not found: ${Z.status} ${Z.statusText}`);J().info(`\uD83D\uDCE1 Trying all releases for ${q}/${I}`);let Q=await y(`${O}/repos/${q}/${I}/releases?per_page=10`,{headers:j});if(Q.ok){let X=await Q.json();if(!Array.isArray(X))J().info("\u26A0\uFE0F Unexpected releases response format (expected array)");else{J().info(`\uD83D\uDCCB Found ${X.length} releases`);let _=X.filter((Y)=>Y.tag_name&&!Y.tag_name.includes("-")).sort((Y,z)=>{let k=Y.published_at?new Date(Y.published_at).getTime():0;return(z.published_at?new Date(z.published_at).getTime():0)-k});if(_.length>0)return J().info(`\u2705 Found latest stable release: ${_[0].tag_name}`),_[0].tag_name||null}}else J().info(`\u26A0\uFE0F Releases not found: ${Q.status} ${Q.statusText}`);J().info(`\uD83D\uDCE1 Trying tags for ${q}/${I}`);let $=await y(`${O}/repos/${q}/${I}/tags?per_page=10`,{headers:j});if($.ok){let X=await $.json();if(!Array.isArray(X))J().info("\u26A0\uFE0F Unexpected tags response format (expected array)");else{J().info(`\uD83D\uDCCB Found ${X.length} tags`);let _=X.filter((Y)=>Y.name&&!Y.name.includes("-")).map((Y)=>Y.name).sort((Y,z)=>{let k=Y.replace(/^v/,""),M=z.replace(/^v/,""),V=k.split(".").map(Number),B=M.split(".").map(Number);for(let x=0;x<Math.max(V.length,B.length);x++){let H=V[x]||0,T=B[x]||0;if(H!==T)return T-H}return 0});if(_.length>0)return J().info(`\u2705 Found latest stable tag: ${_[0]}`),_[0]}}else J().info(`\u26A0\uFE0F Tags not found: ${$.status} ${$.statusText}`);return J().info(`\u274C No version found for ${E}`),null}catch(q){return J().warn(`Failed to fetch latest version for ${E}:`,q),null}}
4
4
  export{G as xe,L as ye,v as ze,R as Ae,U as Be,D as Ce,b as De,P as Ee};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Sh as s,Th as o,Uh as p,Vh as a}from"./chunk-m3rftash.js";import"./chunk-16aeend1.js";a();export{o as pantry,p as packages,s as aliases};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  class I extends Error{status;method;url;repository;responseBody;constructor(j,k,q,P,Q,S){super(j);this.status=k;this.method=q;this.url=P;this.repository=Q;this.responseBody=S;this.name="GitHubApiError"}get isNotFound(){return this.status===404||this.status===410}get isForbidden(){return this.status===403}}function G(j,k=2000){let q=J(j);return q.length>k?`${q.slice(0,k)}\u2026 (truncated)`:q}function J(j){if(j instanceof Error){let k=j.cause;if(k!==void 0&&k!==null){let q=k instanceof Error?k.message:String(k);if(q&&!j.message.includes(q))return`${j.message} (cause: ${q})`}return j.message}if(typeof j==="string")return j;try{return JSON.stringify(j)}catch{return String(j)}}import K from"process";var C={silent:0,error:1,warn:2,info:3,debug:4};function B(j){return j.map((k)=>k instanceof Error?G(k):k)}function N(){let j=K.env.BUDDY_LOG_LEVEL?.toLowerCase();return j&&j in C?j:void 0}class z{level;constructor(j=!1,k){this.level=k??N()??(j?"debug":"info")}enabled(j){return C[this.level]>=C[j]}info(j,...k){if(this.enabled("info"))console.log(j,...B(k))}warn(j,...k){if(this.enabled("warn"))console.warn(j,...B(k))}error(j,...k){if(this.enabled("error"))console.error(j,...B(k))}debug(j,...k){if(this.enabled("debug"))console.log(`\x1B[90m\uD83D\uDC1B\x1B[0m ${j}`,...B(k))}success(j,...k){if(this.enabled("info"))console.log(`\x1B[32m\u2713\x1B[0m ${j}`,...B(k))}get logLevel(){return this.level}static verbose(){return new z(!0,"debug")}static quiet(){return new z(!1,"info")}static silent(){return new z(!1,"silent")}static withLevel(j){return new z(!1,j)}}var H=new z(!1);function Y(j){H=j}function Z(){return H}
3
- export{I as Mh,G as Nh,z as Oh,Y as Ph,Z as Qh};
3
+ export{I as Nh,G as Oh,z as Ph,Y as Qh,Z as Rh};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Va as t,Wa as u}from"./chunk-p16pnhj3.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-k907b533.js";import"./chunk-sn0qr6q7.js";import"./chunk-5sh69bkj.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-4kyxrwxn.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.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-her5azyp.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-gg1ddvnf.js";import"./chunk-vs61069x.js";import"./chunk-wfwrm4k3.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-hk4d7rky.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-s0ps33ft.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.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};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{mb as w}from"./chunk-v808b36p.js";import{Ab as u,Bb as v,Cb as x,Db as y,nb as d,ob as e,pb as f,qb as g,rb as h,sb as i,tb as j,ub as k,vb as l,wb as q,xb as r,yb as s,zb as t}from"./chunk-7b156stw.js";import{Eb as a,Fb as b,Gb as c}from"./chunk-q2tjkhez.js";import{Lb as m,Mb as n,Nb as o,Pb as p}from"./chunk-5yfaptmp.js";import"./chunk-sn0qr6q7.js";import"./chunk-5sh69bkj.js";import{Ed as z,Fd as A,Gd as B,Hd as C,Id as D,Jd as E,Kd as F,Ld as G,Md as H,Nd as I}from"./chunk-7m3pzkcj.js";import"./chunk-2b07w74s.js";import"./chunk-142zh7e5.js";import"./chunk-y1d6e0ye.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{g as validateFindings,I as shouldFail,n as serializeReviewState,y as runReviewForPR,x as reviewPullRequest,j as reviewDiff,w as resolveBuddyThreads,u as renderFinding,b as renderDiffForReview,v as prepareReview,a as parseUnifiedDiff,o as parseReviewState,p as needsReview,s as loadGuidelines,G as formatReview,C as formatPretty,D as formatGithub,E as formatAgent,f as fingerprint,A as diffArgsFor,l as defaultIncludePath,h as dedupeFindings,F as countBySeverity,t as composeInstructions,B as collectLocalDiff,c as collectGitDiff,H as applySuggestion,k as anchorMap,d as SEVERITY_ORDER,m as REVIEW_STATE_VERSION,e as REVIEW_SCHEMA,z as REVIEW_FORMATS,r as MAX_GUIDELINE_CHARS,q as DEFAULT_GUIDELINE_FILES,i as DEFAULT_EXCLUDED_PATHS};
2
+ import{mb as w}from"./chunk-byqzhgzs.js";import{Ab as u,Bb as v,Cb as x,Db as y,nb as d,ob as e,pb as f,qb as g,rb as h,sb as i,tb as j,ub as k,vb as l,wb as q,xb as r,yb as s,zb as t}from"./chunk-4dz5x4xw.js";import{Eb as a,Fb as b,Gb as c}from"./chunk-q2tjkhez.js";import{Lb as m,Mb as n,Nb as o,Pb as p}from"./chunk-5yfaptmp.js";import"./chunk-vs61069x.js";import"./chunk-wfwrm4k3.js";import{Ed as z,Fd as A,Gd as B,Hd as C,Id as D,Jd as E,Kd as F,Ld as G,Md as H,Nd as I}from"./chunk-7m3pzkcj.js";import"./chunk-mr2d1zp0.js";import"./chunk-142zh7e5.js";import"./chunk-743mhx0e.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-s0ps33ft.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.js";export{g as validateFindings,I as shouldFail,n as serializeReviewState,y as runReviewForPR,x as reviewPullRequest,j as reviewDiff,w as resolveBuddyThreads,u as renderFinding,b as renderDiffForReview,v as prepareReview,a as parseUnifiedDiff,o as parseReviewState,p as needsReview,s as loadGuidelines,G as formatReview,C as formatPretty,D as formatGithub,E as formatAgent,f as fingerprint,A as diffArgsFor,l as defaultIncludePath,h as dedupeFindings,F as countBySeverity,t as composeInstructions,B as collectLocalDiff,c as collectGitDiff,H as applySuggestion,k as anchorMap,d as SEVERITY_ORDER,m as REVIEW_STATE_VERSION,e as REVIEW_SCHEMA,z as REVIEW_FORMATS,r as MAX_GUIDELINE_CHARS,q as DEFAULT_GUIDELINE_FILES,i as DEFAULT_EXCLUDED_PATHS};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  import z from"fs";import F from"os";import Y from"path";import K from"process";var G="https://api.github.com",P="https://github.com",S="https://registry.npmjs.org",A="https://packagist.org";function $(j){return j.trim().replace(/\/+$/,"")}function b(...j){for(let q of j)if(q&&q.trim())return q;return}function y(j){return $(b(j?.repository?.apiUrl,K.env.GITHUB_API_URL,G))}function L(j){return $(b(j?.repository?.serverUrl,K.env.GITHUB_SERVER_URL,P))}function C(){return K.env.HOME||K.env.USERPROFILE||F.homedir()}var H=new Map;function D(j){let q=H.get(j);if(q)return q;let J={scoped:new Map},Q=[Y.join(C(),".npmrc"),Y.join(j,".npmrc")];for(let X of Q){let M;try{M=z.readFileSync(X,"utf-8")}catch{continue}for(let O of M.split(`
3
3
  `)){let W=O.trim();if(!W||W.startsWith("#")||W.startsWith(";"))continue;let x=W.indexOf("=");if(x===-1)continue;let Z=W.slice(0,x).trim(),V=I(W.slice(x+1).trim());if(!V)continue;if(Z==="registry")J.default=V;else if(Z.endsWith(":registry")&&Z.startsWith("@"))J.scoped.set(Z.slice(0,-9),V)}}return H.set(j,J),J}function I(j){return j.replace(/\$\{([^}]+)\}/g,(q,J)=>K.env[J]??"")}function w(){H.clear()}function N(j,q,J=K.cwd()){let Q=j?.startsWith("@")?j.split("/")[0]:void 0,X=D(J);return $(b(Q?q?.registries?.npmScopes?.[Q]:void 0,q?.registries?.npm,K.env.NPM_CONFIG_REGISTRY,Q?X.scoped.get(Q):void 0,X.default,S))}function U(j){return $(b(j?.registries?.composer,K.env.COMPOSER_REGISTRY_URL,A))}
4
- export{y as yh,L as zh,w as Ah,N as Bh,U as Ch};
4
+ export{y as zh,L as Ah,w as Bh,N as Ch,U as Dh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ea as a,Fa as b,Ga as c,Ha as d,Ia as e,Ja as f,Ka as g}from"./chunk-9chq5m4p.js";import"./chunk-s3b3vrsj.js";import"./chunk-6gvx1g6h.js";import"./chunk-743mhx0e.js";import"./chunk-1pecmenc.js";import"./chunk-hk4d7rky.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-s0ps33ft.js";import"./chunk-wzncz6j5.js";import"./chunk-16aeend1.js";export{g as runFixCi,e as latestFailurePerWorkflow,d as failsOnBaseBranch,b as extractErrorLines,c as describeFailure,a as classifyFailure,f as attemptFix};
package/dist/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{I as wo,J as So,K as ho,L as uo,M as co,N as Vo,O as eo,P as go,Q as ro,R as vo,S as io,T as so,U as no}from"../chunk-6np84pfr.js";import{W as ko,X as qo}from"../chunk-zjp519wm.js";import{$ as Wo,Y as Jo,Z as Ko,_ as Qo}from"../chunk-3nn2j810.js";import{aa as PR,ba as aR,ca as lR,da as yR,ea as CR,fa as NR,ga as _R,ha as zR,ia as DR,ja as TR}from"../chunk-69qyr9ef.js";import{ka as pR,la as oR,ma as mR,na as xR,oa as fR,pa as dR,qa as RR,ra as MR,sa as UR,ta as AR,ua as GR,va as ER,wa as OR}from"../chunk-bgw39afd.js";import{Aa as $o,Ba as bo,Ca as to,xa as Xo,ya as Yo,za as Zo}from"../chunk-qcvtp2mt.js";import"../chunk-rb1fh9vd.js";import{Da as pm}from"../chunk-y83rsv1a.js";import{Ea as ed,Fa as gd,Ga as rd,Ha as vd,Ia as id,Ja as sd,Ka as nd}from"../chunk-s5czyzje.js";import{La as Zd,Ma as $d,Na as bd,Oa as td,Pa as wd,Qa as Sd,Ra as hd,Sa as ud,Ta as cd,Ua as Vd}from"../chunk-2z85fqdp.js";import{Va as Yf,Wa as Zf}from"../chunk-p16pnhj3.js";import{$a as Sf,Xa as $f,Ya as bf,Za as tf,_a as wf,ab as hf,bb as uf,cb as cf,db as Vf,eb as ef,fb as gf,gb as rf}from"../chunk-jqh7vx2n.js";import{hb as vf,ib as sf,jb as nf,kb as pd,lb as od}from"../chunk-k907b533.js";import{mb as Id}from"../chunk-v808b36p.js";import{Ab as Td,Bb as jd,Cb as Ld,Db as Bd,nb as dd,ob as Rd,pb as Md,qb as Ud,rb as Ad,sb as Gd,tb as Ed,ub as Od,vb as Pd,wb as Nd,xb as _d,yb as zd,zb as Dd}from"../chunk-7b156stw.js";import{Eb as md,Fb as xd,Gb as fd}from"../chunk-q2tjkhez.js";import{Hb as Co,Ib as No,Jb as _o,Kb as zo}from"../chunk-vckhctmr.js";import{Lb as ad,Mb as ld,Nb as yd,Pb as Cd}from"../chunk-5yfaptmp.js";import{Qb as Rf,Rb as Mf,Sb as Uf,Tb as Af,Ub as Gf,Vb as Ef,Wb as Of,Xb as Pf,Yb as af}from"../chunk-sn0qr6q7.js";import{$b as nx,Zb as ix,_b as sx,ac as pf,bc as of,cc as mf,dc as xf,ec as ff,fc as df}from"../chunk-5sh69bkj.js";import{gc as Vp,hc as ep,ic as gp,jc as rp,mc as vp,nc as ip}from"../chunk-sztjfky1.js";import{Ac as Uo,Bc as Ao,Cc as Go,Dc as Eo,Ec as Oo,Fc as Po,Gc as ao,Hc as lo,Ic as yo,pc as sp,sc as np,tc as po,uc as oo,vc as mo,wc as xo,xc as fo,yc as Ro,zc as Mo}from"../chunk-w2ccdet4.js";import{Mc as dp}from"../chunk-nn5rzwty.js";import{Nc as mp,Oc as xp,Pc as fp}from"../chunk-9n1kth4b.js";import{Uc as mm,Vc as xm,Wc as fm,Xc as dm}from"../chunk-8wvc5grf.js";import{Yc as Bo,Zc as Fo,_c as Ho}from"../chunk-01d81hn0.js";import{$c as Sp,ad as hp,bd as up,cd as cp,ed as Do}from"../chunk-cneecnvd.js";import"../chunk-c9266b5x.js";import{gd as _p,hd as zp,id as Dp,jd as Tp,kd as jp}from"../chunk-x9qhsyp6.js";import{ld as wp}from"../chunk-xyzcgskb.js";import"../chunk-bnp0r4eh.js";import{nd as ex,od as gx,pd as rx,qd as vx}from"../chunk-0f1xye20.js";import{td as Np}from"../chunk-66nntsnf.js";import{ud as Xf}from"../chunk-qjzpzd7j.js";import{Ad as hx,Bd as ux,Cd as cx,Dd as Vx,vd as $x,wd as bx,xd as tx,yd as wx,zd as Sx}from"../chunk-ebnc6980.js";import{Ed as Fd,Fd as Hd,Gd as kd,Hd as qd,Id as Jd,Jd as Kd,Kd as Qd,Ld as Wd,Md as Xd,Nd as Yd}from"../chunk-7m3pzkcj.js";import{$d as Hf,Od as lf,Pd as yf,Qd as Cf,Rd as Nf,Sd as _f,Td as zf,Ud as Df,Vd as Tf,Wd as jf,Xd as If,Yd as Lf,Zd as Bf,_d as Ff,ae as kf,be as qf,ce as Jf,de as Kf,ee as Qf,fe as Wf}from"../chunk-2b07w74s.js";import"../chunk-142zh7e5.js";import{ie as Rp,je as Mp,ke as Up,le as Ap,me as Gp,ne as Ep,oe as Op,pe as Pp,qe as ap,re as lp,se as yp}from"../chunk-y1d6e0ye.js";import"../chunk-ma01xp3y.js";import"../chunk-gjhxc6ma.js";import{Fe as Ip,Ge as Lp,He as Bp,Ie as Fp,Je as Hp,Ke as kp,Le as qp,Me as Jp,Ne as Kp,Oe as Qp,Pe as Wp}from"../chunk-3a63hke8.js";import{We as Cp}from"../chunk-92gh2n65.js";import{$e as bp,Xe as Xp,Ye as Yp,Ze as Zp,_e as $p,af as tp}from"../chunk-j46f90n8.js";import{df as a,ef as l,ff as y,gf as C,hf as N,if as _,jf as z,kf as D,lf as T,mf as j,nf as I,of as L,pf as B,qf as F,rf as H}from"../chunk-eh71jv8w.js";import{sf as U,tf as A,uf as G,vf as E,wf as O,yf as P}from"../chunk-3a5gcj3y.js";import{Af as ax,Bf as lx,Cf as yx,Df as Cx,Ef as Nx,zf as Px}from"../chunk-1pecmenc.js";import{Ff as Lx,Gf as Bx,Hf as Fx,If as Hx,Jf as kx,Kf as qx,Lf as Jx,Mf as Kx,Nf as Qx,Of as Wx,Pf as Xx,Qf as Yx,Rf as Zx}from"../chunk-4kyxrwxn.js";import"../chunk-24xvskkf.js";import{Uf as _x,Vf as zx,Wf as Dx,Xf as Tx,Yf as jx,Zf as Ix}from"../chunk-z18bksyr.js";import"../chunk-cj4d5ad7.js";import{bg as e,cg as g,dg as r,eg as v,fg as i,gg as s,hg as n,ig as pp,jg as op,kg as d}from"../chunk-zy49dwqk.js";import"../chunk-x9vpk4kk.js";import"../chunk-94tnmc7j.js";import"../chunk-drmk6r1m.js";import{$g as Lo,Yg as To,Zg as jo,_g as Io,bh as jR,ch as IR,dh as LR,eh as BR,fh as FR,gh as HR,hh as kR,ih as qR,jh as JR,kh as KR,lh as QR,mh as WR,nh as XR,oh as YR,ph as ZR,qh as $R,rh as bR,sh as tR,th as wR,uh as SR,vh as hR,wh as uR}from"../chunk-c4cj24qm.js";import{xh as om}from"../chunk-cx89kty3.js";import{Ah as u,Bh as c,Ch as V,yh as S,zh as h}from"../chunk-7t8s2mcf.js";import{Dh as t}from"../chunk-p2h2z6d3.js";import{Eh as w}from"../chunk-rwz433q2.js";import"../chunk-j6geg3qt.js";import{Gh as J,Hh as K,Ih as Q,Jh as W,Kh as X,Lh as Y}from"../chunk-34vracy4.js";import{Mh as k,Nh as q,Oh as Z,Ph as $,Qh as b}from"../chunk-zwtx6vn3.js";import"../chunk-028354j6.js";import"../chunk-s82adeq9.js";var{semver:m}=globalThis.Bun;class R{static compareVersions(p,o){return m.order(p,o)}static satisfiesRange(p,o){return m.satisfies(p,o)}static getLatestInRange(p,o){let f=p.filter((x)=>m.satisfies(x,o));if(f.length===0)return null;return f.sort((x,M)=>m.order(M,x))[0]}static createRange(p){return{raw:p,range:p.replace(/^[\^~>=<]+/,""),isExact:!/^[\^~>=<]/.test(p),satisfies:(o)=>this.satisfiesRange(o,p),getLatest:(o)=>this.getLatestInRange(o,p)}}static getUpdateType(p,o){return d(p,o)}static isSafeUpdate(p,o){return m.satisfies(o,p)}}export{Fx as writeFileTool,Yx as wrapUntrusted,gf as withTouchOffer,no as withNarrative,sf as verifyChanges,tR as validateWorkflowGeneration,wR as validateRepositoryAccess,Ud as validateFindings,Bo as validateConfig,Jo as validateAgainstSchema,HR as updateProgress,bf as unitTestsTouch,Sp as toOsvEcosystem,Hp as tagUpdateType,Kf as syntaxAnalyzer,lp as supports,z as summarizeUsage,fR as summarizeGates,lo as stripOperators,bd as stripNonCommandContext,nf as stackedBranchName,Mo as splitConstraint,op as sortUpdatesByPriority,wf as simplifyTouch,yR as similarity,Vx as sign,uR as showFinalInstructions,N as shouldOpenAsDraft,Yd as shouldFail,Jf as shellcheckAnalyzer,Kx as shellTool,hR as setupCustomWorkflow,$ as setDefaultLogger,ld as serializeReviewState,Af as serializeLearnings,Of as selectLearnings,Fp as selectLatestTag,qf as secretsAnalyzer,YR as schedulePlan,ao as scanEcosystems,vp as scanCatalogs,Bp as sameVariant,Go as rustAdapter,yf as runTool,pd as runStackedTouch,Bd as runReviewForPR,LR as runPreflightChecks,ER as runPostMerge,Zf as runPlan,Ko as runHeadless,xR as runGates,nd as runFixCi,Wf as runAnalyzers,UR as runAiGates,Zx as runAgent,A as ruleMatches,Ao as rubyAdapter,Ld as reviewPullRequest,Px as reviewMode,Ed as reviewDiff,Lx as resolveWorkspacePath,G as resolveRuleEffects,Op as resolveProviderToken,pf as resolveModelAlias,bp as resolveEngineVersion,Kp as resolveCredentials,ep as resolveCatalogReference,Id as resolveBuddyThreads,ff as resolveAiProvider,fm as resetConfigCache,Vf as renderTouchOffer,so as renderReport,TR as renderQuickLinks,aR as renderPackageContext,D as renderMigrationReport,Pf as renderLearnings,Td as renderFinding,qo as renderDoctorReport,xd as renderDiffForReview,_f as relativize,yo as regenerateLockfiles,xp as regenerateLockFile,Tx as redactError,Dx as redactDeep,zx as redact,Bx as readFileTool,Uo as pythonAdapter,Wo as publishOutput,Yo as productFor,jd as prepareReview,Sf as planTouch,yx as planMode,$p as pinBlocksUpdate,Ro as pep440UpdateType,Vp as parseWorkspaceCatalogs,md as parseUnifiedDiff,rf as parseTouchSelections,Nf as parseToolJson,Ip as parseTag,yd as parseReviewState,W as parseRetryDelay,qR as parseRemote,zR as parseQuickSelection,mo as parsePep440,g as parsePackageFile,Uf as parseLearnings,kp as parseImageRef,ho as parseHistory,td as parseCommand,Qp as parseAuthChallenge,If as offsetToLine,po as numericUpdateType,hp as normalizeSeverity,C as normalizePlan,Cd as needsReview,O as mergeGroupEffects,Sd as mentionsBot,B as matchesGlobs,Hf as markdownlintAnalyzer,zp as mapWithConcurrency,Cf as mapSeverity,af as loadLearnings,Vo as loadHistory,zd as loadGuidelines,Hx as listDirTool,Ff as linterAnalyzer,id as latestFailurePerWorkflow,wd as isReadOnlyCommand,fo as isPep440Prerelease,OR as isMergeEvent,gp as isCatalogReference,l as isAllowedCodemod,ax as implementMode,ef as hasTouchOffer,jf as hadolintAnalyzer,KR as guideTokenCreation,WR as guideRepositorySettings,P as groupsToRules,pp as groupUpdates,oo as goAdapter,Tf as githubActionsAnalyzer,bR as getWorkflowPreset,c as getNpmRegistryUrl,h as getGitHubServerUrl,S as getGitHubApiUrl,uf as getFinishingTouch,b as getDefaultLogger,xm as getConfig,V as getComposerRegistryUrl,mp as getAllLockFilePaths,Nx as getAgentMode,ZR as generateUnifiedWorkflow,jo as generateGitLabPipeline,$R as generateCoreWorkflows,XR as generateConfigFile,n as generateBranchName,Io as generateBitbucketPipeline,dR as gateIcon,kx as fsTools,e as formatSecurityAdvisorySection,Wd as formatReview,qd as formatPretty,i as formatPRTitle,s as formatPRBody,qp as formatImageRef,Qo as formatGithubOutput,Jd as formatGithub,q as formatError,Fo as formatConfigIssues,v as formatCommitMessage,Kd as formatAgent,lx as fixCiMode,Md as fingerprint,_ as findUsageSites,co as findPrevious,PR as findMentionedPackages,AR as findLinkedIssues,CR as findDuplicates,_o as findDrift,X as fetchWithTimeout,Y as fetchJsonOrNull,vd as failsOnBaseBranch,gd as extractErrorLines,Yp as extractEngines,Xf as emitEvent,U as ecosystemOf,Co as driftFor,$f as docstringsTouch,SR as displayValidationResults,kR as displayProgress,cd as dispatchCommand,Hd as diffArgsFor,ko as diagnose,fp as detectRequiredPackageManagers,JR as detectRepository,r as detectPackageManager,Bf as detectLinter,sp as detectFiles,od as detectChangedFiles,L as describeSpanGaps,rd as describeFailure,tx as describeEvent,to as describeEol,zo as describeDrift,Pd as defaultIncludePath,mm as defaultConfig,Ad as dedupeFindings,Zo as cycleFor,cx as createWebhookSink,hx as createSlackSink,Sx as createSinks,Yf as createReadIssueTool,ap as createProvider,FR as createProgressTracker,xf as createOpenAiProvider,Gf as createLearning,Vd as createHandlers,mf as createGoogleProvider,ux as createDiscordSink,of as createAnthropicProvider,df as createAiClient,Qd as countBySeverity,lR as constrainLabels,QR as confirmTokenSetup,dm as config,ro as computeMetrics,vo as computeDeltas,Dd as composeInstructions,Lp as compareVersions,xo as comparePep440,np as compareNumeric,zf as commandExists,I as collectSpanNotes,Zp as collectResolutionPins,kd as collectLocalDiff,fd as collectGitDiff,DR as clearQuickSelection,u as clearNpmrcCache,ed as classifyFailure,Lo as ciTemplateFor,Dp as chunk,pR as checkTitleFormat,ud as checkPermission,RR as checkLinkedIssue,$o as checkEol,oR as checkDescription,mR as checkDependencies,MR as checkCustomAssertions,tp as bumpEngineConstraint,Jx as buildShellEnv,y as buildAnalysisPrompt,tf as autofixTouch,T as attemptMajorUpgrade,sd as attemptFix,Ho as assertValidConfig,yp as assertSupports,Pp as assertProviderSupported,Xd as applySuggestion,E as applyRules,ip as applyCatalogUpdates,rp as applyCatalogUpdate,H as appendUpgradeReport,uo as appendHistory,GR as appendChangelogEntry,Jp as apiHostFor,Od as anchorMap,BR as analyzeProject,F as analyzeGroupMajors,cp as advisoryKey,Ef as addLearning,Po as adapterNamed,Oo as adapterFor,Df as actionlintAnalyzer,wx as WEBHOOK_PAYLOAD_VERSION,R as VersionResolver,Gp as UnsupportedProviderError,Xx as Toolbelt,Qx as ToolPermissionError,cf as TOUCH_OFFER_MARKER,lf as TOOL_TIMEOUT_MS,vf as TEST_COMMANDS,up as SecurityAdvisoryService,pm as Scheduler,qx as SHELL_ENV_ALLOWLIST,dd as SEVERITY_ORDER,kf as SECRET_RULES,Cp as ReleaseNotesFetcher,jp as RegistryClient,No as ROOT,ad as REVIEW_STATE_VERSION,Rd as REVIEW_SCHEMA,Fd as REVIEW_FORMATS,eo as REPORT_PERIODS,io as REPORT_MARKER,_x as REDACTED,$d as READ_ONLY_COMMANDS,NR as QUICK_LINKS_MARKER,_R as QUICK_ACTIONS,Np as PullRequestGenerator,IR as PluginManager,wp as PackageScanner,gx as PackageRegistryError,Up as PROVIDER_TRACKING_ISSUES,Ep as PROVIDER_TOKEN_ENV,nx as PROVIDER_PRIORITY,Rp as PROVIDER_NAMES,sx as PROVIDER_KEY_ENV,go as PERIOD_DAYS,Wp as OciClient,Ap as NO_CAPABILITIES,ix as MODEL_ALIASES,a as MIGRATION_PLAN_SCHEMA,_d as MAX_GUIDELINE_CHARS,Z as Logger,Lf as LINTER_SPECS,Xp as KNOWN_ENGINES,Mp as IMPLEMENTED_PROVIDERS,Q as HttpRequestError,wo as HISTORY_PATH,So as HISTORY_LIMIT,hd as HELP_TEXT,rx as GitProviderError,t as GitLabProvider,dp as GitHubProvider,k as GitHubApiError,om as GitHubActionsTemplate,hf as FINISHING_TOUCHES,bx as EventBus,$x as EVENT_NAMES,bo as EOL_WARNING_DAYS,Xo as EOL_PRODUCTS,J as DEFAULT_TIMEOUT_MS,j as DEFAULT_SPAN_BUDGET,To as DEFAULT_SCHEDULE,K as DEFAULT_RETRIES,Mf as DEFAULT_PROMPT_LIMIT,Rf as DEFAULT_LEARNINGS_FILE,Nd as DEFAULT_GUIDELINE_FILES,Gd as DEFAULT_EXCLUDED_PATHS,_p as DEFAULT_CONCURRENCY,jR as ConfigurationMigrator,vx as ConfigurationError,Zd as COMMAND_ALIASES,ex as BuddyError,Do as Buddy,w as BitbucketProvider,Wx as BUILTIN_TOOLS,Qf as BUILTIN_ANALYZERS,Eo as BUILTIN_ADAPTERS,Tp as AsyncMemo,Ix as AiProviderError,jx as AiBudgetExceededError,Cx as AGENT_MODES};
2
+ import{I as wo,J as So,K as ho,L as uo,M as co,N as Vo,O as eo,P as go,Q as ro,R as vo,S as io,T as so,U as no}from"../chunk-ewhvahnb.js";import{W as ko,X as qo}from"../chunk-bafzw99p.js";import{$ as Wo,Y as Jo,Z as Ko,_ as Qo}from"../chunk-whtdmv3p.js";import{aa as PR,ba as aR,ca as lR,da as yR,ea as CR,fa as NR,ga as _R,ha as zR,ia as DR,ja as TR}from"../chunk-69qyr9ef.js";import{ka as pR,la as oR,ma as mR,na as xR,oa as fR,pa as dR,qa as RR,ra as MR,sa as UR,ta as AR,ua as GR,va as ER,wa as OR}from"../chunk-psjrcpgb.js";import{Aa as $o,Ba as bo,Ca as to,xa as Xo,ya as Yo,za as Zo}from"../chunk-1a14rx5n.js";import"../chunk-rb1fh9vd.js";import{Da as pm}from"../chunk-nzk13c4q.js";import{Ea as ed,Fa as gd,Ga as rd,Ha as vd,Ia as id,Ja as sd,Ka as nd}from"../chunk-9chq5m4p.js";import{La as Zd,Ma as $d,Na as bd,Oa as td,Pa as wd,Qa as Sd,Ra as hd,Sa as ud,Ta as cd,Ua as Vd}from"../chunk-fsghqtgf.js";import{Va as Yf,Wa as Zf}from"../chunk-her5azyp.js";import{$a as Sf,Xa as $f,Ya as bf,Za as tf,_a as wf,ab as hf,bb as uf,cb as cf,db as Vf,eb as ef,fb as gf,gb as rf}from"../chunk-jqh7vx2n.js";import{hb as vf,ib as sf,jb as nf,kb as pd,lb as od}from"../chunk-gg1ddvnf.js";import{mb as Id}from"../chunk-byqzhgzs.js";import{Ab as Td,Bb as jd,Cb as Ld,Db as Bd,nb as dd,ob as Rd,pb as Md,qb as Ud,rb as Ad,sb as Gd,tb as Ed,ub as Od,vb as Pd,wb as Nd,xb as _d,yb as zd,zb as Dd}from"../chunk-4dz5x4xw.js";import{Eb as md,Fb as xd,Gb as fd}from"../chunk-q2tjkhez.js";import{Hb as Co,Ib as No,Jb as _o,Kb as zo}from"../chunk-vckhctmr.js";import{Lb as ad,Mb as ld,Nb as yd,Pb as Cd}from"../chunk-5yfaptmp.js";import{Qb as Rf,Rb as Mf,Sb as Uf,Tb as Af,Ub as Gf,Vb as Ef,Wb as Of,Xb as Pf,Yb as af}from"../chunk-vs61069x.js";import{$b as nx,Zb as ix,_b as sx,ac as pf,bc as of,cc as mf,dc as xf,ec as ff,fc as df}from"../chunk-wfwrm4k3.js";import{gc as Vp,hc as ep,ic as gp,jc as rp,mc as vp,nc as ip}from"../chunk-1g43mpqn.js";import{Ac as Uo,Bc as Ao,Cc as Go,Dc as Eo,Ec as Oo,Fc as Po,Gc as ao,Hc as lo,Ic as yo,pc as sp,sc as np,tc as po,uc as oo,vc as mo,wc as xo,xc as fo,yc as Ro,zc as Mo}from"../chunk-mtn4angk.js";import{Mc as dp}from"../chunk-4chtv4nh.js";import{Nc as mp,Oc as xp,Pc as fp}from"../chunk-j57716xw.js";import{Uc as mm,Vc as xm,Wc as fm,Xc as dm}from"../chunk-20ex3fxc.js";import{Yc as Bo,Zc as Fo,_c as Ho}from"../chunk-4r03rh93.js";import{$c as Sp,ad as hp,bd as up,cd as cp,ed as Do}from"../chunk-kpsvwjac.js";import"../chunk-a8wcn3mh.js";import{gd as _p,hd as zp,id as Dp,jd as Tp,kd as jp}from"../chunk-knhvdm94.js";import{ld as wp}from"../chunk-mthd2c8m.js";import"../chunk-bnp0r4eh.js";import{nd as ex,od as gx,pd as rx,qd as vx}from"../chunk-0f1xye20.js";import{td as Np}from"../chunk-hd74jxm2.js";import{ud as Xf}from"../chunk-s3b3vrsj.js";import{Ad as hx,Bd as ux,Cd as cx,Dd as Vx,vd as $x,wd as bx,xd as tx,yd as wx,zd as Sx}from"../chunk-6gvx1g6h.js";import{Ed as Fd,Fd as Hd,Gd as kd,Hd as qd,Id as Jd,Jd as Kd,Kd as Qd,Ld as Wd,Md as Xd,Nd as Yd}from"../chunk-7m3pzkcj.js";import{$d as Hf,Od as lf,Pd as yf,Qd as Cf,Rd as Nf,Sd as _f,Td as zf,Ud as Df,Vd as Tf,Wd as jf,Xd as If,Yd as Lf,Zd as Bf,_d as Ff,ae as kf,be as qf,ce as Jf,de as Kf,ee as Qf,fe as Wf}from"../chunk-mr2d1zp0.js";import"../chunk-142zh7e5.js";import{ie as Rp,je as Mp,ke as Up,le as Ap,me as Gp,ne as Ep,oe as Op,pe as Pp,qe as ap,re as lp,se as yp}from"../chunk-743mhx0e.js";import"../chunk-d09qj570.js";import"../chunk-wk175yyw.js";import{Fe as Ip,Ge as Lp,He as Bp,Ie as Fp,Je as Hp,Ke as kp,Le as qp,Me as Jp,Ne as Kp,Oe as Qp,Pe as Wp}from"../chunk-4wv5s3vr.js";import{We as Cp}from"../chunk-gvpsbmeg.js";import{$e as bp,Xe as Xp,Ye as Yp,Ze as Zp,_e as $p,af as tp}from"../chunk-j46f90n8.js";import{df as a,ef as l,ff as y,gf as C,hf as N,if as _,jf as z,kf as D,lf as T,mf as j,nf as I,of as L,pf as B,qf as F,rf as H}from"../chunk-7hm46cej.js";import{sf as U,tf as A,uf as G,vf as E,wf as O,yf as P}from"../chunk-wc2z7krw.js";import{Af as ax,Bf as lx,Cf as yx,Df as Cx,Ef as Nx,zf as Px}from"../chunk-1pecmenc.js";import{Ff as Lx,Gf as Bx,Hf as Fx,If as Hx,Jf as kx,Kf as qx,Lf as Jx,Mf as Kx,Nf as Qx,Of as Wx,Pf as Xx,Qf as Yx,Rf as Zx}from"../chunk-hk4d7rky.js";import"../chunk-24xvskkf.js";import{Uf as _x,Vf as zx,Wf as Dx,Xf as Tx,Yf as jx,Zf as Ix}from"../chunk-z18bksyr.js";import"../chunk-cj4d5ad7.js";import{bg as e,cg as g,dg as r,eg as v,fg as i,gg as s,hg as n,ig as pp,jg as op,kg as d}from"../chunk-c63e4ssc.js";import"../chunk-x9vpk4kk.js";import"../chunk-r1jvyhhd.js";import"../chunk-2z9mh5y4.js";import{$g as Io,Zg as To,_g as jo,ah as Lo,ch as jR,dh as IR,eh as LR,fh as BR,gh as FR,hh as HR,ih as kR,jh as qR,kh as JR,lh as KR,mh as QR,nh as WR,oh as XR,ph as YR,qh as ZR,rh as $R,sh as bR,th as tR,uh as wR,vh as SR,wh as hR,xh as uR}from"../chunk-6kd81nf9.js";import{yh as om}from"../chunk-nznpzbq4.js";import{Ah as h,Bh as u,Ch as c,Dh as V,zh as S}from"../chunk-yh13j2af.js";import{Eh as t}from"../chunk-r7qa2ykf.js";import{Fh as w}from"../chunk-gq9gkyah.js";import"../chunk-6w0n6c07.js";import{Hh as J,Ih as K,Jh as Q,Kh as W,Lh as X,Mh as Y}from"../chunk-s0ps33ft.js";import{Nh as k,Oh as q,Ph as Z,Qh as $,Rh as b}from"../chunk-wzncz6j5.js";import"../chunk-m3rftash.js";import"../chunk-16aeend1.js";var{semver:m}=globalThis.Bun;class R{static compareVersions(p,o){return m.order(p,o)}static satisfiesRange(p,o){return m.satisfies(p,o)}static getLatestInRange(p,o){let f=p.filter((x)=>m.satisfies(x,o));if(f.length===0)return null;return f.sort((x,M)=>m.order(M,x))[0]}static createRange(p){return{raw:p,range:p.replace(/^[\^~>=<]+/,""),isExact:!/^[\^~>=<]/.test(p),satisfies:(o)=>this.satisfiesRange(o,p),getLatest:(o)=>this.getLatestInRange(o,p)}}static getUpdateType(p,o){return d(p,o)}static isSafeUpdate(p,o){return m.satisfies(o,p)}}export{Fx as writeFileTool,Yx as wrapUntrusted,gf as withTouchOffer,no as withNarrative,sf as verifyChanges,tR as validateWorkflowGeneration,wR as validateRepositoryAccess,Ud as validateFindings,Bo as validateConfig,Jo as validateAgainstSchema,HR as updateProgress,bf as unitTestsTouch,Sp as toOsvEcosystem,Hp as tagUpdateType,Kf as syntaxAnalyzer,lp as supports,z as summarizeUsage,fR as summarizeGates,lo as stripOperators,bd as stripNonCommandContext,nf as stackedBranchName,Mo as splitConstraint,op as sortUpdatesByPriority,wf as simplifyTouch,yR as similarity,Vx as sign,uR as showFinalInstructions,N as shouldOpenAsDraft,Yd as shouldFail,Jf as shellcheckAnalyzer,Kx as shellTool,hR as setupCustomWorkflow,$ as setDefaultLogger,ld as serializeReviewState,Af as serializeLearnings,Of as selectLearnings,Fp as selectLatestTag,qf as secretsAnalyzer,YR as schedulePlan,ao as scanEcosystems,vp as scanCatalogs,Bp as sameVariant,Go as rustAdapter,yf as runTool,pd as runStackedTouch,Bd as runReviewForPR,LR as runPreflightChecks,ER as runPostMerge,Zf as runPlan,Ko as runHeadless,xR as runGates,nd as runFixCi,Wf as runAnalyzers,UR as runAiGates,Zx as runAgent,A as ruleMatches,Ao as rubyAdapter,Ld as reviewPullRequest,Px as reviewMode,Ed as reviewDiff,Lx as resolveWorkspacePath,G as resolveRuleEffects,Op as resolveProviderToken,pf as resolveModelAlias,bp as resolveEngineVersion,Kp as resolveCredentials,ep as resolveCatalogReference,Id as resolveBuddyThreads,ff as resolveAiProvider,fm as resetConfigCache,Vf as renderTouchOffer,so as renderReport,TR as renderQuickLinks,aR as renderPackageContext,D as renderMigrationReport,Pf as renderLearnings,Td as renderFinding,qo as renderDoctorReport,xd as renderDiffForReview,_f as relativize,yo as regenerateLockfiles,xp as regenerateLockFile,Tx as redactError,Dx as redactDeep,zx as redact,Bx as readFileTool,Uo as pythonAdapter,Wo as publishOutput,Yo as productFor,jd as prepareReview,Sf as planTouch,yx as planMode,$p as pinBlocksUpdate,Ro as pep440UpdateType,Vp as parseWorkspaceCatalogs,md as parseUnifiedDiff,rf as parseTouchSelections,Nf as parseToolJson,Ip as parseTag,yd as parseReviewState,W as parseRetryDelay,qR as parseRemote,zR as parseQuickSelection,mo as parsePep440,g as parsePackageFile,Uf as parseLearnings,kp as parseImageRef,ho as parseHistory,td as parseCommand,Qp as parseAuthChallenge,If as offsetToLine,po as numericUpdateType,hp as normalizeSeverity,C as normalizePlan,Cd as needsReview,O as mergeGroupEffects,Sd as mentionsBot,B as matchesGlobs,Hf as markdownlintAnalyzer,zp as mapWithConcurrency,Cf as mapSeverity,af as loadLearnings,Vo as loadHistory,zd as loadGuidelines,Hx as listDirTool,Ff as linterAnalyzer,id as latestFailurePerWorkflow,wd as isReadOnlyCommand,fo as isPep440Prerelease,OR as isMergeEvent,gp as isCatalogReference,l as isAllowedCodemod,ax as implementMode,ef as hasTouchOffer,jf as hadolintAnalyzer,KR as guideTokenCreation,WR as guideRepositorySettings,P as groupsToRules,pp as groupUpdates,oo as goAdapter,Tf as githubActionsAnalyzer,bR as getWorkflowPreset,c as getNpmRegistryUrl,h as getGitHubServerUrl,S as getGitHubApiUrl,uf as getFinishingTouch,b as getDefaultLogger,xm as getConfig,V as getComposerRegistryUrl,mp as getAllLockFilePaths,Nx as getAgentMode,ZR as generateUnifiedWorkflow,jo as generateGitLabPipeline,$R as generateCoreWorkflows,XR as generateConfigFile,n as generateBranchName,Io as generateBitbucketPipeline,dR as gateIcon,kx as fsTools,e as formatSecurityAdvisorySection,Wd as formatReview,qd as formatPretty,i as formatPRTitle,s as formatPRBody,qp as formatImageRef,Qo as formatGithubOutput,Jd as formatGithub,q as formatError,Fo as formatConfigIssues,v as formatCommitMessage,Kd as formatAgent,lx as fixCiMode,Md as fingerprint,_ as findUsageSites,co as findPrevious,PR as findMentionedPackages,AR as findLinkedIssues,CR as findDuplicates,_o as findDrift,X as fetchWithTimeout,Y as fetchJsonOrNull,vd as failsOnBaseBranch,gd as extractErrorLines,Yp as extractEngines,Xf as emitEvent,U as ecosystemOf,Co as driftFor,$f as docstringsTouch,SR as displayValidationResults,kR as displayProgress,cd as dispatchCommand,Hd as diffArgsFor,ko as diagnose,fp as detectRequiredPackageManagers,JR as detectRepository,r as detectPackageManager,Bf as detectLinter,sp as detectFiles,od as detectChangedFiles,L as describeSpanGaps,rd as describeFailure,tx as describeEvent,to as describeEol,zo as describeDrift,Pd as defaultIncludePath,mm as defaultConfig,Ad as dedupeFindings,Zo as cycleFor,cx as createWebhookSink,hx as createSlackSink,Sx as createSinks,Yf as createReadIssueTool,ap as createProvider,FR as createProgressTracker,xf as createOpenAiProvider,Gf as createLearning,Vd as createHandlers,mf as createGoogleProvider,ux as createDiscordSink,of as createAnthropicProvider,df as createAiClient,Qd as countBySeverity,lR as constrainLabels,QR as confirmTokenSetup,dm as config,ro as computeMetrics,vo as computeDeltas,Dd as composeInstructions,Lp as compareVersions,xo as comparePep440,np as compareNumeric,zf as commandExists,I as collectSpanNotes,Zp as collectResolutionPins,kd as collectLocalDiff,fd as collectGitDiff,DR as clearQuickSelection,u as clearNpmrcCache,ed as classifyFailure,Lo as ciTemplateFor,Dp as chunk,pR as checkTitleFormat,ud as checkPermission,RR as checkLinkedIssue,$o as checkEol,oR as checkDescription,mR as checkDependencies,MR as checkCustomAssertions,tp as bumpEngineConstraint,Jx as buildShellEnv,y as buildAnalysisPrompt,tf as autofixTouch,T as attemptMajorUpgrade,sd as attemptFix,Ho as assertValidConfig,yp as assertSupports,Pp as assertProviderSupported,Xd as applySuggestion,E as applyRules,ip as applyCatalogUpdates,rp as applyCatalogUpdate,H as appendUpgradeReport,uo as appendHistory,GR as appendChangelogEntry,Jp as apiHostFor,Od as anchorMap,BR as analyzeProject,F as analyzeGroupMajors,cp as advisoryKey,Ef as addLearning,Po as adapterNamed,Oo as adapterFor,Df as actionlintAnalyzer,wx as WEBHOOK_PAYLOAD_VERSION,R as VersionResolver,Gp as UnsupportedProviderError,Xx as Toolbelt,Qx as ToolPermissionError,cf as TOUCH_OFFER_MARKER,lf as TOOL_TIMEOUT_MS,vf as TEST_COMMANDS,up as SecurityAdvisoryService,pm as Scheduler,qx as SHELL_ENV_ALLOWLIST,dd as SEVERITY_ORDER,kf as SECRET_RULES,Cp as ReleaseNotesFetcher,jp as RegistryClient,No as ROOT,ad as REVIEW_STATE_VERSION,Rd as REVIEW_SCHEMA,Fd as REVIEW_FORMATS,eo as REPORT_PERIODS,io as REPORT_MARKER,_x as REDACTED,$d as READ_ONLY_COMMANDS,NR as QUICK_LINKS_MARKER,_R as QUICK_ACTIONS,Np as PullRequestGenerator,IR as PluginManager,wp as PackageScanner,gx as PackageRegistryError,Up as PROVIDER_TRACKING_ISSUES,Ep as PROVIDER_TOKEN_ENV,nx as PROVIDER_PRIORITY,Rp as PROVIDER_NAMES,sx as PROVIDER_KEY_ENV,go as PERIOD_DAYS,Wp as OciClient,Ap as NO_CAPABILITIES,ix as MODEL_ALIASES,a as MIGRATION_PLAN_SCHEMA,_d as MAX_GUIDELINE_CHARS,Z as Logger,Lf as LINTER_SPECS,Xp as KNOWN_ENGINES,Mp as IMPLEMENTED_PROVIDERS,Q as HttpRequestError,wo as HISTORY_PATH,So as HISTORY_LIMIT,hd as HELP_TEXT,rx as GitProviderError,t as GitLabProvider,dp as GitHubProvider,k as GitHubApiError,om as GitHubActionsTemplate,hf as FINISHING_TOUCHES,bx as EventBus,$x as EVENT_NAMES,bo as EOL_WARNING_DAYS,Xo as EOL_PRODUCTS,J as DEFAULT_TIMEOUT_MS,j as DEFAULT_SPAN_BUDGET,To as DEFAULT_SCHEDULE,K as DEFAULT_RETRIES,Mf as DEFAULT_PROMPT_LIMIT,Rf as DEFAULT_LEARNINGS_FILE,Nd as DEFAULT_GUIDELINE_FILES,Gd as DEFAULT_EXCLUDED_PATHS,_p as DEFAULT_CONCURRENCY,jR as ConfigurationMigrator,vx as ConfigurationError,Zd as COMMAND_ALIASES,ex as BuddyError,Do as Buddy,w as BitbucketProvider,Wx as BUILTIN_TOOLS,Qf as BUILTIN_ANALYZERS,Eo as BUILTIN_ADAPTERS,Tp as AsyncMemo,Ix as AiProviderError,jx as AiBudgetExceededError,Cx as AGENT_MODES};
package/dist/src/setup.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{bh as a,ch as b,dh as c,eh as d,fh as e,gh as f,hh as g,ih as h,jh as i,kh as j,lh as k,mh as l,nh as m,oh as n,ph as o,qh as p,rh as q,sh as r,th as s,uh as t,vh as u,wh as v}from"../chunk-c4cj24qm.js";import"../chunk-cx89kty3.js";import"../chunk-7t8s2mcf.js";import"../chunk-34vracy4.js";import"../chunk-zwtx6vn3.js";import"../chunk-s82adeq9.js";export{r as validateWorkflowGeneration,s as validateRepositoryAccess,f as updateProgress,v as showFinalInstructions,u as setupCustomWorkflow,n as schedulePlan,c as runPreflightChecks,h as parseRemote,j as guideTokenCreation,l as guideRepositorySettings,q as getWorkflowPreset,o as generateUnifiedWorkflow,p as generateCoreWorkflows,m as generateConfigFile,t as displayValidationResults,g as displayProgress,i as detectRepository,e as createProgressTracker,k as confirmTokenSetup,d as analyzeProject,b as PluginManager,a as ConfigurationMigrator};
2
+ import{ch as a,dh as b,eh as c,fh as d,gh as e,hh as f,ih as g,jh as h,kh as i,lh as j,mh as k,nh as l,oh as m,ph as n,qh as o,rh as p,sh as q,th as r,uh as s,vh as t,wh as u,xh as v}from"../chunk-6kd81nf9.js";import"../chunk-nznpzbq4.js";import"../chunk-yh13j2af.js";import"../chunk-s0ps33ft.js";import"../chunk-wzncz6j5.js";import"../chunk-16aeend1.js";export{r as validateWorkflowGeneration,s as validateRepositoryAccess,f as updateProgress,v as showFinalInstructions,u as setupCustomWorkflow,n as schedulePlan,c as runPreflightChecks,h as parseRemote,j as guideTokenCreation,l as guideRepositorySettings,q as getWorkflowPreset,o as generateUnifiedWorkflow,p as generateCoreWorkflows,m as generateConfigFile,t as displayValidationResults,g as displayProgress,i as detectRepository,e as createProgressTracker,k as confirmTokenSetup,d as analyzeProject,b as PluginManager,a as ConfigurationMigrator};
@@ -15,3 +15,9 @@ export declare function updateDependencyFile(filePath: string, content: string,
15
15
  * Generate file changes for dependency files
16
16
  */
17
17
  export declare function generateDependencyFileUpdates(updates: PackageUpdate[]): Promise<Array<{ path: string, content: string, type: 'update' }>>;
18
+ /**
19
+ * True when a dependency range points at a place rather than a registry
20
+ * version: `workspace:*`, `file:../pkg`, `link:`, `portal:`, a git or http
21
+ * URL, or a `github:` shorthand. Such a range is never rewritten to a version.
22
+ */
23
+ export declare function isLocationRange(range: string): boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@buddysh/buddy",
3
3
  "type": "module",
4
- "version": "0.11.14",
4
+ "version": "0.11.16",
5
5
  "description": "AI code review and dependency updates in one bot. Reviews pull requests and local changes, answers @buddy comments, gates merges, repairs failing CI, and keeps dependencies current across npm, Composer, Docker, GitHub Actions and more.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -50,12 +50,13 @@
50
50
  },
51
51
  "files": [
52
52
  "README.md",
53
- "bin",
53
+ "bin/cli.ts",
54
54
  "dist"
55
55
  ],
56
56
  "scripts": {
57
57
  "build": "bun build.ts",
58
58
  "build:binaries": "bun build-binaries.ts",
59
+ "test:binaries": "bun scripts/verify-standalone.ts",
59
60
  "fresh": "bunx rimraf node_modules/ bun.lock && bun i",
60
61
  "prepublishOnly": "bun run build",
61
62
  "test": "bun test",
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{W as a,X as b}from"./chunk-zjp519wm.js";import"./chunk-5sh69bkj.js";import"./chunk-01d81hn0.js";import"./chunk-0f1xye20.js";import"./chunk-qjzpzd7j.js";import"./chunk-ebnc6980.js";import"./chunk-2b07w74s.js";import"./chunk-142zh7e5.js";import"./chunk-y1d6e0ye.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{b as renderDoctorReport,a as diagnose};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{td as a}from"./chunk-66nntsnf.js";import"./chunk-92gh2n65.js";import"./chunk-zy49dwqk.js";import"./chunk-x9vpk4kk.js";import"./chunk-94tnmc7j.js";import"./chunk-drmk6r1m.js";import"./chunk-7t8s2mcf.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-028354j6.js";import"./chunk-s82adeq9.js";export{a as PullRequestGenerator};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Nc as a,Oc as b,Pc as c,Qc as d,Rc as e,Sc as f,Tc as g}from"./chunk-9n1kth4b.js";import"./chunk-zy49dwqk.js";import"./chunk-x9vpk4kk.js";import"./chunk-94tnmc7j.js";import"./chunk-drmk6r1m.js";import"./chunk-7t8s2mcf.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-028354j6.js";import"./chunk-s82adeq9.js";export{b as regenerateLockFile,d as nestedLockProjects,f as missingLockFiles,e as lockFileFor,g as hasLockFile,a as getAllLockFilePaths,c as detectRequiredPackageManagers};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Da as a}from"./chunk-y83rsv1a.js";import"./chunk-cneecnvd.js";import"./chunk-c9266b5x.js";import"./chunk-x9qhsyp6.js";import"./chunk-xyzcgskb.js";import"./chunk-bnp0r4eh.js";import"./chunk-0f1xye20.js";import"./chunk-66nntsnf.js";import"./chunk-ebnc6980.js";import"./chunk-y1d6e0ye.js";import"./chunk-ma01xp3y.js";import"./chunk-gjhxc6ma.js";import"./chunk-3a63hke8.js";import"./chunk-92gh2n65.js";import"./chunk-j46f90n8.js";import"./chunk-eh71jv8w.js";import"./chunk-3a5gcj3y.js";import"./chunk-1pecmenc.js";import"./chunk-4kyxrwxn.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-zy49dwqk.js";import"./chunk-x9vpk4kk.js";import"./chunk-94tnmc7j.js";import"./chunk-drmk6r1m.js";import"./chunk-7t8s2mcf.js";import"./chunk-j6geg3qt.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-028354j6.js";import"./chunk-s82adeq9.js";export{a as Scheduler};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ea as a,Fa as b,Ga as c,Ha as d,Ia as e,Ja as f,Ka as g}from"./chunk-s5czyzje.js";import"./chunk-qjzpzd7j.js";import"./chunk-ebnc6980.js";import"./chunk-y1d6e0ye.js";import"./chunk-1pecmenc.js";import"./chunk-4kyxrwxn.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{g as runFixCi,e as latestFailurePerWorkflow,d as failsOnBaseBranch,b as extractErrorLines,c as describeFailure,a as classifyFailure,f as attemptFix};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{kd as a}from"./chunk-x9qhsyp6.js";import"./chunk-bnp0r4eh.js";import"./chunk-0f1xye20.js";import"./chunk-zy49dwqk.js";import"./chunk-x9vpk4kk.js";import"./chunk-94tnmc7j.js";import"./chunk-drmk6r1m.js";import"./chunk-7t8s2mcf.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-028354j6.js";import"./chunk-s82adeq9.js";export{a as RegistryClient};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{hi as A,ii as E,ji as _,ki as T,li as C}from"./chunk-028354j6.js";import"./chunk-s82adeq9.js";export{T as PACKAGE_ALIASES,_ as DEFAULT_TIMEOUT_MS,E as DEFAULT_CACHE_EXPIRATION_MINUTES,A as DEFAULT_CACHE_DIR,C as ALL_KNOWN_PACKAGES};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Eh as a}from"./chunk-rwz433q2.js";import"./chunk-j6geg3qt.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{a as BitbucketProvider};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{pf as a,qf as b,rf as c}from"./chunk-eh71jv8w.js";import"./chunk-3a5gcj3y.js";import"./chunk-1pecmenc.js";import"./chunk-4kyxrwxn.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-zy49dwqk.js";import"./chunk-x9vpk4kk.js";import"./chunk-94tnmc7j.js";import"./chunk-drmk6r1m.js";import"./chunk-7t8s2mcf.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-028354j6.js";import"./chunk-s82adeq9.js";export{a as matchesGlobs,c as appendUpgradeReport,b as analyzeGroupMajors};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{Qh as K}from"./chunk-zwtx6vn3.js";import{Fj as R}from"./chunk-028354j6.js";import{fl as x}from"./chunk-s82adeq9.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
- `),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 Ag,V as Bg,M as Cg,k as Dg};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{hb as a,ib as b,jb as c,kb as d,lb as e}from"./chunk-k907b533.js";import"./chunk-4kyxrwxn.js";import"./chunk-z18bksyr.js";import"./chunk-cj4d5ad7.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{b as verifyChanges,c as stackedBranchName,d as runStackedTouch,e as detectChangedFiles,a as TEST_COMMANDS};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Cb as a,Db as b}from"./chunk-7b156stw.js";import"./chunk-q2tjkhez.js";import"./chunk-5yfaptmp.js";import"./chunk-sn0qr6q7.js";import"./chunk-5sh69bkj.js";import"./chunk-2b07w74s.js";import"./chunk-142zh7e5.js";import"./chunk-y1d6e0ye.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{b as runReviewForPR,a as reviewPullRequest};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Dh as a}from"./chunk-p2h2z6d3.js";import"./chunk-j6geg3qt.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{a as GitLabProvider};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Gc as a,Hc as b,Ic as c}from"./chunk-w2ccdet4.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{b as stripOperators,a as scanEcosystems,c as regenerateLockfiles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{fd as a}from"./chunk-c9266b5x.js";import"./chunk-7t8s2mcf.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{a as DeprecatedDependenciesChecker};