@buddysh/buddy 0.11.9 → 0.11.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/bin/cli.js +19 -19
  3. package/dist/{chunk-p9z0hzej.js → chunk-08daxhzx.js} +2 -2
  4. package/dist/{chunk-ja3rvd6y.js → chunk-0f1xye20.js} +1 -1
  5. package/dist/{chunk-be059ncv.js → chunk-0g4ybxwj.js} +2 -2
  6. package/dist/{chunk-2m0134q8.js → chunk-0m1z85m9.js} +1 -1
  7. package/dist/chunk-0m6b7bac.js +2 -0
  8. package/dist/{chunk-6xzzs109.js → chunk-0rbxek2f.js} +2 -2
  9. package/dist/chunk-0sm25gee.js +2 -0
  10. package/dist/{chunk-xny4kgcc.js → chunk-142zh7e5.js} +1 -1
  11. package/dist/chunk-18xha279.js +2 -0
  12. package/dist/{chunk-jpdd59fh.js → chunk-1pecmenc.js} +1 -1
  13. package/dist/chunk-1tx3t9ke.js +2 -0
  14. package/dist/chunk-1w1h2tsf.js +2 -0
  15. package/dist/{chunk-nwrr6jas.js → chunk-1xe0960b.js} +2 -2
  16. package/dist/{chunk-emygmh7r.js → chunk-24xvskkf.js} +1 -1
  17. package/dist/{chunk-r7nh070r.js → chunk-25sjd6zk.js} +5 -5
  18. package/dist/{chunk-6wxwewbh.js → chunk-2e4e6zjs.js} +1 -1
  19. package/dist/chunk-2h90wcxe.js +2 -0
  20. package/dist/{chunk-7bctsv0x.js → chunk-2hb8dan0.js} +1 -1
  21. package/dist/{chunk-z21tw4fz.js → chunk-2jjrxgs1.js} +2 -2
  22. package/dist/{chunk-6k6dgwmy.js → chunk-2z9pkk1y.js} +1 -1
  23. package/dist/{chunk-9m0epv44.js → chunk-33h1me7n.js} +2 -2
  24. package/dist/{chunk-khn11t39.js → chunk-3c114myc.js} +1 -1
  25. package/dist/{chunk-rg996jqw.js → chunk-40pvn33p.js} +1 -1
  26. package/dist/{chunk-k3x0mabj.js → chunk-42xvqxdw.js} +2 -2
  27. package/dist/{chunk-d4wqe366.js → chunk-4kr6evh6.js} +1 -1
  28. package/dist/{chunk-1m5wprvm.js → chunk-54er1whp.js} +2 -2
  29. package/dist/{chunk-y7z0br2x.js → chunk-59993g25.js} +1 -1
  30. package/dist/{chunk-7crh00m7.js → chunk-5jvde2as.js} +2 -2
  31. package/dist/{chunk-y9senfb6.js → chunk-5pheqk23.js} +1 -1
  32. package/dist/{chunk-db9rffcf.js → chunk-5vekh5w1.js} +1 -1
  33. package/dist/{chunk-drkzf2gz.js → chunk-62j8q7sg.js} +1 -1
  34. package/dist/chunk-64kt1w23.js +2 -0
  35. package/dist/{chunk-4akhxmfk.js → chunk-65by8f14.js} +1 -1
  36. package/dist/chunk-6gdenphk.js +2 -0
  37. package/dist/chunk-6pcnvdj9.js +2 -0
  38. package/dist/{chunk-mdbf728w.js → chunk-77qe887p.js} +1 -1
  39. package/dist/{chunk-mg3em5qj.js → chunk-7b4jsg36.js} +2 -2
  40. package/dist/{chunk-hkb714k3.js → chunk-7c1284fb.js} +1 -1
  41. package/dist/chunk-7m1ab6p8.js +2 -0
  42. package/dist/{chunk-bggpgbdx.js → chunk-7m3pzkcj.js} +1 -1
  43. package/dist/chunk-83yea9pk.js +2 -0
  44. package/dist/{chunk-04qvf24t.js → chunk-89jytkd6.js} +1 -1
  45. package/dist/{chunk-bjymeq7e.js → chunk-8swwcx7w.js} +1 -1
  46. package/dist/chunk-9exbsfz5.js +2 -0
  47. package/dist/{chunk-ysgex7h7.js → chunk-a3zgenkh.js} +1 -1
  48. package/dist/{chunk-xffrrs85.js → chunk-afstgmb4.js} +11 -11
  49. package/dist/{chunk-7ds5q6j3.js → chunk-apdrg3r7.js} +1 -1
  50. package/dist/{chunk-88xaexj1.js → chunk-b3s185kp.js} +1 -1
  51. package/dist/chunk-b59zbkfx.js +2 -0
  52. package/dist/{chunk-34rmja4x.js → chunk-b6a5txek.js} +2 -2
  53. package/dist/{chunk-a3bnhq58.js → chunk-b9szrnxw.js} +1 -1
  54. package/dist/{chunk-fpzgxg8a.js → chunk-be7g40yf.js} +1 -1
  55. package/dist/{chunk-89s9f3mf.js → chunk-bnp0r4eh.js} +1 -1
  56. package/dist/{chunk-se4g70q2.js → chunk-bsh3kp53.js} +1 -1
  57. package/dist/{chunk-vckn5ate.js → chunk-cj4d5ad7.js} +1 -1
  58. package/dist/chunk-csqh2ca4.js +3 -0
  59. package/dist/{chunk-xps8n8nj.js → chunk-d9m42wym.js} +2 -2
  60. package/dist/{chunk-61gfjcqt.js → chunk-dd895pm0.js} +1 -1
  61. package/dist/{chunk-h8e796qs.js → chunk-ddky3026.js} +1 -1
  62. package/dist/{chunk-rrnvxj90.js → chunk-dsnd6ndd.js} +1 -1
  63. package/dist/{chunk-pmszvhja.js → chunk-esm5jjgf.js} +1 -1
  64. package/dist/chunk-ffbbc38r.js +2 -0
  65. package/dist/{chunk-p5yaf72b.js → chunk-g0x10e1d.js} +38 -34
  66. package/dist/{chunk-kh6v93yb.js → chunk-gpjde0j6.js} +2 -2
  67. package/dist/{chunk-4wbbbcs2.js → chunk-gweqk008.js} +2 -2
  68. package/dist/{chunk-a34szd4r.js → chunk-gzkwszsg.js} +3 -3
  69. package/dist/{chunk-jxd64dzs.js → chunk-h8wskvjv.js} +1 -1
  70. package/dist/{chunk-kpdz73mc.js → chunk-hc651afv.js} +1 -1
  71. package/dist/chunk-hmymd6m2.js +2 -0
  72. package/dist/{chunk-88j356ng.js → chunk-j46f90n8.js} +1 -1
  73. package/dist/chunk-jhz202wk.js +2 -0
  74. package/dist/{chunk-1szfwcst.js → chunk-jqh7vx2n.js} +1 -1
  75. package/dist/{chunk-amj037yy.js → chunk-jsf2322c.js} +3 -3
  76. package/dist/{chunk-qdmr84mc.js → chunk-k3r7v3dp.js} +2 -2
  77. package/dist/{chunk-s3ksf6s5.js → chunk-kbvj6qxc.js} +1 -1
  78. package/dist/{chunk-gvnsr72j.js → chunk-knpdntnh.js} +1 -1
  79. package/dist/chunk-kq0n3x2e.js +2 -0
  80. package/dist/{chunk-ktmgq0ja.js → chunk-ktn47bq8.js} +1 -1
  81. package/dist/chunk-m1zv8db4.js +2 -0
  82. package/dist/chunk-m63hkte2.js +2 -0
  83. package/dist/{chunk-s3q7g2hy.js → chunk-mpb1g0xk.js} +1 -1
  84. package/dist/{chunk-d7jpbw1z.js → chunk-mt53v4sx.js} +1 -1
  85. package/dist/{chunk-3waqfh3y.js → chunk-naz864cb.js} +2 -2
  86. package/dist/{chunk-90q6r1j7.js → chunk-nbyxgt9c.js} +1 -1
  87. package/dist/chunk-njrezpsw.js +2 -0
  88. package/dist/{chunk-gyf7psxg.js → chunk-nkztawjh.js} +1 -1
  89. package/dist/chunk-pegk4jhq.js +2 -0
  90. package/dist/{chunk-k7x9af5r.js → chunk-pq115qkn.js} +2 -2
  91. package/dist/{chunk-q90s02qc.js → chunk-q7y8dvbz.js} +1 -1
  92. package/dist/{chunk-wjmp2hsj.js → chunk-qdr900z7.js} +1 -1
  93. package/dist/chunk-qxf3f6ks.js +2 -0
  94. package/dist/{chunk-tx9m7y1z.js → chunk-raj75r4h.js} +2 -2
  95. package/dist/chunk-rphwf28s.js +2 -0
  96. package/dist/chunk-rr8apsh5.js +2 -0
  97. package/dist/{chunk-jj1gjkb7.js → chunk-ry5zh9cx.js} +1 -1
  98. package/dist/chunk-sd5xqd44.js +2 -0
  99. package/dist/{chunk-7rjrea9g.js → chunk-sxfk3naz.js} +2 -2
  100. package/dist/chunk-tbt8btwf.js +2 -0
  101. package/dist/chunk-tjvvb919.js +2 -0
  102. package/dist/{chunk-ggzjv4s0.js → chunk-va3k91tf.js} +1 -1
  103. package/dist/{chunk-hdqmcp3n.js → chunk-vmt1bed1.js} +1 -1
  104. package/dist/chunk-vpsvtb9v.js +2 -0
  105. package/dist/{chunk-pxdrwhxx.js → chunk-vpw7adwd.js} +1 -1
  106. package/dist/{chunk-8tsw3cjk.js → chunk-vs68hsbp.js} +1 -1
  107. package/dist/{chunk-2145m12g.js → chunk-vtr2vbk0.js} +1 -1
  108. package/dist/{chunk-4hd1mryc.js → chunk-w55x2g9n.js} +2 -2
  109. package/dist/{chunk-hyp0wfta.js → chunk-wjfw6rx8.js} +2 -2
  110. package/dist/chunk-wt83nzn3.js +2 -0
  111. package/dist/{chunk-8dj94fsy.js → chunk-x1w6q9tk.js} +1 -1
  112. package/dist/{chunk-wreexgkb.js → chunk-xdrvb89m.js} +3 -3
  113. package/dist/chunk-xxwevpnr.js +2 -0
  114. package/dist/{chunk-wd8w0vjs.js → chunk-y3w8h4sy.js} +1 -1
  115. package/dist/{chunk-4c3dws2k.js → chunk-ycbk7tg9.js} +1 -1
  116. package/dist/chunk-yf01hyxn.js +2 -0
  117. package/dist/{chunk-srz5kgyg.js → chunk-yqfwvk9z.js} +1 -1
  118. package/dist/{chunk-0apd8zqn.js → chunk-z05djfac.js} +7 -7
  119. package/dist/{chunk-kpqez1ht.js → chunk-z18bksyr.js} +1 -1
  120. package/dist/chunk-z4btj7s0.js +2 -0
  121. package/dist/{chunk-1tg7dfq5.js → chunk-zk8zdv23.js} +1 -1
  122. package/dist/src/index.js +1 -1
  123. package/dist/src/setup.js +1 -1
  124. package/dist/src/utils/lock-file.d.ts +19 -0
  125. package/package.json +1 -1
  126. package/dist/chunk-00vbhh0z.js +0 -2
  127. package/dist/chunk-0y706m2d.js +0 -2
  128. package/dist/chunk-1aee33aa.js +0 -2
  129. package/dist/chunk-1vhqtq6m.js +0 -2
  130. package/dist/chunk-2fx0tbc0.js +0 -2
  131. package/dist/chunk-3ggd7z2f.js +0 -2
  132. package/dist/chunk-3xbx315d.js +0 -2
  133. package/dist/chunk-4k9f9vn2.js +0 -2
  134. package/dist/chunk-4zvjzesh.js +0 -2
  135. package/dist/chunk-5dw0q5ng.js +0 -2
  136. package/dist/chunk-5qtdc2mb.js +0 -2
  137. package/dist/chunk-6gttmvww.js +0 -2
  138. package/dist/chunk-7f6mpphq.js +0 -2
  139. package/dist/chunk-7mmdxbcm.js +0 -2
  140. package/dist/chunk-7ze1qrmt.js +0 -2
  141. package/dist/chunk-9634xcvq.js +0 -2
  142. package/dist/chunk-ea6rtyvy.js +0 -2
  143. package/dist/chunk-gs5b2ssa.js +0 -2
  144. package/dist/chunk-gw69sjx2.js +0 -2
  145. package/dist/chunk-j0fcqty9.js +0 -2
  146. package/dist/chunk-mzb7cg8a.js +0 -2
  147. package/dist/chunk-pjq0qxst.js +0 -2
  148. package/dist/chunk-pksrcdh6.js +0 -2
  149. package/dist/chunk-sdhyhefy.js +0 -2
  150. package/dist/chunk-sxdfmskp.js +0 -2
  151. package/dist/chunk-tf9nqr0p.js +0 -2
  152. package/dist/chunk-tm8eg4sk.js +0 -2
  153. package/dist/chunk-tq1w2wwa.js +0 -2
  154. package/dist/chunk-w93akf6h.js +0 -2
  155. package/dist/chunk-ydt2sn0j.js +0 -2
  156. package/dist/chunk-z0qbkvyz.js +0 -2
  157. package/dist/chunk-zefqbamj.js +0 -2
  158. package/dist/chunk-zrg5ss0x.js +0 -3
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Oh as z}from"./chunk-8dj94fsy.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{Ph as z}from"./chunk-x1w6q9tk.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,5 +1,5 @@
1
1
  // @bun
