@buddysh/buddy 0.11.4 → 0.11.6

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 (163) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/bin/cli.js +19 -19
  3. package/dist/chunk-042211k4.js +2 -0
  4. package/dist/chunk-04sy4xt9.js +2 -0
  5. package/dist/chunk-0j7rmr49.js +2 -0
  6. package/dist/{chunk-yp1tgdh3.js → chunk-0t8q4880.js} +1 -1
  7. package/dist/{chunk-hsa07n7c.js → chunk-0xxqw1h6.js} +1 -1
  8. package/dist/{chunk-zgkrhymn.js → chunk-1p9hgr6z.js} +1 -1
  9. package/dist/{chunk-8hjvthz4.js → chunk-1zv0s60b.js} +2 -2
  10. package/dist/{chunk-ngh4jbgp.js → chunk-1zz8bd1c.js} +2 -2
  11. package/dist/chunk-217bhn06.js +2 -0
  12. package/dist/{chunk-428c5652.js → chunk-27jza51d.js} +1 -1
  13. package/dist/chunk-2k4gkkc6.js +2 -0
  14. package/dist/chunk-2kkwhrfz.js +2 -0
  15. package/dist/{chunk-f53y8ans.js → chunk-2r5s586j.js} +2 -2
  16. package/dist/{chunk-yr8eta7p.js → chunk-2vmaeyh3.js} +8 -8
  17. package/dist/{chunk-hd5j9e3c.js → chunk-3f34dgnn.js} +1 -1
  18. package/dist/{chunk-jnb80k2x.js → chunk-3k62kevg.js} +1 -1
  19. package/dist/{chunk-5av2vnvv.js → chunk-3nygvd78.js} +2 -2
  20. package/dist/{chunk-96ht6hwd.js → chunk-43p5vzvb.js} +2 -2
  21. package/dist/{chunk-p6qbqsyp.js → chunk-47ancrn1.js} +2 -2
  22. package/dist/{chunk-bmnx3s41.js → chunk-4m1vgh1w.js} +9 -9
  23. package/dist/{chunk-q4t568hv.js → chunk-4sqwtry6.js} +1 -1
  24. package/dist/{chunk-qd2s51gc.js → chunk-56q8k98m.js} +1 -1
  25. package/dist/{chunk-rayxmbcx.js → chunk-5bedx7s3.js} +1 -1
  26. package/dist/{chunk-pkr6905p.js → chunk-5qssa20j.js} +1 -1
  27. package/dist/{chunk-kprtsn8c.js → chunk-6qb96bg0.js} +1 -1
  28. package/dist/{chunk-ds4stft2.js → chunk-7g13yp3v.js} +1 -1
  29. package/dist/{chunk-c3es7pgf.js → chunk-86kymmen.js} +1 -1
  30. package/dist/{chunk-5044y9en.js → chunk-88k998tw.js} +2 -2
  31. package/dist/{chunk-11hdrnf6.js → chunk-8dq3gews.js} +2 -2
  32. package/dist/{chunk-phfmnnne.js → chunk-8mrbvnae.js} +2 -2
  33. package/dist/chunk-90x7e4ra.js +106 -0
  34. package/dist/{chunk-61xecp1z.js → chunk-95je030a.js} +1 -1
  35. package/dist/{chunk-05me15qw.js → chunk-9cnq8y3d.js} +1 -1
  36. package/dist/chunk-9ychha5r.js +2 -0
  37. package/dist/{chunk-3901s7h9.js → chunk-abfyz98y.js} +1 -1
  38. package/dist/{chunk-jtxcr5yw.js → chunk-ak9s0vnr.js} +2 -2
  39. package/dist/chunk-az2vad31.js +2 -0
  40. package/dist/{chunk-e68nf7cm.js → chunk-b4a5gw9c.js} +1 -1
  41. package/dist/chunk-ba1t70ph.js +2 -0
  42. package/dist/{chunk-sw2538r0.js → chunk-bjg4gxs4.js} +2 -2
  43. package/dist/{chunk-hfjywbbc.js → chunk-bprmzg0p.js} +1 -1
  44. package/dist/{chunk-rc2mk5x6.js → chunk-bxdbf2kj.js} +1 -1
  45. package/dist/{chunk-mkzmjg3f.js → chunk-c64qrkpz.js} +2 -2
  46. package/dist/{chunk-yngahb11.js → chunk-d1yhv10h.js} +2 -2
  47. package/dist/{chunk-0hc97k0t.js → chunk-d73ympxb.js} +3 -3
  48. package/dist/{chunk-g30dr44w.js → chunk-d7e6tqmr.js} +2 -2
  49. package/dist/{chunk-aa277p5r.js → chunk-d84k4mek.js} +1 -1
  50. package/dist/chunk-dbawp9kg.js +2 -0
  51. package/dist/{chunk-m4p7cnvk.js → chunk-df75rm51.js} +1 -1
  52. package/dist/chunk-dh9dw57m.js +2 -0
  53. package/dist/chunk-dkhvqxrk.js +2 -0
  54. package/dist/{chunk-cwfkm7h9.js → chunk-e1cvrjf0.js} +2 -2
  55. package/dist/{chunk-2et8yavs.js → chunk-e3wax332.js} +1 -1
  56. package/dist/{chunk-vqa6vte3.js → chunk-e4bcngja.js} +1 -1
  57. package/dist/{chunk-tjc2vgwn.js → chunk-e6wny1pp.js} +1 -1
  58. package/dist/chunk-ecs7b2kg.js +2 -0
  59. package/dist/chunk-edgg7wxb.js +2 -0
  60. package/dist/{chunk-cs066zt9.js → chunk-ej7gpg23.js} +2 -2
  61. package/dist/{chunk-patms7t8.js → chunk-erbqszzp.js} +1 -1
  62. package/dist/{chunk-cgvt98pd.js → chunk-f7aw9cr3.js} +1 -1
  63. package/dist/{chunk-08x5b93v.js → chunk-ffb50kwa.js} +1 -1
  64. package/dist/{chunk-r763e19p.js → chunk-ffp0mgf5.js} +3 -3
  65. package/dist/{chunk-b1w41hfs.js → chunk-ge2r1zmq.js} +1 -1
  66. package/dist/chunk-h82t0mnh.js +2 -0
  67. package/dist/{chunk-g24hav8e.js → chunk-j3bzf5m0.js} +7 -7
  68. package/dist/{chunk-be629jhq.js → chunk-j8era2yj.js} +2 -2
  69. package/dist/{chunk-25sz1y7j.js → chunk-jaewrjw3.js} +1 -1
  70. package/dist/{chunk-vbeeyhhe.js → chunk-jhfkzveb.js} +2 -2
  71. package/dist/chunk-k10hm62v.js +2 -0
  72. package/dist/{chunk-nrr8z2z7.js → chunk-k53ndvfv.js} +2 -2
  73. package/dist/{chunk-k26wnmzk.js → chunk-k8pnnyq1.js} +1 -1
  74. package/dist/{chunk-0w695m54.js → chunk-kbkvw42w.js} +1 -1
  75. package/dist/{chunk-b9escac0.js → chunk-kqam9qmd.js} +2 -2
  76. package/dist/{chunk-c8rzx3a1.js → chunk-kypdeb29.js} +1 -1
  77. package/dist/{chunk-wn6pbyzn.js → chunk-kzgyhhtz.js} +1 -1
  78. package/dist/{chunk-3pqra420.js → chunk-m1zp48mr.js} +1 -1
  79. package/dist/{chunk-0scz1dv5.js → chunk-mfhwcnxr.js} +1 -1
  80. package/dist/chunk-mmc8tvbb.js +2 -0
  81. package/dist/{chunk-txtrpypt.js → chunk-mtp0aygy.js} +2 -2
  82. package/dist/{chunk-xs12dtf1.js → chunk-myswpb7z.js} +1 -1
  83. package/dist/{chunk-jz5zs812.js → chunk-nf9dfx4t.js} +1 -1
  84. package/dist/{chunk-fjp3a7hp.js → chunk-nj38e2km.js} +1 -1
  85. package/dist/{chunk-68fw3ma0.js → chunk-nr1c0dny.js} +1 -1
  86. package/dist/chunk-nz0ns7ah.js +3 -0
  87. package/dist/chunk-p3qck29r.js +2 -0
  88. package/dist/{chunk-hptfq3rg.js → chunk-pkcvytq6.js} +1 -1
  89. package/dist/{chunk-hmskwy76.js → chunk-pqbzatbq.js} +1 -1
  90. package/dist/{chunk-40znfg3x.js → chunk-pwa2tt2e.js} +1 -1
  91. package/dist/chunk-qe63pqwy.js +2 -0
  92. package/dist/{chunk-4jyw358y.js → chunk-qmhd1bgx.js} +1 -1
  93. package/dist/chunk-qxc77b08.js +2 -0
  94. package/dist/{chunk-bffxf4xy.js → chunk-qzens4rg.js} +1 -1
  95. package/dist/chunk-r9k5vnrw.js +2 -0
  96. package/dist/{chunk-v1wfa758.js → chunk-rfvn4j6n.js} +1 -1
  97. package/dist/chunk-rnv477z3.js +2 -0
  98. package/dist/{chunk-3cvng2nz.js → chunk-rp3ytb19.js} +1 -1
  99. package/dist/{chunk-pskqrv5r.js → chunk-rpkwbqr8.js} +1 -1
  100. package/dist/chunk-s7da3h7c.js +2 -0
  101. package/dist/chunk-swphrsyr.js +2 -0
  102. package/dist/chunk-sx8pyc83.js +2 -0
  103. package/dist/chunk-sy3h7j1x.js +2 -0
  104. package/dist/{chunk-eseshkd0.js → chunk-t3340cv5.js} +1 -1
  105. package/dist/{chunk-1qgr52wx.js → chunk-te6etc5c.js} +1 -1
  106. package/dist/chunk-ttx1jk5b.js +2 -0
  107. package/dist/{chunk-tw047td6.js → chunk-tvrz1xp5.js} +1 -1
  108. package/dist/chunk-v5qn8kjd.js +2 -0
  109. package/dist/chunk-vj9stet1.js +2 -0
  110. package/dist/chunk-w6bd9r6p.js +2 -0
  111. package/dist/{chunk-193abzy6.js → chunk-wkq57ssc.js} +1 -1
  112. package/dist/{chunk-s4zb0fcj.js → chunk-wsxy4w86.js} +1 -1
  113. package/dist/chunk-x59yras6.js +2 -0
  114. package/dist/chunk-xfmzts7d.js +2 -0
  115. package/dist/chunk-xj99g66b.js +4 -0
  116. package/dist/{chunk-6p4qz8qv.js → chunk-y1hppm93.js} +1 -1
  117. package/dist/{chunk-1cpdz49v.js → chunk-yj6xx2b8.js} +1 -1
  118. package/dist/{chunk-3fzbvs2p.js → chunk-zc7g037n.js} +1 -1
  119. package/dist/{chunk-s6z3gm2s.js → chunk-zhfrmseh.js} +1 -1
  120. package/dist/{chunk-vgtmrd4c.js → chunk-zpxg12ep.js} +1 -1
  121. package/dist/src/git/github-provider.d.ts +12 -0
  122. package/dist/src/git/provider.d.ts +1 -0
  123. package/dist/src/index.js +1 -1
  124. package/dist/src/setup.js +1 -1
  125. package/dist/src/types.d.ts +1 -0
  126. package/dist/src/utils/github-actions-parser.d.ts +10 -0
  127. package/dist/src/utils/lock-file.d.ts +26 -2
  128. package/package.json +1 -1
  129. package/dist/chunk-0paakbpj.js +0 -2
  130. package/dist/chunk-19zyq15p.js +0 -2
  131. package/dist/chunk-24c2ab29.js +0 -2
  132. package/dist/chunk-28y7eayr.js +0 -2
  133. package/dist/chunk-2wj5xtdn.js +0 -2
  134. package/dist/chunk-49znmbh8.js +0 -2
  135. package/dist/chunk-86x1vsjw.js +0 -2
  136. package/dist/chunk-8fw0v7bv.js +0 -3
  137. package/dist/chunk-90zmqn5k.js +0 -2
  138. package/dist/chunk-97qf7mdt.js +0 -2
  139. package/dist/chunk-a4hzzn28.js +0 -2
  140. package/dist/chunk-b357cgb0.js +0 -2
  141. package/dist/chunk-brfyymhf.js +0 -2
  142. package/dist/chunk-dgfb8k0h.js +0 -2
  143. package/dist/chunk-e0gweha1.js +0 -2
  144. package/dist/chunk-e2t5jq26.js +0 -106
  145. package/dist/chunk-emb5v4wv.js +0 -2
  146. package/dist/chunk-emyvrx5t.js +0 -2
  147. package/dist/chunk-fpnjpgrb.js +0 -2
  148. package/dist/chunk-fr5c326k.js +0 -2
  149. package/dist/chunk-gkpd5nw2.js +0 -2
  150. package/dist/chunk-hns85dqw.js +0 -2
  151. package/dist/chunk-mcwxpdg9.js +0 -2
  152. package/dist/chunk-ng7px8gx.js +0 -2
  153. package/dist/chunk-ppmabn5h.js +0 -2
  154. package/dist/chunk-rwggcfgn.js +0 -2
  155. package/dist/chunk-s25rb4t2.js +0 -2
  156. package/dist/chunk-sc7emb71.js +0 -2
  157. package/dist/chunk-vdd1cghr.js +0 -2
  158. package/dist/chunk-vj1sdxpp.js +0 -2
  159. package/dist/chunk-xznnmhyt.js +0 -2
  160. package/dist/chunk-yk183r6z.js +0 -2
  161. package/dist/chunk-ys1qqcpp.js +0 -2
  162. package/dist/chunk-ytmxd5fk.js +0 -4
  163. package/dist/chunk-zxgkp71x.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{If as Z}from"./chunk-p6qbqsyp.js";import{Fh as Y}from"./chunk-hfjywbbc.js";import W from"process";var $=[["bun","test"],["npm","test","--silent"]];async function E(G,H){let I=H?[H]:await L(G);for(let z of I){let j=Bun.spawn(z,{cwd:G,stdout:"pipe",stderr:"pipe",env:{PATH:W.env.PATH??"",HOME:W.env.HOME??"",CI:"1"}}),[J,K,Q]=await Promise.all([new Response(j.stdout).text(),new Response(j.stderr).text(),j.exited]);return{ran:!0,passed:Q===0,output:`${J}
2
+ import{Pf as Z}from"./chunk-47ancrn1.js";import{Mh as Y}from"./chunk-bprmzg0p.js";import W from"process";var $=[["bun","test"],["npm","test","--silent"]];async function E(G,H){let I=H?[H]:await L(G);for(let z of I){let j=Bun.spawn(z,{cwd:G,stdout:"pipe",stderr:"pipe",env:{PATH:W.env.PATH??"",HOME:W.env.HOME??"",CI:"1"}}),[J,K,Q]=await Promise.all([new Response(j.stdout).text(),new Response(j.stderr).text(),j.exited]);return{ran:!0,passed:Q===0,output:`${J}
3
3
  ${K}`.trim().slice(-4000)}}return{ran:!1,passed:!1,output:""}}async function L(G){let H=Bun.file(`${G}/package.json`);if(!await H.exists())return[];try{return(await H.json()).scripts?.test?$:[]}catch{return[]}}function O(G,H){return`${G.head}/buddy-${H}`}async function N(G){let H=G.logger??Y(),{provider:I,pullRequest:z,touch:j}=G;H.info(`\u2728 Running finishing touch '${j.name}' on PR #${z.number}`);let J=await Z(G.ai,{mode:j.mode,task:j.buildTask({summary:z.title,files:G.files??[]}),context:{workspace:G.workspace,baseBranch:z.base,branch:z.head},logger:H}),K=await _(G.workspace);if(K.length===0)return{mode:"none",changedFiles:[],verified:!1,comment:J.stopReason==="completed"?`**${j.description}** \u2014 nothing to change.`:`**${j.description}** \u2014 stopped before finishing (${J.stopReason}), and left nothing behind.`};let Q=J.stopReason==="completed",P=await E(G.workspace,G.testCommand);if(!(Q&&j.defaultOutput!=="suggestion"&&(P.passed||!P.ran)))return{mode:"suggestions",changedFiles:K,verified:P.passed,comment:X(j,K,P,J.stopReason)};let V=O(z,j.name);try{await I.createBranch(V,z.head),await I.commitChanges(V,`chore: ${j.description.toLowerCase()} for #${z.number}`,await x(G.workspace,K),z.head);let U=await I.createPullRequest({title:`${j.description} for #${z.number}`,body:y(j,z,K,P),head:V,base:z.head,labels:["buddy","finishing-touch"]});return{mode:"stacked-pr",pullRequest:U,changedFiles:K,verified:P.passed,comment:`**${j.description}** \u2014 opened [#${U.number}](${U.url}) targeting this branch.`+(P.ran?"":" No test script was found, so this is unverified.")}}catch(U){return H.warn(`\u26A0\uFE0F Could not open a stacked pull request: ${U}`),{mode:"suggestions",changedFiles:K,verified:P.passed,comment:X(j,K,P,J.stopReason)}}}async function _(G){let H=Bun.spawn(["git","status","--porcelain"],{cwd:G,stdout:"pipe",stderr:"ignore"}),[I,z]=await Promise.all([new Response(H.stdout).text(),H.exited]);if(z!==0)return[];let j=[];for(let J of I.split(`
4
4
  `)){if(!J.trim())continue;let K=J.slice(0,2),Q=J.slice(3).trim();if(K.includes("D"))continue;j.push(Q.includes(" -> ")?Q.split(" -> ")[1]:Q)}return j}async function x(G,H){let I=[];for(let z of H){let j=Bun.file(`${G}/${z}`);if(await j.exists())I.push({path:z,content:await j.text(),type:"update"})}return I}function y(G,H,I,z){return[`${G.description}, requested on #${H.number}.`,"",`This targets \`${H.head}\` rather than \`${H.base}\`, so merging it`,"adds these changes to that pull request.","",z.ran?z.passed?"\u2705 The repository's tests pass with these changes.":"\u26A0\uFE0F The repository's tests do **not** pass with these changes.":"\u2139\uFE0F No test script was found, so these changes are unverified.","","### Files changed","",...I.map((j)=>`- \`${j}\``)].join(`
5
5
  `)}function X(G,H,I,z){let j=[`**${G.description}**`,""];if(z&&z!=="completed")j.push(`The agent stopped before finishing (${z}), so what follows is`,"partial work rather than a complete change.","");if(I.ran&&!I.passed)j.push("The repository's tests do not pass with these changes, so no branch was","opened. Treat what follows as a starting point rather than a result.","");if(j.push("Files that would change:","",...H.map((J)=>`- \`${J}\``)),I.output)j.push("","<details><summary>Test output</summary>","","```",I.output,"```","","</details>");return j.join(`
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{qf as a,rf as b,sf as c,tf as d,uf as e,vf as f,wf as g}from"./chunk-d1yhv10h.js";import"./chunk-yj6xx2b8.js";import"./chunk-d73ympxb.js";import"./chunk-abfyz98y.js";import"./chunk-ak9s0vnr.js";import"./chunk-56q8k98m.js";import"./chunk-wkq57ssc.js";import"./chunk-b4a5gw9c.js";import"./chunk-bprmzg0p.js";import"./chunk-j3bzf5m0.js";import"./chunk-4sqwtry6.js";export{f as strategyAllows,b as ruleMatches,c as resolveRuleEffects,e as mergeGroupEffects,g as groupsToRules,a as ecosystemOf,d as applyRules};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Jc as a,Kc as b,Lc as c}from"./chunk-4m1vgh1w.js";import"./chunk-nz0ns7ah.js";import"./chunk-kypdeb29.js";import"./chunk-d73ympxb.js";import"./chunk-abfyz98y.js";import"./chunk-ak9s0vnr.js";import"./chunk-56q8k98m.js";import"./chunk-wkq57ssc.js";import"./chunk-b4a5gw9c.js";import"./chunk-bprmzg0p.js";import"./chunk-j3bzf5m0.js";import"./chunk-4sqwtry6.js";export{b as isWorkflowPermissionRefusal,a as WorkflowPermissionError,c as GitHubProvider};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{re as a,se as b,te as c,ue as d}from"./chunk-mtp0aygy.js";import"./chunk-bprmzg0p.js";import"./chunk-4sqwtry6.js";export{c as updateZigManifest,b as parseZigManifest,a as isZigManifest,d as generateZigManifestUpdates};
@@ -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 oh,L as ph,w as qh,N as rh,U as sh};
4
+ export{y as vh,L as wh,w as xh,N as yh,U as zh};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{qf as Q,rf as J}from"./chunk-08x5b93v.js";var L=`Verify your work before reporting it done: run the project's
2
+ import{xf as Q,yf as J}from"./chunk-ffb50kwa.js";var L=`Verify your work before reporting it done: run the project's
3
3
  tests or build if one exists. If verification fails, report what failed rather
4
4
  than claiming success \u2014 a change that looks right and breaks the build costs
5
5
  more than no change at all.`,X={name:"docstrings",description:"Add missing doc comments to changed public APIs",mode:J,defaultOutput:"commit",buildTask:({files:j})=>["Add missing documentation comments to the public APIs changed on this branch.","","Follow the documentation style already used in the surrounding code \u2014 match its","density and conventions rather than importing a different house style.","Document what a caller needs: parameters, return value, thrown errors, and any","constraint the signature does not already show. Do not restate what the code says.","","Do not document code that was not changed, and do not modify behaviour.",j?.length?`
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Cb as a,Db as b}from"./chunk-qmhd1bgx.js";import"./chunk-q2tjkhez.js";import"./chunk-5yfaptmp.js";import"./chunk-bxdbf2kj.js";import"./chunk-e6wny1pp.js";import"./chunk-k53ndvfv.js";import"./chunk-myswpb7z.js";import"./chunk-3nygvd78.js";import"./chunk-yj6xx2b8.js";import"./chunk-f7aw9cr3.js";import"./chunk-b4a5gw9c.js";import"./chunk-bprmzg0p.js";import"./chunk-4sqwtry6.js";export{b as runReviewForPR,a as reviewPullRequest};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ee as a,fe as b}from"./chunk-myswpb7z.js";import"./chunk-4sqwtry6.js";export{b as auditParsed,a as audit};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{vh as W}from"./chunk-wkq57ssc.js";import{Gh as y}from"./chunk-b4a5gw9c.js";import{Mh as J}from"./chunk-bprmzg0p.js";import{bl as F}from"./chunk-4sqwtry6.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
+ `);for(let K=0;K<j.length;K++){let Q=j[K].trim().match(/^-?\s*uses:\s*(.+)/);if(Q){let $=Q[1].trim().replace(/['"`]/g,"");if($.startsWith("./")||$.startsWith("docker://"))continue;let X=$.split("@");if(X.length===2){let[_,Y]=X;if(!_||!_.trim())continue;let[z,...k]=Y.split("#"),M=z.trim(),V={name:_.trim(),currentVersion:M,type:"github-actions",file:E};if(v(M)){let x=k.join("#").trim().split(/\s+/)[0];V.metadata=x?{pinnedSha:M,pinnedVersion:x}:{pinnedSha:M}}if(!I.find((x)=>x.name===V.name&&x.currentVersion===V.currentVersion))I.push(V)}}}return{path:E,type:"github-actions",content:q,dependencies:I}}catch(I){return J().warn(`Failed to parse GitHub Actions file ${E}:`,I),null}}function v(E){return/^[0-9a-f]{40}$/i.test(E)}function R(E,q){return E.replace(/^v/i,"")===q.replace(/^v/i,"")}async function U(E,q,I){try{if(!G(E))return q;let j=q;for(let K of I){let O=K.name.replace(/\s*\(.*\)$/,""),Z=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(K.resolved?.sha){let $=new RegExp(`((?:^\\s*-\\s*)?uses:\\s*["']?)(${Z})@(${K.currentVersion})(["']?)([ \\t]*#[^\\n]*)?`,"gm");j=j.replace($,`$1$2@${K.resolved.sha}$4 # ${K.newVersion}`);continue}let Q=new RegExp(`((?:^\\s*-\\s*)?uses:\\s*["']?)(${O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})@(${K.currentVersion.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})(["']?)`,"gm");j=j.replace(Q,`$1$2@${K.newVersion}$4`)}return j}catch(j){return J().warn(`Failed to update GitHub Actions file ${E}:`,j),q}}async function D(E){let q=[],I=new Map;for(let j of E)if(G(j.file)){if(!I.has(j.file))I.set(j.file,[]);I.get(j.file).push(j)}for(let[j,K]of I)try{let O=await import("fs");if(O.existsSync(j)){let Z=O.readFileSync(j,"utf-8"),Q=await U(j,Z,K);q.push({path:j,content:Q,type:"update"})}}catch(O){J().warn(`Failed to generate updates for GitHub Actions file ${j}:`,O)}return q}async function b(E,q){let[I,j]=E.split("/");if(!I||!j)return null;let K={Accept:"application/vnd.github.v3+json","User-Agent":"buddy"},O=S.env.BUDDY_TOKEN||S.env.GITHUB_TOKEN||S.env.GH_TOKEN;if(O)K.Authorization=`Bearer ${O}`;try{let Z=await y(`${W()}/repos/${I}/${j}/commits/${encodeURIComponent(q)}`,{headers:K});if(!Z.ok)return null;let Q=await Z.json();return Q.sha&&v(Q.sha)?Q.sha:null}catch{return null}}async function P(E){try{if(!E.includes("/"))return J().info(`\u26A0\uFE0F Invalid action name format: ${E}`),null;let[q,I]=E.split("/");J().info(`\uD83D\uDD0D Fetching latest version for ${q}/${I}`);let j={Accept:"application/vnd.github.v3+json","User-Agent":"buddy"},K=S.env.BUDDY_TOKEN||S.env.GITHUB_TOKEN||S.env.GH_TOKEN;if(K)j.Authorization=`Bearer ${K}`;let O=W();J().info(`\uD83D\uDCE1 Trying latest release for ${q}/${I}`);let Z=await y(`${O}/repos/${q}/${I}/releases/latest`,{headers:j});if(Z.ok){let X=await Z.json();if(X.tag_name)return J().info(`\u2705 Found latest release: ${X.tag_name}`),X.tag_name}else J().info(`\u26A0\uFE0F Latest release not found: ${Z.status} ${Z.statusText}`);J().info(`\uD83D\uDCE1 Trying all releases for ${q}/${I}`);let Q=await y(`${O}/repos/${q}/${I}/releases?per_page=10`,{headers:j});if(Q.ok){let X=await Q.json();if(!Array.isArray(X))J().info("\u26A0\uFE0F Unexpected releases response format (expected array)");else{J().info(`\uD83D\uDCCB Found ${X.length} releases`);let _=X.filter((Y)=>Y.tag_name&&!Y.tag_name.includes("-")).sort((Y,z)=>{let k=Y.published_at?new Date(Y.published_at).getTime():0;return(z.published_at?new Date(z.published_at).getTime():0)-k});if(_.length>0)return J().info(`\u2705 Found latest stable release: ${_[0].tag_name}`),_[0].tag_name||null}}else J().info(`\u26A0\uFE0F Releases not found: ${Q.status} ${Q.statusText}`);J().info(`\uD83D\uDCE1 Trying tags for ${q}/${I}`);let $=await y(`${O}/repos/${q}/${I}/tags?per_page=10`,{headers:j});if($.ok){let X=await $.json();if(!Array.isArray(X))J().info("\u26A0\uFE0F Unexpected tags response format (expected array)");else{J().info(`\uD83D\uDCCB Found ${X.length} tags`);let _=X.filter((Y)=>Y.name&&!Y.name.includes("-")).map((Y)=>Y.name).sort((Y,z)=>{let k=Y.replace(/^v/,""),M=z.replace(/^v/,""),V=k.split(".").map(Number),B=M.split(".").map(Number);for(let x=0;x<Math.max(V.length,B.length);x++){let H=V[x]||0,T=B[x]||0;if(H!==T)return T-H}return 0});if(_.length>0)return J().info(`\u2705 Found latest stable tag: ${_[0]}`),_[0]}}else J().info(`\u26A0\uFE0F Tags not found: ${$.status} ${$.statusText}`);return J().info(`\u274C No version found for ${E}`),null}catch(q){return J().warn(`Failed to fetch latest version for ${E}:`,q),null}}
4
+ export{G as ve,L as we,v as xe,R as ye,U as ze,D as Ae,b as Be,P as Ce};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{zh as U}from"./chunk-e68nf7cm.js";import{Fh as f}from"./chunk-hfjywbbc.js";var{Glob:u}=globalThis.Bun;import{readdir as m}from"fs/promises";import{join as P,relative as l}from"path";import O from"process";var c=new Set(["node_modules","vendor","target",".git",".venv","venv","dist","build","__pycache__",".next",".cache"]);function W(z){return z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async function L(z,H,$=4){let X=H.map((K)=>new u(K)),Z=[];async function J(K,G){if(G>$)return;let V=await m(K,{withFileTypes:!0}).catch(()=>[]);for(let Q of V){let j=P(K,Q.name);if(Q.isDirectory()){if(!c.has(Q.name)&&!Q.name.startsWith("."))await J(j,G+1);continue}let q=l(z,j);if(X.some((Y)=>Y.match(Q.name)||Y.match(q)))Z.push(q)}}return await J(z,0),Z.sort()}async function M(z,H){let $=[],X=[];for(let Z of H){if(!await Bun.file(P(z,Z.lockfile)).exists())continue;let[J]=Z.command;if(!await E(J)){X.push(`${Z.lockfile} (needs \`${Z.command.join(" ")}\`)`);continue}if(await Bun.spawn(Z.command,{cwd:z,stdout:"ignore",stderr:"ignore",env:{PATH:O.env.PATH??"",HOME:O.env.HOME??""}}).exited===0)$.push(Z.lockfile);else X.push(`${Z.lockfile} (\`${Z.command.join(" ")}\` failed)`)}return{regenerated:$,...X.length>0?{note:`These lockfiles were not regenerated and need updating locally: ${X.join(", ")}.`}:{}}}async function E(z){try{return await Bun.spawn(["which",z],{stdout:"ignore",stderr:"ignore",env:{PATH:O.env.PATH??""}}).exited===0}catch{return!1}}function B(z,H){let $=(J)=>J.replace(/^[^\d]*/,"").split(/[.-]/).map((K)=>Number.parseInt(K,10)||0),X=$(z),Z=$(H);for(let J=0;J<Math.max(X.length,Z.length);J++){let K=(X[J]??0)-(Z[J]??0);if(K!==0)return K}return 0}function C(z,H){let $=(J)=>J.replace(/^[^\d]*/,"").split(/[.-]/).map((K)=>Number.parseInt(K,10)||0),X=$(z),Z=$(H);if((X[0]??0)!==(Z[0]??0))return"major";if((X[1]??0)!==(Z[1]??0))return"minor";return"patch"}var p=/^\s*(?:require\s+)?([\w.~-]+(?:\.[\w.~-]+)*\/[^\s]+)\s+(v[\w.+-]+)\s*(\/\/.*)?$/,R=/^v\d+\.\d+\.\d+-\d{14}-[a-f0-9]{12}$/,I={name:"go",manifestPatterns:["go.mod"],async detect(z){return L(z,this.manifestPatterns)},async parse(z,H){let $=[],X=!1;for(let Z of H.split(`
2
+ import{Gh as U}from"./chunk-b4a5gw9c.js";import{Mh as f}from"./chunk-bprmzg0p.js";var{Glob:u}=globalThis.Bun;import{readdir as m}from"fs/promises";import{join as P,relative as l}from"path";import O from"process";var c=new Set(["node_modules","vendor","target",".git",".venv","venv","dist","build","__pycache__",".next",".cache"]);function W(z){return z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async function L(z,H,$=4){let X=H.map((K)=>new u(K)),Z=[];async function J(K,G){if(G>$)return;let V=await m(K,{withFileTypes:!0}).catch(()=>[]);for(let Q of V){let j=P(K,Q.name);if(Q.isDirectory()){if(!c.has(Q.name)&&!Q.name.startsWith("."))await J(j,G+1);continue}let q=l(z,j);if(X.some((Y)=>Y.match(Q.name)||Y.match(q)))Z.push(q)}}return await J(z,0),Z.sort()}async function M(z,H){let $=[],X=[];for(let Z of H){if(!await Bun.file(P(z,Z.lockfile)).exists())continue;let[J]=Z.command;if(!await E(J)){X.push(`${Z.lockfile} (needs \`${Z.command.join(" ")}\`)`);continue}if(await Bun.spawn(Z.command,{cwd:z,stdout:"ignore",stderr:"ignore",env:{PATH:O.env.PATH??"",HOME:O.env.HOME??""}}).exited===0)$.push(Z.lockfile);else X.push(`${Z.lockfile} (\`${Z.command.join(" ")}\` failed)`)}return{regenerated:$,...X.length>0?{note:`These lockfiles were not regenerated and need updating locally: ${X.join(", ")}.`}:{}}}async function E(z){try{return await Bun.spawn(["which",z],{stdout:"ignore",stderr:"ignore",env:{PATH:O.env.PATH??""}}).exited===0}catch{return!1}}function B(z,H){let $=(J)=>J.replace(/^[^\d]*/,"").split(/[.-]/).map((K)=>Number.parseInt(K,10)||0),X=$(z),Z=$(H);for(let J=0;J<Math.max(X.length,Z.length);J++){let K=(X[J]??0)-(Z[J]??0);if(K!==0)return K}return 0}function C(z,H){let $=(J)=>J.replace(/^[^\d]*/,"").split(/[.-]/).map((K)=>Number.parseInt(K,10)||0),X=$(z),Z=$(H);if((X[0]??0)!==(Z[0]??0))return"major";if((X[1]??0)!==(Z[1]??0))return"minor";return"patch"}var p=/^\s*(?:require\s+)?([\w.~-]+(?:\.[\w.~-]+)*\/[^\s]+)\s+(v[\w.+-]+)\s*(\/\/.*)?$/,R=/^v\d+\.\d+\.\d+-\d{14}-[a-f0-9]{12}$/,I={name:"go",manifestPatterns:["go.mod"],async detect(z){return L(z,this.manifestPatterns)},async parse(z,H){let $=[],X=!1;for(let Z of H.split(`
3
3
  `)){let J=Z.trim();if(/^require\s*\($/.test(J)){X=!0;continue}if(X&&J===")"){X=!1;continue}if(!X&&!J.startsWith("require "))continue;let K=p.exec(Z);if(!K)continue;let[,G,V,Q]=K;if(Q?.includes("indirect"))continue;if(R.test(V))continue;$.push({name:G,currentVersion:V,section:"require",file:z})}return $},async latest(z,H={}){let $=H.registryUrl??"https://proxy.golang.org",X=z.name.replace(/[A-Z]/g,(K)=>`!${K.toLowerCase()}`),Z=await U(`${$}/${X}/@latest`,{headers:{"User-Agent":"buddy",Accept:"application/json"}}).catch(()=>null);if(!Z?.ok)return null;let J=await Z.json().catch(()=>null);if(!J?.Version)return null;if(R.test(J.Version))return null;return{latest:J.Version,...J.Time?{publishedAt:new Date(J.Time)}:{},releaseNotesUrl:`https://pkg.go.dev/${z.name}@${J.Version}`,homepage:`https://pkg.go.dev/${z.name}`}},applyUpdate(z,H){let $=W(H.name),X=W(H.currentVersion);return z.replace(new RegExp(`^(\\s*(?:require\\s+)?${$}\\s+)${X}(\\s|$)`,"gm"),`$1${H.newVersion}$2`)},async postWrite(z){return M(z,[{lockfile:"go.sum",command:["go","mod","tidy"]}])},osvEcosystem:"Go",compareVersions:B,updateType:C};var s=/^\s*v?(?:(\d+)!)?(\d+(?:\.\d+)*)((?:[-_.]?(?:a|b|c|rc|alpha|beta|pre|preview)[-_.]?\d*)?)((?:[-_.]?(?:post|rev|r)[-_.]?\d*|-\d+)?)((?:[-_.]?dev[-_.]?\d*)?)(?:\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?\s*$/i,i={a:"a",alpha:"a",b:"b",beta:"b",c:"rc",rc:"rc",pre:"rc",preview:"rc"},v={a:0,b:1,rc:2};function S(z){let H=s.exec(z);if(!H)return null;let[,$,X,Z,J,K,G]=H,V={epoch:$?Number($):0,release:X.split(".").map(Number)};if(Z){let Q=/([a-z]+)[-_.]?(\d*)/i.exec(Z);if(Q){let j=i[Q[1].toLowerCase()];if(j)V.pre=[j,Q[2]?Number(Q[2]):0]}}if(J){let Q=/(\d+)/.exec(J);V.post=Q?Number(Q[1]):0}if(K){let Q=/(\d+)/.exec(K);V.dev=Q?Number(Q[1]):0}if(G)V.local=G.toLowerCase();return V}function d(z,H){for(let $=0;$<Math.max(z.length,H.length);$++){let X=(z[$]??0)-(H[$]??0);if(X!==0)return X}return 0}function A(z,H){let $=S(z),X=S(H);if(!$||!X)return z===H?0:z<H?-1:1;if($.epoch!==X.epoch)return $.epoch-X.epoch;let Z=d($.release,X.release);if(Z!==0)return Z;let J=(Q)=>{if(Q.dev!==void 0&&Q.pre===void 0&&Q.post===void 0)return 0;if(Q.pre!==void 0)return 1;if(Q.post!==void 0)return 3;return 2},K=J($)-J(X);if(K!==0)return K;if($.pre&&X.pre){let Q=v[$.pre[0]]-v[X.pre[0]];if(Q!==0)return Q;if($.pre[1]!==X.pre[1])return $.pre[1]-X.pre[1]}if(($.post??0)!==(X.post??0))return($.post??0)-(X.post??0);let G=$.dev??Number.POSITIVE_INFINITY,V=X.dev??Number.POSITIVE_INFINITY;if(G!==V)return G<V?-1:1;return 0}function g(z){let H=S(z);return Boolean(H&&(H.pre!==void 0||H.dev!==void 0))}function D(z,H){let $=S(z),X=S(H);if(!$||!X)return"patch";if($.epoch!==X.epoch||($.release[0]??0)!==(X.release[0]??0))return"major";if(($.release[1]??0)!==(X.release[1]??0))return"minor";return"patch"}function N(z){let H=/^\s*(~=|===|==|!=|<=|>=|<|>|\^)?\s*(.*)$/.exec(z.trim());if(!H)return{operator:"",version:z.trim()};return{operator:H[1]??"",version:H[2].trim()}}var b=/^\s*([A-Z0-9][\w.-]*)\s*(\[[^\]]*\])?\s*([<>=!~^].*?)?\s*(?:;.*)?$/i,o=/^\s*(?:-|#|$)/;function r(z,H){let $=[];return H.split(`
4
4
  `).forEach((X)=>{let Z=X.split("#")[0];if(o.test(Z))return;let J=b.exec(Z);if(!J?.[1]||!J[3])return;$.push({name:J[1],currentVersion:J[3].trim(),section:"dependencies",file:z,...J[2]?{metadata:{extras:J[2]}}:{}})}),$}var a=[[/^\s*dependencies\s*=\s*\[/m,"dependencies"],[/^\s*(?:dev-dependencies|dev)\s*=\s*\[/m,"devDependencies"]];function n(z,H){let $=[],X=new Set,Z=(K,G,V)=>{let Q=`${V}:${K}`;if(!G.trim()||G.trim()==="*"||X.has(Q))return;X.add(Q),$.push({name:K,currentVersion:G.trim(),section:V,file:z})};for(let[K,G]of a){let V=K.exec(H);if(!V)continue;let Q=V.index+V[0].length,j=H.indexOf("]",Q);if(j===-1)continue;for(let q of H.slice(Q,j).matchAll(/["']([^"']+)["']/g)){let Y=b.exec(q[1]);if(Y?.[1]&&Y[3])Z(Y[1],Y[3],G)}}let J=H.matchAll(/\[tool\.poetry\.(?:group\.[\w-]+\.)?(dependencies|dev-dependencies)\]([\s\S]*?)(?=\n\[|$)/g);for(let K of J){let G=K[1]==="dependencies"?"dependencies":"devDependencies";for(let V of K[2].matchAll(/^\s*([A-Z0-9][\w.-]*)\s*=\s*(.+)$/gim)){let Q=V[1];if(Q.toLowerCase()==="python")continue;let j=V[2].trim(),q=/version\s*=\s*["']([^"']+)["']/.exec(j),Y=/^["']([^"']+)["']/.exec(j),F=q?.[1]??Y?.[1];if(F)Z(Q,F,G)}}return $}var w={name:"python",manifestPatterns:["pyproject.toml","requirements.txt","requirements-*.txt","requirements/*.txt"],async detect(z){return L(z,this.manifestPatterns)},async parse(z,H){return z.endsWith(".toml")?n(z,H):r(z,H)},async latest(z,H={}){let $=H.registryUrl??"https://pypi.org",X=await U(`${$}/pypi/${encodeURIComponent(z.name)}/json`,{headers:{"User-Agent":"buddy",Accept:"application/json"}}).catch(()=>null);if(!X?.ok)return null;let Z=await X.json().catch(()=>null);if(!Z?.info?.version)return null;let J=Z.info.version;if(H.includePrerelease&&Z.releases){let V=Object.keys(Z.releases).filter((Q)=>!Z.releases[Q]?.every((j)=>j.yanked)).sort(A);J=V[V.length-1]??J}let G=Z.releases?.[J]?.find((V)=>V.upload_time_iso_8601)?.upload_time_iso_8601;return{latest:J,...G?{publishedAt:new Date(G)}:{},...Z.info.yanked?{deprecated:!0}:{},...Z.info.project_urls?.Changelog?{releaseNotesUrl:Z.info.project_urls.Changelog}:{},...Z.info.home_page?{homepage:Z.info.home_page}:{}}},applyUpdate(z,H){let{operator:$}=N(H.currentVersion),X=W(H.name),Z=W(H.currentVersion),J=N(H.newVersion).version,K=$?`${$}${J}`:J;return z.replace(new RegExp(`(^|["'\\s])(${X})(\\[[^\\]]*\\])?\\s*${Z}`,"gim"),(G,V,Q,j)=>`${V}${Q}${j??""}${K}`).replace(new RegExp(`^(\\s*${X}\\s*=\\s*["'])${Z}(["'])`,"gim"),`$1${K}$2`).replace(new RegExp(`^(\\s*${X}\\s*=\\s*\\{[^}]*version\\s*=\\s*["'])${Z}(["'])`,"gim"),`$1${K}$2`)},async postWrite(z){return M(z,[{lockfile:"uv.lock",command:["uv","lock"]},{lockfile:"poetry.lock",command:["poetry","lock","--no-update"]}])},osvEcosystem:"PyPI",compareVersions:A,updateType:D};var t=/^\s*gem\s+["']([\w-]+)["']\s*(?:,\s*["']([^"']+)["'])?/,e=/^\s*group\s+(.+?)\s+do\s*$/,zz=/^\s*end\s*$/,x={name:"ruby",manifestPatterns:["Gemfile","*.gemspec"],async detect(z){return L(z,this.manifestPatterns)},async parse(z,H){let $=[],X=[];for(let Z of H.split(`
5
5
  `)){let J=Z.replace(/#.*$/,""),K=e.exec(J);if(K){X.push(K[1].replace(/[:'",\s]/g,"")||"default");continue}if(zz.test(J)){X.pop();continue}let G=t.exec(J);if(!G?.[1])continue;if(!G[2])continue;if(/\b(?:path|git|github|branch):/.test(J))continue;$.push({name:G[1],currentVersion:G[2],section:X.length>0?X[X.length-1]:"dependencies",file:z})}return $},async latest(z,H={}){let $=H.registryUrl??"https://rubygems.org",X=await U(`${$}/api/v1/versions/${encodeURIComponent(z.name)}.json`,{headers:{"User-Agent":"buddy",Accept:"application/json"}}).catch(()=>null);if(!X?.ok)return null;let Z=await X.json().catch(()=>null);if(!Array.isArray(Z)||Z.length===0)return null;let J=Z.filter((G)=>G.number&&!G.yanked).filter((G)=>H.includePrerelease?!0:!G.prerelease).sort((G,V)=>B(G.number,V.number)),K=J[J.length-1];if(!K?.number)return null;return{latest:K.number,...K.created_at?{publishedAt:new Date(K.created_at)}:{},homepage:`${$}/gems/${z.name}`}},applyUpdate(z,H){let $=W(H.name),X=W(H.currentVersion),Z=/^\s*(~>|>=|<=|>|<|=)?\s*/.exec(H.currentVersion)?.[1]??"",J=Z?`${Z} ${H.newVersion}`:H.newVersion;return z.replace(new RegExp(`^(\\s*gem\\s+["']${$}["']\\s*,\\s*["'])${X}(["'])`,"gm"),`$1${J}$2`)},async postWrite(z){return M(z,[{lockfile:"Gemfile.lock",command:["bundle","lock","--update"]}])},osvEcosystem:"RubyGems",compareVersions:B,updateType:C};var Hz=[[/^\[dependencies\]/m,"dependencies"],[/^\[dev-dependencies\]/m,"devDependencies"],[/^\[build-dependencies\]/m,"buildDependencies"],[/^\[workspace\.dependencies\]/m,"workspaceDependencies"]],T={name:"rust",manifestPatterns:["Cargo.toml"],async detect(z){return L(z,this.manifestPatterns)},async parse(z,H){let $=[];for(let[X,Z]of Hz){let J=X.exec(H);if(!J)continue;let K=J.index+J[0].length,G=H.slice(K).search(/\n\[/),V=G===-1?H.slice(K):H.slice(K,K+G);for(let Q of V.matchAll(/^\s*([\w-]+)\s*=\s*(.+)$/gm)){let j=Q[1],q=Q[2].trim(),Y=/version\s*=\s*["']([^"']+)["']/.exec(q),F=/^["']([^"']+)["']/.exec(q),_=Y?.[1]??F?.[1];if(!_||/\b(?:path|git)\s*=/.test(q))continue;$.push({name:j,currentVersion:_,section:Z,file:z})}}return $},async latest(z,H={}){let $=H.registryUrl??"https://crates.io",X=await U(`${$}/api/v1/crates/${encodeURIComponent(z.name)}`,{headers:{"User-Agent":"buddy (https://buddy.sh)",Accept:"application/json"}}).catch(()=>null);if(!X?.ok)return null;let Z=await X.json().catch(()=>null);if(!Z?.crate)return null;let J=H.includePrerelease?Z.crate.newest_version??Z.crate.max_stable_version:Z.crate.max_stable_version??Z.crate.newest_version;if(!J)return null;let K=Z.versions?.find((G)=>G.num===J);if(K?.yanked)return null;return{latest:J,...K?.created_at?{publishedAt:new Date(K.created_at)}:{},...Z.crate.repository?{releaseNotesUrl:`${Z.crate.repository}/releases`}:{},...Z.crate.homepage?{homepage:Z.crate.homepage}:{}}},applyUpdate(z,H){let $=W(H.name),X=W(H.currentVersion);return z.replace(new RegExp(`^(\\s*${$}\\s*=\\s*["'])${X}(["'])`,"gm"),`$1${H.newVersion}$2`).replace(new RegExp(`^(\\s*${$}\\s*=\\s*\\{[^}]*?version\\s*=\\s*["'])${X}(["'])`,"gm"),`$1${H.newVersion}$2`)},async postWrite(z){return M(z,[{lockfile:"Cargo.lock",command:["cargo","update","--workspace"]}])},osvEcosystem:"crates.io",compareVersions:B,updateType:C};import{join as Xz}from"path";async function Zz(z){let H=z.logger??f(),$=z.adapters??k,X=new Set(z.ignore??[]),Z=[],J={},K=[];return await Promise.all($.map(async(G)=>{let V;try{V=await G.detect(z.dir)}catch(Q){H.warn(`\u26A0\uFE0F ${G.name}: could not look for manifests: ${Q}`);return}if(V.length===0)return;K.push({ecosystem:G.name,files:V}),H.debug(`\uD83D\uDCE6 ${G.name}: ${V.length} manifest(s)`);for(let Q of V){let j;try{j=await G.parse(Q,await Bun.file(Xz(z.dir,Q)).text())}catch(Y){H.warn(`\u26A0\uFE0F ${G.name}: could not parse ${Q}: ${Y}`);continue}J[G.name]=(J[G.name]??0)+j.length;let q=await Promise.all(j.map(async(Y)=>{if(X.has(Y.name))return null;try{let F=await G.latest(Y,{...z.includePrerelease!==void 0?{includePrerelease:z.includePrerelease}:{},logger:H});if(!F)return null;let _=y(Y.currentVersion);if(G.compareVersions(F.latest,_)<=0)return null;return{name:Y.name,currentVersion:Y.currentVersion,newVersion:F.latest,updateType:G.updateType(_,F.latest),dependencyType:G.name,file:Q,...F.releaseNotesUrl?{releaseNotesUrl:F.releaseNotesUrl}:{},...F.homepage?{homepage:F.homepage}:{}}}catch(F){return H.debug(`${G.name}: could not resolve ${Y.name}: ${F}`),null}}));Z.push(...q.filter((Y)=>Y!==null))}})),{updates:Z,dependenciesByEcosystem:J,manifests:K}}function y(z){let H=/(\d[\w.!+-]*)/.exec(z);return H?H[1]:z.trim()}async function $z(z,H,$=k){let X=[],Z=[];for(let J of $){if(!H.includes(J.name)||!J.postWrite)continue;let K=await J.postWrite(z).catch(()=>({regenerated:[],note:void 0}));if(X.push(...K.regenerated),K.note)Z.push(K.note)}return{regenerated:X,notes:Z}}var k=[w,T,I,x];function Ez(z,H=k){let $=z.split("/").pop()??z;for(let X of H)if(X.manifestPatterns.some((Z)=>h($,Z)||h(z,Z)))return X;return null}function h(z,H){if(!H.includes("*"))return z===H;let $=H.split("*").map((X)=>X.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join("[^/]*");return new RegExp(`^${$}$`).test(z)}function Rz(z,H=k){return H.find(($)=>$.name===z)??null}
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var{Glob:F}=globalThis.Bun;function K(k){if(!k||k.length===0)return{matches:()=>!0};let q=k.map((j)=>{let B=j.startsWith("!"),C=B?j.slice(1):j;return{negated:B,glob:new F(C),pattern:C}}),D=q.some((j)=>!j.negated);return{matches(j){let B=j.replace(/^\.\//,""),C=!D;for(let E of q){if(!H(E.glob,B))continue;C=!E.negated}return C}}}function L(k,q){if(!q?.length)return[];let D=k.replace(/^\.\//,"");return q.filter((j)=>H(new F(j.path),D)).sort((j,B)=>j.path.length-B.path.length).map((j)=>j.instructions)}function H(k,q){try{return k.match(q)}catch{return!1}}
3
- export{K as Jf,L as Kf};
3
+ export{K as Qf,L as Rf};
@@ -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-q4t568hv.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-4sqwtry6.js";export{c as findDrift,a as driftFor,d as describeDrift,b as ROOT};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{fc as F}from"./chunk-tjc2vgwn.js";import{tf as c}from"./chunk-08x5b93v.js";import{Ff as E,If as A}from"./chunk-p6qbqsyp.js";import{Fh as m}from"./chunk-hfjywbbc.js";function S(T,f,r){let O=r?"pull request":"issue";return{name:"read_issue",tier:"read",description:`Read the ${O} this task is about: its title and description.`,parameters:{type:"object",properties:{}},async run(M,x){try{let e=r?(await T.getPullRequests("all")).find((h)=>h.number===f):(await T.getIssues("all")).find((h)=>h.number===f);if(!e)return{content:`Could not find ${O} #${f}.`,isError:!0};let k=(e.body??"").slice(0,20000);return x.log(`read ${O} #${f}`),{content:`# ${e.title}
2
+ import{fc as F}from"./chunk-e6wny1pp.js";import{Af as c}from"./chunk-ffb50kwa.js";import{Mf as E,Pf as A}from"./chunk-47ancrn1.js";import{Mh as m}from"./chunk-bprmzg0p.js";function S(T,f,r){let O=r?"pull request":"issue";return{name:"read_issue",tier:"read",description:`Read the ${O} this task is about: its title and description.`,parameters:{type:"object",properties:{}},async run(M,x){try{let e=r?(await T.getPullRequests("all")).find((h)=>h.number===f):(await T.getIssues("all")).find((h)=>h.number===f);if(!e)return{content:`Could not find ${O} #${f}.`,isError:!0};let k=(e.body??"").slice(0,20000);return x.log(`read ${O} #${f}`),{content:`# ${e.title}
3
3
 
4
4
  ${k||"(no description)"}`,untrusted:!0}}catch(e){return{content:`Could not read ${O} #${f}: ${e instanceof Error?e.message:String(e)}`,isError:!0}}}}}async function C(T){let f=T.logger??m(),r=F(T.config,f);if(!r)return"I need an AI provider configured to write a plan. See https://buddy.sh/ai/providers";let M=[`Write an implementation plan for ${T.isPullRequest?"pull request":"issue"} #${T.number} in this repository.`,"","Call `read_issue` first to see what is being asked for, then read enough of","the repository to be concrete about it.",...T.request?["","The person asking added this direction, which comes from them rather than","from the repository:",` ${T.request.replace(/\n/g," ")}`]:[],"","Produce: the files that would change and why, the order of the work, the","risks, and how the result would be verified. Prefer naming real paths you","have read over describing the change in the abstract.","","If the request is too vague to plan, say what you would need to know","instead of inventing a plan around the gap."].join(`
5
5
  `),x=await A(r,{mode:c,task:M,tools:[...E,S(T.provider,T.number,T.isPullRequest)],context:{workspace:T.workspace??process.cwd(),baseBranch:T.config.repository?.baseBranch??"main"},logger:f});if(!x.output)return x.stopReason==="completed"?"I finished researching but produced no plan. That is a bug \u2014 please open an issue.":`I could not finish the plan (${x.stopReason}). The issue may need narrowing.`;return x.output}export{S as Va,C as Wa};
@@ -13,4 +13,4 @@ var G=["pretty","json","github","agent"];function Q(k,j){switch(k){case"staged":
13
13
  `);if(j<1||j>z.length)return null;return z.splice(j-1,1,...q.split(`
14
14
  `)),z.join(`
15
15
  `)}function P(k,j="major"){let q=["critical","major","minor","nit"],z=q.indexOf(j);return k.some((D)=>q.indexOf(D.severity)<=z)}
16
- export{G as yd,Q as zd,L as Ad,X as Bd,Z as Cd,$ as Dd,B as Ed,N as Fd,O as Gd,P as Hd};
16
+ export{G as Cd,Q as Dd,L as Ed,X as Fd,Z as Gd,$ as Hd,B as Id,N as Jd,O as Kd,P as Ld};
@@ -1,5 +1,7 @@
1
1
  import type { FileChange, Issue, IssueOptions, PullRequest, PullRequestOptions } from '../types';
2
2
  import type { GitProvider, ListWorkflowRunsOptions, ProviderCapabilities, ReviewThread, WorkflowRun } from './provider';
3
+ /** Whether a push was refused for touching workflow files without permission. */
4
+ export declare function isWorkflowPermissionRefusal(error: unknown): boolean;
3
5
  /**
4
6
  * Thrown when lockfile regeneration fails. Not a transient git error —
5
7
  * must bubble past the API fallback so we don't silently open a PR with
@@ -8,6 +10,15 @@ import type { GitProvider, ListWorkflowRunsOptions, ProviderCapabilities, Review
8
10
  declare class LockfileRegenerationError extends Error {
9
11
  constructor(message: string);
10
12
  }
13
+ /**
14
+ * Thrown when GitHub refuses a push because the token may not touch
15
+ * `.github/workflows/` - a GitHub App without the Workflows permission, or a
16
+ * PAT without the `workflow` scope. The API path is refused for the same
17
+ * reason, so falling back to it only turns a permission gap into a failed run.
18
+ */
19
+ export declare class WorkflowPermissionError extends Error {
20
+ constructor(message: string);
21
+ }
11
22
  export declare class GitHubProvider implements GitProvider {
12
23
  constructor(token: string, owner: string, repo: string, hasWorkflowPermissions?: boolean, workflowToken?: string);
13
24
  capabilities(): ProviderCapabilities;
@@ -17,6 +28,7 @@ export declare class GitHubProvider implements GitProvider {
17
28
  commitChanges(branchName: string, message: string, files: FileChange[], baseBranch?: string): Promise<void>;
18
29
  createPullRequest(options: PullRequestOptions): Promise<PullRequest>;
19
30
  runCommand(command: string, args: string[], tokenOverride?: string): Promise<string>;
31
+ getPullRequestFiles(number: number): Promise<string[]>;
20
32
  getPullRequests(state?: 'open' | 'closed' | 'all'): Promise<PullRequest[]>;
21
33
  updatePullRequest(prNumber: number, options: Partial<PullRequestOptions>): Promise<PullRequest>;
22
34
  closePullRequest(prNumber: number): Promise<void>;
@@ -193,6 +193,7 @@ export declare interface GitProvider {
193
193
  deleteBranch: (branchName: string) => Promise<void>
194
194
  commitChanges: (branchName: string, message: string, files: FileChange[], baseBranch?: string) => Promise<void>
195
195
  getFileContent: (path: string, ref: string) => Promise<string | null>
196
+ getPullRequestFiles?: (number: number) => Promise<string[]>
196
197
  createPullRequest: (options: PullRequestOptions) => Promise<PullRequest>
197
198
  getPullRequests: (state?: 'open' | 'closed' | 'all') => Promise<PullRequest[]>
198
199
  updatePullRequest: (prNumber: number, options: Partial<PullRequestOptions>) => Promise<PullRequest>
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-0w695m54.js";import{W as ko,X as qo}from"../chunk-rayxmbcx.js";import{$ as Wo,Y as Jo,Z as Ko,_ as Qo}from"../chunk-jnb80k2x.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-fjp3a7hp.js";import{Aa as $o,Ba as bo,Ca as to,xa as Xo,ya as Yo,za as Zo}from"../chunk-3cvng2nz.js";import"../chunk-rb1fh9vd.js";import{Da as pm}from"../chunk-jz5zs812.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-yr8eta7p.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-96ht6hwd.js";import{Va as Yf,Wa as Zf}from"../chunk-s6z3gm2s.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-s4zb0fcj.js";import{hb as vf,ib as sf,jb as nf,kb as pd,lb as od}from"../chunk-tw047td6.js";import{mb as Id}from"../chunk-patms7t8.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-4jyw358y.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-rc2mk5x6.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-tjc2vgwn.js";import{gc as Vp,hc as ep,ic as gp,jc as rp,mc as vp,nc as ip}from"../chunk-61xecp1z.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-6p4qz8qv.js";import{Jc as dp}from"../chunk-bmnx3s41.js";import{Kc as mp,Lc as xp,Mc as fp}from"../chunk-8fw0v7bv.js";import{Oc as mm,Pc as xm,Qc as fm,Rc as dm}from"../chunk-ngh4jbgp.js";import{Sc as Bo,Tc as Fo,Uc as Ho}from"../chunk-cs066zt9.js";import{Vc as Sp,Wc as hp,Xc as up,Yc as cp,_c as Do}from"../chunk-e2t5jq26.js";import"../chunk-phfmnnne.js";import{ad as _p,bd as zp,cd as Dp,dd as Tp,ed as jp}from"../chunk-r763e19p.js";import{fd as wp}from"../chunk-be629jhq.js";import"../chunk-pkr6905p.js";import{hd as ex,id as gx,jd as rx,kd as vx}from"../chunk-eseshkd0.js";import{nd as Np}from"../chunk-11hdrnf6.js";import{od as Xf}from"../chunk-cwfkm7h9.js";import{pd as $x,qd as bx,rd as tx,sd as wx,td as Sx,ud as hx,vd as ux,wd as cx,xd as Vx}from"../chunk-mkzmjg3f.js";import{Ad as kd,Bd as qd,Cd as Jd,Dd as Kd,Ed as Qd,Fd as Wd,Gd as Xd,Hd as Yd,yd as Fd,zd as Hd}from"../chunk-vgtmrd4c.js";import{$d as Wf,Id as lf,Jd as yf,Kd as Cf,Ld as Nf,Md as _f,Nd as zf,Od as Df,Pd as Tf,Qd as jf,Rd as If,Sd as Lf,Td as Bf,Ud as Ff,Vd as Hf,Wd as kf,Xd as qf,Yd as Jf,Zd as Kf,_d as Qf}from"../chunk-nrr8z2z7.js";import"../chunk-xs12dtf1.js";import{ce as Rp,de as Mp,ee as Up,fe as Ap,ge as Gp,he as Ep,ie as Op,je as Pp,ke as ap,le as lp,me as yp}from"../chunk-5av2vnvv.js";import"../chunk-ytmxd5fk.js";import{Ae as Kp,Be as Qp,Ce as Wp,se as Ip,te as Lp,ue as Bp,ve as Fp,we as Hp,xe as kp,ye as qp,ze as Jp}from"../chunk-b9escac0.js";import{Je as Cp}from"../chunk-g30dr44w.js";import{Ke as Xp,Le as Yp,Me as Zp,Ne as $p,Oe as bp,Pe as tp}from"../chunk-2et8yavs.js";import"../chunk-txtrpypt.js";import{$e as _,We as a,Xe as l,Ye as y,Ze as C,_e as N,af as z,bf as D,cf as T,df as j,ef as I,ff as L,gf as B,hf as F,if as H}from"../chunk-8hjvthz4.js";import{jf as U,kf as A,lf as G,mf as E,nf as O,pf as P}from"../chunk-yngahb11.js";import{qf as Px,rf as ax,sf as lx,tf as yx,uf as Cx,vf as Nx}from"../chunk-08x5b93v.js";import{Af as kx,Bf as qx,Cf as Jx,Df as Kx,Ef as Qx,Ff as Wx,Gf as Xx,Hf as Yx,If as Zx,wf as Lx,xf as Bx,yf as Fx,zf as Hx}from"../chunk-p6qbqsyp.js";import"../chunk-1cpdz49v.js";import{Lf as _x,Mf as zx,Nf as Dx,Of as Tx,Pf as jx,Qf as Ix}from"../chunk-cgvt98pd.js";import"../chunk-c8rzx3a1.js";import{$f as pp,Uf as e,Vf as g,Wf as r,Xf as v,Yf as i,Zf as s,_f as n,ag as op,bg as d}from"../chunk-0hc97k0t.js";import"../chunk-3901s7h9.js";import"../chunk-jtxcr5yw.js";import"../chunk-qd2s51gc.js";import{$g as JR,Og as To,Pg as jo,Qg as Io,Rg as Lo,Tg as jR,Ug as IR,Vg as LR,Wg as BR,Xg as FR,Yg as HR,Zg as kR,_g as qR,ah as KR,bh as QR,ch as WR,dh as XR,eh as YR,fh as ZR,gh as $R,hh as bR,ih as tR,jh as wR,kh as SR,lh as hR,mh as uR}from"../chunk-vbeeyhhe.js";import{nh as om}from"../chunk-k26wnmzk.js";import{oh as S,ph as h,qh as u,rh as c,sh as V}from"../chunk-193abzy6.js";import{th as t}from"../chunk-5044y9en.js";import{uh as w}from"../chunk-f53y8ans.js";import{Ah as Y,vh as J,wh as K,xh as Q,yh as W,zh as X}from"../chunk-e68nf7cm.js";import{Bh as k,Ch as q,Dh as Z,Eh as $,Fh as b}from"../chunk-hfjywbbc.js";import"../chunk-g24hav8e.js";import"../chunk-q4t568hv.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-kbkvw42w.js";import{W as ko,X as qo}from"../chunk-5bedx7s3.js";import{$ as Wo,Y as Jo,Z as Ko,_ as Qo}from"../chunk-3k62kevg.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-nj38e2km.js";import{Aa as $o,Ba as bo,Ca as to,xa as Xo,ya as Yo,za as Zo}from"../chunk-rp3ytb19.js";import"../chunk-rb1fh9vd.js";import{Da as pm}from"../chunk-nf9dfx4t.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-2vmaeyh3.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-43p5vzvb.js";import{Va as Yf,Wa as Zf}from"../chunk-zhfrmseh.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-wsxy4w86.js";import{hb as vf,ib as sf,jb as nf,kb as pd,lb as od}from"../chunk-tvrz1xp5.js";import{mb as Id}from"../chunk-erbqszzp.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-qmhd1bgx.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-bxdbf2kj.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-e6wny1pp.js";import{gc as Vp,hc as ep,ic as gp,jc as rp,mc as vp,nc as ip}from"../chunk-95je030a.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-y1hppm93.js";import{Lc as dp}from"../chunk-4m1vgh1w.js";import{Mc as mp,Nc as xp,Oc as fp}from"../chunk-nz0ns7ah.js";import{Sc as mm,Tc as xm,Uc as fm,Vc as dm}from"../chunk-1zz8bd1c.js";import{Wc as Bo,Xc as Fo,Yc as Ho}from"../chunk-ej7gpg23.js";import{$c as up,Zc as Sp,_c as hp,ad as cp,cd as Do}from"../chunk-90x7e4ra.js";import"../chunk-8mrbvnae.js";import{ed as _p,fd as zp,gd as Dp,hd as Tp,id as jp}from"../chunk-ffp0mgf5.js";import{jd as wp}from"../chunk-j8era2yj.js";import"../chunk-5qssa20j.js";import{ld as ex,md as gx,nd as rx,od as vx}from"../chunk-t3340cv5.js";import{rd as Np}from"../chunk-8dq3gews.js";import{sd as Xf}from"../chunk-e1cvrjf0.js";import{Ad as cx,Bd as Vx,td as $x,ud as bx,vd as tx,wd as wx,xd as Sx,yd as hx,zd as ux}from"../chunk-c64qrkpz.js";import{Cd as Fd,Dd as Hd,Ed as kd,Fd as qd,Gd as Jd,Hd as Kd,Id as Qd,Jd as Wd,Kd as Xd,Ld as Yd}from"../chunk-zpxg12ep.js";import{$d as qf,Md as lf,Nd as yf,Od as Cf,Pd as Nf,Qd as _f,Rd as zf,Sd as Df,Td as Tf,Ud as jf,Vd as If,Wd as Lf,Xd as Bf,Yd as Ff,Zd as Hf,_d as kf,ae as Jf,be as Kf,ce as Qf,de as Wf}from"../chunk-k53ndvfv.js";import"../chunk-myswpb7z.js";import{ge as Rp,he as Mp,ie as Up,je as Ap,ke as Gp,le as Ep,me as Op,ne as Pp,oe as ap,pe as lp,qe as yp}from"../chunk-3nygvd78.js";import"../chunk-mtp0aygy.js";import"../chunk-xj99g66b.js";import{De as Ip,Ee as Lp,Fe as Bp,Ge as Fp,He as Hp,Ie as kp,Je as qp,Ke as Jp,Le as Kp,Me as Qp,Ne as Wp}from"../chunk-kqam9qmd.js";import{Ue as Cp}from"../chunk-d7e6tqmr.js";import{Ve as Xp,We as Yp,Xe as Zp,Ye as $p,Ze as bp,_e as tp}from"../chunk-e3wax332.js";import{bf as a,cf as l,df as y,ef as C,ff as N,gf as _,hf as z,if as D,jf as T,kf as j,lf as I,mf as L,nf as B,of as F,pf as H}from"../chunk-1zv0s60b.js";import{qf as U,rf as A,sf as G,tf as E,uf as O,wf as P}from"../chunk-d1yhv10h.js";import{Af as yx,Bf as Cx,Cf as Nx,xf as Px,yf as ax,zf as lx}from"../chunk-ffb50kwa.js";import{Df as Lx,Ef as Bx,Ff as Fx,Gf as Hx,Hf as kx,If as qx,Jf as Jx,Kf as Kx,Lf as Qx,Mf as Wx,Nf as Xx,Of as Yx,Pf as Zx}from"../chunk-47ancrn1.js";import"../chunk-yj6xx2b8.js";import{Sf as _x,Tf as zx,Uf as Dx,Vf as Tx,Wf as jx,Xf as Ix}from"../chunk-f7aw9cr3.js";import"../chunk-kypdeb29.js";import{$f as e,ag as g,bg as r,cg as v,dg as i,eg as s,fg as n,gg as pp,hg as op,ig as d}from"../chunk-d73ympxb.js";import"../chunk-abfyz98y.js";import"../chunk-ak9s0vnr.js";import"../chunk-56q8k98m.js";import{$g as IR,Vg as To,Wg as jo,Xg as Io,Yg as Lo,_g as jR,ah as LR,bh as BR,ch as FR,dh as HR,eh as kR,fh as qR,gh as JR,hh as KR,ih as QR,jh as WR,kh as XR,lh as YR,mh as ZR,nh as $R,oh as bR,ph as tR,qh as wR,rh as SR,sh as hR,th as uR}from"../chunk-jhfkzveb.js";import{uh as om}from"../chunk-k8pnnyq1.js";import{vh as S,wh as h,xh as u,yh as c,zh as V}from"../chunk-wkq57ssc.js";import{Ah as t}from"../chunk-88k998tw.js";import{Bh as w}from"../chunk-2r5s586j.js";import{Ch as J,Dh as K,Eh as Q,Fh as W,Gh as X,Hh as Y}from"../chunk-b4a5gw9c.js";import{Ih as k,Jh as q,Kh as Z,Lh as $,Mh as b}from"../chunk-bprmzg0p.js";import"../chunk-j3bzf5m0.js";import"../chunk-4sqwtry6.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{$g as i,Tg as a,Ug as b,Vg as c,Wg as d,Xg as e,Yg as f,Zg as g,_g as h,ah as j,bh as k,ch as l,dh as m,eh as n,fh as o,gh as p,hh as q,ih as r,jh as s,kh as t,lh as u,mh as v}from"../chunk-vbeeyhhe.js";import"../chunk-k26wnmzk.js";import"../chunk-193abzy6.js";import"../chunk-e68nf7cm.js";import"../chunk-hfjywbbc.js";import"../chunk-q4t568hv.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{$g as b,_g as a,ah as c,bh as d,ch as e,dh as f,eh as g,fh as h,gh as i,hh as j,ih as k,jh as l,kh as m,lh as n,mh as o,nh as p,oh as q,ph as r,qh as s,rh as t,sh as u,th as v}from"../chunk-jhfkzveb.js";import"../chunk-k8pnnyq1.js";import"../chunk-wkq57ssc.js";import"../chunk-b4a5gw9c.js";import"../chunk-bprmzg0p.js";import"../chunk-4sqwtry6.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};
@@ -230,6 +230,7 @@ export declare interface PackageUpdate {
230
230
  url?: string
231
231
  hash?: string
232
232
  catalog?: string
233
+ sha?: string
233
234
  }
234
235
  releaseNotesUrl?: string
235
236
  changelogUrl?: string
@@ -7,6 +7,10 @@ export declare function isGitHubActionsFile(filePath: string): boolean;
7
7
  * Parse a GitHub Actions workflow file to extract action dependencies
8
8
  */
9
9
  export declare function parseGitHubActionsFile(filePath: string, content: string): Promise<PackageFile | null>;
10
+ /** A full 40-character commit SHA, the only immutable way to pin an action. */
11
+ export declare function isCommitSha(ref: string): boolean;
12
+ /** `v1.2.3` and `1.2.3` name the same release. */
13
+ export declare function sameActionVersion(a: string, b: string): boolean;
10
14
  /**
11
15
  * Update action versions in a GitHub Actions workflow file
12
16
  */
@@ -15,6 +19,12 @@ export declare function updateGitHubActionsFile(filePath: string, content: strin
15
19
  * Generate file changes for GitHub Actions workflow files
16
20
  */
17
21
  export declare function generateGitHubActionsUpdates(updates: PackageUpdate[]): Promise<Array<{ path: string, content: string, type: 'update' }>>;
22
+ /**
23
+ * The commit a tag of an action's repository points at, so a SHA pin can move
24
+ * to a newer release without becoming a mutable tag reference. Annotated tags
25
+ * are peeled by the commits endpoint. Null when the tag cannot be resolved.
26
+ */
27
+ export declare function fetchActionTagCommit(actionName: string, tag: string): Promise<string | null>;
18
28
  /**
19
29
  * Fetch latest version for a GitHub Action from GitHub API
20
30
  */
@@ -13,9 +13,33 @@ export declare function regenerateLockFile(packageManager: PackageManagerType, c
13
13
  /**
14
14
  * Examine which manifest files were updated to determine which package managers
15
15
  * need lock file regeneration.
16
+ *
17
+ * `pantry.lock` records npm resolutions alongside system packages, so a
18
+ * `package.json` bump leaves it describing the old version just as surely as
19
+ * `bun.lock`. Pantry is therefore required whenever the project has a
20
+ * `pantry.lock` and any manifest it reads changed, and it is ordered last:
21
+ * it reconciles against the JS lockfile, which has to be regenerated first.
22
+ *
16
23
  * @param updatedFilePaths - List of file paths that were updated
24
+ * @param cwd - Project root whose lock files decide the managers
17
25
  */
18
- export declare function detectRequiredPackageManagers(updatedFilePaths: string[]): PackageManagerType[];
26
+ export declare function detectRequiredPackageManagers(updatedFilePaths: string[], cwd?: string): PackageManagerType[];
27
+ /**
28
+ * The lock file a manager writes in this project, or null when it has none.
29
+ */
30
+ export declare function lockFileFor(packageManager: PackageManagerType, cwd: string): string | null;
31
+ /**
32
+ * Lock files a pull request should have regenerated but does not change.
33
+ *
34
+ * A pull request opened by an older release, or by a run whose regeneration
35
+ * was skipped, carries manifests its lock files do not match. Its updates
36
+ * still "match", so it was left alone and stayed red; this is the evidence
37
+ * that it needs refreshing. Only lock files the project has are expected.
38
+ *
39
+ * @param changedPaths - Paths the pull request changes
40
+ * @param cwd - Project root whose lock files decide what is expected
41
+ */
42
+ export declare function missingLockFiles(changedPaths: string[], cwd?: string): string[];
19
43
  /**
20
44
  * Check if a lock file exists for a given package manager in the working directory
21
45
  */
@@ -25,4 +49,4 @@ export declare interface LockFileResult {
25
49
  packageManager: PackageManagerType
26
50
  message: string
27
51
  }
28
- export type PackageManagerType = 'bun' | 'npm' | 'yarn' | 'pnpm' | 'composer';
52
+ export type PackageManagerType = 'bun' | 'npm' | 'yarn' | 'pnpm' | 'composer' | 'pantry';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@buddysh/buddy",
3
3
  "type": "module",
4
- "version": "0.11.4",
4
+ "version": "0.11.6",
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",
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{kc as a,lc as b,mc as c,nc as d}from"./chunk-61xecp1z.js";import"./chunk-hfjywbbc.js";import"./chunk-q4t568hv.js";export{c as scanCatalogs,d as applyCatalogUpdates,b as WORKSPACE_FILE_ALT,a as WORKSPACE_FILE};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{qg as a,rg as b,sg as c,tg as d}from"./chunk-jtxcr5yw.js";import"./chunk-qd2s51gc.js";import"./chunk-hfjywbbc.js";import"./chunk-g24hav8e.js";import"./chunk-q4t568hv.js";export{c as updateDependencyFile,b as parseDependencyFile,a as isDependencyFile,d as generateDependencyFileUpdates};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$h as T,Yh as A,Zh as E,_h as _,ai as C}from"./chunk-g24hav8e.js";import"./chunk-q4t568hv.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{Cb as a,Db as b}from"./chunk-4jyw358y.js";import"./chunk-q2tjkhez.js";import"./chunk-5yfaptmp.js";import"./chunk-rc2mk5x6.js";import"./chunk-tjc2vgwn.js";import"./chunk-nrr8z2z7.js";import"./chunk-xs12dtf1.js";import"./chunk-5av2vnvv.js";import"./chunk-1cpdz49v.js";import"./chunk-cgvt98pd.js";import"./chunk-e68nf7cm.js";import"./chunk-hfjywbbc.js";import"./chunk-q4t568hv.js";export{b as runReviewForPR,a as reviewPullRequest};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Je as a}from"./chunk-g30dr44w.js";import"./chunk-193abzy6.js";import"./chunk-e68nf7cm.js";import"./chunk-hfjywbbc.js";import"./chunk-q4t568hv.js";export{a as ReleaseNotesFetcher};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{jf as a,kf as b,lf as c,mf as d,nf as e,of as f,pf as g}from"./chunk-yngahb11.js";import"./chunk-1cpdz49v.js";import"./chunk-0hc97k0t.js";import"./chunk-3901s7h9.js";import"./chunk-jtxcr5yw.js";import"./chunk-qd2s51gc.js";import"./chunk-193abzy6.js";import"./chunk-e68nf7cm.js";import"./chunk-hfjywbbc.js";import"./chunk-g24hav8e.js";import"./chunk-q4t568hv.js";export{f as strategyAllows,b as ruleMatches,c as resolveRuleEffects,e as mergeGroupEffects,g as groupsToRules,a as ecosystemOf,d as applyRules};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Jc as a}from"./chunk-bmnx3s41.js";import"./chunk-8fw0v7bv.js";import"./chunk-c8rzx3a1.js";import"./chunk-0hc97k0t.js";import"./chunk-3901s7h9.js";import"./chunk-jtxcr5yw.js";import"./chunk-qd2s51gc.js";import"./chunk-193abzy6.js";import"./chunk-e68nf7cm.js";import"./chunk-hfjywbbc.js";import"./chunk-g24hav8e.js";import"./chunk-q4t568hv.js";export{a as GitHubProvider};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Wf as T}from"./chunk-0hc97k0t.js";import{Fh as B}from"./chunk-hfjywbbc.js";import{Wk as W}from"./chunk-q4t568hv.js";import{spawn as X}from"child_process";import{existsSync as J}from"fs";import U from"process";function C(){return["bun.lock","bun.lockb","package-lock.json","yarn.lock","pnpm-lock.yaml","composer.lock","pantry.lock"]}function Y(b){switch(b){case"bun":return{command:"bun",args:["install"]};case"npm":return{command:"npm",args:["install"]};case"yarn":return{command:"yarn",args:["install"]};case"pnpm":return{command:"pnpm",args:["install"]};case"composer":return{command:"composer",args:["update","--lock"]}}}async function F(b,q,z=300000){let{command:E,args:K}=Y(b);return B().info(`\uD83D\uDD04 Regenerating lock file with ${b} (${E} ${K.join(" ")})...`),new Promise((H)=>{let G=X(E,K,{cwd:q,stdio:"pipe",env:{...U.env,CI:"true"}}),V="",O="",Q=!1,R=setTimeout(()=>{Q=!0,B().warn(`\u26A0\uFE0F ${b} install timed out after ${z/1000}s, sending SIGTERM...`),G.kill("SIGTERM"),setTimeout(()=>{if(!G.killed)B().warn(`\u26A0\uFE0F ${b} install did not exit after SIGTERM, sending SIGKILL...`),G.kill("SIGKILL")},1e4)},z);G.stdout?.on("data",(A)=>{V+=A.toString()}),G.stderr?.on("data",(A)=>{O+=A.toString()}),G.on("close",(A)=>{if(clearTimeout(R),Q){H({success:!1,packageManager:b,message:`Lock file regeneration timed out after ${z/1000}s`});return}if(A===0)B().info(`\u2705 Lock file regenerated successfully with ${b}`),H({success:!0,packageManager:b,message:"Lock file regenerated successfully"});else{if(B().warn(`\u26A0\uFE0F ${b} install exited with code ${A}`),O)B().warn(` stderr: ${O.slice(0,500)}`);H({success:!1,packageManager:b,message:`Install exited with code ${A}: ${O.slice(0,200)}`})}}),G.on("error",(A)=>{clearTimeout(R),B().warn(`\u26A0\uFE0F Failed to run ${E}: ${A.message}`),H({success:!1,packageManager:b,message:`Failed to run ${E}: ${A.message}`})})})}function N(b){let q=new Set;for(let z of b){let E=z.split("/").pop()||"";if(E==="package.json"){let K=U.cwd(),H=T(K);q.add(H)}if(E==="composer.json")q.add("composer")}return Array.from(q)}function P(b,q){let z=W("path");switch(b){case"bun":return J(z.join(q,"bun.lock"))||J(z.join(q,"bun.lockb"));case"npm":return J(z.join(q,"package-lock.json"));case"yarn":return J(z.join(q,"yarn.lock"));case"pnpm":return J(z.join(q,"pnpm-lock.yaml"));case"composer":return J(z.join(q,"composer.lock"))}}
3
- export{C as Kc,F as Lc,N as Mc,P as Nc};
@@ -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-tw047td6.js";import"./chunk-p6qbqsyp.js";import"./chunk-cgvt98pd.js";import"./chunk-c8rzx3a1.js";import"./chunk-hfjywbbc.js";import"./chunk-q4t568hv.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{Gh as s,Hh as o,Ih as p,Jh as a}from"./chunk-g24hav8e.js";import"./chunk-q4t568hv.js";a();export{o as pantry,p as packages,s as aliases};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-rb1fh9vd.js";import{$d as t,Id as a,Jd as b,Kd as c,Ld as d,Md as e,Nd as f,Od as g,Pd as h,Qd as i,Rd as j,Sd as k,Td as l,Ud as m,Vd as n,Wd as o,Xd as p,Yd as q,Zd as r,_d as s}from"./chunk-nrr8z2z7.js";import"./chunk-xs12dtf1.js";import"./chunk-1cpdz49v.js";import"./chunk-hfjywbbc.js";import"./chunk-q4t568hv.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,2 +0,0 @@
1
- // @bun
2
- import{nh as a}from"./chunk-k26wnmzk.js";import"./chunk-q4t568hv.js";export{a as GitHubActionsTemplate};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{uh as a}from"./chunk-f53y8ans.js";import"./chunk-e68nf7cm.js";import"./chunk-hfjywbbc.js";import"./chunk-q4t568hv.js";export{a as BitbucketProvider};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Gc as a,Hc as b,Ic as c}from"./chunk-6p4qz8qv.js";import"./chunk-e68nf7cm.js";import"./chunk-hfjywbbc.js";import"./chunk-q4t568hv.js";export{b as stripOperators,a as scanEcosystems,c as regenerateLockfiles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Da as a}from"./chunk-jz5zs812.js";import"./chunk-e2t5jq26.js";import"./chunk-phfmnnne.js";import"./chunk-r763e19p.js";import"./chunk-be629jhq.js";import"./chunk-pkr6905p.js";import"./chunk-eseshkd0.js";import"./chunk-11hdrnf6.js";import"./chunk-mkzmjg3f.js";import"./chunk-5av2vnvv.js";import"./chunk-ytmxd5fk.js";import"./chunk-b9escac0.js";import"./chunk-g30dr44w.js";import"./chunk-2et8yavs.js";import"./chunk-txtrpypt.js";import"./chunk-8hjvthz4.js";import"./chunk-yngahb11.js";import"./chunk-08x5b93v.js";import"./chunk-p6qbqsyp.js";import"./chunk-1cpdz49v.js";import"./chunk-cgvt98pd.js";import"./chunk-c8rzx3a1.js";import"./chunk-0hc97k0t.js";import"./chunk-3901s7h9.js";import"./chunk-jtxcr5yw.js";import"./chunk-qd2s51gc.js";import"./chunk-193abzy6.js";import"./chunk-e68nf7cm.js";import"./chunk-hfjywbbc.js";import"./chunk-g24hav8e.js";import"./chunk-q4t568hv.js";export{a as Scheduler};