@buddysh/buddy 0.11.1 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/README.md +54 -43
  3. package/bin/cli.ts +282 -135
  4. package/dist/bin/cli.d.ts +5 -1
  5. package/dist/bin/cli.js +84 -91
  6. package/dist/chunk-05me15qw.js +2 -0
  7. package/dist/{chunk-bxfc4g2x.js → chunk-08x5b93v.js} +2 -13
  8. package/dist/chunk-0hc97k0t.js +44 -0
  9. package/dist/chunk-0paakbpj.js +2 -0
  10. package/dist/{chunk-hfvezfxh.js → chunk-0scz1dv5.js} +1 -1
  11. package/dist/{chunk-sp818c27.js → chunk-0w695m54.js} +5 -5
  12. package/dist/{chunk-vyapg8ca.js → chunk-11hdrnf6.js} +3 -3
  13. package/dist/{chunk-5k40mwd4.js → chunk-193abzy6.js} +1 -1
  14. package/dist/chunk-19zyq15p.js +2 -0
  15. package/dist/{chunk-q9n79dd3.js → chunk-1cpdz49v.js} +1 -1
  16. package/dist/{chunk-thaxgm5p.js → chunk-1qgr52wx.js} +1 -1
  17. package/dist/chunk-24c2ab29.js +2 -0
  18. package/dist/chunk-25sz1y7j.js +16 -0
  19. package/dist/chunk-28y7eayr.js +2 -0
  20. package/dist/chunk-2et8yavs.js +3 -0
  21. package/dist/chunk-2wj5xtdn.js +2 -0
  22. package/dist/{chunk-7mgec8kb.js → chunk-3901s7h9.js} +1 -1
  23. package/dist/{chunk-xvptf9jy.js → chunk-3cvng2nz.js} +2 -2
  24. package/dist/chunk-3fzbvs2p.js +2 -0
  25. package/dist/chunk-3pqra420.js +2 -0
  26. package/dist/{chunk-yk23nc4t.js → chunk-40znfg3x.js} +1 -1
  27. package/dist/chunk-428c5652.js +2 -0
  28. package/dist/chunk-49znmbh8.js +2 -0
  29. package/dist/chunk-4jyw358y.js +79 -0
  30. package/dist/chunk-5044y9en.js +5 -0
  31. package/dist/chunk-5av2vnvv.js +3 -0
  32. package/dist/chunk-5yfaptmp.js +7 -0
  33. package/dist/{chunk-h7hs95wn.js → chunk-61xecp1z.js} +2 -2
  34. package/dist/chunk-68fw3ma0.js +2 -0
  35. package/dist/{chunk-9h04nskh.js → chunk-69qyr9ef.js} +1 -1
  36. package/dist/{chunk-vh504tcv.js → chunk-6p4qz8qv.js} +2 -2
  37. package/dist/chunk-86x1vsjw.js +2 -0
  38. package/dist/{chunk-r3zyw8x0.js → chunk-8fw0v7bv.js} +2 -2
  39. package/dist/chunk-8hjvthz4.js +92 -0
  40. package/dist/chunk-90zmqn5k.js +2 -0
  41. package/dist/chunk-96ht6hwd.js +4 -0
  42. package/dist/chunk-97qf7mdt.js +2 -0
  43. package/dist/chunk-a4hzzn28.js +2 -0
  44. package/dist/chunk-aa277p5r.js +2 -0
  45. package/dist/chunk-b1w41hfs.js +2 -0
  46. package/dist/chunk-b357cgb0.js +2 -0
  47. package/dist/chunk-b9escac0.js +4 -0
  48. package/dist/{chunk-56q4pwb5.js → chunk-be629jhq.js} +2 -2
  49. package/dist/chunk-bffxf4xy.js +2 -0
  50. package/dist/chunk-bmnx3s41.js +38 -0
  51. package/dist/chunk-brfyymhf.js +2 -0
  52. package/dist/chunk-c3es7pgf.js +2 -0
  53. package/dist/{chunk-9750tenz.js → chunk-c8rzx3a1.js} +1 -1
  54. package/dist/{chunk-tzs22es2.js → chunk-cgvt98pd.js} +1 -1
  55. package/dist/chunk-cs066zt9.js +5 -0
  56. package/dist/chunk-cwfkm7h9.js +3 -0
  57. package/dist/chunk-dgfb8k0h.js +2 -0
  58. package/dist/chunk-ds4stft2.js +2 -0
  59. package/dist/chunk-e0gweha1.js +2 -0
  60. package/dist/chunk-e2t5jq26.js +106 -0
  61. package/dist/{chunk-1h3ey7k5.js → chunk-e68nf7cm.js} +1 -1
  62. package/dist/chunk-emb5v4wv.js +2 -0
  63. package/dist/chunk-emyvrx5t.js +2 -0
  64. package/dist/{chunk-16yqbccr.js → chunk-eseshkd0.js} +1 -1
  65. package/dist/chunk-f53y8ans.js +3 -0
  66. package/dist/chunk-fjp3a7hp.js +26 -0
  67. package/dist/chunk-fpnjpgrb.js +2 -0
  68. package/dist/chunk-fr5c326k.js +2 -0
  69. package/dist/chunk-g24hav8e.js +370 -0
  70. package/dist/{chunk-6md7qf2g.js → chunk-g30dr44w.js} +2 -2
  71. package/dist/chunk-gkpd5nw2.js +2 -0
  72. package/dist/chunk-hd5j9e3c.js +2 -0
  73. package/dist/{chunk-akffynkc.js → chunk-hfjywbbc.js} +1 -1
  74. package/dist/chunk-hmskwy76.js +2 -0
  75. package/dist/chunk-hns85dqw.js +2 -0
  76. package/dist/{chunk-wtjhehz9.js → chunk-hptfq3rg.js} +1 -1
  77. package/dist/{chunk-54sc18p8.js → chunk-hsa07n7c.js} +1 -1
  78. package/dist/{chunk-52x8mvh4.js → chunk-jnb80k2x.js} +2 -2
  79. package/dist/chunk-jtxcr5yw.js +4 -0
  80. package/dist/{chunk-x0ya2r4r.js → chunk-jz5zs812.js} +2 -2
  81. package/dist/{chunk-tn8prpny.js → chunk-k26wnmzk.js} +7 -7
  82. package/dist/{chunk-2bp7tqca.js → chunk-kprtsn8c.js} +1 -1
  83. package/dist/chunk-m4p7cnvk.js +2 -0
  84. package/dist/chunk-mcwxpdg9.js +2 -0
  85. package/dist/chunk-mkzmjg3f.js +4 -0
  86. package/dist/chunk-ng7px8gx.js +2 -0
  87. package/dist/{chunk-vagxqhef.js → chunk-nrr8z2z7.js} +2 -2
  88. package/dist/{chunk-g0w8n555.js → chunk-p6qbqsyp.js} +2 -2
  89. package/dist/chunk-patms7t8.js +2 -0
  90. package/dist/{chunk-hw70wbzg.js → chunk-phfmnnne.js} +2 -2
  91. package/dist/{chunk-tb5y0350.js → chunk-pkr6905p.js} +1 -1
  92. package/dist/chunk-ppmabn5h.js +2 -0
  93. package/dist/chunk-pskqrv5r.js +2 -0
  94. package/dist/{chunk-4xsq18p3.js → chunk-q2tjkhez.js} +1 -1
  95. package/dist/{chunk-6g1y9yqh.js → chunk-q4t568hv.js} +1 -1
  96. package/dist/chunk-qd2s51gc.js +2 -0
  97. package/dist/chunk-r763e19p.js +6 -0
  98. package/dist/{chunk-3zdcekfj.js → chunk-rayxmbcx.js} +2 -2
  99. package/dist/{chunk-74pxb991.js → chunk-rc2mk5x6.js} +2 -2
  100. package/dist/chunk-rwggcfgn.js +2 -0
  101. package/dist/chunk-s25rb4t2.js +2 -0
  102. package/dist/{chunk-zb62jhwm.js → chunk-s4zb0fcj.js} +13 -9
  103. package/dist/chunk-s6z3gm2s.js +5 -0
  104. package/dist/chunk-sc7emb71.js +2 -0
  105. package/dist/chunk-sw2538r0.js +49 -0
  106. package/dist/{chunk-p4zwy518.js → chunk-tjc2vgwn.js} +2 -2
  107. package/dist/{chunk-1stt2whn.js → chunk-tsckfwch.js} +2 -2
  108. package/dist/{chunk-gngwjf70.js → chunk-tw047td6.js} +2 -2
  109. package/dist/{chunk-6d9hmjt8.js → chunk-txtrpypt.js} +2 -2
  110. package/dist/chunk-v1wfa758.js +2 -0
  111. package/dist/{chunk-zs3jaj0g.js → chunk-vbeeyhhe.js} +168 -121
  112. package/dist/{chunk-dfesffnr.js → chunk-vckhctmr.js} +1 -1
  113. package/dist/chunk-vdd1cghr.js +2 -0
  114. package/dist/{chunk-fvpr07dn.js → chunk-vgtmrd4c.js} +1 -1
  115. package/dist/chunk-vj1sdxpp.js +2 -0
  116. package/dist/{chunk-fm8ckj9b.js → chunk-vqa6vte3.js} +1 -1
  117. package/dist/{chunk-82dv4p13.js → chunk-wn6pbyzn.js} +1 -1
  118. package/dist/{chunk-xqx460y2.js → chunk-xs12dtf1.js} +1 -1
  119. package/dist/chunk-xznnmhyt.js +2 -0
  120. package/dist/chunk-yk183r6z.js +2 -0
  121. package/dist/{chunk-1c1gznm9.js → chunk-yngahb11.js} +2 -2
  122. package/dist/{chunk-qyf90zz3.js → chunk-yp1tgdh3.js} +1 -1
  123. package/dist/chunk-yr8eta7p.js +27 -0
  124. package/dist/chunk-ys1qqcpp.js +2 -0
  125. package/dist/{chunk-8rc6042h.js → chunk-ytmxd5fk.js} +2 -2
  126. package/dist/chunk-zgkrhymn.js +2 -0
  127. package/dist/chunk-zxgkp71x.js +2 -0
  128. package/dist/src/agent/index.d.ts +6 -1
  129. package/dist/src/agent/modes.d.ts +0 -8
  130. package/dist/src/agent/plan.d.ts +28 -0
  131. package/dist/src/agent/tasks.d.ts +20 -0
  132. package/dist/src/agent/tools/issue.d.ts +19 -0
  133. package/dist/src/ci/attempts.d.ts +36 -0
  134. package/dist/src/ci/base.d.ts +55 -0
  135. package/dist/src/ci/fix.d.ts +27 -18
  136. package/dist/src/ci/index.d.ts +5 -1
  137. package/dist/src/ci/run.d.ts +28 -0
  138. package/dist/src/commands/handlers.d.ts +3 -0
  139. package/dist/src/dashboard/dashboard-generator.d.ts +4 -0
  140. package/dist/src/events/index.d.ts +12 -0
  141. package/dist/src/gates/checks.d.ts +10 -0
  142. package/dist/src/gates/index.d.ts +1 -0
  143. package/dist/src/gates/post-merge.d.ts +13 -1
  144. package/dist/src/git/github-provider.d.ts +5 -1
  145. package/dist/src/git/gitlab-provider.d.ts +5 -1
  146. package/dist/src/git/provider.d.ts +40 -0
  147. package/dist/src/index.d.ts +3 -0
  148. package/dist/src/index.js +1 -1
  149. package/dist/src/registry/registry-client.d.ts +1 -1
  150. package/dist/src/reports/index.d.ts +1 -0
  151. package/dist/src/reports/publish-gate.d.ts +22 -0
  152. package/dist/src/review/filters.d.ts +36 -0
  153. package/dist/src/review/index.d.ts +4 -1
  154. package/dist/src/review/marker.d.ts +18 -0
  155. package/dist/src/review/poster.d.ts +11 -1
  156. package/dist/src/review/resolve.d.ts +20 -0
  157. package/dist/src/review/run.d.ts +35 -0
  158. package/dist/src/rules/engine.d.ts +19 -0
  159. package/dist/src/scanner/package-json-extras.d.ts +34 -1
  160. package/dist/src/setup.d.ts +49 -17
  161. package/dist/src/setup.js +1 -1
  162. package/dist/src/templates/github-actions.d.ts +2 -0
  163. package/dist/src/types.d.ts +4 -1
  164. package/dist/src/upgrades/migrate.d.ts +3 -0
  165. package/dist/src/upgrades/report.d.ts +1 -0
  166. package/dist/src/utils/dockerfile-parser.d.ts +2 -2
  167. package/dist/src/utils/helpers.d.ts +10 -1
  168. package/dist/src/version/version-resolver.d.ts +1 -0
  169. package/package.json +18 -16
  170. package/dist/chunk-0j7z87kh.js +0 -3
  171. package/dist/chunk-0r8zt3d7.js +0 -2
  172. package/dist/chunk-1a53wj0h.js +0 -1
  173. package/dist/chunk-1wjnd24b.js +0 -24
  174. package/dist/chunk-1xe07hzm.js +0 -2
  175. package/dist/chunk-2dbkpfy9.js +0 -2
  176. package/dist/chunk-3q6czqs4.js +0 -6
  177. package/dist/chunk-49ey79p0.js +0 -5
  178. package/dist/chunk-4c9m61yd.js +0 -5
  179. package/dist/chunk-4efbxdjr.js +0 -4
  180. package/dist/chunk-4f7panqj.js +0 -21
  181. package/dist/chunk-4hd3rre0.js +0 -2
  182. package/dist/chunk-5c3qf34r.js +0 -2
  183. package/dist/chunk-5kt03hx5.js +0 -2
  184. package/dist/chunk-63ept76v.js +0 -2
  185. package/dist/chunk-65b3vq52.js +0 -2
  186. package/dist/chunk-6k653r8w.js +0 -2
  187. package/dist/chunk-6patq6bw.js +0 -2
  188. package/dist/chunk-6sgh49z1.js +0 -2
  189. package/dist/chunk-7tfrww3v.js +0 -2
  190. package/dist/chunk-7xk28xrv.js +0 -2
  191. package/dist/chunk-8661pvb8.js +0 -3
  192. package/dist/chunk-887s0w81.js +0 -2
  193. package/dist/chunk-978wtejw.js +0 -44
  194. package/dist/chunk-9eqpaxfz.js +0 -2
  195. package/dist/chunk-9p1xkmjy.js +0 -2
  196. package/dist/chunk-agdesgzv.js +0 -2
  197. package/dist/chunk-ar01x04a.js +0 -2
  198. package/dist/chunk-ay43f085.js +0 -2
  199. package/dist/chunk-bk9bqd5j.js +0 -2
  200. package/dist/chunk-bm8d40j0.js +0 -69
  201. package/dist/chunk-c3fczawt.js +0 -2
  202. package/dist/chunk-c9r9nd4t.js +0 -1
  203. package/dist/chunk-ctsz0ynx.js +0 -3
  204. package/dist/chunk-czremqk7.js +0 -2
  205. package/dist/chunk-da3wbh04.js +0 -2
  206. package/dist/chunk-dat582cg.js +0 -2
  207. package/dist/chunk-djntbp7a.js +0 -105
  208. package/dist/chunk-eagjp0dh.js +0 -3
  209. package/dist/chunk-eht72nnj.js +0 -2
  210. package/dist/chunk-f4nv5x3z.js +0 -2
  211. package/dist/chunk-fdfk918n.js +0 -2
  212. package/dist/chunk-fdj0tewy.js +0 -20
  213. package/dist/chunk-fqj7e6xa.js +0 -2
  214. package/dist/chunk-frm8zz31.js +0 -2
  215. package/dist/chunk-g0nv8psv.js +0 -2
  216. package/dist/chunk-gkmvxjbe.js +0 -2
  217. package/dist/chunk-j8asz4hb.js +0 -15
  218. package/dist/chunk-k62w2v03.js +0 -2
  219. package/dist/chunk-mcrfxphm.js +0 -5
  220. package/dist/chunk-mh3x7j6h.js +0 -2
  221. package/dist/chunk-naq32yx3.js +0 -86
  222. package/dist/chunk-nsmcjkas.js +0 -2
  223. package/dist/chunk-p1xm1jvz.js +0 -2
  224. package/dist/chunk-p3wsm8kz.js +0 -2
  225. package/dist/chunk-p7zgy37f.js +0 -2
  226. package/dist/chunk-ph1b3vbp.js +0 -315
  227. package/dist/chunk-pkjm2r0a.js +0 -2
  228. package/dist/chunk-pkkwb0n0.js +0 -4
  229. package/dist/chunk-pnpx1kqn.js +0 -6
  230. package/dist/chunk-qpz9k66h.js +0 -2
  231. package/dist/chunk-qvn1rtgp.js +0 -2
  232. package/dist/chunk-r06ce5g6.js +0 -2
  233. package/dist/chunk-r2sbprdb.js +0 -49
  234. package/dist/chunk-rqdep14r.js +0 -2
  235. package/dist/chunk-s1km8cyq.js +0 -2
  236. package/dist/chunk-s4ms8zag.js +0 -2
  237. package/dist/chunk-ts35hc5t.js +0 -3
  238. package/dist/chunk-vkctfqpm.js +0 -3
  239. package/dist/chunk-wdwvt7gb.js +0 -43
  240. package/dist/chunk-x3kragh9.js +0 -12
  241. package/dist/chunk-x9ctz1qc.js +0 -1
  242. package/dist/chunk-xakpdqaq.js +0 -3
  243. package/dist/chunk-yncea6ty.js +0 -2
  244. package/dist/chunk-yq0gxtzv.js +0 -2
  245. package/dist/chunk-yqhs08ky.js +0 -2
  246. package/dist/chunk-zve5d96e.js +0 -2
