@buddysh/buddy 0.11.11 → 0.11.13
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.
- package/CHANGELOG.md +28 -0
- package/bin/cli.ts +5 -8
- package/dist/bin/cli.js +74 -74
- package/dist/{chunk-raj75r4h.js → chunk-01d81hn0.js} +1 -1
- package/dist/{chunk-z05djfac.js → chunk-028354j6.js} +7 -7
- package/dist/chunk-0w6jmcsh.js +2 -0
- package/dist/{chunk-3c114myc.js → chunk-1tdkpeva.js} +1 -1
- package/dist/{chunk-2e4e6zjs.js → chunk-1znpbjrv.js} +1 -1
- package/dist/{chunk-0g4ybxwj.js → chunk-2b07w74s.js} +1 -1
- package/dist/{chunk-42xvqxdw.js → chunk-2z85fqdp.js} +2 -2
- package/dist/{chunk-b9szrnxw.js → chunk-34vracy4.js} +1 -1
- package/dist/chunk-3578axtf.js +2 -0
- package/dist/{chunk-2jjrxgs1.js → chunk-37zd94a7.js} +2 -2
- package/dist/{chunk-pq115qkn.js → chunk-3a5gcj3y.js} +1 -1
- package/dist/{chunk-1xe0960b.js → chunk-3a63hke8.js} +1 -1
- package/dist/{chunk-dsnd6ndd.js → chunk-3nn2j810.js} +1 -1
- package/dist/chunk-3r0jb90q.js +2 -0
- package/dist/{chunk-ycbk7tg9.js → chunk-4fh7w98z.js} +1 -1
- package/dist/{chunk-sxfk3naz.js → chunk-4kyxrwxn.js} +1 -1
- package/dist/{chunk-vtr2vbk0.js → chunk-4qv88x27.js} +1 -1
- package/dist/chunk-4x1mv7qj.js +2 -0
- package/dist/{chunk-d9m42wym.js → chunk-54hdfa8r.js} +1 -1
- package/dist/{chunk-va3k91tf.js → chunk-5sh69bkj.js} +1 -1
- package/dist/{chunk-g0x10e1d.js → chunk-66nntsnf.js} +1 -1
- package/dist/chunk-6hyrj0b5.js +2 -0
- package/dist/{chunk-mt53v4sx.js → chunk-6np84pfr.js} +1 -1
- package/dist/{chunk-hc651afv.js → chunk-6prz7chv.js} +1 -1
- package/dist/{chunk-bsh3kp53.js → chunk-6qw89f68.js} +1 -1
- package/dist/{chunk-mpb1g0xk.js → chunk-7b156stw.js} +1 -1
- package/dist/{chunk-2z9pkk1y.js → chunk-7t8s2mcf.js} +1 -1
- package/dist/{chunk-25sjd6zk.js → chunk-83srz04v.js} +4 -4
- package/dist/chunk-86xv8x00.js +2 -0
- package/dist/chunk-87k997bm.js +2 -0
- package/dist/chunk-8jvmqdvc.js +2 -0
- package/dist/{chunk-gpjde0j6.js → chunk-92gh2n65.js} +1 -1
- package/dist/{chunk-54er1whp.js → chunk-94tnmc7j.js} +2 -2
- package/dist/{chunk-csqh2ca4.js → chunk-9n1kth4b.js} +1 -1
- package/dist/{chunk-z4btj7s0.js → chunk-a6hv92fx.js} +1 -1
- package/dist/{chunk-rr8apsh5.js → chunk-awjm9n45.js} +1 -1
- package/dist/{chunk-2hb8dan0.js → chunk-bgw39afd.js} +1 -1
- package/dist/{chunk-wt83nzn3.js → chunk-bstgsak0.js} +1 -1
- package/dist/{chunk-33h1me7n.js → chunk-c4cj24qm.js} +2 -2
- package/dist/chunk-c8xfj0m5.js +2 -0
- package/dist/{chunk-08daxhzx.js → chunk-c9266b5x.js} +1 -1
- package/dist/{chunk-4kr6evh6.js → chunk-ce26jarj.js} +1 -1
- package/dist/chunk-cj5fkyxv.js +2 -0
- package/dist/{chunk-7c1284fb.js → chunk-cx89kty3.js} +1 -1
- package/dist/chunk-d3m5kcpp.js +2 -0
- package/dist/{chunk-vs68hsbp.js → chunk-dg2q6egm.js} +1 -1
- package/dist/{chunk-8swwcx7w.js → chunk-dkhherd0.js} +1 -1
- package/dist/{chunk-qdr900z7.js → chunk-dq681xgx.js} +1 -1
- package/dist/{chunk-ktn47bq8.js → chunk-drmk6r1m.js} +1 -1
- package/dist/{chunk-5jvde2as.js → chunk-ebnc6980.js} +1 -1
- package/dist/{chunk-gweqk008.js → chunk-edm12hnb.js} +1 -1
- package/dist/{chunk-naz864cb.js → chunk-eh71jv8w.js} +1 -1
- package/dist/{chunk-40pvn33p.js → chunk-ekf183jk.js} +1 -1
- package/dist/{chunk-jhz202wk.js → chunk-fgec04jx.js} +1 -1
- package/dist/chunk-fzfgvt8s.js +2 -0
- package/dist/{chunk-dd895pm0.js → chunk-gcwg4b2w.js} +1 -1
- package/dist/{chunk-w55x2g9n.js → chunk-gjhxc6ma.js} +1 -1
- package/dist/{chunk-q7y8dvbz.js → chunk-hc2pdv4j.js} +1 -1
- package/dist/chunk-j21m6rf6.js +2 -0
- package/dist/{chunk-0m1z85m9.js → chunk-j6bejzk9.js} +1 -1
- package/dist/{chunk-vpw7adwd.js → chunk-j6geg3qt.js} +1 -1
- package/dist/{chunk-ry5zh9cx.js → chunk-j7qktvpg.js} +1 -1
- package/dist/chunk-jjwxbcfz.js +2 -0
- package/dist/{chunk-nkztawjh.js → chunk-jkn2sdm0.js} +1 -1
- package/dist/{chunk-apdrg3r7.js → chunk-jn3t9v6d.js} +1 -1
- package/dist/{chunk-b3s185kp.js → chunk-k907b533.js} +1 -1
- package/dist/{chunk-zk8zdv23.js → chunk-kjhqe26r.js} +1 -1
- package/dist/chunk-kkh3q0s2.js +2 -0
- package/dist/chunk-ksngk47a.js +2 -0
- package/dist/{chunk-y3w8h4sy.js → chunk-m00hfvnp.js} +1 -1
- package/dist/{chunk-65by8f14.js → chunk-m8brd9b5.js} +1 -1
- package/dist/{chunk-wjfw6rx8.js → chunk-ma01xp3y.js} +1 -1
- package/dist/{chunk-5pheqk23.js → chunk-mg67hhgj.js} +1 -1
- package/dist/{chunk-62j8q7sg.js → chunk-n5mz7csc.js} +1 -1
- package/dist/chunk-nd780ymh.js +2 -0
- package/dist/chunk-ngzrrqy2.js +2 -0
- package/dist/{chunk-afstgmb4.js → chunk-nn5rzwty.js} +1 -1
- package/dist/{chunk-esm5jjgf.js → chunk-p16pnhj3.js} +1 -1
- package/dist/{chunk-k3r7v3dp.js → chunk-p2h2z6d3.js} +2 -2
- package/dist/{chunk-yqfwvk9z.js → chunk-pg32mf9k.js} +1 -1
- package/dist/{chunk-5vekh5w1.js → chunk-q7709hwk.js} +1 -1
- package/dist/{chunk-vmt1bed1.js → chunk-q99xd3m5.js} +1 -1
- package/dist/{chunk-a3zgenkh.js → chunk-qcvtp2mt.js} +1 -1
- package/dist/{chunk-7b4jsg36.js → chunk-qjzpzd7j.js} +1 -1
- package/dist/{chunk-0rbxek2f.js → chunk-rwz433q2.js} +2 -2
- package/dist/{chunk-gzkwszsg.js → chunk-s5czyzje.js} +3 -3
- package/dist/{chunk-pegk4jhq.js → chunk-s609kp6h.js} +1 -1
- package/dist/{chunk-kbvj6qxc.js → chunk-s82adeq9.js} +1 -1
- package/dist/{chunk-59993g25.js → chunk-sn0qr6q7.js} +1 -1
- package/dist/{chunk-nbyxgt9c.js → chunk-t5hq4ke1.js} +1 -1
- package/dist/{chunk-77qe887p.js → chunk-t879n4ab.js} +1 -1
- package/dist/chunk-tmzd2p2n.js +2 -0
- package/dist/chunk-tqsrr90t.js +2 -0
- package/dist/{chunk-be7g40yf.js → chunk-v808b36p.js} +1 -1
- package/dist/chunk-v9avf6sc.js +2 -0
- package/dist/chunk-w2vsf1q0.js +2 -0
- package/dist/{chunk-89jytkd6.js → chunk-wf1jcxtr.js} +1 -1
- package/dist/chunk-wjmrh1nv.js +2 -0
- package/dist/{chunk-jsf2322c.js → chunk-x9qhsyp6.js} +2 -2
- package/dist/chunk-x9vpk4kk.js +7 -0
- package/dist/{chunk-h8wskvjv.js → chunk-xhn5331s.js} +1 -1
- package/dist/{chunk-b6a5txek.js → chunk-y1d6e0ye.js} +1 -1
- package/dist/{chunk-kq0n3x2e.js → chunk-ym9475ry.js} +1 -1
- package/dist/chunk-yrr9hqvw.js +2 -0
- package/dist/chunk-zcsahxe6.js +2 -0
- package/dist/chunk-zpgm9yzy.js +2 -0
- package/dist/{chunk-ddky3026.js → chunk-zrec546r.js} +1 -1
- package/dist/{chunk-x1w6q9tk.js → chunk-zwtx6vn3.js} +1 -1
- package/dist/chunk-zy49dwqk.js +44 -0
- package/dist/src/index.js +1 -1
- package/dist/src/pr/pr-manifest.d.ts +10 -0
- package/dist/src/setup.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-0m6b7bac.js +0 -2
- package/dist/chunk-0sm25gee.js +0 -2
- package/dist/chunk-18xha279.js +0 -2
- package/dist/chunk-1tx3t9ke.js +0 -2
- package/dist/chunk-1w1h2tsf.js +0 -2
- package/dist/chunk-2h90wcxe.js +0 -2
- package/dist/chunk-64kt1w23.js +0 -2
- package/dist/chunk-6gdenphk.js +0 -2
- package/dist/chunk-6pcnvdj9.js +0 -2
- package/dist/chunk-7m1ab6p8.js +0 -2
- package/dist/chunk-83yea9pk.js +0 -2
- package/dist/chunk-9exbsfz5.js +0 -2
- package/dist/chunk-b59zbkfx.js +0 -2
- package/dist/chunk-ffbbc38r.js +0 -2
- package/dist/chunk-hmymd6m2.js +0 -2
- package/dist/chunk-knpdntnh.js +0 -7
- package/dist/chunk-m1zv8db4.js +0 -2
- package/dist/chunk-m63hkte2.js +0 -2
- package/dist/chunk-njrezpsw.js +0 -2
- package/dist/chunk-qxf3f6ks.js +0 -2
- package/dist/chunk-rphwf28s.js +0 -2
- package/dist/chunk-sd5xqd44.js +0 -2
- package/dist/chunk-tbt8btwf.js +0 -2
- package/dist/chunk-tjvvb919.js +0 -2
- package/dist/chunk-vpsvtb9v.js +0 -2
- package/dist/chunk-xdrvb89m.js +0 -44
- package/dist/chunk-xxwevpnr.js +0 -2
- package/dist/chunk-yf01hyxn.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ac as m,Bc as n,Cc as o,Dc as p,Ec as q,Fc as r,Gc as s,Hc as t,Ic as u,oc as a,pc as b,qc as c,rc as d,sc as e,tc as f,uc as g,vc as h,wc as i,xc as j,yc as k,zc as l}from"./chunk-
|
|
2
|
+
import{Ac as m,Bc as n,Cc as o,Dc as p,Ec as q,Fc as r,Gc as s,Hc as t,Ic as u,oc as a,pc as b,qc as c,rc as d,sc as e,tc as f,uc as g,vc as h,wc as i,xc as j,yc as k,zc as l}from"./chunk-j6bejzk9.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{t as stripOperators,l as splitConstraint,s as scanEcosystems,o as rustAdapter,n as rubyAdapter,c as regenerateWith,u as regenerateLockfiles,m as pythonAdapter,k as pep440UpdateType,h as parsePep440,f as numericUpdateType,j as isPep440Prerelease,g as goAdapter,a as escapeRegex,b as detectFiles,i as comparePep440,e as compareNumeric,d as commandAvailable,r as adapterNamed,q as adapterFor,p as BUILTIN_ADAPTERS};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ec as Z}from"./chunk-
|
|
2
|
+
import{ec as Z}from"./chunk-5sh69bkj.js";import{Yc as X}from"./chunk-01d81hn0.js";import{Td as x,ee as V}from"./chunk-2b07w74s.js";import{ne as U,oe as Y}from"./chunk-y1d6e0ye.js";import H from"process";var K=[["actionlint","actionlint"],["shellcheck","shellcheck"],["hadolint","hadolint"],["markdownlint","markdownlint"]];async function T(j,J={}){let W=J.env??H.env,Q=J.cwd??H.cwd(),F=J.hasCommand??x,G=[];G.push({name:"bun",status:"ok",detail:`Bun ${Bun.version}`});let C=await Bun.file(`${Q}/.git/HEAD`).exists();G.push(C?{name:"git repository",status:"ok",detail:Q}:{name:"git repository",status:"fail",detail:`${Q} is not a git repository`,remediation:"Run buddy from inside a repository, or run `git init`."});let $=X(j);G.push($.length===0?{name:"configuration",status:"ok",detail:"valid"}:{name:"configuration",status:"fail",detail:`${$.length} problem(s): ${$.slice(0,3).map((q)=>`${q.path} ${q.message}`).join("; ")}`,remediation:"Fix the paths reported above in buddy.config.ts."});let P=Boolean(j.repository?.owner&&j.repository.name);G.push(P?{name:"repository config",status:"ok",detail:`${j.repository.owner}/${j.repository.name}`}:{name:"repository config",status:"warn",detail:"owner and name are not set",remediation:"Set repository.owner and repository.name, or run in Actions where GITHUB_REPOSITORY is available. Local review works without them."});let B=j.repository?.provider??"github",D=j.repository?.token?{token:j.repository.token,source:"repository.token"}:Y(B,W);G.push(D?{name:"git token",status:"ok",detail:`found in ${D.source}`}:{name:"git token",status:"warn",detail:"no token found",remediation:`Set one of ${(U[B]??[]).join(", ")}. Local review does not need one.`});let b=Z(j,W);G.push(b?{name:"ai provider",status:"ok",detail:`${b.provider} via ${b.apiKeyEnv}`}:{name:"ai provider",status:"warn",detail:"no API key found",remediation:"Set ANTHROPIC_API_KEY (or OPENAI_API_KEY / GOOGLE_API_KEY). Dependency updates and static analysis work without one."});for(let[q,M]of K){let I=await F(M);G.push(I?{name:`analyzer: ${q}`,status:"ok",detail:`${M} found`}:{name:`analyzer: ${q}`,status:"warn",detail:`${M} not installed`,remediation:`Install ${M} to enable the ${q} analyzer. Reviews run without it and report it as skipped.`})}let w=V.filter((q)=>!K.some(([M])=>M===q.name)).map((q)=>q.name);return G.push({name:"native analyzers",status:"ok",detail:`${w.join(", ")} \u2014 always available`}),{checks:G,healthy:!G.some((q)=>q.status==="fail")}}var S={ok:"\u2705",warn:"\u26A0\uFE0F ",fail:"\u274C"};function E(j){let J=["","Buddy environment",""];for(let F of j.checks)if(J.push(`${S[F.status]} ${F.name}: ${F.detail}`),F.remediation)J.push(` \u2192 ${F.remediation}`);let W=j.checks.filter((F)=>F.status==="fail").length,Q=j.checks.filter((F)=>F.status==="warn").length;return J.push(""),J.push(j.healthy?`Ready. ${Q} optional capability/capabilities unavailable.`:`${W} problem(s) must be fixed before buddy can run.`),`${J.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`}
|
|
5
5
|
export{T as W,E as X};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ka as a,la as b,ma as c,na as d,oa as e,pa as f,qa as g,ra as h,sa as i,ta as j,ua as k,va as l,wa as m}from"./chunk-
|
|
2
|
+
import{ka as a,la as b,ma as c,na as d,oa as e,pa as f,qa as g,ra as h,sa as i,ta as j,ua as k,va as l,wa as m}from"./chunk-bgw39afd.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{e as summarizeGates,l as runPostMerge,d as runGates,i as runAiGates,m as isMergeEvent,f as gateIcon,j as findLinkedIssues,a as checkTitleFormat,g as checkLinkedIssue,b as checkDescription,c as checkDependencies,h as checkCustomAssertions,k as appendChangelogEntry};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Kh as X}from"./chunk-34vracy4.js";import{Qh as Z}from"./chunk-zwtx6vn3.js";var V={node:"nodejs","library/node":"nodejs",python:"python","library/python":"python",debian:"debian","library/debian":"debian",ubuntu:"ubuntu","library/ubuntu":"ubuntu",alpine:"alpine","library/alpine":"alpine",php:"php","library/php":"php",ruby:"ruby","library/ruby":"ruby",golang:"go","library/golang":"go",postgres:"postgresql","library/postgres":"postgresql",mysql:"mysql","library/mysql":"mysql",redis:"redis","library/redis":"redis",nginx:"nginx","library/nginx":"nginx"};function q(j){let x=j.replace(/^(?:docker\.io|registry-1\.docker\.io)\//,"");return V[x]??V[x.split("/").pop()??""]??null}function G(j,x){let z=/^v?(\d+(?:\.\d+)*)/.exec(j.trim());if(!z)return null;let H=z[1].split(".");for(let k=H.length;k>=1;k--){let K=H.slice(0,k).join("."),B=x.find((J)=>J.cycle===K);if(B)return B}return null}async function F(j,x,z={}){let H=z.logger??Z(),k=q(j);if(!k)return null;let K=z.baseUrl??"https://endoflife.date",B=await X(`${K}/api/${k}.json`,{headers:{"User-Agent":"buddy",Accept:"application/json"}}).catch(()=>null);if(!B?.ok)return H.debug(`Could not read the support window for ${k}`),null;let J=await B.json().catch(()=>null);if(!Array.isArray(J))return null;let v=G(x,J);if(!v)return null;if(v.eol===!1)return{product:k,cycle:v.cycle,eol:!1};if(v.eol===!0)return{product:k,cycle:v.cycle,eol:!0};let M=new Date(v.eol);if(Number.isNaN(M.getTime()))return{product:k,cycle:v.cycle,eol:!1};let $=z.now??new Date,Q=Math.round((M.getTime()-$.getTime())/86400000);return{product:k,cycle:v.cycle,eol:Q<0,date:v.eol,daysRemaining:Q}}var I=90;function N(j){if(!j)return"";if(j.eol)return j.date?`\`${j.product} ${j.cycle}\` reached end of life on ${j.date} and no longer receives security fixes.`:`\`${j.product} ${j.cycle}\` has reached end of life and no longer receives security fixes.`;if(j.daysRemaining!==void 0&&j.daysRemaining<=I)return`\`${j.product} ${j.cycle}\` reaches end of life in ${j.daysRemaining} day(s), on ${j.date}.`;return""}
|
|
3
3
|
export{V as xa,q as ya,G as za,F as Aa,I as Ba,N as Ca};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{wd as j,zd as q}from"./chunk-
|
|
2
|
+
import{wd as j,zd as q}from"./chunk-ebnc6980.js";async function U(A,D,G){let x=q(A);if(x.length===0)return;let z=new j;for(let H of x)z.register(H);await z.emit(D,G)}
|
|
3
3
|
export{U as ud};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{X as
|
|
2
|
+
import{Fh as V}from"./chunk-j6geg3qt.js";import{Kh as M}from"./chunk-34vracy4.js";import{Nh as K,Qh as Q}from"./chunk-zwtx6vn3.js";class X{token;apiUrl;logger;slug;constructor(j,z,A,C,F){this.token=j;this.apiUrl=(C??"https://api.bitbucket.org/2.0").replace(/\/+$/,""),this.logger=F??Q(),this.slug=`${encodeURIComponent(z)}/${encodeURIComponent(A)}`}capabilities(){return{pinIssues:!1,checkRuns:!0,inlineReviewComments:!0,reviewSuggestions:!1,nativeAutoMerge:!1,commentReactions:!1,ciLogs:!1,ciRuns:!1,reviewThreads:!1,teamReviewers:!1,draftPullRequests:!1,permissionLookup:!0,branchHousekeeping:!0,reopenPullRequests:!1,labels:!1}}async request(j,z,A,C={}){let F={Authorization:`Bearer ${this.token}`,Accept:C.raw?"text/plain":"application/json","User-Agent":"buddy"},H;if(C.form)F["Content-Type"]="application/x-www-form-urlencoded",H=new URLSearchParams(C.form).toString();else if(A)F["Content-Type"]="application/json",H=JSON.stringify(A);let G=await M(`${this.apiUrl}${z}`,{method:j,headers:F,...H?{body:H}:{}});if(!G.ok){let J=await G.text().catch(()=>"");throw Error(`Bitbucket ${j} ${z} failed: ${G.status} ${J.slice(0,200)}`)}let I=await G.text();if(C.raw)return I;return I.trim()?JSON.parse(I):void 0}async optional(j,z){try{return await this.request(j,z)}catch(A){if(String(A).includes("404"))return null;throw A}}async collect(j,z=10){let A=[],C=`${this.apiUrl}${j}`;for(let F=0;F<z&&C;F++){let H=C,G=await this.optional("GET",H.startsWith(this.apiUrl)?H.slice(this.apiUrl.length):H);if(!G)break;A.push(...G.values??[]),C=G.next}return A}async branchExists(j){return await this.optional("GET",`/repositories/${this.slug}/refs/branches/${encodeURIComponent(j)}`)!==null}async createBranch(j,z){await this.request("POST",`/repositories/${this.slug}/refs/branches`,{name:j,target:{hash:z}})}async deleteBranch(j){await this.request("DELETE",`/repositories/${this.slug}/refs/branches/${encodeURIComponent(j)}`)}async commitChanges(j,z,A,C="main"){if(A.length===0)return;let F={message:z,branch:j};for(let I of A)if(I.type==="delete")F.files=F.files?`${F.files},${I.path}`:I.path;else F[I.path]=I.content;let H=new URLSearchParams;for(let[I,J]of Object.entries(F)){if(I==="files")continue;H.append(I,J)}for(let I of A)if(I.type==="delete")H.append("files",I.path);let G=await this.headOf(C);if(G)H.append("parents",G);await this.request("POST",`/repositories/${this.slug}/src`,void 0,{form:Object.fromEntries(H.entries())})}async headOf(j){return(await this.optional("GET",`/repositories/${this.slug}/refs/branches/${encodeURIComponent(j)}`))?.target?.hash??null}async getFileContent(j,z){try{return await this.request("GET",`/repositories/${this.slug}/src/${encodeURIComponent(z)}/${j}`,void 0,{raw:!0})}catch(A){if(String(A).includes("404"))return null;throw A}}async createPullRequest(j){if(j.draft)this.logger.debug("Bitbucket has no draft pull requests; opening as ready");let z=await this.request("POST",`/repositories/${this.slug}/pullrequests`,{title:j.title,description:j.body,source:{branch:{name:j.head}},destination:{branch:{name:j.base}},close_source_branch:!0,...j.reviewers?.length?{reviewers:j.reviewers.map((A)=>({nickname:A}))}:{}});return this.toPullRequest(z)}async getPullRequests(j="open"){let A=(j==="open"?["OPEN"]:j==="closed"?["MERGED","DECLINED","SUPERSEDED"]:["OPEN","MERGED","DECLINED","SUPERSEDED"]).map((F)=>`state=${F}`).join("&");return(await this.collect(`/repositories/${this.slug}/pullrequests?${A}&pagelen=50`)).map((F)=>this.toPullRequest(F))}async updatePullRequest(j,z){let A=await this.request("PUT",`/repositories/${this.slug}/pullrequests/${j}`,{...z.title!==void 0?{title:z.title}:{},...z.body!==void 0?{description:z.body}:{},...z.base!==void 0?{destination:{branch:{name:z.base}}}:{}});return this.toPullRequest(A)}async closePullRequest(j){await this.request("POST",`/repositories/${this.slug}/pullrequests/${j}/decline`)}async reopenPullRequest(j){throw Error(`Bitbucket cannot reopen declined pull request #${j}; open a new one from the same branch.`)}async mergePullRequest(j,z="squash"){let A={merge:"merge_commit",squash:"squash",rebase:"fast_forward"};await this.request("POST",`/repositories/${this.slug}/pullrequests/${j}/merge`,{merge_strategy:A[z]??"squash",close_source_branch:!0})}async getPullRequestDiff(j){return await this.request("GET",`/repositories/${this.slug}/pullrequests/${j}/diff`,void 0,{raw:!0})}async getPullRequestHeadSha(j){return(await this.request("GET",`/repositories/${this.slug}/pullrequests/${j}`)).source?.commit?.hash??""}async createComment(j,z){await this.request("POST",`/repositories/${this.slug}/pullrequests/${j}/comments`,{content:{raw:z}})}async createIssue(j){let z=await this.request("POST",`/repositories/${this.slug}/issues`,{title:j.title,content:{raw:j.body},kind:"task"});return this.toIssue(z)}async getIssues(j="open"){let A=(await this.collect(`/repositories/${this.slug}/issues?pagelen=50`)).map((C)=>this.toIssue(C));return j==="all"?A:A.filter((C)=>C.state===j)}async updateIssue(j,z){let A=await this.request("PUT",`/repositories/${this.slug}/issues/${j}`,{...z.title!==void 0?{title:z.title}:{},...z.body!==void 0?{content:{raw:z.body}}:{}});return this.toIssue(A)}async closeIssue(j){await this.request("PUT",`/repositories/${this.slug}/issues/${j}`,{state:"closed"})}async unpinIssue(j){return!1}async getPullRequestChecksState(j){let z=await this.getPullRequestHeadSha(j);if(!z)return"none";let A=await this.collect(`/repositories/${this.slug}/commit/${z}/statuses?pagelen=50`);if(A.length===0)return"none";if(A.some((C)=>C.state==="FAILED"||C.state==="STOPPED"))return"failure";if(A.some((C)=>C.state==="INPROGRESS"))return"pending";if(A.every((C)=>C.state==="SUCCESSFUL"))return"success";return"pending"}async createReview(j,z){if(await this.createComment(j,z.body),!z.comments?.length)return{posted:!0,inlineComments:0};let A=0;for(let C of z.comments)try{await this.request("POST",`/repositories/${this.slug}/pullrequests/${j}/comments`,{content:{raw:C.body},inline:{path:C.path,...C.side==="RIGHT"?{to:C.line}:{from:C.line}}}),A++}catch(F){this.logger.debug(`Could not place a comment on ${C.path}:${C.line}: ${K(F)}`)}return{posted:!0,inlineComments:A}}async createCheckRun(j,z,A){try{await this.request("POST",`/repositories/${this.slug}/commit/${z}/statuses/build`,{key:j.replace(/[^\w-]/g,"-").slice(0,40),state:A.conclusion==="failure"?"FAILED":"SUCCESSFUL",name:A.title.slice(0,100),description:A.summary.slice(0,300),url:"https://buddy.sh"})}catch(C){this.logger.warn(`\u26A0\uFE0F Could not report build status ${j}: ${K(C)}`)}}async hasWriteAccess(j){let A=(await this.optional("GET",`/repositories/${this.slug}/permissions-config/users`))?.values?.find((C)=>C.user?.nickname===j);return A?.permission==="write"||A?.permission==="admin"}async getBuddyBranches(){return(await this.collect(`/repositories/${this.slug}/refs/branches?q=${encodeURIComponent('name ~ "buddy/"')}&pagelen=50`)).filter((z)=>V(z.name)).map((z)=>({name:z.name,sha:z.target?.hash??"",lastCommitDate:z.target?.date?new Date(z.target.date):new Date(0)}))}async getOrphanedBuddyBranches(){let[j,z]=await Promise.all([this.getBuddyBranches(),this.getPullRequests("open")]),A=new Set(z.map((C)=>C.head));return j.filter((C)=>!A.has(C.name))}async cleanupStaleBranches(j=7,z=!1){let A=new Date(Date.now()-j*24*60*60*1000),C=(await this.getOrphanedBuddyBranches()).filter((G)=>G.lastCommitDate<A);if(z)return{deleted:C.map((G)=>G.name),failed:[]};let F=[],H=[];for(let G of C)try{await this.deleteBranch(G.name),F.push(G.name)}catch{H.push(G.name)}return{deleted:F,failed:H}}toPullRequest(j){let z=j.state==="MERGED"?"merged":j.state==="OPEN"?"open":"closed";return{number:j.id,title:j.title,body:j.description??"",head:j.source?.branch?.name??"",base:j.destination?.branch?.name??"",state:z,url:j.links?.html?.href??"",createdAt:new Date(j.created_on),updatedAt:new Date(j.updated_on),...z==="merged"?{mergedAt:new Date(j.updated_on)}:{},author:j.author?.nickname??j.author?.display_name??"",reviewers:(j.reviewers??[]).map((A)=>A.nickname??A.display_name??"").filter(Boolean),assignees:[],labels:[],draft:!1}}toIssue(j){let z=["new","open","on hold"].includes(j.state);return{number:j.id,title:j.title,body:j.content?.raw??"",state:z?"open":"closed",url:j.links?.html?.href??"",createdAt:new Date(j.created_on),updatedAt:new Date(j.updated_on),...z?{}:{closedAt:new Date(j.updated_on)},author:j.reporter?.nickname??j.reporter?.display_name??"",assignees:[],labels:[]}}}
|
|
3
|
+
export{X as Eh};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ud as R}from"./chunk-
|
|
2
|
+
import{ud as R}from"./chunk-qjzpzd7j.js";import{re as F,se as A}from"./chunk-y1d6e0ye.js";import{Bf as S}from"./chunk-1pecmenc.js";import{Rf as L}from"./chunk-4kyxrwxn.js";import{Nh as K,Qh as O}from"./chunk-zwtx6vn3.js";import{fl as P}from"./chunk-s82adeq9.js";var b=[{kind:"lockfile-drift",mechanical:!0,patterns:[/lockfile had changes, but lockfile is frozen/i,/your lockfile does not satisfy your workspace/i,/the lockfile (?:is|was) out of date/i,/npm ci can only install packages when your package\.json and package-lock\.json .* are in sync/i,/composer\.lock is not up to date/i]},{kind:"flake",mechanical:!0,patterns:[/\bECONNRESET\b|\bETIMEDOUT\b|\bENOTFOUND\b|\bEAI_AGAIN\b/,/socket hang up/i,/502 Bad Gateway|503 Service Unavailable|504 Gateway Time-?out/i,/rate limit exceeded/i,/the runner has received a shutdown signal/i]},{kind:"install",mechanical:!1,patterns:[/could not resolve (?:dependency|host)/i,/no matching version found for/i,/unable to resolve dependency tree/i,/peer dep(?:endency)? .* conflict/i]},{kind:"type-error",mechanical:!1,patterns:[/error TS\d{4}:/,/\berror\[E\d+\]:/,/Type '.*' is not assignable to type/]},{kind:"test-failure",mechanical:!1,patterns:[/\d+ (?:tests? )?fail(?:ed|ing)\b/i,/\(fail\)/,/AssertionError|expect\(received\)/,/\u25CF .* \u203A /]},{kind:"lint",mechanical:!1,patterns:[/\b\d+ problems? \(\d+ errors?/i,/eslint|pickier|biome|oxlint/i]}];function N(x){if(!x.trim())return{kind:"unknown",mechanical:!1,evidence:[]};let H=x.split(`
|
|
3
3
|
`);for(let z of b){let J=[];for(let V of H)if(z.patterns.some((Q)=>Q.test(V))){if(J.push(V.trim()),J.length>=5)break}if(J.length>0)return{kind:z.kind,mechanical:z.mechanical,evidence:J}}return{kind:"unknown",mechanical:!1,evidence:T(H)}}function T(x,H=40){let z=x.filter((J)=>/\b(?:error|failed|failure|exception|panic|fatal)\b/i.test(J)&&!/^\s*(?:at\s|\s*\.\.\.)/.test(J));return(z.length>0?z:x.slice(-H)).slice(-H).map((J)=>J.trim()).filter(Boolean)}function G(x){switch(x.kind){case"lockfile-drift":return"The lock file is out of step with its manifest.";case"flake":return"A network or runner problem, unrelated to the change.";case"install":return"Dependencies could not be resolved.";case"type-error":return"The change does not type-check.";case"test-failure":return"One or more tests failed.";case"lint":return"Lint or formatting checks failed.";default:return"The failure could not be classified automatically."}}var w=3;async function M(x,H,z,J){let V=J??O();try{let Q=await x.listWorkflowRuns(H,{status:"completed",limit:20});for(let Y of _(Q).slice(0,w)){let Z=await x.getWorkflowRunLogs(Y.id);if(!Z)continue;if(N(Z).kind===z)return V.info(`\uD83E\uDDED ${H} already fails the same way (run ${Y.id}) \u2014 not this pull request's to fix`),!0}return!1}catch(Q){return V.debug(`Could not check ${H} for a pre-existing failure: ${K(Q)}`),!1}}function _(x){let H=new Map;for(let z of x)if(!H.has(z.name))H.set(z.name,z);return[...H.values()].filter((z)=>z.conclusion==="failure")}function h(x,H){if(!x)return"Tried to regenerate the lock file, but the install did not succeed.";if(!H)return"Regenerated the lock file, but could not push it to the branch. The change is in the workspace only, so the run will still be red until someone commits it.";return"Regenerated the lock file and pushed the result. No model was needed."}function f(x){let H="Repairs run on the pull request's branch, and answering a comment runs on the default branch, so anything I changed here would land on the wrong tree. ";if(x.kind==="lockfile-drift")return`Regenerating the lock file would fix this, and no model would be needed. ${H}The \`fix-ci\` job will do it on the next failing run, or you can run \`buddy fix-ci --run-id <id> --pr <number>\` yourself.`;return`${H}The \`fix-ci\` job runs on the failing run itself and can repair this; this reply is the diagnosis it would start from.`}async function I(x){let H=x.logger??O(),z=N(x.log),J=x.maxAttempts??3;if(H.info(`\uD83E\uDE7A CI failure classified as ${z.kind}`),x.failsOnBase??(x.checkBase?await x.checkBase(z.kind):!1))return{failure:z,action:"skipped",fixed:!1,report:$(z,"This failure also occurs on the base branch, so it is not caused by this change. Fixing it here would only mask it.")};if((x.priorAttempts??0)>=J)return{failure:z,action:"skipped",fixed:!1,report:$(z,`Already attempted ${x.priorAttempts} time(s); stopping rather than looping.`)};if(x.analysisOnly&&z.kind!=="flake")return{failure:z,action:"reported",fixed:!1,report:$(z,f(z))};if(z.kind==="lockfile-drift"&&x.regenerateLockfile){if(x.dryRun)return{failure:z,action:"mechanical-fix",fixed:!1,report:$(z,"Regenerating the lock file would fix this. No model would be needed. Nothing was changed, because this was a dry run.")};H.info("\uD83D\uDD27 Regenerating the lock file");let{regenerated:Y,pushed:Z}=await x.regenerateLockfile();return{failure:z,action:"mechanical-fix",fixed:Z,report:$(z,h(Y,Z))}}if(z.kind==="flake"){if(x.dryRun)return{failure:z,action:"retry",fixed:!1,report:$(z,"This looks transient, and re-running the failed jobs would likely clear it. Nothing was changed, because this was a dry run.")};if(!x.rerun)return{failure:z,action:"retry",fixed:!1,report:$(z,"This looks transient. Re-running the failed job is likely to clear it.")};H.info("\uD83D\uDD01 Re-running the failed jobs");let Y=await x.rerun();return{failure:z,action:"retry",fixed:!1,report:$(z,Y?"This looks transient, so I re-ran the failed jobs. No model was needed.":"This looks transient, but I could not re-run the failed jobs \u2014 `actions: write` is the usual reason. "+"Re-running them from the Actions tab is likely to clear it.")}}if(!x.ai)return{failure:z,action:"reported",fixed:!1,report:$(z,"No AI provider is configured, so this needs a human. See https://buddy.sh/ai/providers to enable automatic repair.")};let Q=await L(x.ai,{mode:S,task:["A CI job on this branch is failing. Diagnose the root cause and fix it if the fix is clear.","",`Classification: ${z.kind} \u2014 ${G(z)}`,"","Relevant log lines:",z.evidence.join(`
|
|
4
4
|
`),"","Verify your fix by running the project's tests or build before reporting it done.","If the fix is not clear, explain what you found rather than guessing."].join(`
|
|
5
5
|
`),context:{workspace:x.workspace,baseBranch:x.baseBranch,...x.branch?{branch:x.branch}:{}},logger:H});return{failure:z,action:"agent-fix",fixed:Q.stopReason==="completed",report:$(z,Q.output||"The repair run ended without a conclusion.")}}function $(x,H){let z=`## \uD83E\uDE7A CI failure analysis
|
|
@@ -20,8 +20,8 @@ ${x.evidence.slice(0,20).join(`
|
|
|
20
20
|
${JSON.stringify(J)}
|
|
21
21
|
-->`;return`${(x??"").replace(B,"").trimEnd()}
|
|
22
22
|
|
|
23
|
-
${V}`}async function m(x,H,z){if(!F(x,"ciRuns","listWorkflowRuns"))return null;try{let J=await x.getPullRequestHeadSha(H.number),V=await x.listWorkflowRuns(H.head,{status:"completed",limit:30}),Q=J?V.filter((Y)=>Y.headSha===J):V;return _(Q)[0]?.id??null}catch(J){return z.debug(`Could not resolve the failing run for #${H.number}: ${K(J)}`),null}}async function c(x){let H=x.logger??O(),{config:z,provider:J}=x,V=x.workspace??process.cwd();A(J,"ciLogs","getWorkflowRunLogs","reading CI logs");let Q;if(x.prNumber){if(Q=(await J.getPullRequests("open")).find((W)=>W.number===x.prNumber),!Q)return`Could not find open pull request #${x.prNumber}.`}let Y=x.runId??(Q?await m(J,Q,H):null);if(!Y)return Q?"Nothing is failing at the head of this pull request, so there is nothing to diagnose.":"No run to diagnose. Pass --run-id, or --pr so I can find the failing run myself.";let Z=await J.getWorkflowRunLogs(Y);if(!Z)return H.warn(`\u26A0\uFE0F Could not read the logs for run ${Y}; nothing to diagnose`),`Could not read the logs for run ${Y}. They may have expired.`;let U=E(Q?.body)?.attempts??0,j=z.repository?.baseBranch??"main",D=F(J,"ciRuns","listWorkflowRuns"),y=F(J,"ciRuns","rerunWorkflowRun"),{createAiClient:v}=await import("./chunk-
|
|
23
|
+
${V}`}async function m(x,H,z){if(!F(x,"ciRuns","listWorkflowRuns"))return null;try{let J=await x.getPullRequestHeadSha(H.number),V=await x.listWorkflowRuns(H.head,{status:"completed",limit:30}),Q=J?V.filter((Y)=>Y.headSha===J):V;return _(Q)[0]?.id??null}catch(J){return z.debug(`Could not resolve the failing run for #${H.number}: ${K(J)}`),null}}async function c(x){let H=x.logger??O(),{config:z,provider:J}=x,V=x.workspace??process.cwd();A(J,"ciLogs","getWorkflowRunLogs","reading CI logs");let Q;if(x.prNumber){if(Q=(await J.getPullRequests("open")).find((W)=>W.number===x.prNumber),!Q)return`Could not find open pull request #${x.prNumber}.`}let Y=x.runId??(Q?await m(J,Q,H):null);if(!Y)return Q?"Nothing is failing at the head of this pull request, so there is nothing to diagnose.":"No run to diagnose. Pass --run-id, or --pr so I can find the failing run myself.";let Z=await J.getWorkflowRunLogs(Y);if(!Z)return H.warn(`\u26A0\uFE0F Could not read the logs for run ${Y}; nothing to diagnose`),`Could not read the logs for run ${Y}. They may have expired.`;let U=E(Q?.body)?.attempts??0,j=z.repository?.baseBranch??"main",D=F(J,"ciRuns","listWorkflowRuns"),y=F(J,"ciRuns","rerunWorkflowRun"),{createAiClient:v}=await import("./chunk-4qv88x27.js"),C=await I({log:Z,priorAttempts:U,workspace:V,baseBranch:j,ai:x.analysisOnly?null:v(z,H),logger:H,dryRun:Boolean(x.dryRun),analysisOnly:Boolean(x.analysisOnly),...D?{checkBase:(X)=>M({listWorkflowRuns:(W,k)=>J.listWorkflowRuns(W,k),getWorkflowRunLogs:(W)=>J.getWorkflowRunLogs(W)},j,X,H)}:{},...y?{rerun:()=>J.rerunWorkflowRun(Y)}:{},...x.analysisOnly?{}:{regenerateLockfile:()=>g(V,H)}});if(H.info(`
|
|
24
24
|
${C.report}
|
|
25
|
-
`),x.prNumber&&!x.dryRun){if(await J.createComment(x.prNumber,C.report),C.action!=="skipped"&&Q)try{await J.updatePullRequest(x.prNumber,{body:q(Q.body,U+1)})}catch(X){H.warn(`Could not record the fix attempt on PR #${x.prNumber}: ${K(X)}`)}}return await R(z.notifications,"fixci.completed",{...x.prNumber?{number:x.prNumber}:{},action:C.action,fixed:C.fixed}),`${C.action}${C.fixed?" (fixed)":""}`}async function g(x,H){let{regenerateLockFile:z,detectRequiredPackageManagers:J,getAllLockFilePaths:V,hasLockFile:Q}=await import("./chunk-
|
|
25
|
+
`),x.prNumber&&!x.dryRun){if(await J.createComment(x.prNumber,C.report),C.action!=="skipped"&&Q)try{await J.updatePullRequest(x.prNumber,{body:q(Q.body,U+1)})}catch(X){H.warn(`Could not record the fix attempt on PR #${x.prNumber}: ${K(X)}`)}}return await R(z.notifications,"fixci.completed",{...x.prNumber?{number:x.prNumber}:{},action:C.action,fixed:C.fixed}),`${C.action}${C.fixed?" (fixed)":""}`}async function g(x,H){let{regenerateLockFile:z,detectRequiredPackageManagers:J,getAllLockFilePaths:V,hasLockFile:Q}=await import("./chunk-3r0jb90q.js"),{commitAndPush:Y}=await import("./chunk-j7qktvpg.js"),Z=J(["package.json","composer.json"],x).filter((j)=>Q(j,x)),U=!1;for(let j of Z){let D=await z(j,x);if(D.success)U=!0;else H.warn(`\u26A0\uFE0F ${D.message}`)}if(!U)return{regenerated:!1,pushed:!1};try{return{regenerated:!0,pushed:await Y(V(),`fix(deps): regenerate the lock file
|
|
26
26
|
|
|
27
27
|
The lock file had drifted from the manifest, which failed CI.`,x)}}catch(j){return H.warn(`\u26A0\uFE0F Could not push the regenerated lock file: ${K(j)}`),{regenerated:!0,pushed:!1}}}export{N as Ea,T as Fa,G as Ga,M as Ha,_ as Ia,I as Ja,c as Ka};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ge as a,he as b}from"./chunk-142zh7e5.js";import"./chunk-
|
|
2
|
+
import{ge as a,he as b}from"./chunk-142zh7e5.js";import"./chunk-s82adeq9.js";export{b as auditParsed,a as audit};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var j=Object.create;var{getPrototypeOf:k,defineProperty:i,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,q=(a,b,d)=>{var f=a!=null&&typeof a==="object";if(f){var g=b?o??=new WeakMap:p??=new WeakMap,h=g.get(a);if(h)return h}d=a!=null?j(k(a)):{};let c=b||!a||!a.__esModule?i(d,"default",{value:a,enumerable:!0}):d;for(let e of l(a))if(!m.call(c,e))i(c,e,{get:n.bind(a,e),enumerable:!0});if(f)g.set(a,c);return c};var r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var s=import.meta.require;
|
|
3
|
-
export{q as
|
|
3
|
+
export{q as dl,r as el,s as fl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Sf as D}from"./chunk-24xvskkf.js";import{
|
|
2
|
+
import{Sf as D}from"./chunk-24xvskkf.js";import{Qh as C}from"./chunk-zwtx6vn3.js";var O=".buddy/learnings.jsonl",R=20;function T(P){if(!P)return[];let E=[];for(let v of P.split(`
|
|
3
3
|
`)){let L=v.trim();if(!L||L.startsWith("#"))continue;try{let A=JSON.parse(L);if(typeof A.text!=="string"||!A.text.trim())continue;E.push({id:typeof A.id==="string"?A.id:_(A.text),text:A.text.trim(),...Array.isArray(A.paths)?{paths:A.paths.filter((o)=>typeof o==="string")}:{},...typeof A.kind==="string"?{kind:A.kind}:{},...A.source&&typeof A.source==="object"?{source:A.source}:{},createdAt:typeof A.createdAt==="string"?A.createdAt:new Date(0).toISOString()})}catch{continue}}return E}function M(P){return`${P.map((E)=>JSON.stringify(E)).join(`
|
|
4
4
|
`)}
|
|
5
5
|
`}function N(P,E={}){return{id:_(P),text:P.trim(),...E.paths?.length?{paths:E.paths}:{},...E.kind?{kind:E.kind}:{},...E.source?{source:E.source}:{},createdAt:new Date().toISOString()}}function Y(P,E){return[...P.filter((v)=>v.id!==E.id),E]}function q(P,E,v=R){let L=P.map((A)=>{if(!A.paths?.length)return{learning:A,score:1};let o=D(A.paths),I=E.some((V)=>o.matches(V));return{learning:A,score:I?2:0}}).filter((A)=>A.score>0);return L.sort((A,o)=>{if(A.score!==o.score)return o.score-A.score;return o.learning.createdAt.localeCompare(A.learning.createdAt)}),L.slice(0,v).map((A)=>A.learning)}function B(P){if(P.length===0)return"";return`Things this repository has told you before:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-s82adeq9.js";var z={error:"error",warning:"warning",info:"notice"};function E(j){let q=[];for(let h of j.findings){let x=[`file=${h.file}`,`title=${h.ruleId}`];if(h.line!==void 0)x.push(`line=${h.line}`);let y=B(`${h.message}${h.fix?` \u2014 ${h.fix}`:""}`);q.push(`::${z[h.severity]} ${x.join(",")}::${y}`)}return q.join(`
|
|
3
3
|
`)}function B(j){return j.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
|
|
4
4
|
`,"%0A")}export{E as formatGitHub};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ai as h,mi as a,ni as e,oi as o,pi as s,qi as t,ri as i,si as c,ti as r,ui as n,vi as g,wi as m,xi as u,yi as P,zi as l}from"./chunk-028354j6.js";import"./chunk-s82adeq9.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,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{re as p}from"./chunk-
|
|
2
|
+
import{re as p}from"./chunk-y1d6e0ye.js";import{Qh as E}from"./chunk-zwtx6vn3.js";var x=["github-actions[bot]","buddy","buddy[bot]"];function w(f,r){let e=f.authorLogins[0];if(!e)return!1;return r?e===r:x.includes(e)}async function F(f){let r=f.logger??E(),{provider:e,prNumber:t}=f;if(!p(e,"reviewThreads","listReviewThreads"))return"This provider cannot resolve review threads.";let n=await e.listReviewThreads(t),i=n.filter((R)=>!R.isResolved&&w(R,f.author));if(i.length===0)return n.length===0?"There are no review threads on this pull request.":"None of the open threads here are mine to close.";if(!p(e,"reviewThreads","resolveReviewThread"))return"This provider cannot resolve review threads.";let o=0;for(let R of i)if(await e.resolveReviewThread(t,R.id))o++;else r.warn(`Could not resolve thread ${R.id} on #${t}`);if(o===0)return`I could not close any of the ${i.length} thread(s) I opened.`;let m=o<i.length?` (${i.length-o} refused)`:"";return`Closed ${o} thread(s) I opened${m}.`}export{F as mb};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Jc as a,Kc as b,Lc as c,Mc as d}from"./chunk-nn5rzwty.js";import"./chunk-9n1kth4b.js";import"./chunk-cj4d5ad7.js";import"./chunk-zy49dwqk.js";import"./chunk-x9vpk4kk.js";import"./chunk-94tnmc7j.js";import"./chunk-drmk6r1m.js";import"./chunk-7t8s2mcf.js";import"./chunk-j6geg3qt.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-028354j6.js";import"./chunk-s82adeq9.js";export{c as isWorkflowPermissionRefusal,a as gitAuthConfigArgs,b as WorkflowPermissionError,d as GitHubProvider};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{sf as a,tf as b,uf as c,vf as d,wf as e,xf as f,yf as g}from"./chunk-3a5gcj3y.js";import"./chunk-24xvskkf.js";import"./chunk-zy49dwqk.js";import"./chunk-x9vpk4kk.js";import"./chunk-94tnmc7j.js";import"./chunk-drmk6r1m.js";import"./chunk-7t8s2mcf.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-028354j6.js";import"./chunk-s82adeq9.js";export{f as strategyAllows,b as ruleMatches,c as resolveRuleEffects,e as mergeGroupEffects,g as groupsToRules,a as ecosystemOf,d as applyRules};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-s82adeq9.js";function f(i){return JSON.stringify({ok:!i.failed,summary:{workflows:i.workflows.length,findings:i.findings.length,errors:i.findings.filter((n)=>n.severity==="error").length,warnings:i.findings.filter((n)=>n.severity==="warning").length,info:i.findings.filter((n)=>n.severity==="info").length},findings:i.findings},null,2)}export{f as formatJson};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{md as h}from"./chunk-bnp0r4eh.js";import{od as B}from"./chunk-0f1xye20.js";import{kg as E}from"./chunk-
|
|
2
|
+
import{md as h}from"./chunk-bnp0r4eh.js";import{od as B}from"./chunk-0f1xye20.js";import{kg as E}from"./chunk-zy49dwqk.js";import{Bh as w,Ch as f,yh as y}from"./chunk-7t8s2mcf.js";import{Kh as A,Lh as V}from"./chunk-34vracy4.js";import{fl as v}from"./chunk-s82adeq9.js";import{spawn as N}from"child_process";import q from"fs";import F from"path";import T from"process";var P=8;async function M(X,Z,$=8){if(X.length===0)return[];let K=Math.max(1,Math.min($,X.length)),Y=Array.from({length:X.length}),H=0;async function Q(){while(!0){let z=H++;if(z>=X.length)return;Y[z]=await Z(X[z],z)}}return await Promise.all(Array.from({length:K},Q)),Y}function m(X,Z){let $=Math.max(1,Z),K=[];for(let Y=0;Y<X.length;Y+=$)K.push(X.slice(Y,Y+$));return K}class J{entries=new Map;async get(X,Z){let $=this.entries.get(X);if($)return $;let K=Z().catch((Y)=>{throw this.entries.delete(X),Y});return this.entries.set(X,K),K}clear(){this.entries.clear()}get size(){return this.entries.size}}var d=/^[\w.@/*+-]+$/;function C(X,Z){if(!d.test(X))throw new B(`Refusing to pass untrusted ${Z} to bun: ${JSON.stringify(X)}`)}function g(X){let Z={Accept:"application/vnd.github.v3+json","User-Agent":"buddy"},$=X?.repository?.token||T.env.BUDDY_TOKEN||T.env.GITHUB_TOKEN||T.env.GH_TOKEN;if($)Z.Authorization=`Bearer ${$}`;return Z}function R(X){if(typeof X==="string")return X.trim();if(X&&typeof X==="object"&&"version"in X){let Z=X.version;if(typeof Z==="string")return Z.trim()}return""}class k{projectPath;logger;config;concurrency;packumentCache=new J;composerCache=new J;constructor(X,Z,$=void 0,K=P){this.projectPath=X;this.logger=Z;this.config=$;this.concurrency=K}clearCache(){this.packumentCache.clear(),this.composerCache.clear()}async fetchPackument(X){return this.packumentCache.get(X,async()=>{let $=`${w(X,this.config,this.projectPath)}/${encodeURIComponent(X).replace("%40","@")}`;try{let K=await A($,{headers:{"User-Agent":"buddy"},onRetry:({delayMs:Y,reason:H})=>this.logger.debug(`Retrying ${X} in ${Math.round(Y/1000)}s (${H})`)});if(!K.ok)return(K.status===404?this.logger.debug:this.logger.warn).call(this.logger,`No registry data for ${X}: HTTP ${K.status}`),null;return await K.json()}catch(K){return this.logger.warn(`Failed to fetch registry data for ${X}:`,K),null}})}async fetchComposerPackage(X){return this.composerCache.get(X,async()=>{let Z=f(this.config);try{let $=await A(`${Z}/packages/${X}.json`,{headers:{"User-Agent":"buddy"}});if(!$.ok)return null;return await $.json()}catch($){return this.logger.warn(`Failed to get Composer metadata for ${X}:`,$),null}})}shouldRespectVersion(X){if(!(this.config?.packages?.respectLatest??!0))return!1;let $=["latest","*","main","master","develop","dev"],K=X.toLowerCase().trim();return $.includes(K)}async getOutdatedPackages(X){this.logger.info("Checking for outdated packages...");try{let Z=await this.runBunOutdated(X),$=await this.getWorkspaceOutdatedPackages(),K=await this.getPackageJsonOutdated(X),Y=new Map;for(let G of Z)Y.set(G.name,G);for(let G of $)if(!Y.has(G.name))Y.set(G.name,G);for(let G of K)if(!Y.get(G.name))Y.set(G.name,G);let H=[...Y.values()].filter((G)=>{if(this.shouldRespectVersion(G.current))return this.logger.debug(`Skipping ${G.name} - version "${G.current}" should be respected`),!1;return!0}),Q=await M(H,async(G)=>{let[_,I]=await Promise.all([this.getPackageMetadata(G.name),this.findPackageLocation(G.name)]);return{name:G.name,currentVersion:G.current,newVersion:G.latest,updateType:E(G.current,G.latest),dependencyType:"dependencies",file:I||"package.json",metadata:_,releaseNotesUrl:this.getReleaseNotesUrl(G.name,_),changelogUrl:this.getChangelogUrl(G.name,_),homepage:_?.homepage}},this.concurrency),z=F.join(this.projectPath,"composer.json");if(q.existsSync(z))try{let G=await this.getComposerOutdatedPackages();Q.push(...G)}catch(G){this.logger.warn("Failed to check Composer packages:",G)}return this.logger.success(`Found ${Q.length} package updates`),Q}catch(Z){throw this.logger.error("Failed to check for outdated packages:",Z),new B(`Failed to check for outdated packages: ${Z instanceof Error?Z.message:"Unknown error"}`)}}async getUpdatesForPackages(X){let Z=X.join(" ");return this.getOutdatedPackages(Z)}async getUpdatesWithPattern(X){return this.getOutdatedPackages(X)}async getPackageMetadata(X){try{C(X,"package name");let Z=await this.fetchPackument(X);if(!Z)return;let $=Object.keys(Z.versions??{}),K=Z["dist-tags"]?.latest??$[$.length-1]??"",Y=Z.versions?.[K]??{},H=Y.repository??Z.repository,Q=Y.license??Z.license,z=Y.author??Z.author;return{name:Y.name??Z.name??X,description:Y.description??Z.description,repository:typeof H==="string"?H:H?.url,homepage:Y.homepage??Z.homepage,license:typeof Q==="string"?Q:Q?.type,author:typeof z==="string"?z:z?.name,keywords:Y.keywords??Z.keywords,latestVersion:K,versions:$,weeklyDownloads:void 0,dependencies:Y.dependencies,devDependencies:Y.devDependencies,peerDependencies:Y.peerDependencies}}catch(Z){this.logger.warn(`Failed to get metadata for ${X}:`,Z);return}}async packageExists(X){try{return C(X,"package name"),await this.fetchPackument(X)!==null}catch{return!1}}async getLatestVersion(X){try{return await this.getLatestVersionFromNpm(X)}catch{return null}}async getLatestVersionFromNpm(X){let Z=await this.fetchPackument(X);if(!Z)return null;let $=Object.keys(Z.versions??{});if($.length===0)return null;let K=this.config?.packages?.includePrerelease??!1,Y=Z["dist-tags"]?.latest;if(Y&&(K||!this.isPrerelease(Y)))return Y;let H=K?$:$.filter((z)=>!this.isPrerelease(z));if(H.length===0)return null;return[...H].sort((z,G)=>{try{return Bun.semver.order(G,z)}catch{return 0}})[0]||null}isPrerelease(X){return/-(?:alpha|beta|rc|dev|canary|next|experimental|snapshot|nightly)/i.test(X)}async runBunOutdated(X){let Z=[];if(X)for(let $ of X.split(/\s+/).filter(Boolean))C($,"package filter"),Z.push($);try{let $=await this.runCommand("bun",["outdated","--json",...Z]),K=this.parseBunOutdatedJson($);if(K)return K;this.logger.debug("bun outdated --json produced unrecognized output, falling back to table parsing")}catch($){this.logger.debug("bun outdated --json unavailable, falling back to table parsing:",$)}try{let $=await this.runCommand("bun",["outdated",...Z]);return this.parseBunOutdatedOutput($)}catch($){this.logger.error("Failed to run bun outdated:",$);let K=$ instanceof Error?$.message:String($);throw new B(`bun outdated command failed: ${K}`)}}parseBunOutdatedJson(X){let Z=X.trim();if(!Z||!Z.startsWith("[")&&!Z.startsWith("{"))return null;let $;try{$=JSON.parse(Z)}catch{return null}let K=Array.isArray($)?$:Object.entries($).map(([H,Q])=>({name:H,...Q&&typeof Q==="object"?Q:{}})),Y=[];for(let H of K){let Q=typeof H.name==="string"?H.name:void 0,z=R(H.current),G=R(H.latest);if(!Q||!z||!G)continue;let _={name:Q,current:z,update:R(H.update)||G,latest:G},I=typeof H.workspace==="string"?H.workspace:void 0;if(I)_.workspace=I;Y.push(_)}return Y}parseBunOutdatedOutput(X){let Z=[],$=`${String.fromCharCode(27)}[`,Y=X.replace(new RegExp(`${$}[0-9;]*m`,"g"),"").split(`
|
|
3
3
|
`).filter((Q)=>Q.trim()),H=!1;for(let Q of Y){if(Q.includes("Package")&&Q.includes("Current")&&Q.includes("Update")){H=!0;continue}if(!H||!Q.trim())continue;if(Q.match(/^[\u2502\u251C\u2500\u253C\u2524\u2514\u2534\u2518\u250C\u252C\u2510|\-\s]+$/))continue;let z;if(Q.includes("\u2502"))z=Q.split("\u2502").map((G)=>G.trim());else z=Q.split("|").map((G)=>G.trim());if(z.length>=4){let G=z[1]?.trim()||"",_=z[2]?.trim()||"",I=z[3]?.trim()||"",W=z[4]?.trim()||"",L=z.length>=6?z[5]?.trim():void 0;if(G=G.replace(/\s*\(dev\)$/,"").replace(/\s*\(peer\)$/,"").replace(/\s*\(optional\)$/,""),G&&_&&W&&G!=="Package"){let O={name:G,current:_,update:I,latest:W};if(L&&L!=="Workspace")O.workspace=L;Z.push(O)}}}return Z}async getPackageJsonOutdated(X){try{let Z=F.join(this.projectPath,"package.json");if(!q.existsSync(Z))return[];let $;try{let I=q.readFileSync(Z,"utf-8"),W=JSON.parse(I);if(W===null||typeof W!=="object"||Array.isArray(W))throw new B(`package.json at ${Z} is not a JSON object`);$=W}catch(I){if(I instanceof B)throw I;let W=I instanceof Error?I.message:String(I);throw new B(`Failed to parse ${Z}: ${W}`)}let K=(I)=>{let W=$[I];return W&&typeof W==="object"&&!Array.isArray(W)?W:{}},Y={...K("dependencies"),...K("devDependencies"),...K("peerDependencies")},H=Object.keys(Y),Q=this.config?.packages?.ignore||[],z=this.config?.packages?.excludeMajor??!1,G=(X?H.filter((I)=>X.split(" ").some((W)=>I.includes(W))):H).flatMap((I)=>{if(!Y[I]||Q.includes(I))return[];let W=this.cleanVersionRange(Y[I]);return W?[{packageName:I,cleanVersion:W}]:[]});return(await M(G,async({packageName:I,cleanVersion:W})=>{let L=await this.getLatestVersion(I);if(!L)return null;if(Bun.semver.order(W,L)>=0)return null;if(z&&E(W,L)==="major")return null;return{name:I,current:W,update:L,latest:L}},this.concurrency)).filter((I)=>I!==null)}catch(Z){return this.logger.warn("Failed to check package.json versions:",Z),[]}}cleanVersionRange(X){if(X.startsWith("workspace:"))return null;return X.replace(/^[\^~>=<]/,"").trim()}async runCommand(X,Z){return new Promise(($,K)=>{let Y=N(X,Z,{cwd:this.projectPath,stdio:"pipe"}),H="",Q="";Y.stdout?.on("data",(z)=>{H+=z.toString()}),Y.stderr?.on("data",(z)=>{Q+=z.toString()}),Y.on("close",(z)=>{if(z===0)$(H);else K(Error(`Command failed with code ${z}: ${Q}`))}),Y.on("error",(z)=>{K(z)})})}getReleaseNotesUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/releases`;return}getChangelogUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/blob/main/CHANGELOG.md`;return}async getUpdatesForWorkspace(X){try{C(X,"workspace name");let Z=["outdated","--filter",X],$=await this.runCommand("bun",Z),K=this.parseBunOutdatedOutput($),Y=[];for(let H of K){let Q=E(H.current,H.latest),z=await this.getPackageMetadata(H.name);Y.push({name:H.name,currentVersion:H.current,newVersion:H.latest,updateType:Q,dependencyType:"dependencies",file:`${X}/package.json`,metadata:z,releaseNotesUrl:this.getReleaseNotesUrl(H.name,z),changelogUrl:this.getChangelogUrl(H.name,z),homepage:z?.homepage})}return Y}catch(Z){return this.logger.warn(`Failed to get updates for workspace ${X}:`,Z),[]}}async searchPackages(X,Z=10){try{let $=encodeURIComponent(X),Y=`${w(void 0,this.config,this.projectPath)}/-/v1/search?text=${$}&size=${Z}`,H=await A(Y,{headers:{"User-Agent":"buddy"}});if(!H.ok)throw Error(`HTTP ${H.status}: ${H.statusText}`);return(await H.json()).objects?.map((z)=>({name:z.package.name,version:z.package.version,description:z.package.description,keywords:z.package.keywords}))??[]}catch($){return this.logger.warn("Failed to search packages via registry API:",$),[]}}async getComposerOutdatedPackages(){this.logger.info("Checking for outdated Composer packages...");let X=[];try{this.logger.info("\uD83D\uDD0D Checking Composer availability...");try{let Q=await this.runCommand("composer",["--version"]);this.logger.info("\u2705 Composer version:",Q.split(`
|
|
4
4
|
`)[0])}catch(Q){return this.logger.info("\u274C Composer not available:",Q),this.logger.warn("Composer not found, skipping Composer package updates"),[]}let Z=F.join(this.projectPath,"composer.json");if(this.logger.info(`\uD83D\uDD0D Reading composer.json from: ${Z}`),!q.existsSync(Z))return this.logger.info("\u274C composer.json not found"),[];let $=q.readFileSync(Z,"utf8"),K=JSON.parse($);this.logger.info("\uD83D\uDCE6 composer.json require packages:",Object.keys(K.require||{})),this.logger.info("\uD83D\uDCE6 composer.json require-dev packages:",Object.keys(K["require-dev"]||{})),this.logger.info("\uD83D\uDD0D Running composer outdated (including dev dependencies)...");let Y=await this.runCommand("composer",["outdated","--format=json"]);this.logger.info("\uD83D\uDCCA Raw composer outdated output length:",Y.length);let H;try{H=JSON.parse(Y),this.logger.info(`\uD83D\uDCCB Composer outdated found ${H.installed?.length||0} packages`)}catch(Q){return this.logger.info("\u274C Failed to parse composer outdated JSON:",Q),this.logger.info("Raw output:",Y.substring(0,500)),[]}if(H.installed){this.logger.info("\uD83D\uDD04 Processing outdated packages...");for(let Q of H.installed)if(this.logger.info(`
|
|
5
|
-
\uD83D\uDCE6 Processing package: ${Q.name}`),this.logger.info(` Current version: ${Q.version}`),this.logger.info(` Latest version: ${Q.latest}`),Q.name&&Q.version&&Q.latest){let z=K.require?.[Q.name],G=K["require-dev"]?.[Q.name],_=z||G;if(this.logger.info(` Constraint: ${_||"NOT FOUND"}`),!_){this.logger.info(` \u26A0\uFE0F Skipping ${Q.name} - not found in composer.json`);continue}if((this.config?.packages?.ignore||[]).includes(Q.name)){this.logger.info(` \u26A0\uFE0F Skipping ${Q.name} - in ignore list`);continue}let W="require";if(K["require-dev"]&&K["require-dev"][Q.name])W="require-dev";this.logger.info(` Dependency type: ${W}`);let L=await this.getComposerPackageMetadata(Q.name),O=this.extractConstraintBaseVersion(_);if(this.logger.info(` Constraint base version: ${O}`),!O){this.logger.warn(`\u274C Could not extract base version from constraint "${_}" for ${Q.name}`);continue}let S=O,b=Q.latest;this.logger.info(` Using current version: ${S} (from constraint)`),this.logger.info(` Target latest version: ${b}`);let j=[];try{this.logger.info(` \uD83D\uDD0D Getting available versions for ${Q.name}...`);let x=await this.runCommand("composer",["show",Q.name,"--available","--format=json"]),U=JSON.parse(x);if(U.versions)j=U.versions,this.logger.info(` \uD83D\uDCCB Found ${j.length} available versions`)}catch(x){this.logger.warn(`\u274C Failed to get available versions for ${Q.name}, using latest only:`,x),j=[b]}this.logger.info(" \uD83C\uDFAF Finding best constraint updates...");let D=await this.findBestConstraintUpdates(_,j,S);this.logger.info(` \uD83D\uDCCA Found ${D.length} update candidates`);for(let x of D){let U=E(S,x.version);if(this.logger.info(` \uD83D\uDCC8 Update candidate: ${S} \u2192 ${x.version} (${U})`),(this.config?.packages?.excludeMajor??!1)&&U==="major"){this.logger.info(` \u26A0\uFE0F Skipping major update for ${Q.name} - excludeMajor is true`);continue}this.logger.info(` \u2705 Adding update: ${Q.name} ${S} \u2192 ${x.version}`),X.push({name:Q.name,currentVersion:S,newVersion:x.version,updateType:U,dependencyType:W,file:"composer.json",metadata:L,releaseNotesUrl:this.getComposerReleaseNotesUrl(Q.name,L),changelogUrl:this.getComposerChangelogUrl(Q.name,L),homepage:L?.homepage})}}}return this.logger.info(`\u2705 Final result: Found ${X.length} Composer package updates`),this.logger.success(`Found ${X.length} Composer package updates`),X}catch(Z){return this.logger.warn("Failed to check for outdated Composer packages:",Z),[]}}parseVersion(X){let $=X.replace(/^v/,"").split("-")[0].split("+")[0].split(".").map((K)=>Number.parseInt(K,10));if($.length<2||$.some((K)=>Number.isNaN(K)))return null;return{major:$[0]||0,minor:$[1]||0,patch:$[2]||0}}compareVersions(X,Z){let $=this.parseVersion(X),K=this.parseVersion(Z);if(!$||!K)return 0;if($.major!==K.major)return $.major-K.major;if($.minor!==K.minor)return $.minor-K.minor;return $.patch-K.patch}async getComposerPackageMetadata(X){try{let $=(await this.fetchComposerPackage(X))?.package;if(!$?.versions)return;let K=Object.keys($.versions),Y=K.find((Q)=>!Q.includes("dev")&&!Q.includes("alpha")&&!Q.includes("beta"))??K[0],H=(Y?$.versions[Y]:void 0)??{};return{name:$.name??X,description:H.description,repository:H.source?.url??H.homepage,homepage:H.homepage,license:Array.isArray(H.license)?H.license.join(", "):H.license,author:H.authors?.[0]?.name,keywords:H.keywords,latestVersion:Y,versions:K,weeklyDownloads:$.downloads?.monthly,dependencies:H.require,devDependencies:H["require-dev"]}}catch(Z){this.logger.warn(`Failed to get Composer metadata for ${X}:`,Z);return}}async composerPackageExists(X){try{return await this.fetchComposerPackage(X)!==null}catch{return!1}}async getComposerLatestVersion(X){try{let $=(await this.fetchComposerPackage(X))?.package;if(!$?.versions)return null;let K=Object.keys($.versions),Y=K.filter((Q)=>!Q.includes("dev")&&!Q.includes("alpha")&&!Q.includes("beta")&&!Q.includes("rc"));if(Y.length===0)return K[0]||null;let H=Y.sort((Q,z)=>{try{if(typeof Bun<"u"&&Bun.semver)return Bun.semver.order(Q,z);return Q.localeCompare(z,void 0,{numeric:!0})}catch{return Q.localeCompare(z)}});return H[H.length-1]||null}catch(Z){return this.logger.warn(`Failed to get latest Composer version for ${X}:`,Z),null}}getComposerReleaseNotesUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/releases`;return}getComposerChangelogUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/blob/main/CHANGELOG.md`;return}extractConstraintBaseVersion(X){let Z=X.match(/^[\^~>=<]*([\d.]+)/);if(Z)return Z[1];return null}async findBestConstraintUpdates(X,Z,$){let{getUpdateType:K}=await import("./chunk-
|
|
5
|
+
\uD83D\uDCE6 Processing package: ${Q.name}`),this.logger.info(` Current version: ${Q.version}`),this.logger.info(` Latest version: ${Q.latest}`),Q.name&&Q.version&&Q.latest){let z=K.require?.[Q.name],G=K["require-dev"]?.[Q.name],_=z||G;if(this.logger.info(` Constraint: ${_||"NOT FOUND"}`),!_){this.logger.info(` \u26A0\uFE0F Skipping ${Q.name} - not found in composer.json`);continue}if((this.config?.packages?.ignore||[]).includes(Q.name)){this.logger.info(` \u26A0\uFE0F Skipping ${Q.name} - in ignore list`);continue}let W="require";if(K["require-dev"]&&K["require-dev"][Q.name])W="require-dev";this.logger.info(` Dependency type: ${W}`);let L=await this.getComposerPackageMetadata(Q.name),O=this.extractConstraintBaseVersion(_);if(this.logger.info(` Constraint base version: ${O}`),!O){this.logger.warn(`\u274C Could not extract base version from constraint "${_}" for ${Q.name}`);continue}let S=O,b=Q.latest;this.logger.info(` Using current version: ${S} (from constraint)`),this.logger.info(` Target latest version: ${b}`);let j=[];try{this.logger.info(` \uD83D\uDD0D Getting available versions for ${Q.name}...`);let x=await this.runCommand("composer",["show",Q.name,"--available","--format=json"]),U=JSON.parse(x);if(U.versions)j=U.versions,this.logger.info(` \uD83D\uDCCB Found ${j.length} available versions`)}catch(x){this.logger.warn(`\u274C Failed to get available versions for ${Q.name}, using latest only:`,x),j=[b]}this.logger.info(" \uD83C\uDFAF Finding best constraint updates...");let D=await this.findBestConstraintUpdates(_,j,S);this.logger.info(` \uD83D\uDCCA Found ${D.length} update candidates`);for(let x of D){let U=E(S,x.version);if(this.logger.info(` \uD83D\uDCC8 Update candidate: ${S} \u2192 ${x.version} (${U})`),(this.config?.packages?.excludeMajor??!1)&&U==="major"){this.logger.info(` \u26A0\uFE0F Skipping major update for ${Q.name} - excludeMajor is true`);continue}this.logger.info(` \u2705 Adding update: ${Q.name} ${S} \u2192 ${x.version}`),X.push({name:Q.name,currentVersion:S,newVersion:x.version,updateType:U,dependencyType:W,file:"composer.json",metadata:L,releaseNotesUrl:this.getComposerReleaseNotesUrl(Q.name,L),changelogUrl:this.getComposerChangelogUrl(Q.name,L),homepage:L?.homepage})}}}return this.logger.info(`\u2705 Final result: Found ${X.length} Composer package updates`),this.logger.success(`Found ${X.length} Composer package updates`),X}catch(Z){return this.logger.warn("Failed to check for outdated Composer packages:",Z),[]}}parseVersion(X){let $=X.replace(/^v/,"").split("-")[0].split("+")[0].split(".").map((K)=>Number.parseInt(K,10));if($.length<2||$.some((K)=>Number.isNaN(K)))return null;return{major:$[0]||0,minor:$[1]||0,patch:$[2]||0}}compareVersions(X,Z){let $=this.parseVersion(X),K=this.parseVersion(Z);if(!$||!K)return 0;if($.major!==K.major)return $.major-K.major;if($.minor!==K.minor)return $.minor-K.minor;return $.patch-K.patch}async getComposerPackageMetadata(X){try{let $=(await this.fetchComposerPackage(X))?.package;if(!$?.versions)return;let K=Object.keys($.versions),Y=K.find((Q)=>!Q.includes("dev")&&!Q.includes("alpha")&&!Q.includes("beta"))??K[0],H=(Y?$.versions[Y]:void 0)??{};return{name:$.name??X,description:H.description,repository:H.source?.url??H.homepage,homepage:H.homepage,license:Array.isArray(H.license)?H.license.join(", "):H.license,author:H.authors?.[0]?.name,keywords:H.keywords,latestVersion:Y,versions:K,weeklyDownloads:$.downloads?.monthly,dependencies:H.require,devDependencies:H["require-dev"]}}catch(Z){this.logger.warn(`Failed to get Composer metadata for ${X}:`,Z);return}}async composerPackageExists(X){try{return await this.fetchComposerPackage(X)!==null}catch{return!1}}async getComposerLatestVersion(X){try{let $=(await this.fetchComposerPackage(X))?.package;if(!$?.versions)return null;let K=Object.keys($.versions),Y=K.filter((Q)=>!Q.includes("dev")&&!Q.includes("alpha")&&!Q.includes("beta")&&!Q.includes("rc"));if(Y.length===0)return K[0]||null;let H=Y.sort((Q,z)=>{try{if(typeof Bun<"u"&&Bun.semver)return Bun.semver.order(Q,z);return Q.localeCompare(z,void 0,{numeric:!0})}catch{return Q.localeCompare(z)}});return H[H.length-1]||null}catch(Z){return this.logger.warn(`Failed to get latest Composer version for ${X}:`,Z),null}}getComposerReleaseNotesUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/releases`;return}getComposerChangelogUrl(X,Z){if(!Z?.repository)return;let $=Z.repository.match(/github\.com[/:]([^/]+\/[^/]+)/);if($)return`https://github.com/${$[1].replace(".git","")}/blob/main/CHANGELOG.md`;return}extractConstraintBaseVersion(X){let Z=X.match(/^[\^~>=<]*([\d.]+)/);if(Z)return Z[1];return null}async findBestConstraintUpdates(X,Z,$){let{getUpdateType:K}=await import("./chunk-a6hv92fx.js"),Y=[],H=this.parseVersion($);if(!H)return[];let Q=null,z=null,G=null;for(let _ of Z){if(_.includes("dev")||_.includes("alpha")||_.includes("beta")||_.includes("RC"))continue;let I=this.parseVersion(_);if(!I)continue;if(this.compareVersions(_,$)<=0)continue;let L=K($,_);if(L==="patch"&&I.major===H.major&&I.minor===H.minor){if(!Q||this.compareVersions(_,Q)>0)Q=_}else if(L==="minor"&&I.major===H.major){if(!z||this.compareVersions(_,z)>0)z=_}else if(L==="major"){if(!G||this.compareVersions(_,G)>0)G=_}}if(Q)Y.push({version:Q,type:"patch"});if(z)Y.push({version:z,type:"minor"});if(G)Y.push({version:G,type:"major"});return Y}async getWorkspaceOutdatedPackages(){try{let X=await this.getWorkspaceNames(),Z=await this.findPackageJsonFiles(),$=[];this.logger.info(`Found ${X.length} workspace packages to check`);for(let K of X)try{let Y=await this.runBunOutdatedForWorkspace(K);$.push(...Y)}catch(Y){this.logger.warn(`Failed to check workspace ${K}:`,Y)}this.logger.info(`Checking ${Z.length} package.json files directly`);for(let K of Z){if(K==="package.json")continue;try{let Y=F.join(this.projectPath,K),H=q.readFileSync(Y,"utf-8"),Q=JSON.parse(H),z={...Q.dependencies,...Q.devDependencies,...Q.peerDependencies,...Q.optionalDependencies};for(let[G,_]of Object.entries(z)){if(typeof _!=="string"||_.startsWith("workspace:"))continue;if($.some((I)=>I.name===G))continue;try{let I=await this.getLatestVersion(G);if(I){let W=this.cleanVersionRange(_);if(W&&Bun.semver.order(W,I)<0)$.push({name:G,current:W,update:I,latest:I,file:K})}}catch{continue}}}catch(Y){this.logger.warn(`Failed to check packages in ${K}:`,Y)}}return this.logger.info(`Found ${$.length} outdated packages across workspaces`),$}catch(X){return this.logger.warn("Failed to check workspace packages:",X),[]}}async getWorkspaceNames(){let X=[],Z=await this.findPackageJsonFiles();for(let $ of Z)try{let K=F.join(this.projectPath,$),Y=q.readFileSync(K,"utf-8"),H=JSON.parse(Y);if(H.name&&$!=="package.json")X.push(H.name)}catch(K){this.logger.warn(`Failed to parse package.json ${$}:`,K)}return X}async findPackageJsonFiles(){let X=[],Z=async($,K="")=>{try{let Y=await q.promises.readdir($);for(let H of Y){let Q=F.join($,H),z=K?F.join(K,H):H,G=await q.promises.stat(Q);if(G.isDirectory()){if(!this.shouldSkipDirectory(H))await Z(Q,z)}else if(G.isFile()&&H==="package.json")X.push(z)}}catch{}};return await Z(this.projectPath),X}shouldSkipDirectory(X){return h(X)}async findPackageLocation(X){let Z=await this.findPackageJsonFiles();for(let $ of Z)try{let K=F.join(this.projectPath,$),Y=q.readFileSync(K,"utf-8"),H=JSON.parse(Y);if({...H.dependencies,...H.devDependencies,...H.peerDependencies,...H.optionalDependencies}[X])return $}catch{continue}return null}async getPackageVersionReleaseDate(X,Z){try{let K=(await this.fetchPackument(X))?.time?.[Z];if(!K)return null;let Y=new Date(K);return Number.isNaN(Y.getTime())?null:Y}catch($){return this.logger.debug(`Failed to get release date for ${X}@${Z}:`,$),null}}async getGitHubActionReleaseDate(X,Z){try{let[$,K]=X.split("/");if(!$||!K)return null;let Y=`${y(this.config)}/repos/${$}/${K}/releases/tags/${encodeURIComponent(Z)}`,H=await V(Y,{headers:g(this.config)});if(!H?.published_at)return null;let Q=new Date(H.published_at);return Number.isNaN(Q.getTime())?null:Q}catch($){return this.logger.debug(`Failed to get GitHub Action release date for ${X}@${Z}:`,$),null}}async getComposerPackageReleaseDate(X,Z){try{let K=(await this.fetchComposerPackage(X))?.package?.versions?.[Z]?.time;if(!K)return null;let Y=new Date(K);return Number.isNaN(Y.getTime())?null:Y}catch($){return this.logger.debug(`Failed to get Composer package release date for ${X}@${Z}:`,$),null}}async getDockerImageReleaseDate(X,Z){try{return this.logger.debug(`Docker image release date checking not fully implemented for ${X}:${Z}`),null}catch($){return this.logger.debug(`Failed to get Docker image release date for ${X}:${Z}:`,$),null}}async meetsMinimumReleaseAge(X,Z,$,K){let Y=K??this.config?.packages?.minimumReleaseAge??0,H=this.config?.packages?.minimumReleaseAgeExclude??[];if(Y===0)return!0;if(H.includes(X))return this.logger.debug(`Package ${X} is excluded from minimum release age requirement`),!0;let Q=null;switch($){case"github-actions":Q=await this.getGitHubActionReleaseDate(X,Z);break;case"require":case"require-dev":Q=await this.getComposerPackageReleaseDate(X,Z);break;case"docker-image":Q=await this.getDockerImageReleaseDate(X,Z);break;default:Q=await this.getPackageVersionReleaseDate(X,Z);break}if(!Q)return this.logger.warn(`Could not determine release date for ${X}@${Z} (${$||"unknown type"}), allowing update`),!0;let G=(new Date().getTime()-Q.getTime())/60000,_=G>=Y;if(!_)this.logger.info(`Package ${X}@${Z} (${$||"unknown type"}) is too new (${Math.round(G)} minutes old, minimum: ${Y} minutes)`);return _}async runBunOutdatedForWorkspace(X){try{C(X,"workspace name");let Z=await this.runCommand("bun",["outdated","--filter",X]);return this.parseBunOutdatedOutput(Z).map((K)=>({...K,workspace:X}))}catch(Z){return this.logger.warn(`Failed to run bun outdated for workspace ${X}:`,Z),[]}}}
|
|
6
6
|
export{P as gd,M as hd,m as id,J as jd,k as kd};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var F=1,G=30000,V=/<!--\s*buddy:manifest\s+v(\d+)\s*([\s\S]*?)-->/;function W(B){return{name:B.name,current:B.currentVersion,target:B.newVersion,type:B.updateType,file:B.file,dependencyType:B.dependencyType}}function Y(B,C={}){let D={schemaVersion:1,updates:[],...C.group?{group:C.group}:{},...C.strategy?{strategy:C.strategy}:{},...C.branch?{branch:C.branch}:{},generatedAt:C.generatedAt??new Date().toISOString()},L=B.map(W),H=Q({...D,updates:L});if(H.length<=30000)return H;let K=L.map(({name:O,current:$,target:j,file:x})=>({name:O,current:$,target:j,file:x}));if(H=Q({...D,updates:K}),H.length<=30000)return H;let J=K.length;while(J>0)if(J=Math.floor(J*0.9),H=Q({...D,updates:K.slice(0,J),truncated:!0}),H.length<=30000)return H;return Q({...D,updates:[],truncated:!0})}function Q(B){return`
|
|
3
|
+
|
|
4
|
+
<!-- buddy:manifest v1
|
|
5
|
+
${JSON.stringify(B)}
|
|
6
|
+
-->`}function I(B,C={}){return Y(B.updates,{group:B.name,...C})}function Z(B){if(!B)return null;let C=B.match(V);if(!C)return null;try{let D=JSON.parse(C[2].trim());if(!z(D))return null;return{...D,schemaVersion:Number(D.schemaVersion)||Number(C[1])||1,updates:D.updates.filter(A)}}catch{return null}}function P(B){return Z(B)!==null}function q(B){return B.replace(V,"").trimEnd()}function U(B,C,D={}){return q(B)+Y(C,D)}function X(B){return B.updates.map((C)=>({name:C.name,currentVersion:C.current,newVersion:C.target}))}function _(B){return[...new Set(B.updates.map((C)=>C.file).filter(Boolean))]}function z(B){if(typeof B!=="object"||B===null)return!1;return Array.isArray(B.updates)}function A(B){if(typeof B!=="object"||B===null)return!1;let C=B;return typeof C.name==="string"&&typeof C.current==="string"&&typeof C.target==="string"}function S(B,C,D){let L=Z(C)?.group;if(L){let K=B.find((J)=>J.name===L);if(K)return K}let H=new Set(D);return B.find((K)=>{let J=new Set(K.updates.map((O)=>O.name));return J.size===H.size&&[...H].every((O)=>J.has(O))})}
|
|
7
|
+
export{F as pg,G as qg,Y as rg,I as sg,Z as tg,P as ug,q as vg,U as wg,X as xg,_ as yg,S as zg};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mb as w}from"./chunk-
|
|
2
|
+
import{mb as w}from"./chunk-v808b36p.js";import{Ab as u,Bb as v,Cb as x,Db as y,nb as d,ob as e,pb as f,qb as g,rb as h,sb as i,tb as j,ub as k,vb as l,wb as q,xb as r,yb as s,zb as t}from"./chunk-7b156stw.js";import{Eb as a,Fb as b,Gb as c}from"./chunk-q2tjkhez.js";import{Lb as m,Mb as n,Nb as o,Pb as p}from"./chunk-5yfaptmp.js";import"./chunk-sn0qr6q7.js";import"./chunk-5sh69bkj.js";import{Ed as z,Fd as A,Gd as B,Hd as C,Id as D,Jd as E,Kd as F,Ld as G,Md as H,Nd as I}from"./chunk-7m3pzkcj.js";import"./chunk-2b07w74s.js";import"./chunk-142zh7e5.js";import"./chunk-y1d6e0ye.js";import"./chunk-24xvskkf.js";import"./chunk-z18bksyr.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{g as validateFindings,I as shouldFail,n as serializeReviewState,y as runReviewForPR,x as reviewPullRequest,j as reviewDiff,w as resolveBuddyThreads,u as renderFinding,b as renderDiffForReview,v as prepareReview,a as parseUnifiedDiff,o as parseReviewState,p as needsReview,s as loadGuidelines,G as formatReview,C as formatPretty,D as formatGithub,E as formatAgent,f as fingerprint,A as diffArgsFor,l as defaultIncludePath,h as dedupeFindings,F as countBySeverity,t as composeInstructions,B as collectLocalDiff,c as collectGitDiff,H as applySuggestion,k as anchorMap,d as SEVERITY_ORDER,m as REVIEW_STATE_VERSION,e as REVIEW_SCHEMA,z as REVIEW_FORMATS,r as MAX_GUIDELINE_CHARS,q as DEFAULT_GUIDELINE_FILES,i as DEFAULT_EXCLUDED_PATHS};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{fl as Z}from"./chunk-s82adeq9.js";import x from"process";var K=["github","gitlab","bitbucket"],$=["github","gitlab","bitbucket"],H={},L={pinIssues:!1,checkRuns:!1,inlineReviewComments:!1,reviewSuggestions:!1,nativeAutoMerge:!1,commentReactions:!1,ciLogs:!1,ciRuns:!1,reviewThreads:!1,teamReviewers:!1,draftPullRequests:!1,permissionLookup:!1,branchHousekeeping:!1,reopenPullRequests:!1,labels:!1};class Y extends Error{provider;trackingIssue;constructor(j,z,F){super(j);this.provider=z;this.trackingIssue=F;this.name="UnsupportedProviderError"}}var B={github:["GITHUB_TOKEN","BUDDY_TOKEN"],gitlab:["CI_JOB_TOKEN","GITLAB_TOKEN","BUDDY_TOKEN"],bitbucket:["BITBUCKET_TOKEN","BUDDY_TOKEN"]};function A(j,z=x.env){for(let F of B[j]??[]){let J=z[F]?.trim();if(J)return{token:J,source:F}}return null}function C(j){if($.includes(j))return;let z=H[j];if(z)throw new Y(`'${j}' support is not implemented yet \u2014 follow ${z}. Supported today: ${$.join(", ")}.`,j,z);throw new Y(`Unknown git provider '${j}'. Supported: ${$.join(", ")}.`,j)}async function M(j,z={}){let F=j.provider??"github";C(F);let J=z.env??x.env,X=j.token??A(F,J)?.token;if(!X)throw Error(`No token for ${F}. Set one of: ${B[F].join(", ")}.`);switch(F){case"gitlab":{let{GitLabProvider:Q}=await import("./chunk-d3m5kcpp.js");return new Q(X,j.owner,j.name,j.apiUrl,z.logger)}case"bitbucket":{let{BitbucketProvider:Q}=await import("./chunk-87k997bm.js");return new Q(X,j.owner,j.name,j.apiUrl,z.logger)}case"github":{let{GitHubProvider:Q}=await import("./chunk-v9avf6sc.js"),q=j.workflowToken??J.BUDDY_TOKEN;return new Q(X,j.owner,j.name,Boolean(q),q,j.apiUrl,z.logger)}}}function W(j,z,F){return j.capabilities()[z]===!0&&typeof j[F]==="function"}function S(j,z,F,J){if(W(j,z,F))return;throw new Y(`This provider does not support ${J} (missing capability '${z}').`,"unknown")}
|
|
3
3
|
export{K as ie,$ as je,H as ke,L as le,Y as me,B as ne,A as oe,C as pe,M as qe,W as re,S as se};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-rb1fh9vd.js";import{$d as n,Od as a,Pd as b,Qd as c,Rd as d,Sd as e,Td as f,Ud as g,Vd as h,Wd as i,Xd as j,Yd as k,Zd as l,_d as m,ae as o,be as p,ce as q,de as r,ee as s,fe as t}from"./chunk-
|
|
2
|
+
import"./chunk-rb1fh9vd.js";import{$d as n,Od as a,Pd as b,Qd as c,Rd as d,Sd as e,Td as f,Ud as g,Vd as h,Wd as i,Xd as j,Yd as k,Zd as l,_d as m,ae as o,be as p,ce as q,de as r,ee as s,fe as t}from"./chunk-2b07w74s.js";import"./chunk-142zh7e5.js";import"./chunk-24xvskkf.js";import"./chunk-zwtx6vn3.js";import"./chunk-s82adeq9.js";export{r as syntaxAnalyzer,q as shellcheckAnalyzer,p as secretsAnalyzer,b as runTool,t as runAnalyzers,e as relativize,d as parseToolJson,j as offsetToLine,n as markdownlintAnalyzer,c as mapSeverity,m as linterAnalyzer,i as hadolintAnalyzer,h as githubActionsAnalyzer,l as detectLinter,f as commandExists,g as actionlintAnalyzer,a as TOOL_TIMEOUT_MS,o as SECRET_RULES,k as LINTER_SPECS,s as BUILTIN_ANALYZERS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ld as a}from"./chunk-edm12hnb.js";import"./chunk-bnp0r4eh.js";import"./chunk-0f1xye20.js";import"./chunk-ma01xp3y.js";import"./chunk-gjhxc6ma.js";import"./chunk-3a63hke8.js";import"./chunk-j46f90n8.js";import"./chunk-94tnmc7j.js";import"./chunk-drmk6r1m.js";import"./chunk-7t8s2mcf.js";import"./chunk-34vracy4.js";import"./chunk-zwtx6vn3.js";import"./chunk-028354j6.js";import"./chunk-s82adeq9.js";export{a as PackageScanner};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{pg as a,qg as b,rg as c,sg as d,tg as e,ug as f,vg as g,wg as h,xg as i,yg as j,zg as k}from"./chunk-x9vpk4kk.js";import"./chunk-s82adeq9.js";export{h as withManifest,g as stripManifest,c as serializeManifest,d as serializeGroupManifest,e as parseManifest,i as manifestUpdates,j as manifestFiles,f as hasManifest,k as findGroupForPullRequest,a as MANIFEST_SCHEMA_VERSION,b as MANIFEST_MAX_LENGTH};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{D as s,E as t,F as u,G as v,H as w,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,u as p,v as q,w as r}from"./chunk-
|
|
2
|
+
import{D as s,E as t,F as u,G as v,H as w,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,u as p,v as q,w as r}from"./chunk-37zd94a7.js";import"./chunk-s82adeq9.js";export{r as toFile,v as default,w as betaRefusalFallbackMiddleware,l as UnprocessableEntityError,f as RetryableError,m as RateLimitError,i as PermissionDeniedError,q as PagePromise,j as NotFoundError,n as InternalServerError,s as HUMAN_PROMPT,k as ConflictError,o as BetaFallbackState,u as BaseAnthropic,g as BadRequestError,h as AuthenticationError,a as AnthropicError,v as Anthropic,c as APIUserAbortError,p as APIPromise,b as APIError,e as APIConnectionTimeoutError,d as APIConnectionError,t as AI_PROMPT};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
class I extends Error{status;method;url;repository;responseBody;constructor(j,k,q,P,Q,S){super(j);this.status=k;this.method=q;this.url=P;this.repository=Q;this.responseBody=S;this.name="GitHubApiError"}get isNotFound(){return this.status===404||this.status===410}get isForbidden(){return this.status===403}}function G(j,k=2000){let q=J(j);return q.length>k?`${q.slice(0,k)}\u2026 (truncated)`:q}function J(j){if(j instanceof Error){let k=j.cause;if(k!==void 0&&k!==null){let q=k instanceof Error?k.message:String(k);if(q&&!j.message.includes(q))return`${j.message} (cause: ${q})`}return j.message}if(typeof j==="string")return j;try{return JSON.stringify(j)}catch{return String(j)}}import K from"process";var C={silent:0,error:1,warn:2,info:3,debug:4};function B(j){return j.map((k)=>k instanceof Error?G(k):k)}function N(){let j=K.env.BUDDY_LOG_LEVEL?.toLowerCase();return j&&j in C?j:void 0}class z{level;constructor(j=!1,k){this.level=k??N()??(j?"debug":"info")}enabled(j){return C[this.level]>=C[j]}info(j,...k){if(this.enabled("info"))console.log(j,...B(k))}warn(j,...k){if(this.enabled("warn"))console.warn(j,...B(k))}error(j,...k){if(this.enabled("error"))console.error(j,...B(k))}debug(j,...k){if(this.enabled("debug"))console.log(`\x1B[90m\uD83D\uDC1B\x1B[0m ${j}`,...B(k))}success(j,...k){if(this.enabled("info"))console.log(`\x1B[32m\u2713\x1B[0m ${j}`,...B(k))}get logLevel(){return this.level}static verbose(){return new z(!0,"debug")}static quiet(){return new z(!1,"info")}static silent(){return new z(!1,"silent")}static withLevel(j){return new z(!1,j)}}var H=new z(!1);function Y(j){H=j}function Z(){return H}
|
|
3
|
-
export{I as
|
|
3
|
+
export{I as Mh,G as Nh,z as Oh,Y as Ph,Z as Qh};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{tg as C,yg as B}from"./chunk-x9vpk4kk.js";import{Ag as v,Bg as x}from"./chunk-94tnmc7j.js";import{yh as w}from"./chunk-7t8s2mcf.js";import{Kh as S}from"./chunk-34vracy4.js";import{fl as T}from"./chunk-s82adeq9.js";var R={critical:"\uD83D\uDD34 Critical",high:"\uD83D\uDFE0 High",moderate:"\uD83D\uDFE1 Moderate",low:"\u26AA Low"};function F(J){let Q=J.filter((O)=>(O.securityAdvisories?.length??0)>0);if(Q.length===0)return"";let q=Q.reduce((O,Z)=>O+(Z.securityAdvisories?.length??0),0),X=`## \uD83D\uDD12 Security Advisories
|
|
3
|
+
|
|
4
|
+
`;X+=`This PR resolves ${q} known ${q===1?"vulnerability":"vulnerabilities"} `,X+=`across ${Q.length} ${Q.length===1?"package":"packages"}.
|
|
5
|
+
|
|
6
|
+
`,X+=`| Package | Severity | Advisory | Fixed in | Summary |
|
|
7
|
+
`,X+=`|---|---|---|---|---|
|
|
8
|
+
`;for(let O of Q)for(let Z of O.securityAdvisories??[]){let L=R[Z.severity]??Z.severity,_=Z.url?`[${Z.id}](${Z.url})`:Z.id,$=Z.aliases.length>0?` (${Z.aliases.join(", ")})`:"",G=Z.summary.replace(/\|/g,"\\|").replace(/\s*\n\s*/g," ").trim();X+=`| \`${O.name}\` | ${L} | ${_}${$} | \`${Z.fixedVersion??"n/a"}\` | ${G} |
|
|
9
|
+
`}return`${X}
|
|
10
|
+
`}async function u(J,Q){try{let q=Q.split("/").pop()||"";if(q==="package.json"){let X=JSON.parse(J),O=[];return W(X.dependencies,"dependencies",Q,O),W(X.devDependencies,"devDependencies",Q,O),W(X.peerDependencies,"peerDependencies",Q,O),W(X.optionalDependencies,"optionalDependencies",Q,O),{path:Q,type:"package.json",content:J,dependencies:O}}if(v(Q))return await x(Q,J);if(q==="composer.json"||q==="composer.lock"){let{parseComposerFile:X}=await import("./chunk-6prz7chv.js");return await X(Q,J)}return null}catch{return null}}function W(J,Q,q,X){if(!J)return;for(let[O,Z]of Object.entries(J))X.push({name:O,currentVersion:Z,type:Q,file:q})}function n(J){let{existsSync:Q}=T("fs"),{join:q}=T("path");if(Q(q(J,"bun.lockb"))||Q(q(J,"bun.lock")))return"bun";if(Q(q(J,"pnpm-lock.yaml")))return"pnpm";if(Q(q(J,"yarn.lock")))return"yarn";if(Q(q(J,"package-lock.json")))return"npm";return"bun"}function d(J,Q){if(Q)return Q;if(J.length===1){let Z=J[0];return`chore(deps): update dependency ${Z.name} to ${Z.newVersion}`}let q=J.filter((Z)=>Z.updateType==="major"),X=J.filter((Z)=>Z.updateType==="minor"),O=J.filter((Z)=>Z.updateType==="patch");if(q.length>0)return`chore(deps): update ${q.length} major dependencies`;else if(X.length>0)return`chore(deps): update ${X.length} minor dependencies`;else return`chore(deps): update ${O.length} patch dependencies`}function o(J,Q){if(Q)return Q;if(J.length===1){let X=J[0];return`chore(deps): update dependency ${X.name} to v${X.newVersion}`}let q=J.filter((X)=>X.updateType==="major");if(q.length>0)return`chore(deps): update ${q.length} major dependencies`;else return"chore(deps): update all non-major dependencies"}function z(J,Q){if(Q)return Q;let q=`This PR contains the following updates:
|
|
11
|
+
|
|
12
|
+
`;q+=F(J),q+=`| Package | Change | Age | Adoption | Passing | Confidence |
|
|
13
|
+
`,q+=`|---|---|---|---|---|---|
|
|
14
|
+
`;for(let O of J){let Z=`\`${O.currentVersion}\` -> \`${O.newVersion}\``,L=O.metadata?.homepage?`[${O.name}](${O.metadata.homepage})`:O.name;q+=`| ${L} | ${Z} | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
|
|
15
|
+
`}q+=`
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
`;let X=J.filter((O)=>O.releaseNotesUrl);if(X.length>0){q+=`### Release Notes
|
|
19
|
+
|
|
20
|
+
`;for(let O of X)if(O.releaseNotesUrl)q+=`<details>
|
|
21
|
+
<summary>${O.name}</summary>
|
|
22
|
+
|
|
23
|
+
`,q+=`[Release Notes](${O.releaseNotesUrl})
|
|
24
|
+
|
|
25
|
+
`,q+=`</details>
|
|
26
|
+
|
|
27
|
+
`}return q+=`### Configuration
|
|
28
|
+
|
|
29
|
+
`,q+=`\uD83D\uDCC5 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
|
|
30
|
+
|
|
31
|
+
`,q+=`\uD83D\uDEA6 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
|
|
32
|
+
|
|
33
|
+
`,q+=`\u267B **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
|
|
34
|
+
|
|
35
|
+
`,q+=`\uD83D\uDD15 **Ignore**: Close this PR and you won't be reminded about this update again.
|
|
36
|
+
|
|
37
|
+
`,q+=`---
|
|
38
|
+
|
|
39
|
+
`,q+=` - [ ] <!-- rebase-check -->If you want to update/retry this PR, check this box
|
|
40
|
+
|
|
41
|
+
`,q+=`---
|
|
42
|
+
|
|
43
|
+
`,q+="This PR was generated by [Buddy](https://github.com/stacksjs/buddy).",q}function i(J,Q="buddy"){if(J.length===1){let X=J[0],O=X.name.replace(/[^a-z0-9-]/gi,"-");return`${Q}/update-${O}-to-${X.newVersion}`}if(J.filter((X)=>X.updateType==="major").length>0)return`${Q}/update-major-dependencies`;return`${Q}/update-dependencies`}function j(J){let Q=new Map;for(let X of J){let O=`${X.name}:${X.currentVersion}:${X.newVersion}`;Q.set(O,[...Q.get(O)??[],X])}let q=[];for(let X of Q.values()){let O=X.filter((L)=>k(L.file));if(O.length>0){let L=new Set;for(let _ of O)if(!L.has(_.file))L.add(_.file),q.push(_);continue}let Z=X[0];for(let L of X.slice(1))if(N(L.file)>N(Z.file))Z=L;q.push(Z)}return q}function k(J){let Q=J.split("/").pop()??"";return Q==="package.json"||Q==="composer.json"}function N(J){if(J==="package.json")return 3;if(J.endsWith("composer.json"))return 2;if(J.includes(".github/workflows/"))return 1;return 0}function s(J,Q={}){let{prioritizeSecurity:q=!0}=Q,X=[],O=j(J),Z=q?O.filter((Y)=>(Y.securityAdvisories?.length??0)>0):[],L=q?O.filter((Y)=>(Y.securityAdvisories?.length??0)===0):O;if(Z.length>0)X.push({name:"Security Updates",updates:Z,updateType:D(Z),title:"fix(deps): update vulnerable dependencies",body:z(Z)});let _=L.filter((Y)=>Y.dependencyType==="github-actions"),$=L.filter((Y)=>Y.dependencyType==="docker-image"),G=L.filter((Y)=>Y.dependencyType!=="github-actions"&&Y.dependencyType!=="docker-image");if(_.length>0)X.push({name:"GitHub Actions",updates:_,updateType:D(_),title:"chore(deps): update github actions",body:z(_)});if($.length>0)X.push({name:"Docker Images",updates:$,updateType:D($),title:"chore(deps): update docker images",body:z($)});let H=G.filter((Y)=>Y.updateType==="major"),K=G.filter((Y)=>Y.updateType==="minor"),I=G.filter((Y)=>Y.updateType==="patch");if(K.length>0||I.length>0){let Y=[...K,...I];X.push({name:"Non-Major Updates",updates:Y,updateType:K.length>0?"minor":"patch",title:"chore(deps): update all non-major dependencies",body:z(Y)})}let A=new Map;for(let Y of H){let E=`${Y.name}@${Y.newVersion}`;A.set(E,[...A.get(E)??[],Y])}for(let Y of A.values()){let E=Y[0];X.push({name:`Major Update - ${E.name}`,updates:Y,updateType:"major",title:`chore(deps): update dependency ${E.name} to ${E.newVersion}`,body:z(Y)})}return X}function D(J){if(J.some((Q)=>Q.updateType==="major"))return"major";if(J.some((Q)=>Q.updateType==="minor"))return"minor";return"patch"}var U={critical:4,high:3,moderate:2,low:1};function V(J){let Q=0;for(let q of J.securityAdvisories??[])Q=Math.max(Q,U[q.severity]??0);return Q}function r(J,Q={}){let{prioritizeSecurity:q=!0}=Q,X={major:3,minor:2,patch:1};return J.sort((O,Z)=>{let L=q?V(O):0,_=q?V(Z):0;if(L!==_)return _-L;let $=X[O.updateType],G=X[Z.updateType];if($!==G)return G-$;return O.name.localeCompare(Z.name)})}function p(J,Q){let q=M(J.replace(/^[v^~>=<@]+/,"")),X=M(Q.replace(/^[v^~>=<@]+/,""));try{if(Bun.semver.order(X,q)<=0)return"patch"}catch{return"patch"}let O=q.split(".").map((H)=>Number.parseInt(H,10)),Z=X.split(".").map((H)=>Number.parseInt(H,10));while(O.length<3)O.push(0);while(Z.length<3)Z.push(0);let[L,_]=O,[$,G]=Z;if($>L)return"major";if($===L&&G>_)return"minor";return"patch"}function M(J){let Q=J.split(".");if(Q.length>=3||!Q.every((q)=>/^\d+$/.test(q)))return J;while(Q.length<3)Q.push("0");return Q.join(".")}function a(J,Q){try{return Bun.semver.satisfies(J,Q)}catch{return!1}}async function t(J,Q,q){if(!J)throw Error("GitHub token is required");try{let X=await S(`${w()}/repos/${Q}/${q}/pulls?state=open`,{headers:{Authorization:`Bearer ${J}`,Accept:"application/vnd.github+json","User-Agent":"buddy"}});if(!X.ok)throw Error(`GitHub API error: ${X.status} ${X.statusText}`);return(await X.json()).filter((L)=>{if(!L.body)return!1;return/\s*-\s*\[x\]\s*<!--\s*rebase-check\s*-->.*(?:rebase|update)\/retry/i.test(L.body)}).map((L)=>({number:L.number,branchName:L.head.ref}))}catch(X){throw Error(`Failed to check for rebase requests: ${X}`)}}function e(J){let Q=C(J);if(Q)return[...new Set(Q.updates.map((O)=>O.name))];let q=[],X=J.match(/\|[^|]*\|[^|]*\|[^|]*\|[^|]*\|/g);if(X)for(let O of X){let Z=O.match(/\[([^\]]+)\]\([^)]*\)/);if(Z)q.push(Z[1])}return q}async function qq(J,Q,q){if(await b(J,Q,q))return!0;if(await m(J,Q,q))return!0;return!1}async function b(J,Q,q){if(!(Q.packages?.respectLatest??!0))return q.debug(`\uD83D\uDD0D PR #${J.number}: respectLatest is false, skipping auto-close`),!1;let O=["latest","*","main","master","develop","dev"],Z=C(J.body);if(Z){let H=Z.updates.filter((K)=>O.includes(K.current.toLowerCase().trim()));for(let K of H)q.debug(`\uD83D\uDD0D PR #${J.number}: Package ${K.name} has dynamic version "${K.current}"`);return q.debug(`\uD83D\uDD0D PR #${J.number}: Should auto-close: ${H.length>0}`),H.length>0}let L=/\|\s*\[([^\]]+)\][^|]*\|\s*\[?`?[v^~>=]*([^`|\s]+)`?\s*(?:->|\u2192)\s*`?[v^~>=]*([^`|\s]+)`?\]?/g,_,$=[];while((_=L.exec(J.body))!==null){let[,H,K]=_,I=K.toLowerCase().trim();if(O.includes(I))$.push(H),q.debug(`\uD83D\uDD0D PR #${J.number}: Package ${H} has dynamic version "${I}"`)}let G=$.length>0;return q.debug(`\uD83D\uDD0D PR #${J.number}: Packages with dynamic versions: ${$.join(", ")}`),q.debug(`\uD83D\uDD0D PR #${J.number}: Should auto-close: ${G}`),G}async function m(J,Q,q){let X=Q.packages?.ignorePaths;if(!X||X.length===0)return q.debug(`\uD83D\uDD0D PR #${J.number}: No ignorePaths configured, skipping auto-close`),!1;let O=P(J.body);if(O.length===0)return q.debug(`\uD83D\uDD0D PR #${J.number}: No file paths found in PR body`),!1;q.debug(`\uD83D\uDD0D PR #${J.number}: Found file paths: ${O.join(", ")}`);let{Glob:Z}=globalThis.Bun,L=O.filter((_)=>{let $=_.replace(/^\.\//,"");return X.some((G)=>{try{return new Z(G).match($)}catch(H){return q.debug(`Failed to match path ${$} against pattern ${G}: ${H}`),!1}})});if(L.length>0)return q.debug(`\uD83D\uDD0D PR #${J.number}: Contains files now in ignorePaths: ${L.join(", ")}`),!0;return q.debug(`\uD83D\uDD0D PR #${J.number}: No files match ignorePaths patterns`),!1}function P(J){let Q=C(J);if(Q)return B(Q);let q=[],X=/\|\s*\[[^\]]+\]\([^)]*\)\s*\|[^|]*\|\s*\*\*([^*]+)\*\*\s*\|/g,O;while((O=X.exec(J))!==null){let $=O[1].trim();if($&&!q.includes($))q.push($)}let Z=/\*\*([^*]+\.(?:json|yaml|yml|lock))\*\*/g;while((O=Z.exec(J))!==null){let $=O[1].trim();if($&&!q.includes($))q.push($)}let L=/\|[^|]+\|[^|]+\|([^|]+)\|[^|]*\|/g;while((O=L.exec(J))!==null){let $=O[1].trim();if($&&($.includes("/")||/\.(?:json|yaml|yml|lock)$/.test($))&&!q.includes($))q.push($)}let _=/(?:^|\s)([\w-]+(?:\/[\w.-]+)*\/[\w.-]+\.(?:json|yaml|yml|lock))(?:\s|$)/gm;while((O=_.exec(J))!==null){let $=O[1].trim();if($&&!q.includes($))q.push($)}return q}
|
|
44
|
+
export{F as bg,u as cg,n as dg,d as eg,o as fg,z as gg,i as hg,s as ig,r as jg,p as kg,a as lg,t as mg,e as ng,qq as og};
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{I as wo,J as So,K as ho,L as uo,M as co,N as Vo,O as eo,P as go,Q as ro,R as vo,S as io,T as so,U as no}from"../chunk-mt53v4sx.js";import{W as ko,X as qo}from"../chunk-5vekh5w1.js";import{$ as Wo,Y as Jo,Z as Ko,_ as Qo}from"../chunk-dsnd6ndd.js";import{aa as PR,ba as aR,ca as lR,da as yR,ea as CR,fa as NR,ga as _R,ha as zR,ia as DR,ja as TR}from"../chunk-69qyr9ef.js";import{ka as pR,la as oR,ma as mR,na as xR,oa as fR,pa as dR,qa as RR,ra as MR,sa as UR,ta as AR,ua as GR,va as ER,wa as OR}from"../chunk-2hb8dan0.js";import{Aa as $o,Ba as bo,Ca as to,xa as Xo,ya as Yo,za as Zo}from"../chunk-a3zgenkh.js";import"../chunk-rb1fh9vd.js";import{Da as pm}from"../chunk-4kr6evh6.js";import{Ea as ed,Fa as gd,Ga as rd,Ha as vd,Ia as id,Ja as sd,Ka as nd}from"../chunk-gzkwszsg.js";import{La as Zd,Ma as $d,Na as bd,Oa as td,Pa as wd,Qa as Sd,Ra as hd,Sa as ud,Ta as cd,Ua as Vd}from"../chunk-42xvqxdw.js";import{Va as Yf,Wa as Zf}from"../chunk-esm5jjgf.js";import{$a as Sf,Xa as $f,Ya as bf,Za as tf,_a as wf,ab as hf,bb as uf,cb as cf,db as Vf,eb as ef,fb as gf,gb as rf}from"../chunk-jqh7vx2n.js";import{hb as vf,ib as sf,jb as nf,kb as pd,lb as od}from"../chunk-b3s185kp.js";import{mb as Id}from"../chunk-be7g40yf.js";import{Ab as Td,Bb as jd,Cb as Ld,Db as Bd,nb as dd,ob as Rd,pb as Md,qb as Ud,rb as Ad,sb as Gd,tb as Ed,ub as Od,vb as Pd,wb as Nd,xb as _d,yb as zd,zb as Dd}from"../chunk-mpb1g0xk.js";import{Eb as md,Fb as xd,Gb as fd}from"../chunk-q2tjkhez.js";import{Hb as Co,Ib as No,Jb as _o,Kb as zo}from"../chunk-vckhctmr.js";import{Lb as ad,Mb as ld,Nb as yd,Pb as Cd}from"../chunk-5yfaptmp.js";import{Qb as Rf,Rb as Mf,Sb as Uf,Tb as Af,Ub as Gf,Vb as Ef,Wb as Of,Xb as Pf,Yb as af}from"../chunk-59993g25.js";import{$b as nx,Zb as ix,_b as sx,ac as pf,bc as of,cc as mf,dc as xf,ec as ff,fc as df}from"../chunk-va3k91tf.js";import{gc as Vp,hc as ep,ic as gp,jc as rp,mc as vp,nc as ip}from"../chunk-40pvn33p.js";import{Ac as Uo,Bc as Ao,Cc as Go,Dc as Eo,Ec as Oo,Fc as Po,Gc as ao,Hc as lo,Ic as yo,pc as sp,sc as np,tc as po,uc as oo,vc as mo,wc as xo,xc as fo,yc as Ro,zc as Mo}from"../chunk-0m1z85m9.js";import{Mc as dp}from"../chunk-afstgmb4.js";import{Nc as mp,Oc as xp,Pc as fp}from"../chunk-csqh2ca4.js";import{Uc as mm,Vc as xm,Wc as fm,Xc as dm}from"../chunk-d9m42wym.js";import{Yc as Bo,Zc as Fo,_c as Ho}from"../chunk-raj75r4h.js";import{$c as Sp,ad as hp,bd as up,cd as cp,ed as Do}from"../chunk-25sjd6zk.js";import"../chunk-08daxhzx.js";import{gd as _p,hd as zp,id as Dp,jd as Tp,kd as jp}from"../chunk-jsf2322c.js";import{ld as wp}from"../chunk-gweqk008.js";import"../chunk-bnp0r4eh.js";import{nd as ex,od as gx,pd as rx,qd as vx}from"../chunk-0f1xye20.js";import{td as Np}from"../chunk-g0x10e1d.js";import{ud as Xf}from"../chunk-7b4jsg36.js";import{Ad as hx,Bd as ux,Cd as cx,Dd as Vx,vd as $x,wd as bx,xd as tx,yd as wx,zd as Sx}from"../chunk-5jvde2as.js";import{Ed as Fd,Fd as Hd,Gd as kd,Hd as qd,Id as Jd,Jd as Kd,Kd as Qd,Ld as Wd,Md as Xd,Nd as Yd}from"../chunk-7m3pzkcj.js";import{$d as Hf,Od as lf,Pd as yf,Qd as Cf,Rd as Nf,Sd as _f,Td as zf,Ud as Df,Vd as Tf,Wd as jf,Xd as If,Yd as Lf,Zd as Bf,_d as Ff,ae as kf,be as qf,ce as Jf,de as Kf,ee as Qf,fe as Wf}from"../chunk-0g4ybxwj.js";import"../chunk-142zh7e5.js";import{ie as Rp,je as Mp,ke as Up,le as Ap,me as Gp,ne as Ep,oe as Op,pe as Pp,qe as ap,re as lp,se as yp}from"../chunk-b6a5txek.js";import"../chunk-wjfw6rx8.js";import"../chunk-w55x2g9n.js";import{Fe as Ip,Ge as Lp,He as Bp,Ie as Fp,Je as Hp,Ke as kp,Le as qp,Me as Jp,Ne as Kp,Oe as Qp,Pe as Wp}from"../chunk-1xe0960b.js";import{We as Cp}from"../chunk-gpjde0j6.js";import{$e as bp,Xe as Xp,Ye as Yp,Ze as Zp,_e as $p,af as tp}from"../chunk-j46f90n8.js";import{df as a,ef as l,ff as y,gf as C,hf as N,if as _,jf as z,kf as D,lf as T,mf as j,nf as I,of as L,pf as B,qf as F,rf as H}from"../chunk-naz864cb.js";import{sf as U,tf as A,uf as G,vf as E,wf as O,yf as P}from"../chunk-pq115qkn.js";import{Af as ax,Bf as lx,Cf as yx,Df as Cx,Ef as Nx,zf as Px}from"../chunk-1pecmenc.js";import{Ff as Lx,Gf as Bx,Hf as Fx,If as Hx,Jf as kx,Kf as qx,Lf as Jx,Mf as Kx,Nf as Qx,Of as Wx,Pf as Xx,Qf as Yx,Rf as Zx}from"../chunk-sxfk3naz.js";import"../chunk-24xvskkf.js";import{Uf as _x,Vf as zx,Wf as Dx,Xf as Tx,Yf as jx,Zf as Ix}from"../chunk-z18bksyr.js";import"../chunk-cj4d5ad7.js";import{bg as e,cg as g,dg as r,eg as v,fg as i,gg as s,hg as n,ig as pp,jg as op,kg as d}from"../chunk-xdrvb89m.js";import"../chunk-knpdntnh.js";import"../chunk-54er1whp.js";import"../chunk-ktn47bq8.js";import{Xg as To,Yg as jo,Zg as Io,_g as Lo,ah as jR,bh as IR,ch as LR,dh as BR,eh as FR,fh as HR,gh as kR,hh as qR,ih as JR,jh as KR,kh as QR,lh as WR,mh as XR,nh as YR,oh as ZR,ph as $R,qh as bR,rh as tR,sh as wR,th as SR,uh as hR,vh as uR}from"../chunk-33h1me7n.js";import{wh as om}from"../chunk-7c1284fb.js";import{Ah as c,Bh as V,xh as S,yh as h,zh as u}from"../chunk-2z9pkk1y.js";import{Ch as t}from"../chunk-k3r7v3dp.js";import{Dh as w}from"../chunk-0rbxek2f.js";import"../chunk-vpw7adwd.js";import{Fh as J,Gh as K,Hh as Q,Ih as W,Jh as X,Kh as Y}from"../chunk-b9szrnxw.js";import{Lh as k,Mh as q,Nh as Z,Oh as $,Ph as b}from"../chunk-x1w6q9tk.js";import"../chunk-z05djfac.js";import"../chunk-kbvj6qxc.js";var{semver:m}=globalThis.Bun;class R{static compareVersions(p,o){return m.order(p,o)}static satisfiesRange(p,o){return m.satisfies(p,o)}static getLatestInRange(p,o){let f=p.filter((x)=>m.satisfies(x,o));if(f.length===0)return null;return f.sort((x,M)=>m.order(M,x))[0]}static createRange(p){return{raw:p,range:p.replace(/^[\^~>=<]+/,""),isExact:!/^[\^~>=<]/.test(p),satisfies:(o)=>this.satisfiesRange(o,p),getLatest:(o)=>this.getLatestInRange(o,p)}}static getUpdateType(p,o){return d(p,o)}static isSafeUpdate(p,o){return m.satisfies(o,p)}}export{Fx as writeFileTool,Yx as wrapUntrusted,gf as withTouchOffer,no as withNarrative,sf as verifyChanges,tR as validateWorkflowGeneration,wR as validateRepositoryAccess,Ud as validateFindings,Bo as validateConfig,Jo as validateAgainstSchema,HR as updateProgress,bf as unitTestsTouch,Sp as toOsvEcosystem,Hp as tagUpdateType,Kf as syntaxAnalyzer,lp as supports,z as summarizeUsage,fR as summarizeGates,lo as stripOperators,bd as stripNonCommandContext,nf as stackedBranchName,Mo as splitConstraint,op as sortUpdatesByPriority,wf as simplifyTouch,yR as similarity,Vx as sign,uR as showFinalInstructions,N as shouldOpenAsDraft,Yd as shouldFail,Jf as shellcheckAnalyzer,Kx as shellTool,hR as setupCustomWorkflow,$ as setDefaultLogger,ld as serializeReviewState,Af as serializeLearnings,Of as selectLearnings,Fp as selectLatestTag,qf as secretsAnalyzer,YR as schedulePlan,ao as scanEcosystems,vp as scanCatalogs,Bp as sameVariant,Go as rustAdapter,yf as runTool,pd as runStackedTouch,Bd as runReviewForPR,LR as runPreflightChecks,ER as runPostMerge,Zf as runPlan,Ko as runHeadless,xR as runGates,nd as runFixCi,Wf as runAnalyzers,UR as runAiGates,Zx as runAgent,A as ruleMatches,Ao as rubyAdapter,Ld as reviewPullRequest,Px as reviewMode,Ed as reviewDiff,Lx as resolveWorkspacePath,G as resolveRuleEffects,Op as resolveProviderToken,pf as resolveModelAlias,bp as resolveEngineVersion,Kp as resolveCredentials,ep as resolveCatalogReference,Id as resolveBuddyThreads,ff as resolveAiProvider,fm as resetConfigCache,Vf as renderTouchOffer,so as renderReport,TR as renderQuickLinks,aR as renderPackageContext,D as renderMigrationReport,Pf as renderLearnings,Td as renderFinding,qo as renderDoctorReport,xd as renderDiffForReview,_f as relativize,yo as regenerateLockfiles,xp as regenerateLockFile,Tx as redactError,Dx as redactDeep,zx as redact,Bx as readFileTool,Uo as pythonAdapter,Wo as publishOutput,Yo as productFor,jd as prepareReview,Sf as planTouch,yx as planMode,$p as pinBlocksUpdate,Ro as pep440UpdateType,Vp as parseWorkspaceCatalogs,md as parseUnifiedDiff,rf as parseTouchSelections,Nf as parseToolJson,Ip as parseTag,yd as parseReviewState,W as parseRetryDelay,qR as parseRemote,zR as parseQuickSelection,mo as parsePep440,g as parsePackageFile,Uf as parseLearnings,kp as parseImageRef,ho as parseHistory,td as parseCommand,Qp as parseAuthChallenge,If as offsetToLine,po as numericUpdateType,hp as normalizeSeverity,C as normalizePlan,Cd as needsReview,O as mergeGroupEffects,Sd as mentionsBot,B as matchesGlobs,Hf as markdownlintAnalyzer,zp as mapWithConcurrency,Cf as mapSeverity,af as loadLearnings,Vo as loadHistory,zd as loadGuidelines,Hx as listDirTool,Ff as linterAnalyzer,id as latestFailurePerWorkflow,wd as isReadOnlyCommand,fo as isPep440Prerelease,OR as isMergeEvent,gp as isCatalogReference,l as isAllowedCodemod,ax as implementMode,ef as hasTouchOffer,jf as hadolintAnalyzer,KR as guideTokenCreation,WR as guideRepositorySettings,P as groupsToRules,pp as groupUpdates,oo as goAdapter,Tf as githubActionsAnalyzer,bR as getWorkflowPreset,c as getNpmRegistryUrl,h as getGitHubServerUrl,S as getGitHubApiUrl,uf as getFinishingTouch,b as getDefaultLogger,xm as getConfig,V as getComposerRegistryUrl,mp as getAllLockFilePaths,Nx as getAgentMode,ZR as generateUnifiedWorkflow,jo as generateGitLabPipeline,$R as generateCoreWorkflows,XR as generateConfigFile,n as generateBranchName,Io as generateBitbucketPipeline,dR as gateIcon,kx as fsTools,e as formatSecurityAdvisorySection,Wd as formatReview,qd as formatPretty,i as formatPRTitle,s as formatPRBody,qp as formatImageRef,Qo as formatGithubOutput,Jd as formatGithub,q as formatError,Fo as formatConfigIssues,v as formatCommitMessage,Kd as formatAgent,lx as fixCiMode,Md as fingerprint,_ as findUsageSites,co as findPrevious,PR as findMentionedPackages,AR as findLinkedIssues,CR as findDuplicates,_o as findDrift,X as fetchWithTimeout,Y as fetchJsonOrNull,vd as failsOnBaseBranch,gd as extractErrorLines,Yp as extractEngines,Xf as emitEvent,U as ecosystemOf,Co as driftFor,$f as docstringsTouch,SR as displayValidationResults,kR as displayProgress,cd as dispatchCommand,Hd as diffArgsFor,ko as diagnose,fp as detectRequiredPackageManagers,JR as detectRepository,r as detectPackageManager,Bf as detectLinter,sp as detectFiles,od as detectChangedFiles,L as describeSpanGaps,rd as describeFailure,tx as describeEvent,to as describeEol,zo as describeDrift,Pd as defaultIncludePath,mm as defaultConfig,Ad as dedupeFindings,Zo as cycleFor,cx as createWebhookSink,hx as createSlackSink,Sx as createSinks,Yf as createReadIssueTool,ap as createProvider,FR as createProgressTracker,xf as createOpenAiProvider,Gf as createLearning,Vd as createHandlers,mf as createGoogleProvider,ux as createDiscordSink,of as createAnthropicProvider,df as createAiClient,Qd as countBySeverity,lR as constrainLabels,QR as confirmTokenSetup,dm as config,ro as computeMetrics,vo as computeDeltas,Dd as composeInstructions,Lp as compareVersions,xo as comparePep440,np as compareNumeric,zf as commandExists,I as collectSpanNotes,Zp as collectResolutionPins,kd as collectLocalDiff,fd as collectGitDiff,DR as clearQuickSelection,u as clearNpmrcCache,ed as classifyFailure,Lo as ciTemplateFor,Dp as chunk,pR as checkTitleFormat,ud as checkPermission,RR as checkLinkedIssue,$o as checkEol,oR as checkDescription,mR as checkDependencies,MR as checkCustomAssertions,tp as bumpEngineConstraint,Jx as buildShellEnv,y as buildAnalysisPrompt,tf as autofixTouch,T as attemptMajorUpgrade,sd as attemptFix,Ho as assertValidConfig,yp as assertSupports,Pp as assertProviderSupported,Xd as applySuggestion,E as applyRules,ip as applyCatalogUpdates,rp as applyCatalogUpdate,H as appendUpgradeReport,uo as appendHistory,GR as appendChangelogEntry,Jp as apiHostFor,Od as anchorMap,BR as analyzeProject,F as analyzeGroupMajors,cp as advisoryKey,Ef as addLearning,Po as adapterNamed,Oo as adapterFor,Df as actionlintAnalyzer,wx as WEBHOOK_PAYLOAD_VERSION,R as VersionResolver,Gp as UnsupportedProviderError,Xx as Toolbelt,Qx as ToolPermissionError,cf as TOUCH_OFFER_MARKER,lf as TOOL_TIMEOUT_MS,vf as TEST_COMMANDS,up as SecurityAdvisoryService,pm as Scheduler,qx as SHELL_ENV_ALLOWLIST,dd as SEVERITY_ORDER,kf as SECRET_RULES,Cp as ReleaseNotesFetcher,jp as RegistryClient,No as ROOT,ad as REVIEW_STATE_VERSION,Rd as REVIEW_SCHEMA,Fd as REVIEW_FORMATS,eo as REPORT_PERIODS,io as REPORT_MARKER,_x as REDACTED,$d as READ_ONLY_COMMANDS,NR as QUICK_LINKS_MARKER,_R as QUICK_ACTIONS,Np as PullRequestGenerator,IR as PluginManager,wp as PackageScanner,gx as PackageRegistryError,Up as PROVIDER_TRACKING_ISSUES,Ep as PROVIDER_TOKEN_ENV,nx as PROVIDER_PRIORITY,Rp as PROVIDER_NAMES,sx as PROVIDER_KEY_ENV,go as PERIOD_DAYS,Wp as OciClient,Ap as NO_CAPABILITIES,ix as MODEL_ALIASES,a as MIGRATION_PLAN_SCHEMA,_d as MAX_GUIDELINE_CHARS,Z as Logger,Lf as LINTER_SPECS,Xp as KNOWN_ENGINES,Mp as IMPLEMENTED_PROVIDERS,Q as HttpRequestError,wo as HISTORY_PATH,So as HISTORY_LIMIT,hd as HELP_TEXT,rx as GitProviderError,t as GitLabProvider,dp as GitHubProvider,k as GitHubApiError,om as GitHubActionsTemplate,hf as FINISHING_TOUCHES,bx as EventBus,$x as EVENT_NAMES,bo as EOL_WARNING_DAYS,Xo as EOL_PRODUCTS,J as DEFAULT_TIMEOUT_MS,j as DEFAULT_SPAN_BUDGET,To as DEFAULT_SCHEDULE,K as DEFAULT_RETRIES,Mf as DEFAULT_PROMPT_LIMIT,Rf as DEFAULT_LEARNINGS_FILE,Nd as DEFAULT_GUIDELINE_FILES,Gd as DEFAULT_EXCLUDED_PATHS,_p as DEFAULT_CONCURRENCY,jR as ConfigurationMigrator,vx as ConfigurationError,Zd as COMMAND_ALIASES,ex as BuddyError,Do as Buddy,w as BitbucketProvider,Wx as BUILTIN_TOOLS,Qf as BUILTIN_ANALYZERS,Eo as BUILTIN_ADAPTERS,Tp as AsyncMemo,Ix as AiProviderError,jx as AiBudgetExceededError,Cx as AGENT_MODES};
|
|
2
|
+
import{I as wo,J as So,K as ho,L as uo,M as co,N as Vo,O as eo,P as go,Q as ro,R as vo,S as io,T as so,U as no}from"../chunk-6np84pfr.js";import{W as ko,X as qo}from"../chunk-q7709hwk.js";import{$ as Wo,Y as Jo,Z as Ko,_ as Qo}from"../chunk-3nn2j810.js";import{aa as PR,ba as aR,ca as lR,da as yR,ea as CR,fa as NR,ga as _R,ha as zR,ia as DR,ja as TR}from"../chunk-69qyr9ef.js";import{ka as pR,la as oR,ma as mR,na as xR,oa as fR,pa as dR,qa as RR,ra as MR,sa as UR,ta as AR,ua as GR,va as ER,wa as OR}from"../chunk-bgw39afd.js";import{Aa as $o,Ba as bo,Ca as to,xa as Xo,ya as Yo,za as Zo}from"../chunk-qcvtp2mt.js";import"../chunk-rb1fh9vd.js";import{Da as pm}from"../chunk-ce26jarj.js";import{Ea as ed,Fa as gd,Ga as rd,Ha as vd,Ia as id,Ja as sd,Ka as nd}from"../chunk-s5czyzje.js";import{La as Zd,Ma as $d,Na as bd,Oa as td,Pa as wd,Qa as Sd,Ra as hd,Sa as ud,Ta as cd,Ua as Vd}from"../chunk-2z85fqdp.js";import{Va as Yf,Wa as Zf}from"../chunk-p16pnhj3.js";import{$a as Sf,Xa as $f,Ya as bf,Za as tf,_a as wf,ab as hf,bb as uf,cb as cf,db as Vf,eb as ef,fb as gf,gb as rf}from"../chunk-jqh7vx2n.js";import{hb as vf,ib as sf,jb as nf,kb as pd,lb as od}from"../chunk-k907b533.js";import{mb as Id}from"../chunk-v808b36p.js";import{Ab as Td,Bb as jd,Cb as Ld,Db as Bd,nb as dd,ob as Rd,pb as Md,qb as Ud,rb as Ad,sb as Gd,tb as Ed,ub as Od,vb as Pd,wb as Nd,xb as _d,yb as zd,zb as Dd}from"../chunk-7b156stw.js";import{Eb as md,Fb as xd,Gb as fd}from"../chunk-q2tjkhez.js";import{Hb as Co,Ib as No,Jb as _o,Kb as zo}from"../chunk-vckhctmr.js";import{Lb as ad,Mb as ld,Nb as yd,Pb as Cd}from"../chunk-5yfaptmp.js";import{Qb as Rf,Rb as Mf,Sb as Uf,Tb as Af,Ub as Gf,Vb as Ef,Wb as Of,Xb as Pf,Yb as af}from"../chunk-sn0qr6q7.js";import{$b as nx,Zb as ix,_b as sx,ac as pf,bc as of,cc as mf,dc as xf,ec as ff,fc as df}from"../chunk-5sh69bkj.js";import{gc as Vp,hc as ep,ic as gp,jc as rp,mc as vp,nc as ip}from"../chunk-ekf183jk.js";import{Ac as Uo,Bc as Ao,Cc as Go,Dc as Eo,Ec as Oo,Fc as Po,Gc as ao,Hc as lo,Ic as yo,pc as sp,sc as np,tc as po,uc as oo,vc as mo,wc as xo,xc as fo,yc as Ro,zc as Mo}from"../chunk-j6bejzk9.js";import{Mc as dp}from"../chunk-nn5rzwty.js";import{Nc as mp,Oc as xp,Pc as fp}from"../chunk-9n1kth4b.js";import{Uc as mm,Vc as xm,Wc as fm,Xc as dm}from"../chunk-54hdfa8r.js";import{Yc as Bo,Zc as Fo,_c as Ho}from"../chunk-01d81hn0.js";import{$c as Sp,ad as hp,bd as up,cd as cp,ed as Do}from"../chunk-83srz04v.js";import"../chunk-c9266b5x.js";import{gd as _p,hd as zp,id as Dp,jd as Tp,kd as jp}from"../chunk-x9qhsyp6.js";import{ld as wp}from"../chunk-edm12hnb.js";import"../chunk-bnp0r4eh.js";import{nd as ex,od as gx,pd as rx,qd as vx}from"../chunk-0f1xye20.js";import{td as Np}from"../chunk-66nntsnf.js";import{ud as Xf}from"../chunk-qjzpzd7j.js";import{Ad as hx,Bd as ux,Cd as cx,Dd as Vx,vd as $x,wd as bx,xd as tx,yd as wx,zd as Sx}from"../chunk-ebnc6980.js";import{Ed as Fd,Fd as Hd,Gd as kd,Hd as qd,Id as Jd,Jd as Kd,Kd as Qd,Ld as Wd,Md as Xd,Nd as Yd}from"../chunk-7m3pzkcj.js";import{$d as Hf,Od as lf,Pd as yf,Qd as Cf,Rd as Nf,Sd as _f,Td as zf,Ud as Df,Vd as Tf,Wd as jf,Xd as If,Yd as Lf,Zd as Bf,_d as Ff,ae as kf,be as qf,ce as Jf,de as Kf,ee as Qf,fe as Wf}from"../chunk-2b07w74s.js";import"../chunk-142zh7e5.js";import{ie as Rp,je as Mp,ke as Up,le as Ap,me as Gp,ne as Ep,oe as Op,pe as Pp,qe as ap,re as lp,se as yp}from"../chunk-y1d6e0ye.js";import"../chunk-ma01xp3y.js";import"../chunk-gjhxc6ma.js";import{Fe as Ip,Ge as Lp,He as Bp,Ie as Fp,Je as Hp,Ke as kp,Le as qp,Me as Jp,Ne as Kp,Oe as Qp,Pe as Wp}from"../chunk-3a63hke8.js";import{We as Cp}from"../chunk-92gh2n65.js";import{$e as bp,Xe as Xp,Ye as Yp,Ze as Zp,_e as $p,af as tp}from"../chunk-j46f90n8.js";import{df as a,ef as l,ff as y,gf as C,hf as N,if as _,jf as z,kf as D,lf as T,mf as j,nf as I,of as L,pf as B,qf as F,rf as H}from"../chunk-eh71jv8w.js";import{sf as U,tf as A,uf as G,vf as E,wf as O,yf as P}from"../chunk-3a5gcj3y.js";import{Af as ax,Bf as lx,Cf as yx,Df as Cx,Ef as Nx,zf as Px}from"../chunk-1pecmenc.js";import{Ff as Lx,Gf as Bx,Hf as Fx,If as Hx,Jf as kx,Kf as qx,Lf as Jx,Mf as Kx,Nf as Qx,Of as Wx,Pf as Xx,Qf as Yx,Rf as Zx}from"../chunk-4kyxrwxn.js";import"../chunk-24xvskkf.js";import{Uf as _x,Vf as zx,Wf as Dx,Xf as Tx,Yf as jx,Zf as Ix}from"../chunk-z18bksyr.js";import"../chunk-cj4d5ad7.js";import{bg as e,cg as g,dg as r,eg as v,fg as i,gg as s,hg as n,ig as pp,jg as op,kg as d}from"../chunk-zy49dwqk.js";import"../chunk-x9vpk4kk.js";import"../chunk-94tnmc7j.js";import"../chunk-drmk6r1m.js";import{$g as Lo,Yg as To,Zg as jo,_g as Io,bh as jR,ch as IR,dh as LR,eh as BR,fh as FR,gh as HR,hh as kR,ih as qR,jh as JR,kh as KR,lh as QR,mh as WR,nh as XR,oh as YR,ph as ZR,qh as $R,rh as bR,sh as tR,th as wR,uh as SR,vh as hR,wh as uR}from"../chunk-c4cj24qm.js";import{xh as om}from"../chunk-cx89kty3.js";import{Ah as u,Bh as c,Ch as V,yh as S,zh as h}from"../chunk-7t8s2mcf.js";import{Dh as t}from"../chunk-p2h2z6d3.js";import{Eh as w}from"../chunk-rwz433q2.js";import"../chunk-j6geg3qt.js";import{Gh as J,Hh as K,Ih as Q,Jh as W,Kh as X,Lh as Y}from"../chunk-34vracy4.js";import{Mh as k,Nh as q,Oh as Z,Ph as $,Qh as b}from"../chunk-zwtx6vn3.js";import"../chunk-028354j6.js";import"../chunk-s82adeq9.js";var{semver:m}=globalThis.Bun;class R{static compareVersions(p,o){return m.order(p,o)}static satisfiesRange(p,o){return m.satisfies(p,o)}static getLatestInRange(p,o){let f=p.filter((x)=>m.satisfies(x,o));if(f.length===0)return null;return f.sort((x,M)=>m.order(M,x))[0]}static createRange(p){return{raw:p,range:p.replace(/^[\^~>=<]+/,""),isExact:!/^[\^~>=<]/.test(p),satisfies:(o)=>this.satisfiesRange(o,p),getLatest:(o)=>this.getLatestInRange(o,p)}}static getUpdateType(p,o){return d(p,o)}static isSafeUpdate(p,o){return m.satisfies(o,p)}}export{Fx as writeFileTool,Yx as wrapUntrusted,gf as withTouchOffer,no as withNarrative,sf as verifyChanges,tR as validateWorkflowGeneration,wR as validateRepositoryAccess,Ud as validateFindings,Bo as validateConfig,Jo as validateAgainstSchema,HR as updateProgress,bf as unitTestsTouch,Sp as toOsvEcosystem,Hp as tagUpdateType,Kf as syntaxAnalyzer,lp as supports,z as summarizeUsage,fR as summarizeGates,lo as stripOperators,bd as stripNonCommandContext,nf as stackedBranchName,Mo as splitConstraint,op as sortUpdatesByPriority,wf as simplifyTouch,yR as similarity,Vx as sign,uR as showFinalInstructions,N as shouldOpenAsDraft,Yd as shouldFail,Jf as shellcheckAnalyzer,Kx as shellTool,hR as setupCustomWorkflow,$ as setDefaultLogger,ld as serializeReviewState,Af as serializeLearnings,Of as selectLearnings,Fp as selectLatestTag,qf as secretsAnalyzer,YR as schedulePlan,ao as scanEcosystems,vp as scanCatalogs,Bp as sameVariant,Go as rustAdapter,yf as runTool,pd as runStackedTouch,Bd as runReviewForPR,LR as runPreflightChecks,ER as runPostMerge,Zf as runPlan,Ko as runHeadless,xR as runGates,nd as runFixCi,Wf as runAnalyzers,UR as runAiGates,Zx as runAgent,A as ruleMatches,Ao as rubyAdapter,Ld as reviewPullRequest,Px as reviewMode,Ed as reviewDiff,Lx as resolveWorkspacePath,G as resolveRuleEffects,Op as resolveProviderToken,pf as resolveModelAlias,bp as resolveEngineVersion,Kp as resolveCredentials,ep as resolveCatalogReference,Id as resolveBuddyThreads,ff as resolveAiProvider,fm as resetConfigCache,Vf as renderTouchOffer,so as renderReport,TR as renderQuickLinks,aR as renderPackageContext,D as renderMigrationReport,Pf as renderLearnings,Td as renderFinding,qo as renderDoctorReport,xd as renderDiffForReview,_f as relativize,yo as regenerateLockfiles,xp as regenerateLockFile,Tx as redactError,Dx as redactDeep,zx as redact,Bx as readFileTool,Uo as pythonAdapter,Wo as publishOutput,Yo as productFor,jd as prepareReview,Sf as planTouch,yx as planMode,$p as pinBlocksUpdate,Ro as pep440UpdateType,Vp as parseWorkspaceCatalogs,md as parseUnifiedDiff,rf as parseTouchSelections,Nf as parseToolJson,Ip as parseTag,yd as parseReviewState,W as parseRetryDelay,qR as parseRemote,zR as parseQuickSelection,mo as parsePep440,g as parsePackageFile,Uf as parseLearnings,kp as parseImageRef,ho as parseHistory,td as parseCommand,Qp as parseAuthChallenge,If as offsetToLine,po as numericUpdateType,hp as normalizeSeverity,C as normalizePlan,Cd as needsReview,O as mergeGroupEffects,Sd as mentionsBot,B as matchesGlobs,Hf as markdownlintAnalyzer,zp as mapWithConcurrency,Cf as mapSeverity,af as loadLearnings,Vo as loadHistory,zd as loadGuidelines,Hx as listDirTool,Ff as linterAnalyzer,id as latestFailurePerWorkflow,wd as isReadOnlyCommand,fo as isPep440Prerelease,OR as isMergeEvent,gp as isCatalogReference,l as isAllowedCodemod,ax as implementMode,ef as hasTouchOffer,jf as hadolintAnalyzer,KR as guideTokenCreation,WR as guideRepositorySettings,P as groupsToRules,pp as groupUpdates,oo as goAdapter,Tf as githubActionsAnalyzer,bR as getWorkflowPreset,c as getNpmRegistryUrl,h as getGitHubServerUrl,S as getGitHubApiUrl,uf as getFinishingTouch,b as getDefaultLogger,xm as getConfig,V as getComposerRegistryUrl,mp as getAllLockFilePaths,Nx as getAgentMode,ZR as generateUnifiedWorkflow,jo as generateGitLabPipeline,$R as generateCoreWorkflows,XR as generateConfigFile,n as generateBranchName,Io as generateBitbucketPipeline,dR as gateIcon,kx as fsTools,e as formatSecurityAdvisorySection,Wd as formatReview,qd as formatPretty,i as formatPRTitle,s as formatPRBody,qp as formatImageRef,Qo as formatGithubOutput,Jd as formatGithub,q as formatError,Fo as formatConfigIssues,v as formatCommitMessage,Kd as formatAgent,lx as fixCiMode,Md as fingerprint,_ as findUsageSites,co as findPrevious,PR as findMentionedPackages,AR as findLinkedIssues,CR as findDuplicates,_o as findDrift,X as fetchWithTimeout,Y as fetchJsonOrNull,vd as failsOnBaseBranch,gd as extractErrorLines,Yp as extractEngines,Xf as emitEvent,U as ecosystemOf,Co as driftFor,$f as docstringsTouch,SR as displayValidationResults,kR as displayProgress,cd as dispatchCommand,Hd as diffArgsFor,ko as diagnose,fp as detectRequiredPackageManagers,JR as detectRepository,r as detectPackageManager,Bf as detectLinter,sp as detectFiles,od as detectChangedFiles,L as describeSpanGaps,rd as describeFailure,tx as describeEvent,to as describeEol,zo as describeDrift,Pd as defaultIncludePath,mm as defaultConfig,Ad as dedupeFindings,Zo as cycleFor,cx as createWebhookSink,hx as createSlackSink,Sx as createSinks,Yf as createReadIssueTool,ap as createProvider,FR as createProgressTracker,xf as createOpenAiProvider,Gf as createLearning,Vd as createHandlers,mf as createGoogleProvider,ux as createDiscordSink,of as createAnthropicProvider,df as createAiClient,Qd as countBySeverity,lR as constrainLabels,QR as confirmTokenSetup,dm as config,ro as computeMetrics,vo as computeDeltas,Dd as composeInstructions,Lp as compareVersions,xo as comparePep440,np as compareNumeric,zf as commandExists,I as collectSpanNotes,Zp as collectResolutionPins,kd as collectLocalDiff,fd as collectGitDiff,DR as clearQuickSelection,u as clearNpmrcCache,ed as classifyFailure,Lo as ciTemplateFor,Dp as chunk,pR as checkTitleFormat,ud as checkPermission,RR as checkLinkedIssue,$o as checkEol,oR as checkDescription,mR as checkDependencies,MR as checkCustomAssertions,tp as bumpEngineConstraint,Jx as buildShellEnv,y as buildAnalysisPrompt,tf as autofixTouch,T as attemptMajorUpgrade,sd as attemptFix,Ho as assertValidConfig,yp as assertSupports,Pp as assertProviderSupported,Xd as applySuggestion,E as applyRules,ip as applyCatalogUpdates,rp as applyCatalogUpdate,H as appendUpgradeReport,uo as appendHistory,GR as appendChangelogEntry,Jp as apiHostFor,Od as anchorMap,BR as analyzeProject,F as analyzeGroupMajors,cp as advisoryKey,Ef as addLearning,Po as adapterNamed,Oo as adapterFor,Df as actionlintAnalyzer,wx as WEBHOOK_PAYLOAD_VERSION,R as VersionResolver,Gp as UnsupportedProviderError,Xx as Toolbelt,Qx as ToolPermissionError,cf as TOUCH_OFFER_MARKER,lf as TOOL_TIMEOUT_MS,vf as TEST_COMMANDS,up as SecurityAdvisoryService,pm as Scheduler,qx as SHELL_ENV_ALLOWLIST,dd as SEVERITY_ORDER,kf as SECRET_RULES,Cp as ReleaseNotesFetcher,jp as RegistryClient,No as ROOT,ad as REVIEW_STATE_VERSION,Rd as REVIEW_SCHEMA,Fd as REVIEW_FORMATS,eo as REPORT_PERIODS,io as REPORT_MARKER,_x as REDACTED,$d as READ_ONLY_COMMANDS,NR as QUICK_LINKS_MARKER,_R as QUICK_ACTIONS,Np as PullRequestGenerator,IR as PluginManager,wp as PackageScanner,gx as PackageRegistryError,Up as PROVIDER_TRACKING_ISSUES,Ep as PROVIDER_TOKEN_ENV,nx as PROVIDER_PRIORITY,Rp as PROVIDER_NAMES,sx as PROVIDER_KEY_ENV,go as PERIOD_DAYS,Wp as OciClient,Ap as NO_CAPABILITIES,ix as MODEL_ALIASES,a as MIGRATION_PLAN_SCHEMA,_d as MAX_GUIDELINE_CHARS,Z as Logger,Lf as LINTER_SPECS,Xp as KNOWN_ENGINES,Mp as IMPLEMENTED_PROVIDERS,Q as HttpRequestError,wo as HISTORY_PATH,So as HISTORY_LIMIT,hd as HELP_TEXT,rx as GitProviderError,t as GitLabProvider,dp as GitHubProvider,k as GitHubApiError,om as GitHubActionsTemplate,hf as FINISHING_TOUCHES,bx as EventBus,$x as EVENT_NAMES,bo as EOL_WARNING_DAYS,Xo as EOL_PRODUCTS,J as DEFAULT_TIMEOUT_MS,j as DEFAULT_SPAN_BUDGET,To as DEFAULT_SCHEDULE,K as DEFAULT_RETRIES,Mf as DEFAULT_PROMPT_LIMIT,Rf as DEFAULT_LEARNINGS_FILE,Nd as DEFAULT_GUIDELINE_FILES,Gd as DEFAULT_EXCLUDED_PATHS,_p as DEFAULT_CONCURRENCY,jR as ConfigurationMigrator,vx as ConfigurationError,Zd as COMMAND_ALIASES,ex as BuddyError,Do as Buddy,w as BitbucketProvider,Wx as BUILTIN_TOOLS,Qf as BUILTIN_ANALYZERS,Eo as BUILTIN_ADAPTERS,Tp as AsyncMemo,Ix as AiProviderError,jx as AiBudgetExceededError,Cx as AGENT_MODES};
|