@sentry/junior-google 0.301.0 → 0.302.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.
@@ -1,11 +1,47 @@
1
1
  /**
2
- * Link cards for Google Docs, Sheets, and Slides.
2
+ * Link cards for Google Docs, Sheets, and Slides, and for Drive files and
3
+ * folders.
3
4
  *
4
5
  * Junior's own Google account reads the file, so the card shows only when
5
6
  * Drive says that the viewer can open it too. This is the rule of
6
7
  * `searchGoogleFiles`. Any unclear case gets no card. A Doc card also shows
7
8
  * its first paragraph.
8
9
  */
9
- import type { PluginObjectLinkDefinition } from "@sentry/junior-plugin-api";
10
- /** Docs, Sheets, and Slides links that resolve to document cards. */
10
+ import type { ObjectLinkContext, PluginObjectLinkDefinition } from "@sentry/junior-plugin-api";
11
+ import * as z from "zod";
12
+ import { type FileReference } from "../tools/files";
13
+ declare const linkedFileSchema: z.ZodObject<{
14
+ driveId: z.ZodOptional<z.ZodString>;
15
+ id: z.ZodString;
16
+ mimeType: z.ZodString;
17
+ modifiedTime: z.ZodOptional<z.ZodString>;
18
+ name: z.ZodString;
19
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
20
+ displayName: z.ZodOptional<z.ZodString>;
21
+ emailAddress: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>>>;
23
+ thumbnailLink: z.ZodOptional<z.ZodString>;
24
+ trashed: z.ZodOptional<z.ZodBoolean>;
25
+ }, z.core.$strip>;
26
+ type LinkedFile = z.infer<typeof linkedFileSchema>;
27
+ /** What a card or an image read needs to check one viewer. */
28
+ type ViewerReadContext = Pick<ObjectLinkContext, "egress" | "viewer">;
29
+ /** A file that a link names, and the Drive MIME types that the link fits. */
30
+ interface FileLink {
31
+ accepts(mimeType: string): boolean;
32
+ file: FileReference;
33
+ }
34
+ /**
35
+ * Read a file that the viewer can open in Drive, with no cache. Return
36
+ * nothing when Junior's account cannot read it, the link does not fit its
37
+ * type, it is in the trash, or the viewer cannot open it.
38
+ */
39
+ export declare function readViewerFile(ctx: ViewerReadContext, link: FileLink, allowedDomains: string[]): Promise<LinkedFile | undefined>;
40
+ /** Return the file link of a thumbnail image ref. */
41
+ export declare function thumbnailFileLink(ref: string): FileLink | undefined;
42
+ /**
43
+ * Docs, Sheets, and Slides links, and Drive file and folder links, that
44
+ * resolve to document cards.
45
+ */
11
46
  export declare const googleFileLinks: PluginObjectLinkDefinition;
47
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Drive file thumbnails for link cards, served through the Junior image
3
+ * proxy. Each read checks the viewer again with the link card rule, and
4
+ * Junior's Google credential goes only to Google's thumbnail host.
5
+ */
6
+ import type { PluginImageSource } from "@sentry/junior-plugin-api";
7
+ /** Drive thumbnails that link cards show. */
8
+ export declare const googleImages: PluginImageSource;
@@ -6,7 +6,7 @@ import { type GoogleToolContext } from "./shared";
6
6
  * who is invited. Events that other people organize stay out of reach: the
7
7
  * `calendar.events.owned` scope and the organizer check both enforce this.
8
8
  */
9
- export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
9
+ export declare const cancelCalendarEventTool: import("@sentry/junior-plugin-api").PluginToolDefinition<{
10
10
  event_id: string;
11
11
  time_zone?: string | undefined;
12
12
  }, {
@@ -15,7 +15,7 @@ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): i
15
15
  kind: "object";
16
16
  key: string;
17
17
  label: string;
18
- objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
18
+ objectType: "automation" | "calendar_event" | "chart" | "code_change" | "conversation" | "deployment" | "document" | "event" | "item" | "message" | "person" | "task" | "trace" | "web_page";
19
19
  title: string;
20
20
  url: string | null;
21
21
  description?: string | undefined;
@@ -51,6 +51,10 @@ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): i
51
51
  cycle?: string | undefined;