@@ -32,7 +32,19 @@ export declare function appendChangelogEntry(content: string, entry: string): st
32
32
  * const outcome = await runPostMerge(provider, pr, config.postMerge, { baseBranch: 'main' })
33
33
  * ```
34
34
  */
35
- export declare function runPostMerge(provider: GitProvider, pr: PullRequest, config?: PostMergeConfig, options?: { baseBranch?: string, logger?: Logger }): Promise<PostMergeOutcome>;
35
+ export declare function runPostMerge(provider: GitProvider, pr: PullRequest, config?: PostMergeConfig, options?: {
36
+ baseBranch?: string
37
+ logger?: Logger
38
+ /**
39
+ * Refresh the dependency dashboard.
40
+ *
41
+ * A hook rather than something this module does, because refreshing means
42
+ * a full scan and this file only knows about a provider. Absent means the
43
+ * caller cannot refresh, which is reported as a skip rather than passed
44
+ * off as done.
45
+ */
46
+ refreshDashboard?: () => Promise<void>
47
+ }): Promise<PostMergeOutcome>;
36
48
  /**
37
49
  * Whether a webhook payload describes a merged pull request.
38
50
  *
@@ -1,5 +1,5 @@
1
1
  import type { FileChange, Issue, IssueOptions, PullRequest, PullRequestOptions } from '../types';
2
- import type { GitProvider, ProviderCapabilities } from './provider';
2
+ import type { GitProvider, ListWorkflowRunsOptions, ProviderCapabilities, ReviewThread, WorkflowRun } from './provider';
3
3
  /**
4
4
  * Thrown when lockfile regeneration fails. Not a transient git error —
5
5
  * must bubble past the API fallback so we don't silently open a PR with
@@ -27,6 +27,8 @@ export declare class GitHubProvider implements GitProvider {
27
27
  hasWriteAccess(username: string): Promise<boolean>;
28
28
  reactToComment(commentId: number, reaction: 'eyes' | '+1' | '-1' | 'rocket' | 'confused'): Promise<void>;
29
29
  getWorkflowRunLogs(runId: number): Promise<string | null>;
30
+ listWorkflowRuns(branch: string, options?: ListWorkflowRunsOptions): Promise<WorkflowRun[]>;
31
+ rerunWorkflowRun(runId: number, failedJobsOnly?: boolean): Promise<boolean>;
30
32
  createCheckRun(name: string, headSha: string, result: { conclusion: 'success' | 'failure' | 'neutral', title: string, summary: string }): Promise<void>;
31
33
  getFileContent(path: string, ref: string): Promise<string | null>;
32
34
  getPullRequestDiff(prNumber: number): Promise<string>;
@@ -36,6 +38,8 @@ export declare class GitHubProvider implements GitProvider {
36
38
  comments?: Array<{ path: string, line: number, side: 'RIGHT' | 'LEFT', body: string }>
37
39
  }): Promise<{ posted: boolean, inlineComments: number }>;
38
40
  enableAutoMerge(prNumber: number, strategy?: 'merge' | 'squash' | 'rebase'): Promise<boolean>;
41
+ listReviewThreads(prNumber: number): Promise<ReviewThread[]>;
42
+ resolveReviewThread(_prNumber: number, threadId: string): Promise<boolean>;
39
43
  getPullRequestChecksState(prNumber: number): Promise<'success' | 'failure' | 'pending' | 'none'>;
40
44
  deleteBranch(branchName: string): Promise<void>;
41
45
  getBuddyBranches(): Promise<Array<{ name: string, sha: string, lastCommitDate: Date }>>;
@@ -1,5 +1,5 @@
1
1
  import type { FileChange, Issue, IssueOptions, PullRequest, PullRequestOptions } from '../types';
2
- import type { GitProvider, ProviderBranch, ProviderCapabilities, ReviewSubmission, ReviewSubmissionResult } from './provider';
2
+ import type { GitProvider, ListWorkflowRunsOptions, ProviderBranch, ProviderCapabilities, ReviewSubmission, ReviewSubmissionResult, ReviewThread, WorkflowRun } from './provider';
3
3
  import type { Logger } from '../utils/logger';
4
4
  /**
5
5
  * GitLab, through the v4 REST API.
@@ -45,6 +45,10 @@ export declare class GitLabProvider implements GitProvider {
45
45
  reactToComment(commentId: number, reaction: 'eyes' | '+1' | '-1' | 'rocket' | 'confused'): Promise<void>;
46
46
  hasWriteAccess(username: string): Promise<boolean>;
47
47
  getWorkflowRunLogs(runId: number): Promise<string | null>;
48
+ listWorkflowRuns(branch: string, options?: ListWorkflowRunsOptions): Promise<WorkflowRun[]>;
49
+ rerunWorkflowRun(runId: number): Promise<boolean>;
50
+ listReviewThreads(prNumber: number): Promise<ReviewThread[]>;
51
+ resolveReviewThread(prNumber: number, threadId: string): Promise<boolean>;
48
52
  getBuddyBranches(): Promise<ProviderBranch[]>;
49
53
  getOrphanedBuddyBranches(): Promise<ProviderBranch[]>;
50
54
  cleanupStaleBranches(olderThanDays?: number, dryRun?: boolean): Promise<{ deleted: string[], failed: string[] }>;
@@ -105,6 +105,8 @@ export declare interface ProviderCapabilities {
105
105
  nativeAutoMerge: boolean
106
106
  commentReactions: boolean
107
107
  ciLogs: boolean
108
+ reviewThreads: boolean
109
+ ciRuns: boolean
108
110
  teamReviewers: boolean
109
111
  draftPullRequests: boolean
110
112
  permissionLookup: boolean
@@ -112,6 +114,40 @@ export declare interface ProviderCapabilities {
112
114
  labels: boolean
113
115
  reopenPullRequests: boolean
114
116
  }
117
+ /**
118
+ * A review thread as the provider reports it.
119
+ *
120
+ * `authorLogins` rather than a single author because a thread is a
121
+ * conversation: the caller resolving one needs to know who *started* it, and
122
+ * the first login is that person.
123
+ */
124
+ export declare interface ReviewThread {
125
+ id: string
126
+ isResolved: boolean
127
+ path?: string
128
+ authorLogins: string[]
129
+ }
130
+ /**
131
+ * A CI run as the provider reports it.
132
+ *
133
+ * "Run" is GitHub's word. GitLab has pipelines *and* jobs, and this maps onto
134
+ * jobs, because a job is what `getWorkflowRunLogs` reads there — an `id` that
135
+ * could not be handed straight back to that method would be a trap.
136
+ */
137
+ export declare interface WorkflowRun {
138
+ id: number
139
+ name: string
140
+ headSha: string
141
+ headBranch: string
142
+ status: 'queued' | 'in_progress' | 'completed'
143
+ conclusion: 'success' | 'failure' | 'cancelled' | 'skipped' | null
144
+ createdAt: Date
145
+ }
146
+ /** Narrowing for {@link GitProvider.listWorkflowRuns}. */
147
+ export declare interface ListWorkflowRunsOptions {
148
+ status?: WorkflowRun['status']
149
+ limit?: number
150
+ }
115
151
  /** A branch buddy created, as the provider reports it. */
116
152
  export declare interface ProviderBranch {
117
153
  name: string
@@ -179,6 +215,10 @@ export declare interface GitProvider {
179
215
  reactToComment?: (commentId: number, reaction: 'eyes' | '+1' | '-1' | 'rocket' | 'confused') => Promise<void>
180
216
  hasWriteAccess?: (username: string) => Promise<boolean>
181
217
  getWorkflowRunLogs?: (runId: number) => Promise<string | null>
218
+ listReviewThreads?: (prNumber: number) => Promise<ReviewThread[]>
219
+ resolveReviewThread?: (prNumber: number, threadId: string) => Promise<boolean>
220
+ listWorkflowRuns?: (branch: string, options?: ListWorkflowRunsOptions) => Promise<WorkflowRun[]>
221
+ rerunWorkflowRun?: (runId: number, failedJobsOnly?: boolean) => Promise<boolean>
182
222
  getBuddyBranches?: () => Promise<ProviderBranch[]>
183
223
  getOrphanedBuddyBranches?: () => Promise<ProviderBranch[]>
184
224
  cleanupStaleBranches?: (olderThanDays?: number, dryRun?: boolean) => Promise<{ deleted: string[], failed: string[] }>
@@ -3,11 +3,14 @@ export type {
3
3
  CheckRunResult,
4
4
  GitProvider,
5
5
  GitProviderName,
6
+ ListWorkflowRunsOptions,
6
7
  ProviderBranch,
7
8
  ProviderCapabilities,
8
9
  ProviderConfig,
9
10
  ReviewSubmission,
11
+ ReviewThread,
10
12
  ReviewSubmissionResult,
13
+ WorkflowRun,
11
14
  } from './git/provider';
12
15
  export type { DoctorCheck, DoctorEnvironment, DoctorReport } from './doctor';
13
16
  export type { HeadlessOptions, HeadlessResult, SchemaViolation } from './headless/run';
package/dist/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{I as no,J as so,K as px,L as ox,M as xx,N as Ex,O as dx,P as fx,Q as Ax,R as Ox,S as Rx,T as Mx,U as Ux}from"../chunk-sp818c27.js";import{V as $o,W as ho}from"../chunk-3zdcekfj.js";import{X as to,Y as wo,Z as Po,_ as ao}from"../chunk-52x8mvh4.js";import{$ as AA,aa as OA,ba as RA,ca as MA,da as UA,ea as mA,fa as kA,ga as yA,ha as GA,ia as NA}from"../chunk-9h04nskh.js";import"../chunk-c9r9nd4t.js";import{ja as $d,ka as hd,la as td,ma as wd,na as Pd,oa as ad,pa as ud,qa as Vd,ra as gd}from"../chunk-zb62jhwm.js";import{sa as vd,ta as rd,ua as id,va as nd,wa as sd}from"../chunk-gngwjf70.js";import{Aa as rf,Ba as nf,Ca as sf,Da as pA,Ea as oA,Fa as xA,Ga as EA,Ha as dA,Ia as fA,xa as Vf,ya as gf,za as vf}from"../chunk-1wjnd24b.js";import{Ja as uo,Ka as Vo,La as go,Ma as vo,Na as ro,Oa as io}from"../chunk-xvptf9jy.js";import"../chunk-rb1fh9vd.js";import{Pa as mx}from"../chunk-x0ya2r4r.js";import"../chunk-1a53wj0h.js";import{Qa as cf,Ra as qf,Sa as Ff,Ta as Jf,Ua as Qf,Va as Xf,Wa as Zf,Xa as $f,Ya as hf,Za as uf}from"../chunk-pnpx1kqn.js";import{$a as wf,_a as tf,ab as Pf,bb as af}from"../chunk-fdj0tewy.js";import"../chunk-x9ctz1qc.js";import{cb as Ef,db as df,eb as ff,fb as Af,gb as Of,hb as Rf,ib as Mf,jb as Uf,kb as mf,lb as ef,mb as _f,nb as Sf,ob as lf,pb as Cf,qb as Df,rb as Bf}from"../chunk-bm8d40j0.js";import{sb as pf,tb as of,ub as xf}from"../chunk-4xsq18p3.js";import{vb as jo,wb as Ho,xb as Wo,yb as Ko}from"../chunk-dfesffnr.js";import{Ab as yf,Bb as Gf,Cb as Nf,zb as kf}from"../chunk-49ey79p0.js";import{Db as md,Eb as kd,Fb as yd,Gb as Gd,Hb as Nd,Ib as ed,Jb as _d,Kb as Sd,Lb as ld}from"../chunk-74pxb991.js";import{Mb as xd,Nb as Ed,Ob as dd,Pb as fd,Qb as Ad,Rb as Od,Sb as Rd,Tb as Md,Ub as Ud}from"../chunk-p4zwy518.js";import{$b as Ro,Vb as Eo,Wb as fo,Xb as Ao,Yb as Oo,ac as Mo}from"../chunk-h7hs95wn.js";import{cc as Uo,fc as mo,gc as ko,hc as yo,ic as Go,jc as No,kc as eo,lc as _o,mc as So,nc as lo,oc as Co,pc as Do,qc as Bo,rc as To,sc as zo,tc as Io,uc as Lo,vc as bo}from"../chunk-vh504tcv.js";import{wc as ep}from"../chunk-4f7panqj.js";import{xc as yp,yc as Gp,zc as Np}from"../chunk-r3zyw8x0.js";import{Bc as yx,Cc as Gx,Dc as Nx,Ec as ex}from"../chunk-1stt2whn.js";import{Fc as Qo,Gc as Xo,Hc as Zo}from"../chunk-mcrfxphm.js";import{Ic as K,Jc as Y,Kc as c,Lc as q,Mc as F,Nc as J,Oc as Q,Pc as X,Qc as Z,Rc as sp,Sc as po,Tc as oo,Uc as xo,Wc as Yo}from"../chunk-djntbp7a.js";import{$c as G,Xc as U,Yc as m,Zc as k,_c as y,ad as N}from"../chunk-1c1gznm9.js";import"../chunk-hw70wbzg.js";import{cd as Wp,dd as Kp,ed as Yp,fd as cp,gd as qp}from"../chunk-3q6czqs4.js";import{jd as Hp}from"../chunk-vyapg8ca.js";import{Ad as Jd,Bd as Qd,Cd as Xd,Dd as Zd,kd as Cd,ld as Dd,md as Bd,nd as Td,od as zd,pd as Id,qd as Ld,rd as bd,sd as jd,td as Hd,ud as Wd,vd as Kd,wd as Yd,xd as cd,yd as qd,zd as Fd}from"../chunk-vagxqhef.js";import"../chunk-xqx460y2.js";import{Gd as _p,Hd as Sp,Id as lp,Jd as Cp,Kd as Dp,Ld as Bp,Md as Tp,Nd as zp,Od as Ip,Pd as Lp,Qd as bp}from"../chunk-ts35hc5t.js";import{Rd as Tf,Sd as zf,Td as If,Ud as Lf,Vd as bf,Wd as jf,Xd as Hf,Yd as Wf,Zd as Kf,_d as Yf}from"../chunk-fvpr07dn.js";import{$d as np}from"../chunk-56q4pwb5.js";import"../chunk-tb5y0350.js";import{be as nE,ce as sE,de as pd,ee as od}from"../chunk-16yqbccr.js";import"../chunk-8rc6042h.js";import{ke as Fp,le as Jp,me as Qp,ne as Xp,oe as Zp,pe as $p,qe as hp,re as tp,se as wp,te as Pp,ue as ap}from"../chunk-4efbxdjr.js";import"../chunk-q9n79dd3.js";import{De as jp}from"../chunk-6md7qf2g.js";import{Ee as up,Fe as Vp,Ge as gp,He as vp,Ie as rp,Je as ip}from"../chunk-eagjp0dh.js";import"../chunk-6d9hmjt8.js";import{Oe as dp,Pe as fp,Qe as Ap,Re as Op,Se as Rp,Te as Mp,Ue as Up,Ve as mp,We as kp}from"../chunk-978wtejw.js";import"../chunk-pkkwb0n0.js";import"../chunk-ph1b3vbp.js";import"../chunk-0j7z87kh.js";import{$h as e,ai as _,bi as S,ci as l,di as C,ei as D,fi as B,gi as T,hi as z,ii as I,ji as L,ki as b,li as j,mi as H,ni as W}from"../chunk-naq32yx3.js";import{oi as LE,pi as bE,qi as jE,ri as HE,si as WE,ti as KE,ui as YE}from"../chunk-bxfc4g2x.js";import{Ai as PE,Bi as aE,Ci as uE,Di as VE,Ei as gE,Fi as vE,Gi as rE,Hi as iE,vi as ZE,wi as $E,xi as hE,yi as tE,zi as wE}from"../chunk-g0w8n555.js";import{Ii as cE,Ji as qE,Ki as FE,Li as JE,Mi as QE,Ni as XE}from"../chunk-tzs22es2.js";import"../chunk-9750tenz.js";import"../chunk-7mgec8kb.js";import{$i as co,aj as qo,bj as Fo,cj as Jo,ej as eA,fj as _A,gj as SA,hj as lA,ij as CA,jj as DA,kj as BA,lj as TA,mj as zA,nj as IA,oj as LA,pj as bA,qj as jA,rj as HA,sj as WA,tj as KA,uj as YA,vj as cA,wj as qA,xj as FA,yj as JA}from"../chunk-zs3jaj0g.js";import{zj as kx}from"../chunk-tn8prpny.js";import{Aj as s,Bj as pp,Cj as op,Dj as xp,Ej as Ep}from"../chunk-5k40mwd4.js";import{Fj as i}from"../chunk-4c9m61yd.js";import{Gj as n}from"../chunk-xakpdqaq.js";import{Hj as t,Ij as w,Jj as P,Kj as a,Lj as u,Mj as V}from"../chunk-1h3ey7k5.js";import{Nj as $,Oj as h,Pj as g,Qj as v,Rj as r}from"../chunk-akffynkc.js";import"../chunk-x3kragh9.js";import"../chunk-wdwvt7gb.js";import"../chunk-8661pvb8.js";import"../chunk-ctsz0ynx.js";import"../chunk-vkctfqpm.js";import"../chunk-6g1y9yqh.js";var{semver:A}=globalThis.Bun;class M{static compareVersions(p,o){return A.order(p,o)}static satisfiesRange(p,o){return A.satisfies(p,o)}static getLatestInRange(p,o){let O=p.filter((E)=>A.satisfies(E,o));if(O.length===0)return null;return O.sort((E,x)=>A.order(x,E))[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){let O=p.replace(/^[\^~>=<]+/,""),E=o.replace(/^[\^~>=<]+/,""),x=O.split(".").map((R)=>{let f=Number(R);return Number.isNaN(f)?0:f}),d=E.split(".").map((R)=>{let f=Number(R);return Number.isNaN(f)?0:f});while(x.length<3)x.push(0);while(d.length<3)d.push(0);if(d[0]>x[0])return"major";if(d[0]===x[0]&&d[1]>x[1])return"minor";return"patch"}static isSafeUpdate(p,o){return A.satisfies(o,p)}}export{hE as writeFileTool,rE as wrapUntrusted,Ux as withNarrative,rd as verifyChanges,YA as validateWorkflowGeneration,cA as validateRepositoryAccess,Af as validateFindings,Qo as validateConfig,to as validateAgainstSchema,DA as updateProgress,hd as unitTestsTouch,sp as toOsvEcosystem,Zp as tagUpdateType,Qd as syntaxAnalyzer,Lp as supports,B as summarizeUsage,nf as summarizeGates,Lo as stripOperators,Ff as stripNonCommandContext,id as stackedBranchName,So as splitConstraint,kp as sortUpdatesByPriority,wd as simplifyTouch,MA as similarity,Z as sign,JA as showFinalInstructions,C as shouldOpenAsDraft,Yf as shouldFail,Jd as shellcheckAnalyzer,uE as shellTool,FA as setupCustomWorkflow,v as setDefaultLogger,yf as serializeReviewState,Gd as serializeLearnings,_d as selectLearnings,Xp as selectLatestTag,Fd as secretsAnalyzer,Io as scanEcosystems,Ro as scanCatalogs,Qp as sameVariant,Do as rustAdapter,Dd as runTool,nd as runStackedTouch,Bf as runReviewForPR,SA as runPreflightChecks,dA as runPostMerge,wo as runHeadless,rf as runGates,Zd as runAnalyzers,oA as runAiGates,iE as runAgent,m as ruleMatches,Co as rubyAdapter,LE as reviewMode,Mf as reviewDiff,WE as restrictedMode,ZE as resolveWorkspacePath,k as resolveRuleEffects,Tp as resolveProviderToken,fd as resolveModelAlias,rp as resolveEngineVersion,wp as resolveCredentials,fo as resolveCatalogReference,Md as resolveAiProvider,Nx as resetConfigCache,Vd as renderTouchOffer,Mx as renderReport,NA as renderQuickLinks,OA as renderPackageContext,T as renderMigrationReport,Sd as renderLearnings,Cf as renderFinding,ho as renderDoctorReport,of as renderDiffForReview,zd as relativize,bo as regenerateLockfiles,Gp as regenerateLockFile,JE as redactError,FE as redactDeep,qE as redact,$E as readFileTool,lo as pythonAdapter,ao as publishOutput,Vo as productFor,Df as prepareReview,Pd as planTouch,HE as planMode,vp as pinBlocksUpdate,_o as pep440UpdateType,Eo as parseWorkspaceCatalogs,pf as parseUnifiedDiff,gd as parseTouchSelections,Td as parseToolJson,Fp as parseTag,Gf as parseReviewState,a as parseRetryDelay,TA as parseRemote,yA as parseQuickSelection,Go as parsePep440,fp as parsePackageFile,yd as parseLearnings,$p as parseImageRef,px as parseHistory,Jf as parseCommand,Pp as parseAuthChallenge,Hd as offsetToLine,ko as numericUpdateType,po as normalizeSeverity,l as normalizePlan,Nf as needsReview,G as mergeGroupEffects,Xf as mentionsBot,j as matchesGlobs,cd as markdownlintAnalyzer,Kp as mapWithConcurrency,Bd as mapSeverity,ld as loadLearnings,Ex as loadHistory,Sf as loadGuidelines,tE as listDirTool,Yd as linterAnalyzer,Qf as isReadOnlyCommand,eo as isPep440Prerelease,fA as isMergeEvent,Ao as isCatalogReference,_ as isAllowedCodemod,bE as implementMode,jd as hadolintAnalyzer,IA as guideTokenCreation,bA as guideRepositorySettings,N as groupsToRules,mp as groupUpdates,yo as goAdapter,bd as githubActionsAnalyzer,KA as getWorkflowPreset,xp as getNpmRegistryUrl,pp as getGitHubServerUrl,s as getGitHubApiUrl,ud as getFinishingTouch,r as getDefaultLogger,Gx as getConfig,Ep as getComposerRegistryUrl,yp as getAllLockFilePaths,YE as getAgentMode,HA as generateUnifiedWorkflow,qo as generateGitLabPipeline,WA as generateCoreWorkflows,jA as generateConfigFile,Up as generateBranchName,Fo as generateBitbucketPipeline,wE as fsTools,dp as formatSecurityAdvisorySection,Wf as formatReview,Lf as formatPretty,Rp as formatPRTitle,Mp as formatPRBody,hp as formatImageRef,Po as formatGithubOutput,bf as formatGithub,h as formatError,Xo as formatConfigIssues,Op as formatCommitMessage,jf as formatAgent,jE as fixCiMode,ff as fingerprint,D as findUsageSites,xx as findPrevious,AA as findMentionedPackages,xA as findLinkedIssues,UA as findDuplicates,Wo as findDrift,u as fetchWithTimeout,V as fetchJsonOrNull,wf as extractErrorLines,Vp as extractEngines,U as ecosystemOf,jo as driftFor,$d as docstringsTouch,qA as displayValidationResults,BA as displayProgress,hf as dispatchCommand,zf as diffArgsFor,$o as diagnose,Np as detectRequiredPackageManagers,zA as detectRepository,Ap as detectPackageManager,Kd as detectLinter,Uo as detectFiles,sd as detectChangedFiles,b as describeSpanGaps,Pf as describeFailure,c as describeEvent,io as describeEol,Ko as describeDrift,mf as defaultIncludePath,yx as defaultConfig,Of as dedupeFindings,go as cycleFor,X as createWebhookSink,J as createSlackSink,F as createSinks,Ip as createProvider,CA as createProgressTracker,Rd as createOpenAiProvider,Nd as createLearning,uf as createHandlers,Od as createGoogleProvider,Q as createDiscordSink,Ad as createAnthropicProvider,Ud as createAiClient,Hf as countBySeverity,RA as constrainLabels,LA as confirmTokenSetup,ex as config,Ax as computeMetrics,Ox as computeDeltas,lf as composeInstructions,Jp as compareVersions,No as comparePep440,mo as compareNumeric,Id as commandExists,L as collectSpanNotes,gp as collectResolutionPins,If as collectLocalDiff,xf as collectGitDiff,GA as clearQuickSelection,op as clearNpmrcCache,tf as classifyFailure,Jo as ciTemplateFor,Yp as chunk,Vf as checkTitleFormat,$f as checkPermission,sf as checkLinkedIssue,vo as checkEol,gf as checkDescription,vf as checkDependencies,pA as checkCustomAssertions,ip as bumpEngineConstraint,aE as buildShellEnv,S as buildAnalysisPrompt,td as autofixTouch,z as attemptMajorUpgrade,af as attemptFix,Zo as assertValidConfig,bp as assertSupports,zp as assertProviderSupported,Kf as applySuggestion,y as applyRules,Mo as applyCatalogUpdates,Oo as applyCatalogUpdate,W as appendUpgradeReport,ox as appendHistory,EA as appendChangelogEntry,tp as apiHostFor,Uf as anchorMap,lA as analyzeProject,H as analyzeGroupMajors,xo as advisoryKey,ed as addLearning,zo as adapterNamed,To as adapterFor,Ld as actionlintAnalyzer,q as WEBHOOK_PAYLOAD_VERSION,M as VersionResolver,Dp as UnsupportedProviderError,vE as Toolbelt,VE as ToolPermissionError,Cd as TOOL_TIMEOUT_MS,vd as TEST_COMMANDS,oo as SecurityAdvisoryService,mx as Scheduler,PE as SHELL_ENV_ALLOWLIST,Ef as SEVERITY_ORDER,qd as SECRET_RULES,jp as ReleaseNotesFetcher,qp as RegistryClient,Ho as ROOT,kf as REVIEW_STATE_VERSION,df as REVIEW_SCHEMA,Tf as REVIEW_FORMATS,dx as REPORT_PERIODS,Rx as REPORT_MARKER,cE as REDACTED,qf as READ_ONLY_COMMANDS,mA as QUICK_LINKS_MARKER,kA as QUICK_ACTIONS,Hp as PullRequestGenerator,_A as PluginManager,np as PackageScanner,sE as PackageRegistryError,lp as PROVIDER_TRACKING_ISSUES,Bp as PROVIDER_TOKEN_ENV,dd as PROVIDER_PRIORITY,_p as PROVIDER_NAMES,Ed as PROVIDER_KEY_ENV,fx as PERIOD_DAYS,ap as OciClient,Cp as NO_CAPABILITIES,xd as MODEL_ALIASES,e as MIGRATION_PLAN_SCHEMA,_f as MAX_GUIDELINE_CHARS,g as Logger,Wd as LINTER_SPECS,up as KNOWN_ENGINES,Sp as IMPLEMENTED_PROVIDERS,P as HttpRequestError,no as HISTORY_PATH,so as HISTORY_LIMIT,Zf as HELP_TEXT,pd as GitProviderError,i as GitLabProvider,ep as GitHubProvider,$ as GitHubApiError,kx as GitHubActionsTemplate,ad as FINISHING_TOUCHES,Y as EventBus,K as EVENT_NAMES,ro as EOL_WARNING_DAYS,uo as EOL_PRODUCTS,t as DEFAULT_TIMEOUT_MS,I as DEFAULT_SPAN_BUDGET,co as DEFAULT_SCHEDULE,w as DEFAULT_RETRIES,kd as DEFAULT_PROMPT_LIMIT,md as DEFAULT_LEARNINGS_FILE,ef as DEFAULT_GUIDELINE_FILES,Rf as DEFAULT_EXCLUDED_PATHS,Wp as DEFAULT_CONCURRENCY,eA as ConfigurationMigrator,od as ConfigurationError,cf as COMMAND_ALIASES,nE as BuddyError,Yo as Buddy,n as BitbucketProvider,gE as BUILTIN_TOOLS,Xd as BUILTIN_ANALYZERS,Bo as BUILTIN_ADAPTERS,cp as AsyncMemo,XE as AiProviderError,QE as AiBudgetExceededError,KE 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-0w695m54.js";import{W as ko,X as qo}from"../chunk-rayxmbcx.js";import{$ as Wo,Y as Jo,Z as Ko,_ as Qo}from"../chunk-jnb80k2x.js";import{aa as PR,ba as aR,ca as lR,da as yR,ea as CR,fa as NR,ga as _R,ha as zR,ia as DR,ja as TR}from"../chunk-69qyr9ef.js";import{ka as pR,la as oR,ma as mR,na as xR,oa as fR,pa as dR,qa as RR,ra as MR,sa as UR,ta as AR,ua as GR,va as ER,wa as OR}from"../chunk-fjp3a7hp.js";import{Aa as $o,Ba as bo,Ca as to,xa as Xo,ya as Yo,za as Zo}from"../chunk-3cvng2nz.js";import"../chunk-rb1fh9vd.js";import{Da as pm}from"../chunk-jz5zs812.js";import{Ea as ed,Fa as gd,Ga as rd,Ha as vd,Ia as id,Ja as sd,Ka as nd}from"../chunk-yr8eta7p.js";import{La as Zd,Ma as $d,Na as bd,Oa as td,Pa as wd,Qa as Sd,Ra as hd,Sa as ud,Ta as cd,Ua as Vd}from"../chunk-96ht6hwd.js";import{Va as Yf,Wa as Zf}from"../chunk-s6z3gm2s.js";import{$a as Sf,Xa as $f,Ya as bf,Za as tf,_a as wf,ab as hf,bb as uf,cb as cf,db as Vf,eb as ef,fb as gf,gb as rf}from"../chunk-s4zb0fcj.js";import{hb as vf,ib as sf,jb as nf,kb as pd,lb as od}from"../chunk-tw047td6.js";import{mb as Id}from"../chunk-patms7t8.js";import{Ab as Td,Bb as jd,Cb as Ld,Db as Bd,nb as dd,ob as Rd,pb as Md,qb as Ud,rb as Ad,sb as Gd,tb as Ed,ub as Od,vb as Pd,wb as Nd,xb as _d,yb as zd,zb as Dd}from"../chunk-4jyw358y.js";import{Eb as md,Fb as xd,Gb as fd}from"../chunk-q2tjkhez.js";import{Hb as Co,Ib as No,Jb as _o,Kb as zo}from"../chunk-vckhctmr.js";import{Lb as ad,Mb as ld,Nb as yd,Pb as Cd}from"../chunk-5yfaptmp.js";import{Qb as Rf,Rb as Mf,Sb as Uf,Tb as Af,Ub as Gf,Vb as Ef,Wb as Of,Xb as Pf,Yb as af}from"../chunk-rc2mk5x6.js";import{$b as nx,Zb as ix,_b as sx,ac as pf,bc as of,cc as mf,dc as xf,ec as ff,fc as df}from"../chunk-tjc2vgwn.js";import{gc as Vp,hc as ep,ic as gp,jc as rp,mc as vp,nc as ip}from"../chunk-61xecp1z.js";import{Ac as Uo,Bc as Ao,Cc as Go,Dc as Eo,Ec as Oo,Fc as Po,Gc as ao,Hc as lo,Ic as yo,pc as sp,sc as np,tc as po,uc as oo,vc as mo,wc as xo,xc as fo,yc as Ro,zc as Mo}from"../chunk-6p4qz8qv.js";import{Jc as dp}from"../chunk-bmnx3s41.js";import{Kc as mp,Lc as xp,Mc as fp}from"../chunk-8fw0v7bv.js";import{Oc as mm,Pc as xm,Qc as fm,Rc as dm}from"../chunk-tsckfwch.js";import{Sc as Bo,Tc as Fo,Uc as Ho}from"../chunk-cs066zt9.js";import{Vc as Sp,Wc as hp,Xc as up,Yc as cp,_c as Do}from"../chunk-e2t5jq26.js";import"../chunk-phfmnnne.js";import{ad as _p,bd as zp,cd as Dp,dd as Tp,ed as jp}from"../chunk-r763e19p.js";import{fd as wp}from"../chunk-be629jhq.js";import"../chunk-pkr6905p.js";import{hd as ex,id as gx,jd as rx,kd as vx}from"../chunk-eseshkd0.js";import{nd as Np}from"../chunk-11hdrnf6.js";import{od as Xf}from"../chunk-cwfkm7h9.js";import{pd as $x,qd as bx,rd as tx,sd as wx,td as Sx,ud as hx,vd as ux,wd as cx,xd as Vx}from"../chunk-mkzmjg3f.js";import{Ad as kd,Bd as qd,Cd as Jd,Dd as Kd,Ed as Qd,Fd as Wd,Gd as Xd,Hd as Yd,yd as Fd,zd as Hd}from"../chunk-vgtmrd4c.js";import{$d as Wf,Id as lf,Jd as yf,Kd as Cf,Ld as Nf,Md as _f,Nd as zf,Od as Df,Pd as Tf,Qd as jf,Rd as If,Sd as Lf,Td as Bf,Ud as Ff,Vd as Hf,Wd as kf,Xd as qf,Yd as Jf,Zd as Kf,_d as Qf}from"../chunk-nrr8z2z7.js";import"../chunk-xs12dtf1.js";import{ce as Rp,de as Mp,ee as Up,fe as Ap,ge as Gp,he as Ep,ie as Op,je as Pp,ke as ap,le as lp,me as yp}from"../chunk-5av2vnvv.js";import"../chunk-ytmxd5fk.js";import{Ae as Kp,Be as Qp,Ce as Wp,se as Ip,te as Lp,ue as Bp,ve as Fp,we as Hp,xe as kp,ye as qp,ze as Jp}from"../chunk-b9escac0.js";import{Je as Cp}from"../chunk-g30dr44w.js";import{Ke as Xp,Le as Yp,Me as Zp,Ne as $p,Oe as bp,Pe as tp}from"../chunk-2et8yavs.js";import"../chunk-txtrpypt.js";import{$e as _,We as a,Xe as l,Ye as y,Ze as C,_e as N,af as z,bf as D,cf as T,df as j,ef as I,ff as L,gf as B,hf as F,if as H}from"../chunk-8hjvthz4.js";import{jf as U,kf as A,lf as G,mf as E,nf as O,pf as P}from"../chunk-yngahb11.js";import{qf as Px,rf as ax,sf as lx,tf as yx,uf as Cx,vf as Nx}from"../chunk-08x5b93v.js";import{Af as kx,Bf as qx,Cf as Jx,Df as Kx,Ef as Qx,Ff as Wx,Gf as Xx,Hf as Yx,If as Zx,wf as Lx,xf as Bx,yf as Fx,zf as Hx}from"../chunk-p6qbqsyp.js";import"../chunk-1cpdz49v.js";import{Lf as _x,Mf as zx,Nf as Dx,Of as Tx,Pf as jx,Qf as Ix}from"../chunk-cgvt98pd.js";import"../chunk-c8rzx3a1.js";import{$f as pp,Uf as e,Vf as g,Wf as r,Xf as v,Yf as i,Zf as s,_f as n,ag as op,bg as d}from"../chunk-0hc97k0t.js";import"../chunk-3901s7h9.js";import"../chunk-jtxcr5yw.js";import"../chunk-qd2s51gc.js";import{$g as JR,Og as To,Pg as jo,Qg as Io,Rg as Lo,Tg as jR,Ug as IR,Vg as LR,Wg as BR,Xg as FR,Yg as HR,Zg as kR,_g as qR,ah as KR,bh as QR,ch as WR,dh as XR,eh as YR,fh as ZR,gh as $R,hh as bR,ih as tR,jh as wR,kh as SR,lh as hR,mh as uR}from"../chunk-vbeeyhhe.js";import{nh as om}from"../chunk-k26wnmzk.js";import{oh as S,ph as h,qh as u,rh as c,sh as V}from"../chunk-193abzy6.js";import{th as t}from"../chunk-5044y9en.js";import{uh as w}from"../chunk-f53y8ans.js";import{Ah as Y,vh as J,wh as K,xh as Q,yh as W,zh as X}from"../chunk-e68nf7cm.js";import{Bh as k,Ch as q,Dh as Z,Eh as $,Fh as b}from"../chunk-hfjywbbc.js";import"../chunk-g24hav8e.js";import"../chunk-q4t568hv.js";var{semver:m}=globalThis.Bun;class R{static compareVersions(p,o){return m.order(p,o)}static satisfiesRange(p,o){return m.satisfies(p,o)}static getLatestInRange(p,o){let f=p.filter((x)=>m.satisfies(x,o));if(f.length===0)return null;return f.sort((x,M)=>m.order(M,x))[0]}static createRange(p){return{raw:p,range:p.replace(/^[\^~>=<]+/,""),isExact:!/^[\^~>=<]/.test(p),satisfies:(o)=>this.satisfiesRange(o,p),getLatest:(o)=>this.getLatestInRange(o,p)}}static getUpdateType(p,o){return d(p,o)}static isSafeUpdate(p,o){return m.satisfies(o,p)}}export{Fx as writeFileTool,Yx as wrapUntrusted,gf as withTouchOffer,no as withNarrative,sf as verifyChanges,tR as validateWorkflowGeneration,wR as validateRepositoryAccess,Ud as validateFindings,Bo as validateConfig,Jo as validateAgainstSchema,HR as updateProgress,bf as unitTestsTouch,Sp as toOsvEcosystem,Hp as tagUpdateType,Kf as syntaxAnalyzer,lp as supports,z as summarizeUsage,fR as summarizeGates,lo as stripOperators,bd as stripNonCommandContext,nf as stackedBranchName,Mo as splitConstraint,op as sortUpdatesByPriority,wf as simplifyTouch,yR as similarity,Vx as sign,uR as showFinalInstructions,N as shouldOpenAsDraft,Yd as shouldFail,Jf as shellcheckAnalyzer,Kx as shellTool,hR as setupCustomWorkflow,$ as setDefaultLogger,ld as serializeReviewState,Af as serializeLearnings,Of as selectLearnings,Fp as selectLatestTag,qf as secretsAnalyzer,YR as schedulePlan,ao as scanEcosystems,vp as scanCatalogs,Bp as sameVariant,Go as rustAdapter,yf as runTool,pd as runStackedTouch,Bd as runReviewForPR,LR as runPreflightChecks,ER as runPostMerge,Zf as runPlan,Ko as runHeadless,xR as runGates,nd as runFixCi,Wf as runAnalyzers,UR as runAiGates,Zx as runAgent,A as ruleMatches,Ao as rubyAdapter,Ld as reviewPullRequest,Px as reviewMode,Ed as reviewDiff,Lx as resolveWorkspacePath,G as resolveRuleEffects,Op as resolveProviderToken,pf as resolveModelAlias,bp as resolveEngineVersion,Kp as resolveCredentials,ep as resolveCatalogReference,Id as resolveBuddyThreads,ff as resolveAiProvider,fm as resetConfigCache,Vf as renderTouchOffer,so as renderReport,TR as renderQuickLinks,aR as renderPackageContext,D as renderMigrationReport,Pf as renderLearnings,Td as renderFinding,qo as renderDoctorReport,xd as renderDiffForReview,_f as relativize,yo as regenerateLockfiles,xp as regenerateLockFile,Tx as redactError,Dx as redactDeep,zx as redact,Bx as readFileTool,Uo as pythonAdapter,Wo as publishOutput,Yo as productFor,jd as prepareReview,Sf as planTouch,yx as planMode,$p as pinBlocksUpdate,Ro as pep440UpdateType,Vp as parseWorkspaceCatalogs,md as parseUnifiedDiff,rf as parseTouchSelections,Nf as parseToolJson,Ip as parseTag,yd as parseReviewState,W as parseRetryDelay,qR as parseRemote,zR as parseQuickSelection,mo as parsePep440,g as parsePackageFile,Uf as parseLearnings,kp as parseImageRef,ho as parseHistory,td as parseCommand,Qp as parseAuthChallenge,If as offsetToLine,po as numericUpdateType,hp as normalizeSeverity,C as normalizePlan,Cd as needsReview,O as mergeGroupEffects,Sd as mentionsBot,B as matchesGlobs,Hf as markdownlintAnalyzer,zp as mapWithConcurrency,Cf as mapSeverity,af as loadLearnings,Vo as loadHistory,zd as loadGuidelines,Hx as listDirTool,Ff as linterAnalyzer,id as latestFailurePerWorkflow,wd as isReadOnlyCommand,fo as isPep440Prerelease,OR as isMergeEvent,gp as isCatalogReference,l as isAllowedCodemod,ax as implementMode,ef as hasTouchOffer,jf as hadolintAnalyzer,KR as guideTokenCreation,WR as guideRepositorySettings,P as groupsToRules,pp as groupUpdates,oo as goAdapter,Tf as githubActionsAnalyzer,bR as getWorkflowPreset,c as getNpmRegistryUrl,h as getGitHubServerUrl,S as getGitHubApiUrl,uf as getFinishingTouch,b as getDefaultLogger,xm as getConfig,V as getComposerRegistryUrl,mp as getAllLockFilePaths,Nx as getAgentMode,ZR as generateUnifiedWorkflow,jo as generateGitLabPipeline,$R as generateCoreWorkflows,XR as generateConfigFile,n as generateBranchName,Io as generateBitbucketPipeline,dR as gateIcon,kx as fsTools,e as formatSecurityAdvisorySection,Wd as formatReview,qd as formatPretty,i as formatPRTitle,s as formatPRBody,qp as formatImageRef,Qo as formatGithubOutput,Jd as formatGithub,q as formatError,Fo as formatConfigIssues,v as formatCommitMessage,Kd as formatAgent,lx as fixCiMode,Md as fingerprint,_ as findUsageSites,co as findPrevious,PR as findMentionedPackages,AR as findLinkedIssues,CR as findDuplicates,_o as findDrift,X as fetchWithTimeout,Y as fetchJsonOrNull,vd as failsOnBaseBranch,gd as extractErrorLines,Yp as extractEngines,Xf as emitEvent,U as ecosystemOf,Co as driftFor,$f as docstringsTouch,SR as displayValidationResults,kR as displayProgress,cd as dispatchCommand,Hd as diffArgsFor,ko as diagnose,fp as detectRequiredPackageManagers,JR as detectRepository,r as detectPackageManager,Bf as detectLinter,sp as detectFiles,od as detectChangedFiles,L as describeSpanGaps,rd as describeFailure,tx as describeEvent,to as describeEol,zo as describeDrift,Pd as defaultIncludePath,mm as defaultConfig,Ad as dedupeFindings,Zo as cycleFor,cx as createWebhookSink,hx as createSlackSink,Sx as createSinks,Yf as createReadIssueTool,ap as createProvider,FR as createProgressTracker,xf as createOpenAiProvider,Gf as createLearning,Vd as createHandlers,mf as createGoogleProvider,ux as createDiscordSink,of as createAnthropicProvider,df as createAiClient,Qd as countBySeverity,lR as constrainLabels,QR as confirmTokenSetup,dm as config,ro as computeMetrics,vo as computeDeltas,Dd as composeInstructions,Lp as compareVersions,xo as comparePep440,np as compareNumeric,zf as commandExists,I as collectSpanNotes,Zp as collectResolutionPins,kd as collectLocalDiff,fd as collectGitDiff,DR as clearQuickSelection,u as clearNpmrcCache,ed as classifyFailure,Lo as ciTemplateFor,Dp as chunk,pR as checkTitleFormat,ud as checkPermission,RR as checkLinkedIssue,$o as checkEol,oR as checkDescription,mR as checkDependencies,MR as checkCustomAssertions,tp as bumpEngineConstraint,Jx as buildShellEnv,y as buildAnalysisPrompt,tf as autofixTouch,T as attemptMajorUpgrade,sd as attemptFix,Ho as assertValidConfig,yp as assertSupports,Pp as assertProviderSupported,Xd as applySuggestion,E as applyRules,ip as applyCatalogUpdates,rp as applyCatalogUpdate,H as appendUpgradeReport,uo as appendHistory,GR as appendChangelogEntry,Jp as apiHostFor,Od as anchorMap,BR as analyzeProject,F as analyzeGroupMajors,cp as advisoryKey,Ef as addLearning,Po as adapterNamed,Oo as adapterFor,Df as actionlintAnalyzer,wx as WEBHOOK_PAYLOAD_VERSION,R as VersionResolver,Gp as UnsupportedProviderError,Xx as Toolbelt,Qx as ToolPermissionError,cf as TOUCH_OFFER_MARKER,lf as TOOL_TIMEOUT_MS,vf as TEST_COMMANDS,up as SecurityAdvisoryService,pm as Scheduler,qx as SHELL_ENV_ALLOWLIST,dd as SEVERITY_ORDER,kf as SECRET_RULES,Cp as ReleaseNotesFetcher,jp as RegistryClient,No as ROOT,ad as REVIEW_STATE_VERSION,Rd as REVIEW_SCHEMA,Fd as REVIEW_FORMATS,eo as REPORT_PERIODS,io as REPORT_MARKER,_x as REDACTED,$d as READ_ONLY_COMMANDS,NR as QUICK_LINKS_MARKER,_R as QUICK_ACTIONS,Np as PullRequestGenerator,IR as PluginManager,wp as PackageScanner,gx as PackageRegistryError,Up as PROVIDER_TRACKING_ISSUES,Ep as PROVIDER_TOKEN_ENV,nx as PROVIDER_PRIORITY,Rp as PROVIDER_NAMES,sx as PROVIDER_KEY_ENV,go as PERIOD_DAYS,Wp as OciClient,Ap as NO_CAPABILITIES,ix as MODEL_ALIASES,a as MIGRATION_PLAN_SCHEMA,_d as MAX_GUIDELINE_CHARS,Z as Logger,Lf as LINTER_SPECS,Xp as KNOWN_ENGINES,Mp as IMPLEMENTED_PROVIDERS,Q as HttpRequestError,wo as HISTORY_PATH,So as HISTORY_LIMIT,hd as HELP_TEXT,rx as GitProviderError,t as GitLabProvider,dp as GitHubProvider,k as GitHubApiError,om as GitHubActionsTemplate,hf as FINISHING_TOUCHES,bx as EventBus,$x as EVENT_NAMES,bo as EOL_WARNING_DAYS,Xo as EOL_PRODUCTS,J as DEFAULT_TIMEOUT_MS,j as DEFAULT_SPAN_BUDGET,To as DEFAULT_SCHEDULE,K as DEFAULT_RETRIES,Mf as DEFAULT_PROMPT_LIMIT,Rf as DEFAULT_LEARNINGS_FILE,Nd as DEFAULT_GUIDELINE_FILES,Gd as DEFAULT_EXCLUDED_PATHS,_p as DEFAULT_CONCURRENCY,jR as ConfigurationMigrator,vx as ConfigurationError,Zd as COMMAND_ALIASES,ex as BuddyError,Do as Buddy,w as BitbucketProvider,Wx as BUILTIN_TOOLS,Qf as BUILTIN_ANALYZERS,Eo as BUILTIN_ADAPTERS,Tp as AsyncMemo,Ix as AiProviderError,jx as AiBudgetExceededError,Cx as AGENT_MODES};
@@ -35,5 +35,5 @@ export declare class RegistryClient {
35
35
  getGitHubActionReleaseDate(actionName: string, version: string): Promise<Date | null>;
36
36
  getComposerPackageReleaseDate(packageName: string, version: string): Promise<Date | null>;
37
37
  getDockerImageReleaseDate(imageName: string, version: string): Promise<Date | null>;
38
- meetsMinimumReleaseAge(packageName: string, version: string, dependencyType?: string): Promise<boolean>;
38
+ meetsMinimumReleaseAge(packageName: string, version: string, dependencyType?: string, requiredMinutes?: number): Promise<boolean>;
39
39
  }
@@ -21,3 +21,4 @@ export {
21
21
  REPORT_PERIODS,
22
22
  } from './metrics';
23
23
  export { REPORT_MARKER, renderReport, withNarrative } from './render';
24
+ export { shouldPublishReport } from './publish-gate';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Whether a report run should publish.
3
+ *
4
+ * `reports.enabled` was documented as the opt-in for scheduled reports and
5
+ * defaulted to `false`, and nothing read it — the generated workflow published
6
+ * every week regardless. A person at a terminal typing `--publish` has already
7
+ * decided; the setting exists to govern the run nobody typed.
8
+ *
9
+ * @param options - Whether this is the scheduled run, and what config says
10
+ * @returns Whether to publish, and why not when not
11
+ * @example
12
+ * ```ts
13
+ * shouldPublishReport({ scheduled: true, enabled: undefined })
14
+ * // { publish: false, reason: 'reports.enabled is not set' }
15
+ * ```
16
+ */
17
+ export declare function shouldPublishReport(options: {
18
+ /** The run came from the generated workflow's schedule, not a person */
19
+ scheduled: boolean
20
+ /** `reports.enabled` from config */
21
+ enabled: boolean | undefined
22
+ }): { publish: boolean, reason?: string };
@@ -0,0 +1,36 @@
1
+ import type { BuddyConfig, PullRequest } from '../types';
2
+ /**
3
+ * Why this pull request should not be reviewed, if it should not be.
4
+ *
5
+ * These settings were declared, validated and documented long before anything
6
+ * read them, so a repository that set `ai.review.enabled: false` still got
7
+ * reviews. Each one is honoured here, in one place, rather than being scattered
8
+ * across the two paths that post reviews.
9
+ *
10
+ * `undefined` means "not configured" and never means "off": reviews already
11
+ * require both a workflow trigger and a provider key, so treating an unset flag
12
+ * as a refusal would silently disable reviews for every existing repository.
13
+ * Only an explicit `false` turns something off.
14
+ *
15
+ * @param config - Resolved Buddy configuration
16
+ * @param pr - Pull request under consideration
17
+ * @param trigger - Whether Buddy chose to review, or was asked to
18
+ * @returns A human-readable reason to skip, or `null` to go ahead
19
+ * @example
20
+ * ```ts
21
+ * const skip = reviewSkipReason(config, pr, 'automatic')
22
+ * if (skip)
23
+ * return skip
24
+ * ```
25
+ */
26
+ export declare function reviewSkipReason(config: BuddyConfig, pr: ReviewCandidate, trigger: ReviewTrigger): string | null;
27
+ /**
28
+ * How a review came to be running.
29
+ *
30
+ * The distinction matters because every filter here except `enabled` describes
31
+ * when Buddy should review *on its own*. Someone who types `@buddy review` on a
32
+ * draft has answered the question the filter exists to ask.
33
+ */
34
+ export type ReviewTrigger = 'automatic' | 'requested';
35
+ /** The pull request fields a filter decision needs. */
36
+ export type ReviewCandidate = Pick<PullRequest, 'title' | 'author' | 'draft'>;
@@ -3,6 +3,8 @@ export type { ReviewOptions, ReviewProfile } from './engine';
3
3
  export type { FindingSeverity, ReviewFinding, ReviewResult } from './findings';
4
4
  export type { ReviewState } from './marker';
5
5
  export type { RefFileReader } from './guidelines';
6
+ export type { ResolveThreadsOptions } from './resolve';
7
+ export type { ReviewOutcome } from './run';
6
8
  export type { RunReviewOptions } from './run';
7
9
  export type { InlineComment, PreparedReview } from './poster';
8
10
  export type { DiffMode, ReviewFormat } from './local';
@@ -33,7 +35,8 @@ export {
33
35
  MAX_GUIDELINE_CHARS,
34
36
  } from './guidelines';
35
37
  export { prepareReview, renderFinding } from './poster';
36
- export { runReviewForPR } from './run';
38
+ export { resolveBuddyThreads } from './resolve';
39
+ export { reviewPullRequest, runReviewForPR } from './run';
37
40
  export {
38
41
  applySuggestion,
39
42
  collectLocalDiff,
@@ -15,6 +15,24 @@ export declare function serializeReviewState(state: Omit<ReviewState, 'schemaVer
15
15
  * @returns The state, or `null` when absent or unreadable
16
16
  */
17
17
  export declare function parseReviewState(body: string | null | undefined): ReviewState | null;
18
+ /**
19
+ * Replace the review-state marker in a pull request body.
20
+ *
21
+ * The marker has to live on the pull request itself: `parseReviewState` reads
22
+ * `pr.body` and nothing else, so state written anywhere else — a review
23
+ * summary, a comment — is written and never read back.
24
+ *
25
+ * @param body - Current pull request body
26
+ * @param state - State to store
27
+ * @returns The body with exactly one, current, marker
28
+ * @example
29
+ * ```ts
30
+ * await provider.updatePullRequest(number, {
31
+ * body: upsertReviewState(pr.body, { reviewedSha, fingerprints, reviewedAt }),
32
+ * })
33
+ * ```
34
+ */
35
+ export declare function upsertReviewState(body: string | null | undefined, state: Omit<ReviewState, 'schemaVersion'>): string;
18
36
  /**
19
37
  * Whether a pull request needs reviewing.
20
38
  *
@@ -1,4 +1,5 @@
1
1
  import type { ReviewFinding, ReviewResult } from './findings';
2
+ import type { ReviewState } from './marker';
2
3
  /**
3
4
  * Render one finding as an inline comment.
4
5
  *
@@ -7,9 +8,15 @@ import type { ReviewFinding, ReviewResult } from './findings';
7
8
  * as prose only, since a half-right suggestion costs more to undo than to
8
9
  * write by hand.
9
10
  *
11
+ * On a platform whose `reviewSuggestions` capability is false the block
12
+ * renders as a plain code fence instead: Bitbucket shows a literal
13
+ * suggestion fence as noise, and the one-click apply it promises does not
14
+ * exist there.
15
+ *
10
16
  * @param finding - Finding to render
17
+ * @param options - Whether the platform renders suggestion blocks (default: it does)
11
18
  */
12
- export declare function renderFinding(finding: ReviewFinding): string;
19
+ export declare function renderFinding(finding: ReviewFinding, options?: { suggestions?: boolean }): string;
13
20
  /**
14
21
  * Build the summary comment and inline comments for a review.
15
22
  *
@@ -23,6 +30,8 @@ export declare function prepareReview(result: ReviewResult, options: {
23
30
  requestChangesOn?: 'never' | 'critical'
24
31
  /** Fingerprints already reported, carried forward into the new state */
25
32
  seenFingerprints?: string[]
33
+ /** Whether the platform renders suggestion blocks (default: it does) */
34
+ suggestions?: boolean
26
35
  }): PreparedReview;
27
36
  /** An inline comment ready for the review API. */
28
37
  export declare interface InlineComment {
@@ -36,4 +45,5 @@ export declare interface PreparedReview {
36
45
  body: string
37
46
  comments: InlineComment[]
38
47
  event: 'COMMENT' | 'REQUEST_CHANGES'
48
+ state: Omit<ReviewState, 'schemaVersion'>
39
49
  }
@@ -0,0 +1,20 @@
1
+ import type { GitProvider } from '../git/provider';
2
+ import type { Logger } from '../utils/logger';
3
+ /**
4
+ * Resolve the review threads Buddy opened on a pull request.
5
+ *
6
+ * @param options - Provider, pull request and whose threads to close
7
+ * @returns A short status line describing what happened
8
+ * @example
9
+ * ```ts
10
+ * const status = await resolveBuddyThreads({ provider, prNumber: 128 })
11
+ * ```
12
+ */
13
+ export declare function resolveBuddyThreads(options: ResolveThreadsOptions): Promise<string>;
14
+ /** Inputs to a resolve run. */
15
+ export declare interface ResolveThreadsOptions {
16
+ provider: GitProvider
17
+ prNumber: number
18
+ author?: string
19
+ logger?: Logger
20
+ }
@@ -1,6 +1,22 @@
1
+ import type { AiClient } from '../ai/types';
1
2
  import type { BuddyConfig } from '../types';
2
3
  import type { GitProvider } from '../git/provider';
3
4
  import type { Logger } from '../utils/logger';
5
+ import type { ReviewProfile } from './engine';
6
+ import type { ReviewResult } from './findings';
7
+ import type { ReviewTrigger } from './filters';
8
+ /**
9
+ * Review a pull request and report both the status and the findings.
10
+ *
11
+ * `runReviewForPR` returns only the status line, which is all a comment reply
12
+ * needs. The CLI needs the findings too: `--format` renders them and
13
+ * `--fail-on` gates the exit code on them, and both were accepted on the pull
14
+ * request path and then never applied, because the findings never came back.
15
+ *
16
+ * @param options - Repository context and review settings
17
+ * @returns The status, and the review when one was computed
18
+ */
19
+ export declare function reviewPullRequest(options: RunReviewOptions): Promise<ReviewOutcome>;
4
20
  /**
5
21
  * Review a pull request end to end and post the result.
6
22
  *
@@ -20,5 +36,24 @@ export declare interface RunReviewOptions {
20
36
  full?: boolean
21
37
  summaryOnly?: boolean
22
38
  skipIfReviewed?: boolean
39
+ profile?: ReviewProfile
40
+ dryRun?: boolean
41
+ ai?: AiClient | null
42
+ trigger?: ReviewTrigger
23
43
  logger?: Logger
24
44
  }
45
+ /**
46
+ * Review a pull request end to end and post the result.
47
+ *
48
+ * Shared by the CLI, the `@buddy review` command and the automatic
49
+ * trigger, so all three assemble context — guidelines, learnings, analyzer
50
+ * findings — the same way rather than drifting apart.
51
+ *
52
+ * @param options - Repository context and review settings
53
+ * @returns A short status line describing what happened
54
+ */
55
+ /** What a pull request review produced, for callers that need more than a status line. */
56
+ export declare interface ReviewOutcome {
57
+ status: string
58
+ result?: ReviewResult
59
+ }
@@ -60,6 +60,25 @@ export declare function mergeGroupEffects(effects: ResolvedEffects[]): {
60
60
  prPriority: number
61
61
  autoMigrate: boolean
62
62
  };
63
+ /**
64
+ * Whether a strategy permits an update of this type.
65
+ *
66
+ * A strategy names the greatest semver impact a run may propose, so each one
67
+ * admits its own update type and everything gentler beneath it. Exported so the
68
+ * global filter in `src/buddy.ts` resolves the same question through the same
69
+ * function — the two carried separate switches once, and disagreed, which made
70
+ * `packages.strategy` and a rule-level `strategy` mean different things.
71
+ *
72
+ * @param strategy - Ceiling on semver impact
73
+ * @param updateType - The impact of the update being considered
74
+ * @returns Whether the update is within the ceiling
75
+ * @example
76
+ * ```ts
77
+ * strategyAllows('minor', 'patch') // true
78
+ * strategyAllows('patch', 'major') // false
79
+ * ```
80
+ */
81
+ export declare function strategyAllows(strategy: NonNullable<PackageRule['strategy']>, updateType: 'major' | 'minor' | 'patch'): boolean;
63
82
  /**
64
83
  * Compile legacy `packages.groups` into equivalent rules.
65
84
  *
@@ -1,4 +1,4 @@
1
- import type { Dependency } from '../types';
1
+ import type { Dependency, PackageUpdate } from '../types';
2
2
  /**
3
3
  * Extract `engines` as dependencies.
4
4
  *
@@ -78,6 +78,39 @@ export declare function resolveEngineVersion(engine: string, lookups: {
78
78
  * ```
