@sentry/junior-google 0.238.1 → 0.240.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.
@@ -0,0 +1,158 @@
1
+ import { type GoogleToolContext } from "./shared";
2
+ /**
3
+ * Cancel an event that Junior organizes and email the attendees.
4
+ *
5
+ * Junior can only delete events on its own calendar, and only for a requester
6
+ * who is invited. Events that other people organize stay out of reach: the
7
+ * `calendar.events.owned` scope and the organizer check both enforce this.
8
+ */
9
+ export declare function createCancelCalendarEventTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
10
+ eventId: string;
11
+ timeZone?: string | undefined;
12
+ }, {
13
+ [x: string]: unknown;
14
+ eventId: string;
15
+ target: "cancelCalendarEvent";
16
+ cancelled: boolean;
17
+ objectAnnotations?: {
18
+ kind: "object";
19
+ key: string;
20
+ label: string;
21
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
22
+ title: string;
23
+ url: string | null;
24
+ description?: string | undefined;
25
+ status?: string | undefined;
26
+ trigger?: string | undefined;
27
+ warning?: string | undefined;
28
+ displayType?: string | undefined;
29
+ sourceUpdatedAt?: string | undefined;
30
+ facts?: {
31
+ type: "code_change";
32
+ author?: string | undefined;
33
+ sourceBranch?: string | undefined;
34
+ targetBranch?: string | undefined;
35
+ reviewers?: string[] | undefined;
36
+ review?: "required" | "approved" | "changes_requested" | undefined;
37
+ checks?: {
38
+ passed: number;
39
+ failed: number;
40
+ pending: number;
41
+ } | undefined;
42
+ mergeable?: boolean | undefined;
43
+ changedFiles?: number | undefined;
44
+ additions?: number | undefined;
45
+ deletions?: number | undefined;
46
+ } | {
47
+ type: "task";
48
+ assignees?: string[] | undefined;
49
+ priority?: string | undefined;
50
+ project?: string | undefined;
51
+ cycle?: string | undefined;
52
+ dueDate?: string | undefined;
53
+ labels?: string[] | undefined;
54
+ } | {
55
+ type: "deployment";
56
+ project?: string | undefined;
57
+ environment?: string | undefined;
58
+ revision?: string | undefined;
59
+ branch?: string | undefined;
60
+ } | {
61
+ type: "calendar_event";
62
+ when?: string | undefined;
63
+ attendees?: string[] | undefined;
64
+ } | undefined;
65
+ }[] | undefined;
66
+ truncated?: boolean | undefined;
67
+ continuation?: {
68
+ arguments: Record<string, unknown>;
69
+ reason?: string | undefined;
70
+ } | undefined;
71
+ attendees?: {
72
+ email: string;
73
+ optional?: boolean | undefined;
74
+ response?: "accepted" | "declined" | "tentative" | "needsAction" | undefined;
75
+ }[] | undefined;
76
+ end?: string | undefined;
77
+ label?: string | undefined;
78
+ location?: string | undefined;
79
+ repeats?: boolean | undefined;
80
+ seriesEventId?: string | undefined;
81
+ start?: string | undefined;
82
+ title?: string | undefined;
83
+ url?: string | undefined;
84
+ videoCallUrl?: string | undefined;
85
+ }, {
86
+ [x: string]: unknown;
87
+ eventId: string;
88
+ target: "cancelCalendarEvent";
89
+ cancelled: boolean;
90
+ objectAnnotations?: {
91
+ kind: "object";
92
+ key: string;
93
+ label: string;
94
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
95
+ title: string;
96
+ url: string | null;
97
+ description?: string | undefined;
98
+ status?: string | undefined;
99
+ trigger?: string | undefined;
100
+ warning?: string | undefined;
101
+ displayType?: string | undefined;
102
+ sourceUpdatedAt?: string | undefined;
103
+ facts?: {
104
+ type: "code_change";
105
+ author?: string | undefined;
106
+ sourceBranch?: string | undefined;
107
+ targetBranch?: string | undefined;
108
+ reviewers?: string[] | undefined;
109
+ review?: "required" | "approved" | "changes_requested" | undefined;
110
+ checks?: {
111
+ passed: number;
112
+ failed: number;
113
+ pending: number;
114
+ } | undefined;
115
+ mergeable?: boolean | undefined;
116
+ changedFiles?: number | undefined;
117
+ additions?: number | undefined;
118
+ deletions?: number | undefined;
119
+ } | {
120
+ type: "task";
121
+ assignees?: string[] | undefined;
122
+ priority?: string | undefined;
123
+ project?: string | undefined;
124
+ cycle?: string | undefined;
125
+ dueDate?: string | undefined;
126
+ labels?: string[] | undefined;
127
+ } | {
128
+ type: "deployment";
129
+ project?: string | undefined;
130
+ environment?: string | undefined;
131
+ revision?: string | undefined;
132
+ branch?: string | undefined;
133
+ } | {
134
+ type: "calendar_event";
135
+ when?: string | undefined;
136
+ attendees?: string[] | undefined;
137
+ } | undefined;
138
+ }[] | undefined;
139
+ truncated?: boolean | undefined;
140
+ continuation?: {
141
+ arguments: Record<string, unknown>;
142
+ reason?: string | undefined;
143
+ } | undefined;
144
+ attendees?: {
145
+ email: string;
146
+ optional?: boolean | undefined;
147
+ response?: "accepted" | "declined" | "tentative" | "needsAction" | undefined;
148
+ }[] | undefined;
149
+ end?: string | undefined;
150
+ label?: string | undefined;
151
+ location?: string | undefined;
152
+ repeats?: boolean | undefined;
153
+ seriesEventId?: string | undefined;
154
+ start?: string | undefined;
155
+ title?: string | undefined;
156
+ url?: string | undefined;
157
+ videoCallUrl?: string | undefined;
158
+ }>;
@@ -1,4 +1,17 @@
1
+ import { z } from "zod";
1
2
  import { type GoogleToolContext } from "./shared";