52
52
  dueDate?: string | undefined;
53
53
  labels?: string[] | undefined;
54
+ trend?: {
55
+ label: string;
56
+ points: number[];
57
+ } | undefined;
54
58
  } | {
55
59
  type: "deployment";
56
60
  summary?: string | undefined;
@@ -73,6 +77,7 @@ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): i
73
77
  summary?: string | undefined;
74
78
  owner?: string | undefined;
75
79
  modifiedAt?: string | undefined;
80
+ thumbnailUrl?: string | undefined;
76
81
  } | {
77
82
  type: "message";
78
83
  summary?: string | undefined;
@@ -84,7 +89,43 @@ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): i
84
89
  summary?: string | undefined;
85
90
  siteName?: string | undefined;
86
91
  author?: string | undefined;
92
+ media?: "image" | "video" | undefined;
87
93
  thumbnailUrl?: string | undefined;
94
+ } | {
95
+ type: "chart";
96
+ summary?: string | undefined;
97
+ display: "area" | "bar" | "line";
98
+ yAxis: string;
99
+ range: string;
100
+ series: {
101
+ label: string;
102
+ points: number[];
103
+ }[];
104
+ } | {
105
+ type: "event";
106
+ summary?: string | undefined;
107
+ level?: string | undefined;
108
+ project?: string | undefined;
109
+ release?: string | undefined;
110
+ environment?: string | undefined;
111
+ occurredAt?: string | undefined;
112
+ } | {
113
+ type: "trace";
114
+ summary?: string | undefined;
115
+ rootOp?: string | undefined;
116
+ rootName?: string | undefined;
117
+ durationMs: number;
118
+ spanCount: number;
119
+ errorCount: number;
120
+ performanceIssueCount: number;
121
+ projects: string[];
122
+ spans: {
123
+ op?: string | undefined;
124
+ name: string;
125
+ startMs: number;
126
+ durationMs: number;
127
+ issue?: boolean | undefined;
128
+ }[];
88
129
  } | {
89
130
  type: "person";
90
131
  summary?: string | undefined;
@@ -126,7 +167,7 @@ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): i
126
167
  kind: "object";
127
168
  key: string;
128
169
  label: string;
129
- objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
170
+ objectType: "automation" | "calendar_event" | "chart" | "code_change" | "conversation" | "deployment" | "document" | "event" | "item" | "message" | "person" | "task" | "trace" | "web_page";
130
171
  title: string;
131
172
  url: string | null;
132
173
  description?: string | undefined;
@@ -162,6 +203,10 @@ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): i
162
203
  cycle?: string | undefined;
163
204
  dueDate?: string | undefined;
164
205
  labels?: string[] | undefined;
206
+ trend?: {
207
+ label: string;
208
+ points: number[];
209
+ } | undefined;
165
210
  } | {
166
211
  type: "deployment";
167
212
  summary?: string | undefined;
@@ -184,6 +229,7 @@ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): i
184
229
  summary?: string | undefined;
185
230
  owner?: string | undefined;
186
231
  modifiedAt?: string | undefined;
232
+ thumbnailUrl?: string | undefined;
187
233
  } | {
188
234
  type: "message";
189
235
  summary?: string | undefined;
@@ -195,7 +241,43 @@ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): i
195
241
  summary?: string | undefined;
196
242
  siteName?: string | undefined;
197
243
  author?: string | undefined;
244
+ media?: "image" | "video" | undefined;
198
245
  thumbnailUrl?: string | undefined;
246
+ } | {
247
+ type: "chart";
248
+ summary?: string | undefined;
249
+ display: "area" | "bar" | "line";
250
+ yAxis: string;
251
+ range: string;
252
+ series: {
253
+ label: string;
254
+ points: number[];
255
+ }[];
256
+ } | {
257
+ type: "event";
258
+ summary?: string | undefined;
259
+ level?: string | undefined;
260
+ project?: string | undefined;
261
+ release?: string | undefined;
262
+ environment?: string | undefined;
263
+ occurredAt?: string | undefined;
264
+ } | {
265
+ type: "trace";
266
+ summary?: string | undefined;
267
+ rootOp?: string | undefined;
268
+ rootName?: string | undefined;
269
+ durationMs: number;
270
+ spanCount: number;
271
+ errorCount: number;
272
+ performanceIssueCount: number;
273
+ projects: string[];
274
+ spans: {
275
+ op?: string | undefined;
276
+ name: string;
277
+ startMs: number;
278
+ durationMs: number;
279
+ issue?: boolean | undefined;
280
+ }[];
199
281
  } | {
200
282
  type: "person";
201
283
  summary?: string | undefined;
@@ -231,4 +313,4 @@ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): i
231
313
  video_call_url?: string | undefined;
