@sentry/junior-vercel 0.318.0 → 0.319.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,15 @@
1
1
  import { a as VERCEL_DEPLOYMENT_MATCH_FIELDS, i as VERCEL_DEPLOYMENT_EVENTS, o as VERCEL_DEPLOYMENT_SUGGESTED_EVENTS, r as vercelDeploymentTool, t as createVercelWebhookRoute } from "./handler-BXN5t4qw.js";
2
2
  import { PluginToolInputError, defineJuniorPlugin, definePluginTool, pluginToolOutputSchema } from "@sentry/junior-plugin-api";
3
3
  import * as z from "zod";
4
+ // src/inbox-subjects.ts
5
+ /** The subject kinds of Vercel objects. */
6
+ const VERCEL_SUBJECT_KINDS = { deployment: "deployment" };
7
+ /** The registered kinds and labels, for the plugin registration. */
8
+ const vercelInboxSubjectKinds = [{
9
+ kind: VERCEL_SUBJECT_KINDS.deployment,
10
+ label: "Deployment",
11
+ owner: "annotation"
12
+ }];
4
13
  // src/tool-support/vercel-api.ts
5
14
  /**
6
15
  * Vercel API calls and shared shapes of the deployment and alias tools. The
@@ -49,9 +58,25 @@ const aliasOutputSchema = pluginToolOutputSchema.extend({
49
58
  deployment_id: nonEmptyText.nullable(),
50
59
  redirect: nonEmptyText.nullable()
51
60
  });
52
- /** Select the safe fields of a Vercel deployment for a tool result. */
53
- function deploymentResult(data) {
61
+ /**
62
+ * Select the safe fields of a Vercel deployment for a tool result. A tool
63
+ * that created the deployment passes `created`, so the result saves its
64
+ * Annotation. A read adds none.
65
+ */
66
+ function deploymentResult(data, action) {
54
67
  const value = deploymentSchema.parse(data);
68
+ const annotation = action && {
69
+ action,
70
+ kind: "object",
71
+ objectType: "deployment",
72
+ key: value.id,
73
+ subject: {
74
+ id: value.id,
75
+ kind: VERCEL_SUBJECT_KINDS.deployment
76
+ },
77
+ title: value.url.slice(0, 512),
78
+ url: `https://${value.url}`
79
+ };
55
80
  return {
56
81
  target: "deployment",
57
82
  deployment_id: value.id,
@@ -61,23 +86,7 @@ function deploymentResult(data) {
61
86
  project_id: value.projectId ?? null,
62
87
  commit_sha: value.gitSource?.sha ?? null,
63
88
  ref: value.gitSource?.ref ?? null,
64
- objectAnnotations: [{
65
- kind: "object",
66
- objectType: "deployment",
67
- displayType: "Deployment",
68
- key: value.id,
69
- label: value.id,
70
- title: value.url.slice(0, 512),
71
- url: `https://${value.url}`,
72
- status: value.readyState,
73
- facts: {
74
- type: "deployment",
75
- project: value.projectId?.slice(0, 64),
76
- environment: value.target?.slice(0, 64) ?? void 0,
77
- revision: value.gitSource?.sha?.slice(0, 64),
78
- branch: value.gitSource?.ref?.slice(0, 64)
79
- }
80
- }]
89
+ ...annotation ? { objectAnnotations: [annotation] } : void 0
81
90
  };
82
91
  }
83
92
  /** Call the Vercel API through plugin egress and return the JSON body. */
@@ -199,7 +208,7 @@ const vercelDeploymentCreateTool = definePluginTool({
199
208
  project: project.id,
200
209
  target: input.target === "production" ? "production" : void 0,
201
210
  gitSource
202
- }));
211
+ }), "created");
203
212
  }
204
213
  });
205
214
  // src/tools/deployment-delete.ts
