@github-tools/sdk 1.12.0 → 1.14.0

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 (45) hide show
  1. package/README.md +22 -17
  2. package/dist/connect/eve.d.mts +2 -3
  3. package/dist/connect/eve.d.mts.map +1 -1
  4. package/dist/connect/eve.mjs +1 -1
  5. package/dist/connect.d.mts +8 -86
  6. package/dist/connect.d.mts.map +1 -1
  7. package/dist/connect.mjs +2 -2
  8. package/dist/eve-runtime-BdolQrBF.mjs +275 -0
  9. package/dist/eve-runtime-BdolQrBF.mjs.map +1 -0
  10. package/dist/{eve-runtime-BmoVTbEU.d.mts → eve-runtime-D1v4C0UP.d.mts} +14 -6
  11. package/dist/eve-runtime-D1v4C0UP.d.mts.map +1 -0
  12. package/dist/eve-runtime.d.mts +4 -3
  13. package/dist/eve-runtime.mjs +2 -2
  14. package/dist/eve.d.mts +4 -4
  15. package/dist/eve.d.mts.map +1 -1
  16. package/dist/eve.mjs +2 -2
  17. package/dist/index-PqQNoVuw.d.mts +287 -0
  18. package/dist/index-PqQNoVuw.d.mts.map +1 -0
  19. package/dist/index.d.mts +3 -2
  20. package/dist/index.mjs +3 -3
  21. package/dist/{src-D45Onmsn.mjs → src-D9WxaIVj.mjs} +83 -4
  22. package/dist/src-D9WxaIVj.mjs.map +1 -0
  23. package/dist/{token-BIn80-XU.mjs → token-Dt6qs_kf.mjs} +9 -168
  24. package/dist/token-Dt6qs_kf.mjs.map +1 -0
  25. package/dist/tool-types-DbZpOYFG.d.mts +3312 -0
  26. package/dist/tool-types-DbZpOYFG.d.mts.map +1 -0
  27. package/dist/{types-CiNZNOXa.d.mts → types-BAEqBfM5.d.mts} +3 -3
  28. package/dist/{types-CiNZNOXa.d.mts.map → types-BAEqBfM5.d.mts.map} +1 -1
  29. package/dist/{types-CoTpsxxp.d.mts → types-CCoH12WC.d.mts} +4 -3
  30. package/dist/types-CCoH12WC.d.mts.map +1 -0
  31. package/dist/workflow.d.mts +2 -1
  32. package/dist/workflow.d.mts.map +1 -1
  33. package/dist/workflow.mjs +2 -2
  34. package/dist/{write-tools-CnJE0Vvu.mjs → write-tools-Ct0ZV87Z.mjs} +1296 -306
  35. package/dist/write-tools-Ct0ZV87Z.mjs.map +1 -0
  36. package/package.json +3 -3
  37. package/dist/eve-runtime-3asyv7YM.mjs +0 -771
  38. package/dist/eve-runtime-3asyv7YM.mjs.map +0 -1
  39. package/dist/eve-runtime-BmoVTbEU.d.mts.map +0 -1
  40. package/dist/index-CGeFo38P.d.mts +0 -783
  41. package/dist/index-CGeFo38P.d.mts.map +0 -1
  42. package/dist/src-D45Onmsn.mjs.map +0 -1
  43. package/dist/token-BIn80-XU.mjs.map +0 -1
  44. package/dist/types-CoTpsxxp.d.mts.map +0 -1
  45. package/dist/write-tools-CnJE0Vvu.mjs.map +0 -1
@@ -196,6 +196,58 @@ function gitBlobSha(content) {
196
196
  return sha1Hex(payload);
197
197
  }
198
198
  //#endregion
199
+ //#region src/core/pagination.ts
200
+ const pageSchema = z.number().int().positive().optional().default(1).describe("1-based page. When hasMore is true, call again with nextPage (or page + 1). Do not repeat the same page.");
201
+ const maxPagesSchema = z.number().int().positive().max(20).optional().describe("Fetch and combine up to this many pages in one call (max 20). Prefer this over many page=N calls. Omit to fetch a single page. If hasMore, the next start page is nextPage, not page + 1.");
202
+ function pagingFields(page, perPage, itemCount, hasMore) {
203
+ return {
204
+ hasMore,
205
+ page,
206
+ perPage,
207
+ ...hasMore ? { nextPage: page + Math.max(1, Math.ceil(itemCount / perPage)) } : {}
208
+ };
209
+ }
210
+ /** True when the returned window does not yet cover `totalCount`. */
211
+ function hasMoreByTotal(page, perPage, itemCount, totalCount) {
212
+ return (page - 1) * perPage + itemCount < totalCount;
213
+ }
214
+ function pagedList(items, perPage, page, hasMore) {
215
+ return {
216
+ items,
217
+ ...pagingFields(page, perPage, items.length, hasMore)
218
+ };
219
+ }
220
+ /**
221
+ * Fetches a single page (`startPage`, default 1) by default. When `maxPages`
222
+ * is set, fetches pages sequentially starting at `startPage` and stops early
223
+ * once a page returns fewer than `perPage` items (the last page).
224
+ * `hasMore` is true when the last fetched page was full.
225
+ */
226
+ async function fetchAllPages(fetchPage, perPage, maxPages, startPage = 1) {
227
+ if (!maxPages || maxPages <= 1) {
228
+ const items = await fetchPage(startPage);
229
+ return {
230
+ items,
231
+ hasMore: items.length >= perPage
232
+ };
233
+ }
234
+ const items = [];
235
+ let hasMore = false;
236
+ for (let i = 0; i < maxPages; i++) {
237
+ const pageItems = await fetchPage(startPage + i);
238
+ items.push(...pageItems);
239
+ if (pageItems.length < perPage) {
240
+ hasMore = false;
241
+ break;
242
+ }
243
+ hasMore = true;
244
+ }
245
+ return {
246
+ items,
247
+ hasMore
248
+ };
249
+ }
250
+ //#endregion
199
251
  //#region src/core/repository.ts