232
314
  target: "cancelCalendarEvent";
233
315
  cancelled: boolean;
234
- }>;
316
+ }, GoogleToolContext>;
@@ -8,7 +8,7 @@ import { type GoogleToolContext } from "./shared";
8
8
  * Junior's own access. Each failure after the create names the Doc and says
9
9
  * who can still open it, so a Doc is never reported private when it is not.
10
10
  */
11
- export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
11
+ export declare const createGoogleDocTool: import("@sentry/junior-plugin-api").PluginToolDefinition<{
12
12
  title: string;
13
13
  content?: string | undefined;
14
14
  }, {
@@ -17,7 +17,7 @@ export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): impor
17
17
  kind: "object";
18
18
  key: string;
19
19
  label: string;
20
- objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
20
+ objectType: "automation" | "calendar_event" | "chart" | "code_change" | "conversation" | "deployment" | "document" | "event" | "item" | "message" | "person" | "task" | "trace" | "web_page";
21
21
  title: string;
22
22
  url: string | null;
23
23
  description?: string | undefined;
@@ -53,6 +53,10 @@ export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): impor
53
53
  cycle?: string | undefined;
54
54
  dueDate?: string | undefined;
55
55
  labels?: string[] | undefined;
56
+ trend?: {
57
+ label: string;
58
+ points: number[];
59
+ } | undefined;
56
60
  } | {
57
61
  type: "deployment";
58
62
  summary?: string | undefined;
@@ -75,6 +79,7 @@ export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): impor
75
79
  summary?: string | undefined;
76
80
  owner?: string | undefined;
77
81
  modifiedAt?: string | undefined;
82
+ thumbnailUrl?: string | undefined;
78
83
  } | {
79
84
  type: "message";
80
85
  summary?: string | undefined;
@@ -86,7 +91,43 @@ export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): impor
86
91
  summary?: string | undefined;
87
92
  siteName?: string | undefined;
88
93
  author?: string | undefined;
94
+ media?: "image" | "video" | undefined;
89
95
  thumbnailUrl?: string | undefined;
96
+ } | {
97
+ type: "chart";
98
+ summary?: string | undefined;
99
+ display: "area" | "bar" | "line";
100
+ yAxis: string;
101
+ range: string;
102
+ series: {
103
+ label: string;
104
+ points: number[];
105
+ }[];
106
+ } | {
107
+ type: "event";
108
+ summary?: string | undefined;
109
+ level?: string | undefined;
110
+ project?: string | undefined;
111
+ release?: string | undefined;
112
+ environment?: string | undefined;
113
+ occurredAt?: string | undefined;
114
+ } | {
115
+ type: "trace";
116
+ summary?: string | undefined;
117
+ rootOp?: string | undefined;
118
+ rootName?: string | undefined;
119
+ durationMs: number;
120
+ spanCount: number;
121
+ errorCount: number;
122
+ performanceIssueCount: number;
123
+ projects: string[];
124
+ spans: {
125
+ op?: string | undefined;
126
+ name: string;
127
+ startMs: number;
128
+ durationMs: number;
129
+ issue?: boolean | undefined;
130
+ }[];
90
131
  } | {
91
132
  type: "person";
92
133
  summary?: string | undefined;
@@ -116,7 +157,7 @@ export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): impor
116
157
  kind: "object";
117
158
  key: string;
118
159
  label: string;
119
- objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
160
+ objectType: "automation" | "calendar_event" | "chart" | "code_change" | "conversation" | "deployment" | "document" | "event" | "item" | "message" | "person" | "task" | "trace" | "web_page";
120
161
  title: string;
121
162
  url: string | null;
122
163
  description?: string | undefined;