79
79
  */
80
80
  export declare function bumpEngineConstraint(constraint: string, latest: string): string | null;
81
+ /**
82
+ * Classify an engine bump by the first component that changed.
83
+ *
84
+ * Constraints carry operators and are often imprecise (`>=20`), so semver
85
+ * ordering cannot be applied to them directly. Comparing the numeric parts
86
+ * positionally is what the constraint means anyway.
87
+ *
88
+ * @param current - The declared constraint
89
+ * @param next - The proposed constraint
90
+ * @returns The semver impact of the change
91
+ * @example
92
+ * ```ts
93
+ * engineUpdateType('>=20', '>=22') // 'major'
94
+ * engineUpdateType('>=20.5', '>=20.9') // 'minor'
95
+ * ```
96
+ */
97
+ export declare function engineUpdateType(current: string, next: string): PackageUpdate['updateType'];
98
+ /**
99
+ * Rewrite engine constraints in a package.json's text.
100
+ *
101
+ * String replacement rather than parse-and-serialise, for the same reason the
102
+ * dependency writer does it: the file's indentation, key order and trailing
103
+ * newline are somebody's choices, and re-serialising would silently discard
104
+ * them in a pull request that claims to touch one line.
105
+ *
106
+ * Scoped to the `engines` object, so an engine whose name is also a dependency
107
+ * — `npm`, `yarn` — is not rewritten in `devDependencies` by mistake.
108
+ *
109
+ * @param content - Current package.json text
110
+ * @param updates - Engine updates to apply
111
+ * @returns The rewritten text, unchanged when nothing matched
112
+ */
113
+ export declare function applyEngineUpdates(content: string, updates: PackageUpdate[]): string;
81
114
  /**
82
115
  * Runtimes buddy knows how to resolve a version for.
83
116
  * @defaultValue
@@ -25,9 +25,37 @@ export declare function detectRepository(): Promise<RepositoryInfo | null>;
25
25
  export declare function guideTokenCreation(repoInfo: RepositoryInfo): Promise<void>;
26
26
  export declare function confirmTokenSetup(): Promise<{ hasCustomToken: boolean, needsGuide: boolean }>;
27
27
  export declare function guideRepositorySettings(repoInfo: RepositoryInfo): Promise<void>;
28
- export declare function generateConfigFile(repoInfo: RepositoryInfo, hasCustomToken: boolean): Promise<void>;
29
- export declare function generateUnifiedWorkflow(_hasCustomToken: boolean): string;
30
- export declare function generateCoreWorkflows(_preset: WorkflowPreset, _repoInfo: RepositoryInfo, hasCustomToken: boolean, logger: Logger): Promise<void>;
28
+ export declare function generateConfigFile(repoInfo: RepositoryInfo, hasCustomToken: boolean, preset?: WorkflowPreset): Promise<void>;
29
+ /**
30
+ * Work out which jobs each scheduled tick should start.
31
+ *
32
+ * The generated workflow names its cron expressions twice — once in the
33
+ * `schedule:` trigger list and once in the `determine-jobs` step that matches
34
+ * `github.event.schedule` to decide what to run. Those two have to agree
35
+ * exactly, and a cron declared in one but not the other produces a workflow
36
+ * that starts and does nothing. Deriving both from this plan makes that
37
+ * particular drift impossible rather than merely unlikely.
38
+ *
39
+ * Two properties matter and neither is obvious from the preset data:
40
+ *
41
+ * - **A shared cron runs every job that asked for it.** Most presets give
42
+ * updates and the dashboard the same expression, and a naive if/elif chain
43
+ * would let the first branch win and drop the other job entirely.
44
+ * - **`manual` means no schedule**, not a cron expression. The `testing` and
45
+ * `custom` presets use it, and emitting it verbatim yields YAML that GitHub
46
+ * refuses to parse.
47
+ *
48
+ * @param preset - The workflow preset being generated
49
+ * @returns Distinct cron expressions, each with the jobs it starts
50
+ * @example
51
+ * ```ts
52
+ * schedulePlan(getWorkflowPreset('standard'))
53
+ * // [{ cron: '0 9 * * 1,3,5', jobs: ['update', 'dashboard'] }, ...]
54
+ * ```
55
+ */
56
+ export declare function schedulePlan(preset: WorkflowPreset): ScheduleEntry[];
57
+ export declare function generateUnifiedWorkflow(_hasCustomToken: boolean, preset?: WorkflowPreset): string;
58
+ export declare function generateCoreWorkflows(preset: WorkflowPreset, _repoInfo: RepositoryInfo, hasCustomToken: boolean, logger: Logger): Promise<void>;
31
59
  export declare function getWorkflowPreset(useCase: string): WorkflowPreset;
