@jbctechsolutions/mcp-office365 3.0.0 → 4.0.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/README.md +42 -65
- package/dist/approval/hash.d.ts +8 -8
- package/dist/approval/token-manager.d.ts +12 -6
- package/dist/approval/token-manager.d.ts.map +1 -1
- package/dist/approval/token-manager.js +11 -3
- package/dist/approval/token-manager.js.map +1 -1
- package/dist/approval/types.d.ts +7 -3
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +18 -3
- package/dist/cli.js.map +1 -1
- package/dist/database/repository.d.ts +48 -48
- package/dist/database/repository.d.ts.map +1 -1
- package/dist/database/repository.js.map +1 -1
- package/dist/delta/mirror.d.ts +67 -0
- package/dist/delta/mirror.d.ts.map +1 -0
- package/dist/delta/mirror.js +183 -0
- package/dist/delta/mirror.js.map +1 -0
- package/dist/graph/auth/account-id.d.ts +19 -0
- package/dist/graph/auth/account-id.d.ts.map +1 -0
- package/dist/graph/auth/account-id.js +55 -0
- package/dist/graph/auth/account-id.js.map +1 -0
- package/dist/graph/auth/config.d.ts +1 -1
- package/dist/graph/auth/config.d.ts.map +1 -1
- package/dist/graph/auth/config.js +8 -0
- package/dist/graph/auth/config.js.map +1 -1
- package/dist/graph/auth/index.d.ts +1 -0
- package/dist/graph/auth/index.d.ts.map +1 -1
- package/dist/graph/auth/index.js +1 -0
- package/dist/graph/auth/index.js.map +1 -1
- package/dist/graph/client/graph-client.d.ts +105 -0
- package/dist/graph/client/graph-client.d.ts.map +1 -1
- package/dist/graph/client/graph-client.js +414 -18
- package/dist/graph/client/graph-client.js.map +1 -1
- package/dist/graph/client/immutable-id-middleware.d.ts +50 -0
- package/dist/graph/client/immutable-id-middleware.d.ts.map +1 -0
- package/dist/graph/client/immutable-id-middleware.js +137 -0
- package/dist/graph/client/immutable-id-middleware.js.map +1 -0
- package/dist/graph/content-readers.d.ts +0 -12
- package/dist/graph/content-readers.d.ts.map +1 -1
- package/dist/graph/content-readers.js +0 -21
- package/dist/graph/content-readers.js.map +1 -1
- package/dist/graph/index.d.ts +5 -6
- package/dist/graph/index.d.ts.map +1 -1
- package/dist/graph/index.js +5 -6
- package/dist/graph/index.js.map +1 -1
- package/dist/graph/mailbox-adapter.d.ts +15 -15
- package/dist/graph/mappers/contact-mapper.d.ts +4 -1
- package/dist/graph/mappers/contact-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/contact-mapper.js +7 -3
- package/dist/graph/mappers/contact-mapper.js.map +1 -1
- package/dist/graph/mappers/email-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/email-mapper.js +7 -4
- package/dist/graph/mappers/email-mapper.js.map +1 -1
- package/dist/graph/mappers/event-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/event-mapper.js +6 -3
- package/dist/graph/mappers/event-mapper.js.map +1 -1
- package/dist/graph/mappers/folder-mapper.d.ts +0 -4
- package/dist/graph/mappers/folder-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/folder-mapper.js +9 -19
- package/dist/graph/mappers/folder-mapper.js.map +1 -1
- package/dist/graph/mappers/index.d.ts +2 -2
- package/dist/graph/mappers/index.d.ts.map +1 -1
- package/dist/graph/mappers/index.js +2 -2
- package/dist/graph/mappers/index.js.map +1 -1
- package/dist/graph/mappers/task-mapper.d.ts +4 -2
- package/dist/graph/mappers/task-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/task-mapper.js +7 -5
- package/dist/graph/mappers/task-mapper.js.map +1 -1
- package/dist/graph/mappers/utils.d.ts +0 -10
- package/dist/graph/mappers/utils.d.ts.map +1 -1
- package/dist/graph/mappers/utils.js +0 -19
- package/dist/graph/mappers/utils.js.map +1 -1
- package/dist/graph/repository.d.ts +400 -270
- package/dist/graph/repository.d.ts.map +1 -1
- package/dist/graph/repository.js +739 -1046
- package/dist/graph/repository.js.map +1 -1
- package/dist/ids/next-action.d.ts +29 -0
- package/dist/ids/next-action.d.ts.map +1 -0
- package/dist/ids/next-action.js +58 -0
- package/dist/ids/next-action.js.map +1 -0
- package/dist/ids/resolver.d.ts +2 -1
- package/dist/ids/resolver.d.ts.map +1 -1
- package/dist/ids/resolver.js +19 -4
- package/dist/ids/resolver.js.map +1 -1
- package/dist/ids/schema.d.ts +91 -0
- package/dist/ids/schema.d.ts.map +1 -0
- package/dist/ids/schema.js +131 -0
- package/dist/ids/schema.js.map +1 -0
- package/dist/ids/token.d.ts +7 -1
- package/dist/ids/token.d.ts.map +1 -1
- package/dist/ids/token.js +46 -7
- package/dist/ids/token.js.map +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -100
- package/dist/index.js.map +1 -1
- package/dist/parsers/index.d.ts +0 -1
- package/dist/parsers/index.d.ts.map +1 -1
- package/dist/parsers/index.js +0 -1
- package/dist/parsers/index.js.map +1 -1
- package/dist/registry/all-tools.d.ts.map +1 -1
- package/dist/registry/all-tools.js +8 -4
- package/dist/registry/all-tools.js.map +1 -1
- package/dist/registry/context.d.ts +1 -7
- package/dist/registry/context.d.ts.map +1 -1
- package/dist/registry/context.js +0 -11
- package/dist/registry/context.js.map +1 -1
- package/dist/registry/elicit-links.d.ts +35 -0
- package/dist/registry/elicit-links.d.ts.map +1 -0
- package/dist/registry/elicit-links.js +102 -0
- package/dist/registry/elicit-links.js.map +1 -0
- package/dist/registry/elicitor.d.ts +24 -0
- package/dist/registry/elicitor.d.ts.map +1 -0
- package/dist/registry/elicitor.js +51 -0
- package/dist/registry/elicitor.js.map +1 -0
- package/dist/registry/index.d.ts +2 -2
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/registry.d.ts +11 -0
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +87 -0
- package/dist/registry/registry.js.map +1 -1
- package/dist/registry/types.d.ts +61 -13
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/state/delta-store.d.ts +85 -0
- package/dist/state/delta-store.d.ts.map +1 -0
- package/dist/state/delta-store.js +124 -0
- package/dist/state/delta-store.js.map +1 -0
- package/dist/state/schema.d.ts +2 -3
- package/dist/state/schema.d.ts.map +1 -1
- package/dist/state/schema.js +26 -3
- package/dist/state/schema.js.map +1 -1
- package/dist/state/store.d.ts +3 -0
- package/dist/state/store.d.ts.map +1 -1
- package/dist/state/store.js +4 -0
- package/dist/state/store.js.map +1 -1
- package/dist/tools/calendar-graph.d.ts.map +1 -1
- package/dist/tools/calendar-graph.js +10 -9
- package/dist/tools/calendar-graph.js.map +1 -1
- package/dist/tools/calendar-permissions.d.ts +7 -7
- package/dist/tools/calendar-permissions.d.ts.map +1 -1
- package/dist/tools/calendar-permissions.js +7 -4
- package/dist/tools/calendar-permissions.js.map +1 -1
- package/dist/tools/calendar.d.ts +14 -114
- package/dist/tools/calendar.d.ts.map +1 -1
- package/dist/tools/calendar.js +41 -202
- package/dist/tools/calendar.js.map +1 -1
- package/dist/tools/categories.d.ts +4 -4
- package/dist/tools/categories.d.ts.map +1 -1
- package/dist/tools/categories.js +5 -2
- package/dist/tools/categories.js.map +1 -1
- package/dist/tools/checklist-items.d.ts +9 -9
- package/dist/tools/checklist-items.d.ts.map +1 -1
- package/dist/tools/checklist-items.js +8 -5
- package/dist/tools/checklist-items.js.map +1 -1
- package/dist/tools/contact-folders.d.ts +2 -2
- package/dist/tools/contact-folders.d.ts.map +1 -1
- package/dist/tools/contact-folders.js +5 -2
- package/dist/tools/contact-folders.js.map +1 -1
- package/dist/tools/contacts-graph.d.ts +1 -1
- package/dist/tools/contacts-graph.d.ts.map +1 -1
- package/dist/tools/contacts-graph.js +8 -6
- package/dist/tools/contacts-graph.js.map +1 -1
- package/dist/tools/contacts.d.ts +9 -44
- package/dist/tools/contacts.d.ts.map +1 -1
- package/dist/tools/contacts.js +23 -131
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/excel.d.ts +10 -10
- package/dist/tools/excel.d.ts.map +1 -1
- package/dist/tools/excel.js +9 -6
- package/dist/tools/excel.js.map +1 -1
- package/dist/tools/focused-overrides.d.ts +4 -4
- package/dist/tools/focused-overrides.d.ts.map +1 -1
- package/dist/tools/focused-overrides.js +5 -2
- package/dist/tools/focused-overrides.js.map +1 -1
- package/dist/tools/index.d.ts +4 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -6
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/linked-resources.d.ts +7 -7
- package/dist/tools/linked-resources.d.ts.map +1 -1
- package/dist/tools/linked-resources.js +7 -4
- package/dist/tools/linked-resources.js.map +1 -1
- package/dist/tools/mail-graph.d.ts.map +1 -1
- package/dist/tools/mail-graph.js +21 -12
- package/dist/tools/mail-graph.js.map +1 -1
- package/dist/tools/mail-rules.d.ts +8 -8
- package/dist/tools/mail-rules.d.ts.map +1 -1
- package/dist/tools/mail-rules.js +7 -7
- package/dist/tools/mail-rules.js.map +1 -1
- package/dist/tools/mail-send.d.ts +27 -27
- package/dist/tools/mail-send.d.ts.map +1 -1
- package/dist/tools/mail-send.js +30 -19
- package/dist/tools/mail-send.js.map +1 -1
- package/dist/tools/mail.d.ts +22 -79
- package/dist/tools/mail.d.ts.map +1 -1
- package/dist/tools/mail.js +45 -293
- package/dist/tools/mail.js.map +1 -1
- package/dist/tools/mailbox-organization.d.ts +34 -37
- package/dist/tools/mailbox-organization.d.ts.map +1 -1
- package/dist/tools/mailbox-organization.js +72 -64
- package/dist/tools/mailbox-organization.js.map +1 -1
- package/dist/tools/meetings.d.ts +14 -14
- package/dist/tools/meetings.d.ts.map +1 -1
- package/dist/tools/meetings.js +8 -6
- package/dist/tools/meetings.js.map +1 -1
- package/dist/tools/onedrive.d.ts +16 -16
- package/dist/tools/onedrive.d.ts.map +1 -1
- package/dist/tools/onedrive.js +16 -11
- package/dist/tools/onedrive.js.map +1 -1
- package/dist/tools/onenote.d.ts +63 -0
- package/dist/tools/onenote.d.ts.map +1 -0
- package/dist/tools/onenote.js +221 -0
- package/dist/tools/onenote.js.map +1 -0
- package/dist/tools/planner-visualization.d.ts +5 -5
- package/dist/tools/planner-visualization.d.ts.map +1 -1
- package/dist/tools/planner-visualization.js +5 -4
- package/dist/tools/planner-visualization.js.map +1 -1
- package/dist/tools/planner.d.ts +59 -39
- package/dist/tools/planner.d.ts.map +1 -1
- package/dist/tools/planner.js +48 -23
- package/dist/tools/planner.js.map +1 -1
- package/dist/tools/shared-mailbox.d.ts +164 -0
- package/dist/tools/shared-mailbox.d.ts.map +1 -0
- package/dist/tools/shared-mailbox.js +318 -0
- package/dist/tools/shared-mailbox.js.map +1 -0
- package/dist/tools/sharepoint-lists.d.ts +131 -0
- package/dist/tools/sharepoint-lists.d.ts.map +1 -0
- package/dist/tools/sharepoint-lists.js +246 -0
- package/dist/tools/sharepoint-lists.js.map +1 -0
- package/dist/tools/sharepoint.d.ts +14 -14
- package/dist/tools/sharepoint.d.ts.map +1 -1
- package/dist/tools/sharepoint.js +11 -9
- package/dist/tools/sharepoint.js.map +1 -1
- package/dist/tools/task-attachments.d.ts +7 -7
- package/dist/tools/task-attachments.d.ts.map +1 -1
- package/dist/tools/task-attachments.js +7 -4
- package/dist/tools/task-attachments.js.map +1 -1
- package/dist/tools/task-lists.d.ts +3 -3
- package/dist/tools/task-lists.d.ts.map +1 -1
- package/dist/tools/task-lists.js +10 -6
- package/dist/tools/task-lists.js.map +1 -1
- package/dist/tools/tasks-graph.d.ts +2 -2
- package/dist/tools/tasks-graph.d.ts.map +1 -1
- package/dist/tools/tasks-graph.js +6 -4
- package/dist/tools/tasks-graph.js.map +1 -1
- package/dist/tools/tasks.d.ts +8 -43
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +19 -122
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/teams.d.ts +46 -46
- package/dist/tools/teams.d.ts.map +1 -1
- package/dist/tools/teams.js +34 -26
- package/dist/tools/teams.js.map +1 -1
- package/dist/tools/what-changed.d.ts +48 -0
- package/dist/tools/what-changed.d.ts.map +1 -0
- package/dist/tools/what-changed.js +149 -0
- package/dist/tools/what-changed.js.map +1 -0
- package/dist/types/calendar.d.ts +1 -1
- package/dist/types/calendar.d.ts.map +1 -1
- package/dist/types/calendar.js.map +1 -1
- package/dist/types/contacts.d.ts +1 -1
- package/dist/types/contacts.d.ts.map +1 -1
- package/dist/types/contacts.js.map +1 -1
- package/dist/types/mail.d.ts +1 -1
- package/dist/types/mail.d.ts.map +1 -1
- package/dist/types/mail.js.map +1 -1
- package/dist/utils/errors.d.ts +15 -34
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +13 -49
- package/dist/utils/errors.js.map +1 -1
- package/dist/visualization/types.d.ts +4 -4
- package/package.json +2 -3
- package/dist/applescript/account-repository.d.ts +0 -30
- package/dist/applescript/account-repository.d.ts.map +0 -1
- package/dist/applescript/account-repository.js +0 -38
- package/dist/applescript/account-repository.js.map +0 -1
- package/dist/applescript/account-scripts.d.ts +0 -21
- package/dist/applescript/account-scripts.d.ts.map +0 -1
- package/dist/applescript/account-scripts.js +0 -180
- package/dist/applescript/account-scripts.js.map +0 -1
- package/dist/applescript/calendar-manager.d.ts +0 -44
- package/dist/applescript/calendar-manager.d.ts.map +0 -1
- package/dist/applescript/calendar-manager.js +0 -92
- package/dist/applescript/calendar-manager.js.map +0 -1
- package/dist/applescript/calendar-writer.d.ts +0 -36
- package/dist/applescript/calendar-writer.d.ts.map +0 -1
- package/dist/applescript/calendar-writer.js +0 -94
- package/dist/applescript/calendar-writer.js.map +0 -1
- package/dist/applescript/content-readers.d.ts +0 -114
- package/dist/applescript/content-readers.d.ts.map +0 -1
- package/dist/applescript/content-readers.js +0 -328
- package/dist/applescript/content-readers.js.map +0 -1
- package/dist/applescript/executor.d.ts +0 -60
- package/dist/applescript/executor.d.ts.map +0 -1
- package/dist/applescript/executor.js +0 -173
- package/dist/applescript/executor.js.map +0 -1
- package/dist/applescript/index.d.ts +0 -20
- package/dist/applescript/index.d.ts.map +0 -1
- package/dist/applescript/index.js +0 -29
- package/dist/applescript/index.js.map +0 -1
- package/dist/applescript/mail-sender.d.ts +0 -38
- package/dist/applescript/mail-sender.d.ts.map +0 -1
- package/dist/applescript/mail-sender.js +0 -67
- package/dist/applescript/mail-sender.js.map +0 -1
- package/dist/applescript/parser.d.ts +0 -235
- package/dist/applescript/parser.d.ts.map +0 -1
- package/dist/applescript/parser.js +0 -496
- package/dist/applescript/parser.js.map +0 -1
- package/dist/applescript/repository.d.ts +0 -64
- package/dist/applescript/repository.d.ts.map +0 -1
- package/dist/applescript/repository.js +0 -444
- package/dist/applescript/repository.js.map +0 -1
- package/dist/applescript/scripts.d.ts +0 -265
- package/dist/applescript/scripts.d.ts.map +0 -1
- package/dist/applescript/scripts.js +0 -1483
- package/dist/applescript/scripts.js.map +0 -1
- package/dist/parsers/olk15.d.ts +0 -87
- package/dist/parsers/olk15.d.ts.map +0 -1
- package/dist/parsers/olk15.js +0 -368
- package/dist/parsers/olk15.js.map +0 -1
- package/dist/tools/accounts.d.ts +0 -37
- package/dist/tools/accounts.d.ts.map +0 -1
- package/dist/tools/accounts.js +0 -68
- package/dist/tools/accounts.js.map +0 -1
- package/dist/tools/calendar-apple.d.ts +0 -39
- package/dist/tools/calendar-apple.d.ts.map +0 -1
- package/dist/tools/calendar-apple.js +0 -159
- package/dist/tools/calendar-apple.js.map +0 -1
- package/dist/tools/mail-apple.d.ts +0 -40
- package/dist/tools/mail-apple.d.ts.map +0 -1
- package/dist/tools/mail-apple.js +0 -146
- package/dist/tools/mail-apple.js.map +0 -1
- package/dist/tools/notes.d.ts +0 -86
- package/dist/tools/notes.d.ts.map +0 -1
- package/dist/tools/notes.js +0 -202
- package/dist/tools/notes.js.map +0 -1
package/dist/tools/calendar.d.ts
CHANGED
|
@@ -8,28 +8,23 @@
|
|
|
8
8
|
* Provides tools for listing calendars, events, and searching.
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
-
import type {
|
|
12
|
-
import type { CalendarFolder, EventSummary, Event, Attendee } from '../types/index.js';
|
|
11
|
+
import type { Attendee } from '../types/index.js';
|
|
13
12
|
import type { ToolDefinition } from '../registry/types.js';
|
|
14
13
|
import type { GraphCalendarTools } from './calendar-graph.js';
|
|
15
|
-
import type { AppleCalendarTools } from './calendar-apple.js';
|
|
16
14
|
declare module '../registry/types.js' {
|
|
17
15
|
interface GraphToolsets {
|
|
18
16
|
calendarGraph: GraphCalendarTools;
|
|
19
17
|
}
|
|
20
|
-
interface AppleScriptToolsets {
|
|
21
|
-
calendar: AppleCalendarTools;
|
|
22
|
-
}
|
|
23
18
|
}
|
|
24
19
|
export declare const ListCalendarsInput: z.ZodObject<{}, z.core.$strict>;
|
|
25
20
|
export declare const ListEventsInput: z.ZodObject<{
|
|
26
|
-
calendar_id: z.ZodOptional<z.
|
|
21
|
+
calendar_id: z.ZodOptional<z.ZodString>;
|
|
27
22
|
start_date: z.ZodOptional<z.ZodString>;
|
|
28
23
|
end_date: z.ZodOptional<z.ZodString>;
|
|
29
24
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
30
25
|
}, z.core.$strict>;
|
|
31
26
|
export declare const GetEventInput: z.ZodObject<{
|
|
32
|
-
event_id: z.
|
|
27
|
+
event_id: z.ZodString;
|
|
33
28
|
}, z.core.$strict>;
|
|
34
29
|
export declare const SearchEventsInput: z.ZodObject<{
|
|
35
30
|
query: z.ZodOptional<z.ZodString>;
|
|
@@ -38,7 +33,7 @@ export declare const SearchEventsInput: z.ZodObject<{
|
|
|
38
33
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
39
34
|
}, z.core.$strict>;
|
|
40
35
|
export declare const RespondToEventInput: z.ZodObject<{
|
|
41
|
-
event_id: z.
|
|
36
|
+
event_id: z.ZodString;
|
|
42
37
|
response: z.ZodEnum<{
|
|
43
38
|
accept: "accept";
|
|
44
39
|
decline: "decline";
|
|
@@ -91,64 +86,11 @@ export declare const RecurrenceInput: z.ZodObject<{
|
|
|
91
86
|
count: z.ZodNumber;
|
|
92
87
|
}, z.core.$strict>], "type">>;
|
|
93
88
|
}, z.core.$strict>;
|
|
94
|
-
export declare const CreateEventInput: z.ZodObject<{
|
|
95
|
-
title: z.ZodString;
|
|
96
|
-
start_date: z.ZodString;
|
|
97
|
-
end_date: z.ZodString;
|
|
98
|
-
calendar_id: z.ZodOptional<z.ZodNumber>;
|
|
99
|
-
location: z.ZodOptional<z.ZodString>;
|
|
100
|
-
description: z.ZodOptional<z.ZodString>;
|
|
101
|
-
is_all_day: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
102
|
-
recurrence: z.ZodOptional<z.ZodObject<{
|
|
103
|
-
frequency: z.ZodEnum<{
|
|
104
|
-
daily: "daily";
|
|
105
|
-
weekly: "weekly";
|
|
106
|
-
monthly: "monthly";
|
|
107
|
-
yearly: "yearly";
|
|
108
|
-
}>;
|
|
109
|
-
interval: z.ZodDefault<z.ZodNumber>;
|
|
110
|
-
days_of_week: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
111
|
-
sunday: "sunday";
|
|
112
|
-
monday: "monday";
|
|
113
|
-
tuesday: "tuesday";
|
|
114
|
-
wednesday: "wednesday";
|
|
115
|
-
thursday: "thursday";
|
|
116
|
-
friday: "friday";
|
|
117
|
-
saturday: "saturday";
|
|
118
|
-
}>>>;
|
|
119
|
-
day_of_month: z.ZodOptional<z.ZodNumber>;
|
|
120
|
-
week_of_month: z.ZodOptional<z.ZodEnum<{
|
|
121
|
-
first: "first";
|
|
122
|
-
second: "second";
|
|
123
|
-
third: "third";
|
|
124
|
-
fourth: "fourth";
|
|
125
|
-
last: "last";
|
|
126
|
-
}>>;
|
|
127
|
-
day_of_week_monthly: z.ZodOptional<z.ZodEnum<{
|
|
128
|
-
sunday: "sunday";
|
|
129
|
-
monday: "monday";
|
|
130
|
-
tuesday: "tuesday";
|
|
131
|
-
wednesday: "wednesday";
|
|
132
|
-
thursday: "thursday";
|
|
133
|
-
friday: "friday";
|
|
134
|
-
saturday: "saturday";
|
|
135
|
-
}>>;
|
|
136
|
-
end: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
137
|
-
type: z.ZodLiteral<"no_end">;
|
|
138
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
139
|
-
type: z.ZodLiteral<"end_date">;
|
|
140
|
-
date: z.ZodString;
|
|
141
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
142
|
-
type: z.ZodLiteral<"end_after_count">;
|
|
143
|
-
count: z.ZodNumber;
|
|
144
|
-
}, z.core.$strict>], "type">>;
|
|
145
|
-
}, z.core.$strict>>;
|
|
146
|
-
}, z.core.$strict>;
|
|
147
89
|
export declare const CreateEventGraphInput: z.ZodObject<{
|
|
148
90
|
title: z.ZodString;
|
|
149
91
|
start_date: z.ZodString;
|
|
150
92
|
end_date: z.ZodString;
|
|
151
|
-
calendar_id: z.ZodOptional<z.
|
|
93
|
+
calendar_id: z.ZodOptional<z.ZodString>;
|
|
152
94
|
location: z.ZodOptional<z.ZodString>;
|
|
153
95
|
description: z.ZodOptional<z.ZodString>;
|
|
154
96
|
is_all_day: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -190,7 +132,7 @@ export declare const CreateEventGraphInput: z.ZodObject<{
|
|
|
190
132
|
}>>;
|
|
191
133
|
}, z.core.$strict>;
|
|
192
134
|
export declare const UpdateEventInput: z.ZodObject<{
|
|
193
|
-
event_id: z.
|
|
135
|
+
event_id: z.ZodString;
|
|
194
136
|
subject: z.ZodOptional<z.ZodString>;
|
|
195
137
|
start: z.ZodOptional<z.ZodString>;
|
|
196
138
|
end: z.ZodOptional<z.ZodString>;
|
|
@@ -238,29 +180,21 @@ export declare const UpdateEventInput: z.ZodObject<{
|
|
|
238
180
|
skypeForBusiness: "skypeForBusiness";
|
|
239
181
|
skypeForConsumer: "skypeForConsumer";
|
|
240
182
|
}>>;
|
|
241
|
-
apply_to: z.ZodOptional<z.ZodEnum<{
|
|
242
|
-
this_instance: "this_instance";
|
|
243
|
-
all_in_series: "all_in_series";
|
|
244
|
-
}>>;
|
|
245
183
|
}, z.core.$strict>;
|
|
246
184
|
export declare const DeleteEventInput: z.ZodObject<{
|
|
247
|
-
event_id: z.
|
|
248
|
-
apply_to: z.ZodDefault<z.ZodEnum<{
|
|
249
|
-
this_instance: "this_instance";
|
|
250
|
-
all_in_series: "all_in_series";
|
|
251
|
-
}>>;
|
|
185
|
+
event_id: z.ZodString;
|
|
252
186
|
}, z.core.$strict>;
|
|
253
187
|
export declare const ListEventInstancesInput: z.ZodObject<{
|
|
254
|
-
event_id: z.
|
|
188
|
+
event_id: z.ZodString;
|
|
255
189
|
start_date: z.ZodString;
|
|
256
190
|
end_date: z.ZodString;
|
|
257
191
|
}, z.core.$strict>;
|
|
258
192
|
export declare const PrepareDeleteEventInput: z.ZodObject<{
|
|
259
|
-
event_id: z.
|
|
193
|
+
event_id: z.ZodString;
|
|
260
194
|
}, z.core.$strict>;
|
|
261
195
|
export declare const ConfirmDeleteEventInput: z.ZodObject<{
|
|
262
196
|
token_id: z.ZodUUID;
|
|
263
|
-
event_id: z.
|
|
197
|
+
event_id: z.ZodString;
|
|
264
198
|
}, z.core.$strict>;
|
|
265
199
|
export declare const ListCalendarGroupsInput: z.ZodObject<{}, z.core.$strict>;
|
|
266
200
|
export declare const CreateCalendarGroupInput: z.ZodObject<{
|
|
@@ -274,7 +208,6 @@ export type ListCalendarsParams = z.infer<typeof ListCalendarsInput>;
|
|
|
274
208
|
export type ListEventsParams = z.infer<typeof ListEventsInput>;
|
|
275
209
|
export type GetEventParams = z.infer<typeof GetEventInput>;
|
|
276
210
|
export type SearchEventsParams = z.infer<typeof SearchEventsInput>;
|
|
277
|
-
export type CreateEventParams = z.infer<typeof CreateEventInput>;
|
|
278
211
|
export type RecurrenceParams = z.infer<typeof RecurrenceInput>;
|
|
279
212
|
export type RespondToEventParams = z.infer<typeof RespondToEventInput>;
|
|
280
213
|
export type CreateEventGraphParams = z.infer<typeof CreateEventGraphInput>;
|
|
@@ -289,11 +222,11 @@ export type ListRoomsParams = z.infer<typeof ListRoomsInput>;
|
|
|
289
222
|
* Result of creating a calendar event.
|
|
290
223
|
*/
|
|
291
224
|
export interface CreateEventResult {
|
|
292
|
-
readonly id:
|
|
225
|
+
readonly id: string;
|
|
293
226
|
readonly title: string;
|
|
294
227
|
readonly start_date: string;
|
|
295
228
|
readonly end_date: string;
|
|
296
|
-
readonly calendar_id:
|
|
229
|
+
readonly calendar_id: string | null;
|
|
297
230
|
readonly location: string | null;
|
|
298
231
|
readonly description: string | null;
|
|
299
232
|
readonly is_all_day: boolean;
|
|
@@ -319,41 +252,8 @@ export interface EventDetails {
|
|
|
319
252
|
readonly attendees: readonly Attendee[];
|
|
320
253
|
}
|
|
321
254
|
/**
|
|
322
|
-
*
|
|
323
|
-
|
|
324
|
-
export declare const nullEventContentReader: IEventContentReader;
|
|
325
|
-
/**
|
|
326
|
-
* Calendar tools implementation with dependency injection.
|
|
327
|
-
*/
|
|
328
|
-
export declare class CalendarTools {
|
|
329
|
-
private readonly repository;
|
|
330
|
-
private readonly contentReader;
|
|
331
|
-
constructor(repository: IRepository, contentReader?: IEventContentReader);
|
|
332
|
-
/**
|
|
333
|
-
* Lists all calendar folders.
|
|
334
|
-
*/
|
|
335
|
-
listCalendars(_params: ListCalendarsParams): CalendarFolder[];
|
|
336
|
-
/**
|
|
337
|
-
* Lists events with optional filtering.
|
|
338
|
-
*/
|
|
339
|
-
listEvents(params: ListEventsParams): EventSummary[];
|
|
340
|
-
/**
|
|
341
|
-
* Gets a single event by ID.
|
|
342
|
-
*/
|
|
343
|
-
getEvent(params: GetEventParams): Event | null;
|
|
344
|
-
/**
|
|
345
|
-
* Searches events by title and/or date range.
|
|
346
|
-
*/
|
|
347
|
-
searchEvents(params: SearchEventsParams): EventSummary[];
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Creates calendar tools with the given repository.
|
|
351
|
-
*/
|
|
352
|
-
export declare function createCalendarTools(repository: IRepository, contentReader?: IEventContentReader): CalendarTools;
|
|
353
|
-
/**
|
|
354
|
-
* Registry tool definitions for the calendar domain. Each handler branches on
|
|
355
|
-
* the active backend: Graph delegates to GraphCalendarTools; AppleScript
|
|
356
|
-
* delegates to AppleCalendarTools. Both toolsets return MCP content directly.
|
|
255
|
+
* Registry tool definitions for the calendar domain. Each handler delegates to
|
|
256
|
+
* GraphCalendarTools, which returns MCP content directly.
|
|
357
257
|
*/
|
|
358
258
|
export declare function calendarToolDefinitions(): ToolDefinition[];
|
|
359
259
|
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/tools/calendar.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/tools/calendar.ts"],"names":[],"mappings":"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"}
|
package/dist/tools/calendar.js
CHANGED
|
@@ -8,15 +8,19 @@
|
|
|
8
8
|
* Provides tools for listing calendars, events, and searching.
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
-
import {
|
|
11
|
+
import { Id } from '../ids/schema.js';
|
|
12
12
|
import { defineTool } from '../registry/define-tool.js';
|
|
13
|
-
import {
|
|
13
|
+
import { tokenIdLink } from '../registry/elicit-links.js';
|
|
14
|
+
import { requireGraphToolset } from '../registry/context.js';
|
|
14
15
|
// =============================================================================
|
|
15
16
|
// Input Schemas
|
|
16
17
|
// =============================================================================
|
|
18
|
+
// An event id is the canonical durable `ev_…` token (or a raw Graph id). A
|
|
19
|
+
// numeric-string id resolves to NUMERIC_ID_UNSUPPORTED via the resolver.
|
|
20
|
+
const EventIdSchema = Id.event;
|
|
17
21
|
export const ListCalendarsInput = z.strictObject({});
|
|
18
22
|
export const ListEventsInput = z.strictObject({
|
|
19
|
-
calendar_id:
|
|
23
|
+
calendar_id: Id.folder.optional().describe('Optional calendar folder ID — a durable folder (fd_) token.'),
|
|
20
24
|
start_date: z.string().optional().describe('Start date filter (ISO 8601 format)'),
|
|
21
25
|
end_date: z.string().optional().describe('End date filter (ISO 8601 format)'),
|
|
22
26
|
limit: z
|
|
@@ -28,7 +32,7 @@ export const ListEventsInput = z.strictObject({
|
|
|
28
32
|
.describe('Maximum number of events to return (1-100)'),
|
|
29
33
|
});
|
|
30
34
|
export const GetEventInput = z.strictObject({
|
|
31
|
-
event_id:
|
|
35
|
+
event_id: EventIdSchema.describe('The event ID to retrieve'),
|
|
32
36
|
});
|
|
33
37
|
export const SearchEventsInput = z.strictObject({
|
|
34
38
|
query: z.string().min(1).optional().describe('Search query for event titles'),
|
|
@@ -43,7 +47,7 @@ export const SearchEventsInput = z.strictObject({
|
|
|
43
47
|
.describe('Maximum number of events to return (1-100)'),
|
|
44
48
|
}).refine((data) => data.query != null || data.start_date != null || data.end_date != null, { message: 'At least one of query, start_date, or end_date must be provided' });
|
|
45
49
|
export const RespondToEventInput = z.strictObject({
|
|
46
|
-
event_id:
|
|
50
|
+
event_id: EventIdSchema.describe('The event ID to respond to'),
|
|
47
51
|
response: z.enum(['accept', 'decline', 'tentative']).describe('Your response to the invitation'),
|
|
48
52
|
send_response: z.boolean().default(true).describe('Whether to send response to organizer'),
|
|
49
53
|
comment: z.string().optional().describe('Optional comment to include with response'),
|
|
@@ -106,25 +110,8 @@ export const RecurrenceInput = z.strictObject({
|
|
|
106
110
|
});
|
|
107
111
|
}
|
|
108
112
|
});
|
|
109
|
-
const isoDateString = z
|
|
110
|
-
.string()
|
|
111
|
-
.refine((s) => !isNaN(Date.parse(s)), { message: 'Must be a valid ISO 8601 date string' });
|
|
112
|
-
export const CreateEventInput = z.strictObject({
|
|
113
|
-
title: z.string().min(1).describe('Event title/subject'),
|
|
114
|
-
start_date: isoDateString.describe('Start date in ISO 8601 UTC format'),
|
|
115
|
-
end_date: isoDateString.describe('End date in ISO 8601 UTC format'),
|
|
116
|
-
calendar_id: z.number().int().positive().optional().describe('Optional calendar ID to create the event in'),
|
|
117
|
-
location: z.string().optional().describe('Event location'),
|
|
118
|
-
description: z.string().optional().describe('Event description/body text'),
|
|
119
|
-
is_all_day: z.boolean().optional().default(false).describe('Whether this is an all-day event'),
|
|
120
|
-
recurrence: RecurrenceInput.optional().describe('Recurrence pattern to make this a repeating event'),
|
|
121
|
-
}).refine((data) => new Date(data.start_date).getTime() < new Date(data.end_date).getTime(), { message: 'start_date must be before end_date', path: ['start_date'] });
|
|
122
113
|
// -----------------------------------------------------------------------------
|
|
123
114
|
// Canonical (advertised) write schemas — Graph-shaped.
|
|
124
|
-
//
|
|
125
|
-
// The two backends historically parsed different schemas for writes. The Graph
|
|
126
|
-
// schema is the canonical advertised input for each tool; the AppleScript
|
|
127
|
-
// backend receives the superset params and maps only the fields it supports.
|
|
128
115
|
// -----------------------------------------------------------------------------
|
|
129
116
|
const graphIsoDateString = z
|
|
130
117
|
.string()
|
|
@@ -151,7 +138,7 @@ export const CreateEventGraphInput = z.strictObject({
|
|
|
151
138
|
title: z.string().min(1),
|
|
152
139
|
start_date: graphIsoDateString,
|
|
153
140
|
end_date: graphIsoDateString,
|
|
154
|
-
calendar_id:
|
|
141
|
+
calendar_id: Id.folder.optional(),
|
|
155
142
|
location: z.string().optional(),
|
|
156
143
|
description: z.string().optional(),
|
|
157
144
|
is_all_day: z.boolean().optional().default(false),
|
|
@@ -160,18 +147,11 @@ export const CreateEventGraphInput = z.strictObject({
|
|
|
160
147
|
is_online_meeting: z.boolean().optional().describe('Create as online Teams meeting'),
|
|
161
148
|
online_meeting_provider: z.enum(['teamsForBusiness', 'skypeForBusiness', 'skypeForConsumer']).optional().describe('Online meeting provider (default: teamsForBusiness)'),
|
|
162
149
|
}).refine((data) => new Date(data.start_date).getTime() < new Date(data.end_date).getTime(), { message: 'start_date must be before end_date', path: ['start_date'] });
|
|
163
|
-
//
|
|
164
|
-
// Graph
|
|
165
|
-
//
|
|
166
|
-
// - update_event fields use Graph names (subject/start/end/body), not the old
|
|
167
|
-
// AppleScript names (title/start_date/end_date/description).
|
|
168
|
-
// - recurrence uses the Graph {pattern, range} shape; AppleScript-only
|
|
169
|
-
// recurrence that Graph cannot express — monthly-by-date (day_of_month) and
|
|
170
|
-
// ordinal-monthly (week_of_month/day_of_week_monthly) — is no longer
|
|
171
|
-
// reachable via these tools. The Graph (default) backend is unaffected.
|
|
172
|
-
// See CHANGELOG / PR for the full migration matrix.
|
|
150
|
+
// create_event/update_event advertise the Graph schema: field names follow
|
|
151
|
+
// Graph conventions (subject/start/end/body), and recurrence uses the Graph
|
|
152
|
+
// {pattern, range} shape.
|
|
173
153
|
export const UpdateEventInput = z.strictObject({
|
|
174
|
-
event_id:
|
|
154
|
+
event_id: EventIdSchema,
|
|
175
155
|
subject: z.string().optional(),
|
|
176
156
|
start: z.string().optional(),
|
|
177
157
|
end: z.string().optional(),
|
|
@@ -184,23 +164,25 @@ export const UpdateEventInput = z.strictObject({
|
|
|
184
164
|
recurrence: GraphRecurrenceInput.optional(),
|
|
185
165
|
is_online_meeting: z.boolean().optional().describe('Create as online Teams meeting'),
|
|
186
166
|
online_meeting_provider: z.enum(['teamsForBusiness', 'skypeForBusiness', 'skypeForConsumer']).optional().describe('Online meeting provider (default: teamsForBusiness)'),
|
|
187
|
-
apply_to: z.enum(['this_instance', 'all_in_series']).optional().describe('For recurring events (AppleScript backend): update single instance or entire series (default: this_instance). Ignored by the Graph backend.'),
|
|
188
167
|
});
|
|
189
168
|
export const DeleteEventInput = z.strictObject({
|
|
190
|
-
|
|
191
|
-
|
|
169
|
+
// To delete one occurrence of a recurring series, pass that occurrence's own
|
|
170
|
+
// event_id (from list_event_instances); to delete the whole series, pass the
|
|
171
|
+
// master event_id. Graph deletes exactly the id given — there is no separate
|
|
172
|
+
// instance-vs-series flag.
|
|
173
|
+
event_id: EventIdSchema.describe('The event ID to delete (an occurrence id deletes just that occurrence; the master id deletes the series)'),
|
|
192
174
|
});
|
|
193
175
|
export const ListEventInstancesInput = z.strictObject({
|
|
194
|
-
event_id:
|
|
176
|
+
event_id: EventIdSchema.describe('Recurring event ID'),
|
|
195
177
|
start_date: z.string().describe('Start of date range (ISO 8601, e.g. 2024-01-01T00:00:00Z)'),
|
|
196
178
|
end_date: z.string().describe('End of date range (ISO 8601, e.g. 2024-12-31T23:59:59Z)'),
|
|
197
179
|
});
|
|
198
180
|
export const PrepareDeleteEventInput = z.strictObject({
|
|
199
|
-
event_id:
|
|
181
|
+
event_id: EventIdSchema.describe('The event ID to delete'),
|
|
200
182
|
});
|
|
201
183
|
export const ConfirmDeleteEventInput = z.strictObject({
|
|
202
184
|
token_id: z.uuid().describe('The approval token from prepare_delete_event'),
|
|
203
|
-
event_id:
|
|
185
|
+
event_id: EventIdSchema.describe('The event ID to delete'),
|
|
204
186
|
});
|
|
205
187
|
export const ListCalendarGroupsInput = z.strictObject({});
|
|
206
188
|
export const CreateCalendarGroupInput = z.strictObject({
|
|
@@ -210,140 +192,12 @@ export const ListRoomListsInput = z.strictObject({});
|
|
|
210
192
|
export const ListRoomsInput = z.strictObject({
|
|
211
193
|
room_list_email: z.string().email().optional().describe('Room list email to filter by (from list_room_lists)'),
|
|
212
194
|
});
|
|
213
|
-
/**
|
|
214
|
-
* Default event content reader that returns null.
|
|
215
|
-
*/
|
|
216
|
-
export const nullEventContentReader = {
|
|
217
|
-
readEventDetails: () => null,
|
|
218
|
-
};
|
|
219
|
-
// =============================================================================
|
|
220
|
-
// Transformers
|
|
221
|
-
// =============================================================================
|
|
222
|
-
/**
|
|
223
|
-
* Transforms a database folder row to CalendarFolder.
|
|
224
|
-
*/
|
|
225
|
-
function transformCalendar(row) {
|
|
226
|
-
return {
|
|
227
|
-
id: row.id,
|
|
228
|
-
name: row.name ?? 'Unnamed',
|
|
229
|
-
accountId: row.accountId,
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Transforms a database event row to EventSummary.
|
|
234
|
-
*/
|
|
235
|
-
function transformEventSummary(row, title = null) {
|
|
236
|
-
return {
|
|
237
|
-
id: row.id,
|
|
238
|
-
folderId: row.folderId,
|
|
239
|
-
title: title,
|
|
240
|
-
startDate: appleTimestampToIso(row.startDate),
|
|
241
|
-
endDate: appleTimestampToIso(row.endDate),
|
|
242
|
-
isRecurring: row.isRecurring === 1,
|
|
243
|
-
hasReminder: row.hasReminder === 1,
|
|
244
|
-
attendeeCount: row.attendeeCount,
|
|
245
|
-
uid: row.uid,
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Transforms a database event row to full Event.
|
|
250
|
-
*/
|
|
251
|
-
function transformEvent(row, details) {
|
|
252
|
-
const summary = transformEventSummary(row, details?.title ?? null);
|
|
253
|
-
return {
|
|
254
|
-
...summary,
|
|
255
|
-
location: details?.location ?? null,
|
|
256
|
-
description: details?.description ?? null,
|
|
257
|
-
organizer: details?.organizer ?? null,
|
|
258
|
-
attendees: details?.attendees ?? [],
|
|
259
|
-
masterRecordId: row.masterRecordId ?? null,
|
|
260
|
-
recurrenceId: row.recurrenceId ?? null,
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
// =============================================================================
|
|
264
|
-
// Calendar Tools Class
|
|
265
|
-
// =============================================================================
|
|
266
|
-
/**
|
|
267
|
-
* Calendar tools implementation with dependency injection.
|
|
268
|
-
*/
|
|
269
|
-
export class CalendarTools {
|
|
270
|
-
repository;
|
|
271
|
-
contentReader;
|
|
272
|
-
constructor(repository, contentReader = nullEventContentReader) {
|
|
273
|
-
this.repository = repository;
|
|
274
|
-
this.contentReader = contentReader;
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Lists all calendar folders.
|
|
278
|
-
*/
|
|
279
|
-
listCalendars(_params) {
|
|
280
|
-
const rows = this.repository.listCalendars();
|
|
281
|
-
return rows.map(transformCalendar);
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Lists events with optional filtering.
|
|
285
|
-
*/
|
|
286
|
-
listEvents(params) {
|
|
287
|
-
const { calendar_id, start_date, end_date, limit } = params;
|
|
288
|
-
let rows;
|
|
289
|
-
if (start_date != null && end_date != null) {
|
|
290
|
-
const startTimestamp = isoToAppleTimestamp(start_date);
|
|
291
|
-
const endTimestamp = isoToAppleTimestamp(end_date);
|
|
292
|
-
if (startTimestamp != null && endTimestamp != null) {
|
|
293
|
-
rows = this.repository.listEventsByDateRange(startTimestamp, endTimestamp, limit);
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
rows = this.repository.listEvents(limit);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
else if (calendar_id != null) {
|
|
300
|
-
rows = this.repository.listEventsByFolder(calendar_id, limit);
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
rows = this.repository.listEvents(limit);
|
|
304
|
-
}
|
|
305
|
-
return rows.map((row) => {
|
|
306
|
-
const details = this.contentReader.readEventDetails(row.dataFilePath);
|
|
307
|
-
return transformEventSummary(row, details?.title ?? null);
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Gets a single event by ID.
|
|
312
|
-
*/
|
|
313
|
-
getEvent(params) {
|
|
314
|
-
const { event_id } = params;
|
|
315
|
-
const row = this.repository.getEvent(event_id);
|
|
316
|
-
if (row == null) {
|
|
317
|
-
return null;
|
|
318
|
-
}
|
|
319
|
-
const details = this.contentReader.readEventDetails(row.dataFilePath);
|
|
320
|
-
return transformEvent(row, details);
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Searches events by title and/or date range.
|
|
324
|
-
*/
|
|
325
|
-
searchEvents(params) {
|
|
326
|
-
const { query, start_date, end_date, limit } = params;
|
|
327
|
-
const rows = this.repository.searchEvents(query ?? null, start_date ?? null, end_date ?? null, limit);
|
|
328
|
-
return rows.map((row) => {
|
|
329
|
-
const details = this.contentReader.readEventDetails(row.dataFilePath);
|
|
330
|
-
return transformEventSummary(row, details?.title ?? null);
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Creates calendar tools with the given repository.
|
|
336
|
-
*/
|
|
337
|
-
export function createCalendarTools(repository, contentReader = nullEventContentReader) {
|
|
338
|
-
return new CalendarTools(repository, contentReader);
|
|
339
|
-
}
|
|
340
195
|
// =============================================================================
|
|
341
196
|
// Registry Definitions (v3 registry-driven architecture, U2 — dual backend)
|
|
342
197
|
// =============================================================================
|
|
343
198
|
/**
|
|
344
|
-
* Registry tool definitions for the calendar domain. Each handler
|
|
345
|
-
*
|
|
346
|
-
* delegates to AppleCalendarTools. Both toolsets return MCP content directly.
|
|
199
|
+
* Registry tool definitions for the calendar domain. Each handler delegates to
|
|
200
|
+
* GraphCalendarTools, which returns MCP content directly.
|
|
347
201
|
*/
|
|
348
202
|
export function calendarToolDefinitions() {
|
|
349
203
|
return [
|
|
@@ -354,10 +208,8 @@ export function calendarToolDefinitions() {
|
|
|
354
208
|
annotations: { readOnlyHint: true },
|
|
355
209
|
destructive: false,
|
|
356
210
|
presets: ['calendar'],
|
|
357
|
-
backends: ['graph'
|
|
358
|
-
handler: (ctx) => ctx
|
|
359
|
-
? requireGraphToolset(ctx, 'calendarGraph').listCalendars()
|
|
360
|
-
: requireAppleScriptToolset(ctx, 'calendar').listCalendars(),
|
|
211
|
+
backends: ['graph'],
|
|
212
|
+
handler: (ctx) => requireGraphToolset(ctx, 'calendarGraph').listCalendars(),
|
|
361
213
|
}),
|
|
362
214
|
defineTool({
|
|
363
215
|
name: 'list_events',
|
|
@@ -366,10 +218,8 @@ export function calendarToolDefinitions() {
|
|
|
366
218
|
annotations: { readOnlyHint: true },
|
|
367
219
|
destructive: false,
|
|
368
220
|
presets: ['calendar'],
|
|
369
|
-
backends: ['graph'
|
|
370
|
-
handler: (ctx, params) => ctx
|
|
371
|
-
? requireGraphToolset(ctx, 'calendarGraph').listEvents(params)
|
|
372
|
-
: requireAppleScriptToolset(ctx, 'calendar').listEvents(params),
|
|
221
|
+
backends: ['graph'],
|
|
222
|
+
handler: (ctx, params) => requireGraphToolset(ctx, 'calendarGraph').listEvents(params),
|
|
373
223
|
}),
|
|
374
224
|
defineTool({
|
|
375
225
|
name: 'get_event',
|
|
@@ -378,10 +228,8 @@ export function calendarToolDefinitions() {
|
|
|
378
228
|
annotations: { readOnlyHint: true },
|
|
379
229
|
destructive: false,
|
|
380
230
|
presets: ['calendar'],
|
|
381
|
-
backends: ['graph'
|
|
382
|
-
handler: (ctx, params) => ctx
|
|
383
|
-
? requireGraphToolset(ctx, 'calendarGraph').getEvent(params)
|
|
384
|
-
: requireAppleScriptToolset(ctx, 'calendar').getEvent(params),
|
|
231
|
+
backends: ['graph'],
|
|
232
|
+
handler: (ctx, params) => requireGraphToolset(ctx, 'calendarGraph').getEvent(params),
|
|
385
233
|
}),
|
|
386
234
|
defineTool({
|
|
387
235
|
name: 'search_events',
|
|
@@ -390,10 +238,8 @@ export function calendarToolDefinitions() {
|
|
|
390
238
|
annotations: { readOnlyHint: true },
|
|
391
239
|
destructive: false,
|
|
392
240
|
presets: ['calendar'],
|
|
393
|
-
backends: ['graph'
|
|
394
|
-
handler: (ctx, params) => ctx
|
|
395
|
-
? requireGraphToolset(ctx, 'calendarGraph').searchEvents(params)
|
|
396
|
-
: requireAppleScriptToolset(ctx, 'calendar').searchEvents(params),
|
|
241
|
+
backends: ['graph'],
|
|
242
|
+
handler: (ctx, params) => requireGraphToolset(ctx, 'calendarGraph').searchEvents(params),
|
|
397
243
|
}),
|
|
398
244
|
defineTool({
|
|
399
245
|
name: 'create_event',
|
|
@@ -402,10 +248,8 @@ export function calendarToolDefinitions() {
|
|
|
402
248
|
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
|
|
403
249
|
destructive: false,
|
|
404
250
|
presets: ['calendar'],
|
|
405
|
-
backends: ['graph'
|
|
406
|
-
handler: (ctx, params) => ctx
|
|
407
|
-
? requireGraphToolset(ctx, 'calendarGraph').createEvent(params)
|
|
408
|
-
: requireAppleScriptToolset(ctx, 'calendar').createEvent(params),
|
|
251
|
+
backends: ['graph'],
|
|
252
|
+
handler: (ctx, params) => requireGraphToolset(ctx, 'calendarGraph').createEvent(params),
|
|
409
253
|
}),
|
|
410
254
|
defineTool({
|
|
411
255
|
name: 'respond_to_event',
|
|
@@ -414,10 +258,8 @@ export function calendarToolDefinitions() {
|
|
|
414
258
|
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
|
|
415
259
|
destructive: false,
|
|
416
260
|
presets: ['calendar'],
|
|
417
|
-
backends: ['graph'
|
|
418
|
-
handler: (ctx, params) => ctx
|
|
419
|
-
? requireGraphToolset(ctx, 'calendarGraph').respondToEvent(params)
|
|
420
|
-
: requireAppleScriptToolset(ctx, 'calendar').respondToEvent(params),
|
|
261
|
+
backends: ['graph'],
|
|
262
|
+
handler: (ctx, params) => requireGraphToolset(ctx, 'calendarGraph').respondToEvent(params),
|
|
421
263
|
}),
|
|
422
264
|
defineTool({
|
|
423
265
|
name: 'delete_event',
|
|
@@ -426,10 +268,8 @@ export function calendarToolDefinitions() {
|
|
|
426
268
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
|
|
427
269
|
destructive: true,
|
|
428
270
|
presets: ['calendar'],
|
|
429
|
-
backends: ['graph'
|
|
430
|
-
handler: (ctx, params) => ctx
|
|
431
|
-
? requireGraphToolset(ctx, 'calendarGraph').deleteEvent(params)
|
|
432
|
-
: requireAppleScriptToolset(ctx, 'calendar').deleteEvent(params),
|
|
271
|
+
backends: ['graph'],
|
|
272
|
+
handler: (ctx, params) => requireGraphToolset(ctx, 'calendarGraph').deleteEvent(params),
|
|
433
273
|
}),
|
|
434
274
|
defineTool({
|
|
435
275
|
name: 'update_event',
|
|
@@ -438,10 +278,8 @@ export function calendarToolDefinitions() {
|
|
|
438
278
|
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
|
|
439
279
|
destructive: false,
|
|
440
280
|
presets: ['calendar'],
|
|
441
|
-
backends: ['graph'
|
|
442
|
-
handler: (ctx, params) => ctx
|
|
443
|
-
? requireGraphToolset(ctx, 'calendarGraph').updateEvent(params)
|
|
444
|
-
: requireAppleScriptToolset(ctx, 'calendar').updateEvent(params),
|
|
281
|
+
backends: ['graph'],
|
|
282
|
+
handler: (ctx, params) => requireGraphToolset(ctx, 'calendarGraph').updateEvent(params),
|
|
445
283
|
}),
|
|
446
284
|
defineTool({
|
|
447
285
|
name: 'list_event_instances',
|
|
@@ -463,6 +301,7 @@ export function calendarToolDefinitions() {
|
|
|
463
301
|
presets: ['calendar'],
|
|
464
302
|
backends: ['graph'],
|
|
465
303
|
handler: (ctx, params) => requireGraphToolset(ctx, 'calendarGraph').prepareDeleteEvent(params),
|
|
304
|
+
onElicit: tokenIdLink('confirm_delete_event', ['event_id']),
|
|
466
305
|
}),
|
|
467
306
|
defineTool({
|
|
468
307
|
name: 'confirm_delete_event',
|