@sentry/junior-google 0.298.0 → 0.300.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.
@@ -5,14 +5,17 @@ import { type GoogleToolContext } from "./shared";
5
5
  declare const FILE_TYPES: {
6
6
  readonly document: {
7
7
  readonly label: "Google Doc";
8
+ readonly linkRoot: "document";
8
9
  readonly mimeType: "application/vnd.google-apps.document";
9
10
  };
10
11
  readonly presentation: {
11
12
  readonly label: "Google Slides presentation";
13
+ readonly linkRoot: "presentation";
12
14
  readonly mimeType: "application/vnd.google-apps.presentation";
13
15
  };
14
16
  readonly spreadsheet: {
15
17
  readonly label: "Google Sheet";
18
+ readonly linkRoot: "spreadsheets";
16
19
  readonly mimeType: "application/vnd.google-apps.spreadsheet";
17
20
  };
18
21
  };
@@ -22,6 +25,13 @@ export declare const GOOGLE_FILE_TYPES: GoogleFileType[];
22
25
  export declare function googleFileMimeType(type: GoogleFileType): string;
23
26
  /** Return the file type of a Drive MIME type, when the tools read it. */
24
27
  export declare function googleFileType(mimeType: string): GoogleFileType | undefined;
28
+ /** Return the first path segment of a file type's links, such as `spreadsheets`. */
29
+ export declare function googleFileLinkRoot(type: GoogleFileType): string;
30
+ /**
31
+ * Return the file type that a Docs, Sheets, or Slides link names in its
32
+ * path, such as `/spreadsheets/d/<id>`. Other links name no type.
33
+ */
34
+ export declare function googleLinkFileType(url: URL): GoogleFileType | undefined;
25
35
  /** File id or link input for the tools that use one file. */
26
36
  export declare function fileReferenceSchema(name: string): z.ZodString;
27
37
  /** A Drive file id, as the file tools accept it. */