3
+ declare const repeatSchema: z.ZodObject<{
4
+ frequency: z.ZodEnum<{
5
+ weekdays: "weekdays";
6
+ weekly: "weekly";
7
+ monthly: "monthly";
8
+ }>;
9
+ interval: z.ZodDefault<z.ZodNumber>;
10
+ count: z.ZodOptional<z.ZodNumber>;
11
+ }, z.core.$strict>;
12
+ type Repeat = z.infer<typeof repeatSchema>;
13
+ /** Build the Google recurrence rule for a repeating event. Exported for tests. */
14
+ export declare function recurrenceRule(repeat: Repeat): string;
2
15
  /**
3
16
  * Derive a stable Calendar event id from the tool call.
4
17
  *
@@ -11,13 +24,23 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
11
24
  title: string;
12
25
  start: string;
13
26
  end: string;
14
- timeZone: string;
15
27
  attendees: string[];
16
- addVideoCall: boolean;
28
+ optionalAttendees: string[];
17
29
  description?: string | undefined;
30
+ location?: string | undefined;
31
+ timeZone?: string | undefined;
32
+ repeat?: {
33
+ frequency: "weekdays" | "weekly" | "monthly";
34
+ interval: number;
35
+ count?: number | undefined;
36
+ } | undefined;
18
37
  }, {
19
38
  [x: string]: unknown;
20
- attendees: string[];
39
+ attendees: {
40
+ email: string;
41
+ optional?: boolean | undefined;
42
+ response?: "accepted" | "declined" | "tentative" | "needsAction" | undefined;
43
+ }[];
21
44
  end: string;
22
45
  eventId: string;
23
46
  label: string;
@@ -28,7 +51,7 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
28
51
  kind: "object";
29
52
  key: string;
30
53
  label: string;
31
- objectType: "code_change" | "task" | "deployment" | "automation" | "item";
54
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
32
55
  title: string;
33
56
  url: string | null;
34
57
  description?: string | undefined;
@@ -67,6 +90,10 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
67
90
  environment?: string | undefined;
68
91
  revision?: string | undefined;
69
92
  branch?: string | undefined;
93
+ } | {
94
+ type: "calendar_event";
95
+ when?: string | undefined;
96
+ attendees?: string[] | undefined;
70
97
  } | undefined;
71
98
  }[] | undefined;
72
99
  truncated?: boolean | undefined;
@@ -74,12 +101,19 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
74
101
  arguments: Record<string, unknown>;
75
102
  reason?: string | undefined;
76
103
  } | undefined;
104
+ location?: string | undefined;
105
+ repeats?: boolean | undefined;
106
+ seriesEventId?: string | undefined;
77
107
  title?: string | undefined;
78
108
  url?: string | undefined;
79
109
  videoCallUrl?: string | undefined;
80
110
  }, {
81
111
  [x: string]: unknown;
82
- attendees: string[];
112
+ attendees: {
113
+ email: string;
114
+ optional?: boolean | undefined;
115
+ response?: "accepted" | "declined" | "tentative" | "needsAction" | undefined;
116
+ }[];
83
117
  end: string;
84
118
  eventId: string;
85
119
  label: string;
@@ -90,7 +124,7 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
90
124
  kind: "object";
91
125
  key: string;
92
126
  label: string;
93
- objectType: "code_change" | "task" | "deployment" | "automation" | "item";
127
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
94
128
  title: string;
95
129
  url: string | null;
96
130
  description?: string | undefined;
@@ -129,6 +163,10 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
129
163
  environment?: string | undefined;
130
164
  revision?: string | undefined;
131
165
  branch?: string | undefined;
166
+ } | {
167
+ type: "calendar_event";
168
+ when?: string | undefined;
169
+ attendees?: string[] | undefined;
132
170
  } | undefined;
133
171
  }[] | undefined;
134
172
  truncated?: boolean | undefined;
@@ -136,7 +174,11 @@ export declare function createCreateCalendarEventTool(ctx: GoogleToolContext): i
136
174
  arguments: Record<string, unknown>;
137
175
  reason?: string | undefined;
138
176
  } | undefined;
177
+ location?: string | undefined;
178
+ repeats?: boolean | undefined;
179
+ seriesEventId?: string | undefined;
139
180
  title?: string | undefined;
140
181
  url?: string | undefined;
141
182
  videoCallUrl?: string | undefined;
142
183
  }>;
184
+ export {};
@@ -1,15 +1,29 @@
1
1
  import { type GoogleToolContext } from "./shared";
2
+ interface Interval {
3
+ endMs: number;
4
+ startMs: number;
5
+ }
6
+ /** One checked attendee, with busy times from Google free/busy. */
7
+ export interface SlotAttendee {
8
+ busy: Interval[];
9
+ email: string;
10
+ required: boolean;
11
+ /** IANA time zone used for this person's working hours. */
12
+ timeZone: string;
13
+ }
2
14
  /**
3
- * Find shared free slots on weekdays inside local working hours.
15
+ * Find slots inside every required attendee's working hours, in their own
16
+ * time zone, when they are all free.
17
+ *
18
+ * Optional attendees who are busy or outside their hours do not block a slot.
19
+ * Slots without such conflicts come first. Options are spread across the days
20
+ * of `timeZone` and across each day.
4
21
  *
5
22
  * Exported for tests. Busy intervals come from Google free/busy only, so
6
23
  * Junior never sees event titles or details.
7
24
  */
