@miguelarios/cal-mcp 0.11.0 → 0.13.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 +9 -0
- package/README.md +8 -0
- package/dist/main.d.ts +2 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +15 -17
- package/dist/main.js.map +1 -1
- package/dist/services/CalDavService.d.ts +73 -0
- package/dist/services/CalDavService.d.ts.map +1 -1
- package/dist/services/CalDavService.js +414 -9
- package/dist/services/CalDavService.js.map +1 -1
- package/dist/services/urlCache.d.ts +16 -0
- package/dist/services/urlCache.d.ts.map +1 -1
- package/dist/services/urlCache.js +32 -0
- package/dist/services/urlCache.js.map +1 -1
- package/dist/tools/calendarManagementTools.d.ts +11 -0
- package/dist/tools/calendarManagementTools.d.ts.map +1 -0
- package/dist/tools/calendarManagementTools.js +178 -0
- package/dist/tools/calendarManagementTools.js.map +1 -0
- package/dist/tools/calendarSchemas.d.ts +268 -0
- package/dist/tools/calendarSchemas.d.ts.map +1 -0
- package/dist/tools/calendarSchemas.js +96 -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 -533
- package/dist/tools/calendarTools.js.map +1 -1
- package/package.json +4 -3
|
@@ -56,4 +56,36 @@ export function deleteCachedObject(calendarId, uid) {
|
|
|
56
56
|
writeCache(cache);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Rekeys a calendar's cached entries after a rename.
|
|
61
|
+
*
|
|
62
|
+
* A PROPPATCH changes the display name, and with it the `calendar_id` this
|
|
63
|
+
* cache is keyed by — but not the object URLs underneath, so the entries stay
|
|
64
|
+
* valid and only their key is stale. Correctness never depends on this:
|
|
65
|
+
* `findCalendarObject` verifies UIDs after every fetch and falls back to a
|
|
66
|
+
* scan. Without it, though, a rename would silently discard the cache that
|
|
67
|
+
* exists to avoid full-calendar scans.
|
|
68
|
+
*
|
|
69
|
+
* Entries already under `newId` (a name reused after an earlier rename) are
|
|
70
|
+
* kept — they were written against the same URLs the new name now resolves to.
|
|
71
|
+
*/
|
|
72
|
+
export function moveCachedCalendar(oldCalendarId, newCalendarId) {
|
|
73
|
+
if (oldCalendarId === newCalendarId)
|
|
74
|
+
return;
|
|
75
|
+
const cache = readCache();
|
|
76
|
+
const moving = cache[oldCalendarId];
|
|
77
|
+
if (!moving)
|
|
78
|
+
return;
|
|
79
|
+
cache[newCalendarId] = { ...moving, ...(cache[newCalendarId] ?? {}) };
|
|
80
|
+
delete cache[oldCalendarId];
|
|
81
|
+
writeCache(cache);
|
|
82
|
+
}
|
|
83
|
+
/** Drops every cached entry for a calendar — used when the collection is deleted. */
|
|
84
|
+
export function purgeCachedCalendar(calendarId) {
|
|
85
|
+
const cache = readCache();
|
|
86
|
+
if (!cache[calendarId])
|
|
87
|
+
return;
|
|
88
|
+
delete cache[calendarId];
|
|
89
|
+
writeCache(cache);
|
|
90
|
+
}
|
|
59
91
|
//# sourceMappingURL=urlCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlCache.js","sourceRoot":"","sources":["../../src/services/urlCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAS1C,4EAA4E;AAC5E,yEAAyE;AACzE,0EAA0E;AAC1E,wEAAwE;AACxE,2CAA2C;AAC3C,EAAE;AACF,0DAA0D;AAC1D,gFAAgF;AAChF,2EAA2E;AAC3E,qDAAqD;AAErD,SAAS,SAAS;IAChB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,OAAO,EAAE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AC,KAAK,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,aAAqB,EAAE,aAAqB;IAC7E,IAAI,aAAa,KAAK,aAAa;QAAE,OAAO;IAC5C,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;IACtE,OAAO,KAAK,CAAC,aAAa,CAAC,CAAC;IAC5B,UAAU,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;IAC1B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;QAAE,OAAO;IAC/B,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,UAAU,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar collection lifecycle: create, update metadata, delete.
|
|
3
|
+
*
|
|
4
|
+
* Events live in `calendarTools.ts`; this file is about the collections that
|
|
5
|
+
* hold them. `list_calendars` is deliberately not here — it already exists on
|
|
6
|
+
* the event side, and reads belong with the rest of the read surface.
|
|
7
|
+
*/
|
|
8
|
+
import { type ToolDef } from "@miguelarios/pim-core/mcp";
|
|
9
|
+
import type { CalDavService } from "../services/CalDavService.js";
|
|
10
|
+
export declare const CALENDAR_MANAGEMENT_TOOLS: ReadonlyArray<ToolDef<CalDavService>>;
|
|
11
|
+
//# sourceMappingURL=calendarManagementTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarManagementTools.d.ts","sourceRoot":"","sources":["../../src/tools/calendarManagementTools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,KAAK,OAAO,EAKb,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAwDlE,eAAO,MAAM,yBAAyB,EAAE,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CA6I3E,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar collection lifecycle: create, update metadata, delete.
|
|
3
|
+
*
|
|
4
|
+
* Events live in `calendarTools.ts`; this file is about the collections that
|
|
5
|
+
* hold them. `list_calendars` is deliberately not here — it already exists on
|
|
6
|
+
* the event side, and reads belong with the rest of the read surface.
|
|
7
|
+
*/
|
|
8
|
+
import { confirmDestructive, structured, toolError, } from "@miguelarios/pim-core/mcp";
|
|
9
|
+
import { calendarWriteResultSchema } from "./calendarSchemas.js";
|
|
10
|
+
/**
|
|
11
|
+
* Maps to this server's external error vocabulary, as `calendarTools` does —
|
|
12
|
+
* plus `validation_error`, which these tools actually raise: bad colours, empty
|
|
13
|
+
* names, unresolvable providers and empty updates are all caller-fixable, and
|
|
14
|
+
* reporting them as `backend_error` would send a caller looking at the server.
|
|
15
|
+
*/
|
|
16
|
+
function mapError(err) {
|
|
17
|
+
if (err && typeof err === "object" && "code" in err) {
|
|
18
|
+
const code = err.code;
|
|
19
|
+
if (code === "CALENDAR_NOT_FOUND")
|
|
20
|
+
return toolError(err, () => "not_found");
|
|
21
|
+
if (code === "VALIDATION_FAILED")
|
|
22
|
+
return toolError(err, () => "validation_error");
|
|
23
|
+
}
|
|
24
|
+
return toolError(err, () => "backend_error");
|
|
25
|
+
}
|
|
26
|
+
async function run(body) {
|
|
27
|
+
try {
|
|
28
|
+
return await body();
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return mapError(err);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The target is required on every one of these tools. Unlike the event tools'
|
|
36
|
+
* optional `calendar`, renaming or deleting "whichever calendar happened to
|
|
37
|
+
* sort first" is not a thing a caller can mean.
|
|
38
|
+
*/
|
|
39
|
+
const TARGET_CALENDAR_PROP = {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "Provider-prefixed calendar ID to act on (e.g. mailbox/Work).",
|
|
42
|
+
};
|
|
43
|
+
const COLOR_PROP = {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Calendar colour as #RRGGBB or #RRGGBBAA (e.g. #3B82F6).",
|
|
46
|
+
};
|
|
47
|
+
export const CALENDAR_MANAGEMENT_TOOLS = [
|
|
48
|
+
{
|
|
49
|
+
name: "create_calendar",
|
|
50
|
+
title: "Create Calendar",
|
|
51
|
+
description: "Create a new calendar on a CalDAV provider. The URL is derived from the display name unless an explicit slug is given. Fails if a calendar with that name already exists on the provider, since the name is half of every calendar ID.",
|
|
52
|
+
annotations: {
|
|
53
|
+
readOnlyHint: false,
|
|
54
|
+
destructiveHint: false,
|
|
55
|
+
idempotentHint: false,
|
|
56
|
+
openWorldHint: true,
|
|
57
|
+
},
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: "object",
|
|
60
|
+
properties: {
|
|
61
|
+
provider: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "Provider/account to create on — the prefix half of a calendar ID (e.g. 'mailbox' in mailbox/Work). Optional when only one account is configured; required otherwise. Call list_calendars to see the configured providers.",
|
|
64
|
+
},
|
|
65
|
+
display_name: { type: "string", description: "Display name for the new calendar" },
|
|
66
|
+
description: { type: "string", description: "Optional calendar description" },
|
|
67
|
+
color: COLOR_PROP,
|
|
68
|
+
slug: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "Optional URL path segment (lowercase letters, digits, hyphens). Derived from display_name when omitted.",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
required: ["display_name"],
|
|
74
|
+
},
|
|
75
|
+
outputSchema: calendarWriteResultSchema,
|
|
76
|
+
handler: (args, service) => run(async () => {
|
|
77
|
+
const created = await service.createCalendar({
|
|
78
|
+
provider: args.provider,
|
|
79
|
+
displayName: args.display_name,
|
|
80
|
+
description: args.description,
|
|
81
|
+
color: args.color,
|
|
82
|
+
slug: args.slug,
|
|
83
|
+
});
|
|
84
|
+
return structured({
|
|
85
|
+
status: "created",
|
|
86
|
+
calendar_id: created.calendar_id,
|
|
87
|
+
url: created.url,
|
|
88
|
+
display_name: created.display_name,
|
|
89
|
+
});
|
|
90
|
+
}),
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "update_calendar",
|
|
94
|
+
title: "Update Calendar",
|
|
95
|
+
description: "Update a calendar's display name, colour, and/or description. At least one must be given. Renaming changes the calendar's ID — the new ID is returned, and the old one stops resolving.",
|
|
96
|
+
annotations: {
|
|
97
|
+
readOnlyHint: false,
|
|
98
|
+
destructiveHint: false,
|
|
99
|
+
idempotentHint: true,
|
|
100
|
+
openWorldHint: true,
|
|
101
|
+
},
|
|
102
|
+
inputSchema: {
|
|
103
|
+
type: "object",
|
|
104
|
+
properties: {
|
|
105
|
+
calendar: TARGET_CALENDAR_PROP,
|
|
106
|
+
display_name: {
|
|
107
|
+
type: "string",
|
|
108
|
+
description: "New display name. Changes the calendar's ID.",
|
|
109
|
+
},
|
|
110
|
+
color: COLOR_PROP,
|
|
111
|
+
description: { type: "string", description: "New calendar description" },
|
|
112
|
+
},
|
|
113
|
+
required: ["calendar"],
|
|
114
|
+
},
|
|
115
|
+
outputSchema: calendarWriteResultSchema,
|
|
116
|
+
handler: (args, service) => run(async () => {
|
|
117
|
+
const updated = await service.updateCalendarMeta(args.calendar, {
|
|
118
|
+
displayName: args.display_name,
|
|
119
|
+
description: args.description,
|
|
120
|
+
color: args.color,
|
|
121
|
+
});
|
|
122
|
+
return structured({
|
|
123
|
+
status: "updated",
|
|
124
|
+
calendar_id: updated.calendar_id,
|
|
125
|
+
url: updated.url,
|
|
126
|
+
display_name: updated.display_name,
|
|
127
|
+
});
|
|
128
|
+
}),
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "delete_calendar",
|
|
132
|
+
title: "Delete Calendar",
|
|
133
|
+
description: "Delete a calendar and every event in it. This cannot be undone, and asks the user to confirm first. The event count in the confirmation is read when the prompt is built, so it describes the calendar at that moment rather than guaranteeing what the delete will remove.",
|
|
134
|
+
annotations: {
|
|
135
|
+
readOnlyHint: false,
|
|
136
|
+
destructiveHint: true,
|
|
137
|
+
idempotentHint: true,
|
|
138
|
+
openWorldHint: true,
|
|
139
|
+
},
|
|
140
|
+
inputSchema: {
|
|
141
|
+
type: "object",
|
|
142
|
+
properties: {
|
|
143
|
+
calendar: TARGET_CALENDAR_PROP,
|
|
144
|
+
},
|
|
145
|
+
required: ["calendar"],
|
|
146
|
+
},
|
|
147
|
+
outputSchema: calendarWriteResultSchema,
|
|
148
|
+
handler: async (args, service, ctx) => {
|
|
149
|
+
let entry;
|
|
150
|
+
let count;
|
|
151
|
+
try {
|
|
152
|
+
// Resolved and counted before the gate so the confirmation names what
|
|
153
|
+
// is actually being destroyed rather than echoing the caller's own
|
|
154
|
+
// string back at them. The confirmed retry re-enters here and repeats
|
|
155
|
+
// both — two cheap requests, accepted for a stateless handler.
|
|
156
|
+
entry = await service.findCalendarEntry(args.calendar);
|
|
157
|
+
count = await service.countCalendarObjects(args.calendar);
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
return mapError(err);
|
|
161
|
+
}
|
|
162
|
+
const eventsClause = count !== undefined ? `all ${count} events in it` : "every event in it";
|
|
163
|
+
const gate = confirmDestructive(ctx, "confirm_delete_calendar", `Permanently delete calendar "${entry.display_name}" on provider "${entry.provider}" (${entry.url}) and ${eventsClause}? This cannot be undone.`);
|
|
164
|
+
if (gate.status === "interrupt")
|
|
165
|
+
return gate.result;
|
|
166
|
+
return run(async () => {
|
|
167
|
+
const deleted = await service.deleteCalendar(args.calendar);
|
|
168
|
+
return structured({
|
|
169
|
+
status: "deleted",
|
|
170
|
+
calendar_id: deleted.calendar_id,
|
|
171
|
+
url: deleted.url,
|
|
172
|
+
display_name: deleted.display_name,
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
//# sourceMappingURL=calendarManagementTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarManagementTools.js","sourceRoot":"","sources":["../../src/tools/calendarManagementTools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAGL,kBAAkB,EAClB,UAAU,EACV,SAAS,GACV,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;;;;GAKG;AACH,SAAS,QAAQ,CAAC,GAAY;IAC5B,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;QACpD,MAAM,IAAI,GAAI,GAAyB,CAAC,IAAI,CAAC;QAC7C,IAAI,IAAI,KAAK,oBAAoB;YAAE,OAAO,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,IAAI,KAAK,mBAAmB;YAAE,OAAO,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,GAAG,CAAC,IAA+B;IAChD,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAC;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAA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D,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE;gBACpB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC5D,OAAO,UAAU,CAAC;oBAChB,MAAM,EAAE,SAAkB;oBAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;oBAChC,GAAG,EAAE,OAAO,CAAC,GAAG;oBAChB,YAAY,EAAE,OAAO,CAAC,YAAY;iBACnC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
/**
|
|
258
|
+
* Result of the three collection-management tools. `calendar_id` is always the
|
|
259
|
+
* post-operation ID, so a rename hands back the ID that resolves from now on
|
|
260
|
+
* rather than the one the caller passed in.
|
|
261
|
+
*/
|
|
262
|
+
export declare const calendarWriteResultSchema: v.ObjectSchema<{
|
|
263
|
+
readonly status: v.PicklistSchema<["created", "updated", "deleted"], undefined>;
|
|
264
|
+
readonly calendar_id: v.StringSchema<undefined>;
|
|
265
|
+
readonly url: v.StringSchema<undefined>;
|
|
266
|
+
readonly display_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
267
|
+
}, undefined>;
|
|
268
|
+
//# 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;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;aAKpC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
/**
|
|
86
|
+
* Result of the three collection-management tools. `calendar_id` is always the
|
|
87
|
+
* post-operation ID, so a rename hands back the ID that resolves from now on
|
|
88
|
+
* rather than the one the caller passed in.
|
|
89
|
+
*/
|
|
90
|
+
export const calendarWriteResultSchema = v.object({
|
|
91
|
+
status: v.picklist(["created", "updated", "deleted"]),
|
|
92
|
+
calendar_id: v.string(),
|
|
93
|
+
url: v.string(),
|
|
94
|
+
display_name: v.optional(v.string()),
|
|
95
|
+
});
|
|
96
|
+
//# 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,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,KAAK,EAAE,cAAc;IACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,cAAc;IACtB,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,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,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/E,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;CACvE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,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;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IACrD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACrC,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
|