@sentry/junior-github 0.256.0 → 0.258.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/SETUP.md CHANGED
@@ -19,6 +19,11 @@ In GitHub:
19
19
  - Workflows: Write
20
20
  - Metadata: Read
21
21
 
22
+ Optional: under account permissions, grant Email addresses: Read. Junior then
23
+ reads the verified emails of a connected GitHub account to link it to a
24
+ person. Without it, Junior links the account only through the person who
25
+ connected it.
26
+
22
27
  4. Create the app and generate a private key.
23
28
  5. Install the app on the target org/repo(s).
24
29
 
@@ -650,6 +650,25 @@ async function resolveUserAccount(tokens) {
650
650
  ...url ? { url } : void 0
651
651
  };
652
652
  }
653
+ async function listVerifiedUserEmails(tokens) {
654
+ let emails;
655
+ try {
656
+ emails = await githubRequest("https://api.github.com", "/user/emails", {
657
+ token: tokens.accessToken
658
+ });
659
+ } catch (error) {
660
+ if (error instanceof GitHubRequestError && (error.status === 403 || error.status === 404)) {
661
+ return [];
662
+ }
663
+ throw error;
664
+ }
665
+ if (!Array.isArray(emails)) {
666
+ throw new Error("GitHub user emails response is invalid");
667
+ }
668
+ return emails.flatMap(
669
+ (entry) => isRecord(entry) && entry.verified === true && typeof entry.email === "string" && entry.email.trim() ? [entry.email.trim()] : []
670
+ );
671
+ }
653
672
  async function tokensWithAccount(tokenSlot, stored, scope) {
654
673
  if (stored.account) {
655
674
  return { ok: true, tokens: stored };
@@ -1262,10 +1281,12 @@ async function loadCheckSuiteFacts(args) {
1262
1281
  var GITHUB_BOT_NOREPLY_EMAIL = /^(?<userId>[1-9]\d*)\+(?<login>[^@]+\[bot\])@users\.noreply\.github\.com$/i;
1263
1282
  function parseGitHubBotIdentity(value) {
1264
1283
  const match = GITHUB_BOT_NOREPLY_EMAIL.exec(value?.trim() ?? "");
1265
- if (!match?.groups) return void 0;
1284
+ const login = match?.groups?.login;
1285
+ const userId = match?.groups?.userId;
1286
+ if (!login || !userId) return void 0;
1266
1287
  return {
1267
- login: match.groups.login,
1268
- userId: Number(match.groups.userId)
1288
+ login,
1289
+ userId: Number(userId)
1269
1290
  };
1270
1291
  }
1271
1292
  function botLoginFromEmail(value) {
@@ -1957,6 +1978,7 @@ export {
1957
1978
  credentialUnavailable,
1958
1979
  githubRepositoryFromUrl,
1959
1980
  resolveUserAccount,
1981
+ listVerifiedUserEmails,
1960
1982
  issueUserCredential,
1961
1983
  issueInstallationToken,
1962
1984
  issueInstallationCredential,
@@ -68,6 +68,13 @@ export declare function credentialUnavailable(message: string): PluginCredential
68
68
  export declare function githubRepositoryFromUrl(upstreamUrl: URL): GitHubRepository | undefined;
69
69
  /** Resolve the GitHub account associated with stored user tokens. */
70
70
  export declare function resolveUserAccount(tokens: PluginStoredTokens): Promise<PluginProviderAccount>;
71
+ /**
72
+ * List the email addresses GitHub verified for the user OAuth token.
73
+ *
74
+ * GitHub App user tokens need the App's "Email addresses" user permission.
75
+ * Return an empty list when the App does not have it.
76
+ */
77
+ export declare function listVerifiedUserEmails(tokens: PluginStoredTokens): Promise<string[]>;
71
78
  /** Issue a bounded GitHub user credential for an approved grant. */
72
79
  export declare function issueUserCredential(ctx: IssueCredentialHookContext, options: UserCredentialOptions): Promise<PluginCredentialResult>;
73
80
  /** Issue a bounded raw token for plugin-owned GitHub API calls. */
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  export declare const githubPullRequestStateSchema: z.ZodEnum<{
3
+ closed_unmerged: "closed_unmerged";
3
4
  merged: "merged";
4
5
  open: "open";
5
- closed_unmerged: "closed_unmerged";
6
6
  }>;
7
7
  export type GitHubPullRequestState = z.output<typeof githubPullRequestStateSchema>;
8
8
  export declare const githubPullRequestCommitCompositionSchema: z.ZodEnum<{
@@ -168,8 +168,8 @@ export declare const juniorGitHubIssues: import("drizzle-orm/pg-core").PgTableWi
168
168
  }, {}, {
169
169
  baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
170
170
  name: "conversation_ids";
171
- dataType: "string";
172
- columnType: "PgText";
171
+ dataType: 'string';
172
+ columnType: 'PgText';
173
173
  data: string;
174
174
  enumValues: [string, ...string[]];
175
175
  driverParam: string;
@@ -228,7 +228,7 @@ export declare const juniorGitHubIssues: import("drizzle-orm/pg-core").PgTableWi
228
228
  generated: undefined;
229
229
  }, {}, {}>;
230
230
  };
231
- dialect: "pg";
231
+ dialect: 'pg';
232
232
  }>;
233
233
  /** Current provider projection for pull requests classified as Junior-owned. */
234
234
  export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgTableWithColumns<{
@@ -308,7 +308,7 @@ export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgT
308
308
  tableName: "junior_github_pull_requests";
309
309
  dataType: "string";
310
310
  columnType: "PgText";
311
- data: "merged" | "open" | "closed_unmerged";
311
+ data: "closed_unmerged" | "merged" | "open";
312
312
  driverParam: string;
313
313
  notNull: true;
314
314
  hasDefault: false;
@@ -320,7 +320,7 @@ export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgT
320
320
  identity: undefined;
321
321
  generated: undefined;
322
322
  }, {}, {
323
- $type: "merged" | "open" | "closed_unmerged";
323
+ $type: "closed_unmerged" | "merged" | "open";
324
324
  }>;
325
325
  commitComposition: import("drizzle-orm/pg-core").PgColumn<{
326
326
  name: "commit_composition";
@@ -376,8 +376,8 @@ export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgT
376
376
  }, {}, {
377
377
  baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
378
378
  name: "conversation_ids";
379
- dataType: "string";
380
- columnType: "PgText";
379
+ dataType: 'string';
380
+ columnType: 'PgText';
381
381
  data: string;
382
382
  enumValues: [string, ...string[]];
383
383
  driverParam: string;
@@ -453,7 +453,7 @@ export declare const juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgT
453
453
  generated: undefined;
454
454
  }, {}, {}>;
455
455
  };
456
- dialect: "pg";
456
+ dialect: 'pg';
457
457
  }>;
458
458
  /** Many-to-many links between tracked pull requests and tracked issues. */
459
459
  export declare const juniorGitHubPullRequestIssues: import("drizzle-orm/pg-core").PgTableWithColumns<{
@@ -512,7 +512,7 @@ export declare const juniorGitHubPullRequestIssues: import("drizzle-orm/pg-core"
512
512
  generated: undefined;
513
513
  }, {}, {}>;
514
514
  };
515
- dialect: "pg";
515
+ dialect: 'pg';
516
516
  }>;