8
25
  export declare function findFreeSlots(input: {
9
- busy: Array<{
10
- endMs: number;
11
- startMs: number;
12
- }>;
26
+ attendees: SlotAttendee[];
13
27
  durationMinutes: number;
14
28
  maxResults: number;
15
29
  timeMaxMs: number;
@@ -17,28 +31,37 @@ export declare function findFreeSlots(input: {
17
31
  timeZone: string;
18
32
  workdayEnd: string;
19
33
  workdayStart: string;
20
- }): Array<{
21
- endMs: number;
22
- startMs: number;
34
+ }): Array<Interval & {
35
+ optionalConflicts: string[];
23
36
  }>;
24
- /** Find times when everyone is free, using free/busy data only. */
37
+ /**
38
+ * Find times when everyone is free and inside their working hours.
39
+ *
40
+ * Uses free/busy data and each calendar's time zone only.
41
+ */
25
42
  export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
26
43
  attendees: string[];
44
+ optionalAttendees: string[];
27
45
  durationMinutes: number;
28
- timeMin: string;
29
- timeMax: string;
30
- timeZone: string;
31
46
  workdayStart: string;
32
47
  workdayEnd: string;
33
48
  maxResults: number;
49
+ timeMin?: string | undefined;
50
+ timeMax?: string | undefined;
51
+ timeZone?: string | undefined;
34
52
  }, {
35
53
  [x: string]: unknown;
36
54
  target: "findMeetingTimes";
37
- checked: string[];
55
+ checked: {
56
+ email: string;
57
+ timeZone?: string | undefined;
58
+ }[];
38
59
  slots: {
39
60
  end: string;
40
61
  label: string;
41
62
  start: string;
63
+ otherTimeZoneLabels?: string[] | undefined;
64
+ optionalConflicts?: string[] | undefined;
42
65
  }[];
43
66
  timeZone: string;
44
67
  unavailable: {
@@ -49,7 +72,7 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
49
72
  kind: "object";
50
73
  key: string;
51
74
  label: string;
52
- objectType: "code_change" | "task" | "deployment" | "automation" | "item";
75
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
53
76
  title: string;
54
77
  url: string | null;
55
78
  description?: string | undefined;
@@ -88,6 +111,10 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
88
111
  environment?: string | undefined;
89
112
  revision?: string | undefined;
90
113
  branch?: string | undefined;
114
+ } | {
115
+ type: "calendar_event";
116
+ when?: string | undefined;
117
+ attendees?: string[] | undefined;
91
118
  } | undefined;
92
119
  }[] | undefined;
93
120
  truncated?: boolean | undefined;