32
60
  // Enhanced testing and validation functions
33
61
  export declare function validateWorkflowGeneration(workflowContent: string): Promise<ValidationResult>;
@@ -115,14 +143,22 @@ export declare interface SetupPlugin {
115
143
  enabled: boolean
116
144
  }
117
145
  export declare interface SetupTrigger {
118
- event: 'pre_setup' | 'post_setup' | 'step_complete' | 'validation_error' | 'setup_complete'
119
- condition?: string
146
+ event: string
120
147
  }
121
148
  export declare interface SetupHook {
122
149
  name: string
123
150
  priority: number
124
151
  async: boolean
125
- handler: (context: SetupContext) => Promise<void> | void
152
+ handler?: (context: SetupContext) => Promise<void> | void
153
+ action?: SetupHookAction
154
+ }
155
+ /*.json` in
156
+ * a repository into arbitrary code execution on whoever runs `buddy setup`.
157
+ */
158
+ export declare interface SetupHookAction {
159
+ type: 'webhook'
160
+ url: string
161
+ body?: Record<string, unknown>
126
162
  }
127
163
  export declare interface PluginConfig {
128
164
  [key: string]: any
@@ -135,17 +171,14 @@ export declare interface SetupContext {
135
171
  analysis: ProjectAnalysis
136
172
  plugins: SetupPlugin[]
137
173
  }
138
- export declare interface IntegrationPoint {
139
- tool: string
140
- endpoint: string
141
- authentication: AuthConfig
142
- dataMapping: Record<string, string>
143
- enabled: boolean
144
- }
145
- export declare interface AuthConfig {
146
- type: 'token' | 'oauth' | 'webhook' | 'api_key'
147
- credentials: Record<string, string>
174
+ /** One cron expression and everything it starts. */
175
+ export declare interface ScheduleEntry {
176
+ cron: string
177
+ jobs: ScheduledJob[]
178
+ updateStrategy?: string
148
179
  }
180
+ /** A job a scheduled tick can start. */
181
+ export type ScheduledJob = 'update' | 'dashboard' | 'check' | 'report';
149
182
  // Configuration Migration Implementation
150
183
  export declare class ConfigurationMigrator {
151
184
  detectExistingTools(): Promise<DetectedTool[]>;
@@ -153,7 +186,6 @@ export declare class ConfigurationMigrator {
153
186
  migrateFromDependabot(configPath: string): Promise<MigrationResult>;
154
187
  generateMigrationReport(results: MigrationResult[]): Promise<string>;
155
188
  }
156
- // Plugin Architecture Implementation
157
189
  export declare class PluginManager {
158
190
  discoverPlugins(): Promise<SetupPlugin[]>;
159
191
  loadPlugin(plugin: SetupPlugin): Promise<void>;
package/dist/src/setup.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ej as a,fj as b,gj as c,hj as d,ij as e,jj as f,kj as g,lj as h,mj as i,nj as j,oj as k,pj as l,qj as m,rj as n,sj as o,tj as p,uj as q,vj as r,wj as s,xj as t,yj as u}from"../chunk-zs3jaj0g.js";import"../chunk-tn8prpny.js";import"../chunk-5k40mwd4.js";import"../chunk-1h3ey7k5.js";import"../chunk-akffynkc.js";import"../chunk-6g1y9yqh.js";export{q as validateWorkflowGeneration,r as validateRepositoryAccess,f as updateProgress,u as showFinalInstructions,t as setupCustomWorkflow,c as runPreflightChecks,h as parseRemote,j as guideTokenCreation,l as guideRepositorySettings,p as getWorkflowPreset,n as generateUnifiedWorkflow,o as generateCoreWorkflows,m as generateConfigFile,s as displayValidationResults,g as displayProgress,i as detectRepository,e as createProgressTracker,k as confirmTokenSetup,d as analyzeProject,b as PluginManager,a as ConfigurationMigrator};
2
+ import{$g as i,Tg as a,Ug as b,Vg as c,Wg as d,Xg as e,Yg as f,Zg as g,_g as h,ah as j,bh as k,ch as l,dh as m,eh as n,fh as o,gh as p,hh as q,ih as r,jh as s,kh as t,lh as u,mh as v}from"../chunk-vbeeyhhe.js";import"../chunk-k26wnmzk.js";import"../chunk-193abzy6.js";import"../chunk-e68nf7cm.js";import"../chunk-hfjywbbc.js";import"../chunk-q4t568hv.js";export{r as validateWorkflowGeneration,s as validateRepositoryAccess,f as updateProgress,v as showFinalInstructions,u as setupCustomWorkflow,n as schedulePlan,c as runPreflightChecks,h as parseRemote,j as guideTokenCreation,l as guideRepositorySettings,q as getWorkflowPreset,o as generateUnifiedWorkflow,p as generateCoreWorkflows,m as generateConfigFile,t as displayValidationResults,g as displayProgress,i as detectRepository,e as createProgressTracker,k as confirmTokenSetup,d as analyzeProject,b as PluginManager,a as ConfigurationMigrator};
@@ -10,6 +10,7 @@ export declare interface WorkflowConfig {
10
10
  conditions?: string[]
11
11
  }
12
12
  reviewers?: string[]
13
+ assignees?: string[]
13
14
  labels?: string[]
14
15
  }
15
16
  export declare class GitHubActionsTemplate {
@@ -25,6 +26,7 @@ export declare class GitHubActionsTemplate {
25
26
  strategy?: 'major' | 'minor' | 'patch' | 'all'
26
27
  autoMerge?: boolean | { enabled: boolean, strategy: 'merge' | 'squash' | 'rebase', conditions?: string[] }
27
28
  reviewers?: string[]
29
+ assignees?: string[]
28
30
  labels?: string[]
29
31
  }, config?: BuddyConfig): string;
30
32
  static generateSecurityAuditWorkflow(): string;