@@ -266,6 +275,7 @@ function vercelWebhookSecret() {
266
275
  function vercelPlugin() {
267
276
  return defineJuniorPlugin({
268
277
  packageName: "@sentry/junior-vercel",
278
+ inboxSubjects: vercelInboxSubjectKinds,
269
279
  events: {
270
280
  resourceTypes: [{
271
281
  type: "deployment",
package/dist/testing.d.ts CHANGED
@@ -9,185 +9,14 @@ export declare const vercelDeploymentTool: import("@sentry/junior-plugin-api").P
9
9
  objectAnnotations?: {
10
10
  kind: "object";
11
11
  key: string;
12
- label: string;
12
+ subject?: {
13
+ kind: string;
14
+ id: string;
15
+ } | undefined;
13
16
  objectType: "alert" | "automation" | "calendar_event" | "chart" | "code_change" | "conversation" | "dashboard" | "deployment" | "document" | "event" | "item" | "message" | "monitor" | "person" | "release" | "task" | "trace" | "web_page";
14
17
  title: string;
15
18
  url: string | null;
16
- description?: string | undefined;
17
- status?: string | undefined;
18
- trigger?: string | undefined;
19
- warning?: string | undefined;
20
- displayType?: string | undefined;
21
- sourceUpdatedAt?: string | undefined;
22
- facts?: {
23
- type: "code_change";
24
- summary?: string | undefined;
25
- author?: string | undefined;
26
- sourceBranch?: string | undefined;
27
- targetBranch?: string | undefined;
28
- reviewers?: string[] | undefined;
29
- review?: "approved" | "changes_requested" | "required" | undefined;
30
- checks?: "pending" | {
31
- passed: number;
32
- failed: number;
33
- pending: number;
34
- } | undefined;
35
- mergeable?: "pending" | boolean | undefined;
36
- titleParts?: {
37
- breaking?: boolean | undefined;
38
- scope?: string | undefined;
39
- text: string;
40
- type?: string | undefined;
41
- } | undefined;
42
- changedFiles?: number | undefined;
43
- additions?: number | undefined;
44
- deletions?: number | undefined;
45
- previewImageUrls?: string[] | undefined;
46
- } | {
47
- type: "task";
48
- summary?: string | undefined;
49
- assignees?: string[] | undefined;
50
- priority?: string | undefined;
51
- project?: string | undefined;
52
- cycle?: string | undefined;
53
- dueDate?: string | undefined;
54
- labels?: string[] | undefined;
55
- trend?: {
56
- label: string;
57
- points: number[];
58
- } | undefined;
59
- } | {
60
- type: "deployment";
61
- summary?: string | undefined;
62
- project?: string | undefined;
63
- environment?: string | undefined;
64
- revision?: string | undefined;
65
- branch?: string | undefined;
66
- } | {
67
- type: "calendar_event";
68
- summary?: string | undefined;
69
- when?: string | undefined;
70
- attendees?: string[] | undefined;
71
- } | {
72
- type: "conversation";
73
- summary?: string | undefined;
74
- participants?: string[] | undefined;
75
- lastActivityAt?: string | undefined;
76
- } | {
77
- type: "document";
78
- summary?: string | undefined;
79
- owner?: string | undefined;
80
- modifiedAt?: string | undefined;
81
- thumbnailUrl?: string | undefined;
82
- } | {
83
- type: "message";
84
- summary?: string | undefined;
85
- channel?: string | undefined;
86
- author?: string | undefined;
87
- sentAt?: string | undefined;
88
- } | {
89
- type: "web_page";
90
- summary?: string | undefined;
91
- siteName?: string | undefined;
92
- author?: string | undefined;
93
- media?: "image" | "video" | undefined;
94
- thumbnailUrl?: string | undefined;
95
- } | {
96
- type: "chart";
97
- summary?: string | undefined;
98
- display: "area" | "bar" | "line";
99
- yAxis: string;
100
- range: string;
101
- series: {
102
- label: string;
103
- points: number[];
104
- }[];
105
- } | {
106
- type: "event";
107
- summary?: string | undefined;
108
- level?: string | undefined;
109
- project?: string | undefined;
110
- release?: string | undefined;
111
- environment?: string | undefined;
112
- occurredAt?: string | undefined;
113
- } | {
114
- type: "release";
115
- summary?: string | undefined;
116
- version: string;
117
- projects: string[];
118
- newIssues?: number | undefined;
119
- crashFreeSessions?: number | undefined;
120
- deployCount?: number | undefined;
121
- lastDeploy?: {
122
- environment: string;
123
- finishedAt?: string | undefined;
124
- } | undefined;
125
- releasedAt?: string | undefined;
126
- } | {
127
- type: "monitor";
128
- summary?: string | undefined;
129
- kind: "cron" | "metric" | "uptime";
130
- state: "failing" | "ok" | "paused" | "pending";
131
- project?: string | undefined;
132
- environment?: string | undefined;
133
- detail?: string | undefined;
134
- lastCheckedAt?: string | undefined;
135
- trend?: {
136
- label: string;
137
- points: number[];
138
- } | undefined;
139
- } | {
140
- type: "alert";
141
- summary?: string | undefined;
142
- enabled: boolean;
143
- projects: string[];
144
- trigger?: string | undefined;
145
- notifies: string[];
146
- lastTriggeredAt?: string | undefined;
147
- } | {
148
- type: "trace";
149
- summary?: string | undefined;
150
- rootOp?: string | undefined;
151
- rootName?: string | undefined;
152
- durationMs: number;
153
- spanCount: number;
154
- errorCount: number;
155
- performanceIssueCount: number;
156
- projects: string[];
157
- spans: {
158
- op?: string | undefined;
159
- name: string;
160
- startMs: number;
161
- durationMs: number;
162
- issue?: boolean | undefined;
163
- }[];
164
- } | {
165
- type: "dashboard";
166
- summary?: string | undefined;
167
- widgetCount: number;
168
- projects: string[];
169
- environments: string[];
170
- range: string;
171
- widgets: {
172
- title: string;
173
- display: string;
174
- }[];
175
- charts: {
176
- title: string;
177
- display: "area" | "bar" | "line";
178
- series: {
179
- label: string;
180
- points: number[];
181
- }[];
182
- }[];
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;
19
+ action: "changed" | "created";
191
20
  }[] | undefined;
192
21
  reply?: {
193
22
  text: string;
@@ -215,185 +44,14 @@ export declare const vercelDeploymentTool: import("@sentry/junior-plugin-api").P
215
44
  objectAnnotations?: {
216
45
  kind: "object";
217
46
  key: string;
218
- label: string;
47
+ subject?: {
48
+ kind: string;
49
+ id: string;
50
+ } | undefined;
219
51
  objectType: "alert" | "automation" | "calendar_event" | "chart" | "code_change" | "conversation" | "dashboard" | "deployment" | "document" | "event" | "item" | "message" | "monitor" | "person" | "release" | "task" | "trace" | "web_page";
220
52
  title: string;
221
53
  url: string | null;
222
- description?: string | undefined;
223
- status?: string | undefined;
224
- trigger?: string | undefined;
225
- warning?: string | undefined;
226
- displayType?: string | undefined;
227
- sourceUpdatedAt?: string | undefined;
228
- facts?: {
229
- type: "code_change";
230
- summary?: string | undefined;
231
- author?: string | undefined;
232
- sourceBranch?: string | undefined;
233
- targetBranch?: string | undefined;
234
- reviewers?: string[] | undefined;
235
- review?: "approved" | "changes_requested" | "required" | undefined;
236
- checks?: "pending" | {
237
- passed: number;
238
- failed: number;
239
- pending: number;
240
- } | undefined;
241
- mergeable?: "pending" | boolean | undefined;
242
- titleParts?: {
243
- breaking?: boolean | undefined;
244
- scope?: string | undefined;
245
- text: string;
246
- type?: string | undefined;
247
- } | undefined;
248
- changedFiles?: number | undefined;
249
- additions?: number | undefined;
250
- deletions?: number | undefined;
251
- previewImageUrls?: string[] | undefined;
252
- } | {
253
- type: "task";
254
- summary?: string | undefined;
255
- assignees?: string[] | undefined;
256
- priority?: string | undefined;
257
- project?: string | undefined;
258
- cycle?: string | undefined;
259
- dueDate?: string | undefined;
260
- labels?: string[] | undefined;
261
- trend?: {
262
- label: string;
263
- points: number[];
264
- } | undefined;
265
- } | {
266
- type: "deployment";
267
- summary?: string | undefined;
268
- project?: string | undefined;
269
- environment?: string | undefined;
270
- revision?: string | undefined;
271
- branch?: string | undefined;
272
- } | {
273
- type: "calendar_event";
274
- summary?: string | undefined;
275
- when?: string | undefined;
276
- attendees?: string[] | undefined;
277
- } | {
278
- type: "conversation";
279
- summary?: string | undefined;
280
- participants?: string[] | undefined;
281
- lastActivityAt?: string | undefined;
282
- } | {
283
- type: "document";
284
- summary?: string | undefined;
285
- owner?: string | undefined;
286
- modifiedAt?: string | undefined;
287
- thumbnailUrl?: string | undefined;
288
- } | {
289
- type: "message";
290
- summary?: string | undefined;
291
- channel?: string | undefined;
292
- author?: string | undefined;
293
- sentAt?: string | undefined;
294
- } | {
295
- type: "web_page";
296
- summary?: string | undefined;
297
- siteName?: string | undefined;
298
- author?: string | undefined;
299
- media?: "image" | "video" | undefined;
300
- thumbnailUrl?: string | undefined;
301
- } | {
302
- type: "chart";
303
- summary?: string | undefined;
304
- display: "area" | "bar" | "line";
305
- yAxis: string;
306
- range: string;
307
- series: {
308
- label: string;
309
- points: number[];
310
- }[];
311
- } | {
312
- type: "event";
313
- summary?: string | undefined;
314
- level?: string | undefined;
315
- project?: string | undefined;
316
- release?: string | undefined;
317
- environment?: string | undefined;
318
- occurredAt?: string | undefined;
319
- } | {
320
- type: "release";
321
- summary?: string | undefined;
322
- version: string;
323
- projects: string[];
324
- newIssues?: number | undefined;
325
- crashFreeSessions?: number | undefined;
326
- deployCount?: number | undefined;
327
- lastDeploy?: {
328
- environment: string;
329
- finishedAt?: string | undefined;
330
- } | undefined;
331
- releasedAt?: string | undefined;
332
- } | {
333
- type: "monitor";
334
- summary?: string | undefined;
335
- kind: "cron" | "metric" | "uptime";
336
- state: "failing" | "ok" | "paused" | "pending";
337
- project?: string | undefined;
338
- environment?: string | undefined;
339
- detail?: string | undefined;
340
- lastCheckedAt?: string | undefined;
341
- trend?: {
342
- label: string;
343
- points: number[];
344
- } | undefined;
345
- } | {
346
- type: "alert";
347
- summary?: string | undefined;
348
- enabled: boolean;
349
- projects: string[];
350
- trigger?: string | undefined;
351
- notifies: string[];
352
- lastTriggeredAt?: string | undefined;
353
- } | {
354
- type: "trace";
355
- summary?: string | undefined;
356
- rootOp?: string | undefined;
357
- rootName?: string | undefined;
358
- durationMs: number;
359
- spanCount: number;
360
- errorCount: number;
361
- performanceIssueCount: number;
362
- projects: string[];
363
- spans: {
364
- op?: string | undefined;
365
- name: string;
366
- startMs: number;
367
- durationMs: number;
368
- issue?: boolean | undefined;
369
- }[];
370
- } | {
371
- type: "dashboard";
372
- summary?: string | undefined;
373
- widgetCount: number;
374
- projects: string[];
375
- environments: string[];
376
- range: string;
377
- widgets: {
378
- title: string;
379
- display: string;
380
- }[];
381
- charts: {
382
- title: string;
383
- display: "area" | "bar" | "line";
384
- series: {
385
- label: string;
386
- points: number[];
387
- }[];
388
- }[];
389
- } | {
390
- type: "person";
391
- summary?: string | undefined;
392
- email?: string | undefined;
393
- slackHandle?: string | undefined;
394
- githubHandle?: string | undefined;
395
- avatarUrl?: string | undefined;
396
- } | undefined;
54
+ action: "changed" | "created";
397
55
  }[] | undefined;
398
56
  reply?: {
399
57
  text: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-vercel",
3
- "version": "0.318.0",
3
+ "version": "0.319.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -26,7 +26,7 @@
26
26
  "skills"
27
27
  ],
28
28
  "dependencies": {
29
- "@sentry/junior-plugin-api": "0.318.0",
29
+ "@sentry/junior-plugin-api": "0.319.0",
30
30
  "zod": "^4.6.7"
31
31
  },
32
32
  "devDependencies": {