@@ -41,8 +51,11 @@ export interface FileReference {
41
51
  * Older files shared by link also need the link's `resourcekey` value.
42
52
  */
43
53
  export declare function parseFileReference(value: string): FileReference;
54
+ /** Return the header that carries a file's resource key, when known. */
55
+ export declare function resourceKeyHeaders(file: FileReference): Record<string, string>;
44
56
  /** Call one Google operation on a file, with its resource key when known. */
45
57
  export declare function googleFileRequest(ctx: GoogleToolContext, file: FileReference, input: {
58
+ body?: unknown;
46
59
  headers?: Record<string, string>;
47
60
  operation: GoogleOperation;
48
61
  path: string;
@@ -57,7 +70,10 @@ export declare function googleFileRequest(ctx: GoogleToolContext, file: FileRefe
57
70
  * `drive.readonly` can read any Drive file, so each tool checks the type
58
71
  * before it reads content or comments.
59
72
  */
60
- export declare function readGoogleFile(ctx: GoogleToolContext, file: FileReference, types: readonly GoogleFileType[]): Promise<{
73
+ export declare function readGoogleFileMetadata(ctx: GoogleToolContext, file: FileReference, types: readonly GoogleFileType[]): Promise<{
74
+ capabilities?: {
75
+ canEdit?: boolean | undefined;
76
+ } | undefined;
61
77
  id: string;
62
78
  mimeType: string;
63
79
  modifiedTime?: string | undefined;
@@ -84,7 +84,7 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
84
84
  kind: "object";
85
85
  key: string;
86
86
  label: string;
87
- objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
87
+ objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
88
88
  title: string;
89
89
  url: string | null;
90
90
  description?: string | undefined;
@@ -95,6 +95,7 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
95
95
  sourceUpdatedAt?: string | undefined;
96
96
  facts?: {
97
97
  type: "code_change";
98
+ summary?: string | undefined;
98
99
  author?: string | undefined;
99
100
  sourceBranch?: string | undefined;
100
101
  targetBranch?: string | undefined;
@@ -109,8 +110,10 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
109
110
  changedFiles?: number | undefined;
110
111
  additions?: number | undefined;
111
112
  deletions?: number | undefined;
113
+ previewImageUrls?: string[] | undefined;
112
114
  } | {
113
115
  type: "task";
116
+ summary?: string | undefined;
114
117
  assignees?: string[] | undefined;
115
118
  priority?: string | undefined;
116
119
  project?: string | undefined;
@@ -119,14 +122,45 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
119
122
  labels?: string[] | undefined;
120
123
  } | {
121
124
  type: "deployment";
125
+ summary?: string | undefined;
122
126
  project?: string | undefined;
123
127
  environment?: string | undefined;
124
128
  revision?: string | undefined;
125
129
  branch?: string | undefined;
126
130
  } | {
127
131
  type: "calendar_event";
132
+ summary?: string | undefined;
128
133
  when?: string | undefined;
129
134
  attendees?: string[] | undefined;
135
+ } | {
136
+ type: "conversation";
137
+ summary?: string | undefined;
138
+ participants?: string[] | undefined;
139
+ lastActivityAt?: string | undefined;
140
+ } | {
141
+ type: "document";
142
+ summary?: string | undefined;
143
+ owner?: string | undefined;
144
+ modifiedAt?: string | undefined;
145
+ } | {
146
+ type: "message";
147
+ summary?: string | undefined;
148
+ channel?: string | undefined;
149
+ author?: string | undefined;
150
+ sentAt?: string | undefined;
151
+ } | {
152
+ type: "web_page";
153
+ summary?: string | undefined;
154
+ siteName?: string | undefined;
155
+ author?: string | undefined;
156
+ thumbnailUrl?: string | undefined;
157
+ } | {
158
+ type: "person";
159
+ summary?: string | undefined;
160
+ email?: string | undefined;
161
+ slackHandle?: string | undefined;
162
+ githubHandle?: string | undefined;
163
+ avatarUrl?: string | undefined;
130
164
  } | undefined;
131
165
  }[] | undefined;
132
166
  reply?: {
@@ -161,7 +195,7 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
161
195
  kind: "object";
162
196
  key: string;
163
197
  label: string;
164
- objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
198
+ objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
165
199
  title: string;
166
200
  url: string | null;
167
201
  description?: string | undefined;
@@ -172,6 +206,7 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
172
206
  sourceUpdatedAt?: string | undefined;
173
207
  facts?: {
174
208
  type: "code_change";
209
+ summary?: string | undefined;
175
210
  author?: string | undefined;
176
211
  sourceBranch?: string | undefined;
177
212
  targetBranch?: string | undefined;
@@ -186,8 +221,10 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
186
221
  changedFiles?: number | undefined;
187
222
  additions?: number | undefined;
188
223
  deletions?: number | undefined;
224
+ previewImageUrls?: string[] | undefined;
189
225
  } | {
190
226
  type: "task";
227
+ summary?: string | undefined;
191
228
  assignees?: string[] | undefined;
192
229
  priority?: string | undefined;
193
230
  project?: string | undefined;
@@ -196,14 +233,45 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
196
233
  labels?: string[] | undefined;
197
234
  } | {
198
235
  type: "deployment";
236
+ summary?: string | undefined;
199
237
  project?: string | undefined;
200
238
  environment?: string | undefined;
201
239
  revision?: string | undefined;
202
240
  branch?: string | undefined;
203
241
  } | {
204
242
  type: "calendar_event";
243
+ summary?: string | undefined;
205
244
  when?: string | undefined;
206
245
  attendees?: string[] | undefined;
246
+ } | {
247
+ type: "conversation";
248
+ summary?: string | undefined;
249
+ participants?: string[] | undefined;
250
+ lastActivityAt?: string | undefined;
251
+ } | {
252
+ type: "document";
253
+ summary?: string | undefined;
254
+ owner?: string | undefined;
255
+ modifiedAt?: string | undefined;
256
+ } | {
257
+ type: "message";
258
+ summary?: string | undefined;
259
+ channel?: string | undefined;
260
+ author?: string | undefined;
261
+ sentAt?: string | undefined;
262
+ } | {
263
+ type: "web_page";
264
+ summary?: string | undefined;
265
+ siteName?: string | undefined;
266
+ author?: string | undefined;
267
+ thumbnailUrl?: string | undefined;
268
+ } | {
269
+ type: "person";
270
+ summary?: string | undefined;
271
+ email?: string | undefined;
272
+ slackHandle?: string | undefined;
273
+ githubHandle?: string | undefined;
274
+ avatarUrl?: string | undefined;
207
275
  } | undefined;
208
276
  }[] | undefined;
209
277
  reply?: {
@@ -0,0 +1,206 @@
1
+ import type { GoogleToolContext } from "./shared";
2
+ /** Add Markdown content to the start or end of a Google Doc. */
3
+ export declare function createInsertGoogleDocContentTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
4
+ document: string;
5
+ content: string;
6
+ revision_id: string;
7
+ position: "end" | "start";
8
+ }, {
9
+ [x: string]: unknown;
10
+ objectAnnotations?: {
11
+ kind: "object";
12
+ key: string;
13
+ label: string;
14
+ objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
15
+ title: string;
16
+ url: string | null;
17
+ description?: string | undefined;
18
+ status?: string | undefined;
19
+ trigger?: string | undefined;
20
+ warning?: string | undefined;
21
+ displayType?: string | undefined;
22
+ sourceUpdatedAt?: string | undefined;
23
+ facts?: {
24
+ type: "code_change";
25
+ summary?: string | undefined;
26
+ author?: string | undefined;
27
+ sourceBranch?: string | undefined;
28
+ targetBranch?: string | undefined;
29
+ reviewers?: string[] | undefined;
30
+ review?: "approved" | "changes_requested" | "required" | undefined;
31
+ checks?: {
32
+ passed: number;
33
+ failed: number;
34
+ pending: number;
35
+ } | undefined;
36
+ mergeable?: boolean | undefined;
37
+ changedFiles?: number | undefined;
38
+ additions?: number | undefined;
39
+ deletions?: number | undefined;
40
+ previewImageUrls?: string[] | undefined;
41
+ } | {
42
+ type: "task";
43
+ summary?: string | undefined;
44
+ assignees?: string[] | undefined;
45
+ priority?: string | undefined;
46
+ project?: string | undefined;
47
+ cycle?: string | undefined;
48
+ dueDate?: string | undefined;
49
+ labels?: string[] | undefined;
50
+ } | {
51
+ type: "deployment";
52
+ summary?: string | undefined;
53
+ project?: string | undefined;
54
+ environment?: string | undefined;
55
+ revision?: string | undefined;
56
+ branch?: string | undefined;
57
+ } | {
58
+ type: "calendar_event";
59
+ summary?: string | undefined;
60
+ when?: string | undefined;
61
+ attendees?: string[] | undefined;
62
+ } | {
63
+ type: "conversation";
64
+ summary?: string | undefined;
65
+ participants?: string[] | undefined;
66
+ lastActivityAt?: string | undefined;
67
+ } | {
68
+ type: "document";
69
+ summary?: string | undefined;
70
+ owner?: string | undefined;
71
+ modifiedAt?: string | undefined;
72
+ } | {
73
+ type: "message";
74
+ summary?: string | undefined;
75
+ channel?: string | undefined;
76
+ author?: string | undefined;
77
+ sentAt?: string | undefined;
78
+ } | {
79
+ type: "web_page";
80
+ summary?: string | undefined;
81
+ siteName?: string | undefined;
82
+ author?: string | undefined;
83
+ thumbnailUrl?: string | undefined;
84
+ } | {
85
+ type: "person";
86
+ summary?: string | undefined;
87
+ email?: string | undefined;
88
+ slackHandle?: string | undefined;
89
+ githubHandle?: string | undefined;
90
+ avatarUrl?: string | undefined;
91
+ } | undefined;
92
+ }[] | undefined;
93
+ reply?: {
94
+ text: string;
95
+ url?: string | undefined;
96
+ } | undefined;
97
+ truncated?: boolean | undefined;
98
+ continuation?: {
99
+ arguments: Record<string, unknown>;
100
+ reason?: string | undefined;
101
+ } | undefined;
102
+ document_id: string;
103
+ revision_id?: string | undefined;
104
+ title: string;
105
+ url: string;
106
+ target: "insertGoogleDocContent";
107
+ }, {
108
+ [x: string]: unknown;
109
+ objectAnnotations?: {
110
+ kind: "object";
111
+ key: string;
112
+ label: string;
113
+ objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
114
+ title: string;
115
+ url: string | null;
116
+ description?: string | undefined;
117
+ status?: string | undefined;
118
+ trigger?: string | undefined;
119
+ warning?: string | undefined;
120
+ displayType?: string | undefined;
121
+ sourceUpdatedAt?: string | undefined;
122
+ facts?: {
123
+ type: "code_change";
124
+ summary?: string | undefined;
125
+ author?: string | undefined;
126
+ sourceBranch?: string | undefined;
127
+ targetBranch?: string | undefined;
128
+ reviewers?: string[] | undefined;
129
+ review?: "approved" | "changes_requested" | "required" | undefined;
130
+ checks?: {
131
+ passed: number;
132
+ failed: number;
133
+ pending: number;
134
+ } | undefined;
135
+ mergeable?: boolean | undefined;
136
+ changedFiles?: number | undefined;
137
+ additions?: number | undefined;
138
+ deletions?: number | undefined;
139
+ previewImageUrls?: string[] | undefined;
140
+ } | {
141
+ type: "task";
142
+ summary?: string | undefined;
143
+ assignees?: string[] | undefined;
144
+ priority?: string | undefined;
145
+ project?: string | undefined;
146
+ cycle?: string | undefined;
147
+ dueDate?: string | undefined;
148
+ labels?: string[] | undefined;
149
+ } | {
150
+ type: "deployment";
151
+ summary?: string | undefined;
152
+ project?: string | undefined;
153
+ environment?: string | undefined;
154
+ revision?: string | undefined;
155
+ branch?: string | undefined;
156
+ } | {
157
+ type: "calendar_event";
158
+ summary?: string | undefined;
159
+ when?: string | undefined;
160
+ attendees?: string[] | undefined;
161
+ } | {
162
+ type: "conversation";
163
+ summary?: string | undefined;
164
+ participants?: string[] | undefined;
165
+ lastActivityAt?: string | undefined;
166
+ } | {
167
+ type: "document";
168
+ summary?: string | undefined;
169
+ owner?: string | undefined;
170
+ modifiedAt?: string | undefined;
171
+ } | {
172
+ type: "message";
173
+ summary?: string | undefined;
174
+ channel?: string | undefined;
175
+ author?: string | undefined;
176
+ sentAt?: string | undefined;
177
+ } | {
178
+ type: "web_page";
179
+ summary?: string | undefined;
180
+ siteName?: string | undefined;
181
+ author?: string | undefined;
182
+ thumbnailUrl?: string | undefined;
183
+ } | {
184
+ type: "person";
185
+ summary?: string | undefined;
186
+ email?: string | undefined;
187
+ slackHandle?: string | undefined;
188
+ githubHandle?: string | undefined;
189
+ avatarUrl?: string | undefined;
190
+ } | undefined;
191
+ }[] | undefined;
192
+ reply?: {
193
+ text: string;
194
+ url?: string | undefined;
195
+ } | undefined;
196
+ truncated?: boolean | undefined;
197
+ continuation?: {
198
+ arguments: Record<string, unknown>;
199
+ reason?: string | undefined;
200
+ } | undefined;
201
+ document_id: string;
202
+ revision_id?: string | undefined;
203
+ title: string;
204
+ url: string;
205
+ target: "insertGoogleDocContent";
206
+ }>;
@@ -18,7 +18,7 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
18
18
  kind: "object";
19
19
  key: string;
20
20
  label: string;
21
- objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
21
+ objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
22
22
  title: string;
23
23
  url: string | null;
24
24
  description?: string | undefined;
@@ -29,6 +29,7 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
29
29
  sourceUpdatedAt?: string | undefined;
30
30
  facts?: {
31
31
  type: "code_change";
32
+ summary?: string | undefined;
32
33
  author?: string | undefined;
33
34
  sourceBranch?: string | undefined;
34
35
  targetBranch?: string | undefined;
@@ -43,8 +44,10 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
43
44
  changedFiles?: number | undefined;
44
45
  additions?: number | undefined;
45
46
  deletions?: number | undefined;
47
+ previewImageUrls?: string[] | undefined;
46
48
  } | {
47
49
  type: "task";
50
+ summary?: string | undefined;
48
51
  assignees?: string[] | undefined;
49
52
  priority?: string | undefined;
50
53
  project?: string | undefined;
@@ -53,14 +56,45 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
53
56
  labels?: string[] | undefined;
54
57
  } | {
55
58
  type: "deployment";
59
+ summary?: string | undefined;
56
60
  project?: string | undefined;
57
61
  environment?: string | undefined;
58
62
  revision?: string | undefined;
59
63
  branch?: string | undefined;
60
64
  } | {
61
65
  type: "calendar_event";
66
+ summary?: string | undefined;
62
67
  when?: string | undefined;
63
68
  attendees?: string[] | undefined;
69
+ } | {
70
+ type: "conversation";
71
+ summary?: string | undefined;
72
+ participants?: string[] | undefined;
73
+ lastActivityAt?: string | undefined;
74
+ } | {
75
+ type: "document";
76
+ summary?: string | undefined;
77
+ owner?: string | undefined;
78
+ modifiedAt?: string | undefined;
79
+ } | {
80
+ type: "message";
81
+ summary?: string | undefined;
82
+ channel?: string | undefined;
83
+ author?: string | undefined;
84
+ sentAt?: string | undefined;
85
+ } | {
86
+ type: "web_page";
87
+ summary?: string | undefined;
88
+ siteName?: string | undefined;
89
+ author?: string | undefined;
90
+ thumbnailUrl?: string | undefined;
91
+ } | {
92
+ type: "person";
93
+ summary?: string | undefined;
94
+ email?: string | undefined;
95
+ slackHandle?: string | undefined;
96
+ githubHandle?: string | undefined;
97
+ avatarUrl?: string | undefined;
64
98
  } | undefined;
65
99
  }[] | undefined;
66
100
  reply?: {
@@ -100,7 +134,7 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
100
134
  kind: "object";
101
135
  key: string;
102
136
  label: string;
103
- objectType: "automation" | "calendar_event" | "code_change" | "deployment" | "item" | "task";
137
+ objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
104
138
  title: string;
105
139
  url: string | null;
106
140
  description?: string | undefined;
@@ -111,6 +145,7 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
111
145
  sourceUpdatedAt?: string | undefined;
112
146
  facts?: {
113
147
  type: "code_change";
148
+ summary?: string | undefined;
114
149
  author?: string | undefined;
115
150
  sourceBranch?: string | undefined;
116
151
  targetBranch?: string | undefined;
@@ -125,8 +160,10 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
125
160
  changedFiles?: number | undefined;
126
161
  additions?: number | undefined;
127
162
  deletions?: number | undefined;
163
+ previewImageUrls?: string[] | undefined;
128
164
  } | {
129
165
  type: "task";
166
+ summary?: string | undefined;
130
167
  assignees?: string[] | undefined;
131
168
  priority?: string | undefined;
132
169
  project?: string | undefined;
@@ -135,14 +172,45 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
135
172
  labels?: string[] | undefined;
136
173
  } | {
137
174
  type: "deployment";
175
+ summary?: string | undefined;
138
176
  project?: string | undefined;
139
177
  environment?: string | undefined;
140
178
  revision?: string | undefined;
141
179
  branch?: string | undefined;
142
180
  } | {
143
181
  type: "calendar_event";
182
+ summary?: string | undefined;
144
183
  when?: string | undefined;
145
184
  attendees?: string[] | undefined;
185
+ } | {
186
+ type: "conversation";
187
+ summary?: string | undefined;
188
+ participants?: string[] | undefined;
189
+ lastActivityAt?: string | undefined;
190
+ } | {
191
+ type: "document";
192
+ summary?: string | undefined;
193
+ owner?: string | undefined;
194
+ modifiedAt?: string | undefined;
195
+ } | {
196
+ type: "message";
197
+ summary?: string | undefined;
198
+ channel?: string | undefined;
199
+ author?: string | undefined;
200
+ sentAt?: string | undefined;
201
+ } | {
202
+ type: "web_page";
203
+ summary?: string | undefined;
204
+ siteName?: string | undefined;
205
+ author?: string | undefined;
206
+ thumbnailUrl?: string | undefined;
207
+ } | {
208
+ type: "person";
209
+ summary?: string | undefined;
210
+ email?: string | undefined;
211
+ slackHandle?: string | undefined;
212
+ githubHandle?: string | undefined;
213
+ avatarUrl?: string | undefined;
146
214
  } | undefined;
147
215
  }[] | undefined;
148
216
  reply?: {