@miguelarios/cal-mcp 0.10.0 → 0.12.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/CHANGELOG.md +14 -0
- package/README.md +40 -26
- package/dist/main.d.ts +2 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +17 -17
- package/dist/main.js.map +1 -1
- package/dist/services/CalDavService.d.ts +1 -0
- package/dist/services/CalDavService.d.ts.map +1 -1
- package/dist/services/CalDavService.js +91 -11
- package/dist/services/CalDavService.js.map +1 -1
- package/dist/tools/calendarSchemas.d.ts +257 -0
- package/dist/tools/calendarSchemas.d.ts.map +1 -0
- package/dist/tools/calendarSchemas.js +85 -0
- package/dist/tools/calendarSchemas.js.map +1 -0
- package/dist/tools/calendarTools.d.ts +2 -9
- package/dist/tools/calendarTools.d.ts.map +1 -1
- package/dist/tools/calendarTools.js +525 -519
- package/dist/tools/calendarTools.js.map +1 -1
- package/package.json +4 -3
- package/cal-mcp-tools.json +0 -322
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Valibot output schemas for the calendar tools. These drive the `outputSchema`
|
|
3
|
+
* advertised in `tools/list` and validate `structuredContent` before it leaves
|
|
4
|
+
* the server.
|
|
5
|
+
*
|
|
6
|
+
* They mirror `CalendarInfo`, `EventSummary`, `EventFull` and `FreeSlot` from
|
|
7
|
+
* `../services/CalDavService.js`. `list_events` and friends can return either
|
|
8
|
+
* the summary or the full shape depending on `detail_level`, so the event
|
|
9
|
+
* schema is the summary shape with every full-only field optional.
|
|
10
|
+
*/
|
|
11
|
+
import * as v from "valibot";
|
|
12
|
+
export declare const calendarSchema: v.ObjectSchema<{
|
|
13
|
+
readonly calendar_id: v.StringSchema<undefined>;
|
|
14
|
+
readonly display_name: v.StringSchema<undefined>;
|
|
15
|
+
readonly color: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
16
|
+
readonly source: v.StringSchema<undefined>;
|
|
17
|
+
readonly read_only: v.BooleanSchema<undefined>;
|
|
18
|
+
readonly url: v.StringSchema<undefined>;
|
|
19
|
+
readonly ctag: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
20
|
+
}, undefined>;
|
|
21
|
+
/** Summary fields, plus the full-detail fields as optional. */
|
|
22
|
+
export declare const eventSchema: v.ObjectSchema<{
|
|
23
|
+
readonly uid: v.StringSchema<undefined>;
|
|
24
|
+
readonly calendar_id: v.StringSchema<undefined>;
|
|
25
|
+
readonly title: v.StringSchema<undefined>;
|
|
26
|
+
readonly start: v.StringSchema<undefined>;
|
|
27
|
+
readonly end: v.StringSchema<undefined>;
|
|
28
|
+
readonly all_day: v.BooleanSchema<undefined>;
|
|
29
|
+
readonly location: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
30
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
31
|
+
readonly is_recurring: v.BooleanSchema<undefined>;
|
|
32
|
+
readonly occurrence_date: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
33
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
34
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
35
|
+
readonly availability: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
36
|
+
readonly attendees: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
37
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
38
|
+
readonly email: v.StringSchema<undefined>;
|
|
39
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
40
|
+
readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
41
|
+
readonly type: v.StringSchema<undefined>;
|
|
42
|
+
}, undefined>, undefined>, undefined>;
|
|
43
|
+
readonly organizer: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
44
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
45
|
+
readonly email: v.StringSchema<undefined>;
|
|
46
|
+
}, undefined>, undefined>, undefined>;
|
|
47
|
+
readonly recurrence_rule: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
48
|
+
readonly created: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
49
|
+
readonly last_modified: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
50
|
+
readonly alarms: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
51
|
+
readonly type: v.PicklistSchema<["relative", "absolute"], undefined>;
|
|
52
|
+
readonly trigger: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
|
|
53
|
+
readonly trigger_human: v.StringSchema<undefined>;
|
|
54
|
+
}, undefined>, undefined>, undefined>;
|
|
55
|
+
readonly categories: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
56
|
+
readonly geo: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
57
|
+
readonly latitude: v.NumberSchema<undefined>;
|
|
58
|
+
readonly longitude: v.NumberSchema<undefined>;
|
|
59
|
+
}, undefined>, undefined>, undefined>;
|
|
60
|
+
}, undefined>;
|
|
61
|
+
export declare const calendarListSchema: v.ObjectSchema<{
|
|
62
|
+
readonly calendars: v.ArraySchema<v.ObjectSchema<{
|
|
63
|
+
readonly calendar_id: v.StringSchema<undefined>;
|
|
64
|
+
readonly display_name: v.StringSchema<undefined>;
|
|
65
|
+
readonly color: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
66
|
+
readonly source: v.StringSchema<undefined>;
|
|
67
|
+
readonly read_only: v.BooleanSchema<undefined>;
|
|
68
|
+
readonly url: v.StringSchema<undefined>;
|
|
69
|
+
readonly ctag: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
70
|
+
}, undefined>, undefined>;
|
|
71
|
+
}, undefined>;
|
|
72
|
+
export declare const eventListSchema: v.ObjectSchema<{
|
|
73
|
+
readonly events: v.ArraySchema<v.ObjectSchema<{
|
|
74
|
+
readonly uid: v.StringSchema<undefined>;
|
|
75
|
+
readonly calendar_id: v.StringSchema<undefined>;
|
|
76
|
+
readonly title: v.StringSchema<undefined>;
|
|
77
|
+
readonly start: v.StringSchema<undefined>;
|
|
78
|
+
readonly end: v.StringSchema<undefined>;
|
|
79
|
+
readonly all_day: v.BooleanSchema<undefined>;
|
|
80
|
+
readonly location: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
81
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
82
|
+
readonly is_recurring: v.BooleanSchema<undefined>;
|
|
83
|
+
readonly occurrence_date: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
84
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
85
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
86
|
+
readonly availability: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
87
|
+
readonly attendees: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
88
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
89
|
+
readonly email: v.StringSchema<undefined>;
|
|
90
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
91
|
+
readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
92
|
+
readonly type: v.StringSchema<undefined>;
|
|
93
|
+
}, undefined>, undefined>, undefined>;
|
|
94
|
+
readonly organizer: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
95
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
96
|
+
readonly email: v.StringSchema<undefined>;
|
|
97
|
+
}, undefined>, undefined>, undefined>;
|
|
98
|
+
readonly recurrence_rule: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
99
|
+
readonly created: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
100
|
+
readonly last_modified: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
101
|
+
readonly alarms: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
102
|
+
readonly type: v.PicklistSchema<["relative", "absolute"], undefined>;
|
|
103
|
+
readonly trigger: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
|
|
104
|
+
readonly trigger_human: v.StringSchema<undefined>;
|
|
105
|
+
}, undefined>, undefined>, undefined>;
|
|
106
|
+
readonly categories: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
107
|
+
readonly geo: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
108
|
+
readonly latitude: v.NumberSchema<undefined>;
|
|
109
|
+
readonly longitude: v.NumberSchema<undefined>;
|
|
110
|
+
}, undefined>, undefined>, undefined>;
|
|
111
|
+
}, undefined>, undefined>;
|
|
112
|
+
}, undefined>;
|
|
113
|
+
export declare const singleEventSchema: v.ObjectSchema<{
|
|
114
|
+
readonly event: v.ObjectSchema<{
|
|
115
|
+
readonly uid: v.StringSchema<undefined>;
|
|
116
|
+
readonly calendar_id: v.StringSchema<undefined>;
|
|
117
|
+
readonly title: v.StringSchema<undefined>;
|
|
118
|
+
readonly start: v.StringSchema<undefined>;
|
|
119
|
+
readonly end: v.StringSchema<undefined>;
|
|
120
|
+
readonly all_day: v.BooleanSchema<undefined>;
|
|
121
|
+
readonly location: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
122
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
123
|
+
readonly is_recurring: v.BooleanSchema<undefined>;
|
|
124
|
+
readonly occurrence_date: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
125
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
126
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
127
|
+
readonly availability: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
128
|
+
readonly attendees: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
129
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
130
|
+
readonly email: v.StringSchema<undefined>;
|
|
131
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
132
|
+
readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
133
|
+
readonly type: v.StringSchema<undefined>;
|
|
134
|
+
}, undefined>, undefined>, undefined>;
|
|
135
|
+
readonly organizer: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
136
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
137
|
+
readonly email: v.StringSchema<undefined>;
|
|
138
|
+
}, undefined>, undefined>, undefined>;
|
|
139
|
+
readonly recurrence_rule: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
140
|
+
readonly created: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
141
|
+
readonly last_modified: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
142
|
+
readonly alarms: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
143
|
+
readonly type: v.PicklistSchema<["relative", "absolute"], undefined>;
|
|
144
|
+
readonly trigger: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
|
|
145
|
+
readonly trigger_human: v.StringSchema<undefined>;
|
|
146
|
+
}, undefined>, undefined>, undefined>;
|
|
147
|
+
readonly categories: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
148
|
+
readonly geo: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
149
|
+
readonly latitude: v.NumberSchema<undefined>;
|
|
150
|
+
readonly longitude: v.NumberSchema<undefined>;
|
|
151
|
+
}, undefined>, undefined>, undefined>;
|
|
152
|
+
}, undefined>;
|
|
153
|
+
}, undefined>;
|
|
154
|
+
export declare const deleteResultSchema: v.ObjectSchema<{
|
|
155
|
+
readonly deleted: v.BooleanSchema<undefined>;
|
|
156
|
+
readonly uid: v.StringSchema<undefined>;
|
|
157
|
+
}, undefined>;
|
|
158
|
+
export declare const batchCreateSchema: v.ObjectSchema<{
|
|
159
|
+
readonly created: v.NumberSchema<undefined>;
|
|
160
|
+
readonly events: v.ArraySchema<v.ObjectSchema<{
|
|
161
|
+
readonly uid: v.StringSchema<undefined>;
|
|
162
|
+
readonly calendar_id: v.StringSchema<undefined>;
|
|
163
|
+
readonly title: v.StringSchema<undefined>;
|
|
164
|
+
readonly start: v.StringSchema<undefined>;
|
|
165
|
+
readonly end: v.StringSchema<undefined>;
|
|
166
|
+
readonly all_day: v.BooleanSchema<undefined>;
|
|
167
|
+
readonly location: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
168
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
169
|
+
readonly is_recurring: v.BooleanSchema<undefined>;
|
|
170
|
+
readonly occurrence_date: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
171
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
172
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
173
|
+
readonly availability: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
174
|
+
readonly attendees: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
175
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
176
|
+
readonly email: v.StringSchema<undefined>;
|
|
177
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
178
|
+
readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
179
|
+
readonly type: v.StringSchema<undefined>;
|
|
180
|
+
}, undefined>, undefined>, undefined>;
|
|
181
|
+
readonly organizer: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
182
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
183
|
+
readonly email: v.StringSchema<undefined>;
|
|
184
|
+
}, undefined>, undefined>, undefined>;
|
|
185
|
+
readonly recurrence_rule: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
186
|
+
readonly created: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
187
|
+
readonly last_modified: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
188
|
+
readonly alarms: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
189
|
+
readonly type: v.PicklistSchema<["relative", "absolute"], undefined>;
|
|
190
|
+
readonly trigger: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
|
|
191
|
+
readonly trigger_human: v.StringSchema<undefined>;
|
|
192
|
+
}, undefined>, undefined>, undefined>;
|
|
193
|
+
readonly categories: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
194
|
+
readonly geo: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
195
|
+
readonly latitude: v.NumberSchema<undefined>;
|
|
196
|
+
readonly longitude: v.NumberSchema<undefined>;
|
|
197
|
+
}, undefined>, undefined>, undefined>;
|
|
198
|
+
}, undefined>, undefined>;
|
|
199
|
+
}, undefined>;
|
|
200
|
+
/** `import_ics` reports partial success: events that failed keep their UID and reason. */
|
|
201
|
+
export declare const importResultSchema: v.ObjectSchema<{
|
|
202
|
+
readonly imported: v.NumberSchema<undefined>;
|
|
203
|
+
readonly failed: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
204
|
+
readonly uid: v.StringSchema<undefined>;
|
|
205
|
+
readonly message: v.StringSchema<undefined>;
|
|
206
|
+
}, undefined>, undefined>, undefined>;
|
|
207
|
+
readonly events: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
208
|
+
readonly uid: v.StringSchema<undefined>;
|
|
209
|
+
readonly calendar_id: v.StringSchema<undefined>;
|
|
210
|
+
readonly title: v.StringSchema<undefined>;
|
|
211
|
+
readonly start: v.StringSchema<undefined>;
|
|
212
|
+
readonly end: v.StringSchema<undefined>;
|
|
213
|
+
readonly all_day: v.BooleanSchema<undefined>;
|
|
214
|
+
readonly location: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
215
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
216
|
+
readonly is_recurring: v.BooleanSchema<undefined>;
|
|
217
|
+
readonly occurrence_date: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
218
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
219
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
220
|
+
readonly availability: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
221
|
+
readonly attendees: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
222
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
223
|
+
readonly email: v.StringSchema<undefined>;
|
|
224
|
+
readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
225
|
+
readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
226
|
+
readonly type: v.StringSchema<undefined>;
|
|
227
|
+
}, undefined>, undefined>, undefined>;
|
|
228
|
+
readonly organizer: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
229
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
230
|
+
readonly email: v.StringSchema<undefined>;
|
|
231
|
+
}, undefined>, undefined>, undefined>;
|
|
232
|
+
readonly recurrence_rule: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
233
|
+
readonly created: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
234
|
+
readonly last_modified: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
235
|
+
readonly alarms: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
236
|
+
readonly type: v.PicklistSchema<["relative", "absolute"], undefined>;
|
|
237
|
+
readonly trigger: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
|
|
238
|
+
readonly trigger_human: v.StringSchema<undefined>;
|
|
239
|
+
}, undefined>, undefined>, undefined>;
|
|
240
|
+
readonly categories: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
241
|
+
readonly geo: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
242
|
+
readonly latitude: v.NumberSchema<undefined>;
|
|
243
|
+
readonly longitude: v.NumberSchema<undefined>;
|
|
244
|
+
}, undefined>, undefined>, undefined>;
|
|
245
|
+
}, undefined>, v.ObjectSchema<{
|
|
246
|
+
readonly uid: v.StringSchema<undefined>;
|
|
247
|
+
}, undefined>], undefined>, undefined>;
|
|
248
|
+
}, undefined>;
|
|
249
|
+
export declare const freeSlotsSchema: v.ObjectSchema<{
|
|
250
|
+
readonly slots: v.ArraySchema<v.ObjectSchema<{
|
|
251
|
+
readonly start: v.StringSchema<undefined>;
|
|
252
|
+
readonly end: v.StringSchema<undefined>;
|
|
253
|
+
readonly duration: v.NumberSchema<undefined>;
|
|
254
|
+
}, undefined>, undefined>;
|
|
255
|
+
readonly count: v.NumberSchema<undefined>;
|
|
256
|
+
}, undefined>;
|
|
257
|
+
//# sourceMappingURL=calendarSchemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarSchemas.d.ts","sourceRoot":"","sources":["../../src/tools/calendarSchemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAI7B,eAAO,MAAM,cAAc;;;;;;;;aAQzB,CAAC;AAgBH,+DAA+D;AAC/D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAsBtB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;aAE7B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAE1B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAE5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;aAG7B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAG5B,CAAC;AAEH,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAI7B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;aAG1B,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Valibot output schemas for the calendar tools. These drive the `outputSchema`
|
|
3
|
+
* advertised in `tools/list` and validate `structuredContent` before it leaves
|
|
4
|
+
* the server.
|
|
5
|
+
*
|
|
6
|
+
* They mirror `CalendarInfo`, `EventSummary`, `EventFull` and `FreeSlot` from
|
|
7
|
+
* `../services/CalDavService.js`. `list_events` and friends can return either
|
|
8
|
+
* the summary or the full shape depending on `detail_level`, so the event
|
|
9
|
+
* schema is the summary shape with every full-only field optional.
|
|
10
|
+
*/
|
|
11
|
+
import * as v from "valibot";
|
|
12
|
+
const nullableString = v.nullable(v.string());
|
|
13
|
+
export const calendarSchema = v.object({
|
|
14
|
+
calendar_id: v.string(),
|
|
15
|
+
display_name: v.string(),
|
|
16
|
+
color: nullableString,
|
|
17
|
+
source: v.string(),
|
|
18
|
+
read_only: v.boolean(),
|
|
19
|
+
url: v.string(),
|
|
20
|
+
ctag: v.optional(v.string()),
|
|
21
|
+
});
|
|
22
|
+
const attendeeSchema = v.object({
|
|
23
|
+
name: nullableString,
|
|
24
|
+
email: v.string(),
|
|
25
|
+
status: nullableString,
|
|
26
|
+
role: nullableString,
|
|
27
|
+
type: v.string(),
|
|
28
|
+
});
|
|
29
|
+
const alarmSchema = v.object({
|
|
30
|
+
type: v.picklist(["relative", "absolute"]),
|
|
31
|
+
trigger: v.union([v.number(), v.string()]),
|
|
32
|
+
trigger_human: v.string(),
|
|
33
|
+
});
|
|
34
|
+
/** Summary fields, plus the full-detail fields as optional. */
|
|
35
|
+
export const eventSchema = v.object({
|
|
36
|
+
uid: v.string(),
|
|
37
|
+
calendar_id: v.string(),
|
|
38
|
+
title: v.string(),
|
|
39
|
+
start: v.string(),
|
|
40
|
+
end: v.string(),
|
|
41
|
+
all_day: v.boolean(),
|
|
42
|
+
location: nullableString,
|
|
43
|
+
status: nullableString,
|
|
44
|
+
is_recurring: v.boolean(),
|
|
45
|
+
occurrence_date: nullableString,
|
|
46
|
+
description: v.optional(nullableString),
|
|
47
|
+
url: v.optional(nullableString),
|
|
48
|
+
availability: v.optional(nullableString),
|
|
49
|
+
attendees: v.optional(v.array(attendeeSchema)),
|
|
50
|
+
organizer: v.optional(v.nullable(v.object({ name: nullableString, email: v.string() }))),
|
|
51
|
+
recurrence_rule: v.optional(nullableString),
|
|
52
|
+
created: v.optional(nullableString),
|
|
53
|
+
last_modified: v.optional(nullableString),
|
|
54
|
+
alarms: v.optional(v.array(alarmSchema)),
|
|
55
|
+
categories: v.optional(v.array(v.string())),
|
|
56
|
+
geo: v.optional(v.nullable(v.object({ latitude: v.number(), longitude: v.number() }))),
|
|
57
|
+
});
|
|
58
|
+
export const calendarListSchema = v.object({
|
|
59
|
+
calendars: v.array(calendarSchema),
|
|
60
|
+
});
|
|
61
|
+
export const eventListSchema = v.object({
|
|
62
|
+
events: v.array(eventSchema),
|
|
63
|
+
});
|
|
64
|
+
export const singleEventSchema = v.object({
|
|
65
|
+
event: eventSchema,
|
|
66
|
+
});
|
|
67
|
+
export const deleteResultSchema = v.object({
|
|
68
|
+
deleted: v.boolean(),
|
|
69
|
+
uid: v.string(),
|
|
70
|
+
});
|
|
71
|
+
export const batchCreateSchema = v.object({
|
|
72
|
+
created: v.number(),
|
|
73
|
+
events: v.array(eventSchema),
|
|
74
|
+
});
|
|
75
|
+
/** `import_ics` reports partial success: events that failed keep their UID and reason. */
|
|
76
|
+
export const importResultSchema = v.object({
|
|
77
|
+
imported: v.number(),
|
|
78
|
+
failed: v.optional(v.array(v.object({ uid: v.string(), message: v.string() }))),
|
|
79
|
+
events: v.array(v.union([eventSchema, v.object({ uid: v.string() })])),
|
|
80
|
+
});
|
|
81
|
+
export const freeSlotsSchema = v.object({
|
|
82
|
+
slots: v.array(v.object({ start: v.string(), end: v.string(), duration: v.number() })),
|
|
83
|
+
count: v.number(),
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=calendarSchemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarSchemas.js","sourceRoot":"","sources":["../../src/tools/calendarSchemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,MAAM,cAAc,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,cAAc,GAA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,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACtF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ToolDef } from "@miguelarios/pim-core/mcp";
|
|
2
2
|
import { type CalDavService } from "../services/CalDavService.js";
|
|
3
|
-
export declare const CALENDAR_TOOLS:
|
|
4
|
-
export declare function handleCalendarTool(name: string, args: Record<string, unknown>, service: CalDavService): Promise<{
|
|
5
|
-
content: Array<{
|
|
6
|
-
type: "text";
|
|
7
|
-
text: string;
|
|
8
|
-
}>;
|
|
9
|
-
isError?: boolean;
|
|
10
|
-
}>;
|
|
3
|
+
export declare const CALENDAR_TOOLS: ReadonlyArray<ToolDef<CalDavService>>;
|
|
11
4
|
//# sourceMappingURL=calendarTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendarTools.d.ts","sourceRoot":"","sources":["../../src/tools/calendarTools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calendarTools.d.ts","sourceRoot":"","sources":["../../src/tools/calendarTools.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,OAAO,EAMb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,8BAA8B,CAAC;AAsLtC,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CA4vBhE,CAAC"}
|