@sentry/junior-github 0.225.0 → 0.227.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/annotations.d.ts +2 -0
- package/dist/index.js +462 -378
- package/dist/object-facts.d.ts +3 -0
- package/dist/tools/clone-repository.d.ts +68 -2
- package/dist/tools/create-issue.d.ts +68 -2
- package/dist/tools/create-pull-request.d.ts +68 -2
- package/dist/tools/get-deployment.d.ts +68 -2
- package/dist/tools/get-pull-request.d.ts +68 -2
- package/dist/tools/get-release.d.ts +68 -2
- package/dist/tools/get-repository.d.ts +68 -2
- package/dist/tools/resolve-pull-request-review-thread.d.ts +68 -2
- package/dist/tools/submit-pull-request-review.d.ts +68 -2
- package/dist/tools/update-issue.d.ts +68 -2
- package/dist/tools/update-pull-request-feedback.d.ts +69 -3
- package/dist/tools/update-pull-request.d.ts +68 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -237,6 +237,50 @@ function createGitHubCloneRepositoryTool(ctx) {
|
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
// src/object-facts.ts
|
|
241
|
+
import { z as z2 } from "zod";
|
|
242
|
+
var person = z2.object({ login: z2.string() });
|
|
243
|
+
var responseSchema = z2.object({
|
|
244
|
+
user: person.nullable().optional(),
|
|
245
|
+
requested_reviewers: z2.array(person).optional(),
|
|
246
|
+
assignees: z2.array(person).optional(),
|
|
247
|
+
labels: z2.array(z2.union([z2.string(), z2.object({ name: z2.string() })])).optional(),
|
|
248
|
+
head: z2.object({ ref: z2.string() }).optional(),
|
|
249
|
+
base: z2.object({ ref: z2.string() }).optional(),
|
|
250
|
+
mergeable: z2.boolean().nullable().optional(),
|
|
251
|
+
changed_files: z2.number().int().nonnegative().optional(),
|
|
252
|
+
additions: z2.number().int().nonnegative().optional(),
|
|
253
|
+
deletions: z2.number().int().nonnegative().optional(),
|
|
254
|
+
updated_at: z2.iso.datetime({ offset: true }).optional()
|
|
255
|
+
});
|
|
256
|
+
var short = (value) => {
|
|
257
|
+
const text2 = value?.trim();
|
|
258
|
+
return text2 ? text2.length > 64 ? `${text2.slice(0, 63)}\u2026` : text2 : void 0;
|
|
259
|
+
};
|
|
260
|
+
function githubObjectFacts(type, response) {
|
|
261
|
+
const data = responseSchema.parse(response);
|
|
262
|
+
return {
|
|
263
|
+
sourceUpdatedAt: data.updated_at,
|
|
264
|
+
facts: type === "code_change" ? {
|
|
265
|
+
type,
|
|
266
|
+
author: short(data.user?.login),
|
|
267
|
+
reviewers: data.requested_reviewers?.slice(0, 5).map((user) => short(user.login)).filter(Boolean),
|
|
268
|
+
sourceBranch: short(data.head?.ref),
|
|
269
|
+
targetBranch: short(data.base?.ref),
|
|
270
|
+
mergeable: data.mergeable ?? void 0,
|
|
271
|
+
changedFiles: data.changed_files,
|
|
272
|
+
additions: data.additions,
|
|
273
|
+
deletions: data.deletions
|
|
274
|
+
} : {
|
|
275
|
+
type,
|
|
276
|
+
assignees: data.assignees?.slice(0, 5).map((user) => short(user.login)).filter(Boolean),
|
|
277
|
+
labels: data.labels?.slice(0, 5).map(
|
|
278
|
+
(label) => short(typeof label === "string" ? label : label.name)
|
|
279
|
+
).filter(Boolean)
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
240
284
|
// src/annotations.ts
|
|
241
285
|
var STATUS_ICON = {
|
|
242
286
|
warning: "triangle-alert",
|
|
@@ -288,7 +332,10 @@ function githubObjectAnnotation(input) {
|
|
|
288
332
|
title: input.title.slice(0, 512),
|
|
289
333
|
url: input.url,
|
|
290
334
|
objectType: input.objectType,
|
|
291
|
-
status: input.status
|
|
335
|
+
status: input.status,
|
|
336
|
+
displayType: input.objectType === "code_change" ? "Pull request" : "Issue",
|
|
337
|
+
facts: input.facts,
|
|
338
|
+
sourceUpdatedAt: input.sourceUpdatedAt
|
|
292
339
|
};
|
|
293
340
|
}
|
|
294
341
|
async function updateGitHubAnnotation(store, input) {
|
|
@@ -317,6 +364,7 @@ async function updateGitHubAnnotation(store, input) {
|
|
|
317
364
|
|
|
318
365
|
// src/tools/create-issue.ts
|
|
319
366
|
import {
|
|
367
|
+
objectFactsSchema,
|
|
320
368
|
definePluginTool as definePluginTool2,
|
|
321
369
|
EgressAuthRequired,
|
|
322
370
|
PluginToolInputError as PluginToolInputError3,
|
|
@@ -325,7 +373,7 @@ import {
|
|
|
325
373
|
} from "@sentry/junior-plugin-api";
|
|
326
374
|
import { Type } from "@sinclair/typebox";
|
|
327
375
|
import { Value } from "@sinclair/typebox/value";
|
|
328
|
-
import { z as
|
|
376
|
+
import { z as z3 } from "zod";
|
|
329
377
|
|
|
330
378
|
// src/tools/footer.ts
|
|
331
379
|
import { PluginToolInputError as PluginToolInputError2 } from "@sentry/junior-plugin-api";
|
|
@@ -563,11 +611,11 @@ var createIssueInputSchema = Type.Object(
|
|
|
563
611
|
},
|
|
564
612
|
{ additionalProperties: false }
|
|
565
613
|
);
|
|
566
|
-
var createIssueToolInputSchema =
|
|
567
|
-
repo:
|
|
568
|
-
title:
|
|
569
|
-
body:
|
|
570
|
-
labels:
|
|
614
|
+
var createIssueToolInputSchema = z3.object({
|
|
615
|
+
repo: z3.string().describe('Repository in "owner/name" format.'),
|
|
616
|
+
title: z3.string().describe("Issue title."),
|
|
617
|
+
body: z3.string().describe("Issue body. The runtime appends the conversation footer.").optional(),
|
|
618
|
+
labels: z3.array(z3.string()).describe("Labels to apply to the issue.").optional()
|
|
571
619
|
}).strict();
|
|
572
620
|
var createIssueStateSchema = Type.Union([
|
|
573
621
|
Type.Object(
|
|
@@ -575,6 +623,8 @@ var createIssueStateSchema = Type.Union([
|
|
|
575
623
|
createdAtMs: Type.Number(),
|
|
576
624
|
input: Type.Optional(createIssueInputSchema),
|
|
577
625
|
number: Type.Number(),
|
|
626
|
+
facts: Type.Optional(Type.Unknown()),
|
|
627
|
+
sourceUpdatedAt: Type.Optional(Type.String()),
|
|
578
628
|
status: Type.Literal("completed"),
|
|
579
629
|
url: Type.String()
|
|
580
630
|
},
|
|
@@ -589,14 +639,14 @@ var createIssueStateSchema = Type.Union([
|
|
|
589
639
|
{ additionalProperties: false }
|
|
590
640
|
)
|
|
591
641
|
]);
|
|
592
|
-
var gitHubIssueDataSchema =
|
|
593
|
-
number:
|
|
642
|
+
var gitHubIssueDataSchema = z3.object({
|
|
643
|
+
number: z3.number(),
|
|
594
644
|
subscribable: subscribableResourceSchema.optional(),
|
|
595
|
-
url:
|
|
645
|
+
url: z3.string()
|
|
596
646
|
});
|
|
597
647
|
var gitHubIssueOutputSchema = pluginToolOutputSchema2.merge(
|
|
598
648
|
gitHubIssueDataSchema.extend({
|
|
599
|
-
target:
|
|
649
|
+
target: z3.literal("createIssue")
|
|
600
650
|
})
|
|
601
651
|
);
|
|
602
652
|
function gitHubIssueToolResult(input, result, canSubscribe) {
|
|
@@ -605,10 +655,16 @@ function gitHubIssueToolResult(input, result, canSubscribe) {
|
|
|
605
655
|
number: result.number,
|
|
606
656
|
repo: `${repo.owner}/${repo.name}`
|
|
607
657
|
}) : void 0;
|
|
608
|
-
const data = {
|
|
658
|
+
const data = {
|
|
659
|
+
number: result.number,
|
|
660
|
+
url: result.url,
|
|
661
|
+
...subscribable ? { subscribable } : void 0
|
|
662
|
+
};
|
|
609
663
|
return {
|
|
610
664
|
objectAnnotations: [
|
|
611
665
|
githubObjectAnnotation({
|
|
666
|
+
facts: result.facts,
|
|
667
|
+
sourceUpdatedAt: result.sourceUpdatedAt,
|
|
612
668
|
repo: input.repo,
|
|
613
669
|
number: result.number,
|
|
614
670
|
title: input.title,
|
|
@@ -743,6 +799,7 @@ async function createGitHubIssue(ctx, request) {
|
|
|
743
799
|
throw new Error("GitHub issue creation returned an invalid response.");
|
|
744
800
|
}
|
|
745
801
|
return {
|
|
802
|
+
...githubObjectFacts("task", parsed),
|
|
746
803
|
number: issue.number,
|
|
747
804
|
url: issue.html_url
|
|
748
805
|
};
|
|
@@ -774,6 +831,8 @@ function createGitHubIssueTool(ctx) {
|
|
|
774
831
|
if (state?.status === "completed") {
|
|
775
832
|
const completedInput = state.input ?? parsedInput;
|
|
776
833
|
const completedResult = {
|
|
834
|
+
facts: state.facts === void 0 ? void 0 : objectFactsSchema.parse(state.facts),
|
|
835
|
+
sourceUpdatedAt: state.sourceUpdatedAt,
|
|
777
836
|
number: state.number,
|
|
778
837
|
url: state.url
|
|
779
838
|
};
|
|
@@ -843,69 +902,69 @@ import {
|
|
|
843
902
|
pluginToolOutputSchema as pluginToolOutputSchema3,
|
|
844
903
|
subscribableResourceSchema as subscribableResourceSchema2
|
|
845
904
|
} from "@sentry/junior-plugin-api";
|
|
846
|
-
import { z as
|
|
847
|
-
var commitShaSchema =
|
|
848
|
-
var inputSchema2 =
|
|
849
|
-
repo:
|
|
905
|
+
import { z as z4 } from "zod";
|
|
906
|
+
var commitShaSchema = z4.string().regex(/^[0-9a-f]{40}$/i);
|
|
907
|
+
var inputSchema2 = z4.object({
|
|
908
|
+
repo: z4.string().describe('Repository in "owner/name" format.'),
|
|
850
909
|
commitSha: commitShaSchema.describe(
|
|
851
910
|
"Full 40-character Git commit SHA recorded by the deployment."
|
|
852
911
|
),
|
|
853
|
-
environment:
|
|
912
|
+
environment: z4.string().trim().min(1).describe(
|
|
854
913
|
'Optional GitHub deployment environment, such as "Production". Omit to inspect and watch deployments for the commit across environments.'
|
|
855
914
|
).optional()
|
|
856
915
|
}).strict();
|
|
857
|
-
var statusSchema =
|
|
858
|
-
createdAt:
|
|
859
|
-
creator:
|
|
860
|
-
description:
|
|
861
|
-
environmentUrl:
|
|
862
|
-
id:
|
|
863
|
-
logUrl:
|
|
864
|
-
state:
|
|
916
|
+
var statusSchema = z4.object({
|
|
917
|
+
createdAt: z4.string(),
|
|
918
|
+
creator: z4.string().nullable(),
|
|
919
|
+
description: z4.string().nullable(),
|
|
920
|
+
environmentUrl: z4.string().nullable(),
|
|
921
|
+
id: z4.number(),
|
|
922
|
+
logUrl: z4.string().nullable(),
|
|
923
|
+
state: z4.string()
|
|
865
924
|
}).strict();
|
|
866
|
-
var deploymentSchema =
|
|
867
|
-
createdAt:
|
|
868
|
-
creator:
|
|
869
|
-
description:
|
|
870
|
-
environment:
|
|
871
|
-
id:
|
|
925
|
+
var deploymentSchema = z4.object({
|
|
926
|
+
createdAt: z4.string(),
|
|
927
|
+
creator: z4.string().nullable(),
|
|
928
|
+
description: z4.string().nullable(),
|
|
929
|
+
environment: z4.string(),
|
|
930
|
+
id: z4.number(),
|
|
872
931
|
latestStatus: statusSchema.nullable(),
|
|
873
|
-
ref:
|
|
932
|
+
ref: z4.string(),
|
|
874
933
|
sha: commitShaSchema,
|
|
875
|
-
updatedAt:
|
|
876
|
-
url:
|
|
934
|
+
updatedAt: z4.string(),
|
|
935
|
+
url: z4.string()
|
|
877
936
|
}).strict();
|
|
878
|
-
var deploymentSourceSchema =
|
|
937
|
+
var deploymentSourceSchema = z4.object({
|
|
879
938
|
commitSha: commitShaSchema,
|
|
880
939
|
deployment: deploymentSchema.nullable(),
|
|
881
|
-
environment:
|
|
882
|
-
repo:
|
|
940
|
+
environment: z4.string().nullable(),
|
|
941
|
+
repo: z4.string(),
|
|
883
942
|
subscribable: subscribableResourceSchema2.optional()
|
|
884
943
|
}).strict();
|
|
885
944
|
var outputSchema2 = pluginToolOutputSchema3.merge(
|
|
886
945
|
deploymentSourceSchema.extend({
|
|
887
|
-
target:
|
|
946
|
+
target: z4.literal("getDeployment")
|
|
888
947
|
})
|
|
889
948
|
);
|
|
890
|
-
var providerCreatorSchema =
|
|
891
|
-
var providerDeploymentSchema =
|
|
892
|
-
created_at:
|
|
949
|
+
var providerCreatorSchema = z4.object({ login: z4.string() }).passthrough().nullable();
|
|
950
|
+
var providerDeploymentSchema = z4.object({
|
|
951
|
+
created_at: z4.string(),
|
|
893
952
|
creator: providerCreatorSchema,
|
|
894
|
-
description:
|
|
895
|
-
environment:
|
|
896
|
-
id:
|
|
897
|
-
ref:
|
|
953
|
+
description: z4.string().nullable(),
|
|
954
|
+
environment: z4.string(),
|
|
955
|
+
id: z4.number(),
|
|
956
|
+
ref: z4.string(),
|
|
898
957
|
sha: commitShaSchema,
|
|
899
|
-
updated_at:
|
|
958
|
+
updated_at: z4.string()
|
|
900
959
|
}).passthrough();
|
|
901
|
-
var providerStatusSchema =
|
|
902
|
-
created_at:
|
|
960
|
+
var providerStatusSchema = z4.object({
|
|
961
|
+
created_at: z4.string(),
|
|
903
962
|
creator: providerCreatorSchema,
|
|
904
|
-
description:
|
|
905
|
-
environment_url:
|
|
906
|
-
id:
|
|
907
|
-
log_url:
|
|
908
|
-
state:
|
|
963
|
+
description: z4.string().nullable().optional(),
|
|
964
|
+
environment_url: z4.string().nullable().optional(),
|
|
965
|
+
id: z4.number(),
|
|
966
|
+
log_url: z4.string().nullable().optional(),
|
|
967
|
+
state: z4.string()
|
|
909
968
|
}).passthrough();
|
|
910
969
|
function parseRepo3(value) {
|
|
911
970
|
const parts = value.split("/").map((part) => part.trim());
|
|
@@ -972,7 +1031,7 @@ function createGitHubGetDeploymentTool(ctx) {
|
|
|
972
1031
|
deploymentsBody
|
|
973
1032
|
);
|
|
974
1033
|
}
|
|
975
|
-
const providerDeployment =
|
|
1034
|
+
const providerDeployment = z4.array(providerDeploymentSchema).parse(deploymentsBody)[0];
|
|
976
1035
|
let deployment = null;
|
|
977
1036
|
if (providerDeployment) {
|
|
978
1037
|
const statusesResponse = await ctx.egress.fetch({
|
|
@@ -996,7 +1055,7 @@ function createGitHubGetDeploymentTool(ctx) {
|
|
|
996
1055
|
statusesBody
|
|
997
1056
|
);
|
|
998
1057
|
}
|
|
999
|
-
const providerStatus =
|
|
1058
|
+
const providerStatus = z4.array(providerStatusSchema).parse(statusesBody)[0];
|
|
1000
1059
|
deployment = {
|
|
1001
1060
|
createdAt: providerDeployment.created_at,
|
|
1002
1061
|
creator: providerDeployment.creator?.login ?? null,
|
|
@@ -1040,6 +1099,7 @@ function createGitHubGetDeploymentTool(ctx) {
|
|
|
1040
1099
|
|
|
1041
1100
|
// src/tools/create-pull-request.ts
|
|
1042
1101
|
import {
|
|
1102
|
+
objectFactsSchema as objectFactsSchema2,
|
|
1043
1103
|
definePluginTool as definePluginTool4,
|
|
1044
1104
|
EgressAuthRequired as EgressAuthRequired2,
|
|
1045
1105
|
PluginToolInputError as PluginToolInputError5,
|
|
@@ -1049,7 +1109,7 @@ import {
|
|
|
1049
1109
|
} from "@sentry/junior-plugin-api";
|
|
1050
1110
|
import { Type as Type2 } from "@sinclair/typebox";
|
|
1051
1111
|
import { Value as Value2 } from "@sinclair/typebox/value";
|
|
1052
|
-
import { z as
|
|
1112
|
+
import { z as z5 } from "zod";
|
|
1053
1113
|
var GITHUB_PULL_REQUEST_CREATE_IDEMPOTENCY_TTL_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
1054
1114
|
var GITHUB_PULL_REQUEST_CREATE_LOCK_TTL_MS = 6e4;
|
|
1055
1115
|
var GitHubPullRequestCreateRejectedError = class extends Error {
|
|
@@ -1087,15 +1147,15 @@ var createPullRequestInputSchema = Type2.Object(
|
|
|
1087
1147
|
},
|
|
1088
1148
|
{ additionalProperties: false }
|
|
1089
1149
|
);
|
|
1090
|
-
var createPullRequestToolInputSchema =
|
|
1091
|
-
repo:
|
|
1092
|
-
title:
|
|
1093
|
-
head:
|
|
1094
|
-
base:
|
|
1095
|
-
body:
|
|
1150
|
+
var createPullRequestToolInputSchema = z5.object({
|
|
1151
|
+
repo: z5.string().describe('Repository in "owner/name" format.'),
|
|
1152
|
+
title: z5.string().describe("Pull request title."),
|
|
1153
|
+
head: z5.string().describe("Head branch or owner:branch ref."),
|
|
1154
|
+
base: z5.string().describe("Base branch."),
|
|
1155
|
+
body: z5.string().describe(
|
|
1096
1156
|
"Pull request body. The runtime appends the conversation footer."
|
|
1097
1157
|
).optional(),
|
|
1098
|
-
draft:
|
|
1158
|
+
draft: z5.boolean().describe("Whether to open the pull request as a draft.").optional()
|
|
1099
1159
|
}).strict();
|
|
1100
1160
|
var createPullRequestStateSchema = Type2.Union([
|
|
1101
1161
|
Type2.Object(
|
|
@@ -1103,6 +1163,8 @@ var createPullRequestStateSchema = Type2.Union([
|
|
|
1103
1163
|
createdAtMs: Type2.Number(),
|
|
1104
1164
|
input: Type2.Optional(createPullRequestInputSchema),
|
|
1105
1165
|
number: Type2.Number(),
|
|
1166
|
+
facts: Type2.Optional(Type2.Unknown()),
|
|
1167
|
+
sourceUpdatedAt: Type2.Optional(Type2.String()),
|
|
1106
1168
|
status: Type2.Literal("completed"),
|
|
1107
1169
|
url: Type2.String()
|
|
1108
1170
|
},
|
|
@@ -1117,15 +1179,15 @@ var createPullRequestStateSchema = Type2.Union([
|
|
|
1117
1179
|
{ additionalProperties: false }
|
|
1118
1180
|
)
|
|
1119
1181
|
]);
|
|
1120
|
-
var gitHubPullRequestDataSchema =
|
|
1121
|
-
number:
|
|
1122
|
-
url:
|
|
1182
|
+
var gitHubPullRequestDataSchema = z5.object({
|
|
1183
|
+
number: z5.number(),
|
|
1184
|
+
url: z5.string(),
|
|
1123
1185
|
subscribable: subscribableResourceSchema3.optional(),
|
|
1124
1186
|
subscription: watchResultSchema.optional()
|
|
1125
1187
|
});
|
|
1126
1188
|
var gitHubPullRequestOutputSchema = pluginToolOutputSchema4.merge(
|
|
1127
1189
|
gitHubPullRequestDataSchema.extend({
|
|
1128
|
-
target:
|
|
1190
|
+
target: z5.literal("createPullRequest")
|
|
1129
1191
|
})
|
|
1130
1192
|
);
|
|
1131
1193
|
function parseCreatePullRequestInput(input) {
|
|
@@ -1272,6 +1334,7 @@ async function createGitHubPullRequest(ctx, request) {
|
|
|
1272
1334
|
);
|
|
1273
1335
|
}
|
|
1274
1336
|
return {
|
|
1337
|
+
...githubObjectFacts("code_change", parsed),
|
|
1275
1338
|
number: pullRequest.number,
|
|
1276
1339
|
url: pullRequest.html_url
|
|
1277
1340
|
};
|
|
@@ -1283,7 +1346,11 @@ function gitHubPullRequestToolResult(input, result, canSubscribe, omitSuggestedE
|
|
|
1283
1346
|
repo: `${repo.owner}/${repo.name}`,
|
|
1284
1347
|
...omitSuggestedEvents ? { omitSuggestedEvents } : void 0
|
|
1285
1348
|
}) : void 0;
|
|
1286
|
-
return {
|
|
1349
|
+
return {
|
|
1350
|
+
number: result.number,
|
|
1351
|
+
url: result.url,
|
|
1352
|
+
...subscribable ? { subscribable } : void 0
|
|
1353
|
+
};
|
|
1287
1354
|
}
|
|
1288
1355
|
async function gitHubPullRequestStructuredResult(ctx, input, result, subscriptionConfig) {
|
|
1289
1356
|
const base = gitHubPullRequestToolResult(
|
|
@@ -1293,6 +1360,8 @@ async function gitHubPullRequestStructuredResult(ctx, input, result, subscriptio
|
|
|
1293
1360
|
);
|
|
1294
1361
|
const objectAnnotations = [
|
|
1295
1362
|
githubObjectAnnotation({
|
|
1363
|
+
facts: result.facts,
|
|
1364
|
+
sourceUpdatedAt: result.sourceUpdatedAt,
|
|
1296
1365
|
repo: input.repo,
|
|
1297
1366
|
number: result.number,
|
|
1298
1367
|
title: input.title,
|
|
@@ -1367,6 +1436,8 @@ function createGitHubPullRequestTool(ctx, subscriptionConfig) {
|
|
|
1367
1436
|
if (state?.status === "completed") {
|
|
1368
1437
|
const completedInput = state.input ?? parsedInput;
|
|
1369
1438
|
const completedResult = {
|
|
1439
|
+
facts: state.facts === void 0 ? void 0 : objectFactsSchema2.parse(state.facts),
|
|
1440
|
+
sourceUpdatedAt: state.sourceUpdatedAt,
|
|
1370
1441
|
number: state.number,
|
|
1371
1442
|
url: state.url
|
|
1372
1443
|
};
|
|
@@ -1437,28 +1508,28 @@ import {
|
|
|
1437
1508
|
PluginToolInputError as PluginToolInputError6,
|
|
1438
1509
|
pluginToolOutputSchema as pluginToolOutputSchema5
|
|
1439
1510
|
} from "@sentry/junior-plugin-api";
|
|
1440
|
-
import { z as
|
|
1511
|
+
import { z as z6 } from "zod";
|
|
1441
1512
|
import { subscribableResourceSchema as subscribableResourceSchema4 } from "@sentry/junior-plugin-api";
|
|
1442
|
-
var commitShaSchema2 =
|
|
1443
|
-
var inputSchema3 =
|
|
1444
|
-
repo:
|
|
1445
|
-
number:
|
|
1513
|
+
var commitShaSchema2 = z6.string().regex(/^[0-9a-f]{40}$/i);
|
|
1514
|
+
var inputSchema3 = z6.object({
|
|
1515
|
+
repo: z6.string().describe('Repository in "owner/name" format.'),
|
|
1516
|
+
number: z6.number().int().positive().describe("Pull request number.")
|
|
1446
1517
|
}).strict();
|
|
1447
|
-
var pullRequestSchema =
|
|
1448
|
-
base:
|
|
1449
|
-
draft:
|
|
1450
|
-
head:
|
|
1518
|
+
var pullRequestSchema = z6.object({
|
|
1519
|
+
base: z6.string(),
|
|
1520
|
+
draft: z6.boolean(),
|
|
1521
|
+
head: z6.string(),
|
|
1451
1522
|
headSha: commitShaSchema2,
|
|
1452
|
-
merged:
|
|
1453
|
-
number:
|
|
1454
|
-
state:
|
|
1523
|
+
merged: z6.boolean(),
|
|
1524
|
+
number: z6.number(),
|
|
1525
|
+
state: z6.string(),
|
|
1455
1526
|
subscribable: subscribableResourceSchema4.optional(),
|
|
1456
|
-
title:
|
|
1457
|
-
url:
|
|
1527
|
+
title: z6.string(),
|
|
1528
|
+
url: z6.string()
|
|
1458
1529
|
});
|
|
1459
1530
|
var outputSchema3 = pluginToolOutputSchema5.merge(
|
|
1460
1531
|
pullRequestSchema.extend({
|
|
1461
|
-
target:
|
|
1532
|
+
target: z6.literal("getPullRequest")
|
|
1462
1533
|
})
|
|
1463
1534
|
);
|
|
1464
1535
|
function parseRepo5(value) {
|
|
@@ -1511,15 +1582,15 @@ function createGitHubGetPullRequestTool(ctx) {
|
|
|
1511
1582
|
}
|
|
1512
1583
|
throw new Error(message);
|
|
1513
1584
|
}
|
|
1514
|
-
const providerResult =
|
|
1515
|
-
base:
|
|
1516
|
-
draft:
|
|
1517
|
-
head:
|
|
1518
|
-
html_url:
|
|
1519
|
-
merged:
|
|
1520
|
-
number:
|
|
1521
|
-
state:
|
|
1522
|
-
title:
|
|
1585
|
+
const providerResult = z6.object({
|
|
1586
|
+
base: z6.object({ ref: z6.string() }),
|
|
1587
|
+
draft: z6.boolean(),
|
|
1588
|
+
head: z6.object({ ref: z6.string(), sha: commitShaSchema2 }),
|
|
1589
|
+
html_url: z6.string(),
|
|
1590
|
+
merged: z6.boolean().optional().default(false),
|
|
1591
|
+
number: z6.number(),
|
|
1592
|
+
state: z6.string(),
|
|
1593
|
+
title: z6.string()
|
|
1523
1594
|
}).parse(parsed);
|
|
1524
1595
|
const subscribable = ctx.events.canSubscribe ? gitHubPullRequestSubscribable({
|
|
1525
1596
|
number: providerResult.number,
|
|
@@ -1538,6 +1609,17 @@ function createGitHubGetPullRequestTool(ctx) {
|
|
|
1538
1609
|
url: providerResult.html_url
|
|
1539
1610
|
};
|
|
1540
1611
|
return {
|
|
1612
|
+
objectAnnotations: [
|
|
1613
|
+
githubObjectAnnotation({
|
|
1614
|
+
repo: repo.ref,
|
|
1615
|
+
number: data.number,
|
|
1616
|
+
title: data.title,
|
|
1617
|
+
url: data.url,
|
|
1618
|
+
objectType: "code_change",
|
|
1619
|
+
status: data.merged ? "merged" : data.state === "open" && data.draft ? "draft" : data.state,
|
|
1620
|
+
...githubObjectFacts("code_change", parsed)
|
|
1621
|
+
})
|
|
1622
|
+
],
|
|
1541
1623
|
target: "getPullRequest",
|
|
1542
1624
|
...data
|
|
1543
1625
|
};
|
|
@@ -1552,45 +1634,45 @@ import {
|
|
|
1552
1634
|
pluginToolOutputSchema as pluginToolOutputSchema6,
|
|
1553
1635
|
subscribableResourceSchema as subscribableResourceSchema5
|
|
1554
1636
|
} from "@sentry/junior-plugin-api";
|
|
1555
|
-
import { z as
|
|
1556
|
-
var inputSchema4 =
|
|
1557
|
-
repo:
|
|
1558
|
-
tag:
|
|
1637
|
+
import { z as z7 } from "zod";
|
|
1638
|
+
var inputSchema4 = z7.object({
|
|
1639
|
+
repo: z7.string().describe('Repository in "owner/name" format.'),
|
|
1640
|
+
tag: z7.string().trim().min(1).describe(
|
|
1559
1641
|
"Optional release tag name. Omit to inspect and watch every published release in the repository."
|
|
1560
1642
|
).optional()
|
|
1561
1643
|
}).strict();
|
|
1562
|
-
var releaseSchema =
|
|
1563
|
-
createdAt:
|
|
1564
|
-
draft:
|
|
1565
|
-
htmlUrl:
|
|
1566
|
-
id:
|
|
1567
|
-
name:
|
|
1568
|
-
prerelease:
|
|
1569
|
-
publishedAt:
|
|
1570
|
-
tagName:
|
|
1571
|
-
targetCommitish:
|
|
1644
|
+
var releaseSchema = z7.object({
|
|
1645
|
+
createdAt: z7.string(),
|
|
1646
|
+
draft: z7.boolean(),
|
|
1647
|
+
htmlUrl: z7.string(),
|
|
1648
|
+
id: z7.number(),
|
|
1649
|
+
name: z7.string().nullable(),
|
|
1650
|
+
prerelease: z7.boolean(),
|
|
1651
|
+
publishedAt: z7.string().nullable(),
|
|
1652
|
+
tagName: z7.string(),
|
|
1653
|
+
targetCommitish: z7.string()
|
|
1572
1654
|
}).strict();
|
|
1573
|
-
var releaseSourceSchema =
|
|
1655
|
+
var releaseSourceSchema = z7.object({
|
|
1574
1656
|
release: releaseSchema.nullable(),
|
|
1575
|
-
repo:
|
|
1657
|
+
repo: z7.string(),
|
|
1576
1658
|
subscribable: subscribableResourceSchema5.optional(),
|
|
1577
|
-
tag:
|
|
1659
|
+
tag: z7.string().nullable()
|
|
1578
1660
|
}).strict();
|
|
1579
1661
|
var outputSchema4 = pluginToolOutputSchema6.merge(
|
|
1580
1662
|
releaseSourceSchema.extend({
|
|
1581
|
-
target:
|
|
1663
|
+
target: z7.literal("getRelease")
|
|
1582
1664
|
})
|
|
1583
1665
|
);
|
|
1584
|
-
var providerReleaseSchema =
|
|
1585
|
-
created_at:
|
|
1586
|
-
draft:
|
|
1587
|
-
html_url:
|
|
1588
|
-
id:
|
|
1589
|
-
name:
|
|
1590
|
-
prerelease:
|
|
1591
|
-
published_at:
|
|
1592
|
-
tag_name:
|
|
1593
|
-
target_commitish:
|
|
1666
|
+
var providerReleaseSchema = z7.object({
|
|
1667
|
+
created_at: z7.string(),
|
|
1668
|
+
draft: z7.boolean(),
|
|
1669
|
+
html_url: z7.string(),
|
|
1670
|
+
id: z7.number(),
|
|
1671
|
+
name: z7.string().nullable(),
|
|
1672
|
+
prerelease: z7.boolean(),
|
|
1673
|
+
published_at: z7.string().nullable(),
|
|
1674
|
+
tag_name: z7.string(),
|
|
1675
|
+
target_commitish: z7.string()
|
|
1594
1676
|
}).passthrough();
|
|
1595
1677
|
function parseRepo6(value) {
|
|
1596
1678
|
const parts = value.split("/").map((part) => part.trim());
|
|
@@ -1708,21 +1790,21 @@ import {
|
|
|
1708
1790
|
pluginToolOutputSchema as pluginToolOutputSchema7,
|
|
1709
1791
|
subscribableResourceSchema as subscribableResourceSchema6
|
|
1710
1792
|
} from "@sentry/junior-plugin-api";
|
|
1711
|
-
import { z as
|
|
1712
|
-
var inputSchema5 =
|
|
1713
|
-
repo:
|
|
1793
|
+
import { z as z8 } from "zod";
|
|
1794
|
+
var inputSchema5 = z8.object({
|
|
1795
|
+
repo: z8.string().describe('Repository in "owner/name" format.')
|
|
1714
1796
|
}).strict();
|
|
1715
|
-
var repositorySchema =
|
|
1716
|
-
defaultBranch:
|
|
1717
|
-
description:
|
|
1718
|
-
fullName:
|
|
1719
|
-
private:
|
|
1797
|
+
var repositorySchema = z8.object({
|
|
1798
|
+
defaultBranch: z8.string(),
|
|
1799
|
+
description: z8.string().nullable(),
|
|
1800
|
+
fullName: z8.string(),
|
|
1801
|
+
private: z8.boolean(),
|
|
1720
1802
|
subscribable: subscribableResourceSchema6.optional(),
|
|
1721
|
-
url:
|
|
1803
|
+
url: z8.string()
|
|
1722
1804
|
});
|
|
1723
1805
|
var outputSchema5 = pluginToolOutputSchema7.merge(
|
|
1724
1806
|
repositorySchema.extend({
|
|
1725
|
-
target:
|
|
1807
|
+
target: z8.literal("getRepository")
|
|
1726
1808
|
})
|
|
1727
1809
|
);
|
|
1728
1810
|
function parseRepo7(value) {
|
|
@@ -1773,12 +1855,12 @@ function createGitHubGetRepositoryTool(ctx) {
|
|
|
1773
1855
|
`GitHub repository lookup failed with HTTP ${response.status}`
|
|
1774
1856
|
);
|
|
1775
1857
|
}
|
|
1776
|
-
const providerResult =
|
|
1777
|
-
default_branch:
|
|
1778
|
-
description:
|
|
1779
|
-
full_name:
|
|
1780
|
-
html_url:
|
|
1781
|
-
private:
|
|
1858
|
+
const providerResult = z8.object({
|
|
1859
|
+
default_branch: z8.string(),
|
|
1860
|
+
description: z8.string().nullable(),
|
|
1861
|
+
full_name: z8.string(),
|
|
1862
|
+
html_url: z8.string(),
|
|
1863
|
+
private: z8.boolean()
|
|
1782
1864
|
}).parse(parsed);
|
|
1783
1865
|
const subscribable = ctx.events.canSubscribe ? gitHubRepositorySubscribable({
|
|
1784
1866
|
repo: providerResult.full_name
|
|
@@ -1806,30 +1888,30 @@ import {
|
|
|
1806
1888
|
pluginToolOutputSchema as pluginToolOutputSchema8,
|
|
1807
1889
|
subscribableResourceSchema as subscribableResourceSchema7
|
|
1808
1890
|
} from "@sentry/junior-plugin-api";
|
|
1809
|
-
import { z as
|
|
1810
|
-
var inputSchema6 =
|
|
1811
|
-
repo:
|
|
1812
|
-
number:
|
|
1813
|
-
title:
|
|
1814
|
-
body:
|
|
1891
|
+
import { z as z9 } from "zod";
|
|
1892
|
+
var inputSchema6 = z9.object({
|
|
1893
|
+
repo: z9.string().describe('Repository in "owner/name" format.'),
|
|
1894
|
+
number: z9.number().int().positive().describe("Issue number."),
|
|
1895
|
+
title: z9.string().trim().min(1).optional().describe("Replacement issue title."),
|
|
1896
|
+
body: z9.string().optional().describe(
|
|
1815
1897
|
"Replacement issue body. The runtime appends requester attribution and the conversation footer."
|
|
1816
1898
|
),
|
|
1817
|
-
state:
|
|
1899
|
+
state: z9.enum(["open", "closed"]).optional().describe("Replacement issue state.")
|
|
1818
1900
|
}).strict().refine(
|
|
1819
1901
|
({ title, body, state }) => title !== void 0 || body !== void 0 || state !== void 0,
|
|
1820
1902
|
{ message: "At least one issue field must be provided." }
|
|
1821
1903
|
);
|
|
1822
|
-
var issueSchema =
|
|
1823
|
-
body:
|
|
1824
|
-
number:
|
|
1825
|
-
state:
|
|
1904
|
+
var issueSchema = z9.object({
|
|
1905
|
+
body: z9.string().nullable(),
|
|
1906
|
+
number: z9.number(),
|
|
1907
|
+
state: z9.string(),
|
|
1826
1908
|
subscribable: subscribableResourceSchema7.optional(),
|
|
1827
|
-
title:
|
|
1828
|
-
url:
|
|
1909
|
+
title: z9.string(),
|
|
1910
|
+
url: z9.string()
|
|
1829
1911
|
});
|
|
1830
1912
|
var outputSchema6 = pluginToolOutputSchema8.merge(
|
|
1831
1913
|
issueSchema.extend({
|
|
1832
|
-
target:
|
|
1914
|
+
target: z9.literal("updateIssue")
|
|
1833
1915
|
})
|
|
1834
1916
|
);
|
|
1835
1917
|
function nonEmptyString4(value, name) {
|
|
@@ -1913,12 +1995,12 @@ function createGitHubUpdateIssueTool(ctx) {
|
|
|
1913
1995
|
`GitHub issue update failed with HTTP ${response.status}: ${githubApiErrorMessage3(parsed)}`
|
|
1914
1996
|
);
|
|
1915
1997
|
}
|
|
1916
|
-
const providerResult =
|
|
1917
|
-
body:
|
|
1918
|
-
html_url:
|
|
1919
|
-
number:
|
|
1920
|
-
state:
|
|
1921
|
-
title:
|
|
1998
|
+
const providerResult = z9.object({
|
|
1999
|
+
body: z9.string().nullable().optional().default(null),
|
|
2000
|
+
html_url: z9.string(),
|
|
2001
|
+
number: z9.number(),
|
|
2002
|
+
state: z9.string(),
|
|
2003
|
+
title: z9.string()
|
|
1922
2004
|
}).parse(parsed);
|
|
1923
2005
|
const subscribable = ctx.events.canSubscribe ? gitHubIssueSubscribable({
|
|
1924
2006
|
number: providerResult.number,
|
|
@@ -1927,6 +2009,7 @@ function createGitHubUpdateIssueTool(ctx) {
|
|
|
1927
2009
|
return {
|
|
1928
2010
|
objectAnnotations: [
|
|
1929
2011
|
githubObjectAnnotation({
|
|
2012
|
+
...githubObjectFacts("task", parsed),
|
|
1930
2013
|
repo: repo.ref,
|
|
1931
2014
|
number: providerResult.number,
|
|
1932
2015
|
title: providerResult.title,
|
|
@@ -1953,34 +2036,34 @@ import {
|
|
|
1953
2036
|
PluginToolInputError as PluginToolInputError10,
|
|
1954
2037
|
pluginToolOutputSchema as pluginToolOutputSchema9
|
|
1955
2038
|
} from "@sentry/junior-plugin-api";
|
|
1956
|
-
import { z as
|
|
2039
|
+
import { z as z10 } from "zod";
|
|
1957
2040
|
import { subscribableResourceSchema as subscribableResourceSchema8 } from "@sentry/junior-plugin-api";
|
|
1958
|
-
var inputSchema7 =
|
|
1959
|
-
repo:
|
|
1960
|
-
number:
|
|
1961
|
-
title:
|
|
1962
|
-
body:
|
|
2041
|
+
var inputSchema7 = z10.object({
|
|
2042
|
+
repo: z10.string().describe('Repository in "owner/name" format.'),
|
|
2043
|
+
number: z10.number().int().positive().describe("Pull request number."),
|
|
2044
|
+
title: z10.string().trim().min(1).optional().describe("Replacement pull request title."),
|
|
2045
|
+
body: z10.string().optional().describe(
|
|
1963
2046
|
"Replacement pull request body. The runtime appends requester attribution and the conversation footer."
|
|
1964
2047
|
),
|
|
1965
|
-
base:
|
|
1966
|
-
state:
|
|
2048
|
+
base: z10.string().trim().min(1).optional().describe("Replacement base branch."),
|
|
2049
|
+
state: z10.enum(["open", "closed"]).optional().describe("Replacement pull request state.")
|
|
1967
2050
|
}).strict().refine(
|
|
1968
2051
|
({ title, body, base, state }) => title !== void 0 || body !== void 0 || base !== void 0 || state !== void 0,
|
|
1969
2052
|
{ message: "At least one pull request field must be provided." }
|
|
1970
2053
|
);
|
|
1971
|
-
var pullRequestSchema2 =
|
|
1972
|
-
base:
|
|
1973
|
-
body:
|
|
1974
|
-
draft:
|
|
1975
|
-
number:
|
|
1976
|
-
state:
|
|
2054
|
+
var pullRequestSchema2 = z10.object({
|
|
2055
|
+
base: z10.string(),
|
|
2056
|
+
body: z10.string().nullable(),
|
|
2057
|
+
draft: z10.boolean(),
|
|
2058
|
+
number: z10.number(),
|
|
2059
|
+
state: z10.string(),
|
|
1977
2060
|
subscribable: subscribableResourceSchema8.optional(),
|
|
1978
|
-
title:
|
|
1979
|
-
url:
|
|
2061
|
+
title: z10.string(),
|
|
2062
|
+
url: z10.string()
|
|
1980
2063
|
});
|
|
1981
2064
|
var outputSchema7 = pluginToolOutputSchema9.merge(
|
|
1982
2065
|
pullRequestSchema2.extend({
|
|
1983
|
-
target:
|
|
2066
|
+
target: z10.literal("updatePullRequest")
|
|
1984
2067
|
})
|
|
1985
2068
|
);
|
|
1986
2069
|
function nonEmptyString5(value, name) {
|
|
@@ -2068,15 +2151,15 @@ function createGitHubUpdatePullRequestTool(ctx) {
|
|
|
2068
2151
|
`GitHub pull request update failed with HTTP ${response.status}: ${githubApiErrorMessage4(parsed)}`
|
|
2069
2152
|
);
|
|
2070
2153
|
}
|
|
2071
|
-
const providerResult =
|
|
2072
|
-
base:
|
|
2073
|
-
body:
|
|
2074
|
-
draft:
|
|
2075
|
-
html_url:
|
|
2076
|
-
merged:
|
|
2077
|
-
number:
|
|
2078
|
-
state:
|
|
2079
|
-
title:
|
|
2154
|
+
const providerResult = z10.object({
|
|
2155
|
+
base: z10.object({ ref: z10.string() }),
|
|
2156
|
+
body: z10.string().nullable().optional().default(null),
|
|
2157
|
+
draft: z10.boolean(),
|
|
2158
|
+
html_url: z10.string(),
|
|
2159
|
+
merged: z10.boolean(),
|
|
2160
|
+
number: z10.number(),
|
|
2161
|
+
state: z10.string(),
|
|
2162
|
+
title: z10.string()
|
|
2080
2163
|
}).parse(parsed);
|
|
2081
2164
|
const subscribable = ctx.events.canSubscribe ? gitHubPullRequestSubscribable({
|
|
2082
2165
|
number: providerResult.number,
|
|
@@ -2095,6 +2178,7 @@ function createGitHubUpdatePullRequestTool(ctx) {
|
|
|
2095
2178
|
return {
|
|
2096
2179
|
objectAnnotations: [
|
|
2097
2180
|
githubObjectAnnotation({
|
|
2181
|
+
...githubObjectFacts("code_change", parsed),
|
|
2098
2182
|
repo: repo.ref,
|
|
2099
2183
|
number: providerResult.number,
|
|
2100
2184
|
title: providerResult.title,
|
|
@@ -2116,7 +2200,7 @@ import {
|
|
|
2116
2200
|
PluginToolInputError as PluginToolInputError11,
|
|
2117
2201
|
pluginToolOutputSchema as pluginToolOutputSchema10
|
|
2118
2202
|
} from "@sentry/junior-plugin-api";
|
|
2119
|
-
import { z as
|
|
2203
|
+
import { z as z11 } from "zod";
|
|
2120
2204
|
|
|
2121
2205
|
// src/webhooks/ownership.ts
|
|
2122
2206
|
var GITHUB_BOT_NOREPLY_EMAIL = /^(?<userId>[1-9]\d*)\+(?<login>[^@]+\[bot\])@users\.noreply\.github\.com$/i;
|
|
@@ -2144,24 +2228,24 @@ var STATUS_TO_REACTION_CONTENT = {
|
|
|
2144
2228
|
var FEEDBACK_REACTION_CONTENTS = new Set(
|
|
2145
2229
|
Object.values(STATUS_TO_REACTION_CONTENT)
|
|
2146
2230
|
);
|
|
2147
|
-
var inputSchema8 =
|
|
2148
|
-
repo:
|
|
2149
|
-
commentKind:
|
|
2231
|
+
var inputSchema8 = z11.object({
|
|
2232
|
+
repo: z11.string().describe('Repository in "owner/name" format.'),
|
|
2233
|
+
commentKind: z11.enum(["conversation", "review"]).describe(
|
|
2150
2234
|
'Comment kind: "conversation" for a pull request conversation comment, "review" for an inline review comment.'
|
|
2151
2235
|
),
|
|
2152
|
-
commentId:
|
|
2236
|
+
commentId: z11.number().int().positive().describe(
|
|
2153
2237
|
"GitHub comment id (conversation comment id or inline review comment id)."
|
|
2154
2238
|
),
|
|
2155
|
-
status:
|
|
2239
|
+
status: z11.enum(["addressed", "declined"]).describe(
|
|
2156
2240
|
"Feedback outcome. Maps to a reaction: addressed -> +1, declined -> -1."
|
|
2157
2241
|
)
|
|
2158
2242
|
}).strict();
|
|
2159
2243
|
var outputSchema8 = pluginToolOutputSchema10.extend({
|
|
2160
|
-
target:
|
|
2161
|
-
repo:
|
|
2162
|
-
commentId:
|
|
2163
|
-
status:
|
|
2164
|
-
reactionId:
|
|
2244
|
+
target: z11.literal("updatePullRequestFeedback"),
|
|
2245
|
+
repo: z11.string(),
|
|
2246
|
+
commentId: z11.number(),
|
|
2247
|
+
status: z11.enum(["addressed", "declined"]),
|
|
2248
|
+
reactionId: z11.number()
|
|
2165
2249
|
});
|
|
2166
2250
|
function parseRepo10(value) {
|
|
2167
2251
|
const parts = value.split("/").map((part) => part.trim());
|
|
@@ -2193,10 +2277,10 @@ function githubError(payload) {
|
|
|
2193
2277
|
}
|
|
2194
2278
|
return "GitHub request failed";
|
|
2195
2279
|
}
|
|
2196
|
-
var reactionSchema =
|
|
2197
|
-
id:
|
|
2198
|
-
content:
|
|
2199
|
-
user:
|
|
2280
|
+
var reactionSchema = z11.object({
|
|
2281
|
+
id: z11.number(),
|
|
2282
|
+
content: z11.string(),
|
|
2283
|
+
user: z11.object({ id: z11.number() }).nullable()
|
|
2200
2284
|
});
|
|
2201
2285
|
function createGitHubUpdatePullRequestFeedbackTool(ctx, botEmail) {
|
|
2202
2286
|
return definePluginTool10({
|
|
@@ -2244,7 +2328,7 @@ function createGitHubUpdatePullRequestFeedbackTool(ctx, botEmail) {
|
|
|
2244
2328
|
`GitHub reaction lookup failed with HTTP ${listResponse.status}: ${githubError(listPayload)}`
|
|
2245
2329
|
);
|
|
2246
2330
|
}
|
|
2247
|
-
const botReactions =
|
|
2331
|
+
const botReactions = z11.array(reactionSchema).parse(listPayload).filter(
|
|
2248
2332
|
(reaction) => reaction.user?.id === botUserId && FEEDBACK_REACTION_CONTENTS.has(reaction.content)
|
|
2249
2333
|
);
|
|
2250
2334
|
const existing = botReactions.find(
|
|
@@ -2311,21 +2395,21 @@ import {
|
|
|
2311
2395
|
PluginToolInputError as PluginToolInputError12,
|
|
2312
2396
|
pluginToolOutputSchema as pluginToolOutputSchema11
|
|
2313
2397
|
} from "@sentry/junior-plugin-api";
|
|
2314
|
-
import { z as
|
|
2315
|
-
var inputSchema9 =
|
|
2316
|
-
repo:
|
|
2398
|
+
import { z as z12 } from "zod";
|
|
2399
|
+
var inputSchema9 = z12.object({
|
|
2400
|
+
repo: z12.string().describe(
|
|
2317
2401
|
'Repository in "owner/name" format. Required because GraphQL has no repo path.'
|
|
2318
2402
|
),
|
|
2319
|
-
threadId:
|
|
2403
|
+
threadId: z12.string().trim().min(1).describe(
|
|
2320
2404
|
"GitHub pull request review thread node ID (the same `threadId` / `id` variable used by `gh api graphql` resolveReviewThread)."
|
|
2321
2405
|
)
|
|
2322
2406
|
}).strict();
|
|
2323
2407
|
var outputSchema9 = pluginToolOutputSchema11.extend({
|
|
2324
|
-
target:
|
|
2325
|
-
repo:
|
|
2326
|
-
number:
|
|
2327
|
-
threadId:
|
|
2328
|
-
resolved:
|
|
2408
|
+
target: z12.literal("resolvePullRequestReviewThread"),
|
|
2409
|
+
repo: z12.string(),
|
|
2410
|
+
number: z12.number(),
|
|
2411
|
+
threadId: z12.string(),
|
|
2412
|
+
resolved: z12.boolean()
|
|
2329
2413
|
});
|
|
2330
2414
|
function parseRepo11(value) {
|
|
2331
2415
|
const parts = value.split("/").map((part) => part.trim());
|
|
@@ -2407,18 +2491,18 @@ function createGitHubResolvePullRequestReviewThreadTool(ctx, botEmail) {
|
|
|
2407
2491
|
`GitHub review thread lookup failed with HTTP ${lookupResponse.status}: ${githubError2(lookupPayload)}`
|
|
2408
2492
|
);
|
|
2409
2493
|
}
|
|
2410
|
-
const threadNodeSchema =
|
|
2411
|
-
id:
|
|
2412
|
-
isResolved:
|
|
2413
|
-
pullRequest:
|
|
2414
|
-
author:
|
|
2415
|
-
number:
|
|
2416
|
-
repository:
|
|
2494
|
+
const threadNodeSchema = z12.object({
|
|
2495
|
+
id: z12.string(),
|
|
2496
|
+
isResolved: z12.boolean(),
|
|
2497
|
+
pullRequest: z12.object({
|
|
2498
|
+
author: z12.object({ databaseId: z12.number().optional() }).passthrough().nullable(),
|
|
2499
|
+
number: z12.number(),
|
|
2500
|
+
repository: z12.object({ nameWithOwner: z12.string() }).passthrough()
|
|
2417
2501
|
}).passthrough()
|
|
2418
2502
|
}).passthrough();
|
|
2419
|
-
const lookupResultSchema =
|
|
2420
|
-
data:
|
|
2421
|
-
node:
|
|
2503
|
+
const lookupResultSchema = z12.object({
|
|
2504
|
+
data: z12.object({
|
|
2505
|
+
node: z12.unknown().nullable().optional()
|
|
2422
2506
|
}).passthrough()
|
|
2423
2507
|
}).passthrough();
|
|
2424
2508
|
const lookupResult = lookupResultSchema.safeParse(lookupPayload);
|
|
@@ -2468,10 +2552,10 @@ function createGitHubResolvePullRequestReviewThreadTool(ctx, botEmail) {
|
|
|
2468
2552
|
`GitHub review thread resolution failed with HTTP ${resolveResponse.status}: ${githubError2(resolvePayload)}`
|
|
2469
2553
|
);
|
|
2470
2554
|
}
|
|
2471
|
-
const resolveResultSchema =
|
|
2472
|
-
data:
|
|
2473
|
-
resolveReviewThread:
|
|
2474
|
-
thread:
|
|
2555
|
+
const resolveResultSchema = z12.object({
|
|
2556
|
+
data: z12.object({
|
|
2557
|
+
resolveReviewThread: z12.object({
|
|
2558
|
+
thread: z12.object({ id: z12.string(), isResolved: z12.boolean() }).passthrough()
|
|
2475
2559
|
}).passthrough()
|
|
2476
2560
|
}).passthrough()
|
|
2477
2561
|
}).passthrough();
|
|
@@ -2503,32 +2587,32 @@ import {
|
|
|
2503
2587
|
PluginToolInputError as PluginToolInputError13,
|
|
2504
2588
|
pluginToolOutputSchema as pluginToolOutputSchema12
|
|
2505
2589
|
} from "@sentry/junior-plugin-api";
|
|
2506
|
-
import { z as
|
|
2507
|
-
var reviewCommentSchema =
|
|
2508
|
-
path:
|
|
2509
|
-
body:
|
|
2510
|
-
line:
|
|
2511
|
-
side:
|
|
2512
|
-
startLine:
|
|
2513
|
-
startSide:
|
|
2590
|
+
import { z as z13 } from "zod";
|
|
2591
|
+
var reviewCommentSchema = z13.object({
|
|
2592
|
+
path: z13.string().trim().min(1).describe("File path in the pull request."),
|
|
2593
|
+
body: z13.string().trim().min(1).describe("Inline review comment."),
|
|
2594
|
+
line: z13.number().int().positive().describe("Line in the pull request diff."),
|
|
2595
|
+
side: z13.enum(["LEFT", "RIGHT"]).describe("Side of the pull request diff."),
|
|
2596
|
+
startLine: z13.number().int().positive().optional().describe("First line of a multi-line comment."),
|
|
2597
|
+
startSide: z13.enum(["LEFT", "RIGHT"]).optional().describe("First side of a multi-line comment.")
|
|
2514
2598
|
}).strict().refine(
|
|
2515
2599
|
({ startLine, startSide }) => startLine === void 0 === (startSide === void 0),
|
|
2516
2600
|
{ message: "startLine and startSide must be provided together." }
|
|
2517
2601
|
);
|
|
2518
|
-
var inputSchema10 =
|
|
2519
|
-
repo:
|
|
2520
|
-
number:
|
|
2521
|
-
event:
|
|
2522
|
-
body:
|
|
2523
|
-
comments:
|
|
2602
|
+
var inputSchema10 = z13.object({
|
|
2603
|
+
repo: z13.string().describe('Repository in "owner/name" format.'),
|
|
2604
|
+
number: z13.number().int().positive().describe("Pull request number."),
|
|
2605
|
+
event: z13.enum(["COMMENT", "REQUEST_CHANGES"]).describe("Review result. Junior cannot approve pull requests."),
|
|
2606
|
+
body: z13.string().trim().min(1).describe("Review summary."),
|
|
2607
|
+
comments: z13.array(reviewCommentSchema).optional().describe("Optional inline review comments.")
|
|
2524
2608
|
}).strict();
|
|
2525
2609
|
var outputSchema10 = pluginToolOutputSchema12.extend({
|
|
2526
|
-
target:
|
|
2527
|
-
repo:
|
|
2528
|
-
number:
|
|
2529
|
-
reviewId:
|
|
2530
|
-
state:
|
|
2531
|
-
url:
|
|
2610
|
+
target: z13.literal("submitPullRequestReview"),
|
|
2611
|
+
repo: z13.string(),
|
|
2612
|
+
number: z13.number(),
|
|
2613
|
+
reviewId: z13.number(),
|
|
2614
|
+
state: z13.string(),
|
|
2615
|
+
url: z13.string()
|
|
2532
2616
|
});
|
|
2533
2617
|
function parseRepo12(value) {
|
|
2534
2618
|
const parts = value.split("/").map((part) => part.trim());
|
|
@@ -2607,7 +2691,7 @@ function createGitHubSubmitPullRequestReviewTool(egress) {
|
|
|
2607
2691
|
if (!response.ok) {
|
|
2608
2692
|
throwReviewError(response.status, parsed);
|
|
2609
2693
|
}
|
|
2610
|
-
const providerResult =
|
|
2694
|
+
const providerResult = z13.object({ id: z13.number(), html_url: z13.string(), state: z13.string() }).parse(parsed);
|
|
2611
2695
|
return {
|
|
2612
2696
|
target: "submitPullRequestReview",
|
|
2613
2697
|
repo: repo.ref,
|
|
@@ -2651,7 +2735,7 @@ import { createHmac, timingSafeEqual } from "crypto";
|
|
|
2651
2735
|
|
|
2652
2736
|
// src/issue-outcomes/store.ts
|
|
2653
2737
|
import { and, eq, lte, sql as sql2 } from "drizzle-orm";
|
|
2654
|
-
import { z as
|
|
2738
|
+
import { z as z15 } from "zod";
|
|
2655
2739
|
|
|
2656
2740
|
// src/db/schema.ts
|
|
2657
2741
|
import { sql } from "drizzle-orm";
|
|
@@ -2663,18 +2747,18 @@ import {
|
|
|
2663
2747
|
text,
|
|
2664
2748
|
timestamp
|
|
2665
2749
|
} from "drizzle-orm/pg-core";
|
|
2666
|
-
import { z as
|
|
2667
|
-
var githubPullRequestStateSchema =
|
|
2750
|
+
import { z as z14 } from "zod";
|
|
2751
|
+
var githubPullRequestStateSchema = z14.enum([
|
|
2668
2752
|
"closed_unmerged",
|
|
2669
2753
|
"merged",
|
|
2670
2754
|
"open"
|
|
2671
2755
|
]);
|
|
2672
|
-
var githubPullRequestCommitCompositionSchema =
|
|
2756
|
+
var githubPullRequestCommitCompositionSchema = z14.enum([
|
|
2673
2757
|
"junior_only",
|
|
2674
2758
|
"mixed"
|
|
2675
2759
|
]);
|
|
2676
|
-
var githubIssueStateSchema =
|
|
2677
|
-
var githubIssueStateReasonSchema =
|
|
2760
|
+
var githubIssueStateSchema = z14.enum(["closed", "open"]);
|
|
2761
|
+
var githubIssueStateReasonSchema = z14.enum([
|
|
2678
2762
|
"completed",
|
|
2679
2763
|
"duplicate",
|
|
2680
2764
|
"not_planned",
|
|
@@ -2744,21 +2828,21 @@ var juniorGitHubPullRequestIssues = pgTable(
|
|
|
2744
2828
|
);
|
|
2745
2829
|
|
|
2746
2830
|
// src/issue-outcomes/store.ts
|
|
2747
|
-
var githubIssueOutcomeInputSchema =
|
|
2748
|
-
candidateOwned:
|
|
2749
|
-
closedAt:
|
|
2750
|
-
issueId:
|
|
2751
|
-
number:
|
|
2752
|
-
openedAt:
|
|
2753
|
-
repositoryFullName:
|
|
2754
|
-
repositoryId:
|
|
2831
|
+
var githubIssueOutcomeInputSchema = z15.object({
|
|
2832
|
+
candidateOwned: z15.boolean(),
|
|
2833
|
+
closedAt: z15.date().optional(),
|
|
2834
|
+
issueId: z15.string().min(1),
|
|
2835
|
+
number: z15.number().int().positive(),
|
|
2836
|
+
openedAt: z15.date(),
|
|
2837
|
+
repositoryFullName: z15.string().min(1),
|
|
2838
|
+
repositoryId: z15.string().min(1),
|
|
2755
2839
|
state: githubIssueStateSchema,
|
|
2756
2840
|
stateReason: githubIssueStateReasonSchema.optional(),
|
|
2757
|
-
updatedAt:
|
|
2841
|
+
updatedAt: z15.date()
|
|
2758
2842
|
}).strict();
|
|
2759
|
-
var githubIssueConversationsInputSchema =
|
|
2760
|
-
conversationIds:
|
|
2761
|
-
issueId:
|
|
2843
|
+
var githubIssueConversationsInputSchema = z15.object({
|
|
2844
|
+
conversationIds: z15.array(z15.string().min(1)).min(1),
|
|
2845
|
+
issueId: z15.string().min(1)
|
|
2762
2846
|
}).strict();
|
|
2763
2847
|
function projectionValues(input) {
|
|
2764
2848
|
return {
|
|
@@ -2822,33 +2906,33 @@ async function recordGitHubIssueConversations(db, input) {
|
|
|
2822
2906
|
|
|
2823
2907
|
// src/pull-request-outcomes/store.ts
|
|
2824
2908
|
import { and as and2, eq as eq2, lte as lte2, ne, sql as sql3 } from "drizzle-orm";
|
|
2825
|
-
import { z as
|
|
2826
|
-
var githubPullRequestOutcomeInputSchema =
|
|
2827
|
-
candidateOwned:
|
|
2828
|
-
closedAt:
|
|
2909
|
+
import { z as z16 } from "zod";
|
|
2910
|
+
var githubPullRequestOutcomeInputSchema = z16.object({
|
|
2911
|
+
candidateOwned: z16.boolean(),
|
|
2912
|
+
closedAt: z16.date().optional(),
|
|
2829
2913
|
commitComposition: githubPullRequestCommitCompositionSchema.optional(),
|
|
2830
|
-
mergedAt:
|
|
2831
|
-
number:
|
|
2832
|
-
openedAt:
|
|
2833
|
-
pullRequestId:
|
|
2834
|
-
repositoryFullName:
|
|
2835
|
-
repositoryId:
|
|
2914
|
+
mergedAt: z16.date().optional(),
|
|
2915
|
+
number: z16.number().int().positive(),
|
|
2916
|
+
openedAt: z16.date(),
|
|
2917
|
+
pullRequestId: z16.string().min(1),
|
|
2918
|
+
repositoryFullName: z16.string().min(1),
|
|
2919
|
+
repositoryId: z16.string().min(1),
|
|
2836
2920
|
state: githubPullRequestStateSchema,
|
|
2837
|
-
title:
|
|
2838
|
-
updatedAt:
|
|
2921
|
+
title: z16.string().min(1).optional(),
|
|
2922
|
+
updatedAt: z16.date()
|
|
2839
2923
|
}).strict();
|
|
2840
|
-
var githubPullRequestConversationsInputSchema =
|
|
2841
|
-
conversationIds:
|
|
2842
|
-
pullRequestId:
|
|
2924
|
+
var githubPullRequestConversationsInputSchema = z16.object({
|
|
2925
|
+
conversationIds: z16.array(z16.string().min(1)).min(1),
|
|
2926
|
+
pullRequestId: z16.string().min(1)
|
|
2843
2927
|
}).strict();
|
|
2844
|
-
var githubPullRequestLinkedIssuesInputSchema =
|
|
2845
|
-
linkedIssues:
|
|
2846
|
-
|
|
2847
|
-
number:
|
|
2848
|
-
repositoryFullName:
|
|
2928
|
+
var githubPullRequestLinkedIssuesInputSchema = z16.object({
|
|
2929
|
+
linkedIssues: z16.array(
|
|
2930
|
+
z16.object({
|
|
2931
|
+
number: z16.number().int().positive(),
|
|
2932
|
+
repositoryFullName: z16.string().min(1)
|
|
2849
2933
|
}).strict()
|
|
2850
2934
|
).min(1),
|
|
2851
|
-
pullRequestId:
|
|
2935
|
+
pullRequestId: z16.string().min(1)
|
|
2852
2936
|
}).strict();
|
|
2853
2937
|
function projectionValues2(input) {
|
|
2854
2938
|
return {
|
|
@@ -3013,39 +3097,39 @@ async function recordGitHubPullRequestLinkedIssues(db, input) {
|
|
|
3013
3097
|
}
|
|
3014
3098
|
|
|
3015
3099
|
// src/webhooks/issue-outcome.ts
|
|
3016
|
-
import { z as
|
|
3017
|
-
var canonicalIssueOutcomeSchema =
|
|
3018
|
-
action:
|
|
3019
|
-
issue:
|
|
3020
|
-
body:
|
|
3021
|
-
closed_at:
|
|
3022
|
-
created_at:
|
|
3023
|
-
id:
|
|
3024
|
-
number:
|
|
3100
|
+
import { z as z17 } from "zod";
|
|
3101
|
+
var canonicalIssueOutcomeSchema = z17.object({
|
|
3102
|
+
action: z17.enum(["opened", "closed", "reopened"]),
|
|
3103
|
+
issue: z17.object({
|
|
3104
|
+
body: z17.string().nullable().optional(),
|
|
3105
|
+
closed_at: z17.string().nullable().optional(),
|
|
3106
|
+
created_at: z17.string(),
|
|
3107
|
+
id: z17.number().int().positive(),
|
|
3108
|
+
number: z17.number().int().positive(),
|
|
3025
3109
|
state_reason: githubIssueStateReasonSchema.nullable().optional(),
|
|
3026
|
-
updated_at:
|
|
3027
|
-
user:
|
|
3110
|
+
updated_at: z17.string(),
|
|
3111
|
+
user: z17.object({ login: z17.string().min(1) }).strict()
|
|
3028
3112
|
}).strict(),
|
|
3029
|
-
repository:
|
|
3030
|
-
full_name:
|
|
3031
|
-
id:
|
|
3113
|
+
repository: z17.object({
|
|
3114
|
+
full_name: z17.string().min(1),
|
|
3115
|
+
id: z17.number().int().positive()
|
|
3032
3116
|
}).strict()
|
|
3033
3117
|
}).strict();
|
|
3034
|
-
var issueOutcomeSchema =
|
|
3035
|
-
action:
|
|
3036
|
-
issue:
|
|
3037
|
-
body:
|
|
3038
|
-
closed_at:
|
|
3039
|
-
created_at:
|
|
3040
|
-
id:
|
|
3041
|
-
number:
|
|
3118
|
+
var issueOutcomeSchema = z17.object({
|
|
3119
|
+
action: z17.enum(["opened", "closed", "reopened"]),
|
|
3120
|
+
issue: z17.object({
|
|
3121
|
+
body: z17.string().nullable().optional(),
|
|
3122
|
+
closed_at: z17.string().nullable().optional(),
|
|
3123
|
+
created_at: z17.string(),
|
|
3124
|
+
id: z17.number().int().positive(),
|
|
3125
|
+
number: z17.number().int().positive(),
|
|
3042
3126
|
state_reason: githubIssueStateReasonSchema.nullable().optional(),
|
|
3043
|
-
updated_at:
|
|
3044
|
-
user:
|
|
3127
|
+
updated_at: z17.string(),
|
|
3128
|
+
user: z17.object({ login: z17.string().min(1) }).passthrough()
|
|
3045
3129
|
}).passthrough(),
|
|
3046
|
-
repository:
|
|
3047
|
-
full_name:
|
|
3048
|
-
id:
|
|
3130
|
+
repository: z17.object({
|
|
3131
|
+
full_name: z17.string().min(1),
|
|
3132
|
+
id: z17.number().int().positive()
|
|
3049
3133
|
}).passthrough()
|
|
3050
3134
|
}).passthrough().transform(
|
|
3051
3135
|
(provider) => canonicalIssueOutcomeSchema.parse({
|
|
@@ -3066,7 +3150,7 @@ var issueOutcomeSchema = z16.object({
|
|
|
3066
3150
|
}
|
|
3067
3151
|
})
|
|
3068
3152
|
);
|
|
3069
|
-
var issueLifecycleActionSchema =
|
|
3153
|
+
var issueLifecycleActionSchema = z17.object({ action: z17.string() }).passthrough();
|
|
3070
3154
|
function timestamp2(value) {
|
|
3071
3155
|
if (!value) return void 0;
|
|
3072
3156
|
const parsed = new Date(value);
|
|
@@ -3112,21 +3196,21 @@ function normalizeGitHubIssueOutcome(args) {
|
|
|
3112
3196
|
updatedAt
|
|
3113
3197
|
};
|
|
3114
3198
|
}
|
|
3115
|
-
var canonicalIssueConversationSchema =
|
|
3116
|
-
issue:
|
|
3117
|
-
body:
|
|
3118
|
-
id:
|
|
3119
|
-
user:
|
|
3199
|
+
var canonicalIssueConversationSchema = z17.object({
|
|
3200
|
+
issue: z17.object({
|
|
3201
|
+
body: z17.string().nullable().optional(),
|
|
3202
|
+
id: z17.number().int().positive(),
|
|
3203
|
+
user: z17.object({ login: z17.string().min(1) }).strict()
|
|
3120
3204
|
}).strict(),
|
|
3121
|
-
sender:
|
|
3205
|
+
sender: z17.object({ login: z17.string().min(1) }).strict().optional()
|
|
3122
3206
|
}).strict();
|
|
3123
|
-
var issueConversationSchema =
|
|
3124
|
-
issue:
|
|
3125
|
-
body:
|
|
3126
|
-
id:
|
|
3127
|
-
user:
|
|
3207
|
+
var issueConversationSchema = z17.object({
|
|
3208
|
+
issue: z17.object({
|
|
3209
|
+
body: z17.string().nullable().optional(),
|
|
3210
|
+
id: z17.number().int().positive(),
|
|
3211
|
+
user: z17.object({ login: z17.string().min(1) }).passthrough()
|
|
3128
3212
|
}).passthrough(),
|
|
3129
|
-
sender:
|
|
3213
|
+
sender: z17.object({ login: z17.string().min(1) }).passthrough().optional()
|
|
3130
3214
|
}).passthrough().transform(
|
|
3131
3215
|
(provider) => canonicalIssueConversationSchema.parse({
|
|
3132
3216
|
issue: {
|
|
@@ -3153,43 +3237,43 @@ function normalizeGitHubIssueConversations(args) {
|
|
|
3153
3237
|
}
|
|
3154
3238
|
|
|
3155
3239
|
// src/webhooks/pull-request-outcome.ts
|
|
3156
|
-
import { z as
|
|
3157
|
-
var canonicalPullRequestOutcomeSchema =
|
|
3158
|
-
action:
|
|
3159
|
-
pull_request:
|
|
3160
|
-
body:
|
|
3161
|
-
closed_at:
|
|
3162
|
-
created_at:
|
|
3163
|
-
id:
|
|
3164
|
-
merged:
|
|
3165
|
-
merged_at:
|
|
3166
|
-
number:
|
|
3167
|
-
title:
|
|
3168
|
-
updated_at:
|
|
3169
|
-
user:
|
|
3240
|
+
import { z as z18 } from "zod";
|
|
3241
|
+
var canonicalPullRequestOutcomeSchema = z18.object({
|
|
3242
|
+
action: z18.enum(["opened", "closed", "reopened"]),
|
|
3243
|
+
pull_request: z18.object({
|
|
3244
|
+
body: z18.string().nullable().optional(),
|
|
3245
|
+
closed_at: z18.string().nullable().optional(),
|
|
3246
|
+
created_at: z18.string(),
|
|
3247
|
+
id: z18.number().int().positive(),
|
|
3248
|
+
merged: z18.boolean(),
|
|
3249
|
+
merged_at: z18.string().nullable().optional(),
|
|
3250
|
+
number: z18.number().int().positive(),
|
|
3251
|
+
title: z18.string().min(1).optional(),
|
|
3252
|
+
updated_at: z18.string(),
|
|
3253
|
+
user: z18.object({ login: z18.string().min(1) }).strict()
|
|
3170
3254
|
}).strict(),
|
|
3171
|
-
repository:
|
|
3172
|
-
full_name:
|
|
3173
|
-
id:
|
|
3255
|
+
repository: z18.object({
|
|
3256
|
+
full_name: z18.string().min(1),
|
|
3257
|
+
id: z18.number().int().positive()
|
|
3174
3258
|
}).strict()
|
|
3175
3259
|
}).strict();
|
|
3176
|
-
var pullRequestOutcomeSchema =
|
|
3177
|
-
action:
|
|
3178
|
-
pull_request:
|
|
3179
|
-
body:
|
|
3180
|
-
closed_at:
|
|
3181
|
-
created_at:
|
|
3182
|
-
id:
|
|
3183
|
-
merged:
|
|
3184
|
-
merged_at:
|
|
3185
|
-
number:
|
|
3186
|
-
title:
|
|
3187
|
-
updated_at:
|
|
3188
|
-
user:
|
|
3260
|
+
var pullRequestOutcomeSchema = z18.object({
|
|
3261
|
+
action: z18.enum(["opened", "closed", "reopened"]),
|
|
3262
|
+
pull_request: z18.object({
|
|
3263
|
+
body: z18.string().nullable().optional(),
|
|
3264
|
+
closed_at: z18.string().nullable().optional(),
|
|
3265
|
+
created_at: z18.string(),
|
|
3266
|
+
id: z18.number().int().positive(),
|
|
3267
|
+
merged: z18.boolean(),
|
|
3268
|
+
merged_at: z18.string().nullable().optional(),
|
|
3269
|
+
number: z18.number().int().positive(),
|
|
3270
|
+
title: z18.string().min(1).optional(),
|
|
3271
|
+
updated_at: z18.string(),
|
|
3272
|
+
user: z18.object({ login: z18.string().min(1) }).passthrough()
|
|
3189
3273
|
}).passthrough(),
|
|
3190
|
-
repository:
|
|
3191
|
-
full_name:
|
|
3192
|
-
id:
|
|
3274
|
+
repository: z18.object({
|
|
3275
|
+
full_name: z18.string().min(1),
|
|
3276
|
+
id: z18.number().int().positive()
|
|
3193
3277
|
}).passthrough()
|
|
3194
3278
|
}).passthrough().transform(
|
|
3195
3279
|
(provider) => canonicalPullRequestOutcomeSchema.parse({
|
|
@@ -3212,24 +3296,24 @@ var pullRequestOutcomeSchema = z17.object({
|
|
|
3212
3296
|
}
|
|
3213
3297
|
})
|
|
3214
3298
|
);
|
|
3215
|
-
var pullRequestLifecycleActionSchema =
|
|
3216
|
-
var canonicalPullRequestConversationSchema =
|
|
3217
|
-
pull_request:
|
|
3218
|
-
body:
|
|
3219
|
-
id:
|
|
3220
|
-
user:
|
|
3299
|
+
var pullRequestLifecycleActionSchema = z18.object({ action: z18.string() }).passthrough();
|
|
3300
|
+
var canonicalPullRequestConversationSchema = z18.object({
|
|
3301
|
+
pull_request: z18.object({
|
|
3302
|
+
body: z18.string().nullable().optional(),
|
|
3303
|
+
id: z18.number().int().positive(),
|
|
3304
|
+
user: z18.object({ login: z18.string().min(1) }).strict()
|
|
3221
3305
|
}).strict(),
|
|
3222
|
-
repository:
|
|
3223
|
-
sender:
|
|
3306
|
+
repository: z18.object({ full_name: z18.string().min(1) }).strict(),
|
|
3307
|
+
sender: z18.object({ login: z18.string().min(1) }).strict()
|
|
3224
3308
|
}).strict();
|
|
3225
|
-
var pullRequestConversationSchema =
|
|
3226
|
-
pull_request:
|
|
3227
|
-
body:
|
|
3228
|
-
id:
|
|
3229
|
-
user:
|
|
3309
|
+
var pullRequestConversationSchema = z18.object({
|
|
3310
|
+
pull_request: z18.object({
|
|
3311
|
+
body: z18.string().nullable().optional(),
|
|
3312
|
+
id: z18.number().int().positive(),
|
|
3313
|
+
user: z18.object({ login: z18.string().min(1) }).passthrough()
|
|
3230
3314
|
}).passthrough(),
|
|
3231
|
-
repository:
|
|
3232
|
-
sender:
|
|
3315
|
+
repository: z18.object({ full_name: z18.string().min(1) }).passthrough(),
|
|
3316
|
+
sender: z18.object({ login: z18.string().min(1) }).passthrough()
|
|
3233
3317
|
}).passthrough().transform(
|
|
3234
3318
|
(provider) => canonicalPullRequestConversationSchema.parse({
|
|
3235
3319
|
pull_request: {
|
|
@@ -3546,18 +3630,18 @@ function createGitHubWebhookRoute(args) {
|
|
|
3546
3630
|
}
|
|
3547
3631
|
|
|
3548
3632
|
// src/pull-request-outcomes/commit-composition.ts
|
|
3549
|
-
import { z as
|
|
3550
|
-
var canonicalCommitSchema =
|
|
3551
|
-
authorEmail:
|
|
3552
|
-
authorLogin:
|
|
3633
|
+
import { z as z19 } from "zod";
|
|
3634
|
+
var canonicalCommitSchema = z19.object({
|
|
3635
|
+
authorEmail: z19.string().nullable(),
|
|
3636
|
+
authorLogin: z19.string().nullable()
|
|
3553
3637
|
}).strict();
|
|
3554
|
-
var providerCommitSchema =
|
|
3555
|
-
author:
|
|
3556
|
-
commit:
|
|
3557
|
-
author:
|
|
3638
|
+
var providerCommitSchema = z19.object({
|
|
3639
|
+
author: z19.object({ login: z19.string() }).passthrough().nullable(),
|
|
3640
|
+
commit: z19.object({
|
|
3641
|
+
author: z19.object({ email: z19.string() }).passthrough().nullable()
|
|
3558
3642
|
}).passthrough()
|
|
3559
3643
|
}).passthrough();
|
|
3560
|
-
var commitPageSchema =
|
|
3644
|
+
var commitPageSchema = z19.array(providerCommitSchema).transform(
|
|
3561
3645
|
(commits) => commits.map(
|
|
3562
3646
|
(commit) => canonicalCommitSchema.parse({
|
|
3563
3647
|
authorEmail: commit.commit.author?.email ?? null,
|