2
- import{fc as F}from"./chunk-ggzjv4s0.js";import{Bf as c}from"./chunk-jpdd59fh.js";import{Nf as E,Qf as A}from"./chunk-7rjrea9g.js";import{Oh as m}from"./chunk-8dj94fsy.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-va3k91tf.js";import{Cf as c}from"./chunk-1pecmenc.js";import{Of as E,Rf as A}from"./chunk-sxfk3naz.js";import{Ph as m}from"./chunk-x1w6q9tk.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};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fd as a}from"./chunk-08daxhzx.js";import"./chunk-2z9pkk1y.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.js";export{a as DeprecatedDependenciesChecker};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wreexgkb.js";import{rg as y}from"./chunk-gvnsr72j.js";import{xh as k}from"./chunk-6k6dgwmy.js";import{Oh as i}from"./chunk-8dj94fsy.js";import u from"process";var d=/\{([a-z_]+)\}/gi,b={title:"title",message:"message",group:"group",count:"count",strategy:"strategy",update_type:"updateType",updateType:"updateType",packages:"packages",updates_table:"updatesTable",release_notes:"releaseNotes",footer:"footer",package_count:"packageCount"};function C(W,$){return W.replace(d,(Y,R)=>{let K=b[R]??b[R.toLowerCase()];if(!K)return Y;let H=$[K];return H===void 0?Y:String(H)})}function f(W,$={},Y){return{...$,group:W.name,count:W.updates.length,packageCount:W.updates.length,updateType:W.updateType,packages:W.updates.map((R)=>R.name).join(", "),...Y?{strategy:Y}:{}}}class p{config;releaseNotesFetcher=new l;verbose=!1;logger;constructor(W,$){this.config=W;this.verbose=W?.verbose||u.env.BUDDY_VERBOSE==="true",this.logger=$??i()}get releaseNotesSettings(){let W=this.config?.releaseNotes;return{enabled:W?.enabled??!0,maxReleases:W?.maxReleases??3,maxBodyLength:W?.maxBodyLength??1000,includeCompareLinks:W?.includeCompareLinks??!0}}repositoryFileUrl(W){let $=k(this.config),{owner:Y,name:R,baseBranch:K}=this.config?.repository??{};return`${$}/${Y}/${R}/blob/${K||"main"}/${W}`}log(W,$){if(this.verbose){let Y=new Date().toISOString();if(this.logger.info(`[${Y}] PR-GEN: ${W}`),$)this.logger.info(JSON.stringify($,null,2))}}async generatePullRequests(W){let $=[];for(let Y of W){let R=this.generateTitle(Y),K=await this.generateBody(Y),H={number:0,title:R,body:K,head:`buddy/update-${Y.name.toLowerCase().replace(/\s+/g,"-")}`,base:"main",state:"open",url:"",createdAt:new Date,updatedAt:new Date,author:"github-actions[bot]",reviewers:[],assignees:[],labels:this.generateLabels(Y),draft:!1};$.push(H)}return $}generateLabels(W){let $=["dependencies"];if(W.updateType==="major")$.push("major");else if(W.updateType==="minor")$.push("minor");else if(W.updateType==="patch")$.push("patch");let Y=W.updates.filter((B)=>B.file==="package.json"||B.file.endsWith("/package.json")||B.file.endsWith("\\package.json")).length,R=W.updates.filter((B)=>B.file.endsWith("composer.json")||B.file.endsWith("composer.lock")).length,K=W.updates.filter((B)=>B.file.endsWith("build.zig.zon")).length,H=W.updates.filter((B)=>(B.file.includes(".yaml")||B.file.includes(".yml"))&&!B.file.includes(".github/workflows/")).length,Z=W.updates.filter((B)=>B.file.includes(".github/workflows/")).length;if(Y>0)$.push("npm");if(R>0)$.push("composer");if(K>0)$.push("zig");if(H>0)$.push("system");if(Z>0)$.push("github-actions");if(W.updates.length===1){let B=W.updates[0];$.push(B.name)}if(W.updates.length>=5)$.push("bulk-update");return $}generateTitle(W){let $=this.config?.pullRequest?.titleFormat;if($)return C($,f(W,{title:this.defaultTitle(W)},this.config?.packages?.strategy));return this.defaultTitle(W)}defaultTitle(W){if(W.updates.length===1){let R=W.updates[0];return`chore(deps): update dependency ${R.name} to v${R.newVersion}`}let $=W.updates.filter((R)=>R.updateType==="major").length,Y=W.updates.filter((R)=>R.updateType==="minor").length;if($>0)return`chore(deps): update ${W.updates.length} dependencies (major)`;else if(Y>0)return`chore(deps): update ${W.updates.length} dependencies (minor)`;else return`chore(deps): update ${W.updates.length} dependencies (patch)`}async generateBody(W){if(this.log("\uD83D\uDE80 Starting PR body generation",{groupName:W.name,totalUpdates:W.updates.length,updates:W.updates.map((Q)=>({name:Q.name,file:Q.file,dependencyType:Q.dependencyType,currentVersion:Q.currentVersion,newVersion:Q.newVersion,updateType:Q.updateType}))}),W.updates.length===0)this.log("\u26A0\uFE0F WARNING: No updates in group - this will result in sparse PR body",{groupName:W.name,groupTitle:W.title});let $=W.updates.filter((Q)=>Q.file==="package.json"||Q.file.endsWith("/package.json")||Q.file.endsWith("\\package.json")).length,Y=W.updates.filter((Q)=>(Q.file.includes(".yaml")||Q.file.includes(".yml"))&&!Q.file.includes(".github/workflows/")).length,R=W.updates.filter((Q)=>Q.file.includes(".github/workflows/")).length,K=W.updates.filter((Q)=>Q.file.endsWith("composer.json")||Q.file.endsWith("composer.lock")).length,H=W.updates.filter((Q)=>Q.file.endsWith("build.zig.zon")).length;if(this.log("\uD83D\uDCCA Package type counts",{packageJsonCount:$,dependencyFileCount:Y,githubActionsCount:R,composerCount:K,total:W.updates.length}),W.updates.length>0)this.log("\uD83D\uDD0D File path analysis",{files:W.updates.map((Q)=>({name:Q.name,file:Q.file,isExactMatch:Q.file==="package.json",endsWithSlash:Q.file.endsWith("/package.json"),endsWithBackslash:Q.file.endsWith("\\package.json"),matchesAny:Q.file==="package.json"||Q.file.endsWith("/package.json")||Q.file.endsWith("\\package.json")}))});let Z=`This PR contains the following updates:
2
+ import{We as c}from"./chunk-gpjde0j6.js";import{bg as l,kg as A}from"./chunk-xdrvb89m.js";import{sg as y}from"./chunk-knpdntnh.js";import{yh as k}from"./chunk-2z9pkk1y.js";import{Ph as i}from"./chunk-x1w6q9tk.js";import u from"process";var d=/\{([a-z_]+)\}/gi,b={title:"title",message:"message",group:"group",count:"count",strategy:"strategy",update_type:"updateType",updateType:"updateType",packages:"packages",updates_table:"updatesTable",release_notes:"releaseNotes",footer:"footer",package_count:"packageCount"};function h(W,$){return W.replace(d,(Y,R)=>{let K=b[R]??b[R.toLowerCase()];if(!K)return Y;let H=$[K];return H===void 0?Y:String(H)})}function f(W,$={},Y){return{...$,group:W.name,count:W.updates.length,packageCount:W.updates.length,updateType:W.updateType,packages:W.updates.map((R)=>R.name).join(", "),...Y?{strategy:Y}:{}}}class p{config;releaseNotesFetcher=new c;verbose=!1;logger;constructor(W,$){this.config=W;this.verbose=W?.verbose||u.env.BUDDY_VERBOSE==="true",this.logger=$??i()}get releaseNotesSettings(){let W=this.config?.releaseNotes;return{enabled:W?.enabled??!0,maxReleases:W?.maxReleases??3,maxBodyLength:W?.maxBodyLength??1000,includeCompareLinks:W?.includeCompareLinks??!0}}repositoryFileUrl(W){let $=k(this.config),{owner:Y,name:R,baseBranch:K}=this.config?.repository??{};return`${$}/${Y}/${R}/blob/${K||"main"}/${W}`}log(W,$){if(this.verbose){let Y=new Date().toISOString();if(this.logger.info(`[${Y}] PR-GEN: ${W}`),$)this.logger.info(JSON.stringify($,null,2))}}async generatePullRequests(W){let $=[];for(let Y of W){let R=this.generateTitle(Y),K=await this.generateBody(Y),H={number:0,title:R,body:K,head:`buddy/update-${Y.name.toLowerCase().replace(/\s+/g,"-")}`,base:"main",state:"open",url:"",createdAt:new Date,updatedAt:new Date,author:"github-actions[bot]",reviewers:[],assignees:[],labels:this.generateLabels(Y),draft:!1};$.push(H)}return $}generateLabels(W){let $=["dependencies"];if(W.updateType==="major")$.push("major");else if(W.updateType==="minor")$.push("minor");else if(W.updateType==="patch")$.push("patch");let Y=W.updates.filter((D)=>D.file==="package.json"||D.file.endsWith("/package.json")||D.file.endsWith("\\package.json")).length,R=W.updates.filter((D)=>D.file.endsWith("composer.json")||D.file.endsWith("composer.lock")).length,K=W.updates.filter((D)=>D.file.endsWith("build.zig.zon")).length,H=W.updates.filter((D)=>(D.file.includes(".yaml")||D.file.includes(".yml"))&&!D.file.includes(".github/workflows/")).length,Z=W.updates.filter((D)=>D.file.includes(".github/workflows/")).length;if(Y>0)$.push("npm");if(R>0)$.push("composer");if(K>0)$.push("zig");if(H>0)$.push("system");if(Z>0)$.push("github-actions");if(W.updates.length===1){let D=W.updates[0];$.push(D.name)}if(W.updates.length>=5)$.push("bulk-update");return $}generateTitle(W){let $=this.config?.pullRequest?.titleFormat;if($)return h($,f(W,{title:this.defaultTitle(W)},this.config?.packages?.strategy));return this.defaultTitle(W)}defaultTitle(W){if(W.updates.length===1){let R=W.updates[0];return`chore(deps): update dependency ${R.name} to v${R.newVersion}`}let $=W.updates.filter((R)=>R.updateType==="major").length,Y=W.updates.filter((R)=>R.updateType==="minor").length;if($>0)return`chore(deps): update ${W.updates.length} dependencies (major)`;else if(Y>0)return`chore(deps): update ${W.updates.length} dependencies (minor)`;else return`chore(deps): update ${W.updates.length} dependencies (patch)`}async generateBody(W){if(this.log("\uD83D\uDE80 Starting PR body generation",{groupName:W.name,totalUpdates:W.updates.length,updates:W.updates.map((Q)=>({name:Q.name,file:Q.file,dependencyType:Q.dependencyType,currentVersion:Q.currentVersion,newVersion:Q.newVersion,updateType:Q.updateType}))}),W.updates.length===0)this.log("\u26A0\uFE0F WARNING: No updates in group - this will result in sparse PR body",{groupName:W.name,groupTitle:W.title});let $=W.updates.filter((Q)=>Q.file==="package.json"||Q.file.endsWith("/package.json")||Q.file.endsWith("\\package.json")).length,Y=W.updates.filter((Q)=>(Q.file.includes(".yaml")||Q.file.includes(".yml"))&&!Q.file.includes(".github/workflows/")).length,R=W.updates.filter((Q)=>Q.file.includes(".github/workflows/")).length,K=W.updates.filter((Q)=>Q.file.endsWith("composer.json")||Q.file.endsWith("composer.lock")).length,H=W.updates.filter((Q)=>Q.file.endsWith("build.zig.zon")).length;if(this.log("\uD83D\uDCCA Package type counts",{packageJsonCount:$,dependencyFileCount:Y,githubActionsCount:R,composerCount:K,total:W.updates.length}),W.updates.length>0)this.log("\uD83D\uDD0D File path analysis",{files:W.updates.map((Q)=>({name:Q.name,file:Q.file,isExactMatch:Q.file==="package.json",endsWithSlash:Q.file.endsWith("/package.json"),endsWithBackslash:Q.file.endsWith("\\package.json"),matchesAny:Q.file==="package.json"||Q.file.endsWith("/package.json")||Q.file.endsWith("\\package.json")}))});let Z=`This PR contains the following updates:
3
3
 
4
- `;Z+=c(W.updates);let B=W.updates.length>1;if(B){if(Z+=`## Package Updates Summary
4
+ `;Z+=l(W.updates);let D=W.updates.length>1;if(D){if(Z+=`## Package Updates Summary
5
5
 
6
6
  `,Z+=`| Type | Count |
7
7
  `,Z+=`|------|-------|
@@ -12,17 +12,17 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
12
12
  `;if(H>0)Z+=`| \u26A1 Zig Packages | ${H} |
13
13
  `;Z+=`| **Total** | **${W.updates.length}** |
14
14
 
15
- `}let E=W.updates.filter((Q)=>Q.file==="package.json"||Q.file.endsWith("/package.json")||Q.file.endsWith("\\package.json")),x=W.updates.filter((Q)=>Q.file.endsWith("composer.json")||Q.file.endsWith("composer.lock")),q=W.updates.filter((Q)=>Q.file.endsWith("build.zig.zon")),S=W.updates.filter((Q)=>Q.file.includes(".yaml")||Q.file.includes(".yml")).filter((Q)=>!Q.file.includes(".github/workflows/")),P=W.updates.filter((Q)=>Q.file.includes(".github/workflows/"));this.log("\uD83D\uDCDD Filtered updates by type",{packageJsonUpdates:{count:E.length,items:E.map((Q)=>({name:Q.name,file:Q.file}))},composerUpdates:{count:x.length,items:x.map((Q)=>({name:Q.name,file:Q.file}))},dependencyFileUpdates:{count:S.length,items:S.map((Q)=>({name:Q.name,file:Q.file}))},githubActionsUpdates:{count:P.length,items:P.map((Q)=>({name:Q.name,file:Q.file}))}});let T=new Map;for(let Q of P){let X=`${Q.name}@${Q.currentVersion}=>${Q.newVersion}`,D=T.get(X);if(D)D.files.add(Q.file);else T.set(X,{update:Q,files:new Set([Q.file])})}let V=Array.from(T.values()).map(({update:Q,files:X})=>({...Q,file:Array.from(X).join(", ")})),U=new Set,w=[];for(let Q of x){let X=`${Q.name}@${Q.currentVersion}=>${Q.newVersion}`;if(!U.has(X))U.add(X),w.push(Q)}let F=new Map,m=new Map;if(E.length>0){if(this.log("\u2705 Generating npm Dependencies section",{packageCount:E.length,packages:E.map((_)=>_.name)}),B||$<W.updates.length)Z+=`## \uD83D\uDCE6 npm Dependencies
15
+ `}let B=W.updates.filter((Q)=>Q.file==="package.json"||Q.file.endsWith("/package.json")||Q.file.endsWith("\\package.json")),x=W.updates.filter((Q)=>Q.file.endsWith("composer.json")||Q.file.endsWith("composer.lock")),q=W.updates.filter((Q)=>Q.file.endsWith("build.zig.zon")),S=W.updates.filter((Q)=>Q.file.includes(".yaml")||Q.file.includes(".yml")).filter((Q)=>!Q.file.includes(".github/workflows/")),P=W.updates.filter((Q)=>Q.file.includes(".github/workflows/"));this.log("\uD83D\uDCDD Filtered updates by type",{packageJsonUpdates:{count:B.length,items:B.map((Q)=>({name:Q.name,file:Q.file}))},composerUpdates:{count:x.length,items:x.map((Q)=>({name:Q.name,file:Q.file}))},dependencyFileUpdates:{count:S.length,items:S.map((Q)=>({name:Q.name,file:Q.file}))},githubActionsUpdates:{count:P.length,items:P.map((Q)=>({name:Q.name,file:Q.file}))}});let T=new Map;for(let Q of P){let X=`${Q.name}@${Q.currentVersion}=>${Q.newVersion}`,L=T.get(X);if(L)L.files.add(Q.file);else T.set(X,{update:Q,files:new Set([Q.file])})}let V=Array.from(T.values()).map(({update:Q,files:X})=>({...Q,file:Array.from(X).join(", ")})),U=new Set,w=[];for(let Q of x){let X=`${Q.name}@${Q.currentVersion}=>${Q.newVersion}`;if(!U.has(X))U.add(X),w.push(Q)}let F=new Map,m=new Map;if(B.length>0){if(this.log("\u2705 Generating npm Dependencies section",{packageCount:B.length,packages:B.map((_)=>_.name)}),D||$<W.updates.length)Z+=`## \uD83D\uDCE6 npm Dependencies
16
16
 
17
17
  `;if(Z+=`![npm](https://img.shields.io/badge/npm-CB3837?style=flat&logo=npm&logoColor=white)
18
18
 
19
- `,E.length>1)Z+=`*${E.length} packages will be updated*
19
+ `,B.length>1)Z+=`*${B.length} packages will be updated*
20
20
 
21
21
  `;Z+=`| Package | Change | Age | Adoption | Passing | Confidence |
22
22
  `,Z+=`|---|---|---|---|---|---|
23
- `;let Q=Date.now();this.log(`\u23F1\uFE0F Starting to fetch info for ${E.length} npm packages in parallel...`);let X=(this.releaseNotesSettings.enabled?E:[]).map(async(_)=>{let M=Date.now();try{let L=_.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,""),j=await this.releaseNotesFetcher.fetchPackageInfo(L,_.currentVersion,_.newVersion);return this.log(`\u23F1\uFE0F Fetched ${L} in ${Date.now()-M}ms`),{name:_.name,result:j}}catch(L){return this.logger.warn(`Failed to fetch info for ${_.name}:`,L),null}});(await Promise.all(X)).forEach((_)=>{if(_)F.set(_.name,_.result)});let O=Date.now()-Q;this.log(`\u23F1\uFE0F Total npm package info fetch took ${O}ms for ${E.length} packages (avg: ${Math.round(O/E.length)}ms per package)`),this.logger.info(`\u23F1\uFE0F [PR-GEN] npm package info fetch: ${O}ms for ${E.length} packages (PARALLEL)`);for(let _ of E){let L=F.get(_.name)?.packageInfo||{name:_.name},j=_.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,""),z;if(L.repository?.url){let J=this.getRepositorySourceUrl(L.repository.url,j),h=this.getRepositorySourceUrl(L.repository.url,j,"HEAD");z=`[${j}](${J}) ([source](${h}))`}else if(j.startsWith("@types/")){let J=j.replace("@types/",""),h=`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/${J}`,r=`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/${J}`;z=`[${j}](${h}) ([source](${r}))`}else z=`[${j}](https://www.npmjs.com/package/${encodeURIComponent(j)})`;let v=`https://renovatebot.com/diffs/npm/${encodeURIComponent(j)}/${encodeURIComponent(_.currentVersion)}/${encodeURIComponent(_.newVersion)}`,g=this.escapeMarkdownTableValue(_.currentVersion),n=this.escapeMarkdownTableValue(_.newVersion),s=`[\`${g}\` -> \`${n}\`](${v})`,I=this.releaseNotesFetcher.generatePackageBadges({...L,name:j},_.currentVersion,_.newVersion);Z+=`| ${z} | ${s} | ${I.age} | ${I.adoption} | ${I.passing} | ${I.confidence} |
23
+ `;let Q=Date.now();this.log(`\u23F1\uFE0F Starting to fetch info for ${B.length} npm packages in parallel...`);let X=(this.releaseNotesSettings.enabled?B:[]).map(async(_)=>{let M=Date.now();try{let O=_.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,""),j=await this.releaseNotesFetcher.fetchPackageInfo(O,_.currentVersion,_.newVersion);return this.log(`\u23F1\uFE0F Fetched ${O} in ${Date.now()-M}ms`),{name:_.name,result:j}}catch(O){return this.logger.warn(`Failed to fetch info for ${_.name}:`,O),null}});(await Promise.all(X)).forEach((_)=>{if(_)F.set(_.name,_.result)});let z=Date.now()-Q;this.log(`\u23F1\uFE0F Total npm package info fetch took ${z}ms for ${B.length} packages (avg: ${Math.round(z/B.length)}ms per package)`),this.logger.info(`\u23F1\uFE0F [PR-GEN] npm package info fetch: ${z}ms for ${B.length} packages (PARALLEL)`);for(let _ of B){let O=F.get(_.name)?.packageInfo||{name:_.name},j=_.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,""),E;if(O.repository?.url){let J=this.getRepositorySourceUrl(O.repository.url,j),C=this.getRepositorySourceUrl(O.repository.url,j,"HEAD");E=`[${j}](${J}) ([source](${C}))`}else if(j.startsWith("@types/")){let J=j.replace("@types/",""),C=`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/${J}`,r=`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/${J}`;E=`[${j}](${C}) ([source](${r}))`}else E=`[${j}](https://www.npmjs.com/package/${encodeURIComponent(j)})`;let v=`https://renovatebot.com/diffs/npm/${encodeURIComponent(j)}/${encodeURIComponent(_.currentVersion)}/${encodeURIComponent(_.newVersion)}`,g=this.escapeMarkdownTableValue(_.currentVersion),n=this.escapeMarkdownTableValue(_.newVersion),s=`[\`${g}\` -> \`${n}\`](${v})`,I=this.releaseNotesFetcher.generatePackageBadges({...O,name:j},_.currentVersion,_.newVersion);Z+=`| ${E} | ${s} | ${I.age} | ${I.adoption} | ${I.passing} | ${I.confidence} |
24
24
  `}Z+=`
25
- `}if(w.length>0){for(let Q of w)try{let X=await this.releaseNotesFetcher.fetchComposerPackageInfo(Q.name);m.set(Q.name,X)}catch(X){this.logger.warn(`Failed to fetch Composer info for ${Q.name}:`,X)}if(B||K<W.updates.length)Z+=`## \uD83D\uDC18 PHP/Composer Dependencies
25
+ `}if(w.length>0){for(let Q of w)try{let X=await this.releaseNotesFetcher.fetchComposerPackageInfo(Q.name);m.set(Q.name,X)}catch(X){this.logger.warn(`Failed to fetch Composer info for ${Q.name}:`,X)}if(D||K<W.updates.length)Z+=`## \uD83D\uDC18 PHP/Composer Dependencies
26
26
 
27
27
  `;if(Z+=`![composer](https://img.shields.io/badge/composer-885630?style=flat&logo=composer&logoColor=white)
28
28
 
@@ -30,9 +30,9 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
30
30
 
31
31
  `;Z+=`| Package | Change | Age | Adoption | Passing | Confidence | Type | Update |
32
32
  `,Z+=`|---|---|---|---|---|---|---|---|
33
- `;for(let Q of w){let X=m.get(Q.name)||{name:Q.name},D;if(X.homepage&&X.repository?.url){let v=this.getComposerRedirectSourceUrl(X.repository.url,Q.name);D=`[${Q.name}](${X.homepage}) ([source](${v}))`}else if(X.repository?.url){let v=this.getComposerRedirectSourceUrl(X.repository.url,Q.name);D=`[${Q.name}](${v})`}else D=`[${Q.name}](https://packagist.org/packages/${encodeURIComponent(Q.name)})`;let O=this.getConstraintStyleChange(Q.currentVersion,Q.newVersion),_=`https://renovatebot.com/diffs/packagist/${encodeURIComponent(Q.name)}/${Q.currentVersion}/${Q.newVersion}`,M=`[\`${O}\`](${_})`,L=this.releaseNotesFetcher.generateComposerBadges(X,Q.currentVersion,Q.newVersion),j=Q.dependencyType||"require",z=Q.updateType||"minor";Z+=`| ${D} | ${M} | ${L.age} | ${L.adoption} | ${L.passing} | ${L.confidence} | ${j} | ${z} |
33
+ `;for(let Q of w){let X=m.get(Q.name)||{name:Q.name},L;if(X.homepage&&X.repository?.url){let v=this.getComposerRedirectSourceUrl(X.repository.url,Q.name);L=`[${Q.name}](${X.homepage}) ([source](${v}))`}else if(X.repository?.url){let v=this.getComposerRedirectSourceUrl(X.repository.url,Q.name);L=`[${Q.name}](${v})`}else L=`[${Q.name}](https://packagist.org/packages/${encodeURIComponent(Q.name)})`;let z=this.getConstraintStyleChange(Q.currentVersion,Q.newVersion),_=`https://renovatebot.com/diffs/packagist/${encodeURIComponent(Q.name)}/${Q.currentVersion}/${Q.newVersion}`,M=`[\`${z}\`](${_})`,O=this.releaseNotesFetcher.generateComposerBadges(X,Q.currentVersion,Q.newVersion),j=Q.dependencyType||"require",E=Q.updateType||"minor";Z+=`| ${L} | ${M} | ${O.age} | ${O.adoption} | ${O.passing} | ${O.confidence} | ${j} | ${E} |
34
34
  `}Z+=`
35
- `}if(q.length>0){if(B||H<W.updates.length)Z+=`## \u26A1 Zig Dependencies
35
+ `}if(q.length>0){if(D||H<W.updates.length)Z+=`## \u26A1 Zig Dependencies
36
36
 
37
37
  `;if(Z+=`![zig](https://img.shields.io/badge/Zig-F7A41D?style=flat&logo=zig&logoColor=white)
38
38
 
@@ -40,9 +40,9 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
40
40
 
41
41
  `;Z+=`| Package | Change | Type | File |
42
42
  `,Z+=`|---|---|---|---|
43
- `;for(let Q of q){let X,D=Q.metadata;if(D?.url){let z=D.url.match(/https?:\/\/github\.com\/([^/]+\/[^/]+)/);if(z){let v=`https://github.com/${z[1]}`;X=`[${Q.name}](${v})`}else X=Q.name}else X=Q.name;let O=A(Q.currentVersion,Q.newVersion),_=O==="major"?"\uD83D\uDD34":O==="minor"?"\uD83D\uDFE1":"\uD83D\uDFE2",M=this.formatVersionChange(Q.currentVersion,Q.newVersion),L=Q.file.split("/").pop()||Q.file,j=this.config?.repository?.owner&&this.config?.repository?.name?`[\`${L}\`](${this.repositoryFileUrl(Q.file)})`:`\`${L}\``;Z+=`| ${X} | ${M} | ${_} ${O} | ${j} |
43
+ `;for(let Q of q){let X,L=Q.metadata;if(L?.url){let E=L.url.match(/https?:\/\/github\.com\/([^/]+\/[^/]+)/);if(E){let v=`https://github.com/${E[1]}`;X=`[${Q.name}](${v})`}else X=Q.name}else X=Q.name;let z=A(Q.currentVersion,Q.newVersion),_=z==="major"?"\uD83D\uDD34":z==="minor"?"\uD83D\uDFE1":"\uD83D\uDFE2",M=this.formatVersionChange(Q.currentVersion,Q.newVersion),O=Q.file.split("/").pop()||Q.file,j=this.config?.repository?.owner&&this.config?.repository?.name?`[\`${O}\`](${this.repositoryFileUrl(Q.file)})`:`\`${O}\``;Z+=`| ${X} | ${M} | ${_} ${z} | ${j} |
44
44
  `}Z+=`
45
- `}if(S.length>0){if(B||Y<W.updates.length)Z+=`## \uD83D\uDD27 System Dependencies
45
+ `}if(S.length>0){if(D||Y<W.updates.length)Z+=`## \uD83D\uDD27 System Dependencies
46
46
 
47
47
  `;Z+=`![system](https://img.shields.io/badge/system-4CAF50?style=flat&logo=linux&logoColor=white)
48
48
 
@@ -50,9 +50,9 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
50
50
 
51
51
  `;Z+=`| Package | Change | Type | File |
52
52
  `,Z+=`|---|---|---|---|
53
- `;for(let X of S){let D=X.name==="bun.sh"?"bun.com":X.name,O=X.name==="bun.sh"?"https://bun.sh":`https://pkgx.com/pkg/${encodeURIComponent(X.name)}`,_=`[${D}](${O})`,M=A(X.currentVersion,X.newVersion),L=M==="major"?"\uD83D\uDD34":M==="minor"?"\uD83D\uDFE1":"\uD83D\uDFE2",j=this.formatVersionChange(X.currentVersion,X.newVersion),z=X.file.split("/").pop()||X.file,v=this.config?.repository?.owner&&this.config?.repository?.name?`[\`${z}\`](${this.repositoryFileUrl(X.file)})`:`\`${z}\``;Z+=`| ${_} | ${j} | ${L} ${M} | ${v} |
53
+ `;for(let X of S){let L=X.name==="bun.sh"?"bun.com":X.name,z=X.name==="bun.sh"?"https://bun.sh":`https://pkgx.com/pkg/${encodeURIComponent(X.name)}`,_=`[${L}](${z})`,M=A(X.currentVersion,X.newVersion),O=M==="major"?"\uD83D\uDD34":M==="minor"?"\uD83D\uDFE1":"\uD83D\uDFE2",j=this.formatVersionChange(X.currentVersion,X.newVersion),E=X.file.split("/").pop()||X.file,v=this.config?.repository?.owner&&this.config?.repository?.name?`[\`${E}\`](${this.repositoryFileUrl(X.file)})`:`\`${E}\``;Z+=`| ${_} | ${j} | ${O} ${M} | ${v} |
54
54
  `}Z+=`
55
- `}if(V.length>0){if(B||R<W.updates.length)Z+=`## \uD83D\uDE80 GitHub Actions
55
+ `}if(V.length>0){if(D||R<W.updates.length)Z+=`## \uD83D\uDE80 GitHub Actions
56
56
 
57
57
  `;if(Z+=`![github-actions](https://img.shields.io/badge/GitHub%20Actions-2088FF?style=flat&logo=github-actions&logoColor=white)
58
58
 
@@ -60,35 +60,35 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
60
60
 
61
61
  `;Z+=`| Action | Change | Type | Files |
62
62
  `,Z+=`|---|---|---|---|
63
- `;for(let Q of V){let X=`${k(this.config)}/${Q.name}`,D=`[${Q.name}](${X})`,O=A(Q.currentVersion,Q.newVersion),_=O==="major"?"\uD83D\uDD34":O==="minor"?"\uD83D\uDFE1":"\uD83D\uDFE2",M=this.formatVersionChange(Q.currentVersion,Q.newVersion),L=Q.file.includes(", ")?Q.file.split(", ").map((j)=>{let z=j.split("/").pop()||j;return this.config?.repository?.owner&&this.config?.repository?.name?`[\`${z}\`](${this.repositoryFileUrl(j)})`:`\`${z}\``}).join(", "):(()=>{let j=Q.file.split("/").pop()||Q.file;return this.config?.repository?.owner&&this.config?.repository?.name?`[\`${j}\`](${this.repositoryFileUrl(Q.file)})`:`\`${j}\``})();Z+=`| ${D} | ${M} | ${_} ${O} | ${L} |
63
+ `;for(let Q of V){let X=`${k(this.config)}/${Q.name}`,L=`[${Q.name}](${X})`,z=A(Q.currentVersion,Q.newVersion),_=z==="major"?"\uD83D\uDD34":z==="minor"?"\uD83D\uDFE1":"\uD83D\uDFE2",M=this.formatVersionChange(Q.currentVersion,Q.newVersion),O=Q.file.includes(", ")?Q.file.split(", ").map((j)=>{let E=j.split("/").pop()||j;return this.config?.repository?.owner&&this.config?.repository?.name?`[\`${E}\`](${this.repositoryFileUrl(j)})`:`\`${E}\``}).join(", "):(()=>{let j=Q.file.split("/").pop()||Q.file;return this.config?.repository?.owner&&this.config?.repository?.name?`[\`${j}\`](${this.repositoryFileUrl(Q.file)})`:`\`${j}\``})();Z+=`| ${L} | ${M} | ${_} ${z} | ${O} |
64
64
  `}Z+=`
65
65
  `}Z+=`
66
66
  ---
67
67
 
68
68
  `;let G=this.releaseNotesSettings;if(!G.enabled)return this.finalizeBody(Z,W);Z+=`### Release Notes
69
69
 
70
- `;for(let Q of E){let X=F.get(Q.name),D=X?.packageInfo||{name:Q.name},O=X?.releaseNotes||[],_=X?.compareUrl;Z+=`<details>
71
- `;let M,L=Q.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,"");if(D.repository?.url)M=`${this.getRepositoryName(D.repository.url)} (${L})`;else M=L;if(Z+=`<summary>${M}</summary>
70
+ `;for(let Q of B){let X=F.get(Q.name),L=X?.packageInfo||{name:Q.name},z=X?.releaseNotes||[],_=X?.compareUrl;Z+=`<details>
71
+ `;let M,O=Q.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,"");if(L.repository?.url)M=`${this.getRepositoryName(L.repository.url)} (${O})`;else M=O;if(Z+=`<summary>${M}</summary>
72
72
 
73
73
  `,Z+=`**${Q.currentVersion} -> ${Q.newVersion}**
74
74
 
75
- `,O.length>0)for(let j of O.slice(0,G.maxReleases)){if(Z+=`### [\`${j.version}\`](${j.htmlUrl})
75
+ `,z.length>0)for(let j of z.slice(0,G.maxReleases)){if(Z+=`### [\`${j.version}\`](${j.htmlUrl})
76
76
 
77
77
  `,_&&G.includeCompareLinks)Z+=`[Compare Source](${_})
78
78
 
79
- `;if(j.body){let z=this.cleanReleaseBody(j.body);Z+=`${z}
79
+ `;if(j.body){let E=this.cleanReleaseBody(j.body);Z+=`${E}
80
80
 
81
81
  `}if(j.author)Z+=`*Released by [${j.author}](https://github.com/${j.author}) on ${new Date(j.date).toLocaleDateString()}*
82
82
 
83
83
  `}else{if(_&&G.includeCompareLinks)Z+=`[Compare Source](${_})
84
84
 
85
- `;if(D.description)Z+=`${D.description}
85
+ `;if(L.description)Z+=`${L.description}
86
86
 
87
- `;if(D.repository?.url){let j=this.getRepositoryName(D.repository.url);if(j)Z+=`\uD83D\uDCD6 [View Release Notes](https://github.com/${j}/releases)
87
+ `;if(L.repository?.url){let j=this.getRepositoryName(L.repository.url);if(j)Z+=`\uD83D\uDCD6 [View Release Notes](https://github.com/${j}/releases)
88
88
 
89
89
  `,Z+=`\uD83D\uDD17 [View Changelog](https://github.com/${j}/blob/main/CHANGELOG.md)
90
90
 
91
- `}else Z+=`\uD83D\uDCE6 [View on npm](https://www.npmjs.com/package/${encodeURIComponent(L)})
91
+ `}else Z+=`\uD83D\uDCE6 [View on npm](https://www.npmjs.com/package/${encodeURIComponent(O)})
92
92
 
93
93
  `;if(Q.releaseNotesUrl)Z+=`[Release Notes](${Q.releaseNotesUrl})
94
94
 
@@ -96,20 +96,20 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
96
96
 
97
97
  `}Z+=`</details>
98
98
 
99
- `}let N=S.filter((Q)=>!E.some((X)=>X.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,"")===Q.name));for(let Q of N){let X=Q.name==="bun.sh"?"bun.com":Q.name;Z+=`<details>
99
+ `}let N=S.filter((Q)=>!B.some((X)=>X.name.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,"")===Q.name));for(let Q of N){let X=Q.name==="bun.sh"?"bun.com":Q.name;Z+=`<details>
100
100
  `,Z+=`<summary>${X}</summary>
101
101
 
102
- `;let D=this.formatVersionChange(Q.currentVersion,Q.newVersion).replace(/`/g,"");if(Z+=`**${D}**
102
+ `;let L=this.formatVersionChange(Q.currentVersion,Q.newVersion).replace(/`/g,"");if(Z+=`**${L}**
103
103
 
104
- `,Q.file){let O=Q.file.split("/").pop()||Q.file,_=this.config?.repository?.owner&&this.config?.repository?.name?`\uD83D\uDCC1 **File**: [\`${O}\`](https://github.com/${this.config.repository.owner}/${this.config.repository.name}/blob/main/${Q.file})
104
+ `,Q.file){let z=Q.file.split("/").pop()||Q.file,_=this.config?.repository?.owner&&this.config?.repository?.name?`\uD83D\uDCC1 **File**: [\`${z}\`](https://github.com/${this.config.repository.owner}/${this.config.repository.name}/blob/main/${Q.file})
105
105
 
106
- `:`\uD83D\uDCC1 **File**: \`${O}\`
106
+ `:`\uD83D\uDCC1 **File**: \`${z}\`
107
107
 
108
108
  `;Z+=_}if(Q.name==="bun.sh")Z+=`\uD83D\uDD17 **Release Notes**: [bun.sh](https://bun.sh)
109
109
 
110
- `;else if(Q.name.includes(".org")||Q.name.includes(".net")||Q.name.includes(".com")){let O=Q.name.split("/")[0]||Q.name;Z+=`\uD83D\uDD17 **Package Info**: [pkgx.com](https://pkgx.com/pkg/${encodeURIComponent(Q.name)})
110
+ `;else if(Q.name.includes(".org")||Q.name.includes(".net")||Q.name.includes(".com")){let z=Q.name.split("/")[0]||Q.name;Z+=`\uD83D\uDD17 **Package Info**: [pkgx.com](https://pkgx.com/pkg/${encodeURIComponent(Q.name)})
111
111
 
112
- `,Z+=`\uD83C\uDF10 **Official Site**: [${O}](https://${O})
112
+ `,Z+=`\uD83C\uDF10 **Official Site**: [${z}](https://${z})
113
113
 
114
114
  `}else Z+=`\uD83D\uDD17 **Package Info**: [pkgx.com](https://pkgx.com/pkg/${encodeURIComponent(Q.name)})
115
115
 
@@ -137,7 +137,7 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
137
137
 
138
138
  `,F.size>0||w.length>0||N.length>0||V.length>0){Z+=`### \uD83D\uDCCA Package Statistics
139
139
 
140
- `;for(let Q of E){let D=F.get(Q.name)?.packageInfo;if(D?.weeklyDownloads)Z+=`- **${Q.name}**: ${D.weeklyDownloads.toLocaleString()} weekly downloads
140
+ `;for(let Q of B){let L=F.get(Q.name)?.packageInfo;if(L?.weeklyDownloads)Z+=`- **${Q.name}**: ${L.weeklyDownloads.toLocaleString()} weekly downloads
141
141
  `;else Z+=`- **${Q.name}**: npm package with weekly downloads tracked on npmjs.com
142
142
  `}for(let Q of w)Z+=`- **${Q.name}**: PHP package available on Packagist
143
143
  `;for(let Q of N){let X=Q.name==="bun.sh"?"bun.com":Q.name;if(Q.name==="bun.sh")Z+=`- **${X}**: Popular JavaScript runtime and package manager
@@ -146,7 +146,7 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
146
146
  `;Z+=`
147
147
  ---
148
148
 
149
- `}return this.finalizeBody(Z,W)}finalizeBody(W,$){let Y=this.config?.pullRequest?.bodyTemplate,R=" - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box";if(Y){if(W=C(Y,{...f($,{},this.config?.packages?.strategy),updatesTable:W,footer:" - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box"}),!W.includes("<!-- rebase-check -->"))W+=`
149
+ `}return this.finalizeBody(Z,W)}finalizeBody(W,$){let Y=this.config?.pullRequest?.bodyTemplate,R=" - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box";if(Y){if(W=h(Y,{...f($,{},this.config?.packages?.strategy),updatesTable:W,footer:" - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box"}),!W.includes("<!-- rebase-check -->"))W+=`
150
150
 
151
151
  - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
152
152
  `}else{W+=`### Configuration
@@ -157,7 +157,7 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
157
157
 
158
158
  `,W+=`\u267B **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
159
159
 
160
- `;let Z=$.updates.length===1?"this update again":"these updates again";W+=`\uD83D\uDD15 **Ignore**: Close this PR and you won't be reminded about ${Z}.
160
+ `;let D=$.updates.length===1?"this update again":"these updates again";W+=`\uD83D\uDD15 **Ignore**: Close this PR and you won't be reminded about ${D}.
161
161
 
162
162
  `,W+=`---
163
163
 
@@ -165,22 +165,26 @@ import{Ve as l}from"./chunk-kh6v93yb.js";import{ag as c,jg as A}from"./chunk-wre
165
165
 
166
166
  `,W+=`---
167
167
 
168
- `,W+="This PR was generated by [Buddy](https://github.com/stacksjs/buddy) \uD83E\uDD16"}let K=y($),H=60000-K.length;if(W.length>H){let Z=W.substring(0,H),B=Z.lastIndexOf("</details>");if(B>0)W=`${Z.substring(0,B+10)}
168
+ `,W+="This PR was generated by [Buddy](https://github.com/stacksjs/buddy) \uD83E\uDD16"}let K=y($),H=`---
169
+
170
+ - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
171
+
172
+ `,Z=60000-K.length-H.length;if(W.length>Z){let D=W.substring(0,Z),B=D.lastIndexOf("</details>");if(B>0)W=`${D.substring(0,B+10)}
169
173
 
170
174
  ---
171
175
 
172
176
  **Note**: This PR body was truncated due to GitHub's character limit. View the full details in the individual commits.
173
177
 
174
- `;else W=`${Z}
178
+ `;else W=`${D}
175
179
 
176
180
  ---
177
181
 
178
182
  **Note**: This PR body was truncated due to GitHub's character limit.
179
183
 
180
- `;W+="This PR was generated by [Buddy](https://github.com/stacksjs/buddy) \uD83E\uDD16"}if(W+=K,this.log("\u2705 PR body generation complete",{bodyLength:W.length,hasNpmSection:W.includes("## \uD83D\uDCE6 npm Dependencies"),hasComposerSection:W.includes("## \uD83D\uDC18 PHP/Composer Dependencies"),hasSystemSection:W.includes("## \uD83D\uDD27 System Dependencies"),hasGitHubActionsSection:W.includes("## \uD83D\uDE80 GitHub Actions"),hasPackageTable:W.includes("| Package | Change | Age | Adoption | Passing | Confidence |"),hasReleaseNotes:W.includes("### Release Notes"),isSparse:W.length<1000,sections:{hasNpmPackagesInSummary:W.includes("\uD83D\uDCE6 NPM Packages"),hasComposerInSummary:W.includes("\uD83D\uDC18 Composer Packages"),hasSystemInSummary:W.includes("\uD83D\uDD27 System Dependencies"),hasGitHubActionsInSummary:W.includes("\uD83D\uDE80 GitHub Actions")}}),W.length<1000)this.log("\uD83D\uDEA8 WARNING: Generated PR body appears sparse (under 1000 chars)!");return W}getRepositoryName(W){try{let $=W.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),R=new URL($).pathname.split("/").filter(Boolean);if(R.length>=2)return`${R[0]}/${R[1]}`;return W}catch{return W}}getRepositorySourceUrl(W,$,Y="master"){try{let R=W.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),K=new URL(R);if($.startsWith("@types/")&&K.pathname.includes("DefinitelyTyped")){let H=$.replace("@types/","");return`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/${Y}/types/${H}`}if(K.hostname==="github.com")return`${R}/tree/${Y}`;return R}catch{return W}}getComposerSourceUrl(W,$){try{let Y=W.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),R=new URL(Y);if($.startsWith("@types/")&&R.pathname.includes("DefinitelyTyped"))return`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/${$.replace("@types/","")}`;if(R.hostname==="github.com")return`${Y}/tree/master`;return Y}catch{return W}}getConstraintStyleChange(W,$){let Y=W.replace(/^v/,""),R=$.replace(/^v/,""),K=`^${Y}`,H=`^${R}`;return`${K} -> ${H}`}escapeMarkdownTableValue(W){return W.replaceAll("|","\\|").replaceAll(/\r?\n/g," ")}getComposerRedirectSourceUrl(W,$){try{let Y=W.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),R=new URL(Y);if($.startsWith("@types/")&&R.pathname.includes("DefinitelyTyped"))return`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/${$.replace("@types/","")}`;if(R.hostname==="github.com"){let K=R.pathname.split("/").filter((H)=>H);if(K.length>=2){let H=K[0],Z=K[1];return`https://redirect.github.com/${H}/${Z}`}}return Y}catch{return W}}cleanReleaseBody(W){let $=W.replace(/\r\n/g,`
184
+ `;W+=H,W+="This PR was generated by [Buddy](https://github.com/stacksjs/buddy) \uD83E\uDD16"}if(W+=K,this.log("\u2705 PR body generation complete",{bodyLength:W.length,hasNpmSection:W.includes("## \uD83D\uDCE6 npm Dependencies"),hasComposerSection:W.includes("## \uD83D\uDC18 PHP/Composer Dependencies"),hasSystemSection:W.includes("## \uD83D\uDD27 System Dependencies"),hasGitHubActionsSection:W.includes("## \uD83D\uDE80 GitHub Actions"),hasPackageTable:W.includes("| Package | Change | Age | Adoption | Passing | Confidence |"),hasReleaseNotes:W.includes("### Release Notes"),isSparse:W.length<1000,sections:{hasNpmPackagesInSummary:W.includes("\uD83D\uDCE6 NPM Packages"),hasComposerInSummary:W.includes("\uD83D\uDC18 Composer Packages"),hasSystemInSummary:W.includes("\uD83D\uDD27 System Dependencies"),hasGitHubActionsInSummary:W.includes("\uD83D\uDE80 GitHub Actions")}}),W.length<1000)this.log("\uD83D\uDEA8 WARNING: Generated PR body appears sparse (under 1000 chars)!");return W}getRepositoryName(W){try{let $=W.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),R=new URL($).pathname.split("/").filter(Boolean);if(R.length>=2)return`${R[0]}/${R[1]}`;return W}catch{return W}}getRepositorySourceUrl(W,$,Y="master"){try{let R=W.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),K=new URL(R);if($.startsWith("@types/")&&K.pathname.includes("DefinitelyTyped")){let H=$.replace("@types/","");return`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/${Y}/types/${H}`}if(K.hostname==="github.com")return`${R}/tree/${Y}`;return R}catch{return W}}getComposerSourceUrl(W,$){try{let Y=W.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),R=new URL(Y);if($.startsWith("@types/")&&R.pathname.includes("DefinitelyTyped"))return`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/${$.replace("@types/","")}`;if(R.hostname==="github.com")return`${Y}/tree/master`;return Y}catch{return W}}getConstraintStyleChange(W,$){let Y=W.replace(/^v/,""),R=$.replace(/^v/,""),K=`^${Y}`,H=`^${R}`;return`${K} -> ${H}`}escapeMarkdownTableValue(W){return W.replaceAll("|","\\|").replaceAll(/\r?\n/g," ")}getComposerRedirectSourceUrl(W,$){try{let Y=W.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),R=new URL(Y);if($.startsWith("@types/")&&R.pathname.includes("DefinitelyTyped"))return`https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/${$.replace("@types/","")}`;if(R.hostname==="github.com"){let K=R.pathname.split("/").filter((H)=>H);if(K.length>=2){let H=K[0],Z=K[1];return`https://redirect.github.com/${H}/${Z}`}}return Y}catch{return W}}cleanReleaseBody(W){let $=W.replace(/\r\n/g,`
181
185
  `).replace(/\n{3,}/g,`
182
186
 
183
187
  `).trim();$=this.sanitizeMentions($),$=this.sanitizeGitHubReferences($);let Y=this.config?.releaseNotes?.maxBodyLength??1000;if($.length>Y)$=`${$.substring(0,Y)}...
184
188
 
185
- *[View full release notes]*`;return $}sanitizeMentions(W){let $=[],Y=[],R=W.replace(/```[\s\S]*?```/g,(K)=>{return $.push(K),`__FENCE_PLACEHOLDER_${$.length-1}__`});return R=R.replace(/`[^`\n]+`/g,(K)=>{return Y.push(K),`__INLINE_CODE_PLACEHOLDER_${Y.length-1}__`}),R=R.replace(/(?<![\w./])@([A-Z0-9-]+)(?![A-Z0-9-])/gi,(K,H)=>{return`[${H}](https://github.com/${H})`}),R=R.replace(/__INLINE_CODE_PLACEHOLDER_(\d+)__/g,(K,H)=>Y[Number(H)]),R=R.replace(/__FENCE_PLACEHOLDER_(\d+)__/g,(K,H)=>$[Number(H)]),R}sanitizeGitHubReferences(W){if(this.config?.releaseNotes?.sanitizeReferences===!1)return W;let $=[],Y=[],R=W.replace(/```[\s\S]*?```/g,(K)=>{return $.push(K),`__FENCE_PLACEHOLDER_${$.length-1}__`});return R=R.replace(/`[^`\n]+`/g,(K)=>{return Y.push(K),`__INLINE_CODE_PLACEHOLDER_${Y.length-1}__`}),R=R.replace(/https?:\/\/github\.com\/([^/]+)\/([^/]+)\/(?:pull|issues)\/(\d+)/g,(K,H,Z,B)=>`\`${H}/${Z}#${B}\``),R=R.replace(/(?<![`\w])#(\d+)(?!\d)/g,"`#$1`"),R=R.replace(/__INLINE_CODE_PLACEHOLDER_(\d+)__/g,(K,H)=>Y[Number(H)]),R=R.replace(/__FENCE_PLACEHOLDER_(\d+)__/g,(K,H)=>$[Number(H)]),R}generateCustomTemplate(W,$,Y={}){let R=$,H={...{"{title}":this.generateTitle(W),"{package_count}":W.updates.length.toString(),"{update_type}":W.updateType,"{packages}":W.updates.map((Z)=>Z.name).join(", "),"{date}":new Date().toISOString().split("T")[0]},...Y};for(let[Z,B]of Object.entries(H))R=R.replace(new RegExp(Z,"g"),B);return R}formatVersionChange(W,$){let Y=W.match(/^(\D+)/),R=Y?Y[1]:"";if(R){let K=W.replace(/^\D+/,""),H=$.replace(/^\D+/,"");return`\`${R}${K}\` \u2192 \`${R}${H}\``}return`\`${W}\` \u2192 \`${$}\``}getVersionChangeDescription(W,$,Y){return{major:"\uD83D\uDD34 Breaking changes possible",minor:"\uD83D\uDFE1 New features added",patch:"\uD83D\uDFE2 Bug fixes & patches"}[Y]}}
186
- export{C as qd,f as rd,p as sd};
189
+ *[View full release notes]*`;return $}sanitizeMentions(W){let $=[],Y=[],R=W.replace(/```[\s\S]*?```/g,(K)=>{return $.push(K),`__FENCE_PLACEHOLDER_${$.length-1}__`});return R=R.replace(/`[^`\n]+`/g,(K)=>{return Y.push(K),`__INLINE_CODE_PLACEHOLDER_${Y.length-1}__`}),R=R.replace(/(?<![\w./])@([A-Z0-9-]+)(?![A-Z0-9-])/gi,(K,H)=>{return`[${H}](https://github.com/${H})`}),R=R.replace(/__INLINE_CODE_PLACEHOLDER_(\d+)__/g,(K,H)=>Y[Number(H)]),R=R.replace(/__FENCE_PLACEHOLDER_(\d+)__/g,(K,H)=>$[Number(H)]),R}sanitizeGitHubReferences(W){if(this.config?.releaseNotes?.sanitizeReferences===!1)return W;let $=[],Y=[],R=W.replace(/```[\s\S]*?```/g,(K)=>{return $.push(K),`__FENCE_PLACEHOLDER_${$.length-1}__`});return R=R.replace(/`[^`\n]+`/g,(K)=>{return Y.push(K),`__INLINE_CODE_PLACEHOLDER_${Y.length-1}__`}),R=R.replace(/https?:\/\/github\.com\/([^/]+)\/([^/]+)\/(?:pull|issues)\/(\d+)/g,(K,H,Z,D)=>`\`${H}/${Z}#${D}\``),R=R.replace(/(?<![`\w])#(\d+)(?!\d)/g,"`#$1`"),R=R.replace(/__INLINE_CODE_PLACEHOLDER_(\d+)__/g,(K,H)=>Y[Number(H)]),R=R.replace(/__FENCE_PLACEHOLDER_(\d+)__/g,(K,H)=>$[Number(H)]),R}generateCustomTemplate(W,$,Y={}){let R=$,H={...{"{title}":this.generateTitle(W),"{package_count}":W.updates.length.toString(),"{update_type}":W.updateType,"{packages}":W.updates.map((Z)=>Z.name).join(", "),"{date}":new Date().toISOString().split("T")[0]},...Y};for(let[Z,D]of Object.entries(H))R=R.replace(new RegExp(Z,"g"),D);return R}formatVersionChange(W,$){let Y=W.match(/^(\D+)/),R=Y?Y[1]:"";if(R){let K=W.replace(/^\D+/,""),H=$.replace(/^\D+/,"");return`\`${R}${K}\` \u2192 \`${R}${H}\``}return`\`${W}\` \u2192 \`${$}\``}getVersionChangeDescription(W,$,Y){return{major:"\uD83D\uDD34 Breaking changes possible",minor:"\uD83D\uDFE1 New features added",patch:"\uD83D\uDFE2 Bug fixes & patches"}[Y]}}
190
+ export{h as rd,f as sd,p as td};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Ah as S,wh as G,zh as R}from"./chunk-6k6dgwmy.js";import{Ih as x}from"./chunk-a3bnhq58.js";import{Oh as K}from"./chunk-8dj94fsy.js";var{semver:H}=globalThis.Bun;import F from"process";class P{userAgent="Buddy/1.0.0 (https://github.com/stacksjs/buddy)";logger;constructor(B){this.logger=B??K()}githubHeaders(){let B={"User-Agent":this.userAgent,Accept:"application/vnd.github.v3+json"},J=F.env.BUDDY_TOKEN||F.env.GITHUB_TOKEN||F.env.GH_TOKEN;if(J)B.Authorization=`Bearer ${J}`;return B}async fetchPackageInfo(B,J,Y){if(F.env.APP_ENV==="test"){let X={stripe:{owner:"stripe",repo:"stripe-node"},typescript:{owner:"microsoft",repo:"TypeScript"},react:{owner:"facebook",repo:"react"}}[B]||{owner:"example",repo:B};return{packageInfo:{name:B,description:`Package ${B} description`,repository:{type:"git",url:`https://github.com/${X.owner}/${X.repo}`}},releaseNotes:[],changelog:[],compareUrl:this.generateCompareUrl(X.owner,X.repo,J,Y)}}try{let q=await this.fetchNpmPackageInfo(B),X=[],Z=[],Q;if(q.repository?.url){let O=this.parseGitHubUrl(q.repository.url);if(O)X=await this.fetchGitHubReleases(O.owner,O.repo,J,Y),Q=this.generateCompareUrl(O.owner,O.repo,J,Y),Z=await this.fetchChangelog(O.owner,O.repo)}return{packageInfo:q,releaseNotes:X,changelog:Z,compareUrl:Q}}catch(q){return this.logger.error(`\u274C Failed to fetch package info for ${B}:`,q),{packageInfo:{name:B,description:`Package ${B} - see npm for details`,repository:{type:"git",url:`https://github.com/search?q=${encodeURIComponent(B)}&type=repositories`}},releaseNotes:[],changelog:[]}}}async fetchNpmPackageInfo(B){try{let J=R(B),Y=await x(`${J}/${encodeURIComponent(B).replace("%40","@")}`,{headers:{"User-Agent":this.userAgent}});if(!Y.ok)throw Error(`NPM registry responded with ${Y.status}`);let q=await Y.json(),X=q["dist-tags"]?.latest,Z;try{let L=await x(`https://api.npmjs.org/downloads/point/last-week/${encodeURIComponent(B)}`,{headers:{"User-Agent":this.userAgent}});if(L.ok)Z=(await L.json()).downloads}catch{}let Q=typeof q.repository==="string"?{type:"git",url:q.repository}:q.repository?.url?{type:q.repository.type??"git",url:q.repository.url}:void 0,O=q.author,_=typeof O==="string"?O:O&&typeof O==="object"&&("name"in O)&&typeof O.name==="string"?O:void 0,$=Array.isArray(q.maintainers)?q.maintainers.filter((L)=>!!L&&typeof L==="object"&&("name"in L)&&typeof L.name==="string"):void 0;return{name:B,description:q.description,homepage:q.homepage,repository:Q,license:q.license,author:_,keywords:q.keywords,weeklyDownloads:Z,lastPublish:X?q.time?.[X]:void 0,maintainers:$}}catch(J){return this.logger.warn(`\u26A0\uFE0F Failed to fetch npm info for ${B}:`,J),{name:B,description:`NPM package ${B}`,homepage:`https://www.npmjs.com/package/${encodeURIComponent(B)}`}}}async fetchSpanReleases(B,J,Y,q=5){let X=await this.fetchNpmPackageInfo(B).catch(()=>null),Z=X?.repository?.url?this.parseGitHubUrl(X.repository.url):null;if(!Z)return this.logger.debug(`No GitHub repository for ${B}; no span notes available`),[];let Q=[];for(let O=1;O<=q;O++){let _=await x(`${G()}/repos/${Z.owner}/${Z.repo}/releases?per_page=100&page=${O}`,{headers:this.githubHeaders()}).catch(()=>null);if(!_?.ok)break;let $=await _.json().catch(()=>null);if(!Array.isArray($)||$.length===0)break;for(let j of $)Q.push({version:j.tag_name,date:j.published_at,title:j.name??j.tag_name,body:j.body??"",htmlUrl:j.html_url,isPrerelease:j.prerelease});if($.some((j)=>this.isVersionBetween(j.tag_name.replace(/^v/,""),"0.0.0",J))||$.length<100)break}return Q.filter((O)=>this.isVersionBetween(O.version.replace(/^v/,""),J,Y))}parseGitHubUrl(B){try{let J=B.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),Y=new URL(J);if(Y.hostname!=="github.com")return null;let q=Y.pathname.split("/").filter(Boolean);if(q.length>=2)return{owner:q[0],repo:q[1]};return null}catch{return null}}async fetchGitHubReleases(B,J,Y,q){try{let X=await x(`${G()}/repos/${B}/${J}/releases?per_page=50`,{headers:this.githubHeaders()});if(!X.ok)return[];return(await X.json()).filter((Q)=>{let O=Q.tag_name.replace(/^v/,"");return this.isVersionBetween(O,Y,q)}).map((Q)=>({version:Q.tag_name,date:Q.published_at,title:Q.name??Q.tag_name,body:Q.body??"",htmlUrl:Q.html_url,compareUrl:this.generateCompareUrl(B,J,Y,Q.tag_name),author:Q.author?.login,isPrerelease:Q.prerelease,assets:Q.assets?.map((O)=>({name:O.name,downloadUrl:O.browser_download_url,size:O.size,contentType:O.content_type}))??[]}))}catch(X){return this.logger.warn(`Failed to fetch GitHub releases for ${B}/${J}:`,X),[]}}async fetchChangelog(B,J){let Y=["CHANGELOG.md","CHANGELOG.rst","HISTORY.md","RELEASES.md"];for(let q of Y)try{let X=await x(`${G()}/repos/${B}/${J}/contents/${q}`,{headers:this.githubHeaders()});if(X.ok){let Z=await X.json();if(Z.content){let Q=atob(Z.content);return this.parseChangelog(Q)}}}catch{}return[]}parseChangelog(B){let J=[],Y=B.split(`
2
+ import{Ah as R,Bh as S,xh as G}from"./chunk-2z9pkk1y.js";import{Jh as x}from"./chunk-b9szrnxw.js";import{Ph as K}from"./chunk-x1w6q9tk.js";var{semver:H}=globalThis.Bun;import F from"process";class P{userAgent="Buddy/1.0.0 (https://github.com/stacksjs/buddy)";logger;constructor(B){this.logger=B??K()}githubHeaders(){let B={"User-Agent":this.userAgent,Accept:"application/vnd.github.v3+json"},J=F.env.BUDDY_TOKEN||F.env.GITHUB_TOKEN||F.env.GH_TOKEN;if(J)B.Authorization=`Bearer ${J}`;return B}async fetchPackageInfo(B,J,Y){if(F.env.APP_ENV==="test"){let X={stripe:{owner:"stripe",repo:"stripe-node"},typescript:{owner:"microsoft",repo:"TypeScript"},react:{owner:"facebook",repo:"react"}}[B]||{owner:"example",repo:B};return{packageInfo:{name:B,description:`Package ${B} description`,repository:{type:"git",url:`https://github.com/${X.owner}/${X.repo}`}},releaseNotes:[],changelog:[],compareUrl:this.generateCompareUrl(X.owner,X.repo,J,Y)}}try{let q=await this.fetchNpmPackageInfo(B),X=[],Z=[],Q;if(q.repository?.url){let O=this.parseGitHubUrl(q.repository.url);if(O)X=await this.fetchGitHubReleases(O.owner,O.repo,J,Y),Q=this.generateCompareUrl(O.owner,O.repo,J,Y),Z=await this.fetchChangelog(O.owner,O.repo)}return{packageInfo:q,releaseNotes:X,changelog:Z,compareUrl:Q}}catch(q){return this.logger.error(`\u274C Failed to fetch package info for ${B}:`,q),{packageInfo:{name:B,description:`Package ${B} - see npm for details`,repository:{type:"git",url:`https://github.com/search?q=${encodeURIComponent(B)}&type=repositories`}},releaseNotes:[],changelog:[]}}}async fetchNpmPackageInfo(B){try{let J=R(B),Y=await x(`${J}/${encodeURIComponent(B).replace("%40","@")}`,{headers:{"User-Agent":this.userAgent}});if(!Y.ok)throw Error(`NPM registry responded with ${Y.status}`);let q=await Y.json(),X=q["dist-tags"]?.latest,Z;try{let L=await x(`https://api.npmjs.org/downloads/point/last-week/${encodeURIComponent(B)}`,{headers:{"User-Agent":this.userAgent}});if(L.ok)Z=(await L.json()).downloads}catch{}let Q=typeof q.repository==="string"?{type:"git",url:q.repository}:q.repository?.url?{type:q.repository.type??"git",url:q.repository.url}:void 0,O=q.author,_=typeof O==="string"?O:O&&typeof O==="object"&&("name"in O)&&typeof O.name==="string"?O:void 0,$=Array.isArray(q.maintainers)?q.maintainers.filter((L)=>!!L&&typeof L==="object"&&("name"in L)&&typeof L.name==="string"):void 0;return{name:B,description:q.description,homepage:q.homepage,repository:Q,license:q.license,author:_,keywords:q.keywords,weeklyDownloads:Z,lastPublish:X?q.time?.[X]:void 0,maintainers:$}}catch(J){return this.logger.warn(`\u26A0\uFE0F Failed to fetch npm info for ${B}:`,J),{name:B,description:`NPM package ${B}`,homepage:`https://www.npmjs.com/package/${encodeURIComponent(B)}`}}}async fetchSpanReleases(B,J,Y,q=5){let X=await this.fetchNpmPackageInfo(B).catch(()=>null),Z=X?.repository?.url?this.parseGitHubUrl(X.repository.url):null;if(!Z)return this.logger.debug(`No GitHub repository for ${B}; no span notes available`),[];let Q=[];for(let O=1;O<=q;O++){let _=await x(`${G()}/repos/${Z.owner}/${Z.repo}/releases?per_page=100&page=${O}`,{headers:this.githubHeaders()}).catch(()=>null);if(!_?.ok)break;let $=await _.json().catch(()=>null);if(!Array.isArray($)||$.length===0)break;for(let j of $)Q.push({version:j.tag_name,date:j.published_at,title:j.name??j.tag_name,body:j.body??"",htmlUrl:j.html_url,isPrerelease:j.prerelease});if($.some((j)=>this.isVersionBetween(j.tag_name.replace(/^v/,""),"0.0.0",J))||$.length<100)break}return Q.filter((O)=>this.isVersionBetween(O.version.replace(/^v/,""),J,Y))}parseGitHubUrl(B){try{let J=B.replace(/^git\+/,"").replace(/\.git$/,"").replace(/^git:\/\//,"https://").replace(/^ssh:\/\/git@/,"https://").replace(/^git@github\.com:/,"https://github.com/"),Y=new URL(J);if(Y.hostname!=="github.com")return null;let q=Y.pathname.split("/").filter(Boolean);if(q.length>=2)return{owner:q[0],repo:q[1]};return null}catch{return null}}async fetchGitHubReleases(B,J,Y,q){try{let X=await x(`${G()}/repos/${B}/${J}/releases?per_page=50`,{headers:this.githubHeaders()});if(!X.ok)return[];return(await X.json()).filter((Q)=>{let O=Q.tag_name.replace(/^v/,"");return this.isVersionBetween(O,Y,q)}).map((Q)=>({version:Q.tag_name,date:Q.published_at,title:Q.name??Q.tag_name,body:Q.body??"",htmlUrl:Q.html_url,compareUrl:this.generateCompareUrl(B,J,Y,Q.tag_name),author:Q.author?.login,isPrerelease:Q.prerelease,assets:Q.assets?.map((O)=>({name:O.name,downloadUrl:O.browser_download_url,size:O.size,contentType:O.content_type}))??[]}))}catch(X){return this.logger.warn(`Failed to fetch GitHub releases for ${B}/${J}:`,X),[]}}async fetchChangelog(B,J){let Y=["CHANGELOG.md","CHANGELOG.rst","HISTORY.md","RELEASES.md"];for(let q of Y)try{let X=await x(`${G()}/repos/${B}/${J}/contents/${q}`,{headers:this.githubHeaders()});if(X.ok){let Z=await X.json();if(Z.content){let Q=atob(Z.content);return this.parseChangelog(Q)}}}catch{}return[]}parseChangelog(B){let J=[],Y=B.split(`
3
3
  `),q=null,X=null;for(let Z of Y){let Q=Z.match(/^##\s*\[?([^\]]+)\]?\s*-?\s*(.*)/);if(Q){if(q)J.push(q);q={version:Q[1],date:Q[2].trim(),changes:{}},X=null;continue}let O=Z.match(/^###\s*(.+)/);if(O&&q){X=O[1].toLowerCase();continue}let _=Z.match(/^[-*]\s*(.+)/);if(_&&q&&X){if(!q.changes)q.changes={};let $=X;if(!q.changes[$])q.changes[$]=[];q.changes[$].push(_[1])}}if(q)J.push(q);return J.slice(0,10)}generateCompareUrl(B,J,Y,q){let X=this.getComparableVersion(Y),Z=this.getComparableVersion(q);if(!X||!Z)return;return`https://github.com/${B}/${J}/compare/${encodeURIComponent(`v${X}`)}...${encodeURIComponent(`v${Z}`)}`}isVersionBetween(B,J,Y){let q=this.getComparableVersion(B),X=this.getComparableVersion(J),Z=this.getComparableVersion(Y);if(!q||!X||!Z)return!1;try{return H.order(q,X)>0&&H.order(q,Z)<=0}catch{return q>X&&q<=Z}}getComparableVersion(B){let J=B.split("||").flatMap((Y)=>{let q=Y.trim();if(q.startsWith("<"))return[];let X=q.match(/^(?:[~^]|>=?|=)?\s*v?(\d+(?:\.\d+){0,2}(?:-[0-9A-Z.-]+)?)/i);if(!X)return[];let[Z,Q]=X[1].split("-",2),O=Z.split(".");while(O.length<3)O.push("0");return[`${O.join(".")}${Q?`-${Q}`:""}`]});if(J.length===0)return null;return J.reduce((Y,q)=>{try{return H.order(q,Y)>0?q:Y}catch{return q>Y?q:Y}})}generatePackageBadges(B,J,Y){let q=encodeURIComponent(B.name),X=this.normalizeVersionForBadges(J),Z=this.normalizeVersionForBadges(Y),Q=encodeURIComponent(X),O=encodeURIComponent(Z);return{age:`[![age](https://developer.mend.io/api/mc/badges/age/npm/${q}/${O}?slim=true)](https://docs.renovatebot.com/merge-confidence/)`,adoption:`[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/${q}/${O}?slim=true)](https://docs.renovatebot.com/merge-confidence/)`,passing:`[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/${q}/${Q}/${O}?slim=true)](https://docs.renovatebot.com/merge-confidence/)`,confidence:`[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/${q}/${Q}/${O}?slim=true)](https://docs.renovatebot.com/merge-confidence/)`}}async fetchComposerPackageInfo(B){if(F.env.APP_ENV==="test")return{name:B,description:`PHP package ${B} description`,homepage:`https://packagist.org/packages/${B}`,repository:{type:"git",url:`https://github.com/example/${B}`},license:"MIT"};try{let J=await x(`${S()}/packages/${encodeURIComponent(B)}.json`,{headers:{"User-Agent":this.userAgent}});if(!J.ok)throw Error(`Packagist responded with ${J.status}`);let q=(await J.json()).package;if(!q?.versions)return{name:B};let X=Object.keys(q.versions),Z=X.find((L)=>!L.includes("dev")&&!L.includes("alpha")&&!L.includes("beta"))??X[0],Q=(Z?q.versions[Z]:void 0)??{},O=Array.isArray(Q.license)?Q.license[0]:Q.license,_=Q.authors?.[0],$=_&&typeof _==="object"&&"name"in _&&typeof _.name==="string"?_:void 0;return{name:q.name??B,description:Q.description,homepage:Q.homepage,repository:Q.source?.url?{type:"git",url:Q.source.url}:void 0,license:O,author:$,keywords:Q.keywords,lastPublish:Q.time}}catch(J){return this.logger.warn(`Failed to fetch Packagist info for ${B}:`,J),{name:B}}}generateComposerBadges(B,J,Y){let q=encodeURIComponent(B.name),X=this.normalizeVersionForBadges(J),Z=this.normalizeVersionForBadges(Y),Q=encodeURIComponent(X),O=encodeURIComponent(Z);return{age:`[![age](https://developer.mend.io/api/mc/badges/age/packagist/${q}/${O}?slim=true)](https://docs.renovatebot.com/merge-confidence/)`,adoption:`[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/${q}/${O}?slim=true)](https://docs.renovatebot.com/merge-confidence/)`,passing:`[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/${q}/${Q}/${O}?slim=true)](https://docs.renovatebot.com/merge-confidence/)`,confidence:`[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/${q}/${Q}/${O}?slim=true)](https://docs.renovatebot.com/merge-confidence/)`}}normalizeVersionForBadges(B){let J=B.replace(/^v/,"");if(J.split(".").length===2)J=`${J}.0`;return J}}
4
- export{P as Ve};
4
+ export{P as We};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{ld as J}from"./chunk-89s9f3mf.js";import{md as Y}from"./chunk-ja3rvd6y.js";import{te as _}from"./chunk-hyp0wfta.js";import{we as x,xe as w}from"./chunk-4hd1mryc.js";import{Pe as z,Qe as M}from"./chunk-nwrr6jas.js";import{Xe as N}from"./chunk-88j356ng.js";import{yg as L,zg as S}from"./chunk-1m5wprvm.js";import{Oh as G}from"./chunk-8dj94fsy.js";import{dl as j}from"./chunk-s3ksf6s5.js";var{Glob:D}=globalThis.Bun;import{readdir as A,readFile as U,stat as Z}from"fs/promises";import{join as R,relative as E,sep as H}from"path";async function I(q,K){try{let O=JSON.parse(K),V=[];if(O.packages){for(let Q of Object.values(O.packages))if(Q.name&&Q.version)V.push({name:Q.name,currentVersion:Q.version,type:"dependencies",file:q})}return{path:q,type:"pantry.lock",content:K,dependencies:V}}catch(O){return G().warn(`Failed to parse pantry.lock file ${q}:`,O),null}}class m{projectPath;logger;ignoreGlobs=[];constructor(q,K,O){this.projectPath=q;this.logger=K;if(O&&O.length>0)this.ignoreGlobs=O.map((V)=>new D(V)),this.logger.info(`Initialized ${this.ignoreGlobs.length} ignore patterns: ${O.join(", ")}`)}async scanProject(){this.logger.info("Scanning project for package files...");let q=Date.now(),K=[];try{let O=await this.findFiles("package.json");for(let X of O){if(this.shouldIgnorePath(X))continue;let $=await this.parsePackageJsonFile(X);if($)K.push($)}let V=await this.findDependencyFiles();for(let X of V){if(this.shouldIgnorePath(X))continue;let $=await this.parseDependencyFile(X);if($)K.push($)}let Q=await this.findLockFiles();for(let X of Q){if(this.shouldIgnorePath(X))continue;let $=await this.parseLockFile(X);if($)K.push($)}let W=await this.findComposerFiles();for(let X of W){if(this.shouldIgnorePath(X))continue;let $=await this.parseComposerFile(X);if($)K.push($)}let B=await this.findGitHubActionsFiles();for(let X of B){if(this.shouldIgnorePath(X))continue;let $=await this.parseGitHubActionsFile(X);if($)K.push($)}let C=await this.findDockerfiles();this.logger.info(`\uD83D\uDD0D Found ${C.length} Dockerfile(s): ${C.join(", ")}`);for(let X of C){if(this.shouldIgnorePath(X))continue;let $=await this.parseDockerfile(X);if($)K.push($),this.logger.info(`\uD83D\uDCE6 Parsed Dockerfile: ${X} with ${$.dependencies.length} dependencies`)}let T=await this.findZigManifests();this.logger.info(`\uD83D\uDD0D Found ${T.length} Zig manifest(s): ${T.join(", ")}`);for(let X of T){if(this.shouldIgnorePath(X))continue;let $=await this.parseZigManifestFile(X);if($)K.push($),this.logger.info(`\uD83D\uDCE6 Parsed Zig manifest: ${X} with ${$.dependencies.length} dependencies`)}let b=await this.findFiles("pantry.lock");for(let X of b){if(this.shouldIgnorePath(X))continue;let $=await this.parsePantryLockFile(X);if($)K.push($),this.logger.info(`\uD83D\uDCE6 Parsed pantry.lock: ${X} with ${$.dependencies.length} dependencies`)}let v=Date.now()-q;return this.logger.success(`Found ${K.length} package files in ${v}ms`),K}catch(O){throw this.logger.error("Failed to scan project:",O),new Y(`Failed to scan project: ${O instanceof Error?O.message:"Unknown error"}`)}}async parsePackageJsonFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8"),V=JSON.parse(O),Q=[];return this.extractDependencies(V.dependencies,"dependencies",q,Q),this.extractDependencies(V.devDependencies,"devDependencies",q,Q),this.extractDependencies(V.peerDependencies,"peerDependencies",q,Q),this.extractDependencies(V.optionalDependencies,"optionalDependencies",q,Q),Q.push(...N(V.engines,q)),{path:q,type:"package.json",content:O,dependencies:Q}}catch(K){return this.logger.warn(`Failed to parse package.json file ${q}:`,K),null}}async parseLockFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8"),V=q.split("/").pop()||"",Q;if(V==="bun.lockb")Q="bun.lockb";else if(V==="package-lock.json")Q="package-lock.json";else if(V==="yarn.lock")Q="yarn.lock";else if(V==="pnpm-lock.yaml")Q="pnpm-lock.yaml";else return null;let W=await this.extractLockFileDependencies(O,Q,q);return{path:q,type:Q,content:O,dependencies:W}}catch(K){return this.logger.warn(`Failed to parse lock file ${q}:`,K),null}}async parseDependencyFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await S(q,O)}catch(K){return this.logger.warn(`Failed to parse dependency file ${q}:`,K),null}}async findDependencyFiles(){let q=[],K=["deps.yaml","deps.yml","dependencies.yaml","dependencies.yml","pkgx.yaml","pkgx.yml",".deps.yaml",".deps.yml"];for(let Q of K){let W=await this.findFiles(Q);q.push(...W)}let O=await this.findFilesByPattern("*.yaml"),V=await this.findFilesByPattern("*.yml");for(let Q of[...O,...V])if(L(Q)&&!q.includes(Q))q.push(Q);return q}async findGitHubActionsFiles(){let q=[];try{let O=R(this.projectPath,".github","workflows");if((await Z(O).catch(()=>null))?.isDirectory()){let Q=await this.findFilesByPatternInDir("*.yaml",O),W=await this.findFilesByPatternInDir("*.yml",O);for(let B of[...Q,...W])if(x(B))q.push(B)}}catch{}return q}async findDockerfiles(){return this.findFilesMatching(z)}async findFilesMatching(q,K=this.projectPath){let O=[];try{let V=await A(K);for(let Q of V){let W=R(K,Q);try{let B=await Z(W);if(B.isFile()){if(q(Q))O.push(E(this.projectPath,W).split(H).join("/"))}else if(B.isDirectory()&&!J(Q))O.push(...await this.findFilesMatching(q,W))}catch{continue}}}catch{}return O}async parseGitHubActionsFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await w(q,O)}catch(K){return this.logger.warn(`Failed to parse GitHub Actions file ${q}:`,K),null}}async parseDockerfile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await M(q,O)}catch(K){return this.logger.warn(`Failed to parse Dockerfile ${q}:`,K),null}}async findZigManifests(){let q=[];try{let K=await this.findFiles("build.zig.zon");q.push(...K)}catch{}return q}async parseZigManifestFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await _(q,O)}catch(K){return this.logger.warn(`Failed to parse Zig manifest ${q}:`,K),null}}async findComposerFiles(){let q=[];try{let K=await this.findFiles("composer.json");q.push(...K);let O=await this.findFiles("composer.lock");q.push(...O)}catch{}return q}async parseComposerFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8"),{parseComposerFile:V}=await import("./chunk-kpdz73mc.js");return await V(q,O)}catch(K){return this.logger.warn(`Failed to parse Composer file ${q}:`,K),null}}async parsePantryLockFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await I(q,O)}catch(K){return this.logger.warn(`Failed to parse pantry.lock file ${q}:`,K),null}}extractDependencies(q,K,O,V){if(!q)return;for(let[Q,W]of Object.entries(q))V.push({name:Q,currentVersion:W,type:K,file:this.getRelativePath(O)})}async extractLockFileDependencies(q,K,O){let V=[];if(K==="package-lock.json")try{let Q=JSON.parse(q);if(Q.packages){for(let[W,B]of Object.entries(Q.packages))if(W&&W!==""&&B&&typeof B==="object"){let C=B;if(C.version){let T=W.startsWith("node_modules/")?W.replace("node_modules/",""):W;V.push({name:T,currentVersion:C.version,type:C.dev?"devDependencies":"dependencies",file:this.getRelativePath(O)})}}}}catch(Q){this.logger.warn("Failed to parse package-lock.json:",Q)}return V}async findFiles(q,K=this.projectPath){let O=[];try{let V=await A(K);for(let Q of V){let W=R(K,Q);try{let B=await Z(W);if(B.isDirectory()){if(!J(Q)){let C=await this.findFiles(q,W);O.push(...C)}}else if(B.isFile()&&Q===q){let C=E(this.projectPath,W);O.push(C.split(H).join("/"))}}catch{continue}}}catch{}return O}async findLockFiles(){let q=["bun.lock","bun.lockb","package-lock.json","yarn.lock","pnpm-lock.yaml"],K=[];for(let O of q){let V=await this.findFiles(O);K.push(...V)}return K}async findFilesByPattern(q){let K=[],O=q.replace("*.","");try{let V=await A(this.projectPath);for(let Q of V){let W=R(this.projectPath,Q),B=await Z(W);if(B.isFile()&&Q.endsWith(`.${O}`)){let C=E(this.projectPath,W);K.push(C.split(H).join("/"))}else if(B.isDirectory()&&!J(Q)){let C=await this.findFilesByPatternInDir(q,W);K.push(...C)}}}catch{}return K}async findFilesByPatternInDir(q,K){let O=[],V=q.replace("*.","");try{let Q=await A(K);for(let W of Q){let B=R(K,W),C=await Z(B);if(C.isFile()&&W.endsWith(`.${V}`)){let T=E(this.projectPath,B);O.push(T.split(H).join("/"))}else if(C.isDirectory()&&!J(W)){let T=await this.findFilesByPatternInDir(q,B);O.push(...T)}}}catch{}return O}shouldIgnorePath(q){if(this.ignoreGlobs.length===0)return!1;let K=q;if(q.startsWith("/")||q.includes(":"))K=this.getRelativePath(q);for(let O of this.ignoreGlobs)if(O.match(K))return this.logger.debug(`Ignoring path: ${K} (matched pattern)`),!0;return!1}getRelativePath(q){return E(this.projectPath,q).split(H).join("/")}async getDependencyCount(){return(await this.scanProject()).reduce((K,O)=>K+O.dependencies.length,0)}async getUniqueDependencies(){return(await this.scanProject()).flatMap((V)=>V.dependencies).filter((V,Q,W)=>Q===W.findIndex((B)=>B.name===V.name))}}
3
- export{m as kd};
2
+ import{md as J}from"./chunk-bnp0r4eh.js";import{nd as Y}from"./chunk-0f1xye20.js";import{ue as _}from"./chunk-wjfw6rx8.js";import{xe as x,ye as w}from"./chunk-w55x2g9n.js";import{Qe as z,Re as M}from"./chunk-1xe0960b.js";import{Ye as N}from"./chunk-j46f90n8.js";import{Ag as S,zg as L}from"./chunk-54er1whp.js";import{Ph as G}from"./chunk-x1w6q9tk.js";import{el as j}from"./chunk-kbvj6qxc.js";var{Glob:D}=globalThis.Bun;import{readdir as A,readFile as U,stat as Z}from"fs/promises";import{join as R,relative as E,sep as H}from"path";async function I(q,K){try{let O=JSON.parse(K),V=[];if(O.packages){for(let Q of Object.values(O.packages))if(Q.name&&Q.version)V.push({name:Q.name,currentVersion:Q.version,type:"dependencies",file:q})}return{path:q,type:"pantry.lock",content:K,dependencies:V}}catch(O){return G().warn(`Failed to parse pantry.lock file ${q}:`,O),null}}class m{projectPath;logger;ignoreGlobs=[];constructor(q,K,O){this.projectPath=q;this.logger=K;if(O&&O.length>0)this.ignoreGlobs=O.map((V)=>new D(V)),this.logger.info(`Initialized ${this.ignoreGlobs.length} ignore patterns: ${O.join(", ")}`)}async scanProject(){this.logger.info("Scanning project for package files...");let q=Date.now(),K=[];try{let O=await this.findFiles("package.json");for(let X of O){if(this.shouldIgnorePath(X))continue;let $=await this.parsePackageJsonFile(X);if($)K.push($)}let V=await this.findDependencyFiles();for(let X of V){if(this.shouldIgnorePath(X))continue;let $=await this.parseDependencyFile(X);if($)K.push($)}let Q=await this.findLockFiles();for(let X of Q){if(this.shouldIgnorePath(X))continue;let $=await this.parseLockFile(X);if($)K.push($)}let W=await this.findComposerFiles();for(let X of W){if(this.shouldIgnorePath(X))continue;let $=await this.parseComposerFile(X);if($)K.push($)}let B=await this.findGitHubActionsFiles();for(let X of B){if(this.shouldIgnorePath(X))continue;let $=await this.parseGitHubActionsFile(X);if($)K.push($)}let C=await this.findDockerfiles();this.logger.info(`\uD83D\uDD0D Found ${C.length} Dockerfile(s): ${C.join(", ")}`);for(let X of C){if(this.shouldIgnorePath(X))continue;let $=await this.parseDockerfile(X);if($)K.push($),this.logger.info(`\uD83D\uDCE6 Parsed Dockerfile: ${X} with ${$.dependencies.length} dependencies`)}let T=await this.findZigManifests();this.logger.info(`\uD83D\uDD0D Found ${T.length} Zig manifest(s): ${T.join(", ")}`);for(let X of T){if(this.shouldIgnorePath(X))continue;let $=await this.parseZigManifestFile(X);if($)K.push($),this.logger.info(`\uD83D\uDCE6 Parsed Zig manifest: ${X} with ${$.dependencies.length} dependencies`)}let b=await this.findFiles("pantry.lock");for(let X of b){if(this.shouldIgnorePath(X))continue;let $=await this.parsePantryLockFile(X);if($)K.push($),this.logger.info(`\uD83D\uDCE6 Parsed pantry.lock: ${X} with ${$.dependencies.length} dependencies`)}let v=Date.now()-q;return this.logger.success(`Found ${K.length} package files in ${v}ms`),K}catch(O){throw this.logger.error("Failed to scan project:",O),new Y(`Failed to scan project: ${O instanceof Error?O.message:"Unknown error"}`)}}async parsePackageJsonFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8"),V=JSON.parse(O),Q=[];return this.extractDependencies(V.dependencies,"dependencies",q,Q),this.extractDependencies(V.devDependencies,"devDependencies",q,Q),this.extractDependencies(V.peerDependencies,"peerDependencies",q,Q),this.extractDependencies(V.optionalDependencies,"optionalDependencies",q,Q),Q.push(...N(V.engines,q)),{path:q,type:"package.json",content:O,dependencies:Q}}catch(K){return this.logger.warn(`Failed to parse package.json file ${q}:`,K),null}}async parseLockFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8"),V=q.split("/").pop()||"",Q;if(V==="bun.lockb")Q="bun.lockb";else if(V==="package-lock.json")Q="package-lock.json";else if(V==="yarn.lock")Q="yarn.lock";else if(V==="pnpm-lock.yaml")Q="pnpm-lock.yaml";else return null;let W=await this.extractLockFileDependencies(O,Q,q);return{path:q,type:Q,content:O,dependencies:W}}catch(K){return this.logger.warn(`Failed to parse lock file ${q}:`,K),null}}async parseDependencyFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await S(q,O)}catch(K){return this.logger.warn(`Failed to parse dependency file ${q}:`,K),null}}async findDependencyFiles(){let q=[],K=["deps.yaml","deps.yml","dependencies.yaml","dependencies.yml","pkgx.yaml","pkgx.yml",".deps.yaml",".deps.yml"];for(let Q of K){let W=await this.findFiles(Q);q.push(...W)}let O=await this.findFilesByPattern("*.yaml"),V=await this.findFilesByPattern("*.yml");for(let Q of[...O,...V])if(L(Q)&&!q.includes(Q))q.push(Q);return q}async findGitHubActionsFiles(){let q=[];try{let O=R(this.projectPath,".github","workflows");if((await Z(O).catch(()=>null))?.isDirectory()){let Q=await this.findFilesByPatternInDir("*.yaml",O),W=await this.findFilesByPatternInDir("*.yml",O);for(let B of[...Q,...W])if(x(B))q.push(B)}}catch{}return q}async findDockerfiles(){return this.findFilesMatching(z)}async findFilesMatching(q,K=this.projectPath){let O=[];try{let V=await A(K);for(let Q of V){let W=R(K,Q);try{let B=await Z(W);if(B.isFile()){if(q(Q))O.push(E(this.projectPath,W).split(H).join("/"))}else if(B.isDirectory()&&!J(Q))O.push(...await this.findFilesMatching(q,W))}catch{continue}}}catch{}return O}async parseGitHubActionsFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await w(q,O)}catch(K){return this.logger.warn(`Failed to parse GitHub Actions file ${q}:`,K),null}}async parseDockerfile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await M(q,O)}catch(K){return this.logger.warn(`Failed to parse Dockerfile ${q}:`,K),null}}async findZigManifests(){let q=[];try{let K=await this.findFiles("build.zig.zon");q.push(...K)}catch{}return q}async parseZigManifestFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await _(q,O)}catch(K){return this.logger.warn(`Failed to parse Zig manifest ${q}:`,K),null}}async findComposerFiles(){let q=[];try{let K=await this.findFiles("composer.json");q.push(...K);let O=await this.findFiles("composer.lock");q.push(...O)}catch{}return q}async parseComposerFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8"),{parseComposerFile:V}=await import("./chunk-hc651afv.js");return await V(q,O)}catch(K){return this.logger.warn(`Failed to parse Composer file ${q}:`,K),null}}async parsePantryLockFile(q){try{let K=R(this.projectPath,q),O=await U(K,"utf-8");return await I(q,O)}catch(K){return this.logger.warn(`Failed to parse pantry.lock file ${q}:`,K),null}}extractDependencies(q,K,O,V){if(!q)return;for(let[Q,W]of Object.entries(q))V.push({name:Q,currentVersion:W,type:K,file:this.getRelativePath(O)})}async extractLockFileDependencies(q,K,O){let V=[];if(K==="package-lock.json")try{let Q=JSON.parse(q);if(Q.packages){for(let[W,B]of Object.entries(Q.packages))if(W&&W!==""&&B&&typeof B==="object"){let C=B;if(C.version){let T=W.startsWith("node_modules/")?W.replace("node_modules/",""):W;V.push({name:T,currentVersion:C.version,type:C.dev?"devDependencies":"dependencies",file:this.getRelativePath(O)})}}}}catch(Q){this.logger.warn("Failed to parse package-lock.json:",Q)}return V}async findFiles(q,K=this.projectPath){let O=[];try{let V=await A(K);for(let Q of V){let W=R(K,Q);try{let B=await Z(W);if(B.isDirectory()){if(!J(Q)){let C=await this.findFiles(q,W);O.push(...C)}}else if(B.isFile()&&Q===q){let C=E(this.projectPath,W);O.push(C.split(H).join("/"))}}catch{continue}}}catch{}return O}async findLockFiles(){let q=["bun.lock","bun.lockb","package-lock.json","yarn.lock","pnpm-lock.yaml"],K=[];for(let O of q){let V=await this.findFiles(O);K.push(...V)}return K}async findFilesByPattern(q){let K=[],O=q.replace("*.","");try{let V=await A(this.projectPath);for(let Q of V){let W=R(this.projectPath,Q),B=await Z(W);if(B.isFile()&&Q.endsWith(`.${O}`)){let C=E(this.projectPath,W);K.push(C.split(H).join("/"))}else if(B.isDirectory()&&!J(Q)){let C=await this.findFilesByPatternInDir(q,W);K.push(...C)}}}catch{}return K}async findFilesByPatternInDir(q,K){let O=[],V=q.replace("*.","");try{let Q=await A(K);for(let W of Q){let B=R(K,W),C=await Z(B);if(C.isFile()&&W.endsWith(`.${V}`)){let T=E(this.projectPath,B);O.push(T.split(H).join("/"))}else if(C.isDirectory()&&!J(W)){let T=await this.findFilesByPatternInDir(q,B);O.push(...T)}}}catch{}return O}shouldIgnorePath(q){if(this.ignoreGlobs.length===0)return!1;let K=q;if(q.startsWith("/")||q.includes(":"))K=this.getRelativePath(q);for(let O of this.ignoreGlobs)if(O.match(K))return this.logger.debug(`Ignoring path: ${K} (matched pattern)`),!0;return!1}getRelativePath(q){return E(this.projectPath,q).split(H).join("/")}async getDependencyCount(){return(await this.scanProject()).reduce((K,O)=>K+O.dependencies.length,0)}async getUniqueDependencies(){return(await this.scanProject()).flatMap((V)=>V.dependencies).filter((V,Q,W)=>Q===W.findIndex((B)=>B.name===V.name))}}
3
+ export{m as ld};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{td as R}from"./chunk-mg3em5qj.js";import{qe as F,re as A}from"./chunk-34rmja4x.js";import{Af as S}from"./chunk-jpdd59fh.js";import{Qf as L}from"./chunk-7rjrea9g.js";import{Lh as K,Oh as O}from"./chunk-8dj94fsy.js";import{dl as P}from"./chunk-s3ksf6s5.js";var b=[{kind:"lockfile-drift",mechanical:!0,patterns:[/lockfile had changes, but lockfile is frozen/i,/your lockfile does not satisfy your workspace/i,/the lockfile (?:is|was) out of date/i,/npm ci can only install packages when your package\.json and package-lock\.json .* are in sync/i,/composer\.lock is not up to date/i]},{kind:"flake",mechanical:!0,patterns:[/\bECONNRESET\b|\bETIMEDOUT\b|\bENOTFOUND\b|\bEAI_AGAIN\b/,/socket hang up/i,/502 Bad Gateway|503 Service Unavailable|504 Gateway Time-?out/i,/rate limit exceeded/i,/the runner has received a shutdown signal/i]},{kind:"install",mechanical:!1,patterns:[/could not resolve (?:dependency|host)/i,/no matching version found for/i,/unable to resolve dependency tree/i,/peer dep(?:endency)? .* conflict/i]},{kind:"type-error",mechanical:!1,patterns:[/error TS\d{4}:/,/\berror\[E\d+\]:/,/Type '.*' is not assignable to type/]},{kind:"test-failure",mechanical:!1,patterns:[/\d+ (?:tests? )?fail(?:ed|ing)\b/i,/\(fail\)/,/AssertionError|expect\(received\)/,/\u25CF .* \u203A /]},{kind:"lint",mechanical:!1,patterns:[/\b\d+ problems? \(\d+ errors?/i,/eslint|pickier|biome|oxlint/i]}];function N(x){if(!x.trim())return{kind:"unknown",mechanical:!1,evidence:[]};let H=x.split(`
2
+ import{ud as R}from"./chunk-7b4jsg36.js";import{re as F,se as A}from"./chunk-b6a5txek.js";import{Bf as S}from"./chunk-1pecmenc.js";import{Rf as L}from"./chunk-sxfk3naz.js";import{Mh as K,Ph as O}from"./chunk-x1w6q9tk.js";import{el as P}from"./chunk-kbvj6qxc.js";var b=[{kind:"lockfile-drift",mechanical:!0,patterns:[/lockfile had changes, but lockfile is frozen/i,/your lockfile does not satisfy your workspace/i,/the lockfile (?:is|was) out of date/i,/npm ci can only install packages when your package\.json and package-lock\.json .* are in sync/i,/composer\.lock is not up to date/i]},{kind:"flake",mechanical:!0,patterns:[/\bECONNRESET\b|\bETIMEDOUT\b|\bENOTFOUND\b|\bEAI_AGAIN\b/,/socket hang up/i,/502 Bad Gateway|503 Service Unavailable|504 Gateway Time-?out/i,/rate limit exceeded/i,/the runner has received a shutdown signal/i]},{kind:"install",mechanical:!1,patterns:[/could not resolve (?:dependency|host)/i,/no matching version found for/i,/unable to resolve dependency tree/i,/peer dep(?:endency)? .* conflict/i]},{kind:"type-error",mechanical:!1,patterns:[/error TS\d{4}:/,/\berror\[E\d+\]:/,/Type '.*' is not assignable to type/]},{kind:"test-failure",mechanical:!1,patterns:[/\d+ (?:tests? )?fail(?:ed|ing)\b/i,/\(fail\)/,/AssertionError|expect\(received\)/,/\u25CF .* \u203A /]},{kind:"lint",mechanical:!1,patterns:[/\b\d+ problems? \(\d+ errors?/i,/eslint|pickier|biome|oxlint/i]}];function N(x){if(!x.trim())return{kind:"unknown",mechanical:!1,evidence:[]};let H=x.split(`
3
3
  `);for(let z of b){let J=[];for(let V of H)if(z.patterns.some((Q)=>Q.test(V))){if(J.push(V.trim()),J.length>=5)break}if(J.length>0)return{kind:z.kind,mechanical:z.mechanical,evidence:J}}return{kind:"unknown",mechanical:!1,evidence:T(H)}}function T(x,H=40){let z=x.filter((J)=>/\b(?:error|failed|failure|exception|panic|fatal)\b/i.test(J)&&!/^\s*(?:at\s|\s*\.\.\.)/.test(J));return(z.length>0?z:x.slice(-H)).slice(-H).map((J)=>J.trim()).filter(Boolean)}function G(x){switch(x.kind){case"lockfile-drift":return"The lock file is out of step with its manifest.";case"flake":return"A network or runner problem, unrelated to the change.";case"install":return"Dependencies could not be resolved.";case"type-error":return"The change does not type-check.";case"test-failure":return"One or more tests failed.";case"lint":return"Lint or formatting checks failed.";default:return"The failure could not be classified automatically."}}var w=3;async function M(x,H,z,J){let V=J??O();try{let Q=await x.listWorkflowRuns(H,{status:"completed",limit:20});for(let Y of _(Q).slice(0,w)){let Z=await x.getWorkflowRunLogs(Y.id);if(!Z)continue;if(N(Z).kind===z)return V.info(`\uD83E\uDDED ${H} already fails the same way (run ${Y.id}) \u2014 not this pull request's to fix`),!0}return!1}catch(Q){return V.debug(`Could not check ${H} for a pre-existing failure: ${K(Q)}`),!1}}function _(x){let H=new Map;for(let z of x)if(!H.has(z.name))H.set(z.name,z);return[...H.values()].filter((z)=>z.conclusion==="failure")}function h(x,H){if(!x)return"Tried to regenerate the lock file, but the install did not succeed.";if(!H)return"Regenerated the lock file, but could not push it to the branch. The change is in the workspace only, so the run will still be red until someone commits it.";return"Regenerated the lock file and pushed the result. No model was needed."}function f(x){let H="Repairs run on the pull request's branch, and answering a comment runs on the default branch, so anything I changed here would land on the wrong tree. ";if(x.kind==="lockfile-drift")return`Regenerating the lock file would fix this, and no model would be needed. ${H}The \`fix-ci\` job will do it on the next failing run, or you can run \`buddy fix-ci --run-id <id> --pr <number>\` yourself.`;return`${H}The \`fix-ci\` job runs on the failing run itself and can repair this; this reply is the diagnosis it would start from.`}async function I(x){let H=x.logger??O(),z=N(x.log),J=x.maxAttempts??3;if(H.info(`\uD83E\uDE7A CI failure classified as ${z.kind}`),x.failsOnBase??(x.checkBase?await x.checkBase(z.kind):!1))return{failure:z,action:"skipped",fixed:!1,report:$(z,"This failure also occurs on the base branch, so it is not caused by this change. Fixing it here would only mask it.")};if((x.priorAttempts??0)>=J)return{failure:z,action:"skipped",fixed:!1,report:$(z,`Already attempted ${x.priorAttempts} time(s); stopping rather than looping.`)};if(x.analysisOnly&&z.kind!=="flake")return{failure:z,action:"reported",fixed:!1,report:$(z,f(z))};if(z.kind==="lockfile-drift"&&x.regenerateLockfile){if(x.dryRun)return{failure:z,action:"mechanical-fix",fixed:!1,report:$(z,"Regenerating the lock file would fix this. No model would be needed. Nothing was changed, because this was a dry run.")};H.info("\uD83D\uDD27 Regenerating the lock file");let{regenerated:Y,pushed:Z}=await x.regenerateLockfile();return{failure:z,action:"mechanical-fix",fixed:Z,report:$(z,h(Y,Z))}}if(z.kind==="flake"){if(x.dryRun)return{failure:z,action:"retry",fixed:!1,report:$(z,"This looks transient, and re-running the failed jobs would likely clear it. Nothing was changed, because this was a dry run.")};if(!x.rerun)return{failure:z,action:"retry",fixed:!1,report:$(z,"This looks transient. Re-running the failed job is likely to clear it.")};H.info("\uD83D\uDD01 Re-running the failed jobs");let Y=await x.rerun();return{failure:z,action:"retry",fixed:!1,report:$(z,Y?"This looks transient, so I re-ran the failed jobs. No model was needed.":"This looks transient, but I could not re-run the failed jobs \u2014 `actions: write` is the usual reason. "+"Re-running them from the Actions tab is likely to clear it.")}}if(!x.ai)return{failure:z,action:"reported",fixed:!1,report:$(z,"No AI provider is configured, so this needs a human. See https://buddy.sh/ai/providers to enable automatic repair.")};let Q=await L(x.ai,{mode:S,task:["A CI job on this branch is failing. Diagnose the root cause and fix it if the fix is clear.","",`Classification: ${z.kind} \u2014 ${G(z)}`,"","Relevant log lines:",z.evidence.join(`
4
4
  `),"","Verify your fix by running the project's tests or build before reporting it done.","If the fix is not clear, explain what you found rather than guessing."].join(`
5
5
  `),context:{workspace:x.workspace,baseBranch:x.baseBranch,...x.branch?{branch:x.branch}:{}},logger:H});return{failure:z,action:"agent-fix",fixed:Q.stopReason==="completed",report:$(z,Q.output||"The repair run ended without a conclusion.")}}function $(x,H){let z=`## \uD83E\uDE7A CI failure analysis
@@ -20,8 +20,8 @@ ${x.evidence.slice(0,20).join(`
20
20
  ${JSON.stringify(J)}
21
21
  -->`;return`${(x??"").replace(B,"").trimEnd()}
22
22
 
23
- ${V}`}async function m(x,H,z){if(!F(x,"ciRuns","listWorkflowRuns"))return null;try{let J=await x.getPullRequestHeadSha(H.number),V=await x.listWorkflowRuns(H.head,{status:"completed",limit:30}),Q=J?V.filter((Y)=>Y.headSha===J):V;return _(Q)[0]?.id??null}catch(J){return z.debug(`Could not resolve the failing run for #${H.number}: ${K(J)}`),null}}async function c(x){let H=x.logger??O(),{config:z,provider:J}=x,V=x.workspace??process.cwd();A(J,"ciLogs","getWorkflowRunLogs","reading CI logs");let Q;if(x.prNumber){if(Q=(await J.getPullRequests("open")).find((W)=>W.number===x.prNumber),!Q)return`Could not find open pull request #${x.prNumber}.`}let Y=x.runId??(Q?await m(J,Q,H):null);if(!Y)return Q?"Nothing is failing at the head of this pull request, so there is nothing to diagnose.":"No run to diagnose. Pass --run-id, or --pr so I can find the failing run myself.";let Z=await J.getWorkflowRunLogs(Y);if(!Z)return H.warn(`\u26A0\uFE0F Could not read the logs for run ${Y}; nothing to diagnose`),`Could not read the logs for run ${Y}. They may have expired.`;let U=E(Q?.body)?.attempts??0,j=z.repository?.baseBranch??"main",D=F(J,"ciRuns","listWorkflowRuns"),y=F(J,"ciRuns","rerunWorkflowRun"),{createAiClient:v}=await import("./chunk-2145m12g.js"),C=await I({log:Z,priorAttempts:U,workspace:V,baseBranch:j,ai:x.analysisOnly?null:v(z,H),logger:H,dryRun:Boolean(x.dryRun),analysisOnly:Boolean(x.analysisOnly),...D?{checkBase:(X)=>M({listWorkflowRuns:(W,k)=>J.listWorkflowRuns(W,k),getWorkflowRunLogs:(W)=>J.getWorkflowRunLogs(W)},j,X,H)}:{},...y?{rerun:()=>J.rerunWorkflowRun(Y)}:{},...x.analysisOnly?{}:{regenerateLockfile:()=>g(V,H)}});if(H.info(`
23
+ ${V}`}async function m(x,H,z){if(!F(x,"ciRuns","listWorkflowRuns"))return null;try{let J=await x.getPullRequestHeadSha(H.number),V=await x.listWorkflowRuns(H.head,{status:"completed",limit:30}),Q=J?V.filter((Y)=>Y.headSha===J):V;return _(Q)[0]?.id??null}catch(J){return z.debug(`Could not resolve the failing run for #${H.number}: ${K(J)}`),null}}async function c(x){let H=x.logger??O(),{config:z,provider:J}=x,V=x.workspace??process.cwd();A(J,"ciLogs","getWorkflowRunLogs","reading CI logs");let Q;if(x.prNumber){if(Q=(await J.getPullRequests("open")).find((W)=>W.number===x.prNumber),!Q)return`Could not find open pull request #${x.prNumber}.`}let Y=x.runId??(Q?await m(J,Q,H):null);if(!Y)return Q?"Nothing is failing at the head of this pull request, so there is nothing to diagnose.":"No run to diagnose. Pass --run-id, or --pr so I can find the failing run myself.";let Z=await J.getWorkflowRunLogs(Y);if(!Z)return H.warn(`\u26A0\uFE0F Could not read the logs for run ${Y}; nothing to diagnose`),`Could not read the logs for run ${Y}. They may have expired.`;let U=E(Q?.body)?.attempts??0,j=z.repository?.baseBranch??"main",D=F(J,"ciRuns","listWorkflowRuns"),y=F(J,"ciRuns","rerunWorkflowRun"),{createAiClient:v}=await import("./chunk-vtr2vbk0.js"),C=await I({log:Z,priorAttempts:U,workspace:V,baseBranch:j,ai:x.analysisOnly?null:v(z,H),logger:H,dryRun:Boolean(x.dryRun),analysisOnly:Boolean(x.analysisOnly),...D?{checkBase:(X)=>M({listWorkflowRuns:(W,k)=>J.listWorkflowRuns(W,k),getWorkflowRunLogs:(W)=>J.getWorkflowRunLogs(W)},j,X,H)}:{},...y?{rerun:()=>J.rerunWorkflowRun(Y)}:{},...x.analysisOnly?{}:{regenerateLockfile:()=>g(V,H)}});if(H.info(`
24
24
  ${C.report}
25
- `),x.prNumber&&!x.dryRun){if(await J.createComment(x.prNumber,C.report),C.action!=="skipped"&&Q)try{await J.updatePullRequest(x.prNumber,{body:q(Q.body,U+1)})}catch(X){H.warn(`Could not record the fix attempt on PR #${x.prNumber}: ${K(X)}`)}}return await R(z.notifications,"fixci.completed",{...x.prNumber?{number:x.prNumber}:{},action:C.action,fixed:C.fixed}),`${C.action}${C.fixed?" (fixed)":""}`}async function g(x,H){let{regenerateLockFile:z,detectRequiredPackageManagers:J,getAllLockFilePaths:V,hasLockFile:Q}=await import("./chunk-zefqbamj.js"),{commitAndPush:Y}=await import("./chunk-jj1gjkb7.js"),Z=J(["package.json","composer.json"],x).filter((j)=>Q(j,x)),U=!1;for(let j of Z){let D=await z(j,x);if(D.success)U=!0;else H.warn(`\u26A0\uFE0F ${D.message}`)}if(!U)return{regenerated:!1,pushed:!1};try{return{regenerated:!0,pushed:await Y(V(),`fix(deps): regenerate the lock file
25
+ `),x.prNumber&&!x.dryRun){if(await J.createComment(x.prNumber,C.report),C.action!=="skipped"&&Q)try{await J.updatePullRequest(x.prNumber,{body:q(Q.body,U+1)})}catch(X){H.warn(`Could not record the fix attempt on PR #${x.prNumber}: ${K(X)}`)}}return await R(z.notifications,"fixci.completed",{...x.prNumber?{number:x.prNumber}:{},action:C.action,fixed:C.fixed}),`${C.action}${C.fixed?" (fixed)":""}`}async function g(x,H){let{regenerateLockFile:z,detectRequiredPackageManagers:J,getAllLockFilePaths:V,hasLockFile:Q}=await import("./chunk-hmymd6m2.js"),{commitAndPush:Y}=await import("./chunk-ry5zh9cx.js"),Z=J(["package.json","composer.json"],x).filter((j)=>Q(j,x)),U=!1;for(let j of Z){let D=await z(j,x);if(D.success)U=!0;else H.warn(`\u26A0\uFE0F ${D.message}`)}if(!U)return{regenerated:!1,pushed:!1};try{return{regenerated:!0,pushed:await Y(V(),`fix(deps): regenerate the lock file
26
26
 
27
27
  The lock file had drifted from the manifest, which failed CI.`,x)}}catch(j){return H.warn(`\u26A0\uFE0F Could not push the regenerated lock file: ${K(j)}`),{regenerated:!0,pushed:!1}}}export{N as Ea,T as Fa,G as Ga,M as Ha,_ as Ia,I as Ja,c as Ka};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{mb as w}from"./chunk-fpzgxg8a.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-s3q7g2hy.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-y7z0br2x.js";import"./chunk-ggzjv4s0.js";import{Dd as z,Ed as A,Fd as B,Gd as C,Hd as D,Id as E,Jd as F,Kd as G,Ld as H,Md as I}from"./chunk-bggpgbdx.js";import"./chunk-be059ncv.js";import"./chunk-xny4kgcc.js";import"./chunk-34rmja4x.js";import"./chunk-emygmh7r.js";import"./chunk-kpqez1ht.js";import"./chunk-a3bnhq58.js";import"./chunk-8dj94fsy.js";import"./chunk-s3ksf6s5.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-be7g40yf.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-mpb1g0xk.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-59993g25.js";import"./chunk-va3k91tf.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-0g4ybxwj.js";import"./chunk-142zh7e5.js";import"./chunk-b6a5txek.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.js";export{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,2 +1,2 @@
1
1
  // @bun
2
- import{Oh as X}from"./chunk-8dj94fsy.js";import"./chunk-s3ksf6s5.js";import{readFileSync as _}from"fs";function L(q){let z=q.split("/").pop()||"";return z==="composer.json"||z==="composer.lock"}async function R(q,z){try{let j=JSON.parse(z),A=[];if(j.require)J(j.require,"require",q,A);if(j["require-dev"])J(j["require-dev"],"require-dev",q,A);return{path:q,type:"composer.json",content:z,dependencies:A}}catch(j){return X().warn(`Failed to parse composer.json file ${q}:`,j),null}}async function S(q,z){try{let j=JSON.parse(z),A=[];if(j.packages){for(let b of j.packages)if(b.name&&b.version)A.push({name:b.name,currentVersion:b.version,type:"require",file:q})}if(j["packages-dev"]){for(let b of j["packages-dev"])if(b.name&&b.version)A.push({name:b.name,currentVersion:b.version,type:"require-dev",file:q})}return{path:q,type:"composer.lock",content:z,dependencies:A}}catch(j){return X().warn(`Failed to parse composer.lock file ${q}:`,j),null}}async function v(q,z){let j=q.split("/").pop()||"";if(j==="composer.json")return R(q,z);if(j==="composer.lock")return S(q,z);return null}function J(q,z,j,A){for(let[b,Z]of Object.entries(q)){if(b==="php"||b.startsWith("ext-"))continue;if(b.includes("/"))A.push({name:b,currentVersion:Z,type:z,file:j})}}async function U(q){let z=[],j=q.filter((b)=>b.file.endsWith("composer.json"));if(j.length===0)return z;let A=new Map;for(let b of j){if(!A.has(b.file))A.set(b.file,[]);A.get(b.file).push({name:b.name,newVersion:b.newVersion})}for(let[b,Z]of A)try{let K=_(b,"utf-8"),T=JSON.parse(K);for(let E of Z){let Y=!1;if(T.require&&T.require[E.name]){let H=T.require[E.name],O;if(H.includes(",")){let G=H.match(/\d+\.\d+(?:\.\d+)?/),Q=G?G[0]:null;O=H.replace(/\d+\.\d+(?:\.\d+)?/g,(W)=>{return Q!==null&&W===Q?E.newVersion:W})}else{let G=H.match(/^(\D*)/);O=`${G?G[1]:""}${E.newVersion}`}let $=new RegExp(`("${E.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"\\s*:\\s*")([^"]+)(")`,"g");K=K.replace($,`$1${O}$3`),Y=!0}if(!Y&&T["require-dev"]&&T["require-dev"][E.name]){let H=T["require-dev"][E.name],O;if(H.includes(",")){let G=H.match(/\d+\.\d+(?:\.\d+)?/),Q=G?G[0]:null;O=H.replace(/\d+\.\d+(?:\.\d+)?/g,(W)=>{return Q!==null&&W===Q?E.newVersion:W})}else{let G=H.match(/^(\D*)/);O=`${G?G[1]:""}${E.newVersion}`}let $=new RegExp(`("${E.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"\\s*:\\s*")([^"]+)(")`,"g");K=K.replace($,`$1${O}$3`),Y=!0}if(!Y)X().warn(`Package ${E.name} not found in ${b}`)}z.push({path:b,content:K,type:"update"})}catch(K){X().error(`Failed to update ${b}:`,K)}return z}export{S as parseComposerLock,R as parseComposerJson,v as parseComposerFile,L as isComposerFile,U as generateComposerUpdates};
2
+ import{Ph as X}from"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.js";import{readFileSync as _}from"fs";function L(q){let z=q.split("/").pop()||"";return z==="composer.json"||z==="composer.lock"}async function R(q,z){try{let j=JSON.parse(z),A=[];if(j.require)J(j.require,"require",q,A);if(j["require-dev"])J(j["require-dev"],"require-dev",q,A);return{path:q,type:"composer.json",content:z,dependencies:A}}catch(j){return X().warn(`Failed to parse composer.json file ${q}:`,j),null}}async function S(q,z){try{let j=JSON.parse(z),A=[];if(j.packages){for(let b of j.packages)if(b.name&&b.version)A.push({name:b.name,currentVersion:b.version,type:"require",file:q})}if(j["packages-dev"]){for(let b of j["packages-dev"])if(b.name&&b.version)A.push({name:b.name,currentVersion:b.version,type:"require-dev",file:q})}return{path:q,type:"composer.lock",content:z,dependencies:A}}catch(j){return X().warn(`Failed to parse composer.lock file ${q}:`,j),null}}async function v(q,z){let j=q.split("/").pop()||"";if(j==="composer.json")return R(q,z);if(j==="composer.lock")return S(q,z);return null}function J(q,z,j,A){for(let[b,Z]of Object.entries(q)){if(b==="php"||b.startsWith("ext-"))continue;if(b.includes("/"))A.push({name:b,currentVersion:Z,type:z,file:j})}}async function U(q){let z=[],j=q.filter((b)=>b.file.endsWith("composer.json"));if(j.length===0)return z;let A=new Map;for(let b of j){if(!A.has(b.file))A.set(b.file,[]);A.get(b.file).push({name:b.name,newVersion:b.newVersion})}for(let[b,Z]of A)try{let K=_(b,"utf-8"),T=JSON.parse(K);for(let E of Z){let Y=!1;if(T.require&&T.require[E.name]){let H=T.require[E.name],O;if(H.includes(",")){let G=H.match(/\d+\.\d+(?:\.\d+)?/),Q=G?G[0]:null;O=H.replace(/\d+\.\d+(?:\.\d+)?/g,(W)=>{return Q!==null&&W===Q?E.newVersion:W})}else{let G=H.match(/^(\D*)/);O=`${G?G[1]:""}${E.newVersion}`}let $=new RegExp(`("${E.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"\\s*:\\s*")([^"]+)(")`,"g");K=K.replace($,`$1${O}$3`),Y=!0}if(!Y&&T["require-dev"]&&T["require-dev"][E.name]){let H=T["require-dev"][E.name],O;if(H.includes(",")){let G=H.match(/\d+\.\d+(?:\.\d+)?/),Q=G?G[0]:null;O=H.replace(/\d+\.\d+(?:\.\d+)?/g,(W)=>{return Q!==null&&W===Q?E.newVersion:W})}else{let G=H.match(/^(\D*)/);O=`${G?G[1]:""}${E.newVersion}`}let $=new RegExp(`("${E.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"\\s*:\\s*")([^"]+)(")`,"g");K=K.replace($,`$1${O}$3`),Y=!0}if(!Y)X().warn(`Package ${E.name} not found in ${b}`)}z.push({path:b,content:K,type:"update"})}catch(K){X().error(`Failed to update ${b}:`,K)}return z}export{S as parseComposerLock,R as parseComposerJson,v as parseComposerFile,L as isComposerFile,U as generateComposerUpdates};
@@ -0,0 +1,2 @@
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-csqh2ca4.js";import"./chunk-xdrvb89m.js";import"./chunk-knpdntnh.js";import"./chunk-54er1whp.js";import"./chunk-ktn47bq8.js";import"./chunk-2z9pkk1y.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-z05djfac.js";import"./chunk-kbvj6qxc.js";export{b as regenerateLockFile,d as nestedLockProjects,f as missingLockFiles,e as lockFileFor,g as hasLockFile,a as getAllLockFilePaths,c as detectRequiredPackageManagers};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var Y={node:{registry:"github",source:"nodejs/node"},bun:{registry:"npm",source:"bun"},npm:{registry:"npm",source:"npm"},pnpm:{registry:"npm",source:"pnpm"},yarn:{registry:"npm",source:"yarn"},deno:{registry:"github",source:"denoland/deno"}};function Z(A,F){if(typeof A!=="object"||A===null||Array.isArray(A))return[];let z=[];for(let[B,J]of Object.entries(A)){if(typeof J!=="string"||!J.trim())continue;if(!Y[B])continue;z.push({name:B,currentVersion:J.trim(),type:"engines",file:F,metadata:{engine:"true",source:Y[B].source}})}return z}function $(A){if(typeof A!=="object"||A===null)return[];let F=A,z=[],B=(J,L)=>{if(typeof J!=="object"||J===null||Array.isArray(J))return;for(let[U,H]of Object.entries(J)){if(typeof H==="string"&&H.trim()){z.push({name:U,version:H.trim(),field:L});continue}if(typeof H==="object"&&H!==null){let M=H;if(typeof M["."]==="string")z.push({name:U,version:M["."].trim(),field:L});B(H,L)}}};return B(F.overrides,"overrides"),B(F.resolutions,"resolutions"),B(F.pnpm?.overrides,"pnpm.overrides"),z}function q(A,F){let z=A.version.trim();try{if(/^[\^~><=]/.test(z))return!Bun.semver.satisfies(F,z)}catch{return!0}return z!==F}async function C(A,F){let z=Y[A];if(!z)return null;let B=z.registry==="npm"?await F.npm(z.source):await F.github(z.source);return B?B.replace(/^v/,""):null}function R(A,F){let z=/^\s*(>=|\^|~|>|=)?\s*v?(\d+(?:\.\d+)*)\s*$/.exec(A);if(!z)return null;let[,B="",J]=z,L=J.split(".").map(Number),H=F.split(".").map(Number).slice(0,L.length),M=!1;for(let Q=0;Q<H.length;Q++){let X=H[Q]-(L[Q]??0);if(X!==0){M=X>0;break}}if(!M)return null;return`${B}${H.join(".")}`}function T(A,F){let z=(L)=>(/(\d+(?:\.\d+)*)/.exec(L)?.[1]??"0").split(".").map(Number),B=z(A),J=z(F);if((J[0]??0)!==(B[0]??0))return"major";if((J[1]??0)!==(B[1]??0))return"minor";return"patch"}function P(A,F){let z=/("engines"\s*:\s*\{)([\s\S]*?)(\})/.exec(A);if(!z)return A;let[B,J,L,U]=z,H=L;for(let M of F){if(M.dependencyType!=="engines")continue;let Q=M.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=M.currentVersion.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");H=H.replace(new RegExp(`("${Q}"\\s*:\\s*")${X}(")`),`$1${M.newVersion}$2`)}return H===L?A:A.replace(B,`${J}${H}${U}`)}
3
- export{Y as We,Z as Xe,$ as Ye,q as Ze,C as _e,R as $e,T as af,P as bf};
3
+ export{Y as Xe,Z as Ye,$ as Ze,q as _e,C as $e,R as af,T as bf,P as cf};
@@ -0,0 +1,2 @@
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-w55x2g9n.js";import"./chunk-2z9pkk1y.js";import"./chunk-b9szrnxw.js";import"./chunk-x1w6q9tk.js";import"./chunk-kbvj6qxc.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,5 +1,5 @@
1
1
  // @bun
2
- import{yf as Q,zf as J}from"./chunk-jpdd59fh.js";var L=`Verify your work before reporting it done: run the project's
2
+ import{Af as J,zf as Q}from"./chunk-1pecmenc.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?`