@@ -152,6 +193,10 @@ export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): impor
152
193
  cycle?: string | undefined;
153
194
  dueDate?: string | undefined;
154
195
  labels?: string[] | undefined;
196
+ trend?: {
197
+ label: string;
198
+ points: number[];
199
+ } | undefined;
155
200
  } | {
156
201
  type: "deployment";
157
202
  summary?: string | undefined;
@@ -174,6 +219,7 @@ export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): impor
174
219
  summary?: string | undefined;
175
220
  owner?: string | undefined;
176
221
  modifiedAt?: string | undefined;
222
+ thumbnailUrl?: string | undefined;
177
223
  } | {
178
224
  type: "message";
179
225
  summary?: string | undefined;
@@ -185,7 +231,43 @@ export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): impor
185
231
  summary?: string | undefined;
186
232
  siteName?: string | undefined;
187
233
  author?: string | undefined;
234
+ media?: "image" | "video" | undefined;
188
235
  thumbnailUrl?: string | undefined;
236
+ } | {
237
+ type: "chart";
238
+ summary?: string | undefined;
239
+ display: "area" | "bar" | "line";
240
+ yAxis: string;
241
+ range: string;
242
+ series: {
243
+ label: string;
244
+ points: number[];
245
+ }[];
246
+ } | {
247
+ type: "event";
248
+ summary?: string | undefined;
249
+ level?: string | undefined;
250
+ project?: string | undefined;
251
+ release?: string | undefined;
252
+ environment?: string | undefined;
253
+ occurredAt?: string | undefined;
254
+ } | {
255
+ type: "trace";
256
+ summary?: string | undefined;
257
+ rootOp?: string | undefined;
258
+ rootName?: string | undefined;
259
+ durationMs: number;
260
+ spanCount: number;
261
+ errorCount: number;
262
+ performanceIssueCount: number;
263
+ projects: string[];
264
+ spans: {
265
+ op?: string | undefined;
266
+ name: string;
267
+ startMs: number;
268
+ durationMs: number;
269
+ issue?: boolean | undefined;
270
+ }[];
189
271
  } | {
190
272
  type: "person";
191
273
  summary?: string | undefined;
@@ -209,4 +291,4 @@ export declare function createCreateGoogleDocTool(ctx: GoogleToolContext): impor
209
291
  title: string;
210
292
  url: string;
211
293
  target: "createGoogleDoc";
212
- }>;
294
+ }, GoogleToolContext>;
@@ -20,7 +20,7 @@ export declare function recurrenceRule(repeat: Repeat): string;
20
20
  */
21
21
  export declare function calendarEventId(toolCallId: string | undefined): string;
22
22
  /** Create an event on Junior's own calendar and invite the attendees. */
