@jbctechsolutions/mcp-office365 2.5.1 → 3.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 +32 -0
- package/dist/approval/token-manager.d.ts +28 -16
- package/dist/approval/token-manager.d.ts.map +1 -1
- package/dist/approval/token-manager.js +125 -37
- package/dist/approval/token-manager.js.map +1 -1
- package/dist/cli.d.ts +17 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +85 -2
- package/dist/cli.js.map +1 -1
- 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 +5 -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/token-cache.js +2 -2
- package/dist/graph/auth/token-cache.js.map +1 -1
- package/dist/graph/client/graph-client.d.ts +36 -8
- package/dist/graph/client/graph-client.d.ts.map +1 -1
- package/dist/graph/client/graph-client.js +128 -36
- package/dist/graph/client/graph-client.js.map +1 -1
- package/dist/graph/repository.d.ts +9 -6
- package/dist/graph/repository.d.ts.map +1 -1
- package/dist/graph/repository.js +63 -66
- 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/resolver.d.ts +30 -0
- package/dist/ids/resolver.d.ts.map +1 -0
- package/dist/ids/resolver.js +37 -0
- package/dist/ids/resolver.js.map +1 -0
- package/dist/ids/token.d.ts +56 -0
- package/dist/ids/token.d.ts.map +1 -0
- package/dist/ids/token.js +186 -0
- package/dist/ids/token.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +226 -5859
- package/dist/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 +64 -0
- package/dist/registry/all-tools.js.map +1 -0
- package/dist/registry/context.d.ts +25 -0
- package/dist/registry/context.d.ts.map +1 -0
- package/dist/registry/context.js +31 -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/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 +62 -0
- package/dist/registry/registry.d.ts.map +1 -0
- package/dist/registry/registry.js +134 -0
- package/dist/registry/registry.js.map +1 -0
- package/dist/registry/types.d.ts +98 -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/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 +27 -0
- package/dist/state/schema.d.ts.map +1 -0
- package/dist/state/schema.js +54 -0
- package/dist/state/schema.js.map +1 -0
- package/dist/state/store.d.ts +152 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/store.js +317 -0
- package/dist/state/store.js.map +1 -0
- package/dist/tools/accounts.d.ts +37 -0
- package/dist/tools/accounts.d.ts.map +1 -0
- package/dist/tools/accounts.js +68 -0
- package/dist/tools/accounts.js.map +1 -0
- package/dist/tools/calendar-apple.d.ts +39 -0
- package/dist/tools/calendar-apple.d.ts.map +1 -0
- package/dist/tools/calendar-apple.js +159 -0
- package/dist/tools/calendar-apple.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 +298 -0
- package/dist/tools/calendar-graph.js.map +1 -0
- package/dist/tools/calendar-permissions.d.ts +10 -0
- package/dist/tools/calendar-permissions.d.ts.map +1 -1
- package/dist/tools/calendar-permissions.js +53 -0
- package/dist/tools/calendar-permissions.js.map +1 -1
- package/dist/tools/calendar.d.ts +151 -0
- package/dist/tools/calendar.d.ts.map +1 -1
- package/dist/tools/calendar.js +274 -0
- package/dist/tools/calendar.js.map +1 -1
- package/dist/tools/categories.d.ts +10 -0
- package/dist/tools/categories.d.ts.map +1 -1
- package/dist/tools/categories.js +54 -0
- package/dist/tools/categories.js.map +1 -1
- package/dist/tools/checklist-items.d.ts +10 -0
- package/dist/tools/checklist-items.d.ts.map +1 -1
- package/dist/tools/checklist-items.js +63 -0
- 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 +133 -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 +172 -0
- package/dist/tools/contacts-graph.js.map +1 -0
- package/dist/tools/contacts.d.ts +66 -0
- package/dist/tools/contacts.d.ts.map +1 -1
- package/dist/tools/contacts.js +165 -0
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/excel.d.ts +10 -0
- package/dist/tools/excel.d.ts.map +1 -1
- package/dist/tools/excel.js +73 -0
- package/dist/tools/excel.js.map +1 -1
- package/dist/tools/focused-overrides.d.ts +10 -0
- package/dist/tools/focused-overrides.d.ts.map +1 -1
- package/dist/tools/focused-overrides.js +54 -0
- package/dist/tools/focused-overrides.js.map +1 -1
- package/dist/tools/linked-resources.d.ts +10 -0
- package/dist/tools/linked-resources.d.ts.map +1 -1
- package/dist/tools/linked-resources.js +53 -0
- package/dist/tools/linked-resources.js.map +1 -1
- package/dist/tools/mail-apple.d.ts +40 -0
- package/dist/tools/mail-apple.d.ts.map +1 -0
- package/dist/tools/mail-apple.js +146 -0
- package/dist/tools/mail-apple.js.map +1 -0
- 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 +178 -0
- package/dist/tools/mail-graph.js.map +1 -0
- package/dist/tools/mail-rules.d.ts +12 -0
- package/dist/tools/mail-rules.d.ts.map +1 -1
- package/dist/tools/mail-rules.js +56 -0
- package/dist/tools/mail-rules.js.map +1 -1
- package/dist/tools/mail-send.d.ts +12 -0
- package/dist/tools/mail-send.d.ts.map +1 -1
- package/dist/tools/mail-send.js +219 -5
- package/dist/tools/mail-send.js.map +1 -1
- package/dist/tools/mail.d.ts +82 -2
- package/dist/tools/mail.d.ts.map +1 -1
- package/dist/tools/mail.js +239 -2
- package/dist/tools/mail.js.map +1 -1
- package/dist/tools/mailbox-organization.d.ts +20 -0
- package/dist/tools/mailbox-organization.d.ts.map +1 -1
- package/dist/tools/mailbox-organization.js +275 -0
- 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 +10 -0
- package/dist/tools/meetings.d.ts.map +1 -1
- package/dist/tools/meetings.js +74 -0
- package/dist/tools/meetings.js.map +1 -1
- package/dist/tools/notes.d.ts +12 -0
- package/dist/tools/notes.d.ts.map +1 -1
- package/dist/tools/notes.js +66 -0
- package/dist/tools/notes.js.map +1 -1
- package/dist/tools/onedrive.d.ts +10 -0
- package/dist/tools/onedrive.d.ts.map +1 -1
- package/dist/tools/onedrive.js +124 -0
- package/dist/tools/onedrive.js.map +1 -1
- 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 +10 -0
- package/dist/tools/planner-visualization.d.ts.map +1 -1
- package/dist/tools/planner-visualization.js +53 -0
- package/dist/tools/planner-visualization.js.map +1 -1
- package/dist/tools/planner.d.ts +10 -0
- package/dist/tools/planner.d.ts.map +1 -1
- package/dist/tools/planner.js +183 -0
- 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/sharepoint.d.ts +10 -0
- package/dist/tools/sharepoint.d.ts.map +1 -1
- package/dist/tools/sharepoint.js +74 -0
- package/dist/tools/sharepoint.js.map +1 -1
- package/dist/tools/task-attachments.d.ts +10 -0
- package/dist/tools/task-attachments.d.ts.map +1 -1
- package/dist/tools/task-attachments.js +53 -0
- 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 +151 -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 +191 -0
- package/dist/tools/tasks-graph.js.map +1 -0
- package/dist/tools/tasks.d.ts +127 -0
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +155 -0
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/teams.d.ts +11 -0
- package/dist/tools/teams.d.ts.map +1 -1
- package/dist/tools/teams.js +254 -0
- package/dist/tools/teams.js.map +1 -1
- package/dist/utils/errors.d.ts +96 -5
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +227 -8
- package/dist/utils/errors.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
* Universal durable-ID resolver (U5 / D1, D2, D4, D7). Turns any ID a tool
|
|
7
|
+
* receives — a self-encoding token, an alias-backed token, a raw Graph ID, or a
|
|
8
|
+
* legacy numeric ID — into a live Graph ID, or a typed error.
|
|
9
|
+
*
|
|
10
|
+
* - self-encoding token → decode, zero storage (cold-state durable).
|
|
11
|
+
* - alias-backed token → alias table lookup (account-scoped). A cold/foreign
|
|
12
|
+
* miss is distinguished: ID_FOREIGN_ACCOUNT vs ID_UNKNOWN.
|
|
13
|
+
* - numeric (v2 hash) → NUMERIC_ID_UNSUPPORTED on Graph (lossy, D4).
|
|
14
|
+
* - raw non-token string → passed through as an opaque Graph ID (a user may
|
|
15
|
+
* paste a real Graph ID; Graph IDs are opaque, so rejecting them would be
|
|
16
|
+
* hostile). Mutation of state lives in the alias table, not here.
|
|
17
|
+
*/
|
|
18
|
+
import type { StateStore } from '../state/store.js';
|
|
19
|
+
/** A resolved Graph ID plus whether it came from a mutable (drift-prone) alias. */
|
|
20
|
+
export interface ResolvedId {
|
|
21
|
+
graphId: string;
|
|
22
|
+
/** True for `$search`-minted mutable alias rows that may need re-resolution. */
|
|
23
|
+
mutable: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Resolves an ID parameter to a Graph ID for the given signed-in account.
|
|
27
|
+
* Throws a typed {@link import('../utils/errors.js').OutlookMcpError} on failure.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveId(id: string | number, accountId: string, store: StateStore): ResolvedId;
|
|
30
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/ids/resolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQpD,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,GAChB,UAAU,CA6BZ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
5
|
+
import { IdForeignAccountError, IdUnknownError, NumericIdUnsupportedError, } from '../utils/errors.js';
|
|
6
|
+
import { parseToken } from './token.js';
|
|
7
|
+
/**
|
|
8
|
+
* Resolves an ID parameter to a Graph ID for the given signed-in account.
|
|
9
|
+
* Throws a typed {@link import('../utils/errors.js').OutlookMcpError} on failure.
|
|
10
|
+
*/
|
|
11
|
+
export function resolveId(id, accountId, store) {
|
|
12
|
+
if (typeof id === 'number') {
|
|
13
|
+
throw new NumericIdUnsupportedError(id);
|
|
14
|
+
}
|
|
15
|
+
const parsed = parseToken(id);
|
|
16
|
+
if (parsed === null) {
|
|
17
|
+
// Not a known token — treat as an opaque Graph ID the caller supplied.
|
|
18
|
+
return { graphId: id, mutable: false };
|
|
19
|
+
}
|
|
20
|
+
if (parsed.kind === 'self') {
|
|
21
|
+
// graphId is always present for a self-encoding parse.
|
|
22
|
+
return { graphId: parsed.graphId, mutable: false };
|
|
23
|
+
}
|
|
24
|
+
// Alias-backed: resolve against the store, scoped to the account.
|
|
25
|
+
const row = store.getAlias(id, accountId);
|
|
26
|
+
if (row !== null) {
|
|
27
|
+
return { graphId: row.graphId, mutable: row.mutable };
|
|
28
|
+
}
|
|
29
|
+
// Miss — distinguish a foreign-account token from a genuinely unknown one so
|
|
30
|
+
// the agent gets an actionable message (D7).
|
|
31
|
+
const owner = store.getAliasAccount(id);
|
|
32
|
+
if (owner !== null && owner !== accountId) {
|
|
33
|
+
throw new IdForeignAccountError(id);
|
|
34
|
+
}
|
|
35
|
+
throw new IdUnknownError(id);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=resolver.js.map
|
|
@@ -0,0 +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,EAAE,MAAM,YAAY,CAAC;AASxC;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,EAAmB,EACnB,SAAiB,EACjB,KAAiB;IAEjB,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAC3B,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,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3B,uDAAuD;QACvD,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC/D,CAAC;IAED,kEAAkE;IAClE,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC1C,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;IACxD,CAAC;IAED,6EAA6E;IAC7E,6CAA6C;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACxC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,MAAM,IAAI,qBAAqB,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,MAAM,IAAI,cAAc,CAAC,EAAE,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 JBC Tech Solutions, LLC
|
|
3
|
+
* Licensed under the MIT License. See LICENSE file in the project root.
|
|
4
|
+
*/
|
|
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';
|
|
7
|
+
/** How a token encodes its target. */
|
|
8
|
+
export type TokenKind = 'self' | 'alias';
|
|
9
|
+
/**
|
|
10
|
+
* Prefix → entity maps are NULL-PROTOTYPE so a caller-supplied prefix like
|
|
11
|
+
* `constructor` or `toString` (from an arbitrary ID string) can never match an
|
|
12
|
+
* inherited `Object.prototype` member and get misclassified as a known token —
|
|
13
|
+
* `parseToken` must return null for those and let the resolver pass them through
|
|
14
|
+
* as opaque Graph IDs.
|
|
15
|
+
*/
|
|
16
|
+
/** Self-encoding prefixes → entity type (the token carries the Graph ID). */
|
|
17
|
+
export declare const SELF_ENCODING_PREFIXES: Readonly<Record<string, EntityType>>;
|
|
18
|
+
/** Alias-backed prefixes → entity type (the token is a digest; needs the store). */
|
|
19
|
+
export declare const ALIAS_PREFIXES: Readonly<Record<string, EntityType>>;
|
|
20
|
+
/** A parsed durable-ID token. */
|
|
21
|
+
export interface ParsedToken {
|
|
22
|
+
prefix: string;
|
|
23
|
+
kind: TokenKind;
|
|
24
|
+
entityType: EntityType;
|
|
25
|
+
/** For self-encoding tokens: the decoded Graph ID. Absent for alias tokens. */
|
|
26
|
+
graphId?: string;
|
|
27
|
+
}
|
|
28
|
+
/** True when a prefix is a known self-encoding or alias prefix. */
|
|
29
|
+
export declare function isKnownPrefix(prefix: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Mints a self-encoding token carrying the immutable Graph ID (D1). Deterministic.
|
|
32
|
+
*/
|
|
33
|
+
export declare function mintSelfEncoded(entityType: EntityType, graphId: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Mints a short, deterministic alias-backed token from an entity's canonical
|
|
36
|
+
* key (D1). The caller stores the token → key mapping in the alias table.
|
|
37
|
+
*/
|
|
38
|
+
export declare function mintComposite(entityType: EntityType, canonicalKey: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Builds a canonical key for a composite entity from its identifying tuple.
|
|
41
|
+
* Keys are sorted so field order never changes the digest. Keys and values are
|
|
42
|
+
* percent-encoded so a value containing the `&`/`=` delimiters (Graph IDs are
|
|
43
|
+
* base64-ish and can) cannot forge a boundary and make two distinct tuples
|
|
44
|
+
* produce the same key — which would collide their tokens without a hash
|
|
45
|
+
* collision.
|
|
46
|
+
*/
|
|
47
|
+
export declare function canonicalKey(entityType: EntityType, parts: Readonly<Record<string, string>>): string;
|
|
48
|
+
/**
|
|
49
|
+
* Parses a token into its prefix/kind/entity (and decoded Graph ID for
|
|
50
|
+
* self-encoding tokens). Returns null when the value is not a well-formed known
|
|
51
|
+
* token — the caller decides whether to treat that as a raw Graph ID or reject.
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseToken(token: string): ParsedToken | null;
|
|
54
|
+
/** True when a string looks like a durable-ID token (known prefix + payload). */
|
|
55
|
+
export declare function isToken(value: string): boolean;
|
|
56
|
+
//# sourceMappingURL=token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/ids/token.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,OAAO,GACP,SAAS,GACT,QAAQ,GACR,WAAW,GACX,MAAM,GACN,MAAM,GACN,aAAa,GACb,MAAM,GACN,MAAM,GACN,YAAY,GACZ,SAAS,GACT,aAAa,GACb,eAAe,CAAC;AAEpB,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,CAUvE,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAY/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;;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"}
|
|
@@ -0,0 +1,186 @@
|
|
|
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
|
+
* Durable-ID tokens (U5 / D1). Two shapes:
|
|
7
|
+
*
|
|
8
|
+
* - **Self-encoding** (`em_`, `ev_`, `ct_`, `fd_`, `dr_`, `td_`): the token
|
|
9
|
+
* carries the immutable Graph ID directly — `<prefix>_<base64url(graphId)>`.
|
|
10
|
+
* Resolution is a decode with zero storage, so it survives a cold/lost
|
|
11
|
+
* `state.db` and resolves on any machine (the core cold-state fix).
|
|
12
|
+
*
|
|
13
|
+
* - **Alias-backed** (`pl_`, `pt_`, `ch_`, `tm_`, `at_`, composite tuples): the
|
|
14
|
+
* token is a short deterministic digest of the entity's canonical key —
|
|
15
|
+
* `<prefix>_<base32(sha256(canonicalKey))[0..13]>` (70 bits) — backed by the
|
|
16
|
+
* alias table (D3). These are machine-scoped: a cold store yields `ID_UNKNOWN`.
|
|
17
|
+
*
|
|
18
|
+
* Determinism is a hard requirement: the same Graph ID / canonical key always
|
|
19
|
+
* mints a byte-identical token.
|
|
20
|
+
*/
|
|
21
|
+
import { createHash } from 'node:crypto';
|
|
22
|
+
/**
|
|
23
|
+
* Prefix → entity maps are NULL-PROTOTYPE so a caller-supplied prefix like
|
|
24
|
+
* `constructor` or `toString` (from an arbitrary ID string) can never match an
|
|
25
|
+
* inherited `Object.prototype` member and get misclassified as a known token —
|
|
26
|
+
* `parseToken` must return null for those and let the resolver pass them through
|
|
27
|
+
* as opaque Graph IDs.
|
|
28
|
+
*/
|
|
29
|
+
/** Self-encoding prefixes → entity type (the token carries the Graph ID). */
|
|
30
|
+
export const SELF_ENCODING_PREFIXES = Object.assign(Object.create(null), {
|
|
31
|
+
em: 'message',
|
|
32
|
+
ev: 'event',
|
|
33
|
+
ct: 'contact',
|
|
34
|
+
fd: 'folder',
|
|
35
|
+
dr: 'driveItem',
|
|
36
|
+
td: 'task',
|
|
37
|
+
});
|
|
38
|
+
/** Alias-backed prefixes → entity type (the token is a digest; needs the store). */
|
|
39
|
+
export const ALIAS_PREFIXES = Object.assign(Object.create(null), {
|
|
40
|
+
pl: 'plan',
|
|
41
|
+
pt: 'plannerTask',
|
|
42
|
+
ch: 'chat',
|
|
43
|
+
tm: 'team',
|
|
44
|
+
at: 'attachment',
|
|
45
|
+
cn: 'channel',
|
|
46
|
+
cm: 'chatMessage',
|
|
47
|
+
ci: 'checklistItem',
|
|
48
|
+
});
|
|
49
|
+
const ENTITY_TO_PREFIX = buildReverse();
|
|
50
|
+
function buildReverse() {
|
|
51
|
+
const out = Object.create(null);
|
|
52
|
+
for (const [prefix, entity] of Object.entries(SELF_ENCODING_PREFIXES)) {
|
|
53
|
+
out[entity] = prefix;
|
|
54
|
+
}
|
|
55
|
+
for (const [prefix, entity] of Object.entries(ALIAS_PREFIXES)) {
|
|
56
|
+
out[entity] = prefix;
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
/** Crockford-free RFC 4648 base32 alphabet (lowercase for compact tokens). */
|
|
61
|
+
const BASE32_ALPHABET = 'abcdefghijklmnopqrstuvwxyz234567';
|
|
62
|
+
/** 14 base32 chars × 5 bits = 70 bits of the sha256 digest (D1). */
|
|
63
|
+
const COMPOSITE_DIGEST_CHARS = 14;
|
|
64
|
+
/** True when a prefix is a known self-encoding or alias prefix. */
|
|
65
|
+
export function isKnownPrefix(prefix) {
|
|
66
|
+
return prefix in SELF_ENCODING_PREFIXES || prefix in ALIAS_PREFIXES;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Mints a self-encoding token carrying the immutable Graph ID (D1). Deterministic.
|
|
70
|
+
*/
|
|
71
|
+
export function mintSelfEncoded(entityType, graphId) {
|
|
72
|
+
const prefix = ENTITY_TO_PREFIX[entityType];
|
|
73
|
+
if (prefix == null || !(prefix in SELF_ENCODING_PREFIXES)) {
|
|
74
|
+
throw new Error(`Entity type "${entityType}" is not self-encoding.`);
|
|
75
|
+
}
|
|
76
|
+
if (graphId.length === 0) {
|
|
77
|
+
// An empty ID would encode to `<prefix>_` (empty payload), which parseToken
|
|
78
|
+
// rejects — the token would then be mis-handled as a raw Graph ID. Fail fast.
|
|
79
|
+
throw new Error('Cannot mint a self-encoding token for an empty Graph ID.');
|
|
80
|
+
}
|
|
81
|
+
return `${prefix}_${Buffer.from(graphId, 'utf8').toString('base64url')}`;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Mints a short, deterministic alias-backed token from an entity's canonical
|
|
85
|
+
* key (D1). The caller stores the token → key mapping in the alias table.
|
|
86
|
+
*/
|
|
87
|
+
export function mintComposite(entityType, canonicalKey) {
|
|
88
|
+
const prefix = ENTITY_TO_PREFIX[entityType];
|
|
89
|
+
if (prefix == null || !(prefix in ALIAS_PREFIXES)) {
|
|
90
|
+
throw new Error(`Entity type "${entityType}" is not alias-backed.`);
|
|
91
|
+
}
|
|
92
|
+
return `${prefix}_${base32Digest(canonicalKey)}`;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Builds a canonical key for a composite entity from its identifying tuple.
|
|
96
|
+
* Keys are sorted so field order never changes the digest. Keys and values are
|
|
97
|
+
* percent-encoded so a value containing the `&`/`=` delimiters (Graph IDs are
|
|
98
|
+
* base64-ish and can) cannot forge a boundary and make two distinct tuples
|
|
99
|
+
* produce the same key — which would collide their tokens without a hash
|
|
100
|
+
* collision.
|
|
101
|
+
*/
|
|
102
|
+
export function canonicalKey(entityType, parts) {
|
|
103
|
+
const sorted = Object.keys(parts)
|
|
104
|
+
.sort()
|
|
105
|
+
.map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(parts[k] ?? '')}`)
|
|
106
|
+
.join('&');
|
|
107
|
+
return `${entityType}:${sorted}`;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Parses a token into its prefix/kind/entity (and decoded Graph ID for
|
|
111
|
+
* self-encoding tokens). Returns null when the value is not a well-formed known
|
|
112
|
+
* token — the caller decides whether to treat that as a raw Graph ID or reject.
|
|
113
|
+
*/
|
|
114
|
+
export function parseToken(token) {
|
|
115
|
+
const underscore = token.indexOf('_');
|
|
116
|
+
if (underscore <= 0) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const prefix = token.slice(0, underscore);
|
|
120
|
+
const payload = token.slice(underscore + 1);
|
|
121
|
+
if (payload.length === 0) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
const selfEntity = SELF_ENCODING_PREFIXES[prefix];
|
|
125
|
+
if (selfEntity !== undefined) {
|
|
126
|
+
const graphId = decodeBase64Url(payload);
|
|
127
|
+
if (graphId == null) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return { prefix, kind: 'self', entityType: selfEntity, graphId };
|
|
131
|
+
}
|
|
132
|
+
const aliasEntity = ALIAS_PREFIXES[prefix];
|
|
133
|
+
if (aliasEntity !== undefined) {
|
|
134
|
+
return { prefix, kind: 'alias', entityType: aliasEntity };
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
/** True when a string looks like a durable-ID token (known prefix + payload). */
|
|
139
|
+
export function isToken(value) {
|
|
140
|
+
return parseToken(value) !== null;
|
|
141
|
+
}
|
|
142
|
+
function base32Digest(input) {
|
|
143
|
+
const hash = createHash('sha256').update(input, 'utf8').digest();
|
|
144
|
+
let bits = 0;
|
|
145
|
+
let value = 0;
|
|
146
|
+
let output = '';
|
|
147
|
+
for (const byte of hash) {
|
|
148
|
+
value = (value << 8) | byte;
|
|
149
|
+
bits += 8;
|
|
150
|
+
while (bits >= 5) {
|
|
151
|
+
output += BASE32_ALPHABET[(value >>> (bits - 5)) & 0x1f];
|
|
152
|
+
bits -= 5;
|
|
153
|
+
if (output.length === COMPOSITE_DIGEST_CHARS) {
|
|
154
|
+
return output;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return output;
|
|
159
|
+
}
|
|
160
|
+
function decodeBase64Url(payload) {
|
|
161
|
+
// base64url is [A-Za-z0-9_-]; reject anything else so a stray alias-shaped
|
|
162
|
+
// string isn't silently decoded into garbage.
|
|
163
|
+
if (!/^[A-Za-z0-9_-]+$/.test(payload)) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
let decoded;
|
|
167
|
+
try {
|
|
168
|
+
decoded = Buffer.from(payload, 'base64url').toString('utf8');
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
if (decoded.length === 0) {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
// Reject NON-CANONICAL encodings: Buffer's base64url decode is lenient (em_QQ,
|
|
177
|
+
// em_QR, em_QS all decode to "A"), which would give one Graph ID many valid
|
|
178
|
+
// token strings. Requiring the payload to be the exact canonical encoding of
|
|
179
|
+
// the decoded bytes means one Graph ID ↔ exactly one token string, so a later
|
|
180
|
+
// unit keying a control on the token string can't be evaded by a variant.
|
|
181
|
+
if (Buffer.from(decoded, 'utf8').toString('base64url') !== payload) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
return decoded;
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/ids/token.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH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ACd,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,+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
|
@@ -14,8 +14,14 @@
|
|
|
14
14
|
* - Set USE_APPLESCRIPT=1 to use legacy AppleScript backend (macOS + classic Outlook only)
|
|
15
15
|
*/
|
|
16
16
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
17
|
+
import type { SurfaceOptions } from './registry/index.js';
|
|
17
18
|
/**
|
|
18
19
|
* Creates and configures the MCP server.
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
/** Options controlling the exposed tool surface (preset / read-only filters). */
|
|
22
|
+
export interface ServerOptions {
|
|
23
|
+
readonly presets?: SurfaceOptions['presets'];
|
|
24
|
+
readonly readOnly?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function createServer(options?: ServerOptions): Server;
|
|
21
27
|
//# 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;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AACH;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAgCnE,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA0FvE;;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;CAC7B;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CA+ShE"}
|