@buddysh/buddy 0.11.19 → 0.11.20

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 (179) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bin/cli.ts +4 -1
  3. package/dist/bin/cli.js +48 -48
  4. package/dist/bin/entry.js +1 -1
  5. package/dist/bin/stacks.js +1 -1
  6. package/dist/{chunk-5nn5mms4.js → chunk-016ce171.js} +1 -1
  7. package/dist/{chunk-h9deve0y.js → chunk-038mdwdf.js} +3 -3
  8. package/dist/{chunk-qn1g860m.js → chunk-0668q6tf.js} +1 -1
  9. package/dist/{chunk-89spjk6r.js → chunk-09wkxvnt.js} +2 -2
  10. package/dist/{chunk-q3dg57xx.js → chunk-0cqhy9qh.js} +1 -1
  11. package/dist/{chunk-dmaxdw65.js → chunk-0n78c2xd.js} +1 -1
  12. package/dist/{chunk-ar8skamr.js → chunk-1ajy5sev.js} +1 -1
  13. package/dist/{chunk-3pg9420w.js → chunk-1aw736x8.js} +1 -1
  14. package/dist/{chunk-88jx1n4t.js → chunk-2mtwdyka.js} +1 -1
  15. package/dist/{chunk-tztc0r76.js → chunk-2qwk5xfp.js} +2 -2
  16. package/dist/chunk-3nvrjrtp.js +2 -0
  17. package/dist/{chunk-2v4b940m.js → chunk-3sbrd9az.js} +1 -1
  18. package/dist/{chunk-z0avay86.js → chunk-5qj3vteh.js} +2 -2
  19. package/dist/chunk-5xgq771b.js +2 -0
  20. package/dist/chunk-64nen17y.js +2 -0
  21. package/dist/{chunk-c7ja1xmh.js → chunk-64zgq7hq.js} +2 -2
  22. package/dist/{chunk-snya72ah.js → chunk-6evq4y1q.js} +2 -2
  23. package/dist/{chunk-ry21xmre.js → chunk-6jak98cy.js} +1 -1
  24. package/dist/{chunk-ednwgr1b.js → chunk-6njk0m4a.js} +2 -2
  25. package/dist/{chunk-yy8vb4yk.js → chunk-6zp71ecf.js} +1 -1
  26. package/dist/chunk-71mhymva.js +2 -0
  27. package/dist/{chunk-yx9v94q5.js → chunk-7523xqb9.js} +2 -2
  28. package/dist/{chunk-fcax5a60.js → chunk-75rj89c2.js} +2 -2
  29. package/dist/chunk-7dgdvzxn.js +2 -0
  30. package/dist/{chunk-rwzt9xvk.js → chunk-7h8qjayv.js} +1 -1
  31. package/dist/{chunk-2g8r8khw.js → chunk-7khgke9n.js} +1 -1
  32. package/dist/{chunk-xqcmw7d0.js → chunk-7vk0vrwm.js} +2 -2
  33. package/dist/{chunk-rrm4x81p.js → chunk-91gpxfta.js} +1 -1
  34. package/dist/chunk-9dtfray9.js +2 -0
  35. package/dist/{chunk-6bdrm4ab.js → chunk-9g0am1m2.js} +2 -2
  36. package/dist/chunk-9k79e8wa.js +2 -0
  37. package/dist/{chunk-5feeegzy.js → chunk-9rvapdmv.js} +2 -2
  38. package/dist/chunk-a1ta528t.js +2 -0
  39. package/dist/{chunk-ewnhhpak.js → chunk-a7r9dwmt.js} +1 -1
  40. package/dist/chunk-aa8gbnyc.js +2 -0
  41. package/dist/chunk-aw70467z.js +2 -0
  42. package/dist/{chunk-dev3g0n3.js → chunk-b1ng5aqx.js} +2 -2
  43. package/dist/chunk-b7f35wap.js +2 -0
  44. package/dist/{chunk-91q9x0df.js → chunk-brk9jn8q.js} +1 -1
  45. package/dist/chunk-cb6g7nt3.js +2 -0
  46. package/dist/{chunk-tqwek43e.js → chunk-cbzc9ggs.js} +1 -1
  47. package/dist/{chunk-dgcct70c.js → chunk-cf5czw9m.js} +2 -2
  48. package/dist/{chunk-ebb90mp9.js → chunk-cftyw099.js} +1 -1
  49. package/dist/chunk-cndn37he.js +2 -0
  50. package/dist/chunk-cpc1y0gs.js +2 -0
  51. package/dist/{chunk-qbqk1jax.js → chunk-cqh3eadc.js} +2 -2
  52. package/dist/chunk-csf42r3d.js +2 -0
  53. package/dist/{chunk-xyry3bma.js → chunk-dmqptf7k.js} +2 -2
  54. package/dist/chunk-dvnshk0g.js +2 -0
  55. package/dist/{chunk-xmk24pz9.js → chunk-dz2e81v7.js} +2 -2
  56. package/dist/{chunk-0pf9vk80.js → chunk-ep7hn1za.js} +1 -1
  57. package/dist/chunk-ezjvwa4v.js +2 -0
  58. package/dist/{chunk-y6292gbf.js → chunk-fanj4t6c.js} +2 -2
  59. package/dist/chunk-fr2rhvnt.js +2 -0
  60. package/dist/chunk-fr7tw9n2.js +2 -0
  61. package/dist/{chunk-cp3g2srn.js → chunk-g0ttytab.js} +2 -2
  62. package/dist/chunk-gcmx3cp6.js +2 -0
  63. package/dist/{chunk-73a090ce.js → chunk-gn3tjadq.js} +2 -2
  64. package/dist/chunk-gqqqhe3n.js +2 -0
  65. package/dist/{chunk-r0jmwzr3.js → chunk-gt3m1eqn.js} +1 -1
  66. package/dist/{chunk-6kmaj5br.js → chunk-h0bf6z4x.js} +2 -2
  67. package/dist/{chunk-8hstj0s3.js → chunk-jrkmj5ex.js} +1 -1
  68. package/dist/chunk-jzhsa1xh.js +2 -0
  69. package/dist/chunk-kebfqksf.js +2 -0
  70. package/dist/{chunk-sg7bhtb7.js → chunk-kfn6xbc6.js} +1 -1
  71. package/dist/{chunk-065sjjzg.js → chunk-m7v1dba6.js} +2 -2
  72. package/dist/{chunk-20sxtyt7.js → chunk-me7y4rd3.js} +1 -1
  73. package/dist/{chunk-jxmpwday.js → chunk-mpk7ypxd.js} +1 -1
  74. package/dist/{chunk-33ymc651.js → chunk-n1g9gs8x.js} +3 -3
  75. package/dist/{chunk-t7grk0az.js → chunk-n5mvfhd0.js} +2 -2
  76. package/dist/{chunk-m6qym0ya.js → chunk-n7hbbha7.js} +2 -2
  77. package/dist/{chunk-5ytyahtm.js → chunk-n8zfts91.js} +4 -4
  78. package/dist/{chunk-g763t4rr.js → chunk-nap5dm82.js} +2 -2
  79. package/dist/chunk-nekgd2v5.js +2 -0
  80. package/dist/{chunk-q2tjkhez.js → chunk-np5qajht.js} +1 -1
  81. package/dist/{chunk-dkgz8hsd.js → chunk-nqgn0drz.js} +7 -7
  82. package/dist/{chunk-vpz26asn.js → chunk-nrm7vjmv.js} +2 -2
  83. package/dist/chunk-nwj826gp.js +2 -0
  84. package/dist/chunk-p0s7w67s.js +2 -0
  85. package/dist/{chunk-nmrf0ydg.js → chunk-p59g8wwa.js} +1 -1
  86. package/dist/{chunk-qfm0eh6y.js → chunk-pakq6dsv.js} +2 -2
  87. package/dist/{chunk-eq5xb8k1.js → chunk-q31cbz9d.js} +2 -2
  88. package/dist/{chunk-vn4c8fxq.js → chunk-q496yz80.js} +1 -1
  89. package/dist/chunk-q7250hvx.js +4 -0
  90. package/dist/chunk-q8wzcyxj.js +2 -0
  91. package/dist/{chunk-jy1kbr1k.js → chunk-qeg388qq.js} +2 -2
  92. package/dist/{chunk-8y4szfd2.js → chunk-rad9rc2j.js} +1 -1
  93. package/dist/chunk-rbhz8bda.js +2 -0
  94. package/dist/{chunk-wm6g7y1r.js → chunk-rk5j5mcr.js} +1 -1
  95. package/dist/chunk-rma8b124.js +2 -0
  96. package/dist/{chunk-hwpv7jhw.js → chunk-s3g9x8wf.js} +2 -2
  97. package/dist/{chunk-f3fmewqb.js → chunk-s44q0cps.js} +2 -2
  98. package/dist/{chunk-z906zp4k.js → chunk-s8apaa3h.js} +5 -5
  99. package/dist/chunk-sa2m2y9s.js +2 -0
  100. package/dist/{chunk-5qxs04gf.js → chunk-skg1syjj.js} +1 -1
  101. package/dist/chunk-swmkkya0.js +2 -0
  102. package/dist/chunk-t64134ws.js +2 -0
  103. package/dist/{chunk-x9spxa46.js → chunk-t68hsq01.js} +2 -2
  104. package/dist/{chunk-539wp217.js → chunk-t81252jj.js} +2 -2
  105. package/dist/{chunk-58et72hc.js → chunk-tf0mb8m0.js} +2 -2
  106. package/dist/{chunk-6477cdgj.js → chunk-txpb6btd.js} +1 -1
  107. package/dist/chunk-tzz4mpz5.js +2 -0
  108. package/dist/{chunk-ffjp134d.js → chunk-v32q2vv7.js} +1 -1
  109. package/dist/chunk-v8dteyvv.js +2 -0
  110. package/dist/{chunk-j9pe2np4.js → chunk-vcn1gemr.js} +1 -1
  111. package/dist/chunk-ve9xvyez.js +2 -0
  112. package/dist/chunk-vtjh07ea.js +2 -0
  113. package/dist/chunk-wc68652g.js +2 -0
  114. package/dist/{chunk-5q5tm30a.js → chunk-we0x722x.js} +1 -1
  115. package/dist/{chunk-ng9zksy3.js → chunk-weqbnsnn.js} +1 -1
  116. package/dist/{chunk-agdvymzh.js → chunk-wr7scn9c.js} +1 -1
  117. package/dist/{chunk-wca85ahg.js → chunk-x33ryte5.js} +2 -2
  118. package/dist/{chunk-vxt1h0c4.js → chunk-x496v9vb.js} +1 -1
  119. package/dist/chunk-x7y2eh7c.js +2 -0
  120. package/dist/chunk-xd6sxr1m.js +3 -0
  121. package/dist/{chunk-ejfyc7r8.js → chunk-xdqk8fzw.js} +1 -1
  122. package/dist/chunk-xkhznax2.js +2 -0
  123. package/dist/{chunk-dh8yykbg.js → chunk-xmqv24zr.js} +1 -1
  124. package/dist/{chunk-47k0qdd5.js → chunk-xt0k22yx.js} +2 -2
  125. package/dist/{chunk-xn2xv07k.js → chunk-xx7cytzs.js} +2 -2
  126. package/dist/chunk-y59p36an.js +2 -0
  127. package/dist/{chunk-7bqy4enq.js → chunk-y5t07fny.js} +1 -1
  128. package/dist/{chunk-a5hevn6e.js → chunk-yknz94wd.js} +2 -2
  129. package/dist/{chunk-pxv58dh1.js → chunk-yzyqkwsc.js} +1 -1
  130. package/dist/{chunk-s6w47z4a.js → chunk-zbk3g5vf.js} +3 -3
  131. package/dist/{chunk-wx4qd9e9.js → chunk-ze91acnq.js} +1 -1
  132. package/dist/chunk-zhgwbbj9.js +2 -0
  133. package/dist/{chunk-xntpzagn.js → chunk-zqrgvftj.js} +1 -1
  134. package/dist/chunk-zza4y6dx.js +2 -0
  135. package/dist/src/index.js +1 -1
  136. package/dist/src/setup.js +1 -1
  137. package/package.json +1 -1
  138. package/dist/chunk-05nyhkdp.js +0 -2
  139. package/dist/chunk-0796xk82.js +0 -2
  140. package/dist/chunk-11599831.js +0 -2
  141. package/dist/chunk-1et7ppg7.js +0 -2
  142. package/dist/chunk-23cjwxjk.js +0 -2
  143. package/dist/chunk-4gf3a9pm.js +0 -2
  144. package/dist/chunk-4we8d2ys.js +0 -2
  145. package/dist/chunk-6m03hqbw.js +0 -3
  146. package/dist/chunk-78pxywjv.js +0 -2
  147. package/dist/chunk-843907bh.js +0 -2
  148. package/dist/chunk-8fm0z13m.js +0 -2
  149. package/dist/chunk-9pt7kwmm.js +0 -2
  150. package/dist/chunk-b8n7zh62.js +0 -2
  151. package/dist/chunk-by2hfewp.js +0 -2
  152. package/dist/chunk-cfj98vmf.js +0 -2
  153. package/dist/chunk-cxbrnbcp.js +0 -2
  154. package/dist/chunk-e0d1n3yn.js +0 -2
  155. package/dist/chunk-ece98jde.js +0 -2
  156. package/dist/chunk-en525sf9.js +0 -2
  157. package/dist/chunk-f694pp35.js +0 -2
  158. package/dist/chunk-h65g7hd0.js +0 -2
  159. package/dist/chunk-hfq56cgn.js +0 -2
  160. package/dist/chunk-jq846den.js +0 -2
  161. package/dist/chunk-nezqdnp3.js +0 -2
  162. package/dist/chunk-q9x936wq.js +0 -2
  163. package/dist/chunk-rmv4ajb2.js +0 -2
  164. package/dist/chunk-rsvtnsmt.js +0 -2
  165. package/dist/chunk-sek2e857.js +0 -2
  166. package/dist/chunk-tes3e84x.js +0 -2
  167. package/dist/chunk-tgm4vbaq.js +0 -2
  168. package/dist/chunk-v0895nt9.js +0 -2
  169. package/dist/chunk-v6rrvfh4.js +0 -2
  170. package/dist/chunk-vyckmje5.js +0 -2
  171. package/dist/chunk-we1n57ze.js +0 -2
  172. package/dist/chunk-wnqqprmy.js +0 -2
  173. package/dist/chunk-wt8b3ywq.js +0 -2
  174. package/dist/chunk-x0mq8nn2.js +0 -2
  175. package/dist/chunk-xfk9a8az.js +0 -2
  176. package/dist/chunk-xvq8w2jm.js +0 -2
  177. package/dist/chunk-ye3aym4p.js +0 -2
  178. package/dist/chunk-yxt8294f.js +0 -2
  179. package/dist/chunk-zy6azdxt.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Bd as N}from"./chunk-pxv58dh1.js";import{Gd as M}from"./chunk-m6qym0ya.js";import{fe as T}from"./chunk-dgcct70c.js";import{ke as L,le as _}from"./chunk-5feeegzy.js";var D=["major","minor","patch","all"],m=["merge","squash","rebase"],P=["patch-only","minor-only","security-only","all"],R=["anthropic","openai","google","openrouter","openai-compatible"],A=["low","medium","high"],S=["chill","assertive"],d=["never","critical"],q=["low","moderate","high","critical"],E=["silent","error","warn","info","debug"],w=["npm","composer","github-actions","docker","pkgx","zig","python","rust","go","ruby"],b=["major","minor","patch"],U=T.map((J)=>J.name);function K(J){return JSON.stringify(J)}function Z(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}function Y(J,B,X,$){if(X===void 0)return;if(typeof X!=="string"||!$.includes(X))J.push({path:B,message:`expected one of ${$.map(K).join(", ")}, got ${K(X)}`})}function C(J,B,X,$={}){let Q=$.min??0,W=$.integer??!1;if(X===void 0)return;if(typeof X!=="number"||!Number.isFinite(X)||X<Q){J.push({path:B,message:`expected a number >= ${Q}, got ${K(X)}`});return}if(W&&!Number.isInteger(X))J.push({path:B,message:`expected a whole number, got ${K(X)}`})}function j(J,B,X,$){if(X===void 0)return;if(!Array.isArray(X)){J.push({path:B,message:`expected an array, got ${K(X)}`});return}X.forEach((Q,W)=>Y(J,`${B}[${W}]`,Q,$))}function F(J,B,X){if(X===void 0)return;if(!Array.isArray(X)){J.push({path:B,message:`expected an array of strings, got ${K(X)}`});return}X.forEach(($,Q)=>{if(typeof $!=="string"||!$.trim())J.push({path:`${B}[${Q}]`,message:`expected a non-empty string, got ${K($)}`})})}function G(J,B,X){if(X===void 0)return;if(typeof X!=="string"){J.push({path:B,message:`expected a URL string, got ${K(X)}`});return}try{let $=new URL(X);if($.protocol!=="http:"&&$.protocol!=="https:")J.push({path:B,message:`expected an http(s) URL, got ${K(X)}`})}catch{J.push({path:B,message:`expected a valid absolute URL, got ${K(X)}`})}}function x(J,B,X){if(X===void 0)return;if(typeof X!=="string"||!X.trim()){J.push({path:B,message:`expected a cron expression string, got ${K(X)}`});return}let $=X.trim().split(/\s+/);if($.length!==5&&$.length!==6)J.push({path:B,message:`expected 5 or 6 whitespace-separated fields, got ${$.length} (${K(X)})`})}function p(J){let B=[];if(J.verbose!==void 0&&typeof J.verbose!=="boolean")B.push({path:"verbose",message:`expected a boolean, got ${K(J.verbose)}`});return Y(B,"logLevel",J.logLevel,E),C(B,"maxPRsPerRun",J.maxPRsPerRun,{min:1,integer:!0}),h(B,J),v(B,J),n(B,J),l(B,J),t(B,J),r(B,J),o(B,J),a(B,J),i(B,J),c(B,J),y(B,J),B}function f(J,B){if(B===void 0)return;if(!Z(B)){J.push({path:"registries.docker",message:`expected an object keyed by registry host, got ${K(B)}`});return}for(let[X,$]of Object.entries(B)){let Q=`registries.docker.${X}`;if(!Z($)){J.push({path:Q,message:`expected an object, got ${K($)}`});continue}for(let W of["username","passwordEnv","tokenEnv"]){let H=$[W];if(H!==void 0&&(typeof H!=="string"||!H.trim()))J.push({path:`${Q}.${W}`,message:`expected a non-empty string, got ${K(H)}`})}if($.username&&!$.passwordEnv&&!$.tokenEnv)J.push({path:`${Q}.passwordEnv`,message:"is required when a username is given"});if($.passwordEnv&&!$.username)J.push({path:`${Q}.username`,message:"is required when passwordEnv is given"})}}function y(J,B){let X=B.analysis;if(X===void 0)return;if(!Z(X)){J.push({path:"analysis",message:`expected an object, got ${K(X)}`});return}if(X.enabled!==void 0&&typeof X.enabled!=="boolean")J.push({path:"analysis.enabled",message:`expected a boolean, got ${K(X.enabled)}`});if(X.tools===void 0)return;if(!Z(X.tools)){J.push({path:"analysis.tools",message:`expected an object mapping analyzer names to booleans, got ${K(X.tools)}`});return}for(let[$,Q]of Object.entries(X.tools))if(typeof Q!=="boolean")J.push({path:`analysis.tools.${$}`,message:`expected a boolean, got ${K(Q)}`});else if(!U.includes($))J.push({path:`analysis.tools.${$}`,message:`unknown analyzer; expected one of ${U.map(K).join(", ")}`})}function h(J,B){let X=B.repository;if(X===void 0)return;if(!Z(X)){J.push({path:"repository",message:`expected an object, got ${K(X)}`});return}if(X.provider!==void 0&&!L.includes(X.provider)){let $=_[String(X.provider)];J.push({path:"repository.provider",message:$?`${K(X.provider)} support is not implemented yet \u2014 follow ${$}`:`only ${L.map(K).join(", ")} is supported, got ${K(X.provider)}`})}for(let $ of["owner","name","baseBranch","token"]){let Q=X[$];if(Q!==void 0&&typeof Q!=="string")J.push({path:`repository.${$}`,message:`expected a string, got ${K(Q)}`})}G(J,"repository.apiUrl",X.apiUrl),G(J,"repository.serverUrl",X.serverUrl)}function v(J,B){let X=B.packages;if(X===void 0)return;if(!Z(X)){J.push({path:"packages",message:`expected an object, got ${K(X)}`});return}Y(J,"packages.strategy",X.strategy,D),F(J,"packages.ignore",X.ignore),F(J,"packages.ignorePaths",X.ignorePaths),F(J,"packages.minimumReleaseAgeExclude",X.minimumReleaseAgeExclude),C(J,"packages.minimumReleaseAge",X.minimumReleaseAge,{min:0});for(let $ of["includePrerelease","excludeMajor","respectLatest","engines"]){let Q=X[$];if(Q!==void 0&&typeof Q!=="boolean")J.push({path:`packages.${$}`,message:`expected a boolean, got ${K(Q)}`})}if(X.pin!==void 0){if(!Z(X.pin))J.push({path:"packages.pin",message:`expected an object mapping package names to versions, got ${K(X.pin)}`});else for(let[$,Q]of Object.entries(X.pin))if(typeof Q!=="string"||!Q.trim())J.push({path:`packages.pin.${$}`,message:`expected a version string, got ${K(Q)}`})}if(X.groups!==void 0){if(!Array.isArray(X.groups)){J.push({path:"packages.groups",message:`expected an array of groups, got ${K(X.groups)}`});return}X.groups.forEach(($,Q)=>{let W=`packages.groups[${Q}]`;if(!Z($)){J.push({path:W,message:`expected an object, got ${K($)}`});return}if(typeof $.name!=="string"||!$.name.trim())J.push({path:`${W}.name`,message:`expected a non-empty string, got ${K($.name)}`});if(!Array.isArray($.patterns)||$.patterns.length===0)J.push({path:`${W}.patterns`,message:`expected a non-empty array of patterns, got ${K($.patterns)}`});else F(J,`${W}.patterns`,$.patterns);Y(J,`${W}.strategy`,$.strategy,D)})}g(J,X.rules)}var I=["matchPackages","matchEcosystems","matchDepTypes","matchUpdateTypes","matchFiles","matchCurrentVersion","schedule"],k=["enabled","strategy","groupName","labels","reviewers","assignees","autoMerge","autoMigrate","minimumReleaseAge","prPriority","scheduleTimezone"];function g(J,B){if(B===void 0)return;if(!Array.isArray(B)){J.push({path:"packages.rules",message:`expected an array of rules, got ${K(B)}`});return}let X=new Set([...I,...k]);B.forEach(($,Q)=>{let W=`packages.rules[${Q}]`;if(!Z($)){J.push({path:W,message:`expected an object, got ${K($)}`});return}for(let z of Object.keys($))if(!X.has(z))J.push({path:`${W}.${z}`,message:`unknown key; expected one of ${[...X].map(K).join(", ")}`});if(!I.some((z)=>$[z]!==void 0))J.push({path:W,message:'has no matchers, so it applies to every update \u2014 add `matchPackages: ["*"]` if that is intended'});if(F(J,`${W}.matchPackages`,$.matchPackages),F(J,`${W}.matchDepTypes`,$.matchDepTypes),F(J,`${W}.matchFiles`,$.matchFiles),F(J,`${W}.labels`,$.labels),F(J,`${W}.reviewers`,$.reviewers),F(J,`${W}.assignees`,$.assignees),j(J,`${W}.matchEcosystems`,$.matchEcosystems,w),j(J,`${W}.matchUpdateTypes`,$.matchUpdateTypes,b),Y(J,`${W}.strategy`,$.strategy,D),C(J,`${W}.minimumReleaseAge`,$.minimumReleaseAge,{min:0}),$.prPriority!==void 0&&typeof $.prPriority!=="number")J.push({path:`${W}.prPriority`,message:`expected a number, got ${K($.prPriority)}`});for(let z of["enabled","autoMerge","autoMigrate"])if($[z]!==void 0&&typeof $[z]!=="boolean")J.push({path:`${W}.${z}`,message:`expected a boolean, got ${K($[z])}`});for(let z of["groupName","matchCurrentVersion","scheduleTimezone"])if($[z]!==void 0&&(typeof $[z]!=="string"||!String($[z]).trim()))J.push({path:`${W}.${z}`,message:`expected a non-empty string, got ${K($[z])}`});x(J,`${W}.schedule`,$.schedule)})}function n(J,B){let X=B.pullRequest;if(X===void 0)return;if(!Z(X)){J.push({path:"pullRequest",message:`expected an object, got ${K(X)}`});return}F(J,"pullRequest.reviewers",X.reviewers),F(J,"pullRequest.assignees",X.assignees),F(J,"pullRequest.labels",X.labels);let $=X.autoMerge;if($!==void 0){if(!Z($)){J.push({path:"pullRequest.autoMerge",message:`expected an object, got ${K($)}`});return}if($.enabled!==void 0&&typeof $.enabled!=="boolean")J.push({path:"pullRequest.autoMerge.enabled",message:`expected a boolean, got ${K($.enabled)}`});if(Y(J,"pullRequest.autoMerge.strategy",$.strategy,m),F(J,"pullRequest.autoMerge.conditions",$.conditions),Array.isArray($.conditions))for(let[Q,W]of $.conditions.entries())Y(J,`pullRequest.autoMerge.conditions[${Q}]`,W,P);if($.requireGreenCI!==void 0&&typeof $.requireGreenCI!=="boolean")J.push({path:"pullRequest.autoMerge.requireGreenCI",message:`expected a boolean, got ${K($.requireGreenCI)}`});if($.optOutLabel!==void 0&&typeof $.optOutLabel!=="string")J.push({path:"pullRequest.autoMerge.optOutLabel",message:`expected a string, got ${K($.optOutLabel)}`})}}function c(J,B){let X=B.ai;if(X===void 0)return;if(!Z(X)){J.push({path:"ai",message:`expected an object, got ${K(X)}`});return}if(X.enabled!==void 0&&typeof X.enabled!=="boolean")J.push({path:"ai.enabled",message:`expected a boolean, got ${K(X.enabled)}`});Y(J,"ai.provider",X.provider,R),Y(J,"ai.effort",X.effort,A);for(let Q of["model","apiKeyEnv","baseUrl"])if(X[Q]!==void 0&&typeof X[Q]!=="string")J.push({path:`ai.${Q}`,message:`expected a string, got ${K(X[Q])}`});if(typeof X.apiKeyEnv==="string"&&/^sk-|^AIza/.test(X.apiKeyEnv))J.push({path:"ai.apiKeyEnv",message:"expected the NAME of an environment variable, not an API key"});let $=X.review;if($!==void 0)if(!Z($))J.push({path:"ai.review",message:`expected an object, got ${K($)}`});else{for(let Q of["enabled","drafts","autoReview","summaryOnly"])if($[Q]!==void 0&&typeof $[Q]!=="boolean")J.push({path:`ai.review.${Q}`,message:`expected a boolean, got ${K($[Q])}`});if(Y(J,"ai.review.profile",$.profile,S),Y(J,"ai.review.requestChangesOn",$.requestChangesOn,d),F(J,"ai.review.ignoreTitleKeywords",$.ignoreTitleKeywords),F(J,"ai.review.ignoreUsernames",$.ignoreUsernames),F(J,"ai.review.pathFilters",$.pathFilters),$.instructions!==void 0&&typeof $.instructions!=="string")J.push({path:"ai.review.instructions",message:`expected a string, got ${K($.instructions)}`});if($.guidelineFiles!==void 0&&$.guidelineFiles!==!1)F(J,"ai.review.guidelineFiles",$.guidelineFiles);if($.pathInstructions!==void 0)if(!Array.isArray($.pathInstructions))J.push({path:"ai.review.pathInstructions",message:`expected an array, got ${K($.pathInstructions)}`});else $.pathInstructions.forEach((Q,W)=>{let H=`ai.review.pathInstructions[${W}]`;if(!Z(Q)){J.push({path:H,message:`expected an object, got ${K(Q)}`});return}for(let z of["path","instructions"])if(typeof Q[z]!=="string"||!Q[z].trim())J.push({path:`${H}.${z}`,message:`expected a non-empty string, got ${K(Q[z])}`})})}if(X.maxTokensPerRun!==void 0){if(typeof X.maxTokensPerRun!=="number"||!Number.isFinite(X.maxTokensPerRun)||X.maxTokensPerRun<=0)J.push({path:"ai.maxTokensPerRun",message:`expected a positive number, got ${K(X.maxTokensPerRun)}`})}}function l(J,B){let X=B.registries;if(X===void 0)return;if(!Z(X)){J.push({path:"registries",message:`expected an object, got ${K(X)}`});return}if(f(J,X.docker),G(J,"registries.npm",X.npm),G(J,"registries.composer",X.composer),X.npmScopes!==void 0){if(!Z(X.npmScopes)){J.push({path:"registries.npmScopes",message:`expected an object keyed by scope, got ${K(X.npmScopes)}`});return}for(let[$,Q]of Object.entries(X.npmScopes)){if(!$.startsWith("@"))J.push({path:`registries.npmScopes.${$}`,message:`scope keys must start with "@", got ${K($)}`});G(J,`registries.npmScopes.${$}`,Q)}}}function t(J,B){let X=B.security;if(X===void 0)return;if(!Z(X)){J.push({path:"security",message:`expected an object, got ${K(X)}`});return}for(let $ of["enabled","prioritize"]){let Q=X[$];if(Q!==void 0&&typeof Q!=="boolean")J.push({path:`security.${$}`,message:`expected a boolean, got ${K(Q)}`})}if(X.label!==void 0&&(typeof X.label!=="string"||!X.label.trim()))J.push({path:"security.label",message:`expected a non-empty string, got ${K(X.label)}`});Y(J,"security.minimumSeverity",X.minimumSeverity,q)}function r(J,B){if(B.schedule!==void 0){if(!Z(B.schedule))J.push({path:"schedule",message:`expected an object, got ${K(B.schedule)}`});else if(x(J,"schedule.cron",B.schedule.cron),B.schedule.timezone!==void 0&&typeof B.schedule.timezone!=="string")J.push({path:"schedule.timezone",message:`expected a string, got ${K(B.schedule.timezone)}`})}let X=B.workflows?.custom;if(X===void 0)return;if(!Array.isArray(X)){J.push({path:"workflows.custom",message:`expected an array, got ${K(X)}`});return}X.forEach(($,Q)=>{let W=`workflows.custom[${Q}]`;if(!Z($)){J.push({path:W,message:`expected an object, got ${K($)}`});return}if(typeof $.name!=="string"||!$.name.trim())J.push({path:`${W}.name`,message:`expected a non-empty string, got ${K($.name)}`});x(J,`${W}.schedule`,$.schedule),Y(J,`${W}.strategy`,$.strategy,D),F(J,`${W}.reviewers`,$.reviewers),F(J,`${W}.assignees`,$.assignees),F(J,`${W}.labels`,$.labels)})}function o(J,B){let X=B.releaseNotes;if(X===void 0)return;if(!Z(X)){J.push({path:"releaseNotes",message:`expected an object, got ${K(X)}`});return}for(let $ of["enabled","sanitizeReferences","includeCompareLinks"]){let Q=X[$];if(Q!==void 0&&typeof Q!=="boolean")J.push({path:`releaseNotes.${$}`,message:`expected a boolean, got ${K(Q)}`})}C(J,"releaseNotes.maxReleases",X.maxReleases,{min:1,integer:!0}),C(J,"releaseNotes.maxBodyLength",X.maxBodyLength,{min:1,integer:!0})}function a(J,B){let X=B.dashboard;if(X===void 0)return;if(!Z(X)){J.push({path:"dashboard",message:`expected an object, got ${K(X)}`});return}if(F(J,"dashboard.labels",X.labels),F(J,"dashboard.assignees",X.assignees),C(J,"dashboard.issueNumber",X.issueNumber,{min:1,integer:!0}),X.title!==void 0&&(typeof X.title!=="string"||!X.title.trim()))J.push({path:"dashboard.title",message:`expected a non-empty string, got ${K(X.title)}`})}function i(J,B){let X=B.notifications;if(X===void 0)return;if(!Z(X)){J.push({path:"notifications",message:`expected an object, got ${K(X)}`});return}let $=(H,z)=>{if(z===void 0)return;if(!Array.isArray(z)){J.push({path:H,message:`expected an array of event names, got ${K(z)}`});return}z.forEach((V,O)=>{Y(J,`${H}[${O}]`,V,M)})},Q=(H,z)=>{if(z!==void 0&&(typeof z!=="string"||!z.trim()))J.push({path:H,message:`expected an environment variable name, got ${K(z)}`})};for(let H of["slack","discord"]){let z=X[H];if(z===void 0)continue;if(!Z(z)){J.push({path:`notifications.${H}`,message:`expected an object, got ${K(z)}`});continue}Q(`notifications.${H}.webhookEnv`,z.webhookEnv),$(`notifications.${H}.events`,z.events)}let W=X.webhooks;if(W===void 0)return;if(!Array.isArray(W)){J.push({path:"notifications.webhooks",message:`expected an array, got ${K(W)}`});return}W.forEach((H,z)=>{let V=`notifications.webhooks[${z}]`;if(!Z(H)){J.push({path:V,message:`expected an object, got ${K(H)}`});return}if(H.url===void 0)J.push({path:`${V}.url`,message:"a webhook needs a url"});else G(J,`${V}.url`,H.url);Q(`${V}.secretEnv`,H.secretEnv),$(`${V}.events`,H.events)})}function u(J){return J.map((B)=>` \u2022 ${B.path}: ${B.message}`).join(`
2
+ import{Dd as N}from"./chunk-yzyqkwsc.js";import{Id as M}from"./chunk-n7hbbha7.js";import{he as T}from"./chunk-cf5czw9m.js";import{me as L,ne as _}from"./chunk-9rvapdmv.js";var D=["major","minor","patch","all"],m=["merge","squash","rebase"],P=["patch-only","minor-only","security-only","all"],R=["anthropic","openai","google","openrouter","openai-compatible"],A=["low","medium","high"],S=["chill","assertive"],d=["never","critical"],q=["low","moderate","high","critical"],E=["silent","error","warn","info","debug"],w=["npm","composer","github-actions","docker","pkgx","zig","python","rust","go","ruby"],b=["major","minor","patch"],U=T.map((J)=>J.name);function K(J){return JSON.stringify(J)}function Z(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}function Y(J,B,X,$){if(X===void 0)return;if(typeof X!=="string"||!$.includes(X))J.push({path:B,message:`expected one of ${$.map(K).join(", ")}, got ${K(X)}`})}function C(J,B,X,$={}){let Q=$.min??0,W=$.integer??!1;if(X===void 0)return;if(typeof X!=="number"||!Number.isFinite(X)||X<Q){J.push({path:B,message:`expected a number >= ${Q}, got ${K(X)}`});return}if(W&&!Number.isInteger(X))J.push({path:B,message:`expected a whole number, got ${K(X)}`})}function j(J,B,X,$){if(X===void 0)return;if(!Array.isArray(X)){J.push({path:B,message:`expected an array, got ${K(X)}`});return}X.forEach((Q,W)=>Y(J,`${B}[${W}]`,Q,$))}function F(J,B,X){if(X===void 0)return;if(!Array.isArray(X)){J.push({path:B,message:`expected an array of strings, got ${K(X)}`});return}X.forEach(($,Q)=>{if(typeof $!=="string"||!$.trim())J.push({path:`${B}[${Q}]`,message:`expected a non-empty string, got ${K($)}`})})}function G(J,B,X){if(X===void 0)return;if(typeof X!=="string"){J.push({path:B,message:`expected a URL string, got ${K(X)}`});return}try{let $=new URL(X);if($.protocol!=="http:"&&$.protocol!=="https:")J.push({path:B,message:`expected an http(s) URL, got ${K(X)}`})}catch{J.push({path:B,message:`expected a valid absolute URL, got ${K(X)}`})}}function x(J,B,X){if(X===void 0)return;if(typeof X!=="string"||!X.trim()){J.push({path:B,message:`expected a cron expression string, got ${K(X)}`});return}let $=X.trim().split(/\s+/);if($.length!==5&&$.length!==6)J.push({path:B,message:`expected 5 or 6 whitespace-separated fields, got ${$.length} (${K(X)})`})}function p(J){let B=[];if(J.verbose!==void 0&&typeof J.verbose!=="boolean")B.push({path:"verbose",message:`expected a boolean, got ${K(J.verbose)}`});return Y(B,"logLevel",J.logLevel,E),C(B,"maxPRsPerRun",J.maxPRsPerRun,{min:1,integer:!0}),h(B,J),v(B,J),n(B,J),l(B,J),t(B,J),r(B,J),o(B,J),a(B,J),i(B,J),c(B,J),y(B,J),B}function f(J,B){if(B===void 0)return;if(!Z(B)){J.push({path:"registries.docker",message:`expected an object keyed by registry host, got ${K(B)}`});return}for(let[X,$]of Object.entries(B)){let Q=`registries.docker.${X}`;if(!Z($)){J.push({path:Q,message:`expected an object, got ${K($)}`});continue}for(let W of["username","passwordEnv","tokenEnv"]){let H=$[W];if(H!==void 0&&(typeof H!=="string"||!H.trim()))J.push({path:`${Q}.${W}`,message:`expected a non-empty string, got ${K(H)}`})}if($.username&&!$.passwordEnv&&!$.tokenEnv)J.push({path:`${Q}.passwordEnv`,message:"is required when a username is given"});if($.passwordEnv&&!$.username)J.push({path:`${Q}.username`,message:"is required when passwordEnv is given"})}}function y(J,B){let X=B.analysis;if(X===void 0)return;if(!Z(X)){J.push({path:"analysis",message:`expected an object, got ${K(X)}`});return}if(X.enabled!==void 0&&typeof X.enabled!=="boolean")J.push({path:"analysis.enabled",message:`expected a boolean, got ${K(X.enabled)}`});if(X.tools===void 0)return;if(!Z(X.tools)){J.push({path:"analysis.tools",message:`expected an object mapping analyzer names to booleans, got ${K(X.tools)}`});return}for(let[$,Q]of Object.entries(X.tools))if(typeof Q!=="boolean")J.push({path:`analysis.tools.${$}`,message:`expected a boolean, got ${K(Q)}`});else if(!U.includes($))J.push({path:`analysis.tools.${$}`,message:`unknown analyzer; expected one of ${U.map(K).join(", ")}`})}function h(J,B){let X=B.repository;if(X===void 0)return;if(!Z(X)){J.push({path:"repository",message:`expected an object, got ${K(X)}`});return}if(X.provider!==void 0&&!L.includes(X.provider)){let $=_[String(X.provider)];J.push({path:"repository.provider",message:$?`${K(X.provider)} support is not implemented yet \u2014 follow ${$}`:`only ${L.map(K).join(", ")} is supported, got ${K(X.provider)}`})}for(let $ of["owner","name","baseBranch","token"]){let Q=X[$];if(Q!==void 0&&typeof Q!=="string")J.push({path:`repository.${$}`,message:`expected a string, got ${K(Q)}`})}G(J,"repository.apiUrl",X.apiUrl),G(J,"repository.serverUrl",X.serverUrl)}function v(J,B){let X=B.packages;if(X===void 0)return;if(!Z(X)){J.push({path:"packages",message:`expected an object, got ${K(X)}`});return}Y(J,"packages.strategy",X.strategy,D),F(J,"packages.ignore",X.ignore),F(J,"packages.ignorePaths",X.ignorePaths),F(J,"packages.minimumReleaseAgeExclude",X.minimumReleaseAgeExclude),C(J,"packages.minimumReleaseAge",X.minimumReleaseAge,{min:0});for(let $ of["includePrerelease","excludeMajor","respectLatest","engines"]){let Q=X[$];if(Q!==void 0&&typeof Q!=="boolean")J.push({path:`packages.${$}`,message:`expected a boolean, got ${K(Q)}`})}if(X.pin!==void 0){if(!Z(X.pin))J.push({path:"packages.pin",message:`expected an object mapping package names to versions, got ${K(X.pin)}`});else for(let[$,Q]of Object.entries(X.pin))if(typeof Q!=="string"||!Q.trim())J.push({path:`packages.pin.${$}`,message:`expected a version string, got ${K(Q)}`})}if(X.groups!==void 0){if(!Array.isArray(X.groups)){J.push({path:"packages.groups",message:`expected an array of groups, got ${K(X.groups)}`});return}X.groups.forEach(($,Q)=>{let W=`packages.groups[${Q}]`;if(!Z($)){J.push({path:W,message:`expected an object, got ${K($)}`});return}if(typeof $.name!=="string"||!$.name.trim())J.push({path:`${W}.name`,message:`expected a non-empty string, got ${K($.name)}`});if(!Array.isArray($.patterns)||$.patterns.length===0)J.push({path:`${W}.patterns`,message:`expected a non-empty array of patterns, got ${K($.patterns)}`});else F(J,`${W}.patterns`,$.patterns);Y(J,`${W}.strategy`,$.strategy,D)})}g(J,X.rules)}var I=["matchPackages","matchEcosystems","matchDepTypes","matchUpdateTypes","matchFiles","matchCurrentVersion","schedule"],k=["enabled","strategy","groupName","labels","reviewers","assignees","autoMerge","autoMigrate","minimumReleaseAge","prPriority","scheduleTimezone"];function g(J,B){if(B===void 0)return;if(!Array.isArray(B)){J.push({path:"packages.rules",message:`expected an array of rules, got ${K(B)}`});return}let X=new Set([...I,...k]);B.forEach(($,Q)=>{let W=`packages.rules[${Q}]`;if(!Z($)){J.push({path:W,message:`expected an object, got ${K($)}`});return}for(let z of Object.keys($))if(!X.has(z))J.push({path:`${W}.${z}`,message:`unknown key; expected one of ${[...X].map(K).join(", ")}`});if(!I.some((z)=>$[z]!==void 0))J.push({path:W,message:'has no matchers, so it applies to every update \u2014 add `matchPackages: ["*"]` if that is intended'});if(F(J,`${W}.matchPackages`,$.matchPackages),F(J,`${W}.matchDepTypes`,$.matchDepTypes),F(J,`${W}.matchFiles`,$.matchFiles),F(J,`${W}.labels`,$.labels),F(J,`${W}.reviewers`,$.reviewers),F(J,`${W}.assignees`,$.assignees),j(J,`${W}.matchEcosystems`,$.matchEcosystems,w),j(J,`${W}.matchUpdateTypes`,$.matchUpdateTypes,b),Y(J,`${W}.strategy`,$.strategy,D),C(J,`${W}.minimumReleaseAge`,$.minimumReleaseAge,{min:0}),$.prPriority!==void 0&&typeof $.prPriority!=="number")J.push({path:`${W}.prPriority`,message:`expected a number, got ${K($.prPriority)}`});for(let z of["enabled","autoMerge","autoMigrate"])if($[z]!==void 0&&typeof $[z]!=="boolean")J.push({path:`${W}.${z}`,message:`expected a boolean, got ${K($[z])}`});for(let z of["groupName","matchCurrentVersion","scheduleTimezone"])if($[z]!==void 0&&(typeof $[z]!=="string"||!String($[z]).trim()))J.push({path:`${W}.${z}`,message:`expected a non-empty string, got ${K($[z])}`});x(J,`${W}.schedule`,$.schedule)})}function n(J,B){let X=B.pullRequest;if(X===void 0)return;if(!Z(X)){J.push({path:"pullRequest",message:`expected an object, got ${K(X)}`});return}F(J,"pullRequest.reviewers",X.reviewers),F(J,"pullRequest.assignees",X.assignees),F(J,"pullRequest.labels",X.labels);let $=X.autoMerge;if($!==void 0){if(!Z($)){J.push({path:"pullRequest.autoMerge",message:`expected an object, got ${K($)}`});return}if($.enabled!==void 0&&typeof $.enabled!=="boolean")J.push({path:"pullRequest.autoMerge.enabled",message:`expected a boolean, got ${K($.enabled)}`});if(Y(J,"pullRequest.autoMerge.strategy",$.strategy,m),F(J,"pullRequest.autoMerge.conditions",$.conditions),Array.isArray($.conditions))for(let[Q,W]of $.conditions.entries())Y(J,`pullRequest.autoMerge.conditions[${Q}]`,W,P);if($.requireGreenCI!==void 0&&typeof $.requireGreenCI!=="boolean")J.push({path:"pullRequest.autoMerge.requireGreenCI",message:`expected a boolean, got ${K($.requireGreenCI)}`});if($.optOutLabel!==void 0&&typeof $.optOutLabel!=="string")J.push({path:"pullRequest.autoMerge.optOutLabel",message:`expected a string, got ${K($.optOutLabel)}`})}}function c(J,B){let X=B.ai;if(X===void 0)return;if(!Z(X)){J.push({path:"ai",message:`expected an object, got ${K(X)}`});return}if(X.enabled!==void 0&&typeof X.enabled!=="boolean")J.push({path:"ai.enabled",message:`expected a boolean, got ${K(X.enabled)}`});Y(J,"ai.provider",X.provider,R),Y(J,"ai.effort",X.effort,A);for(let Q of["model","apiKeyEnv","baseUrl"])if(X[Q]!==void 0&&typeof X[Q]!=="string")J.push({path:`ai.${Q}`,message:`expected a string, got ${K(X[Q])}`});if(typeof X.apiKeyEnv==="string"&&/^sk-|^AIza/.test(X.apiKeyEnv))J.push({path:"ai.apiKeyEnv",message:"expected the NAME of an environment variable, not an API key"});let $=X.review;if($!==void 0)if(!Z($))J.push({path:"ai.review",message:`expected an object, got ${K($)}`});else{for(let Q of["enabled","drafts","autoReview","summaryOnly"])if($[Q]!==void 0&&typeof $[Q]!=="boolean")J.push({path:`ai.review.${Q}`,message:`expected a boolean, got ${K($[Q])}`});if(Y(J,"ai.review.profile",$.profile,S),Y(J,"ai.review.requestChangesOn",$.requestChangesOn,d),F(J,"ai.review.ignoreTitleKeywords",$.ignoreTitleKeywords),F(J,"ai.review.ignoreUsernames",$.ignoreUsernames),F(J,"ai.review.pathFilters",$.pathFilters),$.instructions!==void 0&&typeof $.instructions!=="string")J.push({path:"ai.review.instructions",message:`expected a string, got ${K($.instructions)}`});if($.guidelineFiles!==void 0&&$.guidelineFiles!==!1)F(J,"ai.review.guidelineFiles",$.guidelineFiles);if($.pathInstructions!==void 0)if(!Array.isArray($.pathInstructions))J.push({path:"ai.review.pathInstructions",message:`expected an array, got ${K($.pathInstructions)}`});else $.pathInstructions.forEach((Q,W)=>{let H=`ai.review.pathInstructions[${W}]`;if(!Z(Q)){J.push({path:H,message:`expected an object, got ${K(Q)}`});return}for(let z of["path","instructions"])if(typeof Q[z]!=="string"||!Q[z].trim())J.push({path:`${H}.${z}`,message:`expected a non-empty string, got ${K(Q[z])}`})})}if(X.maxTokensPerRun!==void 0){if(typeof X.maxTokensPerRun!=="number"||!Number.isFinite(X.maxTokensPerRun)||X.maxTokensPerRun<=0)J.push({path:"ai.maxTokensPerRun",message:`expected a positive number, got ${K(X.maxTokensPerRun)}`})}}function l(J,B){let X=B.registries;if(X===void 0)return;if(!Z(X)){J.push({path:"registries",message:`expected an object, got ${K(X)}`});return}if(f(J,X.docker),G(J,"registries.npm",X.npm),G(J,"registries.composer",X.composer),X.npmScopes!==void 0){if(!Z(X.npmScopes)){J.push({path:"registries.npmScopes",message:`expected an object keyed by scope, got ${K(X.npmScopes)}`});return}for(let[$,Q]of Object.entries(X.npmScopes)){if(!$.startsWith("@"))J.push({path:`registries.npmScopes.${$}`,message:`scope keys must start with "@", got ${K($)}`});G(J,`registries.npmScopes.${$}`,Q)}}}function t(J,B){let X=B.security;if(X===void 0)return;if(!Z(X)){J.push({path:"security",message:`expected an object, got ${K(X)}`});return}for(let $ of["enabled","prioritize"]){let Q=X[$];if(Q!==void 0&&typeof Q!=="boolean")J.push({path:`security.${$}`,message:`expected a boolean, got ${K(Q)}`})}if(X.label!==void 0&&(typeof X.label!=="string"||!X.label.trim()))J.push({path:"security.label",message:`expected a non-empty string, got ${K(X.label)}`});Y(J,"security.minimumSeverity",X.minimumSeverity,q)}function r(J,B){if(B.schedule!==void 0){if(!Z(B.schedule))J.push({path:"schedule",message:`expected an object, got ${K(B.schedule)}`});else if(x(J,"schedule.cron",B.schedule.cron),B.schedule.timezone!==void 0&&typeof B.schedule.timezone!=="string")J.push({path:"schedule.timezone",message:`expected a string, got ${K(B.schedule.timezone)}`})}let X=B.workflows?.custom;if(X===void 0)return;if(!Array.isArray(X)){J.push({path:"workflows.custom",message:`expected an array, got ${K(X)}`});return}X.forEach(($,Q)=>{let W=`workflows.custom[${Q}]`;if(!Z($)){J.push({path:W,message:`expected an object, got ${K($)}`});return}if(typeof $.name!=="string"||!$.name.trim())J.push({path:`${W}.name`,message:`expected a non-empty string, got ${K($.name)}`});x(J,`${W}.schedule`,$.schedule),Y(J,`${W}.strategy`,$.strategy,D),F(J,`${W}.reviewers`,$.reviewers),F(J,`${W}.assignees`,$.assignees),F(J,`${W}.labels`,$.labels)})}function o(J,B){let X=B.releaseNotes;if(X===void 0)return;if(!Z(X)){J.push({path:"releaseNotes",message:`expected an object, got ${K(X)}`});return}for(let $ of["enabled","sanitizeReferences","includeCompareLinks"]){let Q=X[$];if(Q!==void 0&&typeof Q!=="boolean")J.push({path:`releaseNotes.${$}`,message:`expected a boolean, got ${K(Q)}`})}C(J,"releaseNotes.maxReleases",X.maxReleases,{min:1,integer:!0}),C(J,"releaseNotes.maxBodyLength",X.maxBodyLength,{min:1,integer:!0})}function a(J,B){let X=B.dashboard;if(X===void 0)return;if(!Z(X)){J.push({path:"dashboard",message:`expected an object, got ${K(X)}`});return}if(F(J,"dashboard.labels",X.labels),F(J,"dashboard.assignees",X.assignees),C(J,"dashboard.issueNumber",X.issueNumber,{min:1,integer:!0}),X.title!==void 0&&(typeof X.title!=="string"||!X.title.trim()))J.push({path:"dashboard.title",message:`expected a non-empty string, got ${K(X.title)}`})}function i(J,B){let X=B.notifications;if(X===void 0)return;if(!Z(X)){J.push({path:"notifications",message:`expected an object, got ${K(X)}`});return}let $=(H,z)=>{if(z===void 0)return;if(!Array.isArray(z)){J.push({path:H,message:`expected an array of event names, got ${K(z)}`});return}z.forEach((V,O)=>{Y(J,`${H}[${O}]`,V,M)})},Q=(H,z)=>{if(z!==void 0&&(typeof z!=="string"||!z.trim()))J.push({path:H,message:`expected an environment variable name, got ${K(z)}`})};for(let H of["slack","discord"]){let z=X[H];if(z===void 0)continue;if(!Z(z)){J.push({path:`notifications.${H}`,message:`expected an object, got ${K(z)}`});continue}Q(`notifications.${H}.webhookEnv`,z.webhookEnv),$(`notifications.${H}.events`,z.events)}let W=X.webhooks;if(W===void 0)return;if(!Array.isArray(W)){J.push({path:"notifications.webhooks",message:`expected an array, got ${K(W)}`});return}W.forEach((H,z)=>{let V=`notifications.webhooks[${z}]`;if(!Z(H)){J.push({path:V,message:`expected an object, got ${K(H)}`});return}if(H.url===void 0)J.push({path:`${V}.url`,message:"a webhook needs a url"});else G(J,`${V}.url`,H.url);Q(`${V}.secretEnv`,H.secretEnv),$(`${V}.events`,H.events)})}function u(J){return J.map((B)=>` \u2022 ${B.path}: ${B.message}`).join(`
3
3
  `)}function $J(J){let B=p(J);if(B.length===0)return;throw new N(`Invalid buddy configuration (${B.length} issue${B.length===1?"":"s"}):
4
4
  ${u(B)}`,B[0].path)}
5
- export{p as Zc,u as _c,$J as $c};
5
+ export{p as $c,u as ad,$J as bd};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ze as a}from"./chunk-dz2e81v7.js";import"./chunk-gt3m1eqn.js";import"./chunk-kfn6xbc6.js";import"./chunk-91gpxfta.js";import"./chunk-xmqv24zr.js";export{a as ReleaseNotesFetcher};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$ as h,U as a,V as b,W as c,X as d,Y as e,Z as f,_ as g,aa as i,ba as j,ca as k,da as l,ea as m,fa as n}from"./chunk-pakq6dsv.js";import"./chunk-rad9rc2j.js";import"./chunk-91gpxfta.js";import"./chunk-xmqv24zr.js";export{m as withNarrative,n as shouldPublishReport,l as renderReport,c as parseHistory,f as loadHistory,e as findPrevious,i as computeMetrics,j as computeDeltas,d as appendHistory,g as REPORT_PERIODS,k as REPORT_MARKER,h as PERIOD_DAYS,a as HISTORY_PATH,b as HISTORY_LIMIT};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ai as n,Bi as g,Ci as m,Di as u,Ei as P,Fi as l,Gi as h,si as a,ti as e,ui as o,vi as s,wi as t,xi as i,yi as c,zi as r}from"./chunk-dkgz8hsd.js";import"./chunk-dh8yykbg.js";export{n as toPropertyKey,e as shouldProceedWithGitHubRequest,a as saveRateLimitInfo,s as saveGitHubPackageCache,u as resolvePackageDomain,i as logPkgxProjects,l as isKnownAlias,m as guessOriginalDomain,P as getPackageAliases,o as getGitHubPackageCache,h as getCanonicalDomain,c as formatObjectWithoutQuotedKeys,t as fetchPackageListFromGitHub,r as convertDomainToVarName,g as convertDomainToFileName};
2
+ import{Ai as c,Bi as r,Ci as n,Di as g,Ei as m,Fi as u,Gi as P,Hi as l,Ii as h,ui as a,vi as e,wi as o,xi as s,yi as t,zi as i}from"./chunk-nqgn0drz.js";import"./chunk-xmqv24zr.js";export{n as toPropertyKey,e as shouldProceedWithGitHubRequest,a as saveRateLimitInfo,s as saveGitHubPackageCache,u as resolvePackageDomain,i as logPkgxProjects,l as isKnownAlias,m as guessOriginalDomain,P as getPackageAliases,o as getGitHubPackageCache,h as getCanonicalDomain,c as formatObjectWithoutQuotedKeys,t as fetchPackageListFromGitHub,r as convertDomainToVarName,g as convertDomainToFileName};
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import{Lh as Z}from"./chunk-8y4szfd2.js";import{Wh as K}from"./chunk-rrm4x81p.js";var R=".buddy/reports.jsonl",U=52;function X(M){if(!M?.trim())return[];let E=[];for(let j of M.split(`
2
+ import{Nh as Z}from"./chunk-rad9rc2j.js";import{Yh as K}from"./chunk-91gpxfta.js";var R=".buddy/reports.jsonl",U=52;function X(M){if(!M?.trim())return[];let E=[];for(let j of M.split(`
3
3
  `)){if(!j.trim())continue;try{let N=JSON.parse(j);if(N?.period&&N.generatedAt&&N.health&&N.activity)E.push(N)}catch{continue}}return E}function x(M,E){return`${[...M,E].slice(-U).map((N)=>JSON.stringify(N)).join(`
4
4
  `)}
5
5
  `}function W(M,E){for(let j=M.length-1;j>=0;j--)if(M[j].period===E)return M[j];return null}async function _(M,E,j=K()){try{return X(await M.getFileContent(R,E))}catch(N){return j.debug(`No report history at ${R}: ${N}`),[]}}var k=["7d","30d","90d"],O={"7d":7,"30d":30,"90d":90};function A(M){let E=new Date(M.now.getTime()-O[M.period]*24*60*60*1000),j=M.pullRequests.filter((q)=>M.branchPrefix?q.head.startsWith(M.branchPrefix):Z(q.head)),N=j.filter((q)=>q.createdAt>=E),C=j.filter((q)=>q.mergedAt!==void 0&&q.mergedAt>=E),z=j.filter((q)=>q.state==="closed"&&q.mergedAt===void 0&&q.updatedAt>=E),F=C.map((q)=>(q.mergedAt.getTime()-q.createdAt.getTime())/3600000).sort((q,Q)=>q-Q),H=Object.values(M.dependenciesByEcosystem).reduce((q,Q)=>q+Q,0),J=M.updates.length;return{period:M.period,generatedAt:M.now.toISOString(),health:{byEcosystem:{...M.dependenciesByEcosystem},total:H,outdated:J,outdatedPercent:H>0?Math.round(J/H*100):0,majorBehind:M.updates.filter((q)=>q.updateType==="major").length,vulnerable:M.updates.filter((q)=>(q.securityAdvisories?.length??0)>0).length,deprecated:M.deprecated??0,drifted:M.drifted??0},activity:{opened:N.length,merged:C.length,closed:z.length,open:j.filter((q)=>q.state==="open").length,medianHoursToMerge:L(F),mergeRate:N.length>0?Math.round(C.length/N.length*100):0}}}function L(M){if(M.length===0)return null;let E=Math.floor(M.length/2),j=M.length%2===0?(M[E-1]+M[E])/2:M[E];return Math.round(j*10)/10}function S(M,E){if(!E)return{};let j=new Set(["merged","mergeRate"]),N=[["outdated",M.health.outdated,E.health.outdated],["majorBehind",M.health.majorBehind,E.health.majorBehind],["vulnerable",M.health.vulnerable,E.health.vulnerable],["deprecated",M.health.deprecated,E.health.deprecated],["opened",M.activity.opened,E.activity.opened],["merged",M.activity.merged,E.activity.merged],["mergeRate",M.activity.mergeRate,E.activity.mergeRate]],C={};for(let[z,F,H]of N){let J=F-H;C[z]={current:F,previous:H,change:J,improved:j.has(z)?J>=0:J<=0}}return C}var $="<!-- buddy:report -->";function G(M){if(!M||M.change===0)return"\u2014";let E=M.change>0?"\u25B2":"\u25BC",j=M.change>0?"+":"";return`${E} ${j}${M.change}${M.improved?"":" \u26A0\uFE0F"}`}function T(M,E={}){let j=O[M.period],N=[$,"",`## Dependency report \u2014 last ${j} days`,"",`Generated ${M.generatedAt.slice(0,10)}.`,"","### Dependency health","","| Metric | Value | Change |","| --- | --- | --- |",`| Total dependencies | ${M.health.total} | |`,`| Outdated | ${M.health.outdated} (${M.health.outdatedPercent}%) | ${G(E.outdated)} |`,`| A major behind | ${M.health.majorBehind} | ${G(E.majorBehind)} |`,`| With known advisories | ${M.health.vulnerable} | ${G(E.vulnerable)} |`,`| Deprecated | ${M.health.deprecated} | ${G(E.deprecated)} |`];if(M.health.drifted>0)N.push(`| Held back by a dependant | ${M.health.drifted} | |`);N.push("","### By ecosystem","");let C=Object.entries(M.health.byEcosystem).filter(([,z])=>z>0).sort(([,z],[,F])=>F-z);if(C.length===0)N.push("No dependencies detected.");else{N.push("| Ecosystem | Dependencies |","| --- | --- |");for(let[z,F]of C)N.push(`| ${z} | ${F} |`)}if(N.push("","### Bot activity","","| Metric | Value | Change |","| --- | --- | --- |",`| Pull requests opened | ${M.activity.opened} | ${G(E.opened)} |`,`| Merged | ${M.activity.merged} | ${G(E.merged)} |`,`| Closed without merging | ${M.activity.closed} | |`,`| Currently open | ${M.activity.open} | |`),M.activity.medianHoursToMerge!==null)N.push(`| Median time to merge | ${w(M.activity.medianHoursToMerge)} | |`);if(N.push(`| Merged vs opened | ${M.activity.mergeRate}% | ${G(E.mergeRate)} |`),N.push("",`_"Merged vs opened" compares both counts within the same ${j}-day window, so`,"recently opened pull requests depress it by definition._"),Object.keys(E).length===0)N.push("","_No previous report to compare against; this is the baseline._");return N.join(`
6
6
  `)}async function Y(M,E,j,N,C=K()){if(!j)return M;try{let F=(await j.complete({system:"You write short factual summaries of dependency-health metrics. Interpret the numbers you are given; never invent figures, and never restate a table that already appears in the report. Three sentences at most.",messages:[{role:"user",content:[N?`Focus: ${N}`:"Focus: what changed and what needs attention.","","Metrics:",JSON.stringify(E,null,2)].join(`
7
7
  `)}]})).text.trim();if(!F)return M;return M.replace("### Dependency health",`${F}
8
8
 
9
- ### Dependency health`)}catch(z){return C.warn(`\u26A0\uFE0F Could not write the report narrative: ${z}`),M}}function w(M){if(M<24)return`${M}h`;return`${Math.round(M/24*10)/10}d`}function B(M){if(!M.scheduled)return{publish:!0};if(M.enabled===!0)return{publish:!0};return{publish:!1,reason:M.enabled===!1?"reports.enabled is false":"reports.enabled is not set \u2014 scheduled reports are opt-in"}}export{R as O,U as P,X as Q,x as R,W as S,_ as T,k as U,O as V,A as W,S as X,$ as Y,T as Z,Y as _,B as $};
9
+ ### Dependency health`)}catch(z){return C.warn(`\u26A0\uFE0F Could not write the report narrative: ${z}`),M}}function w(M){if(M<24)return`${M}h`;return`${Math.round(M/24*10)/10}d`}function B(M){if(!M.scheduled)return{publish:!0};if(M.enabled===!0)return{publish:!0};return{publish:!1,reason:M.enabled===!1?"reports.enabled is false":"reports.enabled is not set \u2014 scheduled reports are opt-in"}}export{R as U,U as V,X as W,x as X,W as Y,_ as Z,k as _,O as $,A as aa,S as ba,$ as ca,T as da,Y as ea,B as fa};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Wh as K}from"./chunk-rrm4x81p.js";import{ll as N}from"./chunk-dh8yykbg.js";function F(q){return(q.split(/[/\\]/).pop()||"")==="build.zig.zon"}async function S(q,z){try{if(!F(q))return null;let J=[],j=z.match(/\.dependencies\s*=\s*\.?\{/);if(j){let Q=j.index+j[0].length,A=1,T=Q;while(T<z.length&&A>0){if(z[T]==="{")A++;else if(z[T]==="}")A--;T++}let G=z.slice(Q,T-1),O=/\.(\w+)\s*=\s*\.?\{/g,W=O.exec(G);while(W!==null){let b=W[1],X=W.index+W[0].length,Y=1,V=X;while(V<G.length&&Y>0){if(G[V]==="{")Y++;else if(G[V]==="}")Y--;V++}let _=G.slice(X,V-1),$=_.match(/\.url\s*=\s*"([^"]+)"/),R=_.match(/\.hash\s*=\s*"([^"]+)"/);if($){let H=$[1],v=H.match(/\/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/i),E=v?v[1]:"unknown",Z={url:H};if(R)Z.hash=R[1];J.push({name:b,currentVersion:E,type:"zig-dependencies",file:q,metadata:Z})}W=O.exec(G)}}return{path:q,type:"build.zig.zon",content:z,dependencies:J}}catch(J){return K().warn(`Failed to parse Zig manifest ${q}:`,J),null}}async function w(q,z,J){try{if(!F(q))return K().info(`\u26A0\uFE0F updateZigManifest: ${q} is not a Zig manifest file, returning original content`),z;let j=z;for(let Q of J){let A=Q.name.trim(),T=new RegExp(`(\\.${A}\\s*=\\s*\\.?\\{[^}]*\\.url\\s*=\\s*")([^"]+)("[^}]*\\})`,"s"),G=j.match(T);if(G){let[O,W,b,X]=G,Y=/\/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/i,V=b.replace(Y,(H)=>{return H.startsWith("/v")?`/v${Q.newVersion}`:`/${Q.newVersion}`}),_=Q.resolved?.hash,$=X;if(_)$=X.replace(/(\.hash\s*=\s*")([^"]+)(")/,`$1${_}$3`);else if(/\.hash\s*=/.test(X)){K().warn(`\u26A0\uFE0F No hash available for ${A}; leaving ${q} unchanged to avoid a hash mismatch`);continue}let R=`${W}${V}${$}`;j=j.replace(O,R),K().info(`\u2705 Updated ${A} from ${G[2]} to ${V}`)}else K().warn(`\u26A0\uFE0F Could not find dependency block for ${A} in ${q}`)}return j}catch(j){return K().warn(`Failed to update Zig manifest ${q}:`,j),z}}async function U(q){let z=[],J=new Map;for(let j of q)if(F(j.file)){if(!J.has(j.file))J.set(j.file,[]);J.get(j.file).push(j)}for(let[j,Q]of J)try{let A=await import("fs");if(A.existsSync(j)){let T=A.readFileSync(j,"utf-8"),G=await w(j,T,Q);if(G!==T)z.push({path:j,content:G,type:"update"}),K().info(`\u2705 Generated update for ${j} with ${Q.length} package changes`);else K().info(`\u2139\uFE0F No changes needed for ${j} - versions already up to date`)}else K().warn(`\u26A0\uFE0F Zig manifest file ${j} does not exist`)}catch(A){K().warn(`Failed to generate updates for Zig manifest ${j}:`,A)}return z}
3
- export{F as ue,S as ve,w as we,U as xe};
2
+ import{Yh as K}from"./chunk-91gpxfta.js";import{nl as N}from"./chunk-xmqv24zr.js";function F(q){return(q.split(/[/\\]/).pop()||"")==="build.zig.zon"}async function S(q,z){try{if(!F(q))return null;let J=[],j=z.match(/\.dependencies\s*=\s*\.?\{/);if(j){let Q=j.index+j[0].length,A=1,T=Q;while(T<z.length&&A>0){if(z[T]==="{")A++;else if(z[T]==="}")A--;T++}let G=z.slice(Q,T-1),O=/\.(\w+)\s*=\s*\.?\{/g,W=O.exec(G);while(W!==null){let b=W[1],X=W.index+W[0].length,Y=1,V=X;while(V<G.length&&Y>0){if(G[V]==="{")Y++;else if(G[V]==="}")Y--;V++}let _=G.slice(X,V-1),$=_.match(/\.url\s*=\s*"([^"]+)"/),R=_.match(/\.hash\s*=\s*"([^"]+)"/);if($){let H=$[1],v=H.match(/\/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/i),E=v?v[1]:"unknown",Z={url:H};if(R)Z.hash=R[1];J.push({name:b,currentVersion:E,type:"zig-dependencies",file:q,metadata:Z})}W=O.exec(G)}}return{path:q,type:"build.zig.zon",content:z,dependencies:J}}catch(J){return K().warn(`Failed to parse Zig manifest ${q}:`,J),null}}async function w(q,z,J){try{if(!F(q))return K().info(`\u26A0\uFE0F updateZigManifest: ${q} is not a Zig manifest file, returning original content`),z;let j=z;for(let Q of J){let A=Q.name.trim(),T=new RegExp(`(\\.${A}\\s*=\\s*\\.?\\{[^}]*\\.url\\s*=\\s*")([^"]+)("[^}]*\\})`,"s"),G=j.match(T);if(G){let[O,W,b,X]=G,Y=/\/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/i,V=b.replace(Y,(H)=>{return H.startsWith("/v")?`/v${Q.newVersion}`:`/${Q.newVersion}`}),_=Q.resolved?.hash,$=X;if(_)$=X.replace(/(\.hash\s*=\s*")([^"]+)(")/,`$1${_}$3`);else if(/\.hash\s*=/.test(X)){K().warn(`\u26A0\uFE0F No hash available for ${A}; leaving ${q} unchanged to avoid a hash mismatch`);continue}let R=`${W}${V}${$}`;j=j.replace(O,R),K().info(`\u2705 Updated ${A} from ${G[2]} to ${V}`)}else K().warn(`\u26A0\uFE0F Could not find dependency block for ${A} in ${q}`)}return j}catch(j){return K().warn(`Failed to update Zig manifest ${q}:`,j),z}}async function U(q){let z=[],J=new Map;for(let j of q)if(F(j.file)){if(!J.has(j.file))J.set(j.file,[]);J.get(j.file).push(j)}for(let[j,Q]of J)try{let A=await import("fs");if(A.existsSync(j)){let T=A.readFileSync(j,"utf-8"),G=await w(j,T,Q);if(G!==T)z.push({path:j,content:G,type:"update"}),K().info(`\u2705 Generated update for ${j} with ${Q.length} package changes`);else K().info(`\u2139\uFE0F No changes needed for ${j} - versions already up to date`)}else K().warn(`\u26A0\uFE0F Zig manifest file ${j} does not exist`)}catch(A){K().warn(`Failed to generate updates for Zig manifest ${j}:`,A)}return z}
3
+ export{F as we,S as xe,w as ye,U as ze};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Nb as w}from"./chunk-yy8vb4yk.js";import"./chunk-dh8yykbg.js";import{readdir as $}from"fs/promises";import{join as X}from"path";var G=["dependencies","peerDependencies","optionalDependencies"];async function x(V,W,Q,U){let M=await K(Q,U);if(M.length===0)return[];let J=new Map,D=(q,z,H)=>{let Y=J.get(q),Z={by:z,range:H};if(Y)Y.push(Z);else J.set(q,[Z])};for(let q of V)for(let z of q.dependencies)D(z.name,w,z.currentVersion);for(let q of M)for(let[z,H]of Object.entries(q.ranges))D(z,q.name,H);let E=[];for(let q of M){let z=J.get(q.name);if(!z||z.length===0)continue;try{let H=await W.getReleaseVersions(q.name);if(H.length===0)continue;E.push({name:q.name,installed:q.version,available:H,declared:z})}catch(H){U.debug(`Skipping drift analysis for ${q.name}: ${H}`)}}return E}async function K(V,W){let Q=X(V,"node_modules"),U=[],M;try{M=await $(Q)}catch{return W.debug("No node_modules directory, skipping resolution drift analysis"),[]}let J=[];for(let D of M){if(D.startsWith("."))continue;if(D.startsWith("@")){try{let E=await $(X(Q,D));J.push(...E.map((q)=>`${D}/${q}`))}catch{continue}continue}J.push(D)}return await Promise.all(J.map(async(D)=>{try{let E=await Bun.file(X(Q,D,"package.json")).json();if(!E.name||!E.version)return;let q={};for(let z of G)Object.assign(q,E[z]??{});U.push({name:E.name,version:E.version,ranges:q})}catch{}})),U}export{x as collectDriftInputs};
2
+ import{Pb as w}from"./chunk-6zp71ecf.js";import"./chunk-xmqv24zr.js";import{readdir as $}from"fs/promises";import{join as X}from"path";var G=["dependencies","peerDependencies","optionalDependencies"];async function x(V,W,Q,U){let M=await K(Q,U);if(M.length===0)return[];let J=new Map,D=(q,z,H)=>{let Y=J.get(q),Z={by:z,range:H};if(Y)Y.push(Z);else J.set(q,[Z])};for(let q of V)for(let z of q.dependencies)D(z.name,w,z.currentVersion);for(let q of M)for(let[z,H]of Object.entries(q.ranges))D(z,q.name,H);let E=[];for(let q of M){let z=J.get(q.name);if(!z||z.length===0)continue;try{let H=await W.getReleaseVersions(q.name);if(H.length===0)continue;E.push({name:q.name,installed:q.version,available:H,declared:z})}catch(H){U.debug(`Skipping drift analysis for ${q.name}: ${H}`)}}return E}async function K(V,W){let Q=X(V,"node_modules"),U=[],M;try{M=await $(Q)}catch{return W.debug("No node_modules directory, skipping resolution drift analysis"),[]}let J=[];for(let D of M){if(D.startsWith("."))continue;if(D.startsWith("@")){try{let E=await $(X(Q,D));J.push(...E.map((q)=>`${D}/${q}`))}catch{continue}continue}J.push(D)}return await Promise.all(J.map(async(D)=>{try{let E=await Bun.file(X(Q,D,"package.json")).json();if(!E.name||!E.version)return;let q={};for(let z of G)Object.assign(q,E[z]??{});U.push({name:E.name,version:E.version,ranges:q})}catch{}})),U}export{x as collectDriftInputs};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ function N(z){let w=new Map;for(let q of z?.split(",")??[]){let[B,E,...G]=q.trim().split("=");if(B!=="bughq"&&B!=="loghq"&&B!=="statushq"||!E||G.length)throw Error("Use --hq-sources with comma-separated bughq=ID, loghq=ID, or statushq=ID entries.");if(w.has(E))throw Error("Each ID in --hq-sources must appear only once.");w.set(E,B)}return w}function M(z){let w=z.split(`
3
+ `,1)[0]?.trim();if(w==="**Test notification**")return{kind:"test"};if(w?.startsWith("**\uD83D\uDCE2 ")&&w.endsWith("**"))return{kind:"status-report"};let q=w?.match(/^\*\*(\uD83D\uDD34|\u26A0\uFE0F?|\u2705) (.+?)(?: is down|: issue detected| has recovered)\*\*$/u);if(!q)return{kind:"unrecognized"};if(q[1]==="\uD83D\uDD34"&&w?.endsWith(" is down**"))return{kind:"outage",project:q[2]};if(q[1]==="\u2705"&&w?.endsWith(" has recovered**"))return{kind:"recovery",project:q[2]};if(q[1].startsWith("\u26A0")&&w?.endsWith(": issue detected**"))return{kind:"degradation",project:q[2]};return{kind:"unrecognized"}}function O(z,w){if(z==="statushq")return{source:z,...M(w.content)};let q=w.embeds.find((F)=>F.footer?.text===z),B=(F)=>q?.fields?.find((L)=>L.name===F)?.value,E=B("Project"),G=B("Environment"),K=B("Level"),J=q?.url,A=J&&URL.canParse(J)?new URL(J):void 0,D={source:z,project:E,level:K,environment:G};if(!A||A.origin!==`https://${z}.org`||A.username||A.password||!E)return{...D,kind:"unrecognized"};if(G==="test"&&K==="info"&&A.pathname==="/dashboard"&&!A.search)return{...D,kind:"test"};if(z==="bughq"&&/^\/issue\/[\w-]+$/.test(A.pathname)){let F=A.pathname.split("/").at(-1);if(q?.description==="A new issue was just captured.")return{...D,kind:"bug",reference:F};if(q?.description==="An issue you resolved is happening again.")return{...D,kind:"regression",reference:F}}let H=A.searchParams.get("project");if(z==="loghq"&&A.pathname==="/dashboard"&&H&&/^[\w-]+$/.test(H)){if(q?.description==="A new error was just logged.")return{...D,kind:"error",reference:H};if(q?.description==="An error that had gone quiet is happening again.")return{...D,kind:"regression",reference:H}}return{...D,kind:"unrecognized"}}
4
+ export{N as a,O as b};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Mh as a}from"./chunk-09wkxvnt.js";import"./chunk-rad9rc2j.js";import"./chunk-kfn6xbc6.js";import"./chunk-91gpxfta.js";import"./chunk-xmqv24zr.js";export{a as BitbucketProvider};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Tf as K}from"./chunk-rwzt9xvk.js";import{mg as D}from"./chunk-h9deve0y.js";var F=[[0,59],[0,23],[1,31],[1,12],[0,6]];function I(j,J){let[U,B]=F[J],H=new Set;for(let Q of j.split(",")){let[X,Z]=Q.split("/"),q=Z===void 0?1:Number(Z);if(!Number.isInteger(q)||q<1)return null;let $,G;if(X==="*")$=U,G=B;else if(X.includes("-")){let[Y,_]=X.split("-").map(Number);if(!Number.isInteger(Y)||!Number.isInteger(_))return null;$=Y,G=_}else{let Y=Number(X);if(!Number.isInteger(Y))return null;$=Y,G=Y}if($<U||G>B||$>G)return null;for(let Y=$;Y<=G;Y+=q)H.add(Y)}return H.size>0?H:null}function L(j){let J=j.trim().split(/\s+/);if(J.length!==5)return null;let U=J.map((Z,q)=>I(Z,q));if(U.some((Z)=>Z===null))return null;let[,B,H,Q,X]=U;return{hours:B,daysOfMonth:H,months:Q,daysOfWeek:X}}function N(j,J){if(!J)return{hour:j.getHours(),day:j.getDate(),month:j.getMonth()+1,weekday:j.getDay()};let U=new Intl.DateTimeFormat("en-US",{timeZone:J,hour:"numeric",hour12:!1,day:"numeric",month:"numeric",weekday:"short"}),B=Object.fromEntries(U.formatToParts(j).map((Q)=>[Q.type,Q.value])),H=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return{hour:Number(B.hour)%24,day:Number(B.day),month:Number(B.month),weekday:Math.max(0,H.indexOf(B.weekday))}}function C(j,J=new Date,U){let B=L(j);if(!B)return!1;let{hour:H,day:Q,month:X,weekday:Z}=N(J,U);if(!B.hours.has(H)||!B.months.has(X))return!1;let q=B.daysOfMonth.size<31,$=B.daysOfWeek.size<7;if(q&&$)return B.daysOfMonth.has(Q)||B.daysOfWeek.has(Z);return B.daysOfMonth.has(Q)&&B.daysOfWeek.has(Z)}function W(j){if(j.dependencyType==="github-actions")return"github-actions";if(j.dependencyType==="docker-image")return"docker";if(j.dependencyType==="zig-dependencies")return"zig";if(j.dependencyType==="python"||j.dependencyType==="rust"||j.dependencyType==="go"||j.dependencyType==="ruby")return j.dependencyType;if(j.file.endsWith("composer.json")||j.file.endsWith("composer.lock"))return"composer";if(j.file.endsWith("package.json"))return"npm";return"pkgx"}function A(j,J,U=new Date){if(j.matchPackages?.length){if(!K(j.matchPackages).matches(J.name))return!1}if(j.matchEcosystems?.length&&!j.matchEcosystems.includes(W(J)))return!1;if(j.matchDepTypes?.length&&!j.matchDepTypes.includes(J.dependencyType))return!1;if(j.matchUpdateTypes?.length&&!j.matchUpdateTypes.includes(J.updateType))return!1;if(j.matchFiles?.length){if(!K(j.matchFiles).matches(J.file))return!1}if(j.matchCurrentVersion&&!E(J.currentVersion,j.matchCurrentVersion))return!1;if(j.schedule&&!C(j.schedule,U,j.scheduleTimezone))return!1;return!0}function E(j,J){let U=j.replace(/^[\^~>=<\s]+/,"").trim();return U?D(U,J):!1}function S(j,J=[],U=new Date){let B={enabled:!0,labels:[],reviewers:[],assignees:[],prPriority:0};for(let H of J){if(!A(H,j,U))continue;if(H.enabled!==void 0)B.enabled=H.enabled;if(H.strategy!==void 0)B.strategy=H.strategy;if(H.groupName!==void 0)B.groupName=H.groupName;if(H.autoMerge!==void 0)B.autoMerge=H.autoMerge;if(H.minimumReleaseAge!==void 0)B.minimumReleaseAge=H.minimumReleaseAge;if(H.prPriority!==void 0)B.prPriority=H.prPriority;if(H.autoMigrate!==void 0)B.autoMigrate=H.autoMigrate;for(let Q of H.labels??[])if(!B.labels.includes(Q))B.labels.push(Q);for(let Q of H.reviewers??[])if(!B.reviewers.includes(Q))B.reviewers.push(Q);for(let Q of H.assignees??[])if(!B.assignees.includes(Q))B.assignees.push(Q)}return B}function k(j,J=[],U=new Date){let B=[];for(let H of j){let Q=S(H,J,U);if(!Q.enabled)continue;if(Q.strategy&&!V(Q.strategy,H.updateType))continue;B.push({update:H,effects:Q})}return B}function T(j){let J=new Set,U=new Set,B=new Set,H=0;for(let Q of j)Q.labels.forEach((X)=>J.add(X)),Q.reviewers.forEach((X)=>U.add(X)),Q.assignees.forEach((X)=>B.add(X)),H=Math.max(H,Q.prPriority);return{labels:[...J],reviewers:[...U],assignees:[...B],autoMerge:j.length>0&&j.every((Q)=>Q.autoMerge===!0),prPriority:H,autoMigrate:j.some((Q)=>Q.autoMigrate===!0)}}function V(j,J){switch(j){case"all":return!0;case"major":return J==="major";case"minor":return J==="minor"||J==="patch";case"patch":return J==="patch"}}function b(j=[]){return j.map((J)=>({matchPackages:J.patterns,groupName:J.name,...J.strategy?{strategy:J.strategy}:{}}))}
3
- export{W as tf,A as uf,S as vf,k as wf,T as xf,V as yf,b as zf};
2
+ import{Vf as K}from"./chunk-7h8qjayv.js";import{og as D}from"./chunk-038mdwdf.js";var F=[[0,59],[0,23],[1,31],[1,12],[0,6]];function I(j,J){let[U,B]=F[J],H=new Set;for(let Q of j.split(",")){let[X,Z]=Q.split("/"),q=Z===void 0?1:Number(Z);if(!Number.isInteger(q)||q<1)return null;let $,G;if(X==="*")$=U,G=B;else if(X.includes("-")){let[Y,_]=X.split("-").map(Number);if(!Number.isInteger(Y)||!Number.isInteger(_))return null;$=Y,G=_}else{let Y=Number(X);if(!Number.isInteger(Y))return null;$=Y,G=Y}if($<U||G>B||$>G)return null;for(let Y=$;Y<=G;Y+=q)H.add(Y)}return H.size>0?H:null}function L(j){let J=j.trim().split(/\s+/);if(J.length!==5)return null;let U=J.map((Z,q)=>I(Z,q));if(U.some((Z)=>Z===null))return null;let[,B,H,Q,X]=U;return{hours:B,daysOfMonth:H,months:Q,daysOfWeek:X}}function N(j,J){if(!J)return{hour:j.getHours(),day:j.getDate(),month:j.getMonth()+1,weekday:j.getDay()};let U=new Intl.DateTimeFormat("en-US",{timeZone:J,hour:"numeric",hour12:!1,day:"numeric",month:"numeric",weekday:"short"}),B=Object.fromEntries(U.formatToParts(j).map((Q)=>[Q.type,Q.value])),H=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return{hour:Number(B.hour)%24,day:Number(B.day),month:Number(B.month),weekday:Math.max(0,H.indexOf(B.weekday))}}function C(j,J=new Date,U){let B=L(j);if(!B)return!1;let{hour:H,day:Q,month:X,weekday:Z}=N(J,U);if(!B.hours.has(H)||!B.months.has(X))return!1;let q=B.daysOfMonth.size<31,$=B.daysOfWeek.size<7;if(q&&$)return B.daysOfMonth.has(Q)||B.daysOfWeek.has(Z);return B.daysOfMonth.has(Q)&&B.daysOfWeek.has(Z)}function W(j){if(j.dependencyType==="github-actions")return"github-actions";if(j.dependencyType==="docker-image")return"docker";if(j.dependencyType==="zig-dependencies")return"zig";if(j.dependencyType==="python"||j.dependencyType==="rust"||j.dependencyType==="go"||j.dependencyType==="ruby")return j.dependencyType;if(j.file.endsWith("composer.json")||j.file.endsWith("composer.lock"))return"composer";if(j.file.endsWith("package.json"))return"npm";return"pkgx"}function A(j,J,U=new Date){if(j.matchPackages?.length){if(!K(j.matchPackages).matches(J.name))return!1}if(j.matchEcosystems?.length&&!j.matchEcosystems.includes(W(J)))return!1;if(j.matchDepTypes?.length&&!j.matchDepTypes.includes(J.dependencyType))return!1;if(j.matchUpdateTypes?.length&&!j.matchUpdateTypes.includes(J.updateType))return!1;if(j.matchFiles?.length){if(!K(j.matchFiles).matches(J.file))return!1}if(j.matchCurrentVersion&&!E(J.currentVersion,j.matchCurrentVersion))return!1;if(j.schedule&&!C(j.schedule,U,j.scheduleTimezone))return!1;return!0}function E(j,J){let U=j.replace(/^[\^~>=<\s]+/,"").trim();return U?D(U,J):!1}function S(j,J=[],U=new Date){let B={enabled:!0,labels:[],reviewers:[],assignees:[],prPriority:0};for(let H of J){if(!A(H,j,U))continue;if(H.enabled!==void 0)B.enabled=H.enabled;if(H.strategy!==void 0)B.strategy=H.strategy;if(H.groupName!==void 0)B.groupName=H.groupName;if(H.autoMerge!==void 0)B.autoMerge=H.autoMerge;if(H.minimumReleaseAge!==void 0)B.minimumReleaseAge=H.minimumReleaseAge;if(H.prPriority!==void 0)B.prPriority=H.prPriority;if(H.autoMigrate!==void 0)B.autoMigrate=H.autoMigrate;for(let Q of H.labels??[])if(!B.labels.includes(Q))B.labels.push(Q);for(let Q of H.reviewers??[])if(!B.reviewers.includes(Q))B.reviewers.push(Q);for(let Q of H.assignees??[])if(!B.assignees.includes(Q))B.assignees.push(Q)}return B}function k(j,J=[],U=new Date){let B=[];for(let H of j){let Q=S(H,J,U);if(!Q.enabled)continue;if(Q.strategy&&!V(Q.strategy,H.updateType))continue;B.push({update:H,effects:Q})}return B}function T(j){let J=new Set,U=new Set,B=new Set,H=0;for(let Q of j)Q.labels.forEach((X)=>J.add(X)),Q.reviewers.forEach((X)=>U.add(X)),Q.assignees.forEach((X)=>B.add(X)),H=Math.max(H,Q.prPriority);return{labels:[...J],reviewers:[...U],assignees:[...B],autoMerge:j.length>0&&j.every((Q)=>Q.autoMerge===!0),prPriority:H,autoMigrate:j.some((Q)=>Q.autoMigrate===!0)}}function V(j,J){switch(j){case"all":return!0;case"major":return J==="major";case"minor":return J==="minor"||J==="patch";case"patch":return J==="patch"}}function b(j=[]){return j.map((J)=>({matchPackages:J.patterns,groupName:J.name,...J.strategy?{strategy:J.strategy}:{}}))}
3
+ export{W as vf,A as wf,S as xf,k as yf,T as zf,V as Af,b as Bf};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var k=["buddy/","buddy-bot/"];function v(g){return typeof g==="string"&&k.some((j)=>g.startsWith(j))}
3
- export{v as Lh};
3
+ export{v as Nh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Fa as t,Ga as u}from"./chunk-t68hsq01.js";import{Ha as v,Ia as w,Ja as x,Ka as y,La as z,Ma as A,Na as B,Oa as C,Pa as D,Qa as E,Ra as F,Sa as G}from"./chunk-cqh3eadc.js";import{Ta as H,Ua as I,Va as J,Wa as K,Xa as L}from"./chunk-6njk0m4a.js";import"./chunk-nap5dm82.js";import"./chunk-b1ng5aqx.js";import{Cf as a,Df as b,Ef as c,Ff as d,Gf as e,Hf as f}from"./chunk-016ce171.js";import{If as g,Jf as h,Kf as i,Lf as j,Mf as k,Nf as l,Of as m,Pf as n,Qf as o,Rf as p,Sf as q,Tf as r,Uf as s}from"./chunk-fanj4t6c.js";import"./chunk-7h8qjayv.js";import"./chunk-zqrgvftj.js";import"./chunk-me7y4rd3.js";import"./chunk-7khgke9n.js";import"./chunk-kfn6xbc6.js";import"./chunk-91gpxfta.js";import"./chunk-xmqv24zr.js";export{i as writeFileTool,r as wrapUntrusted,F as withTouchOffer,I as verifyChanges,w as unitTestsTouch,J as stackedBranchName,y as simplifyTouch,n as shellTool,K as runStackedTouch,u as runPlan,s as runAgent,a as reviewMode,g as resolveWorkspacePath,D as renderTouchOffer,h as readFileTool,z as planTouch,d as planMode,G as parseTouchSelections,j as listDirTool,b as implementMode,E as hasTouchOffer,B as getFinishingTouch,f as getAgentMode,k as fsTools,c as fixCiMode,v as docstringsTouch,L as detectChangedFiles,t as createReadIssueTool,m as buildShellEnv,x as autofixTouch,q as Toolbelt,o as ToolPermissionError,C as TOUCH_OFFER_MARKER,H as TEST_COMMANDS,l as SHELL_ENV_ALLOWLIST,A as FINISHING_TOUCHES,p as BUILTIN_TOOLS,e as AGENT_MODES};
@@ -4,4 +4,4 @@ ${JSON.stringify(x)}
4
4
  -->`}function I(j){if(!j)return null;let x=j.match(B);if(!x)return null;try{let k=JSON.parse(x[2].trim());if(typeof k.reviewedSha!=="string")return null;return{schemaVersion:Number(k.schemaVersion)||1,reviewedSha:k.reviewedSha,fingerprints:Array.isArray(k.fingerprints)?k.fingerprints.filter((D)=>typeof D==="string"):[],reviewedAt:typeof k.reviewedAt==="string"?k.reviewedAt:new Date(0).toISOString(),...k.paused?{paused:!0}:{}}}catch{return null}}function J(j,x){return`${(j??"").replace(B,"").trimEnd()}
5
5
 
6
6
  ${F(x)}`}function L(j,x){if(j?.paused)return!1;return j?.reviewedSha!==x}
7
- export{H as Hb,F as Ib,I as Jb,J as Kb,L as Lb};
7
+ export{H as Jb,F as Kb,I as Lb,J as Mb,L as Nb};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Za as a}from"./chunk-s44q0cps.js";import"./chunk-s8apaa3h.js";import"./chunk-n5mvfhd0.js";import"./chunk-zbk3g5vf.js";import"./chunk-yknz94wd.js";import"./chunk-ep7hn1za.js";import"./chunk-yzyqkwsc.js";import"./chunk-m7v1dba6.js";import"./chunk-n7hbbha7.js";import"./chunk-9rvapdmv.js";import"./chunk-q31cbz9d.js";import"./chunk-g0ttytab.js";import"./chunk-dmqptf7k.js";import"./chunk-dz2e81v7.js";import"./chunk-we0x722x.js";import"./chunk-7523xqb9.js";import"./chunk-qeg388qq.js";import"./chunk-016ce171.js";import"./chunk-fanj4t6c.js";import"./chunk-7h8qjayv.js";import"./chunk-zqrgvftj.js";import"./chunk-me7y4rd3.js";import"./chunk-7khgke9n.js";import"./chunk-038mdwdf.js";import"./chunk-x496v9vb.js";import"./chunk-75rj89c2.js";import"./chunk-0cqhy9qh.js";import"./chunk-gt3m1eqn.js";import"./chunk-rad9rc2j.js";import"./chunk-kfn6xbc6.js";import"./chunk-91gpxfta.js";import"./chunk-nqgn0drz.js";import"./chunk-xmqv24zr.js";export{a as Scheduler};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Bh as g0}from"./chunk-7bqy4enq.js";import{Ch as f0}from"./chunk-r0jmwzr3.js";import{Qh as v}from"./chunk-sg7bhtb7.js";import{Wh as G}from"./chunk-rrm4x81p.js";import{exec as F$}from"child_process";import W from"fs";import r from"path";import E from"process";import{promisify as K$}from"util";import{existsSync as p0}from"fs";import t from"fs/promises";import V0 from"os";import o from"path";import x from"process";class j0{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let $=V0.homedir(),Q=o.join($,".config","clapp");this.configPath=o.join(Q,"telemetry.json")}async isEnabled(){if(x.env.DO_NOT_TRACK==="1"||x.env.DO_NOT_TRACK==="true")return!1;if(x.env.NO_TELEMETRY==="1"||x.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let $=await this.loadConfig();if($.enabled=!0,!$.userId)$.userId=this.generateUserId();await this.saveConfig($)}async disable(){let $=await this.loadConfig();$.enabled=!1,await this.saveConfig($)}async track($,Q){if(!await this.isEnabled())return;let z={event:$,...Q,timestamp:Date.now(),platform:V0.platform(),nodeVersion:x.version};if(this.events.push(z),this.events.length>=10)await this.send()}async trackCommand($,Q){await this.track("command",{command:$,duration:Q})}async trackError($,Q){await this.track("error",{error:$,command:Q})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let Q=await this.loadConfig();return Q.lastSent=Date.now(),await this.saveConfig(Q),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let Q=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(Q),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep($){return new Promise((Q)=>setTimeout(Q,$))}async status(){let $=await this.loadConfig();return{enabled:$.enabled,doNotTrack:x.env.DO_NOT_TRACK==="1"||x.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:$.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(p0(this.configPath)){let $=await t.readFile(this.configPath,"utf-8");return this.config=JSON.parse($),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig($){this.config=$;try{let Q=o.dirname(this.configPath);await t.mkdir(Q,{recursive:!0}),await t.writeFile(this.configPath,JSON.stringify($,null,2),"utf-8")}catch{}}generateUserId(){let $=Math.random().toString(36).substring(2,15),Q=Date.now().toString(36);return`${$}-${Q}`}}var i0=new j0;import{EventEmitter as n0}from"events";import R from"process";import W0 from"process";import Z0 from"process";import p from"process";import _ from"process";import O0 from"tty";import S1,{stdin as u$,stdout as c$}from"process";import B0,{stdin as _1,stdout as f1}from"process";import g1 from"readline";import $$ from"process";import{WriteStream as Q$}from"tty";function Q0($){return $.replace(/[<[].+/,"").trim()}function l0($){let Q=/<([^>]+)>/g,Z=/\[([^\]]+)\]/g,z=[],J=(F)=>{let X=!1,K=F[1];if(K.startsWith("..."))K=K.slice(3),X=!0;else if(K.endsWith("..."))K=K.slice(0,-3),X=!0;return{required:F[0].startsWith("<"),value:K.trim(),variadic:X}},Y;while(Y=Q.exec($))z.push(J(Y));let q;while(q=Z.exec($))z.push(J(q));return z}function a0($){let Q={alias:{},boolean:[]};for(let[Z,z]of $.entries()){if(z.names.length>1)Q.alias[z.names[0]]=z.names.slice(1);if(z.isBoolean)if(z.negated){if(!$.some((Y,q)=>{return q!==Z&&Y.names.some((F)=>z.names.includes(F))&&typeof Y.required==="boolean"}))Q.boolean.push(z.names[0])}else Q.boolean.push(z.names[0])}return Q}function M0($){return $.reduce((Q,Z)=>Q.length>=Z.length?Q:Z,"")}function e($,Q){return $.length>=Q?$:`${$}${" ".repeat(Q-$.length)}`}function c($){return $.replace(/([a-z])-([a-z])/g,(Q,Z,z)=>{return Z+z.toUpperCase()})}function r0($,Q,Z){let z=0,J=Q.length,Y=$,q;for(;z<J;++z)q=Y[Q[z]],Y=Y[Q[z]]=z===J-1?Z:q!=null?q:!!~Q[z+1].indexOf(".")||!(+Q[z+1]>-1)?{}:[]}function s0($,Q){for(let Z of Object.keys(Q)){let z=Q[Z];if($[Z]===void 0)continue;if(z.shouldTransform){if($[Z]=Array.prototype.concat.call([],$[Z]),typeof z.transformFunction==="function")$[Z]=$[Z].map(z.transformFunction)}}}function t0($){let Q=/([^\\/]+)$/.exec($);return Q?Q[1]:""}function f($){return $.split(".").map((Q,Z)=>{return Z===0?c(Q):Q}).join(".")}class g extends Error{exitCode=2;isUsageError=!0;usage;constructor($,Q){super($);if(this.name=this.constructor.name,Q!==void 0)this.usage=Q;if(typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error($).stack}format($=!1){if($&&this.stack)return`${this.message}
2
+ import{Dh as g0}from"./chunk-y5t07fny.js";import{Eh as f0}from"./chunk-gt3m1eqn.js";import{Sh as v}from"./chunk-kfn6xbc6.js";import{Yh as G}from"./chunk-91gpxfta.js";import{exec as F$}from"child_process";import W from"fs";import r from"path";import E from"process";import{promisify as K$}from"util";import{existsSync as p0}from"fs";import t from"fs/promises";import V0 from"os";import o from"path";import x from"process";class j0{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let $=V0.homedir(),Q=o.join($,".config","clapp");this.configPath=o.join(Q,"telemetry.json")}async isEnabled(){if(x.env.DO_NOT_TRACK==="1"||x.env.DO_NOT_TRACK==="true")return!1;if(x.env.NO_TELEMETRY==="1"||x.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let $=await this.loadConfig();if($.enabled=!0,!$.userId)$.userId=this.generateUserId();await this.saveConfig($)}async disable(){let $=await this.loadConfig();$.enabled=!1,await this.saveConfig($)}async track($,Q){if(!await this.isEnabled())return;let z={event:$,...Q,timestamp:Date.now(),platform:V0.platform(),nodeVersion:x.version};if(this.events.push(z),this.events.length>=10)await this.send()}async trackCommand($,Q){await this.track("command",{command:$,duration:Q})}async trackError($,Q){await this.track("error",{error:$,command:Q})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let Q=await this.loadConfig();return Q.lastSent=Date.now(),await this.saveConfig(Q),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let Q=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(Q),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep($){return new Promise((Q)=>setTimeout(Q,$))}async status(){let $=await this.loadConfig();return{enabled:$.enabled,doNotTrack:x.env.DO_NOT_TRACK==="1"||x.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:$.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(p0(this.configPath)){let $=await t.readFile(this.configPath,"utf-8");return this.config=JSON.parse($),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig($){this.config=$;try{let Q=o.dirname(this.configPath);await t.mkdir(Q,{recursive:!0}),await t.writeFile(this.configPath,JSON.stringify($,null,2),"utf-8")}catch{}}generateUserId(){let $=Math.random().toString(36).substring(2,15),Q=Date.now().toString(36);return`${$}-${Q}`}}var i0=new j0;import{EventEmitter as n0}from"events";import R from"process";import W0 from"process";import Z0 from"process";import p from"process";import _ from"process";import O0 from"tty";import S1,{stdin as u$,stdout as c$}from"process";import B0,{stdin as _1,stdout as f1}from"process";import g1 from"readline";import $$ from"process";import{WriteStream as Q$}from"tty";function Q0($){return $.replace(/[<[].+/,"").trim()}function l0($){let Q=/<([^>]+)>/g,Z=/\[([^\]]+)\]/g,z=[],J=(F)=>{let X=!1,K=F[1];if(K.startsWith("..."))K=K.slice(3),X=!0;else if(K.endsWith("..."))K=K.slice(0,-3),X=!0;return{required:F[0].startsWith("<"),value:K.trim(),variadic:X}},Y;while(Y=Q.exec($))z.push(J(Y));let q;while(q=Z.exec($))z.push(J(q));return z}function a0($){let Q={alias:{},boolean:[]};for(let[Z,z]of $.entries()){if(z.names.length>1)Q.alias[z.names[0]]=z.names.slice(1);if(z.isBoolean)if(z.negated){if(!$.some((Y,q)=>{return q!==Z&&Y.names.some((F)=>z.names.includes(F))&&typeof Y.required==="boolean"}))Q.boolean.push(z.names[0])}else Q.boolean.push(z.names[0])}return Q}function M0($){return $.reduce((Q,Z)=>Q.length>=Z.length?Q:Z,"")}function e($,Q){return $.length>=Q?$:`${$}${" ".repeat(Q-$.length)}`}function c($){return $.replace(/([a-z])-([a-z])/g,(Q,Z,z)=>{return Z+z.toUpperCase()})}function r0($,Q,Z){let z=0,J=Q.length,Y=$,q;for(;z<J;++z)q=Y[Q[z]],Y=Y[Q[z]]=z===J-1?Z:q!=null?q:!!~Q[z+1].indexOf(".")||!(+Q[z+1]>-1)?{}:[]}function s0($,Q){for(let Z of Object.keys(Q)){let z=Q[Z];if($[Z]===void 0)continue;if(z.shouldTransform){if($[Z]=Array.prototype.concat.call([],$[Z]),typeof z.transformFunction==="function")$[Z]=$[Z].map(z.transformFunction)}}}function t0($){let Q=/([^\\/]+)$/.exec($);return Q?Q[1]:""}function f($){return $.split(".").map((Q,Z)=>{return Z===0?c(Q):Q}).join(".")}class g extends Error{exitCode=2;isUsageError=!0;usage;constructor($,Q){super($);if(this.name=this.constructor.name,Q!==void 0)this.usage=Q;if(typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error($).stack}format($=!1){if($&&this.stack)return`${this.message}
3
3
 
4
4
  Stack trace:
5
5
  ${this.stack}`;return this.message}}function o0($){if($ instanceof g)return!0;return!!$&&typeof $==="object"&&$.name==="ClappError"&&typeof $.message==="string"}function e0(){let{env:$}=W0,{TERM:Q,TERM_PROGRAM:Z}=$;if(W0.platform!=="win32")return Q!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||Z==="Terminus-Sublime"||Z==="vscode"||Q==="xterm-256color"||Q==="alacritty"||Q==="rxvt-unicode"||Q==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var n="\x1B",B=`${n}[`;var L={to($,Q){if(!Q)return`${B}${$+1}G`;return`${B}${Q+1};${$+1}H`},move($,Q){let Z="";if($<0)Z+=`${B}${-$}D`;else if($>0)Z+=`${B}${$}C`;if(Q<0)Z+=`${B}${-Q}A`;else if(Q>0)Z+=`${B}${Q}B`;return Z},up:($=1)=>`${B}${$}A`,down:($=1)=>`${B}${$}B`,forward:($=1)=>`${B}${$}C`,backward:($=1)=>`${B}${$}D`,nextLine:($=1)=>`${B}E`.repeat($),prevLine:($=1)=>`${B}F`.repeat($),left:`${B}G`,hide:`${B}?25l`,show:`${B}?25h`,save:`${n}7`,restore:`${n}8`};var $0={screen:`${B}2J`,up:($=1)=>`${B}1J`.repeat($),down:($=1)=>`${B}J`.repeat($),line:`${B}2K`,lineEnd:`${B}K`,lineStart:`${B}1K`,lines($){let Q="";for(let Z=0;Z<$;Z++)Q+=this.line+(Z<$-1?L.up():"");if($)Q+=L.left;return Q}},S$={screen:`${n}c`};function $1($,Q){let Z=[];for(let z=0;z<=Q.length;z++)Z[z]=[z];for(let z=0;z<=$.length;z++)Z[0][z]=z;for(let z=1;z<=Q.length;z++)for(let J=1;J<=$.length;J++)if(Q.charAt(z-1)===$.charAt(J-1))Z[z][J]=Z[z-1][J-1];else Z[z][J]=Math.min(Z[z-1][J-1]+1,Z[z][J-1]+1,Z[z-1][J]+1);return Z[Q.length][$.length]}function E0($,Q,Z=2,z=3){return Q.map((J)=>({cmd:J,distance:$1($,J)})).filter(({distance:J})=>J<=Z).sort((J,Y)=>J.distance-Y.distance).slice(0,z).map(({cmd:J})=>J)}function Q1($,Q={}){let Z={_:[]},z=Q.alias||{},J=new Set(Q.boolean||[]),Y={};for(let X of Object.keys(z))for(let K of z[X])Y[K]=X;for(let X of J)if(z[X])for(let K of z[X])J.add(K);function q(X,K){if(X===void 0)return K;if(typeof K==="boolean")return K;return Array.isArray(X)?[...X,K]:[X,K]}function F(X,K){let H=Y[X]||X,j=q(Z[H],K);if(Z[H]=j,z[H])for(let V of z[H])Z[V]=j;if(Y[X]&&z[Y[X]])for(let V of z[Y[X]])Z[V]=j;Z[X]=j}for(let X=0;X<$.length;X++){let K=$[X];if(K==="--"){Z._.push(...$.slice(X+1));break}if(K.startsWith("--")){let H=K.indexOf("=");if(H!==-1){let j=c(K.slice(2,H)),V=K.slice(H+1);F(j,V)}else{let j=K.slice(2);if(j.startsWith("no-")){let M=c(j.slice(3));F(M,!1);continue}let V=c(j),D=Y[V]||V;if(J.has(D)||J.has(V))F(V,!0);else{let M=$[X+1];if(M!==void 0&&!M.startsWith("-"))F(V,M),X++;else F(V,!0)}}}else if(K.startsWith("-")&&K.length>1){let H=K.slice(1);for(let j=0;j<H.length;j++){let V=H[j],D=Y[V]||V;if(j===H.length-1&&!J.has(D)&&!J.has(V)){let M=$[X+1];if(M!==void 0&&!M.startsWith("-"))F(V,M),X++;else F(V,!0)}else F(V,!0)}}else Z._.push(K)}return Z}class w0{rawName;description;name;names;isBoolean;required;config;negated;variadic;constructor($,Q,Z){if(this.rawName=$,this.description=Q,this.config=Object.assign({},Z),$=$.replace(/\.\*/g,""),this.negated=!1,this.variadic=/[<[](?:\.\.\.[^\]>]+|[^\]>]+\.\.\.)[\]>]/.test($),this.names=Q0($).split(",").map((z)=>{let J=z.trim().replace(/^-{1,2}/,"");if(J.startsWith("no-"))this.negated=!0,J=J.replace(/^no-/,"");return f(J)}).sort((z,J)=>z.length>J.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if($.includes("<"))this.required=!0;else if($.includes("["))this.required=!1;else this.isBoolean=!0}}var y$=Z0.argv,Z1=`${Z0.platform}-${Z0.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,N0=p.argv,z1=`${p.platform}-${p.arch} node-${p.version}`;class q0{rawName;description;config;cli;options;aliasNames;name;namespace;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;beforeHooks;afterHooks;middleware;constructor($,Q,Z,z){this.rawName=$,this.description=Q,this.config=Z,this.cli=z,this.options=[],this.aliasNames=[],this.name=Q0($);let J=Q0($),Y=J.indexOf(":");if(Y>0)this.namespace=J.substring(0,Y),this.name=J.substring(Y+1);if(this.args=l0($),this.examples=[],this.beforeHooks=[],this.afterHooks=[],this.middleware=[],!Z)this.config={}}usage($){return this.usageText=$,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version($,Q="-v, --version"){return this.versionNumber=$,this.option(Q,"Display version number"),this}example($){return this.examples.push($),this}option($,Q,Z){let z=new w0($,Q,Z);return this.options.push(z),this}alias($){return this.aliasNames.push($),this}action($){return this.commandAction=$,this}before($){return this.beforeHooks.push($),this}after($){return this.afterHooks.push($),this}use($){return this.middleware.push($),this}isMatched($){if(this.aliasNames.includes($))return!0;if(this.namespace)return`${this.namespace}:${this.name}`===$;return this.name===$}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof X0}get displayName(){return this.namespace?`${this.namespace}:${this.name}`:this.name}hasOption($){let Q=f($.split(".")[0]);return!!this.options.find((Z)=>{return Z.names.some((z)=>f(z)===Q)})}outputHelp(){let{name:$,commands:Q}=this.cli,{versionNumber:Z,options:z,helpCallback:J}=this.cli.globalCommand,Y=[{body:`${$}${Z?`/${Z}`:""}`}];if(Y.push({title:"Usage",body:` $ ${$} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&Q.length>0){let K=M0(Q.map((M)=>M.rawName)),H=new Map,j=[];for(let M of Q)if(M.namespace){if(!H.has(M.namespace))H.set(M.namespace,[]);H.get(M.namespace).push(M)}else j.push(M);let V="";if(j.sort((M,I)=>M.rawName<I.rawName?-1:M.rawName>I.rawName?1:0),j.length>0)V+=j.map((M)=>{return` ${e(M.rawName,K.length)} ${M.description}`}).join(`
@@ -1040,4 +1040,4 @@ ${Q}:`),$.errors.length>0)G().info("\u274C Errors:"),$.errors.forEach((Z)=>G().i
1040
1040
  2. \u26A0\uFE0F Using default GITHUB_TOKEN (limited functionality):`),G().info(" \u2022 Dependency updates: \u2705 Will work"),G().info(" \u2022 Dashboard creation: \u2705 Will work"),G().info(" \u2022 Workflow file updates: \u274C Won't work"),G().info(" \uD83D\uDCA1 Consider setting up a Personal Access Token later for full functionality");G().info(`
1041
1041
  3. \uD83D\uDD27 Configure repository permissions:`),G().info(` - Go to: https://github.com/${$.owner}/${$.name}/settings/actions`),G().info(' - Under "Workflow permissions":'),G().info(' \u2705 Select "Read and write permissions"'),G().info(' \u2705 Check "Allow GitHub Actions to create and approve pull requests"'),G().info(' - Click "Save"'),G().info(`
1042
1042
  \uD83C\uDF89 Setup Complete!`),G().info("\uD83D\uDCA1 Your workflows will now run automatically on schedule!"),G().info("\uD83D\uDCCA First dashboard update will appear within 24 hours"),G().info("\uD83D\uDD17 Learn more: https://docs.github.com/en/actions")}
1043
- export{v0 as _g,q$ as $g,X$ as ah,y0 as bh,X1 as ch,a as dh,m as eh,G$ as fh,V$ as gh,DQ as hh,EQ as ih,wQ as jh,LQ as kh,IQ as lh,j$ as mh,RQ as nh,AQ as oh,CQ as ph,xQ as qh,hQ as rh,m0 as sh,D$ as th,bQ as uh,d0 as vh,kQ as wh,SQ as xh,vQ as yh,yQ as zh,_Q as Ah};
1043
+ export{v0 as ah,q$ as bh,X$ as ch,y0 as dh,X1 as eh,a as fh,m as gh,G$ as hh,V$ as ih,DQ as jh,EQ as kh,wQ as lh,LQ as mh,IQ as nh,j$ as oh,RQ as ph,AQ as qh,CQ as rh,xQ as sh,hQ as th,m0 as uh,D$ as vh,bQ as wh,d0 as xh,kQ as yh,SQ as zh,vQ as Ah,yQ as Bh,_Q as Ch};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{pd as Z}from"./chunk-z906zp4k.js";import{Uh as _}from"./chunk-rrm4x81p.js";import Y from"process";class L{jobs=new Map;timers=new Map;logger;isRunning=!1;constructor(q=!1){this.logger=q?_.verbose():_.quiet()}addJob(q){this.jobs.set(q.id,q),this.scheduleJob(q),this.logger.info(`Scheduled job '${q.name}' with cron: ${q.schedule.cron}`)}removeJob(q){let C=this.timers.get(q);if(C)clearTimeout(C),this.timers.delete(q);this.jobs.delete(q),this.logger.info(`Removed scheduled job: ${q}`)}start(){if(this.isRunning){this.logger.warn("Scheduler is already running");return}this.isRunning=!0,this.logger.info("\uD83D\uDD52 Buddy Scheduler started");for(let q of this.jobs.values())if(this.scheduleJob(q),q.schedule.runOnStartup)this.logger.info(`Running startup job: ${q.name}`),setImmediate(()=>this.runJob(q));Y.on("SIGINT",()=>this.stop()),Y.on("SIGTERM",()=>this.stop())}stop(){if(!this.isRunning)return;this.isRunning=!1,this.logger.info("\uD83D\uDED1 Stopping Buddy Scheduler...");for(let q of this.timers.values())clearTimeout(q);this.timers.clear(),this.logger.success("\u2705 Buddy Scheduler stopped"),Y.exit(0)}getJobStatus(q){return this.jobs.get(q)}getAllJobs(){return Array.from(this.jobs.values())}scheduleJob(q){let C=this.timers.get(q.id);if(C)clearTimeout(C);let D=this.getNextRunTime(q.schedule.cron,q.schedule.timezone);if(q.nextRun=D||void 0,D){let G=D.getTime()-Date.now(),F=setTimeout(()=>{this.runJob(q),this.scheduleJob(q)},G);this.timers.set(q.id,F),this.logger.debug(`Job '${q.name}' scheduled for ${D.toISOString()}`)}}async runJob(q){if(q.status==="running"){this.logger.warn(`Job '${q.name}' is already running, skipping`);return}q.status="running",q.lastRun=new Date,this.logger.info(`\uD83D\uDE80 Running scheduled job: ${q.name}`);let C=Date.now(),D=q.schedule.maxRuntime||1800000;try{let G=new Promise((Q,U)=>{setTimeout(()=>U(Error("Job timeout")),D)}),F=this.executeJob(q);await Promise.race([F,G]);let J=Date.now()-C;q.status="idle",this.logger.success(`\u2705 Job '${q.name}' completed in ${J}ms`)}catch(G){q.status="error",this.logger.error(`\u274C Job '${q.name}' failed:`,G)}}async executeJob(q){let C=new Z(q.config),D=await C.scanForUpdates();if(D.updates.length===0){this.logger.info("No dependency updates found");return}if(this.logger.info(`Found ${D.updates.length} dependency updates`),q.config.repository&&q.config.pullRequest)await C.createPullRequests(D),this.logger.success(`Created pull requests for ${D.groups.length} update groups`);else this.logger.info("Repository not configured, skipping PR creation")}getNextRunTime(q,C){try{return this.parseCronExpression(q,C)}catch(D){return this.logger.error(`Invalid cron expression '${q}':`,D),null}}parseCronExpression(q,C){let D=q.trim().split(/\s+/);if(D.length!==5)throw Error("Cron expression must have 5 parts: minute hour day month dayOfWeek");let[G,F,J,Q,U]=D,K=new Date,V=C?this.timezoneOffsetMinutes(K,C):0;if(C)this.logger.debug(`Using timezone: ${C} (offset ${V} minutes)`);let X=new Date(K.getTime()+V*60*1000);X.setSeconds(0,0);let $=this.parseCronField(F,0,23),B=this.parseCronField(G,0,59);if($.length>0&&B.length>0){if(X.setHours($[0],B[0],0,0),X.getTime()-V*60*1000<=K.getTime())X.setDate(X.getDate()+1);return new Date(X.getTime()-V*60*1000)}return new Date(K.getTime()+3600000)}timezoneOffsetMinutes(q,C){try{let D=new Date(q.toLocaleString("en-US",{timeZone:C})),G=new Date(q.toLocaleString("en-US"));return Math.round((D.getTime()-G.getTime())/60000)}catch{return this.logger.warn(`\u26A0\uFE0F Unknown timezone "${C}", scheduling in host time instead`),0}}parseCronField(q,C,D){if(q==="*")return Array.from({length:D-C+1},(F,J)=>C+J);if(q.includes(","))return q.split(",").map(Number).filter((F)=>Number.isFinite(F)&&F>=C&&F<=D);if(q.includes("-")){let F=q.split("-").map(Number),J=F[0],Q=F[1];if(F.length!==2||!Number.isFinite(J)||!Number.isFinite(Q)||Q<J)return[];return Array.from({length:Q-J+1},(U,K)=>J+K).filter((U)=>U>=C&&U<=D)}if(q.includes("/")){let[F,J]=q.split("/"),Q=Number(J);if(!Number.isFinite(Q)||Q<=0)return[];if(F==="*")return Array.from({length:D-C+1},(K,V)=>C+V).filter((K,V)=>V%Q===0);let U=Number(F);return Number.isFinite(U)?[U].filter((K)=>K>=C&&K<=D):[]}let G=Number(q);return Number.isFinite(G)&&G>=C&&G<=D?[G]:[]}static createJobFromConfig(q,C="default"){let D={cron:q.schedule?.cron||"0 2 * * 1",timezone:q.schedule?.timezone,runOnStartup:!1,maxRuntime:1800000};return{id:C,name:`Buddy Dependency Updates (${C})`,schedule:D,status:"idle",config:q}}static PRESETS={DAILY:"0 2 * * *",WEEKLY:"0 2 * * 1",WEEKDAYS:"0 2 * * 1-5",TWICE_WEEKLY:"0 2 * * 1,4",MONTHLY:"0 2 1 * *",HOURLY:"0 * * * *",CUSTOM:(q,C,D="*")=>`${q} ${C} * * ${D}`}}
3
- export{L as Xa};
2
+ import{rd as Z}from"./chunk-s8apaa3h.js";import{Wh as _}from"./chunk-91gpxfta.js";import Y from"process";class L{jobs=new Map;timers=new Map;logger;isRunning=!1;constructor(q=!1){this.logger=q?_.verbose():_.quiet()}addJob(q){this.jobs.set(q.id,q),this.scheduleJob(q),this.logger.info(`Scheduled job '${q.name}' with cron: ${q.schedule.cron}`)}removeJob(q){let C=this.timers.get(q);if(C)clearTimeout(C),this.timers.delete(q);this.jobs.delete(q),this.logger.info(`Removed scheduled job: ${q}`)}start(){if(this.isRunning){this.logger.warn("Scheduler is already running");return}this.isRunning=!0,this.logger.info("\uD83D\uDD52 Buddy Scheduler started");for(let q of this.jobs.values())if(this.scheduleJob(q),q.schedule.runOnStartup)this.logger.info(`Running startup job: ${q.name}`),setImmediate(()=>this.runJob(q));Y.on("SIGINT",()=>this.stop()),Y.on("SIGTERM",()=>this.stop())}stop(){if(!this.isRunning)return;this.isRunning=!1,this.logger.info("\uD83D\uDED1 Stopping Buddy Scheduler...");for(let q of this.timers.values())clearTimeout(q);this.timers.clear(),this.logger.success("\u2705 Buddy Scheduler stopped"),Y.exit(0)}getJobStatus(q){return this.jobs.get(q)}getAllJobs(){return Array.from(this.jobs.values())}scheduleJob(q){let C=this.timers.get(q.id);if(C)clearTimeout(C);let D=this.getNextRunTime(q.schedule.cron,q.schedule.timezone);if(q.nextRun=D||void 0,D){let G=D.getTime()-Date.now(),F=setTimeout(()=>{this.runJob(q),this.scheduleJob(q)},G);this.timers.set(q.id,F),this.logger.debug(`Job '${q.name}' scheduled for ${D.toISOString()}`)}}async runJob(q){if(q.status==="running"){this.logger.warn(`Job '${q.name}' is already running, skipping`);return}q.status="running",q.lastRun=new Date,this.logger.info(`\uD83D\uDE80 Running scheduled job: ${q.name}`);let C=Date.now(),D=q.schedule.maxRuntime||1800000;try{let G=new Promise((Q,U)=>{setTimeout(()=>U(Error("Job timeout")),D)}),F=this.executeJob(q);await Promise.race([F,G]);let J=Date.now()-C;q.status="idle",this.logger.success(`\u2705 Job '${q.name}' completed in ${J}ms`)}catch(G){q.status="error",this.logger.error(`\u274C Job '${q.name}' failed:`,G)}}async executeJob(q){let C=new Z(q.config),D=await C.scanForUpdates();if(D.updates.length===0){this.logger.info("No dependency updates found");return}if(this.logger.info(`Found ${D.updates.length} dependency updates`),q.config.repository&&q.config.pullRequest)await C.createPullRequests(D),this.logger.success(`Created pull requests for ${D.groups.length} update groups`);else this.logger.info("Repository not configured, skipping PR creation")}getNextRunTime(q,C){try{return this.parseCronExpression(q,C)}catch(D){return this.logger.error(`Invalid cron expression '${q}':`,D),null}}parseCronExpression(q,C){let D=q.trim().split(/\s+/);if(D.length!==5)throw Error("Cron expression must have 5 parts: minute hour day month dayOfWeek");let[G,F,J,Q,U]=D,K=new Date,V=C?this.timezoneOffsetMinutes(K,C):0;if(C)this.logger.debug(`Using timezone: ${C} (offset ${V} minutes)`);let X=new Date(K.getTime()+V*60*1000);X.setSeconds(0,0);let $=this.parseCronField(F,0,23),B=this.parseCronField(G,0,59);if($.length>0&&B.length>0){if(X.setHours($[0],B[0],0,0),X.getTime()-V*60*1000<=K.getTime())X.setDate(X.getDate()+1);return new Date(X.getTime()-V*60*1000)}return new Date(K.getTime()+3600000)}timezoneOffsetMinutes(q,C){try{let D=new Date(q.toLocaleString("en-US",{timeZone:C})),G=new Date(q.toLocaleString("en-US"));return Math.round((D.getTime()-G.getTime())/60000)}catch{return this.logger.warn(`\u26A0\uFE0F Unknown timezone "${C}", scheduling in host time instead`),0}}parseCronField(q,C,D){if(q==="*")return Array.from({length:D-C+1},(F,J)=>C+J);if(q.includes(","))return q.split(",").map(Number).filter((F)=>Number.isFinite(F)&&F>=C&&F<=D);if(q.includes("-")){let F=q.split("-").map(Number),J=F[0],Q=F[1];if(F.length!==2||!Number.isFinite(J)||!Number.isFinite(Q)||Q<J)return[];return Array.from({length:Q-J+1},(U,K)=>J+K).filter((U)=>U>=C&&U<=D)}if(q.includes("/")){let[F,J]=q.split("/"),Q=Number(J);if(!Number.isFinite(Q)||Q<=0)return[];if(F==="*")return Array.from({length:D-C+1},(K,V)=>C+V).filter((K,V)=>V%Q===0);let U=Number(F);return Number.isFinite(U)?[U].filter((K)=>K>=C&&K<=D):[]}let G=Number(q);return Number.isFinite(G)&&G>=C&&G<=D?[G]:[]}static createJobFromConfig(q,C="default"){let D={cron:q.schedule?.cron||"0 2 * * 1",timezone:q.schedule?.timezone,runOnStartup:!1,maxRuntime:1800000};return{id:C,name:`Buddy Dependency Updates (${C})`,schedule:D,status:"idle",config:q}}static PRESETS={DAILY:"0 2 * * *",WEEKLY:"0 2 * * 1",WEEKDAYS:"0 2 * * 1-5",TWICE_WEEKLY:"0 2 * * 1,4",MONTHLY:"0 2 1 * *",HOURLY:"0 * * * *",CUSTOM:(q,C,D="*")=>`${q} ${C} * * ${D}`}}
3
+ export{L as Za};