23
- export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
23
+ export declare const createCalendarEventTool: import("@sentry/junior-plugin-api").PluginToolDefinition<{
24
24
  title: string;
25
25
  description?: string | undefined;
26
26
  location?: string | undefined;
@@ -40,7 +40,7 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
40
40
  kind: "object";
41
41
  key: string;
42
42
  label: string;
43
- objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
43
+ objectType: "automation" | "calendar_event" | "chart" | "code_change" | "conversation" | "deployment" | "document" | "event" | "item" | "message" | "person" | "task" | "trace" | "web_page";
44
44
  title: string;
45
45
  url: string | null;
46
46
  description?: string | undefined;
@@ -76,6 +76,10 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
76
76
  cycle?: string | undefined;
77
77
  dueDate?: string | undefined;
78
78
  labels?: string[] | undefined;
79
+ trend?: {
80
+ label: string;
81
+ points: number[];
82
+ } | undefined;
79
83
  } | {
80
84
  type: "deployment";
81
85
  summary?: string | undefined;
@@ -98,6 +102,7 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
98
102
  summary?: string | undefined;
99
103
  owner?: string | undefined;
100
104
  modifiedAt?: string | undefined;
105
+ thumbnailUrl?: string | undefined;
101
106
  } | {
102
107
  type: "message";
103
108
  summary?: string | undefined;
@@ -109,7 +114,43 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
109
114
  summary?: string | undefined;
110
115
  siteName?: string | undefined;
111
116
  author?: string | undefined;
117
+ media?: "image" | "video" | undefined;
112
118
  thumbnailUrl?: string | undefined;
119
+ } | {
120
+ type: "chart";
121
+ summary?: string | undefined;
122
+ display: "area" | "bar" | "line";
123
+ yAxis: string;
124
+ range: string;
125
+ series: {
126
+ label: string;
127
+ points: number[];
128
+ }[];
129
+ } | {
130
+ type: "event";
131
+ summary?: string | undefined;
132
+ level?: string | undefined;
133
+ project?: string | undefined;
134
+ release?: string | undefined;
135
+ environment?: string | undefined;
136
+ occurredAt?: string | undefined;
137
+ } | {
138
+ type: "trace";
139
+ summary?: string | undefined;
140
+ rootOp?: string | undefined;
141
+ rootName?: string | undefined;
142
+ durationMs: number;
143
+ spanCount: number;
144
+ errorCount: number;
145
+ performanceIssueCount: number;
146
+ projects: string[];
147
+ spans: {
148
+ op?: string | undefined;
149
+ name: string;
150
+ startMs: number;
151
+ durationMs: number;
152
+ issue?: boolean | undefined;
153
+ }[];
113
154
  } | {
114
155
  type: "person";
115
156
  summary?: string | undefined;
@@ -151,7 +192,7 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
151
192
  kind: "object";
152
193
  key: string;
153
194
  label: string;
154
- objectType: "automation" | "calendar_event" | "code_change" | "conversation" | "deployment" | "document" | "item" | "message" | "person" | "task" | "web_page";
195
+ objectType: "automation" | "calendar_event" | "chart" | "code_change" | "conversation" | "deployment" | "document" | "event" | "item" | "message" | "person" | "task" | "trace" | "web_page";
155
196
  title: string;
156
197
  url: string | null;
157
198
  description?: string | undefined;
@@ -187,6 +228,10 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
187
228
  cycle?: string | undefined;
188
229
  dueDate?: string | undefined;
189
230
  labels?: string[] | undefined;
231
+ trend?: {
232
+ label: string;
233
+ points: number[];
234
+ } | undefined;
190
235
  } | {
191
236
  type: "deployment";
192
237
  summary?: string | undefined;
@@ -209,6 +254,7 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
209
254
  summary?: string | undefined;
210
255
  owner?: string | undefined;
211
256
  modifiedAt?: string | undefined;
257
+ thumbnailUrl?: string | undefined;
212
258
  } | {
213
259
  type: "message";
214
260
  summary?: string | undefined;
@@ -220,7 +266,43 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
220
266
  summary?: string | undefined;
221
267
  siteName?: string | undefined;
222
268
  author?: string | undefined;
269
+ media?: "image" | "video" | undefined;
223
270
  thumbnailUrl?: string | undefined;
271
+ } | {
272
+ type: "chart";
273
+ summary?: string | undefined;
274
+ display: "area" | "bar" | "line";
275
+ yAxis: string;
276
+ range: string;
277
+ series: {
278
+ label: string;
279
+ points: number[];
280
+ }[];
281
+ } | {
282
+ type: "event";
283
+ summary?: string | undefined;
284
+ level?: string | undefined;
285
+ project?: string | undefined;
286
+ release?: string | undefined;
287
+ environment?: string | undefined;
288
+ occurredAt?: string | undefined;
289
+ } | {
290
+ type: "trace";
291
+ summary?: string | undefined;
292
+ rootOp?: string | undefined;
293
+ rootName?: string | undefined;
294
+ durationMs: number;
295
+ spanCount: number;
296
+ errorCount: number;
297
+ performanceIssueCount: number;
298
+ projects: string[];
299
+ spans: {
300
+ op?: string | undefined;
301
+ name: string;
302
+ startMs: number;
303
+ durationMs: number;
304
+ issue?: boolean | undefined;
305
+ }[];
224
306
  } | {
225
307
  type: "person";
226
308
  summary?: string | undefined;
@@ -256,5 +338,5 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
256
338
  video_call_url?: string | undefined;
257
339
  target: "createCalendarEvent";
258
340
  created: boolean;
259
- }>;
341
+ }, GoogleToolContext>;
260
342
  export {};