@sentry/junior-google 0.238.0 → 0.239.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.
@@ -3,6 +3,8 @@ import { z } from "zod";
3
3
  import { type GoogleOperation } from "../credentials";
4
4
  /** Runtime capabilities the Calendar tools use. */
5
5
  export interface GoogleToolContext {
6
+ /** The Workspace account Junior acts as, in lowercase. */
7
+ accountEmail: string;
6
8
  allowedDomains: string[];
7
9
  egress: PluginEgress;
8
10
  users: {
@@ -13,6 +15,8 @@ export interface GoogleToolContext {
13
15
  }
14
16
  export declare const emailListSchema: (max: number) => z.ZodArray<z.ZodPipe<z.ZodString, z.ZodEmail>>;
15
17
  export declare const timeZoneSchema: z.ZodString;
18
+ /** True when the runtime knows this IANA time zone. */
19
+ export declare function isTimeZone(value: string): boolean;
16
20
  /** Reject people outside the domains Junior may look up or invite. */
17
21
  export declare function requireAllowedEmails(emails: string[], allowedDomains: string[]): void;
18
22
  /** Return the requester's email in lowercase, when Junior knows it. */
@@ -41,32 +45,124 @@ export declare function googleApiError(operation: GoogleOperation, response: {
41
45
  export declare function formatInterval(startMs: number, endMs: number, timeZone: string): string;
42
46
  /** Longest event Junior may create or move an event to. */
43
47
  export declare const MAX_EVENT_MS: number;
48
+ /** Google attendee fields that tools read and return. */
49
+ export declare const googleAttendeeSchema: z.ZodObject<{
50
+ displayName: z.ZodOptional<z.ZodString>;
51
+ email: z.ZodString;
52
+ optional: z.ZodOptional<z.ZodBoolean>;
53
+ resource: z.ZodOptional<z.ZodBoolean>;
54
+ responseStatus: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$loose>;
56
+ /** One attendee in a tool result. */
57
+ export declare const attendeeOutputSchema: z.ZodObject<{
58
+ email: z.ZodString;
59
+ optional: z.ZodOptional<z.ZodBoolean>;
60
+ response: z.ZodOptional<z.ZodEnum<{
61
+ accepted: "accepted";
62
+ declined: "declined";
63
+ tentative: "tentative";
64
+ needsAction: "needsAction";
65
+ }>>;
66
+ }, z.core.$strip>;
67
+ /** Shape Google attendees for a tool result. Room resources are left out. */
68
+ export declare function attendeeResults(attendees: Array<z.infer<typeof googleAttendeeSchema>> | undefined): Array<z.infer<typeof attendeeOutputSchema>>;
44
69
  /** Event fields that Junior reads back from its own calendar. */
45
70
  export declare const ownEventSchema: z.ZodObject<{
46
71
  attendees: z.ZodOptional<z.ZodArray<z.ZodObject<{
72
+ displayName: z.ZodOptional<z.ZodString>;
47
73
  email: z.ZodString;
74
+ optional: z.ZodOptional<z.ZodBoolean>;
75
+ resource: z.ZodOptional<z.ZodBoolean>;
48
76
  responseStatus: z.ZodOptional<z.ZodString>;
49
77
  }, z.core.$loose>>>;
78
+ description: z.ZodOptional<z.ZodString>;
50
79
  end: z.ZodObject<{
51
80
  dateTime: z.ZodString;
52
81
  }, z.core.$strip>;
53
82
  hangoutLink: z.ZodOptional<z.ZodString>;
54
83
  htmlLink: z.ZodOptional<z.ZodString>;
55
84
  id: z.ZodString;
85
+ location: z.ZodOptional<z.ZodString>;
56
86
  organizer: z.ZodOptional<z.ZodObject<{
57
87
  self: z.ZodOptional<z.ZodBoolean>;
58
88
  }, z.core.$strip>>;
89
+ recurrence: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
+ recurringEventId: z.ZodOptional<z.ZodString>;
59
91
  start: z.ZodObject<{
60
92
  dateTime: z.ZodString;
61
93
  }, z.core.$strip>;
62
94
  summary: z.ZodOptional<z.ZodString>;
95
+ updated: z.ZodOptional<z.ZodString>;
63
96
  }, z.core.$strip>;
64
- /** Shape one event on Junior's calendar for a tool result. */
65
- export declare function ownEventResult(event: z.infer<typeof ownEventSchema>, timeZone: string): {
97
+ export type OwnEvent = z.infer<typeof ownEventSchema>;
98
+ /**
99
+ * Shape one event on Junior's calendar for a tool result.
100
+ *
101
+ * Core saves the Calendar event annotation and shows its card with the next
102
+ * reply. The event id is the key, so a change replaces the saved card. The
103
+ * label is the short date for the sidebar; the card shows the full time.
104
+ */
105
+ export declare function ownEventResult(event: OwnEvent, timeZone: string): {
66
106
  videoCallUrl?: string | undefined;
67
107
  url?: string | undefined;
108
+ seriesEventId?: string | undefined;
109
+ repeats?: boolean | undefined;
110
+ location?: string | undefined;
68
111
  title?: string | undefined;
69
- attendees: string[];
112
+ objectAnnotations: {
113
+ kind: "object";
114
+ key: string;
115
+ label: string;
116
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
117
+ title: string;
118
+ url: string | null;
119
+ description?: string | undefined;
120
+ status?: string | undefined;
121
+ trigger?: string | undefined;
122
+ warning?: string | undefined;
123
+ displayType?: string | undefined;
124
+ sourceUpdatedAt?: string | undefined;
125
+ facts?: {
126
+ type: "code_change";
127
+ author?: string | undefined;
128
+ sourceBranch?: string | undefined;
129
+ targetBranch?: string | undefined;
130
+ reviewers?: string[] | undefined;
131
+ review?: "required" | "approved" | "changes_requested" | undefined;
132
+ checks?: {
133
+ passed: number;
134
+ failed: number;
135
+ pending: number;
136
+ } | undefined;
137
+ mergeable?: boolean | undefined;
138
+ changedFiles?: number | undefined;
139
+ additions?: number | undefined;
140
+ deletions?: number | undefined;
141
+ } | {
142
+ type: "task";
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
+ project?: string | undefined;
152
+ environment?: string | undefined;
153
+ revision?: string | undefined;
154
+ branch?: string | undefined;
155
+ } | {
156
+ type: "calendar_event";
157
+ when?: string | undefined;
158
+ attendees?: string[] | undefined;
159
+ } | undefined;
160
+ }[];
161
+ attendees: {
162
+ email: string;
163
+ optional?: boolean | undefined;
164
+ response?: "accepted" | "declined" | "tentative" | "needsAction" | undefined;
165
+ }[];
70
166
  end: string;
71
167
  eventId: string;
72
168
  label: string;
@@ -74,12 +170,54 @@ export declare function ownEventResult(event: z.infer<typeof ownEventSchema>, ti
74
170
  };
75
171
  /** Output fields shared by the tools that create or change Junior's events. */
76
172
  export declare const ownEventOutputFields: {
77
- attendees: z.ZodArray<z.ZodString>;
173
+ attendees: z.ZodArray<z.ZodObject<{
174
+ email: z.ZodString;
175
+ optional: z.ZodOptional<z.ZodBoolean>;
176
+ response: z.ZodOptional<z.ZodEnum<{
177
+ accepted: "accepted";
178
+ declined: "declined";
179
+ tentative: "tentative";
180
+ needsAction: "needsAction";
181
+ }>>;
182
+ }, z.core.$strip>>;
78
183
  end: z.ZodString;
79
184
  eventId: z.ZodString;
80
185
  label: z.ZodString;
186
+ location: z.ZodOptional<z.ZodString>;
187
+ repeats: z.ZodOptional<z.ZodBoolean>;
188
+ seriesEventId: z.ZodOptional<z.ZodString>;
81
189
  start: z.ZodString;
82
190
  title: z.ZodOptional<z.ZodString>;
83
191
  url: z.ZodOptional<z.ZodString>;
84
192
  videoCallUrl: z.ZodOptional<z.ZodString>;
85
193
  };
194
+ /** Event id or link input for tools that act on an event Junior organizes. */
195
+ export declare const ownEventIdSchema: z.ZodString;
196
+ /**
197
+ * Return the event id from an id or a Google Calendar event link.
198
+ *
199
+ * A link's `eid` value is base64 for `<eventId> <calendar email>`.
200
+ */
201
+ export declare function parseEventId(value: string): string;
202
+ /** Result of reading an event that Junior organizes. */
203
+ export type OwnEventRead = {
204
+ event: OwnEvent;
205
+ eventId: string;
206
+ path: string;
207
+ status: "active";
208
+ } | {
209
+ eventId: string;
210
+ path: string;
211
+ status: "cancelled";
212
+ };
213
+ /**
214
+ * Read an event that Junior organizes, for a requester who is invited to it.
215
+ *
216
+ * Only invited people may change or cancel an event. This keeps one requester
217
+ * from moving or cancelling a meeting that Junior set up for others.
218
+ *
219
+ * A deleted event on Junior's calendar comes back as `cancelled`. Google
220
+ * returns it as HTTP 410, or as a stub with only `id` and `status`, so it has
221
+ * no organizer or attendees to check. Callers must not change it.
222
+ */
223
+ export declare function readOwnEventForRequester(ctx: GoogleToolContext, eventIdOrLink: string, action: "change" | "cancel"): Promise<OwnEventRead>;
@@ -2,21 +2,27 @@ import { type GoogleToolContext } from "./shared";
2
2
  /**
3
3
  * Change an event that Junior organizes and email the attendees.
4
4
  *
5
- * Only people already invited to the event may change it. This keeps one
6
- * requester from moving or rewriting a meeting that Junior set up for others.
5
+ * Only people already invited to the event may change it.
7
6
  */
8
7
  export declare function createUpdateCalendarEventTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
9
8
  eventId: string;
10
9
  timeZone: string;
11
10
  addAttendees: string[];
11
+ addOptionalAttendees: string[];
12
12
  removeAttendees: string[];
13
13
  title?: string | undefined;
14
14
  description?: string | undefined;
15
15
  start?: string | undefined;
16
16
  end?: string | undefined;
17
+ location?: string | undefined;
18
+ addVideoCall?: true | undefined;
17
19
  }, {
18
20
  [x: string]: unknown;
19
- attendees: string[];
21
+ attendees: {
22
+ email: string;
23
+ optional?: boolean | undefined;
24
+ response?: "accepted" | "declined" | "tentative" | "needsAction" | undefined;
25
+ }[];
20
26
  end: string;
21
27
  eventId: string;
22
28
  label: string;
@@ -26,7 +32,7 @@ export declare function createUpdateCalendarEventTool(ctx: GoogleToolContext): i
26
32
  kind: "object";
27
33
  key: string;
28
34
  label: string;
29
- objectType: "code_change" | "task" | "deployment" | "automation" | "item";
35
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
30
36
  title: string;
31
37
  url: string | null;
32
38
  description?: string | undefined;
@@ -65,6 +71,10 @@ export declare function createUpdateCalendarEventTool(ctx: GoogleToolContext): i
65
71
  environment?: string | undefined;
66
72
  revision?: string | undefined;
67
73
  branch?: string | undefined;
74
+ } | {
75
+ type: "calendar_event";
76
+ when?: string | undefined;
77
+ attendees?: string[] | undefined;
68
78
  } | undefined;
69
79
  }[] | undefined;
70
80
  truncated?: boolean | undefined;
@@ -72,12 +82,19 @@ export declare function createUpdateCalendarEventTool(ctx: GoogleToolContext): i
72
82
  arguments: Record<string, unknown>;
73
83
  reason?: string | undefined;
74
84
  } | undefined;
85
+ location?: string | undefined;
86
+ repeats?: boolean | undefined;
87
+ seriesEventId?: string | undefined;
75
88
  title?: string | undefined;
76
89
  url?: string | undefined;
77
90
  videoCallUrl?: string | undefined;
78
91
  }, {
79
92
  [x: string]: unknown;
80
- attendees: string[];
93
+ attendees: {
94
+ email: string;
95
+ optional?: boolean | undefined;
96
+ response?: "accepted" | "declined" | "tentative" | "needsAction" | undefined;
97
+ }[];
81
98
  end: string;
82
99
  eventId: string;
83
100
  label: string;
@@ -87,7 +104,7 @@ export declare function createUpdateCalendarEventTool(ctx: GoogleToolContext): i
87
104
  kind: "object";
88
105
  key: string;
89
106
  label: string;
90
- objectType: "code_change" | "task" | "deployment" | "automation" | "item";
107
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
91
108
  title: string;
92
109
  url: string | null;
93
110
  description?: string | undefined;
@@ -126,6 +143,10 @@ export declare function createUpdateCalendarEventTool(ctx: GoogleToolContext): i
126
143
  environment?: string | undefined;
127
144
  revision?: string | undefined;
128
145
  branch?: string | undefined;
146
+ } | {
147
+ type: "calendar_event";
148
+ when?: string | undefined;
149
+ attendees?: string[] | undefined;
129
150
  } | undefined;
130
151
  }[] | undefined;
131
152
  truncated?: boolean | undefined;
@@ -133,6 +154,9 @@ export declare function createUpdateCalendarEventTool(ctx: GoogleToolContext): i
133
154
  arguments: Record<string, unknown>;
134
155
  reason?: string | undefined;
135
156
  } | undefined;
157
+ location?: string | undefined;
158
+ repeats?: boolean | undefined;
159
+ seriesEventId?: string | undefined;
136
160
  title?: string | undefined;
137
161
  url?: string | undefined;
138
162
  videoCallUrl?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-google",
3
- "version": "0.238.0",
3
+ "version": "0.239.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -25,7 +25,7 @@
25
25
  "commander": "^14.0.3",
26
26
  "drizzle-orm": "^0.45.2",
27
27
  "zod": "^4.5.4",
28
- "@sentry/junior-plugin-api": "0.238.0"
28
+ "@sentry/junior-plugin-api": "0.239.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@oxlint/plugins": "1.79.0",