@miguelarios/pim-core 0.8.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/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/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 +5 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +84 -1
- package/dist/mcp/index.js.map +1 -1
- package/package.json +1 -1
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/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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AK,QAAQ,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1C,oEAAoE;YACpE,uEAAuE;YACvE,eAAe;YACf,MAAM,MAAM,CAAC,iBAAiB,GAAG,wCAAwC,CAAC,CAAC;QAC7E,CAAC;QACD,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YACnB,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;QACD,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1C,MAAM,MAAM,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC;YAC9D,MAAM,MAAM,CAAC,wCAAwC,cAAc,eAAe,MAAM,GAAG,CAAC,CAAC;QAC/F,CAAC;QACD,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YACnB,MAAM,MAAM,CACV,yBAAyB,MAAM,IAAI,GAAG,UAAU,QAAQ,8BAA8B,CACvF,CAAC;QACJ,CAAC;QACD,MAAM,MAAM,CAAC,aAAa,MAAM,IAAI,QAAQ,IAAI,GAAG,UAAU,MAAM,IAAI,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9F,CAAC;AACH,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"}
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -82,6 +82,11 @@ export type ConfirmOutcome = {
|
|
|
82
82
|
* `input_required` return into a real server-to-client `elicitation/create`
|
|
83
83
|
* and re-enters the handler, so this needs no era branching.
|
|
84
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
|
+
*
|
|
85
90
|
* Set `PIM_MCP_CONFIRM=off` to skip confirmation entirely (headless use).
|
|
86
91
|
*/
|
|
87
92
|
export declare function confirmDestructive(ctx: ServerContext, key: string, message: string): ConfirmOutcome;
|
package/dist/mcp/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,
|
|
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;AAC7C,OAAO,EAAE,KAAK,QAAQ,EAAc,MAAM,cAAc,CAAC;AAEzD,sFAAsF;AACtF,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,mBAAmB,CAAC;AAI9D,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAEpF;;;;;GAKG;AAKH,MAAM,WAAW,OAAO,CAAC,OAAO,EAAE,IAAI,GAAG,GAAG;IAC1C,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,EAAE,QAAQ,CACnB,IAAI,CAAC,eAAe,EAAE,cAAc,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,eAAe,CAAC,CAC/F,CAAC;IACF,4EAA4E;IAC5E,WAAW,EAAE,cAAc,CAAC;IAC5B,oGAAoG;IACpG,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE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E,MAAM,GACd,cAAc,CA2DhB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;CAAsD,CAAC"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -23,7 +23,7 @@ export function registerTools(server, defs, service) {
|
|
|
23
23
|
},
|
|
24
24
|
// the SDK infers handler args from the
|
|
25
25
|
// schema generic; the per-tool `Args` type is asserted by each tool module instead.
|
|
26
|
-
(args, ctx) => def.handler(args, service, ctx));
|
|
26
|
+
(args, ctx) => def.handler(args, service, withClientCapabilities(server, ctx)));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
/** A handler context carrying no multi round-trip input responses. */
|
|
@@ -77,6 +77,67 @@ export function toolError(err, mapCode) {
|
|
|
77
77
|
const pimError = toPimError(err instanceof Error ? err : new Error(String(err)));
|
|
78
78
|
return fail(mapCode ? mapCode(pimError) : pimError.code, pimError.message, pimError.isRetryable);
|
|
79
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
|
+
}
|
|
80
141
|
/**
|
|
81
142
|
* Gates an irreversible operation behind user confirmation, using the
|
|
82
143
|
* 2026-07-28 multi round-trip request pattern: the first call returns
|
|
@@ -87,6 +148,11 @@ export function toolError(err, mapCode) {
|
|
|
87
148
|
* `input_required` return into a real server-to-client `elicitation/create`
|
|
88
149
|
* and re-enters the handler, so this needs no era branching.
|
|
89
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
|
+
*
|
|
90
156
|
* Set `PIM_MCP_CONFIRM=off` to skip confirmation entirely (headless use).
|
|
91
157
|
*/
|
|
92
158
|
export function confirmDestructive(ctx, key, message) {
|
|
@@ -104,6 +170,23 @@ export function confirmDestructive(ctx, key, message) {
|
|
|
104
170
|
result: fail("CONFIRMATION_DECLINED", "Cancelled: the user did not confirm this operation."),
|
|
105
171
|
};
|
|
106
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
|
+
}
|
|
107
190
|
return {
|
|
108
191
|
status: "interrupt",
|
|
109
192
|
result: inputRequired({
|
package/dist/mcp/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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,E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