@jbctechsolutions/mcp-office365 2.5.1 → 4.0.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/README.md +66 -57
- package/dist/approval/hash.d.ts +8 -8
- package/dist/approval/token-manager.d.ts +37 -19
- package/dist/approval/token-manager.d.ts.map +1 -1
- package/dist/approval/token-manager.js +133 -37
- 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 +21 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +100 -2
- 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 +13 -1
- package/dist/graph/auth/config.js.map +1 -1
- package/dist/graph/auth/device-code-flow.d.ts +3 -1
- package/dist/graph/auth/device-code-flow.d.ts.map +1 -1
- package/dist/graph/auth/device-code-flow.js +42 -14
- package/dist/graph/auth/device-code-flow.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/auth/token-cache.js +2 -2
- package/dist/graph/auth/token-cache.js.map +1 -1
- package/dist/graph/client/graph-client.d.ts +141 -8
- package/dist/graph/client/graph-client.d.ts.map +1 -1
- package/dist/graph/client/graph-client.js +536 -48
- 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 +409 -276
- package/dist/graph/repository.d.ts.map +1 -1
- package/dist/graph/repository.js +772 -1082
- package/dist/graph/repository.js.map +1 -1
- package/dist/ids/mint.d.ts +31 -0
- package/dist/ids/mint.d.ts.map +1 -0
- package/dist/ids/mint.js +36 -0
- package/dist/ids/mint.js.map +1 -0
- 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 +31 -0
- package/dist/ids/resolver.d.ts.map +1 -0
- package/dist/ids/resolver.js +52 -0
- package/dist/ids/resolver.js.map +1 -0
- 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 +62 -0
- package/dist/ids/token.d.ts.map +1 -0
- package/dist/ids/token.js +225 -0
- package/dist/ids/token.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +255 -5925
- 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 +14 -0
- package/dist/registry/all-tools.d.ts.map +1 -0
- package/dist/registry/all-tools.js +68 -0
- package/dist/registry/all-tools.js.map +1 -0
- package/dist/registry/context.d.ts +19 -0
- package/dist/registry/context.d.ts.map +1 -0
- package/dist/registry/context.js +20 -0
- package/dist/registry/context.js.map +1 -0
- package/dist/registry/define-tool.d.ts +15 -0
- package/dist/registry/define-tool.d.ts.map +1 -0
- package/dist/registry/define-tool.js +8 -0
- package/dist/registry/define-tool.js.map +1 -0
- 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 +13 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +8 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/registry.d.ts +73 -0
- package/dist/registry/registry.d.ts.map +1 -0
- package/dist/registry/registry.js +221 -0
- package/dist/registry/registry.js.map +1 -0
- package/dist/registry/types.d.ts +146 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +6 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/search/compiler.d.ts +49 -0
- package/dist/search/compiler.d.ts.map +1 -0
- package/dist/search/compiler.js +168 -0
- package/dist/search/compiler.js.map +1 -0
- package/dist/signature.js +2 -2
- package/dist/signature.js.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/migrate.d.ts +23 -0
- package/dist/state/migrate.d.ts.map +1 -0
- package/dist/state/migrate.js +81 -0
- package/dist/state/migrate.js.map +1 -0
- package/dist/state/schema.d.ts +26 -0
- package/dist/state/schema.d.ts.map +1 -0
- package/dist/state/schema.js +77 -0
- package/dist/state/schema.js.map +1 -0
- package/dist/state/store.d.ts +155 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/store.js +321 -0
- package/dist/state/store.js.map +1 -0
- package/dist/tools/calendar-graph.d.ts +41 -0
- package/dist/tools/calendar-graph.d.ts.map +1 -0
- package/dist/tools/calendar-graph.js +299 -0
- package/dist/tools/calendar-graph.js.map +1 -0
- package/dist/tools/calendar-permissions.d.ts +17 -7
- package/dist/tools/calendar-permissions.d.ts.map +1 -1
- package/dist/tools/calendar-permissions.js +60 -4
- package/dist/tools/calendar-permissions.js.map +1 -1
- package/dist/tools/calendar.d.ts +133 -82
- package/dist/tools/calendar.d.ts.map +1 -1
- package/dist/tools/calendar.js +249 -136
- package/dist/tools/calendar.js.map +1 -1
- package/dist/tools/categories.d.ts +14 -4
- package/dist/tools/categories.d.ts.map +1 -1
- package/dist/tools/categories.js +59 -2
- package/dist/tools/categories.js.map +1 -1
- package/dist/tools/checklist-items.d.ts +19 -9
- package/dist/tools/checklist-items.d.ts.map +1 -1
- package/dist/tools/checklist-items.js +71 -5
- package/dist/tools/checklist-items.js.map +1 -1
- package/dist/tools/contact-folders.d.ts +50 -0
- package/dist/tools/contact-folders.d.ts.map +1 -0
- package/dist/tools/contact-folders.js +136 -0
- package/dist/tools/contact-folders.js.map +1 -0
- package/dist/tools/contacts-graph.d.ts +45 -0
- package/dist/tools/contacts-graph.d.ts.map +1 -0
- package/dist/tools/contacts-graph.js +174 -0
- package/dist/tools/contacts-graph.js.map +1 -0
- package/dist/tools/contacts.d.ts +61 -30
- package/dist/tools/contacts.d.ts.map +1 -1
- package/dist/tools/contacts.js +150 -93
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/excel.d.ts +20 -10
- package/dist/tools/excel.d.ts.map +1 -1
- package/dist/tools/excel.js +82 -6
- package/dist/tools/excel.js.map +1 -1
- package/dist/tools/focused-overrides.d.ts +14 -4
- package/dist/tools/focused-overrides.d.ts.map +1 -1
- package/dist/tools/focused-overrides.js +59 -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 +17 -7
- package/dist/tools/linked-resources.d.ts.map +1 -1
- package/dist/tools/linked-resources.js +60 -4
- package/dist/tools/linked-resources.js.map +1 -1
- package/dist/tools/mail-graph.d.ts +38 -0
- package/dist/tools/mail-graph.d.ts.map +1 -0
- package/dist/tools/mail-graph.js +187 -0
- package/dist/tools/mail-graph.js.map +1 -0
- package/dist/tools/mail-rules.d.ts +20 -8
- package/dist/tools/mail-rules.d.ts.map +1 -1
- package/dist/tools/mail-rules.js +63 -7
- package/dist/tools/mail-rules.js.map +1 -1
- package/dist/tools/mail-send.d.ts +39 -27
- package/dist/tools/mail-send.d.ts.map +1 -1
- package/dist/tools/mail-send.js +249 -24
- package/dist/tools/mail-send.js.map +1 -1
- package/dist/tools/mail.d.ts +91 -68
- package/dist/tools/mail.d.ts.map +1 -1
- package/dist/tools/mail.js +232 -243
- package/dist/tools/mail.js.map +1 -1
- package/dist/tools/mailbox-organization.d.ts +51 -34
- package/dist/tools/mailbox-organization.d.ts.map +1 -1
- package/dist/tools/mailbox-organization.js +318 -35
- package/dist/tools/mailbox-organization.js.map +1 -1
- package/dist/tools/mailbox-settings.d.ts +59 -0
- package/dist/tools/mailbox-settings.d.ts.map +1 -0
- package/dist/tools/mailbox-settings.js +136 -0
- package/dist/tools/mailbox-settings.js.map +1 -0
- package/dist/tools/meetings.d.ts +24 -14
- package/dist/tools/meetings.d.ts.map +1 -1
- package/dist/tools/meetings.js +82 -6
- package/dist/tools/meetings.js.map +1 -1
- package/dist/tools/onedrive.d.ts +26 -16
- package/dist/tools/onedrive.d.ts.map +1 -1
- package/dist/tools/onedrive.js +140 -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/people.d.ts +10 -0
- package/dist/tools/people.d.ts.map +1 -1
- package/dist/tools/people.js +94 -0
- package/dist/tools/people.js.map +1 -1
- package/dist/tools/planner-visualization.d.ts +15 -5
- package/dist/tools/planner-visualization.d.ts.map +1 -1
- package/dist/tools/planner-visualization.js +58 -4
- package/dist/tools/planner-visualization.js.map +1 -1
- package/dist/tools/planner.d.ts +69 -39
- package/dist/tools/planner.d.ts.map +1 -1
- package/dist/tools/planner.js +231 -23
- package/dist/tools/planner.js.map +1 -1
- package/dist/tools/scheduling.d.ts +12 -0
- package/dist/tools/scheduling.d.ts.map +1 -1
- package/dist/tools/scheduling.js +38 -0
- package/dist/tools/scheduling.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 +24 -14
- package/dist/tools/sharepoint.d.ts.map +1 -1
- package/dist/tools/sharepoint.js +85 -9
- package/dist/tools/sharepoint.js.map +1 -1
- package/dist/tools/task-attachments.d.ts +17 -7
- package/dist/tools/task-attachments.d.ts.map +1 -1
- package/dist/tools/task-attachments.js +60 -4
- package/dist/tools/task-attachments.js.map +1 -1
- package/dist/tools/task-lists.d.ts +56 -0
- package/dist/tools/task-lists.d.ts.map +1 -0
- package/dist/tools/task-lists.js +155 -0
- package/dist/tools/task-lists.js.map +1 -0
- package/dist/tools/tasks-graph.d.ts +49 -0
- package/dist/tools/tasks-graph.d.ts.map +1 -0
- package/dist/tools/tasks-graph.js +193 -0
- package/dist/tools/tasks-graph.js.map +1 -0
- package/dist/tools/tasks.d.ts +121 -29
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +136 -84
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/teams.d.ts +57 -46
- package/dist/tools/teams.d.ts.map +1 -1
- package/dist/tools/teams.js +288 -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 +110 -38
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +239 -56
- package/dist/utils/errors.js.map +1 -1
- package/dist/visualization/types.d.ts +4 -4
- package/package.json +2 -3
- 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/notes.d.ts +0 -74
- package/dist/tools/notes.d.ts.map +0 -1
- package/dist/tools/notes.js +0 -136
- package/dist/tools/notes.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
* Runtime-context helpers for registry tool handlers.
|
|
7
|
+
*/
|
|
8
|
+
import type { GraphToolsets, ToolContext } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Resolves an initialized Graph-backend toolset from the runtime context, or
|
|
11
|
+
* throws a clear error when the Graph backend is unavailable.
|
|
12
|
+
*
|
|
13
|
+
* Centralizes the per-domain "resolve toolset or throw" boilerplate so every
|
|
14
|
+
* migrated domain shares one implementation instead of hand-rolling a null
|
|
15
|
+
* check. The `key` is type-checked against the augmented `GraphToolsets`, and
|
|
16
|
+
* the return type is the exact toolset class for that key.
|
|
17
|
+
*/
|
|
18
|
+
export declare function requireGraphToolset<K extends keyof GraphToolsets>(ctx: ToolContext, key: K): GraphToolsets[K];
|
|
19
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/registry/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,aAAa,EAC/D,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,CAAC,GACL,aAAa,CAAC,CAAC,CAAC,CAKlB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
* Resolves an initialized Graph-backend toolset from the runtime context, or
|
|
7
|
+
* throws a clear error when the Graph backend is unavailable.
|
|
8
|
+
*
|
|
9
|
+
* Centralizes the per-domain "resolve toolset or throw" boilerplate so every
|
|
10
|
+
* migrated domain shares one implementation instead of hand-rolling a null
|
|
11
|
+
* check. The `key` is type-checked against the augmented `GraphToolsets`, and
|
|
12
|
+
* the return type is the exact toolset class for that key.
|
|
13
|
+
*/
|
|
14
|
+
export function requireGraphToolset(ctx, key) {
|
|
15
|
+
if (ctx.graph == null) {
|
|
16
|
+
throw new Error('This tool requires the Microsoft Graph API backend.');
|
|
17
|
+
}
|
|
18
|
+
return ctx.graph[key];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/registry/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CACjC,GAAgB,EAChB,GAAM;IAEN,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
* `defineTool` — typed helper for authoring a tool definition.
|
|
7
|
+
*
|
|
8
|
+
* Preserves the inference link between the Zod input schema and the handler's
|
|
9
|
+
* `params` argument, so a domain module declares its schema once and the
|
|
10
|
+
* handler is type-checked against it.
|
|
11
|
+
*/
|
|
12
|
+
import type { z } from 'zod';
|
|
13
|
+
import type { ToolDefinition } from './types.js';
|
|
14
|
+
export declare function defineTool<S extends z.ZodType>(def: ToolDefinition<S>): ToolDefinition<S>;
|
|
15
|
+
//# sourceMappingURL=define-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-tool.d.ts","sourceRoot":"","sources":["../../src/registry/define-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,wBAAgB,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAEzF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-tool.js","sourceRoot":"","sources":["../../src/registry/define-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,MAAM,UAAU,UAAU,CAAsB,GAAsB;IACpE,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
* Factory helpers for the declarative `onElicit` links (U11).
|
|
7
|
+
*
|
|
8
|
+
* A `prepare_*` tool opts into inline elicitation by pointing at its `confirm_*`
|
|
9
|
+
* counterpart and describing how to build that confirm's params from the prepare
|
|
10
|
+
* params + the minted token(s). The three confirm shapes in the codebase each
|
|
11
|
+
* get a one-line factory so the ~35 tool defs stay declarative:
|
|
12
|
+
*
|
|
13
|
+
* - {@link approvalTokenLink} — confirm takes `{ approval_token }`.
|
|
14
|
+
* - {@link tokenIdLink} — confirm takes `{ token_id, ...copied ids }`.
|
|
15
|
+
* - {@link batchLink} — confirm takes `{ tokens: [{token_id, email_id}] }`.
|
|
16
|
+
*/
|
|
17
|
+
import type { ElicitLink } from './types.js';
|
|
18
|
+
/** Shape A: confirm tool takes a single `{ approval_token }`. */
|
|
19
|
+
export declare function approvalTokenLink(confirmTool: string): ElicitLink;
|
|
20
|
+
/**
|
|
21
|
+
* Shape B: confirm tool takes `{ token_id, ...copyFields }`, where each copied
|
|
22
|
+
* field is carried over verbatim from the prepare params (same field name).
|
|
23
|
+
*/
|
|
24
|
+
export declare function tokenIdLink(confirmTool: string, copyFields?: readonly string[]): ElicitLink;
|
|
25
|
+
/**
|
|
26
|
+
* Shape C: the batch confirm takes `{ tokens: [{ token_id, email_id }, …] }`,
|
|
27
|
+
* one pair per email. The batch prepare returns `{ tokens: [{ token_id, email:
|
|
28
|
+
* { id, … } }] }` where the token's target is `email.id`, so `email_id` is read
|
|
29
|
+
* from `email.id` (with a direct `email_id` fallback for robustness).
|
|
30
|
+
*
|
|
31
|
+
* `collectTokenIds` gathers EVERY minted `token_id` independently of the id
|
|
32
|
+
* mapping, so a decline invalidates all of them even if a pair is malformed.
|
|
33
|
+
*/
|
|
34
|
+
export declare function batchLink(confirmTool: string): ElicitLink;
|
|
35
|
+
//# sourceMappingURL=elicit-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elicit-links.d.ts","sourceRoot":"","sources":["../../src/registry/elicit-links.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,YAAY,CAAC;AAmCzD,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAMjE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,GAAE,SAAS,MAAM,EAAO,GAAG,UAAU,CAS/F;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAMzD"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/** Parses a prepare tool's single-text-block JSON result, or {} on any failure. */
|
|
6
|
+
function parseResult(result) {
|
|
7
|
+
const text = result.content[0]?.text;
|
|
8
|
+
if (text == null)
|
|
9
|
+
return {};
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(text);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** The lone token a single-target prepare minted (`approval_token`/`token_id`). */
|
|
18
|
+
function singleToken(result) {
|
|
19
|
+
const parsed = parseResult(result);
|
|
20
|
+
const token = parsed['approval_token'] ?? parsed['token_id'];
|
|
21
|
+
return typeof token === 'string' && token.length > 0 ? token : null;
|
|
22
|
+
}
|
|
23
|
+
function singleTokenIds(result) {
|
|
24
|
+
const token = singleToken(result);
|
|
25
|
+
return token != null ? [token] : [];
|
|
26
|
+
}
|
|
27
|
+
/** Copies the named keys from prepare params into the confirm params. */
|
|
28
|
+
function pick(params, keys) {
|
|
29
|
+
const src = (params ?? {});
|
|
30
|
+
const out = {};
|
|
31
|
+
for (const key of keys) {
|
|
32
|
+
if (src[key] !== undefined)
|
|
33
|
+
out[key] = src[key];
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/** Shape A: confirm tool takes a single `{ approval_token }`. */
|
|
38
|
+
export function approvalTokenLink(confirmTool) {
|
|
39
|
+
return {
|
|
40
|
+
confirmTool,
|
|
41
|
+
collectTokenIds: singleTokenIds,
|
|
42
|
+
buildParams: (_prepareParams, result) => ({ approval_token: singleToken(result) }),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Shape B: confirm tool takes `{ token_id, ...copyFields }`, where each copied
|
|
47
|
+
* field is carried over verbatim from the prepare params (same field name).
|
|
48
|
+
*/
|
|
49
|
+
export function tokenIdLink(confirmTool, copyFields = []) {
|
|
50
|
+
return {
|
|
51
|
+
confirmTool,
|
|
52
|
+
collectTokenIds: singleTokenIds,
|
|
53
|
+
buildParams: (prepareParams, result) => ({
|
|
54
|
+
token_id: singleToken(result),
|
|
55
|
+
...pick(prepareParams, copyFields),
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Shape C: the batch confirm takes `{ tokens: [{ token_id, email_id }, …] }`,
|
|
61
|
+
* one pair per email. The batch prepare returns `{ tokens: [{ token_id, email:
|
|
62
|
+
* { id, … } }] }` where the token's target is `email.id`, so `email_id` is read
|
|
63
|
+
* from `email.id` (with a direct `email_id` fallback for robustness).
|
|
64
|
+
*
|
|
65
|
+
* `collectTokenIds` gathers EVERY minted `token_id` independently of the id
|
|
66
|
+
* mapping, so a decline invalidates all of them even if a pair is malformed.
|
|
67
|
+
*/
|
|
68
|
+
export function batchLink(confirmTool) {
|
|
69
|
+
return {
|
|
70
|
+
confirmTool,
|
|
71
|
+
collectTokenIds: (result) => batchTokenIds(result),
|
|
72
|
+
buildParams: (_prepareParams, result) => ({ tokens: batchPairs(result) }),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** Raw `tokens` array from a batch prepare result, or []. */
|
|
76
|
+
function batchEntries(result) {
|
|
77
|
+
const tokens = parseResult(result)['tokens'];
|
|
78
|
+
return Array.isArray(tokens) ? tokens : [];
|
|
79
|
+
}
|
|
80
|
+
/** Every minted token id in the batch result (authoritative for invalidation). */
|
|
81
|
+
function batchTokenIds(result) {
|
|
82
|
+
const ids = [];
|
|
83
|
+
for (const entry of batchEntries(result)) {
|
|
84
|
+
if (typeof entry['token_id'] === 'string')
|
|
85
|
+
ids.push(entry['token_id']);
|
|
86
|
+
}
|
|
87
|
+
return ids;
|
|
88
|
+
}
|
|
89
|
+
/** The `{ token_id, email_id }` pairs the batch confirm expects. */
|
|
90
|
+
function batchPairs(result) {
|
|
91
|
+
const pairs = [];
|
|
92
|
+
for (const entry of batchEntries(result)) {
|
|
93
|
+
const tokenId = entry['token_id'];
|
|
94
|
+
const email = entry['email'];
|
|
95
|
+
const emailId = email?.['id'] ?? entry['email_id'];
|
|
96
|
+
if (typeof tokenId === 'string' && typeof emailId === 'string') {
|
|
97
|
+
pairs.push({ token_id: tokenId, email_id: emailId });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return pairs;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=elicit-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elicit-links.js","sourceRoot":"","sources":["../../src/registry/elicit-links.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
* Inline confirmation via MCP elicitation (U11).
|
|
7
|
+
*
|
|
8
|
+
* Bridges the MCP `Server.elicitInput` request to the registry's backend-neutral
|
|
9
|
+
* {@link Elicitor} contract. Capability-gated and fail-open-to-degrade: if the
|
|
10
|
+
* client can't elicit, or the request times out or errors, the caller falls back
|
|
11
|
+
* to the durable two-phase token flow — an inline confirmation never blocks or
|
|
12
|
+
* fails a tool call.
|
|
13
|
+
*/
|
|
14
|
+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
15
|
+
import type { Elicitor } from './types.js';
|
|
16
|
+
/** How long to wait for the user's inline yes/no before degrading (U11). */
|
|
17
|
+
export declare const ELICIT_TIMEOUT_MS = 60000;
|
|
18
|
+
/**
|
|
19
|
+
* Builds an {@link Elicitor} bound to a live MCP server. Returns 'degrade' —
|
|
20
|
+
* never throws — when the client lacks the capability, cancels, or times out, so
|
|
21
|
+
* the dispatch interceptor can hand back the durable token unchanged.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createServerElicitor(server: Server): Elicitor;
|
|
24
|
+
//# sourceMappingURL=elicitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elicitor.d.ts","sourceRoot":"","sources":["../../src/registry/elicitor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAE1D,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAmBxC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAwB7D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
/** How long to wait for the user's inline yes/no before degrading (U11). */
|
|
6
|
+
export const ELICIT_TIMEOUT_MS = 60_000;
|
|
7
|
+
/**
|
|
8
|
+
* A minimal confirmation form. We key the decision off the elicitation `action`
|
|
9
|
+
* ('accept' = yes), so the schema is a formality some clients render; a single
|
|
10
|
+
* optional boolean keeps it valid and unobtrusive.
|
|
11
|
+
*/
|
|
12
|
+
const CONFIRM_SCHEMA = {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
confirm: {
|
|
16
|
+
type: 'boolean',
|
|
17
|
+
title: 'Confirm',
|
|
18
|
+
description: 'Approve this destructive action.',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
required: [],
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Builds an {@link Elicitor} bound to a live MCP server. Returns 'degrade' —
|
|
25
|
+
* never throws — when the client lacks the capability, cancels, or times out, so
|
|
26
|
+
* the dispatch interceptor can hand back the durable token unchanged.
|
|
27
|
+
*/
|
|
28
|
+
export function createServerElicitor(server) {
|
|
29
|
+
return async ({ message }) => {
|
|
30
|
+
if (server.getClientCapabilities()?.elicitation == null) {
|
|
31
|
+
return 'degrade';
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const result = await server.elicitInput({ message, requestedSchema: CONFIRM_SCHEMA }, { timeout: ELICIT_TIMEOUT_MS });
|
|
35
|
+
switch (result.action) {
|
|
36
|
+
case 'accept':
|
|
37
|
+
return 'accept';
|
|
38
|
+
case 'decline':
|
|
39
|
+
return 'decline';
|
|
40
|
+
default:
|
|
41
|
+
// 'cancel' — the user dismissed without deciding; leave the token.
|
|
42
|
+
return 'degrade';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
// Timeout or transport error → degrade (fail-open to the token flow).
|
|
47
|
+
return 'degrade';
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=elicitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elicitor.js","sourceRoot":"","sources":["../../src/registry/elicitor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC;;;;GAIG;AACH,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,SAAkB;YACxB,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,kCAAkC;SAChD;KACF;IACD,QAAQ,EAAE,EAAc;CACzB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,EAA0B,EAAE;QACnD,IAAI,MAAM,CAAC,qBAAqB,EAAE,EAAE,WAAW,IAAI,IAAI,EAAE,CAAC;YACxD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CACrC,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,EAC5C,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAC/B,CAAC;YACF,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;gBACtB,KAAK,QAAQ;oBACX,OAAO,QAAQ,CAAC;gBAClB,KAAK,SAAS;oBACZ,OAAO,SAAS,CAAC;gBACnB;oBACE,mEAAmE;oBACnE,OAAO,SAAS,CAAC;YACrB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,sEAAsE;YACtE,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
* Tool registry barrel.
|
|
7
|
+
*/
|
|
8
|
+
export type { Backend, Preset, ToolAnnotations, ToolResult, ToolContext, ToolDefinition, GraphToolsets, ConfirmMode, ElicitOutcome, ElicitRequest, Elicitor, ElicitLink, } from './types.js';
|
|
9
|
+
export { ToolRegistry, toInputSchema } from './registry.js';
|
|
10
|
+
export type { SurfaceOptions } from './registry.js';
|
|
11
|
+
export { defineTool } from './define-tool.js';
|
|
12
|
+
export { requireGraphToolset } from './context.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,YAAY,EACV,OAAO,EACP,MAAM,EACN,eAAe,EACf,UAAU,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
export { ToolRegistry, toInputSchema } from './registry.js';
|
|
6
|
+
export { defineTool } from './define-tool.js';
|
|
7
|
+
export { requireGraphToolset } from './context.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
* ToolRegistry — single source of truth for the MCP tool surface (U1).
|
|
7
|
+
*
|
|
8
|
+
* Holds tool definitions, derives the advertised JSON Schema from each Zod
|
|
9
|
+
* schema, filters the surface by backend / preset / read-only, and dispatches
|
|
10
|
+
* a call to the matching handler after validating its arguments.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
14
|
+
import type { Backend, Preset, ToolContext, ToolDefinition, ToolResult } from './types.js';
|
|
15
|
+
/** Options controlling which tools are exposed to a client. */
|
|
16
|
+
export interface SurfaceOptions {
|
|
17
|
+
readonly backend: Backend;
|
|
18
|
+
/** Presets to include. Undefined/empty means the full surface. */
|
|
19
|
+
readonly presets?: readonly Preset[];
|
|
20
|
+
/** When true, only non-destructive tools are exposed. */
|
|
21
|
+
readonly readOnly?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Converts a Zod schema to an MCP-compatible `inputSchema`.
|
|
25
|
+
*
|
|
26
|
+
* Uses zod 4's native `z.toJSONSchema` (draft-07 target) and strips the
|
|
27
|
+
* `$schema` key, which MCP's `Tool.inputSchema` does not carry. Transitional
|
|
28
|
+
* alias keys (U6/D11) are handled by the input pipeline, not here; when a
|
|
29
|
+
* schema opts into aliases it should expose them as optional properties so the
|
|
30
|
+
* advertised schema stays validation-safe.
|
|
31
|
+
*/
|
|
32
|
+
export declare function toInputSchema(schema: z.ZodType): Tool['inputSchema'];
|
|
33
|
+
/**
|
|
34
|
+
* In-memory registry of tool definitions.
|
|
35
|
+
*/
|
|
36
|
+
export declare class ToolRegistry {
|
|
37
|
+
private readonly definitions;
|
|
38
|
+
/** Registers a batch of tool definitions. Throws on a duplicate name. */
|
|
39
|
+
register(defs: readonly ToolDefinition[]): void;
|
|
40
|
+
/** True when a tool with this name is registered. */
|
|
41
|
+
has(name: string): boolean;
|
|
42
|
+
/** All registered names, insertion order preserved. */
|
|
43
|
+
names(): string[];
|
|
44
|
+
/** Returns a single definition, or undefined. */
|
|
45
|
+
get(name: string): ToolDefinition | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the MCP tool list for a given surface, filtered by backend,
|
|
48
|
+
* preset membership, and read-only mode.
|
|
49
|
+
*/
|
|
50
|
+
listTools(options: SurfaceOptions): Tool[];
|
|
51
|
+
/** True when a tool is exposed under the given surface. */
|
|
52
|
+
isExposed(name: string, options: SurfaceOptions): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Validates arguments against the tool's schema and invokes its handler.
|
|
55
|
+
* Returns undefined when no tool with this name is registered, so the caller
|
|
56
|
+
* can fall back to the legacy dispatch during the U2 migration window.
|
|
57
|
+
*/
|
|
58
|
+
dispatch(name: string, args: unknown, ctx: ToolContext, options: SurfaceOptions): Promise<ToolResult | undefined>;
|
|
59
|
+
/**
|
|
60
|
+
* Runs a prepare tool, asks the user inline, and resolves the outcome (U11):
|
|
61
|
+
* - accept → execute now via the linked confirm tool (its exact validation +
|
|
62
|
+
* execution is reused; the just-minted token is consumed there).
|
|
63
|
+
* - decline → invalidate the token (consume-without-execute) and report abort.
|
|
64
|
+
* - degrade → return the prepare token response unchanged (cancel / timeout /
|
|
65
|
+
* no capability / unparseable token) — the normal two-phase flow.
|
|
66
|
+
*
|
|
67
|
+
* Fail-closed: the destructive action runs only on an explicit accept.
|
|
68
|
+
*/
|
|
69
|
+
private dispatchWithElicitation;
|
|
70
|
+
private filtered;
|
|
71
|
+
private matches;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,WAAW,EACX,cAAc,EACd,UAAU,EAGX,MAAM,YAAY,CAAC;AAEpB,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,CAWpE;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqC;IAEjE,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,GAAG,IAAI;IAS/C,qDAAqD;IACrD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,uDAAuD;IACvD,KAAK,IAAI,MAAM,EAAE;IAIjB,iDAAiD;IACjD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI7C;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,EAAE;IAc1C,2DAA2D;IAC3D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO;IAKzD;;;;OAIG;IACG,QAAQ,CACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IA6BlC;;;;;;;;;OASG;YACW,uBAAuB;IAkDrC,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,OAAO;CAahB"}
|
|
@@ -0,0 +1,221 @@
|
|
|
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
|
+
* ToolRegistry — single source of truth for the MCP tool surface (U1).
|
|
7
|
+
*
|
|
8
|
+
* Holds tool definitions, derives the advertised JSON Schema from each Zod
|
|
9
|
+
* schema, filters the surface by backend / preset / read-only, and dispatches
|
|
10
|
+
* a call to the matching handler after validating its arguments.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { ReadOnlyModeError } from '../utils/errors.js';
|
|
14
|
+
/**
|
|
15
|
+
* Converts a Zod schema to an MCP-compatible `inputSchema`.
|
|
16
|
+
*
|
|
17
|
+
* Uses zod 4's native `z.toJSONSchema` (draft-07 target) and strips the
|
|
18
|
+
* `$schema` key, which MCP's `Tool.inputSchema` does not carry. Transitional
|
|
19
|
+
* alias keys (U6/D11) are handled by the input pipeline, not here; when a
|
|
20
|
+
* schema opts into aliases it should expose them as optional properties so the
|
|
21
|
+
* advertised schema stays validation-safe.
|
|
22
|
+
*/
|
|
23
|
+
export function toInputSchema(schema) {
|
|
24
|
+
// `io: 'input'` — the advertised schema describes what a CLIENT sends, so a
|
|
25
|
+
// field with a `.default()` is optional (the server fills the default at
|
|
26
|
+
// parse time). Zod 4's default `io: 'output'` would mark defaulted fields as
|
|
27
|
+
// required, misleading agents into always supplying them.
|
|
28
|
+
const json = z.toJSONSchema(schema, { target: 'draft-7', io: 'input' });
|
|
29
|
+
delete json['$schema'];
|
|
30
|
+
if (json['type'] == null) {
|
|
31
|
+
json['type'] = 'object';
|
|
32
|
+
}
|
|
33
|
+
return json;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* In-memory registry of tool definitions.
|
|
37
|
+
*/
|
|
38
|
+
export class ToolRegistry {
|
|
39
|
+
definitions = new Map();
|
|
40
|
+
/** Registers a batch of tool definitions. Throws on a duplicate name. */
|
|
41
|
+
register(defs) {
|
|
42
|
+
for (const def of defs) {
|
|
43
|
+
if (this.definitions.has(def.name)) {
|
|
44
|
+
throw new Error(`Duplicate tool registration: "${def.name}"`);
|
|
45
|
+
}
|
|
46
|
+
this.definitions.set(def.name, def);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** True when a tool with this name is registered. */
|
|
50
|
+
has(name) {
|
|
51
|
+
return this.definitions.has(name);
|
|
52
|
+
}
|
|
53
|
+
/** All registered names, insertion order preserved. */
|
|
54
|
+
names() {
|
|
55
|
+
return [...this.definitions.keys()];
|
|
56
|
+
}
|
|
57
|
+
/** Returns a single definition, or undefined. */
|
|
58
|
+
get(name) {
|
|
59
|
+
return this.definitions.get(name);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns the MCP tool list for a given surface, filtered by backend,
|
|
63
|
+
* preset membership, and read-only mode.
|
|
64
|
+
*/
|
|
65
|
+
listTools(options) {
|
|
66
|
+
return this.filtered(options).map((def) => {
|
|
67
|
+
const tool = {
|
|
68
|
+
name: def.name,
|
|
69
|
+
description: def.description,
|
|
70
|
+
inputSchema: toInputSchema(def.input),
|
|
71
|
+
};
|
|
72
|
+
if (Object.keys(def.annotations).length > 0) {
|
|
73
|
+
return { ...tool, annotations: def.annotations };
|
|
74
|
+
}
|
|
75
|
+
return tool;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/** True when a tool is exposed under the given surface. */
|
|
79
|
+
isExposed(name, options) {
|
|
80
|
+
const def = this.definitions.get(name);
|
|
81
|
+
return def != null && this.matches(def, options);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Validates arguments against the tool's schema and invokes its handler.
|
|
85
|
+
* Returns undefined when no tool with this name is registered, so the caller
|
|
86
|
+
* can fall back to the legacy dispatch during the U2 migration window.
|
|
87
|
+
*/
|
|
88
|
+
async dispatch(name, args, ctx, options) {
|
|
89
|
+
const def = this.definitions.get(name);
|
|
90
|
+
if (def == null) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
if (!this.matches(def, options)) {
|
|
94
|
+
// Distinguish the read-only rejection so it surfaces a stable
|
|
95
|
+
// READ_ONLY_MODE envelope (D13) — but only when read-only is the *sole*
|
|
96
|
+
// reason (the tool would otherwise be exposed). A tool also filtered by
|
|
97
|
+
// backend/preset gets the generic error, avoiding misattribution.
|
|
98
|
+
if (options.readOnly === true && this.matches(def, { ...options, readOnly: false })) {
|
|
99
|
+
throw new ReadOnlyModeError(name);
|
|
100
|
+
}
|
|
101
|
+
throw new Error(`Tool "${name}" is not available in the current mode.`);
|
|
102
|
+
}
|
|
103
|
+
// MCP marks `arguments` optional; default to {} so no-input tools
|
|
104
|
+
// (e.g. list_mail_rules) parse cleanly, matching the codebase-wide
|
|
105
|
+
// `parse(args ?? {})` convention.
|
|
106
|
+
const params = def.input.parse(args ?? {});
|
|
107
|
+
// Inline-elicitation interceptor (U11): only for a prepare tool that opted in
|
|
108
|
+
// (onElicit), when the server is in elicit mode and the client can elicit.
|
|
109
|
+
// Everything else runs the handler directly — an unchanged fast path.
|
|
110
|
+
if (def.onElicit != null && ctx.confirmMode === 'elicit' && ctx.elicit != null) {
|
|
111
|
+
return this.dispatchWithElicitation(def, params, ctx, def.onElicit, ctx.elicit);
|
|
112
|
+
}
|
|
113
|
+
return def.handler(ctx, params);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Runs a prepare tool, asks the user inline, and resolves the outcome (U11):
|
|
117
|
+
* - accept → execute now via the linked confirm tool (its exact validation +
|
|
118
|
+
* execution is reused; the just-minted token is consumed there).
|
|
119
|
+
* - decline → invalidate the token (consume-without-execute) and report abort.
|
|
120
|
+
* - degrade → return the prepare token response unchanged (cancel / timeout /
|
|
121
|
+
* no capability / unparseable token) — the normal two-phase flow.
|
|
122
|
+
*
|
|
123
|
+
* Fail-closed: the destructive action runs only on an explicit accept.
|
|
124
|
+
*/
|
|
125
|
+
async dispatchWithElicitation(def, prepareParams, ctx, link, elicit) {
|
|
126
|
+
const prepareResult = await def.handler(ctx, prepareParams);
|
|
127
|
+
const tokenIds = link.collectTokenIds(prepareResult);
|
|
128
|
+
// No token in the prepare output → nothing to gate/execute; degrade.
|
|
129
|
+
if (tokenIds.length === 0) {
|
|
130
|
+
return prepareResult;
|
|
131
|
+
}
|
|
132
|
+
const message = link.message?.(prepareParams) ?? defaultConfirmMessage(ctx, tokenIds[0]);
|
|
133
|
+
const outcome = await elicit({ message });
|
|
134
|
+
if (outcome === 'accept') {
|
|
135
|
+
const confirmDef = this.definitions.get(link.confirmTool);
|
|
136
|
+
// A misconfigured link must not silently execute nor lose the approval —
|
|
137
|
+
// degrade to the token response so the two-phase path still works.
|
|
138
|
+
if (confirmDef == null) {
|
|
139
|
+
return prepareResult;
|
|
140
|
+
}
|
|
141
|
+
// Only the param mapping/validation is guarded: a bad buildParams must
|
|
142
|
+
// degrade (return the still-live token) rather than error out an accepted
|
|
143
|
+
// action. The confirm handler runs OUTSIDE the guard so a genuine
|
|
144
|
+
// execution error (e.g. a Graph failure) surfaces normally, not masked.
|
|
145
|
+
let confirmParams;
|
|
146
|
+
try {
|
|
147
|
+
confirmParams = confirmDef.input.parse(link.buildParams(prepareParams, prepareResult));
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
return prepareResult;
|
|
151
|
+
}
|
|
152
|
+
return confirmDef.handler(ctx, confirmParams);
|
|
153
|
+
}
|
|
154
|
+
if (outcome === 'decline') {
|
|
155
|
+
// Burn every token this prepare minted (batch mints one per item), so a
|
|
156
|
+
// declined action can't be redeemed via the confirm flow afterward.
|
|
157
|
+
for (const tokenId of tokenIds) {
|
|
158
|
+
invalidateToken(ctx, tokenId);
|
|
159
|
+
}
|
|
160
|
+
return declinedResult(def.name);
|
|
161
|
+
}
|
|
162
|
+
// 'degrade' — hand back the durable token exactly as the token flow would.
|
|
163
|
+
return prepareResult;
|
|
164
|
+
}
|
|
165
|
+
filtered(options) {
|
|
166
|
+
return [...this.definitions.values()].filter((def) => this.matches(def, options));
|
|
167
|
+
}
|
|
168
|
+
matches(def, options) {
|
|
169
|
+
if (!def.backends.includes(options.backend)) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
if (options.readOnly === true && !isReadOnly(def)) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
const presets = options.presets;
|
|
176
|
+
if (presets != null && presets.length > 0 && def.presets.length > 0) {
|
|
177
|
+
return def.presets.some((p) => presets.includes(p));
|
|
178
|
+
}
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* A tool is read-only iff it explicitly advertises `readOnlyHint: true`. This is
|
|
184
|
+
* stricter than `!destructive` — a non-destructive write (e.g. create_draft,
|
|
185
|
+
* mark_email_read) still mutates state and must be excluded from `--read-only`.
|
|
186
|
+
*/
|
|
187
|
+
function isReadOnly(def) {
|
|
188
|
+
return def.annotations.readOnlyHint === true;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Burns a token without executing its action, so a declined destructive request
|
|
192
|
+
* can't be redeemed via the confirm flow afterward. Uses the token's own
|
|
193
|
+
* operation/targetId (it was just minted, so this always validates), reusing the
|
|
194
|
+
* store's atomic single-use consume — no new persistence machinery.
|
|
195
|
+
*/
|
|
196
|
+
function invalidateToken(ctx, tokenId) {
|
|
197
|
+
const token = ctx.tokenManager.lookupToken(tokenId);
|
|
198
|
+
if (token != null) {
|
|
199
|
+
ctx.tokenManager.consumeToken(tokenId, token.operation, token.targetId);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/** A generic confirmation prompt derived from the token's operation. */
|
|
203
|
+
function defaultConfirmMessage(ctx, tokenId) {
|
|
204
|
+
const op = tokenId != null ? ctx.tokenManager.lookupToken(tokenId)?.operation : undefined;
|
|
205
|
+
const action = op != null ? op.replace(/_/g, ' ') : 'this action';
|
|
206
|
+
return `Confirm: ${action}? This cannot be undone.`;
|
|
207
|
+
}
|
|
208
|
+
/** The result returned when a user declines an inline confirmation. */
|
|
209
|
+
function declinedResult(toolName) {
|
|
210
|
+
return {
|
|
211
|
+
content: [{
|
|
212
|
+
type: 'text',
|
|
213
|
+
text: JSON.stringify({
|
|
214
|
+
success: false,
|
|
215
|
+
declined: true,
|
|
216
|
+
message: `Action cancelled: you declined the confirmation for ${toolName}. The approval token has been invalidated.`,
|
|
217
|
+
}, null, 2),
|
|
218
|
+
}],
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=registry.js.map
|