@miguelarios/pim-core 0.7.0 → 0.9.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 +4 -0
- package/README.md +10 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -0
- package/dist/config.js.map +1 -1
- package/dist/dav.d.ts +50 -0
- package/dist/dav.d.ts.map +1 -0
- package/dist/dav.js +82 -0
- package/dist/dav.js.map +1 -0
- package/dist/ics/index.d.ts +1 -0
- package/dist/ics/index.d.ts.map +1 -1
- package/dist/ics/index.js +3 -0
- package/dist/ics/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +102 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +218 -0
- package/dist/mcp/index.js.map +1 -0
- package/package.json +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 (2026-08-28)
|
|
4
|
+
|
|
5
|
+
- `checkDavCollectionResponse` and `propstatStatusLines` (`dav.ts`) — shared judging of DAV collection-level responses (MKCALENDAR, extended MKCOL, PROPPATCH, DELETE). Extracted from card-mcp so both DAV servers distrust tsdav's response shapes the same way: `ok` is `!responseBody.error`, and a propstat-level PROPPATCH failure leaves the mapped `status` at the transport's 207, so a refused rename reads as success unless the raw propstat statuses are walked. Resource wording and the not-found error are supplied by the caller, so each server keeps its own vocabulary (issues #43, #44, #45).
|
|
6
|
+
|
|
3
7
|
## 0.7.0 (2026-07-10)
|
|
4
8
|
|
|
5
9
|
- RFC 6350 vCard value escaping/unescaping — commas, semicolons, backslashes, and newlines in `N`/`ADR`/`NOTE` fields are now correctly escaped on write and unescaped on read (PR #4, `fix/vcard-escaping`).
|
package/README.md
CHANGED
|
@@ -4,6 +4,16 @@ Shared config, validation, errors, and utilities for PIM agent MCP servers.
|
|
|
4
4
|
|
|
5
5
|
This is an internal library used by [@miguelarios/email-mcp](https://www.npmjs.com/package/@miguelarios/email-mcp), [@miguelarios/cal-mcp](https://www.npmjs.com/package/@miguelarios/cal-mcp), and [@miguelarios/card-mcp](https://www.npmjs.com/package/@miguelarios/card-mcp). You probably don't need to install this directly.
|
|
6
6
|
|
|
7
|
+
## Entry points
|
|
8
|
+
|
|
9
|
+
| Import | Contents |
|
|
10
|
+
|--------|----------|
|
|
11
|
+
| `@miguelarios/pim-core` | Config loading, `PimError` hierarchy and `ErrorCode`, vCard parse/build, timezone helpers |
|
|
12
|
+
| `@miguelarios/pim-core/ics` | iCalendar parsing, generation, and component mutation |
|
|
13
|
+
| `@miguelarios/pim-core/mcp` | MCP plumbing for revision 2026-07-28 — `ToolDef`, `registerTools`, `dispatchTool`, result helpers (`structured`, `fail`, `toolError`), and `confirmDestructive` |
|
|
14
|
+
|
|
15
|
+
Only the `/mcp` subpath pulls in `@modelcontextprotocol/server`; the other two are protocol-agnostic.
|
|
16
|
+
|
|
7
17
|
## License
|
|
8
18
|
|
|
9
19
|
MIT
|
package/dist/config.d.ts
CHANGED
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAiBD,wBAAgB,iBAAiB,IAAI,aAAa,CAwBjD;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3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C;IACF,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,OAAO,CAAC;KACjB,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAWD,wBAAgB,eAAe,IAAI,WAAW,CA+C7C"}
|
package/dist/config.js
CHANGED
|
@@ -106,6 +106,10 @@ export function loadEmailConfig() {
|
|
|
106
106
|
},
|
|
107
107
|
fromName: process.env.SMTP_FROM_NAME || undefined,
|
|
108
108
|
autoSent: process.env.SMTP_AUTO_SENT === "true",
|
|
109
|
+
allowedFrom: (process.env.SMTP_ALLOWED_FROM || "")
|
|
110
|
+
.split(",")
|
|
111
|
+
.map((value) => value.trim())
|
|
112
|
+
.filter(Boolean),
|
|
109
113
|
};
|
|
110
114
|
}
|
|
111
115
|
catch (error) {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQjD,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,WAAW,EAAE,CAAC,CAAC,IAAI,CACjB,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,EACnC,CAAC,CAAC,GAAG,CAAC,iCAAiC,CAAC,CACzC;IACD,YAAY,EAAE,CAAC,CAAC,IAAI,CAClB,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC,EACpC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,8BAA8B,CAAC,CAC/C;IACD,YAAY,EAAE,CAAC,CAAC,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AC,CAAC;YACH,MAAM,IAAI,kBAAkB,CAAC,6BAA6B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnF,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/dav.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Judging DAV collection-level responses (MKCALENDAR, extended MKCOL,
|
|
3
|
+
* PROPPATCH, DELETE) across the CardDAV and CalDAV servers.
|
|
4
|
+
*
|
|
5
|
+
* This module exists to distrust tsdav's response shapes, which lie in two
|
|
6
|
+
* different ways depending on which branch a request takes:
|
|
7
|
+
*
|
|
8
|
+
* - **Plain failures** (a 403/405/501 to a create, a PROPPATCH rejected
|
|
9
|
+
* outright) take the non-XML branch and carry the transport's real `status`.
|
|
10
|
+
* Judging on the numeric status works there.
|
|
11
|
+
* - **A `207 Multi-Status` is `davResponse.ok`**, so it takes the parsed
|
|
12
|
+
* branch, where the mapped `ok` is merely `!responseBody.error` — and when
|
|
13
|
+
* the failure lives only in `propstat/status` (the normal PROPPATCH failure
|
|
14
|
+
* shape, RFC 4918 §9.2) the mapped `status` falls back to the transport's
|
|
15
|
+
* **207**, which is 2xx. tsdav's propstat mapping keeps only the `prop`
|
|
16
|
+
* contents; each propstat's own status survives solely under `raw`.
|
|
17
|
+
*
|
|
18
|
+
* So "success = 2xx" alone cannot catch a refused rename. The rule applied
|
|
19
|
+
* here is to judge on the numeric status *and* walk the raw propstat statuses,
|
|
20
|
+
* treating an unreadable 207 as a failure to judge rather than a success.
|
|
21
|
+
*
|
|
22
|
+
* Nothing here imports tsdav — it inspects plain objects, so core keeps no DAV
|
|
23
|
+
* client dependency.
|
|
24
|
+
*/
|
|
25
|
+
import type { PimError } from "./errors.js";
|
|
26
|
+
/** The collection operation being judged. Used verbatim in error messages. */
|
|
27
|
+
export type DavCollectionAction = "create" | "rename" | "update" | "delete";
|
|
28
|
+
export interface DavCollectionCheckOptions {
|
|
29
|
+
/** Resource noun for messages, e.g. `"calendar"` or `"address book"`. */
|
|
30
|
+
resource: string;
|
|
31
|
+
/** Plural noun. Defaults to `resource + "s"`, which is right for both. */
|
|
32
|
+
resourcePlural?: string;
|
|
33
|
+
/** Builds the 404 error, so each server keeps its own NOT_FOUND code. */
|
|
34
|
+
notFound: (url: string) => PimError;
|
|
35
|
+
/** Builds every other error. */
|
|
36
|
+
failed: (message: string) => PimError;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Collects the propstat-level status lines from a raw tsdav multistatus, in
|
|
40
|
+
* which keys arrive camelCased with namespace prefixes stripped.
|
|
41
|
+
*/
|
|
42
|
+
export declare function propstatStatusLines(raw: unknown): string[];
|
|
43
|
+
/**
|
|
44
|
+
* Throws unless `response` shows the collection operation actually succeeded.
|
|
45
|
+
*
|
|
46
|
+
* Never trusts tsdav's `ok`, and for PROPPATCH not the mapped `status` alone
|
|
47
|
+
* either — see the module comment.
|
|
48
|
+
*/
|
|
49
|
+
export declare function checkDavCollectionResponse(response: unknown, action: DavCollectionAction, url: string, opts: DavCollectionCheckOptions): void;
|
|
50
|
+
//# sourceMappingURL=dav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dav.d.ts","sourceRoot":"","sources":["../src/dav.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5E,MAAM,WAAW,yBAAyB;IACxC,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,QAAQ,CAAC;IACpC,gCAAgC;IAChC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,CAiB1D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,yBAAyB,GAC9B,IAAI,CA0DN"}
|
package/dist/dav.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collects the propstat-level status lines from a raw tsdav multistatus, in
|
|
3
|
+
* which keys arrive camelCased with namespace prefixes stripped.
|
|
4
|
+
*/
|
|
5
|
+
export function propstatStatusLines(raw) {
|
|
6
|
+
const multistatus = raw
|
|
7
|
+
?.multistatus;
|
|
8
|
+
if (!multistatus)
|
|
9
|
+
return [];
|
|
10
|
+
const responses = Array.isArray(multistatus.response)
|
|
11
|
+
? multistatus.response
|
|
12
|
+
: [multistatus.response];
|
|
13
|
+
const lines = [];
|
|
14
|
+
for (const entry of responses) {
|
|
15
|
+
const propstat = entry?.propstat;
|
|
16
|
+
if (!propstat)
|
|
17
|
+
continue;
|
|
18
|
+
for (const ps of Array.isArray(propstat) ? propstat : [propstat]) {
|
|
19
|
+
const status = ps?.status;
|
|
20
|
+
if (typeof status === "string")
|
|
21
|
+
lines.push(status);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return lines;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Throws unless `response` shows the collection operation actually succeeded.
|
|
28
|
+
*
|
|
29
|
+
* Never trusts tsdav's `ok`, and for PROPPATCH not the mapped `status` alone
|
|
30
|
+
* either — see the module comment.
|
|
31
|
+
*/
|
|
32
|
+
export function checkDavCollectionResponse(response, action, url, opts) {
|
|
33
|
+
const { resource, notFound, failed } = opts;
|
|
34
|
+
const resourcePlural = opts.resourcePlural ?? `${resource}s`;
|
|
35
|
+
const res = response;
|
|
36
|
+
const statuses = [];
|
|
37
|
+
if (res && typeof res.status === "number") {
|
|
38
|
+
statuses.push({ status: res.status, statusText: res.statusText ?? "" });
|
|
39
|
+
}
|
|
40
|
+
for (const line of propstatStatusLines(res?.raw)) {
|
|
41
|
+
const match = /\b(\d{3})\b\s*(.*)$/.exec(line);
|
|
42
|
+
if (match)
|
|
43
|
+
statuses.push({ status: Number(match[1]), statusText: match[2] ?? "" });
|
|
44
|
+
}
|
|
45
|
+
// This helper exists to distrust tsdav's response shapes, so a response
|
|
46
|
+
// carrying no status at all is a failure to judge, not a success.
|
|
47
|
+
if (statuses.length === 0) {
|
|
48
|
+
throw failed(`The server returned no usable status for the ${action} of ${url}`);
|
|
49
|
+
}
|
|
50
|
+
// A 207 is not itself a verdict — it is a wrapper saying "the answer is
|
|
51
|
+
// inside". If the propstat statuses did not parse, the only status left is
|
|
52
|
+
// that wrapper, and treating a 2xx envelope as success is exactly the
|
|
53
|
+
// failure this walk exists to prevent. Not being able to look inside is a
|
|
54
|
+
// reason to refuse, not to assume.
|
|
55
|
+
if (res?.status === 207 && statuses.every((s) => s.status === 207)) {
|
|
56
|
+
throw failed(`The server returned a 207 for the ${action} of ${url} with no readable per-property status — cannot confirm it succeeded`);
|
|
57
|
+
}
|
|
58
|
+
for (const { status, statusText } of statuses) {
|
|
59
|
+
if (status >= 200 && status <= 299)
|
|
60
|
+
continue;
|
|
61
|
+
if (action === "create" && status === 404) {
|
|
62
|
+
// RFC 5689 §3: a 404 here is about a missing parent collection, not
|
|
63
|
+
// about the resource being created — saying "not found" would name the
|
|
64
|
+
// wrong thing.
|
|
65
|
+
throw failed(`Cannot create ${url}: the parent collection does not exist`);
|
|
66
|
+
}
|
|
67
|
+
if (status === 404) {
|
|
68
|
+
throw notFound(url);
|
|
69
|
+
}
|
|
70
|
+
if (action === "create" && status === 405) {
|
|
71
|
+
throw failed(`A collection already exists at ${url}`);
|
|
72
|
+
}
|
|
73
|
+
if (action === "create" && (status === 403 || status === 501)) {
|
|
74
|
+
throw failed(`The provider does not allow creating ${resourcePlural} here (HTTP ${status})`);
|
|
75
|
+
}
|
|
76
|
+
if (status === 403) {
|
|
77
|
+
throw failed(`The server refused to ${action} ${url} — the ${resource} may be read-only (HTTP 403)`);
|
|
78
|
+
}
|
|
79
|
+
throw failed(`Failed to ${action} ${resource} ${url}: HTTP ${status} ${statusText}`.trim());
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=dav.js.map
|
package/dist/dav.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dav.js","sourceRoot":"","sources":["../src/dav.ts"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,MAAM,WAAW,GAAI,GAAmE;QACtF,EAAE,WAAW,CAAC;IAChB,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAC5B,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC;QACnD,CAAC,CAAC,WAAW,CAAC,QAAQ;QACtB,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC3B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;QAC9B,MAAM,QAAQ,GAAI,KAAmD,EAAE,QAAQ,CAAC;QAChF,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjE,MAAM,MAAM,GAAI,EAA8C,EAAE,MAAM,CAAC;YACvE,IAAI,OAAO,MAAM,KAAK,QAAQ;gBAAE,KAAK,CAA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
|
package/dist/ics/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { parseIcsEvents } from "./parse-events.js";
|
|
|
6
6
|
export { parseIcsTodos } from "./parse-todos.js";
|
|
7
7
|
export { parseIcsJournals } from "./parse-journals.js";
|
|
8
8
|
export { generateEventIcs, toIcalTime } from "./generate.js";
|
|
9
|
+
export { formatTriggerHuman } from "./_shared.js";
|
|
9
10
|
export { createExceptionComponent, combineIcsComponents, addExdateToIcs, removeExceptionFromIcs, updateMasterEventIcs, splitIcsByUid, } from "./components.js";
|
|
10
11
|
export type { ExceptionOverrides, MasterEventUpdates } from "./components.js";
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ics/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ics/index.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC9D,YAAY,EACV,WAAW,EACX,cAAc,EACd,eAAe,EACf,SAAS,EACT,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ics/index.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC9D,YAAY,EACV,WAAW,EACX,cAAc,EACd,eAAe,EACf,SAAS,EACT,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/ics/index.js
CHANGED
|
@@ -8,5 +8,8 @@ export { parseIcsEvents } from "./parse-events.js";
|
|
|
8
8
|
export { parseIcsTodos } from "./parse-todos.js";
|
|
9
9
|
export { parseIcsJournals } from "./parse-journals.js";
|
|
10
10
|
export { generateEventIcs, toIcalTime } from "./generate.js";
|
|
11
|
+
// Exported so callers that build an event response by hand (rather than by
|
|
12
|
+
// re-reading it) can render `trigger_human` exactly as the parser would.
|
|
13
|
+
export { formatTriggerHuman } from "./_shared.js";
|
|
11
14
|
export { createExceptionComponent, combineIcsComponents, addExdateToIcs, removeExceptionFromIcs, updateMasterEventIcs, splitIcsByUid, } from "./components.js";
|
|
12
15
|
//# sourceMappingURL=index.js.map
|
package/dist/ics/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ics/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,iFAAiF;AACjF,8CAA8C;AAC9C,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAY9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,GACd,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ics/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,iFAAiF;AACjF,8CAA8C;AAC9C,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAY9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,2EAA2E;AAC3E,yEAAyE;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,GACd,MAAM,iBAAiB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { type CalDavAccount, type CalDavConfig, loadCalDavConfig, type CardDavConfig, loadCardDavConfig, type EmailConfig, loadEmailConfig, } from "./config.js";
|
|
2
2
|
export { AuthenticationError, CalendarError, ConfigurationError, ConnectionError, ContactError, EmailError, ErrorCode, PimError, ValidationError, isRetryableError, toPimError, } from "./errors.js";
|
|
3
|
+
export { type DavCollectionAction, type DavCollectionCheckOptions, checkDavCollectionResponse, propstatStatusLines, } from "./dav.js";
|
|
3
4
|
export { type Contact, type TypedValue, type PostalAddress, type SocialProfile, buildVCard, parseVCard, escapeVCardValue, unescapeVCardValue, splitUnescaped, } from "./vcard.js";
|
|
4
5
|
export { getTimezone, formatInTimezone, parseTimestamp, type ParsedTimestamp, getLocalDateParts, zonedTimeToUtc, } from "./timezone.js";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,gBAAgB,EAChB,KAAK,aAAa,EAClB,iBAAiB,EACjB,KAAK,WAAW,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,KAAK,eAAe,EACpB,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,gBAAgB,EAChB,KAAK,aAAa,EAClB,iBAAiB,EACjB,KAAK,WAAW,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,KAAK,eAAe,EACpB,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { loadCalDavConfig, loadCardDavConfig, loadEmailConfig, } from "./config.js";
|
|
2
2
|
export { AuthenticationError, CalendarError, ConfigurationError, ConnectionError, ContactError, EmailError, ErrorCode, PimError, ValidationError, isRetryableError, toPimError, } from "./errors.js";
|
|
3
|
+
export { checkDavCollectionResponse, propstatStatusLines, } from "./dav.js";
|
|
3
4
|
export { buildVCard, parseVCard, escapeVCardValue, unescapeVCardValue, splitUnescaped, } from "./vcard.js";
|
|
4
5
|
export { getTimezone, formatInTimezone, parseTimestamp, getLocalDateParts, zonedTimeToUtc, } from "./timezone.js";
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAEhB,iBAAiB,EAEjB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,OAAO,EAKL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EAEd,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAEhB,iBAAiB,EAEjB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,OAAO,EAGL,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAElB,OAAO,EAKL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EAEd,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { type CallToolResult, type InputRequiredResult, type JsonSchemaType, type McpServer, type ServerContext, type ToolAnnotations } from "@modelcontextprotocol/server";
|
|
2
|
+
import type { GenericSchema } from "valibot";
|
|
3
|
+
import { type PimError } from "../errors.js";
|
|
4
|
+
/** Result a tool handler may return: a finished call, or a request for more input. */
|
|
5
|
+
export type ToolResult = CallToolResult | InputRequiredResult;
|
|
6
|
+
export type { CallToolResult, InputRequiredResult, ServerContext, ToolAnnotations };
|
|
7
|
+
/**
|
|
8
|
+
* A declarative tool definition.
|
|
9
|
+
*
|
|
10
|
+
* Tools stay an inspectable array rather than a pile of `registerTool` calls so
|
|
11
|
+
* they can be asserted over in tests and registered in one place.
|
|
12
|
+
*/
|
|
13
|
+
export interface ToolDef<Service, Args = any> {
|
|
14
|
+
/** Wire name. Must match the spec's `[A-Za-z0-9_.-]`, 1-128 character rule. */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Human-readable display name shown by clients. */
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
/**
|
|
20
|
+
* Behaviour hints. Clients use these to decide what to put in front of the
|
|
21
|
+
* user — a host may auto-approve a read-only tool and confirm a destructive
|
|
22
|
+
* one. All four hints are required here so none is forgotten.
|
|
23
|
+
*/
|
|
24
|
+
annotations: Required<Pick<ToolAnnotations, "readOnlyHint" | "destructiveHint" | "idempotentHint" | "openWorldHint">>;
|
|
25
|
+
/** Raw JSON Schema for the arguments. Validated before the handler runs. */
|
|
26
|
+
inputSchema: JsonSchemaType;
|
|
27
|
+
/** Valibot schema describing `structuredContent`. Validated before the result leaves the server. */
|
|
28
|
+
outputSchema?: GenericSchema;
|
|
29
|
+
handler: (args: Args, service: Service, ctx: ServerContext) => Promise<ToolResult>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Registers every tool against an {@link McpServer}. The SDK derives argument
|
|
33
|
+
* validation from `inputSchema` and validates `structuredContent` against
|
|
34
|
+
* `outputSchema`, so handlers receive checked arguments and cannot emit a
|
|
35
|
+
* result that contradicts its advertised schema.
|
|
36
|
+
*/
|
|
37
|
+
export declare function registerTools<Service>(server: McpServer, defs: ReadonlyArray<ToolDef<Service>>, service: Service): void;
|
|
38
|
+
/**
|
|
39
|
+
* Invokes one tool's handler by name, bypassing the MCP transport.
|
|
40
|
+
*
|
|
41
|
+
* Useful for testing handlers in isolation and for embedding the tools without
|
|
42
|
+
* a protocol layer. Argument validation lives in the SDK's `tools/call` path,
|
|
43
|
+
* so callers of this function are responsible for passing well-formed `args`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function dispatchTool<Service>(defs: ReadonlyArray<ToolDef<Service>>, name: string, args: Record<string, unknown>, service: Service, ctx?: ServerContext): Promise<ToolResult>;
|
|
46
|
+
/** A successful result carrying only human-readable text. */
|
|
47
|
+
export declare function ok(text: string): CallToolResult;
|
|
48
|
+
/**
|
|
49
|
+
* A successful result carrying machine-readable data.
|
|
50
|
+
*
|
|
51
|
+
* The spec requires a tool returning structured content to also return the
|
|
52
|
+
* serialized JSON in a text block, for clients that do not read
|
|
53
|
+
* `structuredContent`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function structured<T>(payload: T): CallToolResult;
|
|
56
|
+
/** A tool execution error the model can read and self-correct from. */
|
|
57
|
+
export declare function fail(code: string, message: string, retryable?: boolean): CallToolResult;
|
|
58
|
+
/**
|
|
59
|
+
* Converts a thrown error into a tool execution error.
|
|
60
|
+
*
|
|
61
|
+
* Unlike the previous per-package handling, the {@link PimError} code survives
|
|
62
|
+
* to the client instead of being flattened into a bare string. `mapCode` lets a
|
|
63
|
+
* server keep its own external code vocabulary.
|
|
64
|
+
*/
|
|
65
|
+
export declare function toolError(err: unknown, mapCode?: (error: PimError) => string): CallToolResult;
|
|
66
|
+
/** The outcome of a {@link confirmDestructive} gate. */
|
|
67
|
+
export type ConfirmOutcome = {
|
|
68
|
+
status: "proceed";
|
|
69
|
+
}
|
|
70
|
+
/** Return `result` from the handler unchanged. */
|
|
71
|
+
| {
|
|
72
|
+
status: "interrupt";
|
|
73
|
+
result: ToolResult;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Gates an irreversible operation behind user confirmation, using the
|
|
77
|
+
* 2026-07-28 multi round-trip request pattern: the first call returns
|
|
78
|
+
* `resultType: "input_required"` with an elicitation, and the client retries
|
|
79
|
+
* with the answer.
|
|
80
|
+
*
|
|
81
|
+
* Works on 2025-era connections too — the SDK's legacy shim turns the
|
|
82
|
+
* `input_required` return into a real server-to-client `elicitation/create`
|
|
83
|
+
* and re-enters the handler, so this needs no era branching.
|
|
84
|
+
*
|
|
85
|
+
* A client that never declared the `elicitation` capability cannot answer, so
|
|
86
|
+
* it is failed with `CONFIRMATION_UNSUPPORTED` rather than handed a question
|
|
87
|
+
* that goes nowhere. Capabilities we cannot read at all are gated as usual —
|
|
88
|
+
* unknown is not the same as unsupported, and the safe reading is to ask.
|
|
89
|
+
*
|
|
90
|
+
* Set `PIM_MCP_CONFIRM=off` to skip confirmation entirely (headless use).
|
|
91
|
+
*/
|
|
92
|
+
export declare function confirmDestructive(ctx: ServerContext, key: string, message: string): ConfirmOutcome;
|
|
93
|
+
/**
|
|
94
|
+
* Cache hints for `tools/list`. Our tool lists are static and identical for
|
|
95
|
+
* every caller, so they are safe for shared caches. Only ever emitted on
|
|
96
|
+
* 2026-07-28 connections; 2025-era responses are unaffected.
|
|
97
|
+
*/
|
|
98
|
+
export declare const TOOL_LIST_CACHE_HINT: {
|
|
99
|
+
readonly ttlMs: 3600000;
|
|
100
|
+
readonly cacheScope: "public";
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,eAAe,EAIrB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA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7D,wBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,cAAc,CAKxD;AAED,uEAAuE;AACvE,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,cAAc,CAKrF;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,MAAM,GAAG,cAAc,CAG7F;AAsED,wDAAwD;AACxD,MAAM,MAAM,cAAc,GACtB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE;AACvB,kDAAkD;GAChD;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,aAAa,EAClB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,cAAc,CA2DhB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;CAAsD,CAAC"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { fromJsonSchema, inputRequired, inputResponse, } from "@modelcontextprotocol/server";
|
|
2
|
+
/**
|
|
3
|
+
* Shared MCP plumbing for the PIM servers, built on the 2026-07-28 protocol
|
|
4
|
+
* revision. Kept behind the `@miguelarios/pim-core/mcp` subpath so consumers of
|
|
5
|
+
* the main entry point do not pull in the MCP SDK.
|
|
6
|
+
*/
|
|
7
|
+
import { toStandardJsonSchema } from "@valibot/to-json-schema";
|
|
8
|
+
import { toPimError } from "../errors.js";
|
|
9
|
+
/**
|
|
10
|
+
* Registers every tool against an {@link McpServer}. The SDK derives argument
|
|
11
|
+
* validation from `inputSchema` and validates `structuredContent` against
|
|
12
|
+
* `outputSchema`, so handlers receive checked arguments and cannot emit a
|
|
13
|
+
* result that contradicts its advertised schema.
|
|
14
|
+
*/
|
|
15
|
+
export function registerTools(server, defs, service) {
|
|
16
|
+
for (const def of defs) {
|
|
17
|
+
server.registerTool(def.name, {
|
|
18
|
+
title: def.title,
|
|
19
|
+
description: def.description,
|
|
20
|
+
annotations: def.annotations,
|
|
21
|
+
inputSchema: fromJsonSchema(def.inputSchema),
|
|
22
|
+
...(def.outputSchema ? { outputSchema: toStandardJsonSchema(def.outputSchema) } : {}),
|
|
23
|
+
},
|
|
24
|
+
// the SDK infers handler args from the
|
|
25
|
+
// schema generic; the per-tool `Args` type is asserted by each tool module instead.
|
|
26
|
+
(args, ctx) => def.handler(args, service, withClientCapabilities(server, ctx)));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** A handler context carrying no multi round-trip input responses. */
|
|
30
|
+
const EMPTY_CTX = { mcpReq: { inputResponses: undefined } };
|
|
31
|
+
/**
|
|
32
|
+
* Invokes one tool's handler by name, bypassing the MCP transport.
|
|
33
|
+
*
|
|
34
|
+
* Useful for testing handlers in isolation and for embedding the tools without
|
|
35
|
+
* a protocol layer. Argument validation lives in the SDK's `tools/call` path,
|
|
36
|
+
* so callers of this function are responsible for passing well-formed `args`.
|
|
37
|
+
*/
|
|
38
|
+
export function dispatchTool(defs, name, args, service, ctx = EMPTY_CTX) {
|
|
39
|
+
const tool = defs.find((def) => def.name === name);
|
|
40
|
+
if (!tool) {
|
|
41
|
+
return Promise.resolve(fail("UNKNOWN_TOOL", `Unknown tool: ${name}`));
|
|
42
|
+
}
|
|
43
|
+
return tool.handler(args, service, ctx);
|
|
44
|
+
}
|
|
45
|
+
/** A successful result carrying only human-readable text. */
|
|
46
|
+
export function ok(text) {
|
|
47
|
+
return { content: [{ type: "text", text }] };
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A successful result carrying machine-readable data.
|
|
51
|
+
*
|
|
52
|
+
* The spec requires a tool returning structured content to also return the
|
|
53
|
+
* serialized JSON in a text block, for clients that do not read
|
|
54
|
+
* `structuredContent`.
|
|
55
|
+
*/
|
|
56
|
+
export function structured(payload) {
|
|
57
|
+
return {
|
|
58
|
+
content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
|
|
59
|
+
structuredContent: payload,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** A tool execution error the model can read and self-correct from. */
|
|
63
|
+
export function fail(code, message, retryable = false) {
|
|
64
|
+
return {
|
|
65
|
+
content: [{ type: "text", text: JSON.stringify({ error: code, message, retryable }) }],
|
|
66
|
+
isError: true,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Converts a thrown error into a tool execution error.
|
|
71
|
+
*
|
|
72
|
+
* Unlike the previous per-package handling, the {@link PimError} code survives
|
|
73
|
+
* to the client instead of being flattened into a bare string. `mapCode` lets a
|
|
74
|
+
* server keep its own external code vocabulary.
|
|
75
|
+
*/
|
|
76
|
+
export function toolError(err, mapCode) {
|
|
77
|
+
const pimError = toPimError(err instanceof Error ? err : new Error(String(err)));
|
|
78
|
+
return fail(mapCode ? mapCode(pimError) : pimError.code, pimError.message, pimError.isRetryable);
|
|
79
|
+
}
|
|
80
|
+
/** The `_meta` envelope key carrying the client's declared capabilities (2026-07-28). */
|
|
81
|
+
const CLIENT_CAPABILITIES_KEY = "io.modelcontextprotocol/clientCapabilities";
|
|
82
|
+
/** Where {@link withClientCapabilities} parks the 2025-era capabilities on a context. */
|
|
83
|
+
const CAPABILITIES = Symbol("pim.clientCapabilities");
|
|
84
|
+
/**
|
|
85
|
+
* Records the client's declared capabilities on a 2025-era context.
|
|
86
|
+
*
|
|
87
|
+
* On that era capabilities are negotiated once, at `initialize`, and never
|
|
88
|
+
* reach the per-request context — so the server's view of them is attached
|
|
89
|
+
* here for {@link clientCapabilities} to read back. 2026-07-28 requests carry
|
|
90
|
+
* their own copy in the `_meta` envelope and take precedence.
|
|
91
|
+
*
|
|
92
|
+
* Writing to the context is safe because the SDK builds a fresh one per
|
|
93
|
+
* request: two calls in flight at once were confirmed to receive distinct
|
|
94
|
+
* `ctx` and `ctx.mcpReq` objects on both eras, so this cannot race.
|
|
95
|
+
*
|
|
96
|
+
* The value is validated on the way in, for the same reason the envelope is:
|
|
97
|
+
* it comes from the SDK unchecked, and a non-object stored here would reach
|
|
98
|
+
* the gate as a capabilities map it could dereference.
|
|
99
|
+
*/
|
|
100
|
+
function withClientCapabilities(server, ctx) {
|
|
101
|
+
ctx[CAPABILITIES] = asObject(server.server.getClientCapabilities());
|
|
102
|
+
return ctx;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The client capabilities in force for this request, or `undefined` when they
|
|
106
|
+
* cannot be determined — as is the case for {@link dispatchTool}, which has no
|
|
107
|
+
* client at all.
|
|
108
|
+
*
|
|
109
|
+
* A client that declares nothing yields `{}`, which is a determination: it
|
|
110
|
+
* means the client supports no optional capability, not that we failed to look.
|
|
111
|
+
* A malformed value is not a determination, and falls through to `undefined`
|
|
112
|
+
* rather than being read as "declared, and empty".
|
|
113
|
+
*
|
|
114
|
+
* Both lookups read SDK surface that the published type declarations erase, so
|
|
115
|
+
* an SDK upgrade should re-check them — last verified against
|
|
116
|
+
* `@modelcontextprotocol/server` 2.0.0, where the 2026-07-28 era carries
|
|
117
|
+
* capabilities in the envelope and returns `undefined` from
|
|
118
|
+
* `getClientCapabilities()`, and the 2025 era does the reverse. A regression
|
|
119
|
+
* there degrades to `undefined`, which restores the previous always-ask
|
|
120
|
+
* behaviour rather than skipping a confirmation.
|
|
121
|
+
*/
|
|
122
|
+
function clientCapabilities(ctx) {
|
|
123
|
+
const { envelope } = ctx.mcpReq;
|
|
124
|
+
const declared = asObject(envelope?.[CLIENT_CAPABILITIES_KEY]);
|
|
125
|
+
if (declared)
|
|
126
|
+
return declared;
|
|
127
|
+
return ctx[CAPABILITIES];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* `value` as a plain object, or `undefined` when it is not one.
|
|
131
|
+
*
|
|
132
|
+
* The capabilities map and the `elicitation` capability inside it are both
|
|
133
|
+
* objects per the spec, so anything else — `null`, an array, a primitive — is
|
|
134
|
+
* malformed rather than something the client stated, and is read as silence.
|
|
135
|
+
*/
|
|
136
|
+
function asObject(value) {
|
|
137
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
138
|
+
return undefined;
|
|
139
|
+
return value;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Gates an irreversible operation behind user confirmation, using the
|
|
143
|
+
* 2026-07-28 multi round-trip request pattern: the first call returns
|
|
144
|
+
* `resultType: "input_required"` with an elicitation, and the client retries
|
|
145
|
+
* with the answer.
|
|
146
|
+
*
|
|
147
|
+
* Works on 2025-era connections too — the SDK's legacy shim turns the
|
|
148
|
+
* `input_required` return into a real server-to-client `elicitation/create`
|
|
149
|
+
* and re-enters the handler, so this needs no era branching.
|
|
150
|
+
*
|
|
151
|
+
* A client that never declared the `elicitation` capability cannot answer, so
|
|
152
|
+
* it is failed with `CONFIRMATION_UNSUPPORTED` rather than handed a question
|
|
153
|
+
* that goes nowhere. Capabilities we cannot read at all are gated as usual —
|
|
154
|
+
* unknown is not the same as unsupported, and the safe reading is to ask.
|
|
155
|
+
*
|
|
156
|
+
* Set `PIM_MCP_CONFIRM=off` to skip confirmation entirely (headless use).
|
|
157
|
+
*/
|
|
158
|
+
export function confirmDestructive(ctx, key, message) {
|
|
159
|
+
if (process.env.PIM_MCP_CONFIRM === "off")
|
|
160
|
+
return { status: "proceed" };
|
|
161
|
+
const view = inputResponse(ctx.mcpReq.inputResponses, key);
|
|
162
|
+
if (view.kind === "elicit") {
|
|
163
|
+
if (view.action === "accept" && view.content?.confirm === true) {
|
|
164
|
+
return { status: "proceed" };
|
|
165
|
+
}
|
|
166
|
+
// Declined, cancelled, or answered "no". Do NOT re-ask — re-issuing the
|
|
167
|
+
// elicitation here would loop until the client's round limit.
|
|
168
|
+
return {
|
|
169
|
+
status: "interrupt",
|
|
170
|
+
result: fail("CONFIRMATION_DECLINED", "Cancelled: the user did not confirm this operation."),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
const capabilities = clientCapabilities(ctx);
|
|
174
|
+
if (capabilities !== undefined && asObject(capabilities.elicitation) === undefined) {
|
|
175
|
+
// Asking would return an `input_required` the client can never answer, so
|
|
176
|
+
// the operation would simply be unusable. Fail with a way out instead.
|
|
177
|
+
//
|
|
178
|
+
// Note the deliberate asymmetry with `clientCapabilities`, which treats a
|
|
179
|
+
// malformed capabilities map as silence and asks: there, nothing legible
|
|
180
|
+
// was said at all. Here a legible map simply does not carry elicitation,
|
|
181
|
+
// which is a statement. Making the two symmetric would send the second
|
|
182
|
+
// case back to asking a client that cannot answer — the hang in #22.
|
|
183
|
+
return {
|
|
184
|
+
status: "interrupt",
|
|
185
|
+
result: fail("CONFIRMATION_UNSUPPORTED", "This operation is irreversible and requires confirmation, but the client did not " +
|
|
186
|
+
'declare the "elicitation" capability, so it cannot be asked. Set PIM_MCP_CONFIRM=off ' +
|
|
187
|
+
"to run irreversible operations without confirmation."),
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
status: "interrupt",
|
|
192
|
+
result: inputRequired({
|
|
193
|
+
inputRequests: {
|
|
194
|
+
[key]: inputRequired.elicit({
|
|
195
|
+
message,
|
|
196
|
+
requestedSchema: {
|
|
197
|
+
type: "object",
|
|
198
|
+
properties: {
|
|
199
|
+
confirm: {
|
|
200
|
+
type: "boolean",
|
|
201
|
+
title: "Confirm",
|
|
202
|
+
description: "Set to true to proceed with this irreversible operation.",
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
required: ["confirm"],
|
|
206
|
+
},
|
|
207
|
+
}),
|
|
208
|
+
},
|
|
209
|
+
}),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Cache hints for `tools/list`. Our tool lists are static and identical for
|
|
214
|
+
* every caller, so they are safe for shared caches. Only ever emitted on
|
|
215
|
+
* 2026-07-28 connections; 2025-era responses are unaffected.
|
|
216
|
+
*/
|
|
217
|
+
export const TOOL_LIST_CACHE_HINT = { ttlMs: 3_600_000, cacheScope: "public" };
|
|
218
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,cAAc,EACd,aAAa,EACb,aAAa,GACd,MAAM,8BAA8B,CAAC;AACtC;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAiB,UAAU,EAAE,MAAM,cAAc,CAAC;AAwCzD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAiB,EACjB,IAAqC,EACrC,OAAgB;IAEhB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,CAAC,YAAY,CACjB,GAAG,CAAC,IAAI,EACR;YACE,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,WAAW,EAAE,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC;YAC5C,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,oBAAoB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtF;QACD,uCAAuC;QACvC,oFAAoF;QACpF,CAAC,IAAS,EAAE,GAAkB,EAAE,EAAE,CAChC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAClE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,sEAAsE;AACtE,MAAM,SAAS,GAAG,EA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AG,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC;oBAC1B,OAAO;oBACP,eAAe,EAAE;wBACf,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,OAAO,EAAE;gCACP,IAAI,EAAE,SAAS;gCACf,KAAK,EAAE,SAAS;gCAChB,WAAW,EAAE,0DAA0D;6BACxE;yBACF;wBACD,QAAQ,EAAE,CAAC,SAAS,CAAC;qBACtB;iBACF,CAAC;aACH;SACF,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miguelarios/pim-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Shared config, validation, errors, and utilities for PIM agent MCP servers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pim",
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"./ics": {
|
|
29
29
|
"import": "./dist/ics/index.js",
|
|
30
30
|
"types": "./dist/ics/index.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./mcp": {
|
|
33
|
+
"import": "./dist/mcp/index.js",
|
|
34
|
+
"types": "./dist/mcp/index.d.ts"
|
|
31
35
|
}
|
|
32
36
|
},
|
|
33
37
|
"scripts": {
|
|
@@ -36,9 +40,11 @@
|
|
|
36
40
|
"test": "vitest run"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
43
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
39
44
|
"@touch4it/ical-timezones": "^1.9.0",
|
|
45
|
+
"@valibot/to-json-schema": "^1.7.1",
|
|
40
46
|
"ical.js": "^2.2.1",
|
|
41
|
-
"valibot": "^1.
|
|
47
|
+
"valibot": "^1.4.0"
|
|
42
48
|
},
|
|
43
49
|
"devDependencies": {
|
|
44
50
|
"typescript": "^5.7.0",
|