@@ -98,11 +125,16 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
98
125
  }, {
99
126
  [x: string]: unknown;
100
127
  target: "findMeetingTimes";
101
- checked: string[];
128
+ checked: {
129
+ email: string;
130
+ timeZone?: string | undefined;
131
+ }[];
102
132
  slots: {
103
133
  end: string;
104
134
  label: string;
105
135
  start: string;
136
+ otherTimeZoneLabels?: string[] | undefined;
137
+ optionalConflicts?: string[] | undefined;
106
138
  }[];
107
139
  timeZone: string;
108
140
  unavailable: {
@@ -113,7 +145,7 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
113
145
  kind: "object";
114
146
  key: string;
115
147
  label: string;
116
- objectType: "code_change" | "task" | "deployment" | "automation" | "item";
148
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
117
149
  title: string;
118
150
  url: string | null;
119
151
  description?: string | undefined;
@@ -152,6 +184,10 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
152
184
  environment?: string | undefined;
153
185
  revision?: string | undefined;
154
186
  branch?: string | undefined;
187
+ } | {
188
+ type: "calendar_event";
189
+ when?: string | undefined;
190
+ attendees?: string[] | undefined;
155
191
  } | undefined;
156
192
  }[] | undefined;
157
193
  truncated?: boolean | undefined;
@@ -160,3 +196,4 @@ export declare function createFindMeetingTimesTool(ctx: GoogleToolContext): impo
160
196
  reason?: string | undefined;
161
197
  } | undefined;
162
198
  }>;
199
+ export {};
@@ -7,11 +7,11 @@ import { type GoogleToolContext } from "./shared";
7
7
  * returned, because they often hold links and notes meant only for attendees.
8
8
  */
9
9
  export declare function createListCalendarEventsTool(ctx: GoogleToolContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
10
- calendar: string;
11
10
  timeMin: string;
12
11
  timeMax: string;
13
- timeZone: string;
14
12
  maxResults: number;
13
+ calendar?: string | undefined;
14
+ timeZone?: string | undefined;
15
15
  }, {
16
16
  [x: string]: unknown;
17
17
  target: "listCalendarEvents";
@@ -20,10 +20,16 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
20
20
  end: string;
21
21
  eventId: string;
22
22
  label: string;
23
+ organizedByJunior: boolean;
23
24
  start: string;
24
- attendees?: string[] | undefined;
25
+ attendees?: {
26
+ email: string;
27
+ optional?: boolean | undefined;
28
+ response?: "accepted" | "declined" | "tentative" | "needsAction" | undefined;
29
+ }[] | undefined;
25
30
  location?: string | undefined;
26
31
  organizer?: string | undefined;
32
+ seriesEventId?: string | undefined;
27
33
  title?: string | undefined;
28
34
  url?: string | undefined;
29
35
  videoCallUrl?: string | undefined;
@@ -35,7 +41,7 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
35
41
  kind: "object";
36
42
  key: string;
37
43
  label: string;
38
- objectType: "code_change" | "task" | "deployment" | "automation" | "item";
44
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
39
45
  title: string;
40
46
  url: string | null;
41
47
  description?: string | undefined;
@@ -74,6 +80,10 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
74
80
  environment?: string | undefined;
75
81
  revision?: string | undefined;
76
82
  branch?: string | undefined;
83
+ } | {
84
+ type: "calendar_event";
85
+ when?: string | undefined;
86
+ attendees?: string[] | undefined;
77
87
  } | undefined;
78
88
  }[] | undefined;
79
89
  continuation?: {
@@ -88,10 +98,16 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
88
98
  end: string;
89
99
  eventId: string;
90
100
  label: string;
101
+ organizedByJunior: boolean;
91
102
  start: string;
92
- attendees?: string[] | undefined;
103
+ attendees?: {
104
+ email: string;
105
+ optional?: boolean | undefined;
106
+ response?: "accepted" | "declined" | "tentative" | "needsAction" | undefined;
107
+ }[] | undefined;
93
108
  location?: string | undefined;
94
109
  organizer?: string | undefined;
110
+ seriesEventId?: string | undefined;
95
111
  title?: string | undefined;
96
112
  url?: string | undefined;
97
113
  videoCallUrl?: string | undefined;
@@ -103,7 +119,7 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
103
119
  kind: "object";
104
120
  key: string;
105
121
  label: string;
106
- objectType: "code_change" | "task" | "deployment" | "automation" | "item";
122
+ objectType: "code_change" | "task" | "deployment" | "calendar_event" | "automation" | "item";
107
123
  title: string;
108
124
  url: string | null;
109
125
  description?: string | undefined;
@@ -142,6 +158,10 @@ export declare function createListCalendarEventsTool(ctx: GoogleToolContext): im
142
158
  environment?: string | undefined;
143
159
  revision?: string | undefined;
144
160
  branch?: string | undefined;
161
+ } | {
162
+ type: "calendar_event";
163
+ when?: string | undefined;
164
+ attendees?: string[] | undefined;
145
165
  } | undefined;
146
166
  }[] | undefined;
147
167
  continuation?: {