@sentry/junior-github 0.277.0 → 0.278.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.
package/dist/index.js CHANGED
@@ -382,22 +382,117 @@ function createGitHubCloneRepositoryTool(ctx) {
382
382
  });
383
383
  }
384
384
 
385
- // src/object-facts.ts
385
+ // src/tools/comment-on-pull-request.ts
386
+ import {
387
+ definePluginTool as definePluginTool2,
388
+ PluginToolInputError as PluginToolInputError2,
389
+ pluginToolOutputSchema as pluginToolOutputSchema2
390
+ } from "@sentry/junior-plugin-api";
386
391
  import { z as z2 } from "zod";
387
- var person = z2.object({ login: z2.string() });
388
- var responseSchema = z2.object({
389
- body: z2.string().nullable().optional(),
392
+ var inputSchema2 = z2.object({
393
+ repo: z2.string().describe('Repository in "owner/name" format.'),
394
+ number: z2.number().int().positive().describe("Pull request number."),
395
+ body: z2.string().trim().min(1).describe("Comment text."),
396
+ in_reply_to: z2.number().int().positive().optional().describe(
397
+ "Inline review comment id. Set it to reply in that comment's thread. Omit it to comment on the pull request."
398
+ )
399
+ }).strict();
400
+ var outputSchema2 = pluginToolOutputSchema2.extend({
401
+ target: z2.literal("commentOnPullRequest"),
402
+ repo: z2.string(),
403
+ number: z2.number(),
404
+ comment_id: z2.number(),
405
+ url: z2.string()
406
+ });
407
+ function parseRepo2(value) {
408
+ const parts = value.split("/").map((part) => part.trim());
409
+ if (parts.length !== 2 || !parts[0] || !parts[1]) {
410
+ throw new PluginToolInputError2('repo must use "owner/name" format');
411
+ }
412
+ return { owner: parts[0], name: parts[1], ref: `${parts[0]}/${parts[1]}` };
413
+ }
414
+ async function readJson(response) {
415
+ const text2 = await response.text();
416
+ if (!text2) return void 0;
417
+ try {
418
+ return JSON.parse(text2);
419
+ } catch {
420
+ return text2;
421
+ }
422
+ }
423
+ function githubError(body) {
424
+ if (body && typeof body === "object" && !Array.isArray(body)) {
425
+ const message = body.message;
426
+ if (typeof message === "string" && message.trim()) return message.trim();
427
+ }
428
+ if (typeof body === "string" && body.trim()) return body.trim();
429
+ return "GitHub request failed";
430
+ }
431
+ function createGitHubCommentOnPullRequestTool(egress) {
432
+ return definePluginTool2({
433
+ annotations: {
434
+ destructiveHint: false,
435
+ idempotentHint: false,
436
+ openWorldHint: true,
437
+ readOnlyHint: false
438
+ },
439
+ description: "Post a comment on a GitHub pull request, or reply in an inline review thread with in_reply_to. Use it to answer a question asked in a pull request review or comment. Returns the comment id and URL.",
440
+ exposure: "direct",
441
+ inputSchema: inputSchema2,
442
+ outputSchema: outputSchema2,
443
+ async execute(input) {
444
+ const repo = parseRepo2(input.repo);
445
+ const repoPath = `https://api.github.com/repos/${encodeURIComponent(repo.owner)}/${encodeURIComponent(repo.name)}`;
446
+ const url = input.in_reply_to === void 0 ? `${repoPath}/issues/${input.number}/comments` : `${repoPath}/pulls/${input.number}/comments/${input.in_reply_to}/replies`;
447
+ const response = await egress.fetch({
448
+ provider: "github",
449
+ operation: "github.pull.comment.create",
450
+ request: new Request(url, {
451
+ method: "POST",
452
+ headers: {
453
+ Accept: "application/vnd.github+json",
454
+ "Content-Type": "application/json",
455
+ "X-GitHub-Api-Version": "2022-11-28"
456
+ },
457
+ body: JSON.stringify({ body: input.body })
458
+ })
459
+ });
460
+ const parsed = await readJson(response);
461
+ if (!response.ok) {
462
+ const message = `GitHub pull request comment failed with HTTP ${response.status}: ${githubError(parsed)}`;
463
+ if (response.status === 404 || response.status === 422) {
464
+ throw new PluginToolInputError2(message);
465
+ }
466
+ throw new Error(message);
467
+ }
468
+ const comment = z2.object({ id: z2.number(), html_url: z2.string() }).parse(parsed);
469
+ return {
470
+ target: "commentOnPullRequest",
471
+ repo: repo.ref,
472
+ number: input.number,
473
+ comment_id: comment.id,
474
+ url: comment.html_url
475
+ };
476
+ }
477
+ });
478
+ }
479
+
480
+ // src/object-facts.ts
481
+ import { z as z3 } from "zod";
482
+ var person = z3.object({ login: z3.string() });
483
+ var responseSchema = z3.object({
484
+ body: z3.string().nullable().optional(),
390
485
  user: person.nullable().optional(),
391
- requested_reviewers: z2.array(person).optional(),
392
- assignees: z2.array(person).optional(),
393
- labels: z2.array(z2.union([z2.string(), z2.object({ name: z2.string() })])).optional(),
394
- head: z2.object({ ref: z2.string() }).optional(),
395
- base: z2.object({ ref: z2.string() }).optional(),
396
- mergeable: z2.boolean().nullable().optional(),
397
- changed_files: z2.number().int().nonnegative().optional(),
398
- additions: z2.number().int().nonnegative().optional(),
399
- deletions: z2.number().int().nonnegative().optional(),
400
- updated_at: z2.iso.datetime({ offset: true }).optional()
486
+ requested_reviewers: z3.array(person).optional(),
487
+ assignees: z3.array(person).optional(),
488
+ labels: z3.array(z3.union([z3.string(), z3.object({ name: z3.string() })])).optional(),
489
+ head: z3.object({ ref: z3.string() }).optional(),
490
+ base: z3.object({ ref: z3.string() }).optional(),
491
+ mergeable: z3.boolean().nullable().optional(),
492
+ changed_files: z3.number().int().nonnegative().optional(),
493
+ additions: z3.number().int().nonnegative().optional(),
494
+ deletions: z3.number().int().nonnegative().optional(),
495
+ updated_at: z3.iso.datetime({ offset: true }).optional()
401
496
  });
402
497
  var short = (value) => {
403
498
  const text2 = value?.trim();
@@ -520,24 +615,24 @@ async function updateGitHubAnnotation(store, input) {
520
615
  // src/tools/create-issue.ts
521
616
  import {
522
617
  objectFactsSchema,
523
- definePluginTool as definePluginTool2,
618
+ definePluginTool as definePluginTool3,
524
619
  EgressAuthRequired,
525
- PluginToolInputError as PluginToolInputError3,
620
+ PluginToolInputError as PluginToolInputError4,
526
621
  subscribableResourceSchema,
527
- pluginToolOutputSchema as pluginToolOutputSchema2
622
+ pluginToolOutputSchema as pluginToolOutputSchema3
528
623
  } from "@sentry/junior-plugin-api";
529
624
  import { Type } from "@sinclair/typebox";
530
625
  import { Value } from "@sinclair/typebox/value";
531
- import { z as z3 } from "zod";
626
+ import { z as z4 } from "zod";
532
627
 
533
628
  // src/tools/footer.ts
534
- import { PluginToolInputError as PluginToolInputError2 } from "@sentry/junior-plugin-api";
629
+ import { PluginToolInputError as PluginToolInputError3 } from "@sentry/junior-plugin-api";
535
630
  var GITHUB_SESSION_FOOTER_START = "<!-- junior-session-footer:start -->";
536
631
  var GITHUB_SESSION_FOOTER_END = "<!-- junior-session-footer:end -->";
537
632
  var GITHUB_CONVERSATION_ID_MARKER = "junior-conversation-id:";
538
633
  function nonEmptyString(value, name) {
539
634
  if (!value?.trim()) {
540
- throw new PluginToolInputError2(`${name} is required`);
635
+ throw new PluginToolInputError3(`${name} is required`);
541
636
  }
542
637
  return value.trim();
543
638
  }
@@ -681,11 +776,11 @@ var createIssueInputSchema = Type.Object(
681
776
  },
682
777
  { additionalProperties: false }
683
778
  );
684
- var createIssueToolInputSchema = z3.object({
685
- repo: z3.string().describe('Repository in "owner/name" format.'),
686
- title: z3.string().describe("Issue title."),
687
- body: z3.string().describe("Issue body. The runtime appends the conversation footer.").optional(),
688
- labels: z3.array(z3.string()).describe("Labels to apply to the issue.").optional()
779
+ var createIssueToolInputSchema = z4.object({
780
+ repo: z4.string().describe('Repository in "owner/name" format.'),
781
+ title: z4.string().describe("Issue title."),
782
+ body: z4.string().describe("Issue body. The runtime appends the conversation footer.").optional(),
783
+ labels: z4.array(z4.string()).describe("Labels to apply to the issue.").optional()
689
784
  }).strict();
690
785
  var createIssueStateSchema = Type.Union([
691
786
  Type.Object(
@@ -710,18 +805,18 @@ var createIssueStateSchema = Type.Union([
710
805
  { additionalProperties: false }
711
806
  )
712
807
  ]);
713
- var gitHubIssueDataSchema = z3.object({
714
- number: z3.number(),
808
+ var gitHubIssueDataSchema = z4.object({
809
+ number: z4.number(),
715
810
  subscribable: subscribableResourceSchema.optional(),
716
- url: z3.string()
811
+ url: z4.string()
717
812
  });
718
- var gitHubIssueOutputSchema = pluginToolOutputSchema2.merge(
813
+ var gitHubIssueOutputSchema = pluginToolOutputSchema3.merge(
719
814
  gitHubIssueDataSchema.extend({
720
- target: z3.literal("createIssue")
815
+ target: z4.literal("createIssue")
721
816
  })
722
817
  );
723
818
  function gitHubIssueToolResult(input, result, canSubscribe) {
724
- const repo = parseRepo2(input.repo);
819
+ const repo = parseRepo3(input.repo);
725
820
  const subscribable = gitHubIssueSubscribable({
726
821
  canSubscribe,
727
822
  number: result.number,
@@ -754,22 +849,22 @@ function parseCreateIssueInput(input) {
754
849
  try {
755
850
  return Value.Parse(createIssueInputSchema, input);
756
851
  } catch (error) {
757
- throw new PluginToolInputError3("Invalid GitHub createIssue input.", {
852
+ throw new PluginToolInputError4("Invalid GitHub createIssue input.", {
758
853
  cause: error
759
854
  });
760
855
  }
761
856
  }
762
857
  function nonEmptyString2(value, name) {
763
858
  if (!value?.trim()) {
764
- throw new PluginToolInputError3(`${name} is required`);
859
+ throw new PluginToolInputError4(`${name} is required`);
765
860
  }
766
861
  return value.trim();
767
862
  }
768
- function parseRepo2(value) {
863
+ function parseRepo3(value) {
769
864
  const repo = nonEmptyString2(value, "repo");
770
865
  const parts = repo.split("/");
771
866
  if (parts.length !== 2 || !parts[0]?.trim() || !parts[1]?.trim()) {
772
- throw new PluginToolInputError3('repo must use "owner/name" format');
867
+ throw new PluginToolInputError4('repo must use "owner/name" format');
773
868
  }
774
869
  return {
775
870
  owner: parts[0].trim(),
@@ -821,7 +916,7 @@ function isDefinitiveGitHubIssueCreateRejection(error) {
821
916
  return [400, 401, 404, 410, 422].includes(error.status);
822
917
  }
823
918
  async function createGitHubIssueRequest(conversationId, input, ctx, dashboardUrl) {
824
- const repo = parseRepo2(input.repo);
919
+ const repo = parseRepo3(input.repo);
825
920
  const labels = input.labels?.map(
826
921
  (label) => nonEmptyString2(label, "labels entry")
827
922
  );
@@ -882,7 +977,7 @@ async function createGitHubIssue(ctx, request) {
882
977
  };
883
978
  }
884
979
  function createGitHubIssueTool(ctx) {
885
- return definePluginTool2({
980
+ return definePluginTool3({
886
981
  annotations: {
887
982
  destructiveHint: false,
888
983
  idempotentHint: true,
@@ -975,83 +1070,83 @@ function createGitHubIssueTool(ctx) {
975
1070
 
976
1071
  // src/tools/get-deployment.ts
977
1072
  import {
978
- definePluginTool as definePluginTool3,
979
- PluginToolInputError as PluginToolInputError4,
980
- pluginToolOutputSchema as pluginToolOutputSchema3,
1073
+ definePluginTool as definePluginTool4,
1074
+ PluginToolInputError as PluginToolInputError5,
1075
+ pluginToolOutputSchema as pluginToolOutputSchema4,
981
1076
  subscribableResourceSchema as subscribableResourceSchema2
982
1077
  } from "@sentry/junior-plugin-api";
983
- import { z as z4 } from "zod";
984
- var commitShaSchema = z4.string().regex(/^[0-9a-f]{40}$/i);
985
- var inputSchema2 = z4.object({
986
- repo: z4.string().describe('Repository in "owner/name" format.'),
1078
+ import { z as z5 } from "zod";
1079
+ var commitShaSchema = z5.string().regex(/^[0-9a-f]{40}$/i);
1080
+ var inputSchema3 = z5.object({
1081
+ repo: z5.string().describe('Repository in "owner/name" format.'),
987
1082
  commit_sha: commitShaSchema.describe(
988
1083
  "Full 40-character Git commit SHA recorded by the deployment."
989
1084
  ),
990
- environment: z4.string().trim().min(1).describe(
1085
+ environment: z5.string().trim().min(1).describe(
991
1086
  'Optional GitHub deployment environment, such as "Production". Omit to inspect and watch deployments for the commit across environments.'
992
1087
  ).optional()
993
1088
  }).strict();
994
- var statusSchema = z4.object({
995
- created_at: z4.string(),
996
- creator: z4.string().nullable(),
997
- description: z4.string().nullable(),
998
- environment_url: z4.string().nullable(),
999
- id: z4.number(),
1000
- log_url: z4.string().nullable(),
1001
- state: z4.string()
1089
+ var statusSchema = z5.object({
1090
+ created_at: z5.string(),
1091
+ creator: z5.string().nullable(),
1092
+ description: z5.string().nullable(),
1093
+ environment_url: z5.string().nullable(),
1094
+ id: z5.number(),
1095
+ log_url: z5.string().nullable(),
1096
+ state: z5.string()
1002
1097
  }).strict();
1003
- var deploymentSchema = z4.object({
1004
- created_at: z4.string(),
1005
- creator: z4.string().nullable(),
1006
- description: z4.string().nullable(),
1007
- environment: z4.string(),
1008
- id: z4.number(),
1098
+ var deploymentSchema = z5.object({
1099
+ created_at: z5.string(),
1100
+ creator: z5.string().nullable(),
1101
+ description: z5.string().nullable(),
1102
+ environment: z5.string(),
1103
+ id: z5.number(),
1009
1104
  latest_status: statusSchema.nullable(),
1010
- ref: z4.string(),
1105
+ ref: z5.string(),
1011
1106
  sha: commitShaSchema,
1012
- updated_at: z4.string(),
1013
- url: z4.string()
1107
+ updated_at: z5.string(),
1108
+ url: z5.string()
1014
1109
  }).strict();
1015
- var deploymentSourceSchema = z4.object({
1110
+ var deploymentSourceSchema = z5.object({
1016
1111
  commit_sha: commitShaSchema,
1017
1112
  deployment: deploymentSchema.nullable(),
1018
- environment: z4.string().nullable(),
1019
- repo: z4.string(),
1113
+ environment: z5.string().nullable(),
1114
+ repo: z5.string(),
1020
1115
  subscribable: subscribableResourceSchema2.optional()
1021
1116
  }).strict();
1022
- var outputSchema2 = pluginToolOutputSchema3.merge(
1117
+ var outputSchema3 = pluginToolOutputSchema4.merge(
1023
1118
  deploymentSourceSchema.extend({
1024
- target: z4.literal("getDeployment")
1119
+ target: z5.literal("getDeployment")
1025
1120
  })
1026
1121
  );
1027
- var providerCreatorSchema = z4.object({ login: z4.string() }).passthrough().nullable();
1028
- var providerDeploymentSchema = z4.object({
1029
- created_at: z4.string(),
1122
+ var providerCreatorSchema = z5.object({ login: z5.string() }).passthrough().nullable();
1123
+ var providerDeploymentSchema = z5.object({
1124
+ created_at: z5.string(),
1030
1125
  creator: providerCreatorSchema,
1031
- description: z4.string().nullable(),
1032
- environment: z4.string(),
1033
- id: z4.number(),
1034
- ref: z4.string(),
1126
+ description: z5.string().nullable(),
1127
+ environment: z5.string(),
1128
+ id: z5.number(),
1129
+ ref: z5.string(),
1035
1130
  sha: commitShaSchema,
1036
- updated_at: z4.string()
1131
+ updated_at: z5.string()
1037
1132
  }).passthrough();
1038
- var providerStatusSchema = z4.object({
1039
- created_at: z4.string(),
1133
+ var providerStatusSchema = z5.object({
1134
+ created_at: z5.string(),
1040
1135
  creator: providerCreatorSchema,
1041
- description: z4.string().nullable().optional(),
1042
- environment_url: z4.string().nullable().optional(),
1043
- id: z4.number(),
1044
- log_url: z4.string().nullable().optional(),
1045
- state: z4.string()
1136
+ description: z5.string().nullable().optional(),
1137
+ environment_url: z5.string().nullable().optional(),
1138
+ id: z5.number(),
1139
+ log_url: z5.string().nullable().optional(),
1140
+ state: z5.string()
1046
1141
  }).passthrough();
1047
- function parseRepo3(value) {
1142
+ function parseRepo4(value) {
1048
1143
  const parts = value.split("/").map((part) => part.trim());
1049
1144
  if (parts.length !== 2 || !parts[0] || !parts[1]) {
1050
- throw new PluginToolInputError4('repo must use "owner/name" format');
1145
+ throw new PluginToolInputError5('repo must use "owner/name" format');
1051
1146
  }
1052
1147
  return { owner: parts[0], name: parts[1], ref: `${parts[0]}/${parts[1]}` };
1053
1148
  }
1054
- async function readJson(response) {
1149
+ async function readJson2(response) {
1055
1150
  const text2 = await response.text();
1056
1151
  if (!text2) return void 0;
1057
1152
  try {
@@ -1064,7 +1159,7 @@ function throwLookupError(target, status, body) {
1064
1159
  const message = `GitHub ${target} lookup failed with HTTP ${status}`;
1065
1160
  const hasValidationErrors = body !== null && typeof body === "object" && !Array.isArray(body) && Array.isArray(body.errors) && body.errors.length > 0;
1066
1161
  if (target === "deployment" && (status === 404 || status === 422 && hasValidationErrors)) {
1067
- throw new PluginToolInputError4(message);
1162
+ throw new PluginToolInputError5(message);
1068
1163
  }
1069
1164
  throw new Error(message);
1070
1165
  }
@@ -1072,7 +1167,7 @@ function repositoryUrl(repo, path) {
1072
1167
  return `https://api.github.com/repos/${encodeURIComponent(repo.owner)}/${encodeURIComponent(repo.name)}/${path}`;
1073
1168
  }
1074
1169
  function createGitHubGetDeploymentTool(ctx) {
1075
- return definePluginTool3({
1170
+ return definePluginTool4({
1076
1171
  annotations: {
1077
1172
  destructiveHint: false,
1078
1173
  idempotentHint: true,
@@ -1080,10 +1175,10 @@ function createGitHubGetDeploymentTool(ctx) {
1080
1175
  readOnlyHint: true
1081
1176
  },
1082
1177
  description: "Get the latest GitHub deployment and status for an exact repository and full commit SHA, optionally limited to one environment. The result remains subscribable when no deployment exists yet, so use it before waiting for a deployment outcome.",
1083
- inputSchema: inputSchema2,
1084
- outputSchema: outputSchema2,
1178
+ inputSchema: inputSchema3,
1179
+ outputSchema: outputSchema3,
1085
1180
  async execute(input) {
1086
- const repo = parseRepo3(input.repo);
1181
+ const repo = parseRepo4(input.repo);
1087
1182
  const commitSha = input.commit_sha.toLowerCase();
1088
1183
  const deploymentsUrl = new URL(repositoryUrl(repo, "deployments"));
1089
1184
  deploymentsUrl.searchParams.set("sha", commitSha);
@@ -1101,7 +1196,7 @@ function createGitHubGetDeploymentTool(ctx) {
1101
1196
  }
1102
1197
  })
1103
1198
  });
1104
- const deploymentsBody = await readJson(deploymentsResponse);
1199
+ const deploymentsBody = await readJson2(deploymentsResponse);
1105
1200
  if (!deploymentsResponse.ok) {
1106
1201
  throwLookupError(
1107
1202
  "deployment",
@@ -1109,7 +1204,7 @@ function createGitHubGetDeploymentTool(ctx) {
1109
1204
  deploymentsBody
1110
1205
  );
1111
1206
  }
1112
- const providerDeployment = z4.array(providerDeploymentSchema).parse(deploymentsBody)[0];
1207
+ const providerDeployment = z5.array(providerDeploymentSchema).parse(deploymentsBody)[0];
1113
1208
  let deployment = null;
1114
1209
  if (providerDeployment) {
1115
1210
  const statusesResponse = await ctx.egress.fetch({
@@ -1125,7 +1220,7 @@ function createGitHubGetDeploymentTool(ctx) {
1125
1220
  }
1126
1221
  )
1127
1222
  });
1128
- const statusesBody = await readJson(statusesResponse);
1223
+ const statusesBody = await readJson2(statusesResponse);
1129
1224
  if (!statusesResponse.ok) {
1130
1225
  throwLookupError(
1131
1226
  "deployment status",
@@ -1133,7 +1228,7 @@ function createGitHubGetDeploymentTool(ctx) {
1133
1228
  statusesBody
1134
1229
  );
1135
1230
  }
1136
- const providerStatus = z4.array(providerStatusSchema).parse(statusesBody)[0];
1231
+ const providerStatus = z5.array(providerStatusSchema).parse(statusesBody)[0];
1137
1232
  deployment = {
1138
1233
  created_at: providerDeployment.created_at,
1139
1234
  creator: providerDeployment.creator?.login ?? null,
@@ -1179,16 +1274,16 @@ function createGitHubGetDeploymentTool(ctx) {
1179
1274
  // src/tools/create-pull-request.ts
1180
1275
  import {
1181
1276
  objectFactsSchema as objectFactsSchema2,
1182
- definePluginTool as definePluginTool4,
1277
+ definePluginTool as definePluginTool5,
1183
1278
  EgressAuthRequired as EgressAuthRequired2,
1184
- PluginToolInputError as PluginToolInputError5,
1185
- pluginToolOutputSchema as pluginToolOutputSchema4,
1279
+ PluginToolInputError as PluginToolInputError6,
1280
+ pluginToolOutputSchema as pluginToolOutputSchema5,
1186
1281
  watchResultSchema,
1187
1282
  subscribableResourceSchema as subscribableResourceSchema3
1188
1283
  } from "@sentry/junior-plugin-api";
1189
1284
  import { Type as Type2 } from "@sinclair/typebox";
1190
1285
  import { Value as Value2 } from "@sinclair/typebox/value";
1191
- import { z as z7 } from "zod";
1286
+ import { z as z8 } from "zod";
1192
1287
 
1193
1288
  // src/pull-request-requesters/store.ts
1194
1289
  import { and, asc, eq, inArray, lt } from "drizzle-orm";
@@ -1203,18 +1298,18 @@ import {
1203
1298
  text,
1204
1299
  timestamp
1205
1300
  } from "drizzle-orm/pg-core";
1206
- import { z as z5 } from "zod";
1207
- var githubPullRequestStateSchema = z5.enum([
1301
+ import { z as z6 } from "zod";
1302
+ var githubPullRequestStateSchema = z6.enum([
1208
1303
  "closed_unmerged",
1209
1304
  "merged",
1210
1305
  "open"
1211
1306
  ]);
1212
- var githubPullRequestCommitCompositionSchema = z5.enum([
1307
+ var githubPullRequestCommitCompositionSchema = z6.enum([
1213
1308
  "junior_only",
1214
1309
  "mixed"
1215
1310
  ]);
1216
- var githubIssueStateSchema = z5.enum(["closed", "open"]);
1217
- var githubIssueStateReasonSchema = z5.enum([
1311
+ var githubIssueStateSchema = z6.enum(["closed", "open"]);
1312
+ var githubIssueStateReasonSchema = z6.enum([
1218
1313
  "completed",
1219
1314
  "duplicate",
1220
1315
  "not_planned",
@@ -1375,34 +1470,34 @@ async function listGitHubPullRequestOpeners(db, input) {
1375
1470
  }
1376
1471
 
1377
1472
  // src/tools/stack-pull-request.ts
1378
- import { z as z6 } from "zod";
1473
+ import { z as z7 } from "zod";
1379
1474
  var MAX_STACK_DEPTH = 10;
1380
1475
  var GITHUB_HEADERS = {
1381
1476
  Accept: "application/vnd.github+json",
1382
1477
  "X-GitHub-Api-Version": "2026-03-10"
1383
1478
  };
1384
- var stackTargetSchema = z6.object({
1385
- number: z6.number().int().positive(),
1386
- head: z6.object({
1387
- repo: z6.object({ full_name: z6.string().min(1) }).nullable()
1479
+ var stackTargetSchema = z7.object({
1480
+ number: z7.number().int().positive(),
1481
+ head: z7.object({
1482
+ repo: z7.object({ full_name: z7.string().min(1) }).nullable()
1388
1483
  }),
1389
- base: z6.object({
1390
- ref: z6.string().min(1),
1391
- repo: z6.object({
1392
- default_branch: z6.string().min(1),
1393
- full_name: z6.string().min(1)
1484
+ base: z7.object({
1485
+ ref: z7.string().min(1),
1486
+ repo: z7.object({
1487
+ default_branch: z7.string().min(1),
1488
+ full_name: z7.string().min(1)
1394
1489
  })
1395
1490
  })
1396
1491
  });
1397
- var openPullRequestsSchema = z6.array(
1398
- z6.object({
1399
- number: z6.number().int().positive(),
1400
- base: z6.object({ ref: z6.string().min(1) })
1492
+ var openPullRequestsSchema = z7.array(
1493
+ z7.object({
1494
+ number: z7.number().int().positive(),
1495
+ base: z7.object({ ref: z7.string().min(1) })
1401
1496
  })
1402
1497
  );
1403
- var stackSchema = z6.object({
1404
- number: z6.number().int().positive(),
1405
- pull_requests: z6.array(z6.object({ number: z6.number().int().positive() }))
1498
+ var stackSchema = z7.object({
1499
+ number: z7.number().int().positive(),
1500
+ pull_requests: z7.array(z7.object({ number: z7.number().int().positive() }))
1406
1501
  });
1407
1502
  async function stackGitHubPullRequest(ctx, target) {
1408
1503
  const repo = target.base.repo.full_name;
@@ -1451,7 +1546,7 @@ async function stackGitHubPullRequest(ctx, target) {
1451
1546
  const stacks = await github(
1452
1547
  "github.stack.read",
1453
1548
  `${api}/stacks?pull_request=${parent.number}`,
1454
- z6.array(stackSchema)
1549
+ z7.array(stackSchema)
1455
1550
  );
1456
1551
  if (!stacks) return void 0;
1457
1552
  const stack = stacks[0];
@@ -1526,15 +1621,15 @@ var createPullRequestInputSchema = Type2.Object(
1526
1621
  },
1527
1622
  { additionalProperties: false }
1528
1623
  );
1529
- var createPullRequestToolInputSchema = z7.object({
1530
- repo: z7.string().describe('Repository in "owner/name" format.'),
1531
- title: z7.string().describe("Pull request title."),
1532
- head: z7.string().describe("Head branch or owner:branch ref."),
1533
- base: z7.string().describe("Base branch."),
1534
- body: z7.string().describe(
1624
+ var createPullRequestToolInputSchema = z8.object({
1625
+ repo: z8.string().describe('Repository in "owner/name" format.'),
1626
+ title: z8.string().describe("Pull request title."),
1627
+ head: z8.string().describe("Head branch or owner:branch ref."),
1628
+ base: z8.string().describe("Base branch."),
1629
+ body: z8.string().describe(
1535
1630
  "Pull request body. The runtime appends the conversation footer."
1536
1631
  ).optional(),
1537
- draft: z7.boolean().describe("Whether to open the pull request as a draft.").optional()
1632
+ draft: z8.boolean().describe("Whether to open the pull request as a draft.").optional()
1538
1633
  }).strict();
1539
1634
  var createPullRequestStateSchema = Type2.Union([
1540
1635
  Type2.Object(
@@ -1559,38 +1654,38 @@ var createPullRequestStateSchema = Type2.Union([
1559
1654
  { additionalProperties: false }
1560
1655
  )
1561
1656
  ]);
1562
- var gitHubPullRequestDataSchema = z7.object({
1563
- number: z7.number(),
1564
- url: z7.string(),
1565
- stack: z7.object({ number: z7.number(), pull_requests: z7.array(z7.number()) }).optional(),
1657
+ var gitHubPullRequestDataSchema = z8.object({
1658
+ number: z8.number(),
1659
+ url: z8.string(),
1660
+ stack: z8.object({ number: z8.number(), pull_requests: z8.array(z8.number()) }).optional(),
1566
1661
  subscribable: subscribableResourceSchema3.optional(),
1567
1662
  subscription: watchResultSchema.optional()
1568
1663
  });
1569
- var gitHubPullRequestOutputSchema = pluginToolOutputSchema4.merge(
1664
+ var gitHubPullRequestOutputSchema = pluginToolOutputSchema5.merge(
1570
1665
  gitHubPullRequestDataSchema.extend({
1571
- target: z7.literal("createPullRequest")
1666
+ target: z8.literal("createPullRequest")
1572
1667
  })
1573
1668
  );
1574
1669
  function parseCreatePullRequestInput(input) {
1575
1670
  try {
1576
1671
  return Value2.Parse(createPullRequestInputSchema, input);
1577
1672
  } catch (error) {
1578
- throw new PluginToolInputError5("Invalid GitHub createPullRequest input.", {
1673
+ throw new PluginToolInputError6("Invalid GitHub createPullRequest input.", {
1579
1674
  cause: error
1580
1675
  });
1581
1676
  }
1582
1677
  }
1583
1678
  function nonEmptyString3(value, name) {
1584
1679
  if (!value?.trim()) {
1585
- throw new PluginToolInputError5(`${name} is required`);
1680
+ throw new PluginToolInputError6(`${name} is required`);
1586
1681
  }
1587
1682
  return value.trim();
1588
1683
  }
1589
- function parseRepo4(value) {
1684
+ function parseRepo5(value) {
1590
1685
  const repo = nonEmptyString3(value, "repo");
1591
1686
  const parts = repo.split("/");
1592
1687
  if (parts.length !== 2 || !parts[0]?.trim() || !parts[1]?.trim()) {
1593
- throw new PluginToolInputError5('repo must use "owner/name" format');
1688
+ throw new PluginToolInputError6('repo must use "owner/name" format');
1594
1689
  }
1595
1690
  return {
1596
1691
  owner: parts[0].trim(),
@@ -1661,7 +1756,7 @@ function isDefinitiveGitHubPullRequestCreateRejection(error) {
1661
1756
  return [400, 401, 404, 410, 422].includes(error.status);
1662
1757
  }
1663
1758
  function createGitHubPullRequestRequest(conversationId, input, ctx, requester, dashboardUrl) {
1664
- const repo = parseRepo4(input.repo);
1759
+ const repo = parseRepo5(input.repo);
1665
1760
  const payload = {
1666
1761
  title: nonEmptyString3(input.title, "title"),
1667
1762
  head: nonEmptyString3(input.head, "head"),
@@ -1727,7 +1822,7 @@ async function createGitHubPullRequest(ctx, request) {
1727
1822
  async function recordOpener(ctx, input, state, requester) {
1728
1823
  const { conversationId, identityId } = requester;
1729
1824
  if (!identityId) return;
1730
- const repo = parseRepo4(input.repo);
1825
+ const repo = parseRepo5(input.repo);
1731
1826
  await recordGitHubPullRequestOpener(ctx.db, {
1732
1827
  conversationId,
1733
1828
  createdAt: new Date(state.createdAtMs),
@@ -1740,7 +1835,7 @@ async function assignPullRequestRequester(ctx, input, result, requester) {
1740
1835
  const assignee = linkedGitHubLogin(requester?.user);
1741
1836
  if (!assignee) return;
1742
1837
  try {
1743
- const repo = parseRepo4(input.repo);
1838
+ const repo = parseRepo5(input.repo);
1744
1839
  const response = await ctx.egress.fetch({
1745
1840
  provider: "github",
1746
1841
  operation: "github.pull.assign",
@@ -1773,7 +1868,7 @@ async function assignPullRequestRequester(ctx, input, result, requester) {
1773
1868
  }
1774
1869
  }
1775
1870
  function gitHubPullRequestToolResult(input, result, canSubscribe, omitSuggestedEvents) {
1776
- const repo = parseRepo4(input.repo);
1871
+ const repo = parseRepo5(input.repo);
1777
1872
  const subscribable = gitHubPullRequestSubscribable({
1778
1873
  canSubscribe,
1779
1874
  number: result.number,
@@ -1847,7 +1942,7 @@ async function gitHubPullRequestStructuredResult(ctx, input, result, subscriptio
1847
1942
  }
1848
1943
  }
1849
1944
  function createGitHubPullRequestTool(ctx, subscriptionConfig) {
1850
- return definePluginTool4({
1945
+ return definePluginTool5({
1851
1946
  annotations: {
1852
1947
  destructiveHint: false,
1853
1948
  idempotentHint: true,
@@ -1966,42 +2061,42 @@ function createGitHubPullRequestTool(ctx, subscriptionConfig) {
1966
2061
 
1967
2062
  // src/tools/get-pull-request.ts
1968
2063
  import {
1969
- definePluginTool as definePluginTool5,
1970
- PluginToolInputError as PluginToolInputError6,
1971
- pluginToolOutputSchema as pluginToolOutputSchema5
2064
+ definePluginTool as definePluginTool6,
2065
+ PluginToolInputError as PluginToolInputError7,
2066
+ pluginToolOutputSchema as pluginToolOutputSchema6
1972
2067
  } from "@sentry/junior-plugin-api";
1973
- import { z as z8 } from "zod";
2068
+ import { z as z9 } from "zod";
1974
2069
  import { subscribableResourceSchema as subscribableResourceSchema4 } from "@sentry/junior-plugin-api";
1975
- var commitShaSchema2 = z8.string().regex(/^[0-9a-f]{40}$/i);
1976
- var inputSchema3 = z8.object({
1977
- repo: z8.string().describe('Repository in "owner/name" format.'),
1978
- number: z8.number().int().positive().describe("Pull request number.")
2070
+ var commitShaSchema2 = z9.string().regex(/^[0-9a-f]{40}$/i);
2071
+ var inputSchema4 = z9.object({
2072
+ repo: z9.string().describe('Repository in "owner/name" format.'),
2073
+ number: z9.number().int().positive().describe("Pull request number.")
1979
2074
  }).strict();
1980
- var pullRequestSchema = z8.object({
1981
- base: z8.string(),
1982
- draft: z8.boolean(),
1983
- head: z8.string(),
2075
+ var pullRequestSchema = z9.object({
2076
+ base: z9.string(),
2077
+ draft: z9.boolean(),
2078
+ head: z9.string(),
1984
2079
  head_sha: commitShaSchema2,
1985
- merged: z8.boolean(),
1986
- number: z8.number(),
1987
- state: z8.string(),
2080
+ merged: z9.boolean(),
2081
+ number: z9.number(),
2082
+ state: z9.string(),
1988
2083
  subscribable: subscribableResourceSchema4.optional(),
1989
- title: z8.string(),
1990
- url: z8.string()
2084
+ title: z9.string(),
2085
+ url: z9.string()
1991
2086
  });
1992
- var outputSchema3 = pluginToolOutputSchema5.merge(
2087
+ var outputSchema4 = pluginToolOutputSchema6.merge(
1993
2088
  pullRequestSchema.extend({
1994
- target: z8.literal("getPullRequest")
2089
+ target: z9.literal("getPullRequest")
1995
2090
  })
1996
2091
  );
1997
- function parseRepo5(value) {
2092
+ function parseRepo6(value) {
1998
2093
  const parts = value.split("/").map((part) => part.trim());
1999
2094
  if (parts.length !== 2 || !parts[0] || !parts[1]) {
2000
- throw new PluginToolInputError6('repo must use "owner/name" format');
2095
+ throw new PluginToolInputError7('repo must use "owner/name" format');
2001
2096
  }
2002
2097
  return { owner: parts[0], name: parts[1], ref: `${parts[0]}/${parts[1]}` };
2003
2098
  }
2004
- async function readJson2(response) {
2099
+ async function readJson3(response) {
2005
2100
  const text2 = await response.text();
2006
2101
  if (!text2) return void 0;
2007
2102
  try {
@@ -2011,7 +2106,7 @@ async function readJson2(response) {
2011
2106
  }
2012
2107
  }
2013
2108
  function createGitHubGetPullRequestTool(ctx) {
2014
- return definePluginTool5({
2109
+ return definePluginTool6({
2015
2110
  annotations: {
2016
2111
  destructiveHint: false,
2017
2112
  idempotentHint: true,
@@ -2019,10 +2114,10 @@ function createGitHubGetPullRequestTool(ctx) {
2019
2114
  readOnlyHint: true
2020
2115
  },
2021
2116
  description: "Get a GitHub pull request. Use this when an existing PR may need event monitoring; the result includes a subscribable hint when GitHub webhooks are configured.",
2022
- inputSchema: inputSchema3,
2023
- outputSchema: outputSchema3,
2117
+ inputSchema: inputSchema4,
2118
+ outputSchema: outputSchema4,
2024
2119
  async execute(input) {
2025
- const repo = parseRepo5(input.repo);
2120
+ const repo = parseRepo6(input.repo);
2026
2121
  const response = await ctx.egress.fetch({
2027
2122
  provider: "github",
2028
2123
  operation: "github.pull.get",
@@ -2036,23 +2131,23 @@ function createGitHubGetPullRequestTool(ctx) {
2036
2131
  }
2037
2132
  )
2038
2133
  });
2039
- const parsed = await readJson2(response);
2134
+ const parsed = await readJson3(response);
2040
2135
  if (!response.ok) {
2041
2136
  const message = `GitHub pull request lookup failed with HTTP ${response.status}`;
2042
2137
  if (response.status === 404) {
2043
- throw new PluginToolInputError6(message);
2138
+ throw new PluginToolInputError7(message);
2044
2139
  }
2045
2140
  throw new Error(message);
2046
2141
  }
2047
- const providerResult = z8.object({
2048
- base: z8.object({ ref: z8.string() }),
2049
- draft: z8.boolean(),
2050
- head: z8.object({ ref: z8.string(), sha: commitShaSchema2 }),
2051
- html_url: z8.string(),
2052
- merged: z8.boolean().optional().default(false),
2053
- number: z8.number(),
2054
- state: z8.string(),
2055
- title: z8.string()
2142
+ const providerResult = z9.object({
2143
+ base: z9.object({ ref: z9.string() }),
2144
+ draft: z9.boolean(),
2145
+ head: z9.object({ ref: z9.string(), sha: commitShaSchema2 }),
2146
+ html_url: z9.string(),
2147
+ merged: z9.boolean().optional().default(false),
2148
+ number: z9.number(),
2149
+ state: z9.string(),
2150
+ title: z9.string()
2056
2151
  }).parse(parsed);
2057
2152
  const subscribable = gitHubPullRequestSubscribable({
2058
2153
  canSubscribe: ctx.events.canSubscribe,
@@ -2092,59 +2187,59 @@ function createGitHubGetPullRequestTool(ctx) {
2092
2187
 
2093
2188
  // src/tools/get-release.ts
2094
2189
  import {
2095
- definePluginTool as definePluginTool6,
2096
- PluginToolInputError as PluginToolInputError7,
2097
- pluginToolOutputSchema as pluginToolOutputSchema6,
2190
+ definePluginTool as definePluginTool7,
2191
+ PluginToolInputError as PluginToolInputError8,
2192
+ pluginToolOutputSchema as pluginToolOutputSchema7,
2098
2193
  subscribableResourceSchema as subscribableResourceSchema5
2099
2194
  } from "@sentry/junior-plugin-api";
2100
- import { z as z9 } from "zod";
2101
- var inputSchema4 = z9.object({
2102
- repo: z9.string().describe('Repository in "owner/name" format.'),
2103
- tag: z9.string().trim().min(1).describe(
2195
+ import { z as z10 } from "zod";
2196
+ var inputSchema5 = z10.object({
2197
+ repo: z10.string().describe('Repository in "owner/name" format.'),
2198
+ tag: z10.string().trim().min(1).describe(
2104
2199
  "Optional release tag name. Omit to inspect and watch every published release in the repository."
2105
2200
  ).optional()
2106
2201
  }).strict();
2107
- var releaseSchema = z9.object({
2108
- created_at: z9.string(),
2109
- draft: z9.boolean(),
2110
- html_url: z9.string(),
2111
- id: z9.number(),
2112
- name: z9.string().nullable(),
2113
- prerelease: z9.boolean(),
2114
- published_at: z9.string().nullable(),
2115
- tag_name: z9.string(),
2116
- target_commitish: z9.string()
2202
+ var releaseSchema = z10.object({
2203
+ created_at: z10.string(),
2204
+ draft: z10.boolean(),
2205
+ html_url: z10.string(),
2206
+ id: z10.number(),
2207
+ name: z10.string().nullable(),
2208
+ prerelease: z10.boolean(),
2209
+ published_at: z10.string().nullable(),
2210
+ tag_name: z10.string(),
2211
+ target_commitish: z10.string()
2117
2212
  }).strict();
2118
- var releaseSourceSchema = z9.object({
2213
+ var releaseSourceSchema = z10.object({
2119
2214
  release: releaseSchema.nullable(),
2120
- repo: z9.string(),
2215
+ repo: z10.string(),
2121
2216
  subscribable: subscribableResourceSchema5.optional(),
2122
- tag: z9.string().nullable()
2217
+ tag: z10.string().nullable()
2123
2218
  }).strict();
2124
- var outputSchema4 = pluginToolOutputSchema6.merge(
2219
+ var outputSchema5 = pluginToolOutputSchema7.merge(
2125
2220
  releaseSourceSchema.extend({
2126
- target: z9.literal("getRelease")
2221
+ target: z10.literal("getRelease")
2127
2222
  })
2128
2223
  );
2129
- var providerReleaseSchema = z9.object({
2130
- created_at: z9.string(),
2131
- draft: z9.boolean(),
2132
- html_url: z9.string(),
2133
- id: z9.number(),
2134
- name: z9.string().nullable(),
2135
- prerelease: z9.boolean(),
2136
- published_at: z9.string().nullable(),
2137
- tag_name: z9.string(),
2138
- target_commitish: z9.string()
2224
+ var providerReleaseSchema = z10.object({
2225
+ created_at: z10.string(),
2226
+ draft: z10.boolean(),
2227
+ html_url: z10.string(),
2228
+ id: z10.number(),
2229
+ name: z10.string().nullable(),
2230
+ prerelease: z10.boolean(),
2231
+ published_at: z10.string().nullable(),
2232
+ tag_name: z10.string(),
2233
+ target_commitish: z10.string()
2139
2234
  }).passthrough();
2140
- function parseRepo6(value) {
2235
+ function parseRepo7(value) {
2141
2236
  const parts = value.split("/").map((part) => part.trim());
2142
2237
  if (parts.length !== 2 || !parts[0] || !parts[1]) {
2143
- throw new PluginToolInputError7('repo must use "owner/name" format');
2238
+ throw new PluginToolInputError8('repo must use "owner/name" format');
2144
2239
  }
2145
2240
  return { owner: parts[0], name: parts[1], ref: `${parts[0]}/${parts[1]}` };
2146
2241
  }
2147
- async function readJson3(response) {
2242
+ async function readJson4(response) {
2148
2243
  const text2 = await response.text();
2149
2244
  if (!text2) return void 0;
2150
2245
  try {
@@ -2170,7 +2265,7 @@ function mapRelease(providerRelease) {
2170
2265
  };
2171
2266
  }
2172
2267
  function createGitHubGetReleaseTool(ctx) {
2173
- return definePluginTool6({
2268
+ return definePluginTool7({
2174
2269
  annotations: {
2175
2270
  destructiveHint: false,
2176
2271
  idempotentHint: true,
@@ -2178,10 +2273,10 @@ function createGitHubGetReleaseTool(ctx) {
2178
2273
  readOnlyHint: true
2179
2274
  },
2180
2275
  description: "Get a GitHub release for an exact repository, optionally limited to one tag. The result remains subscribable when no release exists yet, so use it before waiting for a published release. Omit the tag to watch every published release in the repository.",
2181
- inputSchema: inputSchema4,
2182
- outputSchema: outputSchema4,
2276
+ inputSchema: inputSchema5,
2277
+ outputSchema: outputSchema5,
2183
2278
  async execute(input) {
2184
- const repo = parseRepo6(input.repo);
2279
+ const repo = parseRepo7(input.repo);
2185
2280
  const tag = input.tag?.trim() || void 0;
2186
2281
  let release = null;
2187
2282
  if (tag) {
@@ -2198,7 +2293,7 @@ function createGitHubGetReleaseTool(ctx) {
2198
2293
  }
2199
2294
  )
2200
2295
  });
2201
- const body = await readJson3(response);
2296
+ const body = await readJson4(response);
2202
2297
  if (response.ok) {
2203
2298
  release = mapRelease(providerReleaseSchema.parse(body));
2204
2299
  } else if (response.status !== 404) {
@@ -2217,7 +2312,7 @@ function createGitHubGetReleaseTool(ctx) {
2217
2312
  }
2218
2313
  })
2219
2314
  });
2220
- const body = await readJson3(response);
2315
+ const body = await readJson4(response);
2221
2316
  if (response.ok) {
2222
2317
  release = mapRelease(providerReleaseSchema.parse(body));
2223
2318
  } else if (response.status === 404) {
@@ -2249,36 +2344,36 @@ function createGitHubGetReleaseTool(ctx) {
2249
2344
 
2250
2345
  // src/tools/get-repository.ts
2251
2346
  import {
2252
- definePluginTool as definePluginTool7,
2253
- PluginToolInputError as PluginToolInputError8,
2254
- pluginToolOutputSchema as pluginToolOutputSchema7,
2347
+ definePluginTool as definePluginTool8,
2348
+ PluginToolInputError as PluginToolInputError9,
2349
+ pluginToolOutputSchema as pluginToolOutputSchema8,
2255
2350
  subscribableResourceSchema as subscribableResourceSchema6
2256
2351
  } from "@sentry/junior-plugin-api";
2257
- import { z as z10 } from "zod";
2258
- var inputSchema5 = z10.object({
2259
- repo: z10.string().describe('Repository in "owner/name" format.')
2352
+ import { z as z11 } from "zod";
2353
+ var inputSchema6 = z11.object({
2354
+ repo: z11.string().describe('Repository in "owner/name" format.')
2260
2355
  }).strict();
2261
- var repositorySchema = z10.object({
2262
- default_branch: z10.string(),
2263
- description: z10.string().nullable(),
2264
- full_name: z10.string(),
2265
- private: z10.boolean(),
2356
+ var repositorySchema = z11.object({
2357
+ default_branch: z11.string(),
2358
+ description: z11.string().nullable(),
2359
+ full_name: z11.string(),
2360
+ private: z11.boolean(),
2266
2361
  subscribable: subscribableResourceSchema6.optional(),
2267
- url: z10.string()
2362
+ url: z11.string()
2268
2363
  });
2269
- var outputSchema5 = pluginToolOutputSchema7.merge(
2364
+ var outputSchema6 = pluginToolOutputSchema8.merge(
2270
2365
  repositorySchema.extend({
2271
- target: z10.literal("getRepository")
2366
+ target: z11.literal("getRepository")
2272
2367
  })
2273
2368
  );
2274
- function parseRepo7(value) {
2369
+ function parseRepo8(value) {
2275
2370
  const parts = value.split("/").map((part) => part.trim());
2276
2371
  if (parts.length !== 2 || !parts[0] || !parts[1]) {
2277
- throw new PluginToolInputError8('repo must use "owner/name" format');
2372
+ throw new PluginToolInputError9('repo must use "owner/name" format');
2278
2373
  }
2279
2374
  return { owner: parts[0], name: parts[1] };
2280
2375
  }
2281
- async function readJson4(response) {
2376
+ async function readJson5(response) {
2282
2377
  const text2 = await response.text();
2283
2378
  if (!text2) return void 0;
2284
2379
  try {
@@ -2288,7 +2383,7 @@ async function readJson4(response) {
2288
2383
  }
2289
2384
  }
2290
2385
  function createGitHubGetRepositoryTool(ctx) {
2291
- return definePluginTool7({
2386
+ return definePluginTool8({
2292
2387
  annotations: {
2293
2388
  destructiveHint: false,
2294
2389
  idempotentHint: true,
@@ -2296,10 +2391,10 @@ function createGitHubGetRepositoryTool(ctx) {
2296
2391
  readOnlyHint: true
2297
2392
  },
2298
2393
  description: "Get a GitHub repository. Use this when repository-wide issue activity may need event monitoring; the result includes a subscribable hint when GitHub webhooks are configured.",
2299
- inputSchema: inputSchema5,
2300
- outputSchema: outputSchema5,
2394
+ inputSchema: inputSchema6,
2395
+ outputSchema: outputSchema6,
2301
2396
  async execute(input) {
2302
- const repo = parseRepo7(input.repo);
2397
+ const repo = parseRepo8(input.repo);
2303
2398
  const response = await ctx.egress.fetch({
2304
2399
  provider: "github",
2305
2400
  operation: "github.repository.get",
@@ -2313,18 +2408,18 @@ function createGitHubGetRepositoryTool(ctx) {
2313
2408
  }
2314
2409
  )
2315
2410
  });
2316
- const parsed = await readJson4(response);
2411
+ const parsed = await readJson5(response);
2317
2412
  if (!response.ok) {
2318
- throw new PluginToolInputError8(
2413
+ throw new PluginToolInputError9(
2319
2414
  `GitHub repository lookup failed with HTTP ${response.status}`
2320
2415
  );
2321
2416
  }
2322
- const providerResult = z10.object({
2323
- default_branch: z10.string(),
2324
- description: z10.string().nullable(),
2325
- full_name: z10.string(),
2326
- html_url: z10.string(),
2327
- private: z10.boolean()
2417
+ const providerResult = z11.object({
2418
+ default_branch: z11.string(),
2419
+ description: z11.string().nullable(),
2420
+ full_name: z11.string(),
2421
+ html_url: z11.string(),
2422
+ private: z11.boolean()
2328
2423
  }).parse(parsed);
2329
2424
  const subscribable = gitHubRepositorySubscribable({
2330
2425
  canSubscribe: ctx.events.canSubscribe,
@@ -2348,27 +2443,27 @@ function createGitHubGetRepositoryTool(ctx) {
2348
2443
 
2349
2444
  // src/tools/get-status.ts
2350
2445
  import {
2351
- definePluginTool as definePluginTool8,
2352
- pluginToolOutputSchema as pluginToolOutputSchema8
2446
+ definePluginTool as definePluginTool9,
2447
+ pluginToolOutputSchema as pluginToolOutputSchema9
2353
2448
  } from "@sentry/junior-plugin-api";
2354
- import { z as z12 } from "zod";
2449
+ import { z as z13 } from "zod";
2355
2450
 
2356
2451
  // src/github-status.ts
2357
- import { z as z11 } from "zod";
2452
+ import { z as z12 } from "zod";
2358
2453
  var GITHUB_STATUS_INCIDENTS_URL = "https://www.githubstatus.com/api/v2/incidents.json";
2359
2454
  var GITHUB_STATUS_TTL_MS = 60 * 1e3;
2360
2455
  var GITHUB_STATUS_TIMEOUT_MS = 5e3;
2361
- var incidentsResponseSchema = z11.object({
2362
- incidents: z11.array(
2363
- z11.object({
2364
- components: z11.array(z11.object({ name: z11.string() })).default([]),
2365
- created_at: z11.string(),
2366
- impact: z11.string(),
2367
- name: z11.string(),
2368
- resolved_at: z11.string().nullable(),
2369
- shortlink: z11.string(),
2370
- started_at: z11.string().nullable().optional(),
2371
- status: z11.string()
2456
+ var incidentsResponseSchema = z12.object({
2457
+ incidents: z12.array(
2458
+ z12.object({
2459
+ components: z12.array(z12.object({ name: z12.string() })).default([]),
2460
+ created_at: z12.string(),
2461
+ impact: z12.string(),
2462
+ name: z12.string(),
2463
+ resolved_at: z12.string().nullable(),
2464
+ shortlink: z12.string(),
2465
+ started_at: z12.string().nullable().optional(),
2466
+ status: z12.string()
2372
2467
  })
2373
2468
  )
2374
2469
  });
@@ -2410,22 +2505,22 @@ async function loadGitHubStatusIncidents(cache, withinMs) {
2410
2505
 
2411
2506
  // src/tools/get-status.ts
2412
2507
  var RECENT_INCIDENT_MS = 24 * 60 * 60 * 1e3;
2413
- var inputSchema6 = z12.object({}).strict();
2414
- var incidentSchema = z12.object({
2415
- components: z12.array(z12.string()),
2416
- impact: z12.string(),
2417
- name: z12.string(),
2418
- resolved_at: z12.string().optional(),
2419
- started_at: z12.string(),
2420
- status: z12.string(),
2421
- url: z12.string()
2508
+ var inputSchema7 = z13.object({}).strict();
2509
+ var incidentSchema = z13.object({
2510
+ components: z13.array(z13.string()),
2511
+ impact: z13.string(),
2512
+ name: z13.string(),
2513
+ resolved_at: z13.string().optional(),
2514
+ started_at: z13.string(),
2515
+ status: z13.string(),
2516
+ url: z13.string()
2422
2517
  });
2423
- var outputSchema6 = pluginToolOutputSchema8.extend({
2424
- target: z12.literal("getStatus"),
2425
- incidents: z12.array(incidentSchema)
2518
+ var outputSchema7 = pluginToolOutputSchema9.extend({
2519
+ target: z13.literal("getStatus"),
2520
+ incidents: z13.array(incidentSchema)
2426
2521
  });
2427
2522
  function createGitHubGetStatusTool(ctx) {
2428
- return definePluginTool8({
2523
+ return definePluginTool9({
2429
2524
  annotations: {
2430
2525
  destructiveHint: false,
2431
2526
  idempotentHint: true,
@@ -2433,8 +2528,8 @@ function createGitHubGetStatusTool(ctx) {
2433
2528
  readOnlyHint: true
2434
2529
  },
2435
2530
  description: "List GitHub incidents from githubstatus.com that are open or were resolved in the last 24 hours, with their affected components. Use when a GitHub request fails with a 5xx, a timeout, or a dropped connection, or when checks stay queued or fail with no cause in the logs.",
2436
- inputSchema: inputSchema6,
2437
- outputSchema: outputSchema6,
2531
+ inputSchema: inputSchema7,
2532
+ outputSchema: outputSchema7,
2438
2533
  async execute() {
2439
2534
  const incidents = await loadGitHubStatusIncidents(
2440
2535
  ctx.cache,
@@ -2457,49 +2552,49 @@ function createGitHubGetStatusTool(ctx) {
2457
2552
 
2458
2553
  // src/tools/update-issue.ts
2459
2554
  import {
2460
- definePluginTool as definePluginTool9,
2461
- PluginToolInputError as PluginToolInputError9,
2462
- pluginToolOutputSchema as pluginToolOutputSchema9,
2555
+ definePluginTool as definePluginTool10,
2556
+ PluginToolInputError as PluginToolInputError10,
2557
+ pluginToolOutputSchema as pluginToolOutputSchema10,
2463
2558
  subscribableResourceSchema as subscribableResourceSchema7
2464
2559
  } from "@sentry/junior-plugin-api";
2465
- import { z as z13 } from "zod";
2466
- var inputSchema7 = z13.object({
2467
- repo: z13.string().describe('Repository in "owner/name" format.'),
2468
- number: z13.number().int().positive().describe("Issue number."),
2469
- title: z13.string().trim().min(1).optional().describe("Replacement issue title."),
2470
- body: z13.string().optional().describe(
2560
+ import { z as z14 } from "zod";
2561
+ var inputSchema8 = z14.object({
2562
+ repo: z14.string().describe('Repository in "owner/name" format.'),
2563
+ number: z14.number().int().positive().describe("Issue number."),
2564
+ title: z14.string().trim().min(1).optional().describe("Replacement issue title."),
2565
+ body: z14.string().optional().describe(
2471
2566
  "Replacement issue body. The runtime appends requester attribution and the conversation footer."
2472
2567
  ),
2473
- state: z13.enum(["open", "closed"]).optional().describe("Replacement issue state.")
2568
+ state: z14.enum(["open", "closed"]).optional().describe("Replacement issue state.")
2474
2569
  }).strict().refine(
2475
2570
  ({ title, body, state }) => title !== void 0 || body !== void 0 || state !== void 0,
2476
2571
  { message: "At least one issue field must be provided." }
2477
2572
  );
2478
- var issueSchema = z13.object({
2479
- body: z13.string().nullable(),
2480
- number: z13.number(),
2481
- state: z13.string(),
2573
+ var issueSchema = z14.object({
2574
+ body: z14.string().nullable(),
2575
+ number: z14.number(),
2576
+ state: z14.string(),
2482
2577
  subscribable: subscribableResourceSchema7.optional(),
2483
- title: z13.string(),
2484
- url: z13.string()
2578
+ title: z14.string(),
2579
+ url: z14.string()
2485
2580
  });
2486
- var outputSchema7 = pluginToolOutputSchema9.merge(
2581
+ var outputSchema8 = pluginToolOutputSchema10.merge(
2487
2582
  issueSchema.extend({
2488
- target: z13.literal("updateIssue")
2583
+ target: z14.literal("updateIssue")
2489
2584
  })
2490
2585
  );
2491
2586
  function nonEmptyString4(value, name) {
2492
- if (!value?.trim()) throw new PluginToolInputError9(`${name} is required`);
2587
+ if (!value?.trim()) throw new PluginToolInputError10(`${name} is required`);
2493
2588
  return value.trim();
2494
2589
  }
2495
- function parseRepo8(value) {
2590
+ function parseRepo9(value) {
2496
2591
  const parts = value.split("/").map((part) => part.trim());
2497
2592
  if (parts.length !== 2 || !parts[0] || !parts[1]) {
2498
- throw new PluginToolInputError9('repo must use "owner/name" format');
2593
+ throw new PluginToolInputError10('repo must use "owner/name" format');
2499
2594
  }
2500
2595
  return { owner: parts[0], name: parts[1], ref: `${parts[0]}/${parts[1]}` };
2501
2596
  }
2502
- async function readJson5(response) {
2597
+ async function readJson6(response) {
2503
2598
  const text2 = await response.text();
2504
2599
  if (!text2) return void 0;
2505
2600
  try {
@@ -2517,7 +2612,7 @@ function githubApiErrorMessage3(payload) {
2517
2612
  return "GitHub request failed";
2518
2613
  }
2519
2614
  function createGitHubUpdateIssueTool(ctx) {
2520
- return definePluginTool9({
2615
+ return definePluginTool10({
2521
2616
  annotations: {
2522
2617
  destructiveHint: true,
2523
2618
  idempotentHint: true,
@@ -2525,17 +2620,17 @@ function createGitHubUpdateIssueTool(ctx) {
2525
2620
  readOnlyHint: false
2526
2621
  },
2527
2622
  description: "Update an existing GitHub issue's title, body, or open/closed state. Use this instead of raw GitHub API calls when changing issue metadata.",
2528
- inputSchema: inputSchema7,
2529
- outputSchema: outputSchema7,
2623
+ inputSchema: inputSchema8,
2624
+ outputSchema: outputSchema8,
2530
2625
  async execute(input) {
2531
- const parsedInput = inputSchema7.safeParse(input);
2626
+ const parsedInput = inputSchema8.safeParse(input);
2532
2627
  if (!parsedInput.success) {
2533
- throw new PluginToolInputError9("Invalid GitHub updateIssue input.", {
2628
+ throw new PluginToolInputError10("Invalid GitHub updateIssue input.", {
2534
2629
  cause: parsedInput.error
2535
2630
  });
2536
2631
  }
2537
2632
  const update = parsedInput.data;
2538
- const repo = parseRepo8(update.repo);
2633
+ const repo = parseRepo9(update.repo);
2539
2634
  const payload = {
2540
2635
  ...update.title !== void 0 ? { title: update.title } : void 0,
2541
2636
  ...update.body !== void 0 ? {
@@ -2567,18 +2662,18 @@ function createGitHubUpdateIssueTool(ctx) {
2567
2662
  }
2568
2663
  )
2569
2664
  });
2570
- const parsed = await readJson5(response);
2665
+ const parsed = await readJson6(response);
2571
2666
  if (!response.ok) {
2572
2667
  throw new Error(
2573
2668
  `GitHub issue update failed with HTTP ${response.status}: ${githubApiErrorMessage3(parsed)}`
2574
2669
  );
2575
2670
  }
2576
- const providerResult = z13.object({
2577
- body: z13.string().nullable().optional().default(null),
2578
- html_url: z13.string(),
2579
- number: z13.number(),
2580
- state: z13.string(),
2581
- title: z13.string()
2671
+ const providerResult = z14.object({
2672
+ body: z14.string().nullable().optional().default(null),
2673
+ html_url: z14.string(),
2674
+ number: z14.number(),
2675
+ state: z14.string(),
2676
+ title: z14.string()
2582
2677
  }).parse(parsed);
2583
2678
  const subscribable = gitHubIssueSubscribable({
2584
2679
  canSubscribe: ctx.events.canSubscribe,
@@ -2611,22 +2706,22 @@ function createGitHubUpdateIssueTool(ctx) {
2611
2706
 
2612
2707
  // src/tools/update-pull-request.ts
2613
2708
  import {
2614
- definePluginTool as definePluginTool10,
2615
- PluginToolInputError as PluginToolInputError10,
2616
- pluginToolOutputSchema as pluginToolOutputSchema10
2709
+ definePluginTool as definePluginTool11,
2710
+ PluginToolInputError as PluginToolInputError11,
2711
+ pluginToolOutputSchema as pluginToolOutputSchema11
2617
2712
  } from "@sentry/junior-plugin-api";
2618
- import { z as z14 } from "zod";
2713
+ import { z as z15 } from "zod";
2619
2714
  import { subscribableResourceSchema as subscribableResourceSchema8 } from "@sentry/junior-plugin-api";
2620
- var inputSchema8 = z14.object({
2621
- repo: z14.string().describe('Repository in "owner/name" format.'),
2622
- number: z14.number().int().positive().describe("Pull request number."),
2623
- title: z14.string().trim().min(1).optional().describe("Replacement pull request title."),
2624
- body: z14.string().optional().describe(
2715
+ var inputSchema9 = z15.object({
2716
+ repo: z15.string().describe('Repository in "owner/name" format.'),
2717
+ number: z15.number().int().positive().describe("Pull request number."),
2718
+ title: z15.string().trim().min(1).optional().describe("Replacement pull request title."),
2719
+ body: z15.string().optional().describe(
2625
2720
  "Replacement pull request body. The runtime appends requester attribution and the conversation footer."
2626
2721
  ),
2627
- base: z14.string().trim().min(1).optional().describe("Replacement base branch."),
2628
- state: z14.enum(["open", "closed"]).optional().describe("Replacement pull request state."),
2629
- draft: z14.boolean().optional().describe(
2722
+ base: z15.string().trim().min(1).optional().describe("Replacement base branch."),
2723
+ state: z15.enum(["open", "closed"]).optional().describe("Replacement pull request state."),
2724
+ draft: z15.boolean().optional().describe(
2630
2725
  "Set false to mark a draft pull request ready for review, or true to convert it back to a draft."
2631
2726
  )
2632
2727
  }).strict().refine(
@@ -2641,43 +2736,43 @@ var CONVERT_TO_DRAFT = {
2641
2736
  operationName: "ConvertPullRequestToDraft",
2642
2737
  query: "mutation ConvertPullRequestToDraft($id: ID!) { result: convertPullRequestToDraft(input: {pullRequestId: $id}) { pullRequest { isDraft } } }"
2643
2738
  };
2644
- var draftMutationResponseSchema = z14.object({
2645
- data: z14.object({
2646
- result: z14.object({ pullRequest: z14.object({ isDraft: z14.boolean() }) })
2739
+ var draftMutationResponseSchema = z15.object({
2740
+ data: z15.object({
2741
+ result: z15.object({ pullRequest: z15.object({ isDraft: z15.boolean() }) })
2647
2742
  })
2648
2743
  });
2649
- var graphqlErrorsSchema = z14.object({
2650
- errors: z14.array(z14.object({ message: z14.string() })).min(1)
2744
+ var graphqlErrorsSchema = z15.object({
2745
+ errors: z15.array(z15.object({ message: z15.string() })).min(1)
2651
2746
  });
2652
- var pullRequestSchema2 = z14.object({
2653
- base: z14.string(),
2654
- body: z14.string().nullable(),
2655
- draft: z14.boolean(),
2656
- number: z14.number(),
2657
- state: z14.string(),
2747
+ var pullRequestSchema2 = z15.object({
2748
+ base: z15.string(),
2749
+ body: z15.string().nullable(),
2750
+ draft: z15.boolean(),
2751
+ number: z15.number(),
2752
+ state: z15.string(),
2658
2753
  subscribable: subscribableResourceSchema8.optional(),
2659
- title: z14.string(),
2660
- url: z14.string()
2754
+ title: z15.string(),
2755
+ url: z15.string()
2661
2756
  });
2662
- var outputSchema8 = pluginToolOutputSchema10.merge(
2757
+ var outputSchema9 = pluginToolOutputSchema11.merge(
2663
2758
  pullRequestSchema2.extend({
2664
- target: z14.literal("updatePullRequest")
2759
+ target: z15.literal("updatePullRequest")
2665
2760
  })
2666
2761
  );
2667
2762
  function nonEmptyString5(value, name) {
2668
2763
  if (!value?.trim()) {
2669
- throw new PluginToolInputError10(`${name} is required`);
2764
+ throw new PluginToolInputError11(`${name} is required`);
2670
2765
  }
2671
2766
  return value.trim();
2672
2767
  }
2673
- function parseRepo9(value) {
2768
+ function parseRepo10(value) {
2674
2769
  const parts = value.split("/").map((part) => part.trim());
2675
2770
  if (parts.length !== 2 || !parts[0] || !parts[1]) {
2676
- throw new PluginToolInputError10('repo must use "owner/name" format');
2771
+ throw new PluginToolInputError11('repo must use "owner/name" format');
2677
2772
  }
2678
2773
  return { owner: parts[0], name: parts[1], ref: `${parts[0]}/${parts[1]}` };
2679
2774
  }
2680
- async function readJson6(response) {
2775
+ async function readJson7(response) {
2681
2776
  const text2 = await response.text();
2682
2777
  if (!text2) return void 0;
2683
2778
  try {
@@ -2709,7 +2804,7 @@ async function setPullRequestDraft(input) {
2709
2804
  })
2710
2805
  })
2711
2806
  });
2712
- const payload = await readJson6(response);
2807
+ const payload = await readJson7(response);
2713
2808
  const isDraft = draftMutationResponseSchema.safeParse(payload).data?.data.result.pullRequest.isDraft;
2714
2809
  if (!response.ok || isDraft !== input.draft) {
2715
2810
  throw new Error(
@@ -2723,7 +2818,7 @@ function githubGraphqlErrorMessage(payload) {
2723
2818
  return result.success ? result.data.errors.map((error) => error.message).join("; ") : githubApiErrorMessage4(payload);
2724
2819
  }
2725
2820
  function createGitHubUpdatePullRequestTool(ctx) {
2726
- return definePluginTool10({
2821
+ return definePluginTool11({
2727
2822
  annotations: {
2728
2823
  destructiveHint: true,
2729
2824
  idempotentHint: true,
@@ -2731,18 +2826,18 @@ function createGitHubUpdatePullRequestTool(ctx) {
2731
2826
  readOnlyHint: false
2732
2827
  },
2733
2828
  description: "Update an existing GitHub pull request's title, body, base branch, open/closed state, or draft state. Use this instead of raw GitHub API calls when changing PR metadata or marking a PR ready for review.",
2734
- inputSchema: inputSchema8,
2735
- outputSchema: outputSchema8,
2829
+ inputSchema: inputSchema9,
2830
+ outputSchema: outputSchema9,
2736
2831
  async execute(input) {
2737
- const parsedInput = inputSchema8.safeParse(input);
2832
+ const parsedInput = inputSchema9.safeParse(input);
2738
2833
  if (!parsedInput.success) {
2739
- throw new PluginToolInputError10(
2834
+ throw new PluginToolInputError11(
2740
2835
  "Invalid GitHub updatePullRequest input.",
2741
2836
  { cause: parsedInput.error }
2742
2837
  );
2743
2838
  }
2744
2839
  const update = parsedInput.data;
2745
- const repo = parseRepo9(update.repo);
2840
+ const repo = parseRepo10(update.repo);
2746
2841
  const requester = await resolveGitHubRequester(ctx);
2747
2842
  const payload = {
2748
2843
  ...update.title !== void 0 ? { title: update.title } : void 0,
@@ -2771,22 +2866,22 @@ function createGitHubUpdatePullRequestTool(ctx) {
2771
2866
  ...hasRestUpdate ? { body: JSON.stringify(payload) } : void 0
2772
2867
  })
2773
2868
  });
2774
- const parsed = await readJson6(response);
2869
+ const parsed = await readJson7(response);
2775
2870
  if (!response.ok) {
2776
2871
  throw new Error(
2777
2872
  `GitHub pull request update failed with HTTP ${response.status}: ${githubApiErrorMessage4(parsed)}`
2778
2873
  );
2779
2874
  }
2780
- const providerResult = z14.object({
2781
- base: z14.object({ ref: z14.string() }),
2782
- body: z14.string().nullable().optional().default(null),
2783
- draft: z14.boolean(),
2784
- html_url: z14.string(),
2785
- merged: z14.boolean(),
2786
- node_id: z14.string().optional(),
2787
- number: z14.number(),
2788
- state: z14.string(),
2789
- title: z14.string()
2875
+ const providerResult = z15.object({
2876
+ base: z15.object({ ref: z15.string() }),
2877
+ body: z15.string().nullable().optional().default(null),
2878
+ draft: z15.boolean(),
2879
+ html_url: z15.string(),
2880
+ merged: z15.boolean(),
2881
+ node_id: z15.string().optional(),
2882
+ number: z15.number(),
2883
+ state: z15.string(),
2884
+ title: z15.string()
2790
2885
  }).parse(parsed);
2791
2886
  if (update.draft !== void 0 && update.draft !== providerResult.draft) {
2792
2887
  if (!providerResult.node_id) {
@@ -2847,11 +2942,11 @@ function createGitHubUpdatePullRequestTool(ctx) {
2847
2942
 
2848
2943
  // src/tools/update-pull-request-feedback.ts
2849
2944
  import {
2850
- definePluginTool as definePluginTool11,
2851
- PluginToolInputError as PluginToolInputError11,
2852
- pluginToolOutputSchema as pluginToolOutputSchema11
2945
+ definePluginTool as definePluginTool12,
2946
+ PluginToolInputError as PluginToolInputError12,
2947
+ pluginToolOutputSchema as pluginToolOutputSchema12
2853
2948
  } from "@sentry/junior-plugin-api";
2854
- import { z as z15 } from "zod";
2949
+ import { z as z16 } from "zod";
2855
2950
  var STATUS_TO_REACTION_CONTENT = {
2856
2951
  reviewing: "eyes",
2857
2952
  addressed: "+1",
@@ -2860,29 +2955,29 @@ var STATUS_TO_REACTION_CONTENT = {
2860
2955
  var FEEDBACK_REACTION_CONTENTS = new Set(
2861
2956
  Object.values(STATUS_TO_REACTION_CONTENT)
2862
2957
  );
2863
- var inputSchema9 = z15.object({
2864
- repo: z15.string().describe('Repository in "owner/name" format.'),
2865
- comment_kind: z15.enum(["conversation", "review"]).describe(
2958
+ var inputSchema10 = z16.object({
2959
+ repo: z16.string().describe('Repository in "owner/name" format.'),
2960
+ comment_kind: z16.enum(["conversation", "review"]).describe(
2866
2961
  'Comment kind: "conversation" for a pull request conversation comment, "review" for an inline review comment.'
2867
2962
  ),
2868
- comment_id: z15.number().int().positive().describe(
2963
+ comment_id: z16.number().int().positive().describe(
2869
2964
  "GitHub comment id (conversation comment id or inline review comment id)."
2870
2965
  ),
2871
- status: z15.enum(["addressed", "declined"]).describe(
2966
+ status: z16.enum(["addressed", "declined"]).describe(
2872
2967
  "Feedback outcome. Maps to a reaction: addressed -> +1, declined -> -1."
2873
2968
  )
2874
2969
  }).strict();
2875
- var outputSchema9 = pluginToolOutputSchema11.extend({
2876
- target: z15.literal("updatePullRequestFeedback"),
2877
- repo: z15.string(),
2878
- comment_id: z15.number(),
2879
- status: z15.enum(["addressed", "declined"]),
2880
- reaction_id: z15.number()
2970
+ var outputSchema10 = pluginToolOutputSchema12.extend({
2971
+ target: z16.literal("updatePullRequestFeedback"),
2972
+ repo: z16.string(),
2973
+ comment_id: z16.number(),
2974
+ status: z16.enum(["addressed", "declined"]),
2975
+ reaction_id: z16.number()
2881
2976
  });
2882
- function parseRepo10(value) {
2977
+ function parseRepo11(value) {
2883
2978
  const parts = value.split("/").map((part) => part.trim());
2884
2979
  if (parts.length !== 2 || !parts[0] || !parts[1]) {
2885
- throw new PluginToolInputError11('repo must use "owner/name" format');
2980
+ throw new PluginToolInputError12('repo must use "owner/name" format');
2886
2981
  }
2887
2982
  return { owner: parts[0], name: parts[1], ref: `${parts[0]}/${parts[1]}` };
2888
2983
  }
@@ -2896,7 +2991,7 @@ function pullRequestCommentReactionsPath(input) {
2896
2991
  function pullRequestFeedbackReactionContent(status) {
2897
2992
  return STATUS_TO_REACTION_CONTENT[status];
2898
2993
  }
2899
- async function readJson7(response) {
2994
+ async function readJson8(response) {
2900
2995
  const text2 = await response.text();
2901
2996
  if (!text2) return void 0;
2902
2997
  try {
@@ -2905,17 +3000,17 @@ async function readJson7(response) {
2905
3000
  return text2;
2906
3001
  }
2907
3002
  }
2908
- function githubError(payload) {
3003
+ function githubError2(payload) {
2909
3004
  if (payload && typeof payload === "object" && !Array.isArray(payload)) {
2910
3005
  const message = payload.message;
2911
3006
  if (typeof message === "string" && message.trim()) return message.trim();
2912
3007
  }
2913
3008
  return "GitHub request failed";
2914
3009
  }
2915
- var reactionSchema = z15.object({
2916
- id: z15.number(),
2917
- content: z15.string(),
2918
- user: z15.object({ id: z15.number() }).nullable()
3010
+ var reactionSchema = z16.object({
3011
+ id: z16.number(),
3012
+ content: z16.string(),
3013
+ user: z16.object({ id: z16.number() }).nullable()
2919
3014
  });
2920
3015
  async function assertBotAuthoredPullRequest(egress, input) {
2921
3016
  const headers = {
@@ -2930,15 +3025,15 @@ async function assertBotAuthoredPullRequest(egress, input) {
2930
3025
  { headers }
2931
3026
  )
2932
3027
  });
2933
- const commentPayload = await readJson7(commentResponse);
3028
+ const commentPayload = await readJson8(commentResponse);
2934
3029
  if (!commentResponse.ok) {
2935
- const message = `GitHub comment lookup failed with HTTP ${commentResponse.status}: ${githubError(commentPayload)}`;
2936
- if (commentResponse.status === 404) throw new PluginToolInputError11(message);
3030
+ const message = `GitHub comment lookup failed with HTTP ${commentResponse.status}: ${githubError2(commentPayload)}`;
3031
+ if (commentResponse.status === 404) throw new PluginToolInputError12(message);
2937
3032
  throw new Error(message);
2938
3033
  }
2939
- const comment = z15.object({
2940
- issue_url: z15.string().optional(),
2941
- pull_request_url: z15.string().optional()
3034
+ const comment = z16.object({
3035
+ issue_url: z16.string().optional(),
3036
+ pull_request_url: z16.string().optional()
2942
3037
  }).safeParse(commentPayload);
2943
3038
  const parentUrl = comment.success ? input.commentKind === "conversation" ? comment.data.issue_url : comment.data.pull_request_url : void 0;
2944
3039
  const number = /\/(?:issues|pulls)\/(\d+)$/.exec(parentUrl ?? "")?.[1];
@@ -2953,21 +3048,21 @@ async function assertBotAuthoredPullRequest(egress, input) {
2953
3048
  { headers }
2954
3049
  )
2955
3050
  });
2956
- const pullPayload = await readJson7(pullResponse);
3051
+ const pullPayload = await readJson8(pullResponse);
2957
3052
  if (!pullResponse.ok && pullResponse.status !== 404) {
2958
3053
  throw new Error(
2959
- `GitHub pull request lookup failed with HTTP ${pullResponse.status}: ${githubError(pullPayload)}`
3054
+ `GitHub pull request lookup failed with HTTP ${pullResponse.status}: ${githubError2(pullPayload)}`
2960
3055
  );
2961
3056
  }
2962
- const pull = z15.object({ user: z15.object({ id: z15.number() }).nullable() }).safeParse(pullPayload);
3057
+ const pull = z16.object({ user: z16.object({ id: z16.number() }).nullable() }).safeParse(pullPayload);
2963
3058
  if (!pullResponse.ok || !pull.success || pull.data.user?.id !== input.botUserId) {
2964
- throw new PluginToolInputError11(
3059
+ throw new PluginToolInputError12(
2965
3060
  "This bot can only set feedback status on comments on pull requests it authored."
2966
3061
  );
2967
3062
  }
2968
3063
  }
2969
3064
  function createGitHubUpdatePullRequestFeedbackTool(ctx, botEmail) {
2970
- return definePluginTool11({
3065
+ return definePluginTool12({
2971
3066
  // No action review: the tool checks in code that the bot authored the pull
2972
3067
  // request, and it changes only the bot's own reaction, which is reversible.
2973
3068
  approvalMode: "approve",
@@ -2979,12 +3074,12 @@ function createGitHubUpdatePullRequestFeedbackTool(ctx, botEmail) {
2979
3074
  },
2980
3075
  description: "Set your outcome reaction on GitHub pull request feedback: addressed (+1) or declined (-1). Use the comment_id and comment_kind from the event after acting on the feedback. Replaces only your prior status reaction on that comment. Only works on pull requests the bot authored.",
2981
3076
  exposure: "direct",
2982
- inputSchema: inputSchema9,
2983
- outputSchema: outputSchema9,
3077
+ inputSchema: inputSchema10,
3078
+ outputSchema: outputSchema10,
2984
3079
  async execute(input) {
2985
- const parsedInput = inputSchema9.safeParse(input);
3080
+ const parsedInput = inputSchema10.safeParse(input);
2986
3081
  if (!parsedInput.success) {
2987
- throw new PluginToolInputError11(
3082
+ throw new PluginToolInputError12(
2988
3083
  "Invalid GitHub updatePullRequestFeedback input.",
2989
3084
  { cause: parsedInput.error }
2990
3085
  );
@@ -2994,7 +3089,7 @@ function createGitHubUpdatePullRequestFeedbackTool(ctx, botEmail) {
2994
3089
  comment_kind: commentKind,
2995
3090
  status
2996
3091
  } = parsedInput.data;
2997
- const repo = parseRepo10(parsedInput.data.repo);
3092
+ const repo = parseRepo11(parsedInput.data.repo);
2998
3093
  const botUserId = botUserIdFromEmail(botEmail);
2999
3094
  if (botUserId === void 0) {
3000
3095
  throw new Error("GitHub App bot identity is not configured.");
@@ -3020,13 +3115,13 @@ function createGitHubUpdatePullRequestFeedbackTool(ctx, botEmail) {
3020
3115
  headers: { Accept: "application/vnd.github+json" }
3021
3116
  })
3022
3117
  });
3023
- const listPayload = await readJson7(listResponse);
3118
+ const listPayload = await readJson8(listResponse);
3024
3119
  if (!listResponse.ok) {
3025
3120
  throw new Error(
3026
- `GitHub reaction lookup failed with HTTP ${listResponse.status}: ${githubError(listPayload)}`
3121
+ `GitHub reaction lookup failed with HTTP ${listResponse.status}: ${githubError2(listPayload)}`
3027
3122
  );
3028
3123
  }
3029
- const botReactions = z15.array(reactionSchema).parse(listPayload).filter(
3124
+ const botReactions = z16.array(reactionSchema).parse(listPayload).filter(
3030
3125
  (reaction) => reaction.user?.id === botUserId && FEEDBACK_REACTION_CONTENTS.has(reaction.content)
3031
3126
  );
3032
3127
  const existing = botReactions.find(
@@ -3042,9 +3137,9 @@ function createGitHubUpdatePullRequestFeedbackTool(ctx, botEmail) {
3042
3137
  })
3043
3138
  });
3044
3139
  if (!deleteResponse.ok && deleteResponse.status !== 404) {
3045
- const deletePayload = await readJson7(deleteResponse);
3140
+ const deletePayload = await readJson8(deleteResponse);
3046
3141
  throw new Error(
3047
- `GitHub reaction removal failed with HTTP ${deleteResponse.status}: ${githubError(deletePayload)}`
3142
+ `GitHub reaction removal failed with HTTP ${deleteResponse.status}: ${githubError2(deletePayload)}`
3048
3143
  );
3049
3144
  }
3050
3145
  }
@@ -3069,10 +3164,10 @@ function createGitHubUpdatePullRequestFeedbackTool(ctx, botEmail) {
3069
3164
  body: JSON.stringify({ content: targetContent })
3070
3165
  })
3071
3166
  });
3072
- const createPayload = await readJson7(createResponse);
3167
+ const createPayload = await readJson8(createResponse);
3073
3168
  if (!createResponse.ok) {
3074
3169
  throw new Error(
3075
- `GitHub reaction creation failed with HTTP ${createResponse.status}: ${githubError(createPayload)}`
3170
+ `GitHub reaction creation failed with HTTP ${createResponse.status}: ${githubError2(createPayload)}`
3076
3171
  );
3077
3172
  }
3078
3173
  const created = reactionSchema.parse(createPayload);
@@ -3089,34 +3184,34 @@ function createGitHubUpdatePullRequestFeedbackTool(ctx, botEmail) {
3089
3184
 
3090
3185
  // src/tools/resolve-pull-request-review-thread.ts
3091
3186
  import {
3092
- definePluginTool as definePluginTool12,
3093
- PluginToolInputError as PluginToolInputError12,
3094
- pluginToolOutputSchema as pluginToolOutputSchema12
3187
+ definePluginTool as definePluginTool13,
3188
+ PluginToolInputError as PluginToolInputError13,
3189
+ pluginToolOutputSchema as pluginToolOutputSchema13
3095
3190
  } from "@sentry/junior-plugin-api";
3096
- import { z as z16 } from "zod";
3097
- var inputSchema10 = z16.object({
3098
- repo: z16.string().describe(
3191
+ import { z as z17 } from "zod";
3192
+ var inputSchema11 = z17.object({
3193
+ repo: z17.string().describe(
3099
3194
  'Repository in "owner/name" format. Required because GraphQL has no repo path.'
3100
3195
  ),
3101
- thread_id: z16.string().trim().min(1).describe(
3196
+ thread_id: z17.string().trim().min(1).describe(
3102
3197
  "GitHub pull request review thread node ID (the `threadId` / `id` variable used by `gh api graphql` resolveReviewThread)."
3103
3198
  )
3104
3199
  }).strict();
3105
- var outputSchema10 = pluginToolOutputSchema12.extend({
3106
- target: z16.literal("resolvePullRequestReviewThread"),
3107
- repo: z16.string(),
3108
- number: z16.number(),
3109
- thread_id: z16.string(),
3110
- resolved: z16.boolean()
3200
+ var outputSchema11 = pluginToolOutputSchema13.extend({
3201
+ target: z17.literal("resolvePullRequestReviewThread"),
3202
+ repo: z17.string(),
3203
+ number: z17.number(),
3204
+ thread_id: z17.string(),
3205
+ resolved: z17.boolean()
3111
3206
  });
3112
- function parseRepo11(value) {
3207
+ function parseRepo12(value) {
3113
3208
  const parts = value.split("/").map((part) => part.trim());
3114
3209
  if (parts.length !== 2 || !parts[0] || !parts[1]) {
3115
- throw new PluginToolInputError12('repo must use "owner/name" format');
3210
+ throw new PluginToolInputError13('repo must use "owner/name" format');
3116
3211
  }
3117
3212
  return { owner: parts[0], name: parts[1], ref: `${parts[0]}/${parts[1]}` };
3118
3213
  }
3119
- async function readJson8(response) {
3214
+ async function readJson9(response) {
3120
3215
  const text2 = await response.text();
3121
3216
  if (!text2) return void 0;
3122
3217
  try {
@@ -3125,7 +3220,7 @@ async function readJson8(response) {
3125
3220
  return text2;
3126
3221
  }
3127
3222
  }
3128
- function githubError2(payload) {
3223
+ function githubError3(payload) {
3129
3224
  if (payload && typeof payload === "object" && !Array.isArray(payload)) {
3130
3225
  const message = payload.message;
3131
3226
  if (typeof message === "string" && message.trim()) return message.trim();
@@ -3133,7 +3228,7 @@ function githubError2(payload) {
3133
3228
  return "GitHub request failed";
3134
3229
  }
3135
3230
  function createGitHubResolvePullRequestReviewThreadTool(ctx, botEmail) {
3136
- return definePluginTool12({
3231
+ return definePluginTool13({
3137
3232
  // No action review: the tool checks in code that the bot authored the pull
3138
3233
  // request, and it changes only the thread's resolved state, which is
3139
3234
  // reversible.
@@ -3146,17 +3241,17 @@ function createGitHubResolvePullRequestReviewThreadTool(ctx, botEmail) {
3146
3241
  },
3147
3242
  description: "Resolve a GitHub pull request review thread after acting on its feedback. Only works on pull requests the bot authored.",
3148
3243
  exposure: "direct",
3149
- inputSchema: inputSchema10,
3150
- outputSchema: outputSchema10,
3244
+ inputSchema: inputSchema11,
3245
+ outputSchema: outputSchema11,
3151
3246
  async execute(input) {
3152
- const parsedInput = inputSchema10.safeParse(input);
3247
+ const parsedInput = inputSchema11.safeParse(input);
3153
3248
  if (!parsedInput.success) {
3154
- throw new PluginToolInputError12(
3249
+ throw new PluginToolInputError13(
3155
3250
  "Invalid GitHub resolvePullRequestReviewThread input.",
3156
3251
  { cause: parsedInput.error }
3157
3252
  );
3158
3253
  }
3159
- const repo = parseRepo11(parsedInput.data.repo);
3254
+ const repo = parseRepo12(parsedInput.data.repo);
3160
3255
  const botUserId = botUserIdFromEmail(botEmail);
3161
3256
  if (botUserId === void 0) {
3162
3257
  throw new Error("GitHub App bot identity is not configured.");
@@ -3187,37 +3282,37 @@ function createGitHubResolvePullRequestReviewThreadTool(ctx, botEmail) {
3187
3282
  })
3188
3283
  })
3189
3284
  });
3190
- const lookupPayload = await readJson8(lookupResponse);
3285
+ const lookupPayload = await readJson9(lookupResponse);
3191
3286
  if (!lookupResponse.ok) {
3192
3287
  throw new Error(
3193
- `GitHub review thread lookup failed with HTTP ${lookupResponse.status}: ${githubError2(lookupPayload)}`
3288
+ `GitHub review thread lookup failed with HTTP ${lookupResponse.status}: ${githubError3(lookupPayload)}`
3194
3289
  );
3195
3290
  }
3196
- const threadNodeSchema = z16.object({
3197
- id: z16.string(),
3198
- isResolved: z16.boolean(),
3199
- pullRequest: z16.object({
3200
- author: z16.object({ databaseId: z16.number().optional() }).passthrough().nullable(),
3201
- number: z16.number(),
3202
- repository: z16.object({ nameWithOwner: z16.string() }).passthrough()
3291
+ const threadNodeSchema = z17.object({
3292
+ id: z17.string(),
3293
+ isResolved: z17.boolean(),
3294
+ pullRequest: z17.object({
3295
+ author: z17.object({ databaseId: z17.number().optional() }).passthrough().nullable(),
3296
+ number: z17.number(),
3297
+ repository: z17.object({ nameWithOwner: z17.string() }).passthrough()
3203
3298
  }).passthrough()
3204
3299
  }).passthrough();
3205
- const lookupResultSchema = z16.object({
3206
- data: z16.object({
3207
- node: z16.unknown().nullable().optional()
3300
+ const lookupResultSchema = z17.object({
3301
+ data: z17.object({
3302
+ node: z17.unknown().nullable().optional()
3208
3303
  }).passthrough()
3209
3304
  }).passthrough();
3210
3305
  const lookupResult = lookupResultSchema.safeParse(lookupPayload);
3211
3306
  const rawNode = lookupResult.success ? lookupResult.data.data.node : void 0;
3212
3307
  const parsedNode = rawNode == null ? void 0 : threadNodeSchema.safeParse(rawNode);
3213
3308
  if (!parsedNode?.success) {
3214
- throw new PluginToolInputError12("GitHub review thread was not found.");
3309
+ throw new PluginToolInputError13("GitHub review thread was not found.");
3215
3310
  }
3216
3311
  const thread = parsedNode.data;
3217
3312
  const pullRequest = thread.pullRequest;
3218
3313
  const ownsPullRequest = pullRequest.repository.nameWithOwner.toLowerCase() === repo.ref.toLowerCase() && pullRequest.author?.databaseId === botUserId;
3219
3314
  if (!ownsPullRequest) {
3220
- throw new PluginToolInputError12(
3315
+ throw new PluginToolInputError13(
3221
3316
  "This bot can only resolve review threads on pull requests it authored."
3222
3317
  );
3223
3318
  }
@@ -3248,16 +3343,16 @@ function createGitHubResolvePullRequestReviewThreadTool(ctx, botEmail) {
3248
3343
  })
3249
3344
  })
3250
3345
  });
3251
- const resolvePayload = await readJson8(resolveResponse);
3346
+ const resolvePayload = await readJson9(resolveResponse);
3252
3347
  if (!resolveResponse.ok) {
3253
3348
  throw new Error(
3254
- `GitHub review thread resolution failed with HTTP ${resolveResponse.status}: ${githubError2(resolvePayload)}`
3349
+ `GitHub review thread resolution failed with HTTP ${resolveResponse.status}: ${githubError3(resolvePayload)}`
3255
3350
  );
3256
3351
  }
3257
- const resolveResultSchema = z16.object({
3258
- data: z16.object({
3259
- resolveReviewThread: z16.object({
3260
- thread: z16.object({ id: z16.string(), isResolved: z16.boolean() }).passthrough()
3352
+ const resolveResultSchema = z17.object({
3353
+ data: z17.object({
3354
+ resolveReviewThread: z17.object({
3355
+ thread: z17.object({ id: z17.string(), isResolved: z17.boolean() }).passthrough()
3261
3356
  }).passthrough()
3262
3357
  }).passthrough()
3263
3358
  }).passthrough();
@@ -3285,45 +3380,45 @@ function createGitHubResolvePullRequestReviewThreadTool(ctx, botEmail) {
3285
3380
 
3286
3381
  // src/tools/submit-pull-request-review.ts
3287
3382
  import {
3288
- definePluginTool as definePluginTool13,
3289
- PluginToolInputError as PluginToolInputError13,
3290
- pluginToolOutputSchema as pluginToolOutputSchema13
3383
+ definePluginTool as definePluginTool14,
3384
+ PluginToolInputError as PluginToolInputError14,
3385
+ pluginToolOutputSchema as pluginToolOutputSchema14
3291
3386
  } from "@sentry/junior-plugin-api";
3292
- import { z as z17 } from "zod";
3293
- var reviewCommentSchema = z17.object({
3294
- path: z17.string().trim().min(1).describe("File path in the pull request."),
3295
- body: z17.string().trim().min(1).describe("Inline review comment."),
3296
- line: z17.number().int().positive().describe("Line in the pull request diff."),
3297
- side: z17.enum(["LEFT", "RIGHT"]).describe("Side of the pull request diff."),
3298
- start_line: z17.number().int().positive().optional().describe("First line of a multi-line comment."),
3299
- start_side: z17.enum(["LEFT", "RIGHT"]).optional().describe("First side of a multi-line comment.")
3387
+ import { z as z18 } from "zod";
3388
+ var reviewCommentSchema = z18.object({
3389
+ path: z18.string().trim().min(1).describe("File path in the pull request."),
3390
+ body: z18.string().trim().min(1).describe("Inline review comment."),
3391
+ line: z18.number().int().positive().describe("Line in the pull request diff."),
3392
+ side: z18.enum(["LEFT", "RIGHT"]).describe("Side of the pull request diff."),
3393
+ start_line: z18.number().int().positive().optional().describe("First line of a multi-line comment."),
3394
+ start_side: z18.enum(["LEFT", "RIGHT"]).optional().describe("First side of a multi-line comment.")
3300
3395
  }).strict().refine(
3301
3396
  ({ start_line, start_side }) => start_line === void 0 === (start_side === void 0),
3302
3397
  { message: "start_line and start_side must be provided together." }
3303
3398
  );
3304
- var inputSchema11 = z17.object({
3305
- repo: z17.string().describe('Repository in "owner/name" format.'),
3306
- number: z17.number().int().positive().describe("Pull request number."),
3307
- event: z17.enum(["COMMENT", "REQUEST_CHANGES"]).describe("Review result. You cannot approve pull requests."),
3308
- body: z17.string().trim().min(1).describe("Review summary."),
3309
- comments: z17.array(reviewCommentSchema).optional().describe("Optional inline review comments.")
3399
+ var inputSchema12 = z18.object({
3400
+ repo: z18.string().describe('Repository in "owner/name" format.'),
3401
+ number: z18.number().int().positive().describe("Pull request number."),
3402
+ event: z18.enum(["COMMENT", "REQUEST_CHANGES"]).describe("Review result. You cannot approve pull requests."),
3403
+ body: z18.string().trim().min(1).describe("Review summary."),
3404
+ comments: z18.array(reviewCommentSchema).optional().describe("Optional inline review comments.")
3310
3405
  }).strict();
3311
- var outputSchema11 = pluginToolOutputSchema13.extend({
3312
- target: z17.literal("submitPullRequestReview"),
3313
- repo: z17.string(),
3314
- number: z17.number(),
3315
- review_id: z17.number(),
3316
- state: z17.string(),
3317
- url: z17.string()
3406
+ var outputSchema12 = pluginToolOutputSchema14.extend({
3407
+ target: z18.literal("submitPullRequestReview"),
3408
+ repo: z18.string(),
3409
+ number: z18.number(),
3410
+ review_id: z18.number(),
3411
+ state: z18.string(),
3412
+ url: z18.string()
3318
3413
  });
3319
- function parseRepo12(value) {
3414
+ function parseRepo13(value) {
3320
3415
  const parts = value.split("/").map((part) => part.trim());
3321
3416
  if (parts.length !== 2 || !parts[0] || !parts[1]) {
3322
- throw new PluginToolInputError13('repo must use "owner/name" format');
3417
+ throw new PluginToolInputError14('repo must use "owner/name" format');
3323
3418
  }
3324
3419
  return { owner: parts[0], name: parts[1], ref: `${parts[0]}/${parts[1]}` };
3325
3420
  }
3326
- async function readJson9(response) {
3421
+ async function readJson10(response) {
3327
3422
  const text2 = await response.text();
3328
3423
  if (!text2) return void 0;
3329
3424
  try {
@@ -3332,7 +3427,7 @@ async function readJson9(response) {
3332
3427
  return text2;
3333
3428
  }
3334
3429
  }
3335
- function githubError3(body) {
3430
+ function githubError4(body) {
3336
3431
  if (body && typeof body === "object" && !Array.isArray(body)) {
3337
3432
  const message = body.message;
3338
3433
  if (typeof message === "string" && message.trim()) return message.trim();
@@ -3341,14 +3436,14 @@ function githubError3(body) {
3341
3436
  return "GitHub request failed";
3342
3437
  }
3343
3438
  function throwReviewError(status, body) {
3344
- const message = `GitHub pull request review failed with HTTP ${status}: ${githubError3(body)}`;
3439
+ const message = `GitHub pull request review failed with HTTP ${status}: ${githubError4(body)}`;
3345
3440
  if (status === 404 || status === 422) {
3346
- throw new PluginToolInputError13(message);
3441
+ throw new PluginToolInputError14(message);
3347
3442
  }
3348
3443
  throw new Error(message);
3349
3444
  }
3350
3445
  function createGitHubSubmitPullRequestReviewTool(egress) {
3351
- return definePluginTool13({
3446
+ return definePluginTool14({
3352
3447
  annotations: {
3353
3448
  destructiveHint: true,
3354
3449
  idempotentHint: false,
@@ -3357,10 +3452,10 @@ function createGitHubSubmitPullRequestReviewTool(egress) {
3357
3452
  },
3358
3453
  description: "Submit a GitHub pull request review as a comment or change request. Use this instead of `gh pr review`, GraphQL, or direct REST calls. You cannot approve pull requests.",
3359
3454
  exposure: "direct",
3360
- inputSchema: inputSchema11,
3361
- outputSchema: outputSchema11,
3455
+ inputSchema: inputSchema12,
3456
+ outputSchema: outputSchema12,
3362
3457
  async execute(review) {
3363
- const repo = parseRepo12(review.repo);
3458
+ const repo = parseRepo13(review.repo);
3364
3459
  const comments = review.comments?.map((comment) => ({
3365
3460
  path: comment.path,
3366
3461
  body: comment.body,
@@ -3389,11 +3484,11 @@ function createGitHubSubmitPullRequestReviewTool(egress) {
3389
3484
  }
3390
3485
  )
3391
3486
  });
3392
- const parsed = await readJson9(response);
3487
+ const parsed = await readJson10(response);
3393
3488
  if (!response.ok) {
3394
3489
  throwReviewError(response.status, parsed);
3395
3490
  }
3396
- const providerResult = z17.object({ id: z17.number(), html_url: z17.string(), state: z17.string() }).parse(parsed);
3491
+ const providerResult = z18.object({ id: z18.number(), html_url: z18.string(), state: z18.string() }).parse(parsed);
3397
3492
  return {
3398
3493
  target: "submitPullRequestReview",
3399
3494
  repo: repo.ref,
@@ -3410,6 +3505,7 @@ function createGitHubSubmitPullRequestReviewTool(egress) {
3410
3505
  function createGitHubTools(ctx, botEmail, pullRequestSubscription) {
3411
3506
  return {
3412
3507
  cloneRepository: createGitHubCloneRepositoryTool(ctx),
3508
+ commentOnPullRequest: createGitHubCommentOnPullRequestTool(ctx.egress),
3413
3509
  createIssue: createGitHubIssueTool(ctx),
3414
3510
  createPullRequest: createGitHubPullRequestTool(
3415
3511
  ctx,
@@ -3435,26 +3531,26 @@ function createGitHubTools(ctx, botEmail, pullRequestSubscription) {
3435
3531
 
3436
3532
  // src/webhooks/handler.ts
3437
3533
  import { createHmac, timingSafeEqual } from "crypto";
3438
- import { z as z27 } from "zod";
3534
+ import { z as z28 } from "zod";
3439
3535
 
3440
3536
  // src/issue-outcomes/store.ts
3441
3537
  import { and as and2, eq as eq2, lte, sql as sql2 } from "drizzle-orm";
3442
- import { z as z18 } from "zod";
3443
- var githubIssueOutcomeInputSchema = z18.object({
3444
- candidateOwned: z18.boolean(),
3445
- closedAt: z18.date().optional(),
3446
- issueId: z18.string().min(1),
3447
- number: z18.number().int().positive(),
3448
- openedAt: z18.date(),
3449
- repositoryFullName: z18.string().min(1),
3450
- repositoryId: z18.string().min(1),
3538
+ import { z as z19 } from "zod";
3539
+ var githubIssueOutcomeInputSchema = z19.object({
3540
+ candidateOwned: z19.boolean(),
3541
+ closedAt: z19.date().optional(),
3542
+ issueId: z19.string().min(1),
3543
+ number: z19.number().int().positive(),
3544
+ openedAt: z19.date(),
3545
+ repositoryFullName: z19.string().min(1),
3546
+ repositoryId: z19.string().min(1),
3451
3547
  state: githubIssueStateSchema,
3452
3548
  stateReason: githubIssueStateReasonSchema.optional(),
3453
- updatedAt: z18.date()
3549
+ updatedAt: z19.date()
3454
3550
  }).strict();
3455
- var githubIssueConversationsInputSchema = z18.object({
3456
- conversationIds: z18.array(z18.string().min(1)).min(1),
3457
- issueId: z18.string().min(1)
3551
+ var githubIssueConversationsInputSchema = z19.object({
3552
+ conversationIds: z19.array(z19.string().min(1)).min(1),
3553
+ issueId: z19.string().min(1)
3458
3554
  }).strict();
3459
3555
  function projectionValues(input) {
3460
3556
  return {
@@ -3518,33 +3614,33 @@ async function recordGitHubIssueConversations(db, input) {
3518
3614
 
3519
3615
  // src/pull-request-outcomes/store.ts
3520
3616
  import { and as and3, eq as eq3, lte as lte2, ne, sql as sql3 } from "drizzle-orm";
3521
- import { z as z19 } from "zod";
3522
- var githubPullRequestOutcomeInputSchema = z19.object({
3523
- candidateOwned: z19.boolean(),
3524
- closedAt: z19.date().optional(),
3617
+ import { z as z20 } from "zod";
3618
+ var githubPullRequestOutcomeInputSchema = z20.object({
3619
+ candidateOwned: z20.boolean(),
3620
+ closedAt: z20.date().optional(),
3525
3621
  commitComposition: githubPullRequestCommitCompositionSchema.optional(),
3526
- mergedAt: z19.date().optional(),
3527
- number: z19.number().int().positive(),
3528
- openedAt: z19.date(),
3529
- pullRequestId: z19.string().min(1),
3530
- repositoryFullName: z19.string().min(1),
3531
- repositoryId: z19.string().min(1),
3622
+ mergedAt: z20.date().optional(),
3623
+ number: z20.number().int().positive(),
3624
+ openedAt: z20.date(),
3625
+ pullRequestId: z20.string().min(1),
3626
+ repositoryFullName: z20.string().min(1),
3627
+ repositoryId: z20.string().min(1),
3532
3628
  state: githubPullRequestStateSchema,
3533
- title: z19.string().min(1).optional(),
3534
- updatedAt: z19.date()
3629
+ title: z20.string().min(1).optional(),
3630
+ updatedAt: z20.date()
3535
3631
  }).strict();
3536
- var githubPullRequestConversationsInputSchema = z19.object({
3537
- conversationIds: z19.array(z19.string().min(1)).min(1),
3538
- pullRequestId: z19.string().min(1)
3632
+ var githubPullRequestConversationsInputSchema = z20.object({
3633
+ conversationIds: z20.array(z20.string().min(1)).min(1),
3634
+ pullRequestId: z20.string().min(1)
3539
3635
  }).strict();
3540
- var githubPullRequestLinkedIssuesInputSchema = z19.object({
3541
- linkedIssues: z19.array(
3542
- z19.object({
3543
- number: z19.number().int().positive(),
3544
- repositoryFullName: z19.string().min(1)
3636
+ var githubPullRequestLinkedIssuesInputSchema = z20.object({
3637
+ linkedIssues: z20.array(
3638
+ z20.object({
3639
+ number: z20.number().int().positive(),
3640
+ repositoryFullName: z20.string().min(1)
3545
3641
  }).strict()
3546
3642
  ).min(1),
3547
- pullRequestId: z19.string().min(1)
3643
+ pullRequestId: z20.string().min(1)
3548
3644
  }).strict();
3549
3645
  function projectionValues2(input) {
3550
3646
  return {
@@ -3749,39 +3845,39 @@ async function releaseGitHubPullRequestReadySync(db, target, claim) {
3749
3845
  }
3750
3846
 
3751
3847
  // src/webhooks/issue-outcome.ts
3752
- import { z as z20 } from "zod";
3753
- var canonicalIssueOutcomeSchema = z20.object({
3754
- action: z20.enum(["opened", "closed", "reopened"]),
3755
- issue: z20.object({
3756
- body: z20.string().nullable().optional(),
3757
- closed_at: z20.string().nullable().optional(),
3758
- created_at: z20.string(),
3759
- id: z20.number().int().positive(),
3760
- number: z20.number().int().positive(),
3848
+ import { z as z21 } from "zod";
3849
+ var canonicalIssueOutcomeSchema = z21.object({
3850
+ action: z21.enum(["opened", "closed", "reopened"]),
3851
+ issue: z21.object({
3852
+ body: z21.string().nullable().optional(),
3853
+ closed_at: z21.string().nullable().optional(),
3854
+ created_at: z21.string(),
3855
+ id: z21.number().int().positive(),
3856
+ number: z21.number().int().positive(),
3761
3857
  state_reason: githubIssueStateReasonSchema.nullable().optional(),
3762
- updated_at: z20.string(),
3763
- user: z20.object({ login: z20.string().min(1) }).strict()
3858
+ updated_at: z21.string(),
3859
+ user: z21.object({ login: z21.string().min(1) }).strict()
3764
3860
  }).strict(),
3765
- repository: z20.object({
3766
- full_name: z20.string().min(1),
3767
- id: z20.number().int().positive()
3861
+ repository: z21.object({
3862
+ full_name: z21.string().min(1),
3863
+ id: z21.number().int().positive()
3768
3864
  }).strict()
3769
3865
  }).strict();
3770
- var issueOutcomeSchema = z20.object({
3771
- action: z20.enum(["opened", "closed", "reopened"]),
3772
- issue: z20.object({
3773
- body: z20.string().nullable().optional(),
3774
- closed_at: z20.string().nullable().optional(),
3775
- created_at: z20.string(),
3776
- id: z20.number().int().positive(),
3777
- number: z20.number().int().positive(),
3866
+ var issueOutcomeSchema = z21.object({
3867
+ action: z21.enum(["opened", "closed", "reopened"]),
3868
+ issue: z21.object({
3869
+ body: z21.string().nullable().optional(),
3870
+ closed_at: z21.string().nullable().optional(),
3871
+ created_at: z21.string(),
3872
+ id: z21.number().int().positive(),
3873
+ number: z21.number().int().positive(),
3778
3874
  state_reason: githubIssueStateReasonSchema.nullable().optional(),
3779
- updated_at: z20.string(),
3780
- user: z20.object({ login: z20.string().min(1) }).passthrough()
3875
+ updated_at: z21.string(),
3876
+ user: z21.object({ login: z21.string().min(1) }).passthrough()
3781
3877
  }).passthrough(),
3782
- repository: z20.object({
3783
- full_name: z20.string().min(1),
3784
- id: z20.number().int().positive()
3878
+ repository: z21.object({
3879
+ full_name: z21.string().min(1),
3880
+ id: z21.number().int().positive()
3785
3881
  }).passthrough()
3786
3882
  }).passthrough().transform(
3787
3883
  (provider) => canonicalIssueOutcomeSchema.parse({
@@ -3802,7 +3898,7 @@ var issueOutcomeSchema = z20.object({
3802
3898
  }
3803
3899
  })
3804
3900
  );
3805
- var issueLifecycleActionSchema = z20.object({ action: z20.string() }).passthrough();
3901
+ var issueLifecycleActionSchema = z21.object({ action: z21.string() }).passthrough();
3806
3902
  function timestamp2(value) {
3807
3903
  if (!value) return void 0;
3808
3904
  const parsed = new Date(value);
@@ -3846,21 +3942,21 @@ function normalizeGitHubIssueOutcome(args) {
3846
3942
  updatedAt
3847
3943
  };
3848
3944
  }
3849
- var canonicalIssueConversationSchema = z20.object({
3850
- issue: z20.object({
3851
- body: z20.string().nullable().optional(),
3852
- id: z20.number().int().positive(),
3853
- user: z20.object({ login: z20.string().min(1) }).strict()
3945
+ var canonicalIssueConversationSchema = z21.object({
3946
+ issue: z21.object({
3947
+ body: z21.string().nullable().optional(),
3948
+ id: z21.number().int().positive(),
3949
+ user: z21.object({ login: z21.string().min(1) }).strict()
3854
3950
  }).strict(),
3855
- sender: z20.object({ login: z20.string().min(1) }).strict().optional()
3951
+ sender: z21.object({ login: z21.string().min(1) }).strict().optional()
3856
3952
  }).strict();
3857
- var issueConversationSchema = z20.object({
3858
- issue: z20.object({
3859
- body: z20.string().nullable().optional(),
3860
- id: z20.number().int().positive(),
3861
- user: z20.object({ login: z20.string().min(1) }).passthrough()
3953
+ var issueConversationSchema = z21.object({
3954
+ issue: z21.object({
3955
+ body: z21.string().nullable().optional(),
3956
+ id: z21.number().int().positive(),
3957
+ user: z21.object({ login: z21.string().min(1) }).passthrough()
3862
3958
  }).passthrough(),
3863
- sender: z20.object({ login: z20.string().min(1) }).passthrough().optional()
3959
+ sender: z21.object({ login: z21.string().min(1) }).passthrough().optional()
3864
3960
  }).passthrough().transform(
3865
3961
  (provider) => canonicalIssueConversationSchema.parse({
3866
3962
  issue: {
@@ -3887,43 +3983,43 @@ function normalizeGitHubIssueConversations(args) {
3887
3983
  }
3888
3984
 
3889
3985
  // src/webhooks/pull-request-outcome.ts
3890
- import { z as z21 } from "zod";
3891
- var canonicalPullRequestOutcomeSchema = z21.object({
3892
- action: z21.enum(["opened", "closed", "reopened"]),
3893
- pull_request: z21.object({
3894
- body: z21.string().nullable().optional(),
3895
- closed_at: z21.string().nullable().optional(),
3896
- created_at: z21.string(),
3897
- id: z21.number().int().positive(),
3898
- merged: z21.boolean(),
3899
- merged_at: z21.string().nullable().optional(),
3900
- number: z21.number().int().positive(),
3901
- title: z21.string().min(1).optional(),
3902
- updated_at: z21.string(),
3903
- user: z21.object({ login: z21.string().min(1) }).strict()
3986
+ import { z as z22 } from "zod";
3987
+ var canonicalPullRequestOutcomeSchema = z22.object({
3988
+ action: z22.enum(["opened", "closed", "reopened"]),
3989
+ pull_request: z22.object({
3990
+ body: z22.string().nullable().optional(),
3991
+ closed_at: z22.string().nullable().optional(),
3992
+ created_at: z22.string(),
3993
+ id: z22.number().int().positive(),
3994
+ merged: z22.boolean(),
3995
+ merged_at: z22.string().nullable().optional(),
3996
+ number: z22.number().int().positive(),
3997
+ title: z22.string().min(1).optional(),
3998
+ updated_at: z22.string(),
3999
+ user: z22.object({ login: z22.string().min(1) }).strict()
3904
4000
  }).strict(),
3905
- repository: z21.object({
3906
- full_name: z21.string().min(1),
3907
- id: z21.number().int().positive()
4001
+ repository: z22.object({
4002
+ full_name: z22.string().min(1),
4003
+ id: z22.number().int().positive()
3908
4004
  }).strict()
3909
4005
  }).strict();
3910
- var pullRequestOutcomeSchema = z21.object({
3911
- action: z21.enum(["opened", "closed", "reopened"]),
3912
- pull_request: z21.object({
3913
- body: z21.string().nullable().optional(),
3914
- closed_at: z21.string().nullable().optional(),
3915
- created_at: z21.string(),
3916
- id: z21.number().int().positive(),
3917
- merged: z21.boolean(),
3918
- merged_at: z21.string().nullable().optional(),
3919
- number: z21.number().int().positive(),
3920
- title: z21.string().min(1).optional(),
3921
- updated_at: z21.string(),
3922
- user: z21.object({ login: z21.string().min(1) }).passthrough()
4006
+ var pullRequestOutcomeSchema = z22.object({
4007
+ action: z22.enum(["opened", "closed", "reopened"]),
4008
+ pull_request: z22.object({
4009
+ body: z22.string().nullable().optional(),
4010
+ closed_at: z22.string().nullable().optional(),
4011
+ created_at: z22.string(),
4012
+ id: z22.number().int().positive(),
4013
+ merged: z22.boolean(),
4014
+ merged_at: z22.string().nullable().optional(),
4015
+ number: z22.number().int().positive(),
4016
+ title: z22.string().min(1).optional(),
4017
+ updated_at: z22.string(),
4018
+ user: z22.object({ login: z22.string().min(1) }).passthrough()
3923
4019
  }).passthrough(),
3924
- repository: z21.object({
3925
- full_name: z21.string().min(1),
3926
- id: z21.number().int().positive()
4020
+ repository: z22.object({
4021
+ full_name: z22.string().min(1),
4022
+ id: z22.number().int().positive()
3927
4023
  }).passthrough()
3928
4024
  }).passthrough().transform(
3929
4025
  (provider) => canonicalPullRequestOutcomeSchema.parse({
@@ -3946,24 +4042,24 @@ var pullRequestOutcomeSchema = z21.object({
3946
4042
  }
3947
4043
  })
3948
4044
  );
3949
- var pullRequestLifecycleActionSchema = z21.object({ action: z21.string() }).passthrough();
3950
- var canonicalPullRequestConversationSchema = z21.object({
3951
- pull_request: z21.object({
3952
- body: z21.string().nullable().optional(),
3953
- id: z21.number().int().positive(),
3954
- user: z21.object({ login: z21.string().min(1) }).strict()
4045
+ var pullRequestLifecycleActionSchema = z22.object({ action: z22.string() }).passthrough();
4046
+ var canonicalPullRequestConversationSchema = z22.object({
4047
+ pull_request: z22.object({
4048
+ body: z22.string().nullable().optional(),
4049
+ id: z22.number().int().positive(),
4050
+ user: z22.object({ login: z22.string().min(1) }).strict()
3955
4051
  }).strict(),
3956
- repository: z21.object({ full_name: z21.string().min(1) }).strict(),
3957
- sender: z21.object({ login: z21.string().min(1) }).strict()
4052
+ repository: z22.object({ full_name: z22.string().min(1) }).strict(),
4053
+ sender: z22.object({ login: z22.string().min(1) }).strict()
3958
4054
  }).strict();
3959
- var pullRequestConversationSchema = z21.object({
3960
- pull_request: z21.object({
3961
- body: z21.string().nullable().optional(),
3962
- id: z21.number().int().positive(),
3963
- user: z21.object({ login: z21.string().min(1) }).passthrough()
4055
+ var pullRequestConversationSchema = z22.object({
4056
+ pull_request: z22.object({
4057
+ body: z22.string().nullable().optional(),
4058
+ id: z22.number().int().positive(),
4059
+ user: z22.object({ login: z22.string().min(1) }).passthrough()
3964
4060
  }).passthrough(),
3965
- repository: z21.object({ full_name: z21.string().min(1) }).passthrough(),
3966
- sender: z21.object({ login: z21.string().min(1) }).passthrough()
4061
+ repository: z22.object({ full_name: z22.string().min(1) }).passthrough(),
4062
+ sender: z22.object({ login: z22.string().min(1) }).passthrough()
3967
4063
  }).passthrough().transform(
3968
4064
  (provider) => canonicalPullRequestConversationSchema.parse({
3969
4065
  pull_request: {
@@ -4050,20 +4146,20 @@ function normalizeGitHubPullRequestLinkedIssues(args) {
4050
4146
  }
4051
4147
 
4052
4148
  // src/webhooks/merge-conflict.ts
4053
- import { z as z22 } from "zod";
4149
+ import { z as z23 } from "zod";
4054
4150
  var EVENT_TYPE = "pull_request.merge_conflict";
4055
4151
  var CLOSED_EVENT_TYPES = /* @__PURE__ */ new Set([
4056
4152
  "pull_request.closed_unmerged",
4057
4153
  "pull_request.merged"
4058
4154
  ]);
4059
- var pullRequestSchema3 = z22.object({
4060
- base: z22.object({ ref: z22.string().min(1) }),
4061
- number: z22.number().int().positive().optional(),
4062
- head: z22.object({ sha: z22.string().min(1) }),
4063
- html_url: z22.string().min(1).optional(),
4064
- mergeable: z22.boolean().nullable().optional(),
4065
- mergeable_state: z22.string().optional(),
4066
- state: z22.string()
4155
+ var pullRequestSchema3 = z23.object({
4156
+ base: z23.object({ ref: z23.string().min(1) }),
4157
+ number: z23.number().int().positive().optional(),
4158
+ head: z23.object({ sha: z23.string().min(1) }),
4159
+ html_url: z23.string().min(1).optional(),
4160
+ mergeable: z23.boolean().nullable().optional(),
4161
+ mergeable_state: z23.string().optional(),
4162
+ state: z23.string()
4067
4163
  });
4068
4164
  function gitHubMergeConflictEvents(input) {
4069
4165
  const { conflict } = input;
@@ -4103,7 +4199,7 @@ async function hasMatch(hasMatchEvent, ref) {
4103
4199
  return false;
4104
4200
  }
4105
4201
  function deliveredPullRequest(payload, ref) {
4106
- const parsed = z22.object({ pull_request: pullRequestSchema3 }).safeParse(payload);
4202
+ const parsed = z23.object({ pull_request: pullRequestSchema3 }).safeParse(payload);
4107
4203
  const pullRequest = parsed.success ? parsed.data.pull_request : void 0;
4108
4204
  return pullRequest?.number === ref.number && typeof pullRequest.mergeable === "boolean" ? pullRequest : void 0;
4109
4205
  }
@@ -4141,10 +4237,10 @@ async function loadGitHubMergeConflictEvents(args) {
4141
4237
  }
4142
4238
 
4143
4239
  // src/webhooks/pull-request-ready.ts
4144
- import { z as z24 } from "zod";
4240
+ import { z as z25 } from "zod";
4145
4241
 
4146
4242
  // src/webhooks/installation-requests.ts
4147
- import { z as z23 } from "zod";
4243
+ import { z as z24 } from "zod";
4148
4244
  function splitRepository(fullName, label) {
4149
4245
  const [owner, name, ...extra] = fullName.split("/");
4150
4246
  if (!owner || !name || extra.length > 0) {
@@ -4205,9 +4301,9 @@ async function markPullRequestFeedbackReviewing(env, target) {
4205
4301
  }
4206
4302
  );
4207
4303
  }
4208
- var repositoryPermissionSchema = z23.object({
4209
- permission: z23.string().min(1),
4210
- role_name: z23.string().optional()
4304
+ var repositoryPermissionSchema = z24.object({
4305
+ permission: z24.string().min(1),
4306
+ role_name: z24.string().optional()
4211
4307
  });
4212
4308
  var REPOSITORY_ROLE_TTL_MS = 10 * 60 * 1e3;
4213
4309
  async function loadRepositoryRole(env, cache, target) {
@@ -4237,18 +4333,18 @@ async function loadRepositoryRole(env, cache, target) {
4237
4333
  }
4238
4334
  );
4239
4335
  }
4240
- var pullRequestSchema4 = z23.object({
4241
- draft: z23.boolean().optional(),
4242
- html_url: z23.string().url(),
4243
- mergeable_state: z23.string().nullable().optional(),
4244
- merged: z23.boolean(),
4245
- state: z23.enum(["open", "closed"]),
4246
- title: z23.string()
4336
+ var pullRequestSchema4 = z24.object({
4337
+ draft: z24.boolean().optional(),
4338
+ html_url: z24.string().url(),
4339
+ mergeable_state: z24.string().nullable().optional(),
4340
+ merged: z24.boolean(),
4341
+ state: z24.enum(["open", "closed"]),
4342
+ title: z24.string()
4247
4343
  });
4248
- var reviewsSchema = z23.array(
4249
- z23.object({
4250
- state: z23.string(),
4251
- user: z23.object({ login: z23.string() }).nullable()
4344
+ var reviewsSchema = z24.array(
4345
+ z24.object({
4346
+ state: z24.string(),
4347
+ user: z24.object({ login: z24.string() }).nullable()
4252
4348
  })
4253
4349
  );
4254
4350
  async function loadPullRequestMergeState(env, pullRequest) {
@@ -4313,10 +4409,10 @@ var READY_ACTIONS = {
4313
4409
  ]),
4314
4410
  pull_request_review: /* @__PURE__ */ new Set(["dismissed", "submitted"])
4315
4411
  };
4316
- var pullRequestWebhookSchema = z24.object({
4317
- action: z24.string(),
4318
- pull_request: z24.object({ number: z24.number().int().positive() }),
4319
- repository: z24.object({ full_name: z24.string().min(1) })
4412
+ var pullRequestWebhookSchema = z25.object({
4413
+ action: z25.string(),
4414
+ pull_request: z25.object({ number: z25.number().int().positive() }),
4415
+ repository: z25.object({ full_name: z25.string().min(1) })
4320
4416
  });
4321
4417
  function pullRequestReadyTargets(eventName, body) {
4322
4418
  if (eventName === "check_suite") return checkSuitePullRequests(body);
@@ -4411,7 +4507,7 @@ async function syncGitHubPullRequestReadyNotices(args) {
4411
4507
  }
4412
4508
 
4413
4509
  // src/webhooks/pull-request-match-data.ts
4414
- import { z as z25 } from "zod";
4510
+ import { z as z26 } from "zod";
4415
4511
  var LOOKUPS_BY_MATCH_KEY = {
4416
4512
  authors: ["authors"],
4417
4513
  openerEmail: ["opener"],
@@ -4419,16 +4515,16 @@ var LOOKUPS_BY_MATCH_KEY = {
4419
4515
  openerUsername: ["opener"]
4420
4516
  };
4421
4517
  var ALL_LOOKUPS = ["authors", "opener", "openerRole"];
4422
- var lookupDataSchema = z25.object({
4423
- authors: z25.array(z25.string().min(1)).min(1).optional(),
4424
- openerRole: z25.string().min(1).optional(),
4425
- openerUsername: z25.string().min(1).optional()
4518
+ var lookupDataSchema = z26.object({
4519
+ authors: z26.array(z26.string().min(1)).min(1).optional(),
4520
+ openerRole: z26.string().min(1).optional(),
4521
+ openerUsername: z26.string().min(1).optional()
4426
4522
  }).strict();
4427
4523
  function lookupData(input) {
4428
4524
  return lookupDataSchema.parse(definedValues(input));
4429
4525
  }
4430
- var webhookSchema = z25.object({
4431
- repository: z25.object({ full_name: z25.string().min(1) })
4526
+ var webhookSchema = z26.object({
4527
+ repository: z26.object({ full_name: z26.string().min(1) })
4432
4528
  });
4433
4529
  function pullRequestNumbers(events) {
4434
4530
  const numbers = /* @__PURE__ */ new Map();
@@ -4571,7 +4667,7 @@ async function withGitHubPullRequestMatchData(args) {
4571
4667
  }
4572
4668
 
4573
4669
  // src/webhooks/pull-request-people.ts
4574
- import { z as z26 } from "zod";
4670
+ import { z as z27 } from "zod";
4575
4671
  var PEOPLE_EVENTS = /* @__PURE__ */ new Set([
4576
4672
  "pull_request.review.approved",
4577
4673
  "pull_request.merged"
@@ -4581,18 +4677,18 @@ var PAGE_SIZE = 100;
4581
4677
  var MAX_PAGES = 3;
4582
4678
  var CO_AUTHOR_TRAILER = /^co-authored-by:[^<\n]*<([^>\s]+@[^>\s]+)>\s*$/gim;
4583
4679
  var GITHUB_NOREPLY_EMAIL = /^(?:\d+\+)?(?<login>[^@+]+)@users\.noreply\.github\.com$/i;
4584
- var webhookSchema2 = z26.object({
4585
- pull_request: z26.object({
4586
- assignees: z26.array(z26.object({ login: z26.string().min(1) })).nullish(),
4587
- number: z26.number(),
4588
- user: z26.object({ login: z26.string().min(1) }).nullish()
4680
+ var webhookSchema2 = z27.object({
4681
+ pull_request: z27.object({
4682
+ assignees: z27.array(z27.object({ login: z27.string().min(1) })).nullish(),
4683
+ number: z27.number(),
4684
+ user: z27.object({ login: z27.string().min(1) }).nullish()
4589
4685
  }),
4590
- repository: z26.object({ full_name: z26.string().min(1) })
4686
+ repository: z27.object({ full_name: z27.string().min(1) })
4591
4687
  });
4592
- var commitPageSchema = z26.array(
4593
- z26.object({
4594
- author: z26.object({ login: z26.string().min(1) }).nullish(),
4595
- commit: z26.object({ message: z26.string() })
4688
+ var commitPageSchema = z27.array(
4689
+ z27.object({
4690
+ author: z27.object({ login: z27.string().min(1) }).nullish(),
4691
+ commit: z27.object({ message: z27.string() })
4596
4692
  })
4597
4693
  );
4598
4694
  function shareCommitPages(load) {
@@ -4737,10 +4833,10 @@ function webhookInstallationId(body) {
4737
4833
  }
4738
4834
  return parseInstallationId(installation.id);
4739
4835
  }
4740
- var feedbackTargetSchema = z27.object({
4741
- commentId: z27.number(),
4742
- commentKind: z27.enum(["conversation", "review"]),
4743
- repo: z27.string().min(1)
4836
+ var feedbackTargetSchema = z28.object({
4837
+ commentId: z28.number(),
4838
+ commentKind: z28.enum(["conversation", "review"]),
4839
+ repo: z28.string().min(1)
4744
4840
  });
4745
4841
  function pullRequestFeedbackTarget(events) {
4746
4842
  const event = events.find(
@@ -5023,18 +5119,18 @@ function gitHubResourceUrl(input) {
5023
5119
  }
5024
5120
 
5025
5121
  // src/pull-request-outcomes/commit-composition.ts
5026
- import { z as z28 } from "zod";
5027
- var canonicalCommitSchema = z28.object({
5028
- authorEmail: z28.string().nullable(),
5029
- authorLogin: z28.string().nullable()
5122
+ import { z as z29 } from "zod";
5123
+ var canonicalCommitSchema = z29.object({
5124
+ authorEmail: z29.string().nullable(),
5125
+ authorLogin: z29.string().nullable()
5030
5126
  }).strict();
5031
- var providerCommitSchema = z28.object({
5032
- author: z28.object({ login: z28.string() }).passthrough().nullable(),
5033
- commit: z28.object({
5034
- author: z28.object({ email: z28.string() }).passthrough().nullable()
5127
+ var providerCommitSchema = z29.object({
5128
+ author: z29.object({ login: z29.string() }).passthrough().nullable(),
5129
+ commit: z29.object({
5130
+ author: z29.object({ email: z29.string() }).passthrough().nullable()
5035
5131
  }).passthrough()
5036
5132
  }).passthrough();
5037
- var commitPageSchema2 = z28.array(providerCommitSchema).transform(
5133
+ var commitPageSchema2 = z29.array(providerCommitSchema).transform(
5038
5134
  (commits) => commits.map(
5039
5135
  (commit) => canonicalCommitSchema.parse({
5040
5136
  authorEmail: commit.commit.author?.email ?? null,
@@ -6103,6 +6199,13 @@ var GITHUB_BODY_WRITES = [
6103
6199
  operation: "github.pull.review.create",
6104
6200
  restPath: /^\/repos\/[^/]+\/[^/]+\/pulls\/[^/]+\/reviews$/
6105
6201
  },
6202
+ {
6203
+ denialMessage: `GitHub review thread replies must use the github_commentOnPullRequest tool with in_reply_to. ${CREATE_TOOL_ROUTING_GUIDANCE}`,
6204
+ graphqlField: "addPullRequestReviewThreadReply",
6205
+ method: "POST",
6206
+ operation: "github.pull.comment.create",
6207
+ restPath: /^\/repos\/[^/]+\/[^/]+\/pulls\/[^/]+\/comments\/[^/]+\/replies$/
6208
+ },
6106
6209
  {
6107
6210
  denialMessage: `GitHub issue updates must use the github_updateIssue tool, which owns requester attribution and the conversation footer. ${CREATE_TOOL_ROUTING_GUIDANCE}`,
6108
6211
  graphqlField: "updateIssue",