200
252
  const CREATE_COMMIT_ON_BRANCH_MUTATION = `
201
253
  mutation CreateCommitOnBranch($input: CreateCommitOnBranchInput!) {
@@ -274,21 +326,23 @@ async function getRepositoryCore({ token, owner, repo }) {
274
326
  const listBranchesInputSchema = z.object({
275
327
  owner: z.string().describe("Repository owner"),
276
328
  repo: z.string().describe("Repository name"),
277
- perPage: z.number().optional().default(30).describe("Number of branches to return (max 100)")
329
+ perPage: z.number().optional().default(30).describe("Number of branches to return (max 100)"),
330
+ page: pageSchema
278
331
  });
279
- const listBranchesDescription = "List branches in a GitHub repository";
280
- async function listBranchesCore({ token, owner, repo, perPage }) {
332
+ const listBranchesDescription = "List branches in a GitHub repository. When hasMore, pass nextPage — do not repeat the same call.";
333
+ async function listBranchesCore({ token, owner, repo, perPage, page = 1 }) {
281
334
  return withOctokit(token, async (octokit) => {
282
335
  const { data } = await octokit.rest.repos.listBranches({
283
336
  owner,
284
337
  repo,
285
- per_page: perPage
338
+ per_page: perPage,
339
+ page
286
340
  });
287
- return data.map((branch) => ({
341
+ return pagedList(data.map((branch) => ({
288
342
  name: branch.name,
289
343
  sha: branch.commit.sha,
290
344
  protected: branch.protected
291
- }));
345
+ })), perPage, page, data.length >= perPage);
292
346
  });
293
347
  }
294
348
  const getFileContentInputSchema = z.object({
@@ -354,10 +408,11 @@ const getRepositoryTreeInputSchema = z.object({
354
408
  owner: z.string().describe("Repository owner"),
355
409
  repo: z.string().describe("Repository name"),
356
410
  ref: z.string().optional().describe("Branch, tag, or commit SHA (defaults to the default branch)"),
357
- recursive: z.boolean().optional().default(false).describe("Recursively list the entire tree instead of just the top level")
411
+ path: z.string().optional().describe("Only entries at or under this directory prefix. Prefer this over recursive true on large repos"),
412
+ recursive: z.boolean().optional().default(false).describe("Recursively list the entire tree instead of just the top level. Prefer path + recursive false when exploring")
358
413
  });
359
- const getRepositoryTreeDescription = "List the file and directory structure of a repository at a given ref";
360
- async function getRepositoryTreeCore({ token, owner, repo, ref, recursive }) {
414
+ const getRepositoryTreeDescription = "List the file and directory structure of a repository at a given ref. Prefer a path prefix over recursive true. If truncated, narrow path instead of recalling the full tree.";
415
+ async function getRepositoryTreeCore({ token, owner, repo, ref, path, recursive }) {
361
416
  return withOctokit(token, async (octokit) => {
362
417
  const treeSha = ref || (await octokit.rest.repos.get({
363
418
  owner,
@@ -369,15 +424,21 @@ async function getRepositoryTreeCore({ token, owner, repo, ref, recursive }) {
369
424
  tree_sha: treeSha,
370
425
  recursive: recursive ? "true" : void 0
371
426
  });
427
+ const prefix = path?.replace(/\/+$/, "");
428
+ const entries = data.tree.filter((entry) => {
429
+ if (!prefix || !entry.path) return !prefix;
430
+ return entry.path === prefix || entry.path.startsWith(`${prefix}/`);
431
+ }).map((entry) => ({
432
+ path: entry.path,
433
+ type: entry.type,
434
+ size: entry.size,
435
+ sha: entry.sha
436
+ }));
372
437
  return {
373
438
  sha: data.sha,
374
439
  truncated: data.truncated,
375
- entries: data.tree.map((entry) => ({
376
- path: entry.path,
377
- type: entry.type,
378
- size: entry.size,
379
- sha: entry.sha
380
- }))
440
+ path: prefix,
441
+ entries
381
442
  };
382
443
  });
383
444
  }
@@ -428,6 +489,26 @@ async function createBranchCore({ token, owner, repo, branch, from }) {
428
489
  };
429
490
  });
430
491
  }
492
+ const deleteBranchInputSchema = z.object({
493
+ owner: z.string().describe("Repository owner"),
494
+ repo: z.string().describe("Repository name"),
495
+ branch: z.string().describe("Branch name to delete (without the refs/heads/ prefix)")
496
+ });
497
+ const deleteBranchDescription = "Delete a branch from a GitHub repository permanently";
498
+ /** Not idempotent — deleting a branch that no longer exists fails with a 422. */
499
+ async function deleteBranchCore({ token, owner, repo, branch }) {
500
+ return withOctokit(token, async (octokit) => {
501
+ await octokit.rest.git.deleteRef({
502
+ owner,
503
+ repo,
504
+ ref: `heads/${branch}`
505
+ });
506
+ return {
507
+ deleted: true,
508
+ branch
509
+ };
510
+ });
511
+ }
431
512
  const forkRepositoryInputSchema = z.object({
432
513
  owner: z.string().describe("Repository owner to fork from"),
433
514
  repo: z.string().describe("Repository name to fork"),
@@ -592,6 +673,8 @@ async function createOrUpdateFileCore({ token, owner, repo, path, message, conte
592
673
  //#region src/core/model-output.ts
593
674
  const MAX_PATCH_LENGTH = 4e3;
594
675
  const MAX_CONTENT_LENGTH = 2e4;
676
+ const MAX_MODEL_TREE_ENTRIES = 200;
677
+ const MAX_MODEL_DIFF_FILES = 80;
595
678
  function truncateText(text, maxLength) {
596
679
  if (text.length <= maxLength) return text;
597
680
  return `${text.slice(0, maxLength)}\n\n[truncated: ${text.length - maxLength} more characters]`;
@@ -602,34 +685,66 @@ function truncatePatchFields(files) {
602
685
  patch: file.patch ? truncateText(file.patch, MAX_PATCH_LENGTH) : file.patch
603
686
  }));
604
687
  }
688
+ function capDiffFiles(files) {
689
+ if (!files) return {
690
+ files,
691
+ filesOmitted: 0
692
+ };
693
+ const truncated = truncatePatchFields(files);
694
+ if (truncated.length <= MAX_MODEL_DIFF_FILES) return {
695
+ files: truncated,
696
+ filesOmitted: 0
697
+ };
698
+ return {
699
+ files: truncated.slice(0, MAX_MODEL_DIFF_FILES),
700
+ filesOmitted: truncated.length - MAX_MODEL_DIFF_FILES
701
+ };
702
+ }
605
703
  function listPullRequestFilesToModelOutput({ output }) {
704
+ const result = output;
606
705
  return {
607
706
  type: "json",
608
- value: truncatePatchFields(output)
707
+ value: {
708
+ ...result,
709
+ items: truncatePatchFields(result.items)
710
+ }
609
711
  };
610
712
  }
611
713
  function getCommitToModelOutput({ output }) {
612
714
  const commit = output;
715
+ const { files, filesOmitted } = capDiffFiles(commit.files);
613
716
  return {
614
717
  type: "json",
615
718
  value: {
616
719
  ...commit,
617
- files: commit.files ? truncatePatchFields(commit.files) : commit.files
720
+ files,
721
+ ...filesOmitted > 0 ? { filesOmitted } : {}
618
722
  }
619
723
  };
620
724
  }
621
725
  function compareCommitsToModelOutput({ output }) {
622
726
  const comparison = output;
727
+ const { files, filesOmitted } = capDiffFiles(comparison.files);
623
728
  return {
624
729
  type: "json",
625
730
  value: {
626
731
  ...comparison,
627
- files: comparison.files ? truncatePatchFields(comparison.files) : comparison.files
732
+ files,
733
+ ...filesOmitted > 0 ? { filesOmitted } : {}
628
734
  }
629
735
  };
630
736
  }
631
737
  function getFileContentToModelOutput({ output }) {
632
738
  const result = output;
739
+ if (result.type === "directory" && "entries" in result && result.entries.length > MAX_MODEL_TREE_ENTRIES) return {
740
+ type: "json",
741
+ value: {
742
+ ...result,
743
+ truncated: true,
744
+ entries: result.entries.slice(0, MAX_MODEL_TREE_ENTRIES),
745
+ entriesOmitted: result.entries.length - MAX_MODEL_TREE_ENTRIES
746
+ }
747
+ };
633
748
  if ("content" in result && result.content.length > MAX_CONTENT_LENGTH) return {
634
749
  type: "json",
635
750
  value: {
@@ -642,13 +757,31 @@ function getFileContentToModelOutput({ output }) {
642
757
  value: result
643
758
  };
644
759
  }
760
+ function getRepositoryTreeToModelOutput({ output }) {
761
+ const result = output;
762
+ if (result.entries.length <= MAX_MODEL_TREE_ENTRIES) return {
763
+ type: "json",
764
+ value: result
765
+ };
766
+ return {
767
+ type: "json",
768
+ value: {
769
+ ...result,
770
+ truncated: true,
771
+ entries: result.entries.slice(0, MAX_MODEL_TREE_ENTRIES),
772
+ entriesOmitted: result.entries.length - MAX_MODEL_TREE_ENTRIES
773
+ }
774
+ };
775
+ }
645
776
  function getPullRequestContextToModelOutput({ output }) {
646
777
  const result = output;
778
+ const { files, filesOmitted } = capDiffFiles(result.files);
647
779
  return {
648
780
  type: "json",
649
781
  value: {
650
782
  ...result,
651
- files: result.files ? truncatePatchFields(result.files) : result.files
783
+ files,
784
+ ...filesOmitted > 0 ? { filesOmitted } : {}
652
785
  }
653
786
  };
654
787
  }
@@ -691,24 +824,6 @@ function applyDetailBody(body, detail, maxLength = 500) {
691
824
  return `${body.slice(0, maxLength)}\n\n[truncated: ${body.length - maxLength} more characters]`;
692
825
  }
693
826
  //#endregion
694
- //#region src/core/pagination.ts
695
- const maxPagesSchema = z.number().int().positive().max(20).optional().describe("Automatically fetch and combine up to this many pages on top of perPage. Omit to fetch a single page.");
696
- /**
697
- * Fetches a single page (`startPage`, default 1) by default. When `maxPages`
698
- * is set, fetches pages sequentially starting at `startPage` and stops early
699
- * once a page returns fewer than `perPage` items (the last page).
700
- */
701
- async function fetchAllPages(fetchPage, perPage, maxPages, startPage = 1) {
702
- if (!maxPages || maxPages <= 1) return fetchPage(startPage);
703
- const results = [];
704
- for (let i = 0; i < maxPages; i++) {
705
- const items = await fetchPage(startPage + i);
706
- results.push(...items);
707
- if (items.length < perPage) break;
708
- }
709
- return results;
710
- }
711
- //#endregion
712
827
  //#region src/core/pull-requests.ts
713
828
  const listPullRequestsInputSchema = z.object({
714
829
  owner: z.string().describe("Repository owner"),
@@ -719,21 +834,23 @@ const listPullRequestsInputSchema = z.object({
719
834
  "all"
720
835
  ]).optional().default("open").describe("Filter by state"),
721
836
  perPage: z.number().optional().default(30).describe("Number of results to return per page (max 100)"),
837
+ page: pageSchema,
722
838
  maxPages: maxPagesSchema
723
839
  });
724
- const listPullRequestsDescription = "List pull requests for a GitHub repository";
725
- async function listPullRequestsCore({ token, owner, repo, state, perPage, maxPages }) {
840
+ const listPullRequestsDescription = "List pull requests for a GitHub repository. When hasMore, pass nextPage or raise maxPages — do not repeat the same call.";
841
+ async function listPullRequestsCore({ token, owner, repo, state, perPage, page = 1, maxPages }) {
726
842
  return withOctokit(token, async (octokit) => {
727
- return (await fetchAllPages(async (page) => {
843
+ const { items, hasMore } = await fetchAllPages(async (currentPage) => {
728
844
  const { data } = await octokit.rest.pulls.list({
729
845
  owner,
730
846
  repo,
731
847
  state,
732
848
  per_page: perPage,
733
- page
849
+ page: currentPage
734
850
  });
735
851
  return data;
736
- }, perPage, maxPages)).map((pr) => ({
852
+ }, perPage, maxPages, page);
853
+ return pagedList(items.map((pr) => ({
737
854
  number: pr.number,
738
855
  title: pr.title,
739
856
  state: pr.state,
@@ -744,7 +861,7 @@ async function listPullRequestsCore({ token, owner, repo, state, perPage, maxPag
744
861
  draft: pr.draft,
745
862
  createdAt: pr.created_at,
746
863
  updatedAt: pr.updated_at
747
- }));
864
+ })), perPage, page, hasMore);
748
865
  });
749
866
  }
750
867
  const getPullRequestInputSchema = z.object({
@@ -977,9 +1094,9 @@ const listPullRequestFilesInputSchema = z.object({
977
1094
  includePatch: z.boolean().optional().default(false).describe("Include diff patches (token-heavy). Prefer false for an overview, then set true with filenames to fetch specific diffs"),
978
1095
  filenames: z.array(z.string()).optional().describe("If set, only return these file paths (useful with includePatch: true for targeted diffs)"),
979
1096
  perPage: z.number().optional().default(30).describe("Number of results to return (max 100)"),
980
- page: z.number().optional().default(1).describe("Page number for pagination")
1097
+ page: pageSchema
981
1098
  });
982
- const listPullRequestFilesDescription = "List files changed in a pull request with status and stats. Patches are omitted by default — set includePatch true (optionally with filenames) to fetch diffs";
1099
+ const listPullRequestFilesDescription = "List files changed in a pull request with status and stats. Patches are omitted by default — set includePatch true (optionally with filenames) to fetch diffs. When hasMore, pass nextPage — do not repeat the same call.";
983
1100
  async function listPullRequestFilesCore({ token, owner, repo, pullNumber, includePatch, filenames, perPage, page }) {
984
1101
  return withOctokit(token, async (octokit) => {
985
1102
  const { data } = await octokit.rest.pulls.listFiles({
@@ -990,14 +1107,14 @@ async function listPullRequestFilesCore({ token, owner, repo, pullNumber, includ
990
1107
  page
991
1108
  });
992
1109
  const filenameSet = filenames?.length ? new Set(filenames) : null;
993
- return data.filter((file) => !filenameSet || filenameSet.has(file.filename)).map((file) => ({
1110
+ return pagedList(data.filter((file) => !filenameSet || filenameSet.has(file.filename)).map((file) => ({
994
1111
  filename: file.filename,
995
1112
  status: file.status,
996
1113
  additions: file.additions,
997
1114
  deletions: file.deletions,
998
1115
  changes: file.changes,
999
1116
  ...includePatch && file.patch != null ? { patch: file.patch } : {}
1000
- }));
1117
+ })), perPage, page, data.length >= perPage);
1001
1118
  });
1002
1119
  }
1003
1120
  const listPullRequestReviewsInputSchema = z.object({
@@ -1005,9 +1122,9 @@ const listPullRequestReviewsInputSchema = z.object({
1005
1122
  repo: z.string().describe("Repository name"),
1006
1123
  pullNumber: z.number().describe("Pull request number"),
1007
1124
  perPage: z.number().optional().default(30).describe("Number of results to return (max 100)"),
1008
- page: z.number().optional().default(1).describe("Page number for pagination")
1125
+ page: pageSchema
1009
1126
  });
1010
- const listPullRequestReviewsDescription = "List reviews on a pull request (approvals, change requests, and comments)";
1127
+ const listPullRequestReviewsDescription = "List reviews on a pull request (approvals, change requests, and comments). When hasMore, pass nextPage — do not repeat the same call.";
1011
1128
  async function listPullRequestReviewsCore({ token, owner, repo, pullNumber, perPage, page }) {
1012
1129
  return withOctokit(token, async (octokit) => {
1013
1130
  const { data } = await octokit.rest.pulls.listReviews({
@@ -1017,14 +1134,14 @@ async function listPullRequestReviewsCore({ token, owner, repo, pullNumber, perP
1017
1134
  per_page: perPage,
1018
1135
  page
1019
1136
  });
1020
- return data.map((review) => ({
1137
+ return pagedList(data.map((review) => ({
1021
1138
  id: review.id,
1022
1139
  state: review.state,
1023
1140
  body: review.body,
1024
1141
  author: review.user?.login,
1025
1142
  url: review.html_url,
1026
1143
  submittedAt: review.submitted_at
1027
- }));
1144
+ })), perPage, page, data.length >= perPage);
1028
1145
  });
1029
1146
  }
1030
1147
  const createPullRequestReviewInputSchema = z.object({
@@ -1066,6 +1183,139 @@ async function createPullRequestReviewCore({ token, owner, repo, pullNumber, bod
1066
1183
  };
1067
1184
  });
1068
1185
  }
1186
+ const listPullRequestReviewThreadsInputSchema = z.object({
1187
+ owner: z.string().describe("Repository owner"),
1188
+ repo: z.string().describe("Repository name"),
1189
+ pullNumber: z.number().describe("Pull request number"),
1190
+ status: z.enum(["unresolved", "all"]).optional().default("unresolved").describe("unresolved returns only threads awaiting action (default, saves tokens); all includes resolved threads"),
1191
+ detail: detailSchema,
1192
+ perPage: z.number().int().positive().max(50).optional().default(30).describe("Number of threads to fetch per call (max 50)"),
1193
+ after: z.string().optional().describe("Cursor from a previous call (endCursor) to fetch the next page of threads")
1194
+ });
1195
+ const listPullRequestReviewThreadsDescription = "List review threads on a pull request with their comments, resolution state, and the IDs needed to reply (commentId) or resolve (threadId). Unresolved threads only by default (GitHub GraphQL API)";
1196
+ const REVIEW_THREADS_QUERY = `
1197
+ query ReviewThreads($owner: String!, $name: String!, $number: Int!, $first: Int!, $after: String) {
1198
+ repository(owner: $owner, name: $name) {
1199
+ pullRequest(number: $number) {
1200
+ reviewThreads(first: $first, after: $after) {
1201
+ totalCount
1202
+ pageInfo {
1203
+ hasNextPage
1204
+ endCursor
1205
+ }
1206
+ nodes {
1207
+ id
1208
+ isResolved
1209
+ isOutdated
1210
+ path
1211
+ line
1212
+ startLine
1213
+ resolvedBy {
1214
+ login
1215
+ }
1216
+ comments(first: 30) {
1217
+ totalCount
1218
+ nodes {
1219
+ databaseId
1220
+ body
1221
+ createdAt
1222
+ author {
1223
+ login
1224
+ }
1225
+ }
1226
+ }
1227
+ }
1228
+ }
1229
+ }
1230
+ }
1231
+ }
1232
+ `;
1233
+ async function listPullRequestReviewThreadsCore({ token, owner, repo, pullNumber, status, detail, perPage, after }) {
1234
+ return withOctokit(token, async (octokit) => {
1235
+ const data = await octokit.graphql(REVIEW_THREADS_QUERY, {
1236
+ owner,
1237
+ name: repo,
1238
+ number: pullNumber,
1239
+ first: perPage,
1240
+ after
1241
+ });
1242
+ if (!data.repository) return { error: `Repository not found: ${owner}/${repo}` };
1243
+ const reviewThreads = data.repository.pullRequest?.reviewThreads;
1244
+ if (!reviewThreads) return { error: `Pull request not found: ${owner}/${repo}#${pullNumber}` };
1245
+ const threads = reviewThreads.nodes.filter((thread) => status === "all" || !thread.isResolved).map((thread) => ({
1246
+ threadId: thread.id,
1247
+ isResolved: thread.isResolved,
1248
+ isOutdated: thread.isOutdated,
1249
+ path: thread.path,
1250
+ line: thread.line,
1251
+ startLine: thread.startLine,
1252
+ resolvedBy: thread.resolvedBy?.login ?? null,
1253
+ commentCount: thread.comments.totalCount,
1254
+ comments: thread.comments.nodes.map((comment) => ({
1255
+ commentId: comment.databaseId,
1256
+ author: comment.author?.login ?? null,
1257
+ body: applyDetailBody(comment.body, detail),
1258
+ createdAt: comment.createdAt
1259
+ }))
1260
+ }));
1261
+ return {
1262
+ totalCount: reviewThreads.totalCount,
1263
+ returnedCount: threads.length,
1264
+ hasNextPage: reviewThreads.pageInfo.hasNextPage,
1265
+ endCursor: reviewThreads.pageInfo.endCursor,
1266
+ threads
1267
+ };
1268
+ });
1269
+ }
1270
+ const replyToReviewCommentInputSchema = z.object({
1271
+ owner: z.string().describe("Repository owner"),
1272
+ repo: z.string().describe("Repository name"),
1273
+ pullNumber: z.number().describe("Pull request number"),
1274
+ commentId: z.number().describe("commentId of the thread's first comment, from listPullRequestReviewThreads"),
1275
+ body: z.string().describe("Reply text (supports Markdown)")
1276
+ });
1277
+ const replyToReviewCommentDescription = "Reply to a pull request review comment, adding a message to its review thread";
1278
+ /** Not idempotent — each call posts a new reply. */
1279
+ async function replyToReviewCommentCore({ token, owner, repo, pullNumber, commentId, body }) {
1280
+ return withOctokit(token, async (octokit) => {
1281
+ const { data } = await octokit.rest.pulls.createReplyForReviewComment({
1282
+ owner,
1283
+ repo,
1284
+ pull_number: pullNumber,
1285
+ comment_id: commentId,
1286
+ body
1287
+ });
1288
+ return {
1289
+ id: data.id,
1290
+ url: data.html_url,
1291
+ author: data.user?.login,
1292
+ createdAt: data.created_at
1293
+ };
1294
+ });
1295
+ }
1296
+ const resolveReviewThreadInputSchema = z.object({ threadId: z.string().describe("Review thread ID (threadId from listPullRequestReviewThreads)") });
1297
+ const resolveReviewThreadDescription = "Mark a pull request review thread as resolved";
1298
+ const RESOLVE_THREAD_MUTATION = `
1299
+ mutation ResolveReviewThread($threadId: ID!) {
1300
+ resolveReviewThread(input: { threadId: $threadId }) {
1301
+ thread {
1302
+ id
1303
+ isResolved
1304
+ }
1305
+ }
1306
+ }
1307
+ `;
1308
+ /** Idempotent — resolving an already-resolved thread is a no-op on GitHub. */
1309
+ async function resolveReviewThreadCore({ token, threadId }) {
1310
+ return withOctokit(token, async (octokit) => {
1311
+ const thread = (await octokit.graphql(RESOLVE_THREAD_MUTATION, { threadId })).resolveReviewThread?.thread;
1312
+ if (!thread) return { error: `Review thread not found: ${threadId}` };
1313
+ return {
1314
+ threadId: thread.id,
1315
+ isResolved: thread.isResolved
1316
+ };
1317
+ });
1318
+ }
1069
1319
  const requestReviewersInputSchema = z.object({
1070
1320
  owner: z.string().describe("Repository owner"),
1071
1321
  repo: z.string().describe("Repository name"),
@@ -1104,22 +1354,24 @@ const listIssuesInputSchema = z.object({
1104
1354
  ]).optional().default("open").describe("Filter by state"),
1105
1355
  labels: z.string().optional().describe("Comma-separated list of label names to filter by"),
1106
1356
  perPage: z.number().optional().default(30).describe("Number of results to return per page (max 100)"),
1357
+ page: pageSchema,
1107
1358
  maxPages: maxPagesSchema
1108
1359
  });
1109
- const listIssuesDescription = "List issues for a GitHub repository (excludes pull requests)";
1110
- async function listIssuesCore({ token, owner, repo, state, labels, perPage, maxPages }) {
1360
+ const listIssuesDescription = "List issues for a GitHub repository (excludes pull requests). When hasMore, pass nextPage or raise maxPages — do not repeat the same call.";
1361
+ async function listIssuesCore({ token, owner, repo, state, labels, perPage, page = 1, maxPages }) {
1111
1362
  return withOctokit(token, async (octokit) => {
1112
- return (await fetchAllPages(async (page) => {
1363
+ const { items, hasMore } = await fetchAllPages(async (currentPage) => {
1113
1364
  const { data } = await octokit.rest.issues.listForRepo({
1114
1365
  owner,
1115
1366
  repo,
1116
1367
  state,
1117
1368
  labels,
1118
1369
  per_page: perPage,
1119
- page
1370
+ page: currentPage
1120
1371
  });
1121
1372
  return data;
1122
- }, perPage, maxPages)).filter((issue) => !issue.pull_request).map((issue) => ({
1373
+ }, perPage, maxPages, page);
1374
+ return pagedList(items.filter((issue) => !issue.pull_request).map((issue) => ({
1123
1375
  number: issue.number,
1124
1376
  title: issue.title,
1125
1377
  state: issue.state,
@@ -1128,7 +1380,7 @@ async function listIssuesCore({ token, owner, repo, state, labels, perPage, maxP
1128
1380
  labels: issue.labels.map((l) => typeof l === "string" ? l : l.name),
1129
1381
  createdAt: issue.created_at,
1130
1382
  updatedAt: issue.updated_at
1131
- }));
1383
+ })), perPage, page, hasMore);
1132
1384
  });
1133
1385
  }
1134
1386
  const getIssueInputSchema = z.object({
@@ -1166,10 +1418,10 @@ const listIssueCommentsInputSchema = z.object({
1166
1418
  repo: z.string().describe("Repository name"),
1167
1419
  issueNumber: z.number().describe("Issue number"),
1168
1420
  perPage: z.number().optional().default(30).describe("Number of comments to return (max 100)"),
1169
- page: z.number().optional().default(1).describe("Page number for pagination"),
1421
+ page: pageSchema,
1170
1422
  detail: detailSchema
1171
1423
  });
1172
- const listIssueCommentsDescription = "List comments on a GitHub issue. Bodies are truncated by default (detail: summary)";
1424
+ const listIssueCommentsDescription = "List comments on a GitHub issue. Bodies are truncated by default (detail: summary). When hasMore, pass nextPage — do not repeat the same call.";
1173
1425
  async function listIssueCommentsCore({ token, owner, repo, issueNumber, perPage, page, detail = "summary" }) {
1174
1426
  return withOctokit(token, async (octokit) => {
1175
1427
  const { data } = await octokit.rest.issues.listComments({
@@ -1179,14 +1431,14 @@ async function listIssueCommentsCore({ token, owner, repo, issueNumber, perPage,
1179
1431
  per_page: perPage,
1180
1432
  page
1181
1433
  });
1182
- return data.map((comment) => ({
1434
+ return pagedList(data.map((comment) => ({
1183
1435
  id: comment.id,
1184
1436
  url: comment.html_url,
1185
1437
  body: applyDetailBody(comment.body, detail),
1186
1438
  author: comment.user?.login,
1187
1439
  createdAt: comment.created_at,
1188
1440
  updatedAt: comment.updated_at
1189
- }));
1441
+ })), perPage, page, data.length >= perPage);
1190
1442
  });
1191
1443
  }
1192
1444
  const createIssueInputSchema = z.object({
@@ -1374,9 +1626,9 @@ const listLabelsInputSchema = z.object({
1374
1626
  owner: z.string().describe("Repository owner"),
1375
1627
  repo: z.string().describe("Repository name"),
1376
1628
  perPage: z.number().optional().default(30).describe("Number of results to return (max 100)"),
1377
- page: z.number().optional().default(1).describe("Page number for pagination")
1629
+ page: pageSchema
1378
1630
  });
1379
- const listLabelsDescription = "List labels available in a GitHub repository";
1631
+ const listLabelsDescription = "List labels available in a GitHub repository. When hasMore, pass nextPage — do not repeat the same call.";
1380
1632
  async function listLabelsCore({ token, owner, repo, perPage, page }) {
1381
1633
  return withOctokit(token, async (octokit) => {
1382
1634
  const { data } = await octokit.rest.issues.listLabelsForRepo({
@@ -1385,11 +1637,11 @@ async function listLabelsCore({ token, owner, repo, perPage, page }) {
1385
1637
  per_page: perPage,
1386
1638
  page
1387
1639
  });
1388
- return data.map((label) => ({
1640
+ return pagedList(data.map((label) => ({
1389
1641
  name: label.name,
1390
1642
  color: label.color,
1391
1643
  description: label.description
1392
- }));
1644
+ })), perPage, page, data.length >= perPage);
1393
1645
  });
1394
1646
  }
1395
1647
  const addLabelsInputSchema = z.object({
@@ -1566,7 +1818,7 @@ const reactionContentSchema = z.enum([
1566
1818
  "rocket",
1567
1819
  "eyes"
1568
1820
  ]);
1569
- function shapeReactions(reactions) {
1821
+ function shapeReactions(reactions, perPage, page) {
1570
1822
  const counts = {};
1571
1823
  for (const reaction of reactions) counts[reaction.content] = (counts[reaction.content] ?? 0) + 1;
1572
1824
  return {
@@ -1575,7 +1827,8 @@ function shapeReactions(reactions) {
1575
1827
  reactions: reactions.map((reaction) => ({
1576
1828
  content: reaction.content,
1577
1829
  user: reaction.user?.login
1578
- }))
1830
+ })),
1831
+ ...pagingFields(page, perPage, reactions.length, reactions.length >= perPage)
1579
1832
  };
1580
1833
  }
1581
1834
  const listIssueReactionsInputSchema = z.object({
@@ -1584,9 +1837,9 @@ const listIssueReactionsInputSchema = z.object({
1584
1837
  issueNumber: z.number().describe("Issue or pull request number — pull request conversations share the issue numbering"),
1585
1838
  content: reactionContentSchema.optional().describe("Only return reactions of this type"),
1586
1839
  perPage: z.number().optional().default(30).describe("Number of reactions to return (max 100)"),
1587
- page: z.number().optional().default(1).describe("Page number for pagination")
1840
+ page: pageSchema
1588
1841
  });
1589
- const listIssueReactionsDescription = "List reactions on an issue or pull request conversation, with per-emoji counts for the returned page";
1842
+ const listIssueReactionsDescription = "List reactions on an issue or pull request conversation, with per-emoji counts for the returned page. When hasMore, pass nextPage — do not repeat the same call.";
1590
1843
  async function listIssueReactionsCore({ token, owner, repo, issueNumber, content, perPage, page }) {
1591
1844
  return withOctokit(token, async (octokit) => {
1592
1845
  const { data } = await octokit.rest.reactions.listForIssue({
@@ -1597,7 +1850,7 @@ async function listIssueReactionsCore({ token, owner, repo, issueNumber, content
1597
1850
  per_page: perPage,
1598
1851
  page
1599
1852
  });
1600
- return shapeReactions(data);
1853
+ return shapeReactions(data, perPage, page);
1601
1854
  });
1602
1855
  }
1603
1856
  const addIssueReactionInputSchema = z.object({
@@ -1630,9 +1883,9 @@ const listCommentReactionsInputSchema = z.object({
1630
1883
  commentId: z.number().describe("Issue or pull request comment ID (from getIssueContext or addIssueComment)"),
1631
1884
  content: reactionContentSchema.optional().describe("Only return reactions of this type"),
1632
1885
  perPage: z.number().optional().default(30).describe("Number of reactions to return (max 100)"),
1633
- page: z.number().optional().default(1).describe("Page number for pagination")
1886
+ page: pageSchema
1634
1887
  });
1635
- const listCommentReactionsDescription = "List reactions on an issue or pull request comment, with per-emoji counts for the returned page";
1888
+ const listCommentReactionsDescription = "List reactions on an issue or pull request comment, with per-emoji counts for the returned page. When hasMore, pass nextPage — do not repeat the same call.";
1636
1889
  async function listCommentReactionsCore({ token, owner, repo, commentId, content, perPage, page }) {
1637
1890
  return withOctokit(token, async (octokit) => {
1638
1891
  const { data } = await octokit.rest.reactions.listForIssueComment({
@@ -1643,7 +1896,7 @@ async function listCommentReactionsCore({ token, owner, repo, commentId, content
1643
1896
  per_page: perPage,
1644
1897
  page
1645
1898
  });
1646
- return shapeReactions(data);
1899
+ return shapeReactions(data, perPage, page);
1647
1900
  });
1648
1901
  }
1649
1902
  const addCommentReactionInputSchema = z.object({
@@ -1877,9 +2130,9 @@ const listNotificationsInputSchema = z.object({
1877
2130
  all: z.boolean().optional().default(false).describe("Include notifications already marked as read"),
1878
2131
  participating: z.boolean().optional().default(false).describe("Only notifications where the authenticated user is directly participating or mentioned"),
1879
2132
  perPage: z.number().optional().default(20).describe("Number of notifications to return (max 50)"),
1880
- page: z.number().optional().default(1).describe("Page number for pagination")
2133
+ page: pageSchema
1881
2134
  });
1882
- const listNotificationsDescription = "List notification threads for the authenticated user. Unread only by default — set all true to include read threads. Requires a token with notifications access";
2135
+ const listNotificationsDescription = "List notification threads for the authenticated user. Unread only by default — set all true to include read threads. Requires a token with notifications access. When hasMore, pass nextPage — do not repeat the same call.";
1883
2136
  async function listNotificationsCore({ token, all, participating, perPage, page }) {
1884
2137
  return withOctokit(token, async (octokit) => {
1885
2138
  const { data } = await octokit.rest.activity.listNotificationsForAuthenticatedUser({
@@ -1888,7 +2141,7 @@ async function listNotificationsCore({ token, all, participating, perPage, page
1888
2141
  per_page: perPage,
1889
2142
  page
1890
2143
  });
1891
- return data.map((thread) => ({
2144
+ return pagedList(data.map((thread) => ({
1892
2145
  threadId: thread.id,
1893
2146
  repository: thread.repository.full_name,
1894
2147
  subject: {
@@ -1899,7 +2152,7 @@ async function listNotificationsCore({ token, all, participating, perPage, page
1899
2152
  reason: thread.reason,
1900
2153
  unread: thread.unread,
1901
2154
  updatedAt: thread.updated_at
1902
- }));
2155
+ })), perPage, page, data.length >= perPage);
1903
2156
  });
1904
2157
  }
1905
2158
  const markNotificationReadInputSchema = z.object({ threadId: z.string().describe("Notification thread ID (from listNotifications)") });
@@ -2063,12 +2316,13 @@ const listCommitsInputSchema = z.object({
2063
2316
  since: z.string().optional().describe("Only commits after this date (ISO 8601 format)"),
2064
2317
  until: z.string().optional().describe("Only commits before this date (ISO 8601 format)"),
2065
2318
  perPage: z.number().optional().default(30).describe("Number of results to return per page (max 100)"),
2319
+ page: pageSchema,
2066
2320
  maxPages: maxPagesSchema
2067
2321
  });
2068
- const listCommitsDescription = "List commits for a GitHub repository. Filter by file path to see commits that touched a file. For line-by-line attribution at a given ref, use getBlame instead.";
2069
- async function listCommitsCore({ token, owner, repo, path, sha, author, since, until, perPage, maxPages }) {
2322
+ const listCommitsDescription = "List commits for a GitHub repository. Filter with path, author, since, or until instead of paging the full history. When hasMore, pass nextPage or raise maxPages — do not repeat the same call. For line-by-line attribution, use getBlame.";
2323
+ async function listCommitsCore({ token, owner, repo, path, sha, author, since, until, perPage, page = 1, maxPages }) {
2070
2324
  return withOctokit(token, async (octokit) => {
2071
- return (await fetchAllPages(async (page) => {
2325
+ const { items, hasMore } = await fetchAllPages(async (currentPage) => {
2072
2326
  const { data } = await octokit.rest.repos.listCommits({
2073
2327
  owner,
2074
2328
  repo,
@@ -2078,17 +2332,18 @@ async function listCommitsCore({ token, owner, repo, path, sha, author, since, u
2078
2332
  since,
2079
2333
  until,
2080
2334
  per_page: perPage,
2081
- page
2335
+ page: currentPage
2082
2336
  });
2083
2337
  return data;
2084
- }, perPage, maxPages)).map((commit) => ({
2338
+ }, perPage, maxPages, page);
2339
+ return pagedList(items.map((commit) => ({
2085
2340
  sha: commit.sha,
2086
2341
  message: commit.commit.message,
2087
2342
  author: commit.commit.author?.name,
2088
2343
  authorLogin: commit.author?.login,
2089
2344
  date: commit.commit.author?.date,
2090
2345
  url: commit.html_url
2091
- }));
2346
+ })), perPage, page, hasMore);
2092
2347
  });
2093
2348
  }
2094
2349
  const getCommitInputSchema = z.object({
@@ -2228,9 +2483,9 @@ async function compareCommitsCore({ token, owner, repo, base, head, includePatch
2228
2483
  const listGistsInputSchema = z.object({
2229
2484
  username: z.string().optional().describe("GitHub username — omit to list your own gists"),
2230
2485
  perPage: z.number().optional().default(30).describe("Number of results to return (max 100)"),
2231
- page: z.number().optional().default(1).describe("Page number for pagination")
2486
+ page: pageSchema
2232
2487
  });
2233
- const listGistsDescription = "List gists for the authenticated user or a specific user";
2488
+ const listGistsDescription = "List gists for the authenticated user or a specific user. When hasMore, pass nextPage — do not repeat the same call.";
2234
2489
  async function listGistsCore({ token, username, perPage, page }) {
2235
2490
  return withOctokit(token, async (octokit) => {
2236
2491
  const { data } = username ? await octokit.rest.gists.listForUser({
@@ -2241,7 +2496,7 @@ async function listGistsCore({ token, username, perPage, page }) {
2241
2496
  per_page: perPage,
2242
2497
  page
2243
2498
  });
2244
- return data.map((gist) => ({
2499
+ return pagedList(data.map((gist) => ({
2245
2500
  id: gist.id,
2246
2501
  description: gist.description,
2247
2502
  public: gist.public,
@@ -2251,7 +2506,7 @@ async function listGistsCore({ token, username, perPage, page }) {
2251
2506
  comments: gist.comments,
2252
2507
  createdAt: gist.created_at,
2253
2508
  updatedAt: gist.updated_at
2254
- }));
2509
+ })), perPage, page, data.length >= perPage);
2255
2510
  });
2256
2511
  }
2257
2512
  const getGistInputSchema = z.object({ gistId: z.string().describe("Gist ID") });
@@ -2280,9 +2535,9 @@ async function getGistCore({ token, gistId }) {
2280
2535
  const listGistCommentsInputSchema = z.object({
2281
2536
  gistId: z.string().describe("Gist ID"),
2282
2537
  perPage: z.number().optional().default(30).describe("Number of results to return (max 100)"),
2283
- page: z.number().optional().default(1).describe("Page number for pagination")
2538
+ page: pageSchema
2284
2539
  });
2285
- const listGistCommentsDescription = "List comments on a gist";
2540
+ const listGistCommentsDescription = "List comments on a gist. When hasMore, pass nextPage — do not repeat the same call.";
2286
2541
  async function listGistCommentsCore({ token, gistId, perPage, page }) {
2287
2542
  return withOctokit(token, async (octokit) => {
2288
2543
  const { data } = await octokit.rest.gists.listComments({
@@ -2290,14 +2545,14 @@ async function listGistCommentsCore({ token, gistId, perPage, page }) {
2290
2545
  per_page: perPage,
2291
2546
  page
2292
2547
  });
2293
- return data.map((comment) => ({
2548
+ return pagedList(data.map((comment) => ({
2294
2549
  id: comment.id,
2295
2550
  body: comment.body,
2296
2551
  author: comment.user?.login,
2297
2552
  url: comment.url,
2298
2553
  createdAt: comment.created_at,
2299
2554
  updatedAt: comment.updated_at
2300
- }));
2555
+ })), perPage, page, data.length >= perPage);
2301
2556
  });
2302
2557
  }
2303
2558
  const createGistInputSchema = z.object({
@@ -2389,9 +2644,9 @@ const listWorkflowsInputSchema = z.object({
2389
2644
  owner: z.string().describe("Repository owner"),
2390
2645
  repo: z.string().describe("Repository name"),
2391
2646
  perPage: z.number().optional().default(30).describe("Number of results to return (max 100)"),
2392
- page: z.number().optional().default(1).describe("Page number for pagination")
2647
+ page: pageSchema
2393
2648
  });
2394
- const listWorkflowsDescription = "List GitHub Actions workflows in a repository";
2649
+ const listWorkflowsDescription = "List GitHub Actions workflows in a repository. When hasMore, pass nextPage — do not repeat the same call.";
2395
2650
  async function listWorkflowsCore({ token, owner, repo, perPage, page }) {
2396
2651
  return withOctokit(token, async (octokit) => {
2397
2652
  const { data } = await octokit.rest.actions.listRepoWorkflows({
@@ -2410,7 +2665,8 @@ async function listWorkflowsCore({ token, owner, repo, perPage, page }) {
2410
2665
  url: wf.html_url,
2411
2666
  createdAt: wf.created_at,
2412
2667
  updatedAt: wf.updated_at
2413
- }))
2668
+ })),
2669
+ ...pagingFields(page, perPage, data.workflows.length, hasMoreByTotal(page, perPage, data.workflows.length, data.total_count))
2414
2670
  };
2415
2671
  });
2416
2672
  }
@@ -2437,14 +2693,14 @@ const listWorkflowRunsInputSchema = z.object({
2437
2693
  "pending"
2438
2694
  ]).optional().describe("Status to filter by"),
2439
2695
  perPage: z.number().optional().default(30).describe("Number of results to return per page (max 100)"),
2440
- page: z.number().optional().default(1).describe("Page number for pagination"),
2696
+ page: pageSchema,
2441
2697
  maxPages: maxPagesSchema
2442
2698
  });
2443
- const listWorkflowRunsDescription = "List workflow runs for a repository, optionally filtered by workflow, branch, status, or event";
2699
+ const listWorkflowRunsDescription = "List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. When hasMore, pass nextPage or raise maxPages — do not repeat the same call.";
2444
2700
  async function listWorkflowRunsCore({ token, owner, repo, workflowId, branch, event, status, perPage, page, maxPages }) {
2445
2701
  return withOctokit(token, async (octokit) => {
2446
2702
  let totalCount = 0;
2447
- const runs = await fetchAllPages(async (currentPage) => {
2703
+ const { items } = await fetchAllPages(async (currentPage) => {
2448
2704
  const { data } = workflowId ? await octokit.rest.actions.listWorkflowRuns({
2449
2705
  owner,
2450
2706
  repo,
@@ -2468,7 +2724,7 @@ async function listWorkflowRunsCore({ token, owner, repo, workflowId, branch, ev
2468
2724
  }, perPage, maxPages, page);
2469
2725
  return {
2470
2726
  totalCount,
2471
- runs: runs.map((run) => ({
2727
+ runs: items.map((run) => ({
2472
2728
  id: run.id,
2473
2729
  name: run.name,
2474
2730
  status: run.status,
@@ -2481,7 +2737,8 @@ async function listWorkflowRunsCore({ token, owner, repo, workflowId, branch, ev
2481
2737
  updatedAt: run.updated_at,
2482
2738
  runNumber: run.run_number,
2483
2739
  runAttempt: run.run_attempt
2484
- }))
2740
+ })),
2741
+ ...pagingFields(page, perPage, items.length, hasMoreByTotal(page, perPage, items.length, totalCount))
2485
2742
  };
2486
2743
  });
2487
2744
  }
@@ -2522,9 +2779,9 @@ const listWorkflowJobsInputSchema = z.object({
2522
2779
  runId: z.number().describe("Workflow run ID"),
2523
2780
  filter: z.enum(["latest", "all"]).optional().default("latest").describe("Filter by the latest attempt or all attempts"),
2524
2781
  perPage: z.number().optional().default(30).describe("Number of results to return (max 100)"),
2525
- page: z.number().optional().default(1).describe("Page number for pagination")
2782
+ page: pageSchema
2526
2783
  });
2527
- const listWorkflowJobsDescription = "List jobs for a workflow run, including step-level status and timing";
2784
+ const listWorkflowJobsDescription = "List jobs for a workflow run, including step-level status and timing. When hasMore, pass nextPage — do not repeat the same call.";
2528
2785
  async function listWorkflowJobsCore({ token, owner, repo, runId, filter, perPage, page }) {
2529
2786
  return withOctokit(token, async (octokit) => {
2530
2787
  const { data } = await octokit.rest.actions.listJobsForWorkflowRun({
@@ -2554,7 +2811,43 @@ async function listWorkflowJobsCore({ token, owner, repo, runId, filter, perPage
2554
2811
  startedAt: step.started_at,
2555
2812
  completedAt: step.completed_at
2556
2813
  }))
2557
- }))
2814
+ })),
2815
+ ...pagingFields(page, perPage, data.jobs.length, hasMoreByTotal(page, perPage, data.jobs.length, data.total_count))
2816
+ };
2817
+ });
2818
+ }
2819
+ const getWorkflowJobLogsInputSchema = z.object({
2820
+ owner: z.string().describe("Repository owner"),
2821
+ repo: z.string().describe("Repository name"),
2822
+ jobId: z.number().describe("Workflow job ID (from listWorkflowJobs or getCiFailureContext)"),
2823
+ maxLines: z.number().int().positive().max(2e3).optional().default(200).describe("Return only the last N log lines (default 200, max 2000). Failures surface at the end of a log, so the tail is usually enough")
2824
+ });
2825
+ const getWorkflowJobLogsDescription = "Get the log output of a workflow job to diagnose failures. Returns the last maxLines lines (default 200) with per-line timestamps stripped to save tokens";
2826
+ const LOG_TIMESTAMP_PREFIX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z /;
2827
+ /**
2828
+ * Tail-truncate a raw job log and strip the ISO timestamp GitHub prefixes on
2829
+ * every line (~29 tokens-worth of noise per line the model never needs).
2830
+ */
2831
+ function shapeJobLog(raw, maxLines) {
2832
+ const lines = raw.replace(/\r\n/g, "\n").replace(/\n+$/, "").split("\n");
2833
+ const tail = lines.slice(-maxLines).map((line) => line.replace(LOG_TIMESTAMP_PREFIX, ""));
2834
+ return {
2835
+ totalLines: lines.length,
2836
+ returnedLines: tail.length,
2837
+ omittedLines: lines.length - tail.length,
2838
+ log: tail.join("\n")
2839
+ };
2840
+ }
2841
+ async function getWorkflowJobLogsCore({ token, owner, repo, jobId, maxLines }) {
2842
+ return withOctokit(token, async (octokit) => {
2843
+ const { data } = await octokit.rest.actions.downloadJobLogsForWorkflowRun({
2844
+ owner,
2845
+ repo,
2846
+ job_id: jobId
2847
+ });
2848
+ return {
2849
+ jobId,
2850
+ ...shapeJobLog(String(data), maxLines)
2558
2851
  };
2559
2852
  });
2560
2853
  }
@@ -2637,26 +2930,27 @@ const listCheckRunsInputSchema = z.object({
2637
2930
  repo: z.string().describe("Repository name"),
2638
2931
  ref: z.string().describe("Git ref: branch, tag, or commit SHA"),
2639
2932
  perPage: z.number().optional().default(30).describe("Number of results to return per page (max 100)"),
2933
+ page: pageSchema,
2640
2934
  maxPages: maxPagesSchema
2641
2935
  });
2642
- const listCheckRunsDescription = "List check runs (Checks API — GitHub Actions and other CI providers) for a commit, branch, or tag";
2643
- async function listCheckRunsCore({ token, owner, repo, ref, perPage, maxPages }) {
2936
+ const listCheckRunsDescription = "List check runs (Checks API — GitHub Actions and other CI providers) for a commit, branch, or tag. When hasMore, pass nextPage or raise maxPages — do not repeat the same call.";
2937
+ async function listCheckRunsCore({ token, owner, repo, ref, perPage, page = 1, maxPages }) {
2644
2938
  return withOctokit(token, async (octokit) => {
2645
2939
  let totalCount = 0;
2646
- const checkRuns = await fetchAllPages(async (page) => {
2940
+ const { items } = await fetchAllPages(async (currentPage) => {
2647
2941
  const { data } = await octokit.rest.checks.listForRef({
2648
2942
  owner,
2649
2943
  repo,
2650
2944
  ref,
2651
2945
  per_page: perPage,
2652
- page
2946
+ page: currentPage
2653
2947
  });
2654
2948
  totalCount = data.total_count;
2655
2949
  return data.check_runs;
2656
- }, perPage, maxPages);
2950
+ }, perPage, maxPages, page);
2657
2951
  return {
2658
2952
  totalCount,
2659
- checkRuns: checkRuns.map((run) => ({
2953
+ checkRuns: items.map((run) => ({
2660
2954
  id: run.id,
2661
2955
  name: run.name,
2662
2956
  status: run.status,
@@ -2664,7 +2958,8 @@ async function listCheckRunsCore({ token, owner, repo, ref, perPage, maxPages })
2664
2958
  url: run.html_url,
2665
2959
  startedAt: run.started_at,
2666
2960
  completedAt: run.completed_at
2667
- }))
2961
+ })),
2962
+ ...pagingFields(page, perPage, items.length, hasMoreByTotal(page, perPage, items.length, totalCount))
2668
2963
  };
2669
2964
  });
2670
2965
  }
@@ -2699,21 +2994,23 @@ const listReleasesInputSchema = z.object({
2699
2994
  owner: z.string().describe("Repository owner"),
2700
2995
  repo: z.string().describe("Repository name"),
2701
2996
  perPage: z.number().optional().default(30).describe("Number of results to return per page (max 100)"),
2997
+ page: pageSchema,
2702
2998
  maxPages: maxPagesSchema,
2703
2999
  detail: detailSchema
2704
3000
  });
2705
- const listReleasesDescription = "List releases for a GitHub repository, newest first (includes drafts and prereleases). Bodies truncated by default (detail: summary)";
2706
- async function listReleasesCore({ token, owner, repo, perPage, maxPages, detail = "summary" }) {
3001
+ const listReleasesDescription = "List releases for a GitHub repository, newest first (includes drafts and prereleases). Bodies truncated by default (detail: summary). When hasMore, pass nextPage or raise maxPages — do not repeat the same call.";
3002
+ async function listReleasesCore({ token, owner, repo, perPage, page = 1, maxPages, detail = "summary" }) {
2707
3003
  return withOctokit(token, async (octokit) => {
2708
- return (await fetchAllPages(async (page) => {
3004
+ const { items, hasMore } = await fetchAllPages(async (currentPage) => {
2709
3005
  const { data } = await octokit.rest.repos.listReleases({
2710
3006
  owner,
2711
3007
  repo,
2712
3008
  per_page: perPage,
2713
- page
3009
+ page: currentPage
2714
3010
  });
2715
3011
  return data;
2716
- }, perPage, maxPages)).map((release) => ({
3012
+ }, perPage, maxPages, page);
3013
+ return pagedList(items.map((release) => ({
2717
3014
  id: release.id,
2718
3015
  tagName: release.tag_name,
2719
3016
  name: release.name,
@@ -2724,7 +3021,7 @@ async function listReleasesCore({ token, owner, repo, perPage, maxPages, detail
2724
3021
  author: release.author?.login,
2725
3022
  createdAt: release.created_at,
2726
3023
  publishedAt: release.published_at
2727
- }));
3024
+ })), perPage, page, hasMore);
2728
3025
  });
2729
3026
  }
2730
3027
  const getLatestReleaseInputSchema = z.object({
@@ -2900,7 +3197,7 @@ const getPullRequestContextInputSchema = z.object({
2900
3197
  filesPerPage: z.number().optional().default(100).describe("Max files to return when includeFiles is true (max 100)"),
2901
3198
  detail: detailSchema
2902
3199
  });
2903
- const getPullRequestContextDescription = "Fetch pull request details plus files, reviews, and optional CI checks in one call — prefer this over separate getPullRequest / listPullRequestFiles / listPullRequestReviews calls";
3200
+ const getPullRequestContextDescription = "Fetch pull request details plus files, reviews, and optional CI checks in one call — prefer this over separate getPullRequest / listPullRequestFiles / listPullRequestReviews calls. filesHasMore / reviewsHasMore mean more pages exist on those lists.";
2904
3201
  async function getPullRequestContextCore({ token, owner, repo, pullNumber, includeFiles, includeReviews, includeChecks, includePatch, filesPerPage, detail = "summary" }) {
2905
3202
  const pullRequest = await getPullRequestCore({
2906
3203
  token,
@@ -2946,8 +3243,14 @@ async function getPullRequestContextCore({ token, owner, repo, pullNumber, inclu
2946
3243
  ]);
2947
3244
  return withComposedRateLimit({
2948
3245
  pullRequest,
2949
- ...files !== void 0 ? { files } : {},
2950
- ...reviews !== void 0 ? { reviews } : {},
3246
+ ...files !== void 0 ? {
3247
+ files: files.items,
3248
+ filesHasMore: files.hasMore
3249
+ } : {},
3250
+ ...reviews !== void 0 ? {
3251
+ reviews: reviews.items,
3252
+ reviewsHasMore: reviews.hasMore
3253
+ } : {},
2951
3254
  ...checks !== void 0 ? { checks } : {}
2952
3255
  });
2953
3256
  }
@@ -2960,7 +3263,7 @@ const getIssueContextInputSchema = z.object({
2960
3263
  maxComments: z.number().optional().default(5).describe("Max recent comments to include (keep small — fetch more only when needed)"),
2961
3264
  detail: z.enum(["summary", "full"]).optional().default("full").describe("full returns the complete body (default for this one-shot tool); summary truncates to ~500 chars")
2962
3265
  });
2963
- const getIssueContextDescription = "Fetch an issue plus available label names and recent comments in one call — prefer this over separate getIssue / listLabels / comment calls when triaging. Call once; do not re-fetch the same issue.";
3266
+ const getIssueContextDescription = "Fetch an issue plus available label names and recent comments in one call — prefer this over separate getIssue / listLabels / comment calls when triaging. Call once; do not re-fetch the same issue. commentsHasMore means more comments exist — use listIssueComments with nextPage.";
2964
3267
  async function getIssueContextCore({ token, owner, repo, issueNumber, includeLabels, includeComments, maxComments, detail = "full" }) {
2965
3268
  const [issue, labels, comments] = await Promise.all([
2966
3269
  getIssueCore({
@@ -2989,8 +3292,11 @@ async function getIssueContextCore({ token, owner, repo, issueNumber, includeLab
2989
3292
  ]);
2990
3293
  return withComposedRateLimit({
2991
3294
  issue,
2992
- ...labels !== void 0 ? { labelNames: labels.map((label) => label.name) } : {},
2993
- ...comments !== void 0 ? { comments } : {}
3295
+ ...labels !== void 0 ? { labelNames: labels.items.map((label) => label.name) } : {},
3296
+ ...comments !== void 0 ? {
3297
+ comments: comments.items,
3298
+ commentsHasMore: comments.hasMore
3299
+ } : {}
2994
3300
  });
2995
3301
  }
2996
3302
  const getReleaseContextInputSchema = z.object({
@@ -3023,7 +3329,7 @@ async function getReleaseContextCore({ token, owner, repo, releaseId, includePre
3023
3329
  perPage: 10,
3024
3330
  maxPages: 1,
3025
3331
  detail
3026
- })).find((r) => r.id !== release.id && !r.draft);
3332
+ })).items.find((r) => r.id !== release.id && !r.draft);
3027
3333
  let comparison;
3028
3334
  if (includeCompare && previous) comparison = await compareCommitsCore({
3029
3335
  token,
@@ -3210,10 +3516,10 @@ const PRESET_TOOLS = {
3210
3516
  /**
3211
3517
  * **Code review** — review pull requests and submit feedback.
3212
3518
  *
3213
- * Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`, `getPullRequestContext`,
3519
+ * Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`, `listPullRequestReviewThreads`, `getPullRequestContext`,
3214
3520
  * `getFileContent`, `listCommits`, `getCommit`, `getBlame`, `compareCommits`, `getRepository`, `listBranches`,
3215
3521
  * `searchCode`, `listCheckRuns`, `getCombinedStatus`, `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`,
3216
- * `deletePullRequestComment`, `createPullRequestReview`, `requestReviewers`.
3522
+ * `deletePullRequestComment`, `createPullRequestReview`, `replyToReviewComment`, `resolveReviewThread`, `requestReviewers`.
3217
3523
  *
3218
3524
  * Agent prompt: optimized for thorough PR review with inline feedback.
3219
3525
  */
@@ -3222,6 +3528,7 @@ const PRESET_TOOLS = {
3222
3528
  "listPullRequests",
3223
3529
  "listPullRequestFiles",
3224
3530
  "listPullRequestReviews",
3531
+ "listPullRequestReviewThreads",
3225
3532
  "getPullRequestContext",
3226
3533
  "getFileContent",
3227
3534
  "listCommits",
@@ -3238,6 +3545,8 @@ const PRESET_TOOLS = {
3238
3545
  "updatePullRequestComment",
3239
3546
  "deletePullRequestComment",
3240
3547
  "createPullRequestReview",
3548
+ "replyToReviewComment",
3549
+ "resolveReviewThread",
3241
3550
  "requestReviewers"
3242
3551
  ],
3243
3552
  /**
@@ -3285,9 +3594,10 @@ const PRESET_TOOLS = {
3285
3594
  * **CI operations** — monitor and manage GitHub Actions workflows.
3286
3595
  *
3287
3596
  * Tools: `getRepository`, `listBranches`, `listCommits`, `getCommit`,
3288
- * `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`,
3597
+ * `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`,
3289
3598
  * `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`.
3290
3599
  *
3600
+ * Diagnose a failure with `getCiFailureContext` first, then read the failing job's output with `getWorkflowJobLogs`.
3291
3601
  * Agent prompt: optimized for diagnosing CI failures and managing workflow runs.
3292
3602
  */
3293
3603
  "ci-ops": [
@@ -3299,6 +3609,7 @@ const PRESET_TOOLS = {
3299
3609
  "listWorkflowRuns",
3300
3610
  "getWorkflowRun",
3301
3611
  "listWorkflowJobs",
3612
+ "getWorkflowJobLogs",
3302
3613
  "listCheckRuns",
3303
3614
  "getCombinedStatus",
3304
3615
  "getCiFailureContext",
@@ -3323,6 +3634,7 @@ const PRESET_TOOLS = {
3323
3634
  "getPullRequest",
3324
3635
  "listPullRequestFiles",
3325
3636
  "listPullRequestReviews",
3637
+ "listPullRequestReviewThreads",
3326
3638
  "getPullRequestContext",
3327
3639
  "listIssues",
3328
3640
  "getIssue",
@@ -3345,6 +3657,7 @@ const PRESET_TOOLS = {
3345
3657
  "listWorkflowRuns",
3346
3658
  "getWorkflowRun",
3347
3659
  "listWorkflowJobs",
3660
+ "getWorkflowJobLogs",
3348
3661
  "listCheckRuns",
3349
3662
  "getCombinedStatus",
3350
3663
  "getCiFailureContext",
@@ -3359,7 +3672,8 @@ const PRESET_TOOLS = {
3359
3672
  * Tools: read-only exploration (`getFileContent`, `getRepositoryTree`, `searchCode`, `searchIssues`, `listCommits`, `getCommit`,
3360
3673
  * `getBlame`, `compareCommits`), PR and CI visibility (`listPullRequests`, `getPullRequest`, `listPullRequestFiles`,
3361
3674
  * `getPullRequestContext`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, `listWorkflows`, `listWorkflowRuns`,
3362
- * `getWorkflowRun`, `listWorkflowJobs`), plus `createIssue`, `addIssueComment`, and `addLabels` to report findings.
3675
+ * `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs` — logs can leak secrets, so auditing them matters),
3676
+ * plus `createIssue`, `addIssueComment`, and `addLabels` to report findings.
3363
3677
  * No destructive writes.
3364
3678
  *
3365
3679
  * Agent prompt: optimized for finding and reporting security risks without making changes.
@@ -3387,6 +3701,7 @@ const PRESET_TOOLS = {
3387
3701
  "listWorkflowRuns",
3388
3702
  "getWorkflowRun",
3389
3703
  "listWorkflowJobs",
3704
+ "getWorkflowJobLogs",
3390
3705
  "listIssues",
3391
3706
  "getIssue",
3392
3707
  "getIssueContext",
@@ -3461,10 +3776,12 @@ const PRESET_TOOLS = {
3461
3776
  /**
3462
3777
  * **PR author** — open pull requests without the full write surface.
3463
3778
  *
3464
- * Tools: `getRepository`, `listBranches`, `getFileContent`, `createBranch`, `createOrUpdateFile`,
3779
+ * Tools: `getRepository`, `listBranches`, `getFileContent`, `createBranch`, `deleteBranch`, `createOrUpdateFile`,
3465
3780
  * `createPullRequest`, `updatePullRequest`, `getPullRequest`, `listPullRequestFiles`,
3781
+ * `listPullRequestReviewThreads`, `replyToReviewComment`, `resolveReviewThread`,
3466
3782
  * `compareCommits`, `getCommit`.
3467
3783
  *
3784
+ * Respond to review feedback with `listPullRequestReviewThreads` → `replyToReviewComment` → `resolveReviewThread`.
3468
3785
  * Agent prompt: optimized for branching, editing files, and opening focused PRs.
3469
3786
  */
3470
3787
  "pr-author": [
@@ -3472,11 +3789,15 @@ const PRESET_TOOLS = {
3472
3789
  "listBranches",
3473
3790
  "getFileContent",
3474
3791
  "createBranch",
3792
+ "deleteBranch",
3475
3793
  "createOrUpdateFile",
3476
3794
  "createPullRequest",
3477
3795
  "updatePullRequest",
3478
3796
  "getPullRequest",
3479
3797
  "listPullRequestFiles",
3798
+ "listPullRequestReviewThreads",
3799
+ "replyToReviewComment",
3800
+ "resolveReviewThread",
3480
3801
  "compareCommits",
3481
3802
  "getCommit"
3482
3803
  ],
@@ -3493,6 +3814,7 @@ const PRESET_TOOLS = {
3493
3814
  "getFileContent",
3494
3815
  "getRepositoryTree",
3495
3816
  "createBranch",
3817
+ "deleteBranch",
3496
3818
  "forkRepository",
3497
3819
  "createRepository",
3498
3820
  "createOrUpdateFile",
@@ -3500,6 +3822,7 @@ const PRESET_TOOLS = {
3500
3822
  "getPullRequest",
3501
3823
  "listPullRequestFiles",
3502
3824
  "listPullRequestReviews",
3825
+ "listPullRequestReviewThreads",
3503
3826
  "getPullRequestContext",
3504
3827
  "createPullRequest",
3505
3828
  "mergePullRequest",
@@ -3508,6 +3831,8 @@ const PRESET_TOOLS = {
3508
3831
  "updatePullRequestComment",
3509
3832
  "deletePullRequestComment",
3510
3833
  "createPullRequestReview",
3834
+ "replyToReviewComment",
3835
+ "resolveReviewThread",
3511
3836
  "requestReviewers",
3512
3837
  "listIssues",
3513
3838
  "getIssue",
@@ -3554,6 +3879,7 @@ const PRESET_TOOLS = {
3554
3879
  "listWorkflowRuns",
3555
3880
  "getWorkflowRun",
3556
3881
  "listWorkflowJobs",
3882
+ "getWorkflowJobLogs",
3557
3883
  "triggerWorkflow",
3558
3884
  "cancelWorkflowRun",
3559
3885
  "rerunWorkflowRun",
@@ -3583,260 +3909,924 @@ function resolvePresetTools(preset) {
3583
3909
  return tools;
3584
3910
  }
3585
3911
  //#endregion
3586
- //#region src/core/tool-names.ts
3912
+ //#region src/core/catalog.ts
3913
+ /**
3914
+ * Vercel Connect scope sets, mirroring GitHub App permissions.
3915
+ * Release tools fall under `contents`, reaction tools under `issues`.
3916
+ * Gist and notification tools are intentionally unscoped: those APIs only
3917
+ * accept user access tokens, never the installation tokens Connect mints.
3918
+ */
3919
+ const CONTENTS_READ = ["contents:read", "metadata:read"];
3920
+ const CONTENTS_WRITE = [
3921
+ "contents:read",
3922
+ "contents:write",
3923
+ "metadata:read"
3924
+ ];
3925
+ const PR_READ = [
3926
+ "contents:read",
3927
+ "metadata:read",
3928
+ "pull_requests:read"
3929
+ ];
3930
+ const PR_WRITE = [
3931
+ "contents:read",
3932
+ "metadata:read",
3933
+ "pull_requests:read",
3934
+ "pull_requests:write"
3935
+ ];
3936
+ /** Read-only PR context (details, files, reviews) plus optional CI checks. */
3937
+ const PR_CONTEXT = [
3938
+ "contents:read",
3939
+ "metadata:read",
3940
+ "pull_requests:read",
3941
+ "checks:read",
3942
+ "statuses:read"
3943
+ ];
3944
+ const ISSUES_READ = [
3945
+ "contents:read",
3946
+ "metadata:read",
3947
+ "issues:read"
3948
+ ];
3949
+ const ISSUES_WRITE = [
3950
+ "contents:read",
3951
+ "metadata:read",
3952
+ "issues:read",
3953
+ "issues:write"
3954
+ ];
3955
+ const DISCUSSIONS_READ = [
3956
+ "contents:read",
3957
+ "metadata:read",
3958
+ "discussions:read"
3959
+ ];
3960
+ const DISCUSSIONS_WRITE = [
3961
+ "contents:read",
3962
+ "metadata:read",
3963
+ "discussions:read",
3964
+ "discussions:write"
3965
+ ];
3966
+ const ACTIONS_READ = [
3967
+ "contents:read",
3968
+ "metadata:read",
3969
+ "actions:read"
3970
+ ];
3971
+ const ACTIONS_WRITE = [
3972
+ "contents:read",
3973
+ "metadata:read",
3974
+ "actions:read",
3975
+ "actions:write"
3976
+ ];
3977
+ const CHECKS = [
3978
+ "contents:read",
3979
+ "metadata:read",
3980
+ "checks:read",
3981
+ "statuses:read"
3982
+ ];
3983
+ const CI_CONTEXT = [
3984
+ "contents:read",
3985
+ "metadata:read",
3986
+ "actions:read",
3987
+ "checks:read",
3988
+ "statuses:read"
3989
+ ];
3990
+ const ADMIN = [
3991
+ "metadata:read",
3992
+ "administration:read",
3993
+ "administration:write"
3994
+ ];
3995
+ const SEARCH_REPOS = ["metadata:read"];
3996
+ const SEARCH_ISSUES = [
3997
+ "metadata:read",
3998
+ "issues:read",
3999
+ "pull_requests:read"
4000
+ ];
4001
+ const UNSCOPED = [];
3587
4002
  /**
3588
- * All GitHub tool names available via {@link createGithubTools}.
3589
- * Each key maps to its own string literal for IDE autocomplete and hover docs.
4003
+ * Single source of truth for every GitHub tool.
4004
+ *
4005
+ * `GITHUB_TOOL_NAMES`, `GITHUB_WRITE_TOOLS`, `TOOL_CONNECT_SCOPES`, and the
4006
+ * eve tool registry are all derived from this catalog. Adding a tool here (plus
4007
+ * its `"use step"` factory in `src/tools/` and `allTools` in `src/index.ts`,
4008
+ * both enforced at compile time) is the only registration needed.
3590
4009
  */
3591
- const GITHUB_TOOL_NAMES = {
4010
+ const GITHUB_TOOL_CATALOG = {
3592
4011
  /** Get information about a GitHub repository including description, stars, forks, language, and default branch. */
3593
- getRepository: "getRepository",
4012
+ getRepository: {
4013
+ description: getRepositoryDescription,
4014
+ inputSchema: getRepositoryInputSchema,
4015
+ get core() {
4016
+ return getRepositoryCore;
4017
+ },
4018
+ connectScopes: CONTENTS_READ
4019
+ },
3594
4020
  /** List branches in a GitHub repository. */
3595
- listBranches: "listBranches",
4021
+ listBranches: {
4022
+ description: listBranchesDescription,
4023
+ inputSchema: listBranchesInputSchema,
4024
+ get core() {
4025
+ return listBranchesCore;
4026
+ },
4027
+ connectScopes: CONTENTS_READ
4028
+ },
3596
4029
  /** Get the content of a file from a GitHub repository. Prefer startLine/endLine or maxLines for large files. */
3597
- getFileContent: "getFileContent",
4030
+ getFileContent: {
4031
+ description: getFileContentDescription,
4032
+ inputSchema: getFileContentInputSchema,
4033
+ get core() {
4034
+ return getFileContentCore;
4035
+ },
4036
+ connectScopes: CONTENTS_READ
4037
+ },
3598
4038
  /** List the file and directory structure of a repository at a given ref. */
3599
- getRepositoryTree: "getRepositoryTree",
4039
+ getRepositoryTree: {
4040
+ description: getRepositoryTreeDescription,
4041
+ inputSchema: getRepositoryTreeInputSchema,
4042
+ get core() {
4043
+ return getRepositoryTreeCore;
4044
+ },
4045
+ connectScopes: CONTENTS_READ
4046
+ },
3600
4047
  /** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */
3601
- createBranch: "createBranch",
4048
+ createBranch: {
4049
+ description: createBranchDescription,
4050
+ inputSchema: createBranchInputSchema,
4051
+ get core() {
4052
+ return createBranchCore;
4053
+ },
4054
+ write: true,
4055
+ connectScopes: CONTENTS_WRITE
4056
+ },
4057
+ /** Delete a branch from a GitHub repository permanently. Requires approval by default. */
4058
+ deleteBranch: {
4059
+ description: deleteBranchDescription,
4060
+ inputSchema: deleteBranchInputSchema,
4061
+ get core() {
4062
+ return deleteBranchCore;
4063
+ },
4064
+ write: true,
4065
+ connectScopes: CONTENTS_WRITE
4066
+ },
3602
4067
  /** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
3603
- forkRepository: "forkRepository",
4068
+ forkRepository: {
4069
+ description: forkRepositoryDescription,
4070
+ inputSchema: forkRepositoryInputSchema,
4071
+ get core() {
4072
+ return forkRepositoryCore;
4073
+ },
4074
+ write: true,
4075
+ connectScopes: CONTENTS_READ
4076
+ },
3604
4077
  /** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
3605
- createRepository: "createRepository",
4078
+ createRepository: {
4079
+ description: createRepositoryDescription,
4080
+ inputSchema: createRepositoryInputSchema,
4081
+ get core() {
4082
+ return createRepositoryCore;
4083
+ },
4084
+ write: true,
4085
+ connectScopes: ADMIN
4086
+ },
3606
4087
  /** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */
3607
- createOrUpdateFile: "createOrUpdateFile",
4088
+ createOrUpdateFile: {
4089
+ description: createOrUpdateFileDescription,
4090
+ inputSchema: createOrUpdateFileInputSchema,
4091
+ get core() {
4092
+ return createOrUpdateFileCore;
4093
+ },
4094
+ write: true,
4095
+ connectScopes: CONTENTS_WRITE
4096
+ },
3608
4097
  /** List pull requests for a GitHub repository. */
3609
- listPullRequests: "listPullRequests",
4098
+ listPullRequests: {
4099
+ description: listPullRequestsDescription,
4100
+ inputSchema: listPullRequestsInputSchema,
4101
+ get core() {
4102
+ return listPullRequestsCore;
4103
+ },
4104
+ connectScopes: PR_READ
4105
+ },
3610
4106
  /** Get detailed information about a specific pull request. Body truncated by default (detail: summary). */
3611
- getPullRequest: "getPullRequest",
4107
+ getPullRequest: {
4108
+ description: getPullRequestDescription,
4109
+ inputSchema: getPullRequestInputSchema,
4110
+ get core() {
4111
+ return getPullRequestCore;
4112
+ },
4113
+ connectScopes: PR_READ
4114
+ },
3612
4115
  /** Create a new pull request in a GitHub repository. Requires approval by default. */
3613
- createPullRequest: "createPullRequest",
4116
+ createPullRequest: {
4117
+ description: createPullRequestDescription,
4118
+ inputSchema: createPullRequestInputSchema,
4119
+ get core() {
4120
+ return createPullRequestCore;
4121
+ },
4122
+ write: true,
4123
+ connectScopes: PR_WRITE
4124
+ },
3614
4125
  /** Merge a pull request. Requires approval by default. */
3615
- mergePullRequest: "mergePullRequest",
4126
+ mergePullRequest: {
4127
+ description: mergePullRequestDescription,
4128
+ inputSchema: mergePullRequestInputSchema,
4129
+ get core() {
4130
+ return mergePullRequestCore;
4131
+ },
4132
+ write: true,
4133
+ connectScopes: PR_WRITE
4134
+ },
3616
4135
  /** Update a pull request — title, body, state, base branch, or draft status. Requires approval by default. */
3617
- updatePullRequest: "updatePullRequest",
4136
+ updatePullRequest: {
4137
+ description: updatePullRequestDescription,
4138
+ inputSchema: updatePullRequestInputSchema,
4139
+ get core() {
4140
+ return updatePullRequestCore;
4141
+ },
4142
+ write: true,
4143
+ connectScopes: PR_WRITE
4144
+ },
3618
4145
  /** Add a comment to a pull request. Requires approval by default. */
3619
- addPullRequestComment: "addPullRequestComment",
4146
+ addPullRequestComment: {
4147
+ description: addPullRequestCommentDescription,
4148
+ inputSchema: addPullRequestCommentInputSchema,
4149
+ get core() {
4150
+ return addPullRequestCommentCore;
4151
+ },
4152
+ write: true,
4153
+ connectScopes: PR_WRITE
4154
+ },
3620
4155
  /** Update the body of a comment on a pull request. Requires approval by default. */
3621
- updatePullRequestComment: "updatePullRequestComment",
4156
+ updatePullRequestComment: {
4157
+ description: updatePullRequestCommentDescription,
4158
+ inputSchema: updatePullRequestCommentInputSchema,
4159
+ get core() {
4160
+ return updatePullRequestCommentCore;
4161
+ },
4162
+ write: true,
4163
+ connectScopes: PR_WRITE
4164
+ },
3622
4165
  /** Delete a comment from a pull request permanently. Requires approval by default. */
3623
- deletePullRequestComment: "deletePullRequestComment",
4166
+ deletePullRequestComment: {
4167
+ description: deletePullRequestCommentDescription,
4168
+ inputSchema: deletePullRequestCommentInputSchema,
4169
+ get core() {
4170
+ return deletePullRequestCommentCore;
4171
+ },
4172
+ write: true,
4173
+ connectScopes: PR_WRITE
4174
+ },
3624
4175
  /** List files changed in a pull request with status and stats. Patches omitted by default — set includePatch true for diffs. */
3625
- listPullRequestFiles: "listPullRequestFiles",
4176
+ listPullRequestFiles: {
4177
+ description: listPullRequestFilesDescription,
4178
+ inputSchema: listPullRequestFilesInputSchema,
4179
+ get core() {
4180
+ return listPullRequestFilesCore;
4181
+ },
4182
+ connectScopes: PR_READ
4183
+ },
3626
4184
  /** List reviews on a pull request (approvals, change requests, and comments). */
3627
- listPullRequestReviews: "listPullRequestReviews",
4185
+ listPullRequestReviews: {
4186
+ description: listPullRequestReviewsDescription,
4187
+ inputSchema: listPullRequestReviewsInputSchema,
4188
+ get core() {
4189
+ return listPullRequestReviewsCore;
4190
+ },
4191
+ connectScopes: PR_READ
4192
+ },
3628
4193
  /** Submit a pull request review — approve, request changes, or comment with optional inline comments on specific lines. Requires approval by default. */
3629
- createPullRequestReview: "createPullRequestReview",
4194
+ createPullRequestReview: {
4195
+ description: createPullRequestReviewDescription,
4196
+ inputSchema: createPullRequestReviewInputSchema,
4197
+ get core() {
4198
+ return createPullRequestReviewCore;
4199
+ },
4200
+ write: true,
4201
+ connectScopes: PR_WRITE
4202
+ },
4203
+ /** List review threads on a pull request with comments, resolution state, and the IDs needed to reply or resolve. Unresolved only by default. */
4204
+ listPullRequestReviewThreads: {
4205
+ description: listPullRequestReviewThreadsDescription,
4206
+ inputSchema: listPullRequestReviewThreadsInputSchema,
4207
+ get core() {
4208
+ return listPullRequestReviewThreadsCore;
4209
+ },
4210
+ connectScopes: PR_READ
4211
+ },
4212
+ /** Reply to a pull request review comment in its review thread. Requires approval by default. */
4213
+ replyToReviewComment: {
4214
+ description: replyToReviewCommentDescription,
4215
+ inputSchema: replyToReviewCommentInputSchema,
4216
+ get core() {
4217
+ return replyToReviewCommentCore;
4218
+ },
4219
+ write: true,
4220
+ connectScopes: PR_WRITE
4221
+ },
4222
+ /** Mark a pull request review thread as resolved. Requires approval by default. */
4223
+ resolveReviewThread: {
4224
+ description: resolveReviewThreadDescription,
4225
+ inputSchema: resolveReviewThreadInputSchema,
4226
+ get core() {
4227
+ return resolveReviewThreadCore;
4228
+ },
4229
+ write: true,
4230
+ connectScopes: PR_WRITE
4231
+ },
3630
4232
  /** Request reviews from users or teams on a pull request. Requires approval by default. */
3631
- requestReviewers: "requestReviewers",
4233
+ requestReviewers: {
4234
+ description: requestReviewersDescription,
4235
+ inputSchema: requestReviewersInputSchema,
4236
+ get core() {
4237
+ return requestReviewersCore;
4238
+ },
4239
+ write: true,
4240
+ connectScopes: PR_WRITE
4241
+ },
3632
4242
  /** Fetch pull request details plus files, reviews, and optional CI checks in one call. */
3633
- getPullRequestContext: "getPullRequestContext",
4243
+ getPullRequestContext: {
4244
+ description: getPullRequestContextDescription,
4245
+ inputSchema: getPullRequestContextInputSchema,
4246
+ get core() {
4247
+ return getPullRequestContextCore;
4248
+ },
4249
+ connectScopes: PR_CONTEXT
4250
+ },
4251
+ /** Fetch an issue plus available label names and recent comments in one call. */
4252
+ getIssueContext: {
4253
+ description: getIssueContextDescription,
4254
+ inputSchema: getIssueContextInputSchema,
4255
+ get core() {
4256
+ return getIssueContextCore;
4257
+ },
4258
+ connectScopes: ISSUES_READ
4259
+ },
3634
4260
  /** List issues for a GitHub repository (excludes pull requests). */
3635
- listIssues: "listIssues",
4261
+ listIssues: {
4262
+ description: listIssuesDescription,
4263
+ inputSchema: listIssuesInputSchema,
4264
+ get core() {
4265
+ return listIssuesCore;
4266
+ },
4267
+ connectScopes: ISSUES_READ
4268
+ },
3636
4269
  /** Get detailed information about a specific issue. Body truncated by default (detail: summary). */
3637
- getIssue: "getIssue",
3638
- /** Fetch an issue plus available label names and recent comments in one call. */
3639
- getIssueContext: "getIssueContext",
4270
+ getIssue: {
4271
+ description: getIssueDescription,
4272
+ inputSchema: getIssueInputSchema,
4273
+ get core() {
4274
+ return getIssueCore;
4275
+ },
4276
+ connectScopes: ISSUES_READ
4277
+ },
3640
4278
  /** List comments on a GitHub issue. Bodies are truncated by default (detail: summary). Prefer getIssueContext for the first page when triaging. */
3641
- listIssueComments: "listIssueComments",
4279
+ listIssueComments: {
4280
+ description: listIssueCommentsDescription,
4281
+ inputSchema: listIssueCommentsInputSchema,
4282
+ get core() {
4283
+ return listIssueCommentsCore;
4284
+ },
4285
+ connectScopes: ISSUES_READ
4286
+ },
3642
4287
  /** Create a new issue in a GitHub repository. Requires approval by default. */
3643
- createIssue: "createIssue",
4288
+ createIssue: {
4289
+ description: createIssueDescription,
4290
+ inputSchema: createIssueInputSchema,
4291
+ get core() {
4292
+ return createIssueCore;
4293
+ },
4294
+ write: true,
4295
+ connectScopes: ISSUES_WRITE
4296
+ },
3644
4297
  /** Add a comment to a GitHub issue. Requires approval by default. */
3645
- addIssueComment: "addIssueComment",
4298
+ addIssueComment: {
4299
+ description: addIssueCommentDescription,
4300
+ inputSchema: addIssueCommentInputSchema,
4301
+ get core() {
4302
+ return addIssueCommentCore;
4303
+ },
4304
+ write: true,
4305
+ connectScopes: ISSUES_WRITE
4306
+ },
3646
4307
  /** Update the body of a comment on a GitHub issue. Requires approval by default. */
3647
- updateIssueComment: "updateIssueComment",
4308
+ updateIssueComment: {
4309
+ description: updateIssueCommentDescription,
4310
+ inputSchema: updateIssueCommentInputSchema,
4311
+ get core() {
4312
+ return updateIssueCommentCore;
4313
+ },
4314
+ write: true,
4315
+ connectScopes: ISSUES_WRITE
4316
+ },
3648
4317
  /** Delete a comment from a GitHub issue permanently. Requires approval by default. */
3649
- deleteIssueComment: "deleteIssueComment",
4318
+ deleteIssueComment: {
4319
+ description: deleteIssueCommentDescription,
4320
+ inputSchema: deleteIssueCommentInputSchema,
4321
+ get core() {
4322
+ return deleteIssueCommentCore;
4323
+ },
4324
+ write: true,
4325
+ connectScopes: ISSUES_WRITE
4326
+ },
3650
4327
  /** Close an open GitHub issue. Requires approval by default. */
3651
- closeIssue: "closeIssue",
4328
+ closeIssue: {
4329
+ description: closeIssueDescription,
4330
+ inputSchema: closeIssueInputSchema,
4331
+ get core() {
4332
+ return closeIssueCore;
4333
+ },
4334
+ write: true,
4335
+ connectScopes: ISSUES_WRITE
4336
+ },
3652
4337
  /** Update a GitHub issue — title, body, state, labels, milestone, or assignees. Requires approval by default. */
3653
- updateIssue: "updateIssue",
4338
+ updateIssue: {
4339
+ description: updateIssueDescription,
4340
+ inputSchema: updateIssueInputSchema,
4341
+ get core() {
4342
+ return updateIssueCore;
4343
+ },
4344
+ write: true,
4345
+ connectScopes: ISSUES_WRITE
4346
+ },
3654
4347
  /** List labels available in a GitHub repository. */
3655
- listLabels: "listLabels",
4348
+ listLabels: {
4349
+ description: listLabelsDescription,
4350
+ inputSchema: listLabelsInputSchema,
4351
+ get core() {
4352
+ return listLabelsCore;
4353
+ },
4354
+ connectScopes: ISSUES_READ
4355
+ },
3656
4356
  /** Add labels to an issue or pull request. Requires approval by default. */
3657
- addLabels: "addLabels",
4357
+ addLabels: {
4358
+ description: addLabelsDescription,
4359
+ inputSchema: addLabelsInputSchema,
4360
+ get core() {
4361
+ return addLabelsCore;
4362
+ },
4363
+ write: true,
4364
+ connectScopes: ISSUES_WRITE
4365
+ },
3658
4366
  /** Remove a label from an issue or pull request. Requires approval by default. */
3659
- removeLabel: "removeLabel",
4367
+ removeLabel: {
4368
+ description: removeLabelDescription,
4369
+ inputSchema: removeLabelInputSchema,
4370
+ get core() {
4371
+ return removeLabelCore;
4372
+ },
4373
+ write: true,
4374
+ connectScopes: ISSUES_WRITE
4375
+ },
3660
4376
  /** Create a label in a GitHub repository. Requires approval by default. */
3661
- createLabel: "createLabel",
4377
+ createLabel: {
4378
+ description: createLabelDescription,
4379
+ inputSchema: createLabelInputSchema,
4380
+ get core() {
4381
+ return createLabelCore;
4382
+ },
4383
+ write: true,
4384
+ connectScopes: ISSUES_WRITE
4385
+ },
3662
4386
  /** Update a label in a GitHub repository — name, color, or description. Requires approval by default. */
3663
- updateLabel: "updateLabel",
4387
+ updateLabel: {
4388
+ description: updateLabelDescription,
4389
+ inputSchema: updateLabelInputSchema,
4390
+ get core() {
4391
+ return updateLabelCore;
4392
+ },
4393
+ write: true,
4394
+ connectScopes: ISSUES_WRITE
4395
+ },
3664
4396
  /** Delete a label from a GitHub repository permanently. Requires approval by default. */
3665
- deleteLabel: "deleteLabel",
4397
+ deleteLabel: {
4398
+ description: deleteLabelDescription,
4399
+ inputSchema: deleteLabelInputSchema,
4400
+ get core() {
4401
+ return deleteLabelCore;
4402
+ },
4403
+ write: true,
4404
+ connectScopes: ISSUES_WRITE
4405
+ },
3666
4406
  /** Assign users to an issue or pull request. Requires approval by default. */
3667
- addAssignees: "addAssignees",
4407
+ addAssignees: {
4408
+ description: addAssigneesDescription,
4409
+ inputSchema: addAssigneesInputSchema,
4410
+ get core() {
4411
+ return addAssigneesCore;
4412
+ },
4413
+ write: true,
4414
+ connectScopes: ISSUES_WRITE
4415
+ },
3668
4416
  /** Remove assignees from an issue or pull request. Requires approval by default. */
3669
- removeAssignees: "removeAssignees",
4417
+ removeAssignees: {
4418
+ description: removeAssigneesDescription,
4419
+ inputSchema: removeAssigneesInputSchema,
4420
+ get core() {
4421
+ return removeAssigneesCore;
4422
+ },
4423
+ write: true,
4424
+ connectScopes: ISSUES_WRITE
4425
+ },
4426
+ /** List reactions on an issue or pull request conversation, with per-emoji counts. */
4427
+ listIssueReactions: {
4428
+ description: listIssueReactionsDescription,
4429
+ inputSchema: listIssueReactionsInputSchema,
4430
+ get core() {
4431
+ return listIssueReactionsCore;
4432
+ },
4433
+ connectScopes: ISSUES_READ
4434
+ },
4435
+ /** React to an issue or pull request with an emoji. Requires approval by default. */
4436
+ addIssueReaction: {
4437
+ description: addIssueReactionDescription,
4438
+ inputSchema: addIssueReactionInputSchema,
4439
+ get core() {
4440
+ return addIssueReactionCore;
4441
+ },
4442
+ write: true,
4443
+ connectScopes: ISSUES_WRITE
4444
+ },
4445
+ /** List reactions on an issue or pull request comment, with per-emoji counts. */
4446
+ listCommentReactions: {
4447
+ description: listCommentReactionsDescription,
4448
+ inputSchema: listCommentReactionsInputSchema,
4449
+ get core() {
4450
+ return listCommentReactionsCore;
4451
+ },
4452
+ connectScopes: ISSUES_READ
4453
+ },
4454
+ /** React to an issue or pull request comment with an emoji. Requires approval by default. */
4455
+ addCommentReaction: {
4456
+ description: addCommentReactionDescription,
4457
+ inputSchema: addCommentReactionInputSchema,
4458
+ get core() {
4459
+ return addCommentReactionCore;
4460
+ },
4461
+ write: true,
4462
+ connectScopes: ISSUES_WRITE
4463
+ },
4464
+ /** List discussions in a GitHub repository, most recently updated first, optionally filtered by category. */
4465
+ listDiscussions: {
4466
+ description: listDiscussionsDescription,
4467
+ inputSchema: listDiscussionsInputSchema,
4468
+ get core() {
4469
+ return listDiscussionsCore;
4470
+ },
4471
+ connectScopes: DISCUSSIONS_READ
4472
+ },
4473
+ /** Get a GitHub discussion by number. Body truncated by default (detail: summary). */
4474
+ getDiscussion: {
4475
+ description: getDiscussionDescription,
4476
+ inputSchema: getDiscussionInputSchema,
4477
+ get core() {
4478
+ return getDiscussionCore;
4479
+ },
4480
+ connectScopes: DISCUSSIONS_READ
4481
+ },
4482
+ /** Add a comment to a GitHub discussion. Requires approval by default. */
4483
+ addDiscussionComment: {
4484
+ description: addDiscussionCommentDescription,
4485
+ inputSchema: addDiscussionCommentInputSchema,
4486
+ get core() {
4487
+ return addDiscussionCommentCore;
4488
+ },
4489
+ write: true,
4490
+ connectScopes: DISCUSSIONS_WRITE
4491
+ },
4492
+ /** List notification threads for the authenticated user. Requires a token with notifications access. */
4493
+ listNotifications: {
4494
+ description: listNotificationsDescription,
4495
+ inputSchema: listNotificationsInputSchema,
4496
+ get core() {
4497
+ return listNotificationsCore;
4498
+ },
4499
+ connectScopes: UNSCOPED
4500
+ },
4501
+ /** Mark a single notification thread as read. Requires approval by default. */
4502
+ markNotificationRead: {
4503
+ description: markNotificationReadDescription,
4504
+ inputSchema: markNotificationReadInputSchema,
4505
+ get core() {
4506
+ return markNotificationReadCore;
4507
+ },
4508
+ write: true,
4509
+ connectScopes: UNSCOPED
4510
+ },
3670
4511
  /** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. Results include matching text snippets when GitHub returns them. */
3671
- searchCode: "searchCode",
4512
+ searchCode: {
4513
+ description: searchCodeDescription,
4514
+ inputSchema: searchCodeInputSchema,
4515
+ get core() {
4516
+ return searchCodeCore;
4517
+ },
4518
+ connectScopes: CONTENTS_READ
4519
+ },
3672
4520
  /** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */
3673
- searchRepositories: "searchRepositories",
4521
+ searchRepositories: {
4522
+ description: searchRepositoriesDescription,
4523
+ inputSchema: searchRepositoriesInputSchema,
4524
+ get core() {
4525
+ return searchRepositoriesCore;
4526
+ },
4527
+ connectScopes: SEARCH_REPOS
4528
+ },
3674
4529
  /** Search for issues and pull requests across GitHub using search qualifiers like "repo:owner/name is:open". */
3675
- searchIssues: "searchIssues",
4530
+ searchIssues: {
4531
+ description: searchIssuesDescription,
4532
+ inputSchema: searchIssuesInputSchema,
4533
+ get core() {
4534
+ return searchIssuesCore;
4535
+ },
4536
+ connectScopes: SEARCH_ISSUES
4537
+ },
3676
4538
  /** List commits for a GitHub repository. Filter by file path to see commits that touched a file. For line-by-line attribution at a given ref, use getBlame instead. */
3677
- listCommits: "listCommits",
4539
+ listCommits: {
4540
+ description: listCommitsDescription,
4541
+ inputSchema: listCommitsInputSchema,
4542
+ get core() {
4543
+ return listCommitsCore;
4544
+ },
4545
+ connectScopes: CONTENTS_READ
4546
+ },
3678
4547
  /** Get detailed information about a specific commit, including the list of files changed. Patches omitted by default. */
3679
- getCommit: "getCommit",
4548
+ getCommit: {
4549
+ description: getCommitDescription,
4550
+ inputSchema: getCommitInputSchema,
4551
+ get core() {
4552
+ return getCommitCore;
4553
+ },
4554
+ connectScopes: CONTENTS_READ
4555
+ },
3680
4556
  /** Line-level git blame for a file at a commit-like ref (branch, tag, or SHA). Returns contiguous ranges mapping lines to the commits that last modified them. */
3681
- getBlame: "getBlame",
4557
+ getBlame: {
4558
+ description: getBlameDescription,
4559
+ inputSchema: getBlameInputSchema,
4560
+ get core() {
4561
+ return getBlameCore;
4562
+ },
4563
+ connectScopes: CONTENTS_READ
4564
+ },
3682
4565
  /** Compare two branches, tags, or commits — ahead/behind counts, commits in between, and differing files. Patches omitted by default. */
3683
- compareCommits: "compareCommits",
4566
+ compareCommits: {
4567
+ description: compareCommitsDescription,
4568
+ inputSchema: compareCommitsInputSchema,
4569
+ get core() {
4570
+ return compareCommitsCore;
4571
+ },
4572
+ connectScopes: CONTENTS_READ
4573
+ },
3684
4574
  /** List gists for the authenticated user or a specific user. */
3685
- listGists: "listGists",
4575
+ listGists: {
4576
+ description: listGistsDescription,
4577
+ inputSchema: listGistsInputSchema,
4578
+ get core() {
4579
+ return listGistsCore;
4580
+ },
4581
+ connectScopes: UNSCOPED
4582
+ },
3686
4583
  /** Get a gist by ID, including file contents. */
3687
- getGist: "getGist",
4584
+ getGist: {
4585
+ description: getGistDescription,
4586
+ inputSchema: getGistInputSchema,
4587
+ get core() {
4588
+ return getGistCore;
4589
+ },
4590
+ connectScopes: UNSCOPED
4591
+ },
3688
4592
  /** List comments on a gist. */
3689
- listGistComments: "listGistComments",
4593
+ listGistComments: {
4594
+ description: listGistCommentsDescription,
4595
+ inputSchema: listGistCommentsInputSchema,
4596
+ get core() {
4597
+ return listGistCommentsCore;
4598
+ },
4599
+ connectScopes: UNSCOPED
4600
+ },
3690
4601
  /** Create a new gist with one or more files. Requires approval by default. */
3691
- createGist: "createGist",
4602
+ createGist: {
4603
+ description: createGistDescription,
4604
+ inputSchema: createGistInputSchema,
4605
+ get core() {
4606
+ return createGistCore;
4607
+ },
4608
+ write: true,
4609
+ connectScopes: UNSCOPED
4610
+ },
3692
4611
  /** Update an existing gist — edit description, update files, or remove files. Requires approval by default. */
3693
- updateGist: "updateGist",
4612
+ updateGist: {
4613
+ description: updateGistDescription,
4614
+ inputSchema: updateGistInputSchema,
4615
+ get core() {
4616
+ return updateGistCore;
4617
+ },
4618
+ write: true,
4619
+ connectScopes: UNSCOPED
4620
+ },
3694
4621
  /** Delete a gist permanently. Requires approval by default. */
3695
- deleteGist: "deleteGist",
4622
+ deleteGist: {
4623
+ description: deleteGistDescription,
4624
+ inputSchema: deleteGistInputSchema,
4625
+ get core() {
4626
+ return deleteGistCore;
4627
+ },
4628
+ write: true,
4629
+ connectScopes: UNSCOPED
4630
+ },
3696
4631
  /** Add a comment to a gist. Requires approval by default. */
3697
- createGistComment: "createGistComment",
4632
+ createGistComment: {
4633
+ description: createGistCommentDescription,
4634
+ inputSchema: createGistCommentInputSchema,
4635
+ get core() {
4636
+ return createGistCommentCore;
4637
+ },
4638
+ write: true,
4639
+ connectScopes: UNSCOPED
4640
+ },
3698
4641
  /** List GitHub Actions workflows in a repository. */
3699
- listWorkflows: "listWorkflows",
4642
+ listWorkflows: {
4643
+ description: listWorkflowsDescription,
4644
+ inputSchema: listWorkflowsInputSchema,
4645
+ get core() {
4646
+ return listWorkflowsCore;
4647
+ },
4648
+ connectScopes: ACTIONS_READ
4649
+ },
3700
4650
  /** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */
3701
- listWorkflowRuns: "listWorkflowRuns",
4651
+ listWorkflowRuns: {
4652
+ description: listWorkflowRunsDescription,
4653
+ inputSchema: listWorkflowRunsInputSchema,
4654
+ get core() {
4655
+ return listWorkflowRunsCore;
4656
+ },
4657
+ connectScopes: ACTIONS_READ
4658
+ },
3702
4659
  /** Get details of a specific workflow run including status, timing, and trigger info. */
3703
- getWorkflowRun: "getWorkflowRun",
4660
+ getWorkflowRun: {
4661
+ description: getWorkflowRunDescription,
4662
+ inputSchema: getWorkflowRunInputSchema,
4663
+ get core() {
4664
+ return getWorkflowRunCore;
4665
+ },
4666
+ connectScopes: ACTIONS_READ
4667
+ },
3704
4668
  /** List jobs for a workflow run, including step-level status and timing. */
3705
- listWorkflowJobs: "listWorkflowJobs",
4669
+ listWorkflowJobs: {
4670
+ description: listWorkflowJobsDescription,
4671
+ inputSchema: listWorkflowJobsInputSchema,
4672
+ get core() {
4673
+ return listWorkflowJobsCore;
4674
+ },
4675
+ connectScopes: ACTIONS_READ
4676
+ },
4677
+ /** Get the log output of a workflow job to diagnose failures. Returns the tail (default 200 lines) with timestamps stripped. */
4678
+ getWorkflowJobLogs: {
4679
+ description: getWorkflowJobLogsDescription,
4680
+ inputSchema: getWorkflowJobLogsInputSchema,
4681
+ get core() {
4682
+ return getWorkflowJobLogsCore;
4683
+ },
4684
+ connectScopes: ACTIONS_READ
4685
+ },
3706
4686
  /** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
3707
- triggerWorkflow: "triggerWorkflow",
4687
+ triggerWorkflow: {
4688
+ description: triggerWorkflowDescription,
4689
+ inputSchema: triggerWorkflowInputSchema,
4690
+ get core() {
4691
+ return triggerWorkflowCore;
4692
+ },
4693
+ write: true,
4694
+ connectScopes: ACTIONS_WRITE
4695
+ },
3708
4696
  /** Cancel an in-progress workflow run. Requires approval by default. */
3709
- cancelWorkflowRun: "cancelWorkflowRun",
4697
+ cancelWorkflowRun: {
4698
+ description: cancelWorkflowRunDescription,
4699
+ inputSchema: cancelWorkflowRunInputSchema,
4700
+ get core() {
4701
+ return cancelWorkflowRunCore;
4702
+ },
4703
+ write: true,
4704
+ connectScopes: ACTIONS_WRITE
4705
+ },
3710
4706
  /** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
3711
- rerunWorkflowRun: "rerunWorkflowRun",
4707
+ rerunWorkflowRun: {
4708
+ description: rerunWorkflowRunDescription,
4709
+ inputSchema: rerunWorkflowRunInputSchema,
4710
+ get core() {
4711
+ return rerunWorkflowRunCore;
4712
+ },
4713
+ write: true,
4714
+ connectScopes: ACTIONS_WRITE
4715
+ },
3712
4716
  /** List check runs (Checks API — GitHub Actions and other CI providers) for a commit, branch, or tag. */
3713
- listCheckRuns: "listCheckRuns",
4717
+ listCheckRuns: {
4718
+ description: listCheckRunsDescription,
4719
+ inputSchema: listCheckRunsInputSchema,
4720
+ get core() {
4721
+ return listCheckRunsCore;
4722
+ },
4723
+ connectScopes: CHECKS
4724
+ },
3714
4725
  /** Get the combined commit status (Statuses API — legacy CI integrations) for a commit, branch, or tag. */
3715
- getCombinedStatus: "getCombinedStatus",
4726
+ getCombinedStatus: {
4727
+ description: getCombinedStatusDescription,
4728
+ inputSchema: getCombinedStatusInputSchema,
4729
+ get core() {
4730
+ return getCombinedStatusCore;
4731
+ },
4732
+ connectScopes: CHECKS
4733
+ },
3716
4734
  /** Diagnose CI failures for a ref — combined status, failing checks, and failed workflow jobs in one call. */
3717
- getCiFailureContext: "getCiFailureContext",
3718
- /** List discussions in a GitHub repository, most recently updated first, optionally filtered by category. */
3719
- listDiscussions: "listDiscussions",
3720
- /** Get a GitHub discussion by number. Body truncated by default (detail: summary). */
3721
- getDiscussion: "getDiscussion",
3722
- /** Add a comment to a GitHub discussion. Requires approval by default. */
3723
- addDiscussionComment: "addDiscussionComment",
3724
- /** List notification threads for the authenticated user. Requires a token with notifications access. */
3725
- listNotifications: "listNotifications",
3726
- /** Mark a single notification thread as read. Requires approval by default. */
3727
- markNotificationRead: "markNotificationRead",
3728
- /** List reactions on an issue or pull request conversation, with per-emoji counts. */
3729
- listIssueReactions: "listIssueReactions",
3730
- /** React to an issue or pull request with an emoji. Requires approval by default. */
3731
- addIssueReaction: "addIssueReaction",
3732
- /** List reactions on an issue or pull request comment, with per-emoji counts. */
3733
- listCommentReactions: "listCommentReactions",
3734
- /** React to an issue or pull request comment with an emoji. Requires approval by default. */
3735
- addCommentReaction: "addCommentReaction",
4735
+ getCiFailureContext: {
4736
+ description: getCiFailureContextDescription,
4737
+ inputSchema: getCiFailureContextInputSchema,
4738
+ get core() {
4739
+ return getCiFailureContextCore;
4740
+ },
4741
+ connectScopes: CI_CONTEXT
4742
+ },
3736
4743
  /** List releases for a GitHub repository, newest first (includes drafts and prereleases). */
3737
- listReleases: "listReleases",
4744
+ listReleases: {
4745
+ description: listReleasesDescription,
4746
+ inputSchema: listReleasesInputSchema,
4747
+ get core() {
4748
+ return listReleasesCore;
4749
+ },
4750
+ connectScopes: CONTENTS_READ
4751
+ },
3738
4752
  /** Get the latest published release for a GitHub repository (excludes drafts and prereleases). Body truncated by default. */
3739
- getLatestRelease: "getLatestRelease",
4753
+ getLatestRelease: {
4754
+ description: getLatestReleaseDescription,
4755
+ inputSchema: getLatestReleaseInputSchema,
4756
+ get core() {
4757
+ return getLatestReleaseCore;
4758
+ },
4759
+ connectScopes: CONTENTS_READ
4760
+ },
3740
4761
  /** Get a specific release by ID, including its assets. Body truncated by default. */
3741
- getRelease: "getRelease",
4762
+ getRelease: {
4763
+ description: getReleaseDescription,
4764
+ inputSchema: getReleaseInputSchema,
4765
+ get core() {
4766
+ return getReleaseCore;
4767
+ },
4768
+ connectScopes: CONTENTS_READ
4769
+ },
3742
4770
  /** Fetch a release plus the previous release and tag comparison in one call. */
3743
- getReleaseContext: "getReleaseContext",
4771
+ getReleaseContext: {
4772
+ description: getReleaseContextDescription,
4773
+ inputSchema: getReleaseContextInputSchema,
4774
+ get core() {
4775
+ return getReleaseContextCore;
4776
+ },
4777
+ connectScopes: CONTENTS_READ
4778
+ },
3744
4779
  /** Create a new release (and its tag if needed) in a GitHub repository. Requires approval by default. */
3745
- createRelease: "createRelease",
4780
+ createRelease: {
4781
+ description: createReleaseDescription,
4782
+ inputSchema: createReleaseInputSchema,
4783
+ get core() {
4784
+ return createReleaseCore;
4785
+ },
4786
+ write: true,
4787
+ connectScopes: CONTENTS_WRITE
4788
+ },
3746
4789
  /** Update an existing release — tag, target, title, notes, draft, or prerelease status. Requires approval by default. */
3747
- updateRelease: "updateRelease",
4790
+ updateRelease: {
4791
+ description: updateReleaseDescription,
4792
+ inputSchema: updateReleaseInputSchema,
4793
+ get core() {
4794
+ return updateReleaseCore;
4795
+ },
4796
+ write: true,
4797
+ connectScopes: CONTENTS_WRITE
4798
+ },
3748
4799
  /** Delete a release permanently. Requires approval by default. */
3749
- deleteRelease: "deleteRelease"
4800
+ deleteRelease: {
4801
+ description: deleteReleaseDescription,
4802
+ inputSchema: deleteReleaseInputSchema,
4803
+ get core() {
4804
+ return deleteReleaseCore;
4805
+ },
4806
+ write: true,
4807
+ connectScopes: CONTENTS_WRITE
4808
+ }
3750
4809
  };
3751
- const ALL_GITHUB_TOOL_NAMES = Object.values(GITHUB_TOOL_NAMES);
4810
+ const ALL_GITHUB_TOOL_NAMES = Object.keys(GITHUB_TOOL_CATALOG);
4811
+ const GITHUB_WRITE_TOOL_NAMES = ALL_GITHUB_TOOL_NAMES.filter((name) => "write" in GITHUB_TOOL_CATALOG[name]);
4812
+ function isGithubWriteToolName(name) {
4813
+ return "write" in GITHUB_TOOL_CATALOG[name];
4814
+ }
4815
+ //#endregion
4816
+ //#region src/core/tool-names.ts
4817
+ /**
4818
+ * All GitHub tool names available via {@link createGithubTools}, keyed by name.
4819
+ * Derived from `GITHUB_TOOL_CATALOG` — the single source of truth for tools.
4820
+ */
4821
+ const GITHUB_TOOL_NAMES = Object.fromEntries(ALL_GITHUB_TOOL_NAMES.map((name) => [name, name]));
3752
4822
  //#endregion
3753
4823
  //#region src/core/write-tools.ts
3754
4824
  /**
3755
- * Write tools that mutate GitHub state. All require user approval by default
3756
- * unless overridden via {@link ApprovalConfig}.
4825
+ * GitHub tools that perform write operations and require approval by default.
4826
+ * Derived from the `write: true` entries of `GITHUB_TOOL_CATALOG`.
3757
4827
  */
3758
- const GITHUB_WRITE_TOOLS = {
3759
- /** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */
3760
- createBranch: "createBranch",
3761
- /** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
3762
- forkRepository: "forkRepository",
3763
- /** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
3764
- createRepository: "createRepository",
3765
- /** Create or update a file in a GitHub repository. Requires approval by default. */
3766
- createOrUpdateFile: "createOrUpdateFile",
3767
- /** Create a new pull request in a GitHub repository. Requires approval by default. */
3768
- createPullRequest: "createPullRequest",
3769
- /** Merge a pull request. Requires approval by default. */
3770
- mergePullRequest: "mergePullRequest",
3771
- /** Update a pull request. Requires approval by default. */
3772
- updatePullRequest: "updatePullRequest",
3773
- /** Add a comment to a pull request. Requires approval by default. */
3774
- addPullRequestComment: "addPullRequestComment",
3775
- /** Update a pull request comment. Requires approval by default. */
3776
- updatePullRequestComment: "updatePullRequestComment",
3777
- /** Delete a pull request comment. Requires approval by default. */
3778
- deletePullRequestComment: "deletePullRequestComment",
3779
- /** Submit a pull request review with optional inline comments. Requires approval by default. */
3780
- createPullRequestReview: "createPullRequestReview",
3781
- /** Request reviews from users or teams on a pull request. Requires approval by default. */
3782
- requestReviewers: "requestReviewers",
3783
- /** Create a new issue in a GitHub repository. Requires approval by default. */
3784
- createIssue: "createIssue",
3785
- /** Add a comment to a GitHub issue. Requires approval by default. */
3786
- addIssueComment: "addIssueComment",
3787
- /** Update a GitHub issue comment. Requires approval by default. */
3788
- updateIssueComment: "updateIssueComment",
3789
- /** Delete a GitHub issue comment. Requires approval by default. */
3790
- deleteIssueComment: "deleteIssueComment",
3791
- /** Close an open GitHub issue. Requires approval by default. */
3792
- closeIssue: "closeIssue",
3793
- /** Update a GitHub issue. Requires approval by default. */
3794
- updateIssue: "updateIssue",
3795
- /** Add labels to an issue or pull request. Requires approval by default. */
3796
- addLabels: "addLabels",
3797
- /** Remove a label from an issue or pull request. Requires approval by default. */
3798
- removeLabel: "removeLabel",
3799
- /** Create a label in a GitHub repository. Requires approval by default. */
3800
- createLabel: "createLabel",
3801
- /** Update a label in a GitHub repository. Requires approval by default. */
3802
- updateLabel: "updateLabel",
3803
- /** Delete a label from a GitHub repository permanently. Requires approval by default. */
3804
- deleteLabel: "deleteLabel",
3805
- /** Assign users to an issue or pull request. Requires approval by default. */
3806
- addAssignees: "addAssignees",
3807
- /** Remove assignees from an issue or pull request. Requires approval by default. */
3808
- removeAssignees: "removeAssignees",
3809
- /** Create a new gist with one or more files. Requires approval by default. */
3810
- createGist: "createGist",
3811
- /** Update an existing gist. Requires approval by default. */
3812
- updateGist: "updateGist",
3813
- /** Delete a gist permanently. Requires approval by default. */
3814
- deleteGist: "deleteGist",
3815
- /** Add a comment to a gist. Requires approval by default. */
3816
- createGistComment: "createGistComment",
3817
- /** Add a comment to a GitHub discussion. Requires approval by default. */
3818
- addDiscussionComment: "addDiscussionComment",
3819
- /** Mark a single notification thread as read. Requires approval by default. */
3820
- markNotificationRead: "markNotificationRead",
3821
- /** React to an issue or pull request with an emoji. Requires approval by default. */
3822
- addIssueReaction: "addIssueReaction",
3823
- /** React to an issue or pull request comment with an emoji. Requires approval by default. */
3824
- addCommentReaction: "addCommentReaction",
3825
- /** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
3826
- triggerWorkflow: "triggerWorkflow",
3827
- /** Cancel an in-progress workflow run. Requires approval by default. */
3828
- cancelWorkflowRun: "cancelWorkflowRun",
3829
- /** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
3830
- rerunWorkflowRun: "rerunWorkflowRun",
3831
- /** Create a new release (and its tag if needed) in a GitHub repository. Requires approval by default. */
3832
- createRelease: "createRelease",
3833
- /** Update an existing release. Requires approval by default. */
3834
- updateRelease: "updateRelease",
3835
- /** Delete a release permanently. Requires approval by default. */
3836
- deleteRelease: "deleteRelease"
3837
- };
3838
- Object.values(GITHUB_WRITE_TOOLS);
4828
+ const GITHUB_WRITE_TOOLS = Object.fromEntries(GITHUB_WRITE_TOOL_NAMES.map((name) => [name, name]));
3839
4829
  //#endregion
3840
- export { listWorkflowJobsDescription as $, getIssueDescription as $n, requestReviewersDescription as $r, searchRepositoriesDescription as $t, getLatestReleaseInputSchema as A, getRepositoryDescription as Ai, addAssigneesInputSchema as An, createPullRequestInputSchema as Ar, listGistsInputSchema as At, getCombinedStatusCore as B, createIssueCore as Bn, listPullRequestFilesCore as Br, getCommitCore as Bt, createReleaseDescription as C, forkRepositoryCore as Ci, listCommentReactionsDescription as Cn, updateLabelDescription as Cr, getGistDescription as Ct, deleteReleaseInputSchema as D, getFileContentDescription as Di, listIssueReactionsInputSchema as Dn, addPullRequestCommentInputSchema as Dr, listGistCommentsInputSchema as Dt, deleteReleaseDescription as E, getFileContentCore as Ei, listIssueReactionsDescription as En, addPullRequestCommentDescription as Er, listGistCommentsDescription as Et, listReleasesDescription as F, listBranchesCore as Fi, addLabelsDescription as Fn, deletePullRequestCommentDescription as Fr, compareCommitsDescription as Ft, listCheckRunsInputSchema as G, createLabelInputSchema as Gn, listPullRequestReviewsInputSchema as Gr, listCommitsInputSchema as Gt, getCombinedStatusInputSchema as H, createIssueInputSchema as Hn, listPullRequestFilesInputSchema as Hr, getCommitInputSchema as Ht, listReleasesInputSchema as I, listBranchesDescription as Ii, addLabelsInputSchema as In, deletePullRequestCommentInputSchema as Ir, compareCommitsInputSchema as It, cancelWorkflowRunInputSchema as J, deleteIssueCommentInputSchema as Jn, listPullRequestsInputSchema as Jr, searchCodeInputSchema as Jt, cancelWorkflowRunCore as K, deleteIssueCommentCore as Kn, listPullRequestsCore as Kr, searchCodeCore as Kt, updateReleaseCore as L, listBranchesInputSchema as Li, closeIssueCore as Ln, getPullRequestCore as Lr, getBlameCore as Lt, getReleaseDescription as M, getRepositoryTreeCore as Mi, addIssueCommentDescription as Mn, createPullRequestReviewDescription as Mr, updateGistDescription as Mt, getReleaseInputSchema as N, getRepositoryTreeDescription as Ni, addIssueCommentInputSchema as Nn, createPullRequestReviewInputSchema as Nr, updateGistInputSchema as Nt, getLatestReleaseCore as O, getFileContentInputSchema as Oi, addAssigneesCore as On, createPullRequestCore as Or, listGistsCore as Ot, listReleasesCore as P, getRepositoryTreeInputSchema as Pi, addLabelsCore as Pn, deletePullRequestCommentCore as Pr, compareCommitsCore as Pt, listWorkflowJobsCore as Q, getIssueCore as Qn, requestReviewersCore as Qr, searchRepositoriesCore as Qt, updateReleaseDescription as R, createOctokit as Ri, closeIssueDescription as Rn, getPullRequestDescription as Rr, getBlameDescription as Rt, createReleaseCore as S, createRepositoryInputSchema as Si, listCommentReactionsCore as Sn, updateLabelCore as Sr, getGistCore as St, deleteReleaseCore as T, forkRepositoryInputSchema as Ti, listIssueReactionsCore as Tn, addPullRequestCommentCore as Tr, listGistCommentsCore as Tt, listCheckRunsCore as U, createLabelCore as Un, listPullRequestReviewsCore as Ur, listCommitsCore as Ut, getCombinedStatusDescription as V, createIssueDescription as Vn, listPullRequestFilesDescription as Vr, getCommitDescription as Vt, listCheckRunsDescription as W, createLabelDescription as Wn, listPullRequestReviewsDescription as Wr, listCommitsDescription as Wt, getWorkflowRunDescription as X, deleteLabelDescription as Xn, mergePullRequestDescription as Xr, searchIssuesDescription as Xt, getWorkflowRunCore as Y, deleteLabelCore as Yn, mergePullRequestCore as Yr, searchIssuesCore as Yt, getWorkflowRunInputSchema as Z, deleteLabelInputSchema as Zn, mergePullRequestInputSchema as Zr, searchIssuesInputSchema as Zt, getPullRequestContextDescription as _, createOrUpdateFileCore as _i, addCommentReactionDescription as _n, updateIssueCommentDescription as _r, createGistDescription as _t, resolvePresetTools as a, updatePullRequestDescription as ai, markNotificationReadDescription as an, listIssuesDescription as ar, listWorkflowsDescription as at, getReleaseContextDescription as b, createRepositoryCore as bi, addIssueReactionDescription as bn, updateIssueDescription as br, deleteGistDescription as bt, mergeContextArgs as c, resolveGithubToken as ci, addDiscussionCommentDescription as cn, listLabelsDescription as cr, rerunWorkflowRunDescription as ct, getCiFailureContextDescription as d, getFileContentToModelOutput as di, getDiscussionDescription as dn, removeAssigneesDescription as dr, triggerWorkflowDescription as dt, requestReviewersInputSchema as ei, searchRepositoriesInputSchema as en, getIssueInputSchema as er, listWorkflowJobsInputSchema as et, getCiFailureContextInputSchema as f, getPullRequestContextToModelOutput as fi, getDiscussionInputSchema as fn, removeAssigneesInputSchema as fr, triggerWorkflowInputSchema as ft, getPullRequestContextCore as g, createBranchInputSchema as gi, addCommentReactionCore as gn, updateIssueCommentCore as gr, createGistCore as gt, getIssueContextInputSchema as h, createBranchDescription as hi, listDiscussionsInputSchema as hn, removeLabelInputSchema as hr, createGistCommentInputSchema as ht, PRESET_TOOLS as i, updatePullRequestCore as ii, markNotificationReadCore as in, listIssuesCore as ir, listWorkflowsCore as it, getReleaseCore as j, getRepositoryInputSchema as ji, addIssueCommentCore as jn, createPullRequestReviewCore as jr, updateGistCore as jt, getLatestReleaseDescription as k, getRepositoryCore as ki, addAssigneesDescription as kn, createPullRequestDescription as kr, listGistsDescription as kt, softenContextSchema as l, compareCommitsToModelOutput as li, addDiscussionCommentInputSchema as ln, listLabelsInputSchema as lr, rerunWorkflowRunInputSchema as lt, getIssueContextDescription as m, createBranchCore as mi, listDiscussionsDescription as mn, removeLabelDescription as mr, createGistCommentDescription as mt, ALL_GITHUB_TOOL_NAMES as n, updatePullRequestCommentDescription as ni, listNotificationsDescription as nn, listIssueCommentsDescription as nr, listWorkflowRunsDescription as nt, bindToolsContext as o, updatePullRequestInputSchema as oi, markNotificationReadInputSchema as on, listIssuesInputSchema as or, listWorkflowsInputSchema as ot, getIssueContextCore as p, listPullRequestFilesToModelOutput as pi, listDiscussionsCore as pn, removeLabelCore as pr, createGistCommentCore as pt, cancelWorkflowRunDescription as q, deleteIssueCommentDescription as qn, listPullRequestsDescription as qr, searchCodeDescription as qt, GITHUB_TOOL_NAMES as r, updatePullRequestCommentInputSchema as ri, listNotificationsInputSchema as rn, listIssueCommentsInputSchema as rr, listWorkflowRunsInputSchema as rt, formatContextInstructions as s, createGithubTokenResolver as si, addDiscussionCommentCore as sn, listLabelsCore as sr, rerunWorkflowRunCore as st, GITHUB_WRITE_TOOLS as t, updatePullRequestCommentCore as ti, listNotificationsCore as tn, listIssueCommentsCore as tr, listWorkflowRunsCore as tt, getCiFailureContextCore as u, getCommitToModelOutput as ui, getDiscussionCore as un, removeAssigneesCore as ur, triggerWorkflowCore as ut, getPullRequestContextInputSchema as v, createOrUpdateFileDescription as vi, addCommentReactionInputSchema as vn, updateIssueCommentInputSchema as vr, createGistInputSchema as vt, createReleaseInputSchema as w, forkRepositoryDescription as wi, listCommentReactionsInputSchema as wn, updateLabelInputSchema as wr, getGistInputSchema as wt, getReleaseContextInputSchema as x, createRepositoryDescription as xi, addIssueReactionInputSchema as xn, updateIssueInputSchema as xr, deleteGistInputSchema as xt, getReleaseContextCore as y, createOrUpdateFileInputSchema as yi, addIssueReactionCore as yn, updateIssueCore as yr, deleteGistCore as yt, updateReleaseInputSchema as z, stripRateLimit as zi, closeIssueInputSchema as zn, getPullRequestInputSchema as zr, getBlameInputSchema as zt };
4830
+ export { getWorkflowJobLogsInputSchema as $, listBranchesCore as $i, deleteIssueCommentInputSchema as $n, listPullRequestReviewsInputSchema as $r, searchCodeInputSchema as $t, getLatestReleaseCore as A, createBranchDescription as Ai, listIssueReactionsCore as An, addPullRequestCommentCore as Ar, listGistCommentsCore as At, updateReleaseDescription as B, deleteBranchInputSchema as Bi, addLabelsDescription as Bn, deletePullRequestCommentDescription as Br, compareCommitsDescription as Bt, getReleaseContextInputSchema as C, compareCommitsToModelOutput as Ci, addCommentReactionInputSchema as Cn, updateIssueCommentInputSchema as Cr, createGistInputSchema as Ct, deleteReleaseCore as D, getRepositoryTreeToModelOutput as Di, listCommentReactionsCore as Dn, updateLabelCore as Dr, getGistCore as Dt, createReleaseInputSchema as E, getPullRequestContextToModelOutput as Ei, addIssueReactionInputSchema as En, updateIssueInputSchema as Er, deleteGistInputSchema as Et, getReleaseInputSchema as F, createRepositoryCore as Fi, addAssigneesInputSchema as Fn, createPullRequestInputSchema as Fr, listGistsInputSchema as Ft, listCheckRunsCore as G, getFileContentDescription as Gi, createIssueCore as Gn, listPullRequestFilesCore as Gr, getCommitCore as Gt, getCombinedStatusCore as H, forkRepositoryDescription as Hi, closeIssueCore as Hn, getPullRequestCore as Hr, getBlameCore as Ht, listReleasesCore as I, createRepositoryDescription as Ii, addIssueCommentCore as In, createPullRequestReviewCore as Ir, updateGistCore as It, cancelWorkflowRunCore as J, getRepositoryDescription as Ji, createLabelCore as Jn, listPullRequestReviewThreadsCore as Jr, listCommitsCore as Jt, listCheckRunsDescription as K, getFileContentInputSchema as Ki, createIssueDescription as Kn, listPullRequestFilesDescription as Kr, getCommitDescription as Kt, listReleasesDescription as L, createRepositoryInputSchema as Li, addIssueCommentDescription as Ln, createPullRequestReviewDescription as Lr, updateGistDescription as Lt, getLatestReleaseInputSchema as M, createOrUpdateFileCore as Mi, listIssueReactionsInputSchema as Mn, addPullRequestCommentInputSchema as Mr, listGistCommentsInputSchema as Mt, getReleaseCore as N, createOrUpdateFileDescription as Ni, addAssigneesCore as Nn, createPullRequestCore as Nr, listGistsCore as Nt, deleteReleaseDescription as O, listPullRequestFilesToModelOutput as Oi, listCommentReactionsDescription as On, updateLabelDescription as Or, getGistDescription as Ot, getReleaseDescription as P, createOrUpdateFileInputSchema as Pi, addAssigneesDescription as Pn, createPullRequestDescription as Pr, listGistsDescription as Pt, getWorkflowJobLogsDescription as Q, getRepositoryTreeInputSchema as Qi, deleteIssueCommentDescription as Qn, listPullRequestReviewsDescription as Qr, searchCodeDescription as Qt, listReleasesInputSchema as R, deleteBranchCore as Ri, addIssueCommentInputSchema as Rn, createPullRequestReviewInputSchema as Rr, updateGistInputSchema as Rt, getReleaseContextDescription as S, resolveGithubToken as Si, addCommentReactionDescription as Sn, updateIssueCommentDescription as Sr, createGistDescription as St, createReleaseDescription as T, getFileContentToModelOutput as Ti, addIssueReactionDescription as Tn, updateIssueDescription as Tr, deleteGistDescription as Tt, getCombinedStatusDescription as U, forkRepositoryInputSchema as Ui, closeIssueDescription as Un, getPullRequestDescription as Ur, getBlameDescription as Ut, updateReleaseInputSchema as V, forkRepositoryCore as Vi, addLabelsInputSchema as Vn, deletePullRequestCommentInputSchema as Vr, compareCommitsInputSchema as Vt, getCombinedStatusInputSchema as W, getFileContentCore as Wi, closeIssueInputSchema as Wn, getPullRequestInputSchema as Wr, getBlameInputSchema as Wt, cancelWorkflowRunInputSchema as X, getRepositoryTreeCore as Xi, createLabelInputSchema as Xn, listPullRequestReviewThreadsInputSchema as Xr, listCommitsInputSchema as Xt, cancelWorkflowRunDescription as Y, getRepositoryInputSchema as Yi, createLabelDescription as Yn, listPullRequestReviewThreadsDescription as Yr, listCommitsDescription as Yt, getWorkflowJobLogsCore as Z, getRepositoryTreeDescription as Zi, deleteIssueCommentCore as Zn, listPullRequestReviewsCore as Zr, searchCodeCore as Zt, getIssueContextInputSchema as _, updatePullRequestCommentInputSchema as _i, getDiscussionInputSchema as _n, removeAssigneesInputSchema as _r, triggerWorkflowInputSchema as _t, isGithubWriteToolName as a, mergePullRequestInputSchema as ai, searchRepositoriesInputSchema as an, getIssueInputSchema as ar, listWorkflowJobsInputSchema as at, getPullRequestContextInputSchema as b, updatePullRequestInputSchema as bi, listDiscussionsInputSchema as bn, removeLabelInputSchema as br, createGistCommentInputSchema as bt, bindToolsContext as c, replyToReviewCommentInputSchema as ci, listNotificationsInputSchema as cn, listIssueCommentsInputSchema as cr, listWorkflowRunsInputSchema as ct, softenContextSchema as d, requestReviewersInputSchema as di, markNotificationReadInputSchema as dn, listIssuesInputSchema as dr, listWorkflowsInputSchema as dt, listBranchesDescription as ea, listPullRequestsCore as ei, searchIssuesCore as en, deleteLabelCore as er, getWorkflowRunCore as et, getCiFailureContextCore as f, resolveReviewThreadCore as fi, addDiscussionCommentCore as fn, listLabelsCore as fr, rerunWorkflowRunCore as ft, getIssueContextDescription as g, updatePullRequestCommentDescription as gi, getDiscussionDescription as gn, removeAssigneesDescription as gr, triggerWorkflowDescription as gt, getIssueContextCore as h, updatePullRequestCommentCore as hi, getDiscussionCore as hn, removeAssigneesCore as hr, triggerWorkflowCore as ht, GITHUB_TOOL_CATALOG as i, mergePullRequestDescription as ii, searchRepositoriesDescription as in, getIssueDescription as ir, listWorkflowJobsDescription as it, getLatestReleaseDescription as j, createBranchInputSchema as ji, listIssueReactionsDescription as jn, addPullRequestCommentDescription as jr, listGistCommentsDescription as jt, deleteReleaseInputSchema as k, createBranchCore as ki, listCommentReactionsInputSchema as kn, updateLabelInputSchema as kr, getGistInputSchema as kt, formatContextInstructions as l, requestReviewersCore as li, markNotificationReadCore as ln, listIssuesCore as lr, listWorkflowsCore as lt, getCiFailureContextInputSchema as m, resolveReviewThreadInputSchema as mi, addDiscussionCommentInputSchema as mn, listLabelsInputSchema as mr, rerunWorkflowRunInputSchema as mt, GITHUB_TOOL_NAMES as n, createOctokit as na, listPullRequestsInputSchema as ni, searchIssuesInputSchema as nn, deleteLabelInputSchema as nr, getWorkflowRunInputSchema as nt, PRESET_TOOLS as o, replyToReviewCommentCore as oi, listNotificationsCore as on, listIssueCommentsCore as or, listWorkflowRunsCore as ot, getCiFailureContextDescription as p, resolveReviewThreadDescription as pi, addDiscussionCommentDescription as pn, listLabelsDescription as pr, rerunWorkflowRunDescription as pt, listCheckRunsInputSchema as q, getRepositoryCore as qi, createIssueInputSchema as qn, listPullRequestFilesInputSchema as qr, getCommitInputSchema as qt, ALL_GITHUB_TOOL_NAMES as r, stripRateLimit as ra, mergePullRequestCore as ri, searchRepositoriesCore as rn, getIssueCore as rr, listWorkflowJobsCore as rt, resolvePresetTools as s, replyToReviewCommentDescription as si, listNotificationsDescription as sn, listIssueCommentsDescription as sr, listWorkflowRunsDescription as st, GITHUB_WRITE_TOOLS as t, listBranchesInputSchema as ta, listPullRequestsDescription as ti, searchIssuesDescription as tn, deleteLabelDescription as tr, getWorkflowRunDescription as tt, mergeContextArgs as u, requestReviewersDescription as ui, markNotificationReadDescription as un, listIssuesDescription as ur, listWorkflowsDescription as ut, getPullRequestContextCore as v, updatePullRequestCore as vi, listDiscussionsCore as vn, removeLabelCore as vr, createGistCommentCore as vt, createReleaseCore as w, getCommitToModelOutput as wi, addIssueReactionCore as wn, updateIssueCore as wr, deleteGistCore as wt, getReleaseContextCore as x, createGithubTokenResolver as xi, addCommentReactionCore as xn, updateIssueCommentCore as xr, createGistCore as xt, getPullRequestContextDescription as y, updatePullRequestDescription as yi, listDiscussionsDescription as yn, removeLabelDescription as yr, createGistCommentDescription as yt, updateReleaseCore as z, deleteBranchDescription as zi, addLabelsCore as zn, deletePullRequestCommentCore as zr, compareCommitsCore as zt };
3841
4831
 
3842
- //# sourceMappingURL=write-tools-CnJE0Vvu.mjs.map
4832
+ //# sourceMappingURL=write-tools-Ct0ZV87Z.mjs.map