@jbctechsolutions/mcp-office365 3.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -65
- package/dist/approval/hash.d.ts +8 -8
- package/dist/approval/token-manager.d.ts +12 -6
- package/dist/approval/token-manager.d.ts.map +1 -1
- package/dist/approval/token-manager.js +11 -3
- package/dist/approval/token-manager.js.map +1 -1
- package/dist/approval/types.d.ts +7 -3
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +18 -3
- package/dist/cli.js.map +1 -1
- package/dist/database/repository.d.ts +48 -48
- package/dist/database/repository.d.ts.map +1 -1
- package/dist/database/repository.js.map +1 -1
- package/dist/delta/mirror.d.ts +67 -0
- package/dist/delta/mirror.d.ts.map +1 -0
- package/dist/delta/mirror.js +183 -0
- package/dist/delta/mirror.js.map +1 -0
- package/dist/graph/auth/account-id.d.ts +19 -0
- package/dist/graph/auth/account-id.d.ts.map +1 -0
- package/dist/graph/auth/account-id.js +55 -0
- package/dist/graph/auth/account-id.js.map +1 -0
- package/dist/graph/auth/config.d.ts +1 -1
- package/dist/graph/auth/config.d.ts.map +1 -1
- package/dist/graph/auth/config.js +8 -0
- package/dist/graph/auth/config.js.map +1 -1
- package/dist/graph/auth/index.d.ts +1 -0
- package/dist/graph/auth/index.d.ts.map +1 -1
- package/dist/graph/auth/index.js +1 -0
- package/dist/graph/auth/index.js.map +1 -1
- package/dist/graph/client/graph-client.d.ts +105 -0
- package/dist/graph/client/graph-client.d.ts.map +1 -1
- package/dist/graph/client/graph-client.js +414 -18
- package/dist/graph/client/graph-client.js.map +1 -1
- package/dist/graph/client/immutable-id-middleware.d.ts +50 -0
- package/dist/graph/client/immutable-id-middleware.d.ts.map +1 -0
- package/dist/graph/client/immutable-id-middleware.js +137 -0
- package/dist/graph/client/immutable-id-middleware.js.map +1 -0
- package/dist/graph/content-readers.d.ts +0 -12
- package/dist/graph/content-readers.d.ts.map +1 -1
- package/dist/graph/content-readers.js +0 -21
- package/dist/graph/content-readers.js.map +1 -1
- package/dist/graph/index.d.ts +5 -6
- package/dist/graph/index.d.ts.map +1 -1
- package/dist/graph/index.js +5 -6
- package/dist/graph/index.js.map +1 -1
- package/dist/graph/mailbox-adapter.d.ts +15 -15
- package/dist/graph/mappers/contact-mapper.d.ts +4 -1
- package/dist/graph/mappers/contact-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/contact-mapper.js +7 -3
- package/dist/graph/mappers/contact-mapper.js.map +1 -1
- package/dist/graph/mappers/email-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/email-mapper.js +7 -4
- package/dist/graph/mappers/email-mapper.js.map +1 -1
- package/dist/graph/mappers/event-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/event-mapper.js +6 -3
- package/dist/graph/mappers/event-mapper.js.map +1 -1
- package/dist/graph/mappers/folder-mapper.d.ts +0 -4
- package/dist/graph/mappers/folder-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/folder-mapper.js +9 -19
- package/dist/graph/mappers/folder-mapper.js.map +1 -1
- package/dist/graph/mappers/index.d.ts +2 -2
- package/dist/graph/mappers/index.d.ts.map +1 -1
- package/dist/graph/mappers/index.js +2 -2
- package/dist/graph/mappers/index.js.map +1 -1
- package/dist/graph/mappers/task-mapper.d.ts +4 -2
- package/dist/graph/mappers/task-mapper.d.ts.map +1 -1
- package/dist/graph/mappers/task-mapper.js +7 -5
- package/dist/graph/mappers/task-mapper.js.map +1 -1
- package/dist/graph/mappers/utils.d.ts +0 -10
- package/dist/graph/mappers/utils.d.ts.map +1 -1
- package/dist/graph/mappers/utils.js +0 -19
- package/dist/graph/mappers/utils.js.map +1 -1
- package/dist/graph/repository.d.ts +400 -270
- package/dist/graph/repository.d.ts.map +1 -1
- package/dist/graph/repository.js +739 -1046
- package/dist/graph/repository.js.map +1 -1
- package/dist/ids/next-action.d.ts +29 -0
- package/dist/ids/next-action.d.ts.map +1 -0
- package/dist/ids/next-action.js +58 -0
- package/dist/ids/next-action.js.map +1 -0
- package/dist/ids/resolver.d.ts +2 -1
- package/dist/ids/resolver.d.ts.map +1 -1
- package/dist/ids/resolver.js +19 -4
- package/dist/ids/resolver.js.map +1 -1
- package/dist/ids/schema.d.ts +91 -0
- package/dist/ids/schema.d.ts.map +1 -0
- package/dist/ids/schema.js +131 -0
- package/dist/ids/schema.js.map +1 -0
- package/dist/ids/token.d.ts +7 -1
- package/dist/ids/token.d.ts.map +1 -1
- package/dist/ids/token.js +46 -7
- package/dist/ids/token.js.map +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -100
- package/dist/index.js.map +1 -1
- package/dist/parsers/index.d.ts +0 -1
- package/dist/parsers/index.d.ts.map +1 -1
- package/dist/parsers/index.js +0 -1
- package/dist/parsers/index.js.map +1 -1
- package/dist/registry/all-tools.d.ts.map +1 -1
- package/dist/registry/all-tools.js +8 -4
- package/dist/registry/all-tools.js.map +1 -1
- package/dist/registry/context.d.ts +1 -7
- package/dist/registry/context.d.ts.map +1 -1
- package/dist/registry/context.js +0 -11
- package/dist/registry/context.js.map +1 -1
- package/dist/registry/elicit-links.d.ts +35 -0
- package/dist/registry/elicit-links.d.ts.map +1 -0
- package/dist/registry/elicit-links.js +102 -0
- package/dist/registry/elicit-links.js.map +1 -0
- package/dist/registry/elicitor.d.ts +24 -0
- package/dist/registry/elicitor.d.ts.map +1 -0
- package/dist/registry/elicitor.js +51 -0
- package/dist/registry/elicitor.js.map +1 -0
- package/dist/registry/index.d.ts +2 -2
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/registry.d.ts +11 -0
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +87 -0
- package/dist/registry/registry.js.map +1 -1
- package/dist/registry/types.d.ts +61 -13
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/state/delta-store.d.ts +85 -0
- package/dist/state/delta-store.d.ts.map +1 -0
- package/dist/state/delta-store.js +124 -0
- package/dist/state/delta-store.js.map +1 -0
- package/dist/state/schema.d.ts +2 -3
- package/dist/state/schema.d.ts.map +1 -1
- package/dist/state/schema.js +26 -3
- package/dist/state/schema.js.map +1 -1
- package/dist/state/store.d.ts +3 -0
- package/dist/state/store.d.ts.map +1 -1
- package/dist/state/store.js +4 -0
- package/dist/state/store.js.map +1 -1
- package/dist/tools/calendar-graph.d.ts.map +1 -1
- package/dist/tools/calendar-graph.js +10 -9
- package/dist/tools/calendar-graph.js.map +1 -1
- package/dist/tools/calendar-permissions.d.ts +7 -7
- package/dist/tools/calendar-permissions.d.ts.map +1 -1
- package/dist/tools/calendar-permissions.js +7 -4
- package/dist/tools/calendar-permissions.js.map +1 -1
- package/dist/tools/calendar.d.ts +14 -114
- package/dist/tools/calendar.d.ts.map +1 -1
- package/dist/tools/calendar.js +41 -202
- package/dist/tools/calendar.js.map +1 -1
- package/dist/tools/categories.d.ts +4 -4
- package/dist/tools/categories.d.ts.map +1 -1
- package/dist/tools/categories.js +5 -2
- package/dist/tools/categories.js.map +1 -1
- package/dist/tools/checklist-items.d.ts +9 -9
- package/dist/tools/checklist-items.d.ts.map +1 -1
- package/dist/tools/checklist-items.js +8 -5
- package/dist/tools/checklist-items.js.map +1 -1
- package/dist/tools/contact-folders.d.ts +2 -2
- package/dist/tools/contact-folders.d.ts.map +1 -1
- package/dist/tools/contact-folders.js +5 -2
- package/dist/tools/contact-folders.js.map +1 -1
- package/dist/tools/contacts-graph.d.ts +1 -1
- package/dist/tools/contacts-graph.d.ts.map +1 -1
- package/dist/tools/contacts-graph.js +8 -6
- package/dist/tools/contacts-graph.js.map +1 -1
- package/dist/tools/contacts.d.ts +9 -44
- package/dist/tools/contacts.d.ts.map +1 -1
- package/dist/tools/contacts.js +23 -131
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/excel.d.ts +10 -10
- package/dist/tools/excel.d.ts.map +1 -1
- package/dist/tools/excel.js +9 -6
- package/dist/tools/excel.js.map +1 -1
- package/dist/tools/focused-overrides.d.ts +4 -4
- package/dist/tools/focused-overrides.d.ts.map +1 -1
- package/dist/tools/focused-overrides.js +5 -2
- package/dist/tools/focused-overrides.js.map +1 -1
- package/dist/tools/index.d.ts +4 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -6
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/linked-resources.d.ts +7 -7
- package/dist/tools/linked-resources.d.ts.map +1 -1
- package/dist/tools/linked-resources.js +7 -4
- package/dist/tools/linked-resources.js.map +1 -1
- package/dist/tools/mail-graph.d.ts.map +1 -1
- package/dist/tools/mail-graph.js +21 -12
- package/dist/tools/mail-graph.js.map +1 -1
- package/dist/tools/mail-rules.d.ts +8 -8
- package/dist/tools/mail-rules.d.ts.map +1 -1
- package/dist/tools/mail-rules.js +7 -7
- package/dist/tools/mail-rules.js.map +1 -1
- package/dist/tools/mail-send.d.ts +27 -27
- package/dist/tools/mail-send.d.ts.map +1 -1
- package/dist/tools/mail-send.js +30 -19
- package/dist/tools/mail-send.js.map +1 -1
- package/dist/tools/mail.d.ts +22 -79
- package/dist/tools/mail.d.ts.map +1 -1
- package/dist/tools/mail.js +45 -293
- package/dist/tools/mail.js.map +1 -1
- package/dist/tools/mailbox-organization.d.ts +34 -37
- package/dist/tools/mailbox-organization.d.ts.map +1 -1
- package/dist/tools/mailbox-organization.js +72 -64
- package/dist/tools/mailbox-organization.js.map +1 -1
- package/dist/tools/meetings.d.ts +14 -14
- package/dist/tools/meetings.d.ts.map +1 -1
- package/dist/tools/meetings.js +8 -6
- package/dist/tools/meetings.js.map +1 -1
- package/dist/tools/onedrive.d.ts +16 -16
- package/dist/tools/onedrive.d.ts.map +1 -1
- package/dist/tools/onedrive.js +16 -11
- package/dist/tools/onedrive.js.map +1 -1
- package/dist/tools/onenote.d.ts +63 -0
- package/dist/tools/onenote.d.ts.map +1 -0
- package/dist/tools/onenote.js +221 -0
- package/dist/tools/onenote.js.map +1 -0
- package/dist/tools/planner-visualization.d.ts +5 -5
- package/dist/tools/planner-visualization.d.ts.map +1 -1
- package/dist/tools/planner-visualization.js +5 -4
- package/dist/tools/planner-visualization.js.map +1 -1
- package/dist/tools/planner.d.ts +59 -39
- package/dist/tools/planner.d.ts.map +1 -1
- package/dist/tools/planner.js +48 -23
- package/dist/tools/planner.js.map +1 -1
- package/dist/tools/shared-mailbox.d.ts +164 -0
- package/dist/tools/shared-mailbox.d.ts.map +1 -0
- package/dist/tools/shared-mailbox.js +318 -0
- package/dist/tools/shared-mailbox.js.map +1 -0
- package/dist/tools/sharepoint-lists.d.ts +131 -0
- package/dist/tools/sharepoint-lists.d.ts.map +1 -0
- package/dist/tools/sharepoint-lists.js +246 -0
- package/dist/tools/sharepoint-lists.js.map +1 -0
- package/dist/tools/sharepoint.d.ts +14 -14
- package/dist/tools/sharepoint.d.ts.map +1 -1
- package/dist/tools/sharepoint.js +11 -9
- package/dist/tools/sharepoint.js.map +1 -1
- package/dist/tools/task-attachments.d.ts +7 -7
- package/dist/tools/task-attachments.d.ts.map +1 -1
- package/dist/tools/task-attachments.js +7 -4
- package/dist/tools/task-attachments.js.map +1 -1
- package/dist/tools/task-lists.d.ts +3 -3
- package/dist/tools/task-lists.d.ts.map +1 -1
- package/dist/tools/task-lists.js +10 -6
- package/dist/tools/task-lists.js.map +1 -1
- package/dist/tools/tasks-graph.d.ts +2 -2
- package/dist/tools/tasks-graph.d.ts.map +1 -1
- package/dist/tools/tasks-graph.js +6 -4
- package/dist/tools/tasks-graph.js.map +1 -1
- package/dist/tools/tasks.d.ts +8 -43
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +19 -122
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/teams.d.ts +46 -46
- package/dist/tools/teams.d.ts.map +1 -1
- package/dist/tools/teams.js +34 -26
- package/dist/tools/teams.js.map +1 -1
- package/dist/tools/what-changed.d.ts +48 -0
- package/dist/tools/what-changed.d.ts.map +1 -0
- package/dist/tools/what-changed.js +149 -0
- package/dist/tools/what-changed.js.map +1 -0
- package/dist/types/calendar.d.ts +1 -1
- package/dist/types/calendar.d.ts.map +1 -1
- package/dist/types/calendar.js.map +1 -1
- package/dist/types/contacts.d.ts +1 -1
- package/dist/types/contacts.d.ts.map +1 -1
- package/dist/types/contacts.js.map +1 -1
- package/dist/types/mail.d.ts +1 -1
- package/dist/types/mail.d.ts.map +1 -1
- package/dist/types/mail.js.map +1 -1
- package/dist/utils/errors.d.ts +15 -34
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +13 -49
- package/dist/utils/errors.js.map +1 -1
- package/dist/visualization/types.d.ts +4 -4
- package/package.json +3 -4
- package/dist/applescript/account-repository.d.ts +0 -30
- package/dist/applescript/account-repository.d.ts.map +0 -1
- package/dist/applescript/account-repository.js +0 -38
- package/dist/applescript/account-repository.js.map +0 -1
- package/dist/applescript/account-scripts.d.ts +0 -21
- package/dist/applescript/account-scripts.d.ts.map +0 -1
- package/dist/applescript/account-scripts.js +0 -180
- package/dist/applescript/account-scripts.js.map +0 -1
- package/dist/applescript/calendar-manager.d.ts +0 -44
- package/dist/applescript/calendar-manager.d.ts.map +0 -1
- package/dist/applescript/calendar-manager.js +0 -92
- package/dist/applescript/calendar-manager.js.map +0 -1
- package/dist/applescript/calendar-writer.d.ts +0 -36
- package/dist/applescript/calendar-writer.d.ts.map +0 -1
- package/dist/applescript/calendar-writer.js +0 -94
- package/dist/applescript/calendar-writer.js.map +0 -1
- package/dist/applescript/content-readers.d.ts +0 -114
- package/dist/applescript/content-readers.d.ts.map +0 -1
- package/dist/applescript/content-readers.js +0 -328
- package/dist/applescript/content-readers.js.map +0 -1
- package/dist/applescript/executor.d.ts +0 -60
- package/dist/applescript/executor.d.ts.map +0 -1
- package/dist/applescript/executor.js +0 -173
- package/dist/applescript/executor.js.map +0 -1
- package/dist/applescript/index.d.ts +0 -20
- package/dist/applescript/index.d.ts.map +0 -1
- package/dist/applescript/index.js +0 -29
- package/dist/applescript/index.js.map +0 -1
- package/dist/applescript/mail-sender.d.ts +0 -38
- package/dist/applescript/mail-sender.d.ts.map +0 -1
- package/dist/applescript/mail-sender.js +0 -67
- package/dist/applescript/mail-sender.js.map +0 -1
- package/dist/applescript/parser.d.ts +0 -235
- package/dist/applescript/parser.d.ts.map +0 -1
- package/dist/applescript/parser.js +0 -496
- package/dist/applescript/parser.js.map +0 -1
- package/dist/applescript/repository.d.ts +0 -64
- package/dist/applescript/repository.d.ts.map +0 -1
- package/dist/applescript/repository.js +0 -444
- package/dist/applescript/repository.js.map +0 -1
- package/dist/applescript/scripts.d.ts +0 -265
- package/dist/applescript/scripts.d.ts.map +0 -1
- package/dist/applescript/scripts.js +0 -1483
- package/dist/applescript/scripts.js.map +0 -1
- package/dist/parsers/olk15.d.ts +0 -87
- package/dist/parsers/olk15.d.ts.map +0 -1
- package/dist/parsers/olk15.js +0 -368
- package/dist/parsers/olk15.js.map +0 -1
- package/dist/tools/accounts.d.ts +0 -37
- package/dist/tools/accounts.d.ts.map +0 -1
- package/dist/tools/accounts.js +0 -68
- package/dist/tools/accounts.js.map +0 -1
- package/dist/tools/calendar-apple.d.ts +0 -39
- package/dist/tools/calendar-apple.d.ts.map +0 -1
- package/dist/tools/calendar-apple.js +0 -159
- package/dist/tools/calendar-apple.js.map +0 -1
- package/dist/tools/mail-apple.d.ts +0 -40
- package/dist/tools/mail-apple.d.ts.map +0 -1
- package/dist/tools/mail-apple.js +0 -146
- package/dist/tools/mail-apple.js.map +0 -1
- package/dist/tools/notes.d.ts +0 -86
- package/dist/tools/notes.d.ts.map +0 -1
- package/dist/tools/notes.js +0 -202
- package/dist/tools/notes.js.map +0 -1
package/dist/ids/resolver.js
CHANGED
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
3
|
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
4
|
*/
|
|
5
|
-
import { IdForeignAccountError, IdUnknownError, NumericIdUnsupportedError, } from '../utils/errors.js';
|
|
5
|
+
import { IdForeignAccountError, IdUnknownError, IdEntityMismatchError, NumericIdUnsupportedError, } from '../utils/errors.js';
|
|
6
6
|
import { parseToken } from './token.js';
|
|
7
7
|
/**
|
|
8
8
|
* Resolves an ID parameter to a Graph ID for the given signed-in account.
|
|
9
9
|
* Throws a typed {@link import('../utils/errors.js').OutlookMcpError} on failure.
|
|
10
10
|
*/
|
|
11
|
-
export function resolveId(id, accountId, store) {
|
|
12
|
-
|
|
11
|
+
export function resolveId(id, accountId, store, expectedEntityType) {
|
|
12
|
+
// A bare all-digits string is a legacy v2 hash id (Graph ids and durable
|
|
13
|
+
// tokens are never purely numeric), so surface the same actionable
|
|
14
|
+
// NUMERIC_ID_UNSUPPORTED rather than passing it through to Graph as an opaque
|
|
15
|
+
// id that only 404s. Covers callers whose schema is string-only (U6).
|
|
16
|
+
if (/^\d+$/.test(id)) {
|
|
13
17
|
throw new NumericIdUnsupportedError(id);
|
|
14
18
|
}
|
|
15
19
|
const parsed = parseToken(id);
|
|
@@ -17,10 +21,21 @@ export function resolveId(id, accountId, store) {
|
|
|
17
21
|
// Not a known token — treat as an opaque Graph ID the caller supplied.
|
|
18
22
|
return { graphId: id, mutable: false };
|
|
19
23
|
}
|
|
24
|
+
// A durable token for the wrong entity kind (e.g. a folder token passed as a
|
|
25
|
+
// contact id) must not resolve — otherwise it decodes to a foreign Graph id
|
|
26
|
+
// and the safety rests only on Graph 404-ing the mismatched collection.
|
|
27
|
+
if (expectedEntityType != null && parsed.entityType !== expectedEntityType) {
|
|
28
|
+
throw new IdEntityMismatchError(id, expectedEntityType, parsed.entityType);
|
|
29
|
+
}
|
|
20
30
|
if (parsed.kind === 'self') {
|
|
21
|
-
// graphId is always present for a self-encoding parse.
|
|
31
|
+
// graphId is always present for a self-encoding parse. Self-encoding tokens
|
|
32
|
+
// decode with zero storage, so no store is required to resolve them.
|
|
22
33
|
return { graphId: parsed.graphId, mutable: false };
|
|
23
34
|
}
|
|
35
|
+
// Alias-backed tokens need the store. Without one they can't be resolved.
|
|
36
|
+
if (store == null) {
|
|
37
|
+
throw new IdUnknownError(id);
|
|
38
|
+
}
|
|
24
39
|
// Alias-backed: resolve against the store, scoped to the account.
|
|
25
40
|
const row = store.getAlias(id, accountId);
|
|
26
41
|
if (row !== null) {
|
package/dist/ids/resolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../src/ids/resolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../src/ids/resolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAmB,MAAM,YAAY,CAAC;AASzD;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,EAAU,EACV,SAAiB,EACjB,KAA6B,EAC7B,kBAA+B;IAE/B,yEAAyE;IACzE,mEAAmE;IACnE,8EAA8E;IAC9E,sEAAsE;IACtE,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,yBAAyB,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;IAC9B,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,uEAAuE;QACvE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACzC,CAA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6
|
+
* Canonical per-entity Zod id schemas (U6).
|
|
7
|
+
*
|
|
8
|
+
* Every tool that accepts a durable-ID param should reference the shared schema
|
|
9
|
+
* for its entity (`Id.task`, `Id.plan`, …) instead of an ad-hoc
|
|
10
|
+
* `z.string().min(1).describe(...)`. This gives one place to define:
|
|
11
|
+
*
|
|
12
|
+
* - **normalization** — `.trim()` so a copy/pasted id with stray whitespace
|
|
13
|
+
* still resolves; `.min(1)` so an empty/whitespace-only id fails fast.
|
|
14
|
+
* - **a consistent, prefix-named description** — derived from the token tables
|
|
15
|
+
* (`prefixForEntity`), so the param doc always names the token shape (e.g.
|
|
16
|
+
* "a `td_` token") and where to get it.
|
|
17
|
+
*
|
|
18
|
+
* Deliberately NOT here: classification of the id (numeric-vs-token, wrong
|
|
19
|
+
* entity, alias store lookup). That stays in {@link resolveId} at execution
|
|
20
|
+
* time, which is the single source of truth and emits the specific typed codes
|
|
21
|
+
* (`NUMERIC_ID_UNSUPPORTED`, `ID_ENTITY_MISMATCH`, `ID_UNKNOWN`) agents key on.
|
|
22
|
+
* The schema is string-only (a JSON-number legacy id is a type error); a numeric
|
|
23
|
+
* *string* still passes and reaches `resolveId` for the specific message.
|
|
24
|
+
*/
|
|
25
|
+
import { z } from 'zod';
|
|
26
|
+
import { type EntityType } from './token.js';
|
|
27
|
+
/** Human label + the tools that mint an entity's id, for the description. */
|
|
28
|
+
interface EntityMeta {
|
|
29
|
+
readonly label: string;
|
|
30
|
+
readonly from: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Per-entity description metadata. Only entities actually exposed as tool id
|
|
34
|
+
* params need an entry; others fall back to a generic description. Exported so a
|
|
35
|
+
* contract test can cross-check every `from` tool name against the registry,
|
|
36
|
+
* catching drift when a tool is renamed.
|
|
37
|
+
*/
|
|
38
|
+
export declare const ENTITY_META: Partial<Record<EntityType, EntityMeta>>;
|
|
39
|
+
/** Builds the canonical, prefix-named description for an entity id. */
|
|
40
|
+
export declare function describeId(entityType: EntityType): string;
|
|
41
|
+
/**
|
|
42
|
+
* The canonical required id schema for an entity: a trimmed, non-empty string
|
|
43
|
+
* with a prefix-named description. Classification stays in `resolveId`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function idSchema(entityType: EntityType): z.ZodString;
|
|
46
|
+
/** The canonical optional id schema for an entity. */
|
|
47
|
+
export declare function optionalIdSchema(entityType: EntityType): z.ZodOptional<z.ZodString>;
|
|
48
|
+
/**
|
|
49
|
+
* Canonical required id schemas keyed by entity. Tools reference these directly
|
|
50
|
+
* (`Id.task`, `Id.plan`, …). A per-call `.describe()` may override the default
|
|
51
|
+
* description where a param needs extra context.
|
|
52
|
+
*/
|
|
53
|
+
export declare const Id: {
|
|
54
|
+
readonly message: z.ZodString;
|
|
55
|
+
readonly event: z.ZodString;
|
|
56
|
+
readonly contact: z.ZodString;
|
|
57
|
+
readonly folder: z.ZodString;
|
|
58
|
+
readonly driveItem: z.ZodString;
|
|
59
|
+
readonly task: z.ZodString;
|
|
60
|
+
readonly taskList: z.ZodString;
|
|
61
|
+
readonly plan: z.ZodString;
|
|
62
|
+
readonly plannerBucket: z.ZodString;
|
|
63
|
+
readonly plannerTask: z.ZodString;
|
|
64
|
+
readonly attachment: z.ZodString;
|
|
65
|
+
readonly checklistItem: z.ZodString;
|
|
66
|
+
readonly linkedResource: z.ZodString;
|
|
67
|
+
readonly taskAttachment: z.ZodString;
|
|
68
|
+
readonly chat: z.ZodString;
|
|
69
|
+
readonly team: z.ZodString;
|
|
70
|
+
readonly channel: z.ZodString;
|
|
71
|
+
readonly chatMessage: z.ZodString;
|
|
72
|
+
readonly channelMessage: z.ZodString;
|
|
73
|
+
readonly contactFolder: z.ZodString;
|
|
74
|
+
readonly mailRule: z.ZodString;
|
|
75
|
+
readonly category: z.ZodString;
|
|
76
|
+
readonly focusedOverride: z.ZodString;
|
|
77
|
+
readonly calendarPermission: z.ZodString;
|
|
78
|
+
readonly onlineMeeting: z.ZodString;
|
|
79
|
+
readonly recording: z.ZodString;
|
|
80
|
+
readonly transcript: z.ZodString;
|
|
81
|
+
readonly site: z.ZodString;
|
|
82
|
+
readonly documentLibrary: z.ZodString;
|
|
83
|
+
readonly libraryDriveItem: z.ZodString;
|
|
84
|
+
readonly sharePointList: z.ZodString;
|
|
85
|
+
readonly sharePointListItem: z.ZodString;
|
|
86
|
+
readonly noteNotebook: z.ZodString;
|
|
87
|
+
readonly noteSection: z.ZodString;
|
|
88
|
+
readonly notePage: z.ZodString;
|
|
89
|
+
};
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/ids/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE9D,6EAA6E;AAC7E,UAAU,UAAU;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAoC/D,CAAC;AAEF,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAMzD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,CAAC,CAAC,SAAS,CAE5D;AAED,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAEnF;AAED;;;;GAIG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCiC,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Canonical per-entity Zod id schemas (U6).
|
|
7
|
+
*
|
|
8
|
+
* Every tool that accepts a durable-ID param should reference the shared schema
|
|
9
|
+
* for its entity (`Id.task`, `Id.plan`, …) instead of an ad-hoc
|
|
10
|
+
* `z.string().min(1).describe(...)`. This gives one place to define:
|
|
11
|
+
*
|
|
12
|
+
* - **normalization** — `.trim()` so a copy/pasted id with stray whitespace
|
|
13
|
+
* still resolves; `.min(1)` so an empty/whitespace-only id fails fast.
|
|
14
|
+
* - **a consistent, prefix-named description** — derived from the token tables
|
|
15
|
+
* (`prefixForEntity`), so the param doc always names the token shape (e.g.
|
|
16
|
+
* "a `td_` token") and where to get it.
|
|
17
|
+
*
|
|
18
|
+
* Deliberately NOT here: classification of the id (numeric-vs-token, wrong
|
|
19
|
+
* entity, alias store lookup). That stays in {@link resolveId} at execution
|
|
20
|
+
* time, which is the single source of truth and emits the specific typed codes
|
|
21
|
+
* (`NUMERIC_ID_UNSUPPORTED`, `ID_ENTITY_MISMATCH`, `ID_UNKNOWN`) agents key on.
|
|
22
|
+
* The schema is string-only (a JSON-number legacy id is a type error); a numeric
|
|
23
|
+
* *string* still passes and reaches `resolveId` for the specific message.
|
|
24
|
+
*/
|
|
25
|
+
import { z } from 'zod';
|
|
26
|
+
import { prefixForEntity } from './token.js';
|
|
27
|
+
/**
|
|
28
|
+
* Per-entity description metadata. Only entities actually exposed as tool id
|
|
29
|
+
* params need an entry; others fall back to a generic description. Exported so a
|
|
30
|
+
* contract test can cross-check every `from` tool name against the registry,
|
|
31
|
+
* catching drift when a tool is renamed.
|
|
32
|
+
*/
|
|
33
|
+
export const ENTITY_META = {
|
|
34
|
+
message: { label: 'email message', from: 'list_emails / search_emails' },
|
|
35
|
+
event: { label: 'calendar event', from: 'list_events / search_events' },
|
|
36
|
+
contact: { label: 'contact', from: 'list_contacts / search_contacts' },
|
|
37
|
+
folder: { label: 'mail folder', from: 'list_folders' },
|
|
38
|
+
driveItem: { label: 'OneDrive item', from: 'list_drive_items / search_drive_items' },
|
|
39
|
+
task: { label: 'To Do task', from: 'list_tasks / search_tasks' },
|
|
40
|
+
taskList: { label: 'To Do task list', from: 'list_task_lists' },
|
|
41
|
+
plan: { label: 'Planner plan', from: 'list_plans' },
|
|
42
|
+
plannerBucket: { label: 'Planner bucket', from: 'list_buckets' },
|
|
43
|
+
plannerTask: { label: 'Planner task', from: 'list_planner_tasks' },
|
|
44
|
+
attachment: { label: 'email attachment', from: 'list_attachments' },
|
|
45
|
+
checklistItem: { label: 'task checklist item', from: 'list_checklist_items' },
|
|
46
|
+
linkedResource: { label: 'task linked resource', from: 'list_linked_resources' },
|
|
47
|
+
taskAttachment: { label: 'task attachment', from: 'list_task_attachments' },
|
|
48
|
+
chat: { label: 'Teams chat', from: 'list_chats' },
|
|
49
|
+
team: { label: 'team', from: 'list_teams' },
|
|
50
|
+
channel: { label: 'Teams channel', from: 'list_channels' },
|
|
51
|
+
chatMessage: { label: 'chat message', from: 'list_chat_messages' },
|
|
52
|
+
channelMessage: { label: 'channel message', from: 'list_channel_messages' },
|
|
53
|
+
contactFolder: { label: 'contact folder', from: 'list_contact_folders' },
|
|
54
|
+
mailRule: { label: 'inbox rule', from: 'list_mail_rules' },
|
|
55
|
+
category: { label: 'master category', from: 'list_categories' },
|
|
56
|
+
focusedOverride: { label: 'focused-inbox override', from: 'list_focused_overrides' },
|
|
57
|
+
calendarPermission: { label: 'calendar permission', from: 'list_calendar_permissions' },
|
|
58
|
+
onlineMeeting: { label: 'online meeting', from: 'list_online_meetings' },
|
|
59
|
+
recording: { label: 'meeting recording', from: 'list_meeting_recordings' },
|
|
60
|
+
transcript: { label: 'meeting transcript', from: 'list_meeting_transcripts' },
|
|
61
|
+
site: { label: 'SharePoint site', from: 'list_sites / search_sites' },
|
|
62
|
+
documentLibrary: { label: 'document library', from: 'list_document_libraries' },
|
|
63
|
+
libraryDriveItem: { label: 'library item', from: 'list_library_items' },
|
|
64
|
+
sharePointList: { label: 'SharePoint list', from: 'list_lists' },
|
|
65
|
+
sharePointListItem: { label: 'SharePoint list item', from: 'list_list_items' },
|
|
66
|
+
noteNotebook: { label: 'OneNote notebook', from: 'list_notebooks' },
|
|
67
|
+
noteSection: { label: 'OneNote section', from: 'list_note_sections' },
|
|
68
|
+
notePage: { label: 'OneNote page', from: 'list_note_pages / search_note_pages' },
|
|
69
|
+
};
|
|
70
|
+
/** Builds the canonical, prefix-named description for an entity id. */
|
|
71
|
+
export function describeId(entityType) {
|
|
72
|
+
const prefix = prefixForEntity(entityType);
|
|
73
|
+
const meta = ENTITY_META[entityType];
|
|
74
|
+
const label = meta?.label ?? entityType;
|
|
75
|
+
const source = meta != null ? ` from ${meta.from}` : '';
|
|
76
|
+
return `Durable ${label} ID — a \`${prefix}_\` token${source}. A raw Graph id is also accepted.`;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The canonical required id schema for an entity: a trimmed, non-empty string
|
|
80
|
+
* with a prefix-named description. Classification stays in `resolveId`.
|
|
81
|
+
*/
|
|
82
|
+
export function idSchema(entityType) {
|
|
83
|
+
return z.string().trim().min(1).describe(describeId(entityType));
|
|
84
|
+
}
|
|
85
|
+
/** The canonical optional id schema for an entity. */
|
|
86
|
+
export function optionalIdSchema(entityType) {
|
|
87
|
+
return idSchema(entityType).optional();
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Canonical required id schemas keyed by entity. Tools reference these directly
|
|
91
|
+
* (`Id.task`, `Id.plan`, …). A per-call `.describe()` may override the default
|
|
92
|
+
* description where a param needs extra context.
|
|
93
|
+
*/
|
|
94
|
+
export const Id = {
|
|
95
|
+
message: idSchema('message'),
|
|
96
|
+
event: idSchema('event'),
|
|
97
|
+
contact: idSchema('contact'),
|
|
98
|
+
folder: idSchema('folder'),
|
|
99
|
+
driveItem: idSchema('driveItem'),
|
|
100
|
+
task: idSchema('task'),
|
|
101
|
+
taskList: idSchema('taskList'),
|
|
102
|
+
plan: idSchema('plan'),
|
|
103
|
+
plannerBucket: idSchema('plannerBucket'),
|
|
104
|
+
plannerTask: idSchema('plannerTask'),
|
|
105
|
+
attachment: idSchema('attachment'),
|
|
106
|
+
checklistItem: idSchema('checklistItem'),
|
|
107
|
+
linkedResource: idSchema('linkedResource'),
|
|
108
|
+
taskAttachment: idSchema('taskAttachment'),
|
|
109
|
+
chat: idSchema('chat'),
|
|
110
|
+
team: idSchema('team'),
|
|
111
|
+
channel: idSchema('channel'),
|
|
112
|
+
chatMessage: idSchema('chatMessage'),
|
|
113
|
+
channelMessage: idSchema('channelMessage'),
|
|
114
|
+
contactFolder: idSchema('contactFolder'),
|
|
115
|
+
mailRule: idSchema('mailRule'),
|
|
116
|
+
category: idSchema('category'),
|
|
117
|
+
focusedOverride: idSchema('focusedOverride'),
|
|
118
|
+
calendarPermission: idSchema('calendarPermission'),
|
|
119
|
+
onlineMeeting: idSchema('onlineMeeting'),
|
|
120
|
+
recording: idSchema('recording'),
|
|
121
|
+
transcript: idSchema('transcript'),
|
|
122
|
+
site: idSchema('site'),
|
|
123
|
+
documentLibrary: idSchema('documentLibrary'),
|
|
124
|
+
libraryDriveItem: idSchema('libraryDriveItem'),
|
|
125
|
+
sharePointList: idSchema('sharePointList'),
|
|
126
|
+
sharePointListItem: idSchema('sharePointListItem'),
|
|
127
|
+
noteNotebook: idSchema('noteNotebook'),
|
|
128
|
+
noteSection: idSchema('noteSection'),
|
|
129
|
+
notePage: idSchema('notePage'),
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/ids/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;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AAC,iBAAiB,CAAC;IAC5C,gBAAgB,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IAC9C,cAAc,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAC1C,kBAAkB,EAAE,QAAQ,CAAC,oBAAoB,CAAC;IAClD,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC;IACtC,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC;IACpC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC;CACgB,CAAC"}
|
package/dist/ids/token.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
4
|
*/
|
|
5
5
|
/** Entity kinds addressable by a durable-ID token. */
|
|
6
|
-
export type EntityType = 'message' | 'event' | 'contact' | 'folder' | 'driveItem' | 'task' | 'plan' | 'plannerTask' | 'chat' | 'team' | 'attachment' | 'channel' | 'chatMessage' | 'checklistItem';
|
|
6
|
+
export type EntityType = 'message' | 'event' | 'contact' | 'folder' | 'driveItem' | 'task' | 'taskList' | 'plan' | 'plannerBucket' | 'plannerTask' | 'chat' | 'team' | 'attachment' | 'channel' | 'chatMessage' | 'channelMessage' | 'checklistItem' | 'linkedResource' | 'taskAttachment' | 'noteNotebook' | 'noteSection' | 'notePage' | 'mailRule' | 'contactFolder' | 'category' | 'focusedOverride' | 'calendarPermission' | 'onlineMeeting' | 'recording' | 'transcript' | 'site' | 'documentLibrary' | 'libraryDriveItem' | 'sharePointList' | 'sharePointListItem';
|
|
7
7
|
/** How a token encodes its target. */
|
|
8
8
|
export type TokenKind = 'self' | 'alias';
|
|
9
9
|
/**
|
|
@@ -27,6 +27,12 @@ export interface ParsedToken {
|
|
|
27
27
|
}
|
|
28
28
|
/** True when a prefix is a known self-encoding or alias prefix. */
|
|
29
29
|
export declare function isKnownPrefix(prefix: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The 2-char token prefix for an entity type (e.g. `task` → `td`). Lets callers
|
|
32
|
+
* (canonical id schemas, next-action hints) name the token shape without
|
|
33
|
+
* duplicating the prefix tables. Throws for an entity with no allocated prefix.
|
|
34
|
+
*/
|
|
35
|
+
export declare function prefixForEntity(entityType: EntityType): string;
|
|
30
36
|
/**
|
|
31
37
|
* Mints a self-encoding token carrying the immutable Graph ID (D1). Deterministic.
|
|
32
38
|
*/
|
package/dist/ids/token.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/ids/token.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/ids/token.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,OAAO,GACP,SAAS,GACT,QAAQ,GACR,WAAW,GACX,MAAM,GACN,UAAU,GACV,MAAM,GACN,eAAe,GACf,aAAa,GACb,MAAM,GACN,MAAM,GACN,YAAY,GACZ,SAAS,GACT,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,UAAU,GACV,UAAU,GACV,eAAe,GACf,UAAU,GACV,iBAAiB,GACjB,oBAAoB,GACpB,eAAe,GACf,WAAW,GACX,YAAY,GACZ,MAAM,GACN,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,oBAAoB,CAAC;AAEzB,sCAAsC;AACtC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzC;;;;;;GAMG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAYvE,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CA+B/D,CAAC;AAoBF,iCAAiC;AACjC,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAW/E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAMlF;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAMpG;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CA0B5D;AAED,iFAAiF;AACjF,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE9C"}
|
package/dist/ids/token.js
CHANGED
|
@@ -5,15 +5,21 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Durable-ID tokens (U5 / D1). Two shapes:
|
|
7
7
|
*
|
|
8
|
-
* - **Self-encoding** (`em_`, `ev_`, `ct_`, `fd_`, `dr_`, `
|
|
9
|
-
* carries the immutable Graph ID directly —
|
|
8
|
+
* - **Self-encoding** (`em_`, `ev_`, `ct_`, `fd_`, `dr_`, `nb_`, `ns_`,
|
|
9
|
+
* `np_`): the token carries the immutable Graph ID directly —
|
|
10
|
+
* `<prefix>_<base64url(graphId)>`.
|
|
10
11
|
* Resolution is a decode with zero storage, so it survives a cold/lost
|
|
11
12
|
* `state.db` and resolves on any machine (the core cold-state fix).
|
|
12
13
|
*
|
|
13
|
-
* - **Alias-backed** (`pl_`, `pt_`, `ch_`, `tm_`, `at_`,
|
|
14
|
-
* token is a short deterministic digest of the
|
|
15
|
-
* `<prefix>_<base32(sha256(canonicalKey))[0..13]>`
|
|
16
|
-
* alias table (D3). These are machine-scoped: a
|
|
14
|
+
* - **Alias-backed** (`pl_`, `pb_`, `pt_`, `ch_`, `tm_`, `at_`, `td_`, `tl_`, `mr_`,
|
|
15
|
+
* `cf_`, `cg_`, `fo_`, `cp_`, `om_`, `rc_`, `tr_`, `si_`, `dl_`, `li_`, `sl_`, `sn_`, composite tuples): the token is a short deterministic digest of the
|
|
16
|
+
* entity's canonical key — `<prefix>_<base32(sha256(canonicalKey))[0..13]>`
|
|
17
|
+
* (70 bits) — backed by the alias table (D3). These are machine-scoped: a
|
|
18
|
+
* cold store yields `ID_UNKNOWN`.
|
|
19
|
+
*
|
|
20
|
+
* Calendar groups are an **orphan** entity: minted for display but never
|
|
21
|
+
* resolved back (no Graph URL takes a calendar-group id as a path segment),
|
|
22
|
+
* so they are returned as the raw Graph id string rather than a token.
|
|
17
23
|
*
|
|
18
24
|
* Determinism is a hard requirement: the same Graph ID / canonical key always
|
|
19
25
|
* mints a byte-identical token.
|
|
@@ -33,18 +39,39 @@ export const SELF_ENCODING_PREFIXES = Object.assign(Object.create(null), {
|
|
|
33
39
|
ct: 'contact',
|
|
34
40
|
fd: 'folder',
|
|
35
41
|
dr: 'driveItem',
|
|
36
|
-
|
|
42
|
+
nb: 'noteNotebook',
|
|
43
|
+
ns: 'noteSection',
|
|
44
|
+
np: 'notePage',
|
|
37
45
|
});
|
|
38
46
|
/** Alias-backed prefixes → entity type (the token is a digest; needs the store). */
|
|
39
47
|
export const ALIAS_PREFIXES = Object.assign(Object.create(null), {
|
|
40
48
|
pl: 'plan',
|
|
49
|
+
pb: 'plannerBucket',
|
|
41
50
|
pt: 'plannerTask',
|
|
42
51
|
ch: 'chat',
|
|
43
52
|
tm: 'team',
|
|
44
53
|
at: 'attachment',
|
|
45
54
|
cn: 'channel',
|
|
46
55
|
cm: 'chatMessage',
|
|
56
|
+
xm: 'channelMessage',
|
|
47
57
|
ci: 'checklistItem',
|
|
58
|
+
lr: 'linkedResource',
|
|
59
|
+
ta: 'taskAttachment',
|
|
60
|
+
td: 'task',
|
|
61
|
+
tl: 'taskList',
|
|
62
|
+
mr: 'mailRule',
|
|
63
|
+
cf: 'contactFolder',
|
|
64
|
+
cg: 'category',
|
|
65
|
+
fo: 'focusedOverride',
|
|
66
|
+
cp: 'calendarPermission',
|
|
67
|
+
om: 'onlineMeeting',
|
|
68
|
+
rc: 'recording',
|
|
69
|
+
tr: 'transcript',
|
|
70
|
+
si: 'site',
|
|
71
|
+
dl: 'documentLibrary',
|
|
72
|
+
li: 'libraryDriveItem',
|
|
73
|
+
sl: 'sharePointList',
|
|
74
|
+
sn: 'sharePointListItem',
|
|
48
75
|
});
|
|
49
76
|
const ENTITY_TO_PREFIX = buildReverse();
|
|
50
77
|
function buildReverse() {
|
|
@@ -65,6 +92,18 @@ const COMPOSITE_DIGEST_CHARS = 14;
|
|
|
65
92
|
export function isKnownPrefix(prefix) {
|
|
66
93
|
return prefix in SELF_ENCODING_PREFIXES || prefix in ALIAS_PREFIXES;
|
|
67
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* The 2-char token prefix for an entity type (e.g. `task` → `td`). Lets callers
|
|
97
|
+
* (canonical id schemas, next-action hints) name the token shape without
|
|
98
|
+
* duplicating the prefix tables. Throws for an entity with no allocated prefix.
|
|
99
|
+
*/
|
|
100
|
+
export function prefixForEntity(entityType) {
|
|
101
|
+
const prefix = ENTITY_TO_PREFIX[entityType];
|
|
102
|
+
if (prefix == null) {
|
|
103
|
+
throw new Error(`Entity type "${entityType}" has no allocated token prefix.`);
|
|
104
|
+
}
|
|
105
|
+
return prefix;
|
|
106
|
+
}
|
|
68
107
|
/**
|
|
69
108
|
* Mints a self-encoding token carrying the immutable Graph ID (D1). Deterministic.
|
|
70
109
|
*/
|
package/dist/ids/token.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/ids/token.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/ids/token.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA2CzC;;;;;;GAMG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAyC,MAAM,CAAC,MAAM,CACvF,MAAM,CAAC,MAAM,CAAC,IAAI,CAA+B,EACjD;IACE,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,cAAc;IAClB,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,UAAU;CACsB,CACvC,CAAC;AAEF,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAAyC,MAAM,CAAC,MAAM,CAC/E,MAAM,CAAC,MAAM,CAAC,IAAI,CAA+B,EACjD;IACE,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,UAAU;IACd,E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ACD,+EAA+E;IAC/E,4EAA4E;IAC5E,6EAA6E;IAC7E,8EAA8E;IAC9E,0EAA0E;IAC1E,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,OAAO,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,14 +7,10 @@
|
|
|
7
7
|
* Office 365 MCP Server
|
|
8
8
|
*
|
|
9
9
|
* A Model Context Protocol server that provides full read/write access to
|
|
10
|
-
* Microsoft 365 via Microsoft Graph API
|
|
11
|
-
*
|
|
12
|
-
* Backend selection:
|
|
13
|
-
* - Graph API is the default (full-featured, cross-platform)
|
|
14
|
-
* - Set USE_APPLESCRIPT=1 to use legacy AppleScript backend (macOS + classic Outlook only)
|
|
10
|
+
* Microsoft 365 via the Microsoft Graph API.
|
|
15
11
|
*/
|
|
16
12
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
17
|
-
import type { SurfaceOptions } from './registry/index.js';
|
|
13
|
+
import type { SurfaceOptions, ConfirmMode } from './registry/index.js';
|
|
18
14
|
/**
|
|
19
15
|
* Creates and configures the MCP server.
|
|
20
16
|
*/
|
|
@@ -22,6 +18,8 @@ import type { SurfaceOptions } from './registry/index.js';
|
|
|
22
18
|
export interface ServerOptions {
|
|
23
19
|
readonly presets?: SurfaceOptions['presets'];
|
|
24
20
|
readonly readOnly?: boolean;
|
|
21
|
+
/** Destructive-confirm mode (U11): 'token' (default) or 'elicit'. */
|
|
22
|
+
readonly confirmMode?: ConfirmMode;
|
|
25
23
|
}
|
|
26
24
|
export declare function createServer(options?: ServerOptions): Server;
|
|
27
25
|
//# 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":";AACA;;;GAGG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AACH;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAsBnE,OAAO,KAAK,EAAe,cAAc,EAAE,WAAW,EAAY,MAAM,qBAAqB,CAAC;AAoE9F;;GAEG;AACH,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;CACpC;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CA8RhE"}
|