517
517
  export declare const githubSqlSchema: {
518
518
  juniorGitHubIssues: import("drizzle-orm/pg-core").PgTableWithColumns<{
@@ -660,8 +660,8 @@ export declare const githubSqlSchema: {
660
660
  }, {}, {
661
661
  baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
662
662
  name: "conversation_ids";
663
- dataType: "string";
664
- columnType: "PgText";
663
+ dataType: 'string';
664
+ columnType: 'PgText';
665
665
  data: string;
666
666
  enumValues: [string, ...string[]];
667
667
  driverParam: string;
@@ -720,7 +720,7 @@ export declare const githubSqlSchema: {
720
720
  generated: undefined;
721
721
  }, {}, {}>;
722
722
  };
723
- dialect: "pg";
723
+ dialect: 'pg';
724
724
  }>;
725
725
  juniorGitHubPullRequestIssues: import("drizzle-orm/pg-core").PgTableWithColumns<{
726
726
  name: "junior_github_pull_request_issues";
@@ -778,7 +778,7 @@ export declare const githubSqlSchema: {
778
778
  generated: undefined;
779
779
  }, {}, {}>;
780
780
  };
781
- dialect: "pg";
781
+ dialect: 'pg';
782
782
  }>;
783
783
  juniorGitHubPullRequests: import("drizzle-orm/pg-core").PgTableWithColumns<{
784
784
  name: "junior_github_pull_requests";
@@ -857,7 +857,7 @@ export declare const githubSqlSchema: {
857
857
  tableName: "junior_github_pull_requests";
858
858
  dataType: "string";
859
859
  columnType: "PgText";
860
- data: "merged" | "open" | "closed_unmerged";
860
+ data: "closed_unmerged" | "merged" | "open";
861
861
  driverParam: string;
862
862
  notNull: true;
863
863
  hasDefault: false;
@@ -869,7 +869,7 @@ export declare const githubSqlSchema: {
869
869
  identity: undefined;
870
870
  generated: undefined;
871
871
  }, {}, {
872
- $type: "merged" | "open" | "closed_unmerged";
872
+ $type: "closed_unmerged" | "merged" | "open";
873
873
  }>;
874
874
  commitComposition: import("drizzle-orm/pg-core").PgColumn<{
875
875
  name: "commit_composition";
@@ -925,8 +925,8 @@ export declare const githubSqlSchema: {
925
925
  }, {}, {
926
926
  baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
927
927
  name: "conversation_ids";
928
- dataType: "string";
929
- columnType: "PgText";
928
+ dataType: 'string';
929
+ columnType: 'PgText';
930
930
  data: string;
931
931
  enumValues: [string, ...string[]];
932
932
  driverParam: string;
@@ -1002,6 +1002,6 @@ export declare const githubSqlSchema: {
1002
1002
  generated: undefined;
1003
1003
  }, {}, {}>;
1004
1004
  };
1005
- dialect: "pg";
1005
+ dialect: 'pg';
1006
1006
  }>;
1007
1007
  };
@@ -24,7 +24,7 @@ export declare function gitHubPullRequestCreateWatch(config: GitHubPullRequestSu
24
24
  export declare const GITHUB_PULL_REQUEST_SUGGESTED_EVENTS: readonly ["pull_request.checks.failed", "pull_request.comment.created", "pull_request.ready_for_review", "pull_request.review.changes_requested", "pull_request.review.commented", "pull_request.review_comment.created", "pull_request.merged", "pull_request.closed_unmerged"];
25
25
  /** Exact values GitHub may set on pull request event data. Missing keys do not match. */
26
26
  export declare const GITHUB_PULL_REQUEST_MATCH_FIELDS: Record<string, {
27
- kind: "string" | "number" | "boolean";
27
+ kind: "boolean" | "number" | "string";
28
28
  description: string;
29
29
  enum?: string[] | undefined;
30
30
  }>;
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@ import {
42
42
  issueInstallationCredential,
43
43
  issueInstallationToken,
44
44
  issueUserCredential,
45
+ listVerifiedUserEmails,
45
46
  loadCheckSuiteFacts,
46
47
  needsCheckSuitePullRequestFacts,
47
48
  normalizeGitHubEvents,
@@ -52,7 +53,7 @@ import {
52
53
  readGrantPermissions,
53
54
  requireEnv,
54
55
  resolveUserAccount
55
- } from "./chunk-D75O3CY3.js";
56
+ } from "./chunk-XN3WOI7O.js";
56
57
 
57
58
  // src/plugin.ts
58
59
  import {
@@ -538,13 +539,22 @@ function cleanDisplayValue(value, userId) {
538
539
  }
539
540
  return cleaned;
540
541
  }
542
+ function automationLabel(source, automationUrl) {
543
+ if (source?.kind !== "event_automation" && source?.kind !== "scheduled_automation" || !source.automationId) {
544
+ return void 0;
545
+ }
546
+ const automation = `automation \`${source.automationId}\``;
547
+ const label = automationUrl ? `[${automation}](${automationUrl})` : automation;
548
+ return source.automationRunId ? `${label} \xB7 Run ID \`${source.automationRunId}\`` : label;
549
+ }
541
550
  function requesterLabel(args) {
542
551
  const { actor, identity, user } = args;
543
- if (!actor) {
544
- return void 0;
552
+ const automation = automationLabel(args.source, args.automationUrl);
553
+ if (automation) {
554
+ return automation;
545
555
  }
546
- if (actor.platform === "system") {
547
- return `Junior system actor \`${actor.name}\``;
556
+ if (!actor || actor.platform === "system") {
557
+ return void 0;
548
558
  }
549
559
  const login = linkedGitHubLogin(user);
550
560
  if (login) {
@@ -560,7 +570,7 @@ function parseExistingLabels(blockContents) {
560
570
  return [];
561
571
  }
562
572
  const withoutLeadIn = trimmed.replace(/^(?:Requested by|via)\s+/i, "");
563
- return withoutLeadIn.split(/,\s*(?=\*\*|@|Junior system actor `|via\s)/i).map((entry) => entry.trim().replace(/^via\s+/i, "")).filter(Boolean);
573
+ return withoutLeadIn.split(/,\s*(?=\*\*|@|\[?automation `|Junior system actor `|via\s)/i).map((entry) => entry.trim().replace(/^via\s+/i, "")).filter(Boolean);
564
574
  }
565
575
  function formatAttributionBlock(labels) {
566
576
  return `${GITHUB_REQUEST_ATTRIBUTION_START}
@@ -573,7 +583,7 @@ function applyAttribution(body, label) {
573
583
  `${GITHUB_REQUEST_ATTRIBUTION_START}([\\s\\S]*?)${GITHUB_REQUEST_ATTRIBUTION_END}`
574
584
  );
575
585
  const existingMatch = normalizedBody.match(existing);
576
- const existingLabels = existingMatch ? parseExistingLabels(existingMatch[1]) : [];
586
+ const existingLabels = existingMatch?.[1] !== void 0 ? parseExistingLabels(existingMatch[1]) : [];
577
587
  const labels = label && !existingLabels.includes(label) ? [...existingLabels, label] : existingLabels;
578
588
  const attribution = labels.length ? formatAttributionBlock(labels) : void 0;
579
589
  if (existingMatch) {
@@ -601,7 +611,9 @@ async function appendGitHubRequesterAttribution(body, ctx) {
601
611
  body,
602
612
  requesterLabel({
603
613
  actor: ctx.actor,
614
+ automationUrl: ctx.automationLink?.url,
604
615
  identity: resolved?.identity,
616
+ source: ctx.source,
605
617
  user: resolved?.user
606
618
  })
607
619
  );
@@ -5165,7 +5177,18 @@ function githubPlugin(options = {}) {
5165
5177
  }
5166
5178
  },
5167
5179
  async resolveOAuthAccount(ctx) {
5168
- return await resolveUserAccount(ctx.tokens);
5180
+ const [account, verifiedEmails] = await Promise.all([
5181
+ resolveUserAccount(ctx.tokens),
5182
+ // Verified emails only help link the account. An email lookup
5183
+ // failure must not block the connection.
5184
+ listVerifiedUserEmails(ctx.tokens).catch((error) => {
5185
+ ctx.log.warn("github.oauth_account.emails_lookup.failed", {
5186
+ "exception.message": error instanceof Error ? error.message : String(error)
5187
+ });
5188
+ return [];
5189
+ })
5190
+ ]);
5191
+ return verifiedEmails.length > 0 ? { ...account, verifiedEmails } : account;
5169
5192
  },
5170
5193
  async issueCredential(ctx) {
5171
5194
  try {
@@ -15,9 +15,9 @@ declare const githubPullRequestOutcomeInputSchema: z.ZodObject<{
15
15
  repositoryFullName: z.ZodString;
16
16
  repositoryId: z.ZodString;
17
17
  state: z.ZodEnum<{
18
+ closed_unmerged: "closed_unmerged";
18
19
  merged: "merged";
19
20
  open: "open";
20
- closed_unmerged: "closed_unmerged";
21
21
  }>;
22
22
  title: z.ZodOptional<z.ZodString>;
23
23
  updatedAt: z.ZodDate;
package/dist/testing.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  normalizeGitHubEvents
3
- } from "./chunk-D75O3CY3.js";
3
+ } from "./chunk-XN3WOI7O.js";
4
4
  export {
5
5
  normalizeGitHubEvents
6
6
  };
@@ -1,4 +1,4 @@
1
- import type { Actor, Identity, PluginLogger, User } from "@sentry/junior-plugin-api";
1
+ import type { Actor, Identity, PluginLogger, Source, User } from "@sentry/junior-plugin-api";
2
2
  export declare const GITHUB_REQUEST_ATTRIBUTION_START = "<!-- junior-request-attribution:start -->";
3
3
  export declare const GITHUB_REQUEST_ATTRIBUTION_END = "<!-- junior-request-attribution:end -->";
4
4
  /**
@@ -16,7 +16,11 @@ export declare function linkedGitHubLogin(user: User | undefined): string | unde
16
16
  */
17
17
  export declare function appendGitHubRequesterAttribution(body: string, ctx: {
18
18
  actor?: Actor;
19
+ automationLink?: {
20
+ url: string;
21
+ };
19
22
  log: PluginLogger;
23
+ source?: Source;
20
24
  users: {
21
25
  resolveActor(): Promise<{
22
26
  identity?: Identity;
@@ -9,14 +9,11 @@ export declare function createGitHubCloneRepositoryTool(ctx: {
9
9
  directory?: string | undefined;
10
10
  allowAdHoc?: boolean | undefined;
11
11
  }, {
12
- path: string;
13
- repo: string;
14
- target: "cloneRepository";
15
12
  objectAnnotations?: {
16
13
  kind: "object";
17
14
  key: string;
18
15
  label: string;
19
- objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
16
+ objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
20
17
  title: string;
21
18
  url: string | null;
22
19
  description?: string | undefined;
@@ -31,7 +28,7 @@ export declare function createGitHubCloneRepositoryTool(ctx: {
31
28
  sourceBranch?: string | undefined;
32
29
  targetBranch?: string | undefined;
33
30
  reviewers?: string[] | undefined;
34
- review?: "required" | "approved" | "changes_requested" | undefined;
31
+ review?: "approved" | "changes_requested" | "required" | undefined;
35
32
  checks?: {
36
33
  passed: number;
37
34
  failed: number;
@@ -66,15 +63,15 @@ export declare function createGitHubCloneRepositoryTool(ctx: {
66
63
  arguments: Record<string, unknown>;
67
64
  reason?: string | undefined;
68
65
  } | undefined;
69
- }, {
70
66
  path: string;
71
67
  repo: string;
72
68
  target: "cloneRepository";
69
+ }, {
73
70
  objectAnnotations?: {
74
71
  kind: "object";
75
72
  key: string;
76
73
  label: string;
77
- objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
74
+ objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
78
75
  title: string;
79
76
  url: string | null;
80
77
  description?: string | undefined;
@@ -89,7 +86,7 @@ export declare function createGitHubCloneRepositoryTool(ctx: {
89
86
  sourceBranch?: string | undefined;
90
87
  targetBranch?: string | undefined;
91
88
  reviewers?: string[] | undefined;
92
- review?: "required" | "approved" | "changes_requested" | undefined;
89
+ review?: "approved" | "changes_requested" | "required" | undefined;
93
90
  checks?: {
94
91
  passed: number;
95
92
  failed: number;
@@ -124,4 +121,7 @@ export declare function createGitHubCloneRepositoryTool(ctx: {
124
121
  arguments: Record<string, unknown>;
125
122
  reason?: string | undefined;
126
123
  } | undefined;
124
+ path: string;
125
+ repo: string;
126
+ target: "cloneRepository";
127
127
  }>;
@@ -6,14 +6,11 @@ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext):
6
6
  body?: string | undefined;
7
7
  labels?: string[] | undefined;
8
8
  }, {
9
- number: number;
10
- url: string;
11
- target: "createIssue";
12
9
  objectAnnotations?: {
13
10
  kind: "object";
14
11
  key: string;
15
12
  label: string;
16
- objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
13
+ objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
17
14
  title: string;
18
15
  url: string | null;
19
16
  description?: string | undefined;
@@ -28,7 +25,7 @@ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext):
28
25
  sourceBranch?: string | undefined;
29
26
  targetBranch?: string | undefined;
30
27
  reviewers?: string[] | undefined;
31
- review?: "required" | "approved" | "changes_requested" | undefined;
28
+ review?: "approved" | "changes_requested" | "required" | undefined;
32
29
  checks?: {
33
30
  passed: number;
34
31
  failed: number;
@@ -63,23 +60,23 @@ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext):
63
60
  arguments: Record<string, unknown>;
64
61
  reason?: string | undefined;
65
62
  } | undefined;
63
+ number: number;
66
64
  subscribable?: {
67
65
  identifier: string;
68
66
  label: string;
69
67
  namespace: string;
68
+ suggestedEvents?: string[] | undefined;
70
69
  supportedEvents: string[];
71
70
  type: string;
72
- suggestedEvents?: string[] | undefined;
73
71
  } | undefined;
74
- }, {
75
- number: number;
76
72
  url: string;
77
73
  target: "createIssue";
74
+ }, {
78
75
  objectAnnotations?: {
79
76
  kind: "object";
80
77
  key: string;
81
78
  label: string;
82
- objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
79
+ objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
83
80
  title: string;
84
81
  url: string | null;
85
82
  description?: string | undefined;
@@ -94,7 +91,7 @@ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext):
94
91
  sourceBranch?: string | undefined;
95
92
  targetBranch?: string | undefined;
96
93
  reviewers?: string[] | undefined;
97
- review?: "required" | "approved" | "changes_requested" | undefined;
94
+ review?: "approved" | "changes_requested" | "required" | undefined;
98
95
  checks?: {
99
96
  passed: number;
100
97
  failed: number;
@@ -129,12 +126,15 @@ export declare function createGitHubIssueTool(ctx: ToolRegistrationHookContext):
129
126
  arguments: Record<string, unknown>;
130
127
  reason?: string | undefined;
131
128
  } | undefined;
129
+ number: number;
132
130
  subscribable?: {
133
131
  identifier: string;
134
132
  label: string;
135
133
  namespace: string;
134
+ suggestedEvents?: string[] | undefined;
136
135
  supportedEvents: string[];
137
136
  type: string;
138
- suggestedEvents?: string[] | undefined;
139
137
  } | undefined;
138
+ url: string;
139
+ target: "createIssue";
140
140
  }>;
@@ -9,14 +9,11 @@ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookCon
9
9
  body?: string | undefined;
10
10
  draft?: boolean | undefined;
11
11
  }, {
12
- number: number;
13
- url: string;
14
- target: "createPullRequest";
15
12
  objectAnnotations?: {
16
13
  kind: "object";
17
14
  key: string;
18
15
  label: string;
19
- objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
16
+ objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
20
17
  title: string;
21
18
  url: string | null;
22
19
  description?: string | undefined;
@@ -31,7 +28,7 @@ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookCon
31
28
  sourceBranch?: string | undefined;
32
29
  targetBranch?: string | undefined;
33
30
  reviewers?: string[] | undefined;
34
- review?: "required" | "approved" | "changes_requested" | undefined;
31
+ review?: "approved" | "changes_requested" | "required" | undefined;
35
32
  checks?: {
36
33
  passed: number;
37
34
  failed: number;
@@ -66,27 +63,27 @@ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookCon
66
63
  arguments: Record<string, unknown>;
67
64
  reason?: string | undefined;
68
65
  } | undefined;
66
+ number: number;
67
+ url: string;
69
68
  subscribable?: {
70
69
  identifier: string;
71
70
  label: string;
72
71
  namespace: string;
72
+ suggestedEvents?: string[] | undefined;
73
73
  supportedEvents: string[];
74
74
  type: string;
75
- suggestedEvents?: string[] | undefined;
76
75
  } | undefined;
77
76
  subscription?: {
78
77
  events: string[];
79
78
  id: string;
80
79
  } | undefined;
81
- }, {
82
- number: number;
83
- url: string;
84
80
  target: "createPullRequest";
81
+ }, {
85
82
  objectAnnotations?: {
86
83
  kind: "object";
87
84
  key: string;
88
85
  label: string;
89
- objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
86
+ objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
90
87
  title: string;
91
88
  url: string | null;
92
89
  description?: string | undefined;
@@ -101,7 +98,7 @@ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookCon
101
98
  sourceBranch?: string | undefined;
102
99
  targetBranch?: string | undefined;
103
100
  reviewers?: string[] | undefined;
104
- review?: "required" | "approved" | "changes_requested" | undefined;
101
+ review?: "approved" | "changes_requested" | "required" | undefined;
105
102
  checks?: {
106
103
  passed: number;
107
104
  failed: number;
@@ -136,16 +133,19 @@ export declare function createGitHubPullRequestTool(ctx: ToolRegistrationHookCon
136
133
  arguments: Record<string, unknown>;
137
134
  reason?: string | undefined;
138
135
  } | undefined;
136
+ number: number;
137
+ url: string;
139
138
  subscribable?: {
140
139
  identifier: string;
141
140
  label: string;
142
141
  namespace: string;
142
+ suggestedEvents?: string[] | undefined;
143
143
  supportedEvents: string[];
144
144
  type: string;
145
- suggestedEvents?: string[] | undefined;
146
145
  } | undefined;
147
146
  subscription?: {
148
147
  events: string[];
149
148
  id: string;
150
149
  } | undefined;
150
+ target: "createPullRequest";
